<template>
    <view class="diag-form">
        <!-- pages/diagnosticEntry/diagnostic/addDiagnostic/customDiagnostics/customDiagnostics.wxml -->
        <mp-cells ext-class="my-cells">
            <mp-cell class="diag-form__cell">
                <view class="diag-form__row diag-form__row--full">
                    <view class="diag-form__label">当前选择：</view>
                    <radio-group class="diag-form__radio-group" @change="bindPickerChange">
                        <label v-for="(item, index) in objectArray" :key="item.id" class="diag-form__radio-item">
                            <radio :value="String(index)" :checked="selectIndex == index" :disabled="!canEdit" color="#1687ff" />
                            <text class="diag-form__radio-text">{{ item.name }}</text>
                        </label>
                    </radio-group>
                </view>
            </mp-cell>
            <view>
                <picker @change="bindPickerChange2" :value="diagTypeIndex" :range="diagType" range-key="descripts" :disabled="!canEdit">
                    <mp-cell class="diag-form__cell">
                        <view class="diag-form__line">
                            <view class="diag-form__label">诊断类型</view>
                            <view class="diag-form__picker">
                                {{ editDataClone.diagTypeDesc || diagType[diagTypeIndex].descripts || '请选择' }}
                            </view>
                        </view>
                    </mp-cell>
                </picker>
            </view>
            <mp-cell class="diag-form__cell" @tap.native="tapSelect" :disabled="!canEdit">
                <view class="diag-form__line">
                    <view class="diag-form__label diag-form__label--required">诊断名称</view>
                    <view class="diag-form__value">{{ searchData.diagDesc || editDataClone.diagDesc || '请选择' }}</view>
                </view>
            </mp-cell>
            <mp-cell class="diag-form__cell" v-if="searchData.diagCode || editDataClone.diagCode">
                <view class="diag-form__line">
                    <view class="diag-form__label">诊断编码</view>
                    <view class="diag-form__value diag-form__value--code">{{ searchData.diagCode || editDataClone.diagCode }}</view>
                </view>
            </mp-cell>
            <mp-cell class="diag-form__cell" data-cmark="Z" v-if="editDataClone.diagCMarkID == 'Y' || selectIndex == '1'" @tap.native="tapSelect($event, { cmark: 'Z' })">
                <view class="diag-form__line">
                    <view class="diag-form__label">证型</view>
                    <view class="diag-form__value">请选择</view>
                </view>
            </mp-cell>
            <mp-cell class="diag-form__cell" v-if="editDataClone.diagCMarkID == 'Y' || selectIndex == '1'" v-for="(item, index) in syndromeList" :key="index">
                <view class="diag-form__line">
                    <view class="diag-form__syndrome">{{ item.diagDesc }}</view>
                    <button v-if="canEdit" class="diag-form__remove" :data-id="index" @tap="deleteSyndrome">删除</button>
                </view>
            </mp-cell>
            <mp-cell class="diag-form__cell">
                <view class="diag-form__line">
                    <view class="diag-form__label">诊断注释</view>
                    <view class="diag-form__input-wrap">
                        <input :value="descripts" class="diag-form__input" :disabled="!canEdit" @input="descriptsFun" placeholder="请输入诊断注释" />
                    </view>
                </view>
            </mp-cell>
            <!-- <mp-cell class="fontS30">
    <view>发病日期</view>
    <view slot="footer">
      <picker data-field="date" mode="date" value="{{date}}" bindchange="bindDateChange">
        <view class="weui-input">{{date}}</view>
      </picker>
    </view>
  </mp-cell> -->
            <mp-cell class="diag-form__cell">
                <view class="diag-form__line">
                    <view class="diag-form__label">是否主诊断</view>
                    <switch class="diag-form__switch" :checked="mainDiagID == 'Y' || editDataClone.mainDiagID == 'Y'" :disabled="!canEdit" @change="switchChange" />
                </view>
            </mp-cell>
            <mp-cell class="diag-form__cell diag-form__cell--actions">
                <view class="diag-form__actions">
                    <button v-if="canEdit && !editDataClone.id" class="diag-form__action diag-form__action--plain" @tap="clearn">清空</button>
                    <button v-if="canEdit && editDataClone.id" class="diag-form__action diag-form__action--plain" @tap="cancel">取消</button>
                    <button v-if="canEdit" class="diag-form__action diag-form__action--primary" @tap="diagInsuFlagFun" :disabled="isLoading">
                        {{ editDataClone.id ? (isLoading ? '修改中' : '修改') : isLoading ? '保存中' : '保存' }}
                    </button>
                </view>
            </mp-cell>
        </mp-cells>

        <!-- <view class="multiBtn-content">
	<button class='multiBtn-left' bindtap="clearn" wx:if="{{!editData.id}}">清空</button>
	<button class='multiBtn-right' bindtap="diagInsuFlag" disabled="{{isLoading}}">{{editData.id?isLoading?"修改中":"修改":isLoading?"保存中":"保存"}}</button>
