acdr-ui/dist/dev/mp-weixin/modules/mall/order/pickUpVerify.js

130 lines
3.9 KiB
JavaScript
Raw Normal View History

2024-09-19 07:20:14 +08:00
"use strict";
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
const common_vendor = require("../../../common/vendor.js");
2024-10-01 09:15:35 +08:00
const modules_mall_sheep_index = require("../sheep/index.js");
2024-09-19 07:20:14 +08:00
if (!Array) {
const _easycom_l_painter2 = common_vendor.resolveComponent("l-painter");
_easycom_l_painter2();
}
const _easycom_l_painter = () => "../../../uni_modules/lime-painter/components/l-painter/l-painter.js";
if (!Math) {
_easycom_l_painter();
}
const _sfc_main = {
__name: "pickUpVerify",
props: {
orderInfo: {
type: Object,
default() {
}
},
systemStore: {
type: Object,
default() {
}
}
},
setup(__props, { expose: __expose }) {
const props = __props;
const state = common_vendor.reactive({
qrcodeSize: 145
});
const showMaoLocation = () => {
console.log(props.systemStore);
if (!props.systemStore.latitude || !props.systemStore.longitude) {
2024-10-01 09:15:35 +08:00
modules_mall_sheep_index.sheep.$helper.toast("缺少经纬度信息无法查看地图!");
2024-09-19 07:20:14 +08:00
return;
}
common_vendor.index.openLocation({
latitude: props.systemStore.latitude,
longitude: props.systemStore.longitude,
scale: 8,
name: props.systemStore.name,
address: props.systemStore.areaName + props.systemStore.detailAddress
});
};
const painterRef = common_vendor.ref();
const painterImageUrl = common_vendor.ref();
const showPainter = common_vendor.ref(true);
const renderPoster = (poster) => __async(this, null, function* () {
yield painterRef.value.render(poster);
});
const setPainterImageUrl = (path) => {
painterImageUrl.value = path;
showPainter.value = false;
};
const markCode = (text) => {
renderPoster({
css: {
width: `${state.qrcodeSize}px`,
height: `${state.qrcodeSize}px`
},
views: [
{
type: "qrcode",
text,
css: {
width: `${state.qrcodeSize}px`,
height: `${state.qrcodeSize}px`
}
}
]
});
};
__expose({
markCode
});
return (_ctx, _cache) => {
return common_vendor.e({
a: __props.orderInfo.deliveryType === 2 && __props.orderInfo.payStatus
}, __props.orderInfo.deliveryType === 2 && __props.orderInfo.payStatus ? common_vendor.e({
b: !!painterImageUrl.value
}, !!painterImageUrl.value ? {
c: painterImageUrl.value,
d: `${state.qrcodeSize}px`,
e: `${state.qrcodeSize}px`
} : {}, {
2024-10-01 09:15:35 +08:00
f: common_vendor.unref(modules_mall_sheep_index.sheep).$url.static("/static/images/writeOff.png", "local"),
2024-09-19 07:20:14 +08:00
g: common_vendor.t(__props.orderInfo.pickUpVerifyCode)
}) : {}, {
h: __props.orderInfo.deliveryType === 2
}, __props.orderInfo.deliveryType === 2 ? {
i: common_vendor.o(showMaoLocation)
} : {}, {
j: showPainter.value
}, showPainter.value ? {
k: common_vendor.sr(painterRef, "185bb641-0", {
"k": "painterRef"
}),
l: common_vendor.o(setPainterImageUrl),
m: common_vendor.p({
isCanvasToTempFilePath: true,
pathType: "url",
hidden: true
})
} : {});
};
}
};
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-185bb641"]]);
wx.createComponent(Component);