shareDetail.vue 4.4 KB

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