bd 3 жил өмнө
parent
commit
bd60915e2f
39 өөрчлөгдсөн 453 нэмэгдсэн , 3744 устгасан
  1. 8 21
      activityPages/activityDetail/activityDetail.vue
  2. 5 20
      activityPages/activitySearch/activitySearch.vue
  3. 24 35
      activityPages/components/index.js
  4. 0 0
      activityPages/components/index.scss
  5. 4 0
      activityPages/components/indexActivity.js
  6. 1 0
      activityPages/components/indexActivity.scss
  7. 7 6
      activityPages/themeActivity/themeActivity.vue
  8. 1 1
      config/api.js
  9. 0 196
      config/md5.js
  10. 180 143
      config/request.js
  11. 0 2
      main.js
  12. 2 3
      pageMy/authGuide/authGuide.vue
  13. 1 0
      pageMy/login/login.vue
  14. 43 35
      pageMy/reportDetail/reportDetail.vue
  15. 39 35
      pages/activity/activity.vue
  16. 5 63
      pages/index/index.vue
  17. 13 16
      pages/my/my.vue
  18. 2 23
      pages/reportForm/components/strategy.vue
  19. 17 76
      pages/reportForm/reportForm.vue
  20. 13 28
      reportPages/IndustryReport/IndustryReport.vue
  21. 1 27
      reportPages/industrialReport/industrialReport.vue
  22. 1 22
      reportPages/reportSearch/reportSearch.vue
  23. 4 20
      reportPages/reportSecretDetail/reportSecretDetail.vue
  24. 12 31
      reportPages/roadEssence/roadEssence.vue
  25. 1 27
      reportPages/secretDetails/secretDetails.vue
  26. 69 57
      store/index.js
  27. 0 147
      uview-ui/components/u-line-progress/u-line-progress.vue
  28. 0 257
      uview-ui/components/u-slider/u-slider.vue
  29. 0 200
      uview-ui/components/u-steps/u-steps.vue
  30. 0 157
      uview-ui/components/u-sticky/u-sticky.vue
  31. 0 355
      uview-ui/components/u-subsection/u-subsection.vue
  32. 0 255
      uview-ui/components/u-swipe-action/u-swipe-action.vue
  33. 0 340
      uview-ui/components/u-swiper/u-swiper.vue
  34. 0 83
      uview-ui/components/u-time-line-item/u-time-line-item.vue
  35. 0 43
      uview-ui/components/u-time-line/u-time-line.vue
  36. 0 220
      uview-ui/components/u-toast/u-toast.vue
  37. 0 121
      uview-ui/components/u-top-tips/u-top-tips.vue
  38. 0 25
      uview-ui/components/u-tr/u-tr.vue
  39. 0 654
      uview-ui/components/u-upload/u-upload.vue

+ 8 - 21
activityPages/activityDetail/activityDetail.vue

@@ -206,7 +206,7 @@ import { activity, User } from "@/config/api.js";
 import modalDialog from "@/components/modalDialog.vue";
 import areaCode from "@/activityPages/components/areaCode.vue";
 import jurisdiction from "./jurisdiction/components.vue";
-let app = getApp({allowDefault: true});
+let app = getApp({ allowDefault: true });
 export default {
   data() {
     return {
@@ -479,26 +479,13 @@ export default {
   onLoad(option) {
     this.id = option.id || "";
   },
-  onShow() {
-    this.$store.dispatch("checkHandle").then((res) => {
-      app.globalData.isAuth = res.IsAuth;
-      app.globalData.isBind = res.IsBind;
-      if (!res.IsAuth && !res.IsBind) {
-        //已授权已绑定
-        this.countryCcode(); //判断是否加区号
-        this.getActivityDetail();
-      } else if (res.IsAuth) {
-        //未授权
-        uni.navigateTo({
-          url: "/pageMy/authGuide/authGuide",
-        });
-      } else if (res.IsBind && !res.IsAuth) {
-        //已授权未绑定
-        uni.navigateTo({
-          url: "/pageMy/login/login",
-        });
-      }
-    });
+  async onShow() {
+    await this.$store.dispatch("checkHandle");
+    if (!this.$store.state.isAuth && !this.$store.state.isBind) {
+      //已授权已绑定
+      this.countryCcode(); //判断是否加区号
+      this.getActivityDetail();
+    }
   },
   /**
    * 用户点击分享

+ 5 - 20
activityPages/activitySearch/activitySearch.vue

@@ -209,8 +209,8 @@ import { activity,User } from "@/config/api.js";
 import { Throttle } from "@/config/util.js";
 import modalDialog from "@/components/modalDialog.vue";
 import areaCode from "@/activityPages/components/areaCode.vue";
-import myMixin from "../index.js";
-import myActivityMixin from "../indexActivity.js";
+import myMixin from "../components/index.js";
+import myActivityMixin from "../components/indexActivity.js";
 let app = getApp({allowDefault: true});
 export default {
   data() {
@@ -506,7 +506,7 @@ export default {
     // },
     // //添加会议提醒接口
     // meetingReminderAdd(id) {
-    // 		if (app.globalData.isBind && !app.globalData.isAuth) {
+    // 		
     // 			uni.navigateTo({
     // 				url: '/pageMy/login/login'
     // 			})
@@ -592,20 +592,6 @@ export default {
   },
   //load
   onLoad(option) {
-    this.$store.dispatch("checkHandle", { type: "load", val: option }).then((res) => {
-      app.globalData.isAuth = res.IsAuth;
-      app.globalData.isBind = res.IsBind;
-      if (res.IsAuth) {
-        //未授权
-        uni.navigateTo({
-          url: "/pageMy/authGuide/authGuide",
-        });
-      } else if (res.IsBind && !res.IsAuth) {
-        //已授权未绑定
-        uni.navigateTo({
-          url: "/pageMy/login/login",
-        });
-      }
       if (this.$db.get("historySearchListActivity")) {
         let historyList = JSON.parse(this.$db.get("historySearchListActivity"));
         this.historySearchList = historyList;
@@ -631,7 +617,6 @@ export default {
         this.changeTarget();
       }
       this.fastSearchKeWord();
-    });
   },
   /* 触底 */
   onReachBottom: Throttle(function () {
@@ -681,7 +666,7 @@ export default {
 </script>
 
 <style scoped lang="scss">
-@import "../index.scss";
+@import "../components/index.scss";
 .dynamic-content {
   padding: 0 0 0 0 !important;
   .target-title {
@@ -710,5 +695,5 @@ export default {
 .activity-pages {
   padding-top: 200rpx;
 }
-@import '../indexActivity.scss';
+@import '../components/indexActivity.scss';
 </style>

+ 24 - 35
activityPages/index.js → activityPages/components/index.js

@@ -65,10 +65,6 @@ export default {
         });
       }
     },
-    //去往详情页面
-    goDetail(item) {
-      this.public({ type: "show" }, true, "/activityPages/activityDetail/activityDetail?id=", item.ActivityId);
-    },
     //是否展示有权限的行业
     isJurisdiction() {
       if (this.isShowJurisdiction) {
@@ -78,13 +74,6 @@ export default {
       }
       this.getUserSearchContent("traverse");
     },
-    /* 初始化判断token  */
-    authentication() {
-      this.$store.dispatch("checkHandle").then((res) => {
-        app.globalData.isAuth = res.IsAuth;
-        app.globalData.isBind = res.IsBind;
-      });
-    },
     /* 新布局产业选项确定按钮 */
     replacementConfirm(type) {
       this.page_no = 1;
@@ -206,30 +195,30 @@ export default {
       });
     },
     // 跳转判断权限
-    public(type, flag, purl, price = "") {
-      this.$store.dispatch("checkHandle", type).then((res) => {
-        app.globalData.isAuth = res.IsAuth;
-        app.globalData.isBind = res.IsBind;
-        if (!res.IsAuth && !res.IsBind) {
-          //已授权已绑定
-          if (flag) {
-            uni.navigateTo({
-              url: purl + price,
-            });
-          }
-        } else if (res.IsAuth) {
-          //未授权
-          uni.navigateTo({
-            url: "/pageMy/authGuide/authGuide",
-          });
-        } else if (res.IsBind && !res.IsAuth) {
-          //已授权未绑定
-          uni.navigateTo({
-            url: "/pageMy/login/login",
-          });
-        }
-      });
-    },
+    // public(type, flag, purl, price = "") {
+    //   this.$store.dispatch("checkHandle", type).then((res) => {
+    //     app.globalData.isAuth = res.IsAuth;
+    //     app.globalData.isBind = res.IsBind;
+    //     if (!res.IsAuth && !res.IsBind) {
+    //       //已授权已绑定
+    //       if (flag) {
+    //         uni.navigateTo({
+    //           url: purl + price,
+    //         });
+    //       }
+    //     } else if (res.IsAuth) {
+    //       //未授权
+    //       uni.navigateTo({
+    //         url: "/pageMy/authGuide/authGuide",
+    //       });
+    //     } else if (res.IsBind && !res.IsAuth) {
+    //       //已授权未绑定
+    //       uni.navigateTo({
+    //         url: "/pageMy/login/login",
+    //       });
+    //     }
+    //   });
+    // },
     //今日,明日 活动的选择
     timeListBtn(type, item) {
       this.activityTimeList.forEach((key) => {

+ 0 - 0
activityPages/index.scss → activityPages/components/index.scss


+ 4 - 0
activityPages/indexActivity.js → activityPages/components/indexActivity.js

@@ -298,5 +298,9 @@ export default {
       this.isShow = false;
       this.isCancelShow = false;
     },
+    //去往详情页面
+    goDetail(item) {
+      this.$store.dispatch("checkHandle", "/activityPages/activityDetail/activityDetail?id=" + item.ActivityId);
+    },
   },
 };

+ 1 - 0
activityPages/indexActivity.scss → activityPages/components/indexActivity.scss

@@ -81,6 +81,7 @@
         font-size: 28rpx;
         color: #666666;
         .item-text {
+          min-height: 200rpx;
           .activity-title {
             color: #333333;
             font-weight: 700;

+ 7 - 6
activityPages/themeActivity/themeActivity.vue

@@ -94,8 +94,8 @@
 import { activity, User } from "@/config/api.js";
 import { Throttle } from "@/config/util.js";
 import modalDialog from "@/components/modalDialog.vue";
-import myMixin from "../index.js";
-import myActivityMixin from "../indexActivity.js";
+import myMixin from "../components/index.js";
+import myActivityMixin from "../components/indexActivity.js";
 import areaCode from "@/activityPages/components/areaCode.vue";
 export default {
   mixins: [myMixin, myActivityMixin],
@@ -144,11 +144,12 @@ export default {
     },
   },
   onLoad(option) {
-    this.$store.dispatch("checkHandle", { type: "load", val: option }).then((res) => {
-      this.label = option.title;
+      this.label = option.title || '茅台';
       this.getActivityList();
       this.countryCcode();
-    });
+  },
+  onShow() {
+    this.$store.dispatch("checkHandle")
   },
   /* 触底 */
   onReachBottom: Throttle(function () {
@@ -191,5 +192,5 @@ export default {
     }
   }
 }
-@import "../indexActivity.scss";
+@import "../components/indexActivity.scss";
 </style>

+ 1 - 1
config/api.js

@@ -279,7 +279,7 @@ export const activity = {
   },
   /* 获取敏捷搜索关键词的列表接口*/
   fastSearchKeWord: (params) => {
-    return getHttp("/activity/labelList", params);
+    return getHttp("/activity/labelMoreList", params);
   },
   /*用户修改外呼手机号以及区号接口*/
   addOutboundMobile: (params) => {

+ 0 - 196
config/md5.js

@@ -1,196 +0,0 @@
-export {
-    hex_md5,
-    b64_md5
-};
-
-var hexcase = 0;
-var b64pad = "";
-var chrsz = 8;
-
-function hex_md5(s) {
-    return binl2hex(core_md5(str2binl(s), s.length * chrsz));
-}
-
-function b64_md5(s) {
-    return binl2b64(core_md5(str2binl(s), s.length * chrsz));
-}
-
-function hex_hmac_md5(key, data) {
-    return binl2hex(core_hmac_md5(key, data));
-}
-
-function b64_hmac_md5(key, data) {
-    return binl2b64(core_hmac_md5(key, data));
-}
-
-function calcMD5(s) {
-    return binl2hex(core_md5(str2binl(s), s.length * chrsz));
-}
-
-function md5_vm_test() {
-    return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72";
-}
-
-function core_md5(x, len) {
-
-    x[len >> 5] |= 0x80 << ((len) % 32);
-    x[(((len + 64) >>> 9) << 4) + 14] = len;
-    var a = 1732584193;
-    var b = -271733879;
-    var c = -1732584194;
-    var d = 271733878;
-    for (let i = 0; i < x.length; i += 16) {
-        let olda = a;
-        let oldb = b;
-        let oldc = c;
-        let oldd = d;
-
-        a = md5_ff(a, b, c, d, x[i + 0], 7, -680876936);
-        d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586);
-        c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819);
-        b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330);
-        a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897);
-        d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426);
-        c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341);
-        b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983);
-        a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416);
-        d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417);
-        c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);
-        b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);
-        a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682);
-        d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);
-        c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);
-        b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329);
-        a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510);
-        d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632);
-        c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713);
-        b = md5_gg(b, c, d, a, x[i + 0], 20, -373897302);
-        a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691);
-        d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083);
-        c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);
-        b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848);
-        a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438);
-        d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690);
-        c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961);
-        b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501);
-        a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467);
-        d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784);
-        c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473);
-        b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);
-        a = md5_hh(a, b, c, d, x[i + 5], 4, -378558);
-        d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463);
-        c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562);
-        b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);
-        a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060);
-        d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353);
-        c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632);
-        b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);
-        a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174);
-        d = md5_hh(d, a, b, c, x[i + 0], 11, -358537222);
-        c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979);
-        b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189);
-        a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487);
-        d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);
-        c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520);
-        b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651);
-        a = md5_ii(a, b, c, d, x[i + 0], 6, -198630844);
-        d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415);
-        c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);
-        b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055);
-        a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571);
-        d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606);
-        c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);
-        b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799);
-        a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359);
-        d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);
-        c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380);
-        b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649);
-        a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070);
-        d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);
-        c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259);
-        b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551);
-
-        a = safe_add(a, olda);
-        b = safe_add(b, oldb);
-        c = safe_add(c, oldc);
-        d = safe_add(d, oldd);
-    }
-    return Array(a, b, c, d);
-
-}
-
-function md5_cmn(q, a, b, x, s, t) {
-    return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);
-}
-
-function md5_ff(a, b, c, d, x, s, t) {
-    return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
-}
-
-function md5_gg(a, b, c, d, x, s, t) {
-    return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
-}
-
-function md5_hh(a, b, c, d, x, s, t) {
-    return md5_cmn(b ^ c ^ d, a, b, x, s, t);
-}
-
-function md5_ii(a, b, c, d, x, s, t) {
-    return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
-}
-
-function core_hmac_md5(key, data) {
-    var bkey = str2binl(key);
-    if (bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);
-
-    var ipad = Array(16),
-        opad = Array(16);
-    for (let i = 0; i < 16; i++) {
-        ipad[i] = bkey[i] ^ 0x36363636;
-        opad[i] = bkey[i] ^ 0x5C5C5C5C;
-    }
-
-    var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);
-    return core_md5(opad.concat(hash), 512 + 128);
-}
-
-function safe_add(x, y) {
-    var lsw = (x & 0xFFFF) + (y & 0xFFFF);
-    var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
-    return (msw << 16) | (lsw & 0xFFFF);
-}
-
-function bit_rol(num, cnt) {
-    return (num << cnt) | (num >>> (32 - cnt));
-}
-
-function str2binl(str) {
-    var bin = Array();
-    var mask = (1 << chrsz) - 1;
-    for (let i = 0; i < str.length * chrsz; i += chrsz)
-        bin[i >> 5] |= (str.charCodeAt(i / chrsz) & mask) << (i % 32);
-    return bin;
-}
-
-function binl2hex(binarray) {
-    var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
-    var str = "";
-    for (let i = 0; i < binarray.length * 4; i++) {
-        str += hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8 + 4)) & 0xF) +
-            hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8)) & 0xF);
-    }
-    return str;
-}
-
-function binl2b64(binarray) {
-    var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-    var str = "";
-    for (let i = 0; i < binarray.length * 4; i += 3) {
-        let triplet = (((binarray[i >> 2] >> 8 * (i % 4)) & 0xFF) << 16) | (((binarray[i + 1 >> 2] >> 8 * ((i + 1) % 4)) & 0xFF) << 8) | ((binarray[i + 2 >> 2] >> 8 * ((i + 2) % 4)) & 0xFF);
-        for (let j = 0; j < 4; j++) {
-            if (i * 8 + j * 6 > binarray.length * 32) str += b64pad;
-            else str += tab.charAt((triplet >> 6 * (3 - j)) & 0x3F);
-        }
-    }
-    return str;
-}

+ 180 - 143
config/request.js

@@ -1,145 +1,182 @@
-import * as db from './db.js'
-import { baseUrl } from './config.js';
-import { User } from '@/config/api.js'
-import { modal } from '@/config/util.js'
-const showError = error => {
-	let errorMsg = ''
-	switch (error.status) {
-		case 400:
-			errorMsg = '请求参数错误'
-			break
-		case 401:
-			errorMsg = '未授权,请登录'
-			break
-		case 403:
-			errorMsg = '跨域拒绝访问'
-			break
-		case 404:
-			errorMsg = `请求地址出错: ${error.config.url}`
-			break
-		case 408:
-			errorMsg = '请求超时'
-			break
-		case 500:
-			errorMsg = '服务器内部错误'
-			break
-		case 501:
-			errorMsg = '服务未实现'
-			break
-		case 502:
-			errorMsg = '网关错误'
-			break
-		case 503:
-			errorMsg = '服务不可用'
-			break
-		case 504:
-			errorMsg = '网关超时'
-			break
-		case 505:
-			errorMsg = 'HTTP版本不受支持'
-			break
-		default:
-			errorMsg = error.msg
-			break
-	}
-	uni.showToast({
-		title: errorMsg,
-		icon: 'none',
-		duration: 1000,
-		complete: function() {
-			setTimeout(()=> {
-				uni.hideToast();
-			}, 1000);
-		}
-	});
-}	
+import * as db from "./db.js";
+import { baseUrl } from "./config.js";
+import { User } from "@/config/api.js";
+import { modal } from "@/config/util.js";
+const showError = (error) => {
+  let errorMsg = "";
+  switch (error.status) {
+    case 400:
+      errorMsg = "请求参数错误";
+      break;
+    case 401:
+      errorMsg = "未授权,请登录";
+      break;
+    case 403:
+      errorMsg = "跨域拒绝访问";
+      break;
+    case 404:
+      errorMsg = `请求地址出错: ${error.config.url}`;
+      break;
+    case 408:
+      errorMsg = "请求超时";
+      break;
+    case 500:
+      errorMsg = "服务器内部错误";
+      break;
+    case 501:
+      errorMsg = "服务未实现";
+      break;
+    case 502:
+      errorMsg = "网关错误";
+      break;
+    case 503:
+      errorMsg = "服务不可用";
+      break;
+    case 504:
+      errorMsg = "网关超时";
+      break;
+    case 505:
+      errorMsg = "HTTP版本不受支持";
+      break;
+    default:
+      errorMsg = error.msg;
+      break;
+  }
+  uni.showToast({
+    title: errorMsg,
+    icon: "none",
+    duration: 1000,
+    complete: function () {
+      setTimeout(() => {
+        uni.hideToast();
+      }, 1000);
+    },
+  });
+};
 // get请求
