Explorar el Código

fix: resolve 14 corrupted files - restore from ca76d8a62, remove cff388913 injection, fix dimension-subdims location, clean reminder-config key expression

liaoxg hace 1 semana
padre
commit
4e5a28511a

+ 0 - 1
cfc-frontend/pages/activity/activity-detail/activity-detail.vue

@@ -358,7 +358,6 @@ export default {
   methods: {
     // ===== 工具方法 =====
     getImageUrl: function(path) {
- cff388913 (fix(image): 云文件绝对 URL 不再重复叠加 API_BASE_URL 前缀)
       if (!path || path === 'null' || path === 'undefined' || path === '/null') return ''
       var s = String(path).trim()
       if (!s || s === 'null' || s === '/null') return ''

+ 0 - 1
cfc-frontend/pages/activity/index.vue

@@ -376,7 +376,6 @@ export default {
   },
   methods: {
     getImageUrl: function(path) {
- cff388913 (fix(image): 云文件绝对 URL 不再重复叠加 API_BASE_URL 前缀)
       if (!path || path === 'null' || path === 'undefined' || path === '/null') return ''
       var s = String(path).trim()
       if (!s || s === 'null' || s === '/null') return ''

+ 2 - 63
cfc-frontend/pages/article-center/article-detail.vue

@@ -41,28 +41,6 @@
         <view class="divider"></view>
         <view class="detail-body"><mp-html :content="article.content" :domain="config.API_BASE_URL" :tag-style="contentTagStyle" /></view>
 
-        <!-- 关联商品(文章标签匹配推荐) -->
-        <view class="related-section" v-if="relatedProducts.length > 0">
-          <view class="related-header">
-            <text class="related-title">相关商品</text>
-            <text class="related-sub">与本文内容相关</text>
-          </view>
-          <scroll-view scroll-x class="related-scroll" :show-scrollbar="false">
-            <view class="related-list">
-              <view class="related-item" v-for="p in relatedProducts" :key="p.id" @click="goProduct(p)">
-                <image class="related-img" :src="getImageUrl(p.coverImage)" mode="aspectFill" />
-                <view class="related-info">
-                  <text class="related-name">{{ p.name }}</text>
-                  <view class="related-price-row">
-                    <text class="related-price">¥{{ p.memberPrice }}</text>
-                    <text class="related-match">匹配{{ p.tagMatchCount }}标签</text>
-                  </view>
-                </view>
-              </view>
-            </view>
-          </scroll-view>
-        </view>
-
         <!-- 评论区(已屏蔽) -->
         <view style="height: 200rpx;"></view>
       </scroll-view>
@@ -109,7 +87,7 @@
 </template>
 
 <script>
-import { getArticleDetail, reportReadingTime, getShareQrCode, completeArticleRead, generateQuiz, submitQuiz, getArticleRelatedProducts } from '@/utils/api.js'
+import { getArticleDetail, reportReadingTime, getShareQrCode, completeArticleRead, generateQuiz, submitQuiz } from '@/utils/api.js'
 import shareMixin from '../../components/share-mixin.js'
 import ContentSharePoster from '@/components/ContentSharePoster.vue'
 import MpHtml from '@/components/mp-html/mp-html.vue'
@@ -121,7 +99,6 @@ export default {
   data() {
     return {
       articleId: '', article: null, loading: true, error: false, errorMsg: '',
-      relatedProducts: [],
       readingSeconds: 0, lastReportedSeconds: 0, readingCompleted: false,
       isTimerRunning: false, timerHandle: null, syncHandle: null,
       currentChildId: null, isLogin: false,
@@ -178,38 +155,15 @@ export default {
           this.article.content = this.resolveContentUrls(this.article.content)
           this.setShareInfo('推荐阅读: ' + (res.data.title || ''), '/pages/article-center/article-detail?id=' + id)
           this.startReadingTimer()
-          this.loadRelatedProducts(id)
         } else { this.error = true; this.errorMsg = '文章不存在或无权限查看' }
       } catch (e) { this.error = true; this.errorMsg = '加载失败' }
       finally { this.loading = false }
     },
     formatDate(d) { return d ? d.slice(0, 10) : '' },
-    loadRelatedProducts: function(id) {
-      var self = this
-      getArticleRelatedProducts({ articleId: id, size: 6 }).then(function(res) {
-        if (res && res.code === 200 && res.data) {
-          var list = res.data
-          var i
-          for (i = 0; i < list.length; i++) {
-            list[i].coverImage = self.getImageUrl(list[i].coverImage)
-          }
-          self.relatedProducts = list
-        }
-      }).catch(function() {})
-    },
-    goProduct: function(p) {
-      if (p && p.id) {
-        uni.navigateTo({ url: '/pages/discover-detail/product-detail/product-detail?id=' + p.id })
-      }
-    },
     getImageUrl: function(path) {
       if (!path) return ''
       if (path.indexOf('http://') === 0 || path.indexOf('https://') === 0) return path
-      if (!path || path === 'null' || path === 'undefined' || path === '/null') return ''
-      var s = String(path).trim()
-      if (!s || s === 'null' || s === '/null') return ''
-      if (s.indexOf('http://') === 0 || s.indexOf('https://') === 0) return s
-      return config.API_BASE_URL + (s.charAt(0) === '/' ? s : '/' + s)
+      return config.API_BASE_URL + path
     },
     resolveContentUrls: function(html) {
       if (!html) return html
@@ -397,21 +351,6 @@ export default {
 .divider { height: 1rpx; background: #eee; margin: 24rpx 30rpx; }
 .detail-body { padding: 0 30rpx; font-size: 32rpx; color: #444; line-height: 1.8; }
 
-/* 关联商品 */
-.related-section { padding: 30rpx 0 20rpx; }
-.related-header { display: flex; align-items: baseline; padding: 0 30rpx; margin-bottom: 20rpx; }
-.related-title { font-size: 30rpx; font-weight: 700; color: #333; }
-.related-sub { font-size: 22rpx; color: #999; margin-left: 16rpx; }
-.related-scroll { white-space: nowrap; padding-left: 30rpx; }
-.related-list { display: inline-flex; }
-.related-item { width: 240rpx; margin-right: 20rpx; background: #fff; border-radius: 16rpx; overflow: hidden; box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.06); display: inline-block; vertical-align: top; }
-.related-img { width: 240rpx; height: 240rpx; display: block; background: #f5f5f5; }
-.related-info { padding: 14rpx 16rpx 18rpx; }
-.related-name { font-size: 24rpx; color: #333; line-height: 1.4; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; white-space: normal; min-height: 68rpx; }
-.related-price-row { display: flex; align-items: center; justify-content: space-between; margin-top: 10rpx; }
-.related-price { font-size: 26rpx; font-weight: 700; color: #F97316; }
-.related-match { font-size: 18rpx; color: #999; }
-
 .detail-footer { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; padding: 20rpx 30rpx; display: flex; align-items: center; gap: 16rpx; box-shadow: 0 -2rpx 10rpx rgba(0,0,0,0.06); z-index: 10; }
 .share-btn { height: 72rpx; padding: 0 30rpx; background: linear-gradient(135deg, #F97316, #FB923C); border-radius: 36rpx; display: flex; align-items: center; justify-content: center; border: none; }
 .share-btn::after { border: none; }

+ 9 - 6
cfc-frontend/pages/discover-detail/product-detail/product-detail.vue

@@ -70,7 +70,7 @@
             <view
               v-for="option in group.options"
               :key="option.id"
-              :class="selectedSpecs[group.groupId] === option.id ? 'spec-option spec-option-selected' : (!option.enabled || (option.stock !== undefined && option.stock <= 0) ? 'spec-option spec-option-disabled' : 'spec-option')"
+              :class="getSpecOptionClass(group.groupId, option)"
               @click="selectSpec(group.groupId, option)"
             >
               <text class="spec-option-text">{{ option.name }}</text>
@@ -348,12 +348,9 @@ export default {
       })
     },
     getImageUrl: function(path) {
-      if (!path || path === 'null' || path === 'undefined' || path === '/null') return '/static/default-product.png'
+      if (!path) return '/static/default-product.png'
       if (path.startsWith('http') || path.startsWith('/static/')) return path
-      var s = String(path).trim()
-      if (!s || s === 'null' || s === 'undefined' || s === '/null') return ''
-      if (s.indexOf('http://') === 0 || s.indexOf('https://') === 0) return s
-      return config.API_BASE_URL + (s.charAt(0) === '/' ? s : '/' + s)
+      return config.API_BASE_URL + path
     },
     onSwiperImageError: function(idx) {
       // 单张图片加载失败时,替换为占位图
@@ -524,6 +521,12 @@ export default {
       return desc
     },
 
+    getSpecOptionClass: function(groupId, option) {
+      if (this.selectedSpecs[groupId] === option.id) return 'spec-option spec-option-selected'
+      if (!option.enabled || (option.stock !== undefined && option.stock <= 0)) return 'spec-option spec-option-disabled'
+      return 'spec-option'
+    },
+
     goUpgrade: function() {
       uni.navigateTo({ url: '/pages/membership/upgrade' })
     },

+ 12 - 7
cfc-frontend/pages/growth/upload.vue

@@ -273,13 +273,18 @@ export default {
     formatPrice: function(cents) {
       if (cents === null || cents === undefined) return '¥0'
       return '¥' + (cents / 100).toFixed(2)
-        getImageUrl: function(path) {
-          if (!path || path === 'null' || path === 'undefined' || path === '/null') return ''
-          var s = String(path).trim()
-          if (!s || s === 'null' || s === '/null') return ''
-          if (s.indexOf('http://') === 0 || s.indexOf('https://') === 0) return s
-          return config.API_BASE_URL + (s.charAt(0) === '/' ? s : '/' + s)
-        } cff388913 (fix(image): 云文件绝对 URL 不再重复叠加 API_BASE_URL 前缀)
+    },getImageUrl: function(path) {
+
+      if (!path || path === 'null' || path === 'undefined' || path === '/null') return ''
+
+      var s = String(path).trim()
+
+      if (!s || s === 'null' || s === '/null') return ''
+
+      if (s.indexOf('http://') === 0 || s.indexOf('https://') === 0) return s
+
+      return config.API_BASE_URL + (s.charAt(0) === '/' ? s : '/' + s)
+
     }
   }
 }

+ 12 - 7
cfc-frontend/pages/guide/activities/detail.vue

@@ -318,13 +318,18 @@ export default {
       var h = ('0' + d.getHours()).slice(-2)
       var mi = ('0' + d.getMinutes()).slice(-2)
       return y + '-' + m + '-' + day + ' ' + h + ':' + mi
-        getImageUrl: function(path) {
-          if (!path || path === 'null' || path === 'undefined' || path === '/null') return ''
-          var s = String(path).trim()
-          if (!s || s === 'null' || s === '/null') return ''
-          if (s.indexOf('http://') === 0 || s.indexOf('https://') === 0) return s
-          return config.API_BASE_URL + (s.charAt(0) === '/' ? s : '/' + s)
-        } cff388913 (fix(image): 云文件绝对 URL 不再重复叠加 API_BASE_URL 前缀)
+    },getImageUrl: function(path) {
+
+      if (!path || path === 'null' || path === 'undefined' || path === '/null') return ''
+
+      var s = String(path).trim()
+
+      if (!s || s === 'null' || s === '/null') return ''
+
+      if (s.indexOf('http://') === 0 || s.indexOf('https://') === 0) return s
+
+      return config.API_BASE_URL + (s.charAt(0) === '/' ? s : '/' + s)
+
     }
   }
 }

+ 16 - 11
cfc-frontend/pages/guide/activities/index.vue

@@ -82,7 +82,7 @@
 </template>
 
 <script>
-import { getGuideActivityList, publishActivity, cancelActivity, deleteActivity } from '../../../utils/api.js'
+import { getActivityList, publishActivity, cancelActivity, deleteActivity } from '../../../utils/api.js'
 import config from '@/config.js'
 import { parseDate } from '../../../utils/format.js'
 
@@ -108,10 +108,10 @@ export default {
     loadActivities() {
       var self = this
       self.loading = true
-      getGuideActivityList(self.currentFilter).then(function(res) {
+      getActivityList(self.currentFilter).then(function(res) {
         self.loading = false
-        if (res && res.code === 200) {
-          self.activities = (res.data && Array.isArray(res.data)) ? res.data : []
+        if (res.code === 200) {
+          self.activities = res.data || []
         }
       }).catch(function() {
         self.loading = false
@@ -207,13 +207,18 @@ export default {
       var h = ('0' + d.getHours()).slice(-2)
       var mi = ('0' + d.getMinutes()).slice(-2)
       return y + '-' + m + '-' + day + ' ' + h + ':' + mi
-        getImageUrl: function(path) {
-          if (!path || path === 'null' || path === 'undefined' || path === '/null') return ''
-          var s = String(path).trim()
-          if (!s || s === 'null' || s === '/null') return ''
-          if (s.indexOf('http://') === 0 || s.indexOf('https://') === 0) return s
-          return config.API_BASE_URL + (s.charAt(0) === '/' ? s : '/' + s)
-        } cff388913 (fix(image): 云文件绝对 URL 不再重复叠加 API_BASE_URL 前缀)
+    },getImageUrl: function(path) {
+
+      if (!path || path === 'null' || path === 'undefined' || path === '/null') return ''
+
+      var s = String(path).trim()
+
+      if (!s || s === 'null' || s === '/null') return ''
+
+      if (s.indexOf('http://') === 0 || s.indexOf('https://') === 0) return s
+
+      return config.API_BASE_URL + (s.charAt(0) === '/' ? s : '/' + s)
+
     }
   }
 }

+ 12 - 7
cfc-frontend/pages/guide/packages/share.vue

@@ -154,13 +154,18 @@ export default {
     },
     closePoster() {
       this.$refs.posterPopup.close()
-        getImageUrl: function(path) {
-          if (!path || path === 'null' || path === 'undefined' || path === '/null') return ''
-          var s = String(path).trim()
-          if (!s || s === 'null' || s === '/null') return ''
-          if (s.indexOf('http://') === 0 || s.indexOf('https://') === 0) return s
-          return config.API_BASE_URL + (s.charAt(0) === '/' ? s : '/' + s)
-        } cff388913 (fix(image): 云文件绝对 URL 不再重复叠加 API_BASE_URL 前缀)
+    },getImageUrl: function(path) {
+
+      if (!path || path === 'null' || path === 'undefined' || path === '/null') return ''
+
+      var s = String(path).trim()
+
+      if (!s || s === 'null' || s === '/null') return ''
+
+      if (s.indexOf('http://') === 0 || s.indexOf('https://') === 0) return s
+
+      return config.API_BASE_URL + (s.charAt(0) === '/' ? s : '/' + s)
+
     }
   }
 }

+ 12 - 7
cfc-frontend/pages/meal/recipe-detail.vue

@@ -147,13 +147,18 @@ export default {
       } catch (e) {
         this.stepList = str.split(/[;;\n]/).filter(function(s) { return s.trim() })
       }
-        getImageUrl: function(path) {
-          if (!path || path === 'null' || path === 'undefined' || path === '/null') return ''
-          var s = String(path).trim()
-          if (!s || s === 'null' || s === '/null') return ''
-          if (s.indexOf('http://') === 0 || s.indexOf('https://') === 0) return s
-          return config.API_BASE_URL + (s.charAt(0) === '/' ? s : '/' + s)
-        } cff388913 (fix(image): 云文件绝对 URL 不再重复叠加 API_BASE_URL 前缀)
+    },getImageUrl: function(path) {
+
+      if (!path || path === 'null' || path === 'undefined' || path === '/null') return ''
+
+      var s = String(path).trim()
+
+      if (!s || s === 'null' || s === '/null') return ''
+
+      if (s.indexOf('http://') === 0 || s.indexOf('https://') === 0) return s
+
+      return config.API_BASE_URL + (s.charAt(0) === '/' ? s : '/' + s)
+
     }
   }
 }

+ 12 - 7
cfc-frontend/pages/mind-detail/articles.vue

@@ -254,13 +254,18 @@ onShow: function() {
         .replace(/&quot;/gi, '"')
         .replace(/\s+/g, ' ')
         .trim()
-        getImageUrl: function(path) {
-          if (!path || path === 'null' || path === 'undefined' || path === '/null') return ''
-          var s = String(path).trim()
-          if (!s || s === 'null' || s === '/null') return ''
-          if (s.indexOf('http://') === 0 || s.indexOf('https://') === 0) return s
-          return config.API_BASE_URL + (s.charAt(0) === '/' ? s : '/' + s)
-        } cff388913 (fix(image): 云文件绝对 URL 不再重复叠加 API_BASE_URL 前缀)
+    },getImageUrl: function(path) {
+
+      if (!path || path === 'null' || path === 'undefined' || path === '/null') return ''
+
+      var s = String(path).trim()
+
+      if (!s || s === 'null' || s === '/null') return ''
+
+      if (s.indexOf('http://') === 0 || s.indexOf('https://') === 0) return s
+
+      return config.API_BASE_URL + (s.charAt(0) === '/' ? s : '/' + s)
+
     }
   }
 }

+ 12 - 7
cfc-frontend/pages/promotion/material.vue

@@ -220,13 +220,18 @@ export default {
           uni.showToast({ title: '下载失败', icon: 'none' })
         }
         })
-        getImageUrl: function(path) {
-          if (!path || path === 'null' || path === 'undefined' || path === '/null') return ''
-          var s = String(path).trim()
-          if (!s || s === 'null' || s === '/null') return ''
-          if (s.indexOf('http://') === 0 || s.indexOf('https://') === 0) return s
-          return config.API_BASE_URL + (s.charAt(0) === '/' ? s : '/' + s)
-        } cff388913 (fix(image): 云文件绝对 URL 不再重复叠加 API_BASE_URL 前缀)
+    },getImageUrl: function(path) {
+
+      if (!path || path === 'null' || path === 'undefined' || path === '/null') return ''
+
+      var s = String(path).trim()
+
+      if (!s || s === 'null' || s === '/null') return ''
+
+      if (s.indexOf('http://') === 0 || s.indexOf('https://') === 0) return s
+
+      return config.API_BASE_URL + (s.charAt(0) === '/' ? s : '/' + s)
+
     }
   }
 }

+ 12 - 7
cfc-frontend/pages/shop/checkout/checkout.vue

@@ -1115,13 +1115,18 @@ showOnlineSlotPicker: function() {
     selectServicePerson: function(person) {
       this.selectedServicePerson = person
       this.showServicePersonModal = false
-        getImageUrl: function(path) {
-          if (!path || path === 'null' || path === 'undefined' || path === '/null') return ''
-          var s = String(path).trim()
-          if (!s || s === 'null' || s === '/null') return ''
-          if (s.indexOf('http://') === 0 || s.indexOf('https://') === 0) return s
-          return config.API_BASE_URL + (s.charAt(0) === '/' ? s : '/' + s)
-        } cff388913 (fix(image): 云文件绝对 URL 不再重复叠加 API_BASE_URL 前缀)
+    },getImageUrl: function(path) {
+
+      if (!path || path === 'null' || path === 'undefined' || path === '/null') return ''
+
+      var s = String(path).trim()
+
+      if (!s || s === 'null' || s === '/null') return ''
+
+      if (s.indexOf('http://') === 0 || s.indexOf('https://') === 0) return s
+
+      return config.API_BASE_URL + (s.charAt(0) === '/' ? s : '/' + s)
+
     }
   }
 }

+ 12 - 7
cfc-frontend/pages/shop/order-detail/order-detail.vue

@@ -290,13 +290,18 @@ export default {
     formatPriceWithSymbol(price) {
       if (!price && price !== 0) return '-'
       return '¥' + (price / 100).toFixed(2)
-        getImageUrl: function(path) {
-          if (!path || path === 'null' || path === 'undefined' || path === '/null') return ''
-          var s = String(path).trim()
-          if (!s || s === 'null' || s === '/null') return ''
-          if (s.indexOf('http://') === 0 || s.indexOf('https://') === 0) return s
-          return config.API_BASE_URL + (s.charAt(0) === '/' ? s : '/' + s)
-        } cff388913 (fix(image): 云文件绝对 URL 不再重复叠加 API_BASE_URL 前缀)
+    },getImageUrl: function(path) {
+
+      if (!path || path === 'null' || path === 'undefined' || path === '/null') return ''
+
+      var s = String(path).trim()
+
+      if (!s || s === 'null' || s === '/null') return ''
+
+      if (s.indexOf('http://') === 0 || s.indexOf('https://') === 0) return s
+
+      return config.API_BASE_URL + (s.charAt(0) === '/' ? s : '/' + s)
+
     },
     // 履约状态标签
     fulfillStatusLabel: function(status) {

+ 12 - 7
cfc-frontend/pages/shop/order-list/order-list.vue

@@ -356,13 +356,18 @@ export default {
     },
     onImgError(e, item) {
       item.coverImage = ''
-        getImageUrl: function(path) {
-          if (!path || path === 'null' || path === 'undefined' || path === '/null') return ''
-          var s = String(path).trim()
-          if (!s || s === 'null' || s === '/null') return ''
-          if (s.indexOf('http://') === 0 || s.indexOf('https://') === 0) return s
-          return config.API_BASE_URL + (s.charAt(0) === '/' ? s : '/' + s)
-        } cff388913 (fix(image): 云文件绝对 URL 不再重复叠加 API_BASE_URL 前缀)
+    },getImageUrl: function(path) {
+
+      if (!path || path === 'null' || path === 'undefined' || path === '/null') return ''
+
+      var s = String(path).trim()
+
+      if (!s || s === 'null' || s === '/null') return ''
+
+      if (s.indexOf('http://') === 0 || s.indexOf('https://') === 0) return s
+
+      return config.API_BASE_URL + (s.charAt(0) === '/' ? s : '/' + s)
+
     }
   }
 }