Good.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  1. <template>
  2. <div class="good-wrap">
  3. <div class="baseInfo-wrap">
  4. <img :src="goodMess.coverImg" />
  5. <div>
  6. <h5>{{goodMess.title}}</h5>
  7. <p>{{goodMess.produce}}</p>
  8. <span>{{goodMess.price}}</span>
  9. <el-button @click="toBuy">立即购买</el-button>
  10. </div>
  11. </div>
  12. <el-tabs v-model="activeName">
  13. <el-tab-pane label="商品信息" name="goodMess">
  14. <div class="tags-wrap">
  15. <h5>个性化案例展示</h5>
  16. <div class="caseShow-wrap">
  17. <el-carousel :interval="4000" type="card" height="300px">
  18. <el-carousel-item v-for="(item,index) in fileList" :key="index">
  19. <img :src="item.url" />
  20. </el-carousel-item>
  21. </el-carousel>
  22. </div>
  23. <h5>个性化元素</h5>
  24. <div v-for="(item,index) in tagList" class="tags-content" :key="index">
  25. <h6>{{item.type}}</h6>
  26. <div>
  27. <el-tag v-for="(tag,index) in item.list" :key="index">{{tag.name}}</el-tag>
  28. </div>
  29. </div>
  30. </div>
  31. </el-tab-pane>
  32. <el-tab-pane label="商品评价" name="goodEvaluate">
  33. <ul class="comments-wrap">
  34. <li v-for="comment in goodMess.commentsList">
  35. <p>{{comment.text}}</p>
  36. <span>{{comment.author}}</span>
  37. <div></div>
  38. </li>
  39. </ul>
  40. </el-tab-pane>
  41. </el-tabs>
  42. </div>
  43. </template>
  44. <script>
  45. export default{
  46. data(){
  47. return{
  48. goodMess:{},
  49. activeName:"goodMess",
  50. fileList:[],
  51. tagList:[],
  52. }
  53. },
  54. mounted(){
  55. this.getGoodMess();
  56. },
  57. methods:{
  58. getGoodMess(){
  59. let param = {
  60. shopId:this.$route.query.shopId,
  61. goodId:this.$route.query.id
  62. }
  63. this.axios.post(this.Api.getGoodMess,param).then((res)=>{
  64. this.goodMess=res.data;
  65. this.fileList=res.data.exampleImg;
  66. this.tagList=res.data.tags;
  67. }).catch((err)=>{
  68. console.log("getGoodMess:"+err);
  69. });
  70. },
  71. toBuy(){
  72. this.$router.push({
  73. path: '/buyer/toBuy',
  74. query: {
  75. id: this.$route.query.id,
  76. shopId: this.$route.query.shopId
  77. }
  78. })
  79. }
  80. }
  81. }
  82. </script>
  83. <style scoped>
  84. .good-wrap{
  85. width: 100%;
  86. padding: 0 20px;
  87. }
  88. .baseInfo-wrap{
  89. width: 100%;
  90. height: 300px;
  91. margin-top: 20px;
  92. background-color: #fff;
  93. border-left: 6px solid #3eb983;
  94. padding: 20px 20px 20px 13px;
  95. }
  96. .baseInfo-wrap img{
  97. display: block;
  98. float: left;
  99. width: 260px;
  100. height: 260px;
  101. }
  102. .baseInfo-wrap div{
  103. float: left;
  104. padding-left: 20px;
  105. text-align: left;
  106. width: calc(100% - 260px);
  107. }
  108. .baseInfo-wrap h5{
  109. font-size: 30px;
  110. margin-bottom: 10px;
  111. }
  112. .baseInfo-wrap p{
  113. font-size: 16px;
  114. color: #666;
  115. width: 100%;
  116. height: 100px;
  117. }
  118. .baseInfo-wrap span{
  119. font-size: 30px;
  120. color: #EA6A69;
  121. line-height: 65px;
  122. display: block;
  123. }
  124. .baseInfo-wrap button{
  125. float: right;
  126. }
  127. .el-tabs{
  128. background-color: #fff;
  129. margin-top: 20px;
  130. padding: 20px;
  131. }
  132. .tags-wrap{
  133. width: 100%;
  134. height: auto;
  135. }
  136. .tags-wrap h5{
  137. height: 50px;
  138. line-height: 50px;
  139. text-align: left;
  140. padding-left: 14px;
  141. border-left: 6px solid #3eb983;
  142. font-size: 16px;
  143. border-bottom: 1px solid #eee;
  144. margin-top: 15px;
  145. font-weight: bolder;
  146. }
  147. .tags-wrap .btn-wrap{
  148. width: 100%;
  149. text-align: left;
  150. padding-top: 10px;
  151. }
  152. .tags-content{
  153. width: 100%;
  154. text-align: left;
  155. }
  156. .tags-content h6{
  157. font-size: 16px;
  158. line-height: 40px;
  159. }
  160. .el-tag + .el-tag {
  161. margin-left: 10px;
  162. }
  163. .button-new-tag {
  164. margin-left: 10px;
  165. height: 32px;
  166. line-height: 30px;
  167. padding-top: 0;
  168. padding-bottom: 0;
  169. }
  170. .input-new-tag {
  171. width: 90px;
  172. margin-left: 10px;
  173. vertical-align: bottom;
  174. }
  175. .comments-wrap{
  176. width: 100%;
  177. }
  178. .comments-wrap li{
  179. width: 100%;
  180. height: auto;
  181. border-bottom: 1px solid #eee;
  182. }
  183. .comments-wrap div{
  184. width: 100%;
  185. height: auto;
  186. clear: both;
  187. }
  188. .comments-wrap p{
  189. width: calc(100% - 200px);
  190. float: left;
  191. text-align: left;
  192. line-height: 30px;
  193. padding: 5px 0 5px 10px;
  194. }
  195. .comments-wrap span{
  196. display: block;
  197. width: 200px;
  198. float: left;
  199. line-height: 40px;
  200. }
  201. .caseShow-wrap{
  202. width: 1000px;
  203. height: auto;
  204. margin: 20px auto 0;
  205. }
  206. .el-carousel img{
  207. width: 100%;
  208. height: 100%;
  209. }
  210. </style>
  211. <style>
  212. .good-wrap .el-tabs__item.is-active{
  213. color: #3eb983;
  214. }
  215. .good-wrap .el-tabs__active-bar{
  216. background-color: #3eb983;
  217. }
  218. .good-wrap .el-tabs__header{
  219. margin: 0;
  220. }
  221. .good-wrap .el-upload-list{
  222. display: flex;
  223. flex-wrap: wrap;
  224. justify-content: space-between;
  225. }
  226. .good-wrap .el-upload-list li{
  227. width: 300px;
  228. }
  229. .good-wrap .el-upload{
  230. width: 100%;
  231. text-align: left;
  232. padding-top: 10px;
  233. }
  234. .good-wrap .el-button--primary{
  235. background-color: #3eb983;
  236. border-color: #3eb983;
  237. }
  238. .good-wrap .el-button--primary:hover{
  239. background-color: #3eb983;
  240. border-color: #3eb983;
  241. }
  242. </style>
  243. <style>
  244. .good-wrap .el-dialog{
  245. width: 500px;
  246. /*height: 280px;*/
  247. border-radius: 6px;
  248. text-align: left;
  249. }
  250. .good-wrap .el-dialog__header{
  251. padding: 20px 30px 0 40px;
  252. }
  253. .good-wrap .el-dialog__body{
  254. padding: 20px 30px;
  255. }
  256. .good-wrap .dialogheader{
  257. width: 100%;
  258. /*height: 60px;*/
  259. }
  260. .good-wrap .dialogheader p{
  261. width: 360px;
  262. height: 30px;
  263. line-height: 30px;
  264. margin-top: 10px;
  265. border:1px solid #3eb983;
  266. border-radius: 6px;
  267. text-align: left;
  268. padding-left: 10px;
  269. margin-left: 60px;
  270. }
  271. .good-wrap .dialogheader p input{
  272. height: 24px;
  273. line-height: 24px;
  274. border:0;
  275. margin-left: 20px;
  276. }
  277. .good-wrap .dialogheader .button{
  278. background: #3eb983;
  279. color: #fff;
  280. text-align: center;
  281. margin-top: 40px;
  282. cursor: pointer;
  283. }
  284. .good-wrap .dialogheader .el-button{
  285. width: 173px;
  286. padding: 10px 0;
  287. }
  288. .good-wrap .dialogheader .el-form-item{
  289. margin-bottom: 15px;
  290. }
  291. .good-wrap .dialogheader .el-button+.el-button{
  292. margin-left: 0;
  293. }
  294. .good-wrap .dialogheader .el-button--primary{
  295. background-color: #3eb983;
  296. border-color: #3eb983;
  297. }
  298. .good-wrap .dialogheader .el-button--primary:hover{
  299. background-color: #3eb983;
  300. border-color: #3eb983;
  301. }
  302. .good-wrap .dialogheader .el-button--default{
  303. background-color: #bfcbd9;
  304. color: #fff;
  305. }
  306. .good-wrap .dialogheader .el-button--default:hover{
  307. background-color: #bfcbd9;
  308. border-color: #bfcbd9;
  309. color: #fff;
  310. }
  311. .good-wrap .dialogheader .button-new-tag{
  312. width: auto;
  313. background-color: #fff;
  314. color: #606266;
  315. margin-left: 0;
  316. height: 32px;
  317. line-height: 30px;
  318. padding: 9px 15px;
  319. padding-top: 0;
  320. padding-bottom: 0;
  321. }
  322. .good-wrap .dialogheader .button-new-tag:hover{
  323. color: #409EFF;
  324. background-color: rgba(64,158,255,.1);
  325. border: 1px solid rgba(64,158,255,.2);
  326. }
  327. </style>