<template>
    <div class="page shop-cart-page" :class="{ page_red: theme === 1 }">
        <div class="couponName">
            <span>已选择：</span>{{ selectGoods.length }}个
            <a class="link" @click="qrCode">生成海报</a>
            <a class="link" @click="shareText">生成文字</a>
        </div>
        <div class="page__top">
            <div class="search">
                <i class="iconfont icontubiao- search__icon"></i>
                <input
                    class="search__text"
                    v-model="searchVal"
                    @confirm="search()"
                    type="text"
                    placeholder="搜索商品"
                />
                <i
                    class="iconfont iconclose_icon search__icon remove-icon"
                    @click="closeSearchVal"
                ></i>
            </div>
        </div>
        <div class="page__content">
            <div class="page__box">
                <scroll-view class="category" :scroll-y="true">
                    <ul class="category__list">
                        <li
                            class="category__item select-item"
                            :class="{
                                'category__item--active': viewSelect,
                            }"
                            @click="viewSelected"
                        >
                            已选择({{ selectGoods.length }})
                        </li>
                        <li
                            class="category__item"
                            :class="{
                                'category__item--active':
                                    categoryId === '' && !viewSelect,
                            }"
                            @click="setCategory('')"
                        >
                            全部
                        </li>
                        <li
                            class="category__item"
                            :class="{
                                'category__item--active':
                                    categoryId === item.id && !viewSelect,
                            }"
                            v-for="(item, index) in categoryList"
                            :key="index"
                            @click="setCategory(item)"
                        >
                            {{ item.abbreviation || item.name }}
                        </li>
                    </ul>
                </scroll-view>
                <div class="page__right">
                    <div class="category-sub" v-if="subCategoryList.length">
                        <div class="category-sub__main">
                            <scroll-view
                                class="category-sub__scroll"
                                :scroll-x="true"
                            >
                                <ul class="category-sub__list">
                                    <li
                                        class="category-sub__item"
                                        :class="{
                                            'category-sub__item--active':
                                                subCategoryId === '',
                                        }"
                                        @click="setSubCategory('')"
                                    >
                                        全部
                                    </li>
                                    <li
                                        class="category-sub__item"
                                        :class="{
                                            'category-sub__item--active':
                                                subCategoryId === item.id,
                                        }"
                                        v-for="(item, index) in subCategoryList"
                                        :key="index"
                                        @click="setSubCategory(item)"
                                    >
                                        {{ item.abbreviation || item.name }}
                                    </li>
                                </ul>
                            </scroll-view>
                        </div>
                        <i
                            class="iconfont iconyoujiantou category-sub__toggle"
                            :class="{ active: categoryAllVisible }"
                            @click="categoryToggle"
                        ></i>
                    </div>
                    <div class="category-sub-all" v-if="categoryAllVisible">
                        <div
                            class="category-sub-all__bg"
                            @click="categoryToggle"
                        ></div>
                        <scroll-view
                            class="category-sub-all__scroll"
                            :scroll-y="true"
                        >
                            <ul class="category-sub-all__list">
                                <li
                                    class="category-sub-all__item"
                                    @click="setSubCategory('')"
                                    :class="{
                                        'category-sub-all__item--active':
                                            subCategoryId === '',
                                    }"
                                >
                                    全部
                                </li>
                                <li
                                    class="category-sub-all__item"
                                    v-for="(item, index) in subCategoryList"
                                    :key="index"
                                    @click="setSubCategory(item)"
                                    :class="{
                                        'category-sub-all__item--active':
                                            subCategoryId === item.id,
                                    }"
                                >
                                    {{ item.name }}
                                </li>
                            </ul>
                        </scroll-view>
                    </div>
                    <div class="goods">
                        <scroll-view
                            class="goods__scroll"
                            :scroll-y="true"
                            @scrolltolower="getMoreGoods"
                            v-if="!viewSelect"
                        >
                            <ul class="menu">
                                <li
                                    class="menu__item"
                                    :class="{
                                        'menu__item--active':
                                            sort === 'SaleDesc',
                                    }"
                                    @click="setSort('SaleDesc')"
                                >
                                    <div class="menu__text">销量</div>
                                </li>
                                <li
                                    class="menu__item"
                                    :class="{
                                        'menu__item--active':
                                            sort === 'NewDesc',
                                    }"
                                    @click="setSort('NewDesc')"
                                >
                                    <div class="menu__text">新品</div>
                                </li>
                                <li
                                    class="menu__item"
                                    :class="{
                                        'menu__item--active':
                                            sort === 'Price' ||
                                            sort === 'PriceDesc',
                                    }"
                                    @click="setSort('Price')"
                                >
                                    <div class="menu__text">价格</div>
                                    <div
                                        class="menu__sort"
                                        :class="{
                                            'menu__sort--up': sort === 'Price',
                                            'menu__sort--down':
                                                sort === 'PriceDesc',
                                        }"
                                    ></div>
                                </li>
                            </ul>
                            <checkbox-group
                                class="goods__list"
                                @change="checkChange"
                            >
                                <label
                                    class="goods__item"
                                    v-for="(item, index) in goodsList"
                                    :key="index"
                                >
                                    <div class="main">
                                        <checkbox
                                            class="check"
                                            :value="item.id"
                                            :checked="checked(item.id)"
                                        />
                                        <my-image
                                            class="goods__img"
                                            :src="item.mainImage"
                                        ></my-image>
                                        <div class="goods__info">
                                            <div class="goods__box">
                                                <div class="goods__title">
                                                    {{ item.name }}
                                                </div>
                                                <div class="goods__sale">
                                                    <span
                                                        v-if="item.price"
                                                        class="new-price"
                                                    >
                                                        价格：￥{{
                                                            item.price / 100
                                                        }}
                                                    </span>

                                                    <span
                                                        class="dis-price"
                                                        v-if="item.tagPrice"
                                                    >
                                                        ￥{{
                                                            item.tagPrice / 100
                                                        }}
                                                    </span>
                                                </div>
                                                <div class="goods__sale">
                                                    <span v-if="item.stock">
                                                        库存：{{ item.stock }}
                                                    </span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </label>
                            </checkbox-group>
                            <div
                                class="more-text"
                                v-if="goodsList.length && !isHaveMore"
                            >
                                - 没有更多商品了 -
                            </div>
                            <div
                                class="null"
                                v-if="loading && !goodsList.length"
                            >
                                <img
                                    class="null__img"
                                    src="/static/common/goods_null.jpg"
                                    alt
                                />
                                <div class="null__title">
                                    抱歉！没有找到相关商品~
                                </div>
                            </div>
                        </scroll-view>
                        <div
                            class="goods__scroll goods__scroll-div"
                            v-if="viewSelect"
                        >
                            <checkbox-group
                                class="goods__list"
                                @change="checkChange"
                            >
                                <label
                                    class="goods__item"
                                    v-for="(item, index) in selectGoods"
                                    :key="index"
                                >
                                    <div class="main">
                                        <checkbox
                                            class="check"
                                            :value="item.id"
                                            :checked="checked(item.id)"
                                        />
                                        <my-image
                                            class="goods__img"
                                            :src="item.mainImage"
                                        ></my-image>
                                        <div class="goods__info">
                                            <div class="goods__box">
                                                <div class="goods__title">
                                                    {{ item.name }}
                                                </div>
                                                <div class="goods__sale">
                                                    <span
                                                        v-if="item.price"
                                                        class="new-price"
                                                    >
                                                        价格：￥{{
                                                            item.price / 100
                                                        }}
                                                    </span>

                                                    <span
                                                        class="dis-price"
                                                        v-if="item.tagPrice"
                                                    >
                                                        ￥{{
                                                            item.tagPrice / 100
                                                        }}
                                                    </span>
                                                </div>
                                                <div class="goods__sale">
                                                    <span v-if="item.stock">
                                                        库存：{{ item.stock }}
                                                    </span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </label>
                            </checkbox-group>
                            <div class="null" v-if="!selectGoods.length">
                                <img
                                    class="null__img"
                                    src="/static/common/goods_null.jpg"
                                    alt
                                />
                                <div class="null__title">
                                    抱歉！没有找到相关商品~
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div
            class="canvas"
            v-show="canvasShow"
            @touchmove.stop=""
            @click="closeCanvas"
        >
            <div class="canvas__content">
                <div class="canvas__close">
                    <img
                        class="canvas__img"
                        src="/static/live/close.png"
                        alt=""
                    />
                </div>
                <canvas
                    class="canvas__box"
                    canvas-id="canvas"
                    :style="{ height: canvasHeight }"
                    :disable-scroll="true"
                    @click.stop="viewImg()"
                ></canvas>
            </div>
        </div>
    </div>
