Browse Source

feat: webview逻辑完善、iconfont更新、tabbars配置读取

zhangyuhan 1 year ago
parent
commit
2112b444dc

+ 86 - 1
project-config/index.js

@@ -11,6 +11,7 @@ const projectInfo = {
   // 小程序配置相关
   appId: 'wx37f06c38292f7d82',
   appName: '物业商机 | 采购意向',
+  appType: 'cgyx',
   appDesc: '',
   payAppId: '',
   appIcon: process.env.TARO_APP_WEB_ASSETS_BASE + '/images/logo/zxcg.png',
@@ -74,10 +75,94 @@ const boxInfo = [
   },
 ]
 
+
+
+const searchTabbars = [
+  {
+    key: 'home',
+    text: '订阅',
+    path: '/pages/tabbar/home/index',
+    icon: 'icon-a-Property1subscribe',
+    activeIcon: 'icon-a-Property1subscribe',
+    badge: ''
+  },
+  {
+    key: 'search',
+    text: '搜索',
+    path: '/pages/tabbar/search/index',
+    icon: 'icon-a-Property1search',
+    activeIcon: 'icon-a-Property1search',
+    badge: ''
+  },
+  {
+    key: 'box',
+    text: '全部商机',
+    path: '/pages/tabbar/box/index',
+    icon: 'icon-a-Property1box',
+    activeIcon: 'icon-a-Property1box',
+    badge: 'HOT'
+  },
+  {
+    key: 'mine',
+    text: '我的',
+    path: '/pages/tabbar/mine/index',
+    icon: 'icon-a-Property1mine',
+    activeIcon: 'icon-a-Property1mine',
+    badge: ''
+  }
+]
+
+const unitTabbars = [
+  {
+    key: 'home',
+    text: '甲方库',
+    path: '/pages/tabbar/home/index',
+    icon: 'icon-a-Property1lib',
+    activeIcon: 'icon-a-Property1lib',
+    badge: ''
+  },
+  {
+    key: 'search',
+    text: '搜索',
+    path: '/pages/tabbar/search/index',
+    icon: 'icon-a-Property1search',
+    activeIcon: 'icon-a-Property1search',
+    badge: ''
+  },
+  {
+    key: 'monitor',
+    text: '监控',
+    path: '/pages/tabbar/monitor/index',
+    icon: 'icon-a-Property1monitor',
+    activeIcon: 'icon-a-Property1monitor',
+    badge: ''
+  },
+  {
+    key: 'box',
+    text: '全部商机',
+    path: '/pages/tabbar/box/index',
+    icon: 'icon-a-Property1box',
+    activeIcon: 'icon-a-Property1box',
+    badge: 'HOT'
+  },
+  {
+    key: 'mine',
+    text: '我的',
+    path: '/pages/tabbar/mine/index',
+    icon: 'icon-a-Property1mine',
+    activeIcon: 'icon-a-Property1mine',
+    badge: ''
+  }
+]
+
+const tabbars = unitTabbars
+
+
 const appConfig = {
   projectInfo,
   shareInfo,
-  boxInfo
+  boxInfo,
+  tabbars
 }
 
 export default appConfig

+ 7 - 0
src/app.config.js

