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.

344 lines
7.2 KiB

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