zhb 3 weeks ago
parent
commit
9ebe985671
4 changed files with 93 additions and 93 deletions
  1. 90 81
      App.vue
  2. 1 6
      manifest.json
  3. 0 4
      pages/activities/dollar-list.vue
  4. 2 2
      pages/analytics/components/List.vue

+ 90 - 81
App.vue

@@ -22,7 +22,7 @@ onLoad((options) => {
 onShow((options) => {
 	updateRoute();
 	// checkUpdate()
-  handleSignupRoute(options)
+	handleSignupRoute(options)
 })
 
 // App.vue 或你的初始化文件中
@@ -74,7 +74,16 @@ onLaunch((options) => {
 	// 调用初始化
 	// initTheme()
 
+
+
+	// #ifdef H5
 	// 处理 signup 路径
+	document.title = 'CWGMarkets'
+	// 防止后面又被改掉,再加个定时器兜底
+	setInterval(() => {
+		if (!document.title) document.title = 'CWGMarkets'
+	}, 500)
+	// #endif
 
 })
 
@@ -141,7 +150,7 @@ const handleSignupRoute = (options) => {
 	if (query.path === 'signin') {
 
 		// 跳转到登录页面 有就携带 token 参数
-		const loginUrl = query?.sysLoginToken?`/pages/login/index?sysLoginToken=${encodeURIComponent(query.sysLoginToken)}`:'/pages/login/index'
+		const loginUrl = query?.sysLoginToken ? `/pages/login/index?sysLoginToken=${encodeURIComponent(query.sysLoginToken)}` : '/pages/login/index'
 		console.log('跳转到登录页面:', loginUrl);
 
 		uni.reLaunch({
@@ -205,94 +214,94 @@ watch(locale, () => {
 
 // 检测版本号更新
 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)
-  }
+	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 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
-  })
+	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
+	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(() => {

+ 1 - 6
manifest.json

@@ -27,11 +27,6 @@
         },
         "loglevel" : "debug",
         "modules" : {
-            "OAuth" : {},
-            "Payment" : {},
-            "Share" : {},
-            "Speech" : {},
-            "VideoPlayer" : {},
             "Camera" : {},
             "Barcode" : {},
             "Push" : {}
@@ -113,7 +108,7 @@
                     "xxhdpi" : "static/res 4/drawable-xxhdpi/splash.9.png",
                     "xhdpi" : "static/res 4/drawable-xhdpi/splash.9.png"
                 },
-                "iosStyle" : "storyboard"
+                "iosStyle" : "common"
             }
         },
         "uniStatistics" : {

+ 0 - 4
pages/activities/dollar-list.vue

@@ -74,10 +74,6 @@
             <view class="dialog-popup1">
                 <cwg-combox v-model:value="selectedRuleId" :clearable="false" :options="ruleOptionsList"
                     :placeholder="t('UtaskList.item19')" @change="handleGiftChange" />
-                <template #footer>
-                    <button class="btn btn-danger btn-sm waves-effect waves-light" @click="closeApplyRecordDialog">{{
-                        t('Btn.Confirm') }}</button>
-                </template>
             </view>
             <template #footer>
                 <button class="btn btn-outline-secondary" @click="closeClaimDialog">{{ t("Btn.Cancel") }}</button>

+ 2 - 2
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" @click="handleItemClick(item)">
+        <view class="card card-action action-elevate action-border-primary cursor-pointer" @click="handleItemClick(item)">
           <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">
@@ -43,7 +43,7 @@
                 <h5>
                   <span class="text-2xs text-body p-text"><i class="icon-calendar text-primary"></i> {{
                     formatDate(item.deliveryTime) }}</span><br>
-                  <text class="text-dark cursor-pointer h5">{{ item.title }}</text>
+                  <text class="text-dark h5">{{ item.title }}</text>
                 </h5>
                 <p class="p-text">{{ item.subTitle }}</p>
               </view>