1
PC-20250623MANY\Administrator
2025-07-06 013e32fd5a7fe59fbe4e41e51e3084a45718348c
src/pages/newindex/components/huzhuan.vue
@@ -6,7 +6,7 @@
                    <div class="text item"
                        v-if="$store.state.productSetting.indexDisplay || $store.state.userInfo.accountType === 1">
                        <el-tabs v-model="activeName">
                            <el-tab-pane :label="$t('myzlb') + '(' + $store.state.userInfo.enableAmt + ')'" name="first">
                            <el-tab-pane :label="$t('myzlb') + '(' + useritem[1].symbol+useritem[1].availableBalance + ')'" name="first">
                                <div class="auth-box">
                                    <!-- <el-alert center :closable="false" style="width:400px;margin:10px auto;"
                                        title="当前股票账户可用余额" type="warning">
@@ -26,7 +26,7 @@
                                    </div>
                                </div>
                            </el-tab-pane>
                            <el-tab-pane :label="$t('lbzmy') + '(' + $store.state.userInfo.enableIndexAmt + ')'"
                            <el-tab-pane :label="$t('lbzmy') + '(' + useritem[3].symbol+useritem[3].availableBalance + ')'"
                                name="second">
                                <div class="auth-box">
                                    <!-- <el-alert center :closable="false" style="width:400px;margin:10px auto;"
@@ -62,6 +62,7 @@
        return {
            hasAuth: false,
            isloading: false,
            useritem:'',
            form: {
                account1: '',
                account2: '',
@@ -84,6 +85,13 @@
    methods: {
        getinit() {
            this.getUserInfo()
            this.getMoney()
        },
        async getMoney() {
          let data = await api.getMoney();
          if (data.status == 0) {
            this.useritem = data.data;
          }
        },
        async getUserInfo() {
            // 获取用户信息
@@ -107,11 +115,11 @@
        },
        selectAll1() {
            // 选择全部
            this.form.account1 = Math.floor(this.$store.state.userInfo.enableAmt)
            this.form.account1 = this.useritem[1].availableBalance
        },
        selectAll2() {
            // 选择全部
            this.form.account2 = Math.floor(this.$store.state.userInfo.enableIndexAmt)
            this.form.account2 = this.useritem[3].availableBalance
        },
        async getProductSetting() {
            let data = await api.getProductSetting()
@@ -124,11 +132,13 @@
            // 股票转指数
            let opt = {
                amt: type === 1 ? this.form.account1 : type === 2 ? this.form.account2 : type === 3 ? this.form.account3 : this.form.account4,
                type: type // 1 股票转指数 2 指数转股票
                fromType: this.type==1?'US':'IN', // 1 股票转指数 2 指数转股票
                toType: this.type==2?'IN':'US' // 1 股票转指数 2 指数转股票
            }
            let data = await api.AmtChange(opt)
            if (data.status === 0) {
                this.$message.success(data.msg)
                this.$message.success(this.$t('转换成功'))
                this.getMoney()
                this.getUserInfo()
            } else {
                this.$message.error(data.msg)