li.shaoyi 4 miesięcy temu
rodzic
commit
e2d60d9c05

+ 2 - 2
oem/tss-vi/config/appconfig.json

@@ -1,8 +1,8 @@
 {
   "appId": "com.muchinfo.tssvi",
   "appName": "Tce Vietnam",
-  "version": "1.0.71",
-  "versionCode": "100071",
+  "version": "1.0.72",
+  "versionCode": "100072",
   "apiUrl": "http://192.168.31.210:8080/cfg?key=test_210",
   "tradeChannel": "ws",
   "showLoginAlert": true,

+ 3 - 0
src/packages/mobile/components/base/waterfall/flex/index.vue

@@ -27,6 +27,9 @@ const props = defineProps({
         type: Number,
         default: 2
     },
+    rowKey: {
+        type: String,
+    },
     //间距
     gap: {
         type: Number,

+ 17 - 0
src/packages/tss/assets/images/icons/line.svg

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 26.5.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
+<style type="text/css">
+	.st0{fill:#FFFFFF;}
+</style>
+<path class="st0" d="M19.4,9.9c0.3,0,0.6,0.3,0.6,0.6c0,0.3-0.3,0.6-0.6,0.6h-1.8v1.1h1.8c0.3,0,0.6,0.3,0.6,0.6
+	c0,0.3-0.3,0.6-0.6,0.6H17c-0.3,0-0.6-0.3-0.6-0.6V8.1c0-0.3,0.3-0.6,0.6-0.6h2.4c0.3,0,0.6,0.3,0.6,0.6c0,0.3-0.3,0.6-0.6,0.6h-1.8
+	v1.1H19.4z M15.5,12.9c0,0.3-0.2,0.5-0.4,0.6c-0.1,0-0.1,0-0.2,0c-0.2,0-0.4-0.1-0.5-0.2l-2.4-3.3v2.9c0,0.3-0.3,0.6-0.6,0.6
+	c-0.3,0-0.6-0.3-0.6-0.6V8.1c0-0.3,0.2-0.5,0.4-0.6c0.1,0,0.1,0,0.2,0c0.2,0,0.4,0.1,0.5,0.3l2.5,3.3v-3c0-0.3,0.3-0.6,0.6-0.6
+	c0.3,0,0.6,0.3,0.6,0.6V12.9z M9.8,12.9c0,0.3-0.3,0.6-0.6,0.6c-0.3,0-0.6-0.3-0.6-0.6V8.1c0-0.3,0.3-0.6,0.6-0.6
+	c0.3,0,0.6,0.3,0.6,0.6C9.8,8.1,9.8,12.9,9.8,12.9z M7.3,13.5H4.9c-0.3,0-0.6-0.3-0.6-0.6V8.1c0-0.3,0.3-0.6,0.6-0.6
+	c0.3,0,0.6,0.3,0.6,0.6v4.1h1.8c0.3,0,0.6,0.3,0.6,0.6C7.9,13.2,7.7,13.5,7.3,13.5 M24,10.3c0-5.4-5.4-9.7-12-9.7S0,4.9,0,10.3
+	c0,4.8,4.3,8.8,10,9.6c0.4,0.1,0.9,0.3,1.1,0.6c0.1,0.3,0.1,0.8,0,1.1l-0.2,1c0,0.3-0.2,1.2,1,0.6c1.3-0.5,6.9-4.1,9.4-7
+	C23.2,14.4,24,12.5,24,10.3"/>
+</svg>

+ 6 - 2
src/packages/tss/views/home/index.less

@@ -1,13 +1,17 @@
 .home {
+    &-line-chat {
+        --van-floating-bubble-background: #06c655;
+    }
+
     .app-tabbar {
         background: #DDF1E5 !important;
         margin-top: auto;
 
         .app-iconfont {
-            color: rgb(192,190,199);
+            color: rgb(192, 190, 199);
 
             &.is-active {
-                color: rgb(48,92,62);
+                color: rgb(48, 92, 62);
             }
         }
     }

+ 36 - 6
src/packages/tss/views/home/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="home g-flex">
+  <div ref="homeRef" class="home g-flex">
     <router-view v-slot="{ Component }">
       <RouterTransition :css="cssTransition">
         <!-- 缓存所有组件 -->
@@ -8,7 +8,8 @@
         </keep-alive>
       </RouterTransition>
     </router-view>
-    <FloatingBubble v-model:offset="offset" icon="chat" v-if="false" />
+    <FloatingBubble class="home-line-chat" v-model:offset="offset" :icon="Line" @click="openChat"
+      v-if="loginStore.token" />
     <app-tabbar :data-list="tabList" :data-index="currentTab" @click="onTabClick" />
     <app-updater :ios-update-url="iosUpdateUrl" />
   </div>
@@ -19,11 +20,13 @@ import { shallowRef, nextTick, watch, onMounted, computed } from 'vue'
 import { FloatingBubble } from 'vant'
 import { Tabbar } from '@mobile/components/base/tabbar/types'
 import { useNavigation } from '@mobile/router/navigation'
-import { useLoginStore } from '@/stores'
+import { useLoginStore, useUserStore } from '@/stores'
 import { i18n } from '@/stores'
 import AppTabbar from '@mobile/components/base/tabbar/index.vue'
 import AppUpdater from '@mobile/components/base/updater/index.vue'
 import RouterTransition from '@mobile/components/base/router-transition/index.vue'
+import plus from '@/utils/h5plus'
+import Line from '../../assets/images/icons/line.svg'
 
 defineProps({
   iosUpdateUrl: String
@@ -33,10 +36,12 @@ const { t } = i18n.global
 
 const { route, routerTo } = useNavigation()
 const loginStore = useLoginStore()
+const userStore = useUserStore()
 const cssTransition = shallowRef(true) // 是否使用css动画
 const currentTab = shallowRef(0)
 const marketSection = shallowRef() // 当前选中的板块
 
+const homeRef = shallowRef<HTMLDivElement>()
 const offset = shallowRef({ x: 0, y: 0 })
 
 const tabIndex = computed(() => {
@@ -92,6 +97,28 @@ const onTabClick = (index: number) => {
   }
 }
 
+const openChat = () => {
+  const userAccount = userStore.getUserDataInfo('userAccount')
+  const lineUrl = 'https://line.me/R/oaMessage/@' + userAccount.memberlinecsaccount
+  // const lineProtocolUrl = 'line://ti/p/@' + userAccount.memberlinecsaccount
+
+  // if (plus.getSystemInfo('os') === 'Web') {
+  //   plus.openURL(lineUrl)
+  // } else {
+  //   // 优先尝试 Line 协议
+  //   plus.openURL(lineProtocolUrl)
+
+  //   // 如果失败,回退到通用链接
+  //   setTimeout(() => {
+  //     if (!document.hidden) {
+  //       plus.openURL(lineUrl)
+  //     }
+  //   }, 500)
+  // }
+
+  plus.openURL(lineUrl)
+}
+
 watch(() => route.name, () => {
   if (tabIndex.value > -1) {
     cssTransition.value = false
@@ -105,9 +132,12 @@ watch(() => route.name, () => {
 onMounted(() => {
   currentTab.value = tabIndex.value
 
-  offset.value = {
-    x: -1,
-    y: document.body.clientHeight - 120
+  const el = homeRef.value
+  if (el) {
+    offset.value = {
+      x: -1,
+      y: el.clientHeight - 120
+    }
   }
 })
 </script>

+ 1 - 0
src/types/model/account.d.ts

@@ -232,6 +232,7 @@ declare global {
             isanonymous: number; // 是否匿名下单 - 0:否 1:是
             issigned: boolean; // 今日是否已签到
             maxinvestornum: number; // 最大用户数(经纪会员下投资者个数)
+            memberlinecsaccount: string; // 所属会员Line客服账号
             memberuserid: number; // 所属会员ID
             modifierid: number; // 修改人
             modifyremark: string; // 变更备注