Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
mini-program
/
zhwy
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b62c2797
authored
Sep 26, 2023
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
家生活商品列表
1 parent
babd881b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
162 additions
and
31 deletions
packageIndex/components/GoodsItem/GoodsItem.wxss
packageIndex/pages/constant/lifeConstant.js
packageIndex/pages/homeLife/index.js
packageIndex/pages/homeLife/index.json
packageIndex/pages/homeLife/index.scss
packageIndex/pages/homeLife/index.wxml
packageIndex/components/GoodsItem/GoodsItem.wxss
View file @
b62c279
...
...
@@ -18,7 +18,6 @@
.goods-title-box {
display: flex;
max-width: 236rpx;
}
.goods-title-tips {
...
...
@@ -41,6 +40,7 @@
}
.goods-title-text {
max-width: 176rpx;
font-weight: 500;
font-size: 26rpx;
color: #333333;
...
...
packageIndex/pages/constant/lifeConstant.js
View file @
b62c279
...
...
@@ -127,10 +127,97 @@ const goodsList = [
}
]
const
classifyTitleList
=
[
'超值爆款'
,
'商品分类'
,
'商品分分分类'
]
const
classifyGoodsList1
=
[
{
goodsUrl
:
'https://img01.glsx.com.cn/group1/M00/0F/3B/wKgFDWTclNCAdRMqAAHIp1r8d3w346.png'
,
goodsStatus
:
1
,
name
:
'360全景导航'
,
view
:
9900
,
sale
:
1550
,
newPrice
:
129
,
oldPrice
:
169
},
{
goodsUrl
:
'https://img01.glsx.com.cn/group1/M00/0F/3B/wKgFDWTclNCAdRMqAAHIp1r8d3w346.png'
,
goodsStatus
:
2
,
name
:
'360全景导航导航导航导航'
,
view
:
9900
,
sale
:
1550
,
newPrice
:
129
,
oldPrice
:
169
},
{
goodsUrl
:
'https://img01.glsx.com.cn/group1/M00/0F/3B/wKgFDWTclNCAdRMqAAHIp1r8d3w346.png'
,
goodsStatus
:
1
,
name
:
'大闸蟹提货'
,
view
:
9900
,
sale
:
1550
,
newPrice
:
129
,
oldPrice
:
169
},
{
goodsUrl
:
'https://img01.glsx.com.cn/group1/M00/0F/3B/wKgFDWTclNCAdRMqAAHIp1r8d3w346.png'
,
goodsStatus
:
1
,
name
:
'大闸蟹提货大闸蟹提货'
,
view
:
9900
,
sale
:
1550
,
newPrice
:
129
,
oldPrice
:
169
}
]
const
classifyGoodsList2
=
[
{
goodsUrl
:
'https://img01.glsx.com.cn/group1/M00/0F/3B/wKgFDWTclNCAdRMqAAHIp1r8d3w346.png'
,
goodsStatus
:
1
,
name
:
'360全景导航'
,
view
:
9900
,
sale
:
1550
,
newPrice
:
129
,
oldPrice
:
169
},
{
goodsUrl
:
'https://img01.glsx.com.cn/group1/M00/0F/3B/wKgFDWTclNCAdRMqAAHIp1r8d3w346.png'
,
goodsStatus
:
1
,
name
:
'360全景导航导航导航导航'
,
view
:
9900
,
sale
:
1550
,
newPrice
:
129
,
oldPrice
:
169
}
]
const
classifyGoodsList3
=
[
{
goodsUrl
:
'https://img01.glsx.com.cn/group1/M00/0F/3B/wKgFDWTclNCAdRMqAAHIp1r8d3w346.png'
,
goodsStatus
:
1
,
name
:
'大闸蟹提货'
,
view
:
9900
,
sale
:
1550
,
newPrice
:
129
,
oldPrice
:
169
},
{
goodsUrl
:
'https://img01.glsx.com.cn/group1/M00/0F/3B/wKgFDWTclNCAdRMqAAHIp1r8d3w346.png'
,
goodsStatus
:
1
,
name
:
'大闸蟹提货大闸蟹提货'
,
view
:
9900
,
sale
:
1550
,
newPrice
:
129
,
oldPrice
:
169
}
]
export
{
recreationMenu
,
foodMenu
,
tripMenu
,
maintainCarMenu
,
goodsList
goodsList
,
classifyTitleList
,
classifyGoodsList1
,
classifyGoodsList2
,
classifyGoodsList3
}
\ No newline at end of file
packageIndex/pages/homeLife/index.js
View file @
b62c279
// packageIndex/pages/carLife/index.js
import
{
recreationMenu
,
foodMenu
}
from
'../constant/lifeConstant'
import
{
recreationMenu
,
foodMenu
,
classifyTitleList
,
classifyGoodsList1
,
classifyGoodsList2
,
classifyGoodsList3
,
}
from
"../constant/lifeConstant"
;
Page
({
/**
* 页面的初始数据
*/
data
:
{
recreationMenu
,
foodMenu
,
strategyList
:
[]
strategyList
:
[],
classifyTitleList
,
titleActive
:
0
,
goodsList
:
[],
classifyGoodsList1
,
classifyGoodsList2
,
classifyGoodsList3
,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
()
{
onLoad
()
{
this
.
getStrategyList
();
},
...
...
@@ -23,62 +35,56 @@ Page({
wx
.
p
.
api
.
strategyApi
.
getStrategyList
({
pageNum
:
1
,
pageSize
:
100
pageSize
:
100
,
})
.
then
((
res
)
=>
{
console
.
log
(
res
);
this
.
setData
({
strategyList
:
res
.
list
,
});
});
},
switchTitle
(
e
)
{
const
{
index
}
=
e
.
currentTarget
.
dataset
;
const
_list
=
[
'classifyGoodsList1'
,
'classifyGoodsList2'
,
'classifyGoodsList3'
]
this
.
setData
({
titleActive
:
index
,
goodsList
:
this
.
data
[
_list
[
index
]]
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady
()
{
},
onReady
()
{},
/**
* 生命周期函数--监听页面显示
*/
onShow
()
{
},
onShow
()
{},
/**
* 生命周期函数--监听页面隐藏
*/
onHide
()
{
},
onHide
()
{},
/**
* 生命周期函数--监听页面卸载
*/
onUnload
()
{
},
onUnload
()
{},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh
()
{
},
onPullDownRefresh
()
{},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom
()
{
},
onReachBottom
()
{},
/**
* 用户点击右上角分享
*/
onShareAppMessage
()
{
}
})
\ No newline at end of file
onShareAppMessage
()
{},
});
packageIndex/pages/homeLife/index.json
View file @
b62c279
...
...
@@ -2,7 +2,8 @@
"usingComponents"
:
{
"main-title"
:
"../../../components/MainTitle/MainTitle"
,
"menu-box"
:
"../../components/MenuBox/MenuBox"
,
"money-saving-tips"
:
"../../../components/MoneySavingTips/MoneySavingTips"
"money-saving-tips"
:
"../../../components/MoneySavingTips/MoneySavingTips"
,
"goods-swiper"
:
"../../components/GoodsSwiper/GoodsSwiper"
},
"navigationBarTitleText"
:
"家生活"
}
\ No newline at end of file
packageIndex/pages/homeLife/index.scss
View file @
b62c279
...
...
@@ -9,4 +9,35 @@
.title-box
{
margin
:
30rpx
0
20rpx
0
;
}
.classify-title-box
{
display
:
flex
;
align-items
:
baseline
;
}
.classify-title
{
font-weight
:
400
;
font-size
:
32rpx
;
color
:
#333333
;
margin-right
:
48rpx
;
}
.classify-title
:last-child
{
margin-right
:
0
;
}
.classify-title-active
{
position
:
relative
;
font-weight
:
500
;
font-size
:
36rpx
;
color
:
#333333
;
margin-right
:
48rpx
;
}
.
classify-title-active
:
:
after
{
content
:
""
;
display
:
block
;
/* width: 144rpx; */
width
:
100%
;
height
:
12rpx
;
background-image
:
linear-gradient
(
90deg
,
#61a5ff
00
0%
,
#2699fd
100%
);
border-radius
:
6rpx
;
position
:
absolute
;
bottom
:
4rpx
;
}
}
packageIndex/pages/homeLife/index.wxml
View file @
b62c279
...
...
@@ -8,5 +8,11 @@
<main-title title="美食推荐"></main-title>
</view>
<menu-box menuList="{{foodMenu}}"></menu-box>
<view class="title-box classify-title-box">
<view class="{{titleActive === index? 'classify-title-active':'classify-title'}}" wx:for="{{classifyTitleList}}" data-index="{{index}}" bind:tap="switchTitle">
{{item}}
</view>
</view>
<goods-swiper goodsList="{{goodsList.length ? goodsList : classifyGoodsList1}}"></goods-swiper>
</view>
<money-saving-tips list="{{strategyList}}"></money-saving-tips>
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment