|
@@ -2,7 +2,7 @@
|
|
|
<div>
|
|
<div>
|
|
|
<div class="defbb p-spac">
|
|
<div class="defbb p-spac">
|
|
|
平台账户授权 [
|
|
平台账户授权 [
|
|
|
- <span class="gray-color" :class="{ 'green-color': true }">{{
|
|
|
|
|
|
|
+ <span class="gray-color" :class="{ 'green-color': progress }">{{
|
|
|
stateText
|
|
stateText
|
|
|
}}</span>
|
|
}}</span>
|
|
|
]<span class="ml-spac p-wcolor" v-if="waring"> [ 提醒:请先绑定“授权手机号”!]</span>
|
|
]<span class="ml-spac p-wcolor" v-if="waring"> [ 提醒:请先绑定“授权手机号”!]</span>
|
|
@@ -11,7 +11,7 @@
|
|
|
<div class="center justify-between p-spacd2 defbb">
|
|
<div class="center justify-between p-spacd2 defbb">
|
|
|
<div>授权手机号</div>
|
|
<div>授权手机号</div>
|
|
|
<div>
|
|
<div>
|
|
|
- <span class="mr-spac">{{ bindPhone }}</span>
|
|
|
|
|
|
|
+ <span class="mr-spac">{{ value }}</span>
|
|
|
<el-button type="text" @click="saveTel()">{{
|
|
<el-button type="text" @click="saveTel()">{{
|
|
|
bindPhoneText
|
|
bindPhoneText
|
|
|
}}</el-button>
|
|
}}</el-button>
|
|
@@ -24,17 +24,17 @@
|
|
|
:class="{ 'gray-color': !isBindPhone}"
|
|
:class="{ 'gray-color': !isBindPhone}"
|
|
|
@click="authEvent(0)"
|
|
@click="authEvent(0)"
|
|
|
>
|
|
>
|
|
|
- 去授权
|
|
|
|
|
|
|
+ {{balanceAuthed?'已授权':'去授权'}}
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="center justify-between p-spacd2 defbb">
|
|
|
|
|
|
|
+ <div class="center justify-between p-spacd2 defbb" v-if="isDealer">
|
|
|
<div>提现授权</div>
|
|
<div>提现授权</div>
|
|
|
<div
|
|
<div
|
|
|
class="pointer p-color"
|
|
class="pointer p-color"
|
|
|
:class="{ 'gray-color': !isBindPhone }"
|
|
:class="{ 'gray-color': !isBindPhone }"
|
|
|
@click="authEvent(1)"
|
|
@click="authEvent(1)"
|
|
|
>
|
|
>
|
|
|
- 去授权
|
|
|
|
|
|
|
+ {{withdrawAuthed?'已授权':'去授权'}}
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -167,19 +167,60 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
props: {
|
|
props: {
|
|
|
- orgInfo: {
|
|
|
|
|
|
|
+ tradeType: {
|
|
|
|
|
+ type: Number
|
|
|
|
|
+ },
|
|
|
|
|
+ value: {
|
|
|
|
|
+ type: String,
|
|
|
|
|
+ default: ''
|
|
|
|
|
+ },
|
|
|
|
|
+ carrierBalanceInfo: {
|
|
|
type: Object,
|
|
type: Object,
|
|
|
- default: function() {
|
|
|
|
|
- return {}
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ default: () => ({})
|
|
|
|
|
+ },
|
|
|
|
|
+ carrierWithdrawInfo: {
|
|
|
|
|
+ type: Object,
|
|
|
|
|
+ default: () => ({})
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
|
|
+ /** 经销 */
|
|
|
|
|
+ isDealer() {
|
|
|
|
|
+ return this.$props.tradeType === 1
|
|
|
|
|
+ },
|
|
|
|
|
+ balanceAuthed() {
|
|
|
|
|
+ return this.carrierBalanceInfo.balanceStatus === 2
|
|
|
|
|
+ },
|
|
|
|
|
+ withdrawAuthed() {
|
|
|
|
|
+ return this.carrierWithdrawInfo.withdrawStatus === 2
|
|
|
|
|
+ },
|
|
|
|
|
+ progress() {
|
|
|
|
|
+ let count = 0
|
|
|
|
|
+ if (this.balanceAuthed) {
|
|
|
|
|
+ count++
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.withdrawAuthed) {
|
|
|
|
|
+ count++
|
|
|
|
|
+ }
|
|
|
|
|
+ return count
|
|
|
|
|
+ },
|
|
|
stateText() {
|
|
stateText() {
|
|
|
- return '未完成'
|
|
|
|
|
|
|
+ let rv = '未完成'
|
|
|
|
|
+ if (this.isDealer) {
|
|
|
|
|
+ if (this.progress === 2) {
|
|
|
|
|
+ rv = '已授权'
|
|
|
|
|
+ } else {
|
|
|
|
|
+ rv = `${this.progress}/2`
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (this.carrierBalanceInfo.balanceStatus === 2) {
|
|
|
|
|
+ rv = '已授权'
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return rv
|
|
|
},
|
|
},
|
|
|
isBindPhone() {
|
|
isBindPhone() {
|
|
|
- return !!this.bindPhone
|
|
|
|
|
|
|
+ return !!this.$props.value
|
|
|
},
|
|
},
|
|
|
bindPhoneText() {
|
|
bindPhoneText() {
|
|
|
return this.isBindPhone ? '修改' : '绑定'
|
|
return this.isBindPhone ? '修改' : '绑定'
|
|
@@ -189,15 +230,19 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
- this.formStepOne.tel = this.bindPhone
|
|
|
|
|
|
|
+ this.formStepOne.tel = this.$props.value
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
authEvent(type) {
|
|
authEvent(type) {
|
|
|
- this.authClicked = true
|
|
|
|
|
|
|
+ if (!this.isBindPhone) {
|
|
|
|
|
+ this.authClicked = true
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ // 转账授权
|
|
|
if (type === 0) {
|
|
if (type === 0) {
|
|
|
- if (this.orgInfo.contractNo) {
|
|
|
|
|
|
|
+ // 已授权
|
|
|
|
|
+ if (this.carrierBalanceInfo.balanceStatus === 2) {
|
|
|
const params = {
|
|
const params = {
|
|
|
- bizUserId: this.orgInfo.bizUserId,
|
|
|
|
|
jumpUrl: window.location.href,
|
|
jumpUrl: window.location.href,
|
|
|
source: 2
|
|
source: 2
|
|
|
}
|
|
}
|
|
@@ -208,8 +253,6 @@ export default {
|
|
|
})
|
|
})
|
|
|
} else {
|
|
} else {
|
|
|
const params = {
|
|
const params = {
|
|
|
- bizUserId: this.orgInfo.bizUserId,
|
|
|
|
|
- orgId: this.orgInfo.orgId,
|
|
|
|
|
source: 2,
|
|
source: 2,
|
|
|
backUrl: window.location.href,
|
|
backUrl: window.location.href,
|
|
|
jumpUrl: location.href
|
|
jumpUrl: location.href
|
|
@@ -222,13 +265,13 @@ export default {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ // 提现授权
|
|
|
if (type === 1) {
|
|
if (type === 1) {
|
|
|
- if (this.orgInfo.protocolNo) {
|
|
|
|
|
|
|
+ // 已授权
|
|
|
|
|
+ if (this.carrierWithdrawInfo.withdrawStatus === 2) {
|
|
|
this.$router.push('accountSetting/balanceProtocol')
|
|
this.$router.push('accountSetting/balanceProtocol')
|
|
|
} else {
|
|
} else {
|
|
|
const params = {
|
|
const params = {
|
|
|
- bizUserId: this.orgInfo.bizUserId,
|
|
|
|
|
- orgId: this.orgInfo.orgId,
|
|
|
|
|
source: 2,
|
|
source: 2,
|
|
|
backUrl: window.location.href,
|
|
backUrl: window.location.href,
|
|
|
jumpUrl: location.href
|
|
jumpUrl: location.href
|
|
@@ -246,13 +289,12 @@ export default {
|
|
|
this.$refs.formBindTel.validate((valid) => {
|
|
this.$refs.formBindTel.validate((valid) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
const params = {
|
|
const params = {
|
|
|
- bizUserId: this.bizUserId,
|
|
|
|
|
verificationCode: this.formBindTel.code,
|
|
verificationCode: this.formBindTel.code,
|
|
|
phone: this.formBindTel.tel
|
|
phone: this.formBindTel.tel
|
|
|
}
|
|
}
|
|
|
$bindPhone(params).then((res) => {
|
|
$bindPhone(params).then((res) => {
|
|
|
this.$message.success(res.message)
|
|
this.$message.success(res.message)
|
|
|
- this.bindPhone = this.formBindTel.tel
|
|
|
|
|
|
|
+ this.$props.value = this.formBindTel.tel
|
|
|
this.formStepOne.tel = this.formBindTel.tel
|
|
this.formStepOne.tel = this.formBindTel.tel
|
|
|
this.bindTelDialogVisible = false
|
|
this.bindTelDialogVisible = false
|
|
|
})
|
|
})
|
|
@@ -305,7 +347,6 @@ export default {
|
|
|
}
|
|
}
|
|
|
const params = {
|
|
const params = {
|
|
|
phone: tel,
|
|
phone: tel,
|
|
|
- bizUserId: this.bizUserId,
|
|
|
|
|
verificationCodeType
|
|
verificationCodeType
|
|
|
}
|
|
}
|
|
|
$sendVerificationCode(params)
|
|
$sendVerificationCode(params)
|
|
@@ -337,7 +378,6 @@ export default {
|
|
|
const code = this.formStepOne.code
|
|
const code = this.formStepOne.code
|
|
|
const params = {
|
|
const params = {
|
|
|
phone: this.formStepOne.tel,
|
|
phone: this.formStepOne.tel,
|
|
|
- bizUserId: this.bizUserId,
|
|
|
|
|
verificationCode: code
|
|
verificationCode: code
|
|
|
}
|
|
}
|
|
|
$unbindPhone(params).then((res) => {
|
|
$unbindPhone(params).then((res) => {
|
|
@@ -345,7 +385,7 @@ export default {
|
|
|
this.stepActive = 2
|
|
this.stepActive = 2
|
|
|
this.footerBtnText = '确认修改'
|
|
this.footerBtnText = '确认修改'
|
|
|
this.$message.success(res.message)
|
|
this.$message.success(res.message)
|
|
|
- this.bindPhone = ''
|
|
|
|
|
|
|
+ this.$props.value = ''
|
|
|
if (this.timer) {
|
|
if (this.timer) {
|
|
|
clearInterval(this.timer)
|
|
clearInterval(this.timer)
|
|
|
this.codeBtn.text = '获取验证码'
|
|
this.codeBtn.text = '获取验证码'
|
|
@@ -364,7 +404,6 @@ export default {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
const params = {
|
|
const params = {
|
|
|
phone: this.formStepTwo.newTel,
|
|
phone: this.formStepTwo.newTel,
|
|
|
- bizUserId: this.bizUserId,
|
|
|
|
|
verificationCode: this.formStepTwo.code
|
|
verificationCode: this.formStepTwo.code
|
|
|
}
|
|
}
|
|
|
$bindPhone(params).then((res) => {
|
|
$bindPhone(params).then((res) => {
|
|
@@ -374,7 +413,7 @@ export default {
|
|
|
this.formStepTwo.tel = ''
|
|
this.formStepTwo.tel = ''
|
|
|
this.formStepTwo.code = ''
|
|
this.formStepTwo.code = ''
|
|
|
this.$message.success(res.message)
|
|
this.$message.success(res.message)
|
|
|
- this.bindPhone = this.formStepTwo.newTel
|
|
|
|
|
|
|
+ this.$props.value = this.formStepTwo.newTel
|
|
|
this.telDialogVisible = false
|
|
this.telDialogVisible = false
|
|
|
} else {
|
|
} else {
|
|
|
this.$message.error(res.message)
|
|
this.$message.error(res.message)
|