-export const getHttp = (url,data,status=1)=> {
-	// 获取用户token和用户信息
-	let token = db.get("access_token");
-	let authHeader = token || '';
-	if(status) {
-		uni.showLoading({
-			title: '加载中'
-		});		
-	}
-	return new Promise((resolve, reject) => {
-		uni.request({
-			url: baseUrl + url,
-			data: data,
-			header: {
-				// 'Accept': 'application/json',
-				// 'Content-Type': 'application/x-www-form-urlencoded', //自定义请求头信息
-				'Authorization':authHeader
-			},
-			method: 'GET',
-			success: (res) => {
-				status && uni.hideLoading();
-				res.data.Ret === 403 && uni.showModal({
-					title: '',
-					confirmColor:'#3385FF',
-					content: res.data.Msg,
-					showCancel: false
-				});
-				resolve(res.data)
-			},
-			fail: (error) => {
-				console.log(error)
-				status && uni.hideLoading();
-				if (error && error.response) {
-					showError(error.response);
-				}
-			},
-			complete: () => {
-				setTimeout(()=> {
-					status && uni.hideLoading();
-				}, 250);
-			}
-		});
-	})
-}
+export const getHttp = (url, data, status = 1) => {
+  // 获取用户token和用户信息
+  let token = db.get("access_token");
+  let authHeader = token || "";
+  if (status) {
+    uni.showLoading({
+      title: "加载中",
+    });
+  }
+  return new Promise((resolve, reject) => {
+    uni.request({
+      url: baseUrl + url,
+      data: data,
+      header: {
+        // 'Accept': 'application/json',
+        // 'Content-Type': 'application/x-www-form-urlencoded', //自定义请求头信息
+        Authorization: authHeader,
+      },
+      method: "GET",
+      success: (res) => {
+        status && uni.hideLoading();
+        // 408 token失效
+        if (res.data.Ret === 408) {
+          refreshToken(getHttp, url, data, resolve);
+          return;
+        }
+        res.data.Ret === 403 &&
+          uni.showModal({
+            title: "",
+            confirmColor: "#3385FF",
+            content: res.data.Msg,
+            showCancel: false,
+          });
+        resolve(res.data);
+      },
+      fail: (error) => {
+        status && uni.hideLoading();
+        if (error && error.response) {
+          showError(error.response);
+        }
+      },
+      complete: () => {
+        setTimeout(() => {
+          status && uni.hideLoading();
+        }, 250);
+      },
+    });
+  });
+};
 // post请求
-export const postHttp = (url,data,status=1)=> {
-	// 获取用户token和用户信息
-	let token = db.get("access_token");
-	let authHeader =  token || '';
-	
-	if(status) {
-		uni.showLoading({
-			title: '加载中'
-		});
-	}
-	return new Promise((resolve, reject) => {
-		uni.request({
-			url: baseUrl + url,
-			data: data,
-			header: {
-				// 'Accept': 'application/json',
-				'Content-Type': 'application/json',
-				'Authorization':authHeader
-			},
-			method: 'POST',
-			success: (res) => {
-				status && uni.hideLoading();
-				res.data.Ret === 403 && uni.showModal({
-					title: '',
-					confirmColor:'#3385FF',
-					content: res.data.Msg,
-					showCancel: false
-				});
-				resolve(res.data)
-			},
-			fail: (error) => {
-				status && uni.hideLoading();
-				if (error && error.response) {
-					showError(error.response);
-				}
-			},
-			complete: () => {
-				setTimeout(()=> {
-					status && uni.hideLoading();
-				}, 250);
-			}
-		});
-	})
-}
+export const postHttp = (url, data, status = 1) => {
+  // 获取用户token和用户信息
+  let token = db.get("access_token");
+  let authHeader = token || "";
+
+  if (status) {
+    uni.showLoading({
+      title: "加载中",
+    });
+  }
+  return new Promise((resolve, reject) => {
+    uni.request({
+      url: baseUrl + url,
+      data: data,
+      header: {
+        // 'Accept': 'application/json',
+        "Content-Type": "application/json",
+        Authorization: authHeader,
+      },
+      method: "POST",
+      success: (res) => {
+        status && uni.hideLoading();
+        // 408 token失效
+        if (res.data.Ret === 408) {
+          refreshToken(postHttp, url, data, resolve);
+          return;
+        }
+        res.data.Ret === 403 &&
+          uni.showModal({
+            title: "",
+            confirmColor: "#3385FF",
+            content: res.data.Msg,
+            showCancel: false,
+          });
+        resolve(res.data);
+      },
+      fail: (error) => {
+        status && uni.hideLoading();
+        if (error && error.response) {
+          showError(error.response);
+        }
+      },
+      complete: () => {
+        setTimeout(() => {
+          status && uni.hideLoading();
+        }, 250);
+      },
+    });
+  });
+};
+
+let requestList = []; //存放token失效时请求队列
+let isRefreshing = false; //是否正在刷新token
+const refreshToken = async (type, url, data, resolve) => {
+  requestList.push(() => {
+    resolve(type(url, data));
+  });
+  if (!isRefreshing) {
+    isRefreshing = true;
+    uni.login({
+      success: async (result) => {
+        const res = await User.wechatLog({ Code: result.code });
+        if (res.Ret === 200) {
+          let token = res.Data.Authorization;
+          db.set("access_token", token);
+          // 重新请求队列
+          requestList.map((MT) => {
+            MT();
+          });
+          requestList = [];
+          isRefreshing = false;
+        }
+      },
+    });
+  }
+};

+ 0 - 2
main.js

@@ -3,7 +3,6 @@ import App from './App'
 import store from './store'
 import * as Db from './config/db.js';//缓存操作
 import * as Util from './config/util.js';//通用方法
-import { hex_md5 } from './config/md5.js';//加密
 import uView from "uview-ui";
 
 Vue.use(uView);
@@ -12,7 +11,6 @@ Vue.config.productionTip = false
 Vue.prototype.$store = store;
 Vue.prototype.$db = Db;
 Vue.prototype.$util = Util;
-Vue.prototype.$md5 = hex_md5;
 Vue.prototype.$global = App.globalData;
 App.mpType = 'app'
 

+ 2 - 3
pageMy/authGuide/authGuide.vue