</template>

<script>
import MyImage from "../../../components/image/index";
import config from "../../../common/js/config";
import posterFn from "../../../common/js/poster";
export default {
    name: "",
    components: { MyImage },
    // 数据
    data() {
        return {
            couponId: "",
            storeId: "",
            categoryId: "",
            categoryList: [],
            subCategoryId: "",
            subCategoryList: [],
            sort: "SaleDesc", // 排序
            page: 1, // 页码
            goodsList: [],
            isHaveMore: true, // 是否有更多数据
            loading: false, // 是否加载完成
            couponData: {},

            categoryAllVisible: false, // 分类全部显示
            // 选中
            viewSelect: false,
            selectGoods: [],
            selectIds: [],

            // 搜索
            searchVal: "",
            // 海报
            shopConfig: {},
            canvasShow: false,
            canvasImgPath: "",
            canvasHeight: 1000,
        };
    },

    onLoad(opts) {
        const self = this;
        this.getConfig();
        this.getCategory();
    },

    async onShow() {},

    onPullDownRefresh() {
        this.getCategory();
        this.getGoodsList();
    },

    // 函数
    methods: {
        getConfig() {
            this.api.get("/Shop/GetConfig").then((res) => {
                let data = JSON.parse(res.data);
                this.shopConfig = data;
            });
        },

        checked(id) {
            if (this.selectIds.indexOf(id) === -1) {
                return false;
            } else {
                return true;
            }
        },

        checkChange(e) {
            let arr = [];
            // if (this.selectGoods.length >= 8 && !this.viewSelect) {
            //     return this.fn.showToast("最多选择8个,请前往已选择页取消");
            // }

            // 当前页面选中id
            let productIds = e.detail.value;
            // 判断显示方式
            if (!this.viewSelect) {
                //当前页面没选中id
                let notSelectIds = [];
                for (let item of this.goodsList) {
                    if (productIds.indexOf(item.id) === -1) {
                        notSelectIds.push(item.id);
                    }
                }
                // 已经选择的但不在当前页面的加进去
                for (let id of this.selectIds) {
                    if (
                        notSelectIds.indexOf(id) === -1 &&
                        productIds.indexOf(id) === -1
                    ) {
                        productIds.push(id);
                    }
                }
                this.selectIds = productIds;

                // 当前页面选中的商品
                let goods = [];
                for (let item of this.goodsList) {
                    if (productIds.indexOf(item.id) !== -1) {
                        goods.push(item);
                    }
                }
                // 不在当前页面的选中商品
                for (let item of this.selectGoods) {
                    let flag = true;
                    for (let good of this.goodsList) {
                        if (good.id === item.id) {
                            flag = false;
                        }
                    }
                    if (flag) {
                        goods.push(item);
                    }
                }
                this.selectGoods = goods;
            } else {
                let ids = [];
                let goods = [];
                for (let item of this.selectGoods) {
                    if (productIds.indexOf(item.id) !== -1) {
                        ids.push(item.id);
                        goods.push(item);
                    }
                }
                this.selectIds = ids;
                this.selectGoods = goods;
            }
        },

        viewSelected() {
            this.viewSelect = true;
            this.categoryAllVisible = false;
            this.categoryId = "-1";
            this.goodsList = [];
            this.subCategoryList = [];
        },

        // 设置排序
        setSort(val) {
            const self = this;

            if (val === "Price") {
                self.sort = self.sort === "Price" ? "PriceDesc" : "Price";
            } else {
                self.sort = val;
            }

            self.getGoodsList();
        },

        // 获取商品分类
        getCategory() {
            const self = this;

            self.api
                .get("/Product/GetProductType", {
                    storeId: this.storeId,
                })
                .then((res) => {
                    if (res.data.length) {
                        self.categoryList = res.data;
                        for (let item of self.categoryList) {
                            if (item.name.length > 4) {
                                item.name = item.name.substr(0, 4) + "...";
                            }
                        }
                    }
                    this.getGoodsList();
                });
        },

        // 设置商品分类
        setCategory(val) {
            const self = this;
            this.categoryAllVisible = false;
            this.viewSelect = false;
            // this.searchVal = "";
            if (val === "") {
                // 仓库
                self.categoryId = "";
            } else {
                self.categoryId = val.id;
            }
        },

        // 设置商品二级分类
        setSubCategory(val) {
            const self = this;
            if (val === "") {
                self.subCategoryId = "";
            } else {
                self.subCategoryId = val.id;
            }

            self.getGoodsList();
        },

        // 获取商品列表
        getGoodsList() {
            const self = this;
            self.page = 1;
            let sendData = {
                storeId: this.storeId,
                sort: self.sort,
                pageIndex: self.page,
                pageSize: 20,
                type: self.subCategoryId || self.categoryId,
                status: this.typeStatus,
                keyword: this.searchVal || "",
            };

            uni.showLoading({
                title: "加载中...",
            });
            self.api.get("/Product/GetList", sendData).then((res) => {
                uni.hideLoading();
                uni.stopPullDownRefresh();
                if (res.data.data.length) {
                    self.page++;
                    self.isHaveMore = true;
                } else {
                    self.isHaveMore = false;
                }

                self.goodsList = res.data.data;
                self.loading = true;
                uni.hideLoading();
            });
        },

        // 获取更多商品
        getMoreGoods() {
            const self = this;
            if (!this.isHaveMore) {
                return;
            }
            let sendData = {
                storeId: this.storeId,
                sort: self.sort,
                pageIndex: self.page,
                pageSize: 20,
                type: self.subCategoryId || self.categoryId,
                status: this.typeStatus,
            };
            self.api.get("/Product/GetList", sendData).then((res) => {
                if (res.data.data.length) {
                    self.page++;
                } else {
                    self.isHaveMore = false;
                }

                self.goodsList = self.goodsList.concat(res.data.data);
            });
        },

        // 分类展开切换
        categoryToggle() {
            this.categoryAllVisible = !this.categoryAllVisible;
        },

        // 获取二级分类
        getSubCategory(id) {
            let flag = true;
            for (let item of this.categoryList) {
                if (item.id === id && item.children) {
                    flag = false;
                    this.subCategoryList = item.children;
                }
            }
            if (flag) {
                this.subCategoryList = [];
            }
            this.subCategoryId = "";
            this.getGoodsList();
        },

        // 搜索
        search() {
            if (this.searchVal) {
                // this.categoryId = "";
                // this.subCategoryId = "";
                // this.subCategoryList = [];
                this.getGoodsList();
            }
        },

        closeSearchVal() {
            this.searchVal = "";
            this.getGoodsList();
        },

        qrCode() {
            if (!this.selectGoods.length) {
                return this.fn.showToast("请先选择商品");
            }
            let appName = this.shopConfig.siteTitle;
            posterFn.sharePoster(
                this.selectGoods,
                this.shopConfig,
                this,
                this.user.storeId,
                appName
            );
        },
        // 关闭海报
        closeCanvas() {
            const self = this;
            self.canvasShow = false;
        },
        viewImg() {
            let self = this;
            //查看图片
            uni.previewImage({
                urls: [self.canvasImgPath],
                longPressActions: true,
            });
        },
        // 分享文字
        shareText() {
            if (!this.selectGoods.length) {
                return this.fn.showToast("请先选择商品");
            }
            let appName = this.shopConfig.siteTitle;
            posterFn.shareText(this.selectGoods, appName);
        },
    },

    // 数据计算
    computed: {
        // 判断主题  1:红色  2：绿色
        theme() {
            return this.$store.state.common.theme;
        },
        user() {
            return this.$store.state.user.user;
        },
    },

    // 数据监听
    watch: {
        categoryId(val) {
            const self = this;
            if (val !== "-1") {
                self.getSubCategory(val);
            }
        },
    },
};
</script>

