Commit 754220b5 authored by chuan.liu's avatar chuan.liu

提报市场违约线索提交接口调试

parent 19dbf056
This diff is collapsed.
......@@ -4,17 +4,18 @@
<view class="listview">
<list class="cell-list" v-if="lists.length > 0" :show-scrollbar='false' loadmoreoffset='100'
@loadmore="scrolltolower">
<cell @click="handleChecked(item)" v-for="item in lists" :key='item.zcode'>
<cell @click="handleChecked(item)" v-for="item in lists" :key='item.id'>
<view class="cell-list-block">
<view class="cell-list-block__content">
<view class="list-block-item">
<text class="list-block-item__title1">{{item.zzfld000098}}</text>
<text class="list-block-item__title1">{{item.name}}</text>
<text class="list-block-item__label">{{item.address}}</text>
</view>
</view>
</view>
</cell>
<cell>
<view class="loading-more" v-if='lists.length>14'>
<view class="loading-more" v-if='lists.length>15'>
<text class="loading-more-text">{{loadingText}}</text>
</view>
</cell>
......@@ -30,8 +31,8 @@
} from 'vuex'
import {
apiGetPengmaInfo
} from '@/servers/groupOrder.js'
apiGetTerminal
} from '@/servers/breakwords.js'
import noData from '@/components/nodata.nvue';
......@@ -49,11 +50,14 @@
isDone: false,
isRefresh: false
},
page: {
"currentPage": "1",
"pageSize": "15",
},
lists: [],
selectedPaintDesign: {},
selectedClueTerminal: {},
toPageParams: {
page: '',
head: ""
keywords: '',
}
}
},
......@@ -63,31 +67,34 @@
'height': `${this.sysinfo.safeArea.top + 44}px`
}
},
...mapState(['sysinfo', 'userInfo'])
...mapState(['sysinfo'])
},
onLoad(option) {
console.log('select-saleplan', option)
if (option && option.from) {
if (option && option.keywords) {
const {
from,
head
keywords
} = option
this.toPageParams.page = from
this.toPageParams.head = JSON.parse(head)
this.toPageParams.keywords = keywords || ''
}
},
onPullDownRefresh() {
console.log('refresh');
this.getPengmaInfo()
this.reset()
this.getTerminal()
setTimeout(function() {
uni.stopPullDownRefresh();
}, 600);
},
created() {
this.getPengmaInfo()
this.reset()
this.getTerminal()
},
methods: {
async getPengmaInfo(isRefresh) {
async getTerminal(isRefresh) {
if (this.loadParams.isDone) {
return
}
uni.showLoading({
title: '加载中'
......@@ -95,25 +102,59 @@
setTimeout(function() {
uni.hideLoading();
}, 2000);
const res = await apiGetPengmaInfo()
const params = {
id: '',
name: this.toPageParams.keywords,
...this.page
}
const res = await apiGetTerminal(params)
uni.hideLoading();
this.lists = res.info
this.loadingText = '-- 到底了 --'
const {
totalNumberOfResults,
numberOfPages
} = res.data.pagination
this.loadParams.total = totalNumberOfResults
this.loadParams.totalPage = numberOfPages
if (isRefresh) {
this.lists = res.data.results
this.loadParams.isDone = false
} else {
this.lists = this.lists.concat(res.data.results)
}
},
scrolltolower() {
console.log('onReachBottom');
if (this.page.currentPage < this.loadParams.totalPage) {
this.page.currentPage++
this.getTerminal()
} else {
this.loadParams.isDone = true
this.loadingText = '-- 到底了 --'
}
},
reset() {
this.loadParams = {
total: 0,
totalPage: 1,
isDone: false,
isRefresh: false
}
this.page.currentPage = 1
this.lists = []
this.loadingText = '加载中'
},
handleChecked(item) {
this.selectedPaintDesign = item
uni.$emit('selectedPaintDesign', {
selectedPaintDesign: item
this.selectedClueTerminal = item
uni.$emit('selectClueTerminal', {
selectedClueTerminal: item
})
uni.navigateBack()
},
loadMore() {
// this.getPengmaInfo()
this.reset()
this.getTerminal(true)
}
}
}
......@@ -179,13 +220,14 @@
.list-block-item {
display: flex;
align-items: center;
flex-direction: column;
}
.list-block-item__title1 {
color: #333;
font-weight: 400;
font-size: 28rpx;
margin-bottom: 4px;
}
.list-block-item__label {
......@@ -218,7 +260,7 @@
.cell-list-block {
display: flex;
flex: 1;
height: 100rpx;
height: 120rpx;
background: #fff;
align-items: center;
border-bottom: 1px solid #f4f5f6;
......
......@@ -20,6 +20,26 @@ export async function apiGetTerminal(params) {
return res
}
/**
* 扫码查询产品信息
* @param name 账户名
* @returns {Promise<AxiosResponse<T>>}
*/
export async function apiGetClueProduct(params) {
const res = await apiHelper.post('/wmdpwebservices/clue/product', params)
return res
}
/**
* 扫码查询经销商信息
* @param name 账户名
* @returns {Promise<AxiosResponse<T>>}
*/
export async function apiGetClueDistributer(params) {
const res = await apiHelper.post('/wmdpwebservices/clue/distributer', params)
return res
}
/**
* 线索提交
* @param name 账户名
......
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