mirror of
https://github.com/weilanwl/coloruicss.git
synced 2026-06-08 15:04:47 +08:00
xiaogang
ColorUI 源代码
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
|
||||
Page({
|
||||
data: {
|
||||
rating: [{
|
||||
id: 0,
|
||||
title: '描述相符',
|
||||
scores: 0,
|
||||
}, {
|
||||
id: 1,
|
||||
title: '物流服务',
|
||||
scores: 0,
|
||||
}, {
|
||||
id: 2,
|
||||
title: '服务态度',
|
||||
scores: 0,
|
||||
}]
|
||||
},
|
||||
onLoad: function (options) {
|
||||
|
||||
},
|
||||
setScores: function (e) {
|
||||
var id = e.currentTarget.dataset.id;
|
||||
var index = e.currentTarget.dataset.index;
|
||||
this.data.rating[id].scores = index;
|
||||
this.setData({
|
||||
rating: this.data.rating
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1,21 @@
|
||||
<view class="bar solid-bottom">
|
||||
<view class='ml-sm'>
|
||||
<text class='iconfont icon-titles success-text'></text>
|
||||
<text class='text-lg ml-xs'>星级评分</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class='doc-main'>
|
||||
<view class='rating-item' wx:for="{{rating}}" wx:for-item="rat">
|
||||
<view class='rating-title'>{{rat.title}}</view>
|
||||
<view class='rating-star'>
|
||||
<text wx:for="{{5}}" class="iconfont {{index<rat.scores?'icon-favorfill warning-text':'icon-favor gray-text'}}" bindtap='setScores' data-id='{{rat.id}}' data-index='{{index+1}}'></text>
|
||||
</view>
|
||||
<view class='rating-text gray-text'>
|
||||
<text wx:if="{{rat.scores==5}}">非常好</text>
|
||||
<text wx:if="{{rat.scores==4}}">好</text>
|
||||
<text wx:if="{{rat.scores==3}}">一般</text>
|
||||
<text wx:if="{{rat.scores==2}}">差</text>
|
||||
<text wx:if="{{rat.scores==1}}">非常差</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,14 @@
|
||||
page{
|
||||
background: #f5f5f5;
|
||||
}
|
||||
.rating-item{
|
||||
display: flex;
|
||||
line-height: 60rpx;
|
||||
}
|
||||
.rating-title,.rating-star {
|
||||
padding: 0 10rpx;
|
||||
}
|
||||
.rating-star text{
|
||||
padding: 0 10rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
Reference in New Issue
Block a user