detail.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  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-hyt',
  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. background: #fff;
  99. min-height: calc(100vh - 80px);
  100. }
  101. .page-content {
  102. max-width: 760px;
  103. padding-bottom: 167px;
  104. .title {
  105. font-size: 24px;
  106. color: #282828;
  107. font-weight: bold;
  108. text-align: center;
  109. padding: 60px 0;
  110. }
  111. .row {
  112. display: flex;
  113. align-items: flex-start;
  114. margin: 32px 0;
  115. .col {
  116. font-size: 16px;
  117. }
  118. .label {
  119. color: #666666;
  120. min-width: 100px;
  121. }
  122. .content {
  123. color: #282828;
  124. .el-image {
  125. width: 106px;
  126. height: 106px;
  127. border: 1px solid #dcdcdc;
  128. margin-right: 4px;
  129. &:last-child {
  130. margin-right: 0;
  131. }
  132. }
  133. &.params-list {
  134. width: 100%;
  135. margin-top: -10px;
  136. .param {
  137. display: table-row;
  138. width: 100%;
  139. }
  140. .param-name,
  141. .param-content {
  142. display: table-cell;
  143. font-size: 16px;
  144. padding: 12px 0;
  145. &:nth-child(2n-1) {
  146. color: #999999;
  147. white-space: nowrap;
  148. }
  149. &:nth-child(2n) {
  150. color: #282828;
  151. padding-left: 12px;
  152. }
  153. &:nth-child(3) {
  154. padding-left: 100px;
  155. }
  156. }
  157. }
  158. }
  159. }
  160. }
  161. }
  162. @media screen and (max-width: 768px) {
  163. .page-content {
  164. padding: 0 7.2vw;
  165. .title {
  166. font-size: 4.6vw;
  167. color: #282828;
  168. font-weight: bold;
  169. text-align: center;
  170. padding: 8vw 0;
  171. }
  172. .row {
  173. display: flex;
  174. align-items: flex-start;
  175. margin-bottom: 5.6vw;
  176. &.block {
  177. display: block;
  178. .label {
  179. margin-bottom: 2.4vw;
  180. }
  181. }
  182. .col {
  183. font-size: 3.4vw;
  184. }
  185. .label {
  186. color: #666666;
  187. min-width: 20.4vw;
  188. }
  189. .content {
  190. color: #282828;
  191. .el-image {
  192. width: 26vw;
  193. height: 26vw;
  194. border: 0.1vw solid #dcdcdc;
  195. margin-right: 0.6vw;
  196. &:last-child {
  197. margin-right: 0;
  198. }
  199. }
  200. &.params-list {
  201. width: 100%;
  202. margin-top: -1vw;
  203. .param {
  204. display: table-row;
  205. width: 100%;
  206. }
  207. .param-name,
  208. .param-content {
  209. display: table-cell;
  210. font-size: 3.4vw;
  211. padding: 1.2vw 0;
  212. &:nth-child(2n-1) {
  213. color: #999999;
  214. white-space: nowrap;
  215. }
  216. &:nth-child(2n) {
  217. color: #282828;
  218. padding-left: 1.2vw;
  219. }
  220. &:nth-child(3) {
  221. padding-left: 100px;
  222. }
  223. }
  224. }
  225. }
  226. }
  227. }
  228. }
  229. </style>