<template>
    <view class="container">
        <view class="no-login" v-if="!hasLogin">
            <view class="c">
                <text>您还没有注册</text>
                <button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
                    <image class="wechat" src="/static/images/wechat.png"></image>
                    点击授权微信登录
                </button>
            </view>
        </view>
        <view class="login" v-else>
            <!--<view class="service-policy">
      <view class="item">30天无忧退货</view>
      <view class="item">48小时快速退款</view>
      <view class="item">满88元免邮费</view>
    </view>-->

            <view class="no-cart" v-if="cartGoods.length <= 0">
                <view class="c">
                    <image src="/static/static/images/cart.png" @tap="goIndex"></image>
                    <text>空空如也~</text>
                    <text>去添加点什么吧</text>
                </view>
            </view>
            <view class="cart-view" v-else>
                <view class="list">
                    <view class="group-item">
                        <view class="goods">
                            <!-- <view class="item {{isEditCart ? 'edit' : ''}}" wx:for="{{cartGoods}}" wx:key="id">
              <van-checkbox value="{{ item.checked }}" bind:change="checkedItem" data-item-index="{{index}}"></van-checkbox>
              <view class="cart-goods">
                <image class="img" src="{{item.picUrl}}"></image>
                <view class="info">
                  <view class="t">
                    <text class="name">{{item.goodsName}}</text>
                    <text class="num">x{{item.number}}</text>
                  </view>
                  <view class="attr">{{ isEditCart ? '已选择:' : ''}}{{item.specifications||''}}</view>
                  <view class="b">
                    <text class="price">￥{{item.price}}</text>
                    <view class="selnum">
                      <view class="cut" bindtap="cutNumber" data-item-index="{{index}}">-</view>
                      <input value="{{item.number}}" class="number" disabled="true" type="number" />
                      <view class="add" bindtap="addNumber" data-item-index="{{index}}">+</view>
                    </view>
                  </view>
                </view>
              </view>
            </view>-->

                            <view class="item edit" v-for="(item, index) in cartGoods" :key="index">
                                <van-checkbox :value="item.checked" @change="checkedItem($event, { itemIndex: index })" :data-item-index="index"></van-checkbox>

                                <view class="cart-goods">
                                    <image class="img" :src="item.picUrl"></image>
                                    <view class="info">
                                        <view class="t">
                                            <text class="name">{{ item.goodsName }}</text>
                                            <!-- <text class="num">x{{item.number}}</text> -->
                                        </view>
                                        <view class="attr">{{ item.specifications || '' }}</view>
                                        <view class="b">
                                            <text class="price">￥{{ item.price }}</text>
                                            <view class="selnum">
                                                <view class="cut" @tap="cutNumber" :data-item-index="index">-</view>
                                                <input :value="item.number" class="number" :disabled="true" type="number" />
                                                <view class="add" @tap="addNumber" :data-item-index="index">+</view>
                                            </view>
                                        </view>
                                    </view>
                                </view>
                            </view>
                        </view>
                    </view>
                </view>
                <view class="cart-bottom">
                    <van-checkbox :value="checkedAllStatus" @change="checkedAll">全选（{{ cartTotal.checkedGoodsCount }}）</van-checkbox>
                    <view class="total">合计：{{ '￥' + cartTotal.checkedGoodsAmount }}</view>
                    <view class="action_btn_area">
                        <!--<view class="{{!isEditCart ? 'edit' : 'sure'}}" bindtap="editCart">{{!isEditCart ? '编辑' : '完成'}}</view>
          <view class="delete" bindtap="deleteCart" wx:if="{{isEditCart}}">删除({{cartTotal.checkedGoodsCount}})</view>-->
                        <view class="checkout" @tap="checkoutOrder">结算</view>
                        <!-- </view> -->
                    </view>
                </view>
            </view>
        </view>
    </view>
</template>

