Ver Fonte

Merge branch 'admin_dev' of http://112.213.107.185:3000/cwg-crm/gypsy-crm-frontend-vu into admin_dev

zhb há 1 semana atrás
pai
commit
c6930ec916

+ 1 - 1
components/cwg-file-picker-wrapper.vue

@@ -57,7 +57,7 @@
 
       <!-- 添加按钮 -->
       <view v-if="innerFileList?.length < limit" class="file-picker__box cursor-pointer"
-        :style="typeof boxStyle === 'object' ? boxStyle : { cssText: boxStyle }">
+        :style="typeof boxStyle === 'object' ? boxStyle : { cssText: boxStyle }" :data-tooltip="t('vu.tooltip.t10')" data-placement="top">
         <view class="file-picker__box-content  is-add" :style="borderStyle" @click="handleChoose">
           <cwg-icon name="icon_add" class="upload-icon" :size="24" />
         </view>

+ 4 - 4
components/cwg-link.vue

@@ -1,16 +1,16 @@
 <template>
   <!-- #ifdef H5 -->
   <!-- H5 端:支持普通跳转 / PDF预览 / 文件下载 -->
-  <a v-if="isDownload" class="pdf-link" :href="url" :download="downloadName" target="_blank" :title="resolvedTitle">
+  <a v-if="isDownload" class="pdf-link cursor-pointer" :href="url" :download="downloadName" target="_blank" :title="resolvedTitle" :data-tooltip="resolvedTitle" data-placement="top">
     <slot v-if="slots['default']"></slot>
     <view v-else>{{ t(props.title) || props.title }}</view>
   </a>
-  <a v-else-if="isHtml" class="pdf-link" :href="url" :target="target || '_blank'" :title="resolvedTitle"
-    rel="noopener noreferrer">
+  <a v-else-if="isHtml" class="pdf-link cursor-pointer" :href="url" :target="target || '_blank'" :title="resolvedTitle"
+    rel="noopener noreferrer" :data-tooltip="resolvedTitle" data-placement="top">
     <slot v-if="slots['default']"></slot>
     <view v-else>{{ t(props.title) || props.title }}</view>
   </a>
-  <view v-else class="pdf-link" @click="handleClick">
+  <view v-else class="pdf-link cursor-pointer" @click="handleClick" :data-tooltip="t(props.title) || props.title" data-placement="top">
     <slot v-if="slots['default']"></slot>
     <view v-else>{{ t(props.title) || props.title }}</view>
   </view>

+ 7 - 1
locale/cn.json

@@ -73,7 +73,13 @@
       "t2": "复制",
       "t3": "文件",
       "t4": "跳转{pageName}页面",
