myOrder.vue 8.1 KB

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