backup: 紫色UI换肤前完整备份(当前橙色逍遥梦主题)
保留改造前全部页面样式与功能代码,便于回滚。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
55
pages/staff-join/staff-join.js
Normal file
55
pages/staff-join/staff-join.js
Normal file
@@ -0,0 +1,55 @@
|
||||
import request from '../../utils/request.js';
|
||||
import { STAFF_API, applyStaffFromLoginData } from '../../utils/staff-api.js';
|
||||
import { enterLockedRole, lockPrimaryRole } from '../../utils/primary-role.js';
|
||||
|
||||
const app = getApp();
|
||||
|
||||
Page({
|
||||
data: {
|
||||
inviteCode: '',
|
||||
loading: false,
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
const code = options.code || options.inviteCode || '';
|
||||
if (code) this.setData({ inviteCode: decodeURIComponent(code) });
|
||||
},
|
||||
|
||||
onInput(e) {
|
||||
this.setData({ inviteCode: (e.detail.value || '').trim() });
|
||||
},
|
||||
|
||||
async onBind() {
|
||||
const inviteCode = this.data.inviteCode;
|
||||
if (!inviteCode) {
|
||||
wx.showToast({ title: '请输入邀请码', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
this.setData({ loading: true });
|
||||
try {
|
||||
const res = await request({
|
||||
url: STAFF_API.bind,
|
||||
method: 'POST',
|
||||
data: { inviteCode },
|
||||
});
|
||||
const d = res.data || {};
|
||||
if (d.code === 0 && d.data && d.data.staff_context) {
|
||||
applyStaffFromLoginData({
|
||||
staffstatus: 1,
|
||||
staff_context: d.data.staff_context,
|
||||
});
|
||||
lockPrimaryRole('shangjia', app);
|
||||
wx.showToast({ title: '绑定成功', icon: 'success' });
|
||||
setTimeout(() => {
|
||||
enterLockedRole('shangjia', app);
|
||||
}, 800);
|
||||
} else {
|
||||
wx.showToast({ title: d.msg || '绑定失败', icon: 'none' });
|
||||
}
|
||||
} catch (e) {
|
||||
wx.showToast({ title: '网络错误', icon: 'none' });
|
||||
} finally {
|
||||
this.setData({ loading: false });
|
||||
}
|
||||
},
|
||||
});
|
||||
4
pages/staff-join/staff-join.json
Normal file
4
pages/staff-join/staff-join.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"navigationBarTitleText": "客服入驻",
|
||||
"usingComponents": {}
|
||||
}
|
||||
13
pages/staff-join/staff-join.wxml
Normal file
13
pages/staff-join/staff-join.wxml
Normal file
@@ -0,0 +1,13 @@
|
||||
<view class="page">
|
||||
<view class="card">
|
||||
<text class="title">成为商家客服</text>
|
||||
<text class="desc">输入商家提供的一次性邀请码,绑定后可代商家派单(受权限与额度限制)</text>
|
||||
<input class="input" placeholder="例如 PD-ABC123" value="{{inviteCode}}" bindinput="onInput" />
|
||||
<button class="btn" loading="{{loading}}" bindtap="onBind">确认绑定</button>
|
||||
</view>
|
||||
<view class="tips">
|
||||
<text>· 已是商家账号无法绑定客服</text>
|
||||
<text>· 同时只能绑定一个商家</text>
|
||||
<text>· 被移除后可重新绑定或认证商家</text>
|
||||
</view>
|
||||
</view>
|
||||
8
pages/staff-join/staff-join.wxss
Normal file
8
pages/staff-join/staff-join.wxss
Normal file
@@ -0,0 +1,8 @@
|
||||
.page { min-height: 100vh; background: #f5f5f5; padding: 40rpx; box-sizing: border-box; }
|
||||
.card { background: #fff; border-radius: 16rpx; padding: 40rpx; }
|
||||
.title { display: block; font-size: 36rpx; font-weight: 600; color: #333; margin-bottom: 16rpx; }
|
||||
.desc { display: block; font-size: 26rpx; color: #666; line-height: 1.6; margin-bottom: 32rpx; }
|
||||
.input { border: 1px solid #ddd; border-radius: 12rpx; padding: 24rpx; font-size: 30rpx; margin-bottom: 32rpx; }
|
||||
.btn { background: #C9A962; color: #fff; border-radius: 12rpx; }
|
||||
.tips { margin-top: 32rpx; font-size: 24rpx; color: #999; line-height: 2; }
|
||||
.tips text { display: block; }
|
||||
Reference in New Issue
Block a user