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.

order-list-item-new.vue 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  1. <!-- 新办订单item
  2. 新办订单状态:待支付、审核中、审核不通过、待发货、待收货、待激活、已完成、已取消、已结束、退货、换货-->
  3. <template>
  4. <view :class="item.orderStatus == OrderStatus.已取消 ? 'item finished' : 'item'" @click.stop="gotoOrderDetails(item)">
  5. <view class="head">
  6. <view class="name">
  7. <image :src="`${$imgUrl}order/icon-star-green.png`" class="icon"></image>
  8. <text class="title">{{item.productName ?? ''}}</text>
  9. </view>
  10. <view class="status text-orange" v-if="item.orderStatus == OrderStatus.已取消">已取消</view>
  11. <view class="status text-green" v-else
  12. :class="{'text-orange':item.orderStep == OrderStatus.已完成 || item.orderStep == OrderStatus.已结束
  13. || item.orderStep == OrderStatus['换货-设备已回收'] || item.orderStep == OrderStatus.退款成功 || item.orderStep == OrderStatus.退货成功}">
  14. {{getOrderStatusName(item.orderStep)}}
  15. </view>
  16. </view>
  17. <view class="detail">
  18. <view class="orders">
  19. <view class="order-text">
  20. <text class="type">新办单号:</text>
  21. <text class="value">{{item.orderId}}</text>
  22. </view>
  23. <view class="order-text odd">
  24. <text class="type">业务类型:</text>
  25. <text class="value">{{getOrderTypeName(item.orderType)}}</text>
  26. </view>
  27. <view class="order-text">
  28. <text class="type">订单车牌号:</text>
  29. <text class="value">{{item.vehiclePlate}}</text>
  30. </view>
  31. <view class="order-text odd">
  32. <text class="type">订单车牌颜色:</text>
  33. <text class="value">{{getVehiclePlateColor(item.vehiclePlateColor)}}</text>
  34. </view>
  35. </view>
  36. <view class="money"><text class="cny">¥</text><text class="amount">{{item.amount / 100 ?? '0.00'}}</text>
  37. </view>
  38. </view>
  39. <template v-if="item.orderStatus != OrderStatus.已取消">
  40. <!-- 信息填写未完成 -->
  41. <view class="btns"
  42. v-if="item.orderStep == OrderStatus['完成个人/单位信息上传'] || item.orderStep == OrderStatus.完成填写基本信息 || item.orderStep == OrderStatus.完成车辆信息上传">
  43. <view class="btn btn-normal" @click.stop="gotoCancelOrder(item)">取消订单</view>
  44. <view class="btn btn-primary" @click.stop="gotoEditUserOrUnitInfo(item)">继续申请</view>
  45. </view>
  46. <!-- 待支付 -->
  47. <view class="btns" v-if="item.orderStep == OrderStatus.待支付1">
  48. <view class="btn btn-normal" @click.stop="gotoCancelOrder(item)">取消订单</view>
  49. <view class="btn btn-primary" @click.stop="gotoOrderDetails(item)">支付</view>
  50. </view>
  51. <view class="btns" v-if="item.orderStep == OrderStatus.待支付2">
  52. <view class="btn btn-normal" @click.stop="gotoCancelOrder(item)">取消订单</view>
  53. <view class="btn btn-primary" @click.stop="gotoOrderDetails(item)">支付</view>
  54. </view>
  55. <view class="btns" v-if="item.orderStep == OrderStatus.待支付3">
  56. <view class="btn btn-normal" @click.stop="gotoCancelOrder(item)">取消订单</view>
  57. <view class="btn btn-primary" @click.stop="gotoOrderDetails(item)">支付</view>
  58. </view>
  59. <!-- 审核中/审核不通过 -->
  60. <view class="btns" v-if="item.orderStep == OrderStatus.待审核 || item.orderStep == OrderStatus.审核不通过">
  61. <view class="btn btn-normal" v-if="item.orderStep == OrderStatus.审核不通过"
  62. @click.stop="gotoEditUserOrUnitInfo(item)">修改资料</view>
  63. <view class="btn btn-normal" @click.stop="gotoCancelOrder(item)">取消订单</view>
  64. <view class="btn btn-primary" @click.stop="gotoOrderDetails(item)">修改地址</view>
  65. </view>
  66. <!-- 待发货 -->
  67. <view class="btns" v-else-if="item.orderStep == OrderStatus.待发货">
  68. <view class="btn btn-normal" @click.stop="gotoCancelOrder(item)">取消订单</view>
  69. <view class="btn btn-primary" @click.stop="gotoOrderDetails(item)">修改地址</view>
  70. </view>
  71. <!-- 待收货 -->
  72. <view class="btns" v-else-if="item.orderStep == OrderStatus.待收货">
  73. <view class="btn btn-normal" @click.stop="gotoCheckLogistics(item)">查看物流
  74. </view>
  75. <view class="btn btn-normal" @click.stop="gotoReturnOrder(item)">申请退货
  76. </view>
  77. <!-- <view class="btn btn-normal" @click.stop="gotoExchangeOrder(item)">申请换货</view> -->
  78. <view class="btn btn-primary" @click.stop="gotoConfirmReceipt(item)">确认收货
  79. </view>
  80. </view>
  81. <!-- 待激活 -->
  82. <view class="btns" v-else-if="item.orderStep == OrderStatus.待激活">
  83. <view class="btn btn-normal" @click.stop="gotoReturnOrder(item)">申请退货</view>
  84. <view class="btn btn-normal" @click.stop="gotoExchangeOrder(item)">申请换货</view>
  85. <view class="btn btn-primary" @click.stop="gotoActiveOrder(item)">去激活
  86. </view>
  87. </view>
  88. <!-- 已完成 -->
  89. <view class="btns" v-else-if="item.orderStep == OrderStatus.已完成">
  90. <view v-if="!item.appraise" class='evaluation'>
  91. <!-- <view class="btn btn-primary" @click.stop="gotoEvaluateOrder(item)" >去评价最初的</view> -->
  92. <view class="btn btn-primary" @click.stop="gotoEvaluateProduct(item)" >去评价产品</view>
  93. <view class="btn btn-primary" @click.stop="gotoEvaluateSalesman(item)" >去评价业务员</view>
  94. </view>
  95. <view class="btn btn-normal" v-else>已评价</view>
  96. </view>
  97. <!-- 已结束 -->
  98. <view class="btns" v-else-if="item.orderStep == OrderStatus.已结束">
  99. <view class="btn btn-primary" @click.stop="showActiveOrder = true">重新激活订单</view>
  100. </view>
  101. <!-- 换货中 -->
  102. <view class="btns" v-else-if="item.orderStep == OrderStatus['已申请-换货']">
  103. <!-- 查看物流: 原型没有UI有 -->
  104. <view class="btn btn-normal" @click.stop="gotoCheckLogistics(item)">查看物流</view>
  105. <view class="btn btn-primary" @click.stop="gotoConfirmReceipt(item)">确认收货</view>
  106. </view>
  107. </template>
  108. </view>
  109. <!-- 弹窗 -->
  110. <u-popup v-model="showActiveOrder" mode="center">
  111. <popup-active-order content="确认是否重新激活订单" @cancel="showActiveOrder = false" @confirm="toActiveOrder">
  112. </popup-active-order>
  113. </u-popup>
  114. </template>
  115. <script lang="ts" setup>
  116. import popupActiveOrder from "./popup-active-order.vue";
  117. import useOrderSkip from "@/composables/order/useOrderSkip";
  118. import {
  119. getOrderStatusName,
  120. msg,
  121. getOrderTypeName
  122. } from "@/utils/utils";
  123. import {
  124. ref
  125. } from "vue";
  126. import {
  127. OrderStatus
  128. } from "@/datas/enum";
  129. import {
  130. vehiclePlateColor
  131. } from "@/datas/vehiclePlateColor";
  132. defineProps({
  133. item: {
  134. type: Object,
  135. default: () => ({}),
  136. },
  137. });
  138. //是否确认激活订单弹窗
  139. const showActiveOrder = ref(false);
  140. //办理订单按钮跳转业务逻辑
  141. const {
  142. gotoEditAddress,
  143. gotoCancelOrder,
  144. gotoEditUserOrUnitInfo,
  145. gotoConfirmReceipt,
  146. gotoCheckLogistics,
  147. gotoEvaluateOrder,
  148. gotoEvaluateProduct,
  149. gotoEvaluateSalesman,
  150. gotoActiveOrder,
  151. gotoReturnOrder,
  152. gotoExchangeOrder,
  153. gotoPay,
  154. gotoOrderDetails
  155. } = useOrderSkip();
  156. //激活订单
  157. const toActiveOrder = (item) => {
  158. gotoActiveOrder(item);
  159. showActiveOrder.value = false;
  160. }
  161. //获取车牌颜色文字
  162. const getVehiclePlateColor = (id: number) => {
  163. const colors = vehiclePlateColor.filter(item => item.id == id);
  164. return colors[0].color
  165. }
  166. </script>
  167. <style lang="scss" scoped>
  168. .item {
  169. background: #ffffff;
  170. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  171. border-radius: 20rpx;
  172. box-sizing: border-box;
  173. display: flex;
  174. flex-direction: column;
  175. margin: 30rpx 30rpx 0rpx;
  176. }
  177. .bg-white .item {
  178. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  179. }
  180. .item .head {
  181. display: flex;
  182. justify-content: space-between;
  183. align-items: center;
  184. padding: 20rpx 28rpx;
  185. border-bottom: 1px solid #dcdcdc;
  186. }
  187. .item .head {
  188. .head-row {
  189. display: flex;
  190. width: 100%;
  191. justify-content: space-between;
  192. align-items: center;
  193. }
  194. .name {}
  195. .name>text {
  196. font-size: 26rpx;
  197. font-family: Noto Sans S Chinese;
  198. font-weight: 400;
  199. color: #999999;
  200. line-height: 36rpx;
  201. }
  202. }
  203. .item .head .icon {
  204. width: 48rpx;
  205. height: 48rpx;
  206. }
  207. .item .head .name {
  208. display: flex;
  209. align-items: center;
  210. }
  211. .text-green {
  212. font-size: 26rpx;
  213. color: #00b38b;
  214. }
  215. .text-orange {
  216. font-size: 26rpx;
  217. color: #ff8000;
  218. }
  219. .text-black {
  220. font-size: 28rpx;
  221. color: #333;
  222. font-weight: 500;
  223. }
  224. .title {
  225. font-size: 30rpx;
  226. color: #333;
  227. }
  228. .tag-green {
  229. font-size: 22rpx;
  230. height: 40rpx;
  231. line-height: 40rpx;
  232. padding: 0 12rpx;
  233. border-radius: 6rpx;
  234. background: #d9f4ee;
  235. color: #00b38b;
  236. }
  237. .tag-grey {
  238. font-size: 22rpx;
  239. height: 40rpx;
  240. line-height: 40rpx;
  241. padding: 0 12rpx;
  242. border-radius: 6rpx;
  243. background: #e8e8e8;
  244. color: #666;
  245. }
  246. .detail {
  247. display: flex;
  248. justify-content: space-between;
  249. align-items: center;
  250. padding: 30rpx 32rpx;
  251. }
  252. .detail .type {
  253. font-size: 26rpx;
  254. color: #999;
  255. }
  256. .detail .value {
  257. font-size: 26rpx;
  258. color: #333;
  259. }
  260. .finished .detail .value {
  261. color: #999;
  262. }
  263. .detail .odd {
  264. margin: 20rpx 0;
  265. }
  266. .cny {
  267. font-size: 26rpx;
  268. color: #333;
  269. }
  270. .finished .cny {
  271. color: #999;
  272. }
  273. .amount {
  274. font-size: 40rpx;
  275. font-weight: bold;
  276. }
  277. .bottom .amount {
  278. color: #ff8000;
  279. }
  280. .finished .amount {
  281. color: #999;
  282. }
  283. .btns {
  284. position: relative;
  285. display: flex;
  286. align-items: center;
  287. justify-content: flex-end;
  288. border-top: 1px solid #dcdcdc;
  289. margin: 0 30rpx;
  290. padding: 20rpx 0;
  291. }
  292. .bottom {
  293. display: flex;
  294. justify-content: space-between;
  295. align-items: center;
  296. border-top: 1px solid #dcdcdc;
  297. margin: 0 30rpx;
  298. padding: 20rpx 0;
  299. }
  300. .btn {
  301. height: 60rpx;
  302. line-height: 58rpx;
  303. border-radius: 30rpx;
  304. padding: 0 24rpx;
  305. font-size: 26rpx;
  306. box-sizing: border-box;
  307. margin-right: 20rpx;
  308. }
  309. .btns .btn:last-child {
  310. margin: 0;
  311. }
  312. .btns .state {
  313. position: absolute;
  314. left: 0;
  315. font-size: 26rpx;
  316. font-family: Noto Sans S Chinese;
  317. font-weight: 400;
  318. color: #999999;
  319. line-height: 58rpx;
  320. text {
  321. font-size: 26rpx;
  322. font-family: Noto Sans S Chinese;
  323. font-weight: 400;
  324. color: #00B38B;
  325. line-height: 58rpx;
  326. }
  327. }
  328. .btn-primary {
  329. border: 1px solid #00b38b;
  330. color: #00b38b;
  331. }
  332. .btn-disable {
  333. border: 1px solid #999;
  334. color: #999;
  335. }
  336. .btn-normal {
  337. border: 1px solid #dcdcdc;
  338. color: #333;
  339. }
  340. .evaluation{
  341. display: flex;
  342. }
  343. </style>