<script>
var util = require('../../../utils/util.js');
var api = require('../../../config/api.js');
var user = require('../../../utils/user.js');
var app = getApp();
export default {
    data() {
        return {
            cartGoods: [],
            cartTotal: {
                goodsCount: 0,
                goodsAmount: 0,
                checkedGoodsCount: 0,
                checkedGoodsAmount: 0
            },
            isEditCart: false,
            checkedAllStatus: true,
            editCartList: [],
            hasLogin: false
        };
    },
    onLoad: function (options) {
        // 页面初始化 options为页面跳转所带来的参数
    },
    onReady: function () {
        // 页面渲染完成
    },
    onPullDownRefresh() {
        uni.showNavigationBarLoading(); //在标题栏中显示加载
        this.getCartList();
        uni.hideNavigationBarLoading(); //完成停止加载
        uni.stopPullDownRefresh(); //停止下拉刷新
    },
    onShow: function () {
        console.info(app.globalData.hasLogin);
        let that = this;
        if (app.globalData.hasLogin) {
            that.setData({
                hasLogin: app.globalData.hasLogin
            });
            that.getCartList();
        } else {
            app.globalData.checkLoginReadyCallback = (res) => {
                this.setData({
                    hasLogin: true
                });
                that.getCartList();
            };
        }
    },
    onHide: function () {
        // 页面隐藏
    },
    onUnload: function () {
        // 页面关闭
    },
    methods: {
        goIndex: function () {
            uni.switchTab({
                url: '/pages/index/index'
            });
        },

        getPhoneNumber: function (e) {
            let that = this;
            var ivObj = e.detail.iv;
            var telObj = e.detail.encryptedData;
            let r_userid = uni.getStorageSync('r_userid');
            if (r_userid == null || r_userid == '') {
                r_userid = 0;
            }
            //------执行Login---------
            uni.login({
                success: (res) => {
                    util.request(api.AuthRegister, {
                        code: res.code,
                        encryptedData: telObj,
                        iv: ivObj,
                        r_userid: r_userid
                    }).then(function (res) {
                        if (res.errno === 0) {
                            that.setData({
                                hasLogin: true
                            });
                            //存储用户信息
                            app.globalData.hasLogin = true;
                            uni.setStorageSync('userInfo', res.data.userInfo);
                            uni.setStorageSync('token', res.data.token);
                            uni.showToast({
                                title: '授权注册成功',
                                icon: 'success',
                                duration: 2000
                            });
                        }
                    });
                }
            });

            //-----------------是否授权，授权通过进入主页面，授权拒绝则停留在登陆界面
            if (e.detail.errMsg == 'getPhoneNumber:fail user deny') {
                //用户点击拒绝
                uni.showModal({
                    title: '警告',
                    content: '您点击了拒绝授权，部分功能无法使用!!!',
                    showCancel: false,
                    confirmText: '确定',
                    success: function (res) {
                        // 用户没有授权成功，不需要改变 isHide 的值
                        if (res.confirm) {
                            uni.switchTab({
                                url: '/pages/index/index'
                            });
                        }
                    }
                });
            }
        },

        getCartList: function () {
            let that = this;
            util.request(api.CartList).then(function (res) {
                if (res.errno === 0) {
                    that.setData({
                        cartGoods: res.data.cartList,
                        cartTotal: res.data.cartTotal
                    });
                    that.setData({
                        checkedAllStatus: that.isCheckedAll()
                    });
                    //显示购物车角标
                    if (res.data.cartTotal != null) {
                        uni.setStorageSync('cartcount', res.data.cartTotal.goodsCount);
                        user.cartshow();
                    }
                }
            });
        },

        isCheckedAll: function () {
            //判断购物车商品已全选
            return this.cartGoods.every(function (element, index, array) {
                if (element.checked == true) {
                    return true;
                } else {
                    return false;
                }
            });
        },

        doCheckedAll: function () {
            let checkedAll = this.isCheckedAll();
            this.setData({
                checkedAllStatus: this.isCheckedAll()
            });
        },

        checkedItem: function (event, _dataset) {
            /* ---处理dataset begin--- */
            this.handleDataset(event, _dataset);
            /* ---处理dataset end--- */
            let itemIndex = event.target.dataset.itemIndex;
            let that = this;
            let productIds = [];
            productIds.push(that.cartGoods[itemIndex].productId);
            if (!this.isEditCart) {
                util.request(
                    api.CartChecked,
                    {
                        productIds: productIds,
                        isChecked: that.cartGoods[itemIndex].checked ? 0 : 1
                    },
                    'POST'
                ).then(function (res) {
                    if (res.errno === 0) {
                        that.setData({
                            cartGoods: res.data.cartList,
                            cartTotal: res.data.cartTotal
                        });
                    }
                    that.setData({
                        checkedAllStatus: that.isCheckedAll()
                    });
                });
            } else {
                //编辑状态
                let tmpCartData = this.cartGoods.map(function (element, index, array) {
                    if (index == itemIndex) {
                        element.checked = !element.checked;
                    }
                    return element;
                });
                that.setData({
                    cartGoods: tmpCartData,
                    checkedAllStatus: that.isCheckedAll(),
                    'cartTotal.checkedGoodsCount': that.getCheckedGoodsCount()
                });
            }
        },

        getCheckedGoodsCount: function () {
            let checkedGoodsCount = 0;
            this.cartGoods.forEach(function (v) {
                if (v.checked === true) {
                    checkedGoodsCount += v.number;
                }
            });
            console.log(checkedGoodsCount);
            return checkedGoodsCount;
        },

        getCheckedGoodsAmount: function () {
            let checkedGoodsAmount = 0;
            this.cartGoods.forEach(function (v) {
                if (v.checked === true) {
                    checkedGoodsAmount += v.number * v.price;
                }
            });
            return checkedGoodsAmount.toFixed(2);
        },

        checkedAll: function () {
            let that = this;
            if (!this.isEditCart) {
                var productIds = this.cartGoods.map(function (v) {
                    return v.productId;
                });
                util.request(
                    api.CartChecked,
                    {
                        productIds: productIds,
                        isChecked: that.isCheckedAll() ? 0 : 1
                    },
                    'POST'
                ).then(function (res) {
                    if (res.errno === 0) {
                        console.log(res.data);
                        that.setData({
                            cartGoods: res.data.cartList,
                            cartTotal: res.data.cartTotal
                        });
                    }
                    that.setData({
                        checkedAllStatus: that.isCheckedAll()
                    });
                });
            } else {
                //编辑状态
                let checkedAllStatus = that.isCheckedAll();
                let tmpCartData = this.cartGoods.map(function (v) {
                    v.checked = !checkedAllStatus;
                    return v;
                });
                that.setData({
                    cartGoods: tmpCartData,
                    checkedAllStatus: that.isCheckedAll(),
                    'cartTotal.checkedGoodsCount': that.getCheckedGoodsCount()
                });
            }
        },

        editCart: function () {
            var that = this;
            if (this.isEditCart) {
                this.getCartList();
                this.setData({
                    isEditCart: !this.isEditCart
                });
            } else {
                //编辑状态
                let tmpCartList = this.cartGoods.map(function (v) {
                    v.checked = false;
                    return v;
                });
                this.setData({
                    editCartList: this.cartGoods,
                    cartGoods: tmpCartList,
                    isEditCart: !this.isEditCart,
                    checkedAllStatus: that.isCheckedAll(),
                    'cartTotal.checkedGoodsCount': that.getCheckedGoodsCount()
                });
            }
        },

        updateCart: function (productId, goodsId, number, id) {
            let that = this;
            util.request(
                api.CartUpdate,
                {
                    productId: productId,
                    goodsId: goodsId,
                    number: number,
                    id: id
                },
                'POST'
            ).then(function (res) {
                that.setData({
                    checkedAllStatus: that.isCheckedAll()
                });
            });
        },

        cutNumber: function (event) {
            let that = this;
            let itemIndex = event.target.dataset.itemIndex;
            let cartItem = this.cartGoods[itemIndex];
            //删除操作
            if (cartItem.number == 1) {
                uni.showModal({
                    title: '提醒',
                    content: '确定从购物车删除?',
                    success(res) {
                        if (res.confirm) {
                            that.deleteCartGoods([cartItem.productId]);
                        }
                    }
                });
            } else {
                let number = cartItem.number - 1 > 1 ? cartItem.number - 1 : 1;
                cartItem.number = number;
                this.setData({
                    cartGoods: this.cartGoods,
                    'cartTotal.checkedGoodsAmount': that.getCheckedGoodsAmount(),
                    'cartTotal.checkedGoodsCount': that.getCheckedGoodsCount()
                });
                this.updateCart(cartItem.productId, cartItem.goodsId, number, cartItem.id);
                //显示tab购物车
                user.cartadd(-1);
            }
        },

        addNumber: function (event) {
            let that = this;
            let itemIndex = event.target.dataset.itemIndex;
            let cartItem = this.cartGoods[itemIndex];
            console.log(cartItem);
            if (cartItem.goodsSn == '1036016') {
                uni.showToast({
                    title: '此款商品只能购买一个',
                    icon: 'none',
                    duration: 2000
                });
                var number = 1;
            } else {
                var number = cartItem.number + 1;
                //显示tab购物车
                user.cartadd(1);
            }
            cartItem.number = number;
            this.setData({
                cartGoods: this.cartGoods,
                'cartTotal.checkedGoodsAmount': that.getCheckedGoodsAmount(),
                'cartTotal.checkedGoodsCount': that.getCheckedGoodsCount()
            });
            this.updateCart(cartItem.productId, cartItem.goodsId, number, cartItem.id);
        },

        checkoutOrder: function () {
            //下单
            //获取已选择的商品
            let that = this;
            var checkedGoods = this.cartGoods.filter(function (element, index, array) {
                if (element.checked == true) {
                    return true;
                } else {
                    return false;
                }
            });
            if (checkedGoods.length <= 0) {
                return false;
            }

            // storage中设置了cartId，则是购物车购买
            try {
                uni.setStorageSync('cartId', 0);
                uni.navigateTo({
                    url: '/pages/checkout/checkout'
                });
            } catch (e) {
                console.log('CatchClause', e);
                console.log('CatchClause', e);
            }
        },

        deleteCart: function () {
            //获取已选择的商品
            let that = this;
            let productIds = this.cartGoods.filter(function (element, index, array) {
                if (element.checked == true) {
                    return true;
                } else {
                    return false;
                }
            });
            if (productIds.length <= 0) {
                return false;
            }
            productIds = productIds.map(function (element, index, array) {
                if (element.checked == true) {
                    return element.productId;
                }
            });
            util.request(
                api.CartDelete,
                {
                    productIds: productIds
                },
                'POST'
            ).then(function (res) {
                console.log(res);
                if (res.errno === 0) {
                    let cartList = res.data.cartList.map((v) => {
                        v.checked = false;
                        return v;
                    });
                    that.setData({
                        cartGoods: cartList,
                        cartTotal: res.data.cartTotal
                    });
                }
                that.setData({
                    checkedAllStatus: that.isCheckedAll()
                });
            });
        },

        deleteCartGoods: function (productIds) {
            //获取已选择的商品
            let that = this;
            console.log(productIds);
            util.request(
                api.CartDelete,
                {
                    productIds: productIds
                },
                'POST'
            ).then(function (res) {
                console.log(res.data);
                if (res.errno === 0) {
                    let cartList = res.data.cartList.map((v) => {
                        v.checked = false;
                        return v;
                    });
                    that.setData({
                        cartGoods: cartList,
                        cartTotal: res.data.cartTotal
                    });
                    user.cartadd(-1);
                    user.cartshow();
                }
                that.setData({
                    checkedAllStatus: that.isCheckedAll()
                });
            });
        }
    }
};
</script>
<style>
page {
    height: 100%;
    min-height: 100%;
    background: #f4f4f4;
}

