Commit a0ac102a authored by Damon's avatar Damon

完工信息异常项目定位

parent d2c7023e
...@@ -5,20 +5,20 @@ ...@@ -5,20 +5,20 @@
<u-navbar :background="{background: '#2272FF'}" back-icon-color="#fff" :title-size="32" title-color="#fff" :border-bottom="false" title="完工信息" title-bold></u-navbar> <u-navbar :background="{background: '#2272FF'}" back-icon-color="#fff" :title-size="32" title-color="#fff" :border-bottom="false" title="完工信息" title-bold></u-navbar>
<u-tabs class="order-tabs" ref="tabs" :current="tabIndex" name="panelName" :list="list" @change="tabsChange" :is-scroll="false" bg-color="#2272FF" inactive-color="#a6c6ff" active-color="#fff" height="80" font-size="32"></u-tabs> <u-tabs class="order-tabs" ref="tabs" :current="tabIndex" name="panelName" :list="list" @change="tabsChange" :is-scroll="false" bg-color="#2272FF" inactive-color="#a6c6ff" active-color="#fff" height="80" font-size="32"></u-tabs>
<view class="u-menu-wrap"> <view class="u-menu-wrap">
<scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view" :scroll-top="scrollTop" :scroll-into-view="itemId" v-if="list[tabIndex].items.length > 1"> <scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view" :scroll-top="scrollTop" v-if="list[tabIndex].items.length > 1">
<view v-for="(item,index) in list[tabIndex].items" :key="index" class="u-tab-item" <view v-for="(item,index) in list[tabIndex].items" :key="index" class="u-tab-item"
:class="[current == index ? 'u-tab-item-active' : '']" @tap.stop="swichMenu(index)"> :class="[current == index ? 'u-tab-item-active' : '']" @tap.stop="swichMenu(index)">
<text class="u-line-1">{{item.name}}</text> <text class="u-line-1">{{item.name}}</text>
</view> </view>
</scroll-view> </scroll-view>
<scroll-view :scroll-top="scrollRightTop" :enhanced="true" scroll-y scroll-with-animation class="right-box" @scroll="rightScroll"> <scroll-view :scroll-top="scrollRightTop" scroll-y scroll-with-animation class="right-box" @scroll="rightScroll" :scroll-into-view="itemId">
<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"> <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"
:prop="item.fieldsName" :border-bottom="false" v-show="item.fieldsId != 200 || show200"> :prop="item.fieldsName" :border-bottom="false" v-show="item.fieldsId != 200 || show200" :id="`item${item.fieldsId}`">
<view :class="[{'label-bold': groupItem.name === '基本信息'}, 'label']" v-if="item.formType!=='location'&&item.formType!=='form'&&item.formType!=='label'"> <view :class="[{'label-bold': groupItem.name === '基本信息'}, 'label']" v-if="item.formType!=='location'&&item.formType!=='form'&&item.formType!=='label'">
<image class="item-image" :src="mixingImage" v-if="item.required"></image> <image class="item-image" :src="mixingImage" v-if="item.required"></image>
{{item.fieldsTitle}} {{item.fieldsTitle}}
...@@ -147,6 +147,7 @@ ...@@ -147,6 +147,7 @@
menuHeight: 0, // 左边菜单的高度 menuHeight: 0, // 左边菜单的高度
menuItemHeight: 0, // 左边菜单item的高度 menuItemHeight: 0, // 左边菜单item的高度
itemId: '', // 栏目右边scroll-view用于滚动的id itemId: '', // 栏目右边scroll-view用于滚动的id
oldItemId: '',
menuItemPos: [], menuItemPos: [],
arr: [], arr: [],
scrollRightTop: 0, // 右边栏目scroll-view的滚动条高度 scrollRightTop: 0, // 右边栏目scroll-view的滚动条高度
...@@ -369,6 +370,7 @@ ...@@ -369,6 +370,7 @@
self.waitHandlerPanelIndex = panelIndex self.waitHandlerPanelIndex = panelIndex
self.waitHandlerGroupIndex = groupIndex self.waitHandlerGroupIndex = groupIndex
self.waitHandlerEleIndex = eleIndex self.waitHandlerEleIndex = eleIndex
self.oldItemId = `item${ele.fieldsId}`
} }
}) })
}) })
...@@ -433,6 +435,7 @@ ...@@ -433,6 +435,7 @@
self.waitHandlerPanelIndex = panelIndex self.waitHandlerPanelIndex = panelIndex
self.waitHandlerGroupIndex = groupIndex self.waitHandlerGroupIndex = groupIndex
self.waitHandlerEleIndex = eleIndex self.waitHandlerEleIndex = eleIndex
self.oldItemId = `item${ele.fieldsId}`
} }
} }
}) })
...@@ -460,8 +463,8 @@ ...@@ -460,8 +463,8 @@
locationCompleteItem(panelIndex,groupIndex,eleIndex){ // 页面定位到某一项 locationCompleteItem(panelIndex,groupIndex,eleIndex){ // 页面定位到某一项
this.tabIndex = panelIndex this.tabIndex = panelIndex
this.arr = [] this.arr = []
this.scrollRightTop = 0 this.scrollRightTop = 0;
this.current = groupIndex this.current = 0;
this.$nextTick(function() { this.$nextTick(function() {
this.swichMenu(groupIndex) this.swichMenu(groupIndex)
}) })
...@@ -504,6 +507,7 @@ ...@@ -504,6 +507,7 @@
this.current = 0; this.current = 0;
this.leftMenuStatus(0) this.leftMenuStatus(0)
this.$nextTick(function() { this.$nextTick(function() {
this.itemId = this.oldItemId
this.getMenuItemTop() this.getMenuItemTop()
}) })
}, },
...@@ -664,7 +668,9 @@ ...@@ -664,7 +668,9 @@
if (index == this.current) return; if (index == this.current) return;
this.scrollRightTop = this.oldScrollTop; this.scrollRightTop = this.oldScrollTop;
this.$nextTick(function() { this.$nextTick(function() {
this.scrollRightTop = this.arr[index]; this.itemId = this.oldItemId
if(!this.oldItemId) this.scrollRightTop = this.arr[index];
this.oldItemId = ''
this.current = index; this.current = index;
this.leftMenuStatus(index); this.leftMenuStatus(index);
}) })
......
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