ljc преди 2 седмици
родител
ревизия
a84aef474c
променени са 8 файла, в които са добавени 105 реда и са изтрити 9 реда
  1. 92 0
      App.vue
  2. 5 0
      components/cwg-page-wrapper.vue
  3. 1 1
      index.html
  4. 1 1
      pages/customer/dashboard.vue
  5. 0 1
      pages/follow/trading-center.vue
  6. 3 3
      pages/ib/openPammManager.vue
  7. 1 1
      pages/ib/transfer.vue
  8. 2 2
      static/scss/global/global.scss

+ 92 - 0
App.vue

@@ -200,6 +200,98 @@ watch(locale, () => {
 	// });
 }, { immediate: true })
 
+// 检测版本号更新
+const checkWgtUpdate = async () => {
+  try {
+    const currentVersion = await getCurrentVersion()
+    const res = await uni.request({
+      url: `https://ucard.44a5c8109e4.com/wgt/list.json?_t=${Date.now()}`,
+      method: 'GET',
+      timeout: 5000
+    })
+    const files = res.data?.files || []
+    if (!files.length) return
+    const latestFile = files[files.length - 1]
+    const latestVersion = latestFile
+    if (!latestFile) return
+    const lastInstalled = uni.getStorageSync('lastWgtVersion')
+    console.log(lastInstalled,'lastInstalled');
+    if (latestVersion === lastInstalled) return
+    if (compareVersion(latestVersion, currentVersion) > 0) {
+      downloadAndInstall(latestVersion)
+    }
+  } catch (e) {
+    console.log('[wgt] update check failed', e)
+  }
+}
+
+// 下载并安装
+const downloadAndInstall=(version) => {
+  //TODO: 需要根据版本来确定url
+  const url = `https://ucard.44a5c8109e4.com/wgt/__UNI__EFA7490.wgt`
+  console.log(url,'downloadurl');
+
+  uni.downloadFile({
+    url,
+    success: (res) => {
+      if (res.statusCode === 200) {
+        const filePath = res.tempFilePath
+        plus.runtime.install(
+          filePath, {
+            force: true
+          },
+          () => {
+            uni.setStorageSync('lastWgtVersion', version)
+            console.log('[wgt] install success:', version)
+            uni.setStorageSync('wgtNeedRestart', true)
+          },
+          (err) => {
+            console.error('[wgt] install failed:', err)
+          }
+        )
+      } else {
+        console.error('[wgt] download status error:', res.statusCode)
+      }
+    },
+    fail: (err) => {
+      console.error('[wgt] download failed:', err)
+    }
+  })
+}
+// 获取当前版本
+const getCurrentVersion = async () => {
+  return new Promise((resolve, reject) => {
+    // #ifdef APP-PLUS
+    try {
+      plus.runtime.getProperty(plus.runtime.appid, (info) => {
+        resolve(info.version)
+      }, (error) => {
+        reject(error)
+      })
+    } catch (error) {
+      reject(error)
+    }
+    // #endif
+    // #ifndef APP-PLUS
+    reject(new Error('Not in APP-PLUS environment'))
+    // #endif
+  })
+}
+// 对比版本号
+const compareVersion = (v1, v2) => {
+  const s1 = v1.split('.').map(Number)
+  const s2 = v2.split('.').map(Number)
+  const len = Math.max(s1.length, s2.length)
+
+  for (let i = 0; i < len; i++) {
+    const n1 = s1[i] || 0
+    const n2 = s2[i] || 0
+    if (n1 > n2) return 1
+    if (n1 < n2) return -1
+  }
+  return 0
+}
+
 onMounted(() => {
 	const sysInfo = uni.getSystemInfoSync();
 	globalStore.setBarHeight(sysInfo.statusBarHeight || 60);

+ 5 - 0
components/cwg-page-wrapper.vue

@@ -547,6 +547,11 @@ onShow(() => {
     height: 100vh;
   }
 }
+@media screen and (max-width: 1645px) {
+  .content-wrapper-padding {
+    padding: px2rpx(16) px2rpx(48) 0 px2rpx(48);
+  }
+}
 
 .mobile-menu-btn {
   width: px2rpx(64);

+ 1 - 1
index.html

@@ -10,7 +10,7 @@
         (coverSupport ? ', viewport-fit=cover' : '') + '" />')
     </script>
     <!-- <script type="text/javascript" src="/static/js/jsvm_all.js"></script> -->
-    <title></title>
+    <title>CWGmarkets</title>
     <!--preload-links-->
     <!--app-context-->
   </head>

+ 1 - 1
pages/customer/dashboard.vue

@@ -961,7 +961,7 @@
   .btn {
     text-align: center;
     //background-color: rgb(var(--bs-danger-rgb));
-    font-size: px2rpx(16);
+    //font-size: px2rpx(16);
     color: #fff;
     //padding: px2rpx(10) px2rpx(20);
     border-radius: px2rpx(8)!important;

+ 0 - 1
pages/follow/trading-center.vue

@@ -707,7 +707,6 @@ const applyFllowCancel = () => {
 
 .cancel-btn,
 .confirm-btn {
-  flex: 1;
   margin: 0 10px;
   border-radius: 4px;
 }

+ 3 - 3
pages/ib/openPammManager.vue

@@ -43,8 +43,8 @@
       </view>
 
       <view class="box">
-        <view style="margin: 20px 0; font-size: 14px; line-height: 1.7;">
-          <view style="font-weight: bold; margin-bottom: 5px;">{{ t('Ib.PammManager.tips2') }}</view>
+        <view style="margin: 10px 0; font-size: 14px; line-height: 1.5;">
+          <view style="margin-bottom: 5px;">{{ t('Ib.PammManager.tips2') }}</view>
         </view>
       </view>
     </view>
@@ -244,7 +244,7 @@ onLoad((options: any) => {
 }
 
 .box {
-  padding: px2rpx(15) px2rpx(20);
+  padding: px2rpx(10) px2rpx(20);
   background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
   border-radius: px2rpx(4);
   margin-bottom: px2rpx(20);

+ 1 - 1
pages/ib/transfer.vue

@@ -425,7 +425,7 @@ const depositDisplayList = computed(() => {
         return toInfo.value.map(item => ({
             text: `${item.login} - ${groupTypeName(item.type)} - ${t('Custom.Deposit.AvailableBalance')}${groupCurrency(item.currency)}${item.balance}`,
             value: item.login,
-            disabled: item.status
+            disable: item.status
         }))
     } else {
         return agentInfo.value.map(item => ({

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

@@ -646,11 +646,11 @@ uni-left-window {
     transition: width 281ms cubic-bezier(0.4, 0, 0.2, 1);
 }
 
-@media (min-width: 992px) {
+@media (max-width: 1660px) {
     uni-content .pages-header,
     uni-content .app-page-head.card-header,
     uni-content .create-page > .header {
-        padding-left: 44px;
+        //padding-left: 44px;
     }
 }