myOrder.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  1. <template>
  2. <view class="container">
  3. <topNavBar title="全部订单" />
  4. <!-- 订单状态区 -->
  5. <view class="state-area dflex navbar-area bg-main">
  6. <view class="nav-item dflex-c pos-r fs h-full" :class="{ active: tabCurrentIndex === index }"
  7. v-for="(item, index) in navList" :key="index" @click="tabClick(index)">
  8. {{ item.state }}
  9. </view>
  10. </view>
  11. <!-- </scroll-view> -->
  12. <!-- 订单轮播区 -->
  13. <swiper class="swiper-area w-full" :duration="0" :current="tabCurrentIndex" @change="changeTab">
  14. <!-- 轮播项对应订单状态 -->
  15. <swiper-item class="tab-content wh-full" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
  16. <!-- 滚动区 -->
  17. <scroll-view class="h-full" scroll-y @scrolltolower="loadData">
  18. <!-- 空白页 -->
  19. <use-empty v-if="tabItem.orderList.length === 0 && tabItem.loaded" e-style="round" e-type="cart"
  20. tip="订单数据为空" height="93vh"></use-empty>
  21. <!-- 订单列表区 -->
  22. <view class="margin-bottom-sm" :class="index === 0 ? 'padding-top-sm' : ''"
  23. v-for="(item, index) in tabItem.orderList" :key="index">
  24. <!-- 订单项 -->
  25. <view class="order-item padding bg-main border-radius">
  26. <view @click="todetail(item.order)">
  27. <view class="dflex-b padding-bottom-sm">
  28. <view class="fs fwb dflex">
  29. <u-tag text="打包" size="mini" bgColor="#FFF4E4" color="#F5821F" shape="circle"
  30. borderColor="#FFF4E4"></u-tag>
  31. 订单编号:M000003332
  32. </view>
  33. <text class="fs active">等待付款</text>
  34. </view>
  35. <!-- 订单商品明细 -->
  36. <view class="goods-area dflex-b">
  37. <view class="pic-list dflex">
  38. <view class="pic"></view>
  39. <view class="pic"></view>
  40. <view class="pic"></view>
  41. </view>
  42. <view class="next-detail">
  43. <text>共3件</text>
  44. <u-icon name="arrow-right" size="20"></u-icon>
  45. </view>
  46. </view>
  47. <!-- 实付款 -->
  48. <view class="dflex-e padding-top-sm">
  49. <text class="fs-xs margin-right-xs">共3件</text>
  50. <text class="fs-xs margin-right-xs">共6份商品</text>
  51. <text class="fs-xs margin-right-xs">实付</text>
  52. <text class="price ft-main">{{ item.order.order_actural_paid}}</text>
  53. </view>
  54. </view>
  55. <!-- 订单操作区 -->
  56. <view class="dflex-b margin-top-sm">
  57. <view>
  58. <text class="ft-dark">更多</text>
  59. </view>
  60. <view class="dflex-e">
  61. <view class="dflex">
  62. <button class="action-btn border-radius-big bg-main">取消订单</button>
  63. <button class="action-btn border-radius-big bg-main" @click="todetail">订单详情</button>
  64. <button class="action-btn border-radius-big bg-main main-btn">去支付</button>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. <!-- 上拉加载更多 -->
  71. <use-loadmore v-if="tabItem.orderList.length > 0 && tabItem.loaded && tabItem.hasmore"
  72. :type="tabItem.loadingType"></use-loadmore>
  73. </scroll-view>
  74. </swiper-item>
  75. </swiper>
  76. </view>
  77. </template>
  78. <script>
  79. export default {
  80. data() {
  81. return {
  82. tabCurrentIndex: 0,
  83. navData: {},
  84. navList: [{
  85. id: 0,
  86. state: '全部',
  87. loadingType: 'more',
  88. orderList: [{
  89. order_detail: [{
  90. goods_img: '../../../static/x2.jpg',
  91. goods_name: '商品1',
  92. goods_name_pw: '小标题',
  93. goods_num: 1,
  94. goods_sku_name: 60,
  95. goods_price: 10
  96. }],
  97. order: {
  98. order_actural_paid: 10,
  99. order_refund_state: '处理中',
  100. state: '待发货'
  101. }
  102. },
  103. {
  104. order_detail: [{
  105. goods_img: '../../../static/x2.jpg',
  106. goods_name: '商品1',
  107. goods_name_pw: '小标题',
  108. goods_num: 1,
  109. goods_sku_name: 60,
  110. goods_price: 10
  111. }],
  112. order: {
  113. order_actural_paid: 10,
  114. state: '待发货'
  115. }
  116. }
  117. ]
  118. },
  119. {
  120. id: 1,
  121. state: '待付款',
  122. loadingType: 'more',
  123. orderList: []
  124. },
  125. {
  126. id: 2,
  127. state: '待核销',
  128. loadingType: 'more',
  129. orderList: []
  130. },
  131. {
  132. id: 3,
  133. state: '已取消',
  134. loadingType: 'more',
  135. orderList: []
  136. },
  137. {
  138. id: 4,
  139. state: '已完成',
  140. loadingType: 'more',
  141. orderList: []
  142. }
  143. ],
  144. reqdata: {
  145. page: 1,
  146. rows: 10
  147. },
  148. scrollLeft: 0,
  149. title: '全部'
  150. }
  151. },
  152. onLoad(e) {
  153. this.tabCurrentIndex = parseFloat(e.type);
  154. },
  155. methods: {
  156. loadData() {},
  157. // swiper 切换
  158. changeTab(e) {
  159. this.tabCurrentIndex = e.target.current;
  160. },
  161. //顶部tab点击
  162. tabClick(index) {
  163. this.tabCurrentIndex = index;
  164. },
  165. // 点击跳转详情页面
  166. todetail(order) {
  167. // uni.navigateTo({
  168. // url: `/pages/user/order/order-detail?order_id=${order.order_id}`
  169. // });
  170. uni.navigateTo({
  171. url: `/pages/order/orderPaid/orderPaid`
  172. });
  173. },
  174. // 立即支付
  175. payment(order) {
  176. },
  177. // 删除订单
  178. delOrder(item) {
  179. let _this = this;
  180. uni.showModal({
  181. title: '提示',
  182. content: '删除订单',
  183. success: function(res) {
  184. if (res.confirm) {
  185. uni.showLoading({
  186. title: '请稍后'
  187. });
  188. } else if (res.cancel) {
  189. console.log('点击取消');
  190. }
  191. },
  192. complete() {
  193. uni.hideLoading();
  194. }
  195. });
  196. },
  197. // 取消订单
  198. cancelOrder(item) {
  199. let _this = this;
  200. uni.showModal({
  201. title: '提示',
  202. content: '取消订单',
  203. success: function(res) {
  204. if (res.confirm) {
  205. uni.showLoading({
  206. title: '请稍后'
  207. });
  208. } else if (res.cancel) {
  209. console.log('用户点击取消');
  210. }
  211. },
  212. complete() {
  213. uni.hideLoading();
  214. }
  215. });
  216. },
  217. // 申请退款
  218. torefund(data) {
  219. },
  220. // 评价
  221. toevaluate(item) {
  222. }
  223. }
  224. }
  225. </script>
  226. <style lang="scss">
  227. page,
  228. .container {
  229. min-height: 100%;
  230. background: $page-color-base;
  231. }
  232. /* 订单状态区 */
  233. .navbar-area {
  234. white-space: nowrap;
  235. }
  236. .state-area {
  237. height: 7vh;
  238. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  239. z-index: 10;
  240. top: 0;
  241. }
  242. .nav-item {
  243. flex: 1;
  244. &.active {
  245. &:after {
  246. content: '';
  247. position: absolute;
  248. left: 50%;
  249. transform: translate(-50%);
  250. bottom: 0;
  251. width: 44px;
  252. height: 0;
  253. border-bottom: 2px solid $base-color;
  254. }
  255. }
  256. }
  257. /* 订单轮播区 */
  258. .swiper-area {
  259. height: 93vh;
  260. }
  261. /* 订单区 */
  262. .order-area {}
  263. /* 订单项 */
  264. .order-item {
  265. /* 订单商品明细区 */
  266. .goods-area {
  267. display: flex;
  268. image {
  269. width: 180rpx;
  270. height: 180rpx;
  271. }
  272. .right {
  273. padding: 0 30upx 0 24upx;
  274. overflow: hidden;
  275. .attr-box {
  276. font-size: $font-sm + 2upx;
  277. color: $font-color-light;
  278. padding: 10upx 12upx;
  279. }
  280. }
  281. }
  282. /* 操作按钮 */
  283. .action-btn {
  284. width: 156rpx;
  285. height: inherit;
  286. line-height: inherit;
  287. margin: 0;
  288. margin-left: 20rpx;
  289. padding: 12rpx 0;
  290. font-size: $font-sm + 2upx;
  291. color: $font-color-dark;
  292. /* #ifdef MP-QQ || MP-ALIPAY */
  293. border: 1px solid;
  294. /* #endif */
  295. &:after {
  296. border-radius: 100px;
  297. }
  298. &.main-btn {
  299. background: #fff9f9;
  300. color: $base-color;
  301. &:after {
  302. border-color: #f7bcc8;
  303. }
  304. }
  305. }
  306. }
  307. .pic-list {
  308. width: calc(100% - 130upx);
  309. .pic {
  310. margin-right: 20upx;
  311. height: 160rpx;
  312. width: 160rpx;
  313. background-color: #EEE;
  314. }
  315. .pic:last-child {
  316. margin: 0;
  317. }
  318. }
  319. .next-detail {
  320. width: 130upx;
  321. display: flex;
  322. justify-content: flex-end;
  323. align-items: center;
  324. }
  325. </style>