-      "t5": "公告"
+      "t5": "公告",
+      "t6": "打开链接",
+      "t7": "刷新",
+      "t8": "点击下载",
+      "t9": "支付方式",
+      "t10": "添加"
+
     }
   },
   "common": {

+ 1 - 1
pages/analytics/analystViews.vue

@@ -14,7 +14,7 @@
                     <view class="card-header">
                         <view class="nav nav-underline card-header-tabs" id="myTab" role="tablist">
                             <view class="nav-item" v-for="item in tabsConfig" :key="item">
-                                <view class="nav-link cursor-pointer" @click="activeTab = item.value"
+                                <view class="nav-link cursor-pointer" :data-tooltip="item.text" data-placement="top" @click="activeTab = item.value"
                                     :class="{ 'active': item.value == activeTab }">{{
                                         item.text }}</view>
                             </view>

+ 17 - 1
pages/analytics/components/List.vue

@@ -28,7 +28,7 @@
     <!-- 列表 -->
     <view v-if="list.length > 0" class="list">
       <view v-for="item in list" :key="item.id" class="col-12 m-b30">
-        <view class="card card-action action-elevate action-border-primary cursor-pointer" @click="handleItemClick(item)">
+        <view class="card card-action action-elevate action-border-primary cursor-pointer" @click="handleItemClick(item)" :data-tooltip="t('vu.tooltip.t4',{pageName:currentTitleText})" data-placement="top">
           <view class="row g-0">
             <view class="col-md-3" v-if="item.coverImage">
               <view class="card-header border-0 p-0 m-2 position-relative overflow-hidden">
@@ -90,6 +90,22 @@ const formatDate = (dateStr) => {
   if (!dateStr) return ''
   return dateStr.slice(0, 10).replace('T', ' ')
 }
+const currentTitleText = computed(() => {
+  const map = {
+    1: t('News.ViewAnalysis'),
+    2: t('News.NewsInformation'),
+    3: t('News.Announcement'),
+    4: t('News.VideoCommentary'),
+    5: t('News.NewsInformation'),
+    6: t('News.VideoCommentary'),
+    7: t('News.Notice'),
+    8: t('News.TradeIdeas'),
+    9: t('News.FinancialCalendar'),
+    10: t('News.Ebook'),
+    11: t('News.VideoCommentary')
+  }
+  return map[props.type] || ''
+})
 
 const load = async () => {
   list.value = []

+ 1 - 1
pages/analytics/news.vue

@@ -37,7 +37,7 @@
                     <view class="card-header">
                         <view class="nav nav-underline card-header-tabs" id="myTab" role="tablist">
                             <view class="nav-item" v-for="item in tabsConfig" :key="item">
-                                <view class="nav-link cursor-pointer" @click="activeTab = item.value"
+                                <view class="nav-link cursor-pointer" :data-tooltip="item.text" data-placement="top" @click="activeTab = item.value"
                                     :class="{ 'active': item.value == activeTab }">{{
                                         item.text }}</view>
                             </view>

+ 3 - 3
pages/common/download.vue

@@ -15,15 +15,15 @@
                             <view class="nav nav-pills nav-fill card-header-pills">
                                 <view class="nav-item">
                                     <view class="nav-link cursor-pointer" :class="{ 'active': activeName == 'MT4' }"
-                                        @click="activeName = 'MT4'">MetaTrader 4</view>
+                                        @click="activeName = 'MT4'" :data-tooltip="'MetaTrader 4'" data-placement="top">MetaTrader 4</view>
                                 </view>
                                 <view class="nav-item">
                                     <view class="nav-link cursor-pointer" :class="{ 'active': activeName == 'MT5' }"
-                                        @click="activeName = 'MT5'">MetaTrader 5</view>
+                                        @click="activeName = 'MT5'" :data-tooltip="'MetaTrader 5'" data-placement="top">MetaTrader 5</view>
                                 </view>
                                 <view class="nav-item" v-if="app3">
                                     <view class="nav-link cursor-pointer" :class="{ 'active': activeName == 'App' }"
-                                        @click="activeName = 'App'" v-t="'vu.Downloadpage.item41'"></view>
+                                        @click="activeName = 'App'" v-t="'vu.Downloadpage.item41'" :data-tooltip="t('vu.Downloadpage.item41')" data-placement="top"></view>
                                 </view>
                             </view>
                         </view>

+ 1 - 1
pages/customer/components/PaymentMethodsList.vue

@@ -1,6 +1,6 @@
 <template>
   <view class="row">
-    <view class="col-lg-3 col-sm-12 cursor-pointer mb-2" v-for="item in list" :key="item.id" :class="{ disabled: item.disabled }" @click="handleClick(item)">
+    <view class="col-lg-3 col-sm-12 cursor-pointer mb-2" v-for="item in list" :key="item.id" :class="{ disabled: item.disabled }" @click="handleClick(item)" :data-tooltip="t('vu.tooltip.t9')" data-placement="top">
       <view class="card hover">
         <view class="card-header d-flex justify-content-between align-items-center">
           <h4 class="card-title mb-0">{{ item.name }}</h4>

+ 3 - 3
pages/customer/components/TerminalDialog.vue

@@ -2,7 +2,7 @@
     <cwg-popup :title="t('Shop.Index.Transaction')" :visible="props.visible" :showFooters="false"
         @update:visible="$emit('update:visible', $event)">
         <view class="card-list">
-            <view class="card cursor-pointer" @click="handleWebClick">
+            <view class="card cursor-pointer" @click="handleWebClick" :data-tooltip="t('vu.tooltip.t6')" data-placement="top">
                 <view class="card-icon">
                     <cwg-icon name="cwg-mt" :size="48" color="#fff"  />
                 </view>
@@ -14,7 +14,7 @@
                     <cwg-icon name="cwg-arrow" :size="24" />
                 </view>
             </view>
-            <view class="card cursor-pointer" @click="handleDownloadClick">
+            <view class="card cursor-pointer" @click="handleDownloadClick" :data-tooltip="t('vu.tooltip.t8')" data-placement="top">
                 <view class="card-icon">
                     <cwg-icon name="cwg-mt" :size="48" color="#fff"  />
                 </view>
@@ -26,7 +26,7 @@
                     <cwg-icon name="cwg-arrow" :size="24"  />
                 </view>
             </view>
-            <view class="card cursor-pointer" @click="handleClick">
+            <view class="card cursor-pointer" @click="handleClick" :data-tooltip="t('vu.tooltip.t4',{pageName:t('Downloadpage.item1')})" data-placement="top">
                 <view class="card-content">
                     <text class="card-title" v-t="'vu.item13'"></text>
                 </view>

+ 1 - 1
pages/customer/dashboard.vue

@@ -112,7 +112,7 @@
                       <text v-if="chartForm.chartType == 3">{{ t('Custom.Index.WithdrawalsStatistical') }}</text>
                       <text v-if="chartForm.chartType == 6">{{ t('Custom.Index.ProfitLoss') }}</text>
                     </view>
-                    <view class="time cursor-pointer" @click="toReload">
+                    <view class="time cursor-pointer" @click="toReload" :data-tooltip="t('vu.tooltip.t7')" data-placement="top">
                       <cwg-icon name="crm-refresh" :size="16" color="#666" />
                       <text class="crm-cursor"> GMT+3 {{ time }}</text>
                     </view>

+ 1 - 1
pages/follow/index.vue

@@ -104,7 +104,7 @@
                     <view class="tit">
                       <text class="tab h3">{{ t('Documentary.console.item23') }}</text>
                     </view>
-                    <view class="num cursor-pointer" @click="toDocumentary1">
+                    <view class="num cursor-pointer" @click="toDocumentary1" :data-tooltip="t('Documentary.TundManagement.item11')" data-placement="top">
                       <cwg-icon name="crm-sz" :size="18" color="#6c8595" />
                     </view>
                   </view>

+ 1 - 1
pages/ib/transfer.vue

@@ -19,7 +19,7 @@
                                     <view class="nav-item" role="presentation" v-for="item in tabsConfig"
                                         :key="item.value" @click="activeTab = item.value">
                                         <view class="nav-link cursor-pointer"
-                                            :class="{ 'active': item.value === activeTab }">{{
+                                            :class="{ 'active': item.value === activeTab }" :data-tooltip="item.text" data-placement="top">{{
                                                 item.text }}</view>
                                     </view>
                                 </view>

+ 8 - 8
pages/login/index.vue

@@ -65,8 +65,8 @@
 
             </view>
             <view class="tab-list">
-              <view v-for="tab in tabs" :key="tab.value" class="tab-item" :class="{ active: activeTab === tab.value }"
-                @click="handleClick(tab.value)">
+              <view v-for="tab in tabs" :key="tab.value" class="tab-item cursor-pointer" :class="{ active: activeTab === tab.value }"
+                @click="handleClick(tab.value)" :data-tooltip="tab.text" data-placement="top">
                 <text class="tab-label">{{ tab.text }}</text>
               </view>
             </view>
@@ -98,7 +98,7 @@
                       :label="t('newSignin.item5')" name="记住我" class="wcg-checkbox"></up-checkbox>
                   </up-checkbox-group>
                 </view>
-                <navigator url="/pages/login/reset" class="account-tip">
+                <navigator url="/pages/login/reset" class="account-tip cursor-pointer" :data-tooltip="t('signin.forget')" data-placement="top">
                   <text>{{ t('signin.forget') }}</text>
                 </navigator>
               </view>
@@ -107,13 +107,13 @@
                   {{ t('signin.login') }}
                 </button>
               </view>
-              <view @click="activeTab = 2" class="account-tip">
+              <view @click="activeTab = 2" class="account-tip cursor-pointer" :data-tooltip="t('signin.signup')" data-placement="top">
                 {{ t('signin.words') }}
                 <text>{{ t('signin.signup') }}</text>
               </view>
               <view class="des-bottom">
                 <text v-t="'vu.login.agreemnet1'"></text>
-                <cwg-link type="pdf" url='pdf/Client_Agreement.pdf' target="_blank" :title="'signup.agreemnet2'"
+                <cwg-link type="pdf" url='pdf/Client_Agreement.pdf'  target="_blank" :title="'signup.agreemnet2'"
                           class="desc-link" />
                 <text v-t="'signup.agreemnet3'"></text>
                 <cwg-link type="pdf" url='pdf/Terms&Conditions.pdf' target="_blank" :title="'signup.agreemnet4'"
@@ -168,7 +168,7 @@
                               :placeholder="t('newSignup.item10')">
                             </uni-easyinput>
                           </view>
-                          <view class="btn-code" @click="(!isAgeValid || !formData.birthDate) ? '' : handleGetCode()">
+                          <view class="btn-code cursor-pointer" :data-tooltip="getCodeString" data-placement="top" @click="(!isAgeValid || !formData.birthDate) ? '' : handleGetCode()">
                             {{ getCodeString }}
                           </view>
                         </view>
@@ -221,12 +221,12 @@
                   </uni-forms-item>
                 </uni-forms>
               </view>
-              <view>
+              <view class="cursor-pointer" :data-tooltip="t('signup.button')" data-placement="top">
                 <button class="regiset-btn" @click="register">
                   {{ t('signup.button') }}
                 </button>
               </view>
-              <view class="login-link">
+              <view class="login-link cursor-pointer" :data-tooltip="t('newSignup.item17')" data-placement="top">
                 <text>{{ t('newSignup.item16') }}</text>
                 <view class="link" @click="activeTab = 1">{{ t('newSignup.item17') }}</view>
               </view>

+ 2 - 2
pages/login/reset.vue

@@ -24,10 +24,10 @@
               <uni-easyinput v-model="email" :placeholder="t('newSignup.item7')" class="custom-input">
               </uni-easyinput>
 
-              <view class="reset-button">
+              <view class="reset-button cursor-pointer" :data-tooltip="t('forget.forget')" data-placement="top">
                 <button class="btn btn-danger" @click="handleReset">{{ t('forget.forget') }}</button>
               </view>
-              <view class="login-link">
+              <view class="login-link cursor-pointer" :data-tooltip="t('forget.cancel')" data-placement="top">
                 <button @click="handleLogin" class="link-text">{{ t('forget.cancel') }}</button>
               </view>
             </view>

+ 2 - 2
pages/mine/components/KycAuthDialog.vue

@@ -14,9 +14,9 @@
                     <view class="qrcode-wrapper" v-if="qrCodeUrl">
                         <QrCode v-if="qrCodeUrl" :text="qrCodeUrl"></QrCode>
                         <view class="qrcode-url">
-                            <view class="url-text cursor-pointer" @click="openExternalUrl(qrCodeUrl)">{{ qrCodeUrl }}
+                            <view class="url-text cursor-pointer" @click="openExternalUrl(qrCodeUrl)" :data-tooltip="t('vu.tooltip.t6')" data-placement="top">{{ qrCodeUrl }}
                             </view>
-                            <cwg-icon name="copy" class="cursor-pointer" :size="20" @click="copyUrl" />
+                            <cwg-icon name="copy" class="cursor-pointer" :size="20" @click="copyUrl" :data-tooltip="t('vu.tooltip.t2')" data-placement="top"/>
                         </view>
                     </view>
                     <!-- 说明 -->

+ 2 - 2
static/scss/global/vu.css

@@ -17312,8 +17312,8 @@ html[data-bs-theme=dark] .text-bg-light {
 
 .btn[class*=btn-]:active:not(.dropdown-toggle),
 .btn[class*=btn-].active:not(.dropdown-toggle) {
-  transform: scale(0.982);
-  transition: all 0.125s ease-in-out;
+  /*transform: scale(0.982);*/
+  /*transition: all 0.125s ease-in-out;*/
 }
 
 .btn-icon {

+ 36 - 6
utils/useMouseTooltip.js

@@ -3,18 +3,46 @@ let r = null
 let l = null
 
 export function useMouseTooltip() {
-    // 🔥 修复:进入元素时 立刻更新位置 + 节流合并
+    const TOOLTIP_WIDTH = 80
+    const TOOLTIP_HEIGHT = 40
+    const PADDING = 16
+
+    const updateTooltipPosition = (clientX, clientY) => {
+        const viewportWidth = window.innerWidth
+        const viewportHeight = window.innerHeight
+
+        let x = clientX
+        let y = clientY
+        let flipX = false
+        let flipY = false
+
+        if (clientX + TOOLTIP_WIDTH + PADDING > viewportWidth) {
+            x = clientX - TOOLTIP_WIDTH - PADDING
+            flipX = true
+        }
+
+        if (clientY + TOOLTIP_HEIGHT + PADDING > viewportHeight) {
+            y = clientY - TOOLTIP_HEIGHT - PADDING
+            flipY = true
+        }
+
+        x = Math.max(PADDING, x)
+        y = Math.max(PADDING, y)
+
+        document.documentElement.style.setProperty('--mouse-x', x + 'px')
+        document.documentElement.style.setProperty('--mouse-y', y + 'px')
+        document.documentElement.style.setProperty('--tooltip-flip-x', flipX ? 'true' : 'false')
+        document.documentElement.style.setProperty('--tooltip-flip-y', flipY ? 'true' : 'false')
+    }
+
     const u = (e, instant = false) => {
-        // 切换元素时 → 强制立刻刷新
         if (instant) {
-            document.documentElement.style.setProperty('--mouse-x', e.clientX + 'px')
-            document.documentElement.style.setProperty('--mouse-y', e.clientY + 'px')
+            updateTooltipPosition(e.clientX, e.clientY)
         }
 
         clearTimeout(t)
         t = setTimeout(() => {
-            document.documentElement.style.setProperty('--mouse-x', e.clientX + 'px')
-            document.documentElement.style.setProperty('--mouse-y', e.clientY + 'px')
+            updateTooltipPosition(e.clientX, e.clientY)
         }, 200)
     }
 
@@ -22,6 +50,8 @@ export function useMouseTooltip() {
         clearTimeout(t)
         document.documentElement.style.removeProperty('--mouse-x')
         document.documentElement.style.removeProperty('--mouse-y')
+        document.documentElement.style.removeProperty('--tooltip-flip-x')
+        document.documentElement.style.removeProperty('--tooltip-flip-y')
     }
 
     const i = () => {