|
@@ -31,7 +31,7 @@
|
|
|
|
|
|
|
|
<!-- 责任声明 -->
|
|
<!-- 责任声明 -->
|
|
|
<view class="form-item disclaimer-box">
|
|
<view class="form-item disclaimer-box">
|
|
|
- <view class="disclaimer-check" @click="agreedToTerms = !agreedToTerms">
|
|
|
|
|
|
|
+ <view class="disclaimer-check" @click="toggleAgree">
|
|
|
<view class="disclaimer-checkbox" :class="{ 'disclaimer-checked': agreedToTerms }">
|
|
<view class="disclaimer-checkbox" :class="{ 'disclaimer-checked': agreedToTerms }">
|
|
|
<text class="disclaimer-checkmark" v-if="agreedToTerms">✓</text>
|
|
<text class="disclaimer-checkmark" v-if="agreedToTerms">✓</text>
|
|
|
</view>
|
|
</view>
|
|
@@ -128,35 +128,37 @@ export default {
|
|
|
this.memberId = options.memberId ? parseInt(options.memberId) : null
|
|
this.memberId = options.memberId ? parseInt(options.memberId) : null
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ // 切换同意声明
|
|
|
|
|
+ toggleAgree() {
|
|
|
|
|
+ this.agreedToTerms = !this.agreedToTerms
|
|
|
|
|
+ },
|
|
|
// 未勾选声明时弹窗确认
|
|
// 未勾选声明时弹窗确认
|
|
|
ensureAgreed(isPhoto) {
|
|
ensureAgreed(isPhoto) {
|
|
|
if (this.agreedToTerms) {
|
|
if (this.agreedToTerms) {
|
|
|
this.startPick(isPhoto)
|
|
this.startPick(isPhoto)
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- var self = this
|
|
|
|
|
uni.showModal({
|
|
uni.showModal({
|
|
|
title: '数据使用声明',
|
|
title: '数据使用声明',
|
|
|
- content: '上传报告即代表您同意平台使用报告数据进行分析并提供个性化健康解决方案;平台承诺未经您授权,不会以任何形式将您的报告提供给其他任何个人或机构。点击「同意并继续」即表示您已阅读并同意。',
|
|
|
|
|
|
|
+ content: '上传报告即代表您同意平台使用本报告数据进行分析,为您提供个性化健康解决方案;未经您授权,平台不会以任何形式将您的报告内容提供给其他任何个人或机构。点击「同意并继续」即表示您已阅读并同意。',
|
|
|
confirmText: '同意并继续',
|
|
confirmText: '同意并继续',
|
|
|
cancelText: '暂不',
|
|
cancelText: '暂不',
|
|
|
- success: function(res) {
|
|
|
|
|
|
|
+ success: (res) => {
|
|
|
if (res.confirm) {
|
|
if (res.confirm) {
|
|
|
- self.agreedToTerms = true
|
|
|
|
|
- self.startPick(isPhoto)
|
|
|
|
|
|
|
+ this.agreedToTerms = true
|
|
|
|
|
+ this.startPick(isPhoto)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
startPick(isPhoto) {
|
|
startPick(isPhoto) {
|
|
|
- var self = this
|
|
|
|
|
if (isPhoto) {
|
|
if (isPhoto) {
|
|
|
uni.chooseImage({
|
|
uni.chooseImage({
|
|
|
count: 1,
|
|
count: 1,
|
|
|
sourceType: ['camera', 'album'],
|
|
sourceType: ['camera', 'album'],
|
|
|
- success: function(res) {
|
|
|
|
|
- self.photoPath = res.tempFilePaths[0]
|
|
|
|
|
- self.uploadAndGoConfirm(self.photoPath, 'image')
|
|
|
|
|
|
|
+ success: (res) => {
|
|
|
|
|
+ this.photoPath = res.tempFilePaths[0]
|
|
|
|
|
+ this.uploadAndGoConfirm(this.photoPath, 'image')
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
} else {
|
|
} else {
|
|
@@ -164,14 +166,14 @@ export default {
|
|
|
count: 1,
|
|
count: 1,
|
|
|
type: 'file',
|
|
type: 'file',
|
|
|
extension: ['pdf'],
|
|
extension: ['pdf'],
|
|
|
- success: function(res) {
|
|
|
|
|
|
|
+ success: (res) => {
|
|
|
var files = res.tempFiles
|
|
var files = res.tempFiles
|
|
|
if (files && files.length > 0) {
|
|
if (files && files.length > 0) {
|
|
|
- self.selectedFile = files[0]
|
|
|
|
|
- self.uploadAndGoConfirm(files[0].path, '')
|
|
|
|
|
|
|
+ this.selectedFile = files[0]
|
|
|
|
|
+ this.uploadAndGoConfirm(files[0].path, '')
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- fail: function(e) {
|
|
|
|
|
|
|
+ fail: (e) => {
|
|
|
console.log('选择文件取消或失败', e)
|
|
console.log('选择文件取消或失败', e)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
@@ -187,23 +189,21 @@ export default {
|
|
|
},
|
|
},
|
|
|
// 上传文件 → 自动跳转确认页(确认页按 draftId 触发解析并自动刷新显示结果)
|
|
// 上传文件 → 自动跳转确认页(确认页按 draftId 触发解析并自动刷新显示结果)
|
|
|
uploadAndGoConfirm(filePath, type) {
|
|
uploadAndGoConfirm(filePath, type) {
|
|
|
- var self = this
|
|
|
|
|
if (!filePath) return
|
|
if (!filePath) return
|
|
|
- self.uploading = true
|
|
|
|
|
|
|
+ this.uploading = true
|
|
|
uni.showLoading({ title: '上传中...' })
|
|
uni.showLoading({ title: '上传中...' })
|
|
|
- uploadReportOnly(filePath, type).then(function(res) {
|
|
|
|
|
|
|
+ uploadReportOnly(filePath, type).then((res) => {
|
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
|
- self.uploading = false
|
|
|
|
|
|
|
+ this.uploading = false
|
|
|
var draftId = res.data && res.data.draftId
|
|
var draftId = res.data && res.data.draftId
|
|
|
if (!draftId) {
|
|
if (!draftId) {
|
|
|
uni.showToast({ title: (res && res.message) || '上传失败', icon: 'none' })
|
|
uni.showToast({ title: (res && res.message) || '上传失败', icon: 'none' })
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- // 只传 draftId,确认页自行解析
|
|
|
|
|
uni.redirectTo({ url: '/pages/health/report-detail?draftId=' + draftId })
|
|
uni.redirectTo({ url: '/pages/health/report-detail?draftId=' + draftId })
|
|
|
- }).catch(function(err) {
|
|
|
|
|
|
|
+ }).catch((err) => {
|
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
|
- self.uploading = false
|
|
|
|
|
|
|
+ this.uploading = false
|
|
|
var msg = (err && err.message) || '上传失败,请重试'
|
|
var msg = (err && err.message) || '上传失败,请重试'
|
|
|
uni.showToast({ title: msg, icon: 'none' })
|
|
uni.showToast({ title: msg, icon: 'none' })
|
|
|
})
|
|
})
|