first commit
This commit is contained in:
1
unpackage/dist/build/mp-weixin/pages/order/confirm.js
vendored
Normal file
1
unpackage/dist/build/mp-weixin/pages/order/confirm.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";const e=require("../../common/vendor.js"),a=require("../../common/assets.js"),u=require("../../api/index.js"),t=require("../../store/index.js");if(!Array){(e.resolveComponent("wd-navbar")+e.resolveComponent("wd-input-number")+e.resolveComponent("wd-textarea"))()}Math||((()=>"../../uni_modules/wot-design-uni/components/wd-navbar/wd-navbar.js")+(()=>"../../uni_modules/wot-design-uni/components/wd-input-number/wd-input-number.js")+(()=>"../../uni_modules/wot-design-uni/components/wd-textarea/wd-textarea.js"))();const l={__name:"confirm",setup(l){const o=t.Store(),s=e.computed((()=>(o.userInfo.userRights||(v.value.payType=1),o.userInfo||{inviteCode:"",nickname:"",mobile:"",avatar:"",paywallet:{balance:0},userRights:null}))),i=e.ref({}),r=e.ref(null),v=e.ref({goodsId:null,goodsNum:1,totalAmount:0,payableAmount:0,payAmount:0,payType:1,receiverId:null,note:"",orderType:1}),n=e.computed((()=>i.value.currentPrice*v.value.goodsNum)),p=e.computed((()=>{var e,a;if(1===v.value.payType){const u=(null==(a=null==(e=s.value.userRights)?void 0:e.rights)?void 0:a.rightsDiscount)||100;return n.value*u/100}return n.value})),d=()=>{var a;let t=JSON.parse(JSON.stringify(v.value));r.value?(e.index.showLoading({mask:!0}),t.receiverId=null==(a=r.value)?void 0:a.id,1==t.payType&&(t.payAmount=p.value,t.totalAmount=n.value,t.payableAmount=p.value,t.totalAmount=n.value),2==t.payType&&(t.deductibleAmount=n.value,t.totalAmount=n.value,t.deductionAmount=n.value,t.totalAmount=n.value),3==t.payType&&(s.value.userRights.pice<n.value?(t.deductibleAmount=s.value.userRights.pice,t.deductionAmount=s.value.userRights.pice,t.payAmount=n.value-s.value.userRights.pice,t.payableAmount=n.value-s.value.userRights.pice,t.totalAmount=n.value):(t.deductibleAmount=n.value,t.totalAmount=n.value,t.deductionAmount=n.value,t.totalAmount=n.value,t.payType=2)),u.api.orderCreate(t).then((a=>{e.index.hideLoading(),e.index.navigateTo({url:"/pages/order/success?id="+a})})).catch((()=>{e.index.hideLoading()}))):e.index.showToast({title:"请选择收货地址",icon:"none"})};e.onLoad((async a=>{v.value.goodsId=a.id,await o.usersGetInfo(),u.api.goodsInfo({id:a.id}).then((e=>{i.value=e})),u.api.addressPage({isDefault:1}).then((e=>{e.list.length&&(r.value=e.list[0],v.value.receiverId=r.value.id)})),e.index.$on("address",(e=>{r.value=e}))}));const c=(e,a)=>Math.min(e,a),m=()=>{e.index.navigateTo({url:"/pages/address/list?type=1"})},g=()=>{e.index.navigateTo({url:"/pages/goods/goods?id="+i.value.id})},y=()=>{e.index.navigateBack()};return(u,t)=>{return e.e({a:e.o(y),b:e.p({title:"下单",bordered:!1,"left-arrow":!0,"custom-style":"background-color: transparent !important;",safeAreaInsetTop:!0}),c:r.value},r.value?{d:e.t(r.value.receiverArea),e:e.t(r.value.receiverAddress),f:e.t(r.value.receiverName),g:e.t(r.value.receiverPhone)}:{},{h:a._imports_0$1,i:e.o(m),j:i.value.cover,k:e.t(i.value.name),l:e.t(i.value.specs),m:e.t(i.value.currentPrice),n:e.o(g),o:a._imports_0$1,p:e.o((e=>v.value.goodsNum=e)),q:e.p({modelValue:v.value.goodsNum}),r:e.o((e=>v.value.note=e)),s:e.p({placeholder:"请填写订单备注",modelValue:v.value.note}),t:e.t(s.value.money||0),v:1===v.value.payType?1:"",w:e.o((e=>v.value.payType=1)),x:1===v.value.payType&&s.value.userRights},1===v.value.payType&&s.value.userRights?{y:e.t(s.value.userRights.rights.rightsName),z:e.t(s.value.userRights.rights.rightsDiscount/10)}:{},{A:s.value.userRights},s.value.userRights?{B:e.t(s.value.userRights.pice||0),C:2===v.value.payType?1:"",D:e.o((e=>v.value.payType=2))}:{},{E:2===v.value.payType},(v.value.payType,{}),{F:s.value.userRights},s.value.userRights?e.e({G:n.value>s.value.userRights.pice+s.value.money},n.value>s.value.userRights.pice+s.value.money?{H:e.t(c(s.value.money,n.value-s.value.userRights.pice)),I:e.t(c(s.value.userRights.pice,n.value-s.value.money))}:e.e({J:e.t((o=0,h=n.value-s.value.userRights.pice,Math.max(o,h))),K:c(n.value-(n.value-s.value.userRights.pice),s.value.userRights.pice)>n.value},c(n.value-(n.value-s.value.userRights.pice),s.value.userRights.pice)>n.value?{L:e.t(n.value)}:{M:e.t(c(n.value-(n.value-s.value.userRights.pice),s.value.userRights.pice))}),{N:3===v.value.payType?1:"",O:e.o((e=>v.value.payType=3))}):{},{P:3===v.value.payType},(v.value.payType,{}),{Q:e.t((l=p.value,`¥ ${parseFloat(l).toFixed(2)}`)),R:e.o(d)});var l,o,h}}},o=e._export_sfc(l,[["__scopeId","data-v-46acca1b"]]);wx.createPage(o);
|
||||
Reference in New Issue
Block a user