| | |
| | | <!-- #endif --> |
| | | <!-- #ifdef PUB_CUSTOMER --> |
| | | <!-- open-type="getUserInfo"--> |
| | | <button @tap="wxreg('')" |
| | | class="bottom-button">注 册</button> |
| | | <button @tap="wxreg('')" class="bottom-button">注 册</button> |
| | | |
| | | <!-- #endif --> |
| | | |
| | |
| | | }, |
| | | onLoad(options) { |
| | | this.source = options.source || '' |
| | | // #ifdef PUB_CUSTOMER |
| | | var tjson = this.$storage.getItem('cache_customer_info') |
| | | if (tjson) { |
| | | var dto = JSON.parse(tjson) |
| | | if (dto.partnerUserId) { |
| | | this.partnerId = dto.partnerUserId || '' |
| | | this.partnerName = dto.partnerUserName || '佚名' |
| | | } |
| | | } |
| | | // #endif |
| | | |
| | | }, |
| | | methods: { |
| | | async scanPartnerCode() { |
| | | await this.$message.confirm('确定要绑定合伙人吗?') |
| | | // await this.$message.confirm('确定要绑定合伙人吗?') |
| | | //扫二维码确认 |
| | | let that = this |
| | | uni.scanCode({ |
| | |
| | | console.log('条码内容:' + res.result); |
| | | var dto = undefined |
| | | try { |
| | | dto = JSON.parse(res.result) |
| | | if (res.result && (res.result.startsWith('http://') || res.result.startsWith( |
| | | 'https://')) && res.result.indexOf( |
| | | 'partnerUserId') >= 0) { |
| | | var arr = res.result.split("?")[1].split("&") |
| | | dto = {} |
| | | for (var item of arr) { |
| | | var tarr = item.split("=") |
| | | if (tarr[1]) { |
| | | dto[tarr[0]] = tarr[1] |
| | | |
| | | } |
| | | } |
| | | dto['name'] = dto['partnerUserName'] || '' |
| | | dto['userId'] = dto['partnerUserId'] || '' |
| | | |
| | | } else { |
| | | dto = JSON.parse(res.result) |
| | | |
| | | } |
| | | if (!!dto['userId']) { |
| | | that.partnerName = dto['name'] || '' |
| | | that.partnerId = dto['userId'] || '' |
| | |
| | | } |
| | | var dto = JSON.parse(tjson) |
| | | // dto.partnerId = this.partnerId || undefined |
| | | dto.userId = this.partnerId || undefined |
| | | dto.partnerUserId = this.partnerId || undefined |
| | | post.dto = dto |
| | | } |
| | | post.wxcode = wxcode |