groupDetail.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <template>
  2. <div class="container normal-panel">
  3. <div class="product-detail container flex-align-stretch">
  4. <div>
  5. <el-image style="width:400px;height:400px;margin-right:30px" :src="actImage.url" fit="cover" />
  6. <div class="flex-align-stretch column">
  7. <el-image class="thumImage mt-10" :class="item.attachmentid === actImage.attachmentid?'act':''" v-for="item in selectProduct.attinfos" :key="item.index" :src="item.url" @click="actImage = item" fit="cover" />
  8. </div>
  9. </div>
  10. <div style="flex:1">
  11. <p class="productName normal-margin">
  12. <el-tag class="inline-16" @click="actTradefield = item.tradefield" v-for="(item,index) in tradefield" :key="index" size="small" :effect="actTradefield === item.tradefield ? 'dark' : 'plain'">{{item.tradefield}}
  13. </el-tag>
  14. {{selectProduct.itemname}}
  15. </p>
  16. <p class="normal-margin" style="color:#888;">编码:&emsp;{{selectProduct.itemno}}</p>
  17. <p class="normal-margin">价格:&emsp;<span class="product-price">¥{{selectProduct.gradeprice}}</span>&nbsp;<span class="text-throughline">¥{{selectProduct.marketprice}}</span></p>
  18. <div class="line normal-margin"></div>
  19. <div>
  20. <p class="normal-margin">规格:&emsp;{{selectProduct.spec}}</p>
  21. </div>
  22. <div class="flex-align-center" style="margin-bottom:30px">
  23. <p>数量:&emsp;</p>
  24. <el-input-number v-model="count" :min="selectProduct.orderminqty" :step="selectProduct.orderaddqty" size="small" label="描述文字"></el-input-number>
  25. <span style="color:#888;font-size: 14px;margin-left: 10px">起订量:{{selectProduct.orderminqty}}</span>
  26. <span style="color:#888;font-size: 14px;margin-left: 10px">增量:{{selectProduct.orderaddqty}}</span>
  27. </div>
  28. <p class="normal-margin">当前型号:&emsp;{{selectProduct.model}}</p>
  29. <div class="type">
  30. <div class="content normal-margin">
  31. <p class="inline-16">更多型号:</p>
  32. <el-tag class="inline-16" @click="typeClick(item)" v-for="(item,index) in detail" :key="index" size="small" :effect="selectProduct.itemno == item.itemno ? 'dark' : 'plain'">{{item.model}}
  33. </el-tag>
  34. <!-- <span style="color: #4f7bfd;width: 100px" @click="typeClick(item)" v-for="(item,index) in detail" :key="index">
  35. {{item.model}}
  36. </span>-->
  37. </div>
  38. </div>
  39. <!-- <div class="type">
  40. <div class="content normal-margin">
  41. <p class="inline-16">领域:</p>
  42. <el-tag class="inline-16" @click="actTradefield = item.tradefield" v-for="(item,index) in tradefield" :key="index" size="small" :effect="actTradefield === item.tradefield ? 'dark' : 'plain'">{{item.tradefield}}
  43. </el-tag>
  44. </div>
  45. </div>-->
  46. <el-button class="normal-margin" type="primary" style="width:200px" icon="el-icon-shopping-cart-full" @click="addCart">加入购物车</el-button>
  47. <div style="display:flex">
  48. <p>相关链接:&emsp;</p>
  49. <div>
  50. <div v-for="item in selectProduct.technicalinfo" :key="item.index">
  51. <a class="file-link" :href="item.url">{{item.document}}</a>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. </template>
  59. <script>
  60. export default {
  61. name: '',
  62. data () {
  63. return {
  64. detail: '',
  65. count: 1,
  66. selectProduct: '',
  67. actImage:{},
  68. tradefield:[],
  69. actTradefield:''
  70. };
  71. },
  72. computed: {
  73. },
  74. watch: {
  75. },
  76. created () {
  77. this.getDetail()
  78. },
  79. methods: {
  80. async getDetail () {
  81. let res = await this.$api.requested({
  82. "id": "20220926142403",
  83. "version": 1,
  84. "content": {
  85. "sa_itemgroupid": this.$route.query.id
  86. }
  87. })
  88. this.detail = res.data
  89. this.selectProduct = this.detail ? this.detail[0] : ''
  90. this.actImage = this.detail ? this.detail[0].attinfos[0] : {}
  91. console.log(this.actImage)
  92. this.tradefield = this.detail ? this.detail[0].tradefield : []
  93. this.actTradefield = this.detail[0].tradefield[0].tradefield
  94. console.log(this.actTradefield)
  95. console.log(this.actImage)
  96. },
  97. countChange (num) {
  98. this.count = num
  99. },
  100. typeClick (data) {
  101. this.selectProduct = data
  102. this.actImage = data.attinfos[0]
  103. this.actTradefield = data.tradefield[0].tradefield
  104. this.count = 1
  105. },
  106. async addCart () {
  107. let res = await this.$api.requested({
  108. "id": 20220924095102,
  109. "content": {
  110. "sa_brandid": this.$route.query.brandid, //品牌id
  111. "itemid": this.selectProduct.itemid, //货品id
  112. "qty": this.count, //数量
  113. "itemno": this.selectProduct.itemno, //货品编号
  114. "tradefield":this.actTradefield
  115. },
  116. })
  117. this.tool.showMessage(res)
  118. }
  119. },
  120. };
  121. </script>
  122. <style scoped>
  123. .product-detail{
  124. height: calc(100vh - 210px);
  125. width: 900px;
  126. }
  127. .productName{
  128. font-size: 1.75rem !important;
  129. color: #333 !important;
  130. }
  131. .line{
  132. border-bottom: 1px dashed #e3e5ea;
  133. }
  134. .border-left {
  135. border-left:1px solid #e3e5ea
  136. }
  137. .product-price {
  138. font-size: 1.25rem !important;
  139. color: red;
  140. }
  141. .product-itemno{
  142. font-size: 12px;
  143. color:#888;
  144. margin-bottom: 20px;
  145. }
  146. .text-throughline{
  147. font-size: 14px;
  148. text-decoration: line-through;
  149. color:#999
  150. }
  151. .product-detail p{
  152. font-size: 14px;
  153. color:#888 ;
  154. }
  155. .productName{
  156. font-size: 1.75rem !important;
  157. color: #333 !important;
  158. }
  159. .line{
  160. border-bottom: 1px dashed #e3e5ea;
  161. }
  162. .border-left {
  163. border-left:1px solid #e3e5ea
  164. }
  165. .product-price {
  166. font-size: 1.25rem !important;
  167. color: red;
  168. }
  169. .product-itemno{
  170. font-size: 12px;
  171. color:#888;
  172. margin-bottom: 20px;
  173. }
  174. .text-throughline{
  175. font-size: 14px;
  176. text-decoration: line-through;
  177. color:#999
  178. }
  179. .thumImage{
  180. width:100px;
  181. height:100px;
  182. margin-right:30px;
  183. border:1px solid #f1f2f3;
  184. cursor: pointer;
  185. }
  186. .column{
  187. flex-direction: row;
  188. }
  189. .act{
  190. border:1px solid #607d8b;
  191. }
  192. .file-link{
  193. font-size: 12px;
  194. margin-bottom:16px;
  195. color:#3848f6
  196. }
  197. .file-link a{
  198. text-decoration: none;
  199. margin-left:10px;
  200. color:#999
  201. }
  202. .file-link:hover{
  203. color:#4F7BFD;
  204. text-decoration: underline;
  205. }
  206. </style>