Commit 67d2cee9 by zhangxw

联调修改

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