本文实例为大家分享了微信小程序星级评价的具体代码,供大家参考,具体内容如下
效果图
wxml
{{starDesc}}
wxss
.assess-star { margin-top: 20rpx; } .star-wrap { width: 50vw; margin: 10rpx auto 10rpx auto; } .star-item { display: inline-block; height: 60rpx; width: 60rpx; margin-right: 10rpx; } .star-desc { font-size: 30rpx; font-family: PingFangSC-Regular; font-weight: 400; color: rgba(243, 162, 0, 1); text-align: center; }
js
Page({ /** * 页面的初始数据 */ data: { starDesc: '非常满意,无可挑剔', stars: [{ lightImg: '../../../../images/xing.png', blackImg: '../../../../images/xing1.png', flag: 1, message: '非常不满意,各方面都很差' }, { lightImg: '../../../../images/xing.png', blackImg: '../../../../images/xing1.png', flag: 1, message: '不满意,比较差' }, { lightImg: '../../../../images/xing.png', blackImg: '../../../../images/xing1.png', flag: 1, message: '一般,还要改善' }, { lightImg: '../../../../images/xing.png', blackImg: '../../../../images/xing1.png', flag: 1, message: '比较满意,仍要改善' }, { lightImg: '../../../../images/xing.png', blackImg: '../../../../images/xing1.png', flag: 1, message: '非常完美,无可挑剔' }] }, // 选择评价星星 starClick: function(e) { var that = this; for (var i = 0; i
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。