index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  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. computed:{
  75. isSign() {
  76. return this.userinfo["realname_re"] == 2 ? true : false;
  77. // return false
  78. },
  79. },
  80. methods: {
  81. show({ name, uid, avatar }) {
  82. this.name = name;
  83. this.uid = uid;
  84. this.avatar = avatar;
  85. this.bandId = "";
  86. this.certPic = [];
  87. this.formVisible = true;
  88. },
  89. async submit() {
  90. if (this.loading) {
  91. return;
  92. }
  93. // 实名认证 逻辑判断
  94. if(!this.isSign){
  95. this.$message.error("仅实名认证的用户可以申请");
  96. return;
  97. }
  98. if (this.bandId == "") {
  99. this.$message.error("请填写账户ID");
  100. return;
  101. }
  102. if (this.certPic.length == 0) {
  103. this.$message.error("请填写上传后台登录截图");
  104. return;
  105. }
  106. this.loading = true;
  107. let fileParams = this.certPic.map(item => item.url).join(",");
  108. let params = {
  109. type: 1,
  110. file: fileParams,
  111. account: this.bandId
  112. };
  113. let res = await this.$axios.$post("/uapi/enterprise/user_spider/add", {
  114. ...params
  115. });
  116. this.loading = false;
  117. if (Number(res.status) == 1) {
  118. this.$message.success("添加成功");
  119. this.formVisible = false;
  120. }
  121. }
  122. }
  123. };
  124. </script>
  125. <style lang="scss" scoped>
  126. .flex-center {
  127. display: flex;
  128. align-items: center;
  129. }
  130. .form-title {
  131. text-align: center;
  132. height: 20px;
  133. font-size: 18px;
  134. font-family: PingFangSC-Medium, PingFang SC;
  135. font-weight: 500;
  136. color: #0b121a;
  137. line-height: 20px;
  138. }
  139. .form-item {
  140. display: flex;
  141. margin-bottom: 14px;
  142. }
  143. .form-label {
  144. width: 120px;
  145. text-align: right;
  146. height: 21px;
  147. font-size: 15px;
  148. font-family: PingFangSC-Medium, PingFang SC;
  149. font-weight: 500;
  150. color: #000000;
  151. line-height: 21px;
  152. }
  153. .form-content {
  154. flex: 1;
  155. .name {
  156. font-size: 15px;
  157. font-family: PingFangSC-Regular, PingFang SC;
  158. font-weight: 400;
  159. color: #000000;
  160. }
  161. }
  162. .form-avatar {
  163. width: 24px;
  164. height: 24px;
  165. border-radius: 100%;
  166. background-repeat: no-repeat;
  167. background-position: center center;
  168. background-size: cover;
  169. margin-right: 10px;
  170. }
  171. .form-bind-area {
  172. display: flex;
  173. align-items: center;
  174. }
  175. .band-wechat-btn {
  176. width: 123px;
  177. height: 40px;
  178. background: #308eff;
  179. border-radius: 2px;
  180. line-height: 40px;
  181. text-align: center;
  182. font-size: 15px;
  183. font-family: PingFangSC-Medium, PingFang SC;
  184. font-weight: 500;
  185. color: #ffffff;
  186. margin-right: 16px;
  187. }
  188. .form-input {
  189. margin-right: 16px;
  190. }
  191. .form-bind-tips {
  192. margin-top: 16px;
  193. font-size: 13px;
  194. font-family: PingFangSC-Regular, PingFang SC;
  195. font-weight: 400;
  196. color: #0b121a;
  197. }
  198. .mt40 {
  199. margin-top: 52px;
  200. }
  201. .submit-btn {
  202. margin: 90px auto 30px;
  203. width: 188px;
  204. height: 46px;
  205. background: #308eff;
  206. border-radius: 2px;
  207. text-align: center;
  208. line-height: 46px;
  209. font-size: 16px;
  210. font-family: PingFangSC-Medium, PingFang SC;
  211. font-weight: 500;
  212. color: #ffffff;
  213. cursor: pointer;
  214. }
  215. </style>