<style>
page {
    height: 100%;
    background-color: #fff;
}
</style>

<style lang="scss" scoped>
.page {
    display: flex;
    flex-direction: column;
    height: 100%;

    &__top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: px(145);
        padding: 0 px(50);
        background-color: #fff;
        // box-shadow: 0 px(-5) px(10) #333;
    }

    &__content {
        position: relative;
        flex: 1;
        margin-top: px(5);
    }

    &__box {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1;
        display: flex;
        justify-content: space-between;
    }

    &__right {
        display: flex;
        flex-direction: column;
        flex: 1;
        position: relative;
    }
}

.search {
    display: flex;
    align-items: center;
    width: 100%;
    height: px(86);
    padding: 0 px(35);
    background-color: #f8f8f8;
    border-radius: px(43);

    &__icon {
        margin-top: px(10);
        font-size: px(60);
        color: #999;
    }

    &__text {
        margin-left: px(15);
        font-size: px(36);
        color: #999;
        width: 100%;
    }
}

.service {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    &__icon {
        font-size: px(50);
        color: #666;
    }

    &__text {
        font-size: px(30);
        color: #666;
    }
}

.category {
    width: px(225);
    height: 100%;
    background-color: #f8f6f7;

    &__item {
        position: relative;
        display: flex;
        justify-content: center;
        font-size: px(40);
        color: #888;
        background-color: #f8f6f7;
        padding: px(60) 0;

        &--active {
            // font-weight: 700;
            color: #333;
            background-color: #fff;
            &:before {
                content: "";
                position: absolute;
                top: 50%;
                left: 0;
                z-index: 1;
                display: block;
                width: px(8);
                height: 100%;
                transform: translateY(-50%);
                border-radius: px(4);
                background-color: #27a34f;
            }
        }
    }
}

