doum
2026-04-29 33c2164b1785a4b3c128f71ff577a989e2d91bdc
small-program/shop/pages/login/login.vue
@@ -87,7 +87,7 @@
         }
      },
      methods: {
         async handleLogin() {
         handleLogin() {
            if (!this.form.telephone) {
               uni.showToast({
                  title: '请输入账号',
@@ -109,28 +109,27 @@
               })
               return
            }
            uni.showLoading({ title: '登录中...', mask: true })
            const res = await this.$u.api.shopLogin({
            this.$u.api.shopLogin({
               openid: this.openid,
               password: this.form.password,
               telephone: this.form.telephone
            })
            uni.hideLoading()
            if (res.code === 200) {
               this.$store.commit('setUserType', 1)
               this.$store.commit('setShopToken', res.data.token)
               // 获取门店信息
               const shopInfoRes = await this.$u.api.getShopInfo({})
               if (shopInfoRes.code === 200) {
                  this.$store.commit('setShopInfo', shopInfoRes.data)
            }).then(async res => {
               if (res.code === 200) {
                  this.$store.commit('setUserType', 1)
                  this.$store.commit('setShopToken', res.data.token)
                  // 获取门店信息
                  const shopInfoRes = await this.$u.api.getShopInfo({})
                  if (shopInfoRes.code === 200) {
                     this.$store.commit('setShopInfo', shopInfoRes.data)
                  }
                  uni.showToast({ title: '登录成功', icon: 'success' })
                  setTimeout(() => {
                     uni.reLaunch({
                        url: '/shop/pages/store-home/store-home'
                     });
                  }, 1500)
               }
               uni.showToast({ title: '登录成功', icon: 'success' })
               setTimeout(() => {
                  uni.reLaunch({
                     url: '/shop/pages/store-home/store-home'
                  });
               }, 1500)
            }
            })
         },
         goToService(type) {
            uni.navigateTo({