Преглед изворни кода

fix:权益卡升级到活动

xuyunhui пре 1 недеља
родитељ
комит
1e8864784c

+ 8 - 0
common/js/api.js

@@ -84,6 +84,14 @@ export default {
         })
     },
 
+    //权益卡可升级活动列表
+    upgradeList(equityCardId) {
+        return request({
+            url: '/business/wechat/activity/upgradeList/' + equityCardId,
+            method: 'GET'
+        })
+    },
+
     //根据key获取系统配置
     getConfigKey(data) {
         return request({

+ 2 - 2
common/js/env.js

@@ -11,8 +11,8 @@ let trialActivityImgUrl = `https://minio.xinyuekj.com.cn/jje-test/`
 /** 开发环境*/
 // let developBaseUrl = `http://65i1sxopd9qp.ngrok.xiaomiqiu123.top`
 // let developBaseUrl = `https://jje.xinyuekj.com.cn/prod-api`
-// let developBaseUrl = `https://jje.xinyuekj.com.cn/test-api`
-let developBaseUrl = `http://192.168.2.90:9201`
+let developBaseUrl = `https://jje.xinyuekj.com.cn/test-api`
+// let developBaseUrl = `http://192.168.2.90:9201`
 let developActivityImgUrl = `https://minio.xinyuekj.com.cn/jje-test/`
 
 

+ 8 - 4
orderPages/activityDetail/activityDetail.vue

@@ -256,7 +256,8 @@ export default {
       inviteOrderId: null,
       inviteActivityId:null,
       isShareMax: false,
-      renewServiceObjectId:null
+      renewServiceObjectId:null,
+      upgradeEquityCardId:null
     }
   },
 
@@ -276,6 +277,10 @@ export default {
       this.renewServiceObjectId = e.renewServiceObjectId
     }
 
+    if (e.upgradeEquityCardId){
+      this.upgradeEquityCardId = e.upgradeEquityCardId
+    }
+
     if (e.id) {
       this.id = e.id
       console.log('上一个页面传递过来的活动ID===>', this.id)
@@ -526,7 +531,8 @@ export default {
         inviteUserId: this.inviteUserId,
         inviteOrderId: this.inviteOrderId,
         inviteActivityId: this.inviteActivityId,
-        techNo: this.techNo
+        techNo: this.techNo,
+        upgradeEquityCardId: this.upgradeEquityCardId
       }).then(res => {
         console.log('++++++++++++++++++订单提交+++++++++++', res)
         uni.hideLoading();
@@ -593,9 +599,7 @@ export default {
           }
           this.storeList.push(store)
         }
-
         console.log(this.storeList,'+++++++++store_list++++++++++')
-
         this.$set(this.activity)
         if (this.isShare) {
           console.log(this.activity)

+ 74 - 0
storePages/myRights/index.rpx.scss

@@ -211,3 +211,77 @@
   text-indent: 2em;
   color: #999999;
 }
+
+.actionBar{
+  padding: 16rpx 24rpx;
+  border-top: 1rpx solid #F2F2F2;
+  background: #FFFFFF;
+}
+.actionBtn{
+  min-width: 128rpx;
+  height: 56rpx;
+  line-height: 56rpx;
+  text-align: center;
+  border-radius: 28rpx;
+  font-size: 24rpx;
+  font-weight: bold;
+  padding: 0 24rpx;
+  margin-left: 16rpx;
+}
+.renewBtn{
+  background: #FFE05C;
+  color: #333333;
+}
+.upgradeBtn{
+  background: #FF6B35;
+  color: #FFFFFF;
+}
+
+.upgradePopupView{
+  width: 600rpx;
+  background: #FFFFFF;
+  border-radius: 20rpx;
+  padding: 32rpx;
+  box-sizing: border-box;
+}
+.upgradeTitle{
+  font-size: 32rpx;
+  font-weight: bold;
+  color: #333333;
+  text-align: center;
+  margin-bottom: 24rpx;
+}
+.upgradeScroll{
+  max-height: 600rpx;
+}
+.upgradeItem{
+  padding: 24rpx;
+  background: #F7F7F7;
+  border-radius: 16rpx;
+  margin-bottom: 16rpx;
+}
+.upgradeItemTitle{
+  font-size: 28rpx;
+  font-weight: bold;
+  color: #333333;
+  line-height: 40rpx;
+}
+.upgradeItemPrice{
+  font-size: 24rpx;
+  color: #666666;
+  margin-top: 8rpx;
+}
+.upgradePrice{
+  color: #FF4444;
+  font-weight: bold;
+}
+.upgradeCloseBtn{
+  height: 80rpx;
+  line-height: 80rpx;
+  text-align: center;
+  background: #FFE05C;
+  border-radius: 40rpx;
+  font-size: 28rpx;
+  color: #333333;
+  margin-top: 16rpx;
+}

+ 74 - 6
storePages/myRights/index.vue

@@ -17,12 +17,6 @@
             <view class="money">
               <text>{{item.faceValue}}</text>
             </view>
-            <!--				<view class="desc">-->
-            <!--					<text>{{item.title}}</text>-->
-            <!--				</view>-->
-            <view class="flex-row justify-center" v-if="item.isShow">
-              <text style="font-size: 28rpx;font-weight: bold;color: red;" @click.stop="navigateTo(item)">点击续费</text>
-            </view>
           </view>
 
           <view class="h-center-content flex-col justify-around ">
@@ -48,6 +42,11 @@
           </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 v-if="showRemarkId == item.id" class="remark" style="text-indent:unset">
           <view v-if="item.unavailableWeeklyTimes || item.unavailableTimeRanges">
             不可用日期:
@@ -71,6 +70,19 @@
 				<image :src="magnifyUrl" mode="widthFix"></image>
 			</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>
 </template>
 <script>
@@ -84,6 +96,8 @@
 				windowHeight:'',
 				userInfo:{},
 				equityList:[],
+				upgradeActivityList:[],
+				currentUpgradeItem:null,
 			};
 		},
 
@@ -165,6 +179,60 @@
 
       },
 
+      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()
+        })
+      },
+
+      selectUpgradeActivity(idx){
+        const activity = this.upgradeActivityList[idx]
+        console.log(activity, 'activity')
+        this.goUpgradeDetail(activity, this.currentUpgradeItem)
+        this.closeUpgradePopup()
+      },
+
+      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})
+      },
+
+      closeUpgradePopup(){
+        this.$refs.upgradePopup.close()
+      },
+
       showRemark(item) {
         if (this.showRemarkId == item.id) {
           this.showRemarkId = ''