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> <template>
<view class="content"> <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个工作日内完成" <uniNoticeBar showIcon single scrollable text="赠品仅限线下购买设备的用户领取需人工审核预计3个工作日内完成"
style="width: 100%;position:fixed;top:10%" background-color="transparent" color="#000" /> style="width: 100%;position:fixed;top:10%" background-color="transparent" color="#000" />
<view class="center" @click="openReceivePop" <view class="center" @click="openReceivePop"
@ -153,6 +154,7 @@ export default {
uniNoticeBar uniNoticeBar
}, },
onLoad() { onLoad() {
this.getConfig();
var userId = uni.getStorageSync("user_id"); var userId = uni.getStorageSync("user_id");
if (!userId || userId == 0) { if (!userId || userId == 0) {
this.login(); this.login();
@ -161,6 +163,7 @@ export default {
}, },
data() { data() {
return { return {
bg: "",
userId: 0, userId: 0,
imagePath: '', imagePath: '',
name: "", 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() { wxLogin() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.login({ 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 uniNoticeBar
}, },
onLoad() { onLoad() {
this.getConfig();
var userId = common_vendor.index.getStorageSync("user_id"); var userId = common_vendor.index.getStorageSync("user_id");
if (!userId || userId == 0) { if (!userId || userId == 0) {
this.login(); this.login();
@ -16,6 +17,7 @@ const _sfc_main = {
}, },
data() { data() {
return { return {
bg: "",
userId: 0, userId: 0,
imagePath: "", imagePath: "",
name: "", name: "",
@ -43,7 +45,7 @@ const _sfc_main = {
header, header,
timeout: 1e4, timeout: 1e4,
success: (res) => { 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) { if (res.statusCode === 200) {
resolve(res.data); resolve(res.data);
} else { } else {
@ -51,12 +53,19 @@ const _sfc_main = {
} }
}, },
fail: (err) => { 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); 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() { wxLogin() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
common_vendor.index.login({ common_vendor.index.login({
@ -80,13 +89,13 @@ const _sfc_main = {
if (res.code == 200) { if (res.code == 200) {
common_vendor.index.setStorageSync("user_id", res.data.user_id); common_vendor.index.setStorageSync("user_id", res.data.user_id);
this.userId = 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 { } 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) { } 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() { openReceivePop() {
@ -103,11 +112,11 @@ const _sfc_main = {
try { try {
common_vendor.index.showLoading({ title: "加载中..." }); common_vendor.index.showLoading({ title: "加载中..." });
const result = await this.request("getRecord?userId=" + this.userId, "GET", {}); 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; 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) { } 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(); common_vendor.index.hideLoading();
}, },
@ -118,12 +127,12 @@ const _sfc_main = {
try { try {
common_vendor.index.showLoading({ title: "处理中..." }); common_vendor.index.showLoading({ title: "处理中..." });
const { base64, path } = await common_utils.processImage(); 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.imagePath = path;
this.base64 = base64; this.base64 = base64;
common_vendor.index.showToast({ title: "上传成功" }); common_vendor.index.showToast({ title: "上传成功" });
} catch (err) { } 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" }); common_vendor.index.showToast({ title: "处理失败", icon: "none" });
} finally { } finally {
common_vendor.index.hideLoading(); common_vendor.index.hideLoading();
@ -182,7 +191,7 @@ const _sfc_main = {
ProductImage: this.base64 ProductImage: this.base64
}; };
const result = await this.request("addRecord", "POST", formData); 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) { if (result.code == 200) {
common_vendor.index.showToast({ title: "提交成功,请等待审核", icon: "success" }); common_vendor.index.showToast({ title: "提交成功,请等待审核", icon: "success" });
this.closeReceivePop(); this.closeReceivePop();
@ -194,7 +203,7 @@ const _sfc_main = {
} catch (error) { } catch (error) {
common_vendor.index.hideLoading(); common_vendor.index.hideLoading();
common_vendor.index.showToast({ title: "提交失败,请重试", icon: "none" }); 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() { clearForm() {
@ -214,10 +223,10 @@ const _sfc_main = {
current: this.imagePath, current: this.imagePath,
urls: [this.imagePath], urls: [this.imagePath],
success: function(res) { 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) { 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" }); common_vendor.index.showToast({ title: "预览失败", icon: "none" });
} }
}); });
@ -236,7 +245,8 @@ if (!Math) {
} }
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({ return common_vendor.e({
a: common_vendor.p({ a: $data.bg,
b: common_vendor.p({
showIcon: true, showIcon: true,
single: true, single: true,
scrollable: true, scrollable: true,
@ -244,39 +254,39 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
["background-color"]: "transparent", ["background-color"]: "transparent",
color: "#000" color: "#000"
}), }),
b: common_vendor.o((...args) => $options.openReceivePop && $options.openReceivePop(...args)), c: common_vendor.o((...args) => $options.openReceivePop && $options.openReceivePop(...args)),
c: common_vendor.o((...args) => $options.openRecordPop && $options.openRecordPop(...args)), d: common_vendor.o((...args) => $options.openRecordPop && $options.openRecordPop(...args)),
d: $data.name, e: $data.name,
e: common_vendor.o(($event) => $data.name = $event.detail.value), f: common_vendor.o(($event) => $data.name = $event.detail.value),
f: $data.phone, g: $data.phone,
g: common_vendor.o(($event) => $data.phone = $event.detail.value), h: common_vendor.o(($event) => $data.phone = $event.detail.value),
h: $data.workUnit, i: $data.workUnit,
i: common_vendor.o(($event) => $data.workUnit = $event.detail.value), j: common_vendor.o(($event) => $data.workUnit = $event.detail.value),
j: -1, k: -1,
k: $data.address, l: $data.address,
l: common_vendor.o(($event) => $data.address = $event.detail.value), m: common_vendor.o(($event) => $data.address = $event.detail.value),
m: $data.model, n: $data.model,
n: common_vendor.o(($event) => $data.model = $event.detail.value), o: common_vendor.o(($event) => $data.model = $event.detail.value),
o: $data.number, p: $data.number,
p: common_vendor.o(($event) => $data.number = $event.detail.value), q: common_vendor.o(($event) => $data.number = $event.detail.value),
q: $data.createTime, r: $data.createTime,
r: common_vendor.o(($event) => $data.createTime = $event.detail.value), s: common_vendor.o(($event) => $data.createTime = $event.detail.value),
s: common_vendor.o((...args) => $options.seleImg && $options.seleImg(...args)), t: common_vendor.o((...args) => $options.seleImg && $options.seleImg(...args)),
t: $data.imagePath v: $data.imagePath
}, $data.imagePath ? { }, $data.imagePath ? {
v: $data.imagePath, w: $data.imagePath,
w: common_vendor.o((...args) => $options.previewImage && $options.previewImage(...args)) 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.closeReceivePop && $options.closeReceivePop(...args)),
y: common_vendor.o((...args) => $options.submitForm && $options.submitForm(...args)), z: common_vendor.o((...args) => $options.submitForm && $options.submitForm(...args)),
z: common_vendor.sr("receivePop", "6e486efd-1"), A: common_vendor.sr("receivePop", "6e486efd-1"),
A: common_vendor.p({ B: common_vendor.p({
type: "center", type: "center",
["is-mask-click"]: false ["is-mask-click"]: false
}), }),
B: common_assets._imports_0, C: common_assets._imports_0,
C: common_vendor.o(($event) => $options.closeRecordPop()), D: common_vendor.o(($event) => $options.closeRecordPop()),
D: common_vendor.f($data.recordList, (item, k0, i0) => { E: common_vendor.f($data.recordList, (item, k0, i0) => {
return { return {
a: common_vendor.t(item.name), a: common_vendor.t(item.name),
b: common_vendor.t(item.phone), 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: item.phone + item.time
}; };
}), }),
E: common_vendor.sr("recordPop", "6e486efd-2"), F: common_vendor.sr("recordPop", "6e486efd-2"),
F: common_vendor.p({ G: common_vendor.p({
type: "center" type: "center"
}) })
}); });

File diff suppressed because one or more lines are too long