海南旅游项目 前端仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

275 lines
6.5 KiB

  1. <template>
  2. <view>
  3. <!-- tab标签 -->
  4. <view class="lf-p-r-32 lf-p-l-32">
  5. <u-tabs :list="tab_list" bg-color="#F6F6F6" :is-scroll="true" :current="current" @change="change"></u-tabs>
  6. </view>
  7. <swiper :style="{height: 'calc('+ windowHeight +'px - 110rpx)', width: '750rpx'}" :current="current"
  8. @change="swiperChange">
  9. <swiper-item v-for="(tab, tabIndex) in tab_list" :key="tabIndex">
  10. <scroll-view class="com" :scroll-y="true" :refresher-enabled="true" :refresher-triggered="isRefresher"
  11. @scrolltolower="onScrolltolower" @refresherrefresh="onRefresherrefresh">
  12. <view class="flex-direction justify-around list" @click="$url('/pages/order/order_details?order_id=1')">
  13. <view class="lf-row-between">
  14. <view class="left" style="position: relative;display: flex;">
  15. <image src="../../static/logo.png" mode="aspectFill"></image>
  16. </view>
  17. <view class="right">
  18. <view class="lf-line-2 title lf-font-28 lf-color-333" style="line-height: 40rpx;">南澳站·潮玩旅游胜地 身处亚热带风情/玩转南澳</view>
  19. <view class="lf-flex tips lf-m-t-10">
  20. <text class="progress margin-right-xs lf-color-gray">数量</text>
  21. <text class="bought lf-color-gray">x 1</text>
  22. </view>
  23. <view class="lf-row-between price lf-m-t-16" style="padding-right: 6rpx;">
  24. <lf-price :price="599.00" style="margin-top: 10rpx;" />
  25. <button class="lf-font-24 radius-order">立即付款</button>
  26. <!-- <button class="cu-btn1 lf-color-green lf-border-green">立即使用</button> -->
  27. <!-- <button class="cu-btn1 lf-color-blue lf-border-blue">已使用</button> -->
  28. <!-- <button class="cu-btn1 lf-color-gray lf-border-gray">等待审核</button> -->
  29. </view>
  30. </view>
  31. </view>
  32. <view>
  33. <view class="solid-top flex justify-between align-center text-center">
  34. <view class="text-gray lf-font-28" style="padding: 20rpx;">
  35. 2021-7-6 23:24:46
  36. </view>
  37. <view class="lf-color-price" style="padding: 20rpx 24rpx 20rpx 20rpx;">
  38. 请在10分钟内付款
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <!-- 空数据的情况 -->
  44. <view class="loading-more">
  45. <text v-if="tab.list.length"
  46. :class="{'loading-more-text': tab.loadingClass}">{{ tab.loadingText }}</text>
  47. <my-nocontent v-else></my-nocontent>
  48. </view>
  49. <!-- 回到顶部 -->
  50. <u-back-top :scroll-top="pageScrollTop" :custom-style="{background: 'rgba(51, 51 51, 0.3)'}">
  51. </u-back-top>
  52. </scroll-view>
  53. </swiper-item>
  54. </swiper>
  55. </view>
  56. </template>
  57. <script>
  58. export default {
  59. data() {
  60. return {
  61. tab_list: [{
  62. name: '全部',
  63. type: 'all',
  64. list: [],
  65. loadingClass: true,
  66. loadingText: '正在加载中',
  67. page: 1,
  68. isPage: true
  69. }, {
  70. name: '待付款',
  71. type: 'unpaid',
  72. list: [],
  73. loadingClass: true,
  74. loadingText: '正在加载中',
  75. page: 1,
  76. isPage: true
  77. }, {
  78. name: '已付款',
  79. type: 'paid',
  80. list: [],
  81. loadingClass: true,
  82. loadingText: '正在加载中',
  83. page: 1,
  84. isPage: true
  85. },
  86. {
  87. name: '已完成',
  88. type: 'complete',
  89. list: [],
  90. loadingClass: true,
  91. loadingText: '正在加载中',
  92. page: 1,
  93. isPage: true
  94. },
  95. {
  96. name: '售后',
  97. type: 'after_sales',
  98. list: [],
  99. loadingClass: true,
  100. loadingText: '正在加载中',
  101. page: 1,
  102. isPage: true
  103. }
  104. ],
  105. current: 0, // tab下表
  106. pageSize: 10,
  107. windowHeight: 0, // 屏幕可用高度
  108. }
  109. },
  110. onLoad(e) {
  111. this.windowHeight = getApp().globalData.windowHeight;
  112. },
  113. methods: {
  114. //获取订单数据
  115. getUserOrder() {
  116. console.log('获取数据')
  117. },
  118. // 切换tab
  119. change(index) {
  120. this.current = index;
  121. this.getUserOrder();
  122. },
  123. // 滑块下标值变化
  124. swiperChange(event) {
  125. this.current = event.detail.current;
  126. if (event.detail.source == '') return; // 如果是被动出发,没有事件类型则不做处理
  127. this.getUserOrder();
  128. },
  129. // 页面触底,加载下一页
  130. onScrolltolower() {
  131. let tab_item = this.tab_list[this.current];
  132. if (tab_item.isPage) {
  133. tab_item.page = tab_item.page + 1;
  134. this.getUserOrder();
  135. }
  136. },
  137. // scroll-view 下拉刷新
  138. onRefresherrefresh() {
  139. this.isRefresher = true;
  140. this.refreshFn({
  141. type: 'scrollRefresh'
  142. });
  143. },
  144. // 下拉刷新处理
  145. refreshFn(options) {
  146. let tab_item = this.tab_list[this.current];
  147. tab_item.page = 1;
  148. tab_item.isPage = true;
  149. tab_item.loadingClass = true;
  150. tab_item.loadingText = '正在加载中';
  151. this.getUserOrder(options);
  152. }
  153. },
  154. onPullDownRefresh() {
  155. this.refreshFn({
  156. type: 'pageRefresh'
  157. });
  158. }
  159. }
  160. </script>
  161. <style lang="scss">
  162. page {
  163. background-color: #F6F6F6;
  164. }
  165. .radius-order {
  166. border-radius: 31.5rpx;
  167. }
  168. .font-400 {
  169. font-weight: 400;
  170. }
  171. .tag-self {
  172. position: absolute !important;
  173. top: 0 !important;
  174. border-radius: 20rpx 0 20rpx 0 !important;
  175. width: max-content;
  176. height: 32rpx !important;
  177. }
  178. .title {
  179. font-size: 28rpx;
  180. color: $u-content-color;
  181. height: 80rpx;
  182. }
  183. // tab
  184. .ctab {
  185. width: 100%;
  186. margin: 20rpx 0 0rpx 0rpx;
  187. padding: 0 22rpx;
  188. }
  189. // 商品列表
  190. .com {
  191. width: 100%;
  192. overflow: hidden;
  193. .list {
  194. border-radius: 20rpx;
  195. overflow: hidden;
  196. margin: 0 32rpx 30rpx 32rpx;
  197. background-color: #FFFFFF;
  198. // box-shadow: 0 10rpx 20rpx 0 rgba(0, 0, 0, 0.1);
  199. align-items: flex-start;
  200. .left {
  201. overflow: hidden;
  202. image {
  203. width: 210rpx;
  204. height: 210rpx;
  205. margin: 20rpx;
  206. border-radius: 20rpx;
  207. }
  208. }
  209. .right {
  210. overflow: hidden;
  211. width: 67%;
  212. .title {
  213. margin: 0rpx 20rpx 0rpx 0;
  214. color: #222222;
  215. font-size: 32rpx;
  216. }
  217. .tips {
  218. margin: 16rpx 0;
  219. overflow: hidden;
  220. .u-line-progress {
  221. width: 112rpx;
  222. overflow: hidden;
  223. margin-right: 20rpx;
  224. }
  225. .progress {
  226. color: #777777;
  227. font-size: 24rpx;
  228. }
  229. .bought {
  230. color: #777777;
  231. font-size: 24rpx;
  232. margin-right: 20rpx;
  233. }
  234. }
  235. .price {
  236. overflow: hidden;
  237. color: #FF0000;
  238. button {
  239. width: 150rpx;
  240. height: 63rpx;
  241. background: #fff;
  242. border-radius: 31.5rpx;
  243. font-size: 24rpx;
  244. color: #FF0000;
  245. margin: 0rpx 20rpx 0rpx 20rpx;
  246. border: 1px solid #FF0000;
  247. line-height: 60rpx;
  248. padding: 0;
  249. }
  250. }
  251. }
  252. }
  253. }
  254. </style>