index.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <template>
  2. <div>
  3. <el-dialog
  4. :visible.sync="formVisible"
  5. width="662px"
  6. :close-on-click-modal="false"
  7. :close-on-press-escape="false"
  8. :center="true"
  9. >
  10. <div class="form-title" slot="title">
  11. 申请绑定社交账号
  12. </div>
  13. <div class="form-main">
  14. <div class="form-item">
  15. <div class="form-label">申请人:</div>
  16. <div class="form-content flex-center">
  17. <span
  18. :style="{
  19. 'background-image': 'url(' + avatar + ')'
  20. }"
  21. class="form-avatar"
  22. ></span>
  23. <span class="name">{{ name }}</span>
  24. </div>
  25. </div>
  26. <div class="form-item">
  27. <div class="form-label">关联账户ID:</div>
  28. <div class="form-content">
  29. <div class="form-bind-area">
  30. <div class="band-wechat-btn">微信公众号</div>
  31. <div class="form-input">
  32. <el-input v-model="bandId" placeholder="账户ID"></el-input>
  33. </div>
  34. </div>
  35. <div class="form-bind-tips">
  36. 打开微信公众号后台>设置与开发>公开信息>微信号
  37. </div>
  38. </div>
  39. </div>
  40. <div class="form-item mt40">
  41. <div class="form-label">后台登录截图:</div>
  42. <div class="form-content">
  43. <multi-uploader
  44. v-model="certPic"
  45. :limit="9"
  46. tips="请上传JPG、PNG、JPEG格式图片,文件大小不超过1M"
  47. :file-size="1"
  48. ></multi-uploader>
  49. </div>
  50. </div>
  51. </div>
  52. <div class="submit-btn" @click="submit">提交申请</div>
  53. </el-dialog>
  54. </div>
  55. </template>
  56. <script>
  57. import multiUploader from "@/components/multi-uploader";
  58. export default {
  59. components: {
  60. multiUploader
  61. },
  62. data() {
  63. return {
  64. formVisible: false,
  65. uid: "",
  66. name: "",
  67. avatar:
  68. "https://inn.proginn.com/test/useralbum/10468/avatar104681620985269.jpg",
  69. bandId: "",
  70. certPic: [],
  71. loading: false
  72. };
  73. },
  74. methods: {
  75. show({ name, uid, avatar }) {
  76. this.name = name;
  77. this.uid = uid;
  78. this.avatar = avatar;
  79. this.bandId = "";
  80. this.certPic = [];
  81. this.formVisible = true;
  82. },
  83. async submit() {
  84. if (this.loading) {
  85. return;
  86. }
  87. if (this.bandId == "") {
  88. this.$message.error("请填写账户ID");
  89. return;
  90. }
  91. if (this.certPic.length == 0) {
  92. this.$message.error("请填写上传后台登录截图");
  93. return;
  94. }
  95. this.loading = true;
  96. let fileParams = this.certPic.map(item => item.url).join(",");
  97. let params = {
  98. type: 1,
  99. file: fileParams,
  100. account: this.bandId
  101. };
  102. let res = await this.$axios.$post("/uapi/enterprise/user_spider/add", {
  103. ...params
  104. });
  105. this.loading = false;
  106. if (Number(res.status) == 1) {
  107. this.$message.success("添加成功");
  108. this.formVisible = false;
  109. }
  110. }
  111. }
  112. };
  113. </script>
  114. <style lang="scss" scoped>
  115. .flex-center {
  116. display: flex;
  117. align-items: center;
  118. }
  119. .form-title {
  120. text-align: center;
  121. height: 20px;
  122. font-size: 18px;
  123. font-family: PingFangSC-Medium, PingFang SC;
  124. font-weight: 500;
  125. color: #0b121a;
  126. line-height: 20px;
  127. }
  128. .form-item {
  129. display: flex;
  130. margin-bottom: 14px;
  131. }
  132. .form-label {
  133. width: 120px;
  134. text-align: right;
  135. height: 21px;
  136. font-size: 15px;
  137. font-family: PingFangSC-Medium, PingFang SC;
  138. font-weight: 500;
  139. color: #000000;
  140. line-height: 21px;
  141. }
  142. .form-content {
  143. flex: 1;
  144. .name {
  145. font-size: 15px;
  146. font-family: PingFangSC-Regular, PingFang SC;
  147. font-weight: 400;
  148. color: #000000;
  149. }
  150. }
  151. .form-avatar {
  152. width: 24px;
  153. height: 24px;
  154. border-radius: 100%;
  155. background-repeat: no-repeat;
  156. background-position: center center;
  157. background-size: cover;
  158. margin-right: 10px;
  159. }
  160. .form-bind-area {
  161. display: flex;
  162. align-items: center;
  163. }
  164. .band-wechat-btn {
  165. width: 123px;
  166. height: 40px;
  167. background: #308eff;
  168. border-radius: 2px;
  169. line-height: 40px;
  170. text-align: center;
  171. font-size: 15px;
  172. font-family: PingFangSC-Medium, PingFang SC;
  173. font-weight: 500;
  174. color: #ffffff;
  175. margin-right: 16px;
  176. }
  177. .form-input {
  178. margin-right: 16px;
  179. }
  180. .form-bind-tips {
  181. margin-top: 16px;
  182. font-size: 13px;
  183. font-family: PingFangSC-Regular, PingFang SC;
  184. font-weight: 400;
  185. color: #0b121a;
  186. }
  187. .mt40 {
  188. margin-top: 52px;
  189. }
  190. .submit-btn {
  191. margin: 90px auto 30px;
  192. width: 188px;
  193. height: 46px;
  194. background: #308eff;
  195. border-radius: 2px;
  196. text-align: center;
  197. line-height: 46px;
  198. font-size: 16px;
  199. font-family: PingFangSC-Medium, PingFang SC;
  200. font-weight: 500;
  201. color: #ffffff;
  202. cursor: pointer;
  203. }
  204. </style>