shareDetail.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <template>
  2. <view>
  3. <ms-tabs :type="type" v-model="active" lineAnimated="true" @input='switchTabs'></ms-tabs>
  4. <view class="content">
  5. <view v-show="active===0">
  6. <view class="dayGift-box" v-for="(day,index) in dayGiftList" :key='day.id'>
  7. <view>{{index + 1}}</view>
  8. <view style="margin-left: -35%">{{day.date}}</view>
  9. <view style="color: #1AAD19;">+{{day.times || 0}}次</view>
  10. </view>
  11. <view class="dayGift-box" style="justify-content: center;" v-if="!dayGiftList.length">暂无明细</view>
  12. </view>
  13. <view v-show="active===1">
  14. <view class="dayGift-box" v-for="(friend,index) in inviteFriendList" :key='friend.id'>
  15. <view>{{index + 1}}</view>
  16. <view style="margin-left: -28%" class="flex-column">
  17. <view class="flex-row">
  18. <view>
  19. <image :src="friend.invited_headimg" mode="scaleToFill" style="width: 100%;height: 100%;"></image>
  20. </view>
  21. <text>{{friend.invited_username}}</text>
  22. </view>
  23. <view class="friend-time">{{friend.date}}</view>
  24. </view>
  25. <view style="color: #1AAD19;">+{{friend.times || 0}}次</view>
  26. </view>
  27. <view class="dayGift-box" style="justify-content: center;" v-if="!inviteFriendList.length">暂无明细</view>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. var md5 = require("../../../common/md5.js");
  34. import msTabs from '@/components/ms-tabs/ms-tabs.vue'
  35. export default {
  36. components: {
  37. msTabs
  38. },
  39. data() {
  40. return {
  41. type: [{
  42. title: '每日赠送次数'
  43. }, {
  44. title: '邀好友奖励次数'
  45. }],
  46. active: 0,
  47. page:'',
  48. pageSize:'',
  49. dayGiftList:[
  50. {
  51. giftTime:'2019.12.03 00:00',
  52. giftCounts:'3'
  53. },
  54. {
  55. giftTime:'2019.12.04 00:00',
  56. giftCounts:'3'
  57. },
  58. {
  59. giftTime:'2019.12.05 00:00',
  60. giftCounts:'3'
  61. },
  62. ],
  63. inviteFriendList:[
  64. {
  65. friendHead:'/static/userDefault.png',
  66. friendName:'小瓶子',
  67. giftCounts:'10',
  68. giftTime:'2019.12.05 00:00',
  69. },
  70. {
  71. friendHead:'/static/userDefault.png',
  72. friendName:'小瓶子',
  73. giftCounts:'10',
  74. giftTime:'2019.12.06 00:00',
  75. },
  76. {
  77. friendHead:'/static/userDefault.png',
  78. friendName:'小瓶子',
  79. giftCounts:'10',
  80. giftTime:'2019.12.07 00:00',
  81. },
  82. ]
  83. }
  84. },
  85. onShow() {
  86. this.getGiftRequest(4);
  87. this.getGiftRequest(1);
  88. },
  89. methods: {
  90. switchTabs(){
  91. console.log(this.active)
  92. },
  93. getGiftRequest(types){
  94. let that = this;
  95. uni.request({
  96. url: getApp().globalData.shareUrl, //需要设置为全局
  97. method: 'POST',
  98. header: {
  99. 'content-type': 'application/x-www-form-urlencoded'
  100. },
  101. data: {
  102. method: 'get_times_record_list',
  103. timestamp: getApp().globalData.globalTimestamp, //Date.now()
  104. uid: getApp().globalData.user_id,
  105. sign: md5('get_times_record_list' + getApp().globalData.globalTimestamp),
  106. page:'',
  107. page_size:'',
  108. type:types
  109. },
  110. success: res => {
  111. if(res.data.code === 200){
  112. if(types === 1){
  113. that.inviteFriendList = res.data.msg
  114. }else {
  115. that.dayGiftList = res.data.msg
  116. }
  117. }
  118. }
  119. });
  120. },
  121. }
  122. }
  123. </script>
  124. <style lang="scss">
  125. page {
  126. height:100%
  127. }
  128. .content {
  129. height:100%;
  130. background: #fff;
  131. margin-bottom: 20rpx;
  132. .title {
  133. margin-left: 20rpx;
  134. padding: 20rpx 0;
  135. color: #818586;
  136. border-bottom: 1px solid #f6f6f6;
  137. }
  138. .btn {
  139. background: $uni-color-primary;
  140. background: #007aff;
  141. color: #fff;
  142. padding: 20rpx;
  143. display: inline-block;
  144. border-radius: 10rpx;
  145. }
  146. .dayGift-box{
  147. display: flex;
  148. justify-content: space-between;
  149. align-items: center;
  150. font-size: 28rpx;
  151. padding: 20rpx;
  152. border-bottom: 1px solid #ccc;
  153. }
  154. .flex-column {
  155. display: flex;
  156. flex-direction: column;
  157. justify-content: space-between;
  158. align-items: center;
  159. }
  160. .flex-row {
  161. display: flex;
  162. justify-content: flex-start;
  163. align-items: center;
  164. width: 300rpx;
  165. }
  166. .flex-row view {
  167. width: 80upx;
  168. height: 80upx;
  169. margin-right: 2%;
  170. border: 1px solid white;
  171. border-radius: 50%;
  172. overflow: hidden;
  173. }
  174. .friend-time {
  175. font-size: 26upx;
  176. color: #999;
  177. margin-left: -15%;
  178. width: 260rpx;
  179. margin-top: 3%;
  180. }
  181. }
  182. </style>