Explorar o código

跳转方式调整

shish %!s(int64=6) %!d(string=hai) anos
pai
achega
6701160406

+ 5 - 6
store/src/admin/official/index.vue

@@ -149,14 +149,13 @@ export default {
         this.status = 3;
         uni.setStorageSync("renewOption", JSON.stringify(this.option));
       } else {
-        uni.clearStorageSync("renewOption");
+        uni.removeStorageSync("renewOption");
       }
-
       //花店分享的页面有邀人,打开页面保存邀请人
-      let introMerchantId =
-        typeof this.option.introMerchantId == "undefined"
-          ? 0
-          : this.option.introMerchantId;
+      let introMerchantId = 0;
+      if (typeof this.option.introMerchantId != "undefined") {
+        introMerchantId = this.option.introMerchantId;
+      }
       uni.setStorageSync("introMerchantId", introMerchantId);
     },
     _getDet() {

+ 13 - 25
store/src/admin/official/pay.vue

@@ -27,11 +27,10 @@
     </div>
     <!-- buttom -->
     <div class="page-btn app-footer">
-
       <div v-if="$util.isEmpty(renewOption)" class="flex-center">
-        <span> </span>
+        <span></span>
         <span class="app-price">
-          <span> </span>
+          <span></span>
           <span class="app-size-40" style="text-decoration:line-through">{{ detail.price }}</span>
         </span>
       </div>
@@ -57,7 +56,6 @@
 </template>
 
 <script>
-// import { getShopUser } from '@/utils/auth'
 import wexinPay from "@/utils/pay/wxPay";
 import { getMealDet, renewWxPay } from "@/api/official";
 export default {
@@ -70,29 +68,20 @@ export default {
       renewOption: null
     };
   },
-  onLoad() {
-    // if (!this.$util.isLogin()) {
-    // 	getShopUser()
-    // 	return false
-    // }
-    // this.init()
-  },
+  onLoad() {},
   methods: {
     init() {
-      this.$util.getCheckLogin().then(res => {
-        if (res) {
-          this._getMealDet();
-          // 续费
-          let renewOption = uni.getStorageSync("renewOption");
-          if (renewOption) {
-            this.renewOption = JSON.parse(renewOption);
-          }
-        }
-      });
+      this._getMealDet();
+      let renewOption = uni.getStorageSync("renewOption");
+      if (renewOption) {
+        this.renewOption = JSON.parse(renewOption);
+      }
     },
     _getMealDet() {
       getMealDet({ id: 1 }).then(res => {
-        if (this.$util.isEmpty(res.data)) return false;
+        if (this.$util.isEmpty(res.data)) {
+          return false;
+        }
         this.detail = res.data.detail;
         this.funcitonData = res.data.function;
       });
@@ -107,7 +96,6 @@ export default {
     },
     // 支付成功
     paySuccess() {
-      // alert('支付成功!')
       this.$util.pageTo({
         url: "/official/callback",
         type: 2,
@@ -117,7 +105,7 @@ export default {
       });
     },
     payFail() {
-      this.$msg("支付失败,请重新支付!");
+      this.$msg("支付没有成功");
     }
   }
 };
@@ -166,7 +154,7 @@ export default {
     .list-wrap {
       border: 2px solid #f9f9f9;
       border-top: none;
-      margin-bottom:110rpx;
+      margin-bottom: 110rpx;
       .list {
         @include disFlex(center, space-between);
         padding: 20px 26px;

+ 12 - 4
store/src/mixins/globalMixins.js

@@ -28,7 +28,6 @@ export default {
 			uni.setStorageSync('account', option.account)
 		}
 
-
 		uni.setStorageSync('currentQuery', JSON.stringify(option))
 		if (isLogin() == false) {
 			wxLoginFn()
@@ -38,7 +37,16 @@ export default {
 					//现在我们分 官网 和 后台 的页面。其中官网页面不多,只有4个页面
 					//shopId=0 (即非管理员) 时不能让访问后台的页面
 					//不管shopId值是多少(是否管理员),有些页面都应允许访问,如下面的:admin/adminShop/bind
-					if (res.redirectPage != 'admin/adminShop/bind') {
+
+					var urlArr = ['admin/adminShop/bind', 'admin/official'];
+					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.shopId > 0) {
 							this.$util.pageTo({
 								url: "/admin/home/workbench",
@@ -50,9 +58,10 @@ export default {
 								type: 2
 							});
 						}
-
 					}
+
 					getUser()
+
 				})
 		}
 
@@ -86,7 +95,6 @@ export default {
 			// 	this.mInit()
 			// })
 			// #endif
-			// console.log('init', this.mInit)
 		}
 	}
 }