123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- const _my = require("../../__antmove/api/index.js")(my);
- const wx = _my;
- // components/radioAndcheckbox/index.js
- Component({
- /**
- * 组件的属性列表
- */
- properties: {
- // picker类型
- type: {
- type: String,
- value: "checkbox"
- },
- // 未选择时提示
- placeholder: {
- type: Array,
- value: ["请选择"]
- },
- // 数据列表
- list: {
- type: Array,
- value: []
- },
- // 显示参数key
- rangeKey: {
- type: String,
- value: ""
- },
- // 选择下标
- index: {
- type: Number,
- value: null
- },
- // 日期时间选择器
- dateTime: {
- type: String,
- value: null
- },
- delay: {
- type: Number,
- value: null
- },
- chooseBuilding: {
- type: Boolean,
- value: false
- },
- className: {
- type: String,
- value: ""
- },
- sn: {
- type: Boolean,
- value: false
- }
- },
- /**
- * 组件的初始数据
- */
- data: {
- radio: null,
- checkbox: null
- },
- /**
- * 组件的方法列表
- */
- methods: {
- // 确定
- sure() {
- if (this.data.type == "radio") {
- if (this.data.radio) {
- this.setData({
- chooseBuilding: false
- });
- this.triggerEvent("change", this.data.radio);
- } else {
- wx.showToast({
- title: "请选择",
- icon: "none"
- });
- }
- } else if (this.data.type == "checkbox") {
- if (this.data.checkbox) {
- this.setData({
- chooseBuilding: false
- });
- this.triggerEvent("change", this.data.checkbox);
- } else {
- wx.showToast({
- title: "请选择",
- icon: "none"
- });
- }
- }
- },
- // 关闭租赁楼幢弹出框
- crossBuilding(e) {
- this.setData({
- chooseBuilding: false
- });
- },
- // 多选框
- checkboxChange(e) {
- this.data.checkbox = e.detail.value;
- },
- // 单选框
- chooserRadio(e) {
- this.setData({
- radio: e.detail.value
- });
- },
- antmoveAction: function () {
- //执行时动态赋值,请勿删除
- }
- }
- });
|