Pārlūkot izejas kodu

fix:权益卡升级到活动样式

xuyunhui 1 nedēļu atpakaļ
vecāks
revīzija
3e42cb2535
3 mainītis faili ar 480 papildinājumiem un 363 dzēšanām
  1. 145 21
      orderPages/storeService/index.vue
  2. 108 156
      storePages/myRights/index.rpx.scss
  3. 227 186
      storePages/myRights/index.vue

+ 145 - 21
orderPages/storeService/index.vue

@@ -149,7 +149,10 @@
             </view>
 
             <view class="h-right-content flex-col justify-center ">
-              <view class="btn" @click="navigateTo(item)">
+<!--              <view class="btn" @click="navigateTo(item)">-->
+<!--                <text>续费</text>-->
+<!--              </view>-->
+              <view class="btn" @click="upgrade(item)">
                 <text>续费</text>
               </view>
             </view>
@@ -157,10 +160,31 @@
 
         </scroll-view>
 
+        <view class="expire-popup-footer">
+          <view class="no-more-prompt" @click="noMoreExpirePrompt = !noMoreExpirePrompt">
+            <view class="checkbox" :class="{ checked: noMoreExpirePrompt }">
+              <text v-if="noMoreExpirePrompt" class="check-icon">✓</text>
+            </view>
+            <text class="no-more-text">不再提示</text>
+          </view>
+          <view class="close-btn" @click="closeExpirePopup">关闭</view>
+        </view>
+
       </view>
 
     </uni-popup>
-
+    <uni-popup ref="upgradePopup" type="center">
+      <view class="upgradePopupView">
+        <view class="upgradeTitle">请选择升级活动</view>
+        <scroll-view class="upgradeScroll" scroll-y>
+          <view class="upgradeItem" v-for="(act,idx) in upgradeActivityList" :key="idx" @click="selectUpgradeActivity(idx)">
+            <view class="upgradeItemTitle">{{act.title}}</view>
+            <view class="upgradeItemPrice">活动价格:<text class="upgradePrice">{{act.salePrice}}元</text></view>
+          </view>
+        </scroll-view>
+        <view class="upgradeCloseBtn" @click="closeUpgradePopup">取消</view>
+      </view>
+    </uni-popup>
 
 
   </view>
@@ -182,6 +206,7 @@
 				store: {},
 				serviceObjectList: [],
 				requestStatus: false,
+        upgradeActivityList:[],
 				orderParam: {
 					orderType: 1,
 					serviceAttribute: 1,
@@ -209,6 +234,7 @@
         takeNumberRules:[],
         storeInfo: {},
         expireEquityCard:[], //过期的权益卡
+        noMoreExpirePrompt: false, // 权益卡到期弹框不再提示
         activityImg:"",
 			}
 		},
@@ -308,34 +334,85 @@
         }
 
       },
