+
+
+
+
+
+
+
+
+
+
+
+
+ {{ row.phone || '-' }}
+
+
+
+ {{ getRoleLabel(row.role) }}
+
+
+
+
+
+
+ {{ row.isBanned ? '已封禁' : '正常' }}
+
+
+
+
+ {{ formatTime(row.createdAt) }}
+
+
+
+
+
+ 封禁
+
+
+
+
+ 解封
+
+
+
+
+
+
+
+
+
+
+
diff --git a/miniapp/pages/delivery/delivery.vue b/miniapp/pages/delivery/delivery.vue
index a1d8ef2..9a7cdbd 100644
--- a/miniapp/pages/delivery/delivery.vue
+++ b/miniapp/pages/delivery/delivery.vue
@@ -101,8 +101,20 @@ export default {
const sysInfo = uni.getSystemInfoSync()
this.statusBarHeight = sysInfo.statusBarHeight || 0
this.loadBanner()
+ this.restoreFormData()
},
methods: {
+ /** 恢复登录前保存的表单数据 */
+ restoreFormData() {
+ const saved = uni.getStorageSync('loginFormData')
+ if (saved) {
+ try {
+ const data = JSON.parse(saved)
+ Object.assign(this.form, data)
+ } catch (e) {}
+ uni.removeStorageSync('loginFormData')
+ }
+ },
goBack() { uni.navigateBack() },
async loadBanner() {
try {
@@ -137,12 +149,18 @@ export default {
if (!this.form.phone.trim()) {
uni.showToast({ title: '请输入手机号', icon: 'none' }); return false
}
+ if (!/^1\d{10}$/.test(this.form.phone.trim())) {
+ uni.showToast({ title: '请输入正确的11位手机号', icon: 'none' }); return false
+ }
return this.validateCommission()
},
async onSubmit() {
if (!this.validateForm()) return
const token = uni.getStorageSync('token')
if (!token) {
+ // 保存表单数据,登录后恢复
+ uni.setStorageSync('loginFormData', JSON.stringify(this.form))
+ uni.setStorageSync('loginRedirect', '/pages/delivery/delivery')
uni.navigateTo({ url: '/pages/login/login' }); return
}
this.submitting = true
diff --git a/miniapp/pages/food/food-order.vue b/miniapp/pages/food/food-order.vue
index 54b850e..de1935d 100644
--- a/miniapp/pages/food/food-order.vue
+++ b/miniapp/pages/food/food-order.vue
@@ -142,6 +142,10 @@ export default {
uni.showToast({ title: '请输入手机号', icon: 'none' })
return false
}
+ if (!/^1\d{10}$/.test(this.form.phone.trim())) {
+ uni.showToast({ title: '请输入正确的11位手机号', icon: 'none' })
+ return false
+ }
return this.validateCommission()
},
diff --git a/miniapp/pages/help/help.vue b/miniapp/pages/help/help.vue
index 22ac64b..e57b76b 100644
--- a/miniapp/pages/help/help.vue
+++ b/miniapp/pages/help/help.vue
@@ -99,8 +99,20 @@
const sysInfo = uni.getSystemInfoSync()
this.statusBarHeight = sysInfo.statusBarHeight || 0
this.loadBanner()
+ this.restoreFormData()
},
methods: {
+ /** 恢复登录前保存的表单数据 */
+ restoreFormData() {
+ const saved = uni.getStorageSync('loginFormData')
+ if (saved) {
+ try {
+ const data = JSON.parse(saved)
+ Object.assign(this.form, data)
+ } catch (e) {}
+ uni.removeStorageSync('loginFormData')
+ }
+ },
goBack() {
uni.navigateBack()
},
@@ -153,6 +165,13 @@
})
return false
}
+ if (!/^1\d{10}$/.test(this.form.phone.trim())) {
+ uni.showToast({
+ title: '请输入正确的11位手机号',
+ icon: 'none'
+ })
+ return false
+ }
if (!this.form.goodsAmount) {
uni.showToast({
title: '请输入商品总金额',
@@ -177,6 +196,9 @@
// 未登录跳转登录页
const token = uni.getStorageSync('token')
if (!token) {
+ // 保存表单数据,登录后恢复
+ uni.setStorageSync('loginFormData', JSON.stringify(this.form))
+ uni.setStorageSync('loginRedirect', '/pages/help/help')
uni.navigateTo({
url: '/pages/login/login'
})
diff --git a/miniapp/pages/login/login.vue b/miniapp/pages/login/login.vue
index bb38ec2..e703869 100644
--- a/miniapp/pages/login/login.vue
+++ b/miniapp/pages/login/login.vue
@@ -88,7 +88,14 @@ async function onWxLogin() {
if (res.token && res.userInfo) {
userStore.setLoginInfo(res.token, res.userInfo)
uni.showToast({ title: '登录成功', icon: 'success' })
- uni.reLaunch({ url: '/pages/index/index' })
+ // 检查是否有登录前的回跳页面
+ const redirect = uni.getStorageSync('loginRedirect')
+ if (redirect) {
+ uni.removeStorageSync('loginRedirect')
+ uni.navigateTo({ url: redirect })
+ } else {
+ uni.reLaunch({ url: '/pages/index/index' })
+ }
} else {
tipText.value = '登录失败,请重试'
}
diff --git a/miniapp/pages/message/chat.vue b/miniapp/pages/message/chat.vue
index e1023aa..bf57566 100644
--- a/miniapp/pages/message/chat.vue
+++ b/miniapp/pages/message/chat.vue
@@ -11,146 +11,159 @@