| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235 |
- <template>
- <div>
- <el-dialog
- :visible.sync="formVisible"
- width="662px"
- :close-on-click-modal="false"
- :close-on-press-escape="false"
- :center="true"
- >
- <div class="form-title" slot="title">
- 申请绑定社交账号
- </div>
- <div class="form-main">
- <div class="form-item">
- <div class="form-label">申请人:</div>
- <div class="form-content flex-center">
- <span
- :style="{
- 'background-image': 'url(' + avatar + ')'
- }"
- class="form-avatar"
- ></span>
- <span class="name">{{ name }}</span>
- </div>
- </div>
- <div class="form-item">
- <div class="form-label">关联账户ID:</div>
- <div class="form-content">
- <div class="form-bind-area">
- <div class="band-wechat-btn">微信公众号</div>
- <div class="form-input">
- <el-input v-model="bandId" placeholder="账户ID"></el-input>
- </div>
- </div>
- <div class="form-bind-tips">
- 打开微信公众号后台>设置与开发>公开信息>微信号
- </div>
- </div>
- </div>
- <div class="form-item mt40">
- <div class="form-label">后台登录截图:</div>
- <div class="form-content">
- <multi-uploader
- v-model="certPic"
- :limit="9"
- tips="请上传JPG、PNG、JPEG格式图片,文件大小不超过1M"
- :file-size="1"
- ></multi-uploader>
- </div>
- </div>
- </div>
- <div class="submit-btn" @click="submit">提交申请</div>
- </el-dialog>
- </div>
- </template>
- <script>
- import multiUploader from "@/components/multi-uploader";
- export default {
- components: {
- multiUploader
- },
- data() {
- return {
- formVisible: false,
- uid: "",
- name: "",
- avatar:
- "https://inn.proginn.com/test/useralbum/10468/avatar104681620985269.jpg",
- bandId: "",
- certPic: [],
- loading: false
- };
- },
- computed:{
- isSign() {
- return this.userinfo["realname_re"] == 2 ? true : false;
- // return false
- },
- },
- methods: {
- show({ name, uid, avatar }) {
- this.name = name;
- this.uid = uid;
- this.avatar = avatar;
- this.bandId = "";
- this.certPic = [];
- this.formVisible = true;
- },
- async submit() {
- if (this.loading) {
- return;
- }
- // 实名认证 逻辑判断
- if(!this.isSign){
- this.$message.error("仅实名认证的用户可以申请");
- return;
- }
- if (this.bandId == "") {
- this.$message.error("请填写账户ID");
- return;
- }
- if (this.certPic.length == 0) {
- this.$message.error("请填写上传后台登录截图");
- return;
- }
- this.loading = true;
- let fileParams = this.certPic.map(item => item.url).join(",");
- let params = {
- type: 1,
- file: fileParams,
- account: this.bandId
- };
- let res = await this.$axios.$post("/uapi/enterprise/user_spider/add", {
- ...params
- });
- this.loading = false;
- if (Number(res.status) == 1) {
- this.$message.success("添加成功");
- this.formVisible = false;
- }
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .flex-center {
- display: flex;
- align-items: center;
- }
- .form-title {
- text-align: center;
- height: 20px;
- font-size: 18px;
- font-family: PingFangSC-Medium, PingFang SC;
- font-weight: 500;
- color: #0b121a;
- line-height: 20px;
- }
- .form-item {
- display: flex;
- margin-bottom: 14px;
- }
- .form-label {
- width: 120px;
- text-align: right;
- height: 21px;
- font-size: 15px;
- font-family: PingFangSC-Medium, PingFang SC;
- font-weight: 500;
- color: #000000;
- line-height: 21px;
- }
- .form-content {
- flex: 1;
- .name {
- font-size: 15px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #000000;
- }
- }
- .form-avatar {
- width: 24px;
- height: 24px;
- border-radius: 100%;
- background-repeat: no-repeat;
- background-position: center center;
- background-size: cover;
- margin-right: 10px;
- }
- .form-bind-area {
- display: flex;
- align-items: center;
- }
- .band-wechat-btn {
- width: 123px;
- height: 40px;
- background: #308eff;
- border-radius: 2px;
- line-height: 40px;
- text-align: center;
- font-size: 15px;
- font-family: PingFangSC-Medium, PingFang SC;
- font-weight: 500;
- color: #ffffff;
- margin-right: 16px;
- }
- .form-input {
- margin-right: 16px;
- }
- .form-bind-tips {
- margin-top: 16px;
- font-size: 13px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #0b121a;
- }
- .mt40 {
- margin-top: 52px;
- }
- .submit-btn {
- margin: 90px auto 30px;
- width: 188px;
- height: 46px;
- background: #308eff;
- border-radius: 2px;
- text-align: center;
- line-height: 46px;
- font-size: 16px;
- font-family: PingFangSC-Medium, PingFang SC;
- font-weight: 500;
- color: #ffffff;
- cursor: pointer;
- }
- </style>
|