</view> -->
    </view>
</template>

<script>
import Cache from '../../../../../../../utils/cache';
// pages/diagnosticEntry/diagnostic/addDiagnostic/customDiagnostics/customDiagnostics.js
import { $http } from '../../../../../../../config/https';
import util from '../../../../../../../utils/util';
import messageUtil from '../../../../../../../utils/message.js';
export default {
    components: {},
    data() {
        return {
            diagInfo: {},

            // 患者数据（含 changeDataFlag，'N' 表示不可编辑）
            patientData: Cache.get('patientData') || {},

            //编辑诊断时使用
            date: util.formatTime(new Date()).split(' ')[0],

            //时间
            descripts: '',

            //诊断注释
            diagTypeIndex: 0,

            //诊断类型选中
            diagType: [
                {
                    id: "3",
                    code: "OPD",
                    descripts: "门诊诊断",
                    descriptsSPCode: "MZZD"
                },
                {
                    id: "1",
                    code: "PRE",
                    descripts: "初步诊断",
                    descriptsSPCode: "CBZD"
                },
                {
                    id: "2",
                    code: "SUS",
                    descripts: "拟诊断",
                    descriptsSPCode: "YSZD"
                }, 
            ],

            //诊断类型
            diagStatusIndex: 2,

            //诊断状态选中
            diagStatus: [],

            //诊断状态
            // diagCatIndex: 0,  //诊断类别选中
            // diagCat: [],  //诊断类别
            selectIndex: 0,

            //大类选中
            objectArray: [
                //大类类型
                {
                    id: 0,
                    name: '西医诊断'
                },
                {
                    id: 1,
                    name: '中医诊断'
                }
            ],

            mainDiagID: 'N',

            editDataClone: {
                diagTypeDesc: '',
                diagDesc: '',
                diagCMarkID: '',
                diagStatusDesc: '',
                mainDiagID: '',
                id: ''
            },

            searchData: {
                diagDesc: ''
            },

            syndromeList: [],

            //证型列表
            diagInsuFlag: 'N',

            isLoading: false,
            showRefusal: false,
            diagCat: '',
            editSyndromeListClone: []
        };
    },
    /**
     * 可以使用全局样式
     */
    options: {
        addGlobalClass: true
    },
    /**
     * 组件的属性列表
     */
    props: {
        editData: {
            type: Object,
            //类型
            default: () => ({}) //默认值
        },

        editSyndromeList: {
            type: Array,
            //类型
            default: () => [] //默认值
        },

        arryLength: String
    },
    computed: {
        // 是否可编辑：changeDataFlag 为 'N'（已结束/只读查看）时不可编辑
        canEdit() {
            return !this.patientData || this.patientData.changeDataFlag != 'N';
        }
    },
    mounted() {
        // 处理小程序 attached 生命周期
        this.attached();
        // 处理小程序 ready 生命周期
        this.$nextTick(() => this.ready());
    },
    destroyed: function () {
        // 在组件实例被从页面节点树移除时执行
    },
    /**
     * 组件的方法列表
     */
    methods: {
        handlePageShow() {
            // 兜底:页面 onShow 时若搜索页缓存仍在 (上层 searchSelect 调用链失败),
            // 主动取出并应用,确保选中诊断能带回并参与保存
            try {
                const cached = Cache.get('searchSelect');
                if (!cached || !cached.id) return;
                // 先清缓存再判断,避免主路径异步回调与本次重复处理
                Cache.remove('searchSelect');
                if (cached.CMark === 'Z') {
                    const list = this.syndromeList || [];
                    const dup = list.length && list[list.length - 1].diagID === cached.id;
                    if (!dup) this.searchSelect(cached);
                } else {
                    const current = this.searchData || {};
                    if (current.id !== cached.id) this.searchSelect(cached);
                }
            } catch (e) {}
        },

        ready: function () {
            // 在组件在视图层布局完成后执行
            this.selectData(); // 获取 下拉框数据
            this.applyEditData(this.editDataClone);
        },

        attached: function () {},

        // 获取选中的select数据
        searchSelect: function (selectData) {
            // console.log('selectData', selectData)
            // TODO 刷新数据方法
            // 获取 医嘱名称
            let searchSelect = selectData;
            if (this.editSyndromeList.length > 0) {
                this.setData({
                    syndromeList: this.editSyndromeList,
                    editSyndromeListClone: []
                });
            }
            if (searchSelect) {
                if (searchSelect.CMark && searchSelect.CMark == 'Z') {
                    let syndromeList = this.syndromeList;
                    let obj = {};
                    obj.diagCMark = '证型';
                    obj.diagCMarkID = 'Z';
                    obj.diagCode = searchSelect.code;
                    obj.diagDesc = searchSelect.desc;
                    obj.diagID = searchSelect.id;
                    syndromeList.push(obj);
                    this.setData(
                        {
                            syndromeList: syndromeList
                        },
                        () => {
                            Cache.remove('searchSelect');
                        }
                    );
                } else {
                    this.setData(
                        {
                            searchData: searchSelect
                        },
                        () => {
                            Cache.remove('searchSelect');
                        }
                    );
                }
            }
        },

        // 日期
        bindDateChange: function (e) {
            this.setData({
                date: e.detail.value
            });
        },

        bindPickerChange: function (e) {
            let { editDataClone: editData } = this;
            if (e.detail.value == 0) {
                editData.diagCMarkID = 'N';
                editData.diagCMark = '西医诊断';
            } else {
                editData.diagCMarkID = 'Y';
                editData.diagCMark = '中医诊断';
            }
            editData.diagDesc = '';
            editData.diagID = '';
            editData.ICDID = '';
            this.setData({
                selectIndex: e.detail.value,
                editDataClone: editData,
                searchData: {}
            });
        },

        bindPickerChange2: function (e) {
            let { editDataClone: editData, diagType } = this;
            let diagTypeObj = diagType[e.detail.value];
            editData.diagTypeID = diagTypeObj.id;
            editData.diagTypeCode = diagTypeObj.code;
            editData.diagTypeDesc = diagTypeObj.descripts;
            this.setData({
                diagTypeIndex: e.detail.value,
                editDataClone: editData
            });
        },

        bindPickerChange3: function (e) {
            return;
            let { editDataClone: editData, diagStatus } = this;
            let diagStatusObj = diagStatus[e.detail.value];
            editData.diagStatusID = diagStatusObj.id;
            editData.diagStatusDesc = diagStatusObj.descripts;
            this.setData({
                diagStatusIndex: e.detail.value,
                editDataClone: editData
            });
        },

        descriptsFun: function (e) {
            this.setData({
                descripts: e.detail.value
            });
        },

        // 诊断名称跳转select
        tapSelect: function (e, _dataset) {
            /* ---处理dataset begin--- */
            this.handleDataset(e, _dataset);
            /* ---处理dataset end--- */
            let cmark = e.currentTarget.dataset.cmark;
            let { selectIndex, searchData, editDataClone: editData } = this;
            if (!cmark) {
                if (selectIndex != 0) {
                    cmark = 'Y';
                } else {
                    cmark = 'N';
                }
            }
            let diagID = searchData.id || editData.diagID;
            if (cmark == 'Z' && !diagID) {
                uni.showToast({
                    title: '请先录入诊断,再添加证型',
                    icon: 'none'
                });
                return;
            }
            uni.navigateTo({
                //目的页面地址
                url: '/pages/components/searchSelect/searchSelect?code=03050031&CMark=' + cmark,
                success: function (res) {}
            });
        },

        switchChange: function (e) {
            let { editDataClone: editData } = this;
            if (e.detail.value) {
                editData.mainDiagID = 'Y';
                this.setData({
                    mainDiagID: 'Y',
                    editDataClone: editData
                });
            } else {
                editData.mainDiagID = 'N';
                this.setData({
                    mainDiagID: 'N',
                    editDataClone: editData
                });
            }
        },

        // 获取 下拉框数据
        selectData: function () {
            let patientData = Cache.get('patientData');
            let { admID } = patientData;
            $http.post('urlDeault', this, {
                code: '03050030',
                data: {
                    params: [
                        {
                            admID: admID
                        }
                    ]
                },
                success: function (res) {
                    let errorCode = res.errorCode;
                    if (errorCode === '0') {
                        let { selectIndex } = this;
                        let diagType = res.result.diagType;
                        if (res.result.diagClassDefID == 'Y') {
                            selectIndex = 1;
                        } else {
                            selectIndex = 0;
                        }
                        this.setData({
                            // diagType: res.result.diagType,
                            // //诊断类型
                            diagStatus: res.result.diagStatus,
                            //诊断状态
                            diagCat: res.result.diagCat,
                            //诊断类别
                            selectIndex: selectIndex
                        });
                    }
                }
            });
        },

        // clearn 清空
        clearn: function () {
            this.setData({
                date: util.formatTime(new Date()).split(' ')[0],
                //时间
                diagTypeIndex: 0,
                //诊断类型选中
                diagStatusIndex: 0,
                //诊断状态选中
                selectIndex: 0,
                //大类选中
                searchData: {},
                mainDiagID: 'N',
                descripts: ''
            });
        },

        cancel: function () {
            this.setData({
                isLoading: false,
                editDataClone: {},
                descripts: ''
            });
        },

        applyEditData: function (editData) {
            if (editData && editData.id) {
                let clone = { ...editData };
                clone.diagCMark = (clone.diagCMark || '') + '诊断';
                this.descripts = clone.descripts || '';
                this.date = clone.date || this.date;
                this.editDataClone = clone;
                this.selectIndex = (clone.diagCMark || '').includes('西医') ? 0 : 1;
                if (clone.diagTypeID) {
                    const index = this.diagType.findIndex(item => item.id == clone.diagTypeID);
                    this.diagTypeIndex = index >= 0 ? index : 0;
                } else {
                    this.diagTypeIndex = 0;
                }
            }
        },

        setEditData: function (editData) {
            this.applyEditData(editData);
        },

        listData: function () {
            this.setData({
                showRefusal: false
            });
        },

        // add 保存
        add: function () {
            let patientData = Cache.get('patientData');
            let userData = Cache.get('userData');
            let { admID } = patientData;
            let { userID, locID } = userData;
            let {
                selectIndex,
                diagTypeIndex,
                diagType,
                diagStatusIndex,
                diagStatus,
                descripts,
                mainDiagID,
                editDataClone: editData,
                searchData,
                date,
                syndromeList
            } = this;
            let diagData = [];
            let diagDataObj = {
                diagCMarkID: editData.diagCMarkID || (selectIndex == '0' ? 'N' : 'Y'),
                // 中西医诊断   中医传N  西医传Y
                mainDiagID: editData.mainDiagID || mainDiagID,
                // 中西医诊断   是否主诊断  是传Y  否传N  小程序原型中是否主诊断
                diagTypeID: editData.diagTypeID || diagType[diagTypeIndex].id,
                //诊断类型ID
                diagTypeCode: editData.diagTypeCode || diagType[diagTypeIndex].code,
                //诊断类型Code
                diagStatusID: editData.diagStatusID || diagStatus[diagStatusIndex].id,
                //诊断状态ID
                diagID: searchData.id || editData.diagID,
                //诊断ID
                ICDID: searchData.ICDID || editData.ICDID,
                //ICD诊断ID
                descripts: descripts,
                //诊断注释
                id: editData.id || '',
                onsetDate: date
            };
            diagData.push(diagDataObj);
            if (diagDataObj.diagCMarkID == 'Y') {
                syndromeList.map((item, index) => {
                    item.index = index;
                    diagData.push(item);
                });
            }
            let params = {
                params: [
                    {
                        admID: admID || '',
                        // 就诊ID session 中获取
                        userID: userID || '',
                        // 用户ID session 中获取
                        locID: locID || '',
                        // 科室ID session 中获取
                        diagData: diagData
                    }
                ]
            };
            $http.post('urlDeault', this, {
                code: '03050032',
                data: params,
                success: function (res) {
                    this.setData({
                        isLoading: false,
                        editDataClone: {},
                        descripts: '',
                        mainDiagID: 'N',
                        searchData: {},
                        diagStatusIndex: 2,
                        syndromeList: []
                    });
                    let errorCode = res.errorCode;
                    if (errorCode == '0') {
                        this.$emit('listData');
                        uni.showToast({
                            title: res.errorMessage,
                            icon: 'none'
                        });

                        // let pages = getCurrentPages(); //获取当前页面js里面的pages里的所有信息。
                        // let prevPage = pages[pages.length - 2];
                        // prevPage.setData({ // 将我们想要传递的参数在这里直接setData。上个页面就会执行这里的操作。
                        //   select: 1,
                        // }, () => {
                        //   wx.navigateBack({

                        //   })
                        // })
                    }
                },

                fail: function () {
                    this.setData({
                        isLoading: false
                    });
                }
            });
        },

        /**
         * 删除证型
         */
        deleteSyndrome: function (event) {
            let index = event.currentTarget.dataset.id;
            const userData = Cache.get('userData');
            let { syndromeList } = this;
            if (syndromeList[index].id) {
                $http.post('urlDeault', this, {
                    code: '03050037',
                    data: {
                        params: [
                            {
                                delData: [
                                    {
                                        id: syndromeList[index].id,
                                        diagCMarkID: 'Z'
                                    }
                                ],
                                userID: userData.userID
                            }
                        ]
                    },
                    success: function (res) {
                        let errorCode = res.errorCode;
                        if (errorCode === '0') {
                        }
                    }
                });
            }
            syndromeList.splice(index, 1);
            this.setData({
                syndromeList
            });
        },

        diagInsuFlagFun: function (e) {
            var that = this;
            this.setData({
                isLoading: true
            });
            if (this.arryLength == 0) {
                let patientData = Cache.get('patientData');
                let userData = Cache.get('userData');
                var { editDataClone: editData, searchData } = this;
                let params = {
                    params: [
                        {
                            admID: patientData.admID,
                            hospID: userData.hospID,
                            diagID: searchData.id || editData.diagID,
                            //诊断ID
                            ICDID: searchData.ICDID || editData.ICDID,
                            //ICD诊断ID
                            CMark: searchData.CMark || editData.diagCMarkID
                        }
                    ]
                };
                $http.post('urlDeault', this, {
                    code: '03100139',
                    data: params,
                    success: function (res) {
                        let errorCode = res.errorCode;
                        if (errorCode == '0') {
                            this.$emit('listData');
                            this.setData({
                                isLoading: false
                            });
                            if (res.result.reasonFlag == 'Y' && res.result.insuFlag == 'N') {
                                uni.showModal({
                                    content: res.result.insuDesc,
                                    success(res) {
                                        if (res.confirm) {
                                            that.add();
                                        } else if (res.cancel) {
                                        }
                                    }
                                });
                            } else {
                                that.add();
                            }
                        }
                    }
                });
            } else {
                that.add();
            }
        }
    },
    created: function () {},
    watch: {
        editData: {
            handler: function (newVal, oldVal) {
                this.editDataClone = newVal;
                if (newVal && newVal.id) {
                    this.applyEditData(newVal);
                }
            },

            immediate: true,
            deep: true
        },

        editSyndromeList: {
            handler: function (newVal, oldVal) {
                this.editSyndromeListClone = newVal;
            },

            immediate: true,
            deep: true
        }
    }
};
</script>
<style>
/* @import '../../../Entry.css'; */

