|
|
- "use strict";
- const common_vendor = require("../../common/vendor.js");
- const _sfc_main = common_vendor.defineComponent({
- data() {
- return {
- firstFocus: true,
- ServiceName: "",
- product: [
- new UTSJSONObject({
- id: 1,
- name: "数码",
- children: [
- new UTSJSONObject({
- id: 12,
- name: "耳机",
- children: [
- new UTSJSONObject({ id: 121, name: "漫步者" }),
- new UTSJSONObject({ id: 122, name: "倍思" })
- ]
- }),
- new UTSJSONObject({
- id: 13,
- name: "电脑",
- children: [
- new UTSJSONObject({ id: 131, name: "联想" }),
- new UTSJSONObject({ id: 132, name: "小米" }),
- new UTSJSONObject({ id: 133, name: "戴尔" })
- ]
- })
- ]
- }),
- new UTSJSONObject({
- id: 2,
- name: "家用电器",
- // 类似数码的子结构
- children: [
- new UTSJSONObject({
- id: 11,
- name: "手机",
- children: [
- new UTSJSONObject({ id: 111, name: "iphone" }),
- new UTSJSONObject({ id: 112, name: "vivo" }),
- new UTSJSONObject({ id: 113, name: "oppo" })
- ]
- })
- ]
- })
- ],
- product_2: [],
- FirstIndex: 0,
- name: ""
- };
- },
- onLoad() {
- common_vendor.index.request({
- url: "https://gpt.aiym.run/contract/miniapp/product/categories",
- method: "GET",
- header: new UTSJSONObject({
- "Content-Type": "application/json",
- "X-Access-Token": "11"
- }),
- success: (res) => {
- common_vendor.index.__f__("log", "at pages/views/dingDanCreate.uvue:100", res.data.result);
- }
- });
- },
- methods: {
- toBack() {
- let canNavBack = getCurrentPages();
- if (canNavBack && canNavBack.length > 1) {
- common_vendor.index.navigateBack();
- } else {
- history.back();
- }
- },
- toNext() {
- common_vendor.index.__f__("log", "at pages/views/dingDanCreate.uvue:116", 111);
- common_vendor.index.navigateTo({ url: "/pages/index/PayPal" });
- },
- nameClick() {
- },
- FirstLevelChange(id = null) {
- this.FirstIndex = id;
- this.product_2 = this.product[id - 1].children;
- },
- selctRadio(name = null) {
- common_vendor.index.__f__("log", "at pages/views/dingDanCreate.uvue:129", name);
- this.name = name;
- }
- },
- searchName() {
- common_vendor.index.__f__("log", "at pages/views/dingDanCreate.uvue:134", "1");
- }
- });
- 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(($event) => $data.ServiceName = $event),
- e: common_vendor.p({
- inputBorder: false,
- placeholder: "请输入服务名称",
- focus: $data.firstFocus,
- modelValue: $data.ServiceName
- }),
- f: common_vendor.o((...args) => _ctx.searchName && _ctx.searchName(...args)),
- g: common_vendor.f($data.product, (item, index, i0) => {
- return {
- a: common_vendor.t(item.name),
- b: common_vendor.n($data.FirstIndex === item.id ? "click_color" : ""),
- c: common_vendor.o(($event) => $options.FirstLevelChange(item.id))
- };
- }),
- h: 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))
- };
- }),
- i: common_vendor.o((...args) => $options.toNext && $options.toNext(...args)),
- j: 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
|