.container {
    background: #f4f4f4;
    width: 100%;
    height: auto;
    min-height: 100%;
    overflow: hidden;
}

.service-policy {
    width: 750rpx;
    height: 73rpx;
    background: #f4f4f4;
    padding: 0 31.25rpx;
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    justify-content: space-between;
}

.service-policy .item {
    background-size: 10rpx;
    padding-left: 15rpx;
    display: flex;
    align-items: center;
    font-size: 25rpx;
    color: #666;
}

.no-login {
    width: 100%;
    height: auto;
    margin: 0 auto;
}

.no-login .c {
    width: 100%;
    height: auto;
    margin-top: 400rpx;
}

.no-login .c text {
    margin: 0 auto;
    display: block;
    width: 258rpx;
    height: 59rpx;
    line-height: 29rpx;
    text-align: center;
    font-size: 35rpx;
    color: #999;
}

.no-login button {
    width: 90%;
    margin: 0 auto;
    color: #fff;
    font-size: 30rpx;
    height: 96rpx;
    line-height: 96rpx;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    position: flex;
    bottom: 0;
    left: 0;
    border-radius: 0;
    padding: 0;
    margin-left: 5%;
    text-align: center;
    border-radius: 6rpx;
    letter-spacing: 3rpx;
    background-color: #242a48;
}

