|  |  |  | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | <script> | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | onLoad(options) { | 
|---|
|  |  |  | async onLoad(options) { | 
|---|
|  |  |  | // #ifdef PUB_CUSTOMER | 
|---|
|  |  |  | var query = options.q && decodeURIComponent(options.q) || '' | 
|---|
|  |  |  | var querydto = {} | 
|---|
|  |  |  | 
|---|
|  |  |  | console.log('options query111', querydto) | 
|---|
|  |  |  | // this.optionsStr = JSON.stringify(options) || '' | 
|---|
|  |  |  | if (querydto.partnerUserId) { | 
|---|
|  |  |  | //通过接口获取名称,兼容,url上不能放中文的情况 | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (!querydto.partnerUserName) { | 
|---|
|  |  |  | this.$message.showLoading() | 
|---|
|  |  |  | const resname = await this.$http.request('get', '/api/customer/partner/name', { | 
|---|
|  |  |  | params: { | 
|---|
|  |  |  | id: querydto.partnerUserId | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.$message.hideLoading() | 
|---|
|  |  |  | if (resname.code == 0) { | 
|---|
|  |  |  | querydto.partnerUserName = resname.data || '' | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (this.$storage.getItem('token')) { | 
|---|
|  |  |  | console.log('to login 1') | 
|---|
|  |  |  | this.$message.showLoading() | 
|---|
|  |  |  | 
|---|
|  |  |  | tmp.$message.hideLoading() | 
|---|
|  |  |  | if (tmp.currentInfo && tmp.currentInfo.id || tmp.$storage.getItem('token')) { | 
|---|
|  |  |  | await this.$store.dispatch('getCurrentInfo'); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //这种已经登录的 | 
|---|
|  |  |  | //确定是注册绑定还是重新绑定 | 
|---|
|  |  |  | tmp.$nextTick(() => { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | uni.showModal({ | 
|---|
|  |  |  | ...tt, | 
|---|
|  |  |  | success: (res) => { | 
|---|
|  |  |  | success: async (res) => { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (res.confirm) { | 
|---|
|  |  |  | //清空登录信息, | 
|---|
|  |  |  | this.$store.commit('updateLogin', false) | 
|---|
|  |  |  | this.$store.commit('updateLogin', | 
|---|
|  |  |  | false) | 
|---|
|  |  |  | setTimeout(() => { | 
|---|
|  |  |  | uni.navigateTo({ | 
|---|
|  |  |  | url: `/sub_pages/customer/customer-info/customer-info?source=step&partnerUserId=${querydto.partnerUserId}&partnerUserName=${querydto.partnerUserName}` | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (res.cancel) { | 
|---|
|  |  |  | if (!tmp.currentInfo.customerDTO) { | 
|---|
|  |  |  | tmp.$message.showToast('您尚未完善信息无法绑定') | 
|---|
|  |  |  | tmp.$message.showToast( | 
|---|
|  |  |  | '您尚未完善信息无法绑定') | 
|---|
|  |  |  | return | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | if (tmp.currentInfo.customerDTO | 
|---|
|  |  |  | 
|---|
|  |  |  | // #endif | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | onShareAppMessage() { | 
|---|
|  |  |  | let that = this; | 
|---|
|  |  |  | var name = that.currentInfo.customerDTO && currentInfo.customerDTO.name || that.currentInfo.supplierDTO && | 
|---|
|  |  |  | currentInfo.supplierDTO.name || that.currentInfo.partnerDTO && currentInfo.partnerDTO.name || '' | 
|---|
|  |  |  | var url = | 
|---|
|  |  |  | `/pages/login/supplier-login?shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数 | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | title: "花满芫", | 
|---|
|  |  |  | path: url, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | onShareTimeline() { | 
|---|
|  |  |  | let that = this; | 
|---|
|  |  |  | var name = that.currentInfo.customerDTO && currentInfo.customerDTO.name || that.currentInfo.supplierDTO && | 
|---|
|  |  |  | currentInfo.supplierDTO.name || that.currentInfo.partnerDTO && currentInfo.partnerDTO.name || '' | 
|---|
|  |  |  | var url = | 
|---|
|  |  |  | `/pages/login/supplier-login?shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数 | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | title: "花满芫", | 
|---|
|  |  |  | path: url, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | data() { | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | optionsStr: '', | 
|---|