committed by
trae-solo-agent
co-authored by
Claude Sonnet 4.6 noreply@anthropic.com
parent
031227710d
commit
d3f399d1ad
@@ -1,6 +1,7 @@
|
||||
// pages/mine/contact.js
|
||||
Page({
|
||||
data: {
|
||||
orderContext: '',
|
||||
// 联系方式配置:action 决定点击行为,call=拨号 / copy=复制 / 空=不可点
|
||||
contactItems: [{
|
||||
label: '客服热线',
|
||||
@@ -29,6 +30,17 @@ Page({
|
||||
]
|
||||
},
|
||||
|
||||
onLoad(options = {}) {
|
||||
const orderNo = String(options.orderNo || '').trim()
|
||||
const orderId = String(options.orderId || '').trim()
|
||||
const displayNo = (orderNo || orderId.slice(-8)).toUpperCase()
|
||||
if (!displayNo) return
|
||||
|
||||
this.setData({
|
||||
orderContext: `咨询订单尾号 ${displayNo},联系客服时请提供该编号`
|
||||
})
|
||||
},
|
||||
|
||||
onItemTap(e) {
|
||||
const {
|
||||
action,
|
||||
|
||||
@@ -9,6 +9,10 @@
|
||||
<text class="header-subtitle">人工客服在线,有问题随时找我们</text>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{orderContext}}" class="order-context">
|
||||
<text class="order-context-text">{{orderContext}}</text>
|
||||
</view>
|
||||
|
||||
<!-- 联系方式:action 决定点击行为(call 拨号 / copy 复制) -->
|
||||
<view class="card">
|
||||
<view class="contact-item" wx:for="{{ contactItems }}" wx:key="label"
|
||||
|
||||
@@ -57,6 +57,20 @@ page {
|
||||
letter-spacing: 1rpx;
|
||||
}
|
||||
|
||||
.order-context {
|
||||
margin-top: 24rpx;
|
||||
padding: 20rpx 24rpx;
|
||||
border: 2rpx solid var(--brand-line);
|
||||
border-radius: 16rpx;
|
||||
background: var(--brand-soft);
|
||||
}
|
||||
|
||||
.order-context-text {
|
||||
font-size: 26rpx;
|
||||
color: var(--brand-ink);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
/* ===== 联系方式卡片 ===== */
|
||||
.card {
|
||||
margin-top: 32rpx;
|
||||
|
||||
+4
-36
@@ -11,11 +11,6 @@ Page({
|
||||
// 身份行副行,loadUserInfo 时由手机号脱敏填入
|
||||
account: '',
|
||||
phone: '',
|
||||
sex: '',
|
||||
birth: '',
|
||||
email: '',
|
||||
idnumber: '',
|
||||
ssn: '',
|
||||
isLoggedIn: false
|
||||
},
|
||||
// 菜单分组:按"用途"而非"是不是陪诊"分,三组才立得住。
|
||||
@@ -34,10 +29,6 @@ Page({
|
||||
name: '就诊人',
|
||||
icon: 'user-checked',
|
||||
bindtap: 'onTapHealth'
|
||||
}, {
|
||||
name: '邮寄地址',
|
||||
icon: 'location',
|
||||
bindtap: 'onTapAddress'
|
||||
}]
|
||||
}, {
|
||||
groupName: '帮助与支持',
|
||||
@@ -68,12 +59,9 @@ Page({
|
||||
}]
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
this.loadUserInfo()
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.loadUserInfo()
|
||||
const app = getApp()
|
||||
app.waitForAuth().finally(() => this.loadUserInfo())
|
||||
// 同步自定义 tabBar 选中态(我的为第 2 项)
|
||||
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
|
||||
this.getTabBar().setData({
|
||||
@@ -96,12 +84,7 @@ Page({
|
||||
'userInfo.phone': profile.mobile || '',
|
||||
// 身份行副行(微信那行是微信号):本应用没有账号体系,
|
||||
// 等价标识是手机号,脱敏成 138****1234 后再上屏
|
||||
'userInfo.account': this.maskMobile(profile.mobile || ''),
|
||||
'userInfo.sex': profile.sex || '',
|
||||
'userInfo.birth': profile.birth ? this.formatDate(profile.birth) : '',
|
||||
'userInfo.email': profile.email || '',
|
||||
'userInfo.idnumber': profile.idnumber || '',
|
||||
'userInfo.ssn': profile.ssn || ''
|
||||
'userInfo.account': this.maskMobile(profile.mobile || '')
|
||||
})
|
||||
} else {
|
||||
// 未登录(含刚退出登录):身份行收敛回默认态。
|
||||
@@ -124,17 +107,8 @@ Page({
|
||||
return `${digits.slice(0, 3)}****${digits.slice(7)}`
|
||||
},
|
||||
|
||||
formatDate(date) {
|
||||
if (!date) return ''
|
||||
const d = new Date(date)
|
||||
const year = d.getFullYear()
|
||||
const month = String(d.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(d.getDate()).padStart(2, '0')
|
||||
return `${year}-${month}-${day}`
|
||||
},
|
||||
|
||||
// 顶部身份行整行可点,但未登录时不该跳进"填完才被拦"的资料页
|
||||
// (个人信息与邮寄地址改真页面后系统返回键归页面栈管,
|
||||
// (个人信息改真页面后系统返回键归页面栈管,
|
||||
// 不再像原来的浮层那样被系统返回键直接退出小程序)
|
||||
onTapProfile() {
|
||||
if (!this.data.userInfo.isLoggedIn) return
|
||||
@@ -143,12 +117,6 @@ Page({
|
||||
})
|
||||
},
|
||||
|
||||
onTapAddress() {
|
||||
wx.navigateTo({
|
||||
url: '/pages/mine/addressedit'
|
||||
})
|
||||
},
|
||||
|
||||
onTapHealth() {
|
||||
wx.navigateTo({
|
||||
url: '/pages/health/profilelist'
|
||||
|
||||
Reference in New Issue
Block a user