.wechat {
    width: 80rpx;
    height: 80rpx;
    margin-right: 15rpx;
}

.no-cart {
    width: 100%;
    height: auto;
    margin: 0 auto;
}

.no-cart .c {
    width: 100%;
    height: auto;
    margin-top: 400rpx;
    text-align: center;
}

.no-cart .c image {
    width: 120rpx;
    height: 120rpx;
}

.no-cart .c text {
    margin: 0 auto;
    display: block;
    width: 258rpx;
    height: 29rpx;
    line-height: 29rpx;
    text-align: center;
    font-size: 29rpx;
    color: #999;
}

.cart-view {
    width: 100%;
    height: auto;
    overflow: hidden;
}

.cart-view .list {
    height: auto;
    width: 100%;
    overflow: hidden;
    margin-bottom: 120rpx;
}

.cart-view .group-item {
    height: auto;
    width: 100%;
    background: #fff;
    margin-bottom: 18rpx;
}

.cart-view .item {
    height: 164rpx;
    width: 100%;
    overflow: hidden;
}

.cart-view .item .van-checkbox {
    float: left;
    margin: 65rpx 18rpx 65rpx 18rpx;
}

.cart-view .item .van-checkbox .van-icon {
    color: #fff;
}

.cart-view .item .cart-goods {
    float: left;
    height: 164rpx;
    width: 672rpx;
    border-bottom: 1px solid #f4f4f4;
}

