xuxueyang
2024-08-03 345706a1c57053dae0ef56d0ed911b68b5ecd863
pages/login/supplier-login.vue
@@ -84,7 +84,7 @@
</template>
<script>
   export default {
      onLoad(options) {
      async onLoad(options) {
         // #ifdef PUB_CUSTOMER
         var query = options.q && decodeURIComponent(options.q) || ''
         var querydto = {}
@@ -102,6 +102,22 @@
         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()
@@ -112,6 +128,8 @@
                     tmp.$message.hideLoading()
                     if (tmp.currentInfo && tmp.currentInfo.id || tmp.$storage.getItem('token')) {
                        await this.$store.dispatch('getCurrentInfo');
                        //这种已经登录的
                        //确定是注册绑定还是重新绑定
                        tmp.$nextTick(() => {
@@ -126,10 +144,12 @@
                           }
                           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}`
@@ -138,7 +158,8 @@
                                 }
                                 if (res.cancel) {
                                    if (!tmp.currentInfo.customerDTO) {
                                       tmp.$message.showToast('您尚未完善信息无法绑定')
                                       tmp.$message.showToast(
                                          '您尚未完善信息无法绑定')
                                       return
                                    } else {
                                       if (tmp.currentInfo.customerDTO
@@ -187,6 +208,28 @@
         // #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: '',