orderDetail.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. <template>
  2. <view class="container">
  3. <view style="font-size: 48rpx;margin: 10rpx 20rpx" :style="{color: getStatusColor(list.status)}">
  4. {{ getStatusText(list.status) }}
  5. </view>
  6. <view style="margin: 10rpx 20rpx;"> 该订单服务{{ getStatusText(list.status) }}</view>
  7. <!-- 订单 -->
  8. <view class="order">
  9. <view class="order-box">
  10. <view class="order-item">
  11. <view class="item-allnumb-box">
  12. <view class="allnumb-left">
  13. <image class="img" :src="list.avatar || '@/tatic/logo.png' "
  14. style="width: 50rpx; height: 50rpx" />
  15. <span style="margin-left:20rpx">{{list.memberUsername|| '--'}}</span>
  16. </view>
  17. <view class="allnumb-right">
  18. <u-icon name="phone" color="#2979ff" size="24" @click="handlerMakePhone(list.mobile)" />
  19. </view>
  20. </view>
  21. <u-line margin="20rpx 0"></u-line>
  22. <view class="item-center" :key="idx" v-for="(itm, idx) of list.goodsInfo">
  23. <view class="center-left">
  24. <image :src="itm.goodsPic" class="img"></image>
  25. </view>
  26. <view class="center-right">
  27. <view class="r-l">
  28. <view class="right-name"> {{ itm.goodsName || '--'}} </view>
  29. <view class="right-descript"> 测试商品描述111 </view>
  30. <view class="l-box">
  31. <view class="right-price"> ¥{{ itm.goodsPrice || '--'}} </view>
  32. <view class="right-numb"> ×{{ itm.goodsQuantity || '--'}} </view>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="item-allnumb-box">
  38. <view class="allnumb-left"></view>
  39. <view class="allnumb-right">
  40. <span class="r-text">实付款</span>¥{{ list.payAmount || '--'}}
  41. </view>
  42. </view>
  43. <!-- <u-line margin="20rpx 0" dashed="true"></u-line> -->
  44. </view>
  45. </view>
  46. <view class="order-item">
  47. <view style="font-size: 48rpx;margin-bottom: 10rpx;">服务信息</view>
  48. <view class="item-top">
  49. <view class="top-left gray-color">订单编号 : {{ list.id }}</view>
  50. <view class="top-right"></view>
  51. </view>
  52. <view class="item-top">
  53. <view class="top-left gray-color">下单时间 : {{ formatTime1(list.createTime) || '--' }}</view>
  54. <view class="top-right"></view>
  55. </view>
  56. <view class="item-top">
  57. <view class="top-left gray-color">备注 : {{ list.note || '--' }}</view>
  58. <view class="top-right"></view>
  59. </view>
  60. </view>
  61. <!-- 核销信息 -->
  62. <view class="order-item" v-if="list.status == 4">
  63. <view style="font-size: 48rpx;margin-bottom: 10rpx;">核销信息</view>
  64. <view class="item-top">
  65. <view class="top-left gray-color">核销人员 :--</view>
  66. <!-- <view class="top-right">{{ type_name }}</view> -->
  67. </view>
  68. <view class="item-top">
  69. <view class="top-left gray-color">核销编号 : {{list.orderSn|| '--' }}</view>
  70. <view class="top-right"></view>
  71. </view>
  72. <view class="item-top">
  73. <view class="top-left gray-color">核销时间:
  74. {{ formatTime1(list.receive_time) || '--' }}
  75. </view>
  76. <view v-if="list.status == 3" class="top-left gray-color">核销门店:
  77. {{ '--' }}
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. </template>
  84. <script>
  85. export default {
  86. data() {
  87. return {
  88. list: {}
  89. };
  90. },
  91. mounted() {},
  92. onLoad(options) {
  93. console.log(options, "options");
  94. // 在这里处理传递过来的参数
  95. this.list = options.detailDate; // 尝试解析 JSON 字符串
  96. },
  97. onShow() {
  98. },
  99. methods: {
  100. handlerMakePhone() {
  101. console.log("打电话")
  102. },
  103. getStatusColor(status) {
  104. switch (status) {
  105. case 1:
  106. return 'blue';
  107. case 2:
  108. return 'red';
  109. case 3:
  110. return 'orange';
  111. case 4:
  112. return 'green';
  113. default:
  114. return 'black';
  115. }
  116. },
  117. getStatusText(status) {
  118. switch (status) {
  119. case 1:
  120. return '待核销';
  121. case 2:
  122. return '已核销';
  123. case 3:
  124. return '已退款';
  125. case 4:
  126. return '已过期';
  127. default:
  128. return '';
  129. }
  130. },
  131. formatTime1(timestamp) {
  132. const date = new Date(timestamp); // 转换为毫秒
  133. const year = date.getFullYear();
  134. const month = ('0' + (date.getMonth() + 1)).slice(-2);
  135. const day = ('0' + date.getDate()).slice(-2);
  136. const hour = ('0' + date.getHours()).slice(-2);
  137. const minute = ('0' + date.getMinutes()).slice(-2);
  138. const second = ('0' + date.getSeconds()).slice(-2);
  139. return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
  140. }
  141. },
  142. };
  143. </script>
  144. <style lang="scss" scoped>
  145. .order {
  146. margin-top: 10px;
  147. padding: 10rpx 20rpx 20rpx;
  148. box-sizing: border-box;
  149. .order-box {}
  150. }
  151. .order-item {
  152. margin-bottom: 20rpx;
  153. background-color: #fff;
  154. border-radius: 20rpx;
  155. padding: 20rpx;
  156. box-shadow: 0 8rpx 15rpx 0 rgba(0, 0, 0, 0.08);
  157. .item-top {
  158. display: flex;
  159. justify-content: space-between;
  160. margin-bottom: 10rpx;
  161. }
  162. .item-center {
  163. display: flex;
  164. align-items: center;
  165. margin-bottom: 10rpx;
  166. .center-left {
  167. height: 160rpx;
  168. .img {
  169. width: 160rpx;
  170. height: 160rpx;
  171. }
  172. }
  173. .center-right {
  174. width: 100%;
  175. height: 160rpx;
  176. display: flex;
  177. justify-content: space-between;
  178. margin-left: 20rpx;
  179. .r-l {
  180. display: flex;
  181. flex-direction: column;
  182. justify-content: space-around;
  183. .right-name {
  184. color: #4d5671;
  185. font-size: 32rpx;
  186. font-weight: bold;
  187. }
  188. .right-descript {
  189. font-size: 28rpx;
  190. color: #858797;
  191. }
  192. .l-box {
  193. display: flex;
  194. font-size: 24rpx;
  195. align-items: center;
  196. font-style: italic;
  197. .right-price {
  198. margin-right: 20rpx;
  199. font-weight: bold;
  200. font-size: 28rpx;
  201. color: #f57f32;
  202. }
  203. .right-numb {
  204. font-size: 24rpx;
  205. color: #858797;
  206. }
  207. }
  208. }
  209. .r-r {
  210. .r-item {
  211. align-items: center;
  212. }
  213. }
  214. }
  215. }
  216. .item-allnumb-box {
  217. display: flex;
  218. justify-content: space-between;
  219. align-items: center;
  220. font-weight: bold;
  221. .allnumb-left {
  222. display: flex;
  223. justify-content: start;
  224. align-items: center;
  225. font-size: 32rpx;
  226. .img {
  227. display: block;
  228. }
  229. }
  230. .allnumb-right {
  231. font-size: 26rpx;
  232. color: #f57f32;
  233. .r-text {
  234. color: #000;
  235. }
  236. }
  237. }
  238. }
  239. .item-bottom {
  240. width: 100%;
  241. margin-top: 20rpx;
  242. .btn {
  243. height: 70rpx;
  244. background-color: rgba(248, 213, 53, 0.8);
  245. color: #4e5059;
  246. font-size: 28rpx;
  247. text-align: center;
  248. line-height: 70rpx;
  249. border-radius: 20rpx;
  250. }
  251. }
  252. .gray-color {
  253. color: #858797;
  254. }
  255. ::deep .u-tabs__wrapper__nav__item__text {
  256. font-size: 30px;
  257. }
  258. </style>