萤火科技 1 рік тому
батько
коміт
a06cf89f57
4 змінених файлів з 177 додано та 138 видалено
  1. 2 37
      components/page/diyComponents/mixin.js
  2. 9 5
      components/privacy-popup/index.vue
  3. 43 1
      core/app.js
  4. 123 95
      utils/iconfont.scss

+ 2 - 37
components/page/diyComponents/mixin.js

@@ -1,3 +1,4 @@
+import { onLink } from '@/core/app'
 import { urlDecode } from '@/utils/util'
 
 export default {
@@ -10,43 +11,7 @@ export default {
      * link对象点击事件
      * 支持tabBar页面
      */
-    onLink(linkObj) {
-      if (!linkObj) return false
-      // 跳转到指定页面
-      if (linkObj.type === 'PAGE') {
-        this.$navTo(linkObj.param.path, linkObj.param.query)
-      }
-      // 跳转到自定义路径
-      if (linkObj.type === 'CUSTOM') {
-        this.$navTo(linkObj.param.path, urlDecode(linkObj.param.queryStr))
-      }
-      // 跳转到微信小程序
-      // #ifdef MP-WEIXIN
-      if (linkObj.type === 'MP-WEIXIN') {
-        uni.navigateToMiniProgram({
-          appId: linkObj.param.appId,
-          path: linkObj.param.path
-        })
-      }
-      // #endif
-      // 跳转到H5外部链接
-      if (linkObj.type === 'URL') {
-        // #ifdef H5
-        window.open(linkObj.param.url)
-        // #endif
-        // #ifdef APP-PLUS
-        plus.runtime.openWeb(linkObj.param.url)
-        // #endif
-        // #ifdef MP
-        uni.setClipboardData({
-          data: linkObj.param.url,
-          success: () => this.$toast('链接已复制'),
-          fail: ({ errMsg }) => this.$toast('复制失败 ' + errMsg)
-        })
-        // #endif
-      }
-      return true
-    }
+    onLink
   },
 
 }

+ 9 - 5
components/privacy-popup/index.vue

