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.

263 lines
6.0 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
  1. <template>
  2. <view class="order bx">
  3. <view style="position: fixed;
  4. height: 210rpx;
  5. width: 100%;
  6. z-index: 99;
  7. background-color: #fff;">
  8. </view>
  9. <view class="order-nav">
  10. <navbar
  11. style="background: transparent;position: fixed;"
  12. :title="$t('page.order.records')"></navbar>
  13. </view>
  14. <u-sticky>
  15. <view style="width: 100%;display: flex;padding: 20rpx 0rpx;font-size: 28rpx;">
  16. <view style="flex: 1;
  17. text-align: center;padding: 10rpx 0;
  18. margin: 20rpx;"
  19. :class="{act : currentIndex == index}"
  20. @click="tabChange(index)"
  21. v-for="(item, index) in classifyList">
  22. {{ item.name }}
  23. </view>
  24. </view>
  25. </u-sticky>
  26. <view v-if="!noOrder" class="order-list">
  27. <u-list @scrolltolower="scrolltolower" height="calc(100vh - 90rpx)">
  28. <view v-for="(item,index) in productList" :key="index"
  29. class="order-item">
  30. <view class="top">
  31. <view style="font-size: 28rpx;" class="time">
  32. {{ item.createTime }}
  33. </view>
  34. <view style="color: #333;border: 1px solid #333;
  35. padding: 7rpx 15rpx;font-size: 24rpx;"
  36. v-if="item.state != 0">
  37. {{ $t('page.order.Submit_New') }}
  38. </view>
  39. <view style="color: #f90;border: 1px solid #f90;
  40. padding: 7rpx 15rpx;font-size: 24rpx;"
  41. v-else @click="order = item;show = true;$play()">
  42. {{ $t('page.order.pay') }}
  43. </view>
  44. </view>
  45. <view class="con"
  46. style="border-bottom: 1px solid #333;
  47. padding: 20rpx 0;">
  48. <view class="img-box" style="width: 150rpx;height: 150rpx;
  49. overflow: hidden;border-radius: 10rpx;display: flex;
  50. align-items: center;">
  51. <image :src="item.image" mode="widthFix" style="width: 150rpx;"></image>
  52. </view>
  53. <view style="font-weight: 900;margin-left: 20rpx;font-size: 28rpx;color: #333;">
  54. {{ item.subTitle }}
  55. </view>
  56. </view>
  57. <view class="con"
  58. style="margin-top: 20rpx;font-size: 28rpx;font-weight: 500;">
  59. <view style="flex: 1;">
  60. {{ $t('page.order.Total_Amount') }}
  61. </view>
  62. <view style="flex: 1;">
  63. {{ $t('page.order.Profit') }}
  64. </view>
  65. </view>
  66. <view class="con"
  67. style="margin-top: 10rpx;
  68. color: #333;font-weight: 900;font-size: 28rpx;">
  69. <view style="flex: 1;">
  70. USDT {{ item.price }}
  71. </view>
  72. <view style="flex: 1;">
  73. USDT {{ item.giveMoney }}
  74. </view>
  75. </view>
  76. </view>
  77. <view style="justify-content: center;display: flex;
  78. margin-top: 150rpx;" v-if="loading">
  79. <u-loading-icon
  80. mode="semicircle"
  81. size="30"></u-loading-icon>
  82. </view>
  83. </u-list>
  84. </view>
  85. <view v-else class="no-order">
  86. <view class="box">
  87. <view class="no-product-title">{{ $t('page.order.no-Order') }}</view>
  88. <view @click="toHome()" class="to-home">{{ $t('page.order.take-stroll')}}</view>
  89. </view>
  90. </view>
  91. <u-modal :show="show"
  92. :title="$t('page.order.confirm_pay')"
  93. :confirmText="$t('page.order.ok')"
  94. :cancelText="$t('page.order.no')"
  95. @cancel="show = false;$play()"
  96. @confirm="payOrder"
  97. :showCancelButton="true"
  98. ></u-modal>
  99. <sTabbar select="2"/>
  100. </view>
  101. </template>
  102. <script>
  103. import navbar from '@/components/base/m-navbar.vue'
  104. import sTabbar from '@/components/base/tabBar.vue'
  105. export default {
  106. components: {
  107. navbar,
  108. sTabbar
  109. },
  110. data() {
  111. return {
  112. classifyList: [
  113. {
  114. name: this.$t('page.order.class_1')
  115. },
  116. {
  117. name: this.$t('page.order.class_2')
  118. },
  119. {
  120. name: this.$t('page.order.class_3')
  121. },
  122. {
  123. name: this.$t('page.order.class_4')
  124. },
  125. ],
  126. productList: [],
  127. currentIndex: 0, //当前选择的标签index
  128. queryParams: {
  129. pageNo: 1,
  130. pageSize: 10
  131. },
  132. noOrder: false,
  133. loading : false,
  134. show : false,
  135. order : {}
  136. }
  137. },
  138. onShow() {
  139. this.getOrderList();
  140. this.currentIndex = localStorage.getItem('orderIndex') ?
  141. parseInt(localStorage.getItem('orderIndex')) : 0
  142. localStorage.removeItem('orderIndex')
  143. },
  144. methods: {
  145. getOrderList() { //获取订单列表
  146. this.loading = true
  147. let data = {
  148. ...this.queryParams,
  149. }
  150. if(this.currentIndex) data.state = this.currentIndex - 1
  151. this.request('orderPage', {}, data).then(res => {
  152. if(res.code == 200){
  153. this.loading = false
  154. this.productList = res.result.records
  155. }
  156. })
  157. },
  158. tabChange(index) {
  159. if (index != this.currentIndex) {
  160. this.currentIndex = index
  161. this.$play()
  162. this.getOrderList();
  163. }
  164. },
  165. payOrder() {
  166. this.$play()
  167. uni.showLoading()
  168. this.request('pay', {}, {
  169. id : this.order.id
  170. }).then(res => {
  171. uni.hideLoading()
  172. this.show = false
  173. if (res.code == 200) {
  174. this.getOrderList();
  175. }
  176. })
  177. },
  178. toHome(){ //去首页
  179. this.$play()
  180. uni.switchTab({
  181. url: '/pages/home/home'
  182. })
  183. },
  184. scrolltolower(){
  185. this.queryParams.pageSize += 10
  186. this.getOrderList()
  187. }
  188. }
  189. }
  190. </script>
  191. <style lang="scss" scoped>
  192. .order {
  193. padding-bottom: 200rpx;
  194. background-color: #f7f7f7;
  195. // background-image: url('@/static/home/bg.png');
  196. background-size: 100%;
  197. color: #000;
  198. font-weight: bold;
  199. min-height: 100vh;
  200. padding-bottom: 200rpx;
  201. .act{
  202. background-color: #000;
  203. border-radius: 10rpx;
  204. color: #fff;
  205. }
  206. .order-list {
  207. box-sizing: border-box;
  208. margin-top: 50px;
  209. .order-item {
  210. position: relative;
  211. padding: 20rpx;
  212. border-radius: 5px;
  213. background-color: $uni-bg-color;
  214. box-shadow: 0px 0px 5rpx 5rpx #00000023;
  215. margin: 0rpx 20rpx 20rpx 20rpx;
  216. .top{
  217. display: flex;
  218. justify-content: space-between;
  219. }
  220. .con{
  221. display: flex;
  222. align-items: center;
  223. }
  224. }
  225. }
  226. .no-order {
  227. height: calc(100vh - 138px);
  228. display: flex;
  229. align-items: center;
  230. justify-content: center;
  231. .box {
  232. font-size: 26rpx;
  233. text-align: center;
  234. .to-home {
  235. padding: 20rpx 140rpx;
  236. border: 1px solid #ccc;
  237. border-radius: 5px;
  238. text-align: center;
  239. margin: 20rpx 0px;
  240. }
  241. }
  242. }
  243. }
  244. </style>