Commit 08127c91 by chenwq

服务中心和客户管理tab切换;点击事件拦截

1 parent ad67421e
// components/Nothing-tips/nothingTips.js // components/Nothing-tips/nothingTips.js
Component({ Component({
externalClasses: ['custom-class'],
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
......
<!-- components/Nothing-tips/nothingTips.wxml --> <!-- components/Nothing-tips/nothingTips.wxml -->
<view class="nothingCon" style="background-color: {{bgColor}};"> <view class="nothingCon custom-class" style="background-color: {{bgColor}};">
<image <image
wx:if="{{bg}}" wx:if="{{bg}}"
class="bg" class="bg"
......
...@@ -25,11 +25,15 @@ Component({ ...@@ -25,11 +25,15 @@ Component({
type: Boolean, type: Boolean,
value: true value: true
}, },
listIdx: {
type: Number,
value: -1
},
sceneInfo: { sceneInfo: {
type: Object, type: Object,
value: () => {}, value: () => { },
observer(n) { observer(n) {
if(n.hasOwnProperty('sceneList')) { if (n.hasOwnProperty('sceneList')) {
this.findIsOpen() this.findIsOpen()
} }
} }
...@@ -47,31 +51,10 @@ Component({ ...@@ -47,31 +51,10 @@ Component({
IMGURL: IMG_URL, IMGURL: IMG_URL,
openedIcon: `${IMG_URL}/output/openedIcon.png`, openedIcon: `${IMG_URL}/output/openedIcon.png`,
scenceList scenceList
// custSceneList: [
// {
// title: '新车洽谈场景',
// subTitle: '1.0新车权益升级'
// },
// {
// title: '新车交付场景',
// subTitle: '1.1新车精品升级'
// },
// {
// title: '0-6个月',
// subTitle: '1.2次新车膨胀金活动'
// },
// {
// title: '6个月以上',
// subTitle: '1.3售后直播众筹活动'
// }
// ]
}, },
lifetimes: { lifetimes: {
attached() { attached() { }
// console.log(this.data.sceneInfo, 'sceneInfo--')
// console.log(this.data.scenceList, 'scenceList--')
}
}, },
/** /**
...@@ -81,7 +64,7 @@ Component({ ...@@ -81,7 +64,7 @@ Component({
findIsOpen() { findIsOpen() {
let list = JSON.parse(JSON.stringify(this.data.scenceList)) let list = JSON.parse(JSON.stringify(this.data.scenceList))
list.forEach(item => { list.forEach(item => {
let obj = this.data.sceneInfo?.sceneList.find(k => k.sceneCode == item.sceneCode) || {} let obj = this.data.sceneInfo?.sceneList.find(k => k.sceneCode == item.sceneCode) || {}
item.isOpen = obj.flag || false item.isOpen = obj.flag || false
}) })
this.setData({ this.setData({
...@@ -90,7 +73,8 @@ Component({ ...@@ -90,7 +73,8 @@ Component({
}, },
handleClick(e) { handleClick(e) {
let { idx, scenecode } = e.currentTarget.dataset let { idx, scenecode } = e.currentTarget.dataset
this.triggerEvent('handleSceneChange', { sceneIdx: idx, sceneCode: scenecode }) let { listIdx } = this.data
this.triggerEvent('handleSceneChange', { sceneIdx: idx, sceneCode: scenecode, listIdx: listIdx })
} }
} }
}) })
// packageMine/pages/serviceManage/components/StoreApply/StoreApply.js
import { IMG_URL } from '~/utils/constantData'
import mineServiceApi from '~/api/mineApi/mineService'
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
IMG_URL,
bgUrl: `${IMG_URL}/personal/empty_tran.png`,
active: 'service',
serviceList: [],
total: -1,
pageCof: {
pageNum: 1,
pageSize: 10
},
isAsk: false
},
lifetimes: {
attached() {
this.handleSearch()
}
},
/**
* 组件的方法列表
*/
methods: {
handleSearch() {
this.setData({
['pageCof.pageNum']: 1,
total: -1
})
this.getList(true)
},
scrollonReachBottom() {
this.getList()
},
getList(isReset = false) {
let { serviceList, pageCof, total, isAsk } = this.data
let _this = this
if (total == serviceList.length || isAsk) {
return true
}
let params = {
...pageCof
}
this.setData({
isAsk: true
})
mineServiceApi.getServiceList(params).then(res => {
let { list, total } = res
this.setData({
serviceList: pageCof.pageNum == 1 ? (list || []) : serviceList.concat(list),
['pageCof.pageNum']: pageCof.pageNum + 1,
triggered: false,
total
})
if (isReset) {
this.setData({
scrollTop: 0
})
}
}).finally(function () {
_this.setData({
isAsk: false
})
})
},
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packageMine/pages/serviceManage/components/StoreApply/StoreApply.wxss */
.service-list-page {
width: 100%;
box-sizing: border-box;
padding: 20rpx;
background-color: #F2F3F7;
.title-box {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20rpx;
.title {
color: #323436;
font-size: 28rpx;
font-weight: 600;
.number {
color: var(--btnColor)
}
}
}
.nothingCon {
width: calc(100vw - 40rpx);
height: calc(100vh - 140rpx);
// background-color: #fff;
display: flex;
flex-direction: column;
align-items: center;
}
.item-box {
width: 100%;
background: #FFFFFF;
border-radius: 12rpx;
margin-bottom: 20rpx;
.top {
display: flex;
justify-content: space-between;
// align-items: center;
padding: 24rpx 32rpx;
.message {
display: flex;
.avatar {
flex-shrink: 0;
width: 72rpx;
height: 72rpx;
margin-right: 12rpx;
}
.message-text {
display: flex;
flex-flow: column;
justify-content: center;
.merchant {
color: #323436;
font-size: 28rpx;
}
.contact {
color: #858A94;
font-size: 26rpx;
}
}
}
}
.bottom {
padding: 0 32rpx;
height: 72rpx;
background-color: #FFF9F2;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 24rpx;
color: #8A8C90;
.service_name {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
.bottomTips {
text-align: center;
color: #393b3e;
font-size: 26rpx;
height: 60rpx;
line-height: 40rpx;
}
}
\ No newline at end of file \ No newline at end of file
<!--packageMine/pages/serviceManage/components/StoreApply/StoreApply.wxml-->
<view class="service-list-page">
<view class="content-box" wx:if="{{serviceList.length}}">
<view class="title-box">
<view class="title">我的开店申请:<text class="number">{{total < 0 ? 0 : total}}</text>
</view>
</view>
<scroll-view scroll-y enable-back-to-top refresher-enabled="{{true}}" bindrefresherrefresh="handleSearch" bindscrolltolower="scrollonReachBottom" class="list" style="height:calc(100vh - 148rpx - 110rpx);" scroll-top="{{scrollTop}}" refresher-threshold="104" refresher-triggered="{{triggered}}">
<view class="item-box" wx:for="{{serviceList}}" wx:key="index" bindtap="handleEdit" data-type="edit" data-target="{{item}}">
<view class="top">
<view class="message">
<glsx-image src="personal/service_head.png" class="avatar" />
<view class="message-text">
<view class="merchant">{{item.merchantName}}</view>
<view class="contact">联系人:{{item.contactName}} {{item.phone}}</view>
</view>
</view>
<view>审核中</view>
</view>
<view class="bottom">
<view class="service_name">
商户号:{{item.merchantId}}
</view>
<view class="time">{{item.createdDate}}</view>
</view>
</view>
<view class="bottomTips" wx:if="{{serviceList.length == total}}">到底啦!</view>
</scroll-view>
</view>
<view wx:else>
<nothing-tips custom-class="nothingCon" tips="暂无开店申请~" bgColor="{{'#F2F3F7'}}" bg="{{bgUrl}}" />
</view>
</view>
\ No newline at end of file \ No newline at end of file
...@@ -11,6 +11,7 @@ Page({ ...@@ -11,6 +11,7 @@ Page({
IMG_URL, IMG_URL,
maxNum: 99, maxNum: 99,
bgUrl: `${IMG_URL}/personal/empty_tran.png`, bgUrl: `${IMG_URL}/personal/empty_tran.png`,
active: 'customer',
selectInfo: { selectInfo: {
yqMerchantName: '全部服务中心' yqMerchantName: '全部服务中心'
}, },
...@@ -26,6 +27,13 @@ Page({ ...@@ -26,6 +27,13 @@ Page({
isAsk: false isAsk: false
}, },
tabChange(e) {
let { name } = e.detail
this.setData({
active: name
})
},
// 筛选服务中心 // 筛选服务中心
filterTypeFn() { filterTypeFn() {
this.setData({ this.setData({
......
{ {
"navigationBarTitleText": "客户管理", "navigationBarTitleText": "客户管理",
"usingComponents": { "usingComponents": {
"select-service-popup": "../../../components/selectServicePopup/selectServicePopup" "select-service-popup": "../../../components/selectServicePopup/selectServicePopup",
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index",
"store-apply": "../components/StoreApply/StoreApply"
} }
} }
\ No newline at end of file \ No newline at end of file
<!--packageMine/pages/customerManagement/customerList/customerList.wxml--> <!--packageMine/pages/customerManagement/customerList/customerList.wxml-->
<!-- <wxs src="../index.wxs" module="format" /> --> <!-- <wxs src="../index.wxs" module="format" /> -->
<view class="customer-list-page"> <van-tabs bind:change="tabChange">
<van-tab name="customer" title="客户"></van-tab>
<van-tab name="apply" title="开店申请"></van-tab>
</van-tabs>
<!-- 客户 -->
<view wx:if="{{active == 'customer'}}" class="customer-list-page">
<view class="btn_box" bindtap="handleEdit" data-type="add"> <view class="btn_box" bindtap="handleEdit" data-type="add">
<glsx-image src="index/apply.png" class="icon" /> <glsx-image src="index/apply.png" class="icon" />
<text>创建新客户</text> <text>创建新客户</text>
...@@ -66,4 +71,6 @@ ...@@ -66,4 +71,6 @@
<nothing-tips tips="暂无客户~" bgColor="{{'#F2F3F7'}}" bg="{{bgUrl}}" /> <nothing-tips tips="暂无客户~" bgColor="{{'#F2F3F7'}}" bg="{{bgUrl}}" />
</view> </view>
</view> </view>
<!-- 开店申请 -->
<store-apply wx:else></store-apply>
<select-service-popup wx:if="{{popupShow}}" bind:hidePopup="filterTypeFn" bind:getStaffList="handleSearch" selectInfo="{{selectInfo}}" popShow="{{popupShow}}" serviceRange="{{serviceList}}" /> <select-service-popup wx:if="{{popupShow}}" bind:hidePopup="filterTypeFn" bind:getStaffList="handleSearch" selectInfo="{{selectInfo}}" popShow="{{popupShow}}" serviceRange="{{serviceList}}" />
\ No newline at end of file \ No newline at end of file
// packageMine/pages/serviceManage/components/StoreApply/StoreApply.js
import { IMG_URL } from '~/utils/constantData'
import mineServiceApi from '~/api/mineApi/mineService'
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
IMG_URL,
bgUrl: `${IMG_URL}/personal/empty_tran.png`,
active: 'service',
serviceList: [],
total: -1,
pageCof: {
pageNum: 1,
pageSize: 10
},
isAsk: false
},
lifetimes: {
attached() {
this.handleSearch()
}
},
/**
* 组件的方法列表
*/
methods: {
handleSearch() {
this.setData({
['pageCof.pageNum']: 1,
total: -1
})
this.getList(true)
},
scrollonReachBottom() {
this.getList()
},
getList(isReset = false) {
let { serviceList, pageCof, total, isAsk } = this.data
let _this = this
if (total == serviceList.length || isAsk) {
return true
}
let params = {
...pageCof
}
this.setData({
isAsk: true
})
mineServiceApi.getServiceList(params).then(res => {
let { list, total } = res
this.setData({
serviceList: pageCof.pageNum == 1 ? (list || []) : serviceList.concat(list),
['pageCof.pageNum']: pageCof.pageNum + 1,
triggered: false,
total
})
if (isReset) {
this.setData({
scrollTop: 0
})
}
}).finally(function () {
_this.setData({
isAsk: false
})
})
},
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packageMine/pages/serviceManage/components/StoreApply/StoreApply.wxss */
.service-list-page {
width: 100%;
box-sizing: border-box;
padding: 20rpx;
background-color: #F2F3F7;
.title-box {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20rpx;
.title {
color: #323436;
font-size: 28rpx;
font-weight: 600;
.number {
color: var(--btnColor)
}
}
}
.nothingCon {
width: calc(100vw - 40rpx);
height: calc(100vh - 140rpx);
// background-color: #fff;
display: flex;
flex-direction: column;
align-items: center;
}
.item-box {
width: 100%;
background: #FFFFFF;
border-radius: 12rpx;
margin-bottom: 20rpx;
.top {
display: flex;
justify-content: space-between;
// align-items: center;
padding: 24rpx 32rpx;
.message {
display: flex;
.avatar {
flex-shrink: 0;
width: 72rpx;
height: 72rpx;
margin-right: 12rpx;
}
.message-text {
display: flex;
flex-flow: column;
justify-content: center;
.merchant {
color: #323436;
font-size: 28rpx;
}
.contact {
color: #858A94;
font-size: 26rpx;
}
}
}
}
.bottom {
padding: 0 32rpx;
height: 72rpx;
background-color: #FFF9F2;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 24rpx;
color: #8A8C90;
.service_name {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
.bottomTips {
text-align: center;
color: #393b3e;
font-size: 26rpx;
height: 60rpx;
line-height: 40rpx;
}
}
\ No newline at end of file \ No newline at end of file
<!--packageMine/pages/serviceManage/components/StoreApply/StoreApply.wxml-->
<view class="service-list-page">
<view class="content-box" wx:if="{{serviceList.length}}">
<view class="title-box">
<view class="title">我的开店申请:<text class="number">{{total < 0 ? 0 : total}}</text>
</view>
</view>
<scroll-view scroll-y enable-back-to-top refresher-enabled="{{true}}" bindrefresherrefresh="handleSearch" bindscrolltolower="scrollonReachBottom" class="list" style="height:calc(100vh - 148rpx - 110rpx);" scroll-top="{{scrollTop}}" refresher-threshold="104" refresher-triggered="{{triggered}}">
<view class="item-box" wx:for="{{serviceList}}" wx:key="index" bindtap="handleEdit" data-type="edit" data-target="{{item}}">
<view class="top">
<view class="message">
<glsx-image src="personal/service_head.png" class="avatar" />
<view class="message-text">
<view class="merchant">{{item.merchantName}}</view>
<view class="contact">联系人:{{item.contactName}} {{item.phone}}</view>
</view>
</view>
<view>审核中</view>
</view>
<view class="bottom">
<view class="service_name">
商户号:{{item.merchantId}}
</view>
<view class="time">{{item.createdDate}}</view>
</view>
</view>
<view class="bottomTips" wx:if="{{serviceList.length == total}}">到底啦!</view>
</scroll-view>
</view>
<view wx:else>
<nothing-tips custom-class="nothingCon" tips="暂无开店申请~" bgColor="{{'#F2F3F7'}}" bg="{{bgUrl}}" />
</view>
</view>
\ No newline at end of file \ No newline at end of file
...@@ -9,6 +9,7 @@ Page({ ...@@ -9,6 +9,7 @@ Page({
data: { data: {
IMG_URL, IMG_URL,
bgUrl: `${IMG_URL}/personal/empty_tran.png`, bgUrl: `${IMG_URL}/personal/empty_tran.png`,
active: 'service',
serviceList: [], serviceList: [],
total: -1, total: -1,
pageCof: { pageCof: {
...@@ -18,6 +19,13 @@ Page({ ...@@ -18,6 +19,13 @@ Page({
isAsk: false isAsk: false
}, },
tabChange(e) {
let { name } = e.detail
this.setData({
active: name
})
},
handleEdit(e) { handleEdit(e) {
let { type } = e.currentTarget.dataset let { type } = e.currentTarget.dataset
let params = { let params = {
......
{ {
"navigationBarTitleText": "服务中心管理", "navigationBarTitleText": "服务中心管理",
"usingComponents": {} "usingComponents": {
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index",
"store-apply": "../components/StoreApply/StoreApply"
}
} }
\ No newline at end of file \ No newline at end of file
<!--packagesList/mineDetail/pages/serviceManage/serviceList/serviceList.wxml--> <!--packagesList/mineDetail/pages/serviceManage/serviceList/serviceList.wxml-->
<view class="service-list-page"> <van-tabs bind:change="tabChange">
<van-tab name="service" title="服务中心"></van-tab>
<van-tab name="apply" title="开店申请"></van-tab>
</van-tabs>
<!-- 服务中心 -->
<view wx:if="{{active == 'service'}}" class="service-list-page">
<view class="btn_box" bindtap="handleEdit" data-type="add"> <view class="btn_box" bindtap="handleEdit" data-type="add">
<glsx-image src="index/apply.png" class="icon" /> <glsx-image src="index/apply.png" class="icon" />
<text>创建新的服务中心</text> <text>创建新的服务中心</text>
</view> </view>
<view class="content-box" wx:if="{{serviceList.length}}"> <view class="content-box" wx:if="{{serviceList.length}}">
<view class="title-box"> <view class="title-box">
<view class="title">服务中心数量:<text class="number">{{total < 0 ? 0 : total}}</text></view> <view class="title">服务中心数量:<text class="number">{{total < 0 ? 0 : total}}</text>
</view>
</view> </view>
<scroll-view scroll-y enable-back-to-top refresher-enabled="{{true}}" bindrefresherrefresh="handleSearch" bindscrolltolower="scrollonReachBottom" class="list" style="height:calc(100vh - 148rpx - 110rpx);" scroll-top="{{scrollTop}}" refresher-threshold="104" refresher-triggered="{{triggered}}"> <scroll-view scroll-y enable-back-to-top refresher-enabled="{{true}}" bindrefresherrefresh="handleSearch" bindscrolltolower="scrollonReachBottom" class="list" style="height:calc(100vh - 148rpx - 110rpx);" scroll-top="{{scrollTop}}" refresher-threshold="104" refresher-triggered="{{triggered}}">
<view class="item-box" wx:for="{{serviceList}}" wx:key="index" bindtap="handleEdit" data-type="edit" data-target="{{item}}"> <view class="item-box" wx:for="{{serviceList}}" wx:key="index" bindtap="handleEdit" data-type="edit" data-target="{{item}}">
<view class="top"> <view class="top">
<view class="message"> <view class="message">
...@@ -33,4 +39,6 @@ ...@@ -33,4 +39,6 @@
<view wx:else> <view wx:else>
<nothing-tips tips="暂无服务中心~" bgColor="{{'#F2F3F7'}}" bg="{{bgUrl}}" /> <nothing-tips tips="暂无服务中心~" bgColor="{{'#F2F3F7'}}" bg="{{bgUrl}}" />
</view> </view>
</view>
\ No newline at end of file \ No newline at end of file
</view>
<!-- 开店申请 -->
<store-apply wx:else></store-apply>
\ No newline at end of file \ No newline at end of file
...@@ -685,6 +685,11 @@ Page({ ...@@ -685,6 +685,11 @@ Page({
this.setData({ this.setData({
merchantInfo: obj, merchantInfo: obj,
}) })
if(obj.fixSceneCode) {
this.setData({
sceneCodeActive: obj.fixSceneCode
})
}
let { userInfo } = wx.$storage.get() let { userInfo } = wx.$storage.get()
this.getMockInfo(userInfo) this.getMockInfo(userInfo)
......
// pages/tab/output/components/TotalTab/TotalTab.js // pages/tab/output/components/TotalTab/TotalTab.js
import { scenceList } from '~/pages/tab/index/constant/data' import { scenceList } from '~/pages/tab/index/constant/data'
const busiOptSceneCode = ['-1', 'SC002', 'SC004', 'SC001'] const busiOptSceneCode = ['-1', 'SC002', 'SC004', 'SC001', 'SC003']
import outputApi from '~/api/outputApi/index' import outputApi from '~/api/outputApi/index'
import { getNowMonth } from '~/utils/format' import { getNowMonth } from '~/utils/format'
Component({ Component({
......
...@@ -108,6 +108,22 @@ Component({ ...@@ -108,6 +108,22 @@ Component({
}) })
}, },
// 阻止冒泡事件
sceneCatch() { },
// 点击场景
handleSceneChange(e) {
let { detail } = e
this.handleJump({
currentTarget: {
dataset: {
idx: detail.listIdx,
sceneCode: detail.sceneCode
}
}
})
},
// 众筹数据处理 // 众筹数据处理
dealCrowdObj(data) { dealCrowdObj(data) {
let _obj = { let _obj = {
...@@ -357,7 +373,7 @@ Component({ ...@@ -357,7 +373,7 @@ Component({
}) })
}, },
handleJump(e) { handleJump(e) {
let { idx } = e.currentTarget.dataset let { idx, sceneCode } = e.currentTarget.dataset
var currentItem = this.data.list[idx] var currentItem = this.data.list[idx]
var params = { var params = {
merchantId: currentItem.merchantId, merchantId: currentItem.merchantId,
...@@ -366,6 +382,9 @@ Component({ ...@@ -366,6 +382,9 @@ Component({
pMerchantName: this.data.pMerchantInfo.subLoginUser.merchantName, pMerchantName: this.data.pMerchantInfo.subLoginUser.merchantName,
isSuper: this.data.pMerchantInfo.isSuper isSuper: this.data.pMerchantInfo.isSuper
} }
if(sceneCode == 'SC003') {
params.fixSceneCode = sceneCode
}
wx.$router.go('/packagesList/packageOutput/pages/summary', params) wx.$router.go('/packagesList/packageOutput/pages/summary', params)
} }
// 门店经营汇总-end // 门店经营汇总-end
......
...@@ -18,7 +18,9 @@ ...@@ -18,7 +18,9 @@
</view> </view>
<!-- 场景内容 --> <!-- 场景内容 -->
<view class="box-content"> <view class="box-content">
<scene-box sceneInfo="{{item}}" hasLockIcon="{{false}}" scenePriceList="{{item.scenePriceList}}" /> <view catchtap="sceneCatch">
<scene-box sceneInfo="{{item}}" hasLockIcon="{{false}}" scenePriceList="{{item.scenePriceList}}" listIdx="{{index}}" bindhandleSceneChange="handleSceneChange"/>
</view>
<!-- 通知 --> <!-- 通知 -->
<view class="box-bottom"> <view class="box-bottom">
<view wx:if="{{item.msgList.length}}" class="flex"> <view wx:if="{{item.msgList.length}}" class="flex">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!