@@ -30,6 +30,7 @@
   import StoreModel from '@/common/model/Store'
 
   export default {
+    emits: ['end'],
     props: {
       // 弹出隐私窗口时是否隐藏tabbar
       hideTabBar: {
@@ -47,9 +48,9 @@
       }
     },
 
-    created() {
+    async created() {
       // 获取商城基本信息
-      this.getStoreInfo()
+      await this.getStoreInfo()
       // #ifdef MP-WEIXIN
       // 弹出隐私协议 (微信小程序端)
       this.needAuthorization()
@@ -59,8 +60,8 @@
     methods: {
 
       // 获取商城基本信息
-      getStoreInfo() {
-        StoreModel.storeInfo().then(storeInfo => this.storeInfo = storeInfo)
+      async getStoreInfo() {
+        await StoreModel.storeInfo().then(storeInfo => this.storeInfo = storeInfo)
       },
 
       // 弹出隐私协议 (微信小程序端)
@@ -73,11 +74,13 @@
             if (needAuthorization) {
               app.showPrivacy = true
               app.hideTabBar && uni.hideTabBar()
+            } else {
+              app.$emit('end')
             }
           }
         })
       },
-      
+
       // 查看隐私协议内容
       handlePrivacyContract() {
         uni.openPrivacyContract()
@@ -93,6 +96,7 @@
 
         this.hideTabBar && uni.showTabBar()
         this.showPrivacy = false
+        this.$emit('end')
       },
 
       // 用户不同意隐私协议

+ 43 - 1
core/app.js

@@ -247,4 +247,46 @@ export const checkModules = moduleKeys => {
  */
 export const filterModules = array => {
   return array.filter(item => !item.moduleKey || checkModuleKey(item.moduleKey))
-}
+}
+
+/**
+ * link对象点击事件
+ * 支持tabBar页面
+ */
+export const onLink = linkObj => {
+  if (!linkObj) return false
+  // 跳转到指定页面
+  if (linkObj.type === 'PAGE') {
+    navTo(linkObj.param.path, linkObj.param.query)
+  }
+  // 跳转到自定义路径
+  if (linkObj.type === 'CUSTOM') {
+    navTo(linkObj.param.path, util.urlDecode(linkObj.param.queryStr))
+  }
+  // 跳转到微信小程序
+  // #ifdef MP-WEIXIN
+  if (linkObj.type === 'MP-WEIXIN') {
+    uni.navigateToMiniProgram({
+      appId: linkObj.param.appId,
+      path: linkObj.param.path
+    })
+  }
+  // #endif
+  // 跳转到H5外部链接
+  if (linkObj.type === 'URL') {
+    // #ifdef H5
+    window.open(linkObj.param.url)
+    // #endif
+    // #ifdef APP-PLUS
+    plus.runtime.openWeb(linkObj.param.url)
+    // #endif
+    // #ifdef MP
+    uni.setClipboardData({
+      data: linkObj.param.url,
+      success: () => showToast('链接已复制'),
+      fail: ({ errMsg }) => showToast('复制失败 ' + errMsg)
+    })
+    // #endif
+  }
+  return true
+}

+ 123 - 95
utils/iconfont.scss

@@ -1,354 +1,382 @@
 @font-face {
-  font-family: "iconfont"; /* Project id 2282770 */
-  src: url('https://at.alicdn.com/t/c/font_2282770_14425t4oa60f.woff2?t=1673327595201') format('woff2'),
-       url('https://at.alicdn.com/t/c/font_2282770_14425t4oa60f.woff?t=1673327595201') format('woff'),
-       url('https://at.alicdn.com/t/c/font_2282770_14425t4oa60f.ttf?t=1673327595201') format('truetype'),
-       url('https://at.alicdn.com/t/c/font_2282770_14425t4oa60f.svg?t=1673327595201#iconfont') format('svg');
+  font-family: 'iconfont';
+  src: url('https://at.alicdn.com/t/c/font_2282770_528zm6himwn.woff2?t=1731597843561') format('woff2'),
+    url('https://at.alicdn.com/t/c/font_2282770_528zm6himwn.woff?t=1731597843561') format('woff'),
+    url('https://at.alicdn.com/t/c/font_2282770_528zm6himwn.ttf?t=1731597843561') format('truetype'),
+    url('https://at.alicdn.com/t/c/font_2282770_528zm6himwn.svg?t=1731597843561#iconfont') format('svg');
 }
 
 .iconfont {
-  font-family: "iconfont" !important;
+  font-family: 'iconfont' !important;
   font-style: normal;
   -webkit-font-smoothing: antialiased;
   -moz-osx-font-smoothing: grayscale;
 }
 
-.icon-order-c:before {
-  content: "\e653";
+.icon-jiagou2:before {
+  content: '\e6df';
 }
 
-.icon-shouye2:before {
-  content: "\e60d";
+.icon-jiagou1:before {
+  content: '\e690';
 }
 
 .icon-jiagou3:before {
-  content: "\e69c";
+  content: '\e623';
 }
 
-.icon-jiagou2:before {
-  content: "\e602";
+.icon-plus:before {
+  content: '\eaf3';
 }
 
-.icon-jiagou1:before {
-  content: "\e626";
+.icon-arc:before {
+  content: '\e62e';
+}
+
+.icon-share:before {
+  content: '\e6e0';
+}
+
+.icon-offline-pay:before {
+  content: '\e66d';
+}
+
+.icon-collected:before {
+  content: '\e6da';
+}
+
+.icon-collect:before {
+  content: '\e614';
+}
+
+.icon-jingli:before {
+  content: '\e6c9';
+}
+
+.icon-order-c:before {
+  content: '\e653';
+}
+
+.icon-shouye2:before {
+  content: '\e60d';
 }
 
 .icon-youhuiquan:before {
-  content: "\e672";
+  content: '\e672';
 }
 
 .icon-fenxiao:before {
-  content: "\e70e";
+  content: '\e70e';
 }
 
 .icon-kanjia:before {
-  content: "\e735";
+  content: '\e735';
 }
 
 .icon-pintuan:before {
-  content: "\e671";
+  content: '\e671';
 }
 
 .icon-alipay:before {
-  content: "\e6d3";
+  content: '\e6d3';
 }
 
 .icon-balance-pay:before {
-  content: "\e6d4";
+  content: '\e6d4';
 }
 
 .icon-wechat-pay:before {
-  content: "\e6d5";
+  content: '\e6d5';
 }
 
 .icon-poster:before {
-  content: "\e61a";
+  content: '\e61a';
 }
 
 .icon-weixin:before {
-  content: "\e60e";
+  content: '\e60e';
 }
 
 .icon-qzone:before {
-  content: "\e642";
+  content: '\e642';
 }
 
 .icon-link:before {
-  content: "\e613";
+  content: '\e613';
 }
 
 .icon-weibo:before {
-  content: "\e62a";
+  content: '\e62a';
 }
 
 .icon-qq:before {
-  content: "\e612";
+  content: '\e612';
 }
 
 .icon-timeline:before {
-  content: "\e812";
+  content: '\e812';
 }
 
 .icon-fenxiao1:before {
-  content: "\e606";
+  content: '\e606';
 }
 
 .icon-delete:before {
-  content: "\e668";
+  content: '\e668';
 }
 
 .icon-edit:before {
-  content: "\e7f8";
+  content: '\e7f8';
 }
 
 .icon-daifukuan:before {
-  content: "\e65c";
+  content: '\e65c';
 }
 
 .icon-qpdingdan:before {
-  content: "\e667";
+  content: '\e667';
 }
 
 .icon-daifahuo:before {
-  content: "\e60c";
+  content: '\e60c';
 }
 
 .icon-daishouhuo:before {
-  content: "\e771";
+  content: '\e771';
 }
 
 .icon-jifen:before {
-  content: "\e628";
+  content: '\e628';
 }
 
 .icon-shouhou:before {
-  content: "\e788";
+  content: '\e788';
 }
 
 .icon-shouhuodizhi:before {
-  content: "\e67e";
+  content: '\e67e';
 }
 
 .icon-kefu:before {
-  content: "\e654";
+  content: '\e654';
 }
 
 .icon-lingquan:before {
-  content: "\e60b";
+  content: '\e60b';
 }
 
 .icon-bangzhu:before {
-  content: "\e63a";
+  content: '\e63a';
 }
 
 .icon-bianji:before {
-  content: "\e6a4";
+  content: '\e6a4';
 }
 
 .icon-fuwu:before {
-  content: "\e732";
+  content: '\e732';
 }
 
 .icon-gouwuche:before {
-  content: "\e61b";
+  content: '\e61b';
 }
 
 .icon-view-tile:before {
-  content: "\e6c8";
+  content: '\e6c8';
 }
 
 .icon-view-list:before {
-  content: "\e637";
+  content: '\e637';
 }
 
 .icon-arrow-down:before {
-  content: "\e603";
+  content: '\e603';
 }
 
 .icon-arrow-up:before {
-  content: "\e604";
+  content: '\e604';
 }
 
 .icon-cart:before {
-  content: "\e68c";
+  content: '\e68c';
 }
 
 .icon-chaping:before {
-  content: "\e68f";
+  content: '\e68f';
 }
 
 .icon-dingwei:before {
-  content: "\e698";
+  content: '\e698';
 }
 
 .icon-fanhuidingbu:before {
-  content: "\e69b";
+  content: '\e69b';
 }
 
 .icon-haoping:before {
-  content: "\e6a5";
+  content: '\e6a5';
 }
 
 .icon-home:before {
-  content: "\e6a6";
+  content: '\e6a6';
 }
 
 .icon-help:before {
-  content: "\e6a7";
+  content: '\e6a7';
 }
 
 .icon-iconxx:before {
-  content: "\e6ae";
+  content: '\e6ae';
 }
 
 .icon-profile:before {
-  content: "\e6b6";
+  content: '\e6b6';
 }
 
 .icon-shanchu:before {
-  content: "\e6b7";
+  content: '\e6b7';
 }
 
 .icon-search:before {
-  content: "\e6bf";
+  content: '\e6bf';
 }
 
 .icon-camera:before {
-  content: "\e6c4";
+  content: '\e6c4';
 }
 
 .icon-arrow-right:before {
-  content: "\e6cb";
+  content: '\e6cb';
 }
 
 .icon-x:before {
-  content: "\e6cc";
+  content: '\e6cc';
 }
 
 .icon-wushuju:before {
-  content: "\e6ce";
+  content: '\e6ce';
 }
 
 .icon-zhongping:before {
-  content: "\e6d9";
+  content: '\e6d9';
 }
 
 .icon-radio:before {
-  content: "\e600";
+  content: '\e600';
 }
 
 .icon-dingdan:before {
-  content: "\e60f";
+  content: '\e60f';
 }
 
 .icon-erweima:before {
-  content: "\e601";
+  content: '\e601';
 }
 
 .icon-tuandui:before {
-  content: "\e6d1";
+  content: '\e6d1';
 }
 
 .icon-zhangben:before {
-  content: "\ea2c";
+  content: '\ea2c';
 }
 
 .icon-shenhezhong:before {
-  content: "\e723";
+  content: '\e723';
 }
 
 .icon-fenxiang:before {
-  content: "\e63e";
+  content: '\e63e';
 }
 
 .icon-wenhao:before {
-  content: "\e69f";
+  content: '\e69f';
 }
 
 .icon-shibai:before {
-  content: "\e6b5";
+  content: '\e6b5';
 }
 
 .icon-success:before {
-  content: "\e644";
+  content: '\e644';
 }
 
 .icon-pintuan_huaban:before {
-  content: "\e6c3";
+  content: '\e6c3';
 }
 
 .icon-cate:before {
-  content: "\e6c7";
+  content: '\e6c7';
 }
 
 .icon-daohang:before {
-  content: "\e650";
+  content: '\e650';
 }
 
 .icon-check1:before {
-  content: "\e609";
+  content: '\e609';
 }
 
 .icon-check:before {
-  content: "\e60a";
+  content: '\e60a';
 }
 
 .icon-locate:before {
-  content: "\e652";
+  content: '\e652';
 }
 
 .icon-dianhua:before {
-  content: "\e670";
+  content: '\e670';
 }
 
 .icon-shijian:before {
-  content: "\e661";
+  content: '\e661';
 }
 
 .icon-qr-extract:before {
-  content: "\e635";
+  content: '\e635';
 }
 
 .icon-qianbao:before {
-  content: "\e632";
+  content: '\e632';
 }
 
 .icon-shangcheng:before {
-  content: "\e605";
+  content: '\e605';
 }
 
 .icon-sy-yh:before {
-  content: "\e7b1";
+  content: '\e7b1';
 }
 
 .icon-naozhong:before {
-  content: "\e76e";
+  content: '\e76e';
 }
 
 .icon-shouye:before {
-  content: "\e73d";
+  content: '\e73d';
 }
 
 .icon-kefu1:before {
-  content: "\e75c";
+  content: '\e75c';
 }
 
 .icon-artboard:before {
-  content: "\e7b5";
+  content: '\e7b5';
 }
 
 .icon-miaosha-b:before {
-  content: "\e646";
+  content: '\e646';
 }
 
 .icon-shijian-s:before {
-  content: "\e6eb";
+  content: '\e6eb';
 }
 
 .icon-shipin:before {
-  content: "\e67d";
+  content: '\e67d';
 }
 
 .icon-zhibozhong:before {
-  content: "\e837";
+  content: '\e837';
 }