index.js
2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
"use strict";
var common_vendor = require("../../common/vendor.js");
if (!Array) {
const _component_nav_bar = common_vendor.resolveComponent("nav-bar");
_component_nav_bar();
}
if (!Math) {
(GoodsSeach + WeightAndVolume)();
}
const GoodsSeach = () => "./components/goodsSearch.js";
const WeightAndVolume = () => "./components/weightAndVolume.js";
const _sfc_main = {
__name: "index",
setup(__props) {
const weight = common_vendor.ref(1);
const volume = common_vendor.ref("");
const goods = common_vendor.reactive({
info: {}
});
const store = common_vendor.useStore();
const users = store.state.user;
const isShow = common_vendor.ref(false);
let isAlways = common_vendor.ref();
common_vendor.onMounted(() => {
goods.info = users.goodsInfo;
});
const isActive = common_vendor.computed$1(() => {
return Boolean(users.goodsInfo.name);
});
const isShowOther = (flag, type) => {
if (type === "always") {
isAlways.value = true;
}
isShow.value = type === "always" ? true : flag;
};
const getWeight = (value) => {
weight.value = value;
store.commit("user/setWeight", value);
};
const getVolume = (value, long, width, height) => {
volume.value = value;
store.commit("user/setLong", long);
store.commit("user/setWidth", width);
store.commit("user/setHeight", height);
store.commit("user/setVolume", value);
};
const getGoodsInfo = (value) => {
goods.info = value;
store.commit("user/setGoodsInfo", value);
};
const confirm = () => {
if (!goods.info.name) {
return common_vendor.index.showToast({
title: "\u8BF7\u9009\u62E9\u7269\u54C1",
duration: 1e3,
icon: "none"
});
}
common_vendor.index.redirectTo({
url: "/pages/express-delivery/index?isFromGoods=true"
});
};
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.p({
title: "\u7269\u54C1\u4FE1\u606F"
}),
b: common_vendor.o(getGoodsInfo),
c: common_vendor.p({
isShowOther
}),
d: !isShow.value
}, !isShow.value ? {
e: common_vendor.o(getWeight),
f: common_vendor.o(getVolume)
} : {}, {
g: !isShow.value
}, !isShow.value ? {
h: common_vendor.n(common_vendor.unref(isActive) ? "active" : ""),
i: common_vendor.o(confirm)
} : {}, {
j: isShow.value ? 1 : ""
});
};
}
};
var MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "E:/project/project-wl-yonghuduan-uniapp-vue3/pages/goodsInfo/index.vue"]]);
wx.createPage(MiniProgramPage);