evaluatePlan.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <!-- @rightClick 只有有右边部分的情况下才使用,
  3. 右边默认为空,可以使用slot="right" 自定义右边内容
  4. @ok 是单选或多选最终返回的结果
  5. types 类型 radio或checkbox
  6. titleKeys 标题对应的字段名称key,默认是name
  7. listData 是数据
  8. showArrow 是否显示右边箭头
  9. -->
  10. <uni-check-list :listData="list" types="radio" @ok="chooseOk" @rightClick="viewDetail">
  11. <view slot="right">
  12. 详情
  13. </view>
  14. </uni-check-list>
  15. </template>
  16. <script>
  17. export default {
  18. data() {
  19. return {
  20. list: [
  21. {
  22. id: '1232',
  23. name: '爱的街坊邻居爱上了对方加拉附件爱的街坊邻居爱上了对方加拉附件',
  24. },
  25. {
  26. id: '2223',
  27. name: 'banner',
  28. },
  29. {
  30. id: '3333',
  31. name: 'orange',
  32. }
  33. ],
  34. value: '',
  35. }
  36. },
  37. methods: {
  38. // 选中方案,item 返回的是数组
  39. chooseOk(item) {
  40. console.log(item)
  41. if(item.length==0){
  42. uni.showToast({
  43. icon:'none',
  44. title:'请选择考评方案'
  45. })
  46. }else{
  47. //关闭当前页面,这里处理数据逻辑
  48. }
  49. },
  50. // 查看详情
  51. viewDetail(item){
  52. uni.navigateTo({
  53. url:"/pages/evaluatePlan/planDetail?id="+item.id
  54. })
  55. }
  56. }
  57. }
  58. </script>
  59. <style lang="scss">
  60. page{
  61. height: 100%;
  62. }
  63. </style>