GoodsDetail.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. <template>
  2. <div class="right-wrap">
  3. <el-breadcrumb separator="/" style="margin-bottom: 13px">
  4. <el-breadcrumb-item :to="{ path: '/home/myCenter' }">个人中心</el-breadcrumb-item>
  5. <el-breadcrumb-item>兑换详情</el-breadcrumb-item>
  6. </el-breadcrumb>
  7. <el-card class="box-card">
  8. <div slot="header" class="clearfix">
  9. <span>兑换详情</span>
  10. </div>
  11. <div class="footer">
  12. <div class="left-info" style="width: 100%;">
  13. <span class="info-title">
  14. <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"
  15. class="info-icon">
  16. <path fill-rule="evenodd" clip-rule="evenodd"
  17. d="M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1Z"
  18. fill="#165DFF"></path>
  19. <path fill-rule="evenodd" clip-rule="evenodd"
  20. d="M8.54189 6.70582C8.67075 6.70582 8.77522 6.81029 8.77522 6.93915L8.77511 10.2335L9.46743 10.2343C9.61176 10.2343 9.72876 10.3513 9.72876 10.4956V11.3319C9.72876 11.4762 9.61176 11.5932 9.46743 11.5932H6.58458C6.44025 11.5932 6.32324 11.4762 6.32324 11.3319V10.4956C6.32324 10.3513 6.44025 10.2343 6.58458 10.2343L7.28178 10.2335V8.08122L7.14759 8.08198C7.00326 8.08198 6.88626 7.96498 6.88626 7.82065V6.97073C6.88626 6.8264 7.00326 6.70939 7.14759 6.70939L7.47956 6.70859C7.49132 6.70677 7.50337 6.70582 7.51565 6.70582H8.54189ZM8.40513 4.41602C8.54946 4.41602 8.66646 4.53302 8.66646 4.67735V5.64802C8.66646 5.79235 8.54946 5.90935 8.40513 5.90935H7.43446C7.29013 5.90935 7.17313 5.79235 7.17313 5.64802V4.67735C7.17313 4.53302 7.29013 4.41602 7.43446 4.41602H8.40513Z"
  21. fill="white"></path>
  22. </svg>
  23. 物品介绍
  24. </span>
  25. <div v-html="data.comment"></div>
  26. </div>
  27. </div>
  28. <div v-if="data.deliveryType == 1">
  29. <p class="label">收货地址</p>
  30. <div class="address">
  31. <div class="address-container">
  32. <div class="header">
  33. <div class="left">
  34. <span>{{ data.contact }}</span>
  35. </div>
  36. </div>
  37. <p class="phone">{{ data.contactPhone }}</p>
  38. <p class="address">{{ data.contactAddr }}{{ data.contactEmail }}</p>
  39. </div>
  40. </div>
  41. </div>
  42. <p class="label">物品信息</p>
  43. <div v-if="data.skuType == 0">
  44. <table class="table">
  45. <thead>
  46. <tr>
  47. <th width="35%">兑换物品</th>
  48. <th>数量</th>
  49. <th>单价</th>
  50. <th>兑换方式</th>
  51. <th>总计</th>
  52. </tr>
  53. </thead>
  54. <tbody>
  55. <tr>
  56. <td>
  57. <div class="prize-info">
  58. <div class="prize-img-container">
  59. <el-image :src="data.imgUrl" :preview-src-list="[data.imgUrl]"
  60. class="prize-img"></el-image>
  61. </div>
  62. <div class="prize-detail-info">
  63. <h3 class="title">{{ data.name }}</h3>
  64. <p class="desc">
  65. <span v-if="data.location">{{ data.location }}</span>
  66. </p>
  67. </div>
  68. </div>
  69. </td>
  70. <td>{{ data.skuCount }}</td>
  71. <td>{{ data.price }} 积分</td>
  72. <td>{{ data.deliveryTypeName }}</td>
  73. <td class="finlly-price">
  74. {{ data.total }} 积分
  75. </td>
  76. </tr>
  77. </tbody>
  78. </table>
  79. </div>
  80. <div v-else>
  81. <table class="table">
  82. <thead>
  83. <tr>
  84. <th width="35%">兑换物品</th>
  85. <!-- <th>数量</th> -->
  86. <th>消耗福利券</th>
  87. <th>物品属性</th>
  88. <th>兑换方式</th>
  89. </tr>
  90. </thead>
  91. <tbody>
  92. <tr>
  93. <td>
  94. <div class="prize-info">
  95. <div class="prize-img-container">
  96. <el-image :src="data.imgUrl" :preview-src-list="[data.imgUrl]"
  97. class="prize-img"></el-image>
  98. </div>
  99. <div class="prize-detail-info">
  100. <h3 class="title">{{ data.name }}</h3>
  101. <p class="desc">
  102. <span v-if="data.location">{{ data.location }}</span>
  103. </p>
  104. </div>
  105. </div>
  106. </td>
  107. <!-- <td>{{ skuCount }}</td> -->
  108. <td>{{ data.title }}</td>
  109. <td>{{ data.productAttributeName }}</td>
  110. <td class="finlly-price">
  111. {{ data.deliveryTypeName }}
  112. </td>
  113. </tr>
  114. </tbody>
  115. </table>
  116. </div>
  117. <p class="label">兑换记录</p>
  118. <el-table :data="logs" border style="width: 1000px;margin-bottom: 20px;" size="mini">
  119. <el-table-column align="center" prop="auditor" label="处理人"></el-table-column>
  120. <el-table-column align="center" prop="comment" label="处理结果"></el-table-column>
  121. <el-table-column align="center" prop="orderStatus" label="状态"></el-table-column>
  122. <el-table-column align="center" prop="createTime" label="处理时间"></el-table-column>
  123. </el-table>
  124. <div class="footer" v-if="(data.orderType == 1 || data.orderType == 3) && data.deliveryType != 3">
  125. <div class="left-info">
  126. <span class="info-title">
  127. <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"
  128. class="info-icon">
  129. <path fill-rule="evenodd" clip-rule="evenodd"
  130. d="M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1Z"
  131. fill="#165DFF"></path>
  132. <path fill-rule="evenodd" clip-rule="evenodd"
  133. d="M8.54189 6.70582C8.67075 6.70582 8.77522 6.81029 8.77522 6.93915L8.77511 10.2335L9.46743 10.2343C9.61176 10.2343 9.72876 10.3513 9.72876 10.4956V11.3319C9.72876 11.4762 9.61176 11.5932 9.46743 11.5932H6.58458C6.44025 11.5932 6.32324 11.4762 6.32324 11.3319V10.4956C6.32324 10.3513 6.44025 10.2343 6.58458 10.2343L7.28178 10.2335V8.08122L7.14759 8.08198C7.00326 8.08198 6.88626 7.96498 6.88626 7.82065V6.97073C6.88626 6.8264 7.00326 6.70939 7.14759 6.70939L7.47956 6.70859C7.49132 6.70677 7.50337 6.70582 7.51565 6.70582H8.54189ZM8.40513 4.41602C8.54946 4.41602 8.66646 4.53302 8.66646 4.67735V5.64802C8.66646 5.79235 8.54946 5.90935 8.40513 5.90935H7.43446C7.29013 5.90935 7.17313 5.79235 7.17313 5.64802V4.67735C7.17313 4.53302 7.29013 4.41602 7.43446 4.41602H8.40513Z"
  134. fill="white"></path>
  135. </svg>
  136. 领取详情
  137. </span>
  138. <p class="info-content" v-if="data.deliveryType == 1">
  139. 快递类物品兑换后,将在这里显示兑换的物流单号,请保存好该信息自行查阅快递物流信息。<br>
  140. 物流单号:<span style="font-weight: 600;color: #ff834e;">{{ data.trackingNumber }}</span><br>
  141. </p>
  142. <p class="info-content" v-if="data.deliveryType == 2">
  143. 虚拟类物品兑换后,将在这里显示兑换的券码,请保存好该信息自行兑换。<br>
  144. 券码:<span style="font-weight: 600;color: #ff834e;">{{ data.trackingNumber }}</span><br>
  145. </p>
  146. <p class="info-content" v-if="data.deliveryType == 0">
  147. 线下领取物品请到各地公司进行领取<br>
  148. 领取联系人<br>
  149. 上海办公室:茅玮婷<br>
  150. 北京办公室:刘琳<br>
  151. 洛阳办公室:吴燕敏<br>
  152. </p>
  153. </div>
  154. <div class="right" v-if="data.orderType == 1">
  155. <!-- <div class="remark-line">
  156. <span>备注:</span>
  157. <el-input v-model="comment" class="remark" placeholder="请输入备注,例如兑换商品出现的问题等" type="textarea"></el-input>
  158. </div> -->
  159. <div class="btn-line">
  160. <el-button @click="handleClickConfirm(0)" type="primary" round>确认收货</el-button>
  161. <!-- <el-button @click="handleClickConfirm(1)" type="warning" round>商品问题反馈</el-button> -->
  162. </div>
  163. </div>
  164. </div>
  165. </el-card>
  166. </div>
  167. </template>
  168. <script>
  169. import { orderInfo, orderConfirm } from "@/api/allApi";
  170. export default {
  171. data() {
  172. return {
  173. orderId: this.$route.query.orderId,
  174. comment: '',
  175. logs: [],
  176. skuCount: 1,
  177. data: {},
  178. };
  179. },
  180. created() {
  181. const orderId = this.$route.query.orderId;
  182. this.getInfo(orderId);
  183. },
  184. methods: {
  185. getInfo(orderId) {
  186. orderInfo({ orderId: orderId }).then((response) => {
  187. this.data = response.data.data;
  188. this.logs = response.data.data.logs;
  189. })
  190. },
  191. handleClickConfirm(val) {
  192. if (val == 1 && this.comment == '') {
  193. this.$message.error('请填写备注内容');
  194. return
  195. };
  196. const params = {
  197. orderId: this.orderId,
  198. flag: val,
  199. comment: this.comment
  200. }
  201. orderConfirm(params).then(response => {
  202. console.log(response.data.data);
  203. this.$message({
  204. message: '提交成功!',
  205. type: 'success'
  206. });
  207. this.$router.push({
  208. path: '/home/myCenter',
  209. });
  210. })
  211. }
  212. },
  213. };
  214. </script>
  215. <style scoped>
  216. .clearfix:before,
  217. .clearfix:after {
  218. display: table;
  219. content: "";
  220. }
  221. .clearfix:after {
  222. clear: both;
  223. }
  224. .box-card {
  225. width: 100%;
  226. }
  227. /* .label:first-child {
  228. margin-top: 0;
  229. } */
  230. .label {
  231. font-size: 16px;
  232. line-height: 24px;
  233. margin: 16px 0 24px;
  234. }
  235. .address-container {
  236. padding: 16px;
  237. min-height: 112px;
  238. background-color: #f7f8fa;
  239. box-sizing: border-box;
  240. border-radius: 4px;
  241. width: 320px;
  242. border: 1px solid #abcdff;
  243. }
  244. .address-container .header {
  245. font-weight: 500;
  246. font-size: 14px;
  247. line-height: 24px;
  248. color: #252933;
  249. display: flex;
  250. justify-content: space-between;
  251. margin: 0 0 8px;
  252. }
  253. .address-container .header .left {
  254. display: flex;
  255. justify-content: center;
  256. align-items: center;
  257. }
  258. .address-container .btn {
  259. flex: none;
  260. color: #1e80ff;
  261. cursor: pointer;
  262. font-weight: 400;
  263. margin-left: 1em;
  264. }
  265. .address-container .address,
  266. .address-container .phone {
  267. margin: 0;
  268. font-size: 14px;
  269. line-height: 24px;
  270. color: #515767;
  271. }
  272. .address-container.new {
  273. border: 1px dashed #e4e6eb;
  274. width: 100%;
  275. display: flex;
  276. align-items: center;
  277. justify-content: center;
  278. cursor: pointer;
  279. flex-flow: column nowrap;
  280. }
  281. .address-container {
  282. padding: 16px;
  283. min-height: 112px;
  284. background-color: #f7f8fa;
  285. box-sizing: border-box;
  286. border-radius: 4px;
  287. width: 320px;
  288. border: 1px solid #abcdff;
  289. }
  290. .address-container.new .add-icon {
  291. font-size: 16px;
  292. color: #515767;
  293. }
  294. .byte-icon {
  295. width: 1em;
  296. height: 1em;
  297. display: inline-block;
  298. vertical-align: middle;
  299. line-height: 1;
  300. }
  301. svg:not(:root) {
  302. overflow-clip-margin: content-box;
  303. overflow: hidden;
  304. }
  305. .byte-icon svg {
  306. width: 100%;
  307. height: 100%;
  308. fill: currentColor;
  309. pointer-events: none;
  310. }
  311. .address-container.new .add-label {
  312. font-size: 14px;
  313. line-height: 24px;
  314. color: #8a919f;
  315. margin: 18px 0 0;
  316. }
  317. .table {
  318. border-collapse: collapse;
  319. border: 1px solid #e4e6eb;
  320. box-sizing: border-box;
  321. border-radius: 2px;
  322. width: 100%;
  323. text-align: left;
  324. font-size: 14px;
  325. line-height: 24px;
  326. border-collapse: separate;
  327. border-spacing: 0;
  328. border-radius: 4px;
  329. }
  330. .table tr {
  331. border: 1px solid #e4e6eb;
  332. }
  333. .table th {
  334. padding: 12px 16px;
  335. background-color: #f7f8fa;
  336. font-weight: 500;
  337. color: #282f38;
  338. }
  339. .table td {
  340. padding: 16px;
  341. vertical-align: middle;
  342. color: #515767;
  343. }
  344. .table .prize-info {
  345. display: flex;
  346. }
  347. .table .prize-img-container {
  348. display: flex;
  349. align-items: center;
  350. justify-content: center;
  351. background: #f7f8fa;
  352. width: 80px;
  353. height: 80px;
  354. }
  355. .table .prize-detail-info {
  356. margin-left: 16px;
  357. display: flex;
  358. flex-flow: column;
  359. align-items: flex-start;
  360. justify-content: center;
  361. }
  362. .table .prize-img-container .prize-img {
  363. max-height: 64px;
  364. }
  365. .lazy {
  366. position: relative;
  367. -o-object-fit: cover;
  368. object-fit: cover;
  369. }
  370. img {
  371. border-style: none;
  372. }
  373. .table .prize-detail-info {
  374. margin-left: 16px;
  375. display: flex;
  376. flex-flow: column;
  377. align-items: flex-start;
  378. justify-content: center;
  379. }
  380. .table .prize-detail-info .title {
  381. font-weight: 400;
  382. font-size: 14px;
  383. line-height: 24px;
  384. color: #1d2129;
  385. margin: 0 0 3px;
  386. }
  387. .table .prize-detail-info .desc {
  388. margin: 0;
  389. line-height: 18px;
  390. height: 18px;
  391. }
  392. .table .prize-detail-info .desc span {
  393. font-size: 12px;
  394. line-height: 14px;
  395. color: #ff7d00;
  396. background: #fff7e8;
  397. padding: 2px 4px;
  398. }
  399. .table .finlly-price {
  400. font-weight: 500;
  401. font-size: 14px;
  402. line-height: 24px;
  403. color: #1e80ff;
  404. }
  405. .footer {
  406. margin-top: 16px;
  407. display: flex;
  408. justify-content: space-between;
  409. }
  410. .footer .left-info {
  411. box-sizing: border-box;
  412. width: 400px;
  413. height: -webkit-fit-content;
  414. height: -moz-fit-content;
  415. height: fit-content;
  416. background-color: #e8f3ff;
  417. border-radius: 4px;
  418. padding: 16px;
  419. }
  420. .footer .left-info .info-title {
  421. font-size: 14px;
  422. line-height: 24px;
  423. color: #282f38;
  424. display: flex;
  425. align-items: center;
  426. }
  427. .footer .left-info .info-icon {
  428. margin-right: 8px;
  429. }
  430. .footer .left-info .info-content {
  431. margin: 4px 0 4px 2em;
  432. white-space: pre-line;
  433. font-size: 12px;
  434. line-height: 20px;
  435. color: #8a919f;
  436. }
  437. .footer .right {
  438. font-size: 14px;
  439. line-height: 24px;
  440. color: #282f38;
  441. }
  442. .footer .right .remark-line {
  443. display: flex;
  444. position: relative;
  445. }
  446. .footer .right .remark {
  447. width: 400px;
  448. }
  449. .footer .right .btn-line {
  450. margin-top: 16px;
  451. text-align: right;
  452. }
  453. .addButton-address {
  454. background: #1e80ff;
  455. border-color: #1e80ff;
  456. color: #fff;
  457. width: 160px;
  458. height: 48px;
  459. border-radius: 50px;
  460. line-height: 46px;
  461. padding: 0;
  462. font-size: 16px;
  463. border: 1px solid transparent;
  464. }
  465. </style>
  466. <style>
  467. .el-dialog__body {
  468. padding-bottom: 0px;
  469. }
  470. </style>