浏览代码

1.添加每日获取弹窗及缓存功能
2.与皮总讨论接口设计
3.调试领取每日免费赠送次数接口
4.调试获得和消费次数列表接口

306132416@qq.com 6 年之前
父节点
当前提交
51c82a8962
共有 4 个文件被更改,包括 1023 次插入901 次删除
  1. 2 0
      App.vue
  2. 957 873
      pages/index/index.vue
  3. 1 1
      pages/selfInfo/selfInfo.vue
  4. 63 27
      pages/selfInfo/shareDetail/shareDetail.vue

+ 2 - 0
App.vue

@@ -20,6 +20,8 @@
 			isAndroid:Boolean,
 			isIos:false,
 			globalShareCounts:10,
+			isGetDayCounts:false,
+			isShowDayCountsModal:true
 		},
 		onLaunch: function() {
 			console.log('App Launch')

文件差异内容过多而无法显示
+ 957 - 873
pages/index/index.vue


+ 1 - 1
pages/selfInfo/selfInfo.vue

@@ -131,7 +131,7 @@
 			},
 			goShareDetail(){
 				uni.navigateTo({
-					url: '/pages/selfInfo/shareDetail/shareDetail',
+					url: './shareDetail/shareDetail',
 					success: res => {},
 					fail: () => {},
 					complete: () => {}

+ 63 - 27
pages/selfInfo/shareDetail/shareDetail.vue

@@ -3,24 +3,26 @@
 		<ms-tabs :type="type" v-model="active" lineAnimated="true" @input='switchTabs'></ms-tabs>
 		<view class="content">
 			<view v-show="active===0">
-				<view class="dayGift-box" v-for="(day,index) in dayGiftList" :key='day.giftTime'>
+				<view class="dayGift-box" v-for="(day,index) in dayGiftList" :key='day.id'>
 					<view>{{index + 1}}</view>
-					<view style="margin-left: -35%">{{day.giftTime}}</view>
-					<view style="color: #1AAD19;">+{{day.giftCounts}}次</view>
+					<view style="margin-left: -35%">{{day.date}}</view>
+					<view style="color: #1AAD19;">+{{day.times}}次</view>
 				</view>
 		        <view class="dayGift-box" style="justify-content: center;" v-if="!dayGiftList.length">暂无明细</view>
 			</view>
 			<view v-show="active===1">
-				<view class="dayGift-box" v-for="(friend,index) in inviteFriendList" :key='friend.giftTime'>
+				<view class="dayGift-box" v-for="(friend,index) in inviteFriendList" :key='friend.id'>
 					<view>{{index + 1}}</view>
 					<view style="margin-left: -28%" class="flex-column">
 					    <view class="flex-row">
-							<image :src="friend.friendHead" mode="aspectFit"></image>
-							<text>{{friend.friendName}}</text>
+							<view>
+								<image :src="friend.invited_headimg" mode="scaleToFill" style="width: 100%;height: 100%;"></image>
+							</view>
+							<text>{{friend.invited_username}}</text>
 						</view>
-						<view class="friend-time">{{friend.giftTime}}</view>
+						<view class="friend-time">{{friend.date}}</view>
 					</view>
-					<view style="color: #1AAD19;">+{{friend.giftCounts}}次</view>
+					<view style="color: #1AAD19;">+{{friend.times}}次</view>
 				</view>
 			    <view class="dayGift-box" style="justify-content: center;" v-if="!inviteFriendList.length">暂无明细</view>
 			</view>
@@ -43,19 +45,21 @@
 					title: '邀好友奖励次数'
 				}],
 				active: 0,
+				page:'',
+				pageSize:'',
 				dayGiftList:[
-					// {
-					// 	giftTime:'2019.12.03 00:00',
-					// 	giftCounts:'3'
-					// },
-					// {
-					// 	giftTime:'2019.12.04 00:00',
-					// 	giftCounts:'3'
-					// },
-					// {
-					// 	giftTime:'2019.12.05 00:00',
-					// 	giftCounts:'3'
-					// },
+					{
+						giftTime:'2019.12.03 00:00',
+						giftCounts:'3'
+					},
+					{
+						giftTime:'2019.12.04 00:00',
+						giftCounts:'3'
+					},
+					{
+						giftTime:'2019.12.05 00:00',
+						giftCounts:'3'
+					},
 					],
 				inviteFriendList:[
 					{
@@ -79,12 +83,42 @@
 				]
 			}
 		},
+		onShow() {
+			this.getGiftRequest(4);
+			this.getGiftRequest(1);
+		},
 		methods: {
 			switchTabs(){
 				console.log(this.active)
 			},
-			getDayRequest(){},
-			getFriendRequest(){},
+			getGiftRequest(types){
+				let that = this;
+				uni.request({
+					url: getApp().globalData.shareUrl, //需要设置为全局
+					method: 'POST',
+					header: {
+						'content-type': 'application/x-www-form-urlencoded'
+					},
+					data: {
+						method: 'get_times_record_list',
+						timestamp: getApp().globalData.globalTimestamp, //Date.now()
+						uid:  getApp().globalData.user_id,
+						sign: md5('get_times_record_list' + getApp().globalData.globalTimestamp),
+						page:'',
+						page_size:'',
+						type:types
+					},
+					success: res => {
+						if(res.data.code === 200){
+							if(types === 1){
+								that.inviteFriendList = res.data.msg
+							}else {
+								that.dayGiftList = res.data.msg
+							}
+						}
+					}
+				});
+			},
 		}
 	}
 </script>
@@ -131,17 +165,19 @@
 			align-items: center;
 			width: 300rpx;
 		}
-		.flex-row image {
-			width: 60upx;
-			height: 60upx;
-			border-radius: 50%;
+		.flex-row view {
+			width: 80upx;
+			height: 80upx;
 			margin-right: 2%;
+			border: 1px solid white;
+			border-radius: 50%;
+			overflow: hidden;
 		}
 		.friend-time {
 			font-size: 26upx;
 			color: #999;
 			margin-left: -15%;
-			width: 230rpx;
+			width: 260rpx;
 			margin-top: 3%;
 		}
 	}