-
+      upgrade(item){
+        console.log(item,'itemitem')
+        if (!item.equityCardId){
+          uni.showToast({
+            title: '当前权益卡暂无可升级活动',
+            icon: 'none'
+          })
+          return
+        }
+        uni.showLoading({title: '加载中'})
+        this.$api.upgradeList(item.equityCardId).then(res=>{
+          uni.hideLoading()
+          const list = (res && res.data && (res.data.data || res.data.rows)) || []
+          if (!list || list.length === 0){
+            uni.showToast({
+              title: '当前权益卡暂无可升级活动',
+              icon: 'none'
+            })
+            return
+          }
+          this.currentUpgradeItem = item
+          if (list.length === 1){
+            this.goUpgradeDetail(list[0], item)
+          }else {
+            this.upgradeActivityList = list
+            this.$refs.upgradePopup.open()
+          }
+        }).catch(()=>{
+          uni.hideLoading()
+        })
+      },
+      goUpgradeDetail(activity, item){
+        console.log(activity, item,'activity, item')
+        if (!activity || !activity.id){
+          return
+        }
+        let url = '/orderPages/activityDetail/activityDetail?id=' + activity.id + '&upgradeEquityCardId=' + item.id
+        if (item.serviceObjectId){
+          url += '&renewServiceObjectId=' + item.serviceObjectId
+        }
+        uni.navigateTo({url})
+      },
       getExpireEquityCard(){
         this.$api.getExpireEquityCard({
           serviceObjectId:0
         }).then((res)=>{
-          this.expireEquityCard = res.data.data;
-          // if (this.expireEquityCard.length > 0){
-          //   uni.showModal({
-          //     title:'温馨提示',
-          //     content:'您有' + this.expireEquityCard.length + '张权益卡即将到期',
-          //     confirmText:'立即续费',
-          //     success:(res)=>{
-          //       if (res.confirm) {
-          //         console.log('用户点击确定');
-          //         uni.navigateTo({
-          //           url:'/storePages/myRights/index'
-          //         })
-          //       } else if (res.cancel) {
-          //         console.log('用户点击取消');
-          //       }
-          //     }
-          //   })
-          // }
+          let list = res.data.data || [];
+          // 过滤掉用户已标记"不再提示"的卡片
+          const dismissedIds = uni.getStorageSync('dismissed_expire_equity_cards') || []
+          const validDismissedIds = []
+          const newList = []
+          for (const item of list) {
+            if (dismissedIds.includes(item.equityCardId)) {
+              validDismissedIds.push(item.equityCardId)
+            } else {
+              newList.push(item)
+            }
+          }
+          // 清理已失效的 dismissed 记录
+          uni.setStorageSync('dismissed_expire_equity_cards', validDismissedIds)
+          this.expireEquityCard = newList
           if (this.expireEquityCard.length > 0){
+            this.noMoreExpirePrompt = false
             this.$refs.showExpireEquityCard.open()
           }
         })
       },
+      closeExpirePopup() {
+        if (this.noMoreExpirePrompt) {
+          const dismissedIds = uni.getStorageSync('dismissed_expire_equity_cards') || []
+          for (const item of this.expireEquityCard) {
+            if (item.equityCardId && !dismissedIds.includes(item.equityCardId)) {
+              dismissedIds.push(item.equityCardId)
+            }
+          }
+          uni.setStorageSync('dismissed_expire_equity_cards', dismissedIds)
+        }
+        this.$refs.showExpireEquityCard.close()
+      },
 
 
 			dialogConfirm(){
@@ -734,4 +811,51 @@ background-color: white;
       color: #666;
     }
   }
+
+  .expire-popup-footer {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    padding: 20rpx 32rpx 30rpx;
+
+    .no-more-prompt {
+      display: flex;
+      align-items: center;
+
+      .checkbox {
+        width: 32rpx;
+        height: 32rpx;
+        border: 2rpx solid #ccc;
+        border-radius: 6rpx;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        margin-right: 10rpx;
+
+        &.checked {
+          background-color: #2979ff;
+          border-color: #2979ff;
+        }
+
+        .check-icon {
+          color: #fff;
+          font-size: 22rpx;
+          font-weight: bold;
+        }
+      }
+
+      .no-more-text {
+        font-size: 26rpx;
+        color: #666;
+      }
+    }
+
+    .close-btn {
+      padding: 10rpx 36rpx;
+      background-color: #2979ff;
+      color: #fff;
+      font-size: 28rpx;
+      border-radius: 30rpx;
+    }
+  }
 </style>

+ 108 - 156
storePages/myRights/index.rpx.scss

@@ -1,63 +1,118 @@
-
 .page{
   background: #F7F7F7;
   padding: 0 32rpx;
-  border-top: 1px solid #F7F7F7 ;
+  border-top: 1px solid #F7F7F7;
 }
