myTimes.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <template>
  2. <view class="container">
  3. <view class="tui-bankcard__list">
  4. <view class="tui-bankcard__item" @click="orderDetail(item.id,item.is_times)" :class="'cardbg'+item.styleno" v-for="(item,orderIndex) in orderList"
  5. :key="orderIndex">
  6. <view class="tui-card__info">
  7. <block v-for="(goodsitem,index) in item.goodsMap" :key="index">
  8. <view class="tui-logo__box">
  9. <image class="tui-logo" :src="goodsitem.image"></image>
  10. </view>
  11. <view class="tui-name__box">
  12. <view class="tui-name">{{goodsitem.name}}</view>
  13. <view v-if="goodsitem.label" class="tui-desc">{{goodsitem.label}}</view>
  14. <view v-if="index ==0 && item.is_times==1" class="tui-desc">次卡:{{item.OrderCard.timesmum}}次,剩余:{{item.remain}}次</view>
  15. <view v-if="index ==0 && item.is_times==3" class="tui-desc">面值:{{item.OrderCard.facevalue}},余额:{{item.OrderCard.balance}}</view>
  16. <view v-if="index ==0 && item.timeslabel" class="tui-desc">{{item.timeslabel}}
  17. </view>
  18. </view>
  19. </block>
  20. <view class="tui-card__no">**** {{item.minialias}}</view>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. export default {
  28. data() {
  29. return {
  30. tabBar: [],
  31. statusType: [],
  32. ptype: 2,
  33. currentType: 0,
  34. currentTab: 0,
  35. pageIndex: 1,
  36. loadding: false,
  37. pullUpOn: true,
  38. scrollTop: 0,
  39. orderList: [],
  40. where: {
  41. status: 0,
  42. ptype: 0,
  43. is_times: 1,
  44. keyword: '',
  45. page: 1,
  46. limit: 10,
  47. },
  48. }
  49. },
  50. onLoad: function(e) {
  51. let _this = this
  52. },
  53. onShow: function(e) {
  54. this.getorderlist(true);
  55. },
  56. methods: {
  57. getorderlist: function(isPage) {
  58. var _this = this
  59. console.log(_this.loadend);
  60. if (_this.loading) return;
  61. if (isPage === true) {
  62. _this.where.page = 1;
  63. _this.orderList = [];
  64. } else {
  65. if (_this.loadend) return;
  66. }
  67. _this.where.samkey = (new Date()).valueOf();
  68. _this.where.ptype = _this.ptype;
  69. _this.where.status = _this.currentType;
  70. //console.log(_this.where);
  71. _this.$request.post('order.myorder', _this.where).then(res => {
  72. if (res.errno == 0) {
  73. _this.orderList = _this.orderList.concat(res.data.data);
  74. _this.where.page = _this.where.page + 1
  75. _this.loadend = _this.orderList.length < _this.where.limit;
  76. }
  77. _this.loading = false;
  78. })
  79. },
  80. orderDetail: function(orderid,is_times) {
  81. if(is_times!=3){
  82. var url = '/pagesA/my/myOrder/myTimesDetail?id=' + orderid;
  83. uni.navigateTo({
  84. url: url
  85. })
  86. }
  87. }
  88. },
  89. /**
  90. * 页面相关事件处理函数--监听用户下拉动作
  91. */
  92. onPullDownRefresh: function() {
  93. this.where.page = 1;
  94. this.loadend = false;
  95. this.orderList = [];
  96. this.getorderlist();
  97. setTimeout(() => {
  98. uni.stopPullDownRefresh()
  99. }, 200);
  100. },
  101. /**
  102. * 页面上拉触底事件的处理函数
  103. */
  104. onReachBottom() {
  105. //只是测试效果,逻辑以实际数据为准
  106. this.loadding = true
  107. this.pullUpOn = true
  108. this.getorderlist();
  109. setTimeout(() => {
  110. this.loadding = false
  111. this.pullUpOn = false
  112. }, 1000)
  113. },
  114. onPageScroll(e) {
  115. this.scrollTop = e.scrollTop;
  116. }
  117. }
  118. </script>
  119. <style>
  120. .container {
  121. width: 100%;
  122. padding: 30rpx 40rpx 40rpx;
  123. box-sizing: border-box;
  124. }
  125. .tui-header {
  126. width: 100%;
  127. padding: 36rpx 0;
  128. display: flex;
  129. align-items: center;
  130. justify-content: space-between;
  131. }
  132. .tui-title {
  133. font-size: 30rpx;
  134. font-weight: bold;
  135. }
  136. .tui-total {
  137. font-size: 24rpx;
  138. color: #999;
  139. }
  140. .tui-bankcard__item {
  141. width: 100%;
  142. height: 240rpx;
  143. padding: 30rpx;
  144. box-sizing: border-box;
  145. border-radius: 16rpx;
  146. margin-bottom: 20rpx;
  147. }
  148. .tui-logo__box {
  149. width: 80rpx;
  150. height: 80rpx;
  151. border-radius: 50%;
  152. background-color: #fff;
  153. display: flex;
  154. align-items: center;
  155. justify-content: center;
  156. margin-right: 20rpx;
  157. }
  158. .tui-logo {
  159. width: 52rpx;
  160. height: 52rpx;
  161. }
  162. .tui-card__info {
  163. display: flex;
  164. align-items: center;
  165. color: #fff;
  166. }
  167. .tui-name {
  168. font-size: 30rpx;
  169. font-weight: 500;
  170. }
  171. .tui-desc {
  172. font-size: 24rpx;
  173. opacity: 0.7;
  174. }
  175. .tui-card__no {
  176. margin-left: auto;
  177. }
  178. .cardbg0 {
  179. background: linear-gradient(to right, #FEAD4B, #FF9225);
  180. }
  181. .cardbg1 {
  182. background: linear-gradient(to right, #2C85D5, #2D66D1);
  183. }
  184. .cardbg2 {
  185. background: linear-gradient(to right, #2C87D6, #2D69D0);
  186. }
  187. .cardbg3 {
  188. background: linear-gradient(to right, #01ADA3, #0291A9);
  189. }
  190. .cardbg4 {
  191. background: linear-gradient(to right, #FF6F64, #FE5762);
  192. }
  193. .cardbg5 {
  194. background: linear-gradient(to right, #FF7065, #FD4754);
  195. }
  196. .tui-ping_an {
  197. background: linear-gradient(to right, #FEAD4B, #FF9225);
  198. }
  199. .tui-jian_she {
  200. background: linear-gradient(to right, #2C85D5, #2D66D1);
  201. }
  202. .tui-min_sheng {
  203. background: linear-gradient(to right, #2C87D6, #2D69D0);
  204. }
  205. .tui-nong_ye {
  206. background: linear-gradient(to right, #01ADA3, #0291A9);
  207. }
  208. .tui-zhao_shang {
  209. background: linear-gradient(to right, #FF6F64, #FE5762);
  210. }
  211. .tui-zhong_xin {
  212. background: linear-gradient(to right, #FF7065, #FD4754);
  213. }
  214. </style>