.category-sub {
    position: relative;
    height: px(130);
    background-color: #fff;
    margin-right: px(140);
    margin-left: px(20);
    &__scroll {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1;
    }

    &__list {
        display: flex;
        align-items: center;
        height: 100%;
    }

    &__toggle {
        position: absolute;
        top: 0;
        right: px(-140);
        z-index: 2;
        width: px(140);
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: px(30);
        transform: rotate(90deg);
        &.active {
            transform: rotate(-90deg);
        }
    }

    &__item {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        flex: none;
        height: 100%;
        font-size: px(34);
        width: px(220);
        color: #333;
        height: px(70);
        border-radius: px(35);
        background-color: #f6f6f6;
        border: 1px solid #f6f6f6;
        color: #888;
        margin: 0 px(10);
        &--active {
            color: #262626;
            background-color: rgba(39, 163, 79, 0.2);
            border: 1px solid #27a34f;
            color: #27a34f;
        }
    }
}

.category-sub-all {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    z-index: 10;
    margin-top: px(130);
    &__bg {
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.3);
    }
    &__scroll {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10;
    }
    &__list {
        display: flex;
        flex-wrap: wrap;
        background-color: #fff;
        padding: px(60) px(40);
    }
    &__item {
        display: flex;
        align-items: center;
        justify-content: center;
        flex: none;
        height: 100%;
        font-size: px(34);
        width: px(220);
        color: #333;
        height: px(70);
        border-radius: px(35);
        background-color: #f6f6f6;
        border: 1px solid #f6f6f6;
        color: #888;
        margin: 0 px(20) px(30);
        flex-shrink: 0;
        &--active {
            color: #262626;
            background-color: rgba(39, 163, 79, 0.2);
            border: 1px solid #27a34f;
            color: #27a34f;
        }
    }
}

