合同小程序前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

142 lines
4.6 KiB

"use strict";
const common_vendor = require("../../common/vendor.js");
const api = require("../../api.js");
const _sfc_main = common_vendor.defineComponent({
data() {
return {
firstFocus: true,
ServiceName: "",
product: [],
product_2: [],
product_3: [],
product_4: [],
FirstIndex: 0,
name: ""
};
},
mounted() {
api.isToken();
api.getProduct().then((res = null) => {
this.product = res.result;
this.product_2 = res.result[0].products;
for (var index = 1; index < this.product.length; index++) {
this.product_4.push(this.product[index]);
}
this.product_3 = res.result[0].products;
getApp().productName = res.result[0].products[0].name;
getApp().productUrl = res.result[0].products[0].pdf;
this.name = res.result[0].products[0].name;
});
},
methods: {
toBack() {
let canNavBack = getCurrentPages();
if (canNavBack && canNavBack.length > 1) {
common_vendor.index.navigateBack();
} else {
history.back();
}
},
toNext() {
common_vendor.index.navigateTo({ url: "/pages/index/PayPal" });
},
clear() {
this.ServiceName = "";
},
FirstLevelChange(id = null) {
this.FirstIndex = id;
this.product_2 = this.product[id].products;
},
selctRadio(name = null, pdf = null) {
getApp().productName = name;
getApp().productUrl = pdf;
this.name = name;
},
handleSearch(event = null) {
this.FirstIndex = 0;
if (event) {
this.product_2 = [];
for (var index = 0; index < this.product_4.length; index++) {
this.product_4[index].products.map((item = null) => {
if (item.name.indexOf(event) !== -1) {
this.product_2.push(item);
}
});
}
} else {
this.product_2 = [];
this.product_2 = this.product_3;
}
},
searchName() {
this.FirstIndex = 0;
if (this.ServiceName) {
this.product_2 = [];
for (var index = 0; index < this.product_4.length; index++) {
this.product_4[index].products.map((item = null) => {
if (item.name.indexOf(this.ServiceName) !== -1) {
this.product_2.push(item);
}
});
}
} else {
this.product_2 = [];
this.product_2 = this.product_3;
}
}
}
});
if (!Array) {
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
const _easycom_uni_easyinput2 = common_vendor.resolveComponent("uni-easyinput");
(_easycom_uni_icons2 + _easycom_uni_easyinput2)();
}
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
const _easycom_uni_easyinput = () => "../../uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js";
if (!Math) {
(_easycom_uni_icons + _easycom_uni_easyinput)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.p({
type: "left",
size: "30",
color: "#c2d4de"
}),
b: common_vendor.o((...args) => $options.toBack && $options.toBack(...args)),
c: common_vendor.p({
type: "search",
size: 20
}),
d: common_vendor.o($options.handleSearch),
e: common_vendor.o($options.clear),
f: common_vendor.o(($event) => $data.ServiceName = $event),
g: common_vendor.p({
inputBorder: false,
placeholder: "请输入服务名称",
focus: $data.firstFocus,
modelValue: $data.ServiceName
}),
h: common_vendor.o((...args) => $options.searchName && $options.searchName(...args)),
i: common_vendor.f($data.product, (item, index, i0) => {
return {
a: common_vendor.t(item.categoryName),
b: common_vendor.n($data.FirstIndex === item.categoryId ? "click_color" : ""),
c: common_vendor.o(($event) => $options.FirstLevelChange(item.categoryId))
};
}),
j: common_vendor.f($data.product_2, (item, index, i0) => {
return {
a: common_vendor.t(item.name),
b: common_vendor.n(item.name === $data.name ? "select_color" : ""),
c: item.name == $data.name,
d: common_vendor.o(($event) => $options.selctRadio(item.name, item.pdf))
};
}),
k: common_vendor.o((...args) => $options.toNext && $options.toNext(...args)),
l: common_vendor.sei(_ctx.virtualHostId, "view")
};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/views/dingDanCreate.js.map