@@ -73,13 +73,12 @@ export default {
         Signature: data.signature,
       }).then((res) => {
         if (res.Ret === 200) {
-          //console.log(app.globalData)
           /* 判断是否绑定过 未绑定去绑定 绑定过返回上一页面 */
-          app.globalData.isBind &&
+          this.$store.state.isBind &&
             uni.redirectTo({
               url: "/pageMy/login/login",
             });
-          !app.globalData.isBind &&
+          !this.$store.state.isBind &&
             uni.navigateBack({
               delta: 1,
             });

+ 1 - 0
pageMy/login/login.vue

@@ -115,6 +115,7 @@ export default {
           this.phoneIpt &&
             User.getPhoneCode({
               Mobile: this.phoneIpt,
+              AreaNum:this.countryCode
             }).then((res) => {
               if (res.Ret === 200) {
                 this.$refs.uCode.start();

+ 43 - 35
pageMy/reportDetail/reportDetail.vue

@@ -28,7 +28,7 @@
 
 <script>
 import { Report, User, Reports } from "@/config/api.js";
-let app = getApp({allowDefault: true});
+let app = getApp({ allowDefault: true });
 export default {
   data() {
     return {
@@ -159,33 +159,34 @@ export default {
         this.$util.toast(res.Msg);
       });
     },
+    /* 错误 */
+    errorDetails() {
+      uni.showModal({
+        confirmText: "知道了",
+        showCancel: false,
+        confirmColor: "#3385FF",
+        content: "网络不好,请刷新重试",
+        success: (res) => {
+          uni.navigateBack({
+            fail() {
+              uni.switchTab({
+                url: "/pages/index/index",
+              });
+            },
+          });
+        },
+      });
+    },
   },
-  onShow() {
+  async onShow() {
     this.readTiem = 0;
     this.setIntervalTiem = setInterval(() => {
       this.readTiem++;
     }, 1000);
     let page = getCurrentPages(); //查看路径
     if (page.length === 1) {
-      //分享入口
-      this.$store.dispatch("checkHandle").then((res) => {
-        app.globalData.isAuth = res.IsAuth;
-        app.globalData.isBind = res.IsBind;
-        if (!res.IsAuth && !res.IsBind) {
-          //已授权已绑定
-          this.getDetail();
-        } else if (res.IsAuth) {
-          //未授权
-          uni.navigateTo({
-            url: "/pageMy/authGuide/authGuide",
-          });
-        } else if (res.IsBind && !res.IsAuth) {
-          //已授权未绑定
-          uni.navigateTo({
-            url: "/pageMy/login/login",
-          });
-        }
-      });
+      await this.$store.dispatch("checkHandle");
+      if (!this.$store.state.isAuth && !this.$store.state.isBind) this.getDetail();
     } else {
       // 跳转入口
       this.getDetail();
@@ -202,7 +203,10 @@ export default {
     // 	   }
     // 	}
     // })
-    this.id = option.id || "";
+    this.id = option.id ? option.id : "";
+    if (!this.id && !+this.id > 0) {
+      this.errorDetails()
+    }
   },
   /**
    * 用户点击分享
@@ -219,21 +223,25 @@ export default {
   },
   onHide() {
     //页面退出
-    clearInterval(this.setIntervalTiem);
-    Reports.addStopTime({
-      ArticleId: Number(this.id),
-      StopTime: this.readTiem,
-      OutType: 2,
-    }).then((res) => {});
+    if (this.id && +this.id > 0) {
+      clearInterval(this.setIntervalTiem);
+      Reports.addStopTime({
+        ArticleId: Number(this.id),
+        StopTime: this.readTiem,
+        OutType: 2,
+      }).then((res) => {});
+    }
   },
   onUnload() {
-    //页面返回
-    clearInterval(this.setIntervalTiem);
-    Reports.addStopTime({
-      ArticleId: Number(this.id),
-      StopTime: this.readTiem,
-      OutType: 1,
-    }).then((res) => {});
+    if (this.id && +this.id > 0) {
+      //页面返回
+      clearInterval(this.setIntervalTiem);
+      Reports.addStopTime({
+        ArticleId: Number(this.id),
+        StopTime: this.readTiem,
+        OutType: 1,
+      }).then((res) => {});
+    }
   },
 };
 </script>

+ 39 - 35
pages/activity/activity.vue

@@ -13,7 +13,7 @@
     </view>
     <!-- 筛选状态 -->
     <view class="screen-item" v-if="tabsActive == 0">
-      <text :class="isShowJurisdiction ? 'active' : ''" @click="permissioActivity">有权限活动</text>
+      <text :class="isShowJurisdiction ? 'active' : ''" @click="permissioActivity">有权限行业</text>
       <!-- 各种状态选择 -->
       <view class="select-conyent">
         <van-dropdown-menu active-color="#333333">
@@ -154,9 +154,8 @@
 <script>
 import { activity } from "@/config/api.js";
 import { Throttle } from "@/config/util.js";
-import myActivityMixin from "@/activityPages/indexActivity.js";
+import myActivityMixin from "@/activityPages/components/indexActivity.js";
 import modalDialog from "@/components/modalDialog.vue";
-
 let app = getApp();
 export default {
   mixins: [myActivityMixin],
@@ -208,7 +207,8 @@ export default {
         this.isShowJurisdiction = res.Data.IsShowJurisdiction;
         this.listChartPermission = res.Data.ListChartPermission;
         this.listChartPermissionInit = res.Data.ListChartPermission2;
-        if (this.chartPermissionIds) {
+        this.clickPermission()
+         if (this.chartPermissionIds) {
           this.closeTheWindow();
         }
       }
@@ -256,6 +256,7 @@ export default {
         this.collectTypeList = [];
         this.collectList=[]
         this.tabsActive==0 ? this.getActivityLabelTypeList() : this.getActivityList()
+        this.selectComponent("#industry").toggle(false);
       }
     },
     // 下拉的选择的关闭事件
@@ -271,7 +272,7 @@ export default {
             item.IsChoose = false;
           }
         });
-        this.chartPermissionName = str.join(",") || "所有行业";
+        this.chartPermissionName = str.length==6?"所有行业" : str.join(",") 
       }
     },
     // 下拉的选择的选中事件
@@ -309,10 +310,11 @@ export default {
       }
       this.chartPermissionIds = arr.join(",");
       this.getActivityLabelTypeList();
-      this.selectComponent("#industry").toggle();
+      this.selectComponent("#industry").toggle(false);
     },
     //今日明日的点击事件
     isActivityDate(id) {
+      this.selectComponent("#industry").toggle(false);
       this.activityTimeList.forEach((item) => {
         if (item.Id == id) item.IsChoose = !item.IsChoose;
       });
@@ -322,12 +324,31 @@ export default {
       this.getActivityLabelTypeList()
     },
     //是否有权限的点击事件
-    permissioActivity() {
+  async  permissioActivity() {
+      this.selectComponent("#industry").toggle(false);
       this.isShowJurisdiction = !this.isShowJurisdiction;
-      if (!this.isShowJurisdiction) this.chartPermissionName = "所有行业";
       this.isGetJurisdiction = this.isShowJurisdiction ? 1 : 2;
-      this.getUserSearchContent();
-      this.getActivityLabelTypeList()
+      await  this.getUserSearchContent();
+      this.selectComponent("#industry").toggle(false);
+      if(this.isShowJurisdiction){
+        this.getActivityLabelTypeList()
+      }else{
+        this.replacementBtn()
+      }
+      
+      
+    },
+     //点击后有权限的
+    clickPermission(){
+              if(this.isShowJurisdiction){     
+        const arr = [];
+         this.listChartPermission.forEach((key) => {
+          if (key.IsChoose) {
+          arr.push(key.ChartPermissionId);
+        }
+        });
+        this.chartPermissionIds = arr.join(",");
+        }
     },
     loadShare(option) {
       if (option && Object.keys(option).length !== 0) {
@@ -345,30 +366,11 @@ export default {
       }
     },
     goDetails(item) {
-      this.$store.dispatch("checkHandle").then((res) => {
-        app.globalData.isAuth = res.IsAuth;
-        app.globalData.isBind = res.IsBind;
-        if (!res.IsAuth && !res.IsBind) {
-          //已授权已绑定
-          uni.navigateTo({ url: "/activityPages/themeActivity/themeActivity?title=" + item.KeyWord });
-        } else if (res.IsAuth) {
-          //未授权
-          uni.navigateTo({
-            url: "/pageMy/authGuide/authGuide",
-          });
-        } else if (res.IsBind && !res.IsAuth) {
-          //已授权未绑定
-          uni.navigateTo({
-            url: "/pageMy/login/login",
-          });
-        }
-      });
+       this.$store.dispatch("checkHandle", "/activityPages/themeActivity/themeActivity?title=" + item.KeyWord)
     },
     //去往搜索事件
     goSearch() {
-      uni.navigateTo({
-        url: "/activityPages/activitySearch/activitySearch",
-      });
+       this.$store.dispatch("checkHandle", "/activityPages/activitySearch/activitySearch")
     },
   },
   //load
@@ -393,16 +395,18 @@ export default {
   }),
   /* 下拉刷新 */
   onPullDownRefresh: Throttle(function () {
-    this.page_no = 1;
+      this.page_no = 1;
     this.refresh = true;
-    this.getActivityList();
+    this.tabsActive == 0 ? this.getActivityLabelTypeList() : this.getActivityList();
   }),
   // 页面滚动事件
   onPageScroll() {},
+
 };
 </script>
 
 <style scoped lang="scss">
+image{will-change: transform}
 .activity-content {
   background-color: #f7f7f7;
   padding-bottom: 90rpx;
@@ -612,7 +616,7 @@ export default {
 /deep/.van-dropdown-menu {
   background-color: #fff;
   box-shadow: none !important;
-  padding-top: 26rpx;
+  align-items: center !important;
 }
 /deep/.van-dropdown-menu__item {
   box-sizing: border-box;
@@ -631,6 +635,6 @@ export default {
 /deep/ .van-ellipsis {
   font-size: 24rpx;
 }
-@import "../../activityPages/indexActivity.scss";
+@import "@/activityPages/components/indexActivity.scss";
 
 </style>

+ 5 - 63
pages/index/index.vue

@@ -131,14 +131,12 @@ export default {
       immediate: true,
     },
   },
-  onLoad(optios) {
-    this.$store.dispatch("checkHandle", { type: "load", val: optios }).then((res) => {
+  onLoad(optios) { 
       if (optios.tabid) {
         this.tabAct_id = optios.tabid;
       }
       this.getTabs();
       this.reportIsShow();
-    });
   },
   onShow() {
     this.$store.dispatch("statistics", { PageType: "Summary", ChartPermissionId: Number(this.tabAct_id) });
@@ -230,74 +228,18 @@ export default {
     /* 进入详情 校验是否有该品种权限 */
     goDetail(item) {
       /* 无需授权且已绑定 检验是或否有权限 */
-      this.$store.dispatch("checkHandle").then((res) => {
-        app.globalData.isAuth = res.IsAuth;
-        app.globalData.isBind = res.IsBind;
-        if (!res.IsAuth && !res.IsBind) {
-          // 已授权已绑定
-          uni.navigateTo({
-            url: "/pageMy/reportDetail/reportDetail?id=" + item.ArticleId,
-          });
-        } else if (res.IsAuth) {
-          //未授权
-          uni.navigateTo({
-            url: "/pageMy/authGuide/authGuide",
-          });
-        } else if (res.IsBind && !res.IsAuth) {
-          //已授权未绑定
-          uni.navigateTo({
-            url: "/pageMy/login/login",
-          });
-        }
-      });
+      this.$store.dispatch("checkHandle", "/pageMy/reportDetail/reportDetail?id=" + item.ArticleId)
     },
     /* 搜索 */
     goSearch() {
-      /*  */
-      this.$store.dispatch("checkHandle").then((res) => {
-        app.globalData.isAuth = res.IsAuth;
-        app.globalData.isBind = res.IsBind;
-        if (!res.IsAuth && !res.IsBind) {
-          //已授权已绑定
-          uni.navigateTo({
-            url: "/pageMy/search/search",
-          });
-        } else if (res.IsAuth) {
-          //未授权
-          uni.navigateTo({
-            url: "/pageMy/authGuide/authGuide",
-          });
-        } else if (res.IsBind && !res.IsAuth) {
-          //已授权未绑定
-          uni.navigateTo({
-            url: "/pageMy/login/login",
-          });
-        }
-      });
+      this.$store.dispatch("checkHandle",'/pageMy/search/search')
     },
     adviceHandle() {
-      this.$store.dispatch("checkHandle").then((res) => {
-        app.globalData.isAuth = res.IsAuth;
-        app.globalData.isBind = res.IsBind;
-        if (!res.IsAuth && !res.IsBind) {
-          //已授权已绑定
-          uni.navigateTo({ url: "/pageMy/advice/advice" });
-        } else if (res.IsAuth) {
-          //未授权
-          uni.navigateTo({
-            url: "/pageMy/authGuide/authGuide",
-          });
-        } else if (res.IsBind && !res.IsAuth) {
-          //已授权未绑定
-          uni.navigateTo({
-            url: "/pageMy/login/login",
-          });
-        }
-      });
+      this.$store.dispatch("checkHandle",'/pageMy/advice/advice')
     },
   },
   onShow(){
-    this.$store.dispatch("statistics",{PageType:'Activit'})
+     this.$store.dispatch("statistics",{PageType:'Activit'})
   },
   /* 下拉刷新 */
   onPullDownRefresh: Throttle(function () {

+ 13 - 16
pages/my/my.vue

@@ -76,20 +76,17 @@ export default {
       authList: [],
     };
   },
-  onShow() {
-    this.$store.dispatch("checkHandle").then((res) => {
-      this.haveData = true;
-      app.globalData.isAuth = res.IsAuth;
-      app.globalData.isBind = res.IsBind;
-      if (!res.IsAuth && !res.IsBind) {
-        //已授权已绑定
-        this.isLogin = true;
-        this.getUser();
-      } else {
-        this.login_txt = res.IsAuth ? "点击登录" : "绑定联系方式";
-        this.isLogin = false;
-      }
-    });
+  async onShow() {
+    await this.$store.dispatch("checkHandle", "noGO");
+    this.haveData = true;
+    if (!this.$store.state.isAuth && !this.$store.state.isBind) {
+      //已授权已绑定
+      this.isLogin = true;
+      this.getUser();
+    } else {
+      this.login_txt = this.$store.state.isAuth ? "点击登录" : "绑定联系方式";
+      this.isLogin = false;
+    }
   },
   methods: {
     /* 检查状态 */
@@ -106,12 +103,12 @@ export default {
     /* 点击登录 检验是否绑定或是否授权*/
     loginHandle() {
       /* 先授权再绑定 */
-      if (app.globalData.isAuth) {
+      if (this.$store.state.isAuth) {
         uni.navigateTo({
           url: "/pageMy/authGuide/authGuide",
         });
       } else {
-        app.globalData.isBind &&
+        this.$store.state.isBind &&
           uni.navigateTo({
             url: "/pageMy/login/login",
           });

+ 2 - 23
pages/reportForm/components/strategy.vue

@@ -24,7 +24,7 @@
 <script>
 import { Reports } from "@/config/api.js";
 import { Throttle } from "@/config/util.js";
-let app = getApp({allowDefault: true});
+let app = getApp({ allowDefault: true });
 export default {
   props: {
     strategyIndexTwo: {
@@ -136,28 +136,7 @@ export default {
         this.$emit("hideIsred", this.isShow);
       }
       this.collectList[index].IsRed = false;
-
-      // 	console.log(this.collectList[index])
-      this.$store.dispatch("checkHandle").then((res) => {
-        app.globalData.isAuth = res.IsAuth;
-        app.globalData.isBind = res.IsBind;
-        if (!res.IsAuth && !res.IsBind) {
-          // 已授权已绑定
-          uni.navigateTo({
-            url: "/pageMy/reportDetail/reportDetail?id=" + item.ArticleId,
-          });
-        } else if (res.IsAuth) {
-          //未授权
-          uni.navigateTo({
-            url: "/pageMy/authGuide/authGuide",
-          });
-        } else if (res.IsBind && !res.IsAuth) {
-          //已授权未绑定
-          uni.navigateTo({
-            url: "/pageMy/login/login",
-          });
-        }
-      });
+      this.$store.dispatch("checkHandle", "/pageMy/reportDetail/reportDetail?id=" + item.ArticleId);
     },
   },
 

+ 17 - 76
pages/reportForm/reportForm.vue

@@ -400,26 +400,12 @@ export default {
       });
     },
     //跳转季度策略
-    isClickHandle(id) {
-      this.public(
-        {
-          type: "show",
-        },
-        true,
-        "/reportPages/industrialReport/industrialReport?id=",
-        id
-      );
+    async isClickHandle(id) {
+      await this.$store.dispatch("checkHandle", "/reportPages/industrialReport/industrialReport?id=" + id);
     },
     //跳转产业报告
-    goIndustryReport(id) {
-      this.public(
-        {
-          type: "show",
-        },
-        true,
-        "/reportPages/IndustryReport/IndustryReport?id=",
-        id
-      );
+    async goIndustryReport(id) {
+      await this.$store.dispatch("checkHandle", "/reportPages/IndustryReport/IndustryReport?id=" + id);
     },
     //点击关注的图标
     reportFllow(id) {
@@ -500,43 +486,8 @@ export default {
       this.isScrollShow = true;
     }),
     /* 搜索 */
-    goSearch() {
-      this.public(
-        {
-          type: "show",
-        },
-        true,
-        "/reportPages/reportSearch/reportSearch"
-      );
-    },
-    /* 跳转 */
-    public(type, flag, purl, price = "") {
-      return new Promise((resolve, reject) => {
-        this.$store.dispatch("checkHandle", type).then((res) => {
-          app.globalData.isAuth = res.IsAuth;
-          app.globalData.isBind = res.IsBind;
-          if (!res.IsAuth && !res.IsBind) {
-            //已授权已绑定
-            if (flag) {
-              uni.navigateTo({
-                url: purl + price,
-              });
-            }
-          } else if (res.IsAuth) {
-            //未授权
-            uni.navigateTo({
-              url: "/pageMy/authGuide/authGuide",
-            });
-            return;
-          } else if (res.IsBind && !res.IsAuth) {
-            //已授权未绑定
-            uni.navigateTo({
-              url: "/pageMy/login/login",
-            });
-            return;
-          }
-        });
-      });
+    async goSearch() {
+      await this.$store.dispatch("checkHandle", "/reportPages/reportSearch/reportSearch");
     },
     /* 初始 */
     initList() {
@@ -564,27 +515,17 @@ export default {
         //新手指引
         this.isGuideShow = true;
       }
-
-      this.$store
-        .dispatch("checkHandle", {
-          type: "load",
-          val: option,
-        })
-        .then((res) => {
-          app.globalData.isAuth = res.IsAuth;
-          app.globalData.isBind = res.IsBind;
-          app.globalData.isSx = true;
-          this.tabAct_id = option.tab || "";
-          if (option.tabs !== "" && option.tabs) {
-            this.strategyIndex = 4;
-            this.tabAct_idTwo = option.tabs;
-          }
-          if (this.tabAct_id == 31) {
-            this.strategyIndex = 5;
-          }
-          this.getClassify();
-          this.reportIsShow();
-        });
+      app.globalData.isSx = true;
+      this.tabAct_id = option.tab || "";
+      if (option.tabs !== "" && option.tabs) {
+        this.strategyIndex = 4;
+        this.tabAct_idTwo = option.tabs;
+      }
+      if (this.tabAct_id == 31) {
+        this.strategyIndex = 5;
+      }
+      this.getClassify();
+      this.reportIsShow();
       this.$db.set("guideSole", 1); //新手指引
     },
     goSecretDetail(type) {

+ 13 - 28
reportPages/IndustryReport/IndustryReport.vue

@@ -45,7 +45,7 @@
 import { Mine } from "@/config/api.js"; //模拟
 import { Reports } from "@/config/api.js"; //模拟
 import { Throttle } from "@/config/util.js";
-let app = getApp({allowDefault: true});
+let app = getApp({ allowDefault: true });
 export default {
   data() {
     return {
@@ -74,10 +74,8 @@ export default {
   },
   onLoad(option) {
     this.industrialManagementId = option.id;
-    this.$store.dispatch("checkHandle", { type: "load", val: option }).then((res) => {
-      this.tabAct_id = option.tab;
-      this.toArticleCategoryList();
-    });
+    this.tabAct_id = option.tab;
+    this.toArticleCategoryList();
   },
   onShow() {
     this.$store.dispatch("statistics", { PageType: "IndustryList", IndustrialManagementId: this.industrialManagementId });
@@ -150,39 +148,26 @@ export default {
         }
       });
     },
-    goDetail(item, index) {
+    async goDetail(item, index) {
       /* 无需授权且已绑定 检验是或否有权限 */
       if (index == 0) {
         this.tabBars[this.toggleTabIndex].IsRed = false;
       }
       this.collectList[index].IsRed = false;
-      this.$store.dispatch("checkHandle").then((res) => {
-        app.globalData.isAuth = res.IsAuth;
-        app.globalData.isBind = res.IsBind;
-        if (!res.IsAuth && !res.IsBind) {
-          // 已授权已绑定
-          if (item.IsHaveVideo) {
-            //跳转路演精华
-            uni.navigateTo({
-              url: "/reportPages/roadEssence/roadEssence?id=" + item.ArticleId,
-            });
-          } else {
-            uni.navigateTo({
-              url: "/pageMy/reportDetail/reportDetail?id=" + item.ArticleId,
-            });
-          }
-        } else if (res.IsAuth) {
-          //未授权
+      await this.$store.dispatch("checkHandle");
+      if (!this.$store.state.isAuth && !this.$store.state.isBind) {
+        // 已授权已绑定
+        if (item.IsHaveVideo) {
+          //跳转路演精华
           uni.navigateTo({
-            url: "/pageMy/authGuide/authGuide",
+            url: "/reportPages/roadEssence/roadEssence?id=" + item.ArticleId,
           });
-        } else if (res.IsBind && !res.IsAuth) {
-          //已授权未绑定
+        } else {
           uni.navigateTo({
-            url: "/pageMy/login/login",
+            url: "/pageMy/reportDetail/reportDetail?id=" + item.ArticleId,
           });
         }
-      });
+      }
     },
   },
   /* 触底 */

+ 1 - 27
reportPages/industrialReport/industrialReport.vue

@@ -57,19 +57,12 @@ export default {
     };
   },
   onLoad(option) {
-    this.$store
-      .dispatch("checkHandle", {
-        type: "load",
-        val: option,
-      })
-      .then((res) => {
         this.categoryId = Number(option.id) || "";
         this.idGenre = Number(option.idGenre) || "";
         this.articleId = Number(option.idArticle) || "";
         this.typeIsPost = option.type || "";
         this.genreIs = option.isGenre || "";
         this.getCollectList();
-      });
   },
   onShow() {},
   methods: {
@@ -131,26 +124,7 @@ export default {
     goDetail(item, index) {
       /* 无需授权且已绑定 检验是或否有权限 */
       this.collectList[index].IsRed = false;
-      this.$store.dispatch("checkHandle").then((res) => {
-        app.globalData.isAuth = res.IsAuth;
-        app.globalData.isBind = res.IsBind;
-        if (!res.IsAuth && !res.IsBind) {
-          // 已授权已绑定
-          uni.navigateTo({
-            url: "/pageMy/reportDetail/reportDetail?id=" + item.ArticleId,
-          });
-        } else if (res.IsAuth) {
-          //未授权
-          uni.navigateTo({
-            url: "/pageMy/authGuide/authGuide",
-          });
-        } else if (res.IsBind && !res.IsAuth) {
-          //已授权未绑定
-          uni.navigateTo({
-            url: "/pageMy/login/login",
-          });
-        }
-      });
+      this.$store.dispatch("checkHandle","/pageMy/reportDetail/reportDetail?id=" + item.ArticleId)
     },
   },
   /* 触底 */

+ 1 - 22
reportPages/reportSearch/reportSearch.vue

@@ -228,30 +228,10 @@ export default {
       });
     },
     goDetailIndust(id) {
-      this.$store.dispatch("checkHandle").then((res) => {
-        app.globalData.isAuth = res.IsAuth;
-        app.globalData.isBind = res.IsBind;
-        if (!res.IsAuth && !res.IsBind) {
-          // 已授权已绑定
-          uni.navigateTo({
-            url: "/pageMy/reportDetail/reportDetail?id=" + id,
-          });
-        } else if (res.IsAuth) {
-          //未授权
-          uni.navigateTo({
-            url: "/pageMy/authGuide/authGuide",
-          });
-        } else if (res.IsBind && !res.IsAuth) {
-          //已授权未绑定
-          uni.navigateTo({
-            url: "/pageMy/login/login",
-          });
-        }
-      });
+      this.$store.dispatch("checkHandle","/pageMy/reportDetail/reportDetail?id=" + id)
     },
   },
   onLoad(options) {
-    this.$store.dispatch("checkHandle", { type: "load", val: options }).then((res) => {
       if (options.text) {
         this.searchTxt = options.text;
         this.getDataList();
@@ -261,7 +241,6 @@ export default {
         let historyList = JSON.parse(this.$db.get("historySearchListReport"));
         this.historySearchList = historyList;
       }
-    });
   },
   onShow() {
     this.$store.dispatch("statistics", { PageType: "ReportSearch" });

+ 4 - 20
reportPages/reportSecretDetail/reportSecretDetail.vue

@@ -68,7 +68,7 @@ import statement from "@/reportPages/components/statement.vue";
 import researchSummary from "./components/researchSummary.vue";
 import reportChoiceness from "./components/reportChoiceness.vue";
 import { Reports } from "@/config/api.js";
-let app = getApp({allowDefault: true});
+let app = getApp({ allowDefault: true });
 export default {
   data() {
     return {
@@ -172,25 +172,9 @@ export default {
       this.isPlay = false;
     });
   },
-  onShow() {
-    this.$store.dispatch("checkHandle").then((res) => {
-      app.globalData.isAuth = res.IsAuth;
-      app.globalData.isBind = res.IsBind;
-      if (!res.IsAuth && !res.IsBind) {
-        //已授权已绑定
-        this.getDetilaiList();
-      } else if (res.IsAuth) {
-        //未授权
-        uni.navigateTo({
-          url: "/pageMy/authGuide/authGuide",
-        });
-      } else if (res.IsBind && !res.IsAuth) {
-        //已授权未绑定
-        uni.navigateTo({
-          url: "/pageMy/login/login",
-        });
-      }
-    });
+  async onShow() {
+    await this.$store.dispatch("checkHandle");
+    if (!this.$store.state.isAuth && !this.$store.state.isBind) this.getDetilaiList();
   },
   onUnload() {},
   /**

+ 12 - 31
reportPages/roadEssence/roadEssence.vue

@@ -51,7 +51,7 @@
 <script>
 import { Reports, User } from "@/config/api.js";
 import statement from "@/reportPages/components/statement.vue";
-let app = getApp({allowDefault: true});
+let app = getApp({ allowDefault: true });
 export default {
   data() {
     return {
@@ -139,36 +139,17 @@ export default {
       this.isPlay = false;
     });
   },
-  onShow() {
-    this.$store.dispatch("checkHandle").then((res) => {
-      app.globalData.isAuth = res.IsAuth;
-      app.globalData.isBind = res.IsBind;
-      if (!res.IsAuth && !res.IsBind) {
-        //已授权已绑定
-
-        this.getDetail();
-        this.audioContext = uni.createInnerAudioContext();
-        //音频播放错误事件
-        this.audioContext.onError((res) => {
-          console.log(res.errMsg);
-          console.log(res.errCode);
-        });
-        //音频自然播放结束事件
-        this.audioContext.onEnded((res) => {
-          this.isPlay = true;
-        });
-      } else if (res.IsAuth) {
-        //未授权
-        uni.navigateTo({
-          url: "/pageMy/authGuide/authGuide",
-        });
-      } else if (res.IsBind && !res.IsAuth) {
-        //已授权未绑定
-        uni.navigateTo({
-          url: "/pageMy/login/login",
-        });
-      }
-    });
+  async onShow() {
+    await this.$store.dispatch("checkHandle");
+    if (!this.$store.state.isAuth && !this.$store.state.isBind) {
+      //已授权已绑定
+      this.getDetail();
+      this.audioContext = uni.createInnerAudioContext();
+      //音频自然播放结束事件
+      this.audioContext.onEnded((res) => {
+        this.isPlay = true;
+      });
+    }
   },
   /**
    * 用户点击分享

+ 1 - 27
reportPages/secretDetails/secretDetails.vue

@@ -70,35 +70,10 @@ export default {
     goDetail(item, index) {
       /* 无需授权且已绑定 检验是或否有权限 */
       this.collectList[index].IsRed = false;
-      this.$store.dispatch("checkHandle").then((res) => {
-        app.globalData.isAuth = res.IsAuth;
-        app.globalData.isBind = res.IsBind;
-        if (!res.IsAuth && !res.IsBind) {
-          // 已授权已绑定
-          uni.navigateTo({
-            url: "/reportPages/reportSecretDetail/reportSecretDetail?type=" + this.isType + "&id=" + item.ArticleId,
-          });
-        } else if (res.IsAuth) {
-          //未授权
-          uni.navigateTo({
-            url: "/pageMy/authGuide/authGuide",
-          });
-        } else if (res.IsBind && !res.IsAuth) {
-          //已授权未绑定
-          uni.navigateTo({
-            url: "/pageMy/login/login",
-          });
-        }
-      });
+      this.$store.dispatch("checkHandle","/reportPages/reportSecretDetail/reportSecretDetail?type=" + this.isType + "&id=" + item.ArticleId)
     },
   },
   onLoad(option) {
-    this.$store
-      .dispatch("checkHandle", {
-        type: "load",
-        val: option,
-      })
-      .then((res) => {
         this.isType = option.type;
         this.isType == 1 ? uni.hideShareMenu() : "";
         uni.setNavigationBarTitle({
@@ -106,7 +81,6 @@ export default {
         });
 
         this.getList();
-      });
   },
   /* 触底 */
   onReachBottom: Throttle(function () {

+ 69 - 57
store/index.js

@@ -1,60 +1,72 @@
-import Vue from 'vue'
-import Vuex from 'vuex'
-import { checkToken,User } from '@/config/api.js'
-import { set } from '@/config/db.js';//缓存操作
+import Vue from "vue";
+import Vuex from "vuex";
+import { checkToken, User } from "@/config/api.js";
+import { set } from "@/config/db.js"; //缓存操作
+
+Vue.use(Vuex);
 
-Vue.use(Vuex)
 const store = new Vuex.Store({
-	state: {
-	},
-   mutations: {
-		
-	},
-	actions: {
-		checkHandle(type,payload) {
-			return new Promise((resolve,reject) => {
-				checkToken().then(res => {
-					if(res.Ret === 200) {
-						resolve(res.Data)
-					}else if(res.Ret === 408) {
-						/* 无token或token过期 */
-						uni.login({
-						   success: result=> {
-								User.wechatLog({
-									Code:result.code
-								}).then(res => {
-									let token = res.Data.Authorization;
-									set('access_token',token);
-									let page = getCurrentPages()[0];
-									if(payload.type=='load'){
-										page.onLoad(payload.val);
-									}else {
-										page.onShow();
-									}
-								})
-						  }
-						});
-					}
-				}).catch(err => {
-					reject(err)
-				})
-			})
-		},
-		//获取用户的pv/uv
-		statistics(type,payload){
-			return new Promise ((resolve,reject)=>{
-				User.pageHistory(payload).then(res => {
-					if(res.Ret === 200){
-						resolve(res.Data)
-					}
-				}).catch(err => {
-					reject(err)
-				})
-			})
-		}
-	},
-	getters: {
-	}
-})
+  state: {
+    isAuth: "", // 默认为
+    isBind: "",
+  },
+  mutations: {
+    globalData(state, payload) {
+      state.isAuth = payload.IsAuth;
+      state.isBind = payload.IsBind;
+    },
+  },
+  actions: {
+    checkHandle(context, navigateUrl = "") {
+      return new Promise((resolve, reject) => {
+        checkToken()
+          .then((res) => {
+            if (res.Ret === 200) {
+              context.commit("globalData", res.Data);
+              if (navigateUrl != "noGO") {
+                if (!res.Data.IsAuth && !res.Data.IsBind) {
+                  //已授权已绑定
+                  if (navigateUrl) {
+                    uni.navigateTo({
+                      url: navigateUrl,
+                    });
+                  }
+                } else if (res.Data.IsAuth) {
+                  //未授权
+                  uni.navigateTo({
+                    url: "/pageMy/authGuide/authGuide",
+                  });
+                } else if (res.Data.IsBind && !res.Data.IsAuth) {
+                  //已授权未绑定
+                  uni.navigateTo({
+                    url: "/pageMy/login/login",
+                  });
+                }
+              }
+              resolve()
+            }
+          })
+          .catch((err) => {
+            reject(err);
+          });
+      });
+    },
+    //获取用户的pv/uv
+    statistics(type, payload) {
+      return new Promise((resolve, reject) => {
+        User.pageHistory(payload)
+          .then((res) => {
+            if (res.Ret === 200) {
+              resolve(res.Data);
+            }
+          })
+          .catch((err) => {
+            reject(err);
+          });
+      });
+    },
+  },
+  getters: {},
+});
 
-export default store
+export default store;

+ 0 - 147
uview-ui/components/u-line-progress/u-line-progress.vue

@@ -1,147 +0,0 @@
-<template>
-	<view class="u-progress" :style="{
-		borderRadius: round ? '100rpx' : 0,
-		height: height + 'rpx',
-		backgroundColor: inactiveColor
-	}">
-		<view :class="[
-			type ? `u-type-${type}-bg` : '',
-			striped ? 'u-striped' : '',
-			striped && stripedActive ? 'u-striped-active' : ''
-		]" class="u-active" :style="[progressStyle]">
-			<slot v-if="$slots.default || $slots.$default" />
-			<block v-else-if="showPercent">
-				{{percent + '%'}}
-			</block>
-		</view>
-	</view>
-</template>
-
-<script>
-	/**
-	 * lineProgress 线型进度条
-	 * @description 展示操作或任务的当前进度,比如上传文件,是一个线形的进度条。
-	 * @tutorial https://www.uviewui.com/components/lineProgress.html
-	 * @property {String Number} percent 进度条百分比值,为数值类型,0-100
-	 * @property {Boolean} round 进度条两端是否为半圆(默认true)
-	 * @property {String} type 如设置,active-color值将会失效
-	 * @property {String} active-color 进度条激活部分的颜色(默认#19be6b)
-	 * @property {String} inactive-color 进度条的底色(默认#ececec)
-	 * @property {Boolean} show-percent 是否在进度条内部显示当前的百分比值数值(默认true)
-	 * @property {String Number} height 进度条的高度,单位rpx(默认28)
-	 * @property {Boolean} striped 是否显示进度条激活部分的条纹(默认false)
-	 * @property {Boolean} striped-active 条纹是否具有动态效果(默认false)
-	 * @example <u-line-progress :percent="70" :show-percent="true"></u-line-progress>
-	 */
-	export default {
-		name: "u-line-progress",
-		props: {
-			// 两端是否显示半圆形
-			round: {
-				type: Boolean,
-				default: true
-			},
-			// 主题颜色
-			type: {
-				type: String,
-				default: ''
-			},
-			// 激活部分的颜色
-			activeColor: {
-				type: String,
-				default: '#19be6b'
-			},
-			inactiveColor: {
-				type: String,
-				default: '#ececec'
-			},
-			// 进度百分比,数值
-			percent: {
-				type: Number,
-				default: 0
-			},
-			// 是否在进度条内部显示百分比的值
-			showPercent: {
-				type: Boolean,
-				default: true
-			},
-			// 进度条的高度,单位rpx
-			height: {
-				type: [Number, String],
-				default: 28
-			},
-			// 是否显示条纹
-			striped: {
-				type: Boolean,
-				default: false
-			},
-			// 条纹是否显示活动状态
-			stripedActive: {
-				type: Boolean,
-				default: false
-			}
-		},
-		data() {
-			return {
-
-			}
-		},
-		computed: {
-			progressStyle() {
-				let style = {};
-				style.width = this.percent + '%';
-				if(this.activeColor) style.backgroundColor = this.activeColor;
-				return style;
-			}
-		},
-		methods: {
-
-		}
-	}
-</script>
-
-<style lang="scss" scoped>
-	@import "../../libs/css/style.components.scss";
-	
-	.u-progress {
-		overflow: hidden;
-		height: 15px;
-		/* #ifndef APP-NVUE */
-		display: inline-flex;
-		/* #endif */
-		align-items: center;
-		width: 100%;
-		border-radius: 100rpx;
-	}
-
-	.u-active {
-		width: 0;
-		height: 100%;
-		align-items: center;
-		@include vue-flex;
-		justify-items: flex-end;
-		justify-content: space-around;
-		font-size: 20rpx;
-		color: #ffffff;
-		transition: all 0.4s ease;
-	}
-
-	.u-striped {
-		background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
-		background-size: 39px 39px;
-	}
-
-	.u-striped-active {
-		animation: progress-stripes 2s linear infinite;
-	}
-
-	@keyframes progress-stripes {
-		0% {
-			background-position: 0 0;
-		}
-
-		100% {
-			background-position: 39px 0;
-		}
-	}
-</style>

+ 0 - 257
uview-ui/components/u-slider/u-slider.vue

@@ -1,257 +0,0 @@
-<template>
-	<view class="u-slider" @tap="onClick" :class="[disabled ? 'u-slider--disabled' : '']" :style="{
-		backgroundColor: inactiveColor
-	}">
-		<view
-			class="u-slider__gap"
-			:style="[
-				barStyle,
-				{
-					height: height + 'rpx',
-					backgroundColor: activeColor
-				}
-			]"
-		>
-			<view class="u-slider__button-wrap" @touchstart="onTouchStart" 
-				@touchmove="onTouchMove" @touchend="onTouchEnd" 
-				@touchcancel="onTouchEnd">
-				<slot v-if="$slots.default  || $slots.$default"/>
-				<view v-else class="u-slider__button" :style="[blockStyle, {
-					height: blockWidth + 'rpx',
-					width: blockWidth + 'rpx',
-					backgroundColor: blockColor
-				}]"></view>
-			</view>
-		</view>
-	</view>
-</template>
-
-<script>
-/**
- * slider 滑块选择器
- * @tutorial https://uviewui.com/components/slider.html
- * @property {Number | String} value 滑块默认值(默认0)
- * @property {Number | String} min 最小值(默认0)
- * @property {Number | String} max 最大值(默认100)
- * @property {Number | String} step 步长(默认1)
- * @property {Number | String} blockWidth 滑块宽度,高等于宽(30)
- * @property {Number | String} height 滑块条高度,单位rpx(默认6)
- * @property {String} inactiveColor 底部条背景颜色(默认#c0c4cc)
- * @property {String} activeColor 底部选择部分的背景颜色(默认#2979ff)
- * @property {String} blockColor 滑块颜色(默认#ffffff)
- * @property {Object} blockStyle 给滑块自定义样式,对象形式
- * @property {Boolean} disabled 是否禁用滑块(默认为false)
- * @event {Function} start 滑动触发
- * @event {Function} moving 正在滑动中
- * @event {Function} end 滑动结束
- * @example <u-slider v-model="value" />
- */
-export default {
-	name: 'u-slider',
-	props: {
-		// 当前进度百分比值,范围0-100
-		value: {
-			type: [Number, String],
-			default: 0
-		},
-		// 是否禁用滑块
-		disabled: {
-			type: Boolean,
-			default: false
-		},
-		// 滑块宽度,高等于宽,单位rpx
-		blockWidth: {
-			type: [Number, String],
-			default: 30
-		},
-		// 最小值
-		min: {
-			type: [Number, String],
-			default: 0
-		},
-		// 最大值
-		max: {
-			type: [Number, String],
-			default: 100
-		},
-		// 步进值
-		step: {
-			type: [Number, String],
-			default: 1
-		},
-		// 滑块条高度,单位rpx
-		height: {
-			type: [Number, String],
-			default: 6
-		},
-		// 进度条的激活部分颜色
-		activeColor: {
-			type: String,
-			default: '#2979ff'
-		},
-		// 进度条的背景颜色
-		inactiveColor: {
-			type: String,
-			default: '#c0c4cc'
-		},
-		// 滑块的背景颜色
-		blockColor: {
-			type: String,
-			default: '#ffffff'
-		},
-		// 用户对滑块的自定义颜色
-		blockStyle: {
-			type: Object,
-			default() {
-				return {};
-			}
-		},
-	},
-	data() {
-		return {
-			startX: 0,
-			status: 'end',
-			newValue: 0,
-			distanceX: 0,
-			startValue: 0,
-			barStyle: {},
-			sliderRect: {
-				left: 0,
-				width: 0
-			}
-		};
-	},
-	watch: {
-		value(n) {
-			// 只有在非滑动状态时,才可以通过value更新滑块值,这里监听,是为了让用户触发
-			if(this.status == 'end') this.updateValue(this.value, false);
-		}
-	},
-	created() {
-		this.updateValue(this.value, false);
-	},
-	mounted() {
-		// 获取滑块条的尺寸信息
-		this.$uGetRect('.u-slider').then(rect => {
-			this.sliderRect = rect;
-		});
-	},
-	methods: {
-		onTouchStart(event) {
-			if (this.disabled) return;
-			this.startX = 0;
-			// 触摸点集
-			let touches = event.touches[0];
-			// 触摸点到屏幕左边的距离
-			this.startX = touches.clientX;
-			// 此处的this.value虽为props值,但是通过$emit('input')进行了修改
-			this.startValue = this.format(this.value);
-			// 标示当前的状态为开始触摸滑动
-			this.status = 'start';
-		},
-		onTouchMove(event) {
-			if (this.disabled) return;
-			// 连续触摸的过程会一直触发本方法,但只有手指触发且移动了才被认为是拖动了,才发出事件
-			// 触摸后第一次移动已经将status设置为moving状态,故触摸第二次移动不会触发本事件
-			if (this.status == 'start') this.$emit('start');
-			let touches = event.touches[0];
-			// 滑块的左边不一定跟屏幕左边接壤,所以需要减去最外层父元素的左边值
-			this.distanceX = touches.clientX - this.sliderRect.left;
-			// 获得移动距离对整个滑块的百分比值,此为带有多位小数的值,不能用此更新视图
-			// 否则造成通信阻塞,需要每改变一个step值时修改一次视图
-			this.newValue = (this.distanceX / this.sliderRect.width) * 100;
-			this.status = 'moving';
-			// 发出moving事件
-			this.$emit('moving');
-			this.updateValue(this.newValue, true);
-		},
-		onTouchEnd() {
-			if (this.disabled) return;
-			if (this.status === 'moving') {
-				this.updateValue(this.newValue, false);
-				this.$emit('end');
-			}
-			this.status = 'end';
-		},
-		updateValue(value, drag) {
-			// 去掉小数部分,同时也是对step步进的处理
-			const width = this.format(value);
-			// 不允许滑动的值超过max最大值,百分比也不能超过100
-			if(width > this.max || width > 100) return;
-			// 设置移动的百分比值
-			let barStyle = {
-				width: width + '%'
-			};
-			// 移动期间无需过渡动画
-			if (drag == true) {
-				barStyle.transition = 'none';
-			} else {
-				// 非移动期间,删掉对过渡为空的声明,让css中的声明起效
-				delete barStyle.transition;
-			}
-			// 修改value值
-			this.$emit('input', width);
-			this.barStyle = barStyle;
-		},
-		format(value) {
-			// 将小数变成整数,为了减少对视图的更新,造成视图层与逻辑层的阻塞
-			return Math.round(Math.max(this.min, Math.min(value, this.max)) / this.step) * this.step;
-		},
-		onClick(event) {
-			if (this.disabled) return;
-			// 直接点击滑块的情况,计算方式与onTouchMove方法相同
-			const value = ((event.detail.x - this.sliderRect.left) / this.sliderRect.width) * 100;
-			this.updateValue(value, false);
-		}
-	}
-};
-</script>
-
-<style lang="scss" scoped>
-@import "../../libs/css/style.components.scss";
-
-.u-slider {
-	position: relative;
-	border-radius: 999px;
-	border-radius: 999px;
-	background-color: #ebedf0;
-}
-
-.u-slider:before {
-	position: absolute;
-	right: 0;
-	left: 0;
-	content: '';
-	top: -8px;
-	bottom: -8px;
-	z-index: -1;
-}
-
-.u-slider__gap {
-	position: relative;
-	border-radius: inherit;
-	transition: width 0.2s;
-	transition: width 0.2s;
-	background-color: #1989fa;
-}
-
-.u-slider__button {
-	width: 24px;
-	height: 24px;
-	border-radius: 50%;
-	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
-	background-color: #fff;
-	cursor: pointer;
-}
-
-.u-slider__button-wrap {
-	position: absolute;
-	top: 50%;
-	right: 0;
-	transform: translate3d(50%, -50%, 0);
-}
-
-.u-slider--disabled {
-	opacity: 0.5;
-}
-</style>

+ 0 - 200
uview-ui/components/u-steps/u-steps.vue

@@ -1,200 +0,0 @@
-<template>
-	<view class="">
-		<view
-			class="u-steps"
-			:style="{
-				flexDirection: direction
-			}"
-		>
-			<view class="u-steps__item" 
-				:class="['u-steps__item--' + direction]" 
-				v-for="(item, index) in list" :key="index"
-			>
-				<view
-					class="u-steps__item__num"
-					v-if="mode == 'number'"
-					:style="{
-						backgroundColor: current < index ? 'transparent' : activeColor,
-						borderColor: current < index ? unActiveColor : activeColor
-					}"
-				>
-					<text v-if="current < index" :style="{
-						color: current < index ? unActiveColor : activeColor,
-					}">
-						{{ index + 1 }}
-					</text>
-					<u-icon v-else size="22" color="#ffffff" :name="icon"></u-icon>
-				</view>
-				<view class="u-steps__item__dot" v-if="mode == 'dot'" :style="{ 
-					backgroundColor: index <= current ? activeColor : unActiveColor 
-				}"></view>
-				<text class="u-line-1" :style="{ 
-					color: index <= current ? activeColor : unActiveColor,
-				}" :class="['u-steps__item__text--' + direction]">
-					{{ item.name }}
-				</text>
-				<view class="u-steps__item__line" :class="['u-steps__item__line--' + mode]" v-if="index < list.length - 1">
-					<u-line :direction="direction" length="100%" :hair-line="false" :color="unActiveColor"></u-line>
-				</view>
-			</view>
-		</view>
-	</view>
-</template>
-
-<script>
-/**
- * steps 步骤条
- * @description 该组件一般用于完成一个任务要分几个步骤,标识目前处于第几步的场景。
- * @tutorial https://www.uviewui.com/components/steps.html
- * @property {String} mode 设置模式(默认dot)
- * @property {Array} list 数轴条数据,数组。具体见上方示例
- * @property {String} type type主题(默认primary)
- * @property {String} direction row-横向,column-竖向(默认row)
- * @property {Number String} current 设置当前处于第几步
- * @property {String} active-color 已完成步骤的激活颜色,如设置,type值会失效
- * @property {String} un-active-color 未激活的颜色,用于表示未完成步骤的颜色(默认#606266)
- * @example <u-steps :list="numList" active-color="#fa3534"></u-steps>
- */
-export default {
-	name: 'u-steps',
-	props: {
-		// 步骤条的类型,dot|number
-		mode: {
-			type: String,
-			default: 'dot'
-		},
-		// 步骤条的数据
-		list: {
-			type: Array,
-			default() {
-				return [];
-			}
-		},
-		// 主题类型, primary|success|info|warning|error
-		type: {
-			type: String,
-			default: 'primary'
-		},
-		// 当前哪一步是激活的
-		current: {
-			type: [Number, String],
-			default: 0
-		},
-		// 激活步骤的颜色
-		activeColor: {
-			type: String,
-			default: '#2979ff'
-		},
-		// 未激活的颜色
-		unActiveColor: {
-			type: String,
-			default: '#909399'
-		},
-		// 自定义图标
-		icon: {
-			type: String,
-			default: 'checkmark'
-		},
-		// step的排列方向,row-横向,column-竖向
-		direction: {
-			type: String,
-			default: 'row'
-		}
-	},
-	data() {
-		return {};
-	},
-};
-</script>
-
-<style lang="scss" scoped>
-@import '../../libs/css/style.components.scss';
-
-$u-steps-item-number-width: 44rpx;
-$u-steps-item-dot-width: 20rpx;
-
-.u-steps {
-	@include vue-flex;
-	
-	.u-steps__item {
-		flex: 1;
-		text-align: center;
-		position: relative;
-		min-width: 100rpx;
-		font-size: 26rpx;
-		color: #8799a3;
-		@include vue-flex;
-		justify-content: center;
-		flex-direction: column;
-		align-items: center;
-		
-		&--row {
-			@include vue-flex;
-			flex-direction: column;
-			
-			.u-steps__item__line {
-				position: absolute;
-				z-index: 0;
-				left: 75%;
-				width: 50%;
-				
-				&--dot {
-					top: calc(#{$u-steps-item-dot-width} / 2);
-				}
-				
-				&--number {
-					top: calc(#{$u-steps-item-number-width} / 2);
-				}
-			}
-		}
-		
-		&--column {
-			@include vue-flex;
-			flex-direction: row;
-			justify-content: flex-start;
-			min-height: 120rpx;
-			
-			.u-steps__item__line {
-				position: absolute;
-				z-index: 0;
-				height: 50%;
-				top: 75%;
-				
-				&--dot {
-					left: calc(#{$u-steps-item-dot-width} / 2);
-				}
-				
-				&--number {
-					left: calc(#{$u-steps-item-number-width} / 2);
-				}
-			}
-		}
-		
-		&__num {
-			@include vue-flex;
-			align-items: center;
-			justify-content: center;
-			width: $u-steps-item-number-width;
-			height: $u-steps-item-number-width;
-			border: 1px solid #8799a3;
-			border-radius: 50%;
-			overflow: hidden;
-		}
-		
-		&__dot {
-			width: $u-steps-item-dot-width;
-			height: $u-steps-item-dot-width;
-			@include vue-flex;
-			border-radius: 50%;
-		}
-		
-		&__text--row {
-			margin-top: 14rpx;
-		}
-		
-		&__text--column {
-			margin-left: 14rpx;
-		}
-	}
-}
-</style>

+ 0 - 157
uview-ui/components/u-sticky/u-sticky.vue

@@ -1,157 +0,0 @@
-<template>
-	<view class="">
-		<view class="u-sticky-wrap" :class="[elClass]" :style="{
-			height: fixed ? height + 'px' : 'auto',
-			backgroundColor: bgColor
-		}">
-			<view class="u-sticky" :style="{
-				position: fixed ? 'fixed' : 'static',
-				top: stickyTop + 'px',
-				left: left + 'px',
-				width: width == 'auto' ? 'auto' : width + 'px',
-				zIndex: uZIndex
-			}">
-				<slot></slot>
-			</view>
-		</view>
-	</view>
-</template>
-
-<script>
-	/**
-	 * sticky 吸顶
-	 * @description 该组件与CSS中position: sticky属性实现的效果一致,当组件达到预设的到顶部距离时, 就会固定在指定位置,组件位置大于预设的顶部距离时,会重新按照正常的布局排列。
-	 * @tutorial https://www.uviewui.com/components/sticky.html
-	 * @property {String Number} offset-top 吸顶时与顶部的距离,单位rpx(默认0)
-	 * @property {String Number} index 自定义标识,用于区分是哪一个组件
-	 * @property {Boolean} enable 是否开启吸顶功能(默认true)
-	 * @property {String} bg-color 组件背景颜色(默认#ffffff)
-	 * @property {String Number} z-index 吸顶时的z-index值(默认970)
-	 * @property {String Number} h5-nav-height 导航栏高度,自定义导航栏时(无导航栏时需设置为0),需要传入此值,单位px(默认44)
-	 * @event {Function} fixed 组件吸顶时触发
-	 * @event {Function} unfixed 组件取消吸顶时触发
-	 * @example <u-sticky offset-top="200"><view>塞下秋来风景异,衡阳雁去无留意</view></u-sticky>
-	 */
-	export default {
-		name: "u-sticky",
-		props: {
-			// 吸顶容器到顶部某个距离的时候,进行吸顶,在H5平台,NavigationBar为44px
-			offsetTop: {
-				type: [Number, String],
-				default: 0
-			},
-			//列表中的索引值
-			index: {
-				type: [Number, String],
-				default: ''
-			},
-			// 是否开启吸顶功能
-			enable: {
-				type: Boolean,
-				default: true
-			},
-			// h5顶部导航栏的高度
-			h5NavHeight: {
-				type: [Number, String],
-				default: 44
-			},
-			// 吸顶区域的背景颜色
-			bgColor: {
-				type: String,
-				default: '#ffffff'
-			},
-			// z-index值
-			zIndex: {
-				type: [Number, String],
-				default: ''
-			}
-		},
-		data() {
-			return {
-				fixed: false,
-				height: 'auto',
-				stickyTop: 0,
-				elClass: this.$u.guid(),
-				left: 0,
-				width: 'auto',
-			};
-		},
-		watch: {
-			offsetTop(val) {
-				this.initObserver();
-			},
-			enable(val) {
-				if (val == false) {
-					this.fixed = false;
-					this.disconnectObserver('contentObserver');
-				} else {
-					this.initObserver();
-				}
-			}
-		},
-		computed: {
-			uZIndex() {
-				return this.zIndex ? this.zIndex : this.$u.zIndex.sticky;
-			}
-		},
-		mounted() {
-			this.initObserver();
-		},
-		methods: {
-			initObserver() {
-				if (!this.enable) return;
-				// #ifdef H5
-				this.stickyTop = this.offsetTop != 0 ? uni.upx2px(this.offsetTop) + this.h5NavHeight : this.h5NavHeight;
-				// #endif
-				// #ifndef H5
-				this.stickyTop = this.offsetTop != 0 ? uni.upx2px(this.offsetTop) : 0;
-				// #endif
-
-				this.disconnectObserver('contentObserver');
-				this.$uGetRect('.' + this.elClass).then((res) => {
-					this.height = res.height;
-					this.left = res.left;
-					this.width = res.width;
-					this.$nextTick(() => {
-						this.observeContent();
-					});
-				});
-			},
-			observeContent() {
-				this.disconnectObserver('contentObserver');
-				const contentObserver = this.createIntersectionObserver({
-					thresholds: [0.95, 0.98, 1]
-				});
-				contentObserver.relativeToViewport({
-					top: -this.stickyTop
-				});
-				contentObserver.observe('.' + this.elClass, res => {
-					if (!this.enable) return;
-					this.setFixed(res.boundingClientRect.top);
-				});
-				this.contentObserver = contentObserver;
-			},
-			setFixed(top) {
-				const fixed = top < this.stickyTop;
-				if (fixed) this.$emit('fixed', this.index);
-				else if(this.fixed) this.$emit('unfixed', this.index);
-				this.fixed = fixed;
-			},
-			disconnectObserver(observerName) {
-				const observer = this[observerName];
-				observer && observer.disconnect();
-			},
-		},
-		beforeDestroy() {
-			this.disconnectObserver('contentObserver');
-		}
-	};
-</script>
-
-<style scoped lang="scss">
-	@import "../../libs/css/style.components.scss";
-	
-	.u-sticky {
-		z-index: 9999999999;
-	}
-</style>

+ 0 - 355
uview-ui/components/u-subsection/u-subsection.vue

@@ -1,355 +0,0 @@
-<template>
-	<view class="u-subsection" :style="[subsectionStyle]">
-		<view class="u-item u-line-1" :style="[itemStyle(index)]" @tap="click(index)" :class="[noBorderRight(index), 'u-item-' + index]"
-		 v-for="(item, index) in listInfo" :key="index">
-			<view :style="[textStyle(index)]" class="u-item-text u-line-1">{{ item.name }}</view>
-		</view>
-		<view class="u-item-bg" :style="[itemBarStyle]"></view>
-	</view>
-</template>
-
-<script>
-	/**
-	 * subsection 分段器
-	 * @description 该分段器一般用于用户从几个选项中选择某一个的场景
-	 * @tutorial https://www.uviewui.com/components/subsection.html
-	 * @property {Array} list 选项的数组,形式见上方"基本使用"
-	 * @property {String Number} current 初始化时默认选中的选项索引值(默认0)
-	 * @property {String} active-color 激活时的颜色,mode为subsection时固定为白色(默认#303133)
-	 * @property {String} inactive-color 未激活时字体的颜色,mode为subsection时无效(默认#606266)
-	 * @property {String} mode 模式选择,见官网"模式选择"说明(默认button)
-	 * @property {String Number} font-size 字体大小,单位rpx(默认28)
-	 * @property {String Number} height 组件高度,单位rpx(默认70)
-	 * @property {Boolean} animation 是否开启动画效果,见上方说明(默认true)
-	 * @property {Boolean} bold 激活选项的字体是否加粗(默认true)
-	 * @property {String} bg-color 组件背景颜色,mode为button时有效(默认#eeeeef)
-	 * @property {String} button-color 按钮背景颜色,mode为button时有效(默认#ffffff)
-	 * @event {Function} change 分段器选项发生改变时触发
-	 * @example <u-subsection active-color="#ff9900"></u-subsection>
-	 */
-	export default {
-		name: "u-subsection",
-		props: {
-			// tab的数据
-			list: {
-				type: Array,
-				default () {
-					return [];
-				}
-			},
-			// 当前活动的tab的index
-			current: {
-				type: [Number, String],
-				default: 0
-			},
-			// 激活的颜色
-			activeColor: {
-				type: String,
-				default: '#303133'
-			},
-			// 未激活的颜色
-			inactiveColor: {
-				type: String,
-				default: '#606266'
-			},
-			// 模式选择,mode=button为按钮形式,mode=subsection时为分段模式
-			mode: {
-				type: String,
-				default: 'button'
-			},
-			// 字体大小,单位rpx
-			fontSize: {
-				type: [Number, String],
-				default: 28
-			},
-			// 是否开启动画效果
-			animation: {
-				type: Boolean,
-				default: true
-			},
-			// 组件的高度,单位rpx
-			height: {
-				type: [Number, String],
-				default: 70
-			},
-			// 激活tab的字体是否加粗
-			bold: {
-				type: Boolean,
-				default: true
-			},
-			// mode=button时,组件背景颜色
-			bgColor: {
-				type: String,
-				default: '#eeeeef'
-			},
-			// mode = button时,滑块背景颜色
-			buttonColor: {
-				type: String,
-				default: '#ffffff'
-			},
-			// 在切换分段器的时候,是否让设备震一下
-			vibrateShort: {
-				type: Boolean,
-				default: false
-			}
-		},
-		data() {
-			return {
-				listInfo: [],
-				itemBgStyle: {
-					width: 0,
-					left: 0,
-					backgroundColor: '#ffffff',
-					height: '100%',
-					transition: ''
-				},
-				currentIndex: this.current,
-				buttonPadding: 3, // mode = button 时,组件的内边距
-				borderRadius: 5, // 圆角值
-				firstTimeVibrateShort: true // 组件初始化时,会触发current变化,此时不应震动
-			};
-		},
-		watch: {
-			current: {
-				immediate: true,
-				handler(nVal) {
-					this.currentIndex = nVal;
-					this.changeSectionStatus(nVal);
-				}
-			}
-		},
-		created() {
-			// 将list的数据,传入listInfo数组,因为不能修改props传递的list值
-			// 可以接受直接数组形式,或者数组元素为对象的形式,如:['简介', '评论'],或者[{name: '简介'}, {name: '评论'}]
-			this.listInfo = this.list.map((val, index) => {
-				if (typeof val != 'object') {
-					let obj = {
-						width: 0,
-						name: val
-					};
-					return obj;
-				} else {
-					val.width = 0;
-					return val;
-				}
-			});
-		},
-		computed: {
-			// 设置mode=subsection时,滑块特有的样式
-			noBorderRight() {
-				return index => {
-					if (this.mode != 'subsection') return;
-					let classs = '';
-					// 不显示右边的边框
-					if (index < this.list.length - 1) classs += ' u-none-border-right';
-					// 显示整个组件的左右边圆角
-					if (index == 0) classs += ' u-item-first';
-					if (index == this.list.length - 1) classs += ' u-item-last';
-					return classs;
-				};
-			},
-			// 文字的样式
-			textStyle() {
-				return index => {
-					let style = {};
-					// 设置字体颜色
-					if (this.mode == 'subsection') {
-						if (index == this.currentIndex) {
-							style.color = '#ffffff';
-						} else {
-							style.color = this.activeColor;
-						}
-					} else {
-						if (index == this.currentIndex) {
-							style.color = this.activeColor;
-						} else {
-							style.color = this.inactiveColor;
-						}
-					}
-					// 字体加粗
-					if (index == this.currentIndex && this.bold) style.fontWeight = 'bold';
-					// 文字大小
-					style.fontSize = this.fontSize + 'rpx';
-					return style;
-				};
-			},
-			// 每个分段器item的样式
-			itemStyle() {
-				return index => {
-					let style = {};
-					if (this.mode == 'subsection') {
-						// 设置border的样式
-						style.borderColor = this.activeColor;
-						style.borderWidth = '1px';
-						style.borderStyle = 'solid';
-					}
-					return style;
-				};
-			},
-			// mode=button时,外层view的样式
-			subsectionStyle() {
-				let style = {};
-				style.height = uni.upx2px(this.height) + 'px';
-				if (this.mode == 'button') {
-					style.backgroundColor = this.bgColor;
-					style.padding = `${this.buttonPadding}px`;
-					style.borderRadius = `${this.borderRadius}px`;
-				}
-				return style;
-			},
-			// 滑块的样式
-			itemBarStyle() {
-				let style = {};
-				style.backgroundColor = this.activeColor;
-				style.zIndex = 1;
-				if (this.mode == 'button') {
-					style.backgroundColor = this.buttonColor;
-					style.borderRadius = `${this.borderRadius}px`;
-					style.bottom = `${this.buttonPadding}px`;
-					style.height = uni.upx2px(this.height) - this.buttonPadding * 2 + 'px';
-					style.zIndex = 0;
-				}
-				return Object.assign(this.itemBgStyle, style);
-			}
-		},
-		mounted() {
-			setTimeout(() => {
-				this.getTabsInfo();
-			}, 10);
-		},
-		methods: {
-			// 改变滑块的样式
-			changeSectionStatus(nVal) {
-				if (this.mode == 'subsection') {
-					// 根据滑块在最左边和最右边时,显示左边和右边的圆角
-					if (nVal == this.list.length - 1) {
-						this.itemBgStyle.borderRadius = `0 ${this.buttonPadding}px ${this.buttonPadding}px 0`;
-					}
-					if (nVal == 0) {
-						this.itemBgStyle.borderRadius = `${this.buttonPadding}px 0 0 ${this.buttonPadding}px`;
-					}
-					if (nVal > 0 && nVal < this.list.length - 1) {
-						this.itemBgStyle.borderRadius = '0';
-					}
-				}
-				// 更新滑块的位置
-				setTimeout(() => {
-					this.itemBgLeft();
-				}, 10);
-				if (this.vibrateShort && !this.firstTimeVibrateShort) {
-					// 使手机产生短促震动,微信小程序有效,APP(HX 2.6.8)和H5无效
-					// #ifndef H5
-					uni.vibrateShort();
-					// #endif
-				}
-				// 第一次过后,设置firstTimeVibrateShort为false,让其下一次可以震动(如果允许震动的话)
-				this.firstTimeVibrateShort = false;
-			},
-			click(index) {
-				// 不允许点击当前激活选项
-				if (index == this.currentIndex) return;
-				this.currentIndex = index;
-				this.changeSectionStatus(index);
-				this.$emit('change', Number(index));
-			},
-			// 获取各个tab的节点信息
-			getTabsInfo() {
-				let view = uni.createSelectorQuery().in(this);
-				for (let i = 0; i < this.list.length; i++) {
-					view.select('.u-item-' + i).boundingClientRect();
-				}
-				view.exec(res => {
-					if (!res.length) {
-						setTimeout(() => {
-							this.getTabsInfo();
-							return;
-						}, 10);
-					}
-					// 将分段器每个item的宽度,放入listInfo数组
-					res.map((val, index) => {
-						this.listInfo[index].width = val.width;
-					});
-					// 初始化滑块的宽度
-					if (this.mode == 'subsection') {
-						this.itemBgStyle.width = this.listInfo[0].width + 'px';
-					} else if (this.mode == 'button') {
-						this.itemBgStyle.width = this.listInfo[0].width + 'px';
-					}
-					// 初始化滑块的位置
-					this.itemBgLeft();
-				});
-			},
-			itemBgLeft() {
-				// 根据是否开启动画效果,
-				if (this.animation) {
-					this.itemBgStyle.transition = 'all 0.35s';
-				} else {
-					this.itemBgStyle.transition = 'all 0s';
-				}
-				let left = 0;
-				// 计算当前活跃item到组件左边的距离
-				this.listInfo.map((val, index) => {
-					if (index < this.currentIndex) left += val.width;
-				});
-				// 根据mode不同模式,计算滑块需要移动的距离
-				if (this.mode == 'subsection') {
-					this.itemBgStyle.left = left + 'px';
-				} else if (this.mode == 'button') {
-					this.itemBgStyle.left = left + this.buttonPadding + 'px';
-				}
-			}
-		}
-	};
-</script>
-
-<style lang="scss" scoped>
-	@import "../../libs/css/style.components.scss";
-	
-	.u-subsection {
-		@include vue-flex;
-		align-items: center;
-		overflow: hidden;
-		position: relative;
-	}
-
-	.u-item {
-		flex: 1;
-		text-align: center;
-		font-size: 26rpx;
-		height: 100%;
-		@include vue-flex;
-		align-items: center;
-		justify-content: center;
-		color: $u-main-color;
-		padding: 0 6rpx;
-	}
-
-	.u-item-bg {
-		background-color: $u-type-primary;
-		position: absolute;
-		z-index: -1;
-	}
-
-	.u-none-border-right {
-		border-right: none !important;
-	}
-
-	.u-item-first {
-		border-top-left-radius: 8rpx;
-		border-bottom-left-radius: 8rpx;
-	}
-
-	.u-item-last {
-		border-top-right-radius: 8rpx;
-		border-bottom-right-radius: 8rpx;
-	}
-
-	.u-item-text {
-		transition: all 0.35s;
-		color: $u-main-color;
-		@include vue-flex;
-		align-items: center;
-		position: relative;
-		z-index: 3;
-	}
-</style>

+ 0 - 255
uview-ui/components/u-swipe-action/u-swipe-action.vue

@@ -1,255 +0,0 @@
-<template>
-	<view class="">
-		<movable-area class="u-swipe-action" :style="{ backgroundColor: bgColor }">
-			<movable-view
-				class="u-swipe-view"
-				@change="change"
-				@touchend="touchend"
-				@touchstart="touchstart"
-				direction="horizontal"
-				:disabled="disabled"
-				:x="moveX"
-				:style="{
-					width: movableViewWidth ? movableViewWidth : '100%'
-				}"
-			>
-				<view
-					class="u-swipe-content"
-					@tap.stop="contentClick"
-				>
-					<slot></slot>
-				</view>
-				<view class="u-swipe-del" v-if="showBtn" @tap.stop="btnClick(index)" :style="[btnStyle(item.style)]" v-for="(item, index) in options" :key="index">
-					<view class="u-btn-text">{{ item.text }}</view>
-				</view>
-			</movable-view>
-		</movable-area>
-	</view>
-</template>
-
-<script>
-/**
- * swipeAction 左滑单元格
- * @description 该组件一般用于左滑唤出操作菜单的场景,用的最多的是左滑删除操作。
- * @tutorial https://www.uviewui.com/components/swipeAction.html
- * @property {String} bg-color 整个组件背景颜色(默认#ffffff)
- * @property {Array} options 数组形式,可以配置背景颜色和文字
- * @property {String Number} index 标识符,点击时候用于区分点击了哪一个,用v-for循环时的index即可
- * @property {String Number} btn-width 按钮宽度,单位rpx(默认180)
- * @property {Boolean} disabled 是否禁止某个swipeAction滑动(默认false)
- * @property {Boolean} show 打开或者关闭某个组件(默认false)
- * @event {Function} click 点击组件时触发
- * @event {Function} close 组件触发关闭状态时
- * @event {Function} content-click 点击内容时触发
- * @event {Function} open 组件触发打开状态时
- * @example <u-swipe-action btn-text="收藏">...</u-swipe-action>
- */
-export default {
-	name: 'u-swipe-action',
-	props: {
-		// index值,用于得知点击删除的是哪个按钮
-		index: {
-			type: [Number, String],
-			default: ''
-		},
-		// 滑动按钮的宽度,单位为rpx
-		btnWidth: {
-			type: [String, Number],
-			default: 180
-		},
-		// 是否禁止某个action滑动
-		disabled: {
-			type: Boolean,
-			default: false
-		},
-		// 打开或者关闭组件
-		show: {
-			type: Boolean,
-			default: false
-		},
-		// 组件背景颜色
-		bgColor: {
-			type: String,
-			default: '#ffffff'
-		},
-		// 是否使手机发生短促震动,目前只在iOS的微信小程序有效(2020-05-06)
-		vibrateShort: {
-			type: Boolean,
-			default: false
-		},
-		// 按钮操作参数
-		options: {
-			type: Array,
-			default() {
-				return [];
-			}
-		}
-	},
-	watch: {
-		show: {
-			immediate: true,
-			handler(nVal, oVal) {
-				if (nVal) {
-					this.open();
-				} else {
-					this.close();
-				}
-			}
-		}
-	},
-	data() {
-		return {
-			moveX: 0, // movable-view元素在x轴上需要移动的目标移动距离,用于展开或收起滑动的按钮
-			scrollX: 0, // movable-view移动过程中产生的change事件中的x轴移动值
-			status: false, // 滑动的状态,表示当前是展开还是关闭按钮的状态
-			movableAreaWidth: 0, // 滑动区域
-			elId: this.$u.guid(), // id,用于通知另外组件关闭时的识别
-			showBtn: false, // 刚开始渲染视图时不显示右边的按钮,避免视图闪动
-		};
-	},
-	computed: {
-		movableViewWidth() {
-			return this.movableAreaWidth + this.allBtnWidth + 'px';
-		},
-		innerBtnWidth() {
-			return uni.upx2px(this.btnWidth);
-		},
-		allBtnWidth() {
-			return uni.upx2px(this.btnWidth) * this.options.length;
-		},
-		btnStyle() {
-			return style => {
-				let css = {};
-				style.width = this.btnWidth + 'rpx';
-				return style;
-			};
-		}
-	},
-	mounted() {
-		this.getActionRect();
-	},
-	methods: {
-		// 点击按钮
-		btnClick(index) {
-			this.status = false;
-			// this.index为点击的几个组件,index为点击某个组件的第几个按钮(options数组的索引)
-			this.$emit('click', this.index, index);
-		},
-		// movable-view元素移动事件
-		change(e) {
-			this.scrollX = e.detail.x;
-		},
-		// 关闭按钮状态
-		close() {
-			this.moveX = 0;
-			this.status = false;
-		},
-		// 打开按钮的状态
-		open() {
-			if (this.disabled) return;
-			this.moveX = -this.allBtnWidth;
-			this.status = true;
-		},
-		// 用户手指离开movable-view元素,停止触摸
-		touchend() {
-			this.moveX = this.scrollX;
-			// 停止触摸时候,判断当前是展开还是关闭状态
-			// 关闭状态
-			// 这一步很重要,需要先给this.moveX一个变化的随机值,否则因为前后设置的为同一个值
-			// props单向数据流的原因,导致movable-view元素不会发生变化,切记,详见文档:
-			// https://uniapp.dcloud.io/use?id=%e5%b8%b8%e8%a7%81%e9%97%ae%e9%a2%98
-			this.$nextTick(function() {
-				if (this.status == false) {
-					// 关闭状态左滑,产生的x轴位移为负值,也就是说滑动的距离大于按钮的四分之一宽度,自动展开按钮
-					if (this.scrollX <= -this.allBtnWidth / 4) {
-						this.moveX = -this.allBtnWidth; // 按钮宽度的负值,即为展开状态movable-view元素左滑的距离
-						this.status = true; // 标志当前为展开状态
-						this.emitOpenEvent();
-						// 产生震动效果
-						if (this.vibrateShort) uni.vibrateShort();
-					} else {
-						this.moveX = 0; // 如果距离没有按钮宽度的四分之一,自动收起
-						this.status = false;
-						this.emitCloseEvent();
-					}
-				} else {
-					// 如果在打开的状态下,右滑动的距离X轴偏移超过按钮的四分之一(负值反过来的四分之三),自动收起按钮
-					if (this.scrollX > (-this.allBtnWidth * 3) / 4) {
-						this.moveX = 0;
-						this.$nextTick(() => {
-							this.moveX = 101;
-						});
-						this.status = false;
-						this.emitCloseEvent();
-					} else {
-						this.moveX = -this.allBtnWidth;
-						this.status = true;
-						this.emitOpenEvent();
-					}
-				}
-			});
-		},
-		emitOpenEvent() {
-			this.$emit('open', this.index);
-		},
-		emitCloseEvent() {
-			this.$emit('close', this.index);
-		},
-		// 开始触摸
-		touchstart() {},
-		getActionRect() {
-			this.$uGetRect('.u-swipe-action').then(res => {
-				this.movableAreaWidth = res.width;
-				// 等视图更新完后,再显示右边的可滑动按钮,防止这些按钮会"闪一下"
-				this.$nextTick(() => {
-					this.showBtn = true;
-				})
-			});
-		},
-		// 点击内容触发事件
-		contentClick() {
-			// 点击内容时,如果当前为打开状态,收起组件
-			if (this.status == true) {
-				this.status = 'close';
-				this.moveX = 0;
-			}
-			this.$emit('content-click', this.index);
-		}
-	}
-};
-</script>
-
-<style scoped lang="scss">
-@import "../../libs/css/style.components.scss";
-	
-.u-swipe-action {
-	width: auto;
-	height: initial;
-	position: relative;
-	overflow: hidden;
-}
-
-.u-swipe-view {
-	@include vue-flex;
-	height: initial;
-	position: relative;
-	/* 这一句很关键,覆盖默认的绝对定位 */
-}
-
-.u-swipe-content {
-	flex: 1;
-}
-
-.u-swipe-del {
-	position: relative;
-	font-size: 30rpx;
-	color: #ffffff;
-}
-
-.u-btn-text {
-	position: absolute;
-	top: 50%;
-	left: 50%;
-	transform: translate(-50%, -50%);
-}
-</style>

+ 0 - 340
uview-ui/components/u-swiper/u-swiper.vue

@@ -1,340 +0,0 @@
-<template>
-	<view class="u-swiper-wrap" :style="{
-		borderRadius: `${borderRadius}rpx`
-	}">
-		<swiper :current="elCurrent" @change="change" @animationfinish="animationfinish" :interval="interval" :circular="circular" :duration="duration" :autoplay="autoplay"
-		 :previous-margin="effect3d ? effect3dPreviousMargin + 'rpx' : '0'" :next-margin="effect3d ? effect3dPreviousMargin + 'rpx' : '0'"
-		 :style="{
-				height: height + 'rpx',
-				backgroundColor: bgColor
-			}">
-			<swiper-item class="u-swiper-item" v-for="(item, index) in list" :key="index">
-				<view class="u-list-image-wrap" @tap.stop.prevent="listClick(index)" :class="[uCurrent != index ? 'u-list-scale' : '']" :style="{
-						borderRadius: `${borderRadius}rpx`,
-						transform: effect3d && uCurrent != index ? 'scaleY(0.9)' : 'scaleY(1)',
-						margin: effect3d && uCurrent != index ? '0 20rpx' : 0,
-					}">
-					<image class="u-swiper-image" :src="item[name] || item" :mode="imgMode"></image>
-					<view v-if="title && item.title" class="u-swiper-title u-line-1" :style="[{
-							'padding-bottom': titlePaddingBottom
-						}, titleStyle]">
-						{{ item.title }}
-					</view>
-				</view>
-			</swiper-item>
-		</swiper>
-		<view class="u-swiper-indicator" :style="{
-				top: indicatorPos == 'topLeft' || indicatorPos == 'topCenter' || indicatorPos == 'topRight' ? '12rpx' : 'auto',
-				bottom: indicatorPos == 'bottomLeft' || indicatorPos == 'bottomCenter' || indicatorPos == 'bottomRight' ? '12rpx' : 'auto',
-				justifyContent: justifyContent,
-				padding: `0 ${effect3d ? '74rpx' : '24rpx'}`
-			}">
-			<block v-if="mode == 'rect'">
-				<view class="u-indicator-item-rect" :class="{ 'u-indicator-item-rect-active': index == uCurrent }" v-for="(item, index) in list"
-				 :key="index"></view>
-			</block>
-			<block v-if="mode == 'dot'">
-				<view class="u-indicator-item-dot" :class="{ 'u-indicator-item-dot-active': index == uCurrent }" v-for="(item, index) in list"
-				 :key="index"></view>
-			</block>
-			<block v-if="mode == 'round'">
-				<view class="u-indicator-item-round" :class="{ 'u-indicator-item-round-active': index == uCurrent }" v-for="(item, index) in list"
-				 :key="index"></view>
-			</block>
-			<block v-if="mode == 'number'">
-				<view class="u-indicator-item-number">{{ uCurrent + 1 }}/{{ list.length }}</view>
-			</block>
-		</view>
-	</view>
-</template>
-
-<script>
-	/**
-	 * swiper 轮播图
-	 * @description 该组件一般用于导航轮播,广告展示等场景,可开箱即用
-	 * @tutorial https://www.uviewui.com/components/swiper.html
-	 * @property {Array} list 轮播图数据,见官网"基本使用"说明
-	 * @property {Boolean} title 是否显示标题文字,需要配合list参数,见官网说明(默认false)
-	 * @property {String} mode 指示器模式,见官网说明(默认round)
-	 * @property {String Number} height 轮播图组件高度,单位rpx(默认250)
-	 * @property {String} indicator-pos 指示器的位置(默认bottomCenter)
-	 * @property {Boolean} effect3d 是否开启3D效果(默认false)
-	 * @property {Boolean} autoplay 是否自动播放(默认true)
-	 * @property {String Number} interval 自动轮播时间间隔,单位ms(默认2500)
-	 * @property {Boolean} circular 是否衔接播放,见官网说明(默认true)
-	 * @property {String} bg-color 背景颜色(默认#f3f4f6)
-	 * @property {String Number} border-radius 轮播图圆角值,单位rpx(默认8)
-	 * @property {Object} title-style 自定义标题样式
-	 * @property {String Number} effect3d-previous-margin mode = true模式的情况下,激活项与前后项之间的距离,单位rpx(默认50)
-	 * @property {String} img-mode 图片的裁剪模式,详见image组件裁剪模式(默认aspectFill)
-	 * @event {Function} click 点击轮播图时触发
-	 * @example <u-swiper :list="list" mode="dot" indicator-pos="bottomRight"></u-swiper>
-	 */
-	export default {
-		name: "u-swiper",
-		props: {
-			// 轮播图的数据,格式如:[{image: 'xxxx', title: 'xxxx'},{image: 'yyyy', title: 'yyyy'}],其中title字段可选
-			list: {
-				type: Array,
-				default () {
-					return [];
-				}
-			},
-			// 是否显示title标题
-			title: {
-				type: Boolean,
-				default: false
-			},
-			// 用户自定义的指示器的样式
-			indicator: {
-				type: Object,
-				default () {
-					return {};
-				}
-			},
-			// 圆角值
-			borderRadius: {
-				type: [Number, String],
-				default: 8
-			},
-			// 隔多久自动切换
-			interval: {
-				type: [String, Number],
-				default: 3000
-			},
-			// 指示器的模式,rect|dot|number|round
-			mode: {
-				type: String,
-				default: 'round'
-			},
-			// list的高度,单位rpx
-			height: {
-				type: [Number, String],
-				default: 250
-			},
-			// 指示器的位置,topLeft|topCenter|topRight|bottomLeft|bottomCenter|bottomRight
-			indicatorPos: {
-				type: String,
-				default: 'bottomCenter'
-			},
-			// 是否开启缩放效果
-			effect3d: {
-				type: Boolean,
-				default: false
-			},
-			// 3D模式的情况下,激活item与前后item之间的距离,单位rpx
-			effect3dPreviousMargin: {
-				type: [Number, String],
-				default: 50
-			},
-			// 是否自动播放
-			autoplay: {
-				type: Boolean,
-				default: true
-			},
-			// 自动轮播时间间隔,单位ms
-			duration: {
-				type: [Number, String],
-				default: 500
-			},
-			// 是否衔接滑动,即到最后一张时接着滑动,是否自动切换到第一张
-			circular: {
-				type: Boolean,
-				default: true
-			},
-			// 图片的裁剪模式 
-			imgMode: {
-				type: String,
-				default: 'aspectFill'
-			},
-			// 从list数组中读取的图片的属性名
-			name: {
-				type: String,
-				default: 'image'
-			},
-			// 背景颜色
-			bgColor: {
-				type: String,
-				default: '#f3f4f6'
-			},
-			// 初始化时,默认显示第几项
-			current: {
-				type: [Number, String],
-				default: 0
-			},
-			// 标题的样式,对象形式
-			titleStyle: {
-				type: Object,
-				default() {
-					return {}
-				}
-			}
-		},
-		watch: {
-			// 如果外部的list发生变化,判断长度是否被修改,如果前后长度不一致,重置uCurrent值,避免溢出
-			list(nVal, oVal) {
-				if(nVal.length !== oVal.length) this.uCurrent = 0;
-			},
-			// 监听外部current的变化,实时修改内部依赖于此测uCurrent值,如果更新了current,而不是更新uCurrent,
-			// 就会错乱,因为指示器是依赖于uCurrent的
-			current(n) {
-				this.uCurrent = n;
-			}
-		},
-		data() {
-			return {
-				uCurrent: this.current // 当前活跃的swiper-item的index
-			};
-		},
-		computed: {
-			justifyContent() {
-				if (this.indicatorPos == 'topLeft' || this.indicatorPos == 'bottomLeft') return 'flex-start';
-				if (this.indicatorPos == 'topCenter' || this.indicatorPos == 'bottomCenter') return 'center';
-				if (this.indicatorPos == 'topRight' || this.indicatorPos == 'bottomRight') return 'flex-end';
-			},
-			titlePaddingBottom() {
-				let tmp = 0;
-				if (this.mode == 'none') return '12rpx';
-				if (['bottomLeft', 'bottomCenter', 'bottomRight'].indexOf(this.indicatorPos) >= 0 && this.mode == 'number') {
-					tmp = '60rpx';
-				} else if (['bottomLeft', 'bottomCenter', 'bottomRight'].indexOf(this.indicatorPos) >= 0 && this.mode != 'number') {
-					tmp = '40rpx';
-				} else {
-					tmp = '12rpx';
-				}
-				return tmp;
-			},
-			// 因为uni的swiper组件的current参数只接受Number类型,这里做一个转换
-			elCurrent() {
-				return Number(this.current);
-			}
-		},
-		methods: {
-			listClick(index) {
-				this.$emit('click', index);
-			},
-			change(e) {
-				let current = e.detail.current;
-				this.uCurrent = current;
-				// 发出change事件,表示当前自动切换的index,从0开始
-				this.$emit('change', current);
-			},
-			// 头条小程序不支持animationfinish事件,改由change事件
-			// 暂不监听此事件,因为不再给swiper绑定uCurrent属性
-			animationfinish(e) {
-				// #ifndef MP-TOUTIAO
-				// this.uCurrent = e.detail.current;
-				// #endif
-			}
-		}
-	};
-</script>
-
-<style lang="scss" scoped>
-	@import "../../libs/css/style.components.scss";
-	
-	.u-swiper-wrap {
-		position: relative;
-		overflow: hidden;
-		transform: translateY(0);
-	}
-
-	.u-swiper-image {
-		width: 100%;
-		will-change: transform;
-		height: 100%;
-		/* #ifndef APP-NVUE */
-		display: block;
-		/* #endif */
-		/* #ifdef H5 */
-		pointer-events: none;
-		/* #endif */
-	}
-
-	.u-swiper-indicator {
-		padding: 0 24rpx;
-		position: absolute;
-		@include vue-flex;
-		width: 100%;
-		z-index: 1;
-	}
-
-	.u-indicator-item-rect {
-		width: 26rpx;
-		height: 8rpx;
-		margin: 0 6rpx;
-		transition: all 0.5s;
-		background-color: rgba(0, 0, 0, 0.3);
-	}
-
-	.u-indicator-item-rect-active {
-		background-color: rgba(255, 255, 255, 0.8);
-	}
-
-	.u-indicator-item-dot {
-		width: 14rpx;
-		height: 14rpx;
-		margin: 0 6rpx;
-		border-radius: 20rpx;
-		transition: all 0.5s;
-		background-color: rgba(0, 0, 0, 0.3);
-	}
-
-	.u-indicator-item-dot-active {
-		background-color: rgba(255, 255, 255, 0.8);
-	}
-
-	.u-indicator-item-round {
-		width: 14rpx;
-		height: 14rpx;
-		margin: 0 6rpx;
-		border-radius: 20rpx;
-		transition: all 0.5s;
-		background-color: rgba(0, 0, 0, 0.3);
-	}
-
-	.u-indicator-item-round-active {
-		width: 34rpx;
-		background-color: rgba(255, 255, 255, 0.8);
-	}
-
-	.u-indicator-item-number {
-		padding: 6rpx 16rpx;
-		line-height: 1;
-		background-color: rgba(0, 0, 0, 0.3);
-		border-radius: 100rpx;
-		font-size: 26rpx;
-		color: rgba(255, 255, 255, 0.8);
-	}
-
-	.u-list-scale {
-		transform-origin: center center;
-	}
-
-	.u-list-image-wrap {
-		width: 100%;
-		height: 100%;
-		flex: 1;
-		transition: all 0.5s;
-		overflow: hidden;
-		box-sizing: content-box;
-		position: relative;
-	}
-
-	.u-swiper-title {
-		position: absolute;
-		background-color: rgba(0, 0, 0, 0.3);
-		bottom: 0;
-		left: 0;
-		width: 100%;
-		font-size: 28rpx;
-		padding: 12rpx 24rpx;
-		color: rgba(255, 255, 255, 0.9);
-	}
-
-	.u-swiper-item {
-		@include vue-flex;
-		overflow: hidden;
-		align-items: center;
-	}
-</style>

+ 0 - 83
uview-ui/components/u-time-line-item/u-time-line-item.vue

@@ -1,83 +0,0 @@
-<template>
-	<view class="u-time-axis-item">
-		<slot name="content" />
-		<view class="u-time-axis-node" :style="[nodeStyle]">
-			<slot name="node">
-				<view class="u-dot">
-				</view>
-			</slot>
-		</view>
-	</view>
-</template>
-
-<script>
-	/**
-	 * timeLineItem 时间轴Item
-	 * @description 时间轴组件一般用于物流信息展示,各种跟时间相关的记录等场景。(搭配u-time-line使用)
-	 * @tutorial https://www.uviewui.com/components/timeLine.html
-	 * @property {String} bg-color 左边节点的背景颜色,一般通过slot内容自定义背景颜色即可(默认#ffffff)
-	 * @property {String Number} node-top 节点左边图标绝对定位的top值,单位rpx
-	 * @example <u-time-line-item node-top="2">...</u-time-line-item>
-	 */
-	export default {
-		name: "u-time-line-item",
-		props: {
-			// 节点的背景颜色
-			bgColor: {
-				type: String,
-				default: "#ffffff"
-			},
-			// 节点左边图标绝对定位的top值
-			nodeTop: {
-				type: [String, Number],
-				default: ""
-			}
-		},
-		data() {
-			return {
-
-			}
-		},
-		computed: {
-			nodeStyle() {
-				let style = {
-					backgroundColor: this.bgColor,
-				};
-				if (this.nodeTop != "") style.top = this.nodeTop + 'rpx';
-				return style;
-			}
-		}
-	}
-</script>
-
-<style lang="scss" scoped>
-	@import "../../libs/css/style.components.scss";
-	
-	.u-time-axis-item {
-		@include vue-flex;
-		flex-direction: column;
-		width: 100%;
-		position: relative;
-		margin-bottom: 32rpx;
-	}
-
-	.u-time-axis-node {
-		position: absolute;
-		top: 12rpx;
-		left: -40rpx;
-		transform-origin: 0;
-		transform: translateX(-50%);
-		@include vue-flex;
-		align-items: center;
-		justify-content: center;
-		z-index: 1;
-		font-size: 24rpx;
-	}
-
-	.u-dot {
-		height: 16rpx;
-		width: 16rpx;
-		border-radius: 100rpx;
-		background: #ddd;
-	}
-</style>

+ 0 - 43
uview-ui/components/u-time-line/u-time-line.vue

@@ -1,43 +0,0 @@
-<template>
-	<view class="u-time-axis">
-		<slot />
-	</view>
-</template>
-
-<script>
-	/**
-	 * timeLine 时间轴
-	 * @description 时间轴组件一般用于物流信息展示,各种跟时间相关的记录等场景。
-	 * @tutorial https://www.uviewui.com/components/timeLine.html
-	 * @example <u-time-line></u-time-line>
-	 */
-	export default {
-		name: "u-time-line",
-		data() {
-			return {
-
-			}
-		}
-	}
-</script>
-
-<style lang="scss" scoped>
-	@import "../../libs/css/style.components.scss";
-	
-	.u-time-axis {
-		padding-left: 40rpx;
-		position: relative;
-	}
-
-	.u-time-axis::before {
-		content: " ";
-		position: absolute;
-		left: 0;
-		top: 12rpx;
-		width: 1px;
-		bottom: 0;
-		border-left: 1px solid #ddd;
-		transform-origin: 0 0;
-		transform: scaleX(0.5);
-	}
-</style>

+ 0 - 220
uview-ui/components/u-toast/u-toast.vue

@@ -1,220 +0,0 @@
-<template>
-	<view class="u-toast" :class="[isShow ? 'u-show' : '', 'u-type-' + tmpConfig.type, 'u-position-' + tmpConfig.position]" :style="{
-		zIndex: uZIndex
-	}">
-		<view class="u-icon-wrap">
-			<u-icon v-if="tmpConfig.icon" class="u-icon" :name="iconName" :size="30" :color="tmpConfig.type"></u-icon>
-		</view>
-		<text class="u-text">{{tmpConfig.title}}</text>
-	</view>
-</template>
-
-<script>
-	/**
-	 * toast 消息提示
-	 * @description 此组件表现形式类似uni的uni.showToastAPI,但也有不同的地方。
-	 * @tutorial https://www.uviewui.com/components/toast.html
-	 * @property {String} z-index toast展示时的z-index值
-	 * @event {Function} show 显示toast,如需一进入页面就显示toast,请在onReady生命周期调用
-	 * @example <u-toast ref="uToast" />
-	 */
-	export default {
-		name: "u-toast",
-		props: {
-			// z-index值
-			zIndex: {
-				type: [Number, String],
-				default: ''
-			},
-		},
-		data() {
-			return {
-				isShow: false,
-				timer: null, // 定时器
-				config: {
-					params: {}, // URL跳转的参数,对象
-					title: '', // 显示文本
-					type: '', // 主题类型,primary,success,error,warning,black
-					duration: 2000, // 显示的时间,毫秒
-					isTab: false, // 是否跳转tab页面
-					url: '', // toast消失后是否跳转页面,有则跳转,优先级高于back参数
-					icon: true, // 显示的图标
-					position: 'center', // toast出现的位置
-					callback: null, // 执行完后的回调函数
-					back: false, // 结束toast是否自动返回上一页
-				},
-				tmpConfig: {}, // 将用户配置和内置配置合并后的临时配置变量
-			};
-		},
-		computed: {
-			iconName() {
-				// 只有不为none,并且type为error|warning|succes|info时候,才显示图标
-				if (['error', 'warning', 'success', 'info'].indexOf(this.tmpConfig.type) >= 0 && this.tmpConfig.icon) {
-					let icon = this.$u.type2icon(this.tmpConfig.type);
-					return icon;
-				}
-			},
-			uZIndex() {
-				// 显示toast时候,如果用户有传递z-index值,有限使用
-				return this.isShow ? (this.zIndex ? this.zIndex : this.$u.zIndex.toast) : '999999';
-			}
-		},
-		methods: {
-			// 显示toast组件,由父组件通过this.$refs.xxx.show(options)形式调用
-			show(options) {
-				// 不降结果合并到this.config变量,避免多次条用u-toast,前后的配置造成混论
-				this.tmpConfig = this.$u.deepMerge(this.config, options);
-				if (this.timer) {
-					// 清除定时器
-					clearTimeout(this.timer);
-					this.timer = null;
-				}
-				this.isShow = true;
-				this.timer = setTimeout(() => {
-					// 倒计时结束,清除定时器,隐藏toast组件
-					this.isShow = false;
-					clearTimeout(this.timer);
-					this.timer = null;
-					// 判断是否存在callback方法,如果存在就执行
-					typeof(this.tmpConfig.callback) === 'function' && this.tmpConfig.callback();
-					this.timeEnd();
-				}, this.tmpConfig.duration);
-			},
-			// 隐藏toast组件,由父组件通过this.$refs.xxx.hide()形式调用
-			hide() {
-				this.isShow = false;
-				if (this.timer) {
-					// 清除定时器
-					clearTimeout(this.timer);
-					this.timer = null;
-				}
-			},
-			// 倒计时结束之后,进行的一些操作
-			timeEnd() {
-				// 如果带有url值,根据isTab为true或者false进行跳转
-				if (this.tmpConfig.url) {
-					// 如果url没有"/"开头,添加上,因为uni的路由跳转需要"/"开头
-					if (this.tmpConfig.url[0] != '/') this.tmpConfig.url = '/' + this.tmpConfig.url;
-					// 判断是否有传递显式的参数
-					if (Object.keys(this.tmpConfig.params).length) {
-						// 判断用户传递的url中,是否带有参数
-						// 使用正则匹配,主要依据是判断是否有"/","?","="等,如“/page/index/index?name=mary"
-						// 如果有params参数,转换后无需带上"?"
-						let query = '';
-						if (/.*\/.*\?.*=.*/.test(this.tmpConfig.url)) {
-							// object对象转为get类型的参数
-							query = this.$u.queryParams(this.tmpConfig.params, false);
-							this.tmpConfig.url = this.tmpConfig.url + "&" + query;
-						} else {
-							query = this.$u.queryParams(this.tmpConfig.params);
-							this.tmpConfig.url += query;
-						}
-					}
-					// 如果是跳转tab页面,就使用uni.switchTab
-					if (this.tmpConfig.isTab) {
-						uni.switchTab({
-							url: this.tmpConfig.url
-						});
-					} else {
-						uni.navigateTo({
-							url: this.tmpConfig.url
-						});
-					}
-				} else if(this.tmpConfig.back) {
-					// 回退到上一页
-					this.$u.route({
-						type: 'back'
-					})
-				}
-			}
-		}
-	};
-</script>
-
-<style lang="scss" scoped>
-	@import "../../libs/css/style.components.scss";
-	
-	.u-toast {
-		position: fixed;
-		z-index: -1;
-		transition: opacity 0.3s;
-		text-align: center;
-		color: #fff;
-		border-radius: 8rpx;
-		background: #585858;
-		@include vue-flex;
-		align-items: center;
-		justify-content: center;
-		font-size: 28rpx;
-		opacity: 0;
-		pointer-events: none;
-		padding: 18rpx 40rpx;
-	}
-
-	.u-toast.u-show {
-		opacity: 1;
-	}
-
-	.u-icon {
-		margin-right: 10rpx;
-		@include vue-flex;
-		align-items: center;
-		line-height: normal;
-	}
-
-	.u-position-center {
-		left: 50%;
-		top: 50%;
-		transform: translate(-50%,-50%);
-		/* #ifndef APP-NVUE */
-		max-width: 70%;
-		/* #endif */
-	}
-
-	.u-position-top {
-		left: 50%;
-		top: 20%;
-		transform: translate(-50%,-50%);
-	}
-
-	.u-position-bottom {
-		left: 50%;
-		bottom: 20%;
-		transform: translate(-50%,-50%);
-	}
-
-	.u-type-primary {
-		color: $u-type-primary;
-		background-color: $u-type-primary-light;
-		border: 1px solid rgb(215, 234, 254);
-	}
-
-	.u-type-success {
-		color: $u-type-success;
-		background-color: $u-type-success-light;
-		border: 1px solid #BEF5C8;
-	}
-
-	.u-type-error {
-		color: $u-type-error;
-		background-color: $u-type-error-light;
-		border: 1px solid #fde2e2;
-	}
-
-	.u-type-warning {
-		color: $u-type-warning;
-		background-color: $u-type-warning-light;
-		border: 1px solid #faecd8;
-	}
-
-	.u-type-info {
-		color: $u-type-info;
-		background-color: $u-type-info-light;
-		border: 1px solid #ebeef5;
-	}
-
-	.u-type-default {
-		color: #fff;
-		background-color: #585858;
-	}
-</style>

+ 0 - 121
uview-ui/components/u-top-tips/u-top-tips.vue

@@ -1,121 +0,0 @@
-<template>
-	<view class="u-tips" :class="['u-' + type, isShow ? 'u-tip-show' : '']" :style="{
-		top: navbarHeight + 'px',
-		zIndex: uZIndex
-	}">{{ title }}</view>
-</template>
-
-<script>
-	/**
-	 * topTips 顶部提示
-	 * @description 该组件一般用于页面顶部向下滑出一个提示,尔后自动收起的场景。
-	 * @tutorial https://www.uviewui.com/components/topTips.html
-	 * @property {String Number} navbar-height 导航栏高度(包含状态栏高度在内),单位PX
-	 * @property {String Number} z-index z-index值(默认975)
-	 * @example <u-top-tips ref="uTips"></u-top-tips>
-	 */
-	export default {
-		name: "u-top-tips",
-		props: {
-			// 导航栏高度,用于提示的初始化
-			navbarHeight: {
-				type: [Number, String],
-				// #ifndef H5
-				default: 0,
-				// #endif
-				// #ifdef H5
-				default: 44,
-				// #endif
-			},
-			// z-index值
-			zIndex: {
-				type: [Number, String],
-				default: ''
-			}
-		},
-		data() {
-			return {
-				timer: null, // 定时器
-				isShow: false, // 是否显示消息组件
-				title: '', // 组件中显示的消息内容
-				type: 'primary', // 消息的类型(颜色不同),primary,success,error,warning,info
-				duration: 2000, // 组件显示的时间,单位为毫秒
-			};
-		},
-		computed: {
-			uZIndex() {
-				return this.zIndex ? this.zIndex : this.$u.zIndex.topTips;
-			}
-		},
-		methods: {
-			show(config = {}) {
-				// 先清除定时器(可能是上一次定义的,需要清除了再开始新的)
-				clearTimeout(this.timer);
-				// 时间,内容,类型主题(type)等参数
-				if (config.duration) this.duration = config.duration;
-				if (config.type) this.type = config.type;
-				this.title = config.title;
-				this.isShow = true;
-				// 倒计时
-				this.timer = setTimeout(() => {
-					this.isShow = false;
-					clearTimeout(this.timer);
-					this.timer = null;
-				}, this.duration);
-			}
-		}
-	};
-</script>
-
-<style lang="scss" scoped>
-	@import "../../libs/css/style.components.scss";
-	
-	view {
-		box-sizing: border-box;
-	}
-
-	// 顶部弹出类型样式
-	.u-tips {
-		width: 100%;
-		position: fixed;
-		z-index: 1;
-		padding: 20rpx 30rpx;
-		color: #FFFFFF;
-		font-size: 28rpx;
-		left: 0;
-		right: 0;
-		@include vue-flex;
-		align-items: center;
-		justify-content: center;
-		opacity: 0;
-		// 此处为最核心点,translateY(-100%)意味着将其从Y轴隐藏(隐藏到顶部(h5)或者说导航栏(app)下面)
-		transform: translateY(-100%);
-		transition: all 0.35s linear;
-	}
-
-	.u-tip-show {
-		transform: translateY(0);
-		opacity: 1;
-		z-index: 99;
-	}
-
-	.u-primary {
-		background: $u-type-primary;
-	}
-
-	.u-success {
-		background: $u-type-success;
-	}
-
-	.u-warning {
-		background: $u-type-warning;
-	}
-
-	.u-error {
-		background: $u-type-error;
-	}
-
-	.u-info {
-		background: $u-type-info;
-	}
-</style>

+ 0 - 25
uview-ui/components/u-tr/u-tr.vue

@@ -1,25 +0,0 @@
-<template>
-	<view class="u-tr">
-		<slot></slot>
-	</view>
-</template>
-
-<script>
-	/**
-	 * tr 表格行标签
-	 * @description 表格组件一般用于展示大量结构化数据的场景(搭配<u-table>使用)
-	 * @tutorial https://www.uviewui.com/components/table.html
-	 * @example <u-tr></u-tr>
-	 */
-	export default {
-		name: "u-tr",
-	}
-</script>
-
-<style lang="scss" scoped>
-	@import "../../libs/css/style.components.scss";
-	
-	.u-tr {
-		@include vue-flex;
-	}
-</style>

+ 0 - 654
uview-ui/components/u-upload/u-upload.vue

@@ -1,654 +0,0 @@
-<template>
-	<view class="u-upload" v-if="!disabled">
-		<view
-			v-if="showUploadList"
-			class="u-list-item u-preview-wrap"
-			v-for="(item, index) in lists"
-			:key="index"
-			:style="{
-				width: $u.addUnit(width),
-				height: $u.addUnit(height)
-			}"
-		>
-			<view
-				v-if="deletable"
-				class="u-delete-icon"
-				@tap.stop="deleteItem(index)"
-				:style="{
-					background: delBgColor
-				}"
-			>
-				<u-icon class="u-icon" :name="delIcon" size="20" :color="delColor"></u-icon>
-			</view>
-			<u-line-progress
-				v-if="showProgress && item.progress > 0 && !item.error"
-				:show-percent="false"
-				height="16"
-				class="u-progress"
-				:percent="item.progress"
-			></u-line-progress>
-			<view @tap.stop="retry(index)" v-if="item.error" class="u-error-btn">点击重试</view>
-			<image @tap.stop="doPreviewImage(item.url || item.path, index)" class="u-preview-image" v-if="!item.isImage" :src="item.url || item.path" :mode="imageMode"></image>
-		</view>
-		<slot name="file" :file="lists"></slot>
-		<view style="display: inline-block;" @tap="selectFile" v-if="maxCount > lists.length">
-			<slot name="addBtn"></slot>
-			<view
-				v-if="!customBtn"
-				class="u-list-item u-add-wrap"
-				hover-class="u-add-wrap__hover"
-				hover-stay-time="150"
-				:style="{
-					width: $u.addUnit(width),
-					height: $u.addUnit(height)
-				}"
-			>
-				<u-icon name="plus" class="u-add-btn" size="40"></u-icon>
-				<view class="u-add-tips">{{ uploadText }}</view>
-			</view>
-		</view>
-	</view>
-</template>
-
-<script>
-/**
- * upload 图片上传
- * @description 该组件用于上传图片场景
- * @tutorial https://www.uviewui.com/components/upload.html
- * @property {String} action 服务器上传地址
- * @property {String Number} max-count 最大选择图片的数量(默认99)
- * @property {Boolean} custom-btn 如果需要自定义选择图片的按钮,设置为true(默认false)
- * @property {Boolean} show-progress 是否显示进度条(默认true)
- * @property {Boolean} disabled 是否启用(显示/移仓)组件(默认false)
- * @property {String} image-mode 预览图片等显示模式,可选值为uni的image的mode属性值(默认aspectFill)
- * @property {String} del-icon 右上角删除图标名称,只能为uView内置图标
- * @property {String} del-bg-color 右上角关闭按钮的背景颜色
- * @property {String | Number} index 在各个回调事件中的最后一个参数返回,用于区别是哪一个组件的事件
- * @property {String} del-color 右上角关闭按钮图标的颜色
- * @property {Object} header 上传携带的头信息,对象形式
- * @property {Object} form-data 上传额外携带的参数
- * @property {String} name 上传文件的字段名,供后端获取使用(默认file)
- * @property {Array<String>} size-type original 原图,compressed 压缩图,默认二者都有(默认['original', 'compressed'])
- * @property {Array<String>} source-type 选择图片的来源,album-从相册选图,camera-使用相机,默认二者都有(默认['album', 'camera'])
- * @property {Boolean} preview-full-image	是否可以通过uni.previewImage预览已选择的图片(默认true)
- * @property {Boolean} multiple	是否开启图片多选,部分安卓机型不支持(默认true)
- * @property {Boolean} deletable 是否显示删除图片的按钮(默认true)
- * @property {String Number} max-size 选择单个文件的最大大小,单位B(byte),默认不限制(默认Number.MAX_VALUE)
- * @property {Array<Object>} file-list 默认显示的图片列表,数组元素为对象,必须提供url属性
- * @property {Boolean} upload-text 选择图片按钮的提示文字(默认“选择图片”)
- * @property {Boolean} auto-upload 选择完图片是否自动上传,见上方说明(默认true)
- * @property {Boolean} show-tips 特殊情况下是否自动提示toast,见上方说明(默认true)
- * @property {Boolean} show-upload-list 是否显示组件内部的图片预览(默认true)
- * @event {Function} on-oversize 图片大小超出最大允许大小
- * @event {Function} on-preview 全屏预览图片时触发
- * @event {Function} on-remove 移除图片时触发
- * @event {Function} on-success 图片上传成功时触发
- * @event {Function} on-change 图片上传后,无论成功或者失败都会触发
- * @event {Function} on-error 图片上传失败时触发
- * @event {Function} on-progress 图片上传过程中的进度变化过程触发
- * @event {Function} on-uploaded 所有图片上传完毕触发
- * @event {Function} on-choose-complete 每次选择图片后触发,只是让外部可以得知每次选择后,内部的文件列表
- * @example <u-upload :action="action" :file-list="fileList" ></u-upload>
- */
-export default {
-	name: 'u-upload',
-	props: {
-		//是否显示组件自带的图片预览功能
-		showUploadList: {
-			type: Boolean,
-			default: true
-		},
-		// 后端地址
-		action: {
-			type: String,
-			default: ''
-		},
-		// 最大上传数量
-		maxCount: {
-			type: [String, Number],
-			default: 52
-		},
-		//  是否显示进度条
-		showProgress: {
-			type: Boolean,
-			default: true
-		},
-		// 是否启用
-		disabled: {
-			type: Boolean,
-			default: false
-		},
-		// 预览上传的图片时的裁剪模式,和image组件mode属性一致
-		imageMode: {
-			type: String,
-			default: 'aspectFill'
-		},
-		// 头部信息
-		header: {
-			type: Object,
-			default() {
-				return {};
-			}
-		},
-		// 额外携带的参数
-		formData: {
-			type: Object,
-			default() {
-				return {};
-			}
-		},
-		// 上传的文件字段名
-		name: {
-			type: String,
-			default: 'file'
-		},
-		// 所选的图片的尺寸, 可选值为original compressed
-		sizeType: {
-			type: Array,
-			default() {
-				return ['original', 'compressed'];
-			}
-		},
-		sourceType: {
-			type: Array,
-			default() {
-				return ['album', 'camera'];
-			}
-		},
-		// 是否在点击预览图后展示全屏图片预览
-		previewFullImage: {
-			type: Boolean,
-			default: true
-		},
-		// 是否开启图片多选,部分安卓机型不支持
-		multiple: {
-			type: Boolean,
-			default: true
-		},
-		// 是否展示删除按钮
-		deletable: {
-			type: Boolean,
-			default: true
-		},
-		// 文件大小限制,单位为byte
-		maxSize: {
-			type: [String, Number],
-			default: Number.MAX_VALUE
-		},
-		// 显示已上传的文件列表
-		fileList: {
-			type: Array,
-			default() {
-				return [];
-			}
-		},
-		// 上传区域的提示文字
-		uploadText: {
-			type: String,
-			default: '选择图片'
-		},
-		// 是否自动上传
-		autoUpload: {
-			type: Boolean,
-			default: true
-		},
-		// 是否显示toast消息提示
-		showTips: {
-			type: Boolean,
-			default: true
-		},
-		// 是否通过slot自定义传入选择图标的按钮
-		customBtn: {
-			type: Boolean,
-			default: false
-		},
-		// 内部预览图片区域和选择图片按钮的区域宽度
-		width: {
-			type: [String, Number],
-			default: 200
-		},
-		// 内部预览图片区域和选择图片按钮的区域高度
-		height: {
-			type: [String, Number],
-			default: 200
-		},
-		// 右上角关闭按钮的背景颜色
-		delBgColor: {
-			type: String,
-			default: '#fa3534'
-		},
-		// 右上角关闭按钮的叉号图标的颜色
-		delColor: {
-			type: String,
-			default: '#ffffff'
-		},
-		// 右上角删除图标名称,只能为uView内置图标
-		delIcon: {
-			type: String,
-			default: 'close'
-		},
-		// 如果上传后的返回值为json字符串,是否自动转json
-		toJson: {
-			type: Boolean,
-			default: true
-		},
-		// 上传前的钩子,每个文件上传前都会执行
-		beforeUpload: {
-			type: Function,
-			default: null
-		},
-		// 移除文件前的钩子
-		beforeRemove: {
-			type: Function,
-			default: null
-		},
-		// 允许上传的图片后缀
-		limitType:{
-			type: Array,
-			default() {
-				// 支付宝小程序真机选择图片的后缀为"image"
-				// https://opendocs.alipay.com/mini/api/media-image
-				return ['png', 'jpg', 'jpeg', 'webp', 'gif', 'image'];
-			}
-		},
-		// 在各个回调事件中的最后一个参数返回,用于区别是哪一个组件的事件
-		index: {
-			type: [Number, String],
-			default: ''
-		}
-	},
-	mounted() {},
-	data() {
-		return {
-			lists: [],
-			isInCount: true,
-			uploading: false
-		};
-	},
-	watch: {
-		fileList: {
-			immediate: true,
-			handler(val) {
-				val.map(value => {
-					// 首先检查内部是否已经添加过这张图片,因为外部绑定了一个对象给fileList的话(对象引用),进行修改外部fileList
-					// 时,会触发watch,导致重新把原来的图片再次添加到this.lists
-					// 数组的some方法意思是,只要数组元素有任意一个元素条件符合,就返回true,而另一个数组的every方法的意思是数组所有元素都符合条件才返回true
-					let tmp = this.lists.some(val => {
-						return val.url == value.url;
-					})
-					// 如果内部没有这个图片(tmp为false),则添加到内部
-					!tmp && this.lists.push({ url: value.url, error: false, progress: 100 });
-				});
-			}
-		},
-		// 监听lists的变化,发出事件
-		lists(n) {
-			this.$emit('on-list-change', n, this.index);
-		}
-	},
-	methods: {
-		// 清除列表
-		clear() {
-			this.lists = [];
-		},
-		// 重新上传队列中上传失败的所有文件
-		reUpload() {
-			this.uploadFile();
-		},
-		// 选择图片
-		selectFile() {
-			if (this.disabled) return;
-			const { name = '', maxCount, multiple, maxSize, sizeType, lists, camera, compressed, maxDuration, sourceType } = this;
-			let chooseFile = null;
-			const newMaxCount = maxCount - lists.length;
-			// 设置为只选择图片的时候使用 chooseImage 来实现
-			chooseFile = new Promise((resolve, reject) => {
-				uni.chooseImage({
-					count: multiple ? (newMaxCount > 9 ? 9 : newMaxCount) : 1,
-					sourceType: sourceType,
-					sizeType,
-					success: resolve,
-					fail: reject
-				});
-			});
-			chooseFile
-				.then(res => {
-					let file = null;
-					let listOldLength = this.lists.length;
-					res.tempFiles.map((val, index) => {
-						// 检查文件后缀是否允许,如果不在this.limitType内,就会返回false
-						if(!this.checkFileExt(val)) return ;
-						
-						// 如果是非多选,index大于等于1或者超出最大限制数量时,不处理
-						if (!multiple && index >= 1) return;
-						if (val.size > maxSize) {
-							this.$emit('on-oversize', val, this.lists, this.index);
-							this.showToast('超出允许的文件大小');
-						} else {
-							if (maxCount <= lists.length) {
-								this.$emit('on-exceed', val, this.lists, this.index);
-								this.showToast('超出最大允许的文件个数');
-								return;
-							}
-							lists.push({
-								url: val.path,
-								progress: 0,
-								error: false,
-								file: val
-							});
-						}
-					});
-					// 每次图片选择完,抛出一个事件,并将当前内部选择的图片数组抛出去
-					this.$emit('on-choose-complete', this.lists, this.index);
-					if (this.autoUpload) this.uploadFile(listOldLength);
-				})
-				.catch(error => {
-					this.$emit('on-choose-fail', error);
-				});
-		},
-		// 提示用户消息
-		showToast(message, force = false) {
-			if (this.showTips || force) {
-				uni.showToast({
-					title: message,
-					icon: 'none'
-				});
-			}
-		},
-		// 该方法供用户通过ref调用,手动上传
-		upload() {
-			this.uploadFile();
-		},
-		// 对失败的图片重新上传
-		retry(index) {
-			this.lists[index].progress = 0;
-			this.lists[index].error = false;
-			this.lists[index].response = null;
-			uni.showLoading({
-				title: '重新上传'
-			});
-			this.uploadFile(index);
-		},
-		// 上传图片
-		async uploadFile(index = 0) {
-			if (this.disabled) return;
-			if (this.uploading) return;
-			// 全部上传完成
-			if (index >= this.lists.length) {
-				this.$emit('on-uploaded', this.lists, this.index);
-				return;
-			}
-			// 检查是否是已上传或者正在上传中
-			if (this.lists[index].progress == 100) {
-				if (this.autoUpload == false) this.uploadFile(index + 1);
-				return;
-			}
-			// 执行before-upload钩子
-			if(this.beforeUpload && typeof(this.beforeUpload) === 'function') {
-				// 执行回调,同时传入索引和文件列表当作参数
-				// 在微信,支付宝等环境(H5正常),会导致父组件定义的customBack()函数体中的this变成子组件的this
-				// 通过bind()方法,绑定父组件的this,让this.customBack()的this为父组件的上下文
-				// 因为upload组件可能会被嵌套在其他组件内,比如u-form,这时this.$parent其实为u-form的this,
-				// 非页面的this,所以这里需要往上历遍,一直寻找到最顶端的$parent,这里用了this.$u.$parent.call(this)
-				// 明白意思即可,无需纠结this.$u.$parent.call(this)的细节
-				let beforeResponse = this.beforeUpload.bind(this.$u.$parent.call(this))(index, this.lists);
-				// 判断是否返回了promise
-				if (!!beforeResponse && typeof beforeResponse.then === 'function') {
-					await beforeResponse.then(res => {
-						// promise返回成功,不进行动作,继续上传
-					}).catch(err => {
-						// 进入catch回调的话,继续下一张
-						return this.uploadFile(index + 1);
-					})
-				} else if(beforeResponse === false) {
-					// 如果返回false,继续下一张图片的上传
-					return this.uploadFile(index + 1);
-				} else {
-					// 此处为返回"true"的情形,这里不写代码,就跳过此处,继续执行当前的上传逻辑
-				}
-			}
-			// 检查上传地址
-			if (!this.action) {
-				this.showToast('请配置上传地址', true);
-				return;
-			}
-			this.lists[index].error = false;
-			this.uploading = true;
-			// 创建上传对象
-			const task = uni.uploadFile({
-				url: this.action,
-				filePath: this.lists[index].url,
-				name: this.name,
-				formData: this.formData,
-				header: this.header,
-				success: res => {
-					// 判断是否json字符串,将其转为json格式
-					let data = this.toJson && this.$u.test.jsonString(res.data) ? JSON.parse(res.data) : res.data;
-					if (![200, 201, 204].includes(res.statusCode)) {
-						this.uploadError(index, data);
-					} else {
-						// 上传成功
-						this.lists[index].response = data;
-						this.lists[index].progress = 100;
-						this.lists[index].error = false;
-						this.$emit('on-success', data, index, this.lists, this.index);
-					}
-				},
-				fail: e => {
-					this.uploadError(index, e);
-				},
-				complete: res => {
-					uni.hideLoading();
-					this.uploading = false;
-					this.uploadFile(index + 1);
-					this.$emit('on-change', res, index, this.lists, this.index);
-				}
-			});
-			task.onProgressUpdate(res => {
-				if (res.progress > 0) {
-					this.lists[index].progress = res.progress;
-					this.$emit('on-progress', res, index, this.lists, this.index);
-				}
-			});
-		},
-		// 上传失败
-		uploadError(index, err) {
-			this.lists[index].progress = 0;
-			this.lists[index].error = true;
-			this.lists[index].response = null;
-			this.$emit('on-error', err, index, this.lists, this.index);
-			this.showToast('上传失败,请重试');
-		},
-		// 删除一个图片
-		deleteItem(index) {
-			uni.showModal({
-				title: '提示',
-				content: '您确定要删除此项吗?',
-				success: async (res) => {
-					if (res.confirm) {
-						// 先检查是否有定义before-remove移除前钩子
-						// 执行before-remove钩子
-						if(this.beforeRemove && typeof(this.beforeRemove) === 'function') {
-							// 此处钩子执行 原理同before-remove参数,见上方注释
-							let beforeResponse = this.beforeRemove.bind(this.$u.$parent.call(this))(index, this.lists);
-							// 判断是否返回了promise
-							if (!!beforeResponse && typeof beforeResponse.then === 'function') {
-								await beforeResponse.then(res => {
-									// promise返回成功,不进行动作,继续上传
-									this.handlerDeleteItem(index);
-								}).catch(err => {
-									// 如果进入promise的reject,终止删除操作
-									this.showToast('已终止移除');
-								})
-							} else if(beforeResponse === false) {
-								// 返回false,终止删除
-								this.showToast('已终止移除');
-							} else {
-								// 如果返回true,执行删除操作
-								this.handlerDeleteItem(index);
-							}
-						} else {
-							// 如果不存在before-remove钩子,
-							this.handlerDeleteItem(index);
-						}
-					}
-				}
-			});
-		},
-		// 执行移除图片的动作,上方代码只是判断是否可以移除
-		handlerDeleteItem(index) {
-			// 如果文件正在上传中,终止上传任务,进度在0 < progress < 100则意味着正在上传
-			if (this.lists[index].process < 100 && this.lists[index].process > 0) {
-				typeof this.lists[index].uploadTask != 'undefined' && this.lists[index].uploadTask.abort();
-			}
-			this.lists.splice(index, 1);
-			this.$forceUpdate();
-			this.$emit('on-remove', index, this.lists, this.index);
-			this.showToast('移除成功');
-		},
-		// 用户通过ref手动的形式,移除一张图片
-		remove(index) {
-			// 判断索引的合法范围
-			if (index >= 0 && index < this.lists.length) {
-				this.lists.splice(index, 1);
-				this.$emit('on-list-change', this.lists, this.index);
-			}
-		},
-		// 预览图片
-		doPreviewImage(url, index) {
-			if (!this.previewFullImage) return;
-			const images = this.lists.map(item => item.url || item.path);
-			uni.previewImage({
-				urls: images,
-				current: url,
-				success: () => {
-					this.$emit('on-preview', url, this.lists, this.index);
-				},
-				fail: () => {
-					uni.showToast({
-						title: '预览图片失败',
-						icon: 'none'
-					});
-				}
-			});
-		},
-		// 判断文件后缀是否允许
-		checkFileExt(file) {
-			// 检查是否在允许的后缀中
-			let noArrowExt = false;
-			// 获取后缀名
-			let fileExt = '';
-			const reg = /.+\./;
-			// 如果是H5,需要从name中判断
-			// #ifdef H5
-			fileExt = file.name.replace(reg, "").toLowerCase();
-			// #endif
-			// 非H5,需要从path中读取后缀
-			// #ifndef H5
-			fileExt = file.path.replace(reg, "").toLowerCase();
-			// #endif
-			// 使用数组的some方法,只要符合limitType中的一个,就返回true
-			noArrowExt = this.limitType.some(ext => {
-				// 转为小写
-				return ext.toLowerCase() === fileExt;
-			})
-			if(!noArrowExt) this.showToast(`不允许选择${fileExt}格式的文件`);
-			return noArrowExt;
-		}
-	}
-};
-</script>
-
-<style lang="scss" scoped>
-@import '../../libs/css/style.components.scss';
-
-.u-upload {
-	@include vue-flex;
-	flex-wrap: wrap;
-	align-items: center;
-}
-
-.u-list-item {
-	width: 200rpx;
-	height: 200rpx;
-	overflow: hidden;
-	margin: 10rpx;
-	background: rgb(244, 245, 246);
-	position: relative;
-	border-radius: 10rpx;
-	/* #ifndef APP-NVUE */
-	display: flex;
-	/* #endif */
-	align-items: center;
-	justify-content: center;
-}
-
-.u-preview-wrap {
-	border: 1px solid rgb(235, 236, 238);
-}
-
-.u-add-wrap {
-	flex-direction: column;
-	color: $u-content-color;
-	font-size: 26rpx;
-}
-
-.u-add-tips {
-	margin-top: 20rpx;
-	line-height: 40rpx;
-}
-
-.u-add-wrap__hover {
-	background-color: rgb(235, 236, 238);
-}
-
-.u-preview-image {
-	display: block;
-	width: 100%;
-	height: 100%;
-	border-radius: 10rpx;
-}
-
-.u-delete-icon {
-	position: absolute;
-	top: 10rpx;
-	right: 10rpx;
-	z-index: 10;
-	background-color: $u-type-error;
-	border-radius: 100rpx;
-	width: 44rpx;
-	height: 44rpx;
-	@include vue-flex;
-	align-items: center;
-	justify-content: center;
-}
-
-.u-icon {
-	@include vue-flex;
-	align-items: center;
-	justify-content: center;
-}
-
-.u-progress {
-	position: absolute;
-	bottom: 10rpx;
-	left: 8rpx;
-	right: 8rpx;
-	z-index: 9;
-	width: auto;
-}
-
-.u-error-btn {
-	color: #ffffff;
-	background-color: $u-type-error;
-	font-size: 20rpx;
-	padding: 4px 0;
-	text-align: center;
-	position: absolute;
-	bottom: 0;
-	left: 0;
-	right: 0;
-	z-index: 9;
-	line-height: 1;
-}
-</style>