-.btn{
-  height: 84rpx;
-  background: #FFE05C;
-  border-radius: 54rpx;
-  margin: 32rpx 0;
 
-  font-size: 28rpx;
-  font-family: PingFangSC-Regular, PingFang SC;
-  font-weight: 400;
-  color: #333333;
-  line-height: 84rpx;
-  text-align: center;
-}
-.noUse{
-  margin: 32rpx 0;
-  font-size: 28rpx;
-  font-family: PingFangSC-Regular, PingFang SC;
-  font-weight: 400;
-  color: #333333;
-  line-height: 40rpx;
+/* ===== 卡片堆叠动画 ===== */
+.card-list {
+  padding-top: 24rpx;
+  padding-bottom: 60rpx;
 }
 
-
-.row-list{
+.card-item {
   width: 686rpx;
-  min-height:188rpx;
-  margin-top: 24rpx;
   background: #FFFFFF;
-  //background-image: url('/static/coupon/u210.png');
-  //background-repeat: no-repeat;
-  //background-size: cover;
-  overflow: hidden;
   border-radius: 20rpx;
+  overflow: hidden;
+  box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.08);
+  position: relative;
+  margin-bottom: 24rpx;
 }
 
+/* 展开状态 */
+.card-expanded {
+  box-shadow: 0 8rpx 32rpx rgba(0,0,0,0.12);
+}
 
-.h-text{
-  width: 200rpx;
-  min-height:188rpx;
-  background: #FFE05C;
+/* 收起状态 */
+.card-collapsed .card-header {
+  padding: 16rpx 24rpx;
+  min-height: unset;
 }
-.h-center-content{
-  width: 298rpx;
-  min-height: 188rpx;
+
+/* 卡片头部 */
+.card-header {
+  padding: 20rpx 24rpx;
+  min-height: 140rpx;
 }
-.h-right-content{
-  width: 188rpx;
-  height: 188rpx;
+
+/* 卡片内容区 */
+.card-body {
+  max-height: 0;
+  opacity: 0;
+  overflow: hidden;
+  transition: max-height 0.35s ease, opacity 0.3s ease;
+}
+
+.card-expanded .card-body {
+  max-height: 1200rpx;
+  opacity: 1;
+  transition: max-height 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease;
 }
-.h-right-content-img{
-  width: 188rpx;
-  height: 188rpx;
+
+.card-body-inner {
+  padding: 0 24rpx 24rpx 24rpx;
+}
+
+/* 展开/收起箭头 */
+.arrow-icon {
+  text-align: center;
+  margin-top: 8rpx;
+  transition: transform 0.3s ease;
+}
+
+.arrow-up {
+  transform: rotate(180deg);
+}
+
+/* 收起时显示的信息 */
+.collapsed-info {
+  display: flex;
+  flex-direction: row;
+  margin-top: 8rpx;
+}
+
+/* 详情信息 */
+.detail-info {
+  padding-top: 16rpx;
+  border-top: 1rpx solid #F2F2F2;
+}
+
+/* 使用规则 */
+.rule-toggle {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  padding: 20rpx 0;
+  border-top: 1rpx solid #F2F2F2;
+  font-size: 24rpx;
+  color: #666666;
+}
+
+/* ===== 原有样式 ===== */
+.h-left-content-img{
+  width: 140rpx;
+  height: 140rpx;
   border-radius: 8rpx;
 }
+.img-label{
+  font-size: 20rpx;
+  color: #999999;
+  text-align: center;
+  margin-top: 8rpx;
+}
+.h-center-content{
+  width: 340rpx;
+  min-height: 120rpx;
+  margin-left: 20rpx;
+}
+.h-text{
+  width: 120rpx;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
 .magnifyUrlView{
   border-radius: 20rpx;
   overflow: hidden;
@@ -71,23 +126,12 @@
   line-height: 52rpx;
   text-align: center;
 }
-.desc{
-  height: 36rpx;
-  font-size: 20rpx;
-  font-family: PingFangSC-Regular, PingFang SC;
-  font-weight: 400;
-  color: #333333;
-  line-height: 36rpx;
-  text-align: center;
-}
 .h-value{
   font-size: 28rpx;
   font-family: PingFangSC-Medium, PingFang SC;
   font-weight: bold;
   color: #333333;
   line-height: 44rpx;
-  margin-top: 24rpx;
-  margin-left: 24rpx;
 }
 .title{
   font-size: 20rpx;
@@ -95,102 +139,6 @@
   font-weight: 400;
   color: #999999;
   line-height: 36rpx;
-  margin-left: 24rpx;
-}
-.h-btn-value-use{
-  width: 156rpx;
-  height: 64rpx;
-  background: #93D21A;
-  border-radius: 32rpx;
-
-  font-size: 24rpx;
-  font-family: PingFangSC-Regular, PingFang SC;
-  font-weight: 400;
-  color: #FFFFFF;
-  line-height: 64rpx;
-  text-align: center;
-}
-.h-btn-img{
-  width: 136rpx;
-  height: 136rpx;
-}
-.row-list:first-child{
-  margin-top: 0;
-
-}
-.btn{
-  width: 156rpx;
-  height: 64rpx;
-  background: #93D21A;
-  border-radius: 32rpx;
-
-  font-size: 24rpx;
-  font-family: PingFangSC-Regular, PingFang SC;
-  font-weight: 400;
-  color: #FFFFFF;
-  line-height: 64rpx;
-  text-align: center;
-}
-
-
-
-.payView{
-  height: 638rpx;
-  background: #FFFFFF;
-  box-shadow: 0rpx -4rpx 8rpx 0rpx rgba(0,0,0,0.03);
-  border-radius: 24rpx 24rpx 0rpx 0rpx;
-  padding: 24rpx 32rpx;
-  z-index: 100;
-}
-.payType{
-  font-size: 32rpx;
-  font-family: PingFangSC-Medium, PingFang SC;
-  font-weight: bord;
-  color: #111111;
-  line-height: 48rpx;
-}
-.x{
-  width: 35rpx;
-  height: 35rpx;
-  border-radius: 18rpx;
-}
-.payTitle{
-  font-size: 24rpx;
-  font-family: PingFangSC-Regular, PingFang SC;
-  font-weight: 400;
-  color: #666666;
-  line-height: 40rpx;
-  margin-top: 8rpx;
-}
-.payItem{
-  background: #FAFAFA;
-  border-radius: 20rpx;
-  padding: 34rpx 32rpx;
-  margin-top: 32rpx;
-}
-.payName{
-  margin-left: 24rpx;
-}
-.balance{
-  font-size: 24rpx;
-  font-family: PingFangSC-Regular, PingFang SC;
-  font-weight: 400;
-  color: #999999;
-  line-height: 40rpx;
-}
-.commitBtn{
-  width: 686rpx;
-  height: 108rpx;
-  background: #FFE05C;
-  border-radius: 60rpx;
-  margin-top: 32rpx;
-
-  font-size: 32rpx;
-  font-family: PingFangSC-Medium, PingFang SC;
-  font-weight: bold;
-  color: #111111;
-  line-height: 108rpx;
-  text-align: center;
 }
 .empty{
   margin-top: 80rpx;
@@ -202,20 +150,24 @@
   margin-top: 20rpx;
 }
 .remark{
-  width: 646rpx;
-  font-size: 25rpx;
+  width: 100%;
+  font-size: 24rpx;
   line-height: 40rpx;
-  background: #FFFFFF;
-  border-radius: 20rpx;
+  background: #FAFAFA;
+  border-radius: 12rpx;
   padding: 20rpx;
-  text-indent: 2em;
+  text-indent: unset;
   color: #999999;
+  margin-top: 12rpx;
+  box-sizing: border-box;
+}
+.remarkText{
+  color: #CCCCCC;
 }
 
 .actionBar{
-  padding: 16rpx 24rpx;
+  padding: 16rpx 0;
   border-top: 1rpx solid #F2F2F2;
-  background: #FFFFFF;
 }
 .actionBtn{
   min-width: 128rpx;

+ 227 - 186
storePages/myRights/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="page" :style="{'height':windowHeight}">
 
-		<view class="flex-col" v-if="!equityList">
+		<view class="flex-col" v-if="!equityList || equityList.length === 0">
 			<view class="flex-row justify-center">
 				<image class="empty" src="/static/imageIcon/empty.png" mode="widthFix"></image>
 			</view>
@@ -11,60 +11,99 @@
 		</view>
 
 		<scroll-view v-else scroll-y :style="{'height':windowHeight}">
-			<view  class="row-list" v-for="(item,index) in equityList" :key="index">
-        <view class="flex-row justify-start" @click.stop="showRemark(item)">
-          <view class="h-text flex-col justify-center ">
-            <view class="money">
-              <text>{{item.faceValue}}</text>
-            </view>
-          </view>
+			<view class="card-list">
+				<view
+					class="card-item"
+					:class="{
+						'card-expanded': expandedId == item.id,
+						'card-collapsed': expandedId != item.id,
+						'card-first': index === 0,
+						'card-last': index === equityList.length - 1
+					}"
+					v-for="(item,index) in equityList"
+					:key="index"
+					:style="{zIndex: expandedId == item.id ? equityList.length + 1 : equityList.length - index}"
+				>
+					<!-- 卡片头部 -->
+					<view class="card-header flex-row justify-between" @click.stop="toggleCard(item)">
+						<view class="flex-row">
+							<view class="flex-col justify-center" style="align-items: center;" v-show="expandedId == item.id">
+								<image class="h-left-content-img" :src="item.facePhotoUrl || '/static/logo.png'" mode="aspectFit" @click.stop="magnify(item.facePhotoUrl)"></image>
+								<text class="img-label">服务对象图片</text>
+							</view>
 
-          <view class="h-center-content flex-col justify-around ">
-            <view class="h-value">
-              <text>{{item.title}}</text>
-            </view>
-            <view class="title">
-              适用项目:{{item.serviceProjectName || ''}}
-            </view>
-            <view class="title">
-              适用门店:{{ item.useStoreDesc || '' }}
-            </view>
-            <view class="title">
-              绑定对象:{{item.serviceObjectName}}
-            </view>
-            <view class="title">
-              结束期限:{{item.effectiveEndTime.substring(0,10)}}
-            </view>
-          </view>
+							<view class="h-center-content flex-col justify-around">
+								<view class="h-value">
+									<text>{{item.title}}</text>
+								</view>
+								<view class="title collapsed-info" v-show="expandedId == item.id">
+									<text>{{item.serviceObjectName}}</text>
+									<text style="margin-left: 16rpx;">{{item.effectiveEndTime.substring(0,10)}}到期</text>
+								</view>
+							</view>
+						</view>
 
-          <view class=" flex-col justify-center ">
-            <image class="h-right-content-img "  :src="item.facePhotoUrl || '/static/logo.png'" mode="aspectFit" @click="magnify(item.facePhotoUrl)"></image>
-          </view>
-        </view>
+						<view class="h-text flex-col justify-center">
+							<view class="money">
+								<text>{{item.faceValue}}</text>
+							</view>
+							<view class="arrow-icon" :class="{'arrow-up': expandedId == item.id}">
+								<u-icon name="arrow-down-fill" color="#999" size="12"></u-icon>
+							</view>
+						</view>
+					</view>
+
+					<!-- 卡片内容:展开时显示 -->
+					<view class="card-body" :class="{'card-body-expanded': expandedId == item.id}">
+						<view class="card-body-inner">
+							<view class="detail-info">
+								<view class="title">
+									适用项目:{{item.serviceProjectName || ''}}
+								</view>
+								<view class="title">
+									适用门店:{{ item.useStoreDesc || '' }}
+								</view>
+								<view class="title">
+									绑定对象:{{item.serviceObjectName}}
+								</view>
+								<view class="title">
+									结束期限:{{item.effectiveEndTime.substring(0,10)}}
+								</view>
+							</view>
+
+							<view class="actionBar flex-row justify-end">
+<!--								<view class="actionBtn renewBtn" v-if="item.isShow" @click.stop="navigateTo(item)">续费</view>-->
+								<view class="actionBtn upgradeBtn" v-if="item.isShow" @click.stop="upgrade(item)">续费</view>
+							</view>
 
-        <view class="actionBar flex-row justify-end" >
-          <view class="actionBtn renewBtn" v-if="item.isShow" @click.stop="navigateTo(item)">续费</view>
-          <view class="actionBtn upgradeBtn" @click.stop="upgrade(item)">升级</view>
-        </view>
+							<view class="rule-toggle" @click.stop="showRemark(item)">
+								<text>使用规则</text>
+								<u-icon v-if="item.id == showRemarkId" name="arrow-down-fill" color="#999" size="12"></u-icon>
+								<u-icon v-else name="play-right-fill" color="#999" size="12"></u-icon>
+							</view>
 
-        <view v-if="showRemarkId == item.id" class="remark" style="text-indent:unset">
-          <view v-if="item.unavailableWeeklyTimes || item.unavailableTimeRanges">
-            不可用日期:
-            <view v-if="item.unavailableWeeklyTimes">{{ parseWeeklyTimes(item.unavailableWeeklyTimes) }}</view>
-            <view v-if="item.unavailableTimeRanges">{{ parseTimeRanges(item.unavailableTimeRanges) }}</view>
-          </view>
-          <view v-if="item.delayEffectiveDays > 0">
-            生效时间:
-            <text>购买后{{item.delayEffectiveDays}}天生效</text>
-          </view>
-          <view v-if="item.description !=null">
-            使用说明:
-            <text>{{ item.description }}</text>
-          </view>
-          <text v-else class="remarkText">该优惠券暂无使用说明</text>
-        </view>
+							<view v-if="showRemarkId == item.id" class="remark" style="text-indent:unset">
+								<view v-if="item.unavailableWeeklyTimes || item.unavailableTimeRanges">
+									不可用日期:
+									<view v-if="item.unavailableWeeklyTimes">{{ parseWeeklyTimes(item.unavailableWeeklyTimes) }}</view>
+									<view v-if="item.unavailableTimeRanges">{{ parseTimeRanges(item.unavailableTimeRanges) }}</view>
+								</view>
+								<view v-if="item.delayEffectiveDays > 0">
+									生效时间:
+									<text>购买后{{item.delayEffectiveDays}}天生效</text>
+								</view>
+								<view v-if="item.description !=null">
+									使用说明:
+									<text>{{ item.description }}</text>
+								</view>
+								<text v-else class="remarkText">该优惠券暂无使用说明</text>
+							</view>
+						</view>
+					</view>
+				</view>
 			</view>
 		</scroll-view>
+
 		<uni-popup ref="popup">
 			<view class="magnifyUrlView">
 				<image :src="magnifyUrl" mode="widthFix"></image>
@@ -88,10 +127,11 @@
 <script>
 	import {date} from "@/uni_modules/uv-ui-tools/libs/function/test";
 
-  export default {
+	export default {
 		data() {
 			return {
-        showRemarkId:'',
+				expandedId: '',
+				showRemarkId:'',
 				magnifyUrl:'',
 				windowHeight:'',
 				userInfo:{},
@@ -101,147 +141,150 @@
 			};
 		},
 
-    computed: {
-      // 解析 unavailableWeeklyTimes,将 "3,4,5" 转换为 ["星期二", "星期三", "星期四"]
-      parseWeeklyTimes() {
-        return function(times) {
-          if (!times) return '';
-          const arr = times.split(',');
-          const weekMap = {
-            '1': '星期日',
-            '2': '星期一',
-            '3': '星期二',
-            '4': '星期三',
-            '5': '星期四',
-            '6': '星期五',
-            '7': '星期六'
-          };
-          return arr.map(item => weekMap[item]).join('、');
-        };
-      },
-      // 解析 unavailableTimeRanges,将 JSON 字符串转换为可读格式
-      parseTimeRanges() {
-        return function(ranges) {
-          if (!ranges) return '';
-          try {
-            const arr = JSON.parse(ranges);
-            return arr.map(item => {
-              const begin = item.beginTime?.split?.(' ')?.[0] || '';
-              const end = item.endTime?.split?.(' ')?.[0] || '';
-              return begin && end ? `${begin} - ${end}` : '';
-            }).filter(Boolean).join(';');
-          } catch (e) {
-            return '';
-          }
-        };
-      }
-    },
+		computed: {
+			parseWeeklyTimes() {
+				return function(times) {
+					if (!times) return '';
+					const arr = times.split(',');
+					const weekMap = {
+						'1': '星期日',
+						'2': '星期一',
+						'3': '星期二',
+						'4': '星期三',
+						'5': '星期四',
+						'6': '星期五',
+						'7': '星期六'
+					};
+					return arr.map(item => weekMap[item]).join('、');
+				};
+			},
+			parseTimeRanges() {
+				return function(ranges) {
+					if (!ranges) return '';
+					try {
+						const arr = JSON.parse(ranges);
+						return arr.map(item => {
+							const begin = item.beginTime?.split?.(' ')?.[0] || '';
+							const end = item.endTime?.split?.(' ')?.[0] || '';
+							return begin && end ? `${begin} - ${end}` : '';
+						}).filter(Boolean).join(';');
+					} catch (e) {
+						return '';
+					}
+				};
+			}
+		},
 
 		onLoad(option) {
 			let sysInfo = uni.getSystemInfoSync()
-			this.windowHeight =sysInfo.windowHeight - 3 +'px'//除标题栏栏外的屏幕可用高度
+			this.windowHeight = sysInfo.windowHeight - 3 + 'px'
 			this.userInfo = uni.getStorageSync('userInfo')
-
 			this.myEquityCardList()
 		},
 
 		methods: {
+			toggleCard(item) {
+				if (this.expandedId === item.id) {
+					this.expandedId = ''
+					this.showRemarkId = ''
+				} else {
+					this.expandedId = item.id
+					this.showRemarkId = ''
+				}
+			},
 
-      isShow(item){
-        if (item.effectiveEndTime){
-          let date = new Date(item.effectiveEndTime);
-          let now = new Date().getTime();
-          const timeDiff = Math.abs(now - date.getTime());
-          const ninetyDaysMs = 90 * 24 * 60 * 60 * 1000;
-          return timeDiff < ninetyDaysMs;
-        }
-        return false
-      },
-
-      navigateTo(item){
-        console.log('+++++++++++++++++++++++++++++++',item)
-        if(item.activityId){
-          let list = item.activityId.split(',')
-          if (list.length == 1){
-            uni.navigateTo({
-              url:'/orderPages/activityDetail/activityDetail?id=' + item.activityId +'&renewServiceObjectId=' + item.serviceObjectId
-            })
-          }else {
-            uni.navigateTo({
-              url:'/orderPages/activityList/activityList?renewServiceObjectId=' + item.serviceObjectId + '&equityCardId=' + item.equityCardId
-            })
-          }
-        }else{
-          uni.navigateTo({
-            url:'/orderPages/activityList/activityList?renewServiceObjectId=' + item.serviceObjectId
-          })
-        }
-
-      },
+			isShow(item){
+				if (item.effectiveEndTime){
+					let date = new Date(item.effectiveEndTime);
+					let now = new Date().getTime();
+					const timeDiff = Math.abs(now - date.getTime());
+					const ninetyDaysMs = 90 * 24 * 60 * 60 * 1000;
+					return timeDiff < ninetyDaysMs;
+				}
+				return false
+			},
 
-      upgrade(item){
-        if (!item.equityCardId){
-          uni.showToast({
-            title: '当前权益卡暂无可升级活动',
-            icon: 'none'
-          })
-          return
-        }
-        uni.showLoading({title: '加载中'})
-        this.$api.upgradeList(item.equityCardId).then(res=>{
-          uni.hideLoading()
-          const list = (res && res.data && (res.data.data || res.data.rows)) || []
-          if (!list || list.length === 0){
-            uni.showToast({
-              title: '当前权益卡暂无可升级活动',
-              icon: 'none'
-            })
-            return
-          }
-          this.currentUpgradeItem = item
-          if (list.length === 1){
-            this.goUpgradeDetail(list[0], item)
-          }else {
-            this.upgradeActivityList = list
-            this.$refs.upgradePopup.open()
-          }
-        }).catch(()=>{
-          uni.hideLoading()
-        })
-      },
+			navigateTo(item){
+				console.log('+++++++++++++++++++++++++++++++',item)
+				if(item.activityId){
+					let list = item.activityId.split(',')
+					if (list.length == 1){
+						uni.navigateTo({
+							url:'/orderPages/activityDetail/activityDetail?id=' + item.activityId +'&renewServiceObjectId=' + item.serviceObjectId
+						})
+					}else {
+						uni.navigateTo({
+							url:'/orderPages/activityList/activityList?renewServiceObjectId=' + item.serviceObjectId + '&equityCardId=' + item.equityCardId
+						})
+					}
+				}else{
+					uni.navigateTo({
+						url:'/orderPages/activityList/activityList?renewServiceObjectId=' + item.serviceObjectId
+					})
+				}
+			},
 
-      selectUpgradeActivity(idx){
-        const activity = this.upgradeActivityList[idx]
-        console.log(activity, 'activity')
-        this.goUpgradeDetail(activity, this.currentUpgradeItem)
-        this.closeUpgradePopup()
-      },
+			upgrade(item){
+				if (!item.equityCardId){
+					uni.showToast({
+						title: '当前权益卡暂无可升级活动',
+						icon: 'none'
+					})
+					return
+				}
+				uni.showLoading({title: '加载中'})
+				this.$api.upgradeList(item.equityCardId).then(res=>{
+					uni.hideLoading()
+					const list = (res && res.data && (res.data.data || res.data.rows)) || []
+					if (!list || list.length === 0){
+						uni.showToast({
+							title: '当前权益卡暂无可升级活动',
+							icon: 'none'
+						})
+						return
+					}
+					this.currentUpgradeItem = item
+					if (list.length === 1){
+						this.goUpgradeDetail(list[0], item)
+					}else {
+						this.upgradeActivityList = list
+						this.$refs.upgradePopup.open()
+					}
+				}).catch(()=>{
+					uni.hideLoading()
+				})
+			},
 
-      goUpgradeDetail(activity, item){
-        console.log(activity, item,'activity, item')
-        if (!activity || !activity.id){
-          return
-        }
-        let url = '/orderPages/activityDetail/activityDetail?id=' + activity.id + '&upgradeEquityCardId=' + item.id
-        if (item.serviceObjectId){
-          url += '&renewServiceObjectId=' + item.serviceObjectId
-        }
-        uni.navigateTo({url})
-      },
+			selectUpgradeActivity(idx){
+				const activity = this.upgradeActivityList[idx]
+				console.log(activity, 'activity')
+				this.goUpgradeDetail(activity, this.currentUpgradeItem)
+				this.closeUpgradePopup()
+			},
 
-      closeUpgradePopup(){
-        this.$refs.upgradePopup.close()
-      },
+			goUpgradeDetail(activity, item){
+				if (!activity || !activity.id){
+					return
+				}
+				let url = '/orderPages/activityDetail/activityDetail?id=' + activity.id + '&upgradeEquityCardId=' + item.id
+				if (item.serviceObjectId){
+					url += '&renewServiceObjectId=' + item.serviceObjectId
+				}
+				uni.navigateTo({url})
+			},
 
-      showRemark(item) {
-        if (this.showRemarkId == item.id) {
-          this.showRemarkId = ''
+			closeUpgradePopup(){
+				this.$refs.upgradePopup.close()
+			},
 
-        } else {
-          this.showRemarkId = item.id
+			showRemark(item) {
+				if (this.showRemarkId == item.id) {
+					this.showRemarkId = ''
+				} else {
+					this.showRemarkId = item.id
+				}
+			},
 
-        }
-      },
 			magnify(url){
 				if (!url){
 					return
@@ -254,19 +297,20 @@
 				this.$api.myEquityCardList().then(res=>{
 					console.log(res)
 					this.equityList = res.data.data
-          for (let equityListElement of this.equityList) {
-
-            let a = this.isShow(equityListElement)
-            console.log(a)
-            equityListElement.isShow = this.isShow(equityListElement)
-          }
+					if (this.equityList && this.equityList.length > 0) {
+						this.expandedId = this.equityList[0].id
+					}
+					for (let equityListElement of this.equityList) {
+						let a = this.isShow(equityListElement)
+						console.log(a)
+						equityListElement.isShow = this.isShow(equityListElement)
+					}
 					if (this.equityList){
 						this.getImgUrlByBannerOssId(this.equityList)
 					}
 				})
 			},
 
-			// 获取图片
 			getImgUrlByBannerOssId(items){
 				for(let i = 0; i <items.length; i++) {
 					if (items[i].facePhoto){
@@ -278,13 +322,10 @@
 					}
 				}
 			},
-
 		},
 	};
 </script>
 <style lang="scss" scoped>
-
 	@import '/common/css/common.css';
 	@import './index.rpx.scss';
-
 </style>