Răsfoiți Sursa

feat(frontend): 活动/商城会员价展示、分转元显示与未登录会员状态处理

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Xiaogang Liao 3 luni în urmă
părinte
comite
dbd27695ae

+ 9 - 1
cfc-frontend/components/DimensionActivities.vue

@@ -64,6 +64,7 @@
                   {{ act._statusText }}
                 </text>
                 <text class="card-price" v-if="act.priceLabel">{{ act.priceLabel }}</text>
+                <text class="card-price member-teaser" v-else-if="act.memberPrice && act.memberPrice > 0 && act.memberPrice < (act.price || 0)">会员价 {{ act._memberPriceDisplay }}</text>
                 <text class="card-price" v-else-if="act.price && act.price > 0">{{ act._priceDisplay }}</text>
                 <text class="card-price-free" v-else>免费</text>
               </view>
@@ -120,11 +121,13 @@ export default {
           status: item.status,
           price: item.price,
           priceLabel: item.priceLabel,
+          memberPrice: item.memberPrice,
           dimensionWeights: item.dimensionWeights,
           _badges: self.parseWeights(item.dimensionWeights),
           _timeText: self.formatTime(item.startTime),
           _statusText: self.statusText(item.status),
-          _priceDisplay: self.formatPriceWithSymbol(item.price)
+          _priceDisplay: self.formatPriceWithSymbol(item.price),
+          _memberPriceDisplay: self.formatPriceWithSymbol(item.memberPrice)
         }
       })
     },
@@ -414,6 +417,11 @@ export default {
   color: #F97316;
 }
 
+.card-price.member-teaser {
+  color: #F97316;
+  text-decoration: underline;
+}
+
 .card-price-free {
   font-size: 24rpx;
   font-weight: 600;

+ 7 - 1
cfc-frontend/pages/shop/index/index.vue

@@ -253,12 +253,18 @@ export default {
       })
     },
     checkMemberStatus() {
+      if (!uni.getStorageSync('token')) {
+        this.isMember = false
+        return
+      }
       var that = this
       getMyMembership().then(function(res) {
         if (res.data && res.data.memberLevel) {
           that.isMember = res.data.memberLevel !== 'FREE'
         }
-      }).catch(function() {})
+      }).catch(function() {
+        that.isMember = false
+      })
     },
     goUpgrade() {
       uni.navigateTo({ url: '/pages/membership/upgrade' })