Jelajahi Sumber

订单状态检查修改

Zhangbw 2 bulan lalu
induk
melakukan
aa146baee8

+ 1 - 1
dist/dev/mp-weixin/app.json

@@ -48,7 +48,7 @@
       },
       {
         "pagePath": "pages/rank/rank",
-        "text": "我的自选",
+        "text": "我的股票",
         "iconPath": "/static/images/tab_rank.png",
         "selectedIconPath": "/static/images/tab_rank_active.png"
       },

+ 1 - 1
dist/dev/mp-weixin/components/HistorySearchCard.js

@@ -110,7 +110,7 @@ const _sfc_main = {
     };
     const onSearch = () => {
       if (!props.canSearch) {
-        common_vendor.index.showToast({ title: "请先订阅该标的池", icon: "none" });
+        common_vendor.index.showToast({ title: "请先订阅该股票池", icon: "none" });
         return;
       }
       if (!startDate.value || !endDate.value) {

File diff ditekan karena terlalu besar
+ 0 - 0
dist/dev/mp-weixin/components/HistorySearchCard.wxml


+ 2 - 2
dist/dev/mp-weixin/pages/index/index.js

@@ -87,7 +87,7 @@ const _sfc_main = {
       const kw = (keyword.value || "").trim();
       if (!kw) {
         common_vendor.index.showToast({
-          title: "请输入市场代码或名称",
+          title: "请输入股票代码或名称",
           icon: "none"
         });
         return;
@@ -115,7 +115,7 @@ const _sfc_main = {
         if (stockRes.code === 200 && stockRes.data) {
           result.value = stockRes.data;
         } else {
-          errorMsg.value = stockRes.message || "未查询到相关市场数据";
+          errorMsg.value = stockRes.message || "未查询到相关股票数据";
         }
         if (historyRes.code === 200 && historyRes.data && historyRes.data.found) {
           historyData.value = historyRes.data;

File diff ditekan karena terlalu besar
+ 0 - 0
dist/dev/mp-weixin/pages/index/index.wxml


+ 4 - 4
dist/dev/mp-weixin/pages/pool/pool.js

@@ -103,7 +103,7 @@ const _sfc_main = {
           stockList.value = res.data;
         }
       } catch (e) {
-        console.error("加载标的池失败:", e);
+        console.error("加载股票池失败:", e);
       }
     };
     const loadAndStartRefresh = async () => {
@@ -185,7 +185,7 @@ const _sfc_main = {
       if (!checkLogin()) {
         common_vendor.index.showModal({
           title: "登录提示",
-          content: "添加自选需要登录,是否前往登录?",
+          content: "添加自选股票需要登录,是否前往登录?",
           confirmText: "去登录",
           cancelText: "取消",
           success: (res) => {
@@ -218,13 +218,13 @@ const _sfc_main = {
         if (addRes.code === 200 && addRes.data === true) {
           common_vendor.index.showToast({ title: "添加成功", icon: "success" });
         } else if (addRes.code === 200 && addRes.data === false) {
-          common_vendor.index.showToast({ title: "标的已存在", icon: "none" });
+          common_vendor.index.showToast({ title: "股票已存在", icon: "none" });
         } else {
           common_vendor.index.showToast({ title: addRes.message || "添加失败", icon: "none" });
         }
       } catch (e) {
         common_vendor.index.hideLoading();
-        console.error("添加标的失败:", e);
+        console.error("添加股票失败:", e);
         common_vendor.index.showToast({ title: "添加失败", icon: "none" });
       }
     };

File diff ditekan karena terlalu besar
+ 0 - 0
dist/dev/mp-weixin/pages/rank/rank.wxml


+ 4 - 4
dist/dev/mp-weixin/pages/strong/strong.js

@@ -76,7 +76,7 @@ const _sfc_main = {
           stockList.value = res.data;
         }
       } catch (e) {
-        console.error("加载标的池失败:", e);
+        console.error("加载股票池失败:", e);
       }
     };
     const loadAndStartRefresh = async () => {
@@ -161,7 +161,7 @@ const _sfc_main = {
       if (!utils_auth.isLoggedIn()) {
         common_vendor.index.showModal({
           title: "登录提示",
-          content: "添加自选需要登录,是否前往登录?",
+          content: "添加自选股票需要登录,是否前往登录?",
           confirmText: "去登录",
           cancelText: "取消",
           success: (res) => {
@@ -194,13 +194,13 @@ const _sfc_main = {
         if (addRes.code === 200 && addRes.data === true) {
           common_vendor.index.showToast({ title: "添加成功", icon: "success" });
         } else if (addRes.code === 200 && addRes.data === false) {
-          common_vendor.index.showToast({ title: "标的已存在", icon: "none" });
+          common_vendor.index.showToast({ title: "股票已存在", icon: "none" });
         } else {
           common_vendor.index.showToast({ title: addRes.message || "添加失败", icon: "none" });
         }
       } catch (e) {
         common_vendor.index.hideLoading();
-        console.error("添加标的失败:", e);
+        console.error("添加股票失败:", e);
         common_vendor.index.showToast({ title: "添加失败", icon: "none" });
       }
     };

+ 1 - 2
dist/dev/mp-weixin/project.config.json

@@ -9,8 +9,7 @@
     "postcss": false,
     "minified": false,
     "newFeature": true,
-    "bigPackageSizeSupport": true,
-    "minifyWXML": true
+    "bigPackageSizeSupport": true
   },
   "compileType": "miniprogram",
   "libVersion": "",

+ 1 - 1
dist/dev/mp-weixin/utils/api.js

@@ -2,7 +2,7 @@
 const common_vendor = require("../common/vendor.js");
 const ENV = "prod";
 const CONFIG = {
-  dev: "http://192.168.1.171:8081",
+  dev: "http://localhost:8081",
   // 开发环境
   local: "http://10.167.44.71:8081",
   prod: "https://www.whzhangsheng.cn/applet-api"

+ 27 - 2
src/pages/order/order.vue

@@ -87,14 +87,32 @@
 </template>
 
 <script setup>
-import { ref, onMounted } from 'vue'
-import { onLoad, onShow } from '@dcloudio/uni-app'
+import { ref, onMounted, onUnmounted } from 'vue'
+import { onLoad, onShow, onHide } from '@dcloudio/uni-app'
 import { isLoggedIn as checkLoginStatus } from '../../utils/auth.js'
 import { getUserOrders, repayOrder, wxPay, queryOrder } from '../../utils/api.js'
 
 const orders = ref([])
 const loading = ref(false)
 const isLoggedIn = ref(false)
+let refreshTimer = null
+
+const startAutoRefresh = () => {
+  stopAutoRefresh()
+  if (!isLoggedIn.value) return
+  refreshTimer = setInterval(() => {
+    if (isLoggedIn.value) {
+      loadOrders()
+    }
+  }, 30000)
+}
+
+const stopAutoRefresh = () => {
+  if (refreshTimer) {
+    clearInterval(refreshTimer)
+    refreshTimer = null
+  }
+}
 
 const checkLogin = () => {
   isLoggedIn.value = checkLoginStatus()
@@ -184,6 +202,13 @@ onMounted(() => {
 onShow(() => {
   checkLogin()
   if (isLoggedIn.value) loadOrders()
+  startAutoRefresh()
+})
+onHide(() => {
+  stopAutoRefresh()
+})
+onUnmounted(() => {
+  stopAutoRefresh()
 })
 </script>
 

+ 22 - 0
src/pages/pool/pool.vue

@@ -103,6 +103,7 @@ const shortPrice = ref(1) // 超短池价格,默认1
 
 const stockList = ref([])
 let refreshTimer = null
+let subscriptionTimer = null
 
 // 性能统计数据
 const performanceStats = reactive({
@@ -170,6 +171,23 @@ const stopAutoRefresh = () => {
   }
 }
 
+const startSubscriptionRefresh = () => {
+  stopSubscriptionRefresh()
+  if (!isPageVisible.value) return
+  subscriptionTimer = setInterval(() => {
+    if (isPageVisible.value) {
+      checkPurchaseStatus()
+    }
+  }, 30000)
+}
+
+const stopSubscriptionRefresh = () => {
+  if (subscriptionTimer) {
+    clearInterval(subscriptionTimer)
+    subscriptionTimer = null
+  }
+}
+
 // 检查登录状态
 const checkLogin = () => {
   isLoggedIn.value = checkLoginStatus()
@@ -364,12 +382,14 @@ onLoad(() => {
   console.log('[超短池] onLoad')
   isPageVisible.value = true
   checkPurchaseStatus()
+  startSubscriptionRefresh()
 })
 
 onShow(() => {
   console.log('[超短池] onShow')
   isPageVisible.value = true
   checkPurchaseStatus()
+  startSubscriptionRefresh()
   uni.setNavigationBarTitle({ title: '量化交易大师' })
 })
 
@@ -377,11 +397,13 @@ onHide(() => {
   console.log('[超短池] onHide')
   isPageVisible.value = false
   stopAutoRefresh()
+  stopSubscriptionRefresh()
 })
 
 onUnmounted(() => {
   isPageVisible.value = false
   stopAutoRefresh()
+  stopSubscriptionRefresh()
 })
 </script>
 

+ 22 - 0
src/pages/strong/strong.vue

@@ -93,6 +93,7 @@ const strongPrice = ref(98) // 强势池价格,默认98
 
 const stockList = ref([])
 let refreshTimer = null
+let subscriptionTimer = null
 
 // 获取涨跌样式
 const getChangeClass = (changePercent) => {
@@ -135,6 +136,23 @@ const stopAutoRefresh = () => {
   }
 }
 
+const startSubscriptionRefresh = () => {
+  stopSubscriptionRefresh()
+  if (!isPageVisible.value) return
+  subscriptionTimer = setInterval(() => {
+    if (isPageVisible.value) {
+      checkPurchaseStatus()
+    }
+  }, 30000)
+}
+
+const stopSubscriptionRefresh = () => {
+  if (subscriptionTimer) {
+    clearInterval(subscriptionTimer)
+    subscriptionTimer = null
+  }
+}
+
 // 检查购买状态(从后端查询)
 const checkPurchaseStatus = async () => {
   if (!checkLoginStatus()) {
@@ -328,12 +346,14 @@ onLoad(() => {
   console.log('[强势池] onLoad')
   isPageVisible.value = true
   checkPurchaseStatus()
+  startSubscriptionRefresh()
 })
 
 onShow(() => {
   console.log('[强势池] onShow')
   isPageVisible.value = true
   checkPurchaseStatus()
+  startSubscriptionRefresh()
   uni.setNavigationBarTitle({ title: '量化交易大师' })
 })
 
@@ -341,11 +361,13 @@ onHide(() => {
   console.log('[强势池] onHide')
   isPageVisible.value = false
   stopAutoRefresh()
+  stopSubscriptionRefresh()
 })
 
 onUnmounted(() => {
   isPageVisible.value = false
   stopAutoRefresh()
+  stopSubscriptionRefresh()
 })
 </script>
 

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini