This commit is contained in:
2025-09-29 21:38:32 +08:00
parent ed26244cdb
commit 19117de6c8
182 changed files with 11590 additions and 2156 deletions

View File

@@ -24,6 +24,7 @@
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/* 表单控件尺寸(统一配置,避免页面内硬编码) */
.page {
display: flex;
flex-direction: column;

View File

@@ -24,6 +24,7 @@
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/* 表单控件尺寸(统一配置,避免页面内硬编码) */
.page {
display: flex;
flex-direction: column;

View File

@@ -24,6 +24,7 @@
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/* 表单控件尺寸(统一配置,避免页面内硬编码) */
.page {
display: flex;
flex-direction: column;

View File

@@ -1,11 +1,13 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const common_http = require("../../common/http.js");
const common_config = require("../../common/config.js");
const _sfc_main = {
data() {
return {
loading: false,
tab: "login",
authLoginTopImage: common_config.AUTH_LOGIN_TOP_IMAGE,
loginForm: { email: "", password: "" },
regForm: { name: "", email: "", code: "", password: "", password2: "" },
resetForm: { email: "", code: "", password: "", password2: "" },
@@ -18,6 +20,12 @@ const _sfc_main = {
this._timers.forEach((t) => clearInterval(t));
},
methods: {
gotoRegister() {
this.tab = "register";
},
gotoReset() {
this.tab = "reset";
},
toast(msg) {
try {
common_vendor.index.showToast({ title: String(msg || "操作失败"), icon: "none" });
@@ -154,65 +162,64 @@ const _sfc_main = {
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: common_vendor.n($data.tab === "login" ? "active" : ""),
b: common_vendor.o(($event) => $data.tab = "login"),
c: common_vendor.n($data.tab === "register" ? "active" : ""),
d: common_vendor.o(($event) => $data.tab = "register"),
e: common_vendor.n($data.tab === "reset" ? "active" : ""),
f: common_vendor.o(($event) => $data.tab = "reset"),
g: $data.tab === "login"
a: $data.authLoginTopImage,
b: $data.tab === "login"
}, $data.tab === "login" ? {
h: $data.loginForm.email,
i: common_vendor.o(common_vendor.m(($event) => $data.loginForm.email = $event.detail.value, {
c: $data.loginForm.email,
d: common_vendor.o(common_vendor.m(($event) => $data.loginForm.email = $event.detail.value, {
trim: true
})),
j: $data.loginForm.password,
k: common_vendor.o(($event) => $data.loginForm.password = $event.detail.value),
l: $data.loading,
m: common_vendor.o((...args) => $options.onLogin && $options.onLogin(...args))
} : $data.tab === "register" ? {
o: $data.regForm.name,
p: common_vendor.o(common_vendor.m(($event) => $data.regForm.name = $event.detail.value, {
e: $data.loginForm.password,
f: common_vendor.o(($event) => $data.loginForm.password = $event.detail.value),
g: $data.loading,
h: common_vendor.o((...args) => $options.onLogin && $options.onLogin(...args)),
i: common_vendor.o((...args) => $options.gotoRegister && $options.gotoRegister(...args)),
j: common_vendor.o((...args) => $options.gotoReset && $options.gotoReset(...args))
} : {}, {
k: $data.tab === "register"
}, $data.tab === "register" ? {
l: $data.regForm.name,
m: common_vendor.o(common_vendor.m(($event) => $data.regForm.name = $event.detail.value, {
trim: true
})),
q: $data.regForm.email,
r: common_vendor.o(common_vendor.m(($event) => $data.regForm.email = $event.detail.value, {
n: $data.regForm.email,
o: common_vendor.o(common_vendor.m(($event) => $data.regForm.email = $event.detail.value, {
trim: true
})),
s: $data.regForm.code,
t: common_vendor.o(common_vendor.m(($event) => $data.regForm.code = $event.detail.value, {
p: $data.regForm.code,
q: common_vendor.o(common_vendor.m(($event) => $data.regForm.code = $event.detail.value, {
trim: true
})),
v: common_vendor.t($data.regCountdown > 0 ? $data.regCountdown + "s" : "获取验证码"),
w: $data.regCountdown > 0 || $data.loading,
x: common_vendor.o((...args) => $options.sendRegCode && $options.sendRegCode(...args)),
y: $data.regForm.password,
z: common_vendor.o(($event) => $data.regForm.password = $event.detail.value),
A: $data.regForm.password2,
B: common_vendor.o(($event) => $data.regForm.password2 = $event.detail.value),
C: $data.loading,
D: common_vendor.o((...args) => $options.onRegister && $options.onRegister(...args))
} : {
E: $data.resetForm.email,
F: common_vendor.o(common_vendor.m(($event) => $data.resetForm.email = $event.detail.value, {
r: common_vendor.t($data.regCountdown > 0 ? $data.regCountdown + "s" : "获取验证码"),
s: $data.regCountdown > 0 || $data.loading,
t: common_vendor.o((...args) => $options.sendRegCode && $options.sendRegCode(...args)),
v: $data.regForm.password,
w: common_vendor.o(($event) => $data.regForm.password = $event.detail.value),
x: $data.regForm.password2,
y: common_vendor.o(($event) => $data.regForm.password2 = $event.detail.value),
z: $data.loading,
A: common_vendor.o((...args) => $options.onRegister && $options.onRegister(...args))
} : {}, {
B: $data.tab === "reset"
}, $data.tab === "reset" ? {
C: $data.resetForm.email,
D: common_vendor.o(common_vendor.m(($event) => $data.resetForm.email = $event.detail.value, {
trim: true
})),
G: $data.resetForm.code,
H: common_vendor.o(common_vendor.m(($event) => $data.resetForm.code = $event.detail.value, {
E: $data.resetForm.code,
F: common_vendor.o(common_vendor.m(($event) => $data.resetForm.code = $event.detail.value, {
trim: true
})),
I: common_vendor.t($data.resetCountdown > 0 ? $data.resetCountdown + "s" : "获取验证码"),
J: $data.resetCountdown > 0 || $data.loading,
K: common_vendor.o((...args) => $options.sendResetCode && $options.sendResetCode(...args)),
L: $data.resetForm.password,
M: common_vendor.o(($event) => $data.resetForm.password = $event.detail.value),
N: $data.resetForm.password2,
O: common_vendor.o(($event) => $data.resetForm.password2 = $event.detail.value),
P: $data.loading,
Q: common_vendor.o((...args) => $options.onReset && $options.onReset(...args))
}, {
n: $data.tab === "register"
});
G: common_vendor.t($data.resetCountdown > 0 ? $data.resetCountdown + "s" : "获取验证码"),
H: $data.resetCountdown > 0 || $data.loading,
I: common_vendor.o((...args) => $options.sendResetCode && $options.sendResetCode(...args)),
J: $data.resetForm.password,
K: common_vendor.o(($event) => $data.resetForm.password = $event.detail.value),
L: $data.resetForm.password2,
M: common_vendor.o(($event) => $data.resetForm.password2 = $event.detail.value),
N: $data.loading,
O: common_vendor.o((...args) => $options.onReset && $options.onReset(...args))
} : {});
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createPage(MiniProgramPage);

View File

@@ -1 +1 @@
<view class="auth-page"><view class="tabs"><view class="{{['tab', a]}}" bindtap="{{b}}">登录</view><view class="{{['tab', c]}}" bindtap="{{d}}">注册</view><view class="{{['tab', e]}}" bindtap="{{f}}">忘记密码</view></view><view wx:if="{{g}}" class="panel"><input class="input" type="text" placeholder="输入邮箱" value="{{h}}" bindinput="{{i}}"/><input class="input" type="password" placeholder="输入密码" value="{{j}}" bindinput="{{k}}"/><button class="btn primary" disabled="{{l}}" bindtap="{{m}}">登录</button></view><view wx:elif="{{n}}" class="panel"><input class="input" type="text" placeholder="输入用户名" value="{{o}}" bindinput="{{p}}"/><input class="input" type="text" placeholder="输入邮箱" value="{{q}}" bindinput="{{r}}"/><view class="row"><input class="input flex1" type="text" placeholder="邮箱验证码" value="{{s}}" bindinput="{{t}}"/><button class="btn ghost" disabled="{{w}}" bindtap="{{x}}">{{v}}</button></view><input class="input" type="password" placeholder="输入密码(≥6位)" value="{{y}}" bindinput="{{z}}"/><input class="input" type="password" placeholder="再次输入密码" value="{{A}}" bindinput="{{B}}"/><button class="btn primary" disabled="{{C}}" bindtap="{{D}}">注册新用户</button></view><view wx:else class="panel"><input class="input" type="text" placeholder="输入邮箱" value="{{E}}" bindinput="{{F}}"/><view class="row"><input class="input flex1" type="text" placeholder="邮箱验证码" value="{{G}}" bindinput="{{H}}"/><button class="btn ghost" disabled="{{J}}" bindtap="{{K}}">{{I}}</button></view><input class="input" type="password" placeholder="新密码(≥6位)" value="{{L}}" bindinput="{{M}}"/><input class="input" type="password" placeholder="再次输入新密码" value="{{N}}" bindinput="{{O}}"/><button class="btn primary" disabled="{{P}}" bindtap="{{Q}}">重置密码</button></view></view>
<view class="auth-page"><view class="login-hero"><image class="login-hero-img" src="{{a}}" mode="widthFix"/></view><view class="header"><text class="title">邮箱密码登录</text></view><view wx:if="{{b}}" class="panel"><input class="input" type="text" placeholder="输入邮箱" value="{{c}}" bindinput="{{d}}"/><input class="input" type="password" placeholder="输入密码" value="{{e}}" bindinput="{{f}}"/><button class="btn primary" disabled="{{g}}" bindtap="{{h}}">登录</button><view class="quick-inline"><button class="quick-link" bindtap="{{i}}">注册</button><button class="quick-link" bindtap="{{j}}">忘记密码</button></view></view><view wx:if="{{k}}" class="panel minor"><input class="input" type="text" placeholder="输入用户名" value="{{l}}" bindinput="{{m}}"/><input class="input" type="text" placeholder="输入邮箱" value="{{n}}" bindinput="{{o}}"/><view class="row"><input class="input flex1" type="text" placeholder="邮箱验证码" value="{{p}}" bindinput="{{q}}"/><button class="btn ghost" disabled="{{s}}" bindtap="{{t}}">{{r}}</button></view><input class="input" type="password" placeholder="输入密码(≥6位)" value="{{v}}" bindinput="{{w}}"/><input class="input" type="password" placeholder="再次输入密码" value="{{x}}" bindinput="{{y}}"/><button class="btn primary" disabled="{{z}}" bindtap="{{A}}">注册新用户</button></view><view wx:if="{{B}}" class="panel minor"><input class="input" type="text" placeholder="输入邮箱" value="{{C}}" bindinput="{{D}}"/><view class="row"><input class="input flex1" type="text" placeholder="邮箱验证码" value="{{E}}" bindinput="{{F}}"/><button class="btn ghost" disabled="{{H}}" bindtap="{{I}}">{{G}}</button></view><input class="input" type="password" placeholder="新密码(≥6位)" value="{{J}}" bindinput="{{K}}"/><input class="input" type="password" placeholder="再次输入新密码" value="{{L}}" bindinput="{{M}}"/><button class="btn primary" disabled="{{N}}" bindtap="{{O}}">重置密码</button></view></view>

View File

@@ -24,39 +24,78 @@
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/* 表单控件尺寸(统一配置,避免页面内硬编码) */
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 藏青系主色(高亮) */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/* 表单控件尺寸(统一配置,避免页面内硬编码) */
.auth-page {
padding: 32rpx;
display: flex;
flex-direction: column;
gap: 24rpx;
position: relative;
min-height: 100vh;
}
.tabs {
.header {
display: flex;
gap: 24rpx;
align-items: center;
justify-content: center;
padding: 8rpx 0 0;
}
.tab {
padding: 12rpx 20rpx;
border-radius: 999rpx;
background: #f2f4f8;
color: #5b6b80;
font-weight: 700;
.title {
font-size: 34rpx;
font-weight: 800;
color: #111;
}
.tab.active {
background: #2d6be6;
color: #fff;
.login-hero {
display: flex;
justify-content: center;
padding: 16rpx 0 0;
}
.login-hero-img {
width: 72%;
max-width: 560rpx;
border-radius: 8rpx;
}
.panel {
display: flex;
flex-direction: column;
gap: 16rpx;
background: #fff;
padding: 24rpx;
border-radius: 16rpx;
border: 2rpx solid #eef2f9;
background: transparent;
padding: 0;
border-radius: 0;
border: none;
}
.panel.minor {
margin-top: 12rpx;
}
.input {
background: #f7f9ff;
border: 2rpx solid rgba(45, 107, 230, 0.12);
background: #ffffff;
border: 2rpx solid #e5e7eb;
border-radius: 12rpx;
padding: 22rpx 20rpx;
font-size: 28rpx;
@@ -78,8 +117,47 @@
.btn.primary {
background: linear-gradient(135deg, #4788ff 0%, #2d6be6 100%);
color: #fff;
border: 1rpx solid rgba(45, 107, 230, 0.25);
width: 72%;
margin: 0 auto;
padding: 14rpx 16rpx;
}
.btn.ghost {
background: #eef3ff;
color: #2d6be6;
}
/* 右下角快捷入口:贴着登录功能,无边框、无背景 */
.quick-inline {
display: flex;
gap: 28rpx;
justify-content: flex-end;
align-items: center;
margin-top: 10rpx;
}
.quick-link {
background: transparent !important;
color: #2d6be6;
border: none !important;
outline: none;
padding: 0;
font-size: 26rpx;
font-weight: 700;
box-shadow: none;
line-height: 1.2;
}
.quick-link::after {
border: none !important;
}
/* 注册/重置页:验证码按钮与左侧输入框等高,且更紧凑 */
.panel.minor .row > .input {
height: 76rpx;
padding: 0 20rpx;
}
.panel.minor .row > .btn.ghost {
height: 76rpx;
padding: 0 20rpx;
border-radius: 12rpx;
display: inline-flex;
align-items: center;
justify-content: center;
}

View File

@@ -24,6 +24,7 @@
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/* 表单控件尺寸(统一配置,避免页面内硬编码) */
.register-container {
position: relative;
min-height: 100vh;

View File

@@ -24,6 +24,7 @@
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/* 表单控件尺寸(统一配置,避免页面内硬编码) */
.page {
padding-bottom: 140rpx;
}

View File

@@ -24,6 +24,7 @@
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/* 表单控件尺寸(统一配置,避免页面内硬编码) */
.page {
padding-bottom: 140rpx;
}

View File

@@ -24,6 +24,7 @@
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/* 表单控件尺寸(统一配置,避免页面内硬编码) */
.page {
display: flex;
flex-direction: column;

View File

@@ -24,6 +24,7 @@
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/* 表单控件尺寸(统一配置,避免页面内硬编码) */
.page {
display: flex;
flex-direction: column;

View File

@@ -7,6 +7,7 @@ const _sfc_main = {
data() {
return {
KPI_ICONS: common_config.KPI_ICONS,
KPI_LABELS: common_constants.KPI_LABELS,
kpi: { todaySales: "0.00", monthSales: "0.00", monthProfit: "0.00", stockCount: "0" },
activeTab: "home",
notices: [],
@@ -166,6 +167,10 @@ const _sfc_main = {
common_vendor.index.navigateTo({ url: common_constants.ROUTES.report });
return;
}
if (item.key === "vip") {
common_vendor.index.navigateTo({ url: "/pages/my/vip" });
return;
}
if (item.key === "otherPay") {
try {
common_vendor.index.setStorageSync("ORDER_DEFAULT_PARAMS", { biz: "expense" });
@@ -184,7 +189,7 @@ const _sfc_main = {
},
goDetail() {
try {
common_vendor.index.__f__("log", "at pages/index/index.vue:253", "[index] goDetail → /pages/detail/index");
common_vendor.index.__f__("log", "at pages/index/index.vue:259", "[index] goDetail → /pages/detail/index");
} catch (e) {
}
common_vendor.index.switchTab({ url: "/pages/detail/index" });
@@ -209,29 +214,33 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
a: common_vendor.t($data.consultLabel),
b: common_vendor.o((...args) => $options.onConsultTap && $options.onConsultTap(...args)),
c: $data.KPI_ICONS.todaySales,
d: common_vendor.t($data.kpi.todaySales),
e: $data.KPI_ICONS.monthSales,
f: common_vendor.t($data.kpi.monthSales),
g: $data.KPI_ICONS.monthProfit,
h: common_vendor.t($data.kpi.monthProfit),
i: $data.KPI_ICONS.stockCount,
j: common_vendor.t($data.kpi.stockCount),
k: $data.consultDialogVisible
d: common_vendor.t($data.KPI_LABELS.todaySales),
e: common_vendor.t($data.kpi.todaySales),
f: $data.KPI_ICONS.monthSales,
g: common_vendor.t($data.KPI_LABELS.monthSales),
h: common_vendor.t($data.kpi.monthSales),
i: $data.KPI_ICONS.monthProfit,
j: common_vendor.t($data.KPI_LABELS.monthProfit),
k: common_vendor.t($data.kpi.monthProfit),
l: $data.KPI_ICONS.stockCount,
m: common_vendor.t($data.KPI_LABELS.stockCount),
n: common_vendor.t($data.kpi.stockCount),
o: $data.consultDialogVisible
}, $data.consultDialogVisible ? {
l: $data.consultMessage,
m: common_vendor.o(($event) => $data.consultMessage = $event.detail.value),
n: common_vendor.o((...args) => $options.closeConsultDialog && $options.closeConsultDialog(...args)),
o: common_vendor.o((...args) => $options.submitConsult && $options.submitConsult(...args)),
p: common_vendor.o(() => {
p: $data.consultMessage,
q: common_vendor.o(($event) => $data.consultMessage = $event.detail.value),
r: common_vendor.o((...args) => $options.closeConsultDialog && $options.closeConsultDialog(...args)),
s: common_vendor.o((...args) => $options.submitConsult && $options.submitConsult(...args)),
t: common_vendor.o(() => {
}),
q: common_vendor.o(() => {
v: common_vendor.o(() => {
})
} : {}, {
r: $data.loadingNotices
w: $data.loadingNotices
}, $data.loadingNotices ? {} : $data.noticeError ? {
t: common_vendor.t($data.noticeError)
y: common_vendor.t($data.noticeError)
} : !$data.notices.length ? {} : {
w: common_vendor.f($data.notices, (n, idx, i0) => {
A: common_vendor.f($data.notices, (n, idx, i0) => {
return common_vendor.e({
a: common_vendor.t(n.text),
b: n.tag
@@ -243,9 +252,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
});
})
}, {
s: $data.noticeError,
v: !$data.notices.length,
x: common_vendor.f($data.features, (item, k0, i0) => {
x: $data.noticeError,
z: !$data.notices.length,
B: common_vendor.f($data.features, (item, k0, i0) => {
return common_vendor.e({
a: item.img
}, item.img ? {

View File

@@ -1 +1 @@
<view class="home"><view class="hero"><view class="hero-top"><text class="brand">五金配件管家</text><view class="cta" bindtap="{{b}}" hover-class="cta-active" hover-stay-time="80"><text class="cta-text">{{a}}</text></view></view><view class="kpi kpi-grid"><view class="kpi-item kpi-card"><image src="{{c}}" class="kpi-icon" mode="aspectFit"></image><view class="kpi-content"><text class="kpi-label">今日销售额</text><text class="kpi-value">{{d}}</text></view></view><view class="kpi-item kpi-card"><image src="{{e}}" class="kpi-icon" mode="aspectFit"></image><view class="kpi-content"><text class="kpi-label">本月销售额</text><text class="kpi-value">{{f}}</text></view></view><view class="kpi-item kpi-card"><image src="{{g}}" class="kpi-icon" mode="aspectFit"></image><view class="kpi-content"><text class="kpi-label">本月利润</text><text class="kpi-value">{{h}}</text></view></view><view class="kpi-item kpi-card"><image src="{{i}}" class="kpi-icon" mode="aspectFit"></image><view class="kpi-content"><text class="kpi-label">库存商品数量</text><text class="kpi-value">{{j}}</text></view></view></view></view><view wx:if="{{k}}" class="dialog-mask" catchtouchmove="{{p}}" catchtap="{{q}}"><view class="dialog"><view class="dialog-title">咨询</view><block wx:if="{{r0}}"><textarea class="dialog-textarea" placeholder="请输入咨询内容..." maxlength="500" value="{{l}}" bindinput="{{m}}"></textarea></block><view class="dialog-actions"><view class="btn" bindtap="{{n}}">取消</view><view class="btn primary" bindtap="{{o}}">提交</view></view></view></view><view class="notice"><view class="notice-left">公告</view><view wx:if="{{r}}" class="notice-swiper" style="display:flex;align-items:center;color:#6b5a2a">加载中...</view><view wx:elif="{{s}}" class="notice-swiper" style="display:flex;align-items:center;color:#dd524d">{{t}}</view><view wx:elif="{{v}}" class="notice-swiper" style="display:flex;align-items:center;color:#6b5a2a">暂无公告</view><swiper wx:else class="notice-swiper" circular autoplay interval="4000" duration="400" vertical><swiper-item wx:for="{{w}}" wx:for-item="n" wx:key="e"><view class="notice-item" bindtap="{{n.d}}"><text class="notice-text">{{n.a}}</text><text wx:if="{{n.b}}" class="notice-tag">{{n.c}}</text></view></swiper-item></swiper></view><view class="section-title"><text class="section-text">常用功能</text></view><view class="grid-wrap"><view class="feature-grid"><view wx:for="{{x}}" wx:for-item="item" wx:key="g" class="feature-card" bindtap="{{item.h}}"><view class="fc-icon"><image wx:if="{{item.a}}" src="{{item.b}}" class="fc-img" mode="aspectFit" binderror="{{item.c}}"></image><text wx:elif="{{item.d}}" class="fc-emoji">{{item.e}}</text><view wx:else class="fc-placeholder"></view></view><view class="fc-title">{{item.f}}</view></view></view></view></view>
<view class="home"><view class="hero"><view class="hero-top"><text class="brand">五金配件管家</text><view class="cta" bindtap="{{b}}" hover-class="cta-active" hover-stay-time="80"><text class="cta-text">{{a}}</text></view></view><view class="kpi kpi-grid"><view class="kpi-item kpi-card"><image src="{{c}}" class="kpi-icon" mode="aspectFit"></image><view class="kpi-content"><text class="kpi-label">{{d}}</text><text class="kpi-value">{{e}}</text></view></view><view class="kpi-item kpi-card"><image src="{{f}}" class="kpi-icon" mode="aspectFit"></image><view class="kpi-content"><text class="kpi-label">{{g}}</text><text class="kpi-value">{{h}}</text></view></view><view class="kpi-item kpi-card"><image src="{{i}}" class="kpi-icon" mode="aspectFit"></image><view class="kpi-content"><text class="kpi-label">{{j}}</text><text class="kpi-value">{{k}}</text></view></view><view class="kpi-item kpi-card"><image src="{{l}}" class="kpi-icon" mode="aspectFit"></image><view class="kpi-content"><text class="kpi-label">{{m}}</text><text class="kpi-value">{{n}}</text></view></view></view></view><view wx:if="{{o}}" class="dialog-mask" catchtouchmove="{{t}}" catchtap="{{v}}"><view class="dialog"><view class="dialog-title">咨询</view><block wx:if="{{r0}}"><textarea class="dialog-textarea" placeholder="请输入咨询内容..." maxlength="500" value="{{p}}" bindinput="{{q}}"></textarea></block><view class="dialog-actions"><view class="btn" bindtap="{{r}}">取消</view><view class="btn primary" bindtap="{{s}}">提交</view></view></view></view><view class="notice"><view class="notice-left">公告</view><view wx:if="{{w}}" class="notice-swiper" style="display:flex;align-items:center;color:#6b5a2a">加载中...</view><view wx:elif="{{x}}" class="notice-swiper" style="display:flex;align-items:center;color:#dd524d">{{y}}</view><view wx:elif="{{z}}" class="notice-swiper" style="display:flex;align-items:center;color:#6b5a2a">暂无公告</view><swiper wx:else class="notice-swiper" circular autoplay interval="4000" duration="400" vertical><swiper-item wx:for="{{A}}" wx:for-item="n" wx:key="e"><view class="notice-item" bindtap="{{n.d}}"><text class="notice-text">{{n.a}}</text><text wx:if="{{n.b}}" class="notice-tag">{{n.c}}</text></view></swiper-item></swiper></view><view class="section-title"><text class="section-text">常用功能</text></view><view class="grid-wrap"><view class="feature-grid"><view wx:for="{{B}}" wx:for-item="item" wx:key="g" class="feature-card" bindtap="{{item.h}}"><view class="fc-icon"><image wx:if="{{item.a}}" src="{{item.b}}" class="fc-img" mode="aspectFit" binderror="{{item.c}}"></image><text wx:elif="{{item.d}}" class="fc-emoji">{{item.e}}</text><view wx:else class="fc-placeholder"></view></view><view class="fc-title">{{item.f}}</view></view></view></view></view>

View File

@@ -24,6 +24,7 @@
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/* 表单控件尺寸(统一配置,避免页面内硬编码) */
page {
height: 100%;
overflow: hidden;

View File

@@ -24,6 +24,7 @@
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/* 表单控件尺寸(统一配置,避免页面内硬编码) */
.about {
padding: 24rpx;
}

View File

@@ -182,9 +182,16 @@ const _sfc_main = {
if (!value)
return "-";
const s = String(value);
const m = s.match(/^(\d{4}-\d{2}-\d{2})([ T](\d{2}:\d{2}))/);
const m = s.match(/^(\d{4}-\d{2}-\d{2})/);
if (m)
return `${m[1]} ${m[3]}`;
return m[1];
const d = new Date(s);
if (!isNaN(d.getTime())) {
const y = d.getFullYear();
const mo = String(d.getMonth() + 1).padStart(2, "0");
const da = String(d.getDate()).padStart(2, "0");
return `${y}-${mo}-${da}`;
}
return s;
},
startLogin() {

View File

@@ -24,6 +24,7 @@
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/* 表单控件尺寸(统一配置,避免页面内硬编码) */
.me {
padding: 24rpx;
}

View File

@@ -24,6 +24,7 @@
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/* 表单控件尺寸(统一配置,避免页面内硬编码) */
.orders {
padding: 16rpx 16rpx calc(env(safe-area-inset-bottom) + 16rpx);
}

View File

@@ -24,6 +24,7 @@
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/* 表单控件尺寸(统一配置,避免页面内硬编码) */
.security {
padding: 24rpx;
}

View File

@@ -8,21 +8,67 @@ const _sfc_main = {
isVip: false,
expire: "",
price: 0,
benefits: []
benefits: [],
normalAdmin: { isNormalAdmin: false, applicationStatus: "none" }
};
},
onShow() {
this.loadVip();
this.loadNormalAdminStatus();
this.composeBenefits();
},
computed: {
expireDisplay() {
const s = String(this.expire || "");
return s || "11年11月11日";
const v = this.expire;
if (v === null || v === void 0)
return "";
if (typeof v === "number") {
const d = new Date(v);
if (!isNaN(d.getTime())) {
const y = d.getFullYear();
const m2 = String(d.getMonth() + 1).padStart(2, "0");
const dd = String(d.getDate()).padStart(2, "0");
return `${y}-${m2}-${dd}`;
}
return "";
}
const s = String(v);
const m = s.match(/^(\d{4}-\d{2}-\d{2})/);
if (m)
return m[1];
const idx = s.search(/[ T]/);
if (idx > 0) {
const head = s.slice(0, idx);
if (head)
return head;
}
const d2 = new Date(s);
if (!isNaN(d2.getTime())) {
const y = d2.getFullYear();
const m2 = String(d2.getMonth() + 1).padStart(2, "0");
const dd2 = String(d2.getDate()).padStart(2, "0");
return `${y}-${m2}-${dd2}`;
}
return s;
},
priceDisplay() {
const n = Number(this.price);
return Number.isFinite(n) && n > 0 ? n.toFixed(2) : "0.00";
},
applyDisabled() {
var _a, _b;
const s = String(((_a = this.normalAdmin) == null ? void 0 : _a.applicationStatus) || "none");
return !!(((_b = this.normalAdmin) == null ? void 0 : _b.isNormalAdmin) || s === "approved" || s === "pending");
},
applyBtnText() {
var _a, _b, _c;
if (((_a = this.normalAdmin) == null ? void 0 : _a.isNormalAdmin) || ((_b = this.normalAdmin) == null ? void 0 : _b.applicationStatus) === "approved")
return "已通过";
if (((_c = this.normalAdmin) == null ? void 0 : _c.applicationStatus) === "pending")
return "审核中";
if (!this.isVip)
return "仅限VIP";
return "提交申请";
}
},
methods: {
@@ -44,6 +90,17 @@ const _sfc_main = {
this.isVip = false;
}
},
async loadNormalAdminStatus() {
try {
const data = await common_http.get("/api/normal-admin/application/status");
this.normalAdmin = {
isNormalAdmin: !!(data == null ? void 0 : data.isNormalAdmin),
applicationStatus: String((data == null ? void 0 : data.applicationStatus) || "none")
};
} catch (e) {
this.normalAdmin = { isNormalAdmin: false, applicationStatus: "none" };
}
},
async onPay() {
try {
await common_http.post("/api/vip/pay", {});
@@ -52,6 +109,20 @@ const _sfc_main = {
} catch (e) {
common_vendor.index.showToast({ title: String(e.message || "开通失败"), icon: "none" });
}
},
async onApplyNormalAdmin() {
var _a, _b, _c;
if (this.applyDisabled) {
const msg = ((_a = this.normalAdmin) == null ? void 0 : _a.isNormalAdmin) || ((_b = this.normalAdmin) == null ? void 0 : _b.applicationStatus) === "approved" ? "已通过,无需重复申请" : ((_c = this.normalAdmin) == null ? void 0 : _c.applicationStatus) === "pending" ? "审核中,请耐心等待" : "不可申请";
return common_vendor.index.showToast({ title: msg, icon: "none" });
}
try {
await common_http.post("/api/normal-admin/apply", { remark: "从我的-会员发起申请" });
common_vendor.index.showToast({ title: "申请已提交", icon: "success" });
await this.loadNormalAdminStatus();
} catch (e) {
common_vendor.index.showToast({ title: String(e.message || "申请失败"), icon: "none" });
}
}
}
};
@@ -79,9 +150,17 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
e: item.key
});
}),
j: !$data.isVip
j: $data.isVip
}, $data.isVip ? {
k: common_vendor.t($options.applyBtnText),
l: common_vendor.n({
disabled: $options.applyDisabled
}),
m: common_vendor.o((...args) => $options.onApplyNormalAdmin && $options.onApplyNormalAdmin(...args))
} : {}, {
n: !$data.isVip
}, !$data.isVip ? {
k: common_vendor.o((...args) => $options.onPay && $options.onPay(...args))
o: common_vendor.o((...args) => $options.onPay && $options.onPay(...args))
} : {});
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);

View File

@@ -1 +1 @@
<view class="vip-page"><view class="vip-hero"><image class="hero-icon" src="{{a}}" mode="aspectFit"/><view class="hero-text"><text class="hero-title">{{b}}</text><text class="hero-subtitle">{{c}}</text></view><view class="{{['status-pill', e && 'active']}}"><text>{{d}}</text></view></view><view wx:if="{{f}}" class="vip-summary"><view class="summary-item"><text class="summary-label">会员状态</text><text class="summary-value success">已激活</text></view><view class="summary-item"><text class="summary-label">有效期至</text><text class="summary-value">{{g}}</text></view></view><view wx:else class="vip-summary"><view class="summary-item"><text class="summary-label">当前身份</text><text class="summary-value">普通用户</text></view><view class="summary-item"><text class="summary-label">会员价格</text><text class="summary-value highlight">¥{{h}}/月</text></view></view><view class="benefit-section"><view class="section-header"><text class="section-title">会员特权</text><text class="section-subtitle">聚焦数据留存与专业形象,让经营更有底气</text></view><view class="benefit-grid"><view wx:for="{{i}}" wx:for-item="item" wx:key="e" class="benefit-card"><image wx:if="{{item.a}}" src="{{item.b}}" class="benefit-icon" mode="aspectFit"/><text class="benefit-title">{{item.c}}</text><text class="benefit-desc">{{item.d}}</text></view></view></view><view wx:if="{{j}}" class="purchase-card"><view class="purchase-text"><text class="purchase-title">立即升级 VIP</text><text class="purchase-desc">不限历史数据、专属标识,助您高效管账</text></view><button class="purchase-btn" bindtap="{{k}}"><text>立即开通</text></button></view></view>
<view class="vip-page"><view class="vip-hero"><image class="hero-icon" src="{{a}}" mode="aspectFit"/><view class="hero-text"><text class="hero-title">{{b}}</text><text class="hero-subtitle">{{c}}</text></view><view class="{{['status-pill', e && 'active']}}"><text>{{d}}</text></view></view><view wx:if="{{f}}" class="vip-summary"><view class="summary-item"><text class="summary-label">会员状态</text><text class="summary-value success">已激活</text></view><view class="summary-item"><text class="summary-label">有效期至</text><text class="summary-value">{{g}}</text></view></view><view wx:else class="vip-summary"><view class="summary-item"><text class="summary-label">当前身份</text><text class="summary-value">普通用户</text></view><view class="summary-item"><text class="summary-label">会员价格</text><text class="summary-value highlight">¥{{h}}/月</text></view></view><view class="benefit-section"><view class="section-header"><text class="section-title">会员特权</text><text class="section-subtitle">聚焦数据留存与专业形象,让经营更有底气</text></view><view class="benefit-grid"><view wx:for="{{i}}" wx:for-item="item" wx:key="e" class="benefit-card"><image wx:if="{{item.a}}" src="{{item.b}}" class="benefit-icon" mode="aspectFit"/><text class="benefit-title">{{item.c}}</text><text class="benefit-desc">{{item.d}}</text></view></view></view><view wx:if="{{j}}" class="apply-card"><view class="apply-text"><text class="apply-title">申请成为普通管理员</text><text class="apply-desc">在普通管理端参与配件审核</text></view><view role="button" class="{{['apply-btn', l]}}" bindtap="{{m}}"><text>{{k}}</text></view></view><view wx:if="{{n}}" class="purchase-card"><view class="purchase-text"><text class="purchase-title">立即升级 VIP</text><text class="purchase-desc">不限历史数据、专属标识,助您高效管账</text></view><button class="purchase-btn" bindtap="{{o}}"><text>立即开通</text></button></view></view>

View File

@@ -24,6 +24,7 @@
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/* 表单控件尺寸(统一配置,避免页面内硬编码) */
page {
background: linear-gradient(180deg, #f8fbff 0%, #ffffff 60%) !important;
}
@@ -84,6 +85,11 @@ page {
color: #fff;
border-color: #4c8dff;
}
/* 指定 hero 内激活态徽标文本为黑色 */
.vip-hero .status-pill.active text {
color: #000 !important;
}
.vip-summary {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
@@ -214,6 +220,58 @@ page {
.purchase-btn:active {
opacity: 0.88;
}
.apply-card {
margin-top: 0;
background: linear-gradient(135deg, rgba(30, 173, 145, 0.14) 0%, rgba(30, 173, 145, 0.06) 100%);
border-radius: 28rpx;
padding: 30rpx 28rpx;
display: flex;
align-items: center;
gap: 24rpx;
border: 2rpx solid rgba(30, 173, 145, 0.18);
box-shadow: 0 10rpx 24rpx rgba(30, 173, 145, 0.15);
}
.apply-text {
flex: 1;
display: flex;
flex-direction: column;
gap: 10rpx;
}
.apply-title {
font-size: 32rpx;
font-weight: 800;
color: #1ead91;
}
.apply-desc {
font-size: 24rpx;
color: #247a66;
line-height: 34rpx;
}
.apply-btn {
flex: 0 0 auto;
padding: 20rpx 36rpx;
border-radius: 999rpx;
border: none;
background-color: transparent;
background: linear-gradient(135deg, #1ead91 0%, #159b7e 100%);
color: #fff;
font-size: 28rpx;
font-weight: 700;
box-shadow: 0 10rpx 22rpx rgba(21, 155, 126, 0.2);
}
.apply-btn::after {
border: none;
}
.apply-btn:active {
opacity: 0.9;
}
.apply-btn.disabled {
opacity: 0.5;
background: #c7e8df;
color: #fff;
box-shadow: none;
pointer-events: none;
}
@media (max-width: 375px) {
.vip-summary {
grid-template-columns: 1fr;

View File

@@ -24,6 +24,7 @@
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/* 表单控件尺寸(统一配置,避免页面内硬编码) */
.order {
padding-bottom: 140rpx;
}

View File

@@ -13,22 +13,12 @@ const _sfc_main = {
brand: "",
model: "",
spec: "",
origin: "",
categoryId: "",
unitId: "",
stock: null,
safeMin: null,
safeMax: null,
purchasePrice: null,
retailPrice: null,
wholesalePrice: null,
bigClientPrice: null,
images: [],
remark: "",
platformStatus: "",
sourceSubmissionId: ""
},
units: [],
categories: [],
keyboardHeight: 0
};
@@ -42,16 +32,9 @@ const _sfc_main = {
this.disposeKeyboardListener();
},
computed: {
unitNames() {
return this.units.map((u) => u.name);
},
categoryNames() {
return this.categories.map((c) => c.name);
},
unitLabel() {
const u = this.units.find((x) => String(x.id) === String(this.form.unitId));
return u ? u.name : "选择单位";
},
categoryLabel() {
const c = this.categories.find((x) => String(x.id) === String(this.form.categoryId));
return c ? c.name : "选择类别";
@@ -59,7 +42,7 @@ const _sfc_main = {
},
methods: {
async bootstrap() {
await Promise.all([this.fetchUnits(), this.fetchCategories()]);
await Promise.all([this.fetchCategories()]);
if (this.id)
this.loadDetail();
},
@@ -81,13 +64,6 @@ const _sfc_main = {
} catch (_) {
}
},
async fetchUnits() {
try {
const res = await common_http.get("/api/product-units");
this.units = Array.isArray(res == null ? void 0 : res.list) ? res.list : Array.isArray(res) ? res : [];
} catch (_) {
}
},
async fetchCategories() {
try {
const res = await common_http.get("/api/product-categories");
@@ -95,11 +71,6 @@ const _sfc_main = {
} catch (_) {
}
},
onPickUnit(e) {
const idx = Number(e.detail.value);
const u = this.units[idx];
this.form.unitId = u ? u.id : "";
},
onPickCategory(e) {
const idx = Number(e.detail.value);
const c = this.categories[idx];
@@ -136,16 +107,7 @@ const _sfc_main = {
brand: data.brand,
model: data.model,
spec: data.spec,
origin: data.origin,
categoryId: data.categoryId,
unitId: data.unitId,
stock: data.stock,
safeMin: data.safeMin,
safeMax: data.safeMax,
purchasePrice: data.purchasePrice,
retailPrice: data.retailPrice,
wholesalePrice: data.wholesalePrice,
bigClientPrice: data.bigClientPrice,
images: (data.images || []).map((i) => i.url || i),
remark: data.remark || "",
platformStatus: data.platformStatus || "",
@@ -159,10 +121,6 @@ const _sfc_main = {
common_vendor.index.showToast({ title: "请填写名称", icon: "none" });
return false;
}
if (this.form.safeMin != null && this.form.safeMax != null && Number(this.form.safeMin) > Number(this.form.safeMax)) {
common_vendor.index.showToast({ title: "安全库存区间不合法", icon: "none" });
return false;
}
return true;
},
buildPayload() {
@@ -173,18 +131,7 @@ const _sfc_main = {
brand: f.brand,
model: f.model,
spec: f.spec,
origin: f.origin,
categoryId: f.categoryId || null,
unitId: f.unitId,
safeMin: f.safeMin,
safeMax: f.safeMax,
prices: {
purchasePrice: f.purchasePrice,
retailPrice: f.retailPrice,
wholesalePrice: f.wholesalePrice,
bigClientPrice: f.bigClientPrice
},
stock: f.stock,
images: f.images,
remark: f.remark
};
@@ -204,7 +151,7 @@ const _sfc_main = {
await common_http.post("/api/products", payload);
common_vendor.index.showToast({ title: "保存成功", icon: "success", mask: false });
if (goOn && !this.id) {
this.form = { name: "", barcode: "", brand: "", model: "", spec: "", origin: "", categoryId: "", unitId: "", stock: null, safeMin: null, safeMax: null, purchasePrice: null, retailPrice: null, wholesalePrice: null, bigClientPrice: null, images: [], remark: "", platformStatus: "", sourceSubmissionId: "" };
this.form = { name: "", barcode: "", brand: "", model: "", spec: "", categoryId: "", images: [], remark: "", platformStatus: "", sourceSubmissionId: "" };
} else {
setTimeout(() => common_vendor.index.navigateBack(), 400);
}
@@ -244,58 +191,23 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
m: common_vendor.o(common_vendor.m(($event) => $data.form.spec = $event.detail.value, {
trim: true
})),
n: $data.form.origin,
o: common_vendor.o(common_vendor.m(($event) => $data.form.origin = $event.detail.value, {
trim: true
})),
p: common_vendor.t($options.unitLabel),
q: $options.unitNames,
r: common_vendor.o((...args) => $options.onPickUnit && $options.onPickUnit(...args)),
s: common_vendor.t($options.categoryLabel),
t: $options.categoryNames,
v: common_vendor.o((...args) => $options.onPickCategory && $options.onPickCategory(...args)),
w: $data.form.stock,
x: common_vendor.o(common_vendor.m(($event) => $data.form.stock = $event.detail.value, {
number: true
})),
y: $data.form.safeMin,
z: common_vendor.o(common_vendor.m(($event) => $data.form.safeMin = $event.detail.value, {
number: true
})),
A: $data.form.safeMax,
B: common_vendor.o(common_vendor.m(($event) => $data.form.safeMax = $event.detail.value, {
number: true
})),
C: $data.form.purchasePrice,
D: common_vendor.o(common_vendor.m(($event) => $data.form.purchasePrice = $event.detail.value, {
number: true
})),
E: $data.form.retailPrice,
F: common_vendor.o(common_vendor.m(($event) => $data.form.retailPrice = $event.detail.value, {
number: true
})),
G: $data.form.wholesalePrice,
H: common_vendor.o(common_vendor.m(($event) => $data.form.wholesalePrice = $event.detail.value, {
number: true
})),
I: $data.form.bigClientPrice,
J: common_vendor.o(common_vendor.m(($event) => $data.form.bigClientPrice = $event.detail.value, {
number: true
})),
K: common_vendor.o(($event) => $data.form.images = $event),
L: common_vendor.p({
n: common_vendor.t($options.categoryLabel),
o: $options.categoryNames,
p: common_vendor.o((...args) => $options.onPickCategory && $options.onPickCategory(...args)),
q: common_vendor.o(($event) => $data.form.images = $event),
r: common_vendor.p({
formData: {
ownerType: "product"
},
modelValue: $data.form.images
}),
M: $data.form.remark,
N: common_vendor.o(common_vendor.m(($event) => $data.form.remark = $event.detail.value, {
s: $data.form.remark,
t: common_vendor.o(common_vendor.m(($event) => $data.form.remark = $event.detail.value, {
trim: true
})),
O: common_vendor.o(($event) => $options.save(false)),
P: common_vendor.o(($event) => $options.save(true)),
Q: ($data.keyboardHeight || 0) + "px"
v: common_vendor.o(($event) => $options.save(false)),
w: common_vendor.o(($event) => $options.save(true)),
x: ($data.keyboardHeight || 0) + "px"
});
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);

View File

@@ -1 +1 @@
<scroll-view scroll-y class="page"><view class="hero small"><text class="title">编辑货品</text><text class="sub">完善基础信息与价格</text></view><view wx:if="{{a}}" class="tip platform">平台推荐货品,建议谨慎修改核心字段</view><view wx:elif="{{b}}" class="tip custom">此货品源于我的提交,审核通过后已入库</view><view class="section"><view class="row"><text class="label">商品名称</text><input placeholder="必填" value="{{c}}" bindinput="{{d}}"/></view><view class="row"><text class="label">条形码</text><input class="input-long" placeholder="可扫码或输入" value="{{e}}" bindinput="{{f}}"/><button size="mini" class="picker-btn" bindtap="{{g}}">图片识码</button></view><view class="row"><input placeholder="品牌" value="{{h}}" bindinput="{{i}}"/></view><view class="row"><input placeholder="型号" value="{{j}}" bindinput="{{k}}"/></view><view class="row"><input placeholder="规格" value="{{l}}" bindinput="{{m}}"/></view><view class="row"><input placeholder="产地" value="{{n}}" bindinput="{{o}}"/></view><view class="row"><picker mode="selector" range="{{q}}" bindchange="{{r}}"><view class="picker">主单位:{{p}}</view></picker><picker mode="selector" range="{{t}}" bindchange="{{v}}"><view class="picker">类别:{{s}}</view></picker></view></view><view class="section"><view class="row"><text class="label">库存与安全库存</text></view><view class="row"><input type="number" placeholder="当前库存" value="{{w}}" bindinput="{{x}}"/><input type="number" placeholder="安全库存下限" value="{{y}}" bindinput="{{z}}"/><input type="number" placeholder="安全库存上限" value="{{A}}" bindinput="{{B}}"/></view></view><view class="section"><view class="row"><text class="label">价格(进价/零售/批发/大单)</text></view><view class="row prices"><input type="number" placeholder="进货价" value="{{C}}" bindinput="{{D}}"/><input type="number" placeholder="零售价" value="{{E}}" bindinput="{{F}}"/><input type="number" placeholder="批发价" value="{{G}}" bindinput="{{H}}"/><input type="number" placeholder="大单价" value="{{I}}" bindinput="{{J}}"/></view></view><view class="section"><text class="label">图片</text><image-uploader wx:if="{{L}}" u-i="4a3f460a-0" bind:__l="__l" bindupdateModelValue="{{K}}" u-p="{{L}}"/></view><view class="section"><text class="label">备注</text><block wx:if="{{r0}}"><textarea placeholder="可选" auto-height value="{{M}}" bindinput="{{N}}"/></block></view><view class="fixed" style="{{'bottom:' + Q}}"><button class="ghost" bindtap="{{O}}">保存</button><button class="primary" bindtap="{{P}}">保存并继续</button></view></scroll-view>
<scroll-view scroll-y class="page"><view class="hero small"><text class="title">编辑货品</text><text class="sub">完善基础信息与价格</text></view><view wx:if="{{a}}" class="tip platform">平台推荐货品,建议谨慎修改核心字段</view><view wx:elif="{{b}}" class="tip custom">此货品源于我的提交,审核通过后已入库</view><view class="section"><view class="row"><text class="label">商品名称</text><input placeholder="必填" value="{{c}}" bindinput="{{d}}"/></view><view class="row"><text class="label">条形码</text><input class="input-long" placeholder="可扫码或输入" value="{{e}}" bindinput="{{f}}"/><button size="mini" class="picker-btn" bindtap="{{g}}">图片识码</button></view><view class="row"><input placeholder="品牌" value="{{h}}" bindinput="{{i}}"/></view><view class="row"><input placeholder="型号" value="{{j}}" bindinput="{{k}}"/></view><view class="row"><input placeholder="规格" value="{{l}}" bindinput="{{m}}"/></view><view class="row"><picker mode="selector" range="{{o}}" bindchange="{{p}}"><view class="picker">类别:{{n}}</view></picker></view></view><view class="section"><text class="label">图片</text><image-uploader wx:if="{{r}}" u-i="4a3f460a-0" bind:__l="__l" bindupdateModelValue="{{q}}" u-p="{{r}}"/></view><view class="section"><text class="label">备注</text><block wx:if="{{r0}}"><textarea placeholder="可选" auto-height value="{{s}}" bindinput="{{t}}"/></block></view><view class="fixed" style="{{'bottom:' + x}}"><button class="ghost" bindtap="{{v}}">保存</button><button class="primary" bindtap="{{w}}">保存并继续</button></view></scroll-view>

View File

@@ -24,6 +24,7 @@
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/* 表单控件尺寸(统一配置,避免页面内硬编码) */
.page {
background: #ffffff;
min-height: 100vh;

View File

@@ -5,11 +5,13 @@ const _sfc_main = {
data() {
return {
items: [],
query: { kw: "", page: 1, size: 20, categoryId: "" },
query: { kw: "", page: 1, size: 20, categoryId: "", mode: "direct", templateId: "", params: {} },
finished: false,
loading: false,
tab: "all",
categories: []
categories: [],
templates: [],
paramValues: {}
};
},
onLoad() {
@@ -48,19 +50,57 @@ const _sfc_main = {
categoryLabel() {
const c = this.categories.find((x) => String(x.id) === String(this.query.categoryId));
return c ? "类别:" + c.name : "选择类别";
},
modeLabel() {
const map = { direct: "直接查询", nameLike: "名称模糊查询", template: "按模板参数查询" };
return map[this.query.mode] || "直接查询";
},
templateNames() {
return this.templates.map((t) => t.name);
},
templateLabel() {
const t = this.templates.find((x) => String(x.id) === String(this.query.templateId));
return t ? "模板:" + t.name : "选择模板";
},
selectedTemplate() {
return this.templates.find((t) => String(t.id) === String(this.query.templateId)) || null;
},
selectedTemplateParams() {
return this.selectedTemplate && Array.isArray(this.selectedTemplate.params) ? this.selectedTemplate.params : [];
}
},
methods: {
switchTab(t) {
this.tab = t;
this.query.categoryId = "";
this.query.templateId = "";
this.paramValues = {};
this.reload();
},
onPickCategory(e) {
const idx = Number(e.detail.value);
const c = this.categories[idx];
this.query.categoryId = c ? c.id : "";
this.reload();
this.fetchTemplates();
},
onPickTemplate(e) {
const idx = Number(e.detail.value);
const t = this.templates[idx];
this.query.templateId = t ? t.id : "";
this.paramValues = {};
},
onPickParamEnumWrapper(p, e) {
const idx = Number(e.detail.value);
const arr = p.enumOptions || [];
this.paramValues[p.fieldKey] = arr[idx];
},
onParamBoolChange(p, e) {
var _a;
this.paramValues[p.fieldKey] = ((_a = e == null ? void 0 : e.detail) == null ? void 0 : _a.value) ? true : false;
},
onParamDateChange(p, e) {
var _a;
this.paramValues[p.fieldKey] = ((_a = e == null ? void 0 : e.detail) == null ? void 0 : _a.value) || "";
},
async fetchCategories() {
try {
@@ -69,6 +109,15 @@ const _sfc_main = {
} catch (_) {
}
},
async fetchTemplates() {
try {
const res = await common_http.get("/api/product-templates", this.query.categoryId ? { categoryId: this.query.categoryId } : {});
const list = Array.isArray(res == null ? void 0 : res.list) ? res.list : Array.isArray(res) ? res : [];
this.templates = list;
} catch (_) {
this.templates = [];
}
},
reload() {
this.items = [];
this.query.page = 1;
@@ -81,8 +130,19 @@ const _sfc_main = {
this.loading = true;
try {
const params = { kw: this.query.kw, page: this.query.page, size: this.query.size };
if (this.tab === "category" && this.query.categoryId)
params.categoryId = this.query.categoryId;
if (this.tab === "search") {
if (this.query.categoryId)
params.categoryId = this.query.categoryId;
if (this.query.templateId)
params.templateId = this.query.templateId;
if (this.paramValues && Object.keys(this.paramValues).length) {
for (const k of Object.keys(this.paramValues)) {
const v = this.paramValues[k];
if (v !== void 0 && v !== null && v !== "")
params["param_" + k] = v;
}
}
}
const res = await common_http.get("/api/products", params);
const list = Array.isArray(res == null ? void 0 : res.list) ? res.list : Array.isArray(res) ? res : [];
this.items = this.items.concat(list);
@@ -95,12 +155,26 @@ const _sfc_main = {
this.loading = false;
}
},
openForm(id) {
const url = "/pages/product/form" + (id ? "?id=" + id : "");
common_vendor.index.navigateTo({ url });
openDetail(id) {
common_vendor.index.navigateTo({ url: "/pages/product/product-detail?id=" + id });
},
goMySubmissions() {
common_vendor.index.navigateTo({ url: "/pages/product/submissions" });
},
async remove(it) {
try {
const r = await new Promise((resolve) => {
common_vendor.index.showModal({ content: "确认删除该货品?删除后可在后台恢复", success: resolve });
});
if (!r || !r.confirm)
return;
const { del } = require("../../common/http.js");
await del("/api/products/" + it.id);
common_vendor.index.showToast({ title: "已删除", icon: "success" });
this.reload();
} catch (e) {
common_vendor.index.showToast({ title: "删除失败", icon: "none" });
}
}
}
};
@@ -108,44 +182,96 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: $data.tab === "all" ? 1 : "",
b: common_vendor.o(($event) => $options.switchTab("all")),
c: $data.tab === "category" ? 1 : "",
d: common_vendor.o(($event) => $options.switchTab("category")),
c: $data.tab === "search" ? 1 : "",
d: common_vendor.o(($event) => $options.switchTab("search")),
e: common_vendor.o((...args) => $options.goMySubmissions && $options.goMySubmissions(...args)),
f: common_vendor.o((...args) => $options.reload && $options.reload(...args)),
g: $data.query.kw,
h: common_vendor.o(common_vendor.m(($event) => $data.query.kw = $event.detail.value, {
f: $data.tab === "search"
}, $data.tab === "search" ? common_vendor.e({
g: common_vendor.t($options.modeLabel),
h: ["直接查询", "名称模糊查询", "按模板参数查询"],
i: common_vendor.o((e) => $data.query.mode = ["direct", "nameLike", "template"][Number(e.detail.value)] || "direct"),
j: $data.query.mode === "direct" || $data.query.mode === "nameLike"
}, $data.query.mode === "direct" || $data.query.mode === "nameLike" ? {
k: common_vendor.o((...args) => $options.reload && $options.reload(...args)),
l: $data.query.kw,
m: common_vendor.o(common_vendor.m(($event) => $data.query.kw = $event.detail.value, {
trim: true
})),
i: $data.tab === "category"
}, $data.tab === "category" ? {
j: common_vendor.t($options.categoryLabel),
k: $options.categoryNames,
l: common_vendor.o((...args) => $options.onPickCategory && $options.onPickCategory(...args))
}))
} : {}, {
m: common_vendor.o((...args) => $options.reload && $options.reload(...args)),
n: $data.items.length
n: $data.query.mode === "template"
}, $data.query.mode === "template" ? {
o: common_vendor.t($options.categoryLabel),
p: $options.categoryNames,
q: common_vendor.o((...args) => $options.onPickCategory && $options.onPickCategory(...args)),
r: common_vendor.t($options.templateLabel),
s: $options.templateNames,
t: common_vendor.o((...args) => $options.onPickTemplate && $options.onPickTemplate(...args)),
v: common_vendor.f($options.selectedTemplateParams, (p, idx, i0) => {
return common_vendor.e({
a: p.type === "string"
}, p.type === "string" ? {
b: "输入" + p.fieldLabel,
c: $data.paramValues[p.fieldKey],
d: common_vendor.o(common_vendor.m(($event) => $data.paramValues[p.fieldKey] = $event.detail.value, {
trim: true
}), p.fieldKey)
} : p.type === "number" ? {
f: "输入" + p.fieldLabel,
g: $data.paramValues[p.fieldKey],
h: common_vendor.o(common_vendor.m(($event) => $data.paramValues[p.fieldKey] = $event.detail.value, {
number: true
}), p.fieldKey)
} : p.type === "boolean" ? {
j: !!$data.paramValues[p.fieldKey],
k: common_vendor.o(($event) => $options.onParamBoolChange(p, $event), p.fieldKey)
} : p.type === "enum" ? {
m: common_vendor.t(_ctx.displayParamEnum(p)),
n: p.enumOptions || [],
o: common_vendor.o(($event) => $options.onPickParamEnumWrapper(p, $event), p.fieldKey)
} : p.type === "date" ? {
q: common_vendor.t($data.paramValues[p.fieldKey] || "选择" + p.fieldLabel),
r: common_vendor.o(($event) => $options.onParamDateChange(p, $event), p.fieldKey)
} : {
s: "输入" + p.fieldLabel,
t: $data.paramValues[p.fieldKey],
v: common_vendor.o(common_vendor.m(($event) => $data.paramValues[p.fieldKey] = $event.detail.value, {
trim: true
}), p.fieldKey)
}, {
e: p.type === "number",
i: p.type === "boolean",
l: p.type === "enum",
p: p.type === "date",
w: p.fieldKey
});
})
} : {}, {
w: common_vendor.o((...args) => $options.reload && $options.reload(...args)),
x: $data.query.mode === "template" ? 1 : ""
}) : {}, {
y: $data.items.length
}, $data.items.length ? {
o: common_vendor.f($data.items, (it, k0, i0) => {
z: common_vendor.f($data.items, (it, k0, i0) => {
return common_vendor.e({
a: it.cover
}, it.cover ? {
b: it.cover
} : {}, {
c: common_vendor.t(it.name),
d: it.platformStatus === "platform"
d: it.deleted
}, it.deleted ? {} : {}, {
e: it.platformStatus === "platform"
}, it.platformStatus === "platform" ? {} : it.sourceSubmissionId ? {} : {}, {
e: it.sourceSubmissionId,
f: common_vendor.t(it.brand || "-"),
g: common_vendor.t(it.model || ""),
h: common_vendor.t(it.spec || ""),
i: common_vendor.t(it.stock ?? 0),
j: common_vendor.t((it.retailPrice ?? it.price ?? 0).toFixed(2)),
k: it.id,
l: common_vendor.o(($event) => $options.openForm(it.id), it.id)
f: it.sourceSubmissionId,
g: common_vendor.t(it.brand || "-"),
h: common_vendor.t(it.model || ""),
i: common_vendor.t(it.spec || ""),
j: it.id,
k: common_vendor.o(($event) => $options.openDetail(it.id), it.id)
});
})
} : {}, {
p: common_vendor.o((...args) => $options.loadMore && $options.loadMore(...args))
A: common_vendor.o((...args) => $options.loadMore && $options.loadMore(...args))
});
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);

View File

@@ -1 +1 @@
<view class="page"><view class="tabs"><view class="{{['tab', a && 'active']}}" bindtap="{{b}}">全部</view><view class="{{['tab', c && 'active']}}" bindtap="{{d}}">按类别</view><view class="tab extra" bindtap="{{e}}">我的提交</view></view><view class="search"><input placeholder="输入名称/条码/规格查询" bindconfirm="{{f}}" value="{{g}}" bindinput="{{h}}"/><picker wx:if="{{i}}" mode="selector" range="{{k}}" bindchange="{{l}}"><view class="picker">{{j}}</view></picker><button size="mini" bindtap="{{m}}">查询</button></view><scroll-view scroll-y class="list" bindscrolltolower="{{p}}"><block wx:if="{{n}}"><view wx:for="{{o}}" wx:for-item="it" wx:key="k" class="item" bindtap="{{it.l}}"><image wx:if="{{it.a}}" src="{{it.b}}" class="thumb" mode="aspectFill"/><view class="content"><view class="name"><text>{{it.c}}</text><text wx:if="{{it.d}}" class="tag-platform">平台推荐</text><text wx:elif="{{it.e}}" class="tag-custom">我的提交</text></view><view class="meta">{{it.f}} {{it.g}} {{it.h}}</view><view class="meta">库存:{{it.i}} <text class="price">零售价:¥{{it.j}}</text></view></view></view></block><view wx:else class="empty"><text>暂无数据,点击右上角“+”新增</text></view></scroll-view></view>
<view class="page"><view class="tabs"><view class="{{['tab', a && 'active']}}" bindtap="{{b}}">全部</view><view class="{{['tab', c && 'active']}}" bindtap="{{d}}">查询</view><view class="tab extra" bindtap="{{e}}">我的提交</view></view><view wx:if="{{f}}" class="{{['search', x && 'template-mode']}}"><view class="mode"><picker mode="selector" range="{{h}}" bindchange="{{i}}"><view class="picker">{{g}}</view></picker></view><block wx:if="{{j}}"><input placeholder="输入名称/条码/规格查询" bindconfirm="{{k}}" value="{{l}}" bindinput="{{m}}"/></block><block wx:if="{{n}}"><view class="picker-row"><picker mode="selector" range="{{p}}" bindchange="{{q}}"><view class="picker">{{o}}</view></picker><picker mode="selector" range="{{s}}" bindchange="{{t}}"><view class="picker">{{r}}</view></picker></view><view class="params-wrap"><view wx:for="{{v}}" wx:for-item="p" wx:key="w" class="param-row"><input wx:if="{{p.a}}" placeholder="{{p.b}}" value="{{p.c}}" bindinput="{{p.d}}"/><input wx:elif="{{p.e}}" type="number" placeholder="{{p.f}}" value="{{p.g}}" bindinput="{{p.h}}"/><switch wx:elif="{{p.i}}" checked="{{p.j}}" bindchange="{{p.k}}"/><picker wx:elif="{{p.l}}" mode="selector" range="{{p.n}}" bindchange="{{p.o}}"><view class="picker">{{p.m}}</view></picker><picker wx:elif="{{p.p}}" mode="date" bindchange="{{p.r}}"><view class="picker">{{p.q}}</view></picker><input wx:else placeholder="{{p.s}}" value="{{p.t}}" bindinput="{{p.v}}"/></view></view></block><button size="mini" bindtap="{{w}}">查询</button></view><scroll-view scroll-y class="list" bindscrolltolower="{{A}}"><block wx:if="{{y}}"><view wx:for="{{z}}" wx:for-item="it" wx:key="j" class="item" bindtap="{{it.k}}"><image wx:if="{{it.a}}" src="{{it.b}}" class="thumb" mode="aspectFill"/><view class="content"><view class="name"><text>{{it.c}}</text><text wx:if="{{it.d}}" class="tag-deleted">已删除</text><text wx:if="{{it.e}}" class="tag-platform">平台推荐</text><text wx:elif="{{it.f}}" class="tag-custom">我的提交</text></view><view class="meta">{{it.g}} {{it.h}} {{it.i}}</view></view></view></block><view wx:else class="empty"><text>暂无数据,点击右上角“+”新增</text></view></scroll-view></view>

View File

@@ -24,6 +24,7 @@
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/* 表单控件尺寸(统一配置,避免页面内硬编码) */
.page {
display: flex;
flex-direction: column;
@@ -68,6 +69,21 @@
border-radius: 10rpx;
color: #444;
}
.template-mode {
flex-direction: column;
align-items: stretch;
gap: 8rpx;
}
.picker-row {
display: flex;
gap: 12rpx;
}
.params-wrap {
margin-top: 6rpx;
background: #ffffff;
border-radius: 12rpx;
padding: 8rpx 8rpx;
}
.list {
flex: 1;
}
@@ -109,6 +125,13 @@
padding: 4rpx 10rpx;
border-radius: 8rpx;
}
.tag-deleted {
font-size: 22rpx;
color: #fff;
background: #909399;
padding: 4rpx 10rpx;
border-radius: 8rpx;
}
.meta {
color: #444;
font-size: 24rpx;

View File

@@ -0,0 +1,170 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const common_http = require("../../common/http.js");
const _sfc_main = {
data() {
return { id: "", detail: null, categoryName: "-", templateName: "-" };
},
async onLoad(query) {
this.id = (query == null ? void 0 : query.id) || "";
if (!this.id) {
common_vendor.index.showToast({ title: "参数缺失", icon: "none" });
return;
}
await this.preloadDictionaries();
await this.loadDetail();
},
methods: {
async preloadDictionaries() {
try {
const needCats = !Array.isArray(common_vendor.index.getStorageSync("CACHE_CATEGORIES"));
const needTpls = !Array.isArray(common_vendor.index.getStorageSync("CACHE_TEMPLATES"));
if (!needCats && !needTpls)
return;
const reqs = [];
if (needCats)
reqs.push(common_http.get("/api/product-categories"));
if (needTpls)
reqs.push(common_http.get("/api/product-templates"));
const res = await Promise.all(reqs);
let idx = 0;
if (needCats) {
const r = res[idx++];
const list = Array.isArray(r == null ? void 0 : r.list) ? r.list : Array.isArray(r) ? r : [];
common_vendor.index.setStorageSync("CACHE_CATEGORIES", list);
}
if (needTpls) {
const r = res[idx++];
const list = Array.isArray(r == null ? void 0 : r.list) ? r.list : Array.isArray(r) ? r : [];
common_vendor.index.setStorageSync("CACHE_TEMPLATES", list);
}
} catch (_) {
}
},
async loadDetail() {
try {
const data = await common_http.get("/api/products/" + this.id);
this.detail = data;
this.categoryName = this.categoryLookup(data.categoryId);
this.templateName = this.templateLookup(data.templateId);
} catch (e) {
common_vendor.index.showToast({ title: (e == null ? void 0 : e.message) || "加载失败", icon: "none" });
}
},
preview(idx) {
var _a;
try {
const list = (((_a = this.detail) == null ? void 0 : _a.images) || []).map((i) => i.url || i);
common_vendor.index.previewImage({ urls: list, current: idx });
} catch (_) {
}
},
categoryLookup(id) {
try {
const list = common_vendor.index.getStorageSync("CACHE_CATEGORIES") || [];
const f = list.find((x) => String(x.id) === String(id));
return f ? f.name : "-";
} catch (_) {
return "-";
}
},
templateLookup(id) {
try {
const list = common_vendor.index.getStorageSync("CACHE_TEMPLATES") || [];
const f = list.find((x) => String(x.id) === String(id));
return f ? f.name : "-";
} catch (_) {
return "-";
}
},
async remove() {
try {
const r = await new Promise((resolve) => {
common_vendor.index.showModal({ content: "确认删除该货品?删除后可在后台恢复", success: resolve });
});
if (!r || !r.confirm)
return;
await common_http.del("/api/products/" + this.id);
common_vendor.index.showToast({ title: "已删除", icon: "success" });
setTimeout(() => common_vendor.index.navigateBack(), 400);
} catch (e) {
common_vendor.index.showToast({ title: "删除失败", icon: "none" });
}
},
back() {
common_vendor.index.navigateBack({ delta: 1 });
}
},
computed: {
labeledPairs() {
var _a;
const params = (_a = this.detail) == null ? void 0 : _a.parameters;
if (!params || typeof params !== "object")
return [];
let labelMap = {}, unitMap = {};
try {
const templates = common_vendor.index.getStorageSync("CACHE_TEMPLATES") || [];
const tpl = templates.find((t) => {
var _a2;
return String(t.id) === String((_a2 = this.detail) == null ? void 0 : _a2.templateId);
});
if (tpl && Array.isArray(tpl.params))
for (const p of tpl.params) {
labelMap[p.fieldKey] = p.fieldLabel;
unitMap[p.fieldKey] = p.unit;
}
} catch (_) {
}
return Object.keys(params).map((k) => ({ key: k, label: labelMap[k] || k, unit: unitMap[k] || "", value: params[k] }));
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: $data.detail
}, $data.detail ? common_vendor.e({
b: common_vendor.t($data.detail.model),
c: $data.detail.deleted
}, $data.detail.deleted ? {} : {}, {
d: common_vendor.t($data.detail.name || "-"),
e: common_vendor.t($data.detail.brand || "-"),
f: common_vendor.t($data.detail.model || "-"),
g: common_vendor.t($data.detail.barcode || "-"),
h: common_vendor.t($data.categoryName),
i: common_vendor.t($data.templateName),
j: $data.detail.externalCode
}, $data.detail.externalCode ? {
k: common_vendor.t($data.detail.externalCode)
} : {}, {
l: $options.labeledPairs.length
}, $options.labeledPairs.length ? {
m: common_vendor.f($options.labeledPairs, (item, k0, i0) => {
return common_vendor.e({
a: common_vendor.t(item.label),
b: item.unit
}, item.unit ? {
c: common_vendor.t(item.unit)
} : {}, {
d: common_vendor.t(item.value),
e: item.key
});
})
} : {}, {
n: $data.detail.images && $data.detail.images.length
}, $data.detail.images && $data.detail.images.length ? {
o: common_vendor.f($data.detail.images, (img, idx, i0) => {
return {
a: idx,
b: img.url || img,
c: common_vendor.o(($event) => $options.preview(idx), idx)
};
})
} : {}, {
p: common_vendor.t($data.detail.remark || "无"),
q: common_vendor.o((...args) => $options.back && $options.back(...args)),
r: common_vendor.o((...args) => $options.remove && $options.remove(...args))
}) : {});
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/product/product-detail.js.map

View File

@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "货品详情",
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<scroll-view wx:if="{{a}}" scroll-y class="page"><view class="header"><text class="model">{{b}}</text><text wx:if="{{c}}" class="status deleted">已删除</text></view><view class="section"><view class="row"><text class="label">名称</text><text class="value">{{d}}</text></view><view class="row"><text class="label">品牌</text><text class="value">{{e}}</text></view><view class="row"><text class="label">型号</text><text class="value">{{f}}</text></view><view class="row"><text class="label">条码</text><text class="value">{{g}}</text></view><view class="row"><text class="label">类别</text><text class="value">{{h}}</text></view><view class="row"><text class="label">模板</text><text class="value">{{i}}</text></view><view wx:if="{{j}}" class="row"><text class="label">编号</text><text class="value">{{k}}</text></view></view><view class="section"><view class="block-title">参数</view><view wx:if="{{l}}" class="params"><view wx:for="{{m}}" wx:for-item="item" wx:key="e" class="param"><text class="param-key">{{item.a}}<text wx:if="{{item.b}}">{{item.c}}</text></text><text class="param-val">{{item.d}}</text></view></view><view wx:else class="placeholder">未填写参数</view></view><view class="section"><view class="block-title">图片</view><view wx:if="{{n}}" class="images"><image wx:for="{{o}}" wx:for-item="img" wx:key="a" src="{{img.b}}" class="image" mode="aspectFill" bindtap="{{img.c}}"/></view><view wx:else class="placeholder">未上传图片</view></view><view class="section"><view class="block-title">备注</view><view class="placeholder">{{p}}</view></view><view class="footer"><button size="mini" bindtap="{{q}}">返回</button><button size="mini" type="warn" bindtap="{{r}}">删除</button></view></scroll-view><view wx:else class="loading">加载中...</view>

View File

@@ -0,0 +1,124 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 藏青系主色(高亮) */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/* 表单控件尺寸(统一配置,避免页面内硬编码) */
.page {
padding: 24rpx 24rpx 160rpx;
background: #f6f7fb;
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
}
.model {
font-size: 36rpx;
font-weight: 700;
color: #2d3a4a;
}
.status.deleted {
font-size: 24rpx;
padding: 6rpx 18rpx;
border-radius: 999rpx;
background: #c0c4cc;
color: #fff;
}
.section {
background: #fff;
border-radius: 16rpx;
padding: 20rpx 22rpx;
margin-bottom: 24rpx;
box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.04);
}
.row {
display: flex;
justify-content: space-between;
padding: 12rpx 0;
border-bottom: 1rpx solid #f1f2f5;
}
.row:last-child {
border-bottom: none;
}
.label {
width: 160rpx;
font-size: 26rpx;
color: #7a8899;
}
.value {
flex: 1;
text-align: right;
font-size: 26rpx;
color: #2d3a4a;
word-break: break-all;
}
.block-title {
font-size: 28rpx;
font-weight: 600;
color: #2d3a4a;
margin-bottom: 12rpx;
}
.placeholder {
font-size: 26rpx;
color: #7a8899;
}
.params {
display: flex;
flex-direction: column;
gap: 12rpx;
}
.param {
display: flex;
justify-content: space-between;
font-size: 26rpx;
color: #2d3a4a;
}
.param-key {
color: #7a8899;
}
.images {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 12rpx;
}
.image {
width: 100%;
height: 200rpx;
border-radius: 16rpx;
background: #f0f2f5;
}
.footer {
display: flex;
justify-content: flex-end;
gap: 20rpx;
}
.loading {
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
color: #7a8899;
}

View File

@@ -24,6 +24,7 @@
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/* 表单控件尺寸(统一配置,避免页面内硬编码) */
.page {
display: flex;
flex-direction: column;

View File

@@ -0,0 +1,201 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const common_http = require("../../common/http.js");
const _sfc_main = {
data() {
return {
id: "",
detail: null,
unitName: "-",
categoryName: "-",
templateName: "-"
};
},
async onLoad(query) {
this.id = (query == null ? void 0 : query.id) || "";
if (!this.id) {
common_vendor.index.showToast({ title: "参数缺失", icon: "none" });
return;
}
await this.loadDetail();
},
methods: {
async loadDetail() {
try {
const data = await common_http.get(`/api/products/submissions/${this.id}`);
this.detail = data;
this.categoryName = this.categoryLookup(data.categoryId);
this.templateName = this.templateLookup(data.templateId);
} catch (e) {
const msg = (e == null ? void 0 : e.message) || "加载失败";
common_vendor.index.showToast({ title: msg, icon: "none" });
}
},
statusLabel(s) {
if (s === "approved")
return "已通过";
if (s === "rejected")
return "已驳回";
return "待审核";
},
statusClass(s) {
if (s === "approved")
return "approved";
if (s === "rejected")
return "rejected";
return "pending";
},
preview(idx) {
var _a;
if (!((_a = this.detail) == null ? void 0 : _a.images) || !this.detail.images.length)
return;
common_vendor.index.previewImage({ urls: this.detail.images, current: idx });
},
formatTime(value) {
if (!value)
return "-";
try {
const d = new Date(value);
if (!Number.isFinite(d.getTime()))
return value;
const y = d.getFullYear();
const m = String(d.getMonth() + 1).padStart(2, "0");
const day = String(d.getDate()).padStart(2, "0");
const hh = String(d.getHours()).padStart(2, "0");
const mm = String(d.getMinutes()).padStart(2, "0");
return `${y}-${m}-${day} ${hh}:${mm}`;
} catch (_) {
return value;
}
},
unitLookup(id) {
try {
const list = [];
const found = list.find((x) => String(x.id) === String(id));
return found ? found.name : "-";
} catch (_) {
return "-";
}
},
categoryLookup(id) {
try {
const list = common_vendor.index.getStorageSync("CACHE_CATEGORIES") || [];
const found = list.find((x) => String(x.id) === String(id));
return found ? found.name : "-";
} catch (_) {
return "-";
}
},
templateLookup(id) {
try {
const list = common_vendor.index.getStorageSync("CACHE_TEMPLATES") || [];
const found = list.find((x) => String(x.id) === String(id));
return found ? found.name : "-";
} catch (_) {
return "-";
}
},
back() {
common_vendor.index.navigateBack({ delta: 1 });
},
resubmit() {
const payload = {
model: this.detail.model,
name: this.detail.name,
brand: this.detail.brand,
spec: this.detail.spec,
origin: this.detail.origin,
unitId: this.detail.unitId,
categoryId: this.detail.categoryId,
remark: this.detail.remark,
barcode: this.detail.barcode,
parameters: this.detail.parameters
};
const query = encodeURIComponent(JSON.stringify(payload));
common_vendor.index.navigateTo({ url: `/pages/product/submit?prefill=${query}` });
}
},
computed: {
stockRange() {
var _a, _b;
const min = (_a = this.detail) == null ? void 0 : _a.safeMin;
const max = (_b = this.detail) == null ? void 0 : _b.safeMax;
if (min == null && max == null)
return "-";
if (min != null && max != null)
return `${min} ~ ${max}`;
if (min != null)
return `${min}`;
return `${max}`;
},
labeledPairs() {
var _a;
const params = (_a = this.detail) == null ? void 0 : _a.parameters;
if (!params || typeof params !== "object")
return [];
let labelMap = {};
try {
const templates = common_vendor.index.getStorageSync("CACHE_TEMPLATES") || [];
const tpl = templates.find((t) => {
var _a2;
return String(t.id) === String((_a2 = this.detail) == null ? void 0 : _a2.templateId);
});
if (tpl && Array.isArray(tpl.params)) {
for (const p of tpl.params)
labelMap[p.fieldKey] = p.fieldLabel;
}
} catch (_) {
}
return Object.keys(params).map((k) => ({ key: k, label: labelMap[k] || k, value: params[k] }));
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: $data.detail
}, $data.detail ? common_vendor.e({
b: common_vendor.t($data.detail.model),
c: common_vendor.t($options.statusLabel($data.detail.status)),
d: common_vendor.n($options.statusClass($data.detail.status)),
e: common_vendor.t($data.detail.name || "-"),
f: common_vendor.t($data.detail.brand || "-"),
g: common_vendor.t($data.detail.spec || "-"),
h: common_vendor.t($data.detail.barcode || "-"),
i: common_vendor.t($data.categoryName),
j: common_vendor.t($data.templateName),
k: $options.labeledPairs.length
}, $options.labeledPairs.length ? {
l: common_vendor.f($options.labeledPairs, (item, k0, i0) => {
return {
a: common_vendor.t(item.label),
b: common_vendor.t(item.value),
c: item.key
};
})
} : {}, {
m: $data.detail.images && $data.detail.images.length
}, $data.detail.images && $data.detail.images.length ? {
n: common_vendor.f($data.detail.images, (img, idx, i0) => {
return {
a: idx,
b: img,
c: common_vendor.o(($event) => $options.preview(idx), idx)
};
})
} : {}, {
o: common_vendor.t($data.detail.remark || "无"),
p: common_vendor.t($options.formatTime($data.detail.createdAt)),
q: common_vendor.t($options.formatTime($data.detail.reviewedAt)),
r: $data.detail.reviewRemark
}, $data.detail.reviewRemark ? {
s: common_vendor.t($data.detail.reviewRemark)
} : {}, {
t: common_vendor.o((...args) => $options.back && $options.back(...args)),
v: $data.detail.status === "rejected"
}, $data.detail.status === "rejected" ? {
w: common_vendor.o((...args) => $options.resubmit && $options.resubmit(...args))
} : {}) : {});
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/product/submission-detail.js.map

View File

@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "提交详情",
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<scroll-view wx:if="{{a}}" scroll-y class="page"><view class="header"><text class="model">{{b}}</text><text class="{{['status', d]}}">{{c}}</text></view><view class="section"><view class="row"><text class="label">名称</text><text class="value">{{e}}</text></view><view class="row"><text class="label">品牌</text><text class="value">{{f}}</text></view><view class="row"><text class="label">规格</text><text class="value">{{g}}</text></view><view class="row"><text class="label">条码</text><text class="value">{{h}}</text></view><view class="row"><text class="label">类别</text><text class="value">{{i}}</text></view><view class="row"><text class="label">模板</text><text class="value">{{j}}</text></view></view><view class="section"><view class="block-title">参数</view><view wx:if="{{k}}" class="params"><view wx:for="{{l}}" wx:for-item="item" wx:key="c" class="param"><text class="param-key">{{item.a}}</text><text class="param-val">{{item.b}}</text></view></view><view wx:else class="placeholder">未填写参数</view></view><view class="section"><view class="block-title">图片</view><view wx:if="{{m}}" class="images"><image wx:for="{{n}}" wx:for-item="img" wx:key="a" src="{{img.b}}" class="image" mode="aspectFill" bindtap="{{img.c}}"/></view><view wx:else class="placeholder">未上传图片</view></view><view class="section"><view class="block-title">备注</view><view class="placeholder">{{o}}</view></view><view class="section"><view class="row"><text class="label">提交时间</text><text class="value">{{p}}</text></view><view class="row"><text class="label">审核时间</text><text class="value">{{q}}</text></view><view wx:if="{{r}}" class="row"><text class="label">审核说明</text><text class="value">{{s}}</text></view></view><view class="footer"><button size="mini" bindtap="{{t}}">返回</button><button wx:if="{{v}}" size="mini" type="warn" bindtap="{{w}}">重新提交</button></view></scroll-view><view wx:else class="loading">加载中...</view>

View File

@@ -0,0 +1,134 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 藏青系主色(高亮) */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/* 表单控件尺寸(统一配置,避免页面内硬编码) */
.page {
padding: 24rpx 24rpx 160rpx;
background: #f6f7fb;
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
}
.model {
font-size: 36rpx;
font-weight: 700;
color: #2d3a4a;
}
.status {
font-size: 26rpx;
padding: 6rpx 18rpx;
border-radius: 999rpx;
}
.status.pending {
background: rgba(246, 190, 0, 0.15);
color: #c47f00;
}
.status.approved {
background: rgba(103, 194, 58, 0.15);
color: #409eff;
}
.status.rejected {
background: rgba(255, 87, 115, 0.18);
color: #f56c6c;
}
.section {
background: #fff;
border-radius: 16rpx;
padding: 20rpx 22rpx;
margin-bottom: 24rpx;
box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.04);
}
.row {
display: flex;
justify-content: space-between;
padding: 12rpx 0;
border-bottom: 1rpx solid #f1f2f5;
}
.row:last-child {
border-bottom: none;
}
.label {
width: 160rpx;
font-size: 26rpx;
color: #7a8899;
}
.value {
flex: 1;
text-align: right;
font-size: 26rpx;
color: #2d3a4a;
word-break: break-all;
}
.block-title {
font-size: 28rpx;
font-weight: 600;
color: #2d3a4a;
margin-bottom: 12rpx;
}
.placeholder {
font-size: 26rpx;
color: #7a8899;
}
.params {
display: flex;
flex-direction: column;
gap: 12rpx;
}
.param {
display: flex;
justify-content: space-between;
font-size: 26rpx;
color: #2d3a4a;
}
.param-key {
color: #7a8899;
}
.images {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 12rpx;
}
.image {
width: 100%;
height: 200rpx;
border-radius: 16rpx;
background: #f0f2f5;
}
.footer {
display: flex;
justify-content: flex-end;
gap: 20rpx;
}
.loading {
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
color: #7a8899;
}

View File

@@ -22,9 +22,10 @@ const _sfc_main = {
methods: {
async preloadDictionaries() {
try {
const [units, categories] = await Promise.all([
const [units, categories, templates] = await Promise.all([
this.cacheUnitsLoaded ? Promise.resolve(null) : common_http.get("/api/product-units"),
this.cacheCategoriesLoaded ? Promise.resolve(null) : common_http.get("/api/product-categories")
this.cacheCategoriesLoaded ? Promise.resolve(null) : common_http.get("/api/product-categories"),
common_http.get("/api/product-templates")
]);
if (units) {
const list = Array.isArray(units == null ? void 0 : units.list) ? units.list : Array.isArray(units) ? units : [];
@@ -36,6 +37,10 @@ const _sfc_main = {
common_vendor.index.setStorageSync("CACHE_CATEGORIES", list);
this.cacheCategoriesLoaded = true;
}
if (templates) {
const list = Array.isArray(templates == null ? void 0 : templates.list) ? templates.list : Array.isArray(templates) ? templates : [];
common_vendor.index.setStorageSync("CACHE_TEMPLATES", list);
}
} catch (_) {
}
},
@@ -67,7 +72,7 @@ const _sfc_main = {
this.finished = true;
this.page += 1;
} catch (e) {
common_vendor.index.__f__("warn", "at pages/product/submissions.vue:113", "加载提交记录失败", e);
common_vendor.index.__f__("warn", "at pages/product/submissions.vue:118", "加载提交记录失败", e);
const msg = (e == null ? void 0 : e.message) || "加载失败";
common_vendor.index.showToast({ title: msg, icon: "none" });
} finally {

View File

@@ -24,6 +24,7 @@
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/* 表单控件尺寸(统一配置,避免页面内硬编码) */
.page {
display: flex;
flex-direction: column;

View File

@@ -12,6 +12,7 @@ const _sfc_main = {
barcode: "",
categoryId: "",
templateId: "",
externalCode: "",
parameters: {},
images: [],
remark: "",
@@ -99,11 +100,19 @@ const _sfc_main = {
this.form.templateId = t ? t.id : "";
this.paramValues = {};
},
onPickDate(p, e) {
var _a;
this.paramValues[p.fieldKey] = ((_a = e == null ? void 0 : e.detail) == null ? void 0 : _a.value) || "";
},
onPickEnum(p, e) {
const idx = Number(e.detail.value);
const arr = p.enumOptions || [];
this.paramValues[p.fieldKey] = arr[idx];
},
displayEnum(p) {
const v = this.paramValues[p.fieldKey];
return v === void 0 || v === null || v === "" ? "选择" + p.fieldLabel : String(v);
},
async scanBarcode() {
var _a;
try {
@@ -184,6 +193,7 @@ const _sfc_main = {
model: this.form.model,
brand: this.form.brand,
barcode: this.form.barcode,
externalCode: this.form.externalCode || null,
categoryId: this.form.categoryId || null,
templateId: this.form.templateId || null,
parameters: paramsForSubmit,
@@ -213,7 +223,7 @@ if (!Array) {
_component_ImageUploader();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
return common_vendor.e({
a: $data.form.model,
b: common_vendor.o(common_vendor.m(($event) => $data.form.model = $event.detail.value, {
trim: true
@@ -230,34 +240,87 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
h: common_vendor.t($options.categoryLabel),
i: $options.categoryNames,
j: common_vendor.o((...args) => $options.onPickCategory && $options.onPickCategory(...args)),
k: common_vendor.t($options.templateLabel),
l: $options.templateNames,
m: common_vendor.o((...args) => $options.onPickTemplate && $options.onPickTemplate(...args)),
n: common_vendor.o(($event) => $data.form.images = $event),
o: common_vendor.p({
k: $data.form.externalCode,
l: common_vendor.o(common_vendor.m(($event) => $data.form.externalCode = $event.detail.value, {
trim: true
})),
m: common_vendor.t($options.templateLabel),
n: $options.templateNames,
o: common_vendor.o((...args) => $options.onPickTemplate && $options.onPickTemplate(...args)),
p: $options.selectedTemplate
}, $options.selectedTemplate ? {
q: common_vendor.f($options.selectedTemplate.params || [], (p, idx, i0) => {
return common_vendor.e({
a: common_vendor.t(p.fieldLabel),
b: p.unit
}, p.unit ? {
c: common_vendor.t(p.unit)
} : {}, {
d: p.required
}, p.required ? {} : {}, {
e: p.type === "string"
}, p.type === "string" ? {
f: "请输入" + p.fieldLabel,
g: $data.paramValues[p.fieldKey],
h: common_vendor.o(common_vendor.m(($event) => $data.paramValues[p.fieldKey] = $event.detail.value, {
trim: true
}), p.fieldKey)
} : p.type === "number" ? {
j: "请输入" + p.fieldLabel,
k: $data.paramValues[p.fieldKey],
l: common_vendor.o(common_vendor.m(($event) => $data.paramValues[p.fieldKey] = $event.detail.value, {
number: true
}), p.fieldKey)
} : p.type === "boolean" ? {
n: !!$data.paramValues[p.fieldKey],
o: common_vendor.o((e) => $data.paramValues[p.fieldKey] = e.detail.value, p.fieldKey)
} : p.type === "enum" ? {
q: common_vendor.t($options.displayEnum(p)),
r: p.enumOptions || [],
s: common_vendor.o(($event) => $options.onPickEnum(p, $event), p.fieldKey)
} : p.type === "date" ? {
v: common_vendor.t($data.paramValues[p.fieldKey] || "选择" + p.fieldLabel),
w: common_vendor.o(($event) => $options.onPickDate(p, $event), p.fieldKey)
} : {
x: "请输入" + p.fieldLabel,
y: $data.paramValues[p.fieldKey],
z: common_vendor.o(common_vendor.m(($event) => $data.paramValues[p.fieldKey] = $event.detail.value, {
trim: true
}), p.fieldKey)
}, {
i: p.type === "number",
m: p.type === "boolean",
p: p.type === "enum",
t: p.type === "date",
A: p.fieldKey
});
})
} : {}, {
r: common_vendor.o(($event) => $data.form.images = $event),
s: common_vendor.p({
max: 9,
formData: {
ownerType: "submission"
},
modelValue: $data.form.images
}),
p: $data.form.remark,
q: common_vendor.o(common_vendor.m(($event) => $data.form.remark = $event.detail.value, {
t: $data.form.remark,
v: common_vendor.o(common_vendor.m(($event) => $data.form.remark = $event.detail.value, {
trim: true
})),
r: $data.form.safeMin,
s: common_vendor.o(common_vendor.m(($event) => $data.form.safeMin = $event.detail.value, {
w: $data.form.safeMin,
x: common_vendor.o(common_vendor.m(($event) => $data.form.safeMin = $event.detail.value, {
number: true
})),
t: $data.form.safeMax,
v: common_vendor.o(common_vendor.m(($event) => $data.form.safeMax = $event.detail.value, {
y: $data.form.safeMax,
z: common_vendor.o(common_vendor.m(($event) => $data.form.safeMax = $event.detail.value, {
number: true
})),
w: $data.submitting,
x: common_vendor.o((...args) => $options.submit && $options.submit(...args)),
y: $data.checking,
z: common_vendor.o((...args) => $options.checkModel && $options.checkModel(...args))
};
A: $data.submitting,
B: common_vendor.o((...args) => $options.submit && $options.submit(...args)),
C: $data.checking,
D: common_vendor.o((...args) => $options.checkModel && $options.checkModel(...args))
});
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createPage(MiniProgramPage);

View File

@@ -1 +1 @@
<scroll-view scroll-y class="page"><view class="hero"><text class="title">提交配件</text><text class="desc">填写型号、名称、参数与图片,提交后进入待审核状态</text></view><view class="section"><view class="row required"><text class="label">型号</text><input placeholder="请输入型号(必填)" value="{{a}}" bindinput="{{b}}"/></view><view class="row"><text class="label">品牌</text><input placeholder="品牌/厂商" value="{{c}}" bindinput="{{d}}"/></view><view class="row"><text class="label">条码</text><input placeholder="可选,建议扫码录入" value="{{e}}" bindinput="{{f}}"/><button size="mini" class="picker-btn" bindtap="{{g}}">识码</button></view></view><view class="section"><view class="row"><text class="label">类别</text><picker mode="selector" range="{{i}}" bindchange="{{j}}"><view class="picker">{{h}}</view></picker></view></view><view class="section"><view class="row"><text class="label">模板</text></view><view class="row"><picker mode="selector" range="{{l}}" bindchange="{{m}}"><view class="picker">{{k}}</view></picker></view></view><view class="section"><view class="row"><text class="label">图片</text></view><image-uploader wx:if="{{o}}" u-i="7f3a3bde-0" bind:__l="__l" bindupdateModelValue="{{n}}" u-p="{{o}}"/></view><view class="section"><view class="row"><text class="label">备注</text></view><block wx:if="{{r0}}"><textarea class="textarea" placeholder="选填:补充说明" value="{{p}}" bindinput="{{q}}"/></block></view><view class="section"><view class="row"><text class="label">安全库存</text></view><view class="row triple"><input type="number" placeholder="下限" value="{{r}}" bindinput="{{s}}"/><input type="number" placeholder="上限" value="{{t}}" bindinput="{{v}}"/></view></view><view class="fixed"><button class="primary" loading="{{w}}" bindtap="{{x}}">提交审核</button><button class="primary" style="margin-top:16rpx;background:#7aa9ff" loading="{{y}}" bindtap="{{z}}">查重</button></view></scroll-view>
<scroll-view scroll-y class="page"><view class="hero"><text class="title">提交配件</text><text class="desc">填写型号、名称、参数与图片,提交后进入待审核状态</text></view><view class="section"><view class="row required"><text class="label">型号</text><input placeholder="请输入型号(必填)" value="{{a}}" bindinput="{{b}}"/></view><view class="row"><text class="label">品牌</text><input placeholder="品牌/厂商" value="{{c}}" bindinput="{{d}}"/></view><view class="row"><text class="label">条码</text><input placeholder="可选,建议扫码录入" value="{{e}}" bindinput="{{f}}"/><button size="mini" class="picker-btn" bindtap="{{g}}">识码</button></view></view><view class="section"><view class="row"><text class="label">类别</text><picker mode="selector" range="{{i}}" bindchange="{{j}}"><view class="picker">{{h}}</view></picker></view></view><view class="section"><view class="row"><text class="label">编号</text><input placeholder="内部/外部编号(可选)" value="{{k}}" bindinput="{{l}}"/></view></view><view class="section"><view class="row"><text class="label">模板</text></view><view class="row"><picker mode="selector" range="{{n}}" bindchange="{{o}}"><view class="picker">{{m}}</view></picker></view></view><view wx:if="{{p}}" class="section"><view class="row"><text class="label">参数</text></view><view class="param-list"><view wx:for="{{q}}" wx:for-item="p" wx:key="A" class="row"><text class="label">{{p.a}}<text wx:if="{{p.b}}">{{p.c}}</text><text wx:if="{{p.d}}" style="color:#ff5b5b">*</text></text><block wx:if="{{p.e}}"><input placeholder="{{p.f}}" value="{{p.g}}" bindinput="{{p.h}}"/></block><block wx:elif="{{p.i}}"><input type="number" placeholder="{{p.j}}" value="{{p.k}}" bindinput="{{p.l}}"/></block><block wx:elif="{{p.m}}"><switch checked="{{p.n}}" bindchange="{{p.o}}"/></block><block wx:elif="{{p.p}}"><picker mode="selector" range="{{p.r}}" bindchange="{{p.s}}"><view class="picker">{{p.q}}</view></picker></block><block wx:elif="{{p.t}}"><picker mode="date" bindchange="{{p.w}}"><view class="picker">{{p.v}}</view></picker></block><block wx:else><input placeholder="{{p.x}}" value="{{p.y}}" bindinput="{{p.z}}"/></block></view></view></view><view class="section"><view class="row"><text class="label">图片</text></view><image-uploader wx:if="{{s}}" u-i="7f3a3bde-0" bind:__l="__l" bindupdateModelValue="{{r}}" u-p="{{s}}"/></view><view class="section"><view class="row"><text class="label">备注</text></view><block wx:if="{{r0}}"><textarea class="textarea" placeholder="选填:补充说明" value="{{t}}" bindinput="{{v}}"/></block></view><view class="section"><view class="row"><text class="label">安全库存</text></view><view class="row triple"><input type="number" placeholder="下限" value="{{w}}" bindinput="{{x}}"/><input type="number" placeholder="上限" value="{{y}}" bindinput="{{z}}"/></view></view><view class="fixed"><button class="primary" loading="{{A}}" bindtap="{{B}}">提交审核</button><button class="primary" style="margin-top:16rpx;background:#7aa9ff" loading="{{C}}" bindtap="{{D}}">查重</button></view></scroll-view>

View File

@@ -24,6 +24,7 @@
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/* 表单控件尺寸(统一配置,避免页面内硬编码) */
.page {
padding: 24rpx 24rpx 120rpx;
background: #f6f7fb;

View File

@@ -24,6 +24,7 @@
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/* 表单控件尺寸(统一配置,避免页面内硬编码) */
.report {
padding: 24rpx 20rpx 36rpx;
display: flex;

View File

@@ -24,6 +24,7 @@
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/* 表单控件尺寸(统一配置,避免页面内硬编码) */
.page {
padding-bottom: 140rpx;
}