1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/store/group_buy/index"],{1453:function(t,e,n){"use strict";var a=n("3cb1"),o=n.n(a);o.a},"288c":function(t,e,n){"use strict";n.r(e);var a=n("d19c"),o=n.n(a);for(var r in a)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(r);e["default"]=o.a},"3cb1":function(t,e,n){},"470f":function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){}));var a=function(){var t=this,e=t.$createElement,n=(t._self._c,-1!=t.status?t.plainPartake.length:null),a=-1!=t.status&&n?t.plainPartake.length:null,o=-1!=t.status?t.plainPartake.length:null,r=-1!=t.status?t.collagePartake.length:null,i=-1!=t.status&&r?t.__map(t.collagePartake,(function(e,n){var a=t.__get_orig(e),o=2!=t.status?e.userInfo.uid==t.uid&&e.goods.length:null,r=2!=t.status?e.userInfo.uid==t.uid&&e.goods.length:null,i=2!=t.status?e.userInfo.uid!=t.uid&&e.goods.length:null,c=2!=t.status?e.userInfo.uid==t.uid&&!e.goods.length:null,l=e.goods.length;return{$orig:a,g4:o,g5:r,g6:i,g7:c,g8:l}})):null;t._isMounted||(t.e0=function(e){t.H5ShareBox=!1}),t.$mp.data=Object.assign({},{$root:{g0:n,g1:a,g2:o,g3:r,l0:i}})},o=[]},"832a":function(t,e,n){"use strict";(function(t,e){var a=n("4ea4");n("59a4");a(n("66fd"));var o=a(n("a1ea"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(o.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])},"941e":function(t,e,n){"use strict";var a=n("dda9"),o=n.n(a);o.a},a1ea:function(t,e,n){"use strict";n.r(e);var a=n("470f"),o=n("288c");for(var r in o)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(r);n("941e"),n("1453");var i=n("f0c5"),c=Object(i["a"])(o["default"],a["b"],a["c"],!1,null,"74d242f5",null,!1,a["a"],void 0);e["default"]=c.exports},d19c:function(t,e,n){"use strict";(function(t){var a=n("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=a(n("9523")),r=n("8bb5"),i=n("f8b7"),c=a(n("5c3b")),l=n("26cb"),u=n("865e");function s(t,e){var n="undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return g(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return g(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var a=0,o=function(){};return{s:o,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return i=t.done,t},e:function(t){c=!0,r=t},f:function(){try{i||null==n.return||n.return()}finally{if(c)throw r}}}}function g(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n<e;n++)a[n]=t[n];return a}function f(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function d(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(Object(n),!0).forEach((function(e){(0,o.default)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var h=new Map([["#42ca4d","group-green.png"],["#e93323","group-red.png"],["#1db0fc","group-blue.png"],["#ff448f","group-pink.png"],["#fe5c2d","group-orange.png"],["#e0a558","group-golden.png"]]),p={components:{home:function(){Promise.all([n.e("common/vendor"),n.e("components/home/index")]).then(function(){return resolve(n("377d"))}.bind(null,n)).catch(n.oe)}},mixins:[c.default],data:function(){return{storeInfo:{},delivery_type:2,where:{latitude:0,longitude:0,store_id:0},collage_uid:0,status:null,statusBarHeight:0,navBarHeight:0,collagePartake:[],isShowAuth:!1,imgHost:u.HTTP_REQUEST_URL,statusList:[{name:"完成选购",value:0},{name:"提交订单",value:1},{name:"完成拼单",value:2}],H5ShareBox:!1}},computed:d(d({},(0,l.mapGetters)(["uid","isLogin"])),{},{total:function(){var t=this;return this.collagePartake.reduce((function(e,n){var a=n.sum_price;return t.$util.$h.Add(e,a)}),0)},header:function(){var t=this.colorStyle.split(";"),e={},n="";return t.forEach((function(t){t&&(t=t.split(":"),e[t[0].trim()]=t[1].trim())})),n=h.get(e["--view-theme"].toLocaleLowerCase()),"".concat(u.HTTP_REQUEST_URL,"/statics/images/").concat(n)},plainPartake:function(){var t=this.collagePartake.filter((function(t){return t.goods.length}));return t},canCheckUser:function(){return{status:this.status,collagePartake:this.collagePartake}}}),watch:{canCheckUser:function(t){if(2!=t.status&&t.collagePartake.length){var e,n=!1,a=s(this.collagePartake);try{for(a.s();!(e=a.n()).done;){var o=e.value;if(n=this.uid==o.userInfo.uid,n)break}}catch(r){a.e(r)}finally{a.f()}n||this.$util.Tips({title:"请去个人中心登录"})}}},onLoad:function(e){var n=this;this.collage_id=e.collage_id;var a=t.getMenuButtonBoundingClientRect(),o=a.top,r=a.height;t.getSystemInfo({success:function(t){var e=t.statusBarHeight;n.statusBarHeight=e,n.navBarHeight=2*(o-e)+r}})},onShow:function(){this.isLogin?this.getLocation():toLogin()},methods:{getLocation:function(){var e=this;t.getLocation({type:"gcj02",success:function(e){try{t.setStorageSync("user_latitude",e.latitude),t.setStorageSync("user_longitude",e.longitude)}catch(n){}},fail:function(t){e.$util.Tips({title:t})},complete:function(){e.getCollage(),e.getCollagePartake()}})},onLoadFun:function(){this.isShowAuth=!1,this.getLocation()},authColse:function(t){this.isShowAuth=t},getCollage:function(){var t=this;(0,i.getCollage)({collage_id:this.collage_id}).then((function(e){var n=e.data.collage,a=n.shipping_type,o=n.address_id,r=n.status,i=n.uid,c=n.store_id;t.delivery_type=a,t.address_id=o,t.status=r,t.collage_uid=i,t.where.store_id=c,t.getnearbyStore()}))},getnearbyStore:function(){var e=this;try{this.where.latitude=t.getStorageSync("user_latitude"),this.where.longitude=t.getStorageSync("user_longitude")}catch(n){}(0,r.getnearbyStore)(this.where).then((function(t){e.storeInfo=t.data.info}))},getCollagePartake:function(e){var n=this;e||t.showLoading({title:"加载中"}),(0,i.getCollagePartake)({collage_id:this.collage_id}).then((function(a){if(n.collagePartake=a.data,!e)return t.hideLoading();var o,r=!0,i=s(n.collagePartake);try{for(i.s();!(o=i.n()).done;){var c=o.value;if(!r)break;var l,u=s(c.goods);try{for(u.s();!(l=u.n()).done;){var g=l.value;if(r=g.is_true_stock,!r)break}}catch(f){u.e(f)}finally{u.f()}}}catch(f){i.e(f)}finally{i.f()}if(!r)return n.$util.Tips({title:"存在库存不足的商品,请检查"});e()})).catch((function(){t.hideLoading()}))},onRemove:function(){var t=this;(0,i.emptyCollagePartake)({collage_id:this.collage_id}).then((function(e){t.$util.Tips({title:"清空成功",success:function(){t.getCollagePartake()}})}))},onChange:function(){t.navigateTo({url:"/pages/store/group_cart/index?id=".concat(this.where.store_id,"&collage_id=").concat(this.collage_id,"&delivery_type=").concat(this.delivery_type)})},onCopy:function(t){var e=this;(0,i.duplicateCollagePartake)({collage_id:this.collage_id,c_uid:t}).then((function(t){e.$util.Tips({title:"跟TA选一样成功",success:function(){e.getCollagePartake()}})})).catch((function(t){e.$util.Tips({title:t})}))},onCancel:function(){var t=this;(0,i.cancelCollage)({collage_id:this.collage_id}).then((function(e){t.$util.Tips({title:"取消拼单成功"},{tab:3})}))},onSettle:function(){var e=this;if(!this.plainPartake.length)return this.$util.Tips({title:"暂无人点单"});t.showModal({title:"确定要结算吗?",content:"结算后,其他人无法再加入或修改商品",success:function(n){n.confirm&&(0,i.settleCollage)({collage_id:e.collage_id}).then((function(n){t.navigateTo({url:"/pages/goods/order_confirm/index?new=1&collage_id=".concat(e.collage_id,"&addressId=").concat(e.address_id,"&cartId=").concat(n.data.cartIds,"&delivery_type=").concat(e.delivery_type,"&store_id=").concat(e.where.store_id,"&store_name=").concat(e.storeInfo.name)})})).catch((function(t){e.$util.Tips({title:t})}))}})},goStore:function(){t.reLaunch({url:"/pages/store_cate/store_cate?id=".concat(this.where.store_id)})},goBack:function(){var e=getCurrentPages();e.length>1?t.navigateBack():this.goStore()},refresh:function(){this.getCollage(),this.getCollagePartake()},onShare:function(){this.H5ShareBox=!0}}};e.default=p}).call(this,n("543d")["default"])},dda9:function(t,e,n){}},[["832a","common/runtime","common/vendor"]]]);
|