Sfoglia il codice sorgente

[ 零售前端 ] 338 修改没有开通网店时的体验

wangn 5 anni fa
parent
commit
06b45bca37

+ 5 - 0
hdApp/src/admin/home/apply.vue

@@ -30,12 +30,17 @@
       </view>
     </view>
     <kd-entrance></kd-entrance>
+    <none-hd :show="AUTHORITY_SHOW" title="您还没有网店哦" btnText="免费申请" @bthClick="toFreeApply_HOME"></none-hd>
   </view>
 </template>
 
 <script>
+import noneHd from "@/components/none-hd";
 export default { // 应用页面
   name: 'Apply',
+  components: {
+    noneHd
+  },
   data () {
     return {
       menuList: [

+ 3 - 0
hdApp/src/admin/home/me.vue

@@ -133,6 +133,7 @@
       @selectSussess="selectSussess"
     ></DorpdownSelect>
     <kd-entrance></kd-entrance>
+    <none-hd :show="AUTHORITY_SHOW" title="您还没有网店哦" btnText="免费申请" @bthClick="toFreeApply_HOME"></none-hd>
   </view>
 </template>
 
@@ -146,6 +147,7 @@ import { selectShop } from "@/mixins";
 import { getUser } from "@/utils/auth";
 import { list } from "@/mixins";
 import { mapGetters } from "vuex";
+import noneHd from "@/components/none-hd";
 export default {
   // 我的
   name: "Me",
@@ -153,6 +155,7 @@ export default {
     AppAvatarModule,
     TuiListCell,
     DorpdownSelect,
+    noneHd
   },
   mixins: [selectShop, list],
   computed: {

+ 4 - 1
hdApp/src/admin/home/member.vue

@@ -54,6 +54,7 @@
       <app-wrapper-empty :is-empty="$util.isEmpty(list.data)" />
     </block>
     <kd-entrance></kd-entrance>
+    <none-hd :show="AUTHORITY_SHOW" title="您还没有网店哦" btnText="免费申请" @bthClick="toFreeApply_HOME"></none-hd>
   </div>
 </template>
 
@@ -66,6 +67,7 @@ import appVipModule from "@/components/module/app-vip";
 import AppTag from '@/components/module/app-tag.vue'
 import { list } from "@/mixins";
 import { getClass, getList } from "@/api/member";
+import noneHd from "@/components/none-hd";
 export default {
   name: "admin-memebr",
   components: {
@@ -74,7 +76,8 @@ export default {
     BadgeModule,
     AppWrapperEmpty,
     appVipModule,
-    AppTag
+    AppTag,
+    noneHd
   },
   mixins: [list],
   data() {

+ 10 - 7
hdApp/src/admin/home/order.vue

@@ -154,6 +154,7 @@
       </template>
     </modal-module>
     <kd-entrance></kd-entrance>
+    <none-hd :show="AUTHORITY_SHOW" title="您还没有网店哦" btnText="免费申请" @bthClick="toFreeApply_HOME"></none-hd>
   </div>
 </template>
 
@@ -167,13 +168,15 @@ import { list } from "@/mixins";
 import { mapGetters } from 'vuex';
 import { orderClass } from '@/api/order'
 import { getListB, freeShipping } from "@/api/order";
+import noneHd from "@/components/none-hd";
 export default {
   name: "order-list",
   components: {
     ListModule,
     AppTabs,
     AppWrapperEmpty,
-    ModalModule
+    ModalModule,
+    noneHd
   },
   mixins: [list],
   data () {
@@ -235,7 +238,7 @@ export default {
     getCategory()
     getUsage()
   },
-  onLoad: function () { },
+  onLoad: function () {},
   onShow () {
     let tabIndex = uni.getStorageSync("switchTabQuery") || null;
     if (tabIndex) {
@@ -256,11 +259,11 @@ export default {
       }).then(res => {
         this.completes(res);
         if (this.$util.isEmpty(res.data)) return false;
-        this.tabs[0].value = res.data.asset.totalOrder;
-        this.tabs[1].value = res.data.asset.unPayOrder;
-        this.tabs[2].value = res.data.asset.unSendOrder;
-        this.tabs[3].value = res.data.asset.sendingOrder;
-        this.tabs[4].value = res.data.asset.finishOrder;
+        // this.tabs[0].value = res.data.asset.totalOrder;
+        // this.tabs[1].value = res.data.asset.unPayOrder;
+        // this.tabs[2].value = res.data.asset.unSendOrder;
+        // this.tabs[3].value = res.data.asset.sendingOrder;
+        // this.tabs[4].value = res.data.asset.finishOrder;
       });
     },
     change (e) {

+ 4 - 0
hdApp/src/admin/home/workbench.vue

@@ -129,6 +129,7 @@
         </div>
       </template>
     </modal-module>
+    <none-hd :show="AUTHORITY_SHOW" title="您还没有网店哦" btnText="免费申请" @bthClick="toFreeApply_HOME"></none-hd>
   </div>
 </template>
 
@@ -141,12 +142,14 @@ import { getDataTimestamp } from "@/utils/common";
 import { getWeixinId } from "@/api/invite/index";
 import { getUser } from "@/utils/auth";
 import { consoleIndex } from "@/api/workbench";
+import noneHd from "@/components/none-hd";
 export default {
   name: "admin-workbench",
   components: {
     ModalModule,
     FabModule,
     AppAvatarModule,
+    noneHd
   },
   // mixins:[share],
   data () {
@@ -278,6 +281,7 @@ export default {
     ...mapGetters({ loginInfo: "getLoginInfo" })
   },
   onLoad (option) {
+    console.log(this.AUTHORITY_SHOW)
    },
   onPullDownRefresh () {
     this.init();

+ 16 - 16
hdApp/src/components/none-hd.vue

@@ -4,8 +4,9 @@
       :src="`${constant.imgUrl}/ghs/home/deserve.png`"
       class="noData_img"
     ></image>
-    <view class="no_data_text">您还没有开店,无法采购哦~</view>
-    <view class="freeApply" @click="apply">免费开店</view>
+    <view class="no_data_text">{{title}}</view>
+    <view class="freeApply" @click="apply">{{btnText}}</view>
+    <view class="experience">体验</view>
   </view>
 </template>
 
@@ -16,13 +17,13 @@ export default {
       type: Boolean,
       default: true,
     },
-    hdShopAdminId: {
-      type: Number,
-      default: 0,
+    btnText: {
+      type: String,
+      default: '222',
     },
-    ghsShopAdminId: {
-      type: Number,
-      default: 0,
+    title: {
+      type: String,
+      default: '111',
     },
   },
   data() {
@@ -32,14 +33,7 @@ export default {
   },
   methods: {
     apply() {
-      this.$util.pageTo({
-        url: "/pagesClient/official/index",
-        type: 2,
-        query: {
-          ghsShopAdminId: this.ghsShopAdminId,
-          hdShopAdminId: this.hdShopAdminId
-        },
-      });
+      this.$emit('bthClick')
     },
   },
 };
@@ -55,6 +49,7 @@ export default {
   height: 100vh;
   background: rgba(0, 0, 0, 0.6);
   color: #fff;
+  overflow: hidden;
   text-align: center;
   & > .noData_img {
     width: 318upx;
@@ -78,5 +73,10 @@ export default {
     color: #ffffff;
     text-align: center;
   }
+  &>.experience{
+    margin-top: 40upx;
+    color: #fff;
+    font-size: 30upx;
+  }
 }
 </style>

+ 49 - 36
hdApp/src/mixins/globalMixins.js

@@ -12,7 +12,9 @@ export default {
 			// 全局混入,插入全局工具函数
 			$util: this.$util,
 			// 全局混入,插入全局跳转函数
-			pageTo: pageTo,
+      pageTo: pageTo,
+      AUTHORITY_SHOW: false,
+      shopAdminId: null
 		}
 	},
 	computed: {
@@ -20,7 +22,8 @@ export default {
 		...mapGetters(["getLoginInfo"])
 	},
 	// 页面生命周期才触发
-	onLoad: function (option) {
+  onLoad: function (option) {
+    console.log(11111)
 		this.option = option || null
 		if (option.token) {
 			uni.setStorageSync('token', option.token)
@@ -28,39 +31,40 @@ export default {
 		if (option.account) {
 			uni.setStorageSync('account', option.account)
 		}
-		uni.setStorageSync('currentQuery', JSON.stringify(option))
-
-		if(this.$util.isEmpty(this.getLoginInfo)){
-			wxLoginFn(true).then(res => {
-				//客户可以访问的地址
-				var urlArr = ['admin/shopAdmin/bind', 'pagesClient/official', 'pagesClient/member/bind', 'pagesShare/pay','pagesPurchase/ghsProduct'];
-				var redirectPage = res.redirectPage;
-				var needRedirect = true;
-				urlArr.forEach((item, index, array) => {
-					if (redirectPage.indexOf(item) != -1) {
-						needRedirect = false;
-					}
-				})
-				if (needRedirect === true) {
-					//客户访问不能查看的页面跳转去官网
-					if (res.data.shopAdminId == '0') {
-						this.$util.pageTo({
-							url: "/pagesClient/official/index",
-							type: 2,
-							query: {
-								...this.option
-							}
-						});
-					}
-				}
-				getUser(true)
-				//获取门店信息
-				this.setUserShopAll()
-				if (this.init) {
-					this.init()
-				}
-			})
-		}
+    uni.setStorageSync('currentQuery', JSON.stringify(option))
+    console.log(uni.getStorageSync('SHOPADMINID'),'this.shopAdminId')
+    if (uni.getStorageSync('SHOPADMINID') == '0') {
+      this.AUTHORITY_SHOW = true
+    }
+    if (this.$util.isEmpty(this.getLoginInfo)) {
+      wxLoginFn(true).then(res => {
+        //客户可以访问的地址
+        var urlArr = ['admin/shopAdmin/bind', 'pagesClient/official', 'pagesClient/member/bind', 'pagesShare/pay', 'pagesPurchase/ghsProduct'];
+        var redirectPage = res.redirectPage;
+        var needRedirect = true;
+        urlArr.forEach((item, index, array) => {
+          if (redirectPage.indexOf(item) != -1) {
+            needRedirect = false;
+          }
+        })
+        if (needRedirect === true) {
+          //客户访问不能查看的页面跳转去官网
+          if (res.data.shopAdminId == '0') {
+            this.AUTHORITY_SHOW = true;
+            uni.setStorageSync('SHOPADMINID', res.data.shopAdminId)
+            this.shopAdminId = true;
+          } else {
+            uni.removeStorageSync('SHOPADMINID')
+          }
+        }
+        getUser(true)
+        //获取门店信息
+        this.setUserShopAll()
+        if (this.init) {
+          this.init()
+        }
+      })
+    }
 
 	},
 	onShow(){
@@ -71,7 +75,16 @@ export default {
 		}
 	},
 	methods: {
-		...mapActions(['setUserShopAll'])
+    ...mapActions(['setUserShopAll']),
+    toFreeApply_HOME () {
+      	this.$util.pageTo({
+      		url: "/pagesClient/official/index",
+      		type: 2,
+      		query: {
+      			...this.option
+      		}
+      	});
+    }
 	},
 	mounted() {
 		if (this.mInit) {

+ 11 - 1
hdApp/src/pagesPurchase/ghsProduct.vue

@@ -105,7 +105,7 @@
 		>
 		</modal-module>
 		<FooterCart :price="allPrice" :count="allCount" @confirm="confirmSelectEvent" ></FooterCart>
-		<noneHd :show.sync="notOpenShop" :ghsShopAdminId.sync="ghsShopAdminId" :hdShopAdminId.sync="hdShopAdminId"></noneHd>
+		<noneHd :show.sync="notOpenShop" title="您还没有开店,无法采购哦~" btnText="免费开店" @bthClick="toPage"></noneHd>
 	</view>
 </template>
 
@@ -225,6 +225,16 @@ export default {
 				this.initAllInput();
 			})
 		},
+    toPage() {
+      this.$util.pageTo({
+        url: "/pagesClient/official/index",
+        type: 2,
+        query: {
+          ghsShopAdminId: this.ghsShopAdminId,
+          hdShopAdminId: this.hdShopAdminId
+        },
+      });
+    },
     // 拨打电话  wangn  2021-5-6
     toPhone(phone){
 			uni.makePhoneCall({