Browse Source

重构代码,移除底部隐藏tabBar逻辑

pull/1/head
Default User 2 months ago
parent
commit
7b7e2b1ef7
  1. 237
      pages/index/index.js
  2. 234
      pages/index/index.wxml
  3. 128
      pages/index/index.wxss

237
pages/index/index.js

@ -33,6 +33,7 @@ Page({
selectedCategory: '全部', selectedCategory: '全部',
loadingMore: false, loadingMore: false,
hasMoreData: true, hasMoreData: true,
hasMore: true, // 用于显示"已加载全部商品"提示
page: 1, page: 1,
pageSize: 10, pageSize: 10,
@ -40,6 +41,10 @@ Page({
previewImageUrls: [], // 预览的图片URL列表 previewImageUrls: [], // 预览的图片URL列表
previewImageIndex: 0, // 当前预览图片的索引 previewImageIndex: 0, // 当前预览图片的索引
showImagePreview: false, // 控制图片预览弹窗显示 showImagePreview: false, // 控制图片预览弹窗显示
// 导航栏显示控制
showNavBar: true, // 控制导航栏显示/隐藏
lastScrollTop: 0, // 上一次滚动位置
}, },
// 跳转到聊天页面 // 跳转到聊天页面
@ -333,6 +338,7 @@ Page({
loadingMore: false, loadingMore: false,
page: currentPage + 1, page: currentPage + 1,
hasMoreData: hasMoreData, hasMoreData: hasMoreData,
hasMore: hasMoreData,
totalGoods: totalGoods, totalGoods: totalGoods,
totalPages: totalPages totalPages: totalPages
}) })
@ -527,6 +533,42 @@ Page({
url: `/pages/goods-detail/goods-detail?goodsData=${encodeURIComponent(JSON.stringify(item))}&productId=${productId}` url: `/pages/goods-detail/goods-detail?goodsData=${encodeURIComponent(JSON.stringify(item))}&productId=${productId}`
}) })
}, },
// 查看商品详情(与buyer页面保持一致的方法名)
showGoodsDetail: function (e) {
// 检查用户是否登录
const openid = wx.getStorageSync('openid');
const userId = wx.getStorageSync('userId');
if (!openid || !userId) {
console.log('用户未登录,直接显示授权登录弹窗');
// 直接显示授权登录弹窗
this.showOneKeyLogin();
return;
}
const goodsItem = e.currentTarget.dataset.item;
// 跳转到商品详情页面,并传递商品数据,使用encodeURIComponent编码JSON字符串
wx.navigateTo({
url: '/pages/goods-detail/goods-detail?goodsData=' + encodeURIComponent(JSON.stringify(goodsItem))
});
// 同时尝试直接更新tabBar的选中状态
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
const tabBar = this.getTabBar();
if (tabBar.setData) {
tabBar.setData({ show: false });
}
}
// 调用后端API执行商品联系人更新
console.log('开始调用API.updateProductContacts()');
API.updateProductContacts().then(function(res) {
console.log('商品联系人更新成功:', res);
}).catch(function(err) {
console.error('商品联系人更新失败:', err);
});
},
// 跳转到入驻页面 // 跳转到入驻页面
navigateToSettlement: function() { navigateToSettlement: function() {
@ -587,33 +629,194 @@ Page({
onScroll: function(e) { onScroll: function(e) {
// 获取滚动信息 // 获取滚动信息
const { scrollTop, scrollHeight, clientHeight } = e.detail; const { scrollTop, scrollHeight, clientHeight } = e.detail;
const distanceToBottom = scrollHeight - scrollTop - clientHeight;
// 获取全局状态 // 导航栏显示/隐藏逻辑
const app = getApp(); const { lastScrollTop } = this.data;
if (!app || !app.globalData) {
return;
}
// 当滚动到底部且没有更多数据时,隐藏tabBar // 下滑检测:如果当前滚动位置大于上一次滚动位置,且不在顶部(scrollTop > 10),则隐藏导航栏
if (distanceToBottom < 100 && !this.data.hasMoreData) { if (scrollTop > lastScrollTop && scrollTop > 10) {
app.globalData.showTabBar = false; this.setData({
showNavBar: false
});
} }
// 当往上滚动不在底部时,立即重新显示tabBar // 上滑检测:如果当前滚动位置小于上一次滚动位置,或者回到顶部,则显示导航栏
else { else if (scrollTop < lastScrollTop || scrollTop <= 10) {
app.globalData.showTabBar = true; this.setData({
showNavBar: true
});
} }
// 更新上一次滚动位置
this.setData({
lastScrollTop: scrollTop
});
}, },
// 上拉加载更多 // 上拉加载更多
onReachBottom: function() { onReachBottom: function() {
if (this.data.hasMoreData && !this.data.loadingMore) { if (this.data.hasMoreData && !this.data.loadingMore) {
this.loadGoods(true) this.loadGoods(true)
} else if (!this.data.hasMoreData) { }
// 没有更多数据时,隐藏tabBar },
const app = getApp();
if (app && app.globalData) { // 切换图片
app.globalData.showTabBar = false; swiperChange(e) {
const current = e.detail.current
const itemId = e.currentTarget.dataset.itemId
// 更新对应商品项的currentImageIndex
this.setData({
[`filteredGoods[${itemId}].currentImageIndex`]: current
})
},
// 切换收藏状态
toggleFavorite(e) {
const goodsItem = e.currentTarget.dataset.item;
console.log('用户点击了收藏按钮,商品信息:', goodsItem);
// 检查用户登录状态
const openid = wx.getStorageSync('openid');
const userId = wx.getStorageSync('userId');
if (!openid || !userId) {
console.log('用户未登录,显示一键登录弹窗');
this.setData({
showOneKeyLoginModal: true
});
return;
}
// 获取商品ID
const productId = String(goodsItem.productId || goodsItem.id);
console.log('准备操作的商品ID:', productId);
// 根据当前收藏状态决定是添加还是取消收藏
if (goodsItem.isFavorite) {
this.cancelFavorite(e);
} else {
this.addFavorite(e);
}
},
// 添加收藏
addFavorite: function (e) {
const goodsItem = e.currentTarget.dataset.item;
console.log('用户点击了收藏按钮,商品信息:', goodsItem);
// 获取商品ID
const productId = String(goodsItem.productId || goodsItem.id);
console.log('准备收藏的商品ID:', productId);
wx.showLoading({ title: '正在收藏...' });
// 调用API添加收藏
API.addFavorite(productId)
.then(res => {
wx.hideLoading();
console.log('添加收藏成功:', res);
// 更新商品的收藏状态
this.updateGoodsFavoriteStatus(productId, true);
// 触发全局事件,通知其他页面收藏状态已更改
const app = getApp();
if (app.eventBus) {
app.eventBus.emit('favoriteChanged', {
productId: productId,
isFavorite: true
});
}
// 显示成功提示
wx.showToast({
title: '收藏成功',
icon: 'success',
duration: 1500
});
})
.catch(err => {
wx.hideLoading();
console.error('添加收藏失败:', err);
// 显示错误提示
wx.showToast({
title: '收藏失败,请稍后重试',
icon: 'none',
duration: 2000
});
});
},
// 取消收藏
cancelFavorite: function (e) {
const goodsItem = e.currentTarget.dataset.item;
console.log('用户点击了取消收藏按钮,商品信息:', goodsItem);
// 获取商品ID
const productId = String(goodsItem.productId || goodsItem.id);
console.log('准备取消收藏的商品ID:', productId);
wx.showLoading({ title: '正在取消收藏...' });
// 调用API取消收藏
API.cancelFavorite(productId)
.then(res => {
wx.hideLoading();
console.log('取消收藏成功:', res);
// 更新商品的收藏状态
this.updateGoodsFavoriteStatus(productId, false);
// 触发全局事件,通知其他页面收藏状态已更改
const app = getApp();
if (app.eventBus) {
app.eventBus.emit('favoriteChanged', {
productId: productId,
isFavorite: false
});
}
// 显示成功提示
wx.showToast({
title: '取消收藏成功',
icon: 'success',
duration: 1500
});
})
.catch(err => {
wx.hideLoading();
console.error('取消收藏失败:', err);
// 显示错误提示
wx.showToast({
title: '取消收藏失败,请稍后重试',
icon: 'none',
duration: 2000
});
});
},
// 更新商品收藏状态
updateGoodsFavoriteStatus: function (productId, isFavorite) {
// 找到商品在列表中的索引
const goodsIndex = this.data.filteredGoods.findIndex(item =>
String(item.id) === productId || String(item.productId) === productId
);
if (goodsIndex !== -1) {
// 更新商品的收藏状态
const updateData = {};
updateData[`filteredGoods[${goodsIndex}].isFavorite`] = isFavorite;
this.setData(updateData);
// 同时更新原始goods数组
const originalIndex = this.data.goods.findIndex(item =>
String(item.id) === productId || String(item.productId) === productId
);
if (originalIndex !== -1) {
updateData[`goods[${originalIndex}].isFavorite`] = isFavorite;
this.setData(updateData);
} }
} }
}, },

234
pages/index/index.wxml

@ -1,27 +1,71 @@
<view class="container"> <view class="container">
<!-- 标题 --> <!-- 导航栏区域,根据showNavBar状态控制显示/隐藏 -->
<view class="title">专业的鸡蛋现货交易平台</view> <view wx:if="{{showNavBar}}" class="nav-bar">
<!-- 标题 -->
<!-- 搜索区域 --> <view class="title">专业的鸡蛋现货交易平台</view>
<view class="search-section">
<view class="search-bar"> <!-- 搜索区域 -->
<view class="search-input-wrapper"> <view class="search-section">
<!-- 将地区选择器放在最左边 --> <view class="search-bar">
<view class="region-selector" bindtap="toggleRegionPicker"> <view class="search-input-wrapper">
<text>{{selectedRegion || '全国'}}</text> <!-- 将地区选择器放在最左边 -->
<text class="region-arrow">▼</text> <view class="region-selector" bindtap="toggleRegionPicker">
<text>{{selectedRegion || '全国'}}</text>
<text class="region-arrow">▼</text>
</view>
<!-- 搜索图标和输入框 -->
<text class="search-icon">🔍</text>
<input
class="search-input"
placeholder="搜索商品名称或地区"
placeholder-class="search-placeholder"
value="{{searchKeyword}}"
bindinput="onSearchInput"
/>
</view>
<button class="search-button" bindtap="searchGoods">搜索</button>
</view>
</view>
<!-- 品种筛选区域 -->
<view class="category-section">
<view class="category-scroll">
<view
class="egg-item {{selectedCategory === '全部' ? 'active' : ''}}"
bindtap="selectCategory"
data-category="全部"
>
<view class="egg-inner">全部</view>
</view>
<view
class="egg-item {{selectedCategory === '粉壳' ? 'active' : ''}}"
bindtap="selectCategory"
data-category="粉壳"
>
<view class="egg-inner">粉壳</view>
</view>
<view
class="egg-item {{selectedCategory === '红壳' ? 'active' : ''}}"
bindtap="selectCategory"
data-category="红壳"
>
<view class="egg-inner">红壳</view>
</view>
<view
class="egg-item {{selectedCategory === '绿壳' ? 'active' : ''}}"
bindtap="selectCategory"
data-category="绿壳"
>
<view class="egg-inner">绿壳</view>
</view>
<view
class="egg-item {{selectedCategory === '白壳' ? 'active' : ''}}"
bindtap="selectCategory"
data-category="白壳"
>
<view class="egg-inner">白壳</view>
</view> </view>
<!-- 搜索图标和输入框 -->
<text class="search-icon">🔍</text>
<input
class="search-input"
placeholder="搜索商品名称或地区"
placeholder-class="search-placeholder"
value="{{searchKeyword}}"
bindinput="onSearchInput"
/>
</view> </view>
<button class="search-button" bindtap="searchGoods">搜索</button>
</view> </view>
</view> </view>
@ -44,47 +88,6 @@
</view> </view>
</view> </view>
<!-- 品种筛选区域 -->
<view class="category-section">
<view class="category-scroll">
<view
class="egg-item {{selectedCategory === '全部' ? 'active' : ''}}"
bindtap="selectCategory"
data-category="全部"
>
<view class="egg-inner">全部</view>
</view>
<view
class="egg-item {{selectedCategory === '粉壳' ? 'active' : ''}}"
bindtap="selectCategory"
data-category="粉壳"
>
<view class="egg-inner">粉壳</view>
</view>
<view
class="egg-item {{selectedCategory === '红壳' ? 'active' : ''}}"
bindtap="selectCategory"
data-category="红壳"
>
<view class="egg-inner">红壳</view>
</view>
<view
class="egg-item {{selectedCategory === '绿壳' ? 'active' : ''}}"
bindtap="selectCategory"
data-category="绿壳"
>
<view class="egg-inner">绿壳</view>
</view>
<view
class="egg-item {{selectedCategory === '白壳' ? 'active' : ''}}"
bindtap="selectCategory"
data-category="白壳"
>
<view class="egg-inner">白壳</view>
</view>
</view>
</view>
<!-- 侧边栏按钮 --> <!-- 侧边栏按钮 -->
<view <view
class="sidebar-btn" class="sidebar-btn"
@ -136,30 +139,88 @@
<view <view
wx:for="{{filteredGoods}}" wx:for="{{filteredGoods}}"
wx:key="id" wx:key="id"
class="goods-item" class="card"
data-item="{{item}}" data-item="{{item}}"
bindtap="viewGoodsDetail"
> >
<!-- 商品图片 --> <!-- 图片和信息2:3比例并排显示,整体高度固定 -->
<view class="goods-image-container"> <view style="display: flex; width: 100%; height: 200rpx; border-radius: 8rpx; overflow: hidden; background-color: #f5f5f5;">
<image <!-- 左侧图片区域 40%宽度(2/5),高度固定 -->
class="goods-image" <view style="width: 40%; position: relative; height: 200rpx;">
src="{{item.imageUrls && item.imageUrls.length > 0 ? item.imageUrls[0] : '/images/default-avatar.png'}}" <!-- 第一张图片 -->
mode="aspectFill" <view wx:if="{{item.imageUrls && item.imageUrls.length > 0}}" style="width: 100%; height: 100%;">
bindtap="previewImage" <image src="{{item.imageUrls[0]}}" mode="aspectFill" style="width: 100%; height: 100%;" bindtap="previewImage" data-item="{{item}}" data-index="0"></image>
data-item="{{item}}" </view>
data-index="0" <view wx:else style="width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #999;">
></image> <text>暂无图片</text>
<view class="goods-tag">{{item.supplyStatus || '现货'}}</view> </view>
</view> <!-- 剩余图片可滑动区域 -->
<!-- 商品信息 --> <view wx:if="{{item.imageUrls && item.imageUrls.length > 0}}" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;">
<view class="goods-info"> <swiper
<view class="goods-name">{{item.name}}</view> class="image-swiper"
<view class="goods-spec">{{item.specification || '无'}} | {{item.yolk || '无'}}</view> style="width: 100%; height: 100%;"
<view class="goods-price">¥{{item.price}}</view> current="{{item.currentImageIndex || 0}}"
<view class="goods-footer"> bindchange="swiperChange"
<view class="goods-region">{{item.region}}</view> data-item-id="{{index}}">
<view class="goods-reserved">已有{{item.reservedCount || 0}}人收藏</view> <block wx:for="{{item.imageUrls}}" wx:for-item="img" wx:for-index="idx" wx:key="idx">
<swiper-item>
<image src="{{img}}" mode="aspectFill" style="width: 100%; height: 100%;" bindtap="previewImage" data-item="{{item}}" data-index="{{idx}}"></image>
</swiper-item>
</block>
</swiper>
<!-- 显示页码指示器 -->
<view style="position: absolute; bottom: 10rpx; right: 10rpx; background-color: rgba(0,0,0,0.5); color: white; padding: 5rpx 10rpx; border-radius: 15rpx; font-size: 20rpx;">
{{(item.currentImageIndex || 0) + 1}}/{{item.imageUrls.length}}
</view>
</view>
</view>
<!-- 右侧信息区域 60%宽度(3/5),相应调整 -->
<view style="width: 60%; display: flex; flex-direction: column; background-color: white; border-left: 1rpx solid #f0f0f0;">
<!-- 上半部分商品信息区域(60%高度),可点击查看详情 -->
<view style="flex: 0.6; padding: 0rpx 15rpx 15rpx 15rpx; cursor: pointer;" bindtap="showGoodsDetail" data-item="{{item}}">
<view>
<view style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 10rpx;">
<view style="display: flex; align-items: center; flex: 1;">
<view style="display: inline-block; margin-right: 10rpx; font-size: 18rpx; color: #fff; background: {{item.supplyStatus === '现货' ? 'rgba(76, 175, 80, 0.8)' : 'rgba(218, 165, 32, 0.8)'}}; padding: 4rpx 10rpx; border-radius: 15rpx; vertical-align: middle; backdrop-filter: blur(10rpx); border: 1rpx solid rgba(255, 255, 255, 0.3); box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.15), inset 0 1rpx 0 rgba(255, 255, 255, 0.5); text-shadow: 0 1rpx 2rpx rgba(0, 0, 0, 0.2); font-weight: bold; margin-top: -0.1rpx;">{{item.supplyStatus || '暂无状态'}}</view>
<text style="font-size: 36rpx; font-weight: bold;">{{item.name}}</text>
<span style="vertical-align: middle; font-size: 12rpx; color: white; background: linear-gradient(135deg, #4a90e2 0%, #2b66f0 50%, #1a4bbd 100%); padding: 4rpx 10rpx; clip-path: polygon(50% 0%, 70% 10%, 100% 30%, 100% 70%, 70% 90%, 50% 100%, 30% 90%, 0% 70%, 0% 30%, 30% 10%); margin-left: 8rpx; box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.3), inset 0 1rpx 2rpx rgba(255, 255, 255, 0.5); text-shadow: 0 1rpx 2rpx rgba(0, 0, 0, 0.5); font-weight: bold; margin-top: -20rpx;">V</span>
</view>
<!-- 隐藏列表页价格显示,只在详情页显示 -->
</view>
<view style="font-size: 28rpx; color: #555; font-weight: 600; margin-top: 30rpx;">
{{item.specification || '无'}} | {{item.yolk || '无'}} | {{item.minOrder || item.quantity || 1}}件
</view>
</view>
</view>
<!-- 下半部分按钮区域(40%高度) -->
<view style="flex: 0.4; display: flex; justify-content: space-between; align-items: center; padding: 0 20rpx;">
<!-- 收藏人数显示,与buyer页面保持一致 -->
<view style="display: flex; align-items: center;">
<text style="color: #999999; font-size: 28rpx; font-weight: normal; margin-right: 8rpx;">已有</text>
<text style="color: #d865d8ff; font-size: 28rpx; font-weight: bold;">{{item.reservedCount || 0}}</text>
<text style="color: #999999; font-size: 28rpx; font-weight: normal; margin-left: 8rpx;">人收藏</text>
</view>
<!-- 根据是否已收藏显示不同的按钮 -->
<button
wx:if="{{item.isFavorite}}"
style="font-size: 24rpx; font-weight: bold; width: 150rpx; height: 60rpx; border-radius: 24rpx; display: flex; justify-content: center; align-items: center; padding: 0; border: none; margin: 0; transition: all 0.3s ease; position: relative; overflow: hidden; color: #FF6B6B; background: rgba(255, 107, 107, 0.15); backdrop-filter: blur(12rpx); -webkit-backdrop-filter: blur(12rpx); border: 1rpx solid rgba(255, 255, 255, 0.3); box-shadow: 0 8rpx 32rpx rgba(31, 38, 135, 0.2), 0 4rpx 16rpx rgba(0, 0, 0, 0.1), inset 0 2rpx 4rpx rgba(255, 255, 255, 0.7), inset 0 -2rpx 4rpx rgba(0, 0, 0, 0.1);"
bindtap="cancelFavorite"
data-item="{{item}}"
>
已收藏
</button>
<button
wx:else
style="font-size: 24rpx; font-weight: bold; width: 150rpx; height: 60rpx; border-radius: 24rpx; display: flex; justify-content: center; align-items: center; padding: 0; border: none; margin: 0; transition: all 0.3s ease; position: relative; overflow: hidden; color: #1677ff; background: rgba(22, 119, 255, 0.15); backdrop-filter: blur(12rpx); -webkit-backdrop-filter: blur(12rpx); border: 1rpx solid rgba(255, 255, 255, 0.3); box-shadow: 0 8rpx 32rpx rgba(31, 38, 135, 0.2), 0 4rpx 16rpx rgba(0, 0, 0, 0.1), inset 0 2rpx 4rpx rgba(255, 255, 255, 0.7), inset 0 -2rpx 4rpx rgba(0, 0, 0, 0.1);"
bindtap="addFavorite"
data-item="{{item}}"
>
收藏
</button>
</view>
</view> </view>
</view> </view>
</view> </view>
@ -168,6 +229,11 @@
<view wx:if="{{filteredGoods.length === 0}}" class="empty-goods"> <view wx:if="{{filteredGoods.length === 0}}" class="empty-goods">
<text>暂无商品数据</text> <text>暂无商品数据</text>
</view> </view>
<!-- 搜索结果后添加半页空白区域 -->
<view class="half-page-blank" style="display: flex; justify-content: center; align-items: flex-start; padding-top: 20rpx;">
<text style="color: #999; font-size: 26rpx; opacity: 0.8;">{{hasMore ? '下拉加载更多' : '已加载全部商品'}}</text>
</view>
</view> </view>
</scroll-view> </scroll-view>

128
pages/index/index.wxss

@ -13,7 +13,7 @@ page {
margin: 0; margin: 0;
width: 100%; width: 100%;
height: 100vh; height: 100vh;
display: flex;z display: flex;
flex-direction: column; flex-direction: column;
box-sizing: border-box; box-sizing: border-box;
background-color: #f5f7fa; background-color: #f5f7fa;
@ -369,16 +369,14 @@ page {
font-weight: bold; font-weight: bold;
} }
/* 商品区域样式 - 调整为占据70%空间 */ /* 商品区域样式 - 填充完整宽度 */
.goods-section { .goods-section {
background-color: white; background-color: transparent;
padding: 20rpx; padding: 0 20rpx;
border-radius: 10rpx; margin: 0;
margin: 0 20rpx 20rpx 20rpx; flex: 1;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
flex: 7;
overflow-y: auto; overflow-y: auto;
width: calc(100% - 40rpx); width: 100%;
box-sizing: border-box; box-sizing: border-box;
} }
@ -386,7 +384,7 @@ page {
font-size: 28rpx; font-size: 28rpx;
font-weight: bold; font-weight: bold;
color: #333; color: #333;
margin-bottom: 20rpx; margin: 0 0 20rpx 0;
} }
.goods-list { .goods-list {
@ -396,104 +394,50 @@ page {
.goods-list-container { .goods-list-container {
display: flex; display: flex;
flex-wrap: wrap; flex-direction: column;
gap: 20rpx; gap: 0;
justify-content: flex-start;
padding-bottom: 20rpx; padding-bottom: 20rpx;
} }
.goods-item { /* 商品卡片样式,与buyer页面保持一致,但减小间距 */
width: calc((100% - 20rpx) / 2); .card {
background-color: #f9f9f9; background: white;
border-radius: 10rpx; border-radius: 12rpx;
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
overflow: hidden; overflow: hidden;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05); margin-bottom: 10rpx;
transition: all 0.3s ease;
}
.goods-item:hover {
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1);
transform: translateY(-2rpx);
}
.goods-image-container {
position: relative;
width: 100%; width: 100%;
padding-bottom: 100%; box-sizing: border-box;
overflow: hidden;
} }
.goods-image { .image-swiper {
position: absolute;
top: 0;
left: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: #eee;
}
.goods-tag {
position: absolute;
top: 10rpx;
left: 10rpx;
background-color: rgba(255, 90, 90, 0.8);
color: white;
font-size: 20rpx;
padding: 5rpx 10rpx;
border-radius: 15rpx;
font-weight: bold;
}
.goods-info {
padding: 15rpx;
} }
.goods-name { /* 进一步减小收藏按钮大小并调整位置 */
font-size: 26rpx; .card button {
font-weight: bold; width: 120rpx !important;
color: #333; height: 48rpx !important;
margin-bottom: 10rpx; font-size: 20rpx !important;
overflow: hidden; margin-left: 10rpx !important;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
min-height: 60rpx;
}
.goods-spec {
font-size: 22rpx;
color: #999;
margin-bottom: 10rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
} }
.goods-price { /* 加深所有货源的规格信息行字体颜色 */
font-size: 32rpx; .card view:nth-child(2) view:nth-child(2) view:nth-child(1) view:nth-child(2) {
font-weight: bold; color: #555 !important;
color: #ff4d4f; font-weight: 600 !important;
margin-bottom: 10rpx;
} }
.goods-footer { /* 半页空白页样式,与buyer页面保持一致 */
.half-page-blank {
height: 32vh;
width: 100%;
box-sizing: border-box;
display: flex; display: flex;
justify-content: space-between; justify-content: center;
font-size: 20rpx; align-items: flex-start;
color: #999; padding-top: 20rpx;
}
.goods-region {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.goods-reserved {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
} }
/* 空商品样式 */ /* 空商品样式 */

Loading…
Cancel
Save