evaluatePlan.vue 1.4 KB

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