@@ -5,6 +5,7 @@ export default defineAppConfig({
     "pages/tabbar/search/index",
     "pages/tabbar/box/index",
     "pages/tabbar/mine/index",
+    "pages/tabbar/monitor/index",
     // 搜索功能
     "pages/search/result/bidding/index",
     "pages/search/content/bidding/index",
@@ -49,6 +50,12 @@ export default defineAppConfig({
         iconPath: 'assets/images/tabbar/home.png',
         selectedIconPath: 'assets/images/tabbar/home_active.png'
       },
+      {
+        pagePath: "pages/tabbar/monitor/index",
+        text: "监控",
+        iconPath: 'assets/images/tabbar/home.png',
+        selectedIconPath: 'assets/images/tabbar/home_active.png'
+      },
       {
         pagePath: "pages/tabbar/box/index",
         text: "全部商机",

+ 27 - 4
src/assets/fonts/iconfont.scss

@@ -1,8 +1,8 @@
 @font-face {
   font-family: "iconfont"; /* Project id 687854 */
-  src: url('https://cdn-common.jianyu360.com/cdn/assets/iconfont/mobile/24.2.28/iconfont.woff2?t=1709100990208') format('woff2'),
-  url('https://cdn-common.jianyu360.com/cdn/assets/iconfont/mobile/24.2.28/iconfont.woff?t=1709100990208') format('woff'),
-  url('https://cdn-common.jianyu360.com/cdn/assets/iconfont/mobile/24.2.28/iconfont.ttf?t=1709100990208') format('truetype');
+  src: url('https://cdn-common.jianyu360.com/cdn/assets/iconfont/mobile/24.6.14/iconfont.woff2?t=1709100990208') format('woff2'),
+  url('https://cdn-common.jianyu360.com/cdn/assets/iconfont/mobile/24.6.14/iconfont.woff?t=1709100990208') format('woff'),
+  url('https://cdn-common.jianyu360.com/cdn/assets/iconfont/mobile/24.6.14/iconfont.ttf?t=1709100990208') format('truetype');
 }
 
 .iconfont {
@@ -13,6 +13,30 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
+.icon-a-Property1subscribe:before {
+  content: "\e6e9";
+}
+
+.icon-a-Property1lib:before {
+  content: "\e6d6";
+}
+
+.icon-a-Property1search:before {
+  content: "\e6d7";
+}
+
+.icon-a-Property1monitor:before {
+  content: "\e6d8";
+}
+
+.icon-a-Property1box:before {
+  content: "\e6d4";
+}
+
+.icon-a-Property1mine:before {
+  content: "\e6d5";
+}
+
 .icon-jiankong:before {
   content: "\e60a";
 }
@@ -724,4 +748,3 @@
 .icon-biaoge:before {
   content: "\e63c";
 }
-

+ 3 - 35
src/custom-tab-bar/index.vue

@@ -24,6 +24,7 @@
 import { Tabbar, TabbarItem } from "vant";
 import { mapGetters, mapMutations } from "vuex";
 import Taro from "@tarojs/taro";
+import appConfig from "../../project-config";
 
 export default {
   components: {
@@ -36,40 +37,7 @@ export default {
   data () {
     return {
       active: 'home',
-      tabbars: [
-        {
-          key: 'home',
-          text: '订阅',
-          path: '/pages/tabbar/home/index',
-          icon: 'icon-nav_un_book',
-          activeIcon: 'icon-nav_un_book',
-          badge: ''
-        },
-        {
-          key: 'search',
-          text: '搜索',
-          path: '/pages/tabbar/search/index',
-          icon: 'icon-sousuo1',
-          activeIcon: 'icon-sousuo1',
-          badge: ''
-        },
-        {
-          key: 'box',
-          text: '全部商机',
-          path: '/pages/tabbar/box/index',
-          icon: 'icon-workSpace',
-          activeIcon: 'icon-workSpace',
-          badge: 'HOT'
-        },
-        {
-          key: 'mine',
-          text: '我的',
-          path: '/pages/tabbar/mine/index',
-          icon: 'icon-nav_un_mine',
-          activeIcon: 'icon-nav_un_mine',
-          badge: ''
-        }
-      ]
+      tabbars: appConfig.tabbars
     }
   },
   computed: {
@@ -109,7 +77,7 @@ export default {
     font-size: 24px;
   }
   .van-tabbar-item {
-    color: #171826;
+    color: #A4A5A9;
     &.van-tabbar-item--active {
       color: $main;
     }

+ 23 - 6
src/pages/tabbar/mine/index.vue

@@ -29,11 +29,12 @@
 
     <ad-single :radius="true" :showTag="false" :showCloseIcon="false" ad="mini-app-mine-top"></ad-single>
 
+
     <div class="menu-group">
 
       <div class="menu-card-group">
         <van-cell-group :border="false" inset title="会员权益">
-          <van-cell :border="false" is-link title="地区权限" value="1个" @click="goItem">
+          <van-cell :border="false" is-link title="地区权限" value="1个" @click="goItem('area')">
             <template #icon>
               <img class="cell-icon-img" src="https://cdn-common.jianyu360.com/cdn/assets/mini-app/images/icon/icon_area.png">
             </template>
@@ -43,13 +44,18 @@
               <img class="cell-icon-img" src="https://cdn-common.jianyu360.com/cdn/assets/mini-app/images/icon/icon_order.png">
             </template>
           </van-cell>
+          <van-cell :border="false" is-link title="测试-画像详情页" value="查看" @click="goItem('unit')">
+            <template #icon>
+              <img class="cell-icon-img" src="https://cdn-common.jianyu360.com/cdn/assets/mini-app/images/icon/icon_order.png">
+            </template>
+          </van-cell>
         </van-cell-group>
       </div>
 
 
       <div class="menu-card-group">
         <van-cell-group :border="false" inset title="我的商机">
-          <van-cell :border="false"  is-link title="业主监控" value="0个" @click="goItem">
+          <van-cell :border="false"  is-link title="业主监控" value="0个" @click="goItem('monitor')">
             <template #icon>
               <img class="cell-icon-img" src="https://cdn-common.jianyu360.com/cdn/assets/mini-app/images/icon/icon_jk.png">
             </template>
@@ -81,7 +87,7 @@
               <span @click="doCallPhone(customerPhone)" class="highlight-text">{{customerPhone}}</span>
             </div>
             <span class="img-tip">扫码在线咨询:</span>
-            <img :show-menu-by-longpress="true" class="customer-img" :src="customerSrc">
+            <ad-single class="customer-img" :longpress="true" :radius="true" :showTag="false" :showCloseIcon="false" ad="mini-app-mine-customer"></ad-single>
           </div>
           <div class="customer-footer">
             开发票、会员权益咨询等问题请联系客服
@@ -97,7 +103,7 @@ import {Cell, CellGroup, Popup} from 'vant'
 import UseLogin from "@/components/login/useLogin.vue";
 import Taro from "@tarojs/taro";
 import {mapActions, mapGetters} from "vuex";
-import {formatPhoneNumber} from "@/utils";
+import { formatPhoneNumber, goToOrderList, goToUnitDetail } from "@/utils";
 import adSingle from '@/components/common/Ad.vue'
 
 export default {
@@ -145,11 +151,21 @@ export default {
           break
         }
         case 'order': {
-          Taro.navigateTo({
-            url: '/pages/webview/index?src=' + 'http://localhost:8080/jy_mobile/tabbar/home'
+          goToOrderList()
+          break
+        }
+        case 'unit': {
+          goToUnitDetail({
+            entName: '北京大学'
           })
           break
         }
+        case 'area': {
+         break
+        }
+        case 'monitor': {
+         break
+        }
         default: {
           Taro.showToast({
             title: '暂未实现',
@@ -398,6 +414,7 @@ export default {
     .customer-img {
       width: 140px;
       height: 140px;
+      padding: 0;
       border-radius: 8px;
       background: #FFFFFF;
       border: 1px solid #00000019;

+ 1 - 1
src/pages/webview/index.vue

@@ -7,7 +7,7 @@ import Taro from "@tarojs/taro";
 export default {
   created () {
     this.$instance = Taro.getCurrentInstance()
-    this.src = this.$instance.router.params?.src
+    this.src = decodeURIComponent(this.$instance.router.params?.src)
   },
   onShareAppMessage (res) {
     if (res.from === 'button') {

+ 17 - 1
src/utils/common.js

@@ -1,7 +1,23 @@
 import Taro from "@tarojs/taro";
+import qs from "qs";
 
 export function goToWebPage (url) {
   Taro.navigateTo({
-    url: '/pages/webview/index?src=' + (process.env.TARO_APP_WEB_BASE + url)
+    url: '/pages/webview/index?src=' + encodeURIComponent(process.env.TARO_APP_WEB_BASE + url)
   })
 }
+
+export function goToUnitDetail (query) {
+  const queryStr = qs.stringify(query)
+  return goToWebPage('/weixin/frontPage/mini-app/free/page_unit_portrayal?' + queryStr)
+}
+
+export function goToOrderList (query) {
+  const queryStr = qs.stringify(query)
+  return goToWebPage('/weixin/frontPage/mini-app/free/order_list?' + queryStr)
+}
+
+export function goToOrderDoc (query) {
+  const queryStr = qs.stringify(query)
+  return goToWebPage('/front/staticPage/wx-serviceterms.html?' + queryStr)
+}