陶杰
2024-09-11 3d90d9a71858bea619944ce081632581f0f93644
Merge remote-tracking branch 'origin/master-2.0' into master-2.0

# Conflicts:
# pages/home/components/home-search.vue
已修改7个文件
349 ■■■■ 文件已修改
common/global.scss 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/home/home.vue 289 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
plugins/http.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
sub_pages/customer/coupon/good-self.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sub_pages/customer/shop/shop.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sub_pages/customer/shopping/confirm.vue 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sub_pages/customer/trade/trade.vue 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
common/global.scss
@@ -246,6 +246,10 @@
    position: relative;
}
.component-status-zero{
    position: relative;
}
.component-status-zero::after{
    position: absolute;
    line-height: 100%;
    // font-size: ;
pages/home/home.vue
@@ -197,167 +197,160 @@
                this.$refs.home_top_flow.fun_GetMore()
            }
        },
        onPullDownRefresh() {
          // 下拉刷新方法
          this.init()
        },
        onLoad(options) {
            this.init()
        },
        methods: {
            init(){
                // if(options.partnerUserId){
                //     //需要前往注册了
                //     uni.navigateTo({
                //         url: '/pages/login/supplier-login'
                //     })
                // }
                // console.log('home created')
                //这里进行一次初始化即可
                // this.$http.request('get', '/api/school/area/list', {
                // }).then(res => {
                //     if (res.code == 0) {
                //         this.schools = res.data || []
                //     }
                // })
                // uni.navigateTo({
                //     url: '/sub_pages/customer/trade/detail'
                // })
                //获取banner图
                this.$http.request('get', '/api/pub/banner/list', {}).then(res => {
                    if (res.code == 0) {
                        this.banners = []
                        var tarr = res.data || []
                        if (tarr.length == 0) {
                            // tarr.push({
                            //     url: 'https://hmy-flower.oss-cn-shanghai.aliyuncs.com/62/62ddac6297104e369aba646be704064dbanner@2x.png'
                            // })
                            this.banners = tarr
                        } else {
                            var result = []
                            for (var item of tarr) {
                                // http://106.14.123.210/files/group1/e8/e1c17f7229514e5da211d8d47b09906b.jpeg
                                try {
                                    if (item.url) {
                                        var t = JSON.parse(item.url)
                                        if (Array.isArray(t)) {
                                            // item.url = t[0] || ''
                                            for (var url of t) {
                                                result.push({
                                                    ...item,
                                                    url: url || ''
                                                })
                                            }
                                        } else {
                                            // item.url = t.url || ''
            // if(options.partnerUserId){
            //     //需要前往注册了
            //     uni.navigateTo({
            //         url: '/pages/login/supplier-login'
            //     })
            // }
            // console.log('home created')
            //这里进行一次初始化即可
            // this.$http.request('get', '/api/school/area/list', {
            // }).then(res => {
            //     if (res.code == 0) {
            //         this.schools = res.data || []
            //     }
            // })
            // uni.navigateTo({
            //     url: '/sub_pages/customer/trade/detail'
            // })
            //获取banner图
            this.$http.request('get', '/api/pub/banner/list', {}).then(res => {
                if (res.code == 0) {
                    this.banners = []
                    var tarr = res.data || []
                    if (tarr.length == 0) {
                        // tarr.push({
                        //     url: 'https://hmy-flower.oss-cn-shanghai.aliyuncs.com/62/62ddac6297104e369aba646be704064dbanner@2x.png'
                        // })
                        this.banners = tarr
                    } else {
                        var result = []
                        for (var item of tarr) {
                            // http://106.14.123.210/files/group1/e8/e1c17f7229514e5da211d8d47b09906b.jpeg
                            try {
                                if (item.url) {
                                    var t = JSON.parse(item.url)
                                    if (Array.isArray(t)) {
                                        // item.url = t[0] || ''
                                        for (var url of t) {
                                            result.push({
                                                ...item,
                                                url: t.url || ''
                                                url: url || ''
                                            })
                                        }
                                    } else {
                                        // item.url = t.url || ''
                                        result.push({
                                            ...item,
                                            url: t.url || ''
                                        })
                                    }
                                } catch (e) {
                                    // console.log('error',e)
                                }
                            } catch (e) {
                                // console.log('error',e)
                            }
                            this.banners = result
                        }
                        console.log('this.banners', this.banners)
                        this.banners = result
                    }
                })
                var areaIndex = uni.getStorageSync('areaIndex')
                if (!areaIndex && areaIndex !== 0) {
                } else {
                    this.areaIndex = areaIndex
                    console.log('this.banners', this.banners)
                }
                //如果已经登录,加载一下默认地址
                let that = this
                setTimeout(() => {
                    if (that.currentInfo.id && !that.address.id) {
                        that.$http.request('get', '/api/address/default/detail').then(res => {
                            if (res.data) {
                                that.$store.commit('setDefaultAddress', {
                                    ...res.data
                                })
                            }
                        })
                    }
                }, 2000)
                //公告
                var type = ''
                // #ifdef PUB_CUSTOMER
                type = 'customer'
                // #endif
                // #ifdef PUB_SUPPLIER
                type = 'supplier'
                // #endif
                // #ifdef PUB_PARTNER
                type = 'partner'
                // #endif
                this.$http.request('get', '/api/pub/announcement/list/' + type, {
                    params: {
                        size: 5,
                        status: 'A'
                    }
                }).then(res => {
                    if (res.code === 0) {
                        // (res.data && res.data.records || [])
                        this.noticeList = res.data || []
                        console.log('this.noticeList', this.noticeList)
                        if (this.noticeList.length > 0) {
                            this.currentNotice = this.noticeList[0]
                            if (this.currentNotice.title && this.currentNotice.title.length >= 30) {
                                this.scrollable = true
                            } else {
                                this.scrollable = false
                            }
                            let that = this
                            if (this.noticeList.length >= 1) {
                                setInterval(() => {
                                    console.log('interval,1')
                                    that.currentNoticeIndex += 1
                                    that.currentNoticeIndex %= that.noticeList.length
                                    that.currentNotice = that.noticeList[that.currentNoticeIndex]
                                    that.scrollable = false
                                    that.$nextTick(() => {
                                        if (that.currentNotice.title && that.currentNotice.title
                                            .length >= 30) {
                                            that.scrollable = true
                                        } else {
                                            that.scrollable = false
                                        }
                                    })
                                }, 8000)
                            }
            })
            var areaIndex = uni.getStorageSync('areaIndex')
            if (!areaIndex && areaIndex !== 0) {
            } else {
                this.areaIndex = areaIndex
            }
            //如果已经登录,加载一下默认地址
            let that = this
            setTimeout(() => {
                if (that.currentInfo.id && !that.address.id) {
                    that.$http.request('get', '/api/address/default/detail').then(res => {
                        if (res.data) {
                            that.$store.commit('setDefaultAddress', {
                                ...res.data
                            })
                        }
                    })
                }
            }, 2000)
            //公告
            var type = ''
            // #ifdef PUB_CUSTOMER
            type = 'customer'
            // #endif
            // #ifdef PUB_SUPPLIER
            type = 'supplier'
            // #endif
            // #ifdef PUB_PARTNER
            type = 'partner'
            // #endif
            this.$http.request('get', '/api/pub/announcement/list/' + type, {
                params: {
                    size: 5,
                    status: 'A'
                }
            }).then(res => {
                if (res.code === 0) {
                    // (res.data && res.data.records || [])
                    this.noticeList = res.data || []
                    console.log('this.noticeList', this.noticeList)
                    if (this.noticeList.length > 0) {
                        this.currentNotice = this.noticeList[0]
                        if (this.currentNotice.title && this.currentNotice.title.length >= 30) {
                            this.scrollable = true
                        } else {
                            this.scrollable = false
                        }
                        let that = this
                        if (this.noticeList.length >= 1) {
                            setInterval(() => {
                                console.log('interval,1')
                                that.currentNoticeIndex += 1
                                that.currentNoticeIndex %= that.noticeList.length
                                that.currentNotice = that.noticeList[that.currentNoticeIndex]
                                that.scrollable = false
                                that.$nextTick(() => {
                                    if (that.currentNotice.title && that.currentNotice.title
                                        .length >= 30) {
                                        that.scrollable = true
                                    } else {
                                        that.scrollable = false
                                    }
                                })
                            }, 8000)
                        }
                    }
                })
                // let tmp = this
                // //首页优惠券
                // this.$http.request('get', '/api/v2/coupon/app' + `/home/list`).then(res => {
                //     if (res.code == 0) {
                //         var list = res.data || []
                //         var dto = list.length >= 1 ? list[0] : undefined
                //         if (dto) {
                //             // 显示弹窗图片
                //             tmp.$refs.coupon_home.open()
                //         }
                //     }
                // })
            },
                }
            })
            // let tmp = this
            // //首页优惠券
            // this.$http.request('get', '/api/v2/coupon/app' + `/home/list`).then(res => {
            //     if (res.code == 0) {
            //         var list = res.data || []
            //         var dto = list.length >= 1 ? list[0] : undefined
            //         if (dto) {
            //             // 显示弹窗图片
            //             tmp.$refs.coupon_home.open()
            //         }
            //     }
            // })
        },
        methods: {
            clickBanner(item) {
                if (item.id) {
                    uni.navigateTo({
plugins/http.js
@@ -1,7 +1,7 @@
import environments from '@/environments'
import message from './message'
import storage from './storage'
// import store from '../store'
import store from '../store'
import utils from './util.js'
// import Vue from 'vue'
// import {
sub_pages/customer/coupon/good-self.vue
@@ -197,9 +197,10 @@
                        font-weight: 600;
                        font-size: 36rpx;
                        color: #333333;
                        line-height: 60rpx;
                        line-height: 50rpx;
                        text-align: left;
                        position: relative;
                        margin-top: 20rpx;
                        .select-coupon{
                            position: absolute;
                            right: 10rpx;
sub_pages/customer/shop/shop.vue
@@ -34,11 +34,11 @@
                    <view class="label">发布</view>
                </view>
                <view class="form-item">
                    <view class="value">0</view>
                    <view class="value">{{ '*'}}</view>
                    <view class="label">获赞</view>
                </view>
                <view class="form-item">
                    <view class="value">{{dto.fans || '0'}}</view>
                    <view class="value">{{dto.fans || '*'}}</view>
                    <view class="label">粉丝</view>
                </view>
                <!-- <view class="form-item">
sub_pages/customer/shopping/confirm.vue
@@ -25,7 +25,7 @@
                    if (this.cache_coupon.couponDiscountType === 'zero') {
                        return this.cache_coupon.couponDiscountValue || 0
                    } else if (this.cache_coupon.minOrderAmount && this.cache_coupon.minOrderAmount > 0) {
                        var total = ((this.dto.totalAmount || 0) + (this.dto.packing || 0) + (this.current_transport.fee ||
                        var total = (( this.dto.totalMemberAmount ||  this.dto.totalAmount || 0) + (this.dto.packing || 0) + (this.current_transport.fee ||
                                0) || 0)
                            .toFixed(2)
                        if (total >= this.cache_coupon.minOrderAmount) {
@@ -242,7 +242,7 @@
                            })
                            tmp.$message.hideLoading()
                            if (code === 0) {
                                //提交信息
                                console.log('pay,', data)
                                // /api/pub/init/callback?orderId=
@@ -273,9 +273,9 @@
                                            //返回上一页
                                            await tmp.$store.dispatch('sign_add', 'shopping')
                                            //清空优惠券
                                            this.$store.dispatch('cache_coupon_select', {})
                                            this.$store.dispatch('cache_goods_select', [])
                                            tmp.$store.dispatch('cache_coupon_select', {})
                                            tmp.$store.dispatch('cache_goods_select', [])
                                            tmp.$message.showToast('支付成功')
                                            setTimeout(() => {
                                                uni.navigateBack()
@@ -343,7 +343,7 @@
                </view>
                <view class="price">
                    <view class="m-l-a m-r-0 text-right">
                        共{{ dto.flowers.length }}件,小计<span class="t-red">¥{{ dto.totalAmount || 0 }}</span>
                        共{{ dto.flowers.length }}件,小计<span class="t-red">¥{{ dto.totalMemberAmount ||  dto.totalAmount || 0 }}</span>
                    </view>
                </view>
            </view>
@@ -437,13 +437,14 @@
                        </view>
                    </view>
                </view>
                <view class="form-item  flex ">
                <view class="form-item  flex  flex-wrap-normal">
                    <view class="label">兑换券</view>
                    <view class="m-l-a m-r-0 flex "
                    <view class="m-l-a m-r-0 flex" style="word-break: break-all;"
                        :class="[!dto.goodsRecordIdList||dto.goodsRecordIdList.length==0?'desc-gray':'']"
                        @click="toSelectGood">
                        <view>{{dto.goodsRecordIdListStr|| '请选择'}}</view>
                        {{dto.goodsRecordIdListStr|| '请选择'}}
                        <!-- <view>{{dto.goodsRecordIdListStr|| '请选择'}}</view> -->
                        <u-icon class="m-l-a" name="arrow-right"></u-icon>
                    </view>
                </view>
@@ -454,7 +455,7 @@
            <view class="desc flex">
                <view>商品金额:</view>
                <view class="m-l-a m-r-0 text-right">
                    {{ (dto.totalAmount || 0)  || 0 }}
                    {{ ( dto.totalMemberAmount || dto.totalAmount || 0)  || 0 }}
                </view>
            </view>
            <view class="desc flex">
@@ -470,7 +471,9 @@
                </view>
            </view>
            <view class="desc flex" v-if="cache_coupon&&cache_coupon.id">
                <view>优惠({{cache_coupon.couponDiscountType=='zero'?'无门槛':(cache_coupon.minOrderAmount?(`满¥${cache_coupon.minOrderAmount}可用`):'无门槛')}},优惠¥{{cache_coupon.couponDiscountValue||'0'}}):</view>
                <view>
                    优惠({{cache_coupon.couponDiscountType=='zero'?'无门槛':(cache_coupon.minOrderAmount?(`满¥${cache_coupon.minOrderAmount}可用`):'无门槛')}},优惠¥{{cache_coupon.couponDiscountValue||'0'}}):
                </view>
                <view class="m-l-a m-r-0 text-right">
                    -{{ coupon_fee || 0 }}
                </view>
@@ -483,7 +486,7 @@
        <view class="bottom-price flex">
            <view class="m-t-12 m-l-0 m-r-a">
                合计 <span class="t-red">¥
                    {{ ((dto.totalAmount || 0) + (dto.packing || 0) + (current_transport.fee || 0) - coupon_fee || 0).toFixed(2) }}
                    {{ (( dto.totalMemberAmount || dto.totalAmount || 0) + (dto.packing || 0) + (current_transport.fee || 0) - coupon_fee || 0).toFixed(2) }}
                </span>元
            </view>
            <view class="button-green-1 m-l-a m-r-0" style="min-width: 240rpx" @click="submitOrder">
sub_pages/customer/trade/trade.vue
@@ -1,15 +1,12 @@
<template>
    <view class="container-trade" :style="{'min-height':hidefooter?'':'calc(100vh - 20rpx)'}">
        <view class="search-container m-t-12 flex" v-if="!hidefooter">
            <!-- <view class="flex m-r-20">
            <view class="flex m-r-20">
                <view class="m-r-10" style="line-height: 80rpx;" @click="changeSearchType">
                    {{type=='category'?'按分类':'按店铺'}}
                </view>
                <u-icon name="arrow-down"></u-icon>
            </view> -->
            <view class="flex m-r-20">
                <um-dropdown width="200rpx" style="line-height: 80rpx;" @change="fnChange" :defaultIndex="def" rangeKey="label" :optionList="typeList"></um-dropdown>
            </view>
            <view class="flex1 input">
                <u-input :placeholder="type==='category'?'请输入分类名称':'请输入店铺名称'" v-model="query.name" clearable
@@ -129,17 +126,7 @@
                },
                currentCategory: {},
                type: 'category', //supplier
                def: 0,
                typeList:[
                  {
                    label: '按分类',
                    value: 'category',
                  },
                  {
                    label: '按店铺',
                    value: 'supplier',
                  },
                ],
            }
        },
@@ -205,9 +192,6 @@
            })
        },
        methods: {
            fnChange(e) {
                this.type = e.value
            },
            changeSearchType() {
                if (this.type == 'category') {
                    this.type = 'supplier'