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.

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