OrderDetails.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  1. <template>
  2. <view class="content">
  3. <view class="overview">
  4. <view class="img_box">
  5. <image class="img" mode="aspectFit" :src="queryData?.goods[0]['pic_url']"></image>
  6. </view>
  7. <view class="information">
  8. <text class="name">{{ queryData?.goods[0]['goodTitle'] }}</text>
  9. <view v-for="(title, index) in queryData?.goods[0]['sku_desc'].split(';')" :key="index">
  10. <text>{{ title }}</text>
  11. </view>
  12. </view>
  13. </view>
  14. <view class="price_box">
  15. <text class="currency">{{ currency }}:</text>
  16. <rich-text class="texts" :nodes="Moneyhtml(queryData?.goods[0]['orginal_price'])"></rich-text>
  17. </view>
  18. <view class="dashed"></view>
  19. <view class="text_box">
  20. <trans class="title" _t="实付"></trans>
  21. <view class="price_box">
  22. <text class="currency">{{ currency }}</text>
  23. <rich-text class="texts" :nodes="Moneyhtml(queryData?.goods[0]['price'])"></rich-text>
  24. </view>
  25. </view>
  26. <view class="text_box">
  27. <trans class="title" _t="支付方式"></trans>
  28. <text>{{ queryData?.payType }}</text>
  29. </view>
  30. <view class="text_box">
  31. <trans class="title" _t="订单状态"></trans>
  32. <text>{{ queryData?.status_txt }}</text>
  33. </view>
  34. <view class="text_box">
  35. <trans class="title" _t="平台订单号"></trans>
  36. <text>{{ queryData?.orderNo }}</text>
  37. </view>
  38. <view class="text_box">
  39. <trans class="title" _t="订单时间"></trans>
  40. <text>{{ queryData?.payDate }}</text>
  41. </view>
  42. <view class="dashed"></view>
  43. <view class="title_box">
  44. <trans _t="五项服务全面呵护你的包裹号"></trans>
  45. </view>
  46. <view class="hint">
  47. <trans _t="点击步骤即可查看详情哦~"></trans>
  48. <view class="steps_box">
  49. <view style="width: 300%;overflow-x: scroll !important;">
  50. <up-steps :current="currentStatus" activeColor="#000" inactiveColor="#d8d8d8" direction="row">
  51. <up-steps-item v-for="item in queryData?.bzList" :key="item.id" :title="item.name">
  52. </up-steps-item>
  53. </up-steps>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="quality_inspection">
  58. <view class="head">
  59. <text class="state">{{ t('当前状态') }}:</text>
  60. <view class="progress">
  61. <text class="text_red">{{ currentStatus + 1 }}</text>
  62. <text class="icon">/</text>
  63. <text class="sum">{{ !queryData?.bzList.length ? 0 : queryData?.bzList.length }}</text>
  64. </view>
  65. <trans class="hint" _t="专业质检" />
  66. <up-icon class="icon" color="#FF0000" name="info-circle"></up-icon>
  67. </view>
  68. <view class="body">
  69. <text>商品存在破损问题</text>
  70. </view>
  71. <view class="foot">
  72. <view class="button" @click="noLook">查看</view>
  73. </view>
  74. </view>
  75. <Popup ref="popRef" mode="center">
  76. <template #content>
  77. <view class="popup_content">
  78. <view class="img_box">
  79. <image class="img" mode="aspectFit" :src="queryData?.goods[0]['pic_url']"></image>
  80. </view>
  81. <view class="hint">
  82. <trans _t="kf_hint" class="text" />
  83. <up-icon class="icon" color="#EB3A68" name="kefu-ermai"></up-icon>
  84. </view>
  85. <view class="checkbox">
  86. <up-checkbox activeColor="#000000" size="12" labelSize="12" label="同意并已阅读免责说明" name="agree" shape="circle"
  87. usedAlone :checked="aloneChecked">
  88. </up-checkbox>
  89. </view>
  90. </view>
  91. <view class="popup_close" @click.stop="onClose()">
  92. <up-icon class="icon" color="#000000" name="close" size="12"></up-icon>
  93. </view>
  94. </template>
  95. <template #footer>
  96. <view class="footer_button">
  97. <view class="accept" @click="accept">{{ t('接受瑕疵') }}</view>
  98. <view class="refund" @click="refund">{{ t('退款') }}</view>
  99. </view>
  100. </template>
  101. </Popup>
  102. </view>
  103. </template>
  104. <script setup>
  105. import { defineProps, ref, watchEffect, computed } from "vue";
  106. import { $post } from '@/utils';
  107. import { useSystemStore } from "@/store";
  108. import { Moneyhtml } from "@/utils";
  109. import { t } from "@/locale";
  110. import Popup from "@/components/popup.vue"
  111. const popRef = ref(null)
  112. const props = defineProps({
  113. orderId: Number
  114. })
  115. const useSystem = useSystemStore();
  116. const queryData = ref();
  117. const currentStatus = ref(-1);
  118. const currency = computed(() => useSystem.getCurrency);
  119. const aloneChecked = ref(false)
  120. watchEffect(async () => {
  121. try {
  122. const { data: { data } } = await $post('/shop/order/detail', { orderid: props.orderId })
  123. queryData.value = data;
  124. data?.bzList?.forEach((item) => {
  125. if (item.checked == 1) {
  126. currentStatus.value += item.checked;
  127. return
  128. }
  129. });
  130. } catch (err) {
  131. console.log(err)
  132. }
  133. })
  134. const noLook = () => {
  135. popRef.value && popRef.value.open();
  136. }
  137. const onClose = () => {
  138. popRef.value && popRef.value.close();
  139. }
  140. const accept = () => {
  141. onClose();
  142. }
  143. const refund = () => {
  144. onClose();
  145. }
  146. </script>
  147. <style lang="less" scoped>
  148. @import url('@/style.less');
  149. .snap-container {
  150. width: 100%;
  151. overflow-x: auto;
  152. scroll-snap-type: x mandatory;
  153. display: flex;
  154. }
  155. .snap-item {
  156. scroll-snap-align: start;
  157. min-width: 100%;
  158. height: 200px;
  159. flex-shrink: 0;
  160. }
  161. .slider-container {
  162. width: 100%;
  163. overflow-x: auto;
  164. /* 允许水平滚动 */
  165. white-space: nowrap;
  166. /* 防止内容换行 */
  167. scrollbar-width: none;
  168. /* 隐藏滚动条 - Firefox */
  169. -ms-overflow-style: none;
  170. /* 隐藏滚动条 - IE/Edge */
  171. }
  172. .slider-container::-webkit-scrollbar {
  173. display: none;
  174. /* 隐藏滚动条 - Chrome/Safari */
  175. }
  176. .slider-content {
  177. display: inline-block;
  178. /* 使内容保持在一行 */
  179. }
  180. .item {
  181. display: inline-block;
  182. width: 200px;
  183. height: 150px;
  184. margin-right: 10px;
  185. background-color: #f0f0f0;
  186. }
  187. .content {
  188. .steps_box {
  189. width: 100%;
  190. overflow: scroll !important;
  191. overflow-x: scroll !important;
  192. margin: 20rpx;
  193. }
  194. .overview {
  195. color: var(--text);
  196. .flex();
  197. gap: 24rpx;
  198. .img_box {
  199. flex: 4;
  200. border-radius: 20rpx;
  201. .img {
  202. width: 100%;
  203. height: 100%;
  204. }
  205. }
  206. .information {
  207. flex: 6;
  208. .size(24rpx);
  209. .name {
  210. .ellipsis(2);
  211. margin-bottom: 26rpx;
  212. .size(28rpx);
  213. }
  214. }
  215. }
  216. .orginal_price {
  217. .hor(end);
  218. }
  219. .text_box {
  220. .flex_position(space-between, flex-end);
  221. margin: 8rpx 0;
  222. .size(24rpx);
  223. .title {
  224. color: var(--text-01);
  225. }
  226. .currency,
  227. .texts {
  228. color: var(--red);
  229. .size(28rpx);
  230. font-weight: 500;
  231. }
  232. }
  233. .price_box {
  234. .flex_position(end, flex-end);
  235. color: var(--black);
  236. .size(28rpx);
  237. .currency {
  238. margin-right: 10rpx;
  239. }
  240. }
  241. .texts /deep/ {
  242. .price {
  243. .size();
  244. }
  245. }
  246. .title_box {
  247. .size(28rpx);
  248. font-weight: 500;
  249. color: var(--text);
  250. }
  251. .hint {
  252. .size(24rpx);
  253. color: var(--text-01);
  254. margin-top: 10rpx;
  255. }
  256. .quality_inspection {
  257. margin-top: 40rpx;
  258. background-color: var(--bor-color);
  259. padding: 10rpx 20rpx;
  260. border-radius: 20rpx;
  261. .head {
  262. .ver(flex-end);
  263. .icon {
  264. margin-left: 5rpx;
  265. }
  266. .state {
  267. .size(20rpx);
  268. }
  269. .progress {
  270. .ver(baseline);
  271. .text_red {
  272. color: var(--red);
  273. .size(28rpx);
  274. margin-left: 10rpx;
  275. }
  276. .icon,
  277. .sum {
  278. .size(24rpx);
  279. color: var(--text);
  280. }
  281. }
  282. .hint {
  283. .size(24rpx);
  284. font-weight: 500;
  285. margin-left: 10rpx;
  286. }
  287. }
  288. .body {
  289. .size(24rpx);
  290. color: var(--text);
  291. margin-top: 16rpx;
  292. }
  293. .foot {
  294. margin-top: 26rpx;
  295. .hor(end);
  296. .button {
  297. .size(24rpx);
  298. color: var(--light);
  299. background-color: var(--black);
  300. padding: 14rpx 28rpx;
  301. border-radius: 20rpx;
  302. margin-bottom: 16rpx;
  303. }
  304. }
  305. }
  306. /deep/ .u-popup__content {
  307. width: 80vw !important;
  308. position: relative;
  309. }
  310. .popup_content {
  311. .img_box {
  312. height: 400rpx;
  313. border-radius: 20rpx;
  314. .img {
  315. max-width: 100%;
  316. max-height: 100%;
  317. }
  318. }
  319. .hint {
  320. .ver(flex-start);
  321. .text {
  322. flex: 1;
  323. word-break: break-word;
  324. padding-right: 40rpx;
  325. position: relative;
  326. }
  327. .icon {
  328. position: absolute;
  329. right: 40rpx;
  330. bottom: 0;
  331. margin-left: 8rpx;
  332. }
  333. }
  334. .checkbox {
  335. margin-top: 44rpx;
  336. /deep/ .u-checkbox {
  337. .ver(baseline);
  338. }
  339. }
  340. }
  341. .footer_button {
  342. .hor(space-between);
  343. .size(28rpx);
  344. gap: 50rpx;
  345. text-align: center;
  346. .accept {
  347. flex: 1;
  348. color: var(--text);
  349. padding: 24rpx 0;
  350. border: 2rpx solid var(--black);
  351. border-radius: 20rpx;
  352. }
  353. .refund {
  354. flex: 1;
  355. color: var(--light);
  356. padding: 24rpx 0rpx;
  357. background-color: var(--black);
  358. border-radius: 20rpx;
  359. }
  360. }
  361. .popup_close {
  362. position: absolute;
  363. top: -50rpx;
  364. right: 4rpx;
  365. padding: 6rpx;
  366. .flex_position(center, center);
  367. background-color: var(--light);
  368. border-radius: 50%;
  369. }
  370. }
  371. </style>