赞
踩
操作指引
代码部分
首先在app.json里面引入「评价发布组件」
{
"plugins": {
"wxacommentplugin": {
"version": "latest",
"provider": "wx82e6ae1175f264fa"
}
}
}
注意:// 必须填该评价组件appid,该示例值即为评价组件appid(复制时请去掉注释)
在xxx.js页面代码中添加代码
// js代码:
gopingjia: function () {
var plugin = requirePlugin("wxacommentplugin");
plugin.openComment({
success: (res) => {
console.log('plugin.openComment success', res)
},
fail: (res) => {
console.log('plugin.openComment fail', res)
}
})
},
在xxx.wxml页面代码中添加代码
<button bindtap="gopingjia" style="margin-top: 50px;background-color: #ff4444;color: #fff;">
用户评价
</button>
完整源码包下载:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。