Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

order-list-item-new.vue 10KB

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