edit.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. <template>
  2. <div class="club-device page">
  3. <div class="page-top flex flex-col justify-center items-center">
  4. <img class="logo" :src="supplierInfo.logo" />
  5. <div class="name mt-2" v-text="supplierInfo.shopName + '认证记录'"></div>
  6. </div>
  7. <div class="page-content">
  8. <div class="page-title">设备认证</div>
  9. <el-form :model="formData" :rules="rules">
  10. <el-form-item label="设备名称:">
  11. <el-select
  12. v-model="formData.deviceName"
  13. filterable
  14. allow-create
  15. placeholder="请输入新设备名称或选择已有设备"
  16. >
  17. <el-option label="中国" :value="1"> </el-option>
  18. </el-select>
  19. </el-form-item>
  20. <el-form-item prop="mobile" label="设备图片:">
  21. <br />
  22. <el-input v-show="false"></el-input>
  23. <SimpleUploadImage :limit="1" />
  24. </el-form-item>
  25. <el-form-item label="所属品牌:">
  26. <el-select v-model="formData.deviceName" placeholder="请选择品牌">
  27. <el-option label="中国" :value="1"> </el-option>
  28. </el-select>
  29. </el-form-item>
  30. <el-form-item prop="mobile" label="购买渠道:">
  31. <el-input placeholder="请输入购买渠道"></el-input>
  32. </el-form-item>
  33. <el-form-item prop="mobile" label="发票:">
  34. <br />
  35. <el-input v-show="false"></el-input>
  36. <SimpleUploadImage :limit="1" />
  37. </el-form-item>
  38. <el-form-item prop="mobile" label="设备SN码:">
  39. <el-input placeholder="请输入设备SN码"></el-input>
  40. </el-form-item>
  41. <el-form-item prop="mobile" label="设备参数:">
  42. <br />
  43. <div class="device-param-list">
  44. <span class="add-param">添加参数</span>
  45. <template v-for="i in 3">
  46. <div :key="i">
  47. <div class="param flex justify-between mb-4">
  48. <el-input placeholder="例如:品牌" class="mr-2"></el-input>
  49. <el-input placeholder="请输入参数信息"></el-input>
  50. <span class="remove el-icon-close"></span>
  51. </div>
  52. </div>
  53. </template>
  54. </div>
  55. </el-form-item>
  56. </el-form>
  57. <div class="control flex flex-col items-center">
  58. <div class="button submit flex justify-center items-center">提交</div>
  59. </div>
  60. </div>
  61. </div>
  62. </template>
  63. <script>
  64. import SimpleUploadImage from '@/components/SimpleUploadImage'
  65. import { mapGetters } from 'vuex'
  66. export default {
  67. layout: 'app',
  68. components: {
  69. SimpleUploadImage,
  70. },
  71. data() {
  72. return {
  73. formData: {
  74. deviceName: '',
  75. },
  76. rules: {},
  77. }
  78. },
  79. computed: {
  80. ...mapGetters(['supplierInfo', 'authUserId', 'routePrefix']),
  81. },
  82. mounted() {
  83. this.initData()
  84. },
  85. methods: {
  86. initData() {
  87. this.productId = this.$route.query.id
  88. console.log('productId',this.productId)
  89. this.getProductDetails()
  90. },
  91. // 获取认证机构信息
  92. async getProductDetails() {
  93. try {
  94. const res = await this.$http.api.getProductDetails({
  95. productId: this.productId,
  96. })
  97. this.productInfo = res.data
  98. console.log('res',this.productInfo)
  99. } catch (error) {}
  100. },
  101. auditStatusColor(value) {// 认证状态:0 danger,1 success,2 warning
  102. const map = {
  103. 0: 'danger',
  104. 1: 'success',
  105. 2: 'warning',
  106. }
  107. return map[value]
  108. },
  109. }
  110. }
  111. </script>
  112. <style lang="scss" scoped>
  113. @media screen and (min-width: 768px) {
  114. .page {
  115. background: #fff;
  116. }
  117. .page-top {
  118. height: 360px;
  119. @include themify($themes) {
  120. background: themed('banner-club-register');
  121. background-size: auto 360px;
  122. }
  123. .logo {
  124. display: block;
  125. width: 120px;
  126. height: 120px;
  127. border-radius: 50%;
  128. background: #fff;
  129. }
  130. .name {
  131. font-size: 30px;
  132. color: #fff;
  133. }
  134. }
  135. .page-content {
  136. width: 700px;
  137. margin: 0 auto;
  138. overflow: hidden;
  139. min-height: calc(100vh - 80px - 80px - 360px);
  140. box-sizing: border-box;
  141. padding-bottom: 40px;
  142. .page-title {
  143. font-size: 24px;
  144. font-weight: bold;
  145. text-align: center;
  146. padding: 40px 0;
  147. }
  148. .el-select {
  149. width: 100%;
  150. }
  151. .control {
  152. margin-top: 62px;
  153. .button {
  154. width: 295px;
  155. height: 50px;
  156. cursor: pointer;
  157. &.submit {
  158. @include themify($themes) {
  159. background-color: themed('color');
  160. color: #fff;
  161. }
  162. }
  163. }
  164. }
  165. .device-param-list {
  166. position: relative;
  167. .add-param {
  168. position: absolute;
  169. cursor: pointer;
  170. top: -40px;
  171. right: 0;
  172. text-decoration: underline;
  173. font-size: 14px;
  174. @include themify($themes) {
  175. color: themed('color');
  176. }
  177. }
  178. .param {
  179. position: relative;
  180. .remove {
  181. position: absolute;
  182. right: 0;
  183. top: 0;
  184. width: 20px;
  185. height: 20px;
  186. background: #f94b4b;
  187. border-radius: 2px;
  188. cursor: pointer;
  189. color: #fff;
  190. font-size: 14px;
  191. text-align: center;
  192. line-height: 20px;
  193. }
  194. }
  195. }
  196. }
  197. }
  198. @media screen and (max-width: 768px) {
  199. .page {
  200. background: #fff;
  201. }
  202. .page-top {
  203. height: 46vw;
  204. @include themify($themes) {
  205. background: themed('banner-home-h5');
  206. background-size: auto 46vw;
  207. }
  208. .logo {
  209. display: block;
  210. width: 14.8vw;
  211. height: 14.8vw;
  212. border-radius: 50%;
  213. background: #fff;
  214. }
  215. .name {
  216. font-size: 4vw;
  217. color: #fff;
  218. }
  219. }
  220. .page-content {
  221. box-sizing: border-box;
  222. padding: 8vw 7vw;
  223. .page-title {
  224. font-size: 4.2vw;
  225. font-weight: bold;
  226. text-align: center;
  227. color: #282828;
  228. margin-bottom: 4.6vw;
  229. }
  230. .el-select {
  231. width: 100%;
  232. }
  233. .control {
  234. .button {
  235. width: 100%;
  236. height: 12vw;
  237. cursor: pointer;
  238. &.submit {
  239. @include themify($themes) {
  240. background-color: themed('color');
  241. color: #fff;
  242. }
  243. }
  244. }
  245. }
  246. .device-param-list {
  247. position: relative;
  248. .add-param {
  249. position: absolute;
  250. cursor: pointer;
  251. top: -40px;
  252. right: 0;
  253. font-size: 3.4vw;
  254. @include themify($themes) {
  255. color: themed('color');
  256. }
  257. }
  258. .param {
  259. position: relative;
  260. .remove {
  261. position: absolute;
  262. right: 0;
  263. top: 0;
  264. width: 4.4vw;
  265. height: 4.4vw;
  266. background: #f94b4b;
  267. border-radius: 0.2vw;
  268. cursor: pointer;
  269. color: #fff;
  270. font-size: 3.4vw;
  271. text-align: center;
  272. line-height: 4.4vw;
  273. }
  274. }
  275. }
  276. }
  277. }
  278. </style>