This commit is contained in:
zpc 2025-07-31 20:23:45 +08:00
parent 84d5bc157f
commit c7ea42ed79
5 changed files with 69 additions and 49 deletions

View File

@ -1,7 +1,8 @@
<template>
<view class="content">
<image src="" style="width: 100%; height: 100%; background-color: bisque; position: absolute;" mode=""></image>
<image :src="bg" style="width: 100%; height: 100%; background-color: bisque; position: absolute;" mode="">
</image>
<uniNoticeBar showIcon single scrollable text="赠品仅限线下购买设备的用户领取需人工审核预计3个工作日内完成"
style="width: 100%;position:fixed;top:10%" background-color="transparent" color="#000" />
<view class="center" @click="openReceivePop"
@ -153,6 +154,7 @@ export default {
uniNoticeBar
},
onLoad() {
this.getConfig();
var userId = uni.getStorageSync("user_id");
if (!userId || userId == 0) {
this.login();
@ -161,6 +163,7 @@ export default {
},
data() {
return {
bg: "",
userId: 0,
imagePath: '',
name: "",
@ -205,6 +208,13 @@ export default {
});
})
},
async getConfig() {
const res = await this.request("config", "get", {});
console.log(res);
if (res.home != "") {
this.bg = res.home;
}
},
wxLogin() {
return new Promise((resolve, reject) => {
uni.login({

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -8,6 +8,7 @@ const _sfc_main = {
uniNoticeBar
},
onLoad() {
this.getConfig();
var userId = common_vendor.index.getStorageSync("user_id");
if (!userId || userId == 0) {
this.login();
@ -16,6 +17,7 @@ const _sfc_main = {
},
data() {
return {
bg: "",
userId: 0,
imagePath: "",
name: "",
@ -43,7 +45,7 @@ const _sfc_main = {
header,
timeout: 1e4,
success: (res) => {
common_vendor.index.__f__("log", "at pages/index/index.vue:194", "API响应:", res);
common_vendor.index.__f__("log", "at pages/index/index.vue:197", "API响应:", res);
if (res.statusCode === 200) {
resolve(res.data);
} else {
@ -51,12 +53,19 @@ const _sfc_main = {
}
},
fail: (err) => {
common_vendor.index.__f__("error", "at pages/index/index.vue:202", "API请求失败:", err);
common_vendor.index.__f__("error", "at pages/index/index.vue:205", "API请求失败:", err);
reject(err);
}
});
});
},
async getConfig() {
const res = await this.request("config", "get", {});
common_vendor.index.__f__("log", "at pages/index/index.vue:213", res);
if (res.home != "") {
this.bg = res.home;
}
},
wxLogin() {
return new Promise((resolve, reject) => {
common_vendor.index.login({
@ -80,13 +89,13 @@ const _sfc_main = {
if (res.code == 200) {
common_vendor.index.setStorageSync("user_id", res.data.user_id);
this.userId = res.data.user_id;
common_vendor.index.__f__("log", "at pages/index/index.vue:232", "登录成功, userId:", this.userId);
common_vendor.index.__f__("log", "at pages/index/index.vue:242", "登录成功, userId:", this.userId);
} else {
common_vendor.index.__f__("error", "at pages/index/index.vue:234", "登录失败:", res.message);
common_vendor.index.__f__("error", "at pages/index/index.vue:244", "登录失败:", res.message);
}
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/index/index.vue:238", "登录过程出错:", error);
common_vendor.index.__f__("error", "at pages/index/index.vue:248", "登录过程出错:", error);
}
},
openReceivePop() {
@ -103,11 +112,11 @@ const _sfc_main = {
try {
common_vendor.index.showLoading({ title: "加载中..." });
const result = await this.request("getRecord?userId=" + this.userId, "GET", {});
common_vendor.index.__f__("log", "at pages/index/index.vue:259", result);
common_vendor.index.__f__("log", "at pages/index/index.vue:269", result);
this.recordList = result.data;
common_vendor.index.__f__("log", "at pages/index/index.vue:264", "加载领取记录...");
common_vendor.index.__f__("log", "at pages/index/index.vue:274", "加载领取记录...");
} catch (error) {
common_vendor.index.__f__("error", "at pages/index/index.vue:266", "加载领取记录失败:", error);
common_vendor.index.__f__("error", "at pages/index/index.vue:276", "加载领取记录失败:", error);
}
common_vendor.index.hideLoading();
},
@ -118,12 +127,12 @@ const _sfc_main = {
try {
common_vendor.index.showLoading({ title: "处理中..." });
const { base64, path } = await common_utils.processImage();
common_vendor.index.__f__("log", "at pages/index/index.vue:280", "最终Base64长度:", base64.length, path);
common_vendor.index.__f__("log", "at pages/index/index.vue:290", "最终Base64长度:", base64.length, path);
this.imagePath = path;
this.base64 = base64;
common_vendor.index.showToast({ title: "上传成功" });
} catch (err) {
common_vendor.index.__f__("error", "at pages/index/index.vue:285", "处理失败", err);
common_vendor.index.__f__("error", "at pages/index/index.vue:295", "处理失败", err);
common_vendor.index.showToast({ title: "处理失败", icon: "none" });
} finally {
common_vendor.index.hideLoading();
@ -182,7 +191,7 @@ const _sfc_main = {
ProductImage: this.base64
};
const result = await this.request("addRecord", "POST", formData);
common_vendor.index.__f__("log", "at pages/index/index.vue:351", result);
common_vendor.index.__f__("log", "at pages/index/index.vue:361", result);
if (result.code == 200) {
common_vendor.index.showToast({ title: "提交成功,请等待审核", icon: "success" });
this.closeReceivePop();
@ -194,7 +203,7 @@ const _sfc_main = {
} catch (error) {
common_vendor.index.hideLoading();
common_vendor.index.showToast({ title: "提交失败,请重试", icon: "none" });
common_vendor.index.__f__("error", "at pages/index/index.vue:365", "提交失败:", error);
common_vendor.index.__f__("error", "at pages/index/index.vue:375", "提交失败:", error);
}
},
clearForm() {
@ -214,10 +223,10 @@ const _sfc_main = {
current: this.imagePath,
urls: [this.imagePath],
success: function(res) {
common_vendor.index.__f__("log", "at pages/index/index.vue:387", "预览图片成功");
common_vendor.index.__f__("log", "at pages/index/index.vue:397", "预览图片成功");
},
fail: function(err) {
common_vendor.index.__f__("error", "at pages/index/index.vue:390", "预览图片失败:", err);
common_vendor.index.__f__("error", "at pages/index/index.vue:400", "预览图片失败:", err);
common_vendor.index.showToast({ title: "预览失败", icon: "none" });
}
});
@ -236,7 +245,8 @@ if (!Math) {
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: common_vendor.p({
a: $data.bg,
b: common_vendor.p({
showIcon: true,
single: true,
scrollable: true,
@ -244,39 +254,39 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
["background-color"]: "transparent",
color: "#000"
}),
b: common_vendor.o((...args) => $options.openReceivePop && $options.openReceivePop(...args)),
c: common_vendor.o((...args) => $options.openRecordPop && $options.openRecordPop(...args)),
d: $data.name,
e: common_vendor.o(($event) => $data.name = $event.detail.value),
f: $data.phone,
g: common_vendor.o(($event) => $data.phone = $event.detail.value),
h: $data.workUnit,
i: common_vendor.o(($event) => $data.workUnit = $event.detail.value),
j: -1,
k: $data.address,
l: common_vendor.o(($event) => $data.address = $event.detail.value),
m: $data.model,
n: common_vendor.o(($event) => $data.model = $event.detail.value),
o: $data.number,
p: common_vendor.o(($event) => $data.number = $event.detail.value),
q: $data.createTime,
r: common_vendor.o(($event) => $data.createTime = $event.detail.value),
s: common_vendor.o((...args) => $options.seleImg && $options.seleImg(...args)),
t: $data.imagePath
c: common_vendor.o((...args) => $options.openReceivePop && $options.openReceivePop(...args)),
d: common_vendor.o((...args) => $options.openRecordPop && $options.openRecordPop(...args)),
e: $data.name,
f: common_vendor.o(($event) => $data.name = $event.detail.value),
g: $data.phone,
h: common_vendor.o(($event) => $data.phone = $event.detail.value),
i: $data.workUnit,
j: common_vendor.o(($event) => $data.workUnit = $event.detail.value),
k: -1,
l: $data.address,
m: common_vendor.o(($event) => $data.address = $event.detail.value),
n: $data.model,
o: common_vendor.o(($event) => $data.model = $event.detail.value),
p: $data.number,
q: common_vendor.o(($event) => $data.number = $event.detail.value),
r: $data.createTime,
s: common_vendor.o(($event) => $data.createTime = $event.detail.value),
t: common_vendor.o((...args) => $options.seleImg && $options.seleImg(...args)),
v: $data.imagePath
}, $data.imagePath ? {
v: $data.imagePath,
w: common_vendor.o((...args) => $options.previewImage && $options.previewImage(...args))
w: $data.imagePath,
x: common_vendor.o((...args) => $options.previewImage && $options.previewImage(...args))
} : {}, {
x: common_vendor.o((...args) => $options.closeReceivePop && $options.closeReceivePop(...args)),
y: common_vendor.o((...args) => $options.submitForm && $options.submitForm(...args)),
z: common_vendor.sr("receivePop", "6e486efd-1"),
A: common_vendor.p({
y: common_vendor.o((...args) => $options.closeReceivePop && $options.closeReceivePop(...args)),
z: common_vendor.o((...args) => $options.submitForm && $options.submitForm(...args)),
A: common_vendor.sr("receivePop", "6e486efd-1"),
B: common_vendor.p({
type: "center",
["is-mask-click"]: false
}),
B: common_assets._imports_0,
C: common_vendor.o(($event) => $options.closeRecordPop()),
D: common_vendor.f($data.recordList, (item, k0, i0) => {
C: common_assets._imports_0,
D: common_vendor.o(($event) => $options.closeRecordPop()),
E: common_vendor.f($data.recordList, (item, k0, i0) => {
return {
a: common_vendor.t(item.name),
b: common_vendor.t(item.phone),
@ -285,8 +295,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
e: item.phone + item.time
};
}),
E: common_vendor.sr("recordPop", "6e486efd-2"),
F: common_vendor.p({
F: common_vendor.sr("recordPop", "6e486efd-2"),
G: common_vendor.p({
type: "center"
})
});

File diff suppressed because one or more lines are too long