Commit 9f4d9f7b by 吴娟华

'修改'

1 parent 495b60c1
...@@ -107,27 +107,34 @@ export default { ...@@ -107,27 +107,34 @@ export default {
sessionStorage.setItem('URL_PARAM', JSON.stringify(urlObj)) sessionStorage.setItem('URL_PARAM', JSON.stringify(urlObj))
//console.log(JSON.parse(sessionStorage.getItem('URL_PARAM'))) //console.log(JSON.parse(sessionStorage.getItem('URL_PARAM')))
if(('appId' in urlObj) && ('courseId' in urlObj) && ('channl' in urlObj) && ('merchantId' in urlObj) && ('fissionUser' in urlObj)) { }
if(urlObj.fissionUser === 'false') {
this.showLoading() let urlObj = JSON.parse(sessionStorage.getItem('URL_PARAM'))
equity.getFissionInfo({merchantId: urlObj.merchantId}).then(res => { if(('appId' in urlObj) && ('courseId' in urlObj) && ('channl' in urlObj) && ('merchantId' in urlObj) && ('fissionUser' in urlObj)) {
let { code, data, message } = res if(urlObj.fissionUser === 'false') {
this.hideLoading() this.showLoading()
if (code == 0) { equity.getFissionInfo({merchantId: urlObj.merchantId}).then(res => {
if(data.presentNumber>0) { let { code, data, message } = res
this.openCard(urlObj) this.hideLoading()
} if (code == 0) {
} else { if(data.presentNumber>0) {
this.showToast(message) this.openCard(urlObj)
}else{
this.showToast('赠送名额已失效,请联系门店')
this.init()
} }
}) } else {
}else if (urlObj.fissionUser === 'true') { this.showToast(message)
this.openCard(urlObj) this.init()
} }
})
}else if (urlObj.fissionUser === 'true') {
this.openCard(urlObj)
} }
}else{
this.init()
} }
this.init()
}, },
methods: { methods: {
...@@ -149,20 +156,17 @@ export default { ...@@ -149,20 +156,17 @@ export default {
} }
}, },
openCard(data) { openCard(data) {
let { sessionId } = this.$store.state this.showLoading()
equity.openCardFission({...data}).then(res => {
if (sessionId) { let { code, message } = res
this.showLoading() this.hideLoading()
equity.openCardFission({...data}).then(res => { if (code == 0) {
let { code, message } = res //
this.hideLoading() } else {
if (code == 0) { this.showToast(message)
// }
} else { this.init()
this.showToast(message) })
}
})
}
}, },
receive () { receive () {
let { sessionId, phone } = this.$store.state let { sessionId, phone } = this.$store.state
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!