shish 5 лет назад
Родитель
Сommit
624050b02e

+ 5 - 0
mallApp/src/api/custom/index.js

@@ -0,0 +1,5 @@
+import https from '@/plugins/luch-request_0.0.7/request'
+
+export const initCustom = data => {
+	return https.get('/custom/init-custom', data)
+}

+ 1 - 1
mallApp/src/ext-glhs.json

@@ -3,7 +3,7 @@
   "extAppid": "wxe994a9f5fd036f69",
   "directCommit": false,
   "ext": {
-    "account": 12358,
+    "account": 0,
     "apiHost": "https://api.mall.huahb.com",
     "imgHost": "https://img.huahb.com",
     "merchantName":"国兰花尚"

+ 1 - 1
mallApp/src/ext-production.json

@@ -3,7 +3,7 @@
   "extAppid": "wxe994a9f5fd036f69",
   "directCommit": false,
   "ext": {
-    "account": 12358,
+    "account": 0,
     "apiHost": "https://api.mall.huahb.com",
     "imgHost": "https://img.huahb.com",
     "name":"国兰花尚"

+ 13 - 1
mallApp/src/mixins/globalMixins.js

@@ -1,6 +1,7 @@
 import { mapGetters } from 'vuex'
 import { pageTo, getCheckLogin, isLogin } from '@/utils/util.js'
-import { getUser, wxLoginFn } from '@/utils/auth'
+import { wxLoginFn } from '@/utils/auth'
+import { initCustom } from '@/api/custom'
 import constant from '@/constant'
 export default {
 	data() {
@@ -25,6 +26,17 @@ export default {
 			uni.setStorageSync('token', option.token)
 		}
 		if (option.account) {
+
+			//let oldAccount = uni.getStorageSync('account')
+			//切换门店,需要先确认有没生成客户id
+			//if(oldAccount != option.account){
+				// initCustom().then(res => {
+				// 	if(res.code == 1){
+				// 		uni.setStorageSync('customId', res.data.custom.id)
+				// 	}
+				// })
+			//}
+
 			uni.setStorageSync('account', option.account)
 		}
 		if (constant.source == 'mall') {

+ 7 - 14
mallApp/src/pages/home/recent.vue

@@ -1,20 +1,20 @@
 <template>
   <view class="latest-content_box">
-    <view class="shop-list_box" v-if="show">
+    <view class="shop-list_box" v-if="showGlInfo == 0">
       <template v-if="!$util.isEmpty(list)">
         <view
-          :key="item.shopId"
+          :key="item.id"
           @click="pageTo({
-              url: '/pages/home/index',
+              url: '/pages/home/index?account',
               type:4,
               query: {
-                account: '15680'
+                account: item.id
               }
             })"
           v-for="item in list"
         >
           <!-- <app-avatar-module :src="item.shopImg" /> -->
-          <image :src="item.shopImg"></image>
+          <image :src="item.avatar"></image>
           <view class="tit">
             {{item.shopName}}
           </view>
@@ -83,12 +83,6 @@
         </tui-list-cell>
       </tui-list-view>
     </div>
-    <!-- <app-footer :activeIndex="2" /> -->
-    <app-activily-coupon
-      :show.sync="activeCoupon"
-      :info="newUserGift"
-      :introUserId="option.introUserId"
-    />
   </div>
   </view>
 </template>
@@ -114,7 +108,7 @@ export default {
   data () {
     return {
       list: [],
-      show: false,
+      showGlInfo: 0,
       ad: [
         {
           "img":`${this.$constant.imgUrl}//uploads/12358/202005/30/73ef244f75d985e5295c6481a693fd23.jpeg`
@@ -140,8 +134,7 @@ export default {
       try {
         const { data } = await recentShop({})
         this.list = data.list
-        this.show = data.showIndex
-        console.log(this.show)
+        this.showGlInfo = data.showGlInfo
       } catch (e) {
       }
     }

+ 31 - 130
mallApp/src/pages/home/user.vue

@@ -6,41 +6,22 @@
           <div class="user-wrap-top">
             <div class="user-blo-left">
               <div class="user-name-warp">
-                <div class="user-name">{{ shopUser.name }}</div>
+                <div class="user-name">石少华</div>
                 <div class="user-level-img">
-                  <block v-if="!$util.isEmpty(shopUser)">
-                    <template v-if="1==1">
+                  <block>
+                    <template>
                       <div class="nomal-text">普通客户</div>
                     </template>
-                    <template v-else>
-                      <template v-if="shopUser.member > 0">
-                        <appVipModule
-                          class="level-img"
-                          :vipImgUrl="`${constant.imgUrl}/retail/member/grade/${shopUser.member}.png`"
-                        />
-                      </template>
-                      <template v-else>
-                        <template v-if="mobile != '' && subscribe == 1">
-                          <appVipModule
-                            class="level-img"
-                            :vipImgUrl="`${constant.imgUrl}/retail/member/grade/member.png`"
-                          />
-                        </template>
-                        <template v-else>
-                          <div class="nomal-text">普通客户</div>
-                        </template>
-                      </template>
-                    </template>
                   </block>
                 </div>
               </div>
               <div class="user-level">
-                <div>成长值 {{ shopUser.growth }}/{{ shopUser.userAsset.nextLevelGrowth }}</div>
+                <div>ID 98</div>
               </div>
             </div>
             <div class="user-blo-right login-attr-wrap">
               <img
-                :src="smallAvatarUrl | default_avatar"
+                :src="`${constant.imgUrl}/hhb_small.png`"
                 alt="头像"
                 mode="widthFix"
               />
@@ -49,37 +30,41 @@
           <div class="user-wrap-bottom">
             <div class="level-lint">
               <progress
-                :percent="percentNum"
+                percent="0"
                 stroke-width="2"
                 activeColor="#ffe4bd"
                 backgroundColor="#FF2842"
               />
             </div>
-            <div>ID {{ shopUser.id }}</div>
+            <div>成长值 580 </div>
           </div>
         </div>
       </template>
     </div>
-    <template v-if="!$util.isEmpty(shopUser)">
+    <template>
       <div class="surplus-wrap">
         <div class="surplus-left">
           <div>我的余额(¥)</div>
-          <div class="my-surplus">{{ shopUser.userAsset.balance || 0.00 }}</div>
+          <div class="my-surplus">0.00</div>
         </div>
         <div class="surplus-right">
-
           <button
             class="button-com red"
-            @click="pageToFn({
-					url: '/pages/pay/index',
-					query: {
-						pageStatus: 'payment'
-					}
-				})"
-          >付款</button>
+            @click="
+              pageToFn({
+                url: '/pages/pay/index',
+                query: {
+                  pageStatus: 'payment',
+                },
+              })
+            "
+          >
+            付款
+          </button>
         </div>
       </div>
     </template>
+
     <div class="list-content">
       <tui-list-view class="tui-list-view">
         <tui-list-cell
@@ -133,36 +118,19 @@
             <div class="list-label">支付密码</div>
           </div>
         </tui-list-cell>
-        
       </tui-list-view>
     </div>
-
-    <login-popup
-      :show="popupShow"
-      :info="wxInfo"
-      :merchantInfo="merchantInfo"
-      :isPublic="isPublic"
-      :subscribe.sync="subscribe"
-      :mobile.sync="mobile"
-      @hide="hidePopup"
-    />
-    <app-trademark />
-    <go-login :show.sync="loginShow" />
     <tab-bar :current="4"></tab-bar>
   </div>
 </template>
 
 <script>
-import { mapGetters } from "vuex";
 import TuiListView from "@/components/plugin/list-view";
 import TuiListCell from "@/components/plugin/list-cell";
 import LoginPopup from "@/pages/home/components/login-popup";
 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";
-import { getMerchantInfo } from "@/api/common";
-import { getShopUser } from "@/utils/auth";
 export default {
   name: "user",
   components: {
@@ -171,9 +139,9 @@ export default {
     LoginPopup,
     AppTrademark,
     GoLogin,
-    AppVipModule
+    AppVipModule,
   },
-  data () {
+  data() {
     return {
       constant: this.$constant,
       popupShow: false,
@@ -184,89 +152,22 @@ export default {
       merchantInfo: {},
       mobile: "",
       subscribe: 0,
-      currentTabIndex: 4
+      currentTabIndex: 4,
     };
   },
   watch: {
-    mobile (newVal, oldVal) { }
+
   },
   computed: {
-    ...mapGetters({ shopUser: "getShopUser" }),
-    // #ifdef MP-WEIXIN
-    ...mapGetters({ loginInfo: "getLoginInfo" }),
-    // #endif
-    smallAvatarUrl () {
-      return this.shopUser.smallAvatarUrl || "";
-    },
-    percentNum () {
-      if (this.$util.isEmpty(this.shopUser)) {
-        return 0;
-      }
-      return Math.round(
-        (this.shopUser.userAsset.growth /
-          this.shopUser.userAsset.nextLevelGrowth) *
-        100
-      );
-    }
   },
-  onLoad (option) {
-    // this.init()
+  onLoad(option) {
   },
   methods: {
-    init () {
-      getShopUser().then(res => {
-        this.mobile = res.mobile;
-        this.subscribe = parseInt(res.subscribe);
-        if (this.option.scan == 1) {
-          //没有注册手机号或关注公众号的
-          if (this.$util.isEmpty(res.mobile) || res.subscribe == 0) {
-            this.isPublic = true;
-            this.popupShow = true;
-          }
-        }
-      });
-      getMerchantInfo().then(res => {
-        this.merchantInfo = res.data;
-      });
-    },
-    pageToFn (item) {
-      if (this.$util.isLogin()) {
-        this.$util.pageTo(item);
-      } else {
-        this.loginShow = true;
-      }
-    },
-    showPopup () {
-      // #ifdef H5
-      this.pageTo("/pages/user/register");
-      // #endif
-      // #ifdef MP-WEIXIN
-      this.popupShow = true;
-      // #endif
-    },
-    hidePopup () {
-      this.popupShow = false;
-    },
-    logoutFn () {
-      return false;
-      uni.clearStorageSync();
-      // #ifdef H5
-      this.$util.pageTo({
-        url: "/pages/home/index",
-        type: 4
-      });
-      // #endif
-      // #ifndef H5
-      this.$util.pageTo({
-        url: "/pages/home/index",
-        type: 4
-      });
-      // #endif
-    },
-    tabClick (index) {
-      this.currentTabIndex = index
+    init() {},
+    pageToFn(item) {
+        this.$util.pageTo(item)
     }
-  }
+  },
 };
 </script>
 
@@ -392,4 +293,4 @@ export default {
     }
   }
 }
-</style>
+</style>

+ 4 - 4
mallApp/src/utils/util.js

@@ -208,10 +208,10 @@ export const pageTo = (item) => {
 			})
 		} else if (item.type == 4) {
 			console.log('switchTab', item.query)
-      uni.setStorageSync('switchTabQuery', item.query)
-      if (item.query.account) {
-        uni.setStorageSync('account', item.query.account)
-      }
+			uni.setStorageSync('switchTabQuery', item.query)
+			if (item.query.account) {
+				uni.setStorageSync('account', item.query.account)
+			}
 			uni.switchTab({
 				url: item.url
 			})