Browse Source

埋点bug处理

dev
kola-web 7 days ago
parent
commit
0ffe8c96fc
  1. 64
      src/app.ts
  2. 6
      src/pages/login/index.ts
  3. 2
      src/pages/login/index.wxml
  4. 5
      src/patient/pages/index/index.ts
  5. 2
      src/patient/pages/live/index.scss
  6. 1
      src/patient/pages/mySave/index.scss

64
src/app.ts

@ -170,7 +170,7 @@ App<IAppOption>({
checkLoginType(type, backPath = '') { checkLoginType(type, backPath = '') {
const { loginType, isLogin, isNewReg } = this.globalData const { loginType, isLogin, isNewReg } = this.globalData
if (backPath) { if (backPath) {
app.globalData.backPath = backPath this.globalData.backPath = backPath
} }
if (type === 'any') { if (type === 'any') {
@ -235,6 +235,16 @@ App<IAppOption>({
}, },
mpBehavior(data: { PageName: string }) { mpBehavior(data: { PageName: string }) {
console.log(data) console.log(data)
let url = '?r=zd/mp-behavior/add'
wx.ajax({
method: 'POST',
url,
data,
loading: false,
showMsg: false,
}).then((res) => {
console.log('res: ', res)
})
}, },
oldMpBehavior(data) { oldMpBehavior(data) {
wx.ajax({ wx.ajax({
@ -428,67 +438,25 @@ App<IAppOption>({
return true return true
}, },
zdPermissionVerification(grade = 1, registChannel = 0, backPage = null, regBusinessId = '') { zdPermissionVerification(grade = 1, registChannel = 0, backPage = null, regBusinessId = '') {
// 1-空白用户,2-注册用户,3-疾病患者,4-用药患者 const { isLogin, isNewReg } = this.globalData
const { PatientId, AuditStatus, isFollow, UserType } = this.globalData.zdUserInfo
const that = this const that = this
this.globalData.registChannel = registChannel this.globalData.registChannel = registChannel
this.globalData.regBusinessId = regBusinessId this.globalData.regBusinessId = regBusinessId
let isReject = false let isReject = false
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (grade == 2 && Number(UserType) < 2) { if (grade > 1) {
wx.reLaunch({ if (!isLogin) {
url: '/patient/pages/login/index',
})
isReject = true
}
if (grade == 3 && Number(UserType) < 3) {
if (UserType == 1) {
wx.reLaunch({ wx.reLaunch({
url: '/patient/pages/login/index', url: '/patient/pages/login/index',
}) })
isReject = true isReject = true
} } else if (!isNewReg) {
if (UserType == 2) {
let urlKey = ''
if (!PatientId) {
urlKey = 'enterInfo'
} else if (AuditStatus == 0) {
urlKey = 'noCert'
} else if (AuditStatus == 1) {
if (backPage && (backPage as string).includes('liveResult')) {
urlKey = 'liveResult'
} else {
urlKey = isFollow ? 'nopending' : 'pending'
}
} else if (AuditStatus == 2) {
urlKey = 'reject'
}
let navUrl = {
enterInfo: '/patient/pages/enterInfo/index',
noCert: '/patient/pages/enterInfo/index',
reject: '/patient/pages/enterInfo/index',
pending: '/patient/pages/enterInfo/index',
nopending: '/patient/pages/enterInfo/index',
liveResult: backPage,
}[urlKey]
if (urlKey == 'liveResult') {
wx.navigateTo({
url: navUrl as string,
})
} else {
wx.reLaunch({ wx.reLaunch({
url: navUrl as string, url: '/patient/pages/enterInfo/index',
}) })
}
isReject = true isReject = true
} }
} }
if (grade == 4 && Number(UserType) < 4) {
wx.reLaunch({
url: '/patient/pages/vipLogin/index',
})
isReject = true
}
if (isReject) { if (isReject) {
that.globalData.backPage = backPage that.globalData.backPage = backPage
reject(null) reject(null)

6
src/pages/login/index.ts

@ -79,7 +79,6 @@ Page({
}) })
}, },
handleDocRule() { handleDocRule() {
app.mpBehavior({ PageName: 'BTN_DoctorLogin' })
const { check1 } = this.data const { check1 } = this.data
return new Promise((resolve) => { return new Promise((resolve) => {
if (check1) { if (check1) {
@ -92,6 +91,7 @@ Page({
}) })
}, },
async handleSubmit() { async handleSubmit() {
app.mpBehavior({ PageName: 'BTN_DoctorLogin' })
await this.handleDocRule() await this.handleDocRule()
const { mobile, code } = this.data const { mobile, code } = this.data
if (!mobile) { if (!mobile) {
@ -131,6 +131,10 @@ Page({
} }
}) })
}, },
handleNoDoc() {
app.mpBehavior({ PageName: 'BTN_DoctorQuickLogin' })
this.handleDocRule()
},
handleWxSubmit(e: WechatMiniprogram.CustomEvent) { handleWxSubmit(e: WechatMiniprogram.CustomEvent) {
app.mpBehavior({ PageName: 'BTN_DoctorQuickLogin' }) app.mpBehavior({ PageName: 'BTN_DoctorQuickLogin' })
const { iv, encryptedData } = e.detail const { iv, encryptedData } = e.detail

2
src/pages/login/index.wxml

@ -21,7 +21,7 @@
<button wx:if="{{check1 }}" class="phone" open-type="getPhoneNumber" bindgetphonenumber="handleWxSubmit"> <button wx:if="{{check1 }}" class="phone" open-type="getPhoneNumber" bindgetphonenumber="handleWxSubmit">
手机号一键登录 手机号一键登录
</button> </button>
<button wx:else class="phone" bind:tap="handleDocRule">手机号一键登录</button> <button wx:else class="phone" bind:tap="handleNoDoc">手机号一键登录</button>
<view class="divider"> <view class="divider">
<van-divider class="van-divider" contentPosition="center">或者</van-divider> <van-divider class="van-divider" contentPosition="center">或者</van-divider>
</view> </view>

5
src/patient/pages/index/index.ts

@ -301,6 +301,9 @@ Page({
app.mpBehavior({ PageName: 'BTN_PatientHomeLiveCard' }) app.mpBehavior({ PageName: 'BTN_PatientHomeLiveCard' })
} }
if (code === 'activity2' && url.includes('/patient/pages/liveDetail/index')) { if (code === 'activity2' && url.includes('/patient/pages/liveDetail/index')) {
app.mpBehavior({ PageName: 'BTN_PatientHomeLiveCard' })
}
if (code === 'article' && url.includes('/patient/pages/repositoryDetail/index')) {
app.mpBehavior({ PageName: 'BTN_PatientHomeContentCard' }) app.mpBehavior({ PageName: 'BTN_PatientHomeContentCard' })
} }
@ -312,11 +315,9 @@ Page({
if (url.includes('loginState')) { if (url.includes('loginState')) {
url = url + encodeURIComponent(app.globalData.loginState) url = url + encodeURIComponent(app.globalData.loginState)
app.zdPermissionVerification(2, 11, `/patient/pages/repository/index`).then(() => {
wx.navigateTo({ wx.navigateTo({
url, url,
}) })
})
return return
} }

2
src/patient/pages/live/index.scss

@ -336,7 +336,7 @@ page {
} }
.title { .title {
font-size: 32rpx; font-size: 32rpx;
color: #211d2e; color: #69686E;
} }
} }
} }

1
src/patient/pages/mySave/index.scss

@ -31,6 +31,7 @@ page {
display: flex; display: flex;
padding-bottom: 24rpx; padding-bottom: 24rpx;
border-bottom: 1rpx dotted rgba(39, 58, 101, 0.2); border-bottom: 1rpx dotted rgba(39, 58, 101, 0.2);
margin-bottom: 24rpx;
&:last-of-type { &:last-of-type {
border: none; border: none;
} }

Loading…
Cancel
Save