first commit
This commit is contained in:
97
unpackage/dist/dev/mp-alipay/pages/setMeal/affirm.js
vendored
Normal file
97
unpackage/dist/dev/mp-alipay/pages/setMeal/affirm.js
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
"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.selectGoodsInfo({
|
||||
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 { id } = common_vendor.index.getStorageSync("user");
|
||||
let _res = await api_api.addGoodsPackageOrders({
|
||||
userId: id,
|
||||
num: dataFrom.value.num,
|
||||
gid: shop.value.id
|
||||
});
|
||||
common_vendor.index.redirectTo({
|
||||
url: `/pages/order/pay?id=${_res.id}&amount=${_res.amount}&type=2`
|
||||
});
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: JSON.parse(common_vendor.unref(shop).picture)[0],
|
||||
b: common_vendor.t(common_vendor.unref(shop).packagesName),
|
||||
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 = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-b11f557d"]]);
|
||||
my.createPage(MiniProgramPage);
|
||||
Reference in New Issue
Block a user