|
@@ -1,5 +1,5 @@
|
|
|
import request from '@/helpers/request'
|
|
|
-import { Button, Toast } from 'vant'
|
|
|
+import { Button, Popup, Toast } from 'vant'
|
|
|
import { defineComponent } from 'vue'
|
|
|
import styles from './index.module.less'
|
|
|
import UserAuth from '@/views/order-detail/userAuth/index'
|
|
@@ -7,11 +7,13 @@ import { postMessage } from '@/helpers/native-message'
|
|
|
import { state } from '@/state'
|
|
|
import ColHeader from '@/components/col-header'
|
|
|
import TheSticky from '@/components/the-sticky'
|
|
|
+import { browser } from '@/helpers/utils'
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'cash-protocol',
|
|
|
data() {
|
|
|
return {
|
|
|
+ dialogStatus: false,
|
|
|
realStatus: true, // 是否已经实名认证
|
|
|
url: '',
|
|
|
signStatus: '' // 签署状态
|
|
@@ -20,18 +22,16 @@ export default defineComponent({
|
|
|
async mounted() {
|
|
|
try {
|
|
|
// 先实名认证
|
|
|
- console.log(state.user)
|
|
|
const user = state.user.data
|
|
|
if (!user.realName || !user.idCardNo) {
|
|
|
this.realStatus = false
|
|
|
} else {
|
|
|
+ const { data } = await request.get(
|
|
|
+ '/api-teacher/sysUserContractRecord/checkContractSignV2?contractType=WITHDRAW'
|
|
|
+ )
|
|
|
+ this.signStatus = data
|
|
|
this.getDetail()
|
|
|
}
|
|
|
-
|
|
|
- const { data } = await request.get(
|
|
|
- '/api-teacher/sysUserContractRecord/checkContractSignV2?contractType=WITHDRAW'
|
|
|
- )
|
|
|
- this.signStatus = data
|
|
|
} catch {
|
|
|
//
|
|
|
}
|
|
@@ -40,25 +40,41 @@ export default defineComponent({
|
|
|
async getDetail() {
|
|
|
try {
|
|
|
// 查询提现协议
|
|
|
- const res = await request.get(
|
|
|
- '/api-teacher/sysUserContractRecord/queryLatestContractTemplate',
|
|
|
- {
|
|
|
- params: {
|
|
|
- contractType: 'WITHDRAW'
|
|
|
+ if (this.signStatus === 'SUCCESS') {
|
|
|
+ const res = await request.get(
|
|
|
+ '/api-teacher/sysUserContractRecord/querySignContract',
|
|
|
+ {
|
|
|
+ params: {
|
|
|
+ contractType: 'WITHDRAW'
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- )
|
|
|
+ )
|
|
|
+ this.url =
|
|
|
+ window.location.origin +
|
|
|
+ window.location.pathname +
|
|
|
+ '/pdf/web/viewer.html?file=' +
|
|
|
+ encodeURIComponent(res.data) +
|
|
|
+ '&btn=1'
|
|
|
+ } else {
|
|
|
+ const res = await request.get(
|
|
|
+ '/api-teacher/sysUserContractRecord/queryLatestContractTemplate',
|
|
|
+ {
|
|
|
+ params: {
|
|
|
+ contractType: 'WITHDRAW'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ )
|
|
|
|
|
|
- this.url =
|
|
|
- window.location.origin +
|
|
|
- window.location.pathname +
|
|
|
- '/pdf/web/viewer.html?file=' +
|
|
|
- // encodeURIComponent(
|
|
|
- // 'http://daya.ks3-cn-beijing.ksyun.com/202207/TAxRhc6.pdf'
|
|
|
- // ) +
|
|
|
- encodeURIComponent(res.data.origanalFileUrl) +
|
|
|
- '&btn=1'
|
|
|
- } catch {}
|
|
|
+ this.url =
|
|
|
+ window.location.origin +
|
|
|
+ window.location.pathname +
|
|
|
+ '/pdf/web/viewer.html?file=' +
|
|
|
+ encodeURIComponent(res.data.origanalFileUrl) +
|
|
|
+ '&btn=1'
|
|
|
+ }
|
|
|
+ } catch {
|
|
|
+ //
|
|
|
+ }
|
|
|
},
|
|
|
async onSubmit() {
|
|
|
try {
|
|
@@ -67,23 +83,33 @@ export default defineComponent({
|
|
|
contractType: 'WITHDRAW'
|
|
|
}
|
|
|
})
|
|
|
- setTimeout(() => {
|
|
|
- Toast('签署成功')
|
|
|
- }, 100)
|
|
|
- setTimeout(() => {
|
|
|
- postMessage({
|
|
|
- api: 'openPageSuccess',
|
|
|
- content: {
|
|
|
- page: 'WITHDRAW'
|
|
|
- }
|
|
|
- })
|
|
|
- }, 1000)
|
|
|
- } catch {}
|
|
|
+ this.dialogStatus = true
|
|
|
+ // setTimeout(() => {
|
|
|
+ // // Toast('签署成功')
|
|
|
+ // }, 100)
|
|
|
+ // setTimeout(() => {
|
|
|
+ // postMessage({
|
|
|
+ // api: 'openPageSuccess',
|
|
|
+ // content: {
|
|
|
+ // page: 'WITHDRAW'
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }, 1000)
|
|
|
+ } catch {
|
|
|
+ //
|
|
|
+ }
|
|
|
},
|
|
|
onSuccess() {
|
|
|
// 实名成功
|
|
|
this.realStatus = true
|
|
|
this.getDetail()
|
|
|
+ },
|
|
|
+ onBack() {
|
|
|
+ if (browser().isApp) {
|
|
|
+ postMessage({ api: 'goBack' })
|
|
|
+ } else {
|
|
|
+ this.$router.back()
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
render() {
|
|
@@ -121,6 +147,28 @@ export default defineComponent({
|
|
|
) : (
|
|
|
<UserAuth hideHeader onSuccess={this.onSuccess} />
|
|
|
)}
|
|
|
+
|
|
|
+ <Popup
|
|
|
+ v-model:show={this.dialogStatus}
|
|
|
+ round
|
|
|
+ class={styles.dialogPopup}
|
|
|
+ >
|
|
|
+ <div class={styles.dialogSection}>
|
|
|
+ <div class={styles.dialogTitle}>提示</div>
|
|
|
+ <div class={styles.dialogContent}>
|
|
|
+ 结算协议签署中,签署成功后即可申请结算
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <Button
|
|
|
+ round
|
|
|
+ type="primary"
|
|
|
+ class={styles.dialogBtn}
|
|
|
+ onClick={() => this.onBack()}
|
|
|
+ >
|
|
|
+ 我知道了
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ </Popup>
|
|
|
</div>
|
|
|
)
|
|
|
}
|