Commit 4d886b4b authored by Damon's avatar Damon

完工页面-scroll-view方案

parent 220595a7
; ;
(function() { (function() {
let NODE_ENV = 'dev'; // dev:开发环境 | test:测试环境 | prod:生产环境 let NODE_ENV = 'test'; // dev:开发环境 | test:测试环境 | prod:生产环境
let ENV_VAR = null; let ENV_VAR = null;
if (process.env.NODE_ENV === "development") { if (process.env.NODE_ENV === "development") {
if (NODE_ENV === 'dev') { if (NODE_ENV === 'dev') {
......
<!-- ******************* 单个下拉选择 ******************* --> <!-- ******************* 单个下拉选择 ******************* -->
<template> <template>
<view class="xh-select" :style="{'width': fieldsWidth}"> <view class="xh-select" :style="{'width': fieldsWidth}">
<u-input :value="text" disabled @click="show=true" :placeholder="placeholder" :placeholder-style="placeholderStyle" <!-- <u-input :value="text" disabled @click="show=true" :placeholder="placeholder" :placeholder-style="placeholderStyle"
:custom-style="customStyle" :clearable="false"></u-input> :custom-style="customStyle" :clearable="false"></u-input>
<u-select :list="settings" v-model="show" @confirm="actionSheetCallback" safe-area-inset-bottom></u-select> <u-select :list="settings" v-model="show" @confirm="actionSheetCallback" safe-area-inset-bottom></u-select>
<u-icon class="input-icon" :name="show ? 'arrow-up' : 'arrow-down'"></u-icon> <u-icon class="input-icon" :name="show ? 'arrow-up' : 'arrow-down'"></u-icon> -->
<view class="u-flex u-row-between picker-common">
<picker mode="selector" :value="index" range-key="label" :range="settings" @click="show = true" @change="pickerChange" class="u-flex-1">
<view class="txt">{{text}}</view>
</picker>
<u-icon class="input-icon" color="#2272FF" :name="show ? 'arrow-up' : 'arrow-down'"></u-icon>
</view>
</view> </view>
</template> </template>
...@@ -80,7 +87,13 @@ ...@@ -80,7 +87,13 @@
const id = event[0].value const id = event[0].value
this.dataValue = id this.dataValue = id
this.valueChange(id) this.valueChange(id)
} },
pickerChange(data) {
const index = data.detail.value
const id = this.item.fieldsOptions[index].key
this.dataValue = id
this.valueChange(id)
},
} }
} }
</script> </script>
...@@ -95,5 +108,17 @@ ...@@ -95,5 +108,17 @@
color: #2272FF; color: #2272FF;
} }
} }
.picker-common {
min-height: 35px;
background-color: #F4F5F7;
border-radius: 6px;
color: #333333;
padding-left: 10px;
padding-right: 12px;
width: 100%;
height: 38px;
.txt {
font-size: 14px;
}
}
</style> </style>
<!-- ******************* 单级/多级 选择 ******************* --> <!-- ******************* 单级/多级 选择 ******************* -->
<template> <template>
<view class="picker-box" :style="{'width': fieldsWidth}"> <view class="picker-box" :style="{'width': fieldsWidth}">
<view class="u-flex u-row-between text-view" @click="openPicker"> <!-- <view class="u-flex u-row-between text-view" @click="openPicker">
<view class="txt u-flex-1 text-title">{{text||''}}</view> <view class="txt u-flex-1 text-title">{{text||''}}</view>
<u-icon class="input-icon" color="#2272FF" :name="showPicker ? 'arrow-up' : 'arrow-down'"></u-icon> <u-icon class="input-icon" color="#2272FF" :name="showPicker ? 'arrow-up' : 'arrow-down'"></u-icon>
</view> </view>
<u-picker v-model="showPicker" range-key="label" @columnchange="columnchange" :mode="isNotMulti?'selector':'multiSelector'" @confirm="pickerConfirm" :range="settings"></u-picker> <u-picker v-model="showPicker" range-key="label" @columnchange="columnchange" :mode="isNotMulti?'selector':'multiSelector'" @confirm="pickerConfirm" :range="settings"></u-picker> -->
<view class="u-flex u-row-between picker-common">
<picker :mode="isNotMulti?'selector':'multiSelector'" :value="index" range-key="label" :range="settings" @click="showPicker = true" @change="pickerChange" class="txt u-flex-1">
<view>{{text}}</view>
</picker>
<u-icon class="input-icon" color="#2272FF" :name="showPicker ? 'arrow-up' : 'arrow-down'"></u-icon>
</view>
<!-- :default-selector='[0, 1]' --> <!-- :default-selector='[0, 1]' -->
<u-toast ref="uToast" /> <u-toast ref="uToast" />
</view> </view>
...@@ -57,7 +63,8 @@ ...@@ -57,7 +63,8 @@
isNotMulti:true, isNotMulti:true,
showPicker:false, showPicker:false,
settings:[], settings:[],
measure:[] measure:[],
index: ''
} }
}, },
computed: { computed: {
...@@ -145,6 +152,18 @@ ...@@ -145,6 +152,18 @@
} }
this.valueChange(JSON.stringify(result)) this.valueChange(JSON.stringify(result))
}, },
pickerChange(data) {
this.showPicker = false
this.index = data.detail.value
let result = []
if(this.isMulti){// 维修
}else{// 安装
result.push(this.measure[this.index])
}
this.valueChange(JSON.stringify(result))
},
columnchange(data){ columnchange(data){
// // 树列改变时进行联动操作 // // 树列改变时进行联动操作
// const {column ,index} = data // const {column ,index} = data
...@@ -155,6 +174,19 @@ ...@@ -155,6 +174,19 @@
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.picker-common {
min-height: 35px;
background-color: #F4F5F7;
border-radius: 6px;
color: #333333;
padding-left: 10px;
padding-right: 12px;
width: 100%;
height: 38px;
.txt {
font-size: 14px;
}
}
.text-view { .text-view {
background-color: #F4F5F7; background-color: #F4F5F7;
border-radius: 12rpx; border-radius: 12rpx;
......
<!-- ******************* 输入框 ******************* --> <!-- ******************* 输入框 ******************* -->
<template> <template>
<view class="picker-box"> <view class="picker-box">
<view class="u-flex u-row-between" @click="openPicker"> <!-- <view class="u-flex u-row-between" @click="openPicker">
<!-- <view class="txt">{{item.fieldsTitle}}</view> -->
<view class="txt u-flex-1">{{dataValue||'请选择时间'}}</view> <view class="txt u-flex-1">{{dataValue||'请选择时间'}}</view>
<u-icon name="arrow-right" color="#666" size="28"></u-icon> <u-icon name="arrow-right" color="#666" size="28"></u-icon>
</view> -->
<!-- <u-picker :params="params" v-model="showPicker" mode="time" @confirm="pickerConfirm"></u-picker> -->
<view class="u-flex u-row-between">
<picker mode="date" :value="dataValue" @change="bindDateChange" class="txt u-flex-1">
<view>{{dataValue}}</view>
</picker>
<u-icon name="arrow-right" color="#666" size="28"></u-icon>
</view> </view>
<u-picker :params="params" v-model="showPicker" mode="time" @confirm="pickerConfirm"></u-picker>
<!-- <u-picker v-model="showPicker" :rangeKey="rangeKey" @columnchange="columnchange" mode="multiSelector" @confirm="pickerConfirm" :default-selector='[0, 1]' :range="settings"></u-picker> -->
</view> </view>
</template> </template>
...@@ -29,19 +33,10 @@ ...@@ -29,19 +33,10 @@
minute: false, minute: false,
second: false, second: false,
timestamp: true, timestamp: true,
}
}
}, },
computed: { date: '请选择',
type() {
if (this.item && this.item.fieldsType == 'password') {
return this.item.fieldsType
} else {
return 'text'
}
} }
}, },
watch: {},
mounted() {}, mounted() {},
methods: { methods: {
openPicker() { openPicker() {
...@@ -53,6 +48,11 @@ ...@@ -53,6 +48,11 @@
this.dataValue = dataValue this.dataValue = dataValue
this.valueChange(dataValue) this.valueChange(dataValue)
}, },
bindDateChange: function(e) {
const value = e.target.value
this.dataValue = value
this.valueChange(value)
}
} }
} }
</script> </script>
......
...@@ -11,15 +11,10 @@ ...@@ -11,15 +11,10 @@
<text class="u-line-1">{{item.name}}</text> <text class="u-line-1">{{item.name}}</text>
</view> </view>
</scroll-view> </scroll-view>
<view class="right-boxs"> <scroll-view :scroll-top="scrollRightTop" scroll-y enhanced scroll-with-animation class="right-box" @scroll="rightScroll">
<scroll-view :scroll-top="scrollRightTop" scroll-y scroll-with-animation class="right-box" @scroll="rightScroll">
</scroll-view>
<view class="form-list" @touchmove="handleTouchstart">
<u-form :model="form" ref="uForm"> <u-form :model="form" ref="uForm">
<template v-for="(groupItem, groupIndex) in (list.length>0?list[tabIndex].items:[])"> <template v-for="(groupItem, groupIndex) in (list.length>0?list[tabIndex].items:[])">
<view class="class-item" :key="groupIndex" v-show="current == groupIndex"> <view class="class-item" :key="groupIndex">
<view class="title" v-if="groupItem.name !== '基本信息'">{{groupItem.name}}</view> <view class="title" v-if="groupItem.name !== '基本信息'">{{groupItem.name}}</view>
<view class="class-bd"> <view class="class-bd">
<u-form-item v-for="(item,itemIndex) in groupItem.items" :key="itemIndex" label-position="top" <u-form-item v-for="(item,itemIndex) in groupItem.items" :key="itemIndex" label-position="top"
...@@ -86,8 +81,7 @@ ...@@ -86,8 +81,7 @@
</view> </view>
</template> </template>
</u-form> </u-form>
</view> </scroll-view>
</view>
</view> </view>
<view :class="['btn-wrap', 'flex-xc', {'btn-bottom': tabIndex > 0}]"> <view :class="['btn-wrap', 'flex-xc', {'btn-bottom': tabIndex > 0}]">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment