Commit 56a74f52 authored by 786817560's avatar 786817560

Merge branch 'ren' into develop

parents 26563110 5842d79e
...@@ -15,18 +15,18 @@ ...@@ -15,18 +15,18 @@
<Tab @getTabNum="getTabNum"/> <Tab @getTabNum="getTabNum"/>
<div class="hinput"> <div class="hinput">
<div class="search-box"> <div class="search-box">
<input type="text" placeholder="请输入合同号/承租人名称"> <input v-model="searchInput" type="text" placeholder="请输入合同号/承租人名称">
<img src="@/assets/distributorSign/search.png" alt=""> <img src="@/assets/distributorSign/search.png" alt="">
</div> </div>
</div> </div>
<scroll <scroll
v-if="tabNum === 0"
ref="scroll" ref="scroll"
:updateData="[submitLists]" :updateData="[showLists]"
:pullUp="true" :pullUp="true"
@pullingUp="loadMore"
> >
<div class="wrap"> <div class="wrap">
<div v-for="(item,index) in submitLists" :key="index" class="contract-lists" > <div v-for="(item,index) in showLists" :key="index" class="contract-lists" >
<div class="pro-code" @click="goDetails(item)"> <div class="pro-code" @click="goDetails(item)">
<img src="@/assets/distributorSign/fileIcon.png" alt="" class="file-icon"> <img src="@/assets/distributorSign/fileIcon.png" alt="" class="file-icon">
<p> <p>
...@@ -43,32 +43,6 @@ ...@@ -43,32 +43,6 @@
</div> </div>
</div> </div>
</scroll> </scroll>
<scroll
v-if="tabNum === 1"
ref="scrollList"
:updateData="[approvedLists]"
:pullUp="true"
>
<div class="wrap">
<div v-for="(item,index) in approvedLists" :key="index" class="contract-lists" >
<div class="pro-code" @click="goDetails(item)">
<img src="@/assets/distributorSign/fileIcon.png" alt="" class="file-icon">
<p>
<span>合同号</span>
<span>{{ item.project_number }}</span>
</p>
<img src="@/assets/distributorSign/goDetails.png" alt="" class="arrow">
</div>
<div class="box">
<div><p>承租人</p><p>{{ item.bp_name }}</p></div>
<div><p>合同租金</p><p class="money">{{ item.total_price|currency }}</p></div>
<div><p>申请时间</p><p>{{ dateConverse(item.confirm_start_date) }}</p></div>
</div>
</div>
</div>
</scroll>
</h-view> </h-view>
</template> </template>
...@@ -81,13 +55,38 @@ export default { ...@@ -81,13 +55,38 @@ export default {
}, },
data () { data () {
return { return {
tabNum: 0, tabNum: null,
pagenum: 1,
searchInput: '',
lists: [], lists: [],
showLists: [],
submitLists: [], submitLists: [],
approvedLists: [], approvedLists: [],
} }
}, },
watch: {
'tabNum': {
handler (newVal, oldVal) {
if (newVal === 0) {
this.showLists = this.submitLists
} else if (newVal === 1) {
this.showLists = this.approvedLists
}
},
immediate: true,
},
searchInput () {
let vm = this
if (vm.timeout) {
clearTimeout(vm.timeout)
}
vm.timeout = setTimeout(() => {
vm.search()
}, 1000)
},
},
created () { created () {
this.tabNum = 0
this.getLists() this.getLists()
}, },
methods: { methods: {
...@@ -96,25 +95,99 @@ export default { ...@@ -96,25 +95,99 @@ export default {
let vm = this let vm = this
let url = $config.basePath + 'prj_confirm_list_query' let url = $config.basePath + 'prj_confirm_list_query'
let param = { let param = {
pagesize: 10,
pagenum: vm.pagenum,
searchInput: vm.searchInput,
user_phone: window.localStorage.user_phone, user_phone: window.localStorage.user_phone,
} }
vm.hlsPopup.showLoading('数据加载中') vm.hlsPopup.showLoading('数据加载中')
vm.hlsHttp.post(url, param).then(function (res) { vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading() vm.hlsPopup.hideLoading()
if (res.result === 'S') { if (res.result === 'S') {
vm.lists = res.lists
vm.submitLists = res.lists.filter(item => item.confirm_status === 'SUBMIT') vm.submitLists = res.lists.filter(item => item.confirm_status === 'SUBMIT')
vm.approvedLists = res.lists.filter(item => item.confirm_status === 'APPROVED') vm.approvedLists = res.lists.filter(item => item.confirm_status === 'APPROVED')
if (vm.submitLists.length > 0 && vm.submitLists.length < 10) { vm.showLists = vm.submitLists
if (res.lists.length > 0 && res.lists.length < 10) {
vm.$refs.scroll.update(true)
} else if (res.lists.length === 10) {
vm.$refs.scroll.update(false)
}
} else {
hlsPopup.showLongCenter(res.message)
}
})
},
loadMore () {
let vm = this
vm.pagenum++
let url = $config.basePath + 'prj_confirm_list_query'
let param = {
user_phone: window.localStorage.user_phone,
pagesize: 10,
pagenum: vm.pagenum,
searchInput: vm.searchInput,
}
vm.hlsPopup.showLoading('数据加载中')
vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
let returnData = []
if (res.result === 'S') {
returnData = res.lists
if (returnData.length === 0) {
vm.$refs.scroll.update(true)
} else if (returnData.length > 0 && returnData.length < 10) {
returnData.forEach((data, index, array) => {
vm.lists.push(array[index])
})
vm.$refs.scroll.update(true) vm.$refs.scroll.update(true)
} else if (returnData.length === 10) {
returnData.forEach((data, index, array) => {
vm.lists.push(array[index])
})
vm.$refs.scroll.update(false)
} }
if (vm.approvedLists.length > 0 && vm.approvedLists.length < 10) { vm.submitLists = vm.lists.filter(item => item.confirm_status === 'SUBMIT')
vm.$refs.scrollList.update(true) vm.approvedLists = vm.lists.filter(item => item.confirm_status === 'APPROVED')
if (vm.tabNum === 0) {
vm.showLists = vm.submitLists
} else {
vm.showLists = vm.approvedLists
} }
} else { } else {
hlsPopup.showLongCenter(res.message) hlsPopup.showLongCenter(res.message)
} }
}) })
}, },
search () {
let vm = this
vm.pagenum = 1
let url = $config.basePath + 'prj_confirm_list_query'
let param = {
user_phone: window.localStorage.user_phone,
pagesize: 10,
pagenum: vm.pagenum,
searchInput: vm.searchInput,
}
vm.hlsPopup.showLoading('数据加载中')
vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
vm.lists = res.lists
vm.submitLists = vm.lists.filter(item => item.confirm_status === 'SUBMIT')
vm.approvedLists = vm.lists.filter(item => item.confirm_status === 'APPROVED')
if (vm.tabNum === 0) {
vm.showLists = vm.submitLists
} else {
vm.showLists = vm.approvedLists
}
if (vm.lists.length >= 0 && vm.lists.length < 10) {
vm.$refs.scroll.update(true)
} else if (vm.lists.length === 10) {
vm.$refs.scroll.update(false)
}
})
},
goDetails (item) { goDetails (item) {
window.sessionStorage.setItem('confirm_id', item.confirm_id) window.sessionStorage.setItem('confirm_id', item.confirm_id)
window.sessionStorage.setItem('bp_class', item.bp_class) window.sessionStorage.setItem('bp_class', item.bp_class)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Descrip: 产品明细 * @Descrip: 产品明细
* @Author: your name * @Author: your name
* @Date: 2019-10-15 14:30:00 * @Date: 2019-10-15 14:30:00
* @LastEditTime: 2019-11-14 15:19:39 * @LastEditTime: 2019-11-20 14:44:52
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
--> -->
<template> <template>
...@@ -22,8 +22,10 @@ ...@@ -22,8 +22,10 @@
</div> </div>
<!-- 基本信息 --> <!-- 基本信息 -->
<h-content v-swipeup="(e)=>vueTouch('上滑',e)" v-swipedown="(e)=>vueTouch('下滑',e)" class="hcontent"> <!-- <h-content v-swipeup="(e)=>vueTouch('上滑',e)" v-swipedown="(e)=>vueTouch('下滑',e)" class="hcontent"> -->
<scroll ref="scrolls" :listenScroll="true" class="scrolls" @scroll="startScroll"> <scroll
v-swipeup="(e)=>vueTouch('上滑',e)" v-swipedown="(e)=>vueTouch('下滑',e)" ref="scrolls" :listenScroll="true"
class="scrolls" @scroll="startScroll">
<!-- 基本信息 --> <!-- 基本信息 -->
<div id="baseInfo" class="base"> <div id="baseInfo" class="base">
<swipe :interval="5000" class="hls-swipe"> <swipe :interval="5000" class="hls-swipe">
...@@ -77,7 +79,7 @@ ...@@ -77,7 +79,7 @@
<div class="table-wrap" v-html="confgInfo.product_properties"/> <div class="table-wrap" v-html="confgInfo.product_properties"/>
</div> </div>
</scroll> </scroll>
</h-content> <!-- </h-content> -->
<bottom-tab class="footer-button"> <bottom-tab class="footer-button">
<tab-button <tab-button
:class="{bgcolor: bgc_flag}" class="butt" :class="{bgcolor: bgc_flag}" class="butt"
...@@ -131,14 +133,14 @@ export default { ...@@ -131,14 +133,14 @@ export default {
}, },
beforeRouteEnter (to, from, next) { beforeRouteEnter (to, from, next) {
debugger // debugger
if (from.name === 'ProductList' || from.name === 'MyProductList' || from.name === 'HomePage') { if (from.name === 'ProductList' || from.name === 'MyProductList' || from.name === 'HomePage') {
next(vm => { next(vm => {
vm.baseInfo = {} vm.baseInfo = {}
vm.confgInfo = {} vm.confgInfo = {}
vm.detailInfo = {} vm.detailInfo = {}
vm.picLists = [] vm.picLists = []
vm.tabNum = 0 vm.num = 0
vm.slide = false vm.slide = false
vm.product_id = vm.$route.params.product_id vm.product_id = vm.$route.params.product_id
vm.bp_id = vm.$route.params.bp_id vm.bp_id = vm.$route.params.bp_id
...@@ -187,9 +189,9 @@ export default { ...@@ -187,9 +189,9 @@ export default {
let baseGather = document.getElementsByClassName('base')[0].getBoundingClientRect() // 基本信息元素集合 let baseGather = document.getElementsByClassName('base')[0].getBoundingClientRect() // 基本信息元素集合
if (clientHeight - procnfGather.top >= procnfGather.height) { if (clientHeight - procnfGather.top >= procnfGather.height) {
this.num = 2 this.num = 2
} else if (clientHeight - detailGather.top >= detailGather.height) { } else if (detailGather.top <= clientHeight / 2) {
this.num = 1 this.num = 1
} else if (-(baseGather.top) <= baseGather.height / 2) { } else if (-(baseGather.top) <= baseGather.height / 2 || detailGather.top > clientHeight / 2) {
this.num = 0 this.num = 0
} }
}, },
...@@ -319,6 +321,9 @@ export default { ...@@ -319,6 +321,9 @@ export default {
</script> </script>
<style lang='less'> <style lang='less'>
#detailed { #detailed {
.scrollContent {
padding-bottom: 90px;
}
.hls-swipe { .hls-swipe {
background: #fff; background: #fff;
img { img {
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
<span>产品列表</span> <span>产品列表</span>
</div> </div>
</h-header> </h-header>
<h-content>
<div class="hinput"> <div class="hinput">
<div class="search-box"> <div class="search-box">
<input v-model="searchInput" type="text" placeholder="请输入经销商/产品名称/参数项"> <input v-model="searchInput" type="text" placeholder="请输入经销商/产品名称/参数项">
...@@ -50,7 +49,6 @@ ...@@ -50,7 +49,6 @@
</list-item> </list-item>
</div> </div>
</scroll> </scroll>
</h-content>
</h-view> </h-view>
</template> </template>
<script> <script>
......
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