工作291:当前账号是否绑定操作
生活随笔
收集整理的這篇文章主要介紹了
工作291:当前账号是否绑定操作
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
<template><el-dialog@open="open"title="綁定分發平臺賬號":visible.sync="dialogVisible"width="40%":before-close="handleClose"><el-form style="display: flex;justify-content: center;align-items: center"><el-form-item label="分發賬號名稱" label-width="100px"><el-select v-model="form.index" placeholder="選擇綁定的分發賬號"><!--||!RomoteData.includes(item.id --><el-option :disabled="!item.status||RomoteData.includes(item.id.toString())" v-for="(item,index) in BindData" :key="item.id" :label="item.account_name" :value="index"></el-option></el-select><p v-if="this.account!=''">你已經綁定賬號{{account}}</p><p v-else>當前賬號沒有綁定任何賬號</p></el-form-item></el-form><span slot="footer" class="dialog-footer"><el-button @click="dialogVisible = false">取 消</el-button><el-button type="primary" @click="dialog">確 定</el-button></span></el-dialog>
</template>
<script>
import {getAction, putAction} from "@/api";export default {data(){return{account_id: '',BindData: [],RomoteData:[],dialogVisible: false,ff_account_index: '',form:{},remote:0,account:'',}},methods:{/*綁定id邏輯分析*/handleClose() {},show(record){this.account=''this.dialogVisible = truegetAction("/account/"+record.id).then(res=>{console.log(res)this.remote=res.data.remote_account_idconsole.log(this.remote)})getAction("/account/ff_account_list",{content_type:record.content_type}).then(res => {this.account_id = record.idconsole.log(this.account_id)this.BindData = res.data.dataconsole.log(this.BindData)this.BindData.map((value,index)=>{if(value.id==this.remote){this.account=value.account_nameconsole.log(value.account_name)}/* if(value.id)*//* console.log(index)*/})console.log(this.RomoteData)this.RomoteData=res.data.remoteAccountIds})},open(){},dialog() {/*傳給當前的account_id進行接收*/putAction("/account/" + this.account_id + "/bind_ff_account_id", {remote_account_id: this.BindData[this.form.index].id,pavg: this.BindData[this.form.index].avatar_url,plugin_key: this.BindData[this.form.index].plugin_key,plugin_name: this.BindData[this.form.index].plugin_name,plugin_icon_url: this.BindData[this.form.index].plugin_icon_url,brand_id: this.BindData[this.form.index].brand_id}).then(res=>{this.$message.success("綁定成功")}).catch(error=>{this.$message.success("未綁定")})this.dialogVisible = false},}
}
</script>
<style></style>
總結
以上是生活随笔為你收集整理的工作291:当前账号是否绑定操作的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 什么是编解码器codec
- 下一篇: Allegro 使用技巧