confirmOrder.js 2.7 KB
"use strict";const e=require("../../common/vendor.js"),i=require("../../api/index.js");require("../../utils/request.js");Array||e.resolveComponent("u-navbar")();const x=()=>"../../uni_modules/uview-plus/components/u-navbar/u-navbar.js";Math||(x+P+S+b)();const S=()=>"../../componets/checkPayMode.js",b=()=>"../../componets/tipPop.js",P=()=>"../../componets/address.js",k={__name:"confirmOrder",setup(_){e.onLoad(o=>{o.ids?(f.value=o.ids,y(o.ids)):(n.value=o.shopType,d.value=JSON.parse(o.params),m(JSON.parse(o.params)),console.log(o.params,"商品规格信息"))}),e.onShow(()=>{v(),console.log("onShow执行了吗"),e.index.getStorageSync("defaultAdres")?r.value=e.index.getStorageSync("defaultAdres"):r.value={}});let c=e.ref(!1),d=e.ref({}),n=e.ref(1),f=e.ref(""),p=e.ref(0),l=e.ref([]),a=e.ref({});const m=async o=>{try{let t={goods_id:o.id,num:o.num,goods_spec_id:o.specId};const s=await i.getbBuyData(t);l.value=s.goods_list,a.value=s,console.log("getbBuyData",s)}catch(t){e.index.showToast({title:t,icon:"none"}),e.index.navigateBack({delta:1})}},v=async()=>{try{const o=await i.getyue();p.value=o.money}catch(o){e.index.showToast({title:o,icon:"none"}),console.log("getyue",o)}},y=async o=>{try{const t=await i.getCarsettlement(o);l.value=t.goods_list,a.value=t,console.log("getCarsettlement",t)}catch(t){e.index.showToast({title:t,icon:"none"}),console.log("getCarsettlement",t)}};let r=e.ref({});const g=()=>{e.index.navigateTo({url:"/pages/mine/myAddress?isCheck=1",events:{steBack:o=>{r.value=o,console.log("地址",o)}}})},u=e.ref(!1),h=o=>{u.value=!1,o==1&&(c.value=!0)},w=()=>{if(n.value==3){if(console.log("立即兑换按钮"),e.index.getStorageSync("myPoints")<a.value.coscore)return e.index.showToast({title:"您的积分不足~",icon:"none"});u.value=!0}else c.value=!0,console.log("立即购买")};return(o,t)=>e.e({a:e.p({bgColor:"#F6F8FA",placeholder:!0,title:"",autoBack:!0}),b:!e.unref(r).name},e.unref(r).name?{d:e.p({adress:e.unref(r)}),e:e.o(g)}:{c:e.o(g)},{f:e.f(e.unref(l),(s,A,B)=>e.e({a:s.image,b:e.t(s.name),c:e.t(s.goods_sku.goods_attr)},e.unref(n)!=3?{d:e.t(s.goods_price)}:{e:e.t(e.unref(a).coscore)},{f:e.t(s.total_num),g:s.id})),g:e.unref(n)!=3,h:e.unref(n)==3},e.unref(n)==3?{i:e.t(e.unref(a).express_price)}:{},{j:e.unref(n)==3},e.unref(n)==3?{k:e.t(e.unref(a).coscore),l:e.t(e.unref(a).express_price)}:{m:e.t(e.unref(a).total_price)},{n:e.t(e.unref(n)==3?"立即兑换":"立即购买"),o:e.o(w),p:e.o(s=>e.isRef(c)?c.value=!1:c=!1),q:e.p({car_Id:e.unref(f),balance:e.unref(p),totalPrice:e.unref(a).total_price,adressId:e.unref(r).id,payParams:e.unref(d),modeShow:e.unref(c)}),r:e.o(h),s:e.p({integral:e.unref(a).coscore,tipShow:u.value})})}},C=e._export_sfc(k,[["__file","D:/vue/大健康商城/healthMall/pages/shopCar/confirmOrder.vue"]]);wx.createPage(C);