buyList.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <view class="buy-list-page">
  3. <view class="buy-list" style="height: 100vh">
  4. <view :class="'buy-item ' + (item.memberStatus == '2' ? 'invalid-item' : '')" v-for="(item, index) in buyList" :key="index">
  5. <view class="buy-item-left">
  6. <view>
  7. <text class="item-title">鲸致生活</text>
  8. <text class="item-title" v-if="item.memberType == '1'">超级鲸会员月卡</text>
  9. <text class="item-title" v-if="item.memberType == '2'">超级鲸会员年卡</text>
  10. </view>
  11. <view class="item-content">
  12. <text>有效期:{{ formatFuc.sliceStr(item.effectiveStartTime, 0, 10) }}-{{ formatFuc.sliceStr(item.effectiveEndTime, 0, 10) }}</text>
  13. <!-- <text style="margin-left:30rpx">共{{item.days}}天</text> -->
  14. </view>
  15. <view class="item-date">{{ formatFuc.sliceStr(item.createTime, 0, 10) }} 支付成功</view>
  16. </view>
  17. <view class="buy-item-right">
  18. <image src="https://jzmall.lifejingzhi.com/file/jzmall/weixin/memberCard-1229/icon-member-valid.png" v-if="item.memberStatus == '1'" mode="aspectFit"></image>
  19. <image
  20. src="https://jzmall.lifejingzhi.com/file/jzmall/weixin/memberCard-1229/icon-status-invalid.png"
  21. v-if="item.memberStatus == '2'"
  22. mode="aspectFit"
  23. class="status-img"
  24. ></image>
  25. <image src="https://jzmall.lifejingzhi.com/file/jzmall/weixin/memberCard-1229/icon-member-invalid.png" v-if="item.memberStatus == '2'" mode="aspectFit"></image>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script module="formatFuc" lang="wxs" src="@/utils/formatFuc.wxs"></script>
  32. <script>
  33. var util = require('../../../utils/util.js');
  34. var api = require('../../../config/api');
  35. var user = require('../../../utils/user.js');
  36. var app = getApp();
  37. export default {
  38. data() {
  39. return {
  40. page: 1,
  41. limit: 10,
  42. totalPages: 1,
  43. buyList: [
  44. {
  45. startDate: '2021.07.15',
  46. endDate: '2022.07.15',
  47. totalDay: '365',
  48. date: '2021.07.17',
  49. status: '1'
  50. },
  51. {
  52. startDate: '2021.07.15',
  53. endDate: '2022.07.15',
  54. totalDay: '365',
  55. date: '2021.07.17',
  56. status: '0'
  57. }
  58. ]
  59. };
  60. }
  61. /**
  62. * 生命周期函数--监听页面加载
  63. */,
  64. onLoad: function (options) {
  65. this.getbuyList();
  66. },
  67. /**
  68. * 生命周期函数--监听页面初次渲染完成
  69. */
  70. onReady: function () {},
  71. /**
  72. * 生命周期函数--监听页面显示
  73. */
  74. onShow: function () {},
  75. /**
  76. * 生命周期函数--监听页面隐藏
  77. */
  78. onHide: function () {},
  79. /**
  80. * 生命周期函数--监听页面卸载
  81. */
  82. onUnload: function () {},
  83. /**
  84. * 页面相关事件处理函数--监听用户下拉动作
  85. */
  86. onPullDownRefresh: function () {},
  87. /**
  88. * 页面上拉触底事件的处理函数
  89. */
  90. onReachBottom: function () {
  91. // if (this.data.totalPages > this.data.page) {
  92. // this.setData({
  93. // page: this.data.page + 1
  94. // });
  95. // this.getbuyList();
  96. // } else {
  97. // wx.showToast({
  98. // title: '没有更多了',
  99. // icon: 'none',
  100. // duration: 2000
  101. // });
  102. // return false;
  103. // }
  104. },
  105. /**
  106. * 用户点击右上角分享
  107. */
  108. onShareAppMessage: function () {},
  109. methods: {
  110. getbuyList() {
  111. util.request(
  112. api.getMemberBuyRecord,
  113. {
  114. userId: app.globalData.userInfo.id
  115. },
  116. 'GET'
  117. ).then((res) => {
  118. console.info(res);
  119. if (res.errno === 0) {
  120. this.setData({
  121. buyList: res.data
  122. });
  123. } else {
  124. util.showErrorToast(res.errmsg);
  125. }
  126. });
  127. }
  128. }
  129. };
  130. </script>
  131. <style>
  132. .buy-list-page {
  133. background: #1f232d;
  134. padding: 28rpx 32rpx 0;
  135. }
  136. .buy-item {
  137. height: 180rpx;
  138. margin: 0 0 20rpx;
  139. width: 694rpx;
  140. border-radius: 10rpx;
  141. display: flex;
  142. padding: 30rpx 66rpx 30rpx 44rpx;
  143. justify-content: space-between;
  144. color: #663315;
  145. background: linear-gradient(-11deg, #ffe3b3, #feb73b);
  146. box-shadow: 0rpx 6rpx 8rpx 0rpx rgba(111, 111, 111, 0.06);
  147. border-radius: 15rpx;
  148. }
  149. .buy-item.invalid-item {
  150. background: linear-gradient(-11deg, #ecf1ff, #cad1e7);
  151. color: #9c9c9c;
  152. }
  153. .item-title {
  154. font-size: 28rpx;
  155. font-weight: bold;
  156. }
  157. .item-content {
  158. margin: 8rpx 0 16rpx;
  159. font-size: 22rpx;
  160. }
  161. .item-date {
  162. font-size: 20rpx;
  163. }
  164. .buy-item-right image {
  165. width: 136rpx;
  166. height: 118rpx;
  167. }
  168. .buy-item-right image.status-img {
  169. width: 96rpx;
  170. height: 96rpx;
  171. margin-right: -46rpx;
  172. z-index: 99;
  173. position: relative;
  174. top: -10rpx;
  175. }
  176. </style>