1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugins/mch/shop/shop"],{"1ad3":function(t,e,i){"use strict";var o,a=function(){var t=this,e=t.$createElement;t._self._c},n=[];i.d(e,"b",(function(){return a})),i.d(e,"c",(function(){return n})),i.d(e,"a",(function(){return o}))},"1f6a":function(t,e,i){"use strict";(function(t){i("8748");o(i("66fd"));var e=o(i("2308"));function o(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,i("543d")["createPage"])},2308:function(t,e,i){"use strict";i.r(e);var o=i("1ad3"),a=i("a89f");for(var n in a)"default"!==n&&function(t){i.d(e,t,(function(){return a[t]}))}(n);i("f71e");var s,r=i("f0c5"),c=Object(r["a"])(a["default"],o["b"],o["c"],!1,null,"7d25fb87",null,!1,o["a"],s);e["default"]=c.exports},a89f:function(t,e,i){"use strict";i.r(e);var o=i("b149"),a=i.n(o);for(var n in o)"default"!==n&&function(t){i.d(e,t,(function(){return o[t]}))}(n);e["default"]=a.a},ae7c:function(t,e,i){},b149:function(t,e,i){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=i("2f62");function a(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,o)}return i}function n(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?a(Object(i),!0).forEach((function(e){s(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):a(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function s(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var r=function(){Promise.all([i.e("common/vendor"),i.e("components/page-component/app-goods-list/app-goods-list")]).then(function(){return resolve(i("e27d"))}.bind(null,i)).catch(i.oe)},c={name:"shop",components:{appGoodsList:r},computed:n({},(0,o.mapState)({userInfo:function(t){return t.user.info}})),data:function(){return{mch_id:-1,sort:1,cat_id:0,sort_type:0,page:1,load:!1,args:!1,is_service:0,detail:null,mch_setting:null,tab:2,shopKf:!1,coupon_list:[],goods_list:[],fixed:!1,order_preview:this.$api.mch.order_preview,order_submit:this.$api.mch.order_submit}},onLoad:function(t){this.$store.dispatch("user/info"),this.mch_id=t.mch_id,this.cat_id=t.cat_id?t.cat_id:0,this.loadShop(),this.getGoods(),this.getOption(),this.addVisit()},onReachBottom:function(){var t=this;if(!t.args&&!t.load){t.load=!0;var e=t.page+1;t.$request({url:t.$api.mch.goods,data:{page:e,mch_id:t.mch_id,sort:t.sort,sort_type:t.sort_type,mch_status:2,cat_id:t.cat_id}}).then((function(i){if(0===i.code){var o;o=5===t.sort?t.formatList(t.goods_list,i.data.list):t.goods_list.concat(i.data.list);var a=[e,0===i.data.list.length,o];t.page=a[0],t.args=a[1],t.goods_list=a[2]}t.load=!1}))}},onShareAppMessage:function(){return this.$shareAppMessage({title:this.detail.store.name,path:"/plugins/mch/shop/shop",params:{mch_id:this.mch_id}})},methods:{goodsSearch:function(){t.navigateTo({url:"/pages/search/search?mch_id="+this.mch_id})},navCat:function(){t.navigateTo({url:"/plugins/mch/cat/cat?mch_id="+this.mch_id})},navigateSummary:function(){t.navigateTo({url:"/plugins/mch/summary/summary?mch_id="+this.mch_id})},navigateCs:function(){t.navigateTo({url:"/pages/web/web?url="+this.mch_setting.web_service_url})},getOption:function(){var t=this;t.$request({url:t.$api.mch.setting}).then((function(e){0===e.code&&(t.is_service=e.data.setting.is_service)}))},loadShop:function(){var e=this;e.$showLoading(),e.$request({url:e.$api.mch.detail,data:{id:e.mch_id}}).then((function(i){if(e.$hideLoading(),0===i.code){var o=[i.data.detail,i.data.mchSetting];e.detail=o[0],e.mch_setting=o[1],t.setNavigationBarTitle({title:e.detail.store.name})}})).catch((function(t){e.$hideLoading()}))},addVisit:function(){var t=this;t.$request({url:t.$api.mch.visit,method:"POST",data:{mch_id:t.mch_id}}).then((function(t){}))},getGoods:function(){var t=this;t.$showLoading(),t.$request({url:t.$api.mch.goods,data:{page:1,mch_id:t.mch_id,sort:t.sort,sort_type:t.sort_type,mch_status:2,cat_id:t.cat_id}}).then((function(e){t.$hideLoading(),0===e.code&&(t.goods_list=e.data.list)})).catch((function(e){t.$hideLoading()}))},changeStyle:function(t){var e=this.sort;3===e&&3===t&&(this.sort_type=this.sort_type?0:1);var i=[t,[],1,!1,0];this.sort=i[0],this.goods_list=i[1],this.page=i[2],this.args=i[3],this.cat_id=i[4],this.getGoods()},tabChange:function(t){var e=[t,t,1,!1,0];this.sort=e[0],this.tab=e[1],this.page=e[2],this.args=e[3],this.cat_id=e[4],this.getGoods()},delonPageScroll:function(t){var e=102;2==this.tab&&(e=160),this.fixed=t.scrollTop>=e},copyInfo:function(){t.setClipboardData({data:this.detail.wechat,success:function(){}})},callPhone:function(){t.makePhoneCall({phoneNumber:this.detail.store.mobile})},openKfModal:function(){this.shopKf=!0},closeKfModal:function(){this.shopKf=!1},formatList:function(t,e){if(!e.length)return odlArray;var i,o,a=t.pop(),n=e.shift();return a.label===n.label?(a.goods_list=a.goods_list.concat(n.goods_list),o=a):(t=t.concat(a),o=n),i=t.concat(o),i=i.concat(e),i}}};e.default=c}).call(this,i("543d")["default"])},f71e:function(t,e,i){"use strict";var o=i("ae7c"),a=i.n(o);a.a}},[["1f6a","common/runtime","common/vendor"]]]);
|