Selaa lähdekoodia

图片存储修改

Zhangbw 2 kuukautta sitten
vanhempi
sitoutus
df18da3860

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

@@ -32,32 +32,32 @@
       {
         "pagePath": "pages/index/index",
         "text": "打分查询",
-        "iconPath": "/static/images/tab_search.png",
-        "selectedIconPath": "/static/images/tab_search_active.png"
+        "iconPath": "static/images/tab_search.png",
+        "selectedIconPath": "static/images/tab_search_active.png"
       },
       {
         "pagePath": "pages/pool/pool",
         "text": "超短池",
-        "iconPath": "/static/images/tab_short.png",
-        "selectedIconPath": "/static/images/tab_short_active.png"
+        "iconPath": "static/images/tab_short.png",
+        "selectedIconPath": "static/images/tab_short_active.png"
       },
       {
         "pagePath": "pages/strong/strong",
         "text": "强势池",
-        "iconPath": "/static/images/tab_strong.png",
-        "selectedIconPath": "/static/images/tab_strong_active.png"
+        "iconPath": "static/images/tab_strong.png",
+        "selectedIconPath": "static/images/tab_strong_active.png"
       },
       {
         "pagePath": "pages/rank/rank",
         "text": "我的自选",
-        "iconPath": "/static/images/tab_rank.png",
-        "selectedIconPath": "/static/images/tab_rank_active.png"
+        "iconPath": "static/images/tab_rank.png",
+        "selectedIconPath": "static/images/tab_rank_active.png"
       },
       {
         "pagePath": "pages/mine/mine",
         "text": "个人中心",
-        "iconPath": "/static/images/tab_mine.png",
-        "selectedIconPath": "/static/images/tab_mine_active.png"
+        "iconPath": "static/images/tab_mine.png",
+        "selectedIconPath": "static/images/tab_mine_active.png"
       }
     ]
   },

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

