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 11KB

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