app-goods-list.js 7.7 KB

12345678910
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/page-component/app-goods-list/app-goods-list"],{"34d7":function(t,e,i){"use strict";var n;i.d(e,"b",(function(){return r})),i.d(e,"c",(function(){return o})),i.d(e,"a",(function(){return n}));var r=function(){var t=this,e=t.$createElement;t._self._c},o=[]},6825:function(t,e,i){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=s(i("a34a")),r=i("2f62"),o=s(i("6fd3"));function s(t){return t&&t.__esModule?t:{default:t}}function a(t,e,i,n,r,o,s){try{var a=t[o](s),u=a.value}catch(c){return void i(c)}a.done?e(u):Promise.resolve(u).then(n,r)}function u(t){return function(){var e=this,i=arguments;return new Promise((function(n,r){var o=t.apply(e,i);function s(t){a(o,n,r,s,u,"next",t)}function u(t){a(o,n,r,s,u,"throw",t)}s(void 0)}))}}function c(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function p(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?c(Object(i),!0).forEach((function(e){l(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):c(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function l(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var d=function(){i.e("components/page-component/goods/app-price").then(function(){return resolve(i("e82c"))}.bind(null,i)).catch(i.oe)},h=function(){i.e("components/page-component/app-attr/app-attr").then(function(){return resolve(i("58fd"))}.bind(null,i)).catch(i.oe)},f=function(){i.e("components/page-component/app-pt-attr/app-pt-attr").then(function(){return resolve(i("da39"))}.bind(null,i)).catch(i.oe)},g=function(){i.e("components/page-component/app-member-mark/app-member-price").then(function(){return resolve(i("07a4"))}.bind(null,i)).catch(i.oe)},m=function(){i.e("components/page-component/app-sup-vip/app-sup-vip").then(function(){return resolve(i("a8ec"))}.bind(null,i)).catch(i.oe)},_=function(){i.e("components/basic-component/app-iphone-x/app-iphone-x").then(function(){return resolve(i("a339"))}.bind(null,i)).catch(i.oe)},b={name:"app-goods-list",components:{"app-price":d,"app-attr":h,"app-pt-attr":f,"app-member-price":g,"app-sup-vip":m,"app-iphone-x":_},props:{listStyle:{type:String,default:function(){return"2"}},list:Array,previewUrl:String,submitUrl:String,is_show_member:{type:Boolean,default:function(){return!0}}},data:function(){return{show:0,buyText:"立即购买",sign:"",goods_id:"",cartShow:1,plugin:"",goods_list:[],buyBool:!1,cur_index:0,item:null,show_pt:!1,pt:!0,selectAttr:{},appAttr:{},attrGroup:[],selectGroupAttrId:-1}},computed:p(p(p({},(0,r.mapState)({theme:function(t){return t.mallConfig.theme+"-color"},appImg:function(t){return t.mallConfig.__wxapp_img.mall},appSetting:function(t){return t.mallConfig.mall.setting},isShowCart:function(t){return t.mallConfig.mall.setting.is_show_cart},isShowGoodsName:function(t){return t.mallConfig.mall.setting.is_show_goods_name}})),(0,r.mapGetters)("mallConfig",{getVideo:"getVideo"})),{},{listClass:function(){return 3==this.listStyle?"list-style-3 dir-left-wrap":2==this.listStyle?"list-style-2 dir-left-wrap":""}}),watch:{appAttr:{handler:function(t){"none"===t.display&&(this.show_pt=!1)}}},methods:{setGroupAttrID:function(t){this.selectGroupAttrId=t,this.selectAttr={},this.request_pt(t)},multiplayer:function(){if(this.pt){if(this.selectAttr&&0===Object.keys(this.selectAttr).length)t.showToast({title:"请选择规格",icon:"none"});else if(this.selectAttr&&Object.keys(this.selectAttr).length>0){for(var e=this.item.mch_id,i=[],n={id:this.item.id,attr:[],num:this.appAttr.number,goods_attr_id:this.selectAttr.id,cart_id:0},r=0;r<this.selectAttr.attr_list.length;r++){var o={attr_id:this.selectAttr.attr_list[r].attr_id,attr_group_id:this.selectAttr.attr_list[r].attr_group_id};n.attr.push(o)}i.push({mch_id:e,pintuan_order_id:0,pintuan_group_id:this.selectGroupAttrId,goods_list:[n]}),t.navigateTo({url:"/pages/order-submit/order-submit?mch_list=".concat(JSON.stringify(i),"&preview_url=").concat(encodeURIComponent(this.$api.pt.order_preview),"&submit_url=").concat(encodeURIComponent(this.$api.pt.order_submit),"&order_page_url=/plugins/pt/order/order&plugin=pt")})}}else this.selectAttr={},this.pt=!0,this.request_pt(this.selectGroupAttrId)},buyClick:function(t){(0,o.default)(t,this.sign,this,this.goods_list[this.cur_index])},attr:function(t){this.appAttr=t},specification:function(t){var e=this;switch(this.goods_id=t.id,this.sign=t.sign,"pintuan"!=this.sign&&(this.item=t,this.attrGroup=t.attr_groups,this.show=Math.random()),this.sign){case"advance":this.cartShow=0,this.buyText="支付定金",this.buyBool=!0;break;case"booking":this.cartShow=0,this.buyText="立即预约",this.plugin="booking";break;case"pintuan":this.$request({url:this.$api.pt.detail,data:{id:this.goods_id,group_id:0}}).then((function(t){e.item=t.data.detail,e.selectGroupAttrId=e.item.pintuan_groups[0].id,e.attrGroup=e.item.attr_groups,e.show=Math.random(),e.show_pt=!0,e.request_pt(e.selectGroupAttrId)}));break;case"integral_mall":this.cartShow=0,this.buyText="立即兑换";break;case"step":this.cartShow=0,this.buyText="立即兑换";break;case"gift":this.cartShow=0,this.buyBool=!0,this.buyText="加入礼包";break;default:break}},request_pt:function(t){var e=this;return u(n.default.mark((function i(){var r;return n.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,e.$request({url:e.$api.pt.detail,data:{id:e.goods_id,group_id:t}});case 3:r=i.sent,0===r.code&&(e.item=r.data.detail),i.next=10;break;case 7:throw i.prev=7,i.t0=i["catch"](0),new Error(i.t0);case 10:case"end":return i.stop()}}),i,null,[[0,7]])})))()},buy:function(){if(!this.submit())return!1;var e=this.item,i=this.appAttr.number,n=this.selectAttr,r=n.id,o=[];for(var s in n.attr_list)o.push({attr_id:n.attr_list[s].attr_id,attr_group_id:n.attr_list[s].attr_group_id});var a=[],u={mch_id:e.mch_id?e.mch_id:0,goods_list:[]};u.goods_list.push({id:e.id,attr:o,num:i,cat_id:0,goods_attr_id:r}),a.push(u),t.navigateTo({url:"/pages/order-submit/order-submit?mch_list="+JSON.stringify(a)})},individual:function(){this.pt?(this.pt=!1,this.selectAttr={},this.request_pt(0)):0===Object.keys(this.selectAttr).length?t.showToast({title:"请选择规格",icon:"none"}):this.buy()},jump:function(e){e.video_url&&1==this.getVideo?t.navigateTo({url:"/pages/goods/video?goods_id=".concat(e.id,"&sign=").concat(e.sign)}):t.navigateTo({url:e.page_url})},onAttr:function(t){this.selectAttr=t}},created:function(){}};e.default=b}).call(this,i("543d")["default"])},"751a":function(t,e,i){"use strict";i.r(e);var n=i("6825"),r=i.n(n);for(var o in n)"default"!==o&&function(t){i.d(e,t,(function(){return n[t]}))}(o);e["default"]=r.a},a287:function(t,e,i){"use strict";var n=i("dfa3"),r=i.n(n);r.a},cb83:function(t,e,i){"use strict";i.r(e);var n=i("34d7"),r=i("751a");for(var o in r)"default"!==o&&function(t){i.d(e,t,(function(){return r[t]}))}(o);i("a287");var s,a=i("f0c5"),u=Object(a["a"])(r["default"],n["b"],n["c"],!1,null,"06931430",null,!1,n["a"],s);e["default"]=u.exports},dfa3:function(t,e,i){}}]);
  2. ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
  3. 'components/page-component/app-goods-list/app-goods-list-create-component',
  4. {
  5. 'components/page-component/app-goods-list/app-goods-list-create-component':(function(module, exports, __webpack_require__){
  6. __webpack_require__('543d')['createComponent'](__webpack_require__("cb83"))
  7. })
  8. },
  9. [['components/page-component/app-goods-list/app-goods-list-create-component']]
  10. ]);