12 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/goods/goodDetail/goodDetail"],{234:function(e,t,n){"use strict";(function(e,t){var o=n(4);n(26);o(n(25));var r=o(n(235));e.__webpack_require_UNI_MP_PLUGIN__=n,t(r.default)}).call(this,n(1)["default"],n(2)["createPage"])},235:function(e,t,n){"use strict";n.r(t);var o=n(236),r=n(238);for(var s in r)["default"].indexOf(s)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(s);n(240);var a,i=n(32),u=Object(i["default"])(r["default"],o["render"],o["staticRenderFns"],!1,null,"45802466",null,!1,o["components"],a);u.options.__file="pages/goods/goodDetail/goodDetail.vue",t["default"]=u.exports},236:function(e,t,n){"use strict";n.r(t);var o=n(237);n.d(t,"render",(function(){return o["render"]})),n.d(t,"staticRenderFns",(function(){return o["staticRenderFns"]})),n.d(t,"recyclableRender",(function(){return o["recyclableRender"]})),n.d(t,"components",(function(){return o["components"]}))},237:function(e,t,n){"use strict";var o;n.r(t),n.d(t,"render",(function(){return r})),n.d(t,"staticRenderFns",(function(){return a})),n.d(t,"recyclableRender",(function(){return s})),n.d(t,"components",(function(){return o}));try{o={uIcon:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-icon/u-icon")]).then(n.bind(null,288))},uNumberBox:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-number-box/u-number-box")]).then(n.bind(null,321))},uRadioGroup:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-radio-group/u-radio-group")]).then(n.bind(null,329))},uRadio:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-radio/u-radio")]).then(n.bind(null,337))},uButton:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-button/u-button")]).then(n.bind(null,242))},uPopup:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-popup/u-popup")]).then(n.bind(null,345))},"u-Form":function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u--form/u--form")]).then(n.bind(null,268))},uFormItem:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-form-item/u-form-item")]).then(n.bind(null,274))},"u-Input":function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u--input/u--input")]).then(n.bind(null,282))},uToast:function(){return n.e("uni_modules/uview-ui/components/u-toast/u-toast").then(n.bind(null,353))}}}catch(i){if(-1===i.message.indexOf("Cannot find module")||-1===i.message.indexOf(".vue"))throw i;console.error(i.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var r=function(){var e=this,t=e.$createElement,n=(e._self._c,e.list1.length),o=e.businessInfo.spec.length,r=o?e.getSpecName(e.businessInfo.spec):null;e._isMounted||(e.e0=function(t){e.showSpec=!0},e.e1=function(t){e.showAddress=!0}),e.$mp.data=Object.assign({},{$root:{g0:n,g1:o,l0:r}})},s=!1,a=[];r._withStripped=!0},238:function(e,t,n){"use strict";n.r(t);var o=n(239),r=n.n(o);for(var s in o)["default"].indexOf(s)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(s);t["default"]=r.a},239:function(e,t,n){"use strict";(function(e,o){var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=r(n(56)),a=r(n(18)),i=r(n(11)),u=r(n(58)),c=n(175),d=n(165);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var m=function(){n.e("components/specSelect").then(function(){return resolve(n(360))}.bind(null,n)).catch(n.oe)},h={components:{SpecSelect:m},onLoad:function(e){var t=this;this.id=e.id,this.fetchData(e.id);var n=this.result_show;n=n||"",this.getAddressList(-1,0,n),(0,d.getUserInfo)().then((function(e){t.form.companyName=e.data.companyName,t.form.provinceId=e.data.provinceId,t.form.cityId=e.data.cityId,t.form.areaId=e.data.areaId,t.result_show=e.data.provinceName+" "+e.data.cityName+" "+e.data.areaName,t.form.address=e.data.provinceName+" "+e.data.cityName+" "+e.data.areaName,t.form.fullAddress=e.data.companyAddress,t.form.contactsName=e.data.contactsName,t.form.contactsPhone=e.data.contactsPhone})).catch((function(e){}))},data:function(){return{id:"",detailData:{},list1:[],list:[],currentIndex:0,addressList:[],valueIndex:[],result:[],result_show:"",areaCodeId:[],showSpec:!1,showAddress:!1,businessInfo:{spec:[],tradeCount:1,tradeType:"1",expressType:"1",fullAddress:""},rules:{},form:{contactsName:"",contactsPhone:"",address:"",provinceId:"",cityId:"",areaId:"",fullAddress:""},showLocation:!1}},methods:{fetchData:function(e){var t=this;return(0,u.default)(s.default.mark((function n(){var o,r,i,u,d;return s.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r={productId:e},t.list=[],n.next=4,(0,c.getGoodsDetail)(r);case 4:i=n.sent,console.log(i,"result"),t.detailData=i.data,t.list1=i.data.productImages,u=JSON.parse(i.data.productAttr),d=u.map((function(e){return f(f({},e),{},{inputValue:1==e.featureType?"":[]})})),(o=t.list).push.apply(o,(0,a.default)(d));case 11:case"end":return n.stop()}}),n)})))()},swiperChange:function(e){this.currentIndex=e.detail.current},preview:function(){e.previewImage({current:this.list1,urls:this.list1})},changeSelect:function(e){if(!e.length)return this.$refs.uToast.show({type:"default",title:"默认主题",message:"请选择规格"}),void console.log(e,"接收到的数据");console.log(e,"valuevalue"),this.businessInfo.spec=e,this.closeSpec()},getSpecName:function(e){var t=[];return e.forEach((function(e){e.selectData.forEach((function(e){t.push(e.name)}))})),t},closeSpec:function(){this.showSpec=!1},closeAddress:function(){this.showAddress=!1},openAddress:function(){this.showAddress=!0;var e=this.result_show;e=e||"",this.getAddressList(-1,0,e)},submit:function(){this.form.contactsName?this.form.contactsPhone?this.form.address?this.form.fullAddress?this.closeAddress():o.showToast({title:"详细地址不能为空",icon:"none"}):o.showToast({title:"收货地址不能为空",icon:"none"}):o.showToast({title:"收货人手机号不能为空",icon:"none"}):o.showToast({title:"收货人不能为空",icon:"none"})},goOrderOk:function(t){this.businessInfo.spec.length?this.form.address?(console.log(this.businessInfo,this.form),this.confirmSelection(),e.navigateTo({url:"/pages/goods/orderOK/orderOK?id=".concat(t)})):o.showToast({title:"收货地址不能为空",icon:"none"}):o.showToast({title:"请选择规格",icon:"none"})},confirmSelection:function(){var e=getApp();e.globalData.selectedInfo={productImages:this.detailData.productImages[0],productName:this.detailData.productName,productDesc:this.detailData.productDesc,productAttr:this.businessInfo.spec,tradeCount:this.businessInfo.tradeCount,tradeType:this.businessInfo.tradeType,expressType:this.businessInfo.expressType,contactsName:this.form.contactsName,contactsPhone:this.form.contactsPhone,provinceId:this.form.provinceId,cityId:this.form.cityId,areaId:this.form.areaId,receiveAddress:this.form.fullAddress,address:this.form.address}},getAddressList:function(){var e=arguments,t=this;return(0,u.default)(s.default.mark((function n(){var o,r,a,i,u,c,l,f,m,h;return s.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(o=e.length>0&&void 0!==e[0]?e[0]:-1,r=e.length>1&&void 0!==e[1]?e[1]:0,a=e.length>2?e[2]:void 0,i=t.addressList,u=t.valueIndex,c=t.result,t.result_show,l=t.areaCodeId,f=[],m=[],h=[],!(o<=-1)){n.next=11;break}return n.next=10,(0,d.getProvince)().then((function(e){f=e.data,a?(r=e.data.findIndex((function(e){return e.name==a[0]})),r=r>-1?r:0):r=0}));case 10:t.$set(i,0,f);case 11:if(!(o<=0)){n.next=22;break}return u[0]=r,c[0]=i[0][r].name,l[0]=i[0][r].areaCodeId,n.next=18,(0,d.getCity)(i[0][r||0].areaCodeId).then((function(e){m=e.data,a?(r=e.data.findIndex((function(e){return e.name==a[1]})),r=r>-1?r:0):r=0}));case 18:t.$set(i,1,m),t.$set(u,1,r),c[1]=i[1][r].name,l[1]=i[1][r].areaCodeId;case 22:if(!(o<=1)){n.next=32;break}return u[1]=r,c[1]=i[1][r].name,l[1]=i[1][r].areaCodeId,n.next=28,(0,d.getArea)(i[1][r||0].areaCodeId).then((function(e){h=e.data,a?(r=e.data.findIndex((function(e){return e.name==a[2]})),r=r>-1?r:0):r=0}));case 28:t.$set(i,2,h),t.$set(u,2,r),c[2]=i[2][r].name,l[2]=i[2][r].areaCodeId;case 32:o<=-1&&!a&&(c=[],""),t.valueIndex=u;case 34:case"end":return n.stop()}}),n)})))()},changeColumn:function(e){var t=e.detail.column,n=e.detail.value;this.getAddressList(t,n)},changeValue:function(e){var t=this,n=this.valueIndex,o=this.result,r=this.result_show,s=this.areaCodeId;n=e.detail.value,n.forEach((function(e,n){t.addressList[n][e]&&(o[n]=t.addressList[n][e].name,s[n]=t.addressList[n][e].areaCodeId)})),r=o.join(" "),this.result_show=r,this.form.address=r,this.areaCodeId=s,this.form.provinceId=this.areaCodeId[0],this.form.cityId=this.areaCodeId[1],this.form.areaId=this.areaCodeId[2]}}};t.default=h}).call(this,n(2)["default"],n(1)["default"])},240:function(e,t,n){"use strict";n.r(t);var o=n(241),r=n.n(o);for(var s in o)["default"].indexOf(s)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(s);t["default"]=r.a},241:function(e,t,n){}},[[234,"common/runtime","common/vendor"]]]);
- //# sourceMappingURL=../../../../.sourcemap/mp-weixin/pages/goods/goodDetail/goodDetail.js.map
|