Files
hnxdcount-uniapp/unpackage/dist/build/mp-alipay/pages/shop/affirm.js
PC-202306242200\Administrator dac42e3b0c first commit
2026-03-28 23:09:02 +08:00

2 lines
2.5 KiB
JavaScript

"use strict";const common_vendor=require("../../common/vendor.js");const api_api=require("../../api/api.js");if(!Array){const _easycom_up_number_box2=common_vendor.resolveComponent("up-number-box");const _easycom_up_text2=common_vendor.resolveComponent("up-text");(_easycom_up_number_box2+_easycom_up_text2)()}const _easycom_up_number_box=()=>"../../uni_modules/uview-plus/components/u-number-box/u-number-box.js";const _easycom_up_text=()=>"../../uni_modules/uview-plus/components/u-text/u-text.js";if(!Math){(_easycom_up_number_box+_easycom_up_text)()}const _sfc_main={__name:"affirm",setup(__props){let dataFrom=common_vendor.ref({num:1});let shop=common_vendor.ref({});let policy=common_vendor.ref({is_trusteeship:0,is_buy:0});common_vendor.onLoad((async options=>{let _res=await api_api.shopInfo({id:options.id});shop.value=_res;common_vendor.index.$on("buy",(e=>{policy.value.is_buy=e}));common_vendor.index.$on("trusteeship",(e=>{policy.value.is_trusteeship=e}))}));let changenum=e=>{console.log(e)};let add=async()=>{if(!policy.value.is_buy)return common_vendor.index.showToast({title:"请阅读并同意《充电桩购销合同》",icon:"none"});if(!policy.value.is_trusteeship)return common_vendor.index.showToast({title:"请阅读并同意《充电桩托管协议》",icon:"none"});let _res=await api_api.addGoodsOrders({num:dataFrom.value.num,gid:shop.value.id});common_vendor.index.redirectTo({url:`/pages/order/pay?id=${_res.id}&amount=${_res.amount}&type=1`})};return(_ctx,_cache)=>common_vendor.e({a:JSON.parse(common_vendor.unref(shop).picture)[0],b:common_vendor.t(common_vendor.unref(shop).goodsName),c:common_vendor.t(common_vendor.unref(shop).salePrice),d:common_vendor.t(common_vendor.unref(shop).salePrice*common_vendor.unref(dataFrom).num),e:common_vendor.o(common_vendor.unref(changenum)),f:common_vendor.o(($event=>common_vendor.unref(dataFrom).num=$event)),g:common_vendor.p({inputWidth:"100rpx",modelValue:common_vendor.unref(dataFrom).num}),h:common_vendor.unref(policy).is_buy==1},common_vendor.unref(policy).is_buy==1?{i:common_vendor.p({text:"已同意",type:"primary"})}:{j:common_vendor.p({text:"未同意",type:"error"})},{k:common_vendor.unref(policy).is_trusteeship==1},common_vendor.unref(policy).is_trusteeship==1?{l:common_vendor.p({text:"已同意",type:"primary"})}:{m:common_vendor.p({text:"未同意",type:"error"})},{n:common_vendor.o(((...args)=>common_vendor.unref(add)&&common_vendor.unref(add)(...args)))})}};const MiniProgramPage=common_vendor._export_sfc(_sfc_main,[["__scopeId","data-v-1963f699"]]);my.createPage(MiniProgramPage);