@@ -118,7 +118,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
   return common_vendor.e({
     a: $data.visible
   }, $data.visible ? {
-    b: $data.avatarUrl || "/static/images/head.png",
+    b: $data.avatarUrl || _ctx.getImageUrl("/static/images/head.png"),
     c: common_vendor.o((...args) => $options.handleChooseAvatar && $options.handleChooseAvatar(...args)),
     d: $data.nickname,
     e: common_vendor.o(($event) => $data.nickname = $event.detail.value),

+ 63 - 62
dist/dev/mp-weixin/pages/index/index.js

@@ -226,10 +226,11 @@ const _sfc_main = {
         b: common_vendor.o(handleSearchClick),
         c: common_vendor.o(($event) => showDropdown.value = true),
         d: keyword.value,
-        e: common_vendor.o(handleSearchClick),
-        f: showDropdown.value && suggestions.value && suggestions.value.length > 0
+        e: common_vendor.unref(utils_api.getImageUrl)("/static/images/tab_search.png"),
+        f: common_vendor.o(handleSearchClick),
+        g: showDropdown.value && suggestions.value && suggestions.value.length > 0
       }, showDropdown.value && suggestions.value && suggestions.value.length > 0 ? {
-        g: common_vendor.f(suggestions.value, (item, index, i0) => {
+        h: common_vendor.f(suggestions.value, (item, index, i0) => {
           return {
             a: common_vendor.t(item.name),
             b: common_vendor.t(item.code),
@@ -238,98 +239,98 @@ const _sfc_main = {
           };
         })
       } : {}, {
-        h: common_vendor.t(isLoggedIn.value ? "" : "(需登录)"),
-        i: showDropdown.value && suggestions.value.length > 0
+        i: common_vendor.t(isLoggedIn.value ? "" : "(需登录)"),
+        j: showDropdown.value && suggestions.value.length > 0
       }, showDropdown.value && suggestions.value.length > 0 ? {
-        j: common_vendor.o(closeDropdown)
+        k: common_vendor.o(closeDropdown)
       } : {}, {
-        k: hasSearched.value
+        l: hasSearched.value
       }, hasSearched.value ? common_vendor.e({
-        l: loading.value
+        m: loading.value
       }, loading.value ? {} : errorMsg.value ? {
-        n: common_vendor.t(errorMsg.value)
+        o: common_vendor.t(errorMsg.value)
       } : result.value ? common_vendor.e({
-        p: common_vendor.t(result.value.stockName),
-        q: common_vendor.t(result.value.stockCode),
-        r: common_vendor.t(result.value.currentPrice || "--"),
-        s: common_vendor.n(getPriceClass(result.value.changePercent)),
-        t: common_vendor.t(result.value.priceChange || "--"),
-        v: common_vendor.t(result.value.changePercent || "--"),
-        w: common_vendor.n(getPriceClass(result.value.changePercent)),
-        x: result.value.currentPrice
+        q: common_vendor.t(result.value.stockName),
+        r: common_vendor.t(result.value.stockCode),
+        s: common_vendor.t(result.value.currentPrice || "--"),
+        t: common_vendor.n(getPriceClass(result.value.changePercent)),
+        v: common_vendor.t(result.value.priceChange || "--"),
+        w: common_vendor.t(result.value.changePercent || "--"),
+        x: common_vendor.n(getPriceClass(result.value.changePercent)),
+        y: result.value.currentPrice
       }, result.value.currentPrice ? {
-        y: common_vendor.t(result.value.openPrice || "--"),
-        z: common_vendor.t(result.value.highPrice || "--"),
-        A: common_vendor.t(result.value.lowPrice || "--"),
-        B: common_vendor.t(result.value.volume || "--"),
-        C: common_vendor.t(result.value.amount || "--"),
-        D: common_vendor.t(result.value.turnoverRate || "--")
+        z: common_vendor.t(result.value.openPrice || "--"),
+        A: common_vendor.t(result.value.highPrice || "--"),
+        B: common_vendor.t(result.value.lowPrice || "--"),
+        C: common_vendor.t(result.value.volume || "--"),
+        D: common_vendor.t(result.value.amount || "--"),
+        E: common_vendor.t(result.value.turnoverRate || "--")
       } : {}, {
-        E: result.value.score
+        F: result.value.score
       }, result.value.score ? {
-        F: common_vendor.t(result.value.score)
+        G: common_vendor.t(result.value.score)
       } : {}, {
-        G: hasSearched.value && result.value
+        H: hasSearched.value && result.value
       }, hasSearched.value && result.value ? common_vendor.e({
-        H: common_vendor.o(onDateChange),
-        I: historyData.value && historyData.value.recordDate
+        I: common_vendor.o(onDateChange),
+        J: historyData.value && historyData.value.recordDate
       }, historyData.value && historyData.value.recordDate ? {
-        J: common_vendor.t(historyData.value.recordDate)
+        K: common_vendor.t(historyData.value.recordDate)
       } : {}, {
-        K: !historyData.value || !historyData.value.strengthScore && !historyData.value.highTrend
+        L: !historyData.value || !historyData.value.strengthScore && !historyData.value.highTrend
       }, !historyData.value || !historyData.value.strengthScore && !historyData.value.highTrend ? {
-        L: common_vendor.t(selectedDate.value ? "未找到该日期的历史数据" : "暂无历史数据")
+        M: common_vendor.t(selectedDate.value ? "未找到该日期的历史数据" : "暂无历史数据")
       } : common_vendor.e({
-        M: historyData.value.strengthScore !== null && historyData.value.strengthScore !== void 0
+        N: historyData.value.strengthScore !== null && historyData.value.strengthScore !== void 0
       }, historyData.value.strengthScore !== null && historyData.value.strengthScore !== void 0 ? {
-        N: common_vendor.t(formatStrengthScore(historyData.value.strengthScore)),
-        O: common_vendor.n(historyData.value.strengthScore >= 0 ? "capsule-up" : "capsule-down")
+        O: common_vendor.t(formatStrengthScore(historyData.value.strengthScore)),
+        P: common_vendor.n(historyData.value.strengthScore >= 0 ? "capsule-up" : "capsule-down")
       } : {}, {
-        P: historyData.value.closePrice
+        Q: historyData.value.closePrice
       }, historyData.value.closePrice ? {
-        Q: common_vendor.t(historyData.value.closePrice)
+        R: common_vendor.t(historyData.value.closePrice)
       } : {}, {
-        R: historyData.value.changePercent
+        S: historyData.value.changePercent
       }, historyData.value.changePercent ? {
-        S: common_vendor.t(formatPercent(historyData.value.changePercent)),
-        T: common_vendor.n(getChangeClass(historyData.value.changePercent))
+        T: common_vendor.t(formatPercent(historyData.value.changePercent)),
+        U: common_vendor.n(getChangeClass(historyData.value.changePercent))
       } : {}, {
-        U: historyData.value.totalAmount
+        V: historyData.value.totalAmount
       }, historyData.value.totalAmount ? {
-        V: common_vendor.t(formatAmount(historyData.value.totalAmount))
+        W: common_vendor.t(formatAmount(historyData.value.totalAmount))
       } : {}, {
-        W: historyData.value.circulationMarketValue
+        X: historyData.value.circulationMarketValue
       }, historyData.value.circulationMarketValue ? {
-        X: common_vendor.t(formatAmount(historyData.value.circulationMarketValue))
+        Y: common_vendor.t(formatAmount(historyData.value.circulationMarketValue))
       } : {}, {
-        Y: historyData.value.mainRisePeriod
+        Z: historyData.value.mainRisePeriod
       }, historyData.value.mainRisePeriod ? {
-        Z: common_vendor.t(historyData.value.mainRisePeriod)
+        aa: common_vendor.t(historyData.value.mainRisePeriod)
       } : {}, {
-        aa: historyData.value.recentLimitUp
+        ab: historyData.value.recentLimitUp
       }, historyData.value.recentLimitUp ? {
-        ab: common_vendor.t(historyData.value.recentLimitUp)
+        ac: common_vendor.t(historyData.value.recentLimitUp)
       } : {}, {
-        ac: historyData.value.dayHighestPrice
+        ad: historyData.value.dayHighestPrice
       }, historyData.value.dayHighestPrice ? {
-        ad: common_vendor.t(historyData.value.dayHighestPrice)
+        ae: common_vendor.t(historyData.value.dayHighestPrice)
       } : {}, {
-        ae: historyData.value.dayLowestPrice
+        af: historyData.value.dayLowestPrice
       }, historyData.value.dayLowestPrice ? {
-        af: common_vendor.t(historyData.value.dayLowestPrice)
+        ag: common_vendor.t(historyData.value.dayLowestPrice)
       } : {}, {
-        ag: historyData.value.dayClosePrice
+        ah: historyData.value.dayClosePrice
       }, historyData.value.dayClosePrice ? {
-        ah: common_vendor.t(historyData.value.dayClosePrice)
+        ai: common_vendor.t(historyData.value.dayClosePrice)
       } : {}, {
-        ai: historyData.value.highTrend !== null && historyData.value.highTrend !== void 0
+        aj: historyData.value.highTrend !== null && historyData.value.highTrend !== void 0
       }, historyData.value.highTrend !== null && historyData.value.highTrend !== void 0 ? {
-        aj: common_vendor.t(formatPercent(historyData.value.highTrend)),
-        ak: common_vendor.n(getChangeClass(historyData.value.highTrend))
+        ak: common_vendor.t(formatPercent(historyData.value.highTrend)),
+        al: common_vendor.n(getChangeClass(historyData.value.highTrend))
       } : {})) : {}, {
-        al: result.value.history && result.value.history.length > 0
+        am: result.value.history && result.value.history.length > 0
       }, result.value.history && result.value.history.length > 0 ? {
-        am: common_vendor.f(result.value.history, (item, index, i0) => {
+        an: common_vendor.f(result.value.history, (item, index, i0) => {
           return {
             a: common_vendor.t(item.date),
             b: common_vendor.t(item.score),
@@ -338,9 +339,9 @@ const _sfc_main = {
           };
         })
       } : {}, {
-        an: result.value.factors && result.value.factors.length > 0
+        ao: result.value.factors && result.value.factors.length > 0
       }, result.value.factors && result.value.factors.length > 0 ? {
-        ao: common_vendor.f(result.value.factors, (item, index, i0) => {
+        ap: common_vendor.f(result.value.factors, (item, index, i0) => {
           return {
             a: common_vendor.t(item.name),
             b: common_vendor.t(item.value),
@@ -348,8 +349,8 @@ const _sfc_main = {
           };
         })
       } : {}) : {}, {
-        m: errorMsg.value,
-        o: result.value
+        n: errorMsg.value,
+        p: result.value
       }) : {});
     };
   }

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/dev/mp-weixin/pages/index/index.wxml


+ 18 - 11
dist/dev/mp-weixin/pages/login/login.js

@@ -24,6 +24,12 @@ const _sfc_main = {
     };
   },
   methods: {
+    /**
+     * 获取图片URL
+     */
+    getImageUrl(url) {
+      return utils_api.getImageUrl(url);
+    },
     /**
      * 返回上一页
      */
@@ -320,21 +326,22 @@ if (!Array) {
 function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
   return common_vendor.e({
     a: common_vendor.o((...args) => $options.handleBack && $options.handleBack(...args)),
-    b: $data.showOneClickLogin
+    b: $options.getImageUrl("/static/images/logo.png"),
+    c: $data.showOneClickLogin
   }, $data.showOneClickLogin ? {
-    c: common_vendor.o((...args) => $options.handleWxLogin && $options.handleWxLogin(...args))
+    d: common_vendor.o((...args) => $options.handleWxLogin && $options.handleWxLogin(...args))
   } : $data.showPhoneAuth ? {
-    e: common_vendor.o((...args) => $options.handleGetPhoneNumber && $options.handleGetPhoneNumber(...args))
+    f: common_vendor.o((...args) => $options.handleGetPhoneNumber && $options.handleGetPhoneNumber(...args))
   } : {
-    f: common_vendor.o((...args) => $options.handleGetUserProfile && $options.handleGetUserProfile(...args))
+    g: common_vendor.o((...args) => $options.handleGetUserProfile && $options.handleGetUserProfile(...args))
   }, {
-    d: $data.showPhoneAuth,
-    g: $data.agreedToTerms,
-    h: common_vendor.o(($event) => $options.showAgreement("user")),
-    i: common_vendor.o(($event) => $options.showAgreement("privacy")),
-    j: common_vendor.o((...args) => $options.handleAgreementChange && $options.handleAgreementChange(...args)),
-    k: common_vendor.sr("userInfoPopup", "cdfe2409-0"),
-    l: common_vendor.o($options.handleUserInfoConfirm)
+    e: $data.showPhoneAuth,
+    h: $data.agreedToTerms,
+    i: common_vendor.o(($event) => $options.showAgreement("user")),
+    j: common_vendor.o(($event) => $options.showAgreement("privacy")),
+    k: common_vendor.o((...args) => $options.handleAgreementChange && $options.handleAgreementChange(...args)),
+    l: common_vendor.sr("userInfoPopup", "cdfe2409-0"),
+    m: common_vendor.o($options.handleUserInfoConfirm)
   });
 }
 const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-cdfe2409"], ["__file", "D:/program/gupiao/gupiao-wx/src/pages/login/login.vue"]]);

+ 1 - 1
dist/dev/mp-weixin/pages/login/login.wxml

@@ -1 +1 @@
-<view class="login-container data-v-cdfe2409"><view class="back-button data-v-cdfe2409" bindtap="{{a}}"><text class="back-icon data-v-cdfe2409">←</text><text class="back-text data-v-cdfe2409">返回</text></view><view class="bg-decoration data-v-cdfe2409"><view class="circle circle-1 data-v-cdfe2409"></view><view class="circle circle-2 data-v-cdfe2409"></view></view><view class="header data-v-cdfe2409"><image class="logo data-v-cdfe2409" src="/static/images/logo.png" mode="aspectFit"></image><text class="title data-v-cdfe2409">量化交易大师</text><text class="subtitle data-v-cdfe2409">专业的市场量化分析工具</text></view><view class="login-actions data-v-cdfe2409"><button wx:if="{{b}}" class="login-btn primary-btn data-v-cdfe2409" bindtap="{{c}}"><text class="btn-text data-v-cdfe2409">微信一键登录</text></button><button wx:elif="{{d}}" class="login-btn primary-btn data-v-cdfe2409" open-type="getPhoneNumber" bindgetphonenumber="{{e}}"><text class="btn-icon data-v-cdfe2409">🔐</text><text class="btn-text data-v-cdfe2409">授权手机号完成注册</text></button><button wx:else class="login-btn primary-btn data-v-cdfe2409" bindtap="{{f}}"><text class="btn-icon data-v-cdfe2409">👤</text><text class="btn-text data-v-cdfe2409">授权登录</text></button><view class="agreement data-v-cdfe2409"><checkbox-group class="data-v-cdfe2409" bindchange="{{j}}"><label class="agreement-label data-v-cdfe2409"><checkbox class="data-v-cdfe2409" checked="{{g}}" color="#5d55e8"/><text class="agreement-text data-v-cdfe2409"> 我已阅读并同意 <text class="link data-v-cdfe2409" catchtap="{{h}}">《用户协议》</text> 和 <text class="link data-v-cdfe2409" catchtap="{{i}}">《隐私政策》</text></text></label></checkbox-group></view></view><user-info-popup class="r data-v-cdfe2409" u-r="userInfoPopup" bindconfirm="{{l}}" u-i="cdfe2409-0" bind:__l="__l"/></view>
+<view class="login-container data-v-cdfe2409"><view class="back-button data-v-cdfe2409" bindtap="{{a}}"><text class="back-icon data-v-cdfe2409">←</text><text class="back-text data-v-cdfe2409">返回</text></view><view class="bg-decoration data-v-cdfe2409"><view class="circle circle-1 data-v-cdfe2409"></view><view class="circle circle-2 data-v-cdfe2409"></view></view><view class="header data-v-cdfe2409"><image class="logo data-v-cdfe2409" src="{{b}}" mode="aspectFit"></image><text class="title data-v-cdfe2409">量化交易大师</text><text class="subtitle data-v-cdfe2409">专业的市场量化分析工具</text></view><view class="login-actions data-v-cdfe2409"><button wx:if="{{c}}" class="login-btn primary-btn data-v-cdfe2409" bindtap="{{d}}"><text class="btn-text data-v-cdfe2409">微信一键登录</text></button><button wx:elif="{{e}}" class="login-btn primary-btn data-v-cdfe2409" open-type="getPhoneNumber" bindgetphonenumber="{{f}}"><text class="btn-icon data-v-cdfe2409">🔐</text><text class="btn-text data-v-cdfe2409">授权手机号完成注册</text></button><button wx:else class="login-btn primary-btn data-v-cdfe2409" bindtap="{{g}}"><text class="btn-icon data-v-cdfe2409">👤</text><text class="btn-text data-v-cdfe2409">授权登录</text></button><view class="agreement data-v-cdfe2409"><checkbox-group class="data-v-cdfe2409" bindchange="{{k}}"><label class="agreement-label data-v-cdfe2409"><checkbox class="data-v-cdfe2409" checked="{{h}}" color="#5d55e8"/><text class="agreement-text data-v-cdfe2409"> 我已阅读并同意 <text class="link data-v-cdfe2409" catchtap="{{i}}">《用户协议》</text> 和 <text class="link data-v-cdfe2409" catchtap="{{j}}">《隐私政策》</text></text></label></checkbox-group></view></view><user-info-popup class="r data-v-cdfe2409" u-r="userInfoPopup" bindconfirm="{{m}}" u-i="cdfe2409-0" bind:__l="__l"/></view>

+ 1 - 1
dist/dev/mp-weixin/pages/mine/mine.js

@@ -92,7 +92,7 @@ const _sfc_main = {
     };
     return (_ctx, _cache) => {
       return common_vendor.e({
-        a: isLoggedIn.value && userInfo.value.avatar ? common_vendor.unref(utils_api.getImageUrl)(userInfo.value.avatar) : "/static/images/head.png",
+        a: isLoggedIn.value && userInfo.value.avatar ? common_vendor.unref(utils_api.getImageUrl)(userInfo.value.avatar) : common_vendor.unref(utils_api.getImageUrl)("/static/images/head.png"),
         b: common_vendor.t(isLoggedIn.value ? userInfo.value.nickname || "微信用户" : "登录/注册"),
         c: common_vendor.o(handleUserCardClick),
         d: common_vendor.o(handleOrderRecord),

+ 3 - 3
dist/dev/mp-weixin/pages/profile/edit.js

@@ -5,7 +5,7 @@ const utils_api = require("../../utils/api.js");
 const _sfc_main = {
   __name: "edit",
   setup(__props) {
-    const avatarUrl = common_vendor.ref("/static/images/head.png");
+    const avatarUrl = common_vendor.ref(utils_api.getImageUrl("/static/images/head.png"));
     const nickname = common_vendor.ref("");
     const phone = common_vendor.ref("");
     const originalAvatar = common_vendor.ref("");
@@ -24,7 +24,7 @@ const _sfc_main = {
     const loadUserInfo = async () => {
       const userInfo = utils_auth.getUserInfo();
       if (userInfo) {
-        avatarUrl.value = userInfo.avatar ? utils_api.getImageUrl(userInfo.avatar) : "/static/images/head.png";
+        avatarUrl.value = userInfo.avatar ? utils_api.getImageUrl(userInfo.avatar) : utils_api.getImageUrl("/static/images/head.png");
         nickname.value = userInfo.nickname || "";
         phone.value = userInfo.phone || "";
         originalAvatar.value = userInfo.avatar || "";
@@ -32,7 +32,7 @@ const _sfc_main = {
       }
       const latestInfo = await utils_auth.refreshUserInfo();
       if (latestInfo) {
-        avatarUrl.value = latestInfo.avatar ? utils_api.getImageUrl(latestInfo.avatar) : "/static/images/head.png";
+        avatarUrl.value = latestInfo.avatar ? utils_api.getImageUrl(latestInfo.avatar) : utils_api.getImageUrl("/static/images/head.png");
         nickname.value = latestInfo.nickname || "";
         phone.value = latestInfo.phone || "";
         originalAvatar.value = latestInfo.avatar || "";

BIN
dist/dev/mp-weixin/static/images/head.png


BIN
dist/dev/mp-weixin/static/images/logo.png


+ 5 - 2
dist/dev/mp-weixin/utils/api.js

@@ -1,6 +1,6 @@
 "use strict";
 const common_vendor = require("../common/vendor.js");
-const ENV = "dev";
+const ENV = "prod";
 const CONFIG = {
   dev: "http://localhost:8081",
   // 开发环境
@@ -16,9 +16,12 @@ const getImageUrl = (url) => {
     console.warn("[getImageUrl] 检测到微信临时路径,无法显示:", url);
     return "";
   }
-  if (url.startsWith("http") || url.startsWith("/static/")) {
+  if (url.startsWith("http")) {
     return url;
   }
+  if (url.startsWith("/static/images/")) {
+    return BASE_URL + url.replace("/static/images/", "/images/");
+  }
   return BASE_URL + url;
 };
 const getToken = () => {

BIN
images/tab_rank.png


BIN
images/tab_rank_active.png


BIN
images/tab_search.png


BIN
images/tab_search_active.png


BIN
images/tab_short.png


BIN
images/tab_short_active.png


+ 4 - 4
src/components/UserInfoPopup.vue

@@ -15,9 +15,9 @@
             open-type="chooseAvatar"
             @chooseavatar="handleChooseAvatar"
           >
-            <image 
-              class="avatar-img" 
-              :src="avatarUrl || '/static/images/head.png'" 
+            <image
+              class="avatar-img"
+              :src="avatarUrl || getImageUrl('/static/images/head.png')"
               mode="aspectFill"
             ></image>
             <view class="avatar-tip">点击选择头像</view>
@@ -47,7 +47,7 @@
 </template>
 
 <script>
-import { uploadFile } from '@/utils/api.js'
+import { uploadFile, getImageUrl } from '@/utils/api.js'
 
 export default {
   data() {

+ 10 - 10
src/pages.json

@@ -92,32 +92,32 @@
       {
         "pagePath": "pages/index/index",
         "text": "打分查询",
-        "iconPath": "/static/images/tab_search.png",
-        "selectedIconPath": "/static/images/tab_search_active.png"
+        "iconPath": "static/images/tab_search.png",
+        "selectedIconPath": "static/images/tab_search_active.png"
       },
       {
         "pagePath": "pages/pool/pool",
         "text": "超短池",
-        "iconPath": "/static/images/tab_short.png",
-        "selectedIconPath": "/static/images/tab_short_active.png"
+        "iconPath": "static/images/tab_short.png",
+        "selectedIconPath": "static/images/tab_short_active.png"
       },
       {
         "pagePath": "pages/strong/strong",
         "text": "强势池",
-        "iconPath": "/static/images/tab_strong.png",
-        "selectedIconPath": "/static/images/tab_strong_active.png"
+        "iconPath": "static/images/tab_strong.png",
+        "selectedIconPath": "static/images/tab_strong_active.png"
       },
       {
         "pagePath": "pages/rank/rank",
         "text": "我的自选",
-        "iconPath": "/static/images/tab_rank.png",
-        "selectedIconPath": "/static/images/tab_rank_active.png"
+        "iconPath": "static/images/tab_rank.png",
+        "selectedIconPath": "static/images/tab_rank_active.png"
       },
       {
         "pagePath": "pages/mine/mine",
         "text": "个人中心",
-        "iconPath": "/static/images/tab_mine.png",
-        "selectedIconPath": "/static/images/tab_mine_active.png"
+        "iconPath": "static/images/tab_mine.png",
+        "selectedIconPath": "static/images/tab_mine_active.png"
       }
     ]
   }

+ 2 - 2
src/pages/index/index.vue

@@ -21,7 +21,7 @@
             />
             <!-- 搜索按钮(统一处理登录检查) -->
             <view class="search-button" @click="handleSearchClick">
-              <image class="search-icon" src="/static/images/tab_search.png" mode="aspectFit"></image>
+              <image class="search-icon" :src="getImageUrl('/static/images/tab_search.png')" mode="aspectFit"></image>
             </view>
           </view>
 
@@ -247,7 +247,7 @@
 
 <script setup>
 import { ref, onMounted } from 'vue'
-import { getSuggestions, searchStocks, searchStockHistory } from '../../utils/api.js'
+import { getSuggestions, searchStocks, searchStockHistory, getImageUrl } from '../../utils/api.js'
 import { isLoggedIn as checkLoginStatus } from '../../utils/auth.js'
 import DateSelector from '../../components/DateSelector.vue'
 

+ 9 - 2
src/pages/login/login.vue

@@ -14,7 +14,7 @@
 
     <!-- Logo和标题 -->
     <view class="header">
-      <image class="logo" src="/static/images/logo.png" mode="aspectFit"></image>
+      <image class="logo" :src="getImageUrl('/static/images/logo.png')" mode="aspectFit"></image>
       <text class="title">量化交易大师</text>
       <text class="subtitle">专业的市场量化分析工具</text>
     </view>
@@ -77,7 +77,7 @@
 
 <script>
 import { wxSilentLogin, wxPhoneLogin, wxCompleteUserInfo } from '@/utils/auth.js'
-import { uploadFile, updateUserProfile } from '@/utils/api.js'
+import { uploadFile, updateUserProfile, getImageUrl } from '@/utils/api.js'
 import UserInfoPopup from '@/components/UserInfoPopup.vue'
 
 export default {
@@ -97,6 +97,13 @@ export default {
   },
 
   methods: {
+    /**
+     * 获取图片URL
+     */
+    getImageUrl(url) {
+      return getImageUrl(url)
+    },
+
     /**
      * 返回上一页
      */

+ 3 - 3
src/pages/mine/mine.vue

@@ -5,9 +5,9 @@
         <!-- 用户信息卡片 -->
         <view class="user-info-card" @click="handleUserCardClick">
           <view class="user-header">
-            <image 
-              class="user-avatar" 
-              :src="isLoggedIn && userInfo.avatar ? getImageUrl(userInfo.avatar) : '/static/images/head.png'" 
+            <image
+              class="user-avatar"
+              :src="isLoggedIn && userInfo.avatar ? getImageUrl(userInfo.avatar) : getImageUrl('/static/images/head.png')"
               mode="aspectFill"
             ></image>
             <view class="user-details">

+ 3 - 3
src/pages/profile/edit.vue

@@ -64,7 +64,7 @@ import { onShow } from '@dcloudio/uni-app'
 import { getUserInfo, setUserInfo, refreshUserInfo } from '@/utils/auth.js'
 import { updateUserProfile, getImageUrl, BASE_URL } from '@/utils/api.js'
 
-const avatarUrl = ref('/static/images/head.png')
+const avatarUrl = ref(getImageUrl('/static/images/head.png'))
 const nickname = ref('')
 const phone = ref('')
 const originalAvatar = ref('')
@@ -88,7 +88,7 @@ const loadUserInfo = async () => {
   // 先显示本地缓存
   const userInfo = getUserInfo()
   if (userInfo) {
-    avatarUrl.value = userInfo.avatar ? getImageUrl(userInfo.avatar) : '/static/images/head.png'
+    avatarUrl.value = userInfo.avatar ? getImageUrl(userInfo.avatar) : getImageUrl('/static/images/head.png')
     nickname.value = userInfo.nickname || ''
     phone.value = userInfo.phone || ''
     originalAvatar.value = userInfo.avatar || ''
@@ -98,7 +98,7 @@ const loadUserInfo = async () => {
   // 刷新最新状态
   const latestInfo = await refreshUserInfo()
   if (latestInfo) {
-    avatarUrl.value = latestInfo.avatar ? getImageUrl(latestInfo.avatar) : '/static/images/head.png'
+    avatarUrl.value = latestInfo.avatar ? getImageUrl(latestInfo.avatar) : getImageUrl('/static/images/head.png')
     nickname.value = latestInfo.nickname || ''
     phone.value = latestInfo.phone || ''
     originalAvatar.value = latestInfo.avatar || ''

BIN
src/static/images/head.png


BIN
src/static/images/logo.png


+ 9 - 3
src/utils/api.js

@@ -4,7 +4,7 @@
 
 // ============ 配置区域 ============
 
-const ENV = 'dev' // 'dev' | 'prod'
+const ENV = 'prod' // 'dev' | 'prod'
 
 const CONFIG = {
   dev: 'http://localhost:8081',      // 开发环境
@@ -30,10 +30,16 @@ export const getImageUrl = (url) => {
     return ''
   }
 
-  // 已经是完整URL或本地静态资源,直接返回
-  if (url.startsWith('http') || url.startsWith('/static/')) {
+  // 已经是完整URL,直接返回
+  if (url.startsWith('http')) {
     return url
   }
+
+  // 本地静态资源路径,转换为服务器路径
+  if (url.startsWith('/static/images/')) {
+    return BASE_URL + url.replace('/static/images/', '/images/')
+  }
+
   // 相对路径,拼接BASE_URL
   return BASE_URL + url
 }

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä