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 {
},
beforeRouteEnter (to, from, next) {
next(vm => {
vm.pagenum = 1
vm.lists = []
vm.getList()
})
},
......@@ -155,6 +157,7 @@ export default {
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) {
......
<!--
* @Author: your name
* @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
* @Description: 合同查询--记录
* @FilePath:
......@@ -24,8 +24,8 @@
<div v-if="data!==null">
<div class="tab">
<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 === 'two'}" @click="isSelected('two')">待还款</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 === 'three'}" @click="isSelected('three')">还款中</span></p>
<p><span :class="{'selected':selected === 'four'}" @click="isSelected('four')">已结清</span></p>
</div>
......@@ -38,139 +38,29 @@
<!-- 全部合同记录 -->
<scroll
v-if="selected === 'all'"
ref="scroll"
:updateData="[lists]"
:updateData="[showLists]"
:pullUp="true"
@pullingUp="loadMore"
>
<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">
<img src="@/assets/contractRepayment/contract.png" alt="">
<h2>{{ item.project_number }}</h2>
<!-- 状态用类名控制 待还款orange,待签约green,还款中blue,已结清black -->
<p v-if="item.contract_status_n === '待首付'" class="green">待签约</p>
<p v-if="item.contract_status_n === '首付还款中'" class="orange">代还款</p>
<div v-if="selected === 'all'">
<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="black">已结清</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 === '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 v-if="selected !== 'all'">
<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="black">已结清</p>
</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 class="center">
<div><span>承租人</span><p>{{ item.bp_name }}</p></div>
......@@ -186,7 +76,6 @@
</div>
</div>
</scroll>
</h-view>
</template>
......@@ -200,6 +89,7 @@ export default {
return {
// data: null, // 无记录时
data: 1,
showLists: [],
lists: [], // 全部记录
selected: 'all',
unSignedLists: [], // 待签约
......@@ -212,11 +102,36 @@ export default {
}
},
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) {
next(vm => {
if (from.name === 'HomePage') {
vm.selected = 'all'
vm.pagenum = 1
vm.searchInput = ''
vm.recordQuery()
}
})
......@@ -254,10 +169,7 @@ export default {
vm.data = 1
}
vm.lists = res.lists
vm.unSignedLists = res.lists.filter(item => item.contract_status_n === '待首付') // 待签约
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 === '已结清') // 已结清
vm.classify()
if (res.lists.length >= 0 && res.lists.length < 10) {
vm.$refs.scroll.update(true)
}
......@@ -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 () {
let vm = this
vm.pagenum++
......@@ -279,26 +200,51 @@ export default {
vm.hlsPopup.showLoading('数据加载中')
vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
let returnData = []
if (res.result === 'S') {
// if (res.lists.length === 0) {
// vm.data = null
// } else {
// vm.data = 1
// }
console.log('........', res.lists)
// vm.lists = res.lists
// vm.unSignedLists = res.lists.filter(item => item.contract_status_n === '待首付') // 待签约
// 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) {
// vm.$refs.scroll.update(true)
// }
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)
} else if (returnData.length === 10) {
returnData.forEach((data, index, array) => {
vm.lists.push(array[index])
})
vm.$refs.scroll.update(false)
}
vm.classify()
} else {
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>
......
<!--
* @Author: your name
* @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
* @Description: 合同查询--明细
* @FilePath:
......@@ -73,7 +73,7 @@
</div>
</div>
<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)">
<img src="@/assets/contractRepayment/plan.png" alt="">
<span>还款计划</span>
......@@ -99,13 +99,7 @@ export default {
}
},
computed: {
totalTimes () {
let num = 0
for (let item of this.lists) {
num += Number(item.overdue_times)
}
return num
},
},
watch: {},
beforeRouteEnter (to, from, next) {
......
......@@ -8,7 +8,7 @@
</h-header>
<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 class="header">
<img src="@/assets/contractRepayment/contract.png" alt="">
......@@ -46,6 +46,7 @@ export default {
data () {
return {
// data: null, 无记录时
pagenum: 1,
lists: [],
}
},
......@@ -62,6 +63,8 @@ export default {
beforeRouteEnter (to, from, next) {
next(vm => {
if (from.name === 'HomePage') {
vm.pagenum = 1
vm.lists = []
vm.getList()
}
})
......@@ -72,15 +75,34 @@ export default {
let url = process.env.basePath + 'con_repayment_list_query'
let param = {
user_phone: window.localStorage.getItem('user_phone'),
pagesize: 10,
pagenum: vm.pagenum,
}
hlsPopup.showLoading('请稍候')
vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
vm.lists = res.lists
if (res.listst.length >= 0 && res.lists.length < 10) {
let returnData = []
returnData = res.lists
if (returnData.length === 0) {
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 {
hlsPopup.showLongCenter(res.message)
}
......
<!--
* @Author: your name
* @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
* @Description: In User Settings Edit
-->
......@@ -26,14 +26,13 @@
<!-- <h-content > -->
<scroll
v-if="num === 1"
ref="scroll"
:updateData="[submitLists]"
:updateData="[showLists]"
:pullUp="true"
@pullingUp="loadMore"
>
<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)">
<img src="@/assets/distributorSign/fileIcon.png" alt="" class="file-icon">
<p>
......@@ -50,35 +49,6 @@
</div>
</div>
</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>
</template>
......@@ -91,7 +61,7 @@ import unCheck2 from '@/assets/constractSigning/yes-undone.png'
export default {
data () {
return {
num: 1,
num: null,
pagenum: 1,
searchInput: '',
check1: Check1,
......@@ -101,7 +71,30 @@ export default {
user_bp_type: '', // 客户类型
submitLists: [], // 待签约
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 () {
......@@ -113,6 +106,8 @@ export default {
next(vm => {
if (from.name === 'MyInfo') {
vm.num = 1
vm.pagenum = 1
vm.searchInput = ''
vm.user_bp_type = vm.$route.params.user_bp_type
}
vm.contractList()
......@@ -138,13 +133,14 @@ export default {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
console.log(res.lists)
vm.lists = res.lists
vm.submitLists = res.lists.filter(item => item.confirm_status === 'SUBMIT')
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)
}
if (vm.approvedLists.length > 0 && vm.approvedLists.length < 10) {
vm.$refs.scrollList.update(true)
} else if (res.lists.length === 10) {
vm.$refs.scroll.update(false)
}
} else {
hlsPopup.showLongCenter(res.message)
......@@ -154,31 +150,73 @@ export default {
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 + 1,
searchInput: '1',
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') {
console.log('.....', res.lists)
vm.submitLists = res.lists.filter(item => item.confirm_status === 'SUBMIT')
vm.approvedLists = res.lists.filter(item => item.confirm_status === 'APPROVED')
if (vm.submitLists.length > 0 && vm.submitLists.length < 10) {
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)
} 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.$refs.scrollList.update(true)
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
}
} else {
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) {
this.$router.push({
......
......@@ -168,6 +168,7 @@ export default {
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) {
......
......@@ -14,7 +14,7 @@
<h-content>
<div class="hinput">
<div class="search-box">
<input type="text" placeholder="请输入经销商/产品名称/参数项">
<input v-model="searchInput" type="text" placeholder="请输入经销商/产品名称/参数项">
<img src="@/assets/distributorSign/search.png" alt="">
</div>
</div>
......@@ -22,6 +22,7 @@
ref="scroll"
:updateData="[productList]"
:pullUp="true"
@pullingUp="loadMore"
>
<div class="division-box">
......@@ -56,11 +57,24 @@
export default {
data () {
return {
pagenum: 1,
searchInput: '',
productList: [],
}
},
created: function () {
},
watch: {
searchInput () {
let vm = this
if (vm.timeout) {
clearTimeout(vm.timeout)
}
vm.timeout = setTimeout(() => {
vm.search()
}, 1000)
},
},
mounted: function () {
},
......@@ -70,9 +84,13 @@ export default {
},
beforeRouteEnter (to, from, next) {
next(vm => {
// if (from.name === 'MyInfo') {
if (from.name === 'MyInfo') {
vm.pagenum = 1
vm.searchInput = ''
vm.getList()
} else if (from.name === 'ProDetailed') {
vm.getList()
// }
}
})
},
methods: {
......@@ -80,6 +98,9 @@ export default {
let vm = this
let url = $config.basePath + 'my_collection_query'
let param = {
pagesize: 10,
pagenum: vm.pagenum,
searchInput: vm.searchInput,
user_phone: window.localStorage.getItem('user_phone'),
}
hlsPopup.showLoading('数据加载中')
......@@ -87,16 +108,89 @@ export default {
hlsPopup.hideLoading()
if (res.result === 'S') {
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
})
if (res.lists.length > 0 && res.lists.length < 10) {
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 {
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: 收藏状态
goDetailed (val, status, bp_id) { // 进入产品查询功能明细页面
......
......@@ -59,15 +59,32 @@ export default {
data () {
return {
lists: [],
pagenum: 2,
pagenum: 1,
searchInput: '',
}
},
computed: {},
watch: {},
activated () {
// debugger
this.proQuery()
watch: {
searchInput () {
let vm = this
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:
{
......@@ -87,14 +104,19 @@ export default {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
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
})
if (res.lists.length > 0 && res.lists.length < 10) {
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 {
hlsPopup.showLongCenter(res.message)
}
......@@ -103,7 +125,7 @@ export default {
loadMore () {
let vm = this
vm.pagenum++
vm.pagenum = vm.pagenum + 1
let url = $config.basePath + 'prd_product_list'
let param = {
division: window.sessionStorage.division,
......@@ -115,20 +137,62 @@ export default {
vm.hlsPopup.showLoading('数据加载中')
vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
let returnData = []
if (res.result === 'S') {
console.log('...........', res.lists)
// vm.lists = res.lists
// res.lists.forEach(item => {
// 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)
// }
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.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 {
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: 收藏状态
goDetailed (val, status, bp_id) {
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