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 8f622f43
authored
Sep 25, 2023
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
商品横向滚动完成
1 parent
ecbbebc9
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
197 additions
and
4 deletions
packageIndex/components/GoodsItem/GoodsItem.js
packageIndex/components/GoodsItem/GoodsItem.json
packageIndex/components/GoodsItem/GoodsItem.wxml
packageIndex/components/GoodsItem/GoodsItem.wxss
packageIndex/components/GoodsSwiper/GoodsSwiper.js
packageIndex/components/GoodsSwiper/GoodsSwiper.json
packageIndex/components/GoodsSwiper/GoodsSwiper.wxml
packageIndex/components/GoodsSwiper/GoodsSwiper.wxss
packageIndex/pages/carLife/index.js
packageIndex/pages/carLife/index.json
packageIndex/pages/carLife/index.wxml
packageIndex/pages/constant/lifeConstant.js
packageIndex/components/GoodsItem/GoodsItem.js
0 → 100644
View file @
8f622f4
Component
({
data
:
{},
properties
:
{
goodsItem
:
{
type
:
Object
,
value
:
{}
}
},
methods
:
{}
})
\ No newline at end of file
packageIndex/components/GoodsItem/GoodsItem.json
0 → 100644
View file @
8f622f4
{
"component"
:
true
}
\ No newline at end of file
packageIndex/components/GoodsItem/GoodsItem.wxml
0 → 100644
View file @
8f622f4
<view class="goods-item">
<image class="goods-img" src="{{goodsItem.goodsUrl}}" />
<view class="goods-content-box">
<view class="goods-title-box">
<view class="goods-title-tips {{goodsItem.goodsStatus == 1 ? 'goods-title-tips-new': 'goods-title-tips-miao'}}">
{{goodsItem.goodsStatus == 1 ? '上新' : '秒杀'}}
</view>
<view class="goods-title-text">{{goodsItem.name}}</view>
</view>
<view class="goods-msg">{{goodsItem.view}}查看 | 售出{{goodsItem.sale}}</view>
<view class="goods-price-box">
<view class="goods-new-price-box">
<text class="goods-new-price-icon">¥</text>
<text class="goods-new-price-text">{{goodsItem.newPrice}}</text>
</view>
<view class="goods-old-price-box">¥{{goodsItem.oldPrice}}</view>
</view>
</view>
</view>
\ No newline at end of file
packageIndex/components/GoodsItem/GoodsItem.wxss
0 → 100644
View file @
8f622f4
.goods-item {
background: #ffffff;
}
.goods-img {
width: 276rpx;
height: 280rpx;
border-radius: 8rpx 8rpx 0 0;
-webkit-border-radius: 8rpx 8rpx 0 0;
-moz-border-radius: 8rpx 8rpx 0 0;
-ms-border-radius: 8rpx 8rpx 0 0;
-o-border-radius: 8rpx 8rpx 0 0;
}
.goods-content-box {
padding: 20rpx;
}
.goods-title-box {
display: flex;
max-width: 236rpx;
}
.goods-title-tips {
width: 60rpx;
height: 28rpx;
border-radius: 4rpx;
font-weight: 400;
font-size: 20rpx;
color: #ffffff;
line-height: 28rpx;
text-align: center;
}
.goods-title-tips-new {
background: #70b2ff;
}
.goods-title-tips-miao {
background: #f94a36;
}
.goods-title-text {
font-weight: 500;
font-size: 26rpx;
color: #333333;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.goods-msg {
font-weight: 400;
font-size: 20rpx;
color: #d79736;
margin-top: 8rpx;
}
.goods-price-box {
display: flex;
align-items: baseline;
margin-top: 12rpx;
}
.goods-new-price-box {
font-weight: 600;
color: #ec3c1f;
}
.goods-new-price-icon {
font-size: 24rpx;
}
.goods-new-price-text {
font-size: 40rpx;
}
.goods-old-price-box {
font-weight: 400;
font-size: 22rpx;
color: #999999;
text-decoration: line-through;
}
packageIndex/components/GoodsSwiper/GoodsSwiper.js
0 → 100644
View file @
8f622f4
Component
({
data
:
{},
properties
:
{
goodsList
:
{
type
:
Array
,
value
:
[]
}
},
methods
:
{}
})
\ No newline at end of file
packageIndex/components/GoodsSwiper/GoodsSwiper.json
0 → 100644
View file @
8f622f4
{
"component"
:
true
,
"usingComponents"
:
{
"goods-item"
:
"../GoodsItem/GoodsItem"
}
}
\ No newline at end of file
packageIndex/components/GoodsSwiper/GoodsSwiper.wxml
0 → 100644
View file @
8f622f4
<view class="goods-swiper">
<scroll-view class="goods-list" enable-flex scroll-x>
<view class="cell" wx:for="{{goodsList}}" wx:key="index">
<goods-item goodsItem="{{item}}"></goods-item>
</view>
</scroll-view>
</view>
\ No newline at end of file
packageIndex/components/GoodsSwiper/GoodsSwiper.wxss
0 → 100644
View file @
8f622f4
.goods-list {
height: 448rpx;
display: flex;
flex-direction: row;
box-sizing: border-box;
}
.goods-list .cell {
margin: 0 12rpx 0 0;
}
.goods-list .cell:last-child {
margin: 0;
}
\ No newline at end of file
packageIndex/pages/carLife/index.js
View file @
8f622f4
// packageIndex/pages/carLife/index.js
import
{
tripMenu
,
maintainCarMenu
}
from
'../constant/lifeConstant'
import
{
tripMenu
,
maintainCarMenu
,
goodsList
}
from
'../constant/lifeConstant'
Page
({
/**
...
...
@@ -7,7 +7,8 @@ Page({
*/
data
:
{
tripMenu
,
maintainCarMenu
maintainCarMenu
,
goodsList
},
/**
...
...
packageIndex/pages/carLife/index.json
View file @
8f622f4
{
"usingComponents"
:
{
"main-title"
:
"../../components/MainTitle/MainTitle"
,
"menu-box"
:
"../../components/MenuBox/MenuBox"
"menu-box"
:
"../../components/MenuBox/MenuBox"
,
"goods-swiper"
:
"../../components/GoodsSwiper/GoodsSwiper"
},
"navigationBarTitleText"
:
"车生活"
}
\ No newline at end of file
packageIndex/pages/carLife/index.wxml
View file @
8f622f4
...
...
@@ -11,4 +11,5 @@
<view class="title-box">
<main-title title="甄选车品"></main-title>
</view>
<goods-swiper goodsList="{{goodsList}}"></goods-swiper>
</view>
packageIndex/pages/constant/lifeConstant.js
View file @
8f622f4
...
...
@@ -88,9 +88,49 @@ const maintainCarMenu = [
}
]
const
goodsList
=
[
{
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
},
{
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
}
]
export
{
recreationMenu
,
foodMenu
,
tripMenu
,
maintainCarMenu
maintainCarMenu
,
goodsList
}
\ 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