Commit f0a380df authored by 李晓兵's avatar 李晓兵

Merge branch 'develop' of https://hel.hand-china.com/xugong/hls-xcmg-vue-app into develop

parents 9d251116 2184a8df
Pipeline #3146 canceled with stages
...@@ -86,6 +86,8 @@ export default { ...@@ -86,6 +86,8 @@ export default {
}, },
beforeRouteEnter (to, from, next) { beforeRouteEnter (to, from, next) {
next(vm => { next(vm => {
vm.pagenum = 1
vm.lists = []
vm.getList() vm.getList()
}) })
}, },
...@@ -155,6 +157,7 @@ export default { ...@@ -155,6 +157,7 @@ export default {
vum.forEach(returnData, function (data, index, array) { vum.forEach(returnData, function (data, index, array) {
vm.lists.push(array[index]) vm.lists.push(array[index])
}) })
vm.pagenum++
vm.$refs.scroll.update(true) vm.$refs.scroll.update(true)
} else if (returnData.length === 10) { } else if (returnData.length === 10) {
vum.forEach(returnData, function (data, index, array) { vum.forEach(returnData, function (data, index, array) {
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2019-10-31 09:49:57 * @Date: 2019-10-31 09:49:57
* @LastEditTime: 2019-11-18 17:23:29 * @LastEditTime: 2019-11-19 14:20:47
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 合同查询--记录 * @Description: 合同查询--记录
* @FilePath: * @FilePath:
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
<div v-if="data!==null"> <div v-if="data!==null">
<div class="tab"> <div class="tab">
<p><span :class="{'selected':selected === 'all'}" @click="isSelected('all')">全部</span></p> <p><span :class="{'selected':selected === 'all'}" @click="isSelected('all')">全部</span></p>
<p><span :class="{'selected':selected === 'one'}" @click="isSelected('one')">待签约</span></p> <p><span :class="{'selected':selected === 'one'}" @click="isSelected('one')">待首付</span></p>
<p><span :class="{'selected':selected === 'two'}" @click="isSelected('two')">待还款</span></p> <p><span :class="{'selected':selected === 'two'}" @click="isSelected('two')">首付还款中</span></p>
<p><span :class="{'selected':selected === 'three'}" @click="isSelected('three')">还款中</span></p> <p><span :class="{'selected':selected === 'three'}" @click="isSelected('three')">还款中</span></p>
<p><span :class="{'selected':selected === 'four'}" @click="isSelected('four')">已结清</span></p> <p><span :class="{'selected':selected === 'four'}" @click="isSelected('four')">已结清</span></p>
</div> </div>
...@@ -38,139 +38,29 @@ ...@@ -38,139 +38,29 @@
<!-- 全部合同记录 --> <!-- 全部合同记录 -->
<scroll <scroll
v-if="selected === 'all'"
ref="scroll" ref="scroll"
:updateData="[lists]" :updateData="[showLists]"
:pullUp="true" :pullUp="true"
@pullingUp="loadMore" @pullingUp="loadMore"
> >
<div class="pay-content"> <div class="pay-content">
<div v-for="(item,index) in lists" :key="index" class="contract-item"> <div v-for="(item,index) in showLists" :key="index" class="contract-item">
<div class="header"> <div class="header">
<img src="@/assets/contractRepayment/contract.png" alt=""> <img src="@/assets/contractRepayment/contract.png" alt="">
<h2>{{ item.project_number }}</h2> <h2>{{ item.project_number }}</h2>
<!-- 状态用类名控制 待还款orange,待签约green,还款中blue,已结清black --> <!-- 状态用类名控制 待还款orange,待签约green,还款中blue,已结清black -->
<p v-if="item.contract_status_n === '待首付'" class="green">待签约</p> <div v-if="selected === 'all'">
<p v-if="item.contract_status_n === '首付还款中'" class="orange">代还款</p> <p v-if="item.contract_status_n === '待首付'" class="green">待首付</p>
<p v-if="item.contract_status_n === '首付还款中'" class="orange">首付还款中</p>
<p v-if="item.contract_status_n === '还款中'" class="blue">还款中</p> <p v-if="item.contract_status_n === '还款中'" class="blue">还款中</p>
<p v-if="item.contract_status_n === '已结清'" class="black">已结清</p> <p v-if="item.contract_status_n === '已结清'" class="black">已结清</p>
</div> </div>
<div class="center"> <div v-if="selected !== 'all'">
<div><span>承租人</span><p>{{ item.bp_name }}</p></div> <p v-if="item.contract_status_n === '待首付'" class="green">待首付</p>
<div><span>年利率</span><p>{{ item.int_rate_n }}</p></div> <p v-if="item.contract_status_n === '首付还款中'" class="orange">首付还款中</p>
<div><span>期限</span><p>{{ item.lease_times }}</p></div> <p v-if="item.contract_status_n === '还款中'" class="blue">还款中</p>
<div><span>融资金额</span><p class="bold">{{ parseFloat(item.finance_amount).toFixed(2) | currency }}</p></div> <p v-if="item.contract_status_n === '已结清'" class="black">已结清</p>
<span class="red">{{ item.con_overdue_status }}</span>
<section @click="toRepayDetail(item.project_id)">
<img src="@/assets/contractRepayment/view.png" alt="">
<span>查看合同明细</span>
</section>
</div>
</div>
</div>
</scroll>
<!-- 待签约 -->
<scroll
v-if="selected === 'one'"
ref="scroll"
:updateData="[unSignedLists]"
:pullUp="true"
>
<div class="pay-content">
<div v-for="(item,index) in unSignedLists" :key="index" class="contract-item">
<div class="header">
<img src="@/assets/contractRepayment/contract.png" alt="">
<h2>{{ item.project_number }}</h2>
<p class="green">待签约</p>
</div>
<div class="center">
<div><span>承租人</span><p>{{ item.bp_name }}</p></div>
<div><span>年利率</span><p>{{ item.int_rate_n }}</p></div>
<div><span>期限</span><p>{{ item.lease_times }}</p></div>
<div><span>融资金额</span><p class="bold">{{ parseFloat(item.finance_amount).toFixed(2) | currency }}</p></div>
<span class="red">{{ item.con_overdue_status }}</span>
<section @click="toRepayDetail(item.project_id)">
<img src="@/assets/contractRepayment/view.png" alt="">
<span>查看合同明细</span>
</section>
</div>
</div>
</div>
</scroll>
<!-- 待还款 -->
<scroll
v-if="selected === 'two'"
ref="scroll"
:updateData="[unRepayLists]"
:pullUp="true"
>
<div class="pay-content">
<div v-for="(item,index) in unRepayLists" :key="index" class="contract-item">
<div class="header">
<img src="@/assets/contractRepayment/contract.png" alt="">
<h2>{{ item.project_number }}</h2>
<p class="orange">待还款</p>
</div>
<div class="center">
<div><span>承租人</span><p>{{ item.bp_name }}</p></div>
<div><span>年利率</span><p>{{ item.int_rate_n }}</p></div>
<div><span>期限</span><p>{{ item.lease_times }}</p></div>
<div><span>融资金额</span><p class="bold">{{ parseFloat(item.finance_amount).toFixed(2) | currency }}</p></div>
<span class="red">{{ item.con_overdue_status }}</span>
<section @click="toRepayDetail(item.project_id)">
<img src="@/assets/contractRepayment/view.png" alt="">
<span>查看合同明细</span>
</section>
</div>
</div>
</div>
</scroll>
<!-- 还款中 -->
<scroll
v-if="selected === 'three'"
ref="scroll"
:updateData="[repayingLists]"
:pullUp="true"
>
<div class="pay-content">
<div v-for="(item,index) in repayingLists" :key="index" class="contract-item">
<div class="header">
<img src="@/assets/contractRepayment/contract.png" alt="">
<h2>{{ item.project_number }}</h2>
<p class="blue">还款中</p>
</div>
<div class="center">
<div><span>承租人</span><p>{{ item.bp_name }}</p></div>
<div><span>年利率</span><p>{{ item.int_rate_n }}</p></div>
<div><span>期限</span><p>{{ item.lease_times }}</p></div>
<div><span>融资金额</span><p class="bold">{{ parseFloat(item.finance_amount).toFixed(2) | currency }}</p></div>
<span class="red">{{ item.con_overdue_status }}</span>
<section @click="toRepayDetail(item.project_id)">
<img src="@/assets/contractRepayment/view.png" alt="">
<span>查看合同明细</span>
</section>
</div>
</div>
</div> </div>
</scroll>
<!-- 已结清 -->
<scroll
v-if="selected === 'four'"
ref="scroll"
:updateData="[repayedLists]"
:pullUp="true"
>
<div class="pay-content">
<div v-for="(item,index) in repayedLists" :key="index" class="contract-item">
<div class="header">
<img src="@/assets/contractRepayment/contract.png" alt="">
<h2>{{ item.project_number }}</h2>
<p class="black">已结清</p>
</div> </div>
<div class="center"> <div class="center">
<div><span>承租人</span><p>{{ item.bp_name }}</p></div> <div><span>承租人</span><p>{{ item.bp_name }}</p></div>
...@@ -186,7 +76,6 @@ ...@@ -186,7 +76,6 @@
</div> </div>
</div> </div>
</scroll> </scroll>
</h-view> </h-view>
</template> </template>
...@@ -200,6 +89,7 @@ export default { ...@@ -200,6 +89,7 @@ export default {
return { return {
// data: null, // 无记录时 // data: null, // 无记录时
data: 1, data: 1,
showLists: [],
lists: [], // 全部记录 lists: [], // 全部记录
selected: 'all', selected: 'all',
unSignedLists: [], // 待签约 unSignedLists: [], // 待签约
...@@ -212,11 +102,36 @@ export default { ...@@ -212,11 +102,36 @@ export default {
} }
}, },
computed: {}, computed: {},
watch: {}, watch: {
selected () {
if (this.selected === 'all') {
this.showLists = this.lists
} else if (this.selected === 'one') {
this.showLists = this.unSignedLists
} else if (this.selected === 'two') {
this.showLists = this.unRepayLists
} else if (this.selected === 'three') {
this.showLists = this.repayingLists
} else if (this.selected === 'four') {
this.showLists = this.repayedLists
}
},
searchInput () {
let vm = this
if (vm.timeout) {
clearTimeout(vm.timeout)
}
vm.timeout = setTimeout(() => {
vm.search()
}, 1000)
},
},
beforeRouteEnter (to, from, next) { beforeRouteEnter (to, from, next) {
next(vm => { next(vm => {
if (from.name === 'HomePage') { if (from.name === 'HomePage') {
vm.selected = 'all' vm.selected = 'all'
vm.pagenum = 1
vm.searchInput = ''
vm.recordQuery() vm.recordQuery()
} }
}) })
...@@ -254,10 +169,7 @@ export default { ...@@ -254,10 +169,7 @@ export default {
vm.data = 1 vm.data = 1
} }
vm.lists = res.lists vm.lists = res.lists
vm.unSignedLists = res.lists.filter(item => item.contract_status_n === '待首付') // 待签约 vm.classify()
vm.unRepayLists = res.lists.filter(item => item.contract_status_n === '首付还款中') // 待还款
vm.repayingLists = res.lists.filter(item => item.contract_status_n === '还款中') // 还款中
vm.repayedLists = res.lists.filter(item => item.contract_status_n === '已结清') // 已结清
if (res.lists.length >= 0 && res.lists.length < 10) { if (res.lists.length >= 0 && res.lists.length < 10) {
vm.$refs.scroll.update(true) vm.$refs.scroll.update(true)
} }
...@@ -266,6 +178,15 @@ export default { ...@@ -266,6 +178,15 @@ export default {
} }
}) })
}, },
// 分类
classify () {
let vm = this
vm.showLists = vm.lists
vm.unSignedLists = vm.lists.filter(item => item.contract_status_n === '待首付') // 待签约
vm.unRepayLists = vm.lists.filter(item => item.contract_status_n === '首付还款中') // 待还款
vm.repayingLists = vm.lists.filter(item => item.contract_status_n === '还款中') // 还款中
vm.repayedLists = vm.lists.filter(item => item.contract_status_n === '已结清') // 已结清
},
loadMore () { loadMore () {
let vm = this let vm = this
vm.pagenum++ vm.pagenum++
...@@ -279,26 +200,51 @@ export default { ...@@ -279,26 +200,51 @@ export default {
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()
let returnData = []
if (res.result === 'S') { if (res.result === 'S') {
// if (res.lists.length === 0) { returnData = res.lists
// vm.data = null if (returnData.length === 0) {
// } else { vm.$refs.scroll.update(true)
// vm.data = 1 } else if (returnData.length > 0 && returnData.length < 10) {
// } returnData.forEach((data, index, array) => {
console.log('........', res.lists) vm.lists.push(array[index])
// vm.lists = res.lists })
// vm.unSignedLists = res.lists.filter(item => item.contract_status_n === '待首付') // 待签约 vm.$refs.scroll.update(true)
// vm.unRepayLists = res.lists.filter(item => item.contract_status_n === '首付还款中') // 待还款 } else if (returnData.length === 10) {
// vm.repayingLists = res.lists.filter(item => item.contract_status_n === '还款中') // 还款中 returnData.forEach((data, index, array) => {
// vm.repayedLists = res.lists.filter(item => item.contract_status_n === '已结清') // 已结清 vm.lists.push(array[index])
// if (res.lists.length > 0 && res.lists.length < 10) { })
// vm.$refs.scroll.update(true) vm.$refs.scroll.update(false)
// } }
vm.classify()
} else { } else {
hlsPopup.showLongCenter(res.message) hlsPopup.showLongCenter(res.message)
} }
}) })
}, },
search () {
let vm = this
vm.pagenum = 1
let url = $config.basePath + 'con_contract_list'
let param = {
user_phone: window.localStorage.user_phone,
searchInput: vm.searchInput,
pagenum: vm.pagenum,
pagesize: 10,
}
vm.hlsPopup.showLoading('数据加载中')
vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
vm.selected = 'all'
vm.lists = res.lists
vm.classify()
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)
}
})
},
}, },
} }
</script> </script>
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2019-10-31 09:49:57 * @Date: 2019-10-31 09:49:57
* @LastEditTime: 2019-11-18 16:31:19 * @LastEditTime: 2019-11-19 11:12:37
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 合同查询--明细 * @Description: 合同查询--明细
* @FilePath: * @FilePath:
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
</div> </div>
</div> </div>
<div slot="content"> <div slot="content">
<span v-if="item.overdue_times" :class="['status','red']">逾期{{ totalTimes }}</span> <span v-if="item.overdue_times" :class="['status','red']">逾期{{ item.overdue_times }}</span>
<div class="plan" @click="toRepayPlans(item.contract_id)"> <div class="plan" @click="toRepayPlans(item.contract_id)">
<img src="@/assets/contractRepayment/plan.png" alt=""> <img src="@/assets/contractRepayment/plan.png" alt="">
<span>还款计划</span> <span>还款计划</span>
...@@ -99,13 +99,7 @@ export default { ...@@ -99,13 +99,7 @@ export default {
} }
}, },
computed: { computed: {
totalTimes () {
let num = 0
for (let item of this.lists) {
num += Number(item.overdue_times)
}
return num
},
}, },
watch: {}, watch: {},
beforeRouteEnter (to, from, next) { beforeRouteEnter (to, from, next) {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</h-header> </h-header>
<h-content v-if="data!==null" class="pay-content"> <h-content v-if="data!==null" class="pay-content">
<scroll ref="scroll" :updateData="[lists]" :pullUp="true"> <scroll ref="scroll" :updateData="[lists]" :pullUp="true" @pullingUp="getList">
<div v-for="(item,index) in lists" :key="index" class="contract-item"> <div v-for="(item,index) in lists" :key="index" class="contract-item">
<div class="header"> <div class="header">
<img src="@/assets/contractRepayment/contract.png" alt=""> <img src="@/assets/contractRepayment/contract.png" alt="">
...@@ -46,6 +46,7 @@ export default { ...@@ -46,6 +46,7 @@ export default {
data () { data () {
return { return {
// data: null, 无记录时 // data: null, 无记录时
pagenum: 1,
lists: [], lists: [],
} }
}, },
...@@ -62,6 +63,8 @@ export default { ...@@ -62,6 +63,8 @@ export default {
beforeRouteEnter (to, from, next) { beforeRouteEnter (to, from, next) {
next(vm => { next(vm => {
if (from.name === 'HomePage') { if (from.name === 'HomePage') {
vm.pagenum = 1
vm.lists = []
vm.getList() vm.getList()
} }
}) })
...@@ -72,15 +75,34 @@ export default { ...@@ -72,15 +75,34 @@ export default {
let url = process.env.basePath + 'con_repayment_list_query' let url = process.env.basePath + 'con_repayment_list_query'
let param = { let param = {
user_phone: window.localStorage.getItem('user_phone'), user_phone: window.localStorage.getItem('user_phone'),
pagesize: 10,
pagenum: vm.pagenum,
} }
hlsPopup.showLoading('请稍候') hlsPopup.showLoading('请稍候')
vm.$post(url, param).then(function (res) { vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading() vm.hlsPopup.hideLoading()
if (res.result === 'S') { if (res.result === 'S') {
vm.lists = res.lists let returnData = []
if (res.listst.length >= 0 && res.lists.length < 10) { returnData = res.lists
if (returnData.length === 0) {
vm.$refs.scroll.update(true) vm.$refs.scroll.update(true)
} else if (returnData.length > 0 && returnData.length < 10) {
vum.forEach(returnData, function (data, index, array) {
vm.lists.push(array[index])
})
vm.pagenum++
vm.$refs.scroll.update(true)
} else if (returnData.length === 10) {
vum.forEach(returnData, function (data, index, array) {
vm.lists.push(array[index])
})
vm.pagenum++
vm.$refs.scroll.update(false)
} }
// vm.lists = res.lists
// if (res.listst.length >= 0 && res.lists.length < 10) {
// vm.$refs.scroll.update(true)
// }
} else { } else {
hlsPopup.showLongCenter(res.message) hlsPopup.showLongCenter(res.message)
} }
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2019-09-29 10:02:11 * @Date: 2019-09-29 10:02:11
* @LastEditTime: 2019-11-18 16:25:52 * @LastEditTime: 2019-11-19 16:47:01
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
--> -->
...@@ -26,14 +26,13 @@ ...@@ -26,14 +26,13 @@
<!-- <h-content > --> <!-- <h-content > -->
<scroll <scroll
v-if="num === 1"
ref="scroll" ref="scroll"
:updateData="[submitLists]" :updateData="[showLists]"
:pullUp="true" :pullUp="true"
@pullingUp="loadMore" @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>
...@@ -50,35 +49,6 @@ ...@@ -50,35 +49,6 @@
</div> </div>
</div> </div>
</scroll> </scroll>
<!-- </h-content> -->
<!-- <h-content > -->
<scroll
v-if="num === 2"
ref="scrollList"
:updateData="[approvedLists]"
:pullUp="true"
@pullingUp="loadMore"
>
<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-content> -->
</h-view> </h-view>
</template> </template>
...@@ -91,7 +61,7 @@ import unCheck2 from '@/assets/constractSigning/yes-undone.png' ...@@ -91,7 +61,7 @@ import unCheck2 from '@/assets/constractSigning/yes-undone.png'
export default { export default {
data () { data () {
return { return {
num: 1, num: null,
pagenum: 1, pagenum: 1,
searchInput: '', searchInput: '',
check1: Check1, check1: Check1,
...@@ -101,7 +71,30 @@ export default { ...@@ -101,7 +71,30 @@ export default {
user_bp_type: '', // 客户类型 user_bp_type: '', // 客户类型
submitLists: [], // 待签约 submitLists: [], // 待签约
approvedLists: [], // 已签约 approvedLists: [], // 已签约
showLists: [],
lists: [],
}
},
watch: {
'num': {
handler (newVal, oldVal) {
if (newVal === 1) {
this.showLists = this.submitLists
} else if (newVal === 2) {
this.showLists = this.approvedLists
}
},
immediate: true,
},
searchInput () {
let vm = this
if (vm.timeout) {
clearTimeout(vm.timeout)
} }
vm.timeout = setTimeout(() => {
vm.search()
}, 1000)
},
}, },
activated () { activated () {
...@@ -113,6 +106,8 @@ export default { ...@@ -113,6 +106,8 @@ export default {
next(vm => { next(vm => {
if (from.name === 'MyInfo') { if (from.name === 'MyInfo') {
vm.num = 1 vm.num = 1
vm.pagenum = 1
vm.searchInput = ''
vm.user_bp_type = vm.$route.params.user_bp_type vm.user_bp_type = vm.$route.params.user_bp_type
} }
vm.contractList() vm.contractList()
...@@ -138,13 +133,14 @@ export default { ...@@ -138,13 +133,14 @@ export default {
vm.hlsPopup.hideLoading() vm.hlsPopup.hideLoading()
if (res.result === 'S') { if (res.result === 'S') {
console.log(res.lists) console.log(res.lists)
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) vm.$refs.scroll.update(true)
} } else if (res.lists.length === 10) {
if (vm.approvedLists.length > 0 && vm.approvedLists.length < 10) { vm.$refs.scroll.update(false)
vm.$refs.scrollList.update(true)
} }
} else { } else {
hlsPopup.showLongCenter(res.message) hlsPopup.showLongCenter(res.message)
...@@ -154,31 +150,73 @@ export default { ...@@ -154,31 +150,73 @@ export default {
loadMore () { loadMore () {
let vm = this let vm = this
vm.pagenum++
let url = $config.basePath + 'prj_confirm_list_query' let url = $config.basePath + 'prj_confirm_list_query'
let param = { let param = {
user_phone: window.localStorage.user_phone, user_phone: window.localStorage.user_phone,
pagesize: 10, pagesize: 10,
pagenum: vm.pagenum + 1, pagenum: vm.pagenum,
searchInput: '1', searchInput: vm.searchInput,
} }
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()
let returnData = []
if (res.result === 'S') { if (res.result === 'S') {
console.log('.....', res.lists) returnData = res.lists
vm.submitLists = res.lists.filter(item => item.confirm_status === 'SUBMIT') if (returnData.length === 0) {
vm.approvedLists = res.lists.filter(item => item.confirm_status === 'APPROVED')
if (vm.submitLists.length > 0 && vm.submitLists.length < 10) {
vm.$refs.scroll.update(true) 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)
} 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.num === 1) {
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.num === 1) {
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) {
this.$router.push({ this.$router.push({
......
...@@ -168,6 +168,7 @@ export default { ...@@ -168,6 +168,7 @@ export default {
vum.forEach(returnData, function (data, index, array) { vum.forEach(returnData, function (data, index, array) {
vm.lists.push(array[index]) vm.lists.push(array[index])
}) })
vm.pagenum++
vm.$refs.scroll.update(true) vm.$refs.scroll.update(true)
} else if (returnData.length === 10) { } else if (returnData.length === 10) {
vum.forEach(returnData, function (data, index, array) { vum.forEach(returnData, function (data, index, array) {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<h-content> <h-content>
<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>
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
ref="scroll" ref="scroll"
:updateData="[productList]" :updateData="[productList]"
:pullUp="true" :pullUp="true"
@pullingUp="loadMore"
> >
<div class="division-box"> <div class="division-box">
...@@ -56,11 +57,24 @@ ...@@ -56,11 +57,24 @@
export default { export default {
data () { data () {
return { return {
pagenum: 1,
searchInput: '',
productList: [], productList: [],
} }
}, },
created: function () { created: function () {
}, },
watch: {
searchInput () {
let vm = this
if (vm.timeout) {
clearTimeout(vm.timeout)
}
vm.timeout = setTimeout(() => {
vm.search()
}, 1000)
},
},
mounted: function () { mounted: function () {
}, },
...@@ -70,9 +84,13 @@ export default { ...@@ -70,9 +84,13 @@ export default {
}, },
beforeRouteEnter (to, from, next) { beforeRouteEnter (to, from, next) {
next(vm => { next(vm => {
// if (from.name === 'MyInfo') { if (from.name === 'MyInfo') {
vm.pagenum = 1
vm.searchInput = ''
vm.getList()
} else if (from.name === 'ProDetailed') {
vm.getList() vm.getList()
// } }
}) })
}, },
methods: { methods: {
...@@ -80,6 +98,9 @@ export default { ...@@ -80,6 +98,9 @@ export default {
let vm = this let vm = this
let url = $config.basePath + 'my_collection_query' let url = $config.basePath + 'my_collection_query'
let param = { let param = {
pagesize: 10,
pagenum: vm.pagenum,
searchInput: vm.searchInput,
user_phone: window.localStorage.getItem('user_phone'), user_phone: window.localStorage.getItem('user_phone'),
} }
hlsPopup.showLoading('数据加载中') hlsPopup.showLoading('数据加载中')
...@@ -87,16 +108,89 @@ export default { ...@@ -87,16 +108,89 @@ export default {
hlsPopup.hideLoading() hlsPopup.hideLoading()
if (res.result === 'S') { if (res.result === 'S') {
vm.productList = res.lists vm.productList = res.lists
res.lists.forEach(item => {
if (vm.productList.length === 0) {
vm.$refs.scroll.update(true)
} else if (vm.productList.length > 0 && vm.productList.length < 10) {
vm.productList.forEach(item => {
item['url'] = process.env.filePath + 'attachment_id=' + item.product_attachment_id + '&access_token=' + window.localStorage.access_token item['url'] = process.env.filePath + 'attachment_id=' + item.product_attachment_id + '&access_token=' + window.localStorage.access_token
}) })
if (res.lists.length > 0 && res.lists.length < 10) {
vm.$refs.scroll.update(true) vm.$refs.scroll.update(true)
} else if (vm.productList.length === 10) {
vm.productList.forEach(item => {
item['url'] = process.env.filePath + 'attachment_id=' + item.product_attachment_id + '&access_token=' + window.localStorage.access_token
})
vm.$refs.scroll.update(false)
} }
} else { } else {
hlsPopup.showLongCenter(res.message) hlsPopup.showLongCenter(res.message)
} }
}) })
},
loadMore () {
let vm = this
vm.pagenum = vm.pagenum + 1
let url = $config.basePath + 'my_collection_query'
let param = {
pagesize: 10,
pagenum: vm.pagenum,
searchInput: vm.searchInput,
user_phone: window.localStorage.getItem('user_phone'),
}
vm.hlsPopup.showLoading('数据加载中')
vm.$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(item => {
item['url'] = process.env.filePath + 'attachment_id=' + item.product_attachment_id + '&access_token=' + window.localStorage.access_token
})
returnData.forEach((data, index, array) => {
vm.productList.push(array[index])
})
vm.$refs.scroll.update(true)
} else if (returnData.length === 10) {
returnData.forEach(item => {
item['url'] = process.env.filePath + 'attachment_id=' + item.product_attachment_id + '&access_token=' + window.localStorage.access_token
})
returnData.forEach((data, index, array) => {
vm.productList.push(array[index])
})
vm.$refs.scroll.update(false)
}
} else {
hlsPopup.showLongCenter(res.message)
}
})
},
search () {
let vm = this
vm.pagenum = 1
// vm.bpList = []
let url = $config.basePath + 'my_collection_query'
let param = {
pagesize: 10,
pagenum: 1,
searchInput: vm.searchInput,
user_phone: window.localStorage.getItem('user_phone'),
}
vm.hlsPopup.showLoading('数据加载中')
vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
vm.productList = res.lists
vm.productList.forEach(item => {
item['url'] = process.env.filePath + 'attachment_id=' + item.product_attachment_id + '&access_token=' + window.localStorage.access_token
})
if (vm.productList.length >= 0 && vm.productList.length < 10) {
vm.$refs.scroll.update(true)
} else if (vm.productList.length === 10) {
vm.$refs.scroll.update(false)
}
})
}, },
// val:产品id, status: 收藏状态 // val:产品id, status: 收藏状态
goDetailed (val, status, bp_id) { // 进入产品查询功能明细页面 goDetailed (val, status, bp_id) { // 进入产品查询功能明细页面
......
...@@ -59,15 +59,32 @@ export default { ...@@ -59,15 +59,32 @@ export default {
data () { data () {
return { return {
lists: [], lists: [],
pagenum: 2, pagenum: 1,
searchInput: '', searchInput: '',
} }
}, },
computed: {}, computed: {},
watch: {}, watch: {
activated () { searchInput () {
// debugger let vm = this
this.proQuery() if (vm.timeout) {
clearTimeout(vm.timeout)
}
vm.timeout = setTimeout(() => {
vm.search()
}, 1000)
},
},
beforeRouteEnter (to, from, next) {
next(vm => {
if (from.name === 'QueryHome') {
vm.pagenum = 1
vm.searchInput = ''
vm.proQuery()
} else if (from.name === 'ProDetailed') {
vm.proQuery()
}
})
}, },
methods: methods:
{ {
...@@ -87,14 +104,19 @@ export default { ...@@ -87,14 +104,19 @@ export default {
vm.hlsPopup.hideLoading() vm.hlsPopup.hideLoading()
if (res.result === 'S') { if (res.result === 'S') {
vm.lists = res.lists vm.lists = res.lists
res.lists.forEach(item => { if (vm.lists.length === 0) {
vm.$refs.scroll.update(true)
} else if (vm.lists.length > 0 && vm.lists.length < 10) {
vm.lists.forEach(item => {
item['url'] = process.env.filePath + 'attachment_id=' + item.product_attachment_id + '&access_token=' + window.localStorage.access_token item['url'] = process.env.filePath + 'attachment_id=' + item.product_attachment_id + '&access_token=' + window.localStorage.access_token
}) })
if (res.lists.length > 0 && res.lists.length < 10) {
vm.$refs.scroll.update(true) vm.$refs.scroll.update(true)
} else if (vm.lists.length === 10) {
vm.lists.forEach(item => {
item['url'] = process.env.filePath + 'attachment_id=' + item.product_attachment_id + '&access_token=' + window.localStorage.access_token
})
vm.$refs.scroll.update(false)
} }
// vm.picLists = res.lists
// console.log('........',vm.picLists)
} else { } else {
hlsPopup.showLongCenter(res.message) hlsPopup.showLongCenter(res.message)
} }
...@@ -103,7 +125,7 @@ export default { ...@@ -103,7 +125,7 @@ export default {
loadMore () { loadMore () {
let vm = this let vm = this
vm.pagenum++ vm.pagenum = vm.pagenum + 1
let url = $config.basePath + 'prd_product_list' let url = $config.basePath + 'prd_product_list'
let param = { let param = {
division: window.sessionStorage.division, division: window.sessionStorage.division,
...@@ -115,20 +137,62 @@ export default { ...@@ -115,20 +137,62 @@ export default {
vm.hlsPopup.showLoading('数据加载中') vm.hlsPopup.showLoading('数据加载中')
vm.$post(url, param).then(function (res) { vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading() vm.hlsPopup.hideLoading()
let returnData = []
if (res.result === 'S') { if (res.result === 'S') {
console.log('...........', res.lists) returnData = res.lists
// vm.lists = res.lists if (returnData.length === 0) {
// res.lists.forEach(item => { vm.$refs.scroll.update(true)
// item['url'] = process.env.filePath + 'attachment_id=' + item.product_attachment_id + '&access_token=' + window.localStorage.access_token } else if (returnData.length > 0 && returnData.length < 10) {
// }) returnData.forEach(item => {
// if (res.lists.length > 0 && res.lists.length < 10) { item['url'] = process.env.filePath + 'attachment_id=' + item.product_attachment_id + '&access_token=' + window.localStorage.access_token
// vm.$refs.scroll.update(true) })
// } returnData.forEach((data, index, array) => {
vm.lists.push(array[index])
})
vm.$refs.scroll.update(true)
} else if (returnData.length === 10) {
returnData.forEach(item => {
item['url'] = process.env.filePath + 'attachment_id=' + item.product_attachment_id + '&access_token=' + window.localStorage.access_token
})
returnData.forEach((data, index, array) => {
vm.lists.push(array[index])
})
vm.$refs.scroll.update(false)
}
} else { } else {
hlsPopup.showLongCenter(res.message) hlsPopup.showLongCenter(res.message)
} }
}) })
}, },
// 搜索
search () {
let vm = this
vm.pagenum = 1
// vm.bpList = []
let url = $config.basePath + 'prd_product_list'
let param = {
pagesize: 10,
pagenum: 1,
searchInput: vm.searchInput,
division: window.sessionStorage.division,
user_phone: window.localStorage.user_phone,
}
vm.hlsPopup.showLoading('数据加载中')
vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
console.log(res)
vm.lists = res.lists
vm.lists.forEach(item => {
item['url'] = process.env.filePath + 'attachment_id=' + item.product_attachment_id + '&access_token=' + window.localStorage.access_token
})
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)
}
})
},
// val:产品id, status: 收藏状态 // val:产品id, status: 收藏状态
goDetailed (val, status, bp_id) { goDetailed (val, status, bp_id) {
window.sessionStorage.setItem('collect_status', status) window.sessionStorage.setItem('collect_status', status)
......
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