rating.js 497 B

1234567891011121314151617181920212223242526272829
  1. Page({
  2. data: {
  3. rating: [{
  4. id: 0,
  5. title: '描述相符',
  6. scores: 0,
  7. }, {
  8. id: 1,
  9. title: '物流服务',
  10. scores: 0,
  11. }, {
  12. id: 2,
  13. title: '服务态度',
  14. scores: 0,
  15. }]
  16. },
  17. onLoad: function (options) {
  18. },
  19. setScores: function (e) {
  20. var id = e.currentTarget.dataset.id;
  21. var index = e.currentTarget.dataset.index;
  22. this.data.rating[id].scores = index;
  23. this.setData({
  24. rating: this.data.rating
  25. })
  26. }
  27. })