giftlist.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. <template>
  2. <view>
  3. <!--列表-->
  4. <scroll-view scroll-y="true" class="scroll-Y" :style="'height:' + scrollviewHigh + 'px;'" lower-threshold="50" @scrolltolower="scrolltolowerFunc">
  5. <view :class="topRefresh ? 'top-refresh open' : 'top-refresh'"><view class="circle" v-for="(circle, n) in 3" :key="n"></view></view>
  6. <view class="order-list">
  7. <view class="item" v-for="(item, index) in listData" :key="index">
  8. <view class="order-head d-b-c">
  9. <view>
  10. <text class="state-text">{{ item.order_source_text }}</text>
  11. <text class="shop-name flex-1 fb">订单号:{{ item.order_no }}</text>
  12. </view>
  13. </view>
  14. <!--一个商品显示-->
  15. <view class="one-product d-a-c" @click="gotoPage(item.order_no)">
  16. <view>
  17. <view class="giftlist_item_num">{{item.point*1}}<text class='f20'>个</text></view>
  18. <view class="giftlist_item_type">积分</view>
  19. </view>
  20. <view>
  21. <view class="giftlist_item_num">{{item.coupon_num}}<text class="f20">张</text></view>
  22. <view class="giftlist_item_type">优惠券</view>
  23. </view>
  24. <view>
  25. <view class="giftlist_item_num">{{item.product_num}}<text class="f20">件</text></view>
  26. <view class="giftlist_item_type">商品</view>
  27. </view>
  28. <view class="total-count">
  29. <view class="left-shadow"></view>
  30. <view class="price f22">
  31. ¥
  32. <text class="f40">{{item.pay_price}}</text>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="d-c-c p30" v-if="listData.length == 0 && !loading">
  38. <text class="iconfont icon-wushuju"></text>
  39. <text class="cont">亲,暂无相关记录哦</text>
  40. </view>
  41. <uni-load-more v-else :loadingType="loadingType"></uni-load-more>
  42. </view>
  43. </scroll-view>
  44. </view>
  45. </template>
  46. <script>
  47. import uniLoadMore from '@/components/uni-load-more.vue';
  48. import { pay } from '@/common/pay.js';
  49. export default {
  50. components: {
  51. uniLoadMore
  52. },
  53. data() {
  54. return {
  55. /*手机高度*/
  56. phoneHeight: 0,
  57. /*可滚动视图区域高度*/
  58. scrollviewHigh: 0,
  59. /*顶部刷新*/
  60. topRefresh: false,
  61. /*数据*/
  62. listData: [],
  63. /*是否显示支付类别弹窗*/
  64. isPayPopup: false,
  65. /*订单id*/
  66. order_id: 0,
  67. /*最后一页码数*/
  68. last_page: 0,
  69. /*当前页面*/
  70. page: 1,
  71. /*每页条数*/
  72. list_rows: 10,
  73. /*有没有等多*/
  74. no_more: false,
  75. /*是否正在加载*/
  76. loading: true,
  77. /*是否显示核销二维码*/
  78. isCodeImg: false,
  79. codeImg: ''
  80. };
  81. },
  82. computed: {
  83. /*加载中状态*/
  84. loadingType() {
  85. if (this.loading) {
  86. return 1;
  87. } else {
  88. if (this.listData.length != 0 && this.no_more) {
  89. return 2;
  90. } else {
  91. return 0;
  92. }
  93. }
  94. }
  95. },
  96. onLoad(e) {
  97. },
  98. mounted() {
  99. this.init();
  100. /*获取订单列表*/
  101. this.getData();
  102. },
  103. methods: {
  104. /*初始化*/
  105. init() {
  106. let self = this;
  107. uni.getSystemInfo({
  108. success(res) {
  109. self.phoneHeight = res.windowHeight;
  110. self.scrollviewHigh = self.phoneHeight;
  111. }
  112. });
  113. },
  114. /*可滚动视图区域到底触发*/
  115. scrolltolowerFunc() {
  116. let self = this;
  117. if (self.no_more) {
  118. return;
  119. }
  120. self.page++;
  121. if (self.page <= self.last_page) {
  122. self.getData();
  123. } else {
  124. self.no_more = true;
  125. }
  126. },
  127. /*获取数据*/
  128. getData() {
  129. let self = this;
  130. self.loading = true;
  131. self._get(
  132. 'plus.package.order/orderlist',
  133. {
  134. page: self.page,
  135. list_rows: self.list_rows
  136. },
  137. function(res) {
  138. self.loading = false;
  139. self.listData = self.listData.concat(res.data.list.data);
  140. self.last_page = res.data.list.last_page;
  141. if (res.data.list.last_page <= 1) {
  142. self.no_more = true;
  143. } else {
  144. self.no_more = false;
  145. }
  146. }
  147. );
  148. },
  149. /*跳转页面*/
  150. gotoPage(e) {
  151. this.gotoPage('/pages/plus/giftpackage/order_detail?order_no=' + e);
  152. },
  153. }
  154. };
  155. </script>
  156. <style lang="scss">
  157. .order-list{
  158. padding: 30rpx;
  159. }
  160. .order-list .order-head .state-text {
  161. padding: 4rpx 8rpx;
  162. margin-right: 10rpx;
  163. border-radius: 4rpx;
  164. background: $dominant-color;
  165. color: #ffffff;
  166. }
  167. .order-list .item {
  168. margin-top: 30rpx;
  169. padding: 30rpx;
  170. background: #ffffff;
  171. border: 1rpx solid #CACACA;
  172. border-radius: 15rpx;
  173. }
  174. .order-list .product-list,
  175. .order-list .one-product {
  176. height: 160rpx;
  177. }
  178. .one-product .pro-info {
  179. padding: 0 30rpx;
  180. display: -webkit-box;
  181. overflow: hidden;
  182. -webkit-line-clamp: 2;
  183. -webkit-box-orient: vertical;
  184. font-size: 28rpx;
  185. color: #666666;
  186. }
  187. .order-list .cover,
  188. .order-list .cover image {
  189. width: 160rpx;
  190. height: 160rpx;
  191. }
  192. .order-list .total-count {
  193. padding-left: 20rpx;
  194. display: flex;
  195. flex-direction: column;
  196. justify-content: center;
  197. align-items: flex-end;
  198. }
  199. .total-count .count {
  200. padding-top: 10rpx;
  201. color: #666;
  202. font-size: 28rpx;
  203. }
  204. .product-list .total-count {
  205. position: absolute;
  206. top: 0;
  207. right: 0;
  208. bottom: 0;
  209. background: rgba(255, 255, 255, 0.9);
  210. }
  211. .product-list .total-count .left-shadow {
  212. position: absolute;
  213. top: 0;
  214. bottom: 0;
  215. left: -24rpx;
  216. width: 24rpx;
  217. overflow: hidden;
  218. }
  219. .product-list .total-count .left-shadow::after {
  220. position: absolute;
  221. top: 0;
  222. bottom: 0;
  223. width: 24rpx;
  224. right: -12rpx;
  225. display: block;
  226. content: '';
  227. background-image: radial-gradient(rgba(0, 0, 0, 0.2) 10%, rgba(0, 0, 0, 0.1) 40%, rgba(0, 0, 0, 0) 80%);
  228. }
  229. .order-list .order-bts {
  230. display: flex;
  231. justify-content: flex-end;
  232. align-items: center;
  233. }
  234. .order-list .order-bts button {
  235. margin: 0;
  236. padding: 0 30rpx;
  237. height: 60rpx;
  238. line-height: 60rpx;
  239. margin-left: 20rpx;
  240. border-radius: 30rpx;
  241. font-size: 24rpx;
  242. border: 1px solid #cccccc;
  243. white-space: nowrap;
  244. background: #ffffff;
  245. }
  246. .order-list .order-bts button::after {
  247. display: none;
  248. }
  249. .order-list .order-bts button.btn-border-red {
  250. border: 1px solid $dominant-color;
  251. font-size: 24rpx;
  252. color: $dominant-color;
  253. }
  254. .order-list .order-bts button.btn-red {
  255. background: $dominant-color;
  256. border: 1px solid $dominant-color;
  257. font-size: 24rpx;
  258. color: #ffffff;
  259. }
  260. .buy-checkout {
  261. width: 100%;
  262. }
  263. .buy-checkout .item {
  264. min-height: 50rpx;
  265. line-height: 50rpx;
  266. padding: 20rpx;
  267. display: flex;
  268. justify-content: space-between;
  269. font-size: 28rpx;
  270. }
  271. .buy-checkout .iconfont.icon-weixin {
  272. color: #04be01;
  273. font-size: 50rpx;
  274. }
  275. .buy-checkout .iconfont.icon-yue {
  276. color: #f0de7c;
  277. font-size: 50rpx;
  278. }
  279. .buy-checkout .item.active .iconfont.icon-xuanze {
  280. color: #04be01;
  281. }
  282. .giftlist_item_num{
  283. color: $dominant-color;
  284. font-size: 28rpx;
  285. text-align: center;
  286. }
  287. .giftlist_item_type{
  288. text-align: center;
  289. color: #000000;
  290. font-size: 30rpx;
  291. }
  292. .f20{
  293. font-size: 20rpx;
  294. }
  295. </style>