作者:Pluto,来自授权地址,本文作者还制作了另外一个不错的东西,在相关文章内; 效果图:
<view class="weui-flex__item"> <view class="placeholder" bindtap="selectCommentType" data-index="{{index}}" data-type="GOOD"> <image wx:if="{{item.commentType!='GOOD'}}" src="/images/icon_good.png" style="width:30rpx;height:30rpx;"></image> <text wx:if="{{item.commentType!='GOOD'}}" class="order_comment_type_default">好评</text> <!--选中--> <image wx:if="{{item.commentType=='GOOD'}}" src="/images/icon_good_select.png" style="width:30rpx;height:30rpx;"></image> <text wx:if="{{item.commentType=='GOOD'}}" class="order_comment_type_selected">好评</text> </view> </view>
selectCommentType: function (e) { console.log('选中的是第几条评论的哪一种类型', e.currentTarget.dataset); var commentList = this.data.commentList; var index = parseInt(e.currentTarget.dataset.index); commentList[index].commentType = e.currentTarget.dataset.type; this.setData({ 'commentList': commentList }); }
完整代码: wxml <form> <view class="order_comment_bg"> <view wx:for="{{commentList}}" style="background:#fff;"> <view class="order_comment_item"> <view class="weui-flex order_comment_content bottom_border"> <view> <view class="placeholder"> <image src="{{item.commodityIcon}}" class="order_comment_img"></image> </view> </view |
微信小程序-订单评价交互样式(WXML&WXSS&JS)
发布:2018-04-08 12:07浏览: 次来源:网络 作者:cola
免责声明:本站所有文章和图片均来自用户分享和网络收集,文章和图片版权归原作者及原出处所有,仅供学习与参考,请勿用于商业用途,如果损害了您的权利,请联系网站客服处理。
相关文章
- 微信小程序app.json文件常用配置说明2021-07-09
- 微信小程序文字控制单行超过显示省略号2021-07-09
- 微信小程序参数传递的几种方法2021-07-09
- 微信小程序使用button按钮分享2021-07-09
- 微信小程序的setData2021-07-09
- 小程序分享,获取openid2021-07-08
- 微信小程序-实现tab2021-07-08
- 微信开发者工具新建和导入小程序2021-07-08
- 微信小程序实现点击拍照长按录像功能2021-07-08
- 微信小程序必知知识2021-07-08