.goods {
    position: relative;
    flex: 1;
    border-top: 1px solid #f6f6f6;

    &__scroll {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1;
        background-color: #fff;
    }

    &__list {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        padding: px(35) 0 0 0;
        background-color: #fff;
        border-top: 1px solid #f6f6f6;
    }

    &__item {
        width: 100%;
        margin-bottom: px(60);
        border-bottom: 1px solid #f1f1f1;
    }
    .main {
        width: 100%;
        overflow: hidden;
        // border-radius: px(20) px(20) 0 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 px(35);
    }

    &__img {
        flex-shrink: 0;
        margin-right: px(30);
        /deep/ img {
            width: px(230);
            height: px(230);
        }
    }

    &__info {
        display: flex;
        justify-content: space-between;
        flex-direction: column;
        align-items: flex-start;
        position: relative;
        width: 100%;
        min-height: px(230);
    }

    &__box {
        width: 100%;
    }
    &__title {
        width: 100%;
        @include omits(2);
        max-height: px(88);
        line-height: px(44);
        margin-top: px(30);
        font-size: px(36);
        color: #333;
    }

    &__price {
        // margin-top: px(30);
    }
    &__sale {
        font-size: px(32);
        line-height: px(40);
        color: #999;
        margin-top: px(20);
        span ~ span {
            margin-left: px(20);
        }
    }

    &__present {
        font-size: px(36);
        color: #000;
        font-weight: 600;
    }

    &__original {
        position: relative;
        font-size: px(30);
        color: #999;
        margin-top: px(20);
        text-decoration: line-through;
        &:after {
            content: "";
            position: absolute;
            top: 50%;
            left: 0;
            z-index: 1;
            width: 100%;
            height: px(1);
            transform: translateY(-100%);
            background-color: #999;
        }
    }
    .btns {
        overflow: visible;
        // position: absolute;
        // bottom: 0;
        // right: 0;
        // z-index: 1;
        width: 100%;
        display: flex;
        align-items: center;
        max-width: 100%;
        border-top: 1px solid #f1f1f1;
        margin-top: px(20);
    }
    .btn {
        width: 25%;
        height: px(100);
        line-height: px(100);
        // background-color: #27a34f;
        color: #333;
        font-size: px(40);
        padding: 0 px(20);
        text-align: center;
        & ~ .btn {
            border-left: 1px solid #f1f1f1;
        }
    }
    .cart-num {
        // padding: px(30) px(10) px(10) px(30);
        padding: 0 px(30);
        box-sizing: border-box;
        min-width: px(60);
    }
    .num-input {
        overflow: visible;
        position: absolute;
        bottom: 0;
        right: 0;
        z-index: 1;
    }

    &__remove {
        background-color: #fff;
        width: px(60);
        height: px(60);
        border-radius: 50%;
        border: 1px solid #999;
        position: relative;
        &::after {
            content: "";
            position: absolute;
            top: 50%;
            left: 50%;
            z-index: 1;
            width: 60%;
            height: px(6);
            border-radius: px(6);
            background: #999;
            transform: translate(-50%, -50%);
        }
    }
}

.menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: px(110);
    margin-bottom: px(5);
    padding: 0 px(85);
    background-color: #fff;
    // box-shadow: 0 px(-5) px(10) #333;

    &__item {
        display: flex;
        align-items: center;
    }

    &__text {
        font-size: px(36);
        color: #888;
    }

    &__item--active &__text {
        color: #27a34f;
    }

    &__sort {
        margin-left: px(15);

        &:before {
            display: block;
            content: "";
            width: 0;
            height: 0;
            margin-bottom: px(10);
            border-width: px(12);
            border-style: solid;
            border-color: transparent transparent #ccc transparent;
        }

        &:after {
            display: block;
            content: "";
            width: 0;
            height: 0;
            border-width: px(12);
            border-style: solid;
            border-color: #ccc transparent transparent transparent;
        }

        &--up:before {
            border-color: transparent transparent #27a34f transparent;
        }

        &--down:after {
            border-color: #27a34f transparent transparent transparent;
        }
    }
}

.more-text {
    display: flex;
    justify-content: center;
    padding-bottom: px(60);
    font-size: px(34);
    color: #999;
}

.null {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-top: px(115);

    &__img {
        width: px(576);
        height: px(281);
    }

    &__title {
        margin-top: px(60);
        font-size: px(40);
        color: #666;
    }
}

