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

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

parent 19dbf056
This diff is collapsed.
...@@ -4,17 +4,18 @@ ...@@ -4,17 +4,18 @@
<view class="listview"> <view class="listview">
<list class="cell-list" v-if="lists.length > 0" :show-scrollbar='false' loadmoreoffset='100' <list class="cell-list" v-if="lists.length > 0" :show-scrollbar='false' loadmoreoffset='100'
@loadmore="scrolltolower"> @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">
<view class="cell-list-block__content"> <view class="cell-list-block__content">
<view class="list-block-item"> <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> </view>
</view> </view>
</cell> </cell>
<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> <text class="loading-more-text">{{loadingText}}</text>
</view> </view>
</cell> </cell>
...@@ -30,8 +31,8 @@ ...@@ -30,8 +31,8 @@
} from 'vuex' } from 'vuex'
import { import {
apiGetPengmaInfo apiGetTerminal
} from '@/servers/groupOrder.js' } from '@/servers/breakwords.js'
import noData from '@/components/nodata.nvue'; import noData from '@/components/nodata.nvue';
...@@ -49,11 +50,14 @@ ...@@ -49,11 +50,14 @@
isDone: false, isDone: false,
isRefresh: false isRefresh: false
}, },
page: {
"currentPage": "1",
"pageSize": "15",
},
lists: [], lists: [],
selectedPaintDesign: {}, selectedClueTerminal: {},
toPageParams: { toPageParams: {
page: '', keywords: '',
head: ""
} }
} }
}, },
...@@ -63,31 +67,34 @@ ...@@ -63,31 +67,34 @@
'height': `${this.sysinfo.safeArea.top + 44}px` 'height': `${this.sysinfo.safeArea.top + 44}px`
} }
}, },
...mapState(['sysinfo', 'userInfo']) ...mapState(['sysinfo'])
}, },
onLoad(option) { onLoad(option) {
console.log('select-saleplan', option) console.log('select-saleplan', option)
if (option && option.from) { if (option && option.keywords) {
const { const {
from, keywords
head
} = option } = option
this.toPageParams.page = from this.toPageParams.keywords = keywords || ''
this.toPageParams.head = JSON.parse(head)
} }
}, },
onPullDownRefresh() { onPullDownRefresh() {
console.log('refresh'); console.log('refresh');
this.getPengmaInfo() this.reset()
this.getTerminal()
setTimeout(function() { setTimeout(function() {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
}, 600); }, 600);
}, },
created() { created() {
this.getPengmaInfo() this.reset()
this.getTerminal()
}, },
methods: { methods: {
async getPengmaInfo(isRefresh) { async getTerminal(isRefresh) {
if (this.loadParams.isDone) {
return
}
uni.showLoading({ uni.showLoading({
title: '加载中' title: '加载中'
...@@ -95,25 +102,59 @@ ...@@ -95,25 +102,59 @@
setTimeout(function() { setTimeout(function() {
uni.hideLoading(); uni.hideLoading();
}, 2000); }, 2000);
const res = await apiGetPengmaInfo() const params = {
id: '',
name: this.toPageParams.keywords,
...this.page
}
const res = await apiGetTerminal(params)
uni.hideLoading(); 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() { 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) { handleChecked(item) {
this.selectedPaintDesign = item this.selectedClueTerminal = item
uni.$emit('selectedPaintDesign', { uni.$emit('selectClueTerminal', {
selectedPaintDesign: item selectedClueTerminal: item
}) })
uni.navigateBack() uni.navigateBack()
}, },
loadMore() { loadMore() {
// this.getPengmaInfo() this.reset()
this.getTerminal(true)
} }
} }
} }
...@@ -179,13 +220,14 @@ ...@@ -179,13 +220,14 @@
.list-block-item { .list-block-item {
display: flex; display: flex;
align-items: center; flex-direction: column;
} }
.list-block-item__title1 { .list-block-item__title1 {
color: #333; color: #333;
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
margin-bottom: 4px;
} }
.list-block-item__label { .list-block-item__label {
...@@ -218,7 +260,7 @@ ...@@ -218,7 +260,7 @@
.cell-list-block { .cell-list-block {
display: flex; display: flex;
flex: 1; flex: 1;
height: 100rpx; height: 120rpx;
background: #fff; background: #fff;
align-items: center; align-items: center;
border-bottom: 1px solid #f4f5f6; border-bottom: 1px solid #f4f5f6;
......
...@@ -20,6 +20,26 @@ export async function apiGetTerminal(params) { ...@@ -20,6 +20,26 @@ export async function apiGetTerminal(params) {
return res 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 账户名 * @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