yurong/unpackage/dist/dev/mp-weixin/pages/tabbar/shop.js

2 lines
5.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/tabbar/shop"],{100:function(t,n,o){"use strict";var e;o.r(n),o.d(n,"render",(function(){return i})),o.d(n,"staticRenderFns",(function(){return r})),o.d(n,"recyclableRender",(function(){return s})),o.d(n,"components",(function(){return e}));try{e={uniNavBar:function(){return o.e("uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar").then(o.bind(null,357))},lxcCountStyle:function(){return o.e("components/lxc-count-style/lxc-count-style").then(o.bind(null,364))}}}catch(c){if(-1===c.message.indexOf("Cannot find module")||-1===c.message.indexOf(".vue"))throw c;console.error(c.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范文档https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var i=function(){var t=this,n=t.$createElement,o=(t._self._c,t.list.length),e=t.list.length,i=e>0?t.__map(t.list,(function(n,o){var e=t.__get_orig(n),i=t.$tools.oss(n.image);return{$orig:e,g2:i}})):null;t.$mp.data=Object.assign({},{$root:{g0:o,g1:e,l0:i}})},s=!1,r=[];i._withStripped=!0},101:function(t,n,o){"use strict";o.r(n);var e=o(102),i=o.n(e);for(var s in e)["default"].indexOf(s)<0&&function(t){o.d(n,t,(function(){return e[t]}))}(s);n["default"]=i.a},102:function(t,n,o){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var e={data:function(){return{min:1,nums:1,list:[],checkAllList:!1,promotionUnlocked:!0,promotionH5Url:"https://point.agrimedia.cn/affiliate-activity/pages/rank/rank"}},onLoad:function(){this.syncPromotionStatus()},onShow:function(){this.syncPromotionStatus(),this.syncCustomTabBar(),this.openPromotionPageIfNeeded()||(0===this.list.length&&this.shopCar(),this.checkAllList=!1)},computed:{totalPrice:function(){var t=this.list.filter((function(t){return t.checkList})),n=0;return t.forEach((function(t){n+=Number(t.price)*Number(t.num)})),n.toFixed(2)}},methods:{syncPromotionStatus:function(){this.promotionUnlocked=this.$tools.getPromotionUnlocked()},syncCustomTabBar:function(){if(this.$tools.setTabbarSelectedPath("/pages/tabbar/shop"),"function"===typeof this.getTabBar){var t=this.getTabBar();t&&"function"===typeof t.syncPromotionStatus&&setTimeout((function(){t.syncPromotionStatus("/pages/tabbar/shop")}),0)}},openPromotionPageIfNeeded:function(){return!this.promotionUnlocked&&(!this.$tools.consumePromotionBridgeSkip("/pages/tabbar/shop")&&(this.$tools.goNext("/pages/h5/bridge?url=".concat(encodeURIComponent(this.promotionH5Url),"&from=").concat(encodeURIComponent("/pages/tabbar/shop"))),!0))},shopCar:function(){var t=this;this.$tools.axiosFromToken("POST","shop/shopCar").then((function(n){n.data.forEach((function(t){t.checkList=!1})),t.list=n.data}))},checkAll:function(){this.checkAllList=!this.checkAllList,this.checkAllList?this.list.forEach((function(t){t.checkList=!0})):this.list.forEach((function(t){t.checkList=!1})),this.$forceUpdate()},checkItem:function(t,n){t.checkList=!t.checkList,this.checkAllList=this.list.every((function(t){return t.checkList})),this.$forceUpdate()},handleCount:function(t,n,o){var e=this;this.$tools.axiosFromToken("POST","shop/editCar",{id:n.id,num:t}).then((function(n){e.$tools.showtt(n.msg),1==n.code&&(e.list[o].num=t,0==t&&(e.list.splice(o,1),e.$tools.showtt("删除成功")))}))},cardelete:function(){var t=this;if(0==this.list.length)return this.$tools.showtt("购物车暂无商品");var n=[];if(this.list.forEach((function(t){t.checkList&&n.push(t.id)})),0==n.length)return this.$tools.showtt("请选择要删除的商品");this.$tools.axiosFrom("POST","shop/deleteCar",{ids:n.join(",")}).then((function(n){t.$tools.showtt(n.msg),1==n.code&&(t.shopCar(),t.checkAllList=!1)}))},cartOrderCreate:function(){if(0==this.list.length)return this.$tools.showtt("购物车暂无商品");var t=[],n=[];if(this.list.forEach((function(o){o.checkList&&(t.push(o),n.push(o.id))})),0==t.length)return this.$tools.showtt("请选择要结算的商品");getApp().globalData.shoppings=t,this.$tools.goNext("/pageOne/shopConfirm?id=".concat(n.join(",")))}}};n.default=e},103:function(t,n,o){"use strict";o.r(n);var e=o(104),i=o.n(e);for(var s in e)["default"].indexOf(s)<0&&function(t){o.d(n,t,(function(){return e[t]}))}(s);n["default"]=i.a},104:function(t,n,o){},97:function(t,n,o){"use strict";(function(t,n){var e=o(4);o(26);e(o(25));var i=e(o(98));t.__webpack_require_UNI_MP_PLUGIN__=o,n(i.default)}).call(this,o(1)["default"],o(2)["createPage"])},98:function(t,n,o){"use strict";o.r(n);var e=o(99),i=o(101);for(var s in i)["default"].indexOf(s)<0&&function(t){o.d(n,t,(function(){return i[t]}))}(s);o(103);var r,c=o(32),a=Object(c["default"])(i["default"],e["render"],e["staticRenderFns"],!1,null,null,null,!1,e["components"],r);a.options.__file="pages/tabbar/shop.vue",n["default"]=a.exports},99:function(t,n,o){"use strict";o.r(n);var e=o(100);o.d(n,"render",(function(){return e["render"]})),o.d(n,"staticRenderFns",(function(){return e["staticRenderFns"]})),o.d(n,"recyclableRender",(function(){return e["recyclableRender"]})),o.d(n,"components",(function(){return e["components"]}))}},[[97,"common/runtime","common/vendor"]]]);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/tabbar/shop.js.map