Commit 31a854bb by 张立顺

feat 功能禁用

1 parent 88069fb3
...@@ -49,7 +49,8 @@ import { ...@@ -49,7 +49,8 @@ import {
// Overlay, // Overlay,
// loading, // loading,
// SwipeCell // SwipeCell
Toast Toast,
Dialog
} from 'vant' } from 'vant'
export const components = [ export const components = [
Toast, Toast,
...@@ -84,7 +85,8 @@ export const components = [ ...@@ -84,7 +85,8 @@ export const components = [
// Cascader, // Cascader,
// Checkbox, // Checkbox,
// CheckboxGroup, // CheckboxGroup,
Notify Notify,
Dialog
// Icon, // Icon,
// Empty, // Empty,
// PullRefresh, // PullRefresh,
......
...@@ -80,12 +80,18 @@ ...@@ -80,12 +80,18 @@
<img class="logoIcon" src="../images/djLogin.png" /> <img class="logoIcon" src="../images/djLogin.png" />
</div> </div>
</div> </div>
<van-dialog v-model="show" confirm-button-text="知道了" confirm-button-color="#347BFF">
<img class="errorIcon" src="https://img02.glsx.com.cn/weapp/resource/venus-agentic/sass/h5/image/error.png" />
<div class="text ">当前收款码已停用,请联系销售人员</div>
<div class="text text_bottom">重新提供新的收款码,谢谢~</div>
</van-dialog>
</div> </div>
</template> </template>
<script> <script>
import { alipayOauthToken, createWxPayH5, getTitleByModule } from '@/api/alipayApi' import { alipayOauthToken, createWxPayH5, getTitleByModule } from '@/api/alipayApi'
import { baseConfig } from '@/main' import { baseConfig } from '@/main'
import { Toast, Dialog } from 'vant'
export default { export default {
name: 'Alipay', name: 'Alipay',
data() { data() {
...@@ -120,7 +126,9 @@ export default { ...@@ -120,7 +126,9 @@ export default {
userCollaborationCheck: false, userCollaborationCheck: false,
isYqType: true, isYqType: true,
merchantDisabled: false, merchantDisabled: false,
appId: '' appId: '',
disabledPay: false,
show: false
} }
}, },
mounted() { mounted() {
...@@ -135,7 +143,9 @@ export default { ...@@ -135,7 +143,9 @@ export default {
// 区分是流量方还是导流方 // 区分是流量方还是导流方
// this.getMiniAppConfig() // this.getMiniAppConfig()
this.setMerchantDisabled(merchantId || shopMerchantId) this.setMerchantDisabled(merchantId || shopMerchantId)
console.log(merchantId || M, 'merchantId || M')
if (merchantId || M) { if (merchantId || M) {
this.setDisabledList(merchantId || M)
this.merchantId = merchantId || M this.merchantId = merchantId || M
this.merchantName = merchantName || MN this.merchantName = merchantName || MN
} else { } else {
...@@ -183,6 +193,15 @@ export default { ...@@ -183,6 +193,15 @@ export default {
this.getTitleByModule() this.getTitleByModule()
}, },
methods: { methods: {
// 如果id不住名单中,就弹框提升并禁用cer
setDisabledList(id) {
const { prohibitedList } = baseConfig
this.disabledPay = !prohibitedList.some(item => item.merchantId == id)
console.log(this.disabledPay, prohibitedList)
if (this.disabledPay) {
this.show = true
}
},
setMerchantDisabled(id) { setMerchantDisabled(id) {
const { disabledList } = baseConfig const { disabledList } = baseConfig
this.merchantDisabled = disabledList.some(item => item.merchantId == id) this.merchantDisabled = disabledList.some(item => item.merchantId == id)
...@@ -281,6 +300,9 @@ export default { ...@@ -281,6 +300,9 @@ export default {
handlePay() { handlePay() {
// const _this = this // const _this = this
const { payMoney, unPayMoneyList, userId, userCollaborationName, userCollaborationCheck, merchantDisabled } = this const { payMoney, unPayMoneyList, userId, userCollaborationName, userCollaborationCheck, merchantDisabled } = this
if (this.disabledPay) {
this.show = true
}
if (payMoney === '' || unPayMoneyList.includes(payMoney)) return if (payMoney === '' || unPayMoneyList.includes(payMoney)) return
if (userCollaborationName && !userCollaborationCheck && !merchantDisabled) { if (userCollaborationName && !userCollaborationCheck && !merchantDisabled) {
return this.showToast(`请先阅读并勾选《${userCollaborationName}》`) return this.showToast(`请先阅读并勾选《${userCollaborationName}》`)
...@@ -667,4 +689,22 @@ export default { ...@@ -667,4 +689,22 @@ export default {
width: 200px; width: 200px;
height: 50px; height: 50px;
} }
.text {
text-align: center;
}
.errorIcon {
display: flex;
align-items: center;
width: 117px;
height: 88px;
margin: 30px auto 16px;
}
.text_bottom {
margin-bottom: 32px;
}
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!