.diag-form {
    margin: 0 4rpx 12rpx;
}

.my-cells {
    display: block;
    margin: 0;
    border-radius: 14rpx;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 6rpx 18rpx rgba(15, 23, 42, 0.04);
}

.diag-form .weui-cell {
    min-height: 88rpx;
    padding: 16rpx 24rpx;
    align-items: center;
    box-sizing: border-box;
}

.diag-form .weui-cell__bd {
    width: 100%;
    min-width: 0;
}

.diag-form .weui-cell__ft {
    display: none;
}

.diag-form .weui-cell__ft:after {
    display: none;
}

.diag-form .diag-form__cell:first-child .weui-cell__bd {
    width: 100%;
}

.diag-form .diag-form__cell--actions .weui-cell__bd {
    width: 100%;
}

.diag-form__cell {
    font-size: 28rpx !important;
    color: #1f2937;
}

.diag-form__row {
    width: 100%;
    min-height: 72rpx;
    display: flex;
    align-items: center;
}

.diag-form__row--full {
    justify-content: flex-start;
}

.diag-form__line {
    width: 100%;
    min-height: 72rpx;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.diag-form__label {
    flex: 0 0 40%;
    max-width: 40%;
    color: #1f2937;
    font-size: 28rpx;
    font-weight: 500;
    line-height: 42rpx;
    text-align: left;
    white-space: nowrap;
    box-sizing: border-box;
    padding-right: 20rpx;
}

.diag-form__label--required:before {
    content: "*";
    color: #f5222d;
    margin-right: 4rpx;
}

.diag-form__picker,
.diag-form__value {
    flex: 0 0 60%;
    max-width: 60%;
    color: #3f4a5a;
    min-height: 42rpx;
    line-height: 42rpx;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
    word-break: break-all;
}

.diag-form__value--code {
    color: #8b98a8;
    font-size: 24rpx;
}

.diag-form__picker {
    white-space: nowrap;
}

.diag-form__picker--left {
    flex: none;
    max-width: none;
    text-align: left;
    color: #1687ff;
    font-weight: 500;
}

.diag-form__radio-group {
    display: flex;
    align-items: center;
    gap: 24rpx;
}

.diag-form__radio-item {
    display: flex;
    align-items: center;
    gap: 6rpx;
}

.diag-form__radio-text {
    font-size: 28rpx;
    color: #1f2937;
}

.diag-form__value {
    display: block;
    white-space: normal;
}

.diag-form__syndrome {
    flex: 1;
    min-width: 0;
    color: #1f2937;
    font-size: 28rpx;
    line-height: 42rpx;
    word-break: break-all;
}

.diag-form__input-wrap {
    flex: 0 0 60%;
    max-width: 60%;
    min-height: 56rpx;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.diag-form__input {
    width: 100%;
    min-height: 56rpx;
    line-height: 56rpx;
    text-align: right;
    color: #3f4a5a;
    font-size: 28rpx;
}

.diag-form__switch {
    margin-left: auto;
    transform: scale(0.86);
    transform-origin: right center;
}

.diag-form__remove {
    height: 52rpx;
    line-height: 52rpx;
    border-radius: 999rpx;
    border: 1px solid #f5222d;
    color: #f5222d;
    background: #fff;
    font-size: 25rpx;
    padding: 0 18rpx;
}

.diag-form__cell--actions {
    padding-top: 8rpx;
}

.diag-form__actions {
    width: 100%;
    min-height: 76rpx;
    display: flex;
    align-items: center;
    gap: 14rpx;
    box-sizing: border-box;
}

.diag-form__action {
    flex: 1;
    height: 72rpx;
    line-height: 72rpx;
    border-radius: 12rpx !important;
    font-size: 30rpx;
    padding: 0;
    margin: 0;
    font-weight: normal;
}

.diag-form__action--plain {
    border: 1px solid #d8dee8;
    background: #fff;
    color: #1f2937;
}

.diag-form__action--primary {
    background-color: #1890ff;
    color: #ffffff;
    border: 0;
}

.diag-form__action:after,
.diag-form__remove:after {
    border: 0;
}

/* 历史遗留类名保留，避免未迁移的隐藏模板片段依赖 */
.btn {
    margin-left: 10rpx;
    width: 30% !important;
    display: inline-block;
    font-size: 35rpx;
    color: #fff;
    border: none;
    border-radius: 8rpx;
    font-weight: normal;
    padding: 0 10px !important;
    height: 80rpx !important;
    line-height: 80rpx !important;
    margin-top: 60rpx;
}

.clearnbtn {
    background: #fff;
    color: #000;
    border: 2rpx solid #eee;
    margin-right: 30rpx !important;
}

.addbtn {
    background: #1890ff;
    border: 2rpx solid #1890ff;
}

.custombutton {
    height: 80rpx;
    font-size: 30rpx;
    color: #fff;
    padding: 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 10px 10px;
    display: flex;
}

.custom-btnleft {
    flex: 1;
    margin: 0 10rpx;
    align-items: center;
    justify-content: center;
    display: flex;
}

.custom-btnright {
    flex: 1;
    margin: 0 10rpx;
    align-items: center;
    justify-content: center;
    display: flex;
    background-color: #1890ff;
    color: #fff;
}
</style>
