Commit 1c245d90 by hank

修改小程序模板详情

parent 0052c86f
......@@ -64,7 +64,7 @@
/* postcss-pxtransform rn eject enable */
overflow: hidden;
white-space: nowrap;
display: -webkit-box;
// display: -webkit-box;
text-overflow: ellipsis;
-webkit-line-clamp: $line;
......
......@@ -59,7 +59,7 @@ export function formatTime(date) {
const year = day * 365
console.log(typeof date)
if (typeof date === 'string') {
date = date.replace('-', '/')
date = date.replace(/-/g, '/')
}
let times = new Date(date).getTime()
const now = new Date().getTime()
......
......@@ -61,6 +61,36 @@
padding-top: 10px;
color: #ccc;
font-size: 28px;
width: 600px;
box-sizing: border-box;
position: relative;
.word {
width: 540px;
height: 35px;
text-overflow: ellipsis;
@include lamp-clamp(1);
}
.showAll {
color: #333;
text-decoration: underline;
position: absolute;
top: 10px;
right: 0;
}
}
.temp-top-describe-show {
padding-top: 10px;
color: #ccc;
font-size: 28px;
.showAll {
color: #333;
display: none;
}
}
.temp-top-collection {
......
......@@ -20,6 +20,7 @@ type PageState = {
collectionState: boolean
collectionId: string
current: 0
showAll: boolean
}
type IProps = PageStateProps & PageDispatchProps & PageOwnProps
......@@ -44,7 +45,6 @@ class DerailTop extends Component {
}
swiperChange(e) {
console.log(e, 'swiperChange')
this.setState({
current: e.detail.current
})
......@@ -97,7 +97,7 @@ class DerailTop extends Component {
render() {
let { templateUrl, templateName, templateDescribe, templateShow, templateId } = this.props
templateUrl = templateUrl || ''
const { collectionState, current } = this.state
const { collectionState, current, showAll } = this.state
let collectionUrl = collectionState
? 'http://visual-clouds.oss-cn-beijing.aliyuncs.com/miniprogram/collection-select.png'
: 'http://visual-clouds.oss-cn-beijing.aliyuncs.com/miniprogram/collection.png'
......@@ -134,8 +134,26 @@ class DerailTop extends Component {
<View className="temp-top-text-wrapper">
<View className="temp-top-title">{templateName}</View>
<View className="temp-top-describe">
<Text>{templateDescribe}</Text>
<View
className={
showAll && templateDescribe.length >= 20
? 'temp-top-describe-show'
: 'temp-top-describe'
}
>
<View className="word">{templateDescribe}</View>
{templateDescribe.length >= 20 && (
<View
className="showAll"
onClick={() => {
this.setState({
showAll: true
})
}}
>
展开
</View>
)}
</View>
{templateId ? (
<Image
......
......@@ -6,6 +6,7 @@
padding-bottom: 20px;
margin-bottom: 20px;
padding-left: 20px;
padding-right: 20px;
padding-top: 36px;
box-sizing: border-box;
......
......@@ -92,7 +92,7 @@ class TempDetail extends Component {
createFilm = () => {
Taro.navigateTo({
url: `/pages/home/tempaltes/film_detail?templateId=${this.$router.params.templateId}`
url: `/pages/home/tempaltes/film_detail?templateId=${this.props.templateId}`
})
// this.setState({ showModal: true })
}
......
......@@ -80,11 +80,13 @@ class Tempaltes extends Component {
templateId: ''
})
})
Taro.showTabBar()
}
componentDidShow() {
this.setState({
page: 1
page: 1,
templateId: ''
})
this.getData()
}
......
......@@ -32,7 +32,8 @@
position: absolute;
left: 26px;
top: 116px;
height: 50px;
height: 55px;
width: 37px;
.close {
position: absolute;
......
......@@ -75,7 +75,7 @@
&-scroll {
width: 100%;
height: 100%;
padding: 20px 20px 0;
padding: 20px 0;
padding-left: 0;
@include eject(box-sizing, border-box);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment