浏览代码

注册会员

shish 6 年之前
父节点
当前提交
926f9b41f2

+ 5 - 15
mall/src/pages/home/components/login-popup.vue

@@ -72,8 +72,7 @@
 import AppStep from "@/components/app-step";
 import BottomPopup from "@/components/plugin/bottom-popup";
 import AppClose from "@/components/module/app-close";
-// api
-import { getUser, wxLoginFn } from "@/utils/auth";
+import { getUser, wxLoginFn,getShopUser } from "@/utils/auth";
 import { getWxInfo, getWxPhone } from "@/api/mini";
 export default {
   name: "login-popup-module",
@@ -83,10 +82,6 @@ export default {
     AppClose
   },
   props: {
-    // stepIndex: {
-    // 	type: Number,
-    // 	default: 0
-    // },
     show: {
       type: Boolean,
       default: false
@@ -134,25 +129,19 @@ export default {
         provider: "weixin",
         success: res => {
           console.log("res", res);
-          // this.popupShow = true
           getWxInfo({ iv: res.iv, encryptedData: res.encryptedData }).then(
             subRes => {
-              console.log("用户信息", subRes);
               uni.showToast({
                 icon: "success"
               });
               this.wxInfo = subRes.data;
-              // this.$msg('创建用户信息成功!')
-              // this.popupShow = true
               setTimeout(() => {
                 this.stepIndex = 1;
               }, 1000);
             }
           );
         },
-        fail: () => {
-          // this.loading = false
-        }
+        fail: () => {}
       });
     },
     // 获取微信手机号
@@ -172,9 +161,10 @@ export default {
           //只要授权了手机号就将父页面里的申请会员按钮去除 shish 2020.5.11
           //注册了手机号默认他也会关注公众号,申请会员 暂时按钮隐藏
           //这里的数据要更新到父页面的shopUser里去,因不会做未实现
-          this.$emit('update:subscribe', 1)
-          this.$emit('update:mobile', res.data.mobile)
+          this.$emit("update:subscribe", 1);
+          this.$emit("update:mobile", res.data.mobile);
 
+          getShopUser(true);
           wxLoginFn(true);
 
           setTimeout(() => {

+ 4 - 34
mall/src/pages/home/user.vue

@@ -21,7 +21,10 @@
                       </template>
                       <template v-else>
                         <template v-if="mobile != '' && subscribe == 1">
-                          <appVipModule class="level-img" :vipImgUrl="`${constant.imgUrl}/retail/interest/grade/member.png`" />
+                          <appVipModule
+                            class="level-img"
+                            :vipImgUrl="`${constant.imgUrl}/retail/interest/grade/member.png`"
+                          />
                         </template>
                         <template v-else>
                           <div class="nomal-text">普通客户</div>
@@ -113,7 +116,6 @@
         </tui-list-cell>
       </tui-list-view>
     </div>
-    <!-- 登录弹窗 -->
     <login-popup
       :show="popupShow"
       :info="wxInfo"
@@ -123,17 +125,13 @@
       :mobile.sync="mobile"
       @hide="hidePopup"
     />
-    <!-- 登录弹窗 -->
     <app-trademark />
-    <!-- <app-footer :activeIndex="3" /> -->
-    <!-- login -->
     <go-login :show.sync="loginShow" />
   </div>
 </template>
 
 <script>
 import { mapGetters } from "vuex";
-// import AppFooter from '@/components/app-footer'
 import TuiListView from "@/components/plugin/list-view";
 import TuiListCell from "@/components/plugin/list-cell";
 import LoginPopup from "@/pages/home/components/login-popup";
@@ -141,14 +139,11 @@ import AppTrademark from "@/components/module/app-trademark";
 import GoLogin from "@/pages/home/components/go-login.vue";
 import AppVipModule from "@/components/module/app-vip";
 import { getMiniAppUrl, isWxBrowser } from "@/utils/common";
-// api
 import { getMerchantInfo } from "@/api/common";
 import { getShopUser } from "@/utils/auth";
-// import { getWxInfo, getWxPhone } from '@/api/mini'
 export default {
   name: "user",
   components: {
-    // AppFooter
     TuiListView,
     TuiListCell,
     LoginPopup,
@@ -211,7 +206,6 @@ export default {
         this.merchantInfo = res.data;
       });
     },
-    // pageTo
     pageToFn(item) {
       if (this.$util.isLogin()) {
         this.$util.pageTo(item);
@@ -220,13 +214,8 @@ export default {
       }
     },
     showPopup() {
-      // this.popupShow = true
       // #ifdef H5
       this.pageTo("/pages/user/register");
-      // if (isWxBrowser()) {
-      // 	location.href = `${this.$constant.hostUrl}/auth/prepare?url=${encodeURIComponent(getMiniAppUrl(this.option, true))}`
-      // }
-      // this.$util.getCheckLogin()
       // #endif
       // #ifdef MP-WEIXIN
       this.popupShow = true;
@@ -239,7 +228,6 @@ export default {
       return false;
       uni.clearStorageSync();
       // #ifdef H5
-      // location.reload()
       this.$util.pageTo({
         url: "/pages/home/index",
         type: 4
@@ -252,24 +240,6 @@ export default {
       });
       // #endif
     }
-    // 获取微信信息
-    // getWxAvatar() {
-    // 	uni.getUserInfo({
-    // 		provider: 'weixin',
-    // 		success: res => {
-    // 			console.log('res', res)
-    // 			// this.popupShow = true
-    // 			getWxInfo({ iv: res.iv, encryptedData: res.encryptedData }).then(subRes => {
-    // 				console.log('用户信息', subRes)
-    // 				this.wxInfo = subRes.data
-    // 				this.popupShow = true
-    // 			})
-    // 		},
-    // 		fail: () => {
-    // 			// this.loading = false
-    // 		}
-    // 	})
-    // }
   }
 };
 </script>

+ 1 - 1
shop/src/views/order/components/sel-order.vue

@@ -51,8 +51,8 @@
 							<!-- 制单 -->
 							<template v-if="item.actionName == '制单'">
 								<div v-if="$util.isEmpty(item.receive) && index == 0">
-									<el-button type="primary" @click="hasDeliver">跳过</el-button>
 									<el-button type="primary" @click="fillFormFn">填写</el-button>
+									<el-button type="primary" @click="hasDeliver">跳过</el-button>
 								</div>
 								<div v-else>
 									<!-- <span>配送用户信息</span> -->