117 lines
4.0 KiB
JavaScript
117 lines
4.0 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const _sfc_main = {
|
|
name: "LeasePage",
|
|
data() {
|
|
return {
|
|
formData: {
|
|
name: "张珊珊",
|
|
phone: "",
|
|
address: "",
|
|
detailAddress: "",
|
|
equipment: "",
|
|
period: "1年"
|
|
},
|
|
currentLocation: {
|
|
company: "福鼎创特物联科技有限公司",
|
|
address: "福建宁德市福鼎市"
|
|
},
|
|
showDetails: false,
|
|
totalAmount: "100.10"
|
|
};
|
|
},
|
|
methods: {
|
|
selectAddress() {
|
|
common_vendor.index.showToast({
|
|
title: "选择地址功能",
|
|
icon: "none"
|
|
});
|
|
},
|
|
useCurrentLocation() {
|
|
this.formData.address = this.currentLocation.company + " " + this.currentLocation.address;
|
|
common_vendor.index.showToast({
|
|
title: "已使用当前定位",
|
|
icon: "success"
|
|
});
|
|
},
|
|
selectEquipment() {
|
|
common_vendor.index.showActionSheet({
|
|
itemList: ["节能灶", "燃烧器", "燃气灶", "电磁炉"],
|
|
success: (res) => {
|
|
const equipmentList = ["节能灶", "燃烧器", "燃气灶", "电磁炉"];
|
|
this.formData.equipment = equipmentList[res.tapIndex];
|
|
}
|
|
});
|
|
},
|
|
selectPeriod() {
|
|
common_vendor.index.showActionSheet({
|
|
itemList: ["1个月", "3个月", "6个月", "1年", "2年"],
|
|
success: (res) => {
|
|
const periodList = ["1个月", "3个月", "6个月", "1年", "2年"];
|
|
this.formData.period = periodList[res.tapIndex];
|
|
}
|
|
});
|
|
},
|
|
toggleDetails() {
|
|
this.showDetails = !this.showDetails;
|
|
},
|
|
handlePayment() {
|
|
common_vendor.index.showModal({
|
|
title: "确认支付",
|
|
content: `确认支付 ¥${this.totalAmount} 吗?`,
|
|
success: (res) => {
|
|
if (res.confirm) {
|
|
common_vendor.index.showToast({
|
|
title: "支付成功",
|
|
icon: "success"
|
|
});
|
|
}
|
|
}
|
|
});
|
|
},
|
|
// 页面跳转现在由系统tabBar处理
|
|
goToHome() {
|
|
common_vendor.index.switchTab({
|
|
url: "/pages/index/index"
|
|
});
|
|
},
|
|
goToProfile() {
|
|
common_vendor.index.switchTab({
|
|
url: "/pages/profile/profile"
|
|
});
|
|
}
|
|
}
|
|
};
|
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
return common_vendor.e({
|
|
a: $data.formData.name,
|
|
b: common_vendor.o(($event) => $data.formData.name = $event.detail.value),
|
|
c: $data.formData.phone,
|
|
d: common_vendor.o(($event) => $data.formData.phone = $event.detail.value),
|
|
e: common_vendor.t($data.formData.address || "选择收货地址"),
|
|
f: common_vendor.o((...args) => $options.selectAddress && $options.selectAddress(...args)),
|
|
g: $data.currentLocation
|
|
}, $data.currentLocation ? {
|
|
h: common_vendor.t($data.currentLocation.company),
|
|
i: common_vendor.t($data.currentLocation.address),
|
|
j: common_vendor.o((...args) => $options.useCurrentLocation && $options.useCurrentLocation(...args))
|
|
} : {}, {
|
|
k: $data.formData.detailAddress,
|
|
l: common_vendor.o(($event) => $data.formData.detailAddress = $event.detail.value),
|
|
m: common_vendor.t($data.formData.equipment || "选择设备类型"),
|
|
n: common_vendor.o((...args) => $options.selectEquipment && $options.selectEquipment(...args)),
|
|
o: common_vendor.t($data.formData.period || "1年"),
|
|
p: common_vendor.o((...args) => $options.selectPeriod && $options.selectPeriod(...args)),
|
|
q: common_vendor.t($data.totalAmount),
|
|
r: common_vendor.o((...args) => $options.handlePayment && $options.handlePayment(...args)),
|
|
s: $data.showDetails ? 1 : "",
|
|
t: common_vendor.o((...args) => $options.toggleDetails && $options.toggleDetails(...args)),
|
|
v: $data.showDetails
|
|
}, $data.showDetails ? {
|
|
w: common_vendor.t($data.totalAmount)
|
|
} : {});
|
|
}
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-45bce28e"]]);
|
|
wx.createPage(MiniProgramPage);
|
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/lease/lease.js.map
|