12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <template>
- <!-- @rightClick 只有有右边部分的情况下才使用,
- 右边默认为空,可以使用slot="right" 自定义右边内容
- @ok 是单选或多选最终返回的结果
- types 类型 radio或checkbox
- titleKeys 标题对应的字段名称key,默认是name
- listData 是数据
- -->
- <uni-check-list :listData="list" types="radio" @ok="chooseOk" @rightClick="viewDetail">
- <view slot="right">
- 详情 <u-icon name="icon-xian-11" custom-prefix="xd-icon" size="28" color="#888888"></u-icon>
- </view>
- </uni-check-list>
- </template>
- <script>
- export default {
- data() {
- return {
- list: [
- {
- id: '1232',
- name: '爱的街坊邻居爱上了对方加拉附件爱的街坊邻居爱上了对方加拉附件',
- },
- {
- id: '2223',
- name: 'banner',
- },
- {
- id: '3333',
- name: 'orange',
- }
- ],
- value: '',
- }
- },
- methods: {
- // 选中方案,item 返回的是数组
- chooseOk(item) {
- console.log(item)
- if(item.length==0){
- uni.showToast({
- icon:'none',
- title:'请选择考评方案'
- })
- }else{
- //关闭当前页面,这里处理数据逻辑
- }
- },
- // 查看详情
- viewDetail(item){
- uni.navigateTo({
- url:"/pages/evaluatePlan/planDetail?id="+item.id
- })
- }
- }
- }
- </script>
- <style lang="scss">
- page{
- height: 100%;
- }
- </style>
|