Commit 67d2cee9 by zhangxw

联调修改

1 parent 78864b56
...@@ -76,6 +76,17 @@ App({ ...@@ -76,6 +76,17 @@ App({
}) })
}) })
}, },
// 设置tabBar跳转参数
setTabParams(tabPage, params) {
this.globalData.tabPageParams[tabPage] = params
},
// 获取tabBar页参数
getTabParams(tabPage) {
const params = this.globalData.tabPageParams[tabPage]
delete this.globalData.tabPageParams[tabPage]
return params
},
async getVersionInfo(request) { async getVersionInfo(request) {
if (request) this.globalData.versionData = null if (request) this.globalData.versionData = null
const { const {
...@@ -100,6 +111,7 @@ App({ ...@@ -100,6 +111,7 @@ App({
}, },
onHide() {}, onHide() {},
globalData: { globalData: {
versionData: null versionData: null,
tabPageParams: {}
}, },
}) })
...@@ -19,7 +19,8 @@ Component({ ...@@ -19,7 +19,8 @@ Component({
} }
} }
}, },
scroll: Boolean scroll: Boolean,
notInitialLoading: Boolean
}, },
/** /**
* 组件的初始数据 * 组件的初始数据
...@@ -31,7 +32,7 @@ Component({ ...@@ -31,7 +32,7 @@ Component({
ready() { ready() {
// console.log('lifetimes',this.data.tabIndex); // console.log('lifetimes',this.data.tabIndex);
// console.log('lifetimes',this.data.activeIndex); // console.log('lifetimes',this.data.activeIndex);
this.setTab(this.data.tabIndex) this.setTab(this.data.tabIndex, this.data.notInitialLoading)
let that = this let that = this
wx.$eventbus.on('page_show', n => { wx.$eventbus.on('page_show', n => {
!that.data.width && that.setTab(that.data.tabIndex) !that.data.width && that.setTab(that.data.tabIndex)
...@@ -49,7 +50,7 @@ Component({ ...@@ -49,7 +50,7 @@ Component({
} = e.currentTarget.dataset } = e.currentTarget.dataset
this.setTab(index) this.setTab(index)
}, },
setTab(index = 0) { setTab(index = 0, notInitialLoading) {
let { let {
tabIndex, tabIndex,
} = this.data } = this.data
...@@ -75,7 +76,7 @@ Component({ ...@@ -75,7 +76,7 @@ Component({
to: `to-${index}`, to: `to-${index}`,
width width
}) })
this.triggerEvent('click', index) if (!notInitialLoading) this.triggerEvent('click', index)
}, 100) }, 100)
}, this) }, this)
}, this) }, this)
......
...@@ -119,7 +119,6 @@ Component({ ...@@ -119,7 +119,6 @@ Component({
async getAnalysisData() { async getAnalysisData() {
try { try {
let params = this.getParams() let params = this.getParams()
params.merchantid = 44215138
const [outputData, buyAndToStoreData, chartData, supervisionSale] = await Promise.all([ const [outputData, buyAndToStoreData, chartData, supervisionSale] = await Promise.all([
CustomerApi.queryMerchantOutputAndAtv(params), CustomerApi.queryMerchantOutputAndAtv(params),
CustomerApi.queryMerchantBuyAndTostore(params), CustomerApi.queryMerchantBuyAndTostore(params),
......
...@@ -419,7 +419,7 @@ Page({ ...@@ -419,7 +419,7 @@ Page({
this.setData({ this.setData({
confirmFlag: false confirmFlag: false
}) })
let { code } = res let { code, message } = res
const okText = '我知道了' const okText = '我知道了'
if (this.resultDialog) { if (this.resultDialog) {
if (code == 0) { if (code == 0) {
...@@ -432,7 +432,7 @@ Page({ ...@@ -432,7 +432,7 @@ Page({
} else { } else {
this.resultDialog.open({ this.resultDialog.open({
type: 'error', type: 'error',
title: '修改失败,请稍后重试', title: message,
description: '', description: '',
okText okText
}) })
......
...@@ -50,6 +50,15 @@ ...@@ -50,6 +50,15 @@
min-height: 40rpx; min-height: 40rpx;
line-height: 40rpx; line-height: 40rpx;
width: 100%; width: 100%;
&.disabled {
color: #999EA8;
}
}
.value-text {
word-break: break-all;
&.disabled {
color: #999EA8;
}
} }
image { image {
flex-shrink: 0; flex-shrink: 0;
......
...@@ -9,11 +9,11 @@ ...@@ -9,11 +9,11 @@
<view class="label">{{item.label}} <text class="star">*</text></view> <view class="label">{{item.label}} <text class="star">*</text></view>
<view class="value" bindtap="showPopup" data-target="{{item}}"> <view class="value" bindtap="showPopup" data-target="{{item}}">
<block wx:if="{{item.type == 'textarea'}}"> <block wx:if="{{item.type == 'textarea'}}">
<textarea value="{{infoData[item.key]}}" class="textarea" placeholder="请输入" placeholder-class="placeholder-class" auto-height="true" maxlength="{{item.maxLength}}" disabled="{{item.disabled}}" cursor-spacing="16" bindinput="onInput" data-key="{{item.key}}"/> <textarea value="{{infoData[item.key]}}" class="textarea {{item.disabled ? 'disabled': ''}}" placeholder="请输入" placeholder-class="placeholder-class" auto-height="true" maxlength="{{item.maxLength}}" disabled="{{item.disabled}}" cursor-spacing="16" bindinput="onInput" data-key="{{item.key}}"/>
</block> </block>
<block wx:else> <block wx:else>
<block wx:if="{{infoData[item.key]}}"> <block wx:if="{{infoData[item.key]}}">
<text style="word-break: break-all;">{{infoData[item.key]}}</text> <text class="value-text {{item.disabled ? 'disabled' : ''}}" style="word-break: break-all;">{{infoData[item.key]}}</text>
</block> </block>
<block wx:else> <block wx:else>
<text class="placeholder">点击选择</text> <text class="placeholder">点击选择</text>
......
...@@ -121,8 +121,9 @@ Page({ ...@@ -121,8 +121,9 @@ Page({
}, },
onContactInput(e) { onContactInput(e) {
const value = e.detail.value.replace(/\s/g, '')
this.setData({ this.setData({
'infoData.contactName': e.detail.value 'infoData.contactName': value
}) })
}, },
...@@ -190,11 +191,10 @@ Page({ ...@@ -190,11 +191,10 @@ Page({
async getLocation() { async getLocation() {
try { try {
wx.$api.showLoading()
const loc = await wx.getLocation({ type: "gcj02" }) const loc = await wx.getLocation({ type: "gcj02" })
const { latitude, longitude } = loc const { latitude, longitude } = loc
wx.$api.showLoading()
const res = await mapApi.detailedAdrress([latitude, longitude]) const res = await mapApi.detailedAdrress([latitude, longitude])
console.log(res)
const locationName = res?.formatted_address || res?.address || "已定位" const locationName = res?.formatted_address || res?.address || "已定位"
wx.$api.hideLoading() wx.$api.hideLoading()
this.setData({ latitude, longitude, locationName }) this.setData({ latitude, longitude, locationName })
...@@ -229,7 +229,7 @@ Page({ ...@@ -229,7 +229,7 @@ Page({
this.setData({confirmFlag: false}) this.setData({confirmFlag: false})
wx.$api.hideLoading() wx.$api.hideLoading()
const okText = '我知道了' const okText = '我知道了'
let { code } = res let { code, message } = res
if (this.resultDialog) { if (this.resultDialog) {
if (code == 0) { if (code == 0) {
this.resultDialog.open({ this.resultDialog.open({
...@@ -241,7 +241,7 @@ Page({ ...@@ -241,7 +241,7 @@ Page({
} else { } else {
this.resultDialog.open({ this.resultDialog.open({
type: 'fail', type: 'fail',
title: '新增拜访记录失败,请稍后重试', title: message,
description: '', description: '',
okText okText
}) })
......
...@@ -50,6 +50,7 @@ page { ...@@ -50,6 +50,7 @@ page {
.value-text { .value-text {
color: #1A2233; color: #1A2233;
font-size: 30rpx; font-size: 30rpx;
word-break: break-all;
} }
.location-text { .location-text {
display: flex; display: flex;
...@@ -127,7 +128,8 @@ page { ...@@ -127,7 +128,8 @@ page {
margin-left: 8rpx; margin-left: 8rpx;
} }
.location-value { .location-value {
justify-content: flex-end; justify-content: flex-end;
} }
.btn { .btn {
position: fixed; position: fixed;
......
// packageCustomer/pages/merchantDetail/merchantDetail.js // packageCustomer/pages/merchantDetail/merchantDetail.js
import CustomerApi from "~/api/customerApi/index" import CustomerApi from "~/api/customerApi/index"
import { IMG_URL, COOPERATIONMODELIST, TRSFFICSTATUSLIST, SCENELIST, ROLELIST } from '~/utils/constantData' import { IMG_URL, COOPERATIONMODELIST, TRSFFICSTATUSLIST, SCENELIST, ROLELIST } from '~/utils/constantData'
import dayjs from 'dayjs'
Page({ Page({
options: { options: {
styleIsolation: 'shared' styleIsolation: 'shared'
...@@ -80,7 +81,7 @@ Page({ ...@@ -80,7 +81,7 @@ Page({
{ label: '合作模式', value: infoDetail.coopMode }, { label: '合作模式', value: infoDetail.coopMode },
{ label: '拜访次数', value: infoDetail.visitCount != null ? `${infoDetail.visitCount}` : '', highlight: true }, { label: '拜访次数', value: infoDetail.visitCount != null ? `${infoDetail.visitCount}` : '', highlight: true },
{ label: '流量情况', value: infoDetail.flowScale }, { label: '流量情况', value: infoDetail.flowScale },
{ label: '展业时间', value: infoDetail.expectBizTime }, { label: '展业时间', value: infoDetail.expectedOperationDate ? dayjs(infoDetail.expectedOperationDate).format('YYYY-MM-DD') : '' },
{ label: '分润规则', value: infoDetail.profitRule }, { label: '分润规则', value: infoDetail.profitRule },
{ label: '业务类型', value: infoDetail.bizType, full: true } { label: '业务类型', value: infoDetail.bizType, full: true }
].filter(Boolean) ].filter(Boolean)
...@@ -100,7 +101,7 @@ Page({ ...@@ -100,7 +101,7 @@ Page({
progressData(data) { progressData(data) {
const businessSceneNames = {0: '轻改', 1: '权益', 2: '延保'} const businessSceneNames = {0: '轻改', 1: '权益', 2: '延保'}
// 主营品牌 // 主营品牌
data.mainCategory = data?.brandList?.map(val => {return `${val.mainBrand}${val.subBrandName}`})?.join('/') data.mainCategory = data.mainBrand
// 合作模式 // 合作模式
data.coopMode = data?.cooperationModeList?.map(val => { data.coopMode = data?.cooperationModeList?.map(val => {
const sceneName = businessSceneNames[val.businessSceneType] || '' const sceneName = businessSceneNames[val.businessSceneType] || ''
...@@ -130,7 +131,6 @@ Page({ ...@@ -130,7 +131,6 @@ Page({
}, },
tabClick(e) { tabClick(e) {
console.log(e)
const index = typeof e?.detail === 'number' ? e.detail : 0 const index = typeof e?.detail === 'number' ? e.detail : 0
this.setData({ this.setData({
tabIndex: index, tabIndex: index,
...@@ -141,7 +141,6 @@ Page({ ...@@ -141,7 +141,6 @@ Page({
measureLayout() { measureLayout() {
const { scrollTop, initialTabTop, navBarHeight } = this.data const { scrollTop, initialTabTop, navBarHeight } = this.data
console.log(scrollTop, initialTabTop, navBarHeight)
if (scrollTop >= (initialTabTop - navBarHeight)) { if (scrollTop >= (initialTabTop - navBarHeight)) {
this.setData({ this.setData({
setScrollTop: (initialTabTop - navBarHeight) setScrollTop: (initialTabTop - navBarHeight)
......
...@@ -70,8 +70,9 @@ Page({ ...@@ -70,8 +70,9 @@ Page({
getPotentialDetail() { getPotentialDetail() {
let { pageQuery } = this.data let { pageQuery } = this.data
wx.$api.showLoading()
CustomerApi.getCustomerData({id: pageQuery.id}).then(res => { CustomerApi.getCustomerData({id: pageQuery.id}).then(res => {
if (res.isBind == 1) res.potentialCustomersStatus = 4 wx.$api.hideLoading()
// 处理数据回显 // 处理数据回显
this.progressData(res) this.progressData(res)
}) })
...@@ -101,7 +102,8 @@ Page({ ...@@ -101,7 +102,8 @@ Page({
// 店面门头照片 // 店面门头照片
data.storePhotoList = data.storePhoto?.split(',') data.storePhotoList = data.storePhoto?.split(',')
this.setData({ this.setData({
infoDetail: data infoDetail: data,
showPage: true
}, () => { }, () => {
this.buildInfoBoard() this.buildInfoBoard()
this.recordTabTop() this.recordTabTop()
...@@ -128,7 +130,7 @@ Page({ ...@@ -128,7 +130,7 @@ Page({
{ label: '合作模式', value: infoDetail.coopMode }, { label: '合作模式', value: infoDetail.coopMode },
{ label: '拜访次数', value: infoDetail.visitCount != null ? `${infoDetail.visitCount}` : '', highlight: true }, { label: '拜访次数', value: infoDetail.visitCount != null ? `${infoDetail.visitCount}` : '', highlight: true },
{ label: '流量情况', value: infoDetail.flowScale }, { label: '流量情况', value: infoDetail.flowScale },
[3, 4].includes(infoDetail.potentialCustomersStatus) ? { label: '预计展业时间', value: dayjs(infoDetail.expectedOperationDate).format('YYYY-MM-DD') } : null, // 已签约或已绑定展示 [3, 4].includes(infoDetail.potentialCustomersStatus) ? { label: '预计展业时间', value: infoDetail.expectedOperationDate ? dayjs(infoDetail.expectedOperationDate).format('YYYY-MM-DD') : '' } : null, // 已签约或已绑定展示
[3, 4].includes(infoDetail.potentialCustomersStatus) ? { label: '分润规则', value: infoDetail.profitRule } : null, // 已签约或已绑定展示 [3, 4].includes(infoDetail.potentialCustomersStatus) ? { label: '分润规则', value: infoDetail.profitRule } : null, // 已签约或已绑定展示
{ label: '业务类型', value: infoDetail.bizType, span: 2, full: [3, 4].includes(infoDetail.potentialCustomersStatus), clampLines: 1, threshold: 16 }, { label: '业务类型', value: infoDetail.bizType, span: 2, full: [3, 4].includes(infoDetail.potentialCustomersStatus), clampLines: 1, threshold: 16 },
[3, 4].includes(infoDetail.potentialCustomersStatus) ? { label: '上架商品', value: infoDetail.productShelfInfo, full: true } : null [3, 4].includes(infoDetail.potentialCustomersStatus) ? { label: '上架商品', value: infoDetail.productShelfInfo, full: true } : null
......
<!-- 统一导航栏 --> <!-- 统一导航栏 -->
<navigation-bar showBack="{{true}}" navStyle="{{navStyle}}" bindnavbarReady="navbarReady">潜客详情</navigation-bar> <navigation-bar showBack="{{true}}" navStyle="{{navStyle}}" bindnavbarReady="navbarReady">潜客详情</navigation-bar>
<scroll-view class="layout" scroll-y style="padding-top: {{navBarHeight}}px;" bindscroll="onScroll" scroll-top="{{setScrollTop}}"> <scroll-view class="layout" scroll-y style="padding-top: {{navBarHeight}}px;" bindscroll="onScroll" scroll-top="{{setScrollTop}}">
<view class="container"> <view class="container" wx:if="{{showPage}}">
<view class="card header-card"> <view class="card header-card">
<view class="title-row"> <view class="title-row">
<text class="shop-name">{{infoDetail.storeName}}</text> <text class="shop-name">{{infoDetail.storeName}}</text>
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</view> </view>
</view> </view>
<view class="tabbar-anchor" id="tabbarAnchor"> <view class="tabbar-anchor" id="tabbarAnchor">
<tab-bar tabList="{{ listTabs }}" bindclick="tabClick" activeIndex="{{ tabIndex }}" /> <tab-bar tabList="{{ listTabs }}" notInitialLoading="{{true}}" bindclick="tabClick" activeIndex="{{ tabIndex }}" />
</view> </view>
<block wx:if="{{tabIndex == 0}}"> <block wx:if="{{tabIndex == 0}}">
...@@ -59,8 +59,7 @@ ...@@ -59,8 +59,7 @@
</view> </view>
</scroll-view> </scroll-view>
<!-- 底部固定操作条:新增拜访 --> <!-- 底部固定操作条:新增拜访 -->
<!-- potentialCustomersStatus 4是根据isBind绑定状态方便处理造出来的值 --> <view class="bottom-bar" wx:if="{{tabIndex != 1 && userInfo.loginRole != 1 && infoDetail.potentialCustomersStatus == 1}}">
<view class="bottom-bar" wx:if="{{tabIndex != 1 && userInfo.loginRole != 1 && infoDetail.potentialCustomersStatus != 3 && infoDetail.potentialCustomersStatus != 4}}">
<view class="inner safe-area-bottom"> <view class="inner safe-area-bottom">
<view class="btn" bind:tap="onCreateVisit">新增拜访</view> <view class="btn" bind:tap="onCreateVisit">新增拜访</view>
</view> </view>
......
...@@ -175,7 +175,7 @@ Page({ ...@@ -175,7 +175,7 @@ Page({
wx.$api.hideLoading() wx.$api.hideLoading()
this.setData({confirmFlag: false}) this.setData({confirmFlag: false})
const okText = '我知道了' const okText = '我知道了'
let { code } = res let { code, message } = res
if (this.resultDialog) { if (this.resultDialog) {
if (code == 0) { if (code == 0) {
this.resultDialog.open({ this.resultDialog.open({
...@@ -187,7 +187,7 @@ Page({ ...@@ -187,7 +187,7 @@ Page({
} else { } else {
this.resultDialog.open({ this.resultDialog.open({
type: 'fail', type: 'fail',
title: '结果反馈失败,请稍后重试', title: message,
description: '', description: '',
okText okText
}) })
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
<view class="confirm" bindtap="handleConfirm">提交</view> <view class="confirm" bindtap="handleConfirm">提交</view>
</view> </view>
</view> </view>
<popup bind:hidePopup="cancel" bind:confirm="popupConfirm" show="{{timeVisible}}" title="拜访时间" height="50vh"> <popup bind:hidePopup="cancel" bind:confirm="popupConfirm" show="{{timeVisible}}" title="预计展业时间" height="50vh">
<van-datetime-picker id="datePicker" show-toolbar="{{false}}" min-date="{{ minDate }}" model:value="{{ currentDate }}" type="date" bind:change="onChange"/> <van-datetime-picker id="datePicker" show-toolbar="{{false}}" min-date="{{ minDate }}" model:value="{{ currentDate }}" type="date" bind:change="onChange"/>
</popup> </popup>
<!-- 结果弹窗组件:统一反馈弹窗 --> <!-- 结果弹窗组件:统一反馈弹窗 -->
......
// packageIndex/pages/salesSummary/salesSummary.js // packageIndex/pages/salesSummary/salesSummary.js
import IndexApi from '~/api/index/index' import IndexApi from '~/api/index/index'
import { tsFormatTime } from '~/utils/format' import { tsFormatTime } from '~/utils/format'
const app = getApp()
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
...@@ -77,6 +78,25 @@ Page({ ...@@ -77,6 +78,25 @@ Page({
this.getList() this.getList()
this.initTablist() this.initTablist()
}, },
// 跳转查看某个销售人员的潜客/门店数据
goCustomer(e) {
let { item } = e.currentTarget.dataset
app.setTabParams('customerObj', {itemParams: item})
wx.switchTab({
url: `/pages/tab/customer/customer`
})
},
// 跳转查看潜客详情
goPotentialDetail(e) {
let { target } = e.currentTarget.dataset
console.log(target)
// 兼容潜客详情页面参数
target.id = target.potentialCustomerId
wx.navigateTo({
url: `/packageCustomer/pages/potentialDetail/potentialDetail?query=${encodeURIComponent(JSON.stringify(target))}`
})
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<scroll-view class="scrollView" scroll-y style="height: calc(100vh - 80px);"> <scroll-view class="scrollView" scroll-y style="height: calc(100vh - 80px);">
<block wx:if="{{ activeIndex==0 }}"> <block wx:if="{{ activeIndex==0 }}">
<view class="list"> <view class="list">
<view class="box" wx:for="{{ list }}" wx:key="index"> <view class="box" bindtap="goCustomer" data-item="{{item}}" wx:for="{{ list }}" wx:key="index">
<view class="header"> <view class="header">
<view class="name">{{item.personName}}</view> <view class="name">{{item.personName}}</view>
<view class="phone">{{item.personPhone}}</view> <view class="phone">{{item.personPhone}}</view>
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
</block> </block>
<block wx:if="{{ activeIndex ==1 }}"> <block wx:if="{{ activeIndex ==1 }}">
<view class="list"> <view class="list">
<view class="box" wx:for="{{ list }}" wx:key="index"> <view class="box" bindtap="goPotentialDetail" data-target="{{item}}" wx:for="{{ list }}" wx:key="index">
<view class="merchant"> <view class="merchant">
<view class="merchantName text-hide">{{item.potentialCustomerName}}</view> <view class="merchantName text-hide">{{item.potentialCustomerName}}</view>
<view class="status">跟进中</view> <view class="status">跟进中</view>
......
// pages/components/storeStatistics/storeStatistics.js // pages/components/storeStatistics/storeStatistics.js
import IndexApi from '~/api/index/index' import IndexApi from '~/api/index/index'
const app = getApp()
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
...@@ -137,6 +138,21 @@ Component({ ...@@ -137,6 +138,21 @@ Component({
}) })
// 请求门店待跟进 // 请求门店待跟进
this.getTotal() this.getTotal()
},
// 跳转潜客详情
goPotentialDetail(e) {
let { target } = e.currentTarget.dataset
wx.navigateTo({
url: `/packageCustomer/pages/potentialDetail/potentialDetail?query=${encodeURIComponent(JSON.stringify(target))}`
})
},
// 跳转客户页面
getCustomerPage(e) {
let { type } = e.currentTarget.dataset
app.setTabParams('customer', {type})
wx.switchTab({
url: `/pages/tab/customer/customer`
})
} }
} }
}) })
...@@ -11,19 +11,19 @@ ...@@ -11,19 +11,19 @@
</view> </view>
<view class="tips">潜客门店跟进情况</view> <view class="tips">潜客门店跟进情况</view>
<view class="statusList"> <view class="statusList">
<view class="item"> <view class="item" bindtap="getCustomerPage" data-type="0">
<view class="label">潜客数</view> <view class="label">潜客数</view>
<view class="num">{{followUpData.potentialCustomersCount}}</view> <view class="num">{{followUpData.potentialCustomersCount}}</view>
</view> </view>
<view class="item"> <view class="item" bindtap="getCustomerPage" data-type="0">
<view class="label">跟进中</view> <view class="label">跟进中</view>
<view class="num">{{followUpData.followUpCount}}</view> <view class="num">{{followUpData.followUpCount}}</view>
</view> </view>
<view class="item"> <view class="item" bindtap="getCustomerPage" data-type="1">
<view class="label">已签约未出单</view> <view class="label">已签约未出单</view>
<view class="num">{{followUpData.signedNoOrderTotal}}</view> <view class="num">{{followUpData.signedNoOrderTotal}}</view>
</view> </view>
<view class="item"> <view class="item" bindtap="getCustomerPage" data-type="1">
<view class="label">已签约已出单</view> <view class="label">已签约已出单</view>
<view class="num">{{followUpData.signedHasOrderTotal}}</view> <view class="num">{{followUpData.signedHasOrderTotal}}</view>
</view> </view>
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<text class="label">上次拜访内容:</text> <text class="label">上次拜访内容:</text>
<text class="text">{{followUpData.waitFollowShopList[0].lastVisitContent||'-'}}</text> <text class="text">{{followUpData.waitFollowShopList[0].lastVisitContent||'-'}}</text>
</view> </view>
<view class="btn">跟进</view> <view class="btn" bindtap="goPotentialDetail" data-target="{{followUpData.waitFollowShopList[0]}}">跟进</view>
</view> </view>
<view class="visitRecord" wx:if="{{ followUpData.waitFollowShopList[1] }}"> <view class="visitRecord" wx:if="{{ followUpData.waitFollowShopList[1] }}">
<view class="time"> <view class="time">
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<text class="label">上次拜访内容:</text> <text class="label">上次拜访内容:</text>
<text class="text">{{followUpData.waitFollowShopList[1].lastVisitContent||'-'}}</text> <text class="text">{{followUpData.waitFollowShopList[1].lastVisitContent||'-'}}</text>
</view> </view>
<view class="btn">跟进</view> <view class="btn" bindtap="goPotentialDetail" data-target="{{followUpData.waitFollowShopList[0]}}">跟进</view>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -12,7 +12,8 @@ Component({ ...@@ -12,7 +12,8 @@ Component({
showAddIcon: Boolean, showAddIcon: Boolean,
navBarHeight: Number, navBarHeight: Number,
searchObj: Object, searchObj: Object,
userInfo: Object userInfo: Object,
personParams: Object
}, },
data: { data: {
...@@ -59,11 +60,12 @@ Component({ ...@@ -59,11 +60,12 @@ Component({
this.resetAndLoad() this.resetAndLoad()
}, },
getParams() { getParams() {
let { boardScopeActive, monthPickerValue, searchObj, statusIndex, userInfo } = this.data let { boardScopeActive, monthPickerValue, searchObj, statusIndex, userInfo, personParams } = this.data
const statusMap = { const statusMap = {
0: 0, // 全部 0: 0, // 全部
1: 1, // 待跟进 1: 1, // 待跟进
2: 3, // 已签约 2: 3, // 已签约
3: 4, // 已绑定
4: 2 // 未签约 4: 2 // 未签约
} }
const obj = { const obj = {
...@@ -76,10 +78,9 @@ Component({ ...@@ -76,10 +78,9 @@ Component({
businessTypeList: searchObj?.businessTypeList?.map(val => { if (val.value) return val.value }), businessTypeList: searchObj?.businessTypeList?.map(val => { if (val.value) return val.value }),
flowSituation: searchObj?.trafficStatusList?.value, flowSituation: searchObj?.trafficStatusList?.value,
provinceId: searchObj?.provinces?.value, provinceId: searchObj?.provinces?.value,
salesPersonId: searchObj?.salesStaffList?.value, salesPersonId: personParams?.personId || searchObj?.salesStaffList?.value,
potentialCustomersStatus: statusIndex == 0 ? undefined : statusMap[statusIndex], // 状态 potentialCustomersStatus: statusIndex == 0 ? undefined : statusMap[statusIndex], // 状态
isBind: statusIndex == 3 ? 1 : undefined, // 是否绑定 isSuperior: userInfo.loginRole == 1 && (personParams?.personId || searchObj?.salesStaffList?.value) ? 1 : 0,
isSuperior: userInfo.loginRole == 1 ? 1 : 0,
queryScoure: 3 queryScoure: 3
} }
return obj return obj
...@@ -87,7 +88,6 @@ Component({ ...@@ -87,7 +88,6 @@ Component({
getStatic() { getStatic() {
let params = this.getParams() let params = this.getParams()
delete params.potentialCustomersStatus delete params.potentialCustomersStatus
delete params.isBind
wx.$api.showLoading() wx.$api.showLoading()
CustomerApi.getPotentialStatic(params).then(res => { CustomerApi.getPotentialStatic(params).then(res => {
wx.$api.hideLoading() wx.$api.hideLoading()
...@@ -179,10 +179,9 @@ Component({ ...@@ -179,10 +179,9 @@ Component({
try { try {
const { currentPage, pageSize } = this.data const { currentPage, pageSize } = this.data
const params = this.getParams() const params = this.getParams()
if (currentPage == 1) wx.$api.showLoading()
const res = await CustomerApi.getPotentialList({ currentPage, pageSize, ...params }) const res = await CustomerApi.getPotentialList({ currentPage, pageSize, ...params })
res.list?.forEach(val => { wx.$api.hideLoading()
if (val.isBind == 1) val.potentialCustomersStatus = 4
})
const nextList = res?.list || [] const nextList = res?.list || []
const total = res?.total || res?.count || 0 const total = res?.total || res?.count || 0
const pages = res?.pages || (total ? Math.ceil(total / pageSize) : null) const pages = res?.pages || (total ? Math.ceil(total / pageSize) : null)
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
</view> </view>
</view> </view>
<view class="tabbar-anchor" > <view class="tabbar-anchor" >
<tab-bar tabList="{{ listTabs }}" bindclick="tabClick" activeIndex="{{ statusIndex }}" /> <tab-bar tabList="{{ listTabs }}" notInitialLoading="{{true}}" bindclick="tabClick" activeIndex="{{ statusIndex }}" />
</view> </view>
<!-- 列表(潜客) --> <!-- 列表(潜客) -->
<view class="list-section {{loading ? 'loading' : ''}}" id="" style="min-height: calc(100vh - {{tabHeight}}px - {{navBarHeight}}px - 24rpx - 172rpx);" > <view class="list-section {{loading ? 'loading' : ''}}" id="" style="min-height: calc(100vh - {{tabHeight}}px - {{navBarHeight}}px - 24rpx - 172rpx);" >
......
...@@ -11,7 +11,8 @@ Component({ ...@@ -11,7 +11,8 @@ Component({
properties: { properties: {
navBarHeight: Number, navBarHeight: Number,
searchObj: Object, searchObj: Object,
userInfo: Object userInfo: Object,
personParams: Object
}, },
data: { data: {
...@@ -52,7 +53,7 @@ Component({ ...@@ -52,7 +53,7 @@ Component({
this.resetAndLoad() this.resetAndLoad()
}, },
getParams() { getParams() {
let { boardScopeActive, monthPickerValue, searchObj, statusIndex, userInfo } = this.data let { boardScopeActive, monthPickerValue, searchObj, statusIndex, userInfo, personParams } = this.data
const obj = { const obj = {
isAll: boardScopeActive ? 1 : 0, isAll: boardScopeActive ? 1 : 0,
year: boardScopeActive ? undefined : new Date(monthPickerValue).getFullYear(), year: boardScopeActive ? undefined : new Date(monthPickerValue).getFullYear(),
...@@ -63,9 +64,9 @@ Component({ ...@@ -63,9 +64,9 @@ Component({
businessTypeList: searchObj?.businessTypeList?.map(val => { if (val.value) return val.value }), businessTypeList: searchObj?.businessTypeList?.map(val => { if (val.value) return val.value }),
flowSituation: searchObj?.trafficStatusList?.value, flowSituation: searchObj?.trafficStatusList?.value,
provinceId: searchObj?.provinces?.value, provinceId: searchObj?.provinces?.value,
salesPersonId: searchObj?.salesStaffList?.value, salesPersonId: personParams?.personId || searchObj?.salesStaffList?.value,
storeType: statusIndex ? statusIndex : undefined, storeType: statusIndex ? statusIndex : undefined,
isSuperior: userInfo.loginRole == 1 ? 1 : 0, isSuperior: userInfo.loginRole == 1 && (personParams?.personId || searchObj?.salesStaffList?.value) ? 1 : 0,
queryScoure: 3 queryScoure: 3
} }
return obj return obj
...@@ -107,7 +108,7 @@ Component({ ...@@ -107,7 +108,7 @@ Component({
} }
}, },
// 打开/关闭月份选择器(保持原有结构) // 打开/关闭月份选择器
openMonthPicker() { openMonthPicker() {
this.setData({ monthPickerShow: true, pendingMonthValue: this.data.monthPickerValue }) this.setData({ monthPickerShow: true, pendingMonthValue: this.data.monthPickerValue })
}, },
...@@ -165,11 +166,15 @@ Component({ ...@@ -165,11 +166,15 @@ Component({
}, },
async loadMore(cb) { async loadMore(cb) {
let { hasMore } = this.data
if (!hasMore) return
this.setData({ loading: true }) this.setData({ loading: true })
try { try {
const { currentPage, pageSize } = this.data const { currentPage, pageSize } = this.data
const params = this.getParams() const params = this.getParams()
if (currentPage == 1) wx.$api.showLoading()
const res = await CustomerApi.getStorePageList({ currentPage, pageSize, ...params }) const res = await CustomerApi.getStorePageList({ currentPage, pageSize, ...params })
wx.$api.hideLoading()
const nextList = (res.list || []).map(val => { const nextList = (res.list || []).map(val => {
val.salesUser = val.salePersonnelInfoDTOList?.map(v => { return v.personnelName })?.join('/') val.salesUser = val.salePersonnelInfoDTOList?.map(v => { return v.personnelName })?.join('/')
val.signedTime = val.signedTime ? dayjs(val.signedTime).format('YYYY-MM-DD HH:mm') : '' val.signedTime = val.signedTime ? dayjs(val.signedTime).format('YYYY-MM-DD HH:mm') : ''
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<!-- 列表状态筛选 TabBar(与父页吸顶逻辑保持一致类名) --> <!-- 列表状态筛选 TabBar(与父页吸顶逻辑保持一致类名) -->
<view class="tabbar-anchor" id="storeListTop"> <view class="tabbar-anchor" id="storeListTop">
<tab-bar tabList="{{ listTabs }}" bindclick="tabClick" activeIndex="{{ statusIndex }}" /> <tab-bar tabList="{{ listTabs }}" notInitialLoading="{{true}}" bindclick="tabClick" activeIndex="{{ statusIndex }}" />
</view> </view>
<!-- 列表(门店) --> <!-- 列表(门店) -->
......
...@@ -3,6 +3,7 @@ import { IMG_URL } from '~/utils/constantData' ...@@ -3,6 +3,7 @@ import { IMG_URL } from '~/utils/constantData'
import { getUserInfo } from '~/utils/cache/userInfo' import { getUserInfo } from '~/utils/cache/userInfo'
const navStyleTransparent = 'background-color: transparent;' const navStyleTransparent = 'background-color: transparent;'
import reportPageTrackMixin from '~/mixins/reportPageTrackMixin' import reportPageTrackMixin from '~/mixins/reportPageTrackMixin'
const app = getApp()
Page({ Page({
behaviors: [reportPageTrackMixin], behaviors: [reportPageTrackMixin],
/** /**
...@@ -78,6 +79,7 @@ Page({ ...@@ -78,6 +79,7 @@ Page({
scrollTop: 0, scrollTop: 0,
setScrollTop: 0, setScrollTop: 0,
track_event_code: 'customer_view_page', track_event_code: 'customer_view_page',
personParams: {} // 总监通过销售人员进入参数
}, },
// 总监有查看某个员工的潜客数据,手动触发时,将员工过滤条件清除 // 总监有查看某个员工的潜客数据,手动触发时,将员工过滤条件清除
onTabItemTap(e) { onTabItemTap(e) {
...@@ -85,7 +87,10 @@ Page({ ...@@ -85,7 +87,10 @@ Page({
wx.$track.setTrackData(0, 'customer_page', {}, '') wx.$track.setTrackData(0, 'customer_page', {}, '')
// 重新加载数据 // 重新加载数据
this.setData({ this.setData({
myTabIdx: 0 myTabIdx: 0,
scrollTop: 0,
setScrollTop: 0,
personParams: {}
}, () => { }, () => {
this.onShow() this.onShow()
}) })
...@@ -116,7 +121,21 @@ Page({ ...@@ -116,7 +121,21 @@ Page({
}) })
}, },
onShow() { onShow() {
let { myTabIdx } = this.data const obj = app.getTabParams('customerObj')?.itemParams || {}
if (Object.keys(obj)?.length) {
this.setData({
personParams: obj
})
}
const params = app.getTabParams('customerType')
let myTabIdx
if (params) {
this.setData({myTabIdx: Number(params.type)})
myTabIdx = Number(params.type)
} else {
myTabIdx = this.data.myTabIdx
}
const component = myTabIdx == 0 ? 'potentialSection' : 'storeSection' const component = myTabIdx == 0 ? 'potentialSection' : 'storeSection'
this.setData({ this.setData({
setScrollTop: 0 setScrollTop: 0
...@@ -144,12 +163,14 @@ Page({ ...@@ -144,12 +163,14 @@ Page({
scrollToListTop(e) { scrollToListTop(e) {
let { scrollTop, navBarHeight, fixedHeight } = this.data let { scrollTop, navBarHeight, fixedHeight } = this.data
wx.nextTick(() => { wx.nextTick(() => {
if (scrollTop >= (e.detail - navBarHeight - fixedHeight)) { setTimeout(() => {
this.setData({ let setScrollTop = e.detail - navBarHeight - fixedHeight
setScrollTop: e.detail - navBarHeight - fixedHeight, if (scrollTop >= setScrollTop) {
scrollTop: e.detail - navBarHeight - fixedHeight this.setData({
}) setScrollTop: setScrollTop > 0 ? setScrollTop : 0
} })
}
}, 200)
}) })
}, },
...@@ -198,12 +219,12 @@ Page({ ...@@ -198,12 +219,12 @@ Page({
return { ...item, valueText: text } return { ...item, valueText: text }
}) })
if (myTabIdx == 0) { if (myTabIdx == 0) {
this.setData({ selectedScreenPotential: nextSelected }, () => { this.setData({ selectedScreenPotential: nextSelected, scrollTop: 0, setScrollTop: 0 }, () => {
const potential = this.selectComponent('#potentialSection') const potential = this.selectComponent('#potentialSection')
if (potential) potential.getPageData() if (potential) potential.getPageData()
}) })
} else { } else {
this.setData({ selectedScreenStore: nextSelected }, () => { this.setData({ selectedScreenStore: nextSelected, scrollTop: 0, setScrollTop: 0 }, () => {
const storeSection = this.selectComponent('#storeSection') const storeSection = this.selectComponent('#storeSection')
if (storeSection) storeSection.getPageData() if (storeSection) storeSection.getPageData()
}) })
...@@ -227,10 +248,13 @@ Page({ ...@@ -227,10 +248,13 @@ Page({
const index = e?.currentTarget?.dataset?.id const index = e?.currentTarget?.dataset?.id
const nextIdx = typeof index === 'number' ? index : 0 const nextIdx = typeof index === 'number' ? index : 0
if (nextIdx === this.data.myTabIdx) return if (nextIdx === this.data.myTabIdx) return
this.setData({ myTabIdx: nextIdx, setScrollTop: 0 }) this.setData({ myTabIdx: nextIdx, scrollTop: 0, setScrollTop: 0 })
const component = nextIdx == 0 ? 'potentialSection' : 'storeSection' wx.nextTick(() => {
const coms = this.selectComponent(`#${component}`) this.setData({ scrollTop: 0, setScrollTop: 0 })
if (coms.getPageData) coms.getPageData() const component = nextIdx == 0 ? 'potentialSection' : 'storeSection'
const coms = this.selectComponent(`#${component}`)
if (coms.getPageData) coms.getPageData()
})
}, },
onHide() { onHide() {
this.onPageHide() this.onPageHide()
......
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
<view class="navigation-bar"> <view class="navigation-bar">
<navigation-bar fixedShowBack="{{ show_confirm }}" customBack bindback="back" navStyle="{{!show_confirm ? navStyle : ''}}" bindnavbarReady="navbarReady" page-title="工作台"> <navigation-bar fixedShowBack="{{ show_confirm }}" customBack bindback="back" navStyle="{{!show_confirm ? navStyle : ''}}" bindnavbarReady="navbarReady" page-title="工作台">
<view class="bar-nav" style="height: {{navigationBarHeight}}px"> <view class="bar-nav" style="height: {{navigationBarHeight}}px">
<view class="bar-text">{{!show_confirm ? (staffName || '客户') : '筛选'}}</view> <view class="bar-text">{{!show_confirm ? ((personParams && personParams.personName) || '客户') : '筛选'}}</view>
</view> </view>
<view class="fixed-header"> <view class="fixed-header">
<view class="my-tab"> <view class="my-tab">
<view wx:for="{{tabList}}" wx:key="index" bindtap="changeMyTab" data-id="{{index}}" class='my-tab-item {{myTabIdx==index ? "tab-item-active": ""}}'>{{item.name}}</view> <view wx:for="{{tabList}}" wx:key="index" bindtap="changeMyTab" data-id="{{index}}" class='my-tab-item {{myTabIdx==index ? "tab-item-active": ""}}'>{{item.name}}</view>
</view> </view>
<view class="screen-box"> <view class="screen-box">
<scroll-view class="view-container" scroll-x> <scroll-view class="view-container" show-scrollbar="{{false}}" scroll-x>
<view class="view-box"> <view class="view-box">
<block wx:for="{{myTabIdx == 0 ? selectedScreenPotential : selectedScreenStore}}" wx:key="index"> <block wx:for="{{myTabIdx == 0 ? selectedScreenPotential : selectedScreenStore}}" wx:key="index">
<view bindtap="changeScreen" class="view-item" wx:if="{{userInfo.loginRole == 1 ? true : item.key != 'provinces' && item.key != 'salesStaffList'}}"> <view bindtap="changeScreen" class="view-item" wx:if="{{userInfo.loginRole == 1 ? true : item.key != 'provinces' && item.key != 'salesStaffList'}}">
...@@ -31,8 +31,7 @@ ...@@ -31,8 +31,7 @@
<view class="bg_iamge"> <view class="bg_iamge">
<glsx-image src="{{'customer/top-bg.png'}}" class="image_class" /> <glsx-image src="{{'customer/top-bg.png'}}" class="image_class" />
</view> </view>
<!-- scroll-top="{{setScrollTop}}" --> <scroll-view class="layout" style="padding-top: calc({{navBarHeight}}px + 172rpx);" scroll-top="{{setScrollTop}}" lower-threshold="104" scroll-y bindscrolltolower="getMore" bindscroll="onPageScroll">
<scroll-view class="layout" style="padding-top: calc({{navBarHeight}}px + 172rpx);" scroll-into-view="{{statusIndex % 2 ? 'mask-view' : 'mask-view-2'}}" lower-threshold="104" scroll-y bindscrolltolower="getMore" bindscroll="onPageScroll">
<view class="container"> <view class="container">
<block wx:if="{{myTabIdx==0}}"> <block wx:if="{{myTabIdx==0}}">
<potential-section id="potentialSection" <potential-section id="potentialSection"
...@@ -41,6 +40,7 @@ ...@@ -41,6 +40,7 @@
bind:needScrollTop="scrollToListTop" bind:needScrollTop="scrollToListTop"
searchObj="{{searchObj}}" searchObj="{{searchObj}}"
userInfo="{{userInfo}}" userInfo="{{userInfo}}"
personParams="{{personParams}}"
></potential-section> ></potential-section>
</block> </block>
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
navBarHeight="{{navBarHeight}}" navBarHeight="{{navBarHeight}}"
searchObj="{{storeSearchObj}}" searchObj="{{storeSearchObj}}"
userInfo="{{userInfo}}" userInfo="{{userInfo}}"
personParams="{{personParams}}"
/> />
</block> </block>
</view> </view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!