detail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  1. <template>
  2. <div class="app-container">
  3. <div class="left">
  4. <div class="leftTop">
  5. <span>店铺名称</span>
  6. </div>
  7. <div class="leftBottom">
  8. <!-- <div class="leftBottom1">
  9. <el-carousel height="45vh">
  10. <el-carousel-item v-for="(item,index) in picList" :key="index">
  11. <img :src="item.picture" alt="" style="width: 100%;height: 100%;">
  12. </el-carousel-item>
  13. </el-carousel>
  14. </div> -->
  15. <!-- <div class="leftBottom2">
  16. <img v-for="item in picList" :src="item.picture" alt="" style="width: 20%;">
  17. <PicListChange :picList="picList"></PicListChange>
  18. </div> -->
  19. <PicListChange :picList="goodsDetail.picture"></PicListChange>
  20. <div style="width: 100%;display: block;">
  21. <el-button class="leftBottom3" type="text">举报</el-button>
  22. </div>
  23. <div class="leftBottom4">
  24. <el-button type="primary">进入店铺</el-button>
  25. </div>
  26. </div>
  27. </div>
  28. <div class="right">
  29. <div class="rightTop">
  30. <div class="goodsName">
  31. <span>{{ goodsDetail.name }}</span>
  32. </div>
  33. <div class="detail1">
  34. <div style="width: 100%; float: left;">
  35. <div class="detail1-1">商品单价</div>
  36. <div class="detail1-2">¥{{ goodsDetail.platPrice }}/{{ goodsDetail.unit }}</div>
  37. <div class="detail1-3">¥{{ goodsDetail.marketPrice }}/{{ goodsDetail.unit }}</div>
  38. </div>
  39. <div class="detail1-4">
  40. <el-tag v-for="item in goodsDetail.keyword" size="mini" style="margin-right: 2%;"> {{ item
  41. }}</el-tag>
  42. </div>
  43. </div>
  44. <div class="detail2">
  45. <div class="rightBottomDetail">
  46. <div class="rightBottom-1" style="height: 35px;">剩余库存</div>
  47. <div class="rightBottom-2">{{ goodsDetail.num }}&nbsp;{{ goodsDetail.unit }}</div>
  48. </div>
  49. <div class="rightBottomDetail">
  50. <div class="rightBottom-1" style="height: 35px;">价格策略</div>
  51. <div class="rightBottom-2">
  52. aaaaafasdfafqwefqwfefqawedsfasdfqwefasdfqwefasdfwqefaefasdfqawefasedfqawegfqwgqwerfqwefdwe
  53. </div>
  54. </div>
  55. </div>
  56. <!-- <el-divider class="divider" :dashed="true"></el-divider> -->
  57. </div>
  58. <div class="rightBottom">
  59. <el-tabs v-model="bottomChoice" @tab-click="" style="width: 98%; margin: 0px auto">
  60. <el-tab-pane label="商品介绍" name="1">
  61. <div class="rightBottomDetail">
  62. <div class="rightBottom-1" style="height: 35px;">商品名称</div>
  63. <div class="rightBottom-2">{{ goodsDetail.name }}</div>
  64. </div>
  65. <div class="rightBottomDetail">
  66. <div class="rightBottom-1" style="height: 35px;">商品编号</div>
  67. <div class="rightBottom-2">{{ goodsDetail.code }}</div>
  68. </div>
  69. <div class="rightBottomDetail">
  70. <div class="rightBottom-1" style="height: 35px;">商品品牌</div>
  71. <div class="rightBottom-2">{{ goodsDetail.brand }}</div>
  72. </div>
  73. <div class="rightBottomDetail">
  74. <div class="rightBottom-1" style="height: 35px;">商品产地</div>
  75. <div class="rightBottom-2">暂时没有商品产地</div>
  76. </div>
  77. <div class="rightBottomDetail">
  78. <div class="rightBottom-1" style="min-height: 35px;">商品描述</div>
  79. <!-- <div class="rightBottom-2">{{ goodsDetail.productDetail }}</div> -->
  80. <div class="rightBottom-2">
  81. <div v-html="goodsDetail.productDetail"></div>
  82. </div>
  83. </div>
  84. <div class="rightBottomDetail">
  85. <div class="rightBottom-1" style="min-height: 35px;">平台申明</div>
  86. <div class="rightBottom-2">
  87. Lorem isum dolor sit amet, conseclelur adipiscing elt. Aenean euismod
  88. bibendum aoreet Proin gravda dolorsit amet lacus accumsan etvvea ustocommodo.
  89. Proin sodalespulvinar sic tempor. Socis natoquepenatibus etmagnis dis paturient
  90. montes, nasceturridiculus mus. Nam fermentum, nulaluctus pharetravulputate
  91. </div>
  92. </div>
  93. </el-tab-pane>
  94. <el-tab-pane label="规格与包装" name="2"></el-tab-pane>
  95. <el-tab-pane label="售后保障" name="3"></el-tab-pane>
  96. <el-tab-pane label="商品评价" name="4"></el-tab-pane>
  97. </el-tabs>
  98. </div>
  99. </div>
  100. </div>
  101. </template>
  102. <script>
  103. import {
  104. createGoodsDetail,
  105. updateGoodsDetail,
  106. deleteGoodsDetail,
  107. getGoodsDetail,
  108. getGoodsDetailPage,
  109. exportGoodsDetailExcel,
  110. addGoodsDetailUpNum,
  111. changeGoodsDetailStatus,
  112. getAddAgainLog,
  113. } from "@/api/supplier/goodsDetail";
  114. import PicListChange from "./components/picListChange.vue";
  115. export default {
  116. name: "GoodsDetail",
  117. components: {
  118. PicListChange,
  119. },
  120. data() {
  121. return {
  122. goodsDetail: { name: "商品名称" },
  123. bottomChoice: '1',
  124. picList: [
  125. "https://ts.willalp.com:9002/willalpbucket/微信图片_2024032809233720240328092531.png",
  126. "http://60.188.249.11:9002/willalpbucket/fm0220240407170915.jpg",
  127. "http://60.188.249.11:9002/willalpbucket/lunbo320240402180418.png",
  128. "http://60.188.249.11:9002/willalpbucket/lunbo120240402180243.png",
  129. "http://60.188.249.11:9002/willalpbucket/lunbo420240403110118.png",
  130. "http://60.188.249.11:9002/willalpbucket/%E5%85%B3%E5%BF%83%E5%85%B3%E7%88%B120240403110925.png",
  131. ],
  132. }
  133. },
  134. created() {
  135. this.id = this.$route.query.id;
  136. if (!this.id) {
  137. this.$message.error("未传递 id 参数,无法查看商品详情信息");
  138. return;
  139. }
  140. this.getDetail();
  141. },
  142. methods: {
  143. getDetail() {
  144. this.goodsDetail = { name: "商品名称" };
  145. getGoodsDetail(this.id).then((response) => {
  146. this.goodsDetail = response.data;
  147. if (typeof this.goodsDetail.platPrice == 'number') {
  148. this.goodsDetail.platPrice = this.goodsDetail.platPrice.toFixed(2);
  149. }
  150. if (typeof this.goodsDetail.marketPrice == 'number') {
  151. this.goodsDetail.marketPrice = this.goodsDetail.marketPrice.toFixed(2);
  152. }
  153. if (this.goodsDetail.keyword) {
  154. this.goodsDetail.keyword = this.goodsDetail.keyword.split(",")
  155. }
  156. if (this.goodsDetail.picture) {
  157. this.goodsDetail.picture = this.goodsDetail.picture.split(",")
  158. }
  159. console.log(">>>>>>>>>>>>", this.goodsDetail)
  160. });
  161. },
  162. }
  163. }
  164. </script>
  165. <style scoped>
  166. .app-container {
  167. display: flex;
  168. background: #F5F7FB;
  169. border-radius: 0px 0px 0px 0px;
  170. padding: 0 20px;
  171. }
  172. .left {
  173. float: left;
  174. width: 37%;
  175. background: #FFFFFF;
  176. margin-top: 1vh;
  177. height: 100vh
  178. }
  179. .leftTop {
  180. display: flex;
  181. justify-content: center;
  182. align-items: center;
  183. margin: auto;
  184. width: 98%;
  185. height: 10vh;
  186. position: relative;
  187. margin-bottom: 1vh;
  188. padding: auto;
  189. background: #FFFFFF;
  190. box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
  191. span {
  192. font-family: Microsoft YaHei, Microsoft YaHei;
  193. font-weight: bold;
  194. font-size: 24px;
  195. color: #333333;
  196. line-height: 28px;
  197. letter-spacing: 13px;
  198. text-align: center;
  199. }
  200. }
  201. .leftBottom {
  202. background: #FFFFFF;
  203. width: 98%;
  204. height: 65vh;
  205. position: relative;
  206. margin-bottom: 1vh;
  207. display: block;
  208. margin: auto;
  209. }
  210. .leftBottom1 {
  211. height: 100%;
  212. width: 98%;
  213. display: block;
  214. margin: auto;
  215. }
  216. .leftBottom2 {
  217. width: 98%;
  218. height: 10vh;
  219. display: block;
  220. margin: auto;
  221. margin-top: 2vh;
  222. }
  223. .leftBottom3 {
  224. font-family: Microsoft YaHei, Microsoft YaHei;
  225. font-weight: 400;
  226. font-size: 16px;
  227. color: #6F6F6F;
  228. line-height: 19px;
  229. letter-spacing: 1px;
  230. text-align: center;
  231. float: right;
  232. }
  233. .leftBottom4 {
  234. height: 20vh;
  235. display: flex;
  236. justify-content: center;
  237. align-items: center;
  238. }
  239. .right {
  240. float: left;
  241. margin-top: 1vh;
  242. margin-left: 1vh;
  243. width: 62%;
  244. }
  245. .goodsName {
  246. font-family: Microsoft YaHei, Microsoft YaHei;
  247. font-weight: bold;
  248. font-size: 24px;
  249. color: #333333;
  250. line-height: 28px;
  251. letter-spacing: 1px;
  252. text-align: left;
  253. font-style: normal;
  254. text-transform: none;
  255. margin-left: 2.5vh;
  256. padding-top: 2.5vh;
  257. }
  258. .detail1 {
  259. float: left;
  260. width: 70%;
  261. height: 12vh;
  262. margin: 1%;
  263. background: linear-gradient(90deg, #FFEFE0 0%, #FDE6E6 100%);
  264. border-radius: 0px 0px 0px 0px;
  265. }
  266. .detail1-1 {
  267. float: left;
  268. display: flex;
  269. justify-content: right;
  270. align-items: center;
  271. font-family: Microsoft YaHei, Microsoft YaHei;
  272. font-weight: 400;
  273. font-size: 16px;
  274. color: #6F6F6F;
  275. letter-spacing: 1px;
  276. font-style: normal;
  277. text-transform: none;
  278. /* width: 80px; */
  279. margin-left: 2vh;
  280. height: 50px;
  281. }
  282. .detail1-2 {
  283. float: left;
  284. display: flex;
  285. justify-content: center;
  286. align-items: center;
  287. font-family: Microsoft YaHei, Microsoft YaHei;
  288. font-weight: bold;
  289. font-size: 24px;
  290. color: #FF0000;
  291. letter-spacing: 1px;
  292. text-align: left;
  293. font-style: normal;
  294. text-transform: none;
  295. min-width: 120px;
  296. height: 50px;
  297. padding-left: 15px;
  298. padding-right: 15px;
  299. }
  300. .detail1-3 {
  301. float: left;
  302. display: flex;
  303. justify-content: left;
  304. align-items: center;
  305. font-family: Microsoft YaHei, Microsoft YaHei;
  306. font-weight: 400;
  307. font-size: 16px;
  308. color: #ADADAD;
  309. letter-spacing: 1px;
  310. font-style: normal;
  311. text-transform: none;
  312. min-width: 100px;
  313. height: 50px;
  314. text-decoration: line-through;
  315. }
  316. .detail1-4 {
  317. float: left;
  318. width: 100%;
  319. margin-left: 2vh;
  320. }
  321. .detail2 {
  322. float: left;
  323. width: 70%;
  324. /* height: 12vh; */
  325. }
  326. .detail2-1 {
  327. font-family: Microsoft YaHei, Microsoft YaHei;
  328. font-weight: 400;
  329. font-size: 16px;
  330. color: #333333;
  331. letter-spacing: 1px;
  332. text-align: left;
  333. height: 35px;
  334. display: flex;
  335. justify-content: left;
  336. /* align-items: center; */
  337. align-content: flex-start;
  338. padding-left: 20px;
  339. word-break: break-all;
  340. }
  341. .divider {
  342. float: left;
  343. }
  344. .rightTop {
  345. background: #FFFFFF;
  346. width: 100%;
  347. height: 34vh;
  348. position: relative;
  349. margin-bottom: 1vh;
  350. }
  351. .rightBottom {
  352. background: #FFFFFF;
  353. width: 100%;
  354. min-height: 44vh;
  355. float: left;
  356. display: flex;
  357. align-content: flex-start;
  358. }
  359. .rightBottom-1 {
  360. float: left;
  361. display: flex;
  362. justify-content: right;
  363. align-content: flex-start;
  364. font-weight: 400;
  365. font-size: 16px;
  366. color: #6F6F6F;
  367. letter-spacing: 1px;
  368. font-style: normal;
  369. text-transform: none;
  370. text-align: left;
  371. word-break: break-all;
  372. /* width: 80px; */
  373. margin-left: 2vh;
  374. height: 35px;
  375. }
  376. .rightBottom-2 {
  377. font-weight: 400;
  378. font-size: 16px;
  379. color: #333333;
  380. letter-spacing: 1px;
  381. text-align: left;
  382. word-break: break-all;
  383. min-height: 35px;
  384. width: 80%;
  385. display: flex;
  386. justify-content: left;
  387. align-content: flex-start;
  388. padding-left: 20px;
  389. }
  390. .rightBottomDetail {
  391. width: 100%;
  392. float: left;
  393. }
  394. .el-carousel__item h3 {
  395. color: #475669;
  396. font-size: 14px;
  397. opacity: 0.75;
  398. line-height: 150px;
  399. margin: 0;
  400. }
  401. .el-carousel__item:nth-child(2n) {
  402. background-color: #99a9bf;
  403. }
  404. .el-carousel__item:nth-child(2n+1) {
  405. background-color: #d3dce6;
  406. }
  407. </style>