فهرست منبع

fix 优化细节

wzh 4 ماه پیش
والد
کامیت
02d148a793
4فایلهای تغییر یافته به همراه29 افزوده شده و 13 حذف شده
  1. 11 2
      pages/cjx/shop/score_list.vue
  2. 2 8
      pages/cjx/shop/shop.vue
  3. 15 2
      pages/hexiao/jxs/add_order.vue
  4. 1 1
      pages/hexiao/login.vue

+ 11 - 2
pages/cjx/shop/score_list.vue

@@ -33,6 +33,7 @@
 
 <script>
 import {scoreRecord} from "@/api/hexiao";
+import {getAdminInfo, getAdminToken, setAdminInfo, setAdminToken} from "@/utils/auth";
 
 export default {
   data() {
@@ -99,8 +100,16 @@ export default {
     },
     // 跳转到积分使用页面
     goToUsagePage() {
-      console.log('跳转到积分商城或使用页面');
-      uni.navigateTo({ url: '/pages/cjx/shop/shop' });
+      let info = getAdminInfo()
+      let userType = info.roleType;
+      let type = 0;
+      if(userType === 1){
+        type = 2;
+      }else if(userType === 2){
+        type = 1;
+      }
+      console.log('跳转到积分商城或使用页面:'+type);
+      uni.navigateTo({ url: '/pages/cjx/shop/shop?type='+type });
     }
   }
 }

+ 2 - 8
pages/cjx/shop/shop.vue

@@ -6,7 +6,6 @@
 
 <script>
 const appId = "wxe25fed34f9f70ef4";
-import {getAdminInfo, getAdminToken, setAdminInfo, setAdminToken} from "@/utils/auth";
 	export default {
 		data() {
 			return {
@@ -14,13 +13,8 @@ import {getAdminInfo, getAdminToken, setAdminInfo, setAdminToken} from "@/utils/
           src :""
 			}
 		},
-    onLoad(){
-      let info = getAdminInfo()
-      let userType = info.roleType;
-      let type = 0;
-      if(userType === 1){
-        type = 2;
-      }
+    onLoad(opt){
+      let type = opt.type;
       this.src = "https://d.dnzc.vip/cache/wx?appid="+appId+"&redirect_uri=https%3A%2F%2Fcjxmall.dnzc.vip%2Fpages%2Fusers%2Fwechat_login%2Findex%3Fstate="+type+"&response_type=code&scope=snsapi_userinfo&connect_redirect=1#wechat_redirect"
     },
 		methods: {

+ 15 - 2
pages/hexiao/jxs/add_order.vue

@@ -93,6 +93,7 @@ export default {
       ],
       // 订单备注
       remarks: '',
+      isLoading:false
     };
   },
   onLoad(opt){
@@ -161,6 +162,12 @@ export default {
           items: items
         };
       uni.showLoading({ title: '正在提交...' });
+      let self = this;
+      if(self.isLoading){
+        uni.showToast({ title: '请勿重复提交', icon: 'none' });
+        return
+      }
+      self.isLoading = true;
       if(this.id>0){
         finalData.orderId = this.id;
         editDealerOrder(finalData).then(res=>{
@@ -169,7 +176,10 @@ export default {
           }
           uni.hideLoading();
 
-          setTimeout(() => uni.reLaunch({url:"/pages/hexiao/jxs/order"}), 1500);
+          setTimeout(() =>{
+            self.isLoading = false;
+            uni.reLaunch({url:"/pages/hexiao/jxs/order"});
+          }, 1500);
         })
       }else{
         addDealerOrder(finalData).then(res=>{
@@ -178,7 +188,10 @@ export default {
           }
           uni.hideLoading();
 
-          setTimeout(() => uni.reLaunch({url:"/pages/hexiao/jxs/order"}), 1500);
+          setTimeout(() =>{
+            self.isLoading = false;
+            uni.reLaunch({url:"/pages/hexiao/jxs/order"});
+          }, 1500);
         })
       }
 

+ 1 - 1
pages/hexiao/login.vue

@@ -129,7 +129,7 @@ export default {
                 self.doLoginSuccess();
               } else {
                 console.log('登录失败!' + res.msg);
-                uni.showToast({ title: err.msg || '登录失败', icon: 'none' });
+                uni.showToast({ title: res.msg || '登录失败', icon: 'none' });
               }
             }).catch(err => {
               // 登录失败 (res.code !== 0 或网络错误)