| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188 |
- <template>
- <view>
- <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.id'>
- <view>{{index + 1}}</view>
- <view style="margin-left: -35%">{{day.date}}</view>
- <view style="color: #1AAD19;">+{{day.times || 0}}次</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.id'>
- <view>{{index + 1}}</view>
- <view style="margin-left: -28%" class="flex-column">
- <view class="flex-row">
- <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.date}}</view>
- </view>
- <view style="color: #1AAD19;">+{{friend.times || 0}}次</view>
- </view>
- <view class="dayGift-box" style="justify-content: center;" v-if="!inviteFriendList.length">暂无明细</view>
- </view>
- </view>
- </view>
- </template>
- <script>
- var md5 = require("../../../common/md5.js");
- import msTabs from '@/components/ms-tabs/ms-tabs.vue'
- export default {
- components: {
- msTabs
- },
- data() {
- return {
- type: [{
- title: '每日赠送次数'
- }, {
- 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'
- },
- ],
- inviteFriendList:[
- {
- friendHead:'/static/userDefault.png',
- friendName:'小瓶子',
- giftCounts:'10',
- giftTime:'2019.12.05 00:00',
- },
- {
- friendHead:'/static/userDefault.png',
- friendName:'小瓶子',
- giftCounts:'10',
- giftTime:'2019.12.06 00:00',
- },
- {
- friendHead:'/static/userDefault.png',
- friendName:'小瓶子',
- giftCounts:'10',
- giftTime:'2019.12.07 00:00',
- },
- ]
- }
- },
- onShow() {
- this.getGiftRequest(4);
- this.getGiftRequest(1);
- },
- methods: {
- switchTabs(){
- console.log(this.active)
- },
- 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>
- <style lang="scss">
- page {
- height:100%
- }
- .content {
- height:100%;
- background: #fff;
- margin-bottom: 20rpx;
- .title {
- margin-left: 20rpx;
- padding: 20rpx 0;
- color: #818586;
- border-bottom: 1px solid #f6f6f6;
- }
- .btn {
- background: $uni-color-primary;
- background: #007aff;
- color: #fff;
- padding: 20rpx;
- display: inline-block;
- border-radius: 10rpx;
- }
- .dayGift-box{
- display: flex;
- justify-content: space-between;
- align-items: center;
- font-size: 28rpx;
- padding: 20rpx;
- border-bottom: 1px solid #ccc;
- }
- .flex-column {
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- align-items: center;
- }
- .flex-row {
- display: flex;
- justify-content: flex-start;
- align-items: center;
- width: 300rpx;
- }
- .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: 260rpx;
- margin-top: 3%;
- }
- }
-
-
- </style>
|