Browse Source

活动管理和我的页面优化

vaecebyZ 1 year ago
parent
commit
9e09bd6c02
2 changed files with 29 additions and 8 deletions
  1. 28 7
      my/order/index.vue
  2. 1 1
      pages/my/index.vue

+ 28 - 7
my/order/index.vue

@@ -52,6 +52,7 @@
 
 <script>
 import { getOrderList } from '@/api/order.js'
+import { getActivityDetail } from '@/api/activity.js'
 export default {
 	data() {
 		return {
@@ -63,6 +64,7 @@ export default {
 				size: 10,
 				userId: JSON.parse(uni.getStorageSync('userInfo')).userId
 			},
+			activity: null,
 			total: 0,
 			list: []
 		}
@@ -98,16 +100,35 @@ export default {
 
 		},
 		jump(item) {
-			console.log('item',item);
-			
 			// 如果是活动则跳转到活动支付页
 			if (item.goodsModelList[0].goodsInfo.hasOwnProperty('activityEnable')) {
 				const enable = item.goodsModelList[0].goodsInfo.activityEnable
-				if(enable){
-					uni.navigateTo({
-					url: '/signUp/makeOut?id=' + item.activityId
-				})
-				}else{
+				if (enable) {
+					uni.showLoading({
+						title: '获取信息中...'
+					})
+					getActivityDetail({
+						id: item.goodsModelList[0].goodsInfo.id
+					}).then(res => {
+						this.activity = res.content
+						this.activity.activityDetail = res.content.activityDetail.replace(/<img/gi, '<img class="img_class" ')
+						let { activityStartTime, activityEndTime, limited, activityName, id, price, shopId } = this.activity
+						let obj = {
+							activityStartTime,
+							activityEndTime,
+							limited,
+							activityName,
+							id,
+							price,
+							shopId
+						}
+						uni.hideLoading()
+						uni.setStorageSync('activity', JSON.stringify(obj))
+						uni.navigateTo({
+							url: '/signUp/makeOut?id=' + item.activityId
+						})
+					})
+				} else {
 					uni.showToast({
 						title: '活动已结束',
 						icon: 'none'

+ 1 - 1
pages/my/index.vue

@@ -49,7 +49,7 @@
         <text class="grid-text">{{ baseListItem.title }}</text>
       </u-grid-item>
     </u-grid>
-    <view style="font-size: 34rpx; font-weight: bold; margin: 30rpx 0 0 30rpx">
+    <view style="font-size: 34rpx; font-weight: bold; margin: 30rpx 0 20rpx 30rpx">
       常用功能
     </view>
     <view class="setting">