.page_red {
    /deep/ {
        .category {
            &__item {
                &--active {
                    &:before {
                        background-color: #fe6661;
                    }
                }
            }
        }
        .category-sub {
            &__item {
                &--active {
                    background-color: rgba(254, 102, 97, 0.2);
                    border: 1px solid #fe6661;
                    color: #fe6661;
                }
            }
        }
        .category-sub-all {
            &__item {
                &--active {
                    color: #262626;
                    background-color: rgba(254, 102, 97, 0.2);
                    border: 1px solid #fe6661;
                    color: #fe6661;
                }
            }
        }
        .goods {
            &__add-text {
                background-color: #fe6661;
            }
            &__add {
                background-color: #fe6661;
                box-shadow: px(1) px(2) px(6) #fe6661;
            }
        }

        .menu {
            .menu__item--active .menu__text {
                color: #fe6661;
            }

            &__sort {
                &--up:before {
                    border-color: transparent transparent #fe6661 transparent;
                }

                &--down:after {
                    border-color: #fe6661 transparent transparent transparent;
                }
            }
        }
    }
}
.switch {
    transform: scale(0.7);
}
.remove-icon {
    padding-left: px(20);
}

.check {
    transform: scale(0.8, 0.8);
}
.select-item {
    background-color: #f9f9f9;
    // color: #333;
    // font-size: px(44);
    border-bottom: 2px solid #e9e9e9;
}
.couponName {
    padding: px(35);
    border-bottom: 1px solid #f1f1f1;
    span {
        color: #666;
    }
}
.check-all {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: px(100);
    font-size: px(40);
    padding: 0 px(35);
    border-bottom: 2px solid #f1f1f1;
    .text {
        width: 100%;
    }
}
.goods__scroll-div {
    overflow: auto;
}
.link {
    margin-left: px(30);
    display: inline-block;
    color: #4395ff;
}
.canvas {
    position: fixed;
    top: -1000%;
    left: -1000%;
    z-index: -11;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    &__content {
        position: relative;
        width: 100%;
        height: 100%;
        padding: px(200) px(80) 0;
        z-index: 10;
    }

    &__close {
        position: absolute;
        top: px(50);
        right: px(120);
        z-index: 1;
        display: flex;
        justify-content: center;
        align-items: center;
        width: px(100);
        height: px(100);
        border-radius: 50%;
        border: solid px(3) #fff;

        &:after {
            content: "";
            position: absolute;
            top: px(100);
            left: 50%;
            z-index: 1;
            display: block;
            width: px(3);
            height: px(50);
            transform: translateX(-50%);
            background-color: #fff;
        }
    }

    &__img {
        width: px(60);
        height: px(60);
    }

    &__box {
        width: 750px;
        height: 1328px;
        background-color: #fff;
    }
}
.dis-price {
    text-decoration: line-through;
}
.new-price {
    color: #666;
}
</style>