.cart-view .item .img {
    float: left;
    height: 125rpx;
    width: 125rpx;
    background: #f4f4f4;
    margin: 19.5rpx 18rpx 19.5rpx 0;
}

.cart-view .item .info {
    float: left;
    height: 125rpx;
    width: 503rpx;
    margin: 19.5rpx 26rpx 19.5rpx 0;
}

.cart-view .item .t {
    margin: 8rpx 0;
    height: 28rpx;
    font-size: 25rpx;
    color: #333;
    overflow: hidden;
}

.cart-view .item .name {
    height: 28rpx;
    max-width: 310rpx;
    line-height: 28rpx;
    font-size: 25rpx;
    color: #333;
    overflow: hidden;
}

.cart-view .item .num {
    height: 28rpx;
    line-height: 28rpx;
    float: right;
}

.cart-view .item .attr {
    margin-bottom: 17rpx;
    height: 24rpx;
    line-height: 24rpx;
    font-size: 22rpx;
    color: #666;
    overflow: hidden;
}

.cart-view .item .b {
    height: 28rpx;
    line-height: 28rpx;
    font-size: 25rpx;
    color: #333;
    overflow: hidden;
}

.cart-view .item .price {
    float: left;
    color: #ab956d;
}

/*.cart-view .item.edit .t {
  display: none;
}*/

