This commit is contained in:
@fawn-nine
2024-05-21 16:29:23 +08:00
parent ed803b94bf
commit edf80bea28
2 changed files with 181 additions and 84 deletions

View File

@@ -237,15 +237,16 @@
</view>
<scroll-view class="scroll-view_H" scroll-x="true" scroll-left="0">
<view class="ProTabs">
<scroll-view class="ProTabsBox">
<view class="New_ProTabs flexbox">
<text v-for="(item,index) in catTagList" :key="item.splId" :class="[tabsid == item.id ? 'cur' :'']"
@click="tabsChange(item,index)">{{item.title}}</text>
</view>
</scroll-view>
<view class="children_cate flexbox" v-if="childrenCatList && childrenCatList.length > 0">
<view @click="childrenChange(item,index)" :class="['item',curChildrenId == item.id ? 'cur':'']" v-for="(item, index) in childrenCatList" :key="item.id">
<view @click="childrenChange(item,index)" :class="['item',curChildrenId == item.id ? 'cur':'']"
v-for="(item, index) in childrenCatList" :key="item.id">
<text>{{item.title}}</text>
</view>
</view>
@@ -264,7 +265,7 @@
</view>
<view class="goodsPrice">
<span class="price"
v-if="item.activity_price && item.activity_price > 0">{{item.activityPrice}}</span>
v-if="item.activityPrice && item.activityPrice > 0">{{item.activityPrice}}</span>
<span class="price" v-else>{{item.price}}</span>
<span class="Salesnum">已售{{item.sum_sales}} </span>
</view>
@@ -395,6 +396,7 @@
status: 3,
userMsg: {}, // 用户信息
yxCurIndex: 0, // 当前营销标签序号
SystemInfoSync: {}, // 屏幕尺寸
};
},
onPageScroll(e) {
@@ -409,7 +411,7 @@
},
onHide() {
this.page = 1
this.tjProList = []
// this.tjProList = []
// if(this.tagList.length > 0){
// this.tabsid = this.tagList[0].splId
// }
@@ -417,24 +419,32 @@
//页面显示
onShow() {
// 隐藏原生的tabbar
this.tjProList = []
uni.hideTabBar();
this.getData();
this.getTags()
this.getUserInfo()
this.getYXTgs()
// this.getUserInfo()
// this.tjProList = []
// uni.hideTabBar();
// this.getData();
// this.getTags()
// this.getYXTgs()
this.requestAll()
},
onTabItemTap() {
},
// 页面加载完毕
onReady() {
// this.requestIapOrder()
// console.log(uni.getSystemInfoSync(), '屏幕')
},
mounted() {
this.requestAll()
},
// 下拉刷新
onPullDownRefresh() {
this.page = 1
this.tjProList = []
this.getData()
this.getTags()
this.getUserInfo()
// this.getData()
this.getTags()
this.getYXTgs()
// this.requestIapOrder()
uni.stopPullDownRefresh()
@@ -475,12 +485,20 @@
//方法
methods: {
...mapMutations(['setUserInfo']),
requestAll() {
this.getUserInfo()
this.tjProList = []
uni.hideTabBar();
// this.getData();
this.getTags()
this.getYXTgs()
},
// 获取营销标签列表
getYXTgs() {
this.$http
.post('book/labelAndMarket/marketTree')
.then(res => {
console.log(res, '营销标签列表')
// console.log(res, '营销标签列表')
if (res.result.length > 0) {
this.yingxiaoTags = res.result
this.getYXproducts()
@@ -494,7 +512,7 @@
getYXproducts(item) {
var tag_id = null
if (!item) {
console.log('没有传参')
/// console.log('没有传参')
tag_id = this.yingxiaoTags[0].id
} else {
tag_id = item.id
@@ -504,8 +522,15 @@
'marketId': tag_id
})
.then(res => {
console.log(res.result, '营销商品列表')
if (res.code == 0 && res.result.length > 0) {
this.YXBookList = res.result
}else{
this.YXBookList = []
}
// console.log(res.result, '营销商品列表')
}).catch( e =>{
this.YXBookList = []
});
},
// 获取用户详情
@@ -549,7 +574,7 @@
this.getJtData(this.childrenCatList[index].id)
},
tabsChange(item, cindex) {
this.tjProList = []
// this.tjProList = []
this.tabsid = item.id
this.childrenCatList = []
if (this.catTagList[cindex].isLast == 1) {
@@ -582,10 +607,10 @@
this.wztabsid = item.splId
this.page = 1
// 获取推荐数据
this.getJtData()
// this.getJtData()
},
getJtData(cid) {
this.tjProList = []
this.$http
// .post('book/label/list',{
.post('book/labelAndMarket/getShopProductListByLabelId', {
@@ -594,29 +619,30 @@
.then(res => {
if (res.code == 0 && res.result.length > 0) {
this.tjProList = res.result
}
else {
} else {
this.tjProList = []
this.status = 3
}
}).catch(e => {
this.tjProList = []
console.log(e, '商品分类列表报错')
});
},
// 获取折扣图书
getOffSale() {
this.$http
.post('book/shopproduct/listactivityprice?limit=10&page=1')
.then(res => {
console.log(res, '折扣')
if (res.code == 0 && res.page.list.length > 0) {
this.offSaleList = res.page.list
this.tabsNumber = 0
}
// getOffSale() {
// this.$http
// .post('book/shopproduct/listactivityprice?limit=10&page=1')
// .then(res => {
// console.log(res, '折扣')
// if (res.code == 0 && res.page.list.length > 0) {
// this.offSaleList = res.page.list
// this.tabsNumber = 0
// }
}).catch(e => {
console.log(e, 'e')
});
},
// }).catch(e => {
// console.log(e, 'e')
// });
// },
// 新书上市
// getNewBook() {
// this.$http
@@ -882,13 +908,39 @@
</script>
<style lang="scss" scoped>
@import '@/style/mixin.scss';
.children_cate {
background-color: #fff; justify-items: normal;
margin-bottom: 12rpx;
justify-content: space-evenly;
padding: 0 10rpx;
.item{padding: 10rpx; background-color: #eee;}
.cur{ color:#55aa7f ;}
background-color: #fff;
display: flex;
justify-items: normal;
padding-top: 12rpx;
overflow: hidden;
padding-bottom: 10rpx;
.item {
width: 100%; text-align: center;
margin-right: 1px;
font-size: 32rpx;
padding: 10rpx;
color: #fff;
// background-color: #55aa7f;
background-color: #eee;
color: #333;
border-radius: 10rpx;
}
.item:last-child {
margin-right: 0;
}
.cur {
color: #55aa7f; font-weight: bold;
border-radius: 5rpx;
}
}
.fiveIcon {
justify-content: space-between;
text-align: center;
@@ -936,6 +988,7 @@
padding: 0 20rpx;
text {
padding: 8rpx 14rpx;
font-size: 32rpx;
display: inline-block;
@@ -952,6 +1005,32 @@
}
}
.New_ProTabs {
justify-content: space-between;
background-color: #fff;
padding-left: 5px; padding-right: 5px;
text {
// max-width: 12.5%;
// background-color: #56565633;
font-size: 32rpx;
padding: 5px 3px;
font-weight: bold;
display: block;
width: 100%;
border-radius: 10rpx;
overflow: hidden;
// background-color: #eee;
color: #333;
// white-space:wrap !important;
text-align: center;
}
text.cur {
background-color: #55aa7f;
color: #fff;
}
}
.wzProTabs {
display: flex;
justify-content: center;
@@ -1441,6 +1520,7 @@
width: 100%;
margin: 0 0 50rpx 0;
background-color: #fff;
margin-top: 10rpx;
.goodsItem {
display: inline-block;

View File

@@ -707,11 +707,21 @@
title: '登录成功',
duration: 2000
});
// 跳转底部导航
setTimeout(() => {
// uni.switchTab({
// url: "/pages/home/home"
// });
uni.switchTab({
url: "/pages/home/home"
});
}, 2000);
                url: "/pages/home/home",
                success: function () {
                  let page = getCurrentPages()[0];                  
          page.$vm.requestAll();
                },
              });
}, 1000);
} else {
uni.showModal({
title: '提示',
@@ -767,10 +777,17 @@
duration: 2000
});
setTimeout(() => {
// uni.switchTab({
// url: "/pages/home/home"
// });
uni.switchTab({
url: "/pages/home/home"
});
}, 2000);
                url: "/pages/home/home",
                success: function () {
                  let page = getCurrentPages()[0];                  
                  page.$vm.requestAll();
                },
              });
}, 1000);
} else {
uni.showModal({
title: '提示',