Merge remote-tracking branch 'remotes/old/zmj' into old

This commit is contained in:
jia 2023-09-11 20:21:11 +08:00
commit e5abdf536d

View File

@ -17,8 +17,9 @@
</view> -->
<view class="" v-if="cloudList.length>0">
<view class="">
<!-- <view style="height: var(--status-bar-height);"></view> -->
<!-- <view :style="`height: ${appInfo.top}px;background-color: red;z-index: 99999;`"></view> -->
<transition name="fade">
<view class="head" style="padding-top: var(--status-bar-height);" v-if="showtit">
<view style="display: flex;align-items: center;">
@ -59,15 +60,12 @@
<u--image :showLoading="true" src="/static/images/LHYC/QB.png" width="50.82rpx"
height="50.82rpx"></u--image>
<text class="">全部</text>
<view class="flag">
<view class="flags">
</view>
</view>
</view>
</view>
</transition>
<view class="box">
<view :class="act_swiper">
@ -75,11 +73,10 @@
:circular="true" previous-margin='0rpx' next-margin='0rpx' :current="current"
:disable-touch="true">
<swiper-item v-for="(item,index) in cloudList">
<u--image :showLoading="true" :src="item.cover" width="750rpx"
<u--image :showLoading="true" :src="item.cover" :class="act_img" width="750rpx"
height="998.83rpx"></u--image>
</swiper-item>
</swiper>
</view>
<view class="" style="height:998.83rpx;" v-if="act_swiper">
@ -97,15 +94,15 @@
</swiper-item>
</swiper>
</view>
<view class="content_sift" :style="{position:pocls,top:headtop+'px'}" v-if="!showtit">
<view :class="{act:item.act}" v-for="item,index in actList" :key="index"
@click="screenGoods(item.screen,index)">
{{item.tit}}
</view>
</view>
<transition name="fade">
<view class="content">
<view class="content_sift" :style="{position:pocls,top:(headtop+16)+'px'}" v-if="!showtit">
<view :class="{act:item.act}" v-for="item,index in actList" :key="index"
@click="screenGoods(item.screen,index)">
{{item.tit}}
</view>
</view>
<view class="goods_list" v-if="goodsList.length>0">
<view class="empty" v-if='showLoading'>
<u-loading-icon v-if='showLoading' text="加载中" textSize="18"></u-loading-icon>
@ -135,10 +132,14 @@
30.00
</view>
</view>
<view class="good_price_r" @click="addcart(item.price)">
<u--image class="act_class" :showLoading="true"
<!-- :style="{'transform': `translateY(${trnList[index].bottom}) translateX(${trnList[index].left})`,'transition':'1s'}" -->
<view class="good_price_r" @click.stop="addcart(item)">
<u--image :class="'act_class'+index" class="act_class"
:showLoading="true" src="/static/images/LHYC/J.png"
width="49.07rpx" height="49.07rpx"></u--image>
<!-- <u--image class="act_class" :showLoading="true"
src="/static/images/LHYC/J.png" width="49.07rpx"
height="49.07rpx"></u--image>
height="49.07rpx"></u--image> -->
</view>
</view>
@ -159,9 +160,11 @@
</view>
</view>
<view class="card" :style="`bottom:${appInfo.bottom}px`">
<view class="card" :style="`bottom:${appInfo.bottom}px`"
@click="navgo('/pages/order_addcart/order_addcart')">
<view class="left">
<view class="" style="position: relative;">
<view class="cart" :class="{act_cart:act_cart}"
style="position: relative;z-index: 9999999;">
<u--image :showLoading="true" src="/static/images/LHYC/GWC.png" width="63.09rpx"
height="63.09rpx"></u--image>
@ -178,7 +181,7 @@
</view>
</view>
</view>
<view class="right" @click="navgo('/pages/order_addcart/order_addcart')">
<view class="right">
去结算
</view>
</view>
@ -256,10 +259,15 @@
import {
goShopDetail
} from '@/libs/order.js'
import {
postCartAdd,
} from '@/api/store.js';
export default {
data() {
let src = 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/luzhou/static4/13';
return {
trnList: [],
act_cart: false,
appInfo: {},
pocls: "",
type: "",
@ -280,8 +288,10 @@
showtit: true,
cartList: [],
activeClass: 'activeClass',
headtop: "",
headtop: 0,
page_num: 1,
act_img: "",
cartTagInfo: {},
actList: [{
tit: '综合',
act: "",
@ -337,14 +347,15 @@
.in(this)
.select('.content')
.boundingClientRect(rect => {
// console.log(rect)
if (rect.top <= this.headtop) {
if (rect.top <= (this.headtop + 16)) {
this.pocls = 'fixed'
this.act_swiper = 'act_swiper'
this.act_img = 'act_img'
} else {
this.pocls = ''
this.act_swiper = ''
this.act_img = ''
}
})
@ -352,11 +363,19 @@
if (this.headtop) return
uni.createSelectorQuery()
.in(this)
.select('.flag')
.select('.flags')
.boundingClientRect(rect => {
this.headtop = rect.top
})
.exec();
uni.createSelectorQuery()
.in(this)
.select('.cart')
.boundingClientRect(rect => {
this.cartTagInfo = rect
})
.exec();
},
onPullDownRefresh() {
uni.stopPullDownRefresh()
@ -374,14 +393,11 @@
this.cartList[0].list.forEach(e => {
this.totalMoney = this.totalMoney + Number(e.productAttr.price) * e.cart_num
})
})
getCartCounts().then(res => {
this.goodsNum = res.data[0].count
})
},
godDetail(item) {
goShopDetail(item, this.uid).then(res => {
if (this.isLogin) {
@ -442,8 +458,46 @@
})
},
addcart(price) {
this.tot_price += Number(price)
addcart(i) {
let data = {
cart_num: 1,
is_new: 0,
product_attr_unique: i.sku[''].unique,
product_id: i.product_id,
product_type: i.product_type,
spread_id: "",
}
let that = this
let res = postCartAdd({
...data
}).then((res, err) => {
this.act_cart = true
this.cartFn()
uni.showToast({
title: "加入成功",
duration: 1000,
})
}).catch(err => {
// this.act_cart = false
uni.showToast({
title: err,
icon: "none",
duration: 1000,
})
})
setTimeout(() => {
that.act_cart = false
}, 500)
// let that = this
// uni.createSelectorQuery().in(this).select(`.act_class${i}`).boundingClientRect(data1 => {
// that.trnList[i].left = this.cartTagInfo.left - data1.left + 'px';
// that.trnList[i].bottom = this.cartTagInfo.top - data1.top + 'px';
// console.log(that.trnList[i])
// }).exec();
// this.tot_price += Number(price)
},
all(index) {
this.showPop = false
@ -469,6 +523,12 @@
category_id: this.cloudList[this.current].category_id
}).then(res => {
this.goodsList = res.data.list
this.goodsList.forEach(item => {
this.trnList.push({
left: 0,
bottom: 0
})
})
})
// console.log(this.cloudList)
data.length < 1 ? Toast("暂无云仓") : '';
@ -478,6 +538,16 @@
</script>
<style lang="scss" scoped>
.flags {
background-color: red;
z-index: 99999999;
}
.act_cart {
transition: 0.5s;
transform: scale(1.1);
}
.box {
position: relative;
@ -488,7 +558,7 @@
// border-top: 5px solid red;
z-index: 99;
background-color: #F4F4F4;
padding: 0 10rpx;
// padding: 0 10rpx;
}
@ -496,6 +566,7 @@
.active_swiper {
transform: scale(1.3);
// transform: translateX() translateY();
}
@ -523,14 +594,15 @@
}
.act_class {
transition: 1s;
transition: 0.5s;
}
.act_class:active {
transform: scale(2);
// transform: translate(-500rpx, 500rpx);
}
.content_act {
width: 100vw;
position: absolute;
@ -646,7 +718,8 @@
}
.goods_list {
min-height: 100vh;
min-height: 95vh;
padding: 0 10rpx;
// background-color: red;
.goods {
@ -687,6 +760,10 @@
align-items: center;
width: 60vw;
.good_price_r {
z-index: 9;
}
.good_price_l {
display: flex;
@ -717,6 +794,12 @@
overflow: hidden;
}
.act_img {
// transition:t;
transform: translateY(-848rpx);
}
// .act_swiper2 {
// height: 998rpx;
// }
@ -727,8 +810,10 @@
display: flex;
justify-content: space-around;
background-color: white;
// background-color: green;
z-index: 99;
box-sizing: border-box;
margin-bottom: 20rpx;
}
@ -740,6 +825,7 @@
.card {
width: 720rpx;
z-index: 999999;
// margin:auto;
left: 50%;
transform: translateX(-50%);
@ -829,6 +915,7 @@
}
}
.body-wrapper {
width: 694.74rpx;
display: flex;
@ -895,4 +982,8 @@
flex-direction: column;
align-items: center;
}
.cart {
z-index: 999;
}
</style>