detail.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <template>
  2. <div class="club-detail page">
  3. <div class="page-top"></div>
  4. <div class="page-content">
  5. <div class="title">设备认证信息</div>
  6. <div class="row">
  7. <div class="col label">设备名称:</div>
  8. <div class="col content">{{ productInfo.productName }}</div>
  9. </div>
  10. <div class="row block">
  11. <div class="col label">设备图片:</div>
  12. <div class="col content">
  13. <el-image
  14. v-if="productInfo.productImage"
  15. :src="productInfo.productImage"
  16. :preview-src-list="[productInfo.productImage]"
  17. ></el-image>
  18. <span v-else>暂无图片</span>
  19. </div>
  20. </div>
  21. <div class="row">
  22. <div class="col label">所属品牌:</div>
  23. <div class="col content">{{ productInfo.brandName }}</div>
  24. </div>
  25. <div class="row">
  26. <div class="col label">购买渠道:</div>
  27. <div class="col content">{{ productInfo.purchaseWay || '暂无' }}</div>
  28. </div>
  29. <div class="row block">
  30. <div class="col label">发票:</div>
  31. <div class="col content">
  32. <el-image
  33. v-if="productInfo.invoiceImage"
  34. :src="productInfo.invoiceImage"
  35. :preview-src-list="[productInfo.invoiceImage]"
  36. ></el-image>
  37. <span v-else>暂无图片</span>
  38. </div>
  39. </div>
  40. <div class="row">
  41. <div class="col label">设备SN码:</div>
  42. <div class="col content">{{ productInfo.snCode }}</div>
  43. </div>
  44. <div class="row">
  45. <div class="col label">设备参数:</div>
  46. <div class="col content params-list">
  47. <div
  48. class="param"
  49. v-for="param in productInfo.paramList"
  50. :key="param.productName"
  51. >
  52. <div class="param-name">{{ param.paramName }}</div>
  53. <div class="param-content">{{ param.paramContent }}</div>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. </template>
  60. <script>
  61. export default {
  62. layout: 'app-normal',
  63. data() {
  64. return {
  65. productInfo: {},
  66. }
  67. },
  68. created() {
  69. this.initData()
  70. },
  71. methods: {
  72. initData() {
  73. this.productId = this.$route.query.id
  74. this.relationId = this.$route.query.relationId
  75. this.getProductDetails()
  76. },
  77. // 获取认证机构信息
  78. async getProductDetails() {
  79. try {
  80. const res = await this.$http.api.getProductDetails({
  81. productId: this.productId,
  82. relationId: this.relationId,
  83. })
  84. this.productInfo = { ...this.productInfo, ...res.data }
  85. console.log('res', this.productInfo)
  86. } catch (error) {
  87. console.log(error)
  88. }
  89. },
  90. },
  91. }
  92. </script>
  93. <style lang="scss" scoped>
  94. @media screen and (min-width: 768px) {
  95. .page {
  96. display: flex;
  97. justify-content: center;
  98. }
  99. .page-content {
  100. max-width: 760px;
  101. padding-bottom: 167px;
  102. .title {
  103. font-size: 24px;
  104. color: #282828;
  105. font-weight: bold;
  106. text-align: center;
  107. padding: 60px 0;
  108. }
  109. .row {
  110. display: flex;
  111. align-items: flex-start;
  112. margin: 32px 0;
  113. .col {
  114. font-size: 16px;
  115. }
  116. .label {
  117. color: #666666;
  118. min-width: 100px;
  119. }
  120. .content {
  121. color: #282828;
  122. .el-image {
  123. width: 106px;
  124. height: 106px;
  125. border: 1px solid #dcdcdc;
  126. margin-right: 4px;
  127. &:last-child {
  128. margin-right: 0;
  129. }
  130. }
  131. &.params-list {
  132. width: 100%;
  133. margin-top: -10px;
  134. .param {
  135. display: table-row;
  136. width: 100%;
  137. }
  138. .param-name,
  139. .param-content {
  140. display: table-cell;
  141. font-size: 16px;
  142. padding: 12px 0;
  143. &:nth-child(2n-1) {
  144. color: #999999;
  145. white-space: nowrap;
  146. }
  147. &:nth-child(2n) {
  148. color: #282828;
  149. padding-left: 12px;
  150. }
  151. &:nth-child(3) {
  152. padding-left: 100px;
  153. }
  154. }
  155. }
  156. }
  157. }
  158. }
  159. }
  160. @media screen and (max-width: 768px) {
  161. .page-content {
  162. padding: 0 7.2vw;
  163. .title {
  164. font-size: 4.6vw;
  165. color: #282828;
  166. font-weight: bold;
  167. text-align: center;
  168. padding: 8vw 0;
  169. }
  170. .row {
  171. display: flex;
  172. align-items: flex-start;
  173. margin-bottom: 5.6vw;
  174. &.block {
  175. display: block;
  176. .label {
  177. margin-bottom: 2.4vw;
  178. }
  179. }
  180. .col {
  181. font-size: 3.4vw;
  182. }
  183. .label {
  184. color: #666666;
  185. min-width: 20.4vw;
  186. }
  187. .content {
  188. color: #282828;
  189. .el-image {
  190. width: 26vw;
  191. height: 26vw;
  192. border: 0.1vw solid #dcdcdc;
  193. margin-right: 0.6vw;
  194. &:last-child {
  195. margin-right: 0;
  196. }
  197. }
  198. &.params-list {
  199. width: 100%;
  200. margin-top: -1vw;
  201. .param {
  202. display: table-row;
  203. width: 100%;
  204. }
  205. .param-name,
  206. .param-content {
  207. display: table-cell;
  208. font-size: 3.4vw;
  209. padding: 1.2vw 0;
  210. &:nth-child(2n-1) {
  211. color: #999999;
  212. white-space: nowrap;
  213. }
  214. &:nth-child(2n) {
  215. color: #282828;
  216. padding-left: 1.2vw;
  217. }
  218. &:nth-child(3) {
  219. padding-left: 100px;
  220. }
  221. }
  222. }
  223. }
  224. }
  225. }
  226. }
  227. </style>