| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <template>
- <view class="select">
- <view class="title p-30 row-justify-sb">
- <view class="icon"></view>
- <text class="size-30 sys-weight-600">{{title}}</text>
- <view class="icon">
- <uni-icons :animation="animationData" class="dropdown-icon" type="closeempty" size="16"
- color="#666"></uni-icons>
- </view>
- </view>
- <view class="select">
- <scroll-view scroll-y="true" class="scroll-Y select">
- <view id="demo1" class="scroll-view-item" v-for="(item,index) in localData" @click="onSelect(index)">
- <text class="size-28 color-0FB160">{{item[itemText]}}</text>
- </view>
- </scroll-view>
- </view>
- <EnButton :is_fixed="false"></EnButton>
- </view>
- </template>
- <script>
- import EnButton from "@/components/en-utils/en-button/en-button.vue";
- export default {
- name: 'peak_chart',
- props: {
- title: {
- type: String,
- default: '选择'
- },
- localData: {
- default: []
- },
- itemKey:{
- type:String,
- default:'id'
- },
- itemText:{
- type:String,
- default:'name'
- },
- value:{
- default:''
- }
- },
- components: {
- EnButton
- },
- data() {
- return {
- current: 0,
- };
- },
- watch:{
- 'value':function () {
- if(this.current!==this.value){
- this.current=this.value
- }
- }
- },
- methods: {
- onSelect(index) {
- this.$emit('onChange', index)
- this.$emit('input', this.localData[index][this.itemKey])
- }
- }
- }
- </script>
- <style lang="scss">
- .select {
- height: 800rpx;
- }
- .icon {
- width: 40rpx;
- text-align: right;
- }
- .scroll-view-item {
- height: 90rpx;
- line-height: 90rpx;
- text-align: center;
- background: rgba(15, 177, 96, 0.1);
- border-radius: 10rpx;
- border: 1rpx solid #0FB160;
- margin: 16rpx 30rpx;
- }
- </style>
|