|
|
|
@ -1,91 +1,97 @@ |
|
|
|
const app = getApp<IAppOption>(); |
|
|
|
const app = getApp<IAppOption>() |
|
|
|
|
|
|
|
|
|
|
|
Page({ |
|
|
|
Page({ |
|
|
|
data: { |
|
|
|
data: { |
|
|
|
diagnoseImg: "", |
|
|
|
diagnoseImg: '', |
|
|
|
error: false, |
|
|
|
error: false, |
|
|
|
errorText: "", |
|
|
|
errorText: '', |
|
|
|
aiPass: 0, |
|
|
|
aiPass: 0, |
|
|
|
verify: false, |
|
|
|
verify: false, |
|
|
|
audit: false, |
|
|
|
audit: false, |
|
|
|
|
|
|
|
|
|
|
|
userInfo: app.globalData.userInfo, |
|
|
|
userInfo: app.globalData.userInfo, |
|
|
|
Hash: "", |
|
|
|
Hash: '', |
|
|
|
}, |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
onLoad() { |
|
|
|
app.waitLogin({}).then(() => { |
|
|
|
app.waitLogin({}).then(() => { |
|
|
|
app.getUserInfo(this, true, (userInfo) => { |
|
|
|
app.getUserInfo(this, true, (userInfo) => { |
|
|
|
if (userInfo.UserType == 4) { |
|
|
|
if (userInfo.UserType == 4) { |
|
|
|
wx.reLaunch({ |
|
|
|
wx.reLaunch({ |
|
|
|
url: "/pages/my/index", |
|
|
|
url: '/pages/my/index', |
|
|
|
}); |
|
|
|
}) |
|
|
|
|
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
app.permissionVerification(3, 0, `/pages/index/index`); |
|
|
|
if (userInfo.UseDrugsAuditStatus == 1) { |
|
|
|
}); |
|
|
|
wx.redirectTo({ |
|
|
|
}); |
|
|
|
url: '/gift/pages/vipPending/index', |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
app.permissionVerification(3, 0, `/pages/index/index`) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleSetData(e: WechatMiniprogram.CustomEvent) { |
|
|
|
handleSetData(e: WechatMiniprogram.CustomEvent) { |
|
|
|
const imgUrl = e.detail[0].imgUrl; |
|
|
|
const imgUrl = e.detail[0].imgUrl |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
diagnoseImg: imgUrl, |
|
|
|
diagnoseImg: imgUrl, |
|
|
|
audit: true, |
|
|
|
audit: true, |
|
|
|
}); |
|
|
|
}) |
|
|
|
this.handleAiPass(imgUrl); |
|
|
|
this.handleAiPass(imgUrl) |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleAiPass(imgUrl: string) { |
|
|
|
handleAiPass(imgUrl: string) { |
|
|
|
wx.ajax({ |
|
|
|
wx.ajax({ |
|
|
|
method: "POST", |
|
|
|
method: 'POST', |
|
|
|
url: "?r=igg4/common/medicine-image-verify", |
|
|
|
url: '?r=igg4/common/medicine-image-verify', |
|
|
|
data: { |
|
|
|
data: { |
|
|
|
ImageUrl: imgUrl, |
|
|
|
ImageUrl: imgUrl, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}).then((res) => { |
|
|
|
}).then((res) => { |
|
|
|
const { code, Hash } = res; |
|
|
|
const { code, Hash } = res |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
Hash, |
|
|
|
Hash, |
|
|
|
}); |
|
|
|
}) |
|
|
|
if (code === 0) { |
|
|
|
if (code === 0) { |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
audit: false, |
|
|
|
audit: false, |
|
|
|
verify: true, |
|
|
|
verify: true, |
|
|
|
aiPass: 1, |
|
|
|
aiPass: 1, |
|
|
|
}); |
|
|
|
}) |
|
|
|
this.handleSubmit(); |
|
|
|
this.handleSubmit() |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
const errorText = { |
|
|
|
const errorText = { |
|
|
|
1001: "智能审核失败:图片模糊无法识别", |
|
|
|
1001: '智能审核失败:图片模糊无法识别', |
|
|
|
1002: "智能审核失败:图片模糊无法识别", |
|
|
|
1002: '智能审核失败:图片模糊无法识别', |
|
|
|
2001: "智能审核失败:疑似提交重复图片", |
|
|
|
2001: '智能审核失败:疑似提交重复图片', |
|
|
|
2002: '智能审核失败:您提交图片中不包含"艾加莫德"相关字样', |
|
|
|
2002: '智能审核失败:您提交图片中不包含"伊奈利珠单抗注射液"相关字样', |
|
|
|
}; |
|
|
|
} |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
audit: false, |
|
|
|
audit: false, |
|
|
|
error: true, |
|
|
|
error: true, |
|
|
|
errorText: errorText[code] || errorText[1001], |
|
|
|
errorText: errorText[code] || errorText[1001], |
|
|
|
}); |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleSubmit() { |
|
|
|
handleSubmit() { |
|
|
|
const { registrationSource, registChannel, regBusinessId } = app.globalData; |
|
|
|
const { registrationSource, registChannel, regBusinessId } = app.globalData |
|
|
|
const { diagnoseImg, error, userInfo, Hash } = this.data; |
|
|
|
const { diagnoseImg, error, Hash } = this.data |
|
|
|
let urlKey = ""; |
|
|
|
let urlKey = '' |
|
|
|
|
|
|
|
|
|
|
|
if (error) { |
|
|
|
if (error) { |
|
|
|
urlKey = userInfo.isFollow ? "nopending" : "pending"; |
|
|
|
urlKey = 'pending' |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
urlKey = "reslove"; |
|
|
|
urlKey = 'reslove' |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const navUrl = { |
|
|
|
const navUrl = { |
|
|
|
reslove: "/pages/index/index", |
|
|
|
reslove: '/pages/index/index', |
|
|
|
pending: "/gift/pages/vipPending/index", |
|
|
|
pending: '/gift/pages/vipPending/index', |
|
|
|
nopending: "/gift/pages/vimStartPending/index", |
|
|
|
}[urlKey] as string |
|
|
|
}[urlKey] as string; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wx.ajax({ |
|
|
|
wx.ajax({ |
|
|
|
method: "POST", |
|
|
|
method: 'POST', |
|
|
|
url: "?r=igg4/account/upload-use-drugs-audit-img", |
|
|
|
url: '?r=igg4/account/upload-use-drugs-audit-img', |
|
|
|
data: { |
|
|
|
data: { |
|
|
|
diagnoseImg, |
|
|
|
diagnoseImg, |
|
|
|
aiPass: this.data.aiPass, |
|
|
|
aiPass: this.data.aiPass, |
|
|
|
@ -99,36 +105,20 @@ Page({ |
|
|
|
app.getUserInfo(this, true, () => { |
|
|
|
app.getUserInfo(this, true, () => { |
|
|
|
wx.reLaunch({ |
|
|
|
wx.reLaunch({ |
|
|
|
url: navUrl, |
|
|
|
url: navUrl, |
|
|
|
}); |
|
|
|
}) |
|
|
|
}); |
|
|
|
}) |
|
|
|
}); |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleReset() { |
|
|
|
handleReset() { |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
diagnoseImg: "", |
|
|
|
diagnoseImg: '', |
|
|
|
error: false, |
|
|
|
error: false, |
|
|
|
errorText: "", |
|
|
|
errorText: '', |
|
|
|
aiPass: 0, |
|
|
|
aiPass: 0, |
|
|
|
verify: false, |
|
|
|
verify: false, |
|
|
|
}); |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
handleVisitors() { |
|
|
|
|
|
|
|
app.globalData.anyWhere = true; |
|
|
|
|
|
|
|
wx.reLaunch({ |
|
|
|
|
|
|
|
url: "/pages/index/index", |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleVip() { |
|
|
|
|
|
|
|
wx.navigateTo({ |
|
|
|
|
|
|
|
url: "/pages/vipLogin/index", |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
handleBack() { |
|
|
|
handleBack() { |
|
|
|
wx.navigateBack(); |
|
|
|
wx.navigateBack() |
|
|
|
}, |
|
|
|
|
|
|
|
handleVipScan() { |
|
|
|
|
|
|
|
wx.navigateTo({ |
|
|
|
|
|
|
|
url: "/pages/vipLogin/index", |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
}); |
|
|
|
}) |
|
|
|
|