Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

order-list-item-new.vue 9.2KB

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