.cart-view .item.edit .attr {
    text-align: left;
    padding-right: 25rpx;
    background-size: 12rpx 20rpx;
    margin-bottom: 10rpx;
    height: 35rpx;
    line-height: 35rpx;
    font-size: 24rpx;
    color: #999;
    overflow: hidden;
}

.cart-view .item.edit .b {
    display: flex;
    height: 60rpx;
    overflow: hidden;
}

.cart-view .item.edit .price {
    line-height: 42rpx;
    height: 42rpx;
    flex: 1;
    color: #ab956d;
}

.cart-view .item.edit .selnum {
    width: 235rpx;
    height: 52rpx;
    border: 1rpx solid #ccc;
    display: flex;
    margin-bottom: 10rpx;
}

.selnum .cut {
    width: 70rpx;
    height: 100%;
    text-align: center;
    line-height: 50rpx;
}

.selnum .number {
    flex: 1;
    height: 100%;
    text-align: center;
    line-height: 50rpx;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
    float: left;
}

.selnum .add {
    width: 80rpx;
    height: 100%;
    text-align: center;
    line-height: 50rpx;
}

.cart-view .group-item .header {
    width: 100%;
    height: 94rpx;
    line-height: 94rpx;
    padding: 0 26rpx;
    border-bottom: 1px solid #f4f4f4;
}

.cart-view .promotion .icon {
    display: inline-block;
    height: 24rpx;
    width: 15rpx;
}

.cart-view .promotion {
    margin-top: 25.5rpx;
    float: left;
    height: 43rpx;
    width: 480rpx;
    /*margin-right: 84rpx;*/
    line-height: 43rpx;
    font-size: 0;
}

.cart-view .promotion .tag {
    border: 1px solid #f48f18;
    height: 37rpx;
    line-height: 31rpx;
    padding: 0 9rpx;
    margin-right: 10rpx;
    color: #f48f18;
    font-size: 24.5rpx;
}

.cart-view .promotion .txt {
    height: 43rpx;
    line-height: 43rpx;
    padding-right: 10rpx;
    color: #333;
    font-size: 29rpx;
    overflow: hidden;
}

.cart-view .get {
    margin-top: 18rpx;
    float: right;
    height: 58rpx;
    padding-left: 14rpx;
    border-left: 1px solid #d9d9d9;
    line-height: 58rpx;
    font-size: 29rpx;
    color: #333;
}

.cart-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    height: 100rpx;
    width: 100%;
    background: #fff;
    display: flex;
}

.cart-bottom .van-checkbox {
    float: left;
    margin: 33rpx 18rpx 33rpx 26rpx;
    font-size: 29rpx;
}

.cart-bottom .van-checkbox .van-icon {
    color: #fff;
}

.cart-bottom .total {
    height: 34rpx;
    flex: 1;
    margin: 33rpx 15rpx;
    font-size: 29rpx;
}

