dengjie commit :首页和详情页样式初步完成
This commit is contained in:
175
pages/detail/detail.vue
Normal file
175
pages/detail/detail.vue
Normal file
@@ -0,0 +1,175 @@
|
||||
<template>
|
||||
<view>
|
||||
<view v-for="(item,index) in detailList" :key="index">
|
||||
<u-image :src="item.src" width="750rpx" height="530rpx" :lazy-load="true">
|
||||
</u-image>
|
||||
<view class="collect">
|
||||
<u-icon :name="like?'heart-fill':'heart'" color="#FEAA19" size="23" @click.stop="likeTap"></u-icon>
|
||||
<view class="collect_text">收藏</view>
|
||||
</view>
|
||||
|
||||
<view class="content">
|
||||
<view class="title_box">
|
||||
<text class="title">{{item.title}}</text>
|
||||
<view class="title_tag">{{item.tag}}</view>
|
||||
</view>
|
||||
<view class="desc">
|
||||
{{item.desc}}
|
||||
</view>
|
||||
<view class="classify">
|
||||
{{item.classify}}
|
||||
</view>
|
||||
<view class="tagOne">{{item.tagOne}}</view>
|
||||
<view class="tagTwo">{{item.tagTwo}}</view>
|
||||
</view>
|
||||
|
||||
<view class="releaseDate">
|
||||
<u-image src="/static/products/sy_icon_sjf.png" width="24rpx" height="24rpx" :lazy-load="true">
|
||||
</u-image>
|
||||
<text class="release">发布日期:</text>
|
||||
<text>{{item.time}}</text>
|
||||
</view>
|
||||
<u-parse :content="item.content" @preview="preview" @navigate="navigate"></u-parse>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
like: false,
|
||||
detailList: [{
|
||||
src: '/static/detail/zhanwei_xppx.png',
|
||||
title: '锅巴',
|
||||
tag: '零食铺子',
|
||||
desc: '糯米蟹黄锅巴散装,非油炸绿色健康食品',
|
||||
classify: '薯片膨化',
|
||||
tagOne: '无添加剂',
|
||||
tagTwo: '无添加剂',
|
||||
time: '2022年12月04日',
|
||||
content: '<h1>走马灯</h1>'
|
||||
}]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
likeTap() {
|
||||
this.like = !this.like
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.collect {
|
||||
display: flex;
|
||||
position: absolute;
|
||||
top: 16rpx;
|
||||
right: 0;
|
||||
background-color: #a6a6a6;
|
||||
color: #fff;
|
||||
border-radius: 54rpx 0px 0px 54rpx;
|
||||
padding: 2px 2px 2px 3px;
|
||||
|
||||
.collect_text {
|
||||
font-size: 26rpx;
|
||||
padding: 1px;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 20rpx;
|
||||
background-color: #fff;
|
||||
|
||||
.title_box {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.title {
|
||||
font-size: 36rpx;
|
||||
font-weight: 400;
|
||||
color: #0EBB5B;
|
||||
line-height: 50rpx;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.title_tag {
|
||||
height: 30rpx;
|
||||
background: #0EBB5B;
|
||||
border-radius: 7rpx;
|
||||
font-size: 20rpx;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
line-height: 28rpx;
|
||||
padding: 1rpx 15rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.desc {
|
||||
font-size: 30rpx;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #3E3E3E;
|
||||
line-height: 34rpx;
|
||||
padding: 15rpx 0;
|
||||
}
|
||||
|
||||
.classify {
|
||||
width: 80rpx;
|
||||
height: 30rpx;
|
||||
border-radius: 6rpx;
|
||||
border: 1rpx solid #EEEEEE;
|
||||
font-size: 20rpx;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
line-height: 28rpx;
|
||||
padding: 1rpx 15rpx;
|
||||
}
|
||||
|
||||
.tagOne {
|
||||
font-size: 20rpx;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #CCCCCC;
|
||||
line-height: 28rpx;
|
||||
float: left;
|
||||
padding-top: 14rpx;
|
||||
padding-right: 20rpx;
|
||||
}
|
||||
|
||||
.tagTwo {
|
||||
font-size: 20rpx;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #CCCCCC;
|
||||
line-height: 28rpx;
|
||||
padding-top: 14rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.releaseDate {
|
||||
font-size: 24rpx;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
line-height: 33rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 24rpx 20rpx;
|
||||
margin-top: 20rpx;
|
||||
background-color: #fff;
|
||||
|
||||
|
||||
.release {
|
||||
padding: 0 10rpx 0 6rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user