Commit bfbec361 authored by zengqiang's avatar zengqiang

feat(withdraw): 添加唤起微信失败时的降级提示

- 新增FAQ提示:确认收款遇到问题?去小程序试试 - 默认隐藏,仅在唤起微信失败时显示(用户取消不显示) - 点击跳转小程序,复用小程序跳转逻辑 - 使用a标签name属性自动埋点:withdraw_confirm_fallback_miniprogram
parent 43714e68
......@@ -24,6 +24,12 @@
<span class="faq-icon">?</span>
<span>点击后没反应?请更新微信至最新版本</span>
</div>
<!-- 唤起微信失败时显示的提示 -->
<div class="confirm-faq confirm-faq-fallback" v-if="showFallbackHint">
<span>确认收款遇到问题?</span>
<a class="faq-link" name="withdraw_confirm_fallback_miniprogram" @click="handleGoMiniProgram">去小程序试试</a>
</div>
</template>
</div>
</template>
......@@ -49,7 +55,8 @@ export default defineComponent({
packageInfo: '',
mchId: '',
appId: '',
loading: true
loading: true,
showFallbackHint: false
}
},
async created () {
......@@ -144,10 +151,17 @@ export default defineComponent({
if (error.message === 'cancel') {
Toast('用户取消')
} else {
// 唤起失败:显示降级提示
this.showFallbackHint = true
Toast.fail('操作失败')
}
}
},
// 跳转小程序
handleGoMiniProgram () {
const url = `jksxbapp://platformapi/launchMini?appId=${MINI_PROGRAM_APP_ID}&path=${encodeURIComponent(MINI_PROGRAM_PATH)}&miniProgramType=0`
openLink({ url })
},
handleBack () {
this.$router.back()
}
......@@ -275,4 +289,23 @@ export default defineComponent({
font-size: 2.5vw;
font-weight: bold;
}
.confirm-faq-fallback {
margin-top: 3vw;
padding: 3vw;
background: #fff7e6;
border-radius: 2vw;
border: 1px solid #ffd591;
}
.confirm-faq-fallback span {
color: #fa8c16;
}
.faq-link {
color: #1890ff;
text-decoration: underline;
cursor: pointer;
margin-left: 1vw;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment