导游中台-游客端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

2 lines
7.5 KiB

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["subPackages/daoyou/order"],{86:function(t,e,n){"use strict";(function(t,e){var s=n(4);n(26);s(n(25));var i=s(n(87));t.__webpack_require_UNI_MP_PLUGIN__=n,e(i.default)}).call(this,n(1)["default"],n(2)["createPage"])},87:function(t,e,n){"use strict";n.r(e);var s=n(88),i=n(90);for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);n(95);var c,r=n(32),a=Object(r["default"])(i["default"],s["render"],s["staticRenderFns"],!1,null,"783e881c",null,!1,s["components"],c);a.options.__file="subPackages/daoyou/order.vue",e["default"]=a.exports},88:function(t,e,n){"use strict";n.r(e);var s=n(89);n.d(e,"render",(function(){return s["render"]})),n.d(e,"staticRenderFns",(function(){return s["staticRenderFns"]})),n.d(e,"recyclableRender",(function(){return s["recyclableRender"]})),n.d(e,"components",(function(){return s["components"]}))},89:function(t,e,n){"use strict";var s;n.r(e),n.d(e,"render",(function(){return i})),n.d(e,"staticRenderFns",(function(){return c})),n.d(e,"recyclableRender",(function(){return o})),n.d(e,"components",(function(){return s}));try{s={uniPopup:function(){return n.e("uni_modules/uni-popup/components/uni-popup/uni-popup").then(n.bind(null,292))}}}catch(r){if(-1===r.message.indexOf("Cannot find module")||-1===r.message.indexOf(".vue"))throw r;console.error(r.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,e=t.$createElement,n=(t._self._c,1==t.skuInfo.is_card?t.seldPeople.length:null),s=t.phone.length,i=t.contactList.length,o=t.formateRichText(t.xieyi.content);t._isMounted||(t.e0=function(e){t.phone=""},t.e1=function(e){return t.$refs.contactPopup.close()},t.e2=function(e){return t.$refs.contactPopup.close()},t.e3=function(e){return t.$refs.contactAddPopup.open()},t.e4=function(e){return t.$refs.agreementPopup.close()}),t.$mp.data=Object.assign({},{$root:{g0:n,g1:s,g2:i,m0:o}})},o=!1,c=[];i._withStripped=!0},90:function(t,e,n){"use strict";n.r(e);var s=n(91),i=n.n(s);for(var o in s)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return s[t]}))}(o);e["default"]=i.a},91:function(t,e,n){"use strict";(function(t){var s=n(4);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=s(n(92)),o=s(n(94)),c=function(){n.e("components/contactAdd").then(function(){return resolve(n(306))}.bind(null,n)).catch(n.oe)},r={components:{contactAddVue:c},data:function(){return{buyNum:1,sku:this.$store.state.user.touristInfo.sku,skuInfo:this.$store.state.user.touristInfo.sku.sku_info,selectDay:this.$store.state.user.touristInfo.selectDay,phone:"",seldPeople:[],contactList:[],isAgreement:!1,isBottom:!1,xieyi:""}},onLoad:function(){var t=this;console.log(this.skuInfo),this.getContactList(),this.Post({id:3},"/api/Article/getArticleById").then((function(e){t.xieyi=e.data}))},methods:{order:function(){var e=this,n=[];if(1==this.skuInfo.is_card){for(var s=0;s<this.seldPeople.length;s++)n.push(this.seldPeople[s].id);if(n.length<1)return void t.showToast({title:"请选择出行人",icon:"none"})}if(this.IsTel(this.phone))if(this.isAgreement){var i=[],o={goods_id:this.skuInfo.goods_id,specifications_id:this.skuInfo.id,num:1,contact_num:this.buyNum,contact_id:n,date:this.selectDay,start_time:"",end_time:""};i.push(o);var c={goods:i,coupon:this.coupon?this.coupon.id:"",reserve_phone:this.phone,guide_id:this.$store.state.user.touristInfo.guide_id};this.Post({method:"POST",data:JSON.stringify(c)},"/api/order/place").then((function(n){var s=n.data.order_id;e.$store.commit("changeTouristInfo",null),e.$store.commit("choseCoupon",""),e.Post({order_id:s,type:"miniprogram",platform:"miniprogram"},"/api/pay/unify").then((function(e){if(e.data){var n=e.data;if("success"==n.status)return void t.navigateTo({url:"/subPackages/order/trades"});WeixinJSBridge.invoke("getBrandWCPayRequest",{appId:n.appId,timeStamp:n.timeStamp,nonceStr:n.nonceStr,package:n.package,signType:n.signType,paySign:n.paySign},(function(e){t.navigateTo({url:"/subPackages/order/trades"})}))}}))}))}else this.isBottom=!1,this.$refs.agreementPopup.open();else t.showToast({title:"请输入正确格式的手机号",icon:"none"})},clickAgreement:function(t){if(t&&this.isBottom)this.isAgreement=!0,this.$refs.agreementPopup.close();else{if(this.isAgreement)return void(this.isAgreement=!1);this.isBottom=!1,this.$refs.agreementPopup.open()}},lower:function(){this.isBottom=!0},changeContactAddPopup:function(t,e){var n=this;if("open"==t){if(this.contactList.length<=0||e.id)return this.$refs.contactAddPopup.open(),void(e.id&&this.$nextTick((function(){n.$refs.contactAddVueRef.init(e)})));this.$refs.contactPopup.open()}else this.$refs.contactAddPopup.close()},seldThisContact:function(t,e){if(!this.skuInfo.is_real_name)if(t.isSeld)this.contactList[e].isSeld=!1,this.seldPeople=[];else for(var n=0;n<this.contactList.length;n++)this.contactList[n].isSeld=!1;if(this.skuInfo.is_real_name&&t.isSeld){this.contactList[e].isSeld=!1,this.seldPeople=[];for(var s=0;s<this.contactList.length;s++)this.contactList[s].isSeld&&this.seldPeople.push(this.contactList[s]);this.buyNum<=this.seldPeople.length+1&&(this.buyNum=this.seldPeople.length||1)}else{for(var i=[],o=0;o<this.contactList.length;o++)this.contactList[o].isSeld&&i.push(this.contactList[o]);if(1==this.buyNum){for(var c=0;c<this.contactList.length;c++)this.contactList[c].isSeld=!1;i=[]}else if(this.skuInfo.is_real_name&&this.seldPeople.length==this.buyNum&&0==t.isSeld)return void this.$toast("您只需选择"+this.buyNum+"游客");t.isSeld=!0,i.push(this.contactList[e]),this.seldPeople=i}},removeSeldPeople:function(t,e){for(var n=0;n<this.seldPeople.length;n++)this.seldPeople[n].id==t.id&&this.seldPeople.splice(n,1);for(var s=0;s<this.contactList.length;s++)this.contactList[s].id==t.id&&(this.contactList[s].isSeld=!1)},saveContact:function(){var t=this;return(0,o.default)(i.default.mark((function e(){var n;return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$refs.contactAddVueRef.submit();case 2:n=e.sent,n&&1==n.code&&(t.getContactList(),t.changeContactAddPopup("close"));case 4:case"end":return e.stop()}}),e)})))()},getContactList:function(){var t=this;this.Post({},"/api/user/contactList").then((function(e){if(e.data.forEach((function(e,n){e.isSeld=!1,0==t.seldPeople.length&&1==e.is_default&&(e.isSeld=!0,t.seldPeople.push(e))})),t.contactList=e.data,t.seldPeople.length>0){for(var n=0;n<t.seldPeople.length;n++)for(var s=0;s<t.contactList.length;s++)t.contactList[s].id==t.seldPeople[n].id&&(t.seldPeople[n]=t.contactList[s],t.contactList[s].isSeld=!0);t.$forceUpdate()}}))},changeNum:function(e){var n=this;if(e)this.buyNum+=1,this.buyNum>this.skuInfo.contact_num&&(this.buyNum=this.skuInfo.contact_num,t.showToast({title:"最大出行人数为"+this.skuInfo.contact_num,icon:"none"}));else{if(this.buyNum<=1)return;this.buyNum==this.seldPeople.length&&(this.contactList.forEach((function(t){t.id==n.seldPeople[n.seldPeople.length-1].id&&(t.isSeld=!1)})),this.seldPeople.pop()),this.buyNum-=1}}}};e.default=r}).call(this,n(2)["default"])},95:function(t,e,n){"use strict";n.r(e);var s=n(96),i=n.n(s);for(var o in s)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return s[t]}))}(o);e["default"]=i.a},96:function(t,e,n){}},[[86,"common/runtime","common/vendor"]]]);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/subPackages/daoyou/order.js.map