This commit is contained in:
weipengfei 2024-03-27 16:39:59 +08:00
parent 66a882a309
commit 78044465b1
6 changed files with 29 additions and 24 deletions

View File

@ -140,11 +140,12 @@ export function getBrandlist(data) {
* 获取推荐产品
*
*/
export function getProductHot(page, limit, sale_type, enLoad=false) {
export function getProductHot(page, limit, sale_type, rand=0, enLoad=false) {
return request.get("product/spu/recommend", {
page: page === undefined ? 1 : page,
limit: limit === undefined ? 10 : limit,
sale_type: sale_type || null
sale_type: sale_type || null,
rand: rand
}, {
noAuth: true,
enLoad: enLoad

View File

@ -36,19 +36,22 @@
</view>
<!-- 资讯 -->
<view v-if="showTab&&list.length>0" @click="navTo('/pages/news_list/index?type=20')" style="display: flex;justify-content: flex-end;padding-bottom: 16rpx;font-size: 26rpx;color: #333;">
更多资讯<u-icon name="arrow-right" color="#333"></u-icon>
<view v-if="showTab&&list.length>0" @click="navTo('/pages/news_list/index?type=20')" style="display: flex;justify-content: space-between;padding-bottom: 20rpx;font-size: 26rpx;color: #999999;height: 70rpx;align-items: center;">
<view style="font-size: 28rpx;background-color: #40ae36;color: #fff;padding: 4rpx 16rpx 6rpx 16rpx;border-radius: 90rpx;">里海新闻</view>
<view style="display: flex;">更多<u-icon name="arrow-right" size="12" color="#999"></u-icon></view>
</view>
<view class="information" v-if="showTab&&list.length>0">
<view class="nav-item" @click="navTo(`/pages/news_details/index?id=${item.article_id}`)" v-for="(item, index) in list" :key="item.article_id">
<view class="nav-item-up" style="overflow: hidden;">
<image :src="item.image_input" mode="aspectFill"></image>
</view>
<view class="nav-item-down">
<view class="nav-item-down-title">{{item.title}}</view>
<view class="nav-item-down-desc">{{item.synopsis}}</view>
</view>
</view>
<scroll-view scroll-x style="height: 230rpx;width: 700rpx;white-space: nowrap;">
<view class="nav-item" style="display: inline-block;margin-right: 16rpx;" @click="navTo(`/pages/news_details/index?id=${item.article_id}`)" v-for="(item, index) in list" :key="item.article_id">
<view class="nav-item-up" style="overflow: hidden;">
<image :src="item.image_input" mode="aspectFill"></image>
</view>
<view class="nav-item-down">
<view class="nav-item-down-title">{{item.title}}</view>
<view class="nav-item-down-desc">{{item.synopsis}}</view>
</view>
</view>
</scroll-view>
</view>
<!-- tab导航 -->
@ -161,7 +164,7 @@
getArticleList(){
getArticleList(20,{
page: 1,
limit: 3
limit: 10
}).then(res=>{
this.list = res.data.list;
})
@ -312,9 +315,9 @@
}
.information{
display: flex;
justify-content: space-between;
margin-bottom: 20rpx;
// display: flex;
// justify-content: space-between;
// margin-bottom: 20rpx;
.nav-item {
width: 227rpx;

View File

@ -2,8 +2,8 @@
"name" : "惠农生活",
"appid" : "__UNI__3A527D1",
"description" : "",
"versionName" : "2.0.12",
"versionCode" : 2012,
"versionName" : "2.0.15",
"versionCode" : 2015,
"transformPx" : false,
/* 5+App */
"app-plus" : {

View File

@ -115,14 +115,13 @@
{
"path": "pages/news_list/index",
"style": {
"navigationBarTitleText": "资讯消息"
"navigationBarTitleText": "里海新闻"
}
},
{
"path": "pages/news_details/index",
"style": {
"navigationBarTitleText": ""
// "navigationBarTitleText": "资讯详情"
}
},

View File

@ -464,7 +464,7 @@
hostProduct: [[],[],[],[]],
hostIndex: 0,
hotPage: 1,
hotLimit: 30,
hotLimit: 20,
hotScroll: true,
hotLoading: [false, false, false, false],
hotTitle: '加载更多',
@ -1041,7 +1041,7 @@
if (that.hotLoading[e]) return;
that.hotLoading[e] = true;
that.hotTitle = '加载中';
getProductHot(that.hotPage, that.hotLimit, 1).then(res => {
getProductHot(that.hotPage, that.hotLimit, 1, 1).then(res => {
let list = res.data.list;
let productList = that.hostProduct;
if(!productList[e]) productList[e] = [];
@ -1050,6 +1050,7 @@
that.hotScroll = hotScroll;
that.hotLoading[e] = false;
that.hotTitle = !hotScroll ? '已全部加载' : '加载更多';
that.$set(that, 'hostProduct', productList);
if(this.hostIndex==e) this.$forceUpdate();
that.$set(that, 'hotPage', that.hotPage + 1);
@ -1068,6 +1069,7 @@
query.page = that.hotPage;
query.limit = that.hotLimit;
query.sale_type = 1;
query.rand = 1;
getProductslist({
...query
}).then(res => {

View File

@ -288,7 +288,7 @@
}
.newsList .list .item .text {
width: 420rpx;
height: 156rpx;
height: 160rpx;
font-size: 24rpx;
color: #999;
}