xuxy
2024-08-12 3ae92c6fa55922af770ebc8e9355c5c0255e69cd
update花店详情
已修改3个文件
177 ■■■■■ 文件已修改
sub_pages/customer/shop/shop-trade.vue 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sub_pages/customer/shop/shop.vue 108 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sub_pages/customer/trade/detail.vue 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sub_pages/customer/shop/shop-trade.vue
@@ -104,47 +104,7 @@
                    this.currentCategory = this.list[0] || {}
                }
            },
            async updateParamsAndSearch() {
                //todo 设置参数并查询
                await this.refreshList()
                this.$refs.popup_param.close()
            },
            openParamPop() {
                //todo 同时设置查询参数为空吧
                this.$refs.popup_param.open()
            },
            closeParamPop() {
                this.$refs.popup_param.close()
            },
            buttonSearchFlow() {
                if (this.type == 'category') {
                    //根据分类名称查询
                    this.$message.showLoading()
                    this.$http.request('get', '/api/customer/flower/category/tree', {
                        params: {
                            name: this.query.name || ''
                        }
                    }).then(res => {
                        var data = res.data
                        this.list = data || []
                        if (this.list.length > 0) {
                            this.query.categoryId = this.list[0].id || ''
                            this.currentCategory = this.list[0] || {}
                        } else {
                            this.query.categoryId = ''
                            this.currentCategory = {}
                        }
                    }).finally(() => {
                        this.$message.hideLoading()
                    })
                } else {
                    uni.navigateTo({
                        url: '/sub_pages/customer/trade/list?' + 'supplierName=' + this.query.name
                    })
                }
            },
            toDetailList(item) {
                //去商品列表页面
                console.log('toDetailList', this.supplierId)
@@ -155,6 +115,7 @@
            changeType(item) {
                this.query.categoryId = item.id || ''
                this.currentCategory = item
                //拼接二级分类,然后查询商品列表
            },
sub_pages/customer/shop/shop.vue
@@ -53,7 +53,7 @@
            </view>
        </view>
        <view class="brand-info">
            <view v-if="flg==='0'" class="brand-info-0">
            <view v-show="flg==='0'||flg==='1'" class="brand-info-0">
                <view class="search-container  flex"
                    style="padding-left: 20rpx;padding-right: 20rpx;padding-top: 20rpx">
                    <view class="flex1 input">
@@ -67,7 +67,7 @@
                        </u-input>
                    </view>
                </view>
                <view class="component-filter-container" style="padding-top: 12rpx;">
                <view class="component-filter-container" style="padding-top: 12rpx;" v-show="flg==='0'">
                    <view class="flex1" @click.stop="$refs.popup_column.open()">
                        排序{{ query.columnStr&&('-'+query.columnStr) || '' }}
                        <image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"></image>
@@ -77,10 +77,21 @@
                        <image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"></image>
                    </view>
                </view>
                <view class="top-title m-t-12">
                <view class="top-title m-t-12" v-show="flg==='0'">
                    报价已包含打包费、材料费、交易佣金
                </view>
                <view class="component-shop-item flex" v-for="(item,index) of list" :key="index">
                <no-data v-if="(!list||list.length==0)&&true" style="width: 100%;margin-top: 120rpx;"></no-data>
                <view class="flex m-t-12 flex-wrap-normal">
                <view class="type-list"  v-if="flg==='1'">
                    <view v-for="(item,index) of catgoryTree" @click="changeType(item)"
                        :class="[query.categoryRoot===item.id?'current':'']" :key="index" class="p10 flex type-item">
                        {{item.name || '-'}}
                    </view>
                </view>
                <view class="flex1">
                    <view class="component-shop-item flex" v-for="(item,index) of list" :key="index" :class="flg==='1'?'flg-category':''">
                    <view class="img" @click.stop="toDetail(item)">
                        <image class="img img100" :src="item.cover" lazy-load>
                        </image>
@@ -129,16 +140,15 @@
                        </view>
                    </view>
                </view>
                </view>
                </view>
            </view>
            <view v-show="flg==='1'" class="brand-info-1">
            <!-- <view v-show="flg==='1'" class="brand-info-1">
                <trade :hidefooter="true" :supplierId="id" :catgoryTree="catgoryTree" v-if="catgoryTree" ref="trade">
                </trade>
                <!-- // 构建一个分类树 -->
                <!-- catgoryTree -->
            </view>
             -->
            <view v-if="flg==='2'" class="brand-info-3">
                <view class="title">
                    基础信息
@@ -252,6 +262,7 @@
                    levelStr: '',
                    level: '',
                    name: '',
                    categoryRoot:'',
                },
                level_show: false,
                level_columns: [
@@ -399,7 +410,13 @@
            },
            async changeTab(flg) {
                console.log('changeTab', flg)
                if ('0' === ('' + flg)) {
                    //刷新list数据
                    this.query.categoryRoot = ''
                    this.refreshList('post')
                }
                if ('1' === ('' + flg)) {
                    this.list = []
                    if (!this.catgoryTree) {
                        this.$message.showLoading()
                        const {
@@ -416,17 +433,33 @@
                        if (code === 0) {
                            // data 分类树
                            this.catgoryTree = data || []
                            let tmp = this
                            this.$nextTick(() => {
                                tmp.$refs.trade.refInit(tmp.catgoryTree)
                            })
                            // let tmp = this
                            // this.$nextTick(() => {
                            //     tmp.$refs.trade.refInit(tmp.catgoryTree)
                            // })
                        }
                        this.$message.hideLoading()
                    }
                    //如果存在第一个分类,根据一级分类查询
                    if(this.catgoryTree.length>0){
                        this.query.categoryRoot =this.catgoryTree[0].id
                        //然后刷新
                        this.refreshList('post')
                    }
                }
                this.flg = '' + flg
                //如果没有加载数据,需要加载一下
            },
            changeType(item) {
                if(item.id!==this.query.categoryRoot){
                    this.query.categoryRoot = item.id || ''
                    this.refreshList('post')
                    //拼接二级分类,然后查询商品列表
                }
            },
            buttonSearchFlow() {
@@ -519,6 +552,55 @@
            height: calc(100vh - 450rpx);
            padding-top: 0rpx;
            .type-list {
                max-width: 140rpx;
                min-width: 140rpx;
                background: #EEF7F5;
                border-radius: 8rpx;
                min-height: calc(100vh - 600rpx);
                // max-height: calc(100vh - 600rpx);
                overflow-y: scroll;
                margin-right: 10rpx;
                .type-item {
                    text-align: center;
                    font-weight: 400;
                    font-size: 24rpx;
                    color: #000000;
                    display: block;
                    line-height: 60rpx;
                    // padding-left: 30rpx;
                    // padding-right: 30rpx;
                }
                .type-item.current {
                    font-weight: 600;
                    color: #04BA97;
                }
            }
            .flg-category.component-shop-item{
                .img{
                    width: 140rpx;
                    height: 140rpx;
                    margin-top: 10rpx;
                }
                .info-container{
                    .title {
                        margin-top: 0rpx;
                    }
                    .shop-name{
                    }
                    .other-info {
                        margin-bottom: 60rpx;
                    }
                    .bottom-buttons{
                            bottom: -50rpx;
                    }
                }
            }
            .brand-info-0 {
                .top-title {
                    height: 60rpx;
sub_pages/customer/trade/detail.vue
@@ -9,17 +9,25 @@
                    <swiper-item v-if="dto.video">
                        <video :src="dto.video" class="top-img" :auto-pause-if-navigate="true"
                            style="display: block;margin: 0 auto;"></video>
                        <view class="index-tag">
                            1/{{(dto.video&&1||0)+(dto.cover&&1||0)+(dto.bannerList&&dto.bannerList.length||0)}}
                        </view>
                    </swiper-item>
                    <swiper-item v-for="(url, index) in dto.bannerList" :key="index">
                        <image class="top-img" :lazy-load="true" mode="scaleToFill" @click="previewImg(url)"
                            :src="url">
                        <image class="top-img" :lazy-load="true" mode="scaleToFill" @click="previewImg(url)" :src="url">
                        </image>
                        <view class="index-tag">
                            {{index+1+(dto.video&&1)}}/{{(dto.video&&1||0)+(dto.cover&&1||0)+(dto.bannerList&&dto.bannerList.length||0)}}
                        </view>
                    </swiper-item>
                    <swiper-item>
                        <image :src="dto.cover" :lazy-load="true" @click="previewImg(dto.cover)" class="top-img" mode="scaleToFill">
                        <image :src="dto.cover" :lazy-load="true" @click="previewImg(dto.cover)" class="top-img"
                            mode="scaleToFill">
                        </image>
                        <view class="index-tag">
                            {{(dto.bannerList&&dto.bannerList.length||0)+1+(dto.video&&1||0)}}/{{(dto.video&&1||0)+(dto.cover&&1||0)+(dto.bannerList&&dto.bannerList.length||0)}}
                        </view>
                    </swiper-item>
@@ -529,6 +537,18 @@
            swiper-item {
                background-color: #fff;
                border-radius: 8rpx;
                position: relative;
                .index-tag{
                    position: absolute;
                    color: #fff;
                    font-size: 22rpx;
                    right: 10rpx;
                    bottom: 10rpx;
                    padding: 10rpx 20rpx;
                    text-align: center;
                    background-color: #545454;
                    border-radius: 30rpx;
                }
            }
        }