.cart-bottom .delete {
    text-align: center;
    width: 180rpx;
    height: 80rpx;
    line-height: 82rpx;
    padding: 0;
    margin: 0;
    margin-left: -5rpx;
    padding-right: 25rpx;
    font-size: 25rpx;
    color: #f4f4f4;
    /* text-align: center; */
    border-top-left-radius: 0rpx;
    border-bottom-left-radius: 0rpx;
    border-top-right-radius: 50rpx;
    border-bottom-right-radius: 50rpx;
    letter-spacing: 3rpx;
    background-image: linear-gradient(to right, #9a9ba1 0%, #ae8b9c 100%);
}

.cart-bottom .checkout {
    height: 100rpx;
    width: 100rpx;
    text-align: center;
    line-height: 100rpx;
    font-size: 29rpx;
    /*background: #b4282d;*/
    background: #242a48;
    color: #fff;
}

.action_btn_area {
    /* border: 1px solid #333; */
    position: absolute;
    display: inline;
    justify-content: center;
    align-items: center;
    right: 0;
    top: 0;
    /*width: 380rpx;
  height: 100rpx;  */
    display: inline;
}

.action_btn_area .edit {
    width: 140rpx;
    /* border: 1px solid #000; 
  height: 70rpx;
  line-height: 72rpx;
  padding: 0;
  margin: 0;
  margin-right: 5rpx;
  text-align: center;
  margin-left: 20rpx;
  /* padding-left: 25rpx; */
    font-size: 25rpx;
    color: #f4f4f4;
    border-top-left-radius: 50rpx;
    border-bottom-left-radius: 50rpx;
    border-top-right-radius: 50rpx;
    border-bottom-right-radius: 50rpx;
    letter-spacing: 3rpx;
    /* background-image: linear-gradient(to right, #ff7701 100%); */
    background-image: linear-gradient(to right, #ab956d 0%, #ab956d 100%);
}

.action_btn_area .checkout {
    width: 140rpx;
    height: 70rpx;
    line-height: 72rpx;
    padding: 0;
    margin: 0;
    margin-left: 5rpx;
    margin-right: 10rpx;
    margin-top: 15rpx;
    /*padding-right: 25rpx; */
    font-size: 25rpx;
    color: #f4f4f4;
    text-align: center;
    border-top-left-radius: 50rpx;
    border-bottom-left-radius: 50rpx;
    border-top-right-radius: 50rpx;
    border-bottom-right-radius: 50rpx;
    letter-spacing: 3rpx;
    background: #242a48;

    float: right;
}

.action_btn_area .delete {
    width: 140rpx;
    /* border: 1px solid #000; */
    height: 70rpx;
    line-height: 72rpx;
    padding: 0;
    margin: 0;
    margin-right: 5rpx;
    text-align: center;
    padding-left: -5rpx;
    font-size: 25rpx;
    color: #f4f4f4;
    border-top-left-radius: 50rpx;
    border-bottom-left-radius: 50rpx;
    border-top-right-radius: 50rpx;
    border-bottom-right-radius: 50rpx;
    letter-spacing: 3rpx;
    background-image: linear-gradient(to right, #9a9ba1 0%, #9a9ba1 100%);
}

.action_btn_area .sure {
    text-align: center;
    width: 140rpx;
    height: 80rpx;
    line-height: 82rpx;
    padding: 0;
    margin: 0;
    margin-right: 10rpx;
    padding-left: -5rpx;
    font-size: 25rpx;
    color: #f4f4f4;
    /* text-align: center; */
    border-top-left-radius: 50rpx;
    border-bottom-left-radius: 50rpx;
    border-top-right-radius: 50rpx;
    border-bottom-right-radius: 50rpx;
    letter-spacing: 3rpx;
    background-image: linear-gradient(to right, #ab956d 0%, #ab956d 100%);
    /* background-image: linear-gradient(to right, #ff7701 0%, #fe4800 100%); */
}

.auth_btn {
    position: fixed;
    top: 55vh;
    left: 10vw;
    width: 80vw;
    height: 96rpx;
    line-height: 96rpx;
    font-size: 25rpx;
    color: #f4f4f4;
    /* text-align: center; */
    border-top-left-radius: 50rpx;
    border-bottom-left-radius: 50rpx;
    border-top-right-radius: 50rpx;
    border-bottom-right-radius: 50rpx;
    letter-spacing: 3rpx;
    background-image: linear-gradient(to right, #8baaaa 0%, #9a9ba1 100%);
}
</style>
