myWholesale.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. <template>
  2. <view class="content">
  3. <view class="navbar flex">
  4. <view class="nav-item" v-for="(navitem,index) in navList" :class="{'action': index == currentIndex}"
  5. @click="navClick(index)">
  6. {{navitem.tit}}
  7. </view>
  8. </view>
  9. <swiper :current="tabCurrentIndex" class="swiper-box" duration="300" @change="changeTab">
  10. <swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
  11. <scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
  12. <!-- 空白页 -->
  13. <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
  14. <!-- 订单列表 -->
  15. <view @click="goToOrderDetail(item)" v-for="(item, index) in tabItem.orderList" :key="index" class="order-item">
  16. <view class="i-top b-b">
  17. <text class="time">订单编号:{{ item.order_id }}</text>
  18. <text class="state" :style="{ color: item.stateTipColor }">{{ item._status._title }}</text>
  19. <text v-if="item.status === 4" class="del-btn iconfont icondelete" @click="deleteOrder(index)"></text>
  20. </view>
  21. <scroll-view v-if="item.cartInfo.length > 1" class="goods-box" scroll-x>
  22. <view v-for="(goodsItem, goodsIndex) in item.cartInfo" :key="goodsIndex" class="goods-item">
  23. <image class="goods-img" :src="goodsItem.productInfo.image" mode="aspectFill"></image>
  24. </view>
  25. </scroll-view>
  26. <view class="goods-box-single" v-for="(goodsItem, goodsIndex) in item.cartInfo" :key="goodsIndex">
  27. <image class="goods-img" :src="goodsItem.productInfo.image" mode="scaleToFill"></image>
  28. <view class="right">
  29. <view class="flex-start" style="justify-content: space-between;">
  30. <text class="title clamp">{{ goodsItem.productInfo.store_name }}</text>
  31. <text class="price">{{ moneyNum(goodsItem.truePrice) }}</text>
  32. </view>
  33. <view class="row flex">
  34. <text class="row_title">{{ goodsItem.productInfo.attrInfo ? goodsItem.productInfo.attrInfo.suk : '' }}</text>
  35. <text class="attr-box"> x {{ goodsItem.cart_num }}</text>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="price-box">
  40. <text class="num">{{ item.cartInfo.length }}</text>
  41. 件商品 合计
  42. <text class="price">{{ moneyNum(item.pay_price)}}</text>
  43. (含邮费
  44. <text class="price">{{ moneyNum(item.pay_postage)}}</text>
  45. </view>
  46. <view class="action-box b-t" v-if="item.status != 5">
  47. <button v-if="item._status._title == '未支付'" class="action-btn" @click.stop="cancelOrder(item)">取消订单</button>
  48. <button v-if="item._status._title == '未支付'" @click.stop="orderPay(item)" class="action-btn recom">付款</button>
  49. <button v-if="item._status._title == '待评价'" class="action-btn">评价</button>
  50. <button v-if="item._status._title == '待收货'" @click.stop="orderTake(item, index)" class="action-btn">确认收货</button>
  51. <!-- <button v-if="item._status._title == '未发货'" class="action-btn" @click.stop="orderRefund(item)">申请退款</button> -->
  52. </view>
  53. </view>
  54. <uni-load-more :status="tabItem.loadingType"></uni-load-more>
  55. </scroll-view>
  56. </swiper-item>
  57. </swiper>
  58. </view>
  59. </template>
  60. <script>
  61. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  62. import empty from '@/components/empty';
  63. export default {
  64. components: {
  65. uniLoadMore,
  66. empty
  67. },
  68. data() {
  69. return {
  70. currentIndex: 0,
  71. navList: [{
  72. status: 'today',
  73. tit: '当天预约',
  74. orderList: [],
  75. page: 1,
  76. limit: 10,
  77. loadingType: 'more',
  78. loaded: false,
  79. },
  80. {
  81. status: 1,
  82. tit: '待支付',
  83. orderList: [],
  84. page: 1,
  85. limit: 10,
  86. loadingType: 'more',
  87. loaded: false,
  88. },
  89. ],
  90. }
  91. },
  92. onLoad() {
  93. },
  94. methods: {
  95. navClick(index) {
  96. this.currentIndex = index
  97. }
  98. }
  99. }
  100. </script>
  101. <style lang="scss" scoped>
  102. .navbar {
  103. background-color: #fff;
  104. height: 40px;
  105. .nav-item {
  106. width: 50%;
  107. text-align: center;
  108. font-size: 30rpx;
  109. font-family: PingFang SC;
  110. font-weight: 500;
  111. color: #333333;
  112. }
  113. .action {
  114. font-weight: bold;
  115. position: relative;
  116. color: #FF4C4C;
  117. &::after {
  118. content: '';
  119. width: 84rpx;
  120. height: 4rpx;
  121. background: #FF4C4C;
  122. border-radius: 2px;
  123. position: absolute;
  124. bottom: -20rpx;
  125. left: 0;
  126. right: 0;
  127. margin: auto;
  128. }
  129. }
  130. }
  131. .swiper-box {
  132. height: calc(100% - 40px);
  133. }
  134. .list-scroll-content {
  135. height: 100%;
  136. }
  137. .order-item {
  138. display: flex;
  139. flex-direction: column;
  140. padding-left: 30rpx;
  141. background: #fff;
  142. margin-top: 16rpx;
  143. .i-top {
  144. display: flex;
  145. align-items: center;
  146. height: 80rpx;
  147. padding-right: 30rpx;
  148. font-size: $font-base;
  149. color: $font-color-dark;
  150. position: relative;
  151. .time {
  152. flex: 1;
  153. }
  154. .state {
  155. color: $base-color;
  156. }
  157. .del-btn {
  158. padding: 10rpx 0 10rpx 36rpx;
  159. font-size: $font-lg;
  160. color: $font-color-light;
  161. position: relative;
  162. &:after {
  163. content: '';
  164. width: 0;
  165. height: 30rpx;
  166. border-left: 1px solid $border-color-dark;
  167. position: absolute;
  168. left: 20rpx;
  169. top: 50%;
  170. transform: translateY(-50%);
  171. }
  172. }
  173. }
  174. /* 多条商品 */
  175. .goods-box {
  176. height: 160rpx;
  177. padding: 20rpx 0;
  178. white-space: nowrap;
  179. .goods-item {
  180. width: 120rpx;
  181. height: 120rpx;
  182. display: inline-block;
  183. margin-right: 24rpx;
  184. }
  185. .goods-img {
  186. display: block;
  187. width: 100%;
  188. height: 100%;
  189. }
  190. }
  191. /* 单条商品 */
  192. .goods-box-single {
  193. display: flex;
  194. padding: 20rpx 0;
  195. .goods-img {
  196. display: block;
  197. width: 120rpx;
  198. height: 120rpx;
  199. }
  200. .right {
  201. flex: 1;
  202. display: flex;
  203. flex-direction: column;
  204. padding: 0 30rpx 0 24rpx;
  205. overflow: hidden;
  206. .row{
  207. margin-top: 10rpx;
  208. }
  209. .row_title{
  210. padding:5rpx 10rpx;
  211. background-color: #dddddd;
  212. border-radius: 10rpx;
  213. font-size: 22rpx;
  214. color: #ffffff;
  215. }
  216. .title {
  217. font-size: $font-base + 2rpx;
  218. color: $font-color-dark;
  219. line-height: 1;
  220. width: 80%;
  221. }
  222. .attr-box {
  223. display: flex;
  224. justify-content: flex-end;
  225. font-size: $font-sm + 2rpx;
  226. color: $font-color-light;
  227. }
  228. .price {
  229. display: inline;
  230. font-size: $font-base + 2rpx;
  231. color: $font-color-dark;
  232. &:before {
  233. content: '¥';
  234. font-size: $font-sm;
  235. }
  236. }
  237. }
  238. }
  239. .price-box {
  240. display: flex;
  241. justify-content: flex-end;
  242. align-items: baseline;
  243. padding: 20rpx 30rpx;
  244. font-size: $font-sm + 2rpx;
  245. color: $font-color-light;
  246. .num {
  247. margin: 0 8rpx;
  248. color: $font-color-dark;
  249. }
  250. .price {
  251. font-size: $font-lg;
  252. color: $font-color-dark;
  253. &:before {
  254. content: '¥';
  255. font-size: $font-sm;
  256. margin: 0 2rpx 0 8rpx;
  257. }
  258. }
  259. }
  260. .action-box {
  261. display: flex;
  262. justify-content: flex-end;
  263. align-items: center;
  264. height: 100rpx;
  265. position: relative;
  266. padding-right: 30rpx;
  267. }
  268. .action-btn {
  269. width: 160rpx;
  270. height: 60rpx;
  271. margin: 0;
  272. margin-left: 24rpx;
  273. padding: 0;
  274. text-align: center;
  275. line-height: 60rpx;
  276. font-size: $font-sm + 2rpx;
  277. color: $font-color-dark;
  278. background: #fff;
  279. border-radius: 100px;
  280. &:after {
  281. border-radius: 100px;
  282. }
  283. &.recom {
  284. color: $base-color;
  285. &:after {
  286. border-color: $base-color;
  287. }
  288. }
  289. &.evaluate {
  290. color: $color-yellow;
  291. &:after {
  292. border-color: $color-yellow;
  293. }
  294. }
  295. }
  296. }
  297. </style>