1 line
8.9 KiB
Plaintext
1 line
8.9 KiB
Plaintext
|
{"version":3,"file":"su-region-picker.js","sources":["../../../../../../src/sheep/ui/su-region-picker/su-region-picker.vue","../../../../../../uniComponent:/RDovQXBwL1dvcmsvYWRkci9hY2RyLXVpL3NyYy9zaGVlcC91aS9zdS1yZWdpb24tcGlja2VyL3N1LXJlZ2lvbi1waWNrZXIudnVl"],"sourcesContent":["<!-- 省市区选择弹窗 -->\r\n<template>\r\n <su-popup :show=\"show\" @close=\"onCancel\" round=\"20\">\r\n <view class=\"ui-region-picker\">\r\n <su-toolbar\r\n :cancelColor=\"cancelColor\"\r\n :confirmColor=\"confirmColor\"\r\n :cancelText=\"cancelText\"\r\n :confirmText=\"confirmText\"\r\n title=\"选择区域\"\r\n @cancel=\"onCancel\"\r\n @confirm=\"onConfirm('confirm')\"\r\n />\r\n <view class=\"ui-picker-body\">\r\n <picker-view\r\n :value=\"state.currentIndex\"\r\n @change=\"change\"\r\n class=\"ui-picker-view\"\r\n @pickstart=\"pickstart\"\r\n @pickend=\"pickend\"\r\n >\r\n <picker-view-column>\r\n <view class=\"ui-column-item\" v-for=\"province in provinceList\" :key=\"province.id\">\r\n <view :style=\"getSizeByNameLength(province.name)\">{{ province.name }}</view>\r\n </view>\r\n </picker-view-column>\r\n <picker-view-column>\r\n <view class=\"ui-column-item\" v-for=\"city in cityList\" :key=\"city.id\">\r\n <view :style=\"getSizeByNameLength(city.name)\">{{ city.name }}</view>\r\n </view>\r\n </picker-view-column>\r\n <picker-view-column>\r\n <view class=\"ui-column-item\" v-for=\"district in districtList\" :key=\"district.id\">\r\n <view :style=\"getSizeByNameLength(district.name)\">{{ district.name }}</view>\r\n </view>\r\n </picker-view-column>\r\n </picker-view>\r\n </view>\r\n </view>\r\n </su-popup>\r\n</template>\r\n\r\n<script setup>\r\n/**\r\n * picker picker弹出选择器\r\n * @property {Object} params 需要显示的参\r\n * @property {Boolean} safe-area-inset-bottom 是否开启底部安全区适配(默认false)\r\n * @property {Boolean} show-time-tag 时间模式时,是否显示后面的年月日中文提示\r\n * @property {String} cancel-color 取消按钮的颜色\r\n * @property {String} confirm-color 确认按钮的颜色\r\n * @property {String} confirm-text 确认按钮的文字\r\n * @property {String} cancel-text 取消按钮的文字\r\n * @property {String} default-region 默认选中的地区,\r\n * @property {String} default-code 默认选中的地区\r\n * @property {Boolean} mask-close-able 是否允许通过点击遮罩关闭Picker(默认true)\r\n * @property {String Number} z-index 弹出时的z-index值(默认1075)\r\n * @property {Array} default-selector 数组形式,其中每一项表示选择了range对应项中的第几个\r\n * @property {String} range-key 当range参数的元素为对象时,指定Object中的哪个key的值作为选择器显示内容\r\n * @event {Function} confirm 点击确定按钮,返回当前选择的值\r\n * @event {Function} cancel 点击取消按钮,返回当前选择的值\r\n */\r\nimport { computed, reactive } from 'vue'\r\nconst props = defineProps({\r\n show: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n // \"取消\"按钮的颜色\r\n cancelColor: {\r\n type: String,\r\n default: '#6666',\r\n },\r\n // \"确定\"按钮的颜色\r\n confirmColor: {\r\n type: String,\r\n default: 'var(--ui-BG-Main)',\r\n },\r\n // 取消按钮的文字\r\n cancelText: {\r\n type: String,\r\n default: '取消',\r\n },\r\n // 确认按钮的文字\r\n confirmText: {\r\n type: String,\r\n default: '确认',\r\n },\r\n})\r\nconst areaData = uni.getStorageSync('areaData')\r\n\r\nconst getSizeByNameLength = (name) => {\r\n const length = name.length\r\n if (length <= 7) return ''\r\n if (length < 9) {\r\n return 'font-size:28rpx'\r\n } else {\r\n return 'font-size: 24rpx'\r\n }\r\n}\r\nconst state = react
|