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.
high-mini/unpackage/dist/build/mp-weixin/pages/order/confirmation.js

1 line
5.1 KiB

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/order/confirmation"],{5449:function(t,i,e){"use strict";(function(t){e("e5b1");o(e("66fd"));var i=o(e("fc2f"));function o(t){return t&&t.__esModule?t:{default:t}}t(i.default)}).call(this,e("543d")["createPage"])},6804:function(t,i,e){},b305:function(t,i,e){"use strict";(function(t){Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var o=e("53e0"),n=getApp(),s={data:function(){return{buylist:[],goodsPrice:0,sumPrice:0,freight:12,note:"",int:1200,deduction:0,recinfo:{id:1,name:"大黑哥",head:"大",tel:"18816881688",address:{region:{label:"广东省-深圳市-福田区",value:[18,2,1],cityCode:"440304"},detailed:"深南大道1111号无名摩登大厦6楼A2"},isDefault:!0},couponId:"",couponList:[],UserNormalDiscountList:[],imageUrl:n.globalData.imgUrl,deductionPrice:"0.00",paytheprice:"",radioStatus:!0,memDiscountId:"",user:""}},onLoad:function(t){this.couponId=t.id,this.user=n.globalData.userInfo,console.log("==="+this.user.phone),this.getCouponById(),this.getUserNormalDiscountList()},onShow:function(){},onHide:function(){},onBackPress:function(){},filters:{toFixed:function(t){return parseFloat(t).toFixed(2)},formatDate:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",e=new Date(t),o=e.getFullYear(),n=e.getMonth()+1,s=e.getDate(),r=e.getHours(),c=e.getMinutes(),u=e.getSeconds();return n=n>10?n:"0"+n,s=s>10?s:"0"+s,r=r>10?r:"0"+r,c=c>10?c:"0"+c,u=u>10?u:"0"+u,"".concat(o).concat(i).concat(n).concat(i).concat(s," ").concat(r,":").concat(c,":").concat(u)}},methods:{getCouponById:function(){var i=this;t.showLoading({title:"加载中..."});var e={couponId:this.couponId};(0,o.getCouponById)(e).then((function(e){"000000"==e.return_code?(i.couponList=e.return_data,i.paytheprice=e.return_data.discountPrice,t.hideLoading()):t.hideLoading()}))},switch2Change:function(t){this.radioStatus=t.target.value,this.radioStatus||(this.paytheprice=this.couponList.discountPrice,this.deductionPrice="0.00",this.memDiscountId=""),this.current=this.UserNormalDiscountList.length},getUserNormalDiscountList:function(){var t=this,i={couponId:this.couponId};(0,o.getUserNormalDiscountList)(i).then((function(i){"000000"==i.return_code&&(t.UserNormalDiscountList=i.return_data)}))},radioChange:function(i){for(var e=0;e<this.UserNormalDiscountList.length;e++)this.UserNormalDiscountList[e].highDiscount.id==i.target.value&&(this.memDiscountId=this.UserNormalDiscountList[e].id,this.current=e,1==this.UserNormalDiscountList[e].highDiscount.discountType?this.couponList.salesPrice>this.UserNormalDiscountList[e].highDiscount.discountPrice?(this.deductionPrice=this.UserNormalDiscountList[e].highDiscount.discountPrice,this.paytheprice=this.couponList.salesPrice-this.deductionPrice):t.showToast({title:"未满足满减条件",icon:"none",duration:2e3}):2==this.UserNormalDiscountList[e].highDiscount.discountType?(this.deductionPrice=this.UserNormalDiscountList[e].highDiscount.discountPrice,this.paytheprice=this.couponList.salesPrice-this.deductionPrice):3==this.UserNormalDiscountList[e].highDiscount.discountType&&(this.deductionPrice=this.couponList.salesPrice-this.couponList.salesPrice*(this.UserNormalDiscountList[e].highDiscount.discountPrice/10),this.paytheprice=this.couponList.salesPrice*(this.UserNormalDiscountList[e].highDiscount.discountPrice/10)))},getPhoneNumber:function(i){var e=this,s={openId:n.globalData.openId,iv:i.detail.iv,encryptedData:i.detail.encryptedData};(0,o.GetPhoneNumber)(s).then((function(i){if("000000"==i.return_code){n.globalData.userInfo=i.return_data.object.highUser,t.setStorage({key:"user",data:i.return_data.object.highUser});var o=e;o.toPay()}}))},toPay:function(){var i=this;t.showLoading({title:"提交订单中..."});var e={memDiscountId:this.memDiscountId,highChildOrderList:[{goodsType:1,goodsId:this.couponId,saleCount:1}]};(0,o.addOrder)(e).then((function(e){"000000"==e.return_code?(t.hideLoading(),t.redirectTo({url:"../pay/payment/payment?amount="+e.return_data.payPrice+"&paytype="+i.couponList.payType+"&orderId="+e.return_dat