GoodsDetail.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  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.addressStr + data.street + data.contactAddr }}</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 style="text-align: center;">数量</th>
  49. <th style="text-align: center;">单价</th>
  50. <th style="text-align: center;">兑换方式</th>
  51. <th v-if="data.reclaimAddrName" style="text-align: center;">领取地点</th>
  52. <th style="text-align: center;">总计</th>
  53. </tr>
  54. </thead>
  55. <tbody>
  56. <tr>
  57. <td>
  58. <div class="prize-info">
  59. <div class="prize-img-container">
  60. <el-image :src="data.imgUrl" v-if="data.imgUrl" :preview-src-list="[data.imgUrl]"
  61. class="prize-img"></el-image>
  62. </div>
  63. <div class="prize-detail-info">
  64. <h3 style="color: #1e80ff;" class="title" @click="handleClickGood(data.skuDesc)">{{ data.name }}</h3>
  65. <!-- <p class="desc">
  66. <span v-if="data.location">{{ data.location }}</span>
  67. </p> -->
  68. </div>
  69. </div>
  70. </td>
  71. <td style="text-align: center;">{{ data.skuCount }}</td>
  72. <td style="text-align: center;">{{ data.price }} 积分</td>
  73. <td style="text-align: center;">{{ data.deliveryTypeName }}</td>
  74. <td v-if="data.reclaimAddrName" style="text-align: center;">{{ data.reclaimAddrName }}</td>
  75. <td style="text-align: center;" class="finlly-price">
  76. {{ data.total }} 积分
  77. </td>
  78. </tr>
  79. </tbody>
  80. </table>
  81. </div>
  82. <div v-else>
  83. <table class="table">
  84. <thead>
  85. <tr>
  86. <th width="35%">兑换物品</th>
  87. <!-- <th>数量</th> -->
  88. <th style="text-align: center;">消耗福利券</th>
  89. <th style="text-align: center;">物品属性</th>
  90. <th style="text-align: center;">兑换方式</th>
  91. </tr>
  92. </thead>
  93. <tbody>
  94. <tr>
  95. <td>
  96. <div class="prize-info">
  97. <div class="prize-img-container">
  98. <el-image :src="data.imgUrl" v-if="data.imgUrl" :preview-src-list="imgUrls.length==0?[data.imgUrl]:imgUrls"
  99. class="prize-img"></el-image>
  100. </div>
  101. <div class="prize-detail-info">
  102. <h3 class="title">{{ data.name }}</h3>
  103. <!-- <p class="desc">
  104. <span v-if="data.location">{{ data.location }}</span>
  105. </p> -->
  106. </div>
  107. </div>
  108. </td>
  109. <!-- <td>{{ skuCount }}</td> -->
  110. <td style="text-align: center;">{{ data.title }}</td>
  111. <td style="text-align: center;">{{ data.productAttributeName }}</td>
  112. <td style="text-align: center;" class="finlly-price">
  113. {{ data.deliveryTypeName }}
  114. </td>
  115. </tr>
  116. </tbody>
  117. </table>
  118. </div>
  119. <p class="label">兑换记录</p>
  120. <el-table :data="logs" border style="width: 1000px;margin-bottom: 20px;" size="mini">
  121. <el-table-column align="center" prop="auditor" label="处理人"></el-table-column>
  122. <el-table-column align="center" prop="comment" label="处理结果"></el-table-column>
  123. <el-table-column align="center" prop="orderStatus" label="状态"></el-table-column>
  124. <el-table-column align="center" prop="createTime" label="处理时间"></el-table-column>
  125. </el-table>
  126. <div class="footer" v-if="(data.orderType == 3 || data.orderType == 4) && (data.deliveryType == 0 || data.deliveryType == 1 || data.deliveryType == 2)">
  127. <div class="left-info">
  128. <span class="info-title">
  129. <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"
  130. class="info-icon">
  131. <path fill-rule="evenodd" clip-rule="evenodd"
  132. 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"
  133. fill="#165DFF"></path>
  134. <path fill-rule="evenodd" clip-rule="evenodd"
  135. 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"
  136. fill="white"></path>
  137. </svg>
  138. 领取详情
  139. </span>
  140. <p class="info-content" v-if="data.deliveryType == 1">
  141. 快递类物品兑换后,将在这里显示兑换的物流单号,请保存好该信息自行查阅快递物流信息。<br>
  142. 物流单号:<span style="font-weight: 600;color: #ff834e;">{{ data.trackingNumber }}</span><br>
  143. </p>
  144. <p class="info-content" v-if="data.deliveryType == 2">
  145. 虚拟类物品兑换后,将在这里显示兑换的券码,请保存好该信息自行兑换。<br>
  146. 券码:<span style="font-weight: 600;color: #ff834e;">{{ data.trackingNumber }}</span><br>
  147. </p>
  148. <p class="info-content" v-if="data.deliveryType == 0">
  149. 办公室领取的物品请到各地公司进行领取<br>
  150. <!-- 领取联系人<br>
  151. 上海办公室:茅玮婷<br>
  152. 北京办公室:刘琳<br>
  153. 洛阳办公室:吴燕敏<br> -->
  154. </p>
  155. </div>
  156. <div class="right" v-if="data.orderType == 3">
  157. <!-- <div class="remark-line">
  158. <span>备注:</span>
  159. <el-input v-model="comment" class="remark" placeholder="请输入备注,例如兑换商品出现的问题等" type="textarea"></el-input>
  160. </div> -->
  161. <div class="btn-line">
  162. <el-button @click="handleClickConfirm(0)" type="primary" round>确认收货</el-button>
  163. <!-- <el-button @click="handleClickConfirm(1)" type="warning" round>商品问题反馈</el-button> -->
  164. </div>
  165. </div>
  166. </div>
  167. <div v-if="data.deliveryType == 3 || data.deliveryType == 4">
  168. <div class="right" style="text-align: right;" v-if="data.orderType == 3">
  169. <div class="btn-line">
  170. <el-button @click="handleClickConfirm(0)" type="primary" round>确认收货</el-button>
  171. </div>
  172. </div>
  173. </div>
  174. </el-card>
  175. <el-dialog title="物品详情" :visible.sync="dialogVisibleGoods" width="40%">
  176. <div v-html="data.skuDesc"></div>
  177. </el-dialog>
  178. </div>
  179. </template>
  180. <script>
  181. import { setTab } from '@/utils/auth';
  182. import { orderInfo, orderConfirm } from "@/api/allApi";
  183. export default {
  184. data() {
  185. return {
  186. skuDesc:'',
  187. dialogVisibleGoods:false,
  188. orderId: this.$route.query.orderId,
  189. comment: '',
  190. logs: [],
  191. skuCount: 1,
  192. data: {},
  193. imgUrls:[],
  194. };
  195. },
  196. created() {
  197. const orderId = this.$route.query.orderId;
  198. this.getInfo(orderId);
  199. },
  200. methods: {
  201. handleClickGood(val) {
  202. this.skuDesc = val;
  203. if(this.skuDesc){
  204. this.dialogVisibleGoods = true;
  205. }
  206. // this.$router.push({
  207. // path: '/home/pointsMall/goodDetail',
  208. // query: {
  209. // id: id,
  210. // }
  211. // });
  212. },
  213. getInfo(orderId) {
  214. orderInfo({ orderId: orderId }).then((response) => {
  215. this.data = response.data.data;
  216. this.logs = response.data.data.logs;
  217. let imgs = response.data.data.imgs;
  218. if(imgs){
  219. imgs.forEach(element => {
  220. this.imgUrls.push(element.url);
  221. });
  222. }
  223. })
  224. },
  225. handleClickConfirm(val) {
  226. if (val == 1 && this.comment == '') {
  227. this.$message.error('请填写备注内容');
  228. return
  229. };
  230. const params = {
  231. orderId: this.orderId,
  232. flag: val,
  233. comment: this.comment
  234. }
  235. orderConfirm(params).then(response => {
  236. console.log(response.data.data);
  237. this.$message({
  238. message: '提交成功!',
  239. type: 'success'
  240. });
  241. setTab('exchange');
  242. this.$router.push({
  243. path: '/home/myCenter',
  244. });
  245. })
  246. }
  247. },
  248. };
  249. </script>
  250. <style scoped>
  251. .clearfix:before,
  252. .clearfix:after {
  253. display: table;
  254. content: "";
  255. }
  256. .clearfix:after {
  257. clear: both;
  258. }
  259. .box-card {
  260. width: 100%;
  261. }
  262. /* .label:first-child {
  263. margin-top: 0;
  264. } */
  265. .label {
  266. font-size: 16px;
  267. line-height: 24px;
  268. margin: 16px 0 24px;
  269. }
  270. .address-container {
  271. padding: 16px;
  272. min-height: 112px;
  273. background-color: #f7f8fa;
  274. box-sizing: border-box;
  275. border-radius: 4px;
  276. width: 320px;
  277. border: 1px solid #abcdff;
  278. }
  279. .address-container .header {
  280. font-weight: 500;
  281. font-size: 14px;
  282. line-height: 24px;
  283. color: #252933;
  284. display: flex;
  285. justify-content: space-between;
  286. margin: 0 0 8px;
  287. }
  288. .address-container .header .left {
  289. display: flex;
  290. justify-content: center;
  291. align-items: center;
  292. }
  293. .address-container .btn {
  294. flex: none;
  295. color: #1e80ff;
  296. cursor: pointer;
  297. font-weight: 400;
  298. margin-left: 1em;
  299. }
  300. .address-container .address,
  301. .address-container .phone {
  302. margin: 0;
  303. font-size: 14px;
  304. line-height: 24px;
  305. color: #515767;
  306. }
  307. .address-container.new {
  308. border: 1px dashed #e4e6eb;
  309. width: 100%;
  310. display: flex;
  311. align-items: center;
  312. justify-content: center;
  313. cursor: pointer;
  314. flex-flow: column nowrap;
  315. }
  316. .address-container {
  317. padding: 16px;
  318. min-height: 112px;
  319. background-color: #f7f8fa;
  320. box-sizing: border-box;
  321. border-radius: 4px;
  322. width: 320px;
  323. border: 1px solid #abcdff;
  324. }
  325. .address-container.new .add-icon {
  326. font-size: 16px;
  327. color: #515767;
  328. }
  329. .byte-icon {
  330. width: 1em;
  331. height: 1em;
  332. display: inline-block;
  333. vertical-align: middle;
  334. line-height: 1;
  335. }
  336. svg:not(:root) {
  337. overflow-clip-margin: content-box;
  338. overflow: hidden;
  339. }
  340. .byte-icon svg {
  341. width: 100%;
  342. height: 100%;
  343. fill: currentColor;
  344. pointer-events: none;
  345. }
  346. .address-container.new .add-label {
  347. font-size: 14px;
  348. line-height: 24px;
  349. color: #8a919f;
  350. margin: 18px 0 0;
  351. }
  352. .table {
  353. border-collapse: collapse;
  354. border: 1px solid #e4e6eb;
  355. box-sizing: border-box;
  356. border-radius: 2px;
  357. width: 100%;
  358. text-align: left;
  359. font-size: 14px;
  360. line-height: 24px;
  361. border-collapse: separate;
  362. border-spacing: 0;
  363. border-radius: 4px;
  364. }
  365. .table tr {
  366. border: 1px solid #e4e6eb;
  367. }
  368. .table th {
  369. padding: 12px 16px;
  370. background-color: #f7f8fa;
  371. font-weight: 500;
  372. color: #282f38;
  373. }
  374. .table td {
  375. padding: 16px;
  376. vertical-align: middle;
  377. color: #515767;
  378. }
  379. .table .prize-info {
  380. display: flex;
  381. }
  382. .table .prize-img-container {
  383. display: flex;
  384. align-items: center;
  385. justify-content: center;
  386. background: #f7f8fa;
  387. width: 80px;
  388. height: 80px;
  389. }
  390. .table .prize-detail-info {
  391. margin-left: 16px;
  392. display: flex;
  393. flex-flow: column;
  394. align-items: flex-start;
  395. justify-content: center;
  396. }
  397. .table .prize-img-container .prize-img {
  398. max-height: 64px;
  399. }
  400. .lazy {
  401. position: relative;
  402. -o-object-fit: cover;
  403. object-fit: cover;
  404. }
  405. img {
  406. border-style: none;
  407. }
  408. .table .prize-detail-info {
  409. margin-left: 16px;
  410. display: flex;
  411. flex-flow: column;
  412. align-items: flex-start;
  413. justify-content: center;
  414. }
  415. .table .prize-detail-info .title {
  416. cursor: pointer;
  417. font-weight: 400;
  418. font-size: 14px;
  419. line-height: 24px;
  420. color: #1d2129;
  421. margin: 0 0 3px;
  422. }
  423. .table .prize-detail-info .desc {
  424. margin: 0;
  425. line-height: 18px;
  426. height: 18px;
  427. }
  428. .table .prize-detail-info .desc span {
  429. font-size: 12px;
  430. line-height: 14px;
  431. color: #ff7d00;
  432. background: #fff7e8;
  433. padding: 2px 4px;
  434. }
  435. .table .finlly-price {
  436. font-weight: 500;
  437. font-size: 14px;
  438. line-height: 24px;
  439. color: #1e80ff;
  440. }
  441. .footer {
  442. margin-top: 16px;
  443. display: flex;
  444. justify-content: space-between;
  445. }
  446. .footer .left-info {
  447. box-sizing: border-box;
  448. width: 400px;
  449. height: -webkit-fit-content;
  450. height: -moz-fit-content;
  451. height: fit-content;
  452. background-color: #e8f3ff;
  453. border-radius: 4px;
  454. padding: 16px;
  455. }
  456. .footer .left-info .info-title {
  457. font-size: 14px;
  458. line-height: 24px;
  459. color: #282f38;
  460. display: flex;
  461. align-items: center;
  462. }
  463. .footer .left-info .info-icon {
  464. margin-right: 8px;
  465. }
  466. .footer .left-info .info-content {
  467. margin: 4px 0 4px 2em;
  468. white-space: pre-line;
  469. font-size: 12px;
  470. line-height: 20px;
  471. color: #8a919f;
  472. }
  473. .footer .right {
  474. font-size: 14px;
  475. line-height: 24px;
  476. color: #282f38;
  477. }
  478. .footer .right .remark-line {
  479. display: flex;
  480. position: relative;
  481. }
  482. .footer .right .remark {
  483. width: 400px;
  484. }
  485. .footer .right .btn-line {
  486. margin-top: 16px;
  487. text-align: right;
  488. }
  489. .addButton-address {
  490. background: #1e80ff;
  491. border-color: #1e80ff;
  492. color: #fff;
  493. width: 160px;
  494. height: 48px;
  495. border-radius: 50px;
  496. line-height: 46px;
  497. padding: 0;
  498. font-size: 16px;
  499. border: 1px solid transparent;
  500. }
  501. </style>