Commit 3ead2ed1 by 陈婉清

Merge branch 'saas+v4.19.0_0418' into 'develop'

Saas+v4.19.0 0418上线后,代码合并

See merge request !26
2 parents 3eecc66b e2519afb
Showing 155 changed files with 8999 additions and 571 deletions
......@@ -46,5 +46,52 @@ class mineApi {
// true
)
}
// 获取服务中心下拉筛选 所有服务商数据
getServiceCenterListAPI(data) {
return api.post(
{
method: 'scrm.api.busassistant.serviceCenter.listByServiceMerchantId',
...data
}
)
}
// 获取员工列表
getStaffListAPI(data) {
return api.post(
{
method: 'scrm.api.busassistant.staff.searchStaffPage',
...data
}
)
}
// 创建员工
createStaffAPI(data) {
return api.post(
{
method: 'scrm.api.busassistant.staff.createStaff',
...data
}
)
}
// 更新员工
updateStaffAPI(data) {
return api.post(
{
method: 'scrm.api.busassistant.staff.updateStaff',
...data
}
)
}
// 获取当前服务中心下的客户列表
getConnectionListByServiceAPI(data) {
return api.post(
{
method: 'scrm.api.busassistant.merchantCustomer.listByServiceCenterMerchantId',
...data
}
)
}
}
export default mineApi
import api from '~/utils/request/request'
// 分页查询客户管理列表
const getCustomerList = data => {
return api.post(
{
method: 'scrm.api.busassistant.merchantCustomer.page',
...data
}
)
}
// 保存客户管理信息
const saveCustomer = data => {
return api.post(
{
method: 'scrm.api.busassistant.merchantCustomer.save',
...data
},
true
)
}
// 修改客户管理信息
const updateCustomer = data => {
return api.post(
{
method: 'scrm.api.busassistant.merchantCustomer.update',
...data
},
true
)
}
// 查询客户销售顾问列表
const getEmployeeList = data => {
return api.post(
{
method: 'scrm.api.busassistant.merchantCustomer.employee.list',
...data
}
)
}
// 创建邀请销售顾问二维码
const getInviteCode = data => {
return api.post(
{
method: 'scrm.api.busassistant.merchantCustomer.inviteCode',
...data
}
)
}
export default {
getCustomerList,
saveCustomer,
updateCustomer,
getEmployeeList,
getInviteCode
}
\ No newline at end of file
import api from '~/utils/request/request'
// 查询服务中心列表-不分页
const getAllServiceList = data => {
return api.post(
{
method: 'scrm.api.busassistant.serviceCenter.listByServiceMerchantId',
...data
}
)
}
// 分页查询服务中心列表
const getServiceList = data => {
return api.post(
{
method: 'scrm.api.busassistant.serviceCenter.page',
...data
}
)
}
// 保存服务中心信息
const saveService = data => {
return api.post(
{
method: 'scrm.api.busassistant.serviceCenter.save',
...data
},
true
)
}
// 修改服务中心信息
const updateService = data => {
return api.post(
{
method: 'scrm.api.busassistant.serviceCenter.update',
...data
},
true
)
}
// 分页查询技师列表
const getTechnicianList = data => {
return api.post(
{
method: 'scrm.api.busassistant.technicianConfig.page',
...data
}
)
}
// 新增技师信息
const addTechnician = data => {
return api.post(
{
method: 'scrm.api.busassistant.technicianConfig.add',
...data
},
true
)
}
// 修改技师信息
const updateTechnician = data => {
return api.post(
{
method: 'scrm.api.busassistant.technicianConfig.update',
...data
},
true
)
}
// 删除技师
const deleteTechnician = data => {
return api.post(
{
method: 'scrm.api.busassistant.technicianConfig.delete',
...data
},
true
)
}
export default {
getAllServiceList,
getServiceList,
saveService,
updateService,
getTechnicianList,
addTechnician,
updateTechnician,
deleteTechnician
}
\ No newline at end of file
......@@ -80,9 +80,10 @@ class outputApi {
/** 查询门店权益订单数据统计-车险升级活动产值 */
getEquityRevenue(data) {
return api.post({
method: 'scrm.api.busassistant.merchant.equity.statistics',
// method: 'scrm.api.busassistant.merchant.equity.statistics',
method: 'dj.api.smartcarlife.vd.quotation.merchant.statistics',
...data
})
}, false, 'dj')
}
/** 店面汇总-下载海报 */
......@@ -115,5 +116,31 @@ class outputApi {
...data
})
}
/** 根据场景查询产品 */
findProByScene(data) {
return api.post({
method: 'scrm.api.busassistant.activity.productByscene',
...data
})
}
/** 业务经营汇总列表查询 */
getBusiStatistics(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.business.assistant.merchants.statistics',
...data
})
}
// 我的员工
/** 服务商查询园区店员工产值统计 */
getStaffList(data) {
data.routerMethod = 'dj.api.smarcarlife.yquser.stat.byPartnerMerchant'
return api.post({
method: 'scrm.api.boutiquecoupon.rop.boutique.router.withoutLogin',
...data
})
}
}
export default outputApi
......@@ -168,5 +168,15 @@ class UsersApi {
platformEntrance: 'BUSINESS_ASSISTANT'
})
}
// 登录自动创建服务中心
initServiceCenter(data) {
return api.post(
{
method: 'scrm.api.busassistant.serviceCenter.init',
...data
}
)
}
}
export default UsersApi
\ No newline at end of file
{
"pages": ["login/loading/loading", "pages/tab/index/index", "pages/tab/output/output", "pages/tab/mine/mine", "pages/webView/webView", "login/index/index", "login/accountItems/accountItems", "pages/viewVideo/index", "pages/viewProd/index", "pages/viewProdBanner/index", "pages/measure/measure/measure", "pages/measure/measureResult/measureResult", "packagesList/activityDetail/activityDetail"],
"requiredPrivateInfos": ["getLocation"],
"pages": [
"login/loading/loading",
"pages/tab/index/index",
"pages/tab/output/output",
"pages/tab/mine/mine",
"pages/webView/webView",
"login/index/index",
"login/accountItems/accountItems",
"pages/viewVideo/index",
"pages/viewProd/index",
"pages/viewProdBanner/index",
"pages/measure/measure/measure",
"pages/measure/measureResult/measureResult",
"packagesList/activityDetail/activityDetail"
],
"requiredPrivateInfos": [
"getLocation"
],
"lazyCodeLoading": "requiredComponents",
"window": {
"backgroundTextStyle": "light",
......@@ -37,37 +53,67 @@
{
"root": "packagesList/pages",
"name": "packagesList",
"pages": ["videoDetal/videoDetal", "productDetail/productDetail", "scenarioDetail/scenarioDetail"]
"pages": [
"videoDetal/videoDetal",
"productDetail/productDetail",
"scenarioDetail/scenarioDetail"
]
},
{
"root": "packagesList/packageOutput",
"name": "packageOutput",
"pages": ["pages/openBusiness", "pages/summary"]
},
{
"root": "packagesList/mineDetail",
"name": "mineDetail",
"pages": ["pages/messageBox", "pages/customerManagement", "pages/clue"]
"pages": [
"pages/openBusiness",
"pages/summary"
]
},
{
"root": "packagesList/apply",
"name": "apply",
"pages": ["pages/apply"]
"pages": [
"pages/apply"
]
},
{
"root": "packagesList/applyProd",
"name": "applyProd",
"pages": ["pages/apply"]
"pages": [
"pages/apply"
]
},
{
"root": "packageMine/pages",
"name": "packageMine",
"pages": [
"messageBox/messageBox",
"customerManagement/customerManagement",
"clue/clue",
"staffManage/staffList/staffList",
"serviceManage/serviceList/serviceList",
"staffManage/createStaff/createStaff",
"staffManage/selectConnectionPage/selectConnectionPage",
"successPage/successPage",
"serviceManage/editService/editService",
"customerManagement/customerList/customerList",
"customerManagement/editCustomer/editCustomer",
"customerManagement/saleList/saleList",
"customerManagement/technicianList/technicianList"
]
}
],
"preloadRule": {
"pages/tab/mine/mine": {
"network": "all",
"packages": ["mineDetail"]
"packages": [
"packageMine"
]
},
"pages/tab/index/index": {
"network": "all",
"packages": ["apply", "packageOutput"]
"packages": [
"apply",
"packageOutput"
]
}
},
"usingComponents": {
......@@ -87,4 +133,4 @@
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
}
}
}
\ No newline at end of file
......@@ -7,6 +7,7 @@ Component({
navStyle: String,
custom: Boolean,
showBack: Boolean,
customBack: Boolean,
pageTitle: {
type: String,
value: '',
......@@ -88,7 +89,9 @@ Component({
})
},
back() {
wx.$router.back()
let { customBack } = this.data
if (customBack) this.triggerEvent('back')
else wx.$router.back()
}
},
lifetimes: {
......
......@@ -5,7 +5,11 @@ Component({
*/
properties: {
tips: String,
bg: String
bg: String,
bgColor: {
type: String,
value: '#fff'
}
},
/**
......
......@@ -2,7 +2,7 @@
.nothingCon {
width: 100vw;
height: 100vh;
background-color: #fff;
// background-color: #fff;
display: flex;
flex-direction: column;
align-items: center;
......
<!-- components/Nothing-tips/nothingTips.wxml -->
<view class="nothingCon">
<view class="nothingCon" style="background-color: {{bgColor}};">
<image
wx:if="{{bg}}"
class="bg"
......
// tabWorkOrder/pages/createOrder/createOrderComponents/Popup/Popup.js
Component({
externalClasses: ['custom-class'],
/**
* 组件的属性列表
*/
......@@ -50,7 +51,7 @@ Component({
* 组件的方法列表
*/
methods: {
noScroll() {},
noScroll() { },
hidePopup() {
this.setData({
show: false
......
<view class="popup " hidden="{{!showPopup}}" catchtouchmove="noScroll">
<view class="popup custom-class" hidden="{{!showPopup}}" catchtouchmove="noScroll">
<view class="popup-bg" bindtap="hidePopup"></view>
<view class="popup-content {{close?'close':''}}" style="height:{{height}}">
<block wx:if="{{title}}">
......
......@@ -175,5 +175,27 @@ Component({
getUserInfo(e) {
this.triggerEvent('getUserInfo', { detail: e.detail })
},
// 膨胀金-二维码-长按图片
handleLongPress(e) {
let { index } = e.target.dataset
let { activeNavIdx, actNum } = this.data
// 膨胀金活动,合作方式
if (actNum == 99 && activeNavIdx == 3 && index == 4) {
wx.downloadFile({
// 示例 url,并非真实存在
url: 'https://scrm.glsx.com.cn/frontpdf/expand_agreement.pdf',
success: function (res) {
console.log(res)
const filePath = res.tempFilePath
wx.openDocument({
filePath: filePath,
success: function (res) {
console.log('打开文档成功')
}
})
}
})
}
},
}
})
......@@ -2,7 +2,7 @@
<view class="view-prod custom-class">
<view class="pro-head">
<!-- 有视频 -->
<video class="frame" id="video" wx:if="{{actNum != 2}}" src="{{prodItemVideo.videoUrl}}" bindplay="handleVideoPlay" data-attr="crowdVideoCtx"/>
<video class="frame" id="video" wx:if="{{actNum != 2}}" src="{{prodItemVideo.videoUrl}}" bindplay="handleVideoPlay" data-attr="crowdVideoCtx" />
<image class="no-video" wx:if="{{actNum == 2}}" src="{{prodItemVideo.posterUrl}}?v={{img_version}}" />
<view class="title-wrap">
<view class="title">{{prodItemVideo.name}}</view>
......@@ -41,7 +41,7 @@
</button>
</block>
</image>
<image webp wx:if="{{ index >= 3 && !showLeftFlag}}" mode="widthFix" webp class="img-item {{item.className?item.className:''}}" src="{{item.url?item.url:item}}?v={{img_version}}">
<image webp wx:if="{{ index >= 3 && !showLeftFlag}}" mode="widthFix" webp class="img-item {{item.className?item.className:''}}" src="{{item.url?item.url:item}}?v={{img_version}}" data-index="{{index}}" bindlongpress="handleLongPress">
<!-- 众筹-视频 -->
<block wx:if="{{ index == 3 && actNum == 3 }}">
<video class="crowd-video" id="crowd-video" bindplay="handleVideoPlay" data-attr="videoCtx" src="{{videoBaseUrl}}video/crowd-detail.mp4" />
......
......@@ -30,12 +30,19 @@ Component({
// password: 'bb123456'
},
phoneReady: false,
countDown: null
countDown: null,
agree: false
},
/**
* 组件的方法列表
*/
methods: {
authChoose(e) {
let { detail: agree } = e
this.setData({
agree
})
},
/**隐藏验证码错误 */
hideError(name) {
if (name == 'code')
......@@ -129,8 +136,19 @@ Component({
showPwd: !this.data.showPwd
})
},
checkAgree() {
let { agree } = this.data
console.log('agree', agree)
if (!agree) {
wx.$api.showToast('请同意用户协议')
return true
}
return false
},
/**手机号&帐号密码登录 */
login() {
const checkAgree = this.checkAgree()
if (checkAgree) return false
const { formData, loginType } = this.data,
target = {
1: 'phoneSmsLogin',
......
{
"component": true,
"usingComponents": {
"input-icon":"../InputIcon/InputIcon"
"input-icon": "../InputIcon/InputIcon",
"auth-setting": "../authSetting/authSetting"
}
}
\ No newline at end of file
}
<block wx:if="{{loginType == 0}}">
<view class="wx opacity-view">
<view class="title">
您好
</view>
<view class="subtitle">
欢迎登录生意助手
</view>
<image webp class="img" src="{{IMGURL}}login/login-2.webp" />
</view>
<view class="wx opacity-view">
<view class="title">
您好
</view>
<view class="subtitle">
欢迎登录生意助手
</view>
<image webp class="img" src="{{IMGURL}}login/login-2.webp" />
</view>
</block>
<block wx:else>
<view class="box">
<view class="input-box opacity-view">
<view class="title">{{loginType == 1?'手机号':'账号'}}登录</view>
<block wx:if="{{loginType == 1}}">
<view class="input">
<input type="number" placeholder="填写手机号" placeholder-class="placeholder" bindinput="input" data-name="phone" value="{{formData.phone}}" maxlength="11" />
<input-icon show="{{formData.phone}}" bindtap="clear" data-name="phone" />
</view>
<view class="input">
<input type="number" placeholder="填写验证码" placeholder-class="placeholder" bindinput="input" data-name="code" value="{{formData.code}}" maxlength="4" />
<input-icon show="{{formData.code}}" bindtap="clear" data-name="code" />
<button class="sms text-center " bindtap="getSmsCode" disabled="{{count || !phoneReady}}" loading="{{smsLoading}}">{{
count? count + 's':'获取验证码'
}}</button>
<block wx:if="{{smsError}}">
<view class="error">验证码错误</view>
</block>
</view>
</block>
<block wx:else>
<view class="input">
<input type="text" placeholder="填写账号" placeholder-class="placeholder" bindinput="input" data-name="account" value="{{formData.account}}" maxlength="15" />
<input-icon show="{{formData.account}}" bindtap="clear" data-name="account" />
</view>
<view class="input">
<input type="text" placeholder="填写密码" placeholder-class="placeholder" bindinput="input" data-name="password" value="{{formData.password}}" maxlength="20" password='{{!showPwd}}' />
<input-icon show bindtap="pwdSwitch" type="{{showPwd?'showPwd':'hidePwd'}}" />
<input-icon show="{{formData.password}}" bindtap="clear" data-name="password" />
</view>
</block>
</view>
</view>
<view class="box">
<view class="input-box opacity-view">
<view class="title">{{loginType == 1?'手机号':'账号'}}登录</view>
<block wx:if="{{loginType == 1}}">
<view class="input">
<input
type="number"
placeholder="填写手机号"
placeholder-class="placeholder"
bindinput="input"
data-name="phone"
value="{{formData.phone}}"
maxlength="11" />
<input-icon show="{{formData.phone}}" bindtap="clear" data-name="phone" />
</view>
<view class="input">
<input
type="number"
placeholder="填写验证码"
placeholder-class="placeholder"
bindinput="input"
data-name="code"
value="{{formData.code}}"
maxlength="4" />
<input-icon show="{{formData.code}}" bindtap="clear" data-name="code" />
<button
class="sms text-center "
bindtap="getSmsCode"
disabled="{{count || !phoneReady}}"
loading="{{smsLoading}}">{{
count? count + 's':'获取验证码'
}}
</button>
<block wx:if="{{smsError}}">
<view class="error">验证码错误</view>
</block>
</view>
</block>
<block wx:else>
<view class="input">
<input
type="text"
placeholder="填写账号"
placeholder-class="placeholder"
bindinput="input"
data-name="account"
value="{{formData.account}}"
maxlength="15" />
<input-icon show="{{formData.account}}" bindtap="clear" data-name="account" />
</view>
<view class="input">
<input
type="text"
placeholder="填写密码"
placeholder-class="placeholder"
bindinput="input"
data-name="password"
value="{{formData.password}}"
maxlength="20"
password='{{!showPwd}}' />
<input-icon show bindtap="pwdSwitch" type="{{showPwd?'showPwd':'hidePwd'}}" />
<input-icon show="{{formData.password}}" bindtap="clear" data-name="password" />
</view>
</block>
</view>
</view>
</block>
<block wx:if="{{loginType == 0}}">
<button class="button" disabled="{{disabled}}" hover-class="btn-hover" open-type="getPhoneNumber" bindgetphonenumber="wxLogin" loading="{{loading}}">微信登录</button>
<block wx:if="{{loginType == 0 &&agree}}">
<button
class="button"
disabled="{{disabled}}"
hover-class="btn-hover"
open-type="getPhoneNumber"
bindgetphonenumber="wxLogin"
loading="{{loading}}">微信登录
</button>
</block>
<block wx:else>
<button class="button" disabled="{{disabled}}" hover-class="btn-hover" bindtap="login" loading="{{loading}}">登录</button>
</block>
\ No newline at end of file
<button
class="button"
disabled="{{disabled}}"
hover-class="btn-hover"
bindtap="login"
loading="{{loading}}">登录
</button>
</block>
<auth-setting bind:choose="authChoose" />
// components/authSetting/authSetting.js
// const restapi = require('../../utils/restapi.js')
// var appInstance = getApp()
Component({
/**
* 组件的属性列表
*/
properties: {
// auth: {
// type: Boolean,
// value: true,
// observer: function (newVal, oldVal) {
// this.getHeadImage()
// }
// },
// type: {
// type: Boolean,
// value: true
// },
// special: {
// type: Boolean,
// value: false
// },
// index: {
// type: Boolean,
// value: false
// }
},
/**
* 组件的初始数据
*/
data: {
agree: false
// auth: true,
// type: true,
// appLogo: '',
// appName: '',
// merchantName: '',
// gender: 1
},
ready() {
// this.getHeadImage()
},
/**
* 组件的方法列表
*/
methods: {
choose() {
this.setData({
agree: !this.data.agree
})
this.triggerEvent('choose', this.data.agree)
},
jump(e) {
console.log(e)
let { url } = e.currentTarget.dataset
const baseUrl = 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/html/'
const path = `${baseUrl}${url}.html`
// private user
wx.navigateTo({
url: `/pages/webView/webView?url=${encodeURIComponent(path)}`
})
// var globalData = appInstance.globalData.extConfig
// restapi.getMerchantBussiness(globalData.merchantId, function (res) {
// console.log(res);
// if (res.returnCode == '0') {
// let path = `https://dj.glsx.com.cn/agreement/djUserPolicy.html?merchantName=${globalData.merchantName}&phone=${res.data.phone}`
// wx.navigateTo({
// url: `/pages/webpage/webpage?path=${encodeURIComponent(path)}`
// })
// }
// }, function (res) {
// console.log(res);
// })
},
noScroll() {}
}
})
<view class='tips'>
<view class='choose-box' bindtap="choose">
<view class='icon'>
<image src="{{agree?'./images/ok.png':'./images/box.png'}}" class='check-img' />
</view>
</view>
阅读并同意以下协议
<!-- <text catchtap="jump" data-url="agree">《服务协议》</text> -->
<text catchtap="jump" data-url="privacy">《隐私协议》</text>
<text catchtap="jump" data-url="agreement">《用户协议》</text>
</view>
/* components/authSetting/authSetting.wxss */
.tips {
position: fixed;
width: 100%;
left: 0;
bottom: 60rpx;
font-size: 24rpx;
color: #999;
letter-spacing: 2rpx;
padding-left: 28rpx;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
}
.tips text {
color: #ff600f;
}
.tips .icon {
position: absolute;
top: 50%;
left: 50%;
width: 24rpx;
height: 24rpx;
border-radius: 2rpx;
box-sizing: border-box;
transform: translate(-50%, -50%);
}
.tips .icon .check-img {
vertical-align: top;
width: 100%;
height: 100%;
}
.tips .choose-box {
width: 80rpx;
height: 80rpx;
position: relative;
}
\ No newline at end of file
......@@ -28,7 +28,6 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow(options, refresh) {
1
if (refresh) {
this.setData({
disabled: true
......
......@@ -8,4 +8,4 @@
},
"navigationStyle": "custom",
"disableScroll": true
}
\ No newline at end of file
}
......@@ -43,10 +43,15 @@ const setLoginInfo = (userInfo, sessionId) => {
wx.$api.showToast('仅支持服务商类型账户登录')
return
}
// 自动创建服务中心
initServiceCenter()
setUserInfo(userInfo)
setSessionId(sessionId)
loginSuccess()
}
const initServiceCenter = () => {
USERAPI.initServiceCenter({})
}
/**成功跳转 */
const loginSuccess = () => {
const {
......@@ -105,5 +110,6 @@ module.exports = {
loginSuccess,
setRouteData,
setLoginInfo,
loginModal
loginModal,
initServiceCenter
}
\ No newline at end of file
......@@ -10,9 +10,9 @@
"integrity": "sha512-R2FyCk0mK2xvUX2dMgVZjVG512RKBj7ELMDxjRJjhQWtw4495WBgbl5Yb4v2A6d4vWJe6z9toKgDJTciN0Bo9A=="
},
"glsx-applet-component": {
"version": "1.0.47",
"resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.0.47.tgz",
"integrity": "sha512-KzdhJD35vbW1NPMhABsTTe+IosDUH1dlPO0pLUCug+JXLCU2/WbhNvIGAq5+y6Dj9xYy98HDAB9fGsQZ677YLw=="
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.1.3.tgz",
"integrity": "sha512-Ze+HdtFJImhOsWLfV+ZzB86Kf18pm9M9CZWhctPel/qJNMEn29g9ywC16NXmeac+gTu07MOpURyF+YmO8ojkJA=="
}
}
}
......@@ -5,7 +5,7 @@
"main": "app.js",
"dependencies": {
"@vant/weapp": "^1.10.7",
"glsx-applet-component": "^1.0.50"
"glsx-applet-component": "^1.1.3"
},
"devDependencies": {},
"scripts": {
......
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
// packagesList/mineDetail/components/selectConnectionConfirm/selectConnectionConfirm.js
Component({
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
observer: function(n) {
if (n) {
let { connectionList, selectedConnectionList } = this.data
connectionList.map(val => {
val.show = true
if (selectedConnectionList?.length && selectedConnectionList?.findIndex(item => item.merchantId == val.merchantId) > -1) val.checked = true
return val
})
this.setData({connectionList})
}
}
},
connectionList: Array,
tabBarStyle: String,
selectedConnectionList: {
type: Array
}
},
/**
* 组件的初始数据
*/
data: {
searchKeyword: ''
},
/**
* 组件的方法列表
*/
methods: {
select(e) {
let { item } = e.currentTarget.dataset
let { connectionList } = this.data
// 不可操作选项
if (item?.disabled) return
connectionList.forEach(v => {
if (v.merchantId == item?.merchantId) v.checked = !v.checked
})
this.setData({
connectionList
})
},
search(e) {
let { connectionList } = this.data
let { value } = e.currentTarget.dataset && Object.keys(e.currentTarget.dataset).length ? e.currentTarget.dataset : e.detail
console.log(value)
connectionList.forEach(item => {
console.log(item)
item.show = item.merchantName?.includes(value)
})
this.setData({
connectionList
})
console.log(connectionList)
},
input(e) {
let { value } = e.detail
this.setData({
searchKeyword: value
})
},
// 确定
handleConfirm() {
// 处理选中的数据
let { connectionList } = this.data
let filterArr = connectionList.filter(v => v.checked)
this.triggerEvent('selectConfirm', filterArr)
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* packagesList/mineDetail/components/selectConnectionConfirm/selectConnectionConfirm.wxss */
.select-connection-page{
position: fixed;
top: 0;
z-index: 10;
height: 100vh;
width: 100%;
box-sizing: border-box;
background-color: #F2F3F7;
animation: show-confirm-box .5s forwards;
.search-content{
height: 108rpx;
background: #FFFFFF;
box-shadow: 0 8rpx 20rpx 0 #b4bacc26;
position: relative;
z-index: inherit;
.search-box {
width: 100%;
height: 104rpx;
padding-left: 32rpx;
display: flex;
align-items: center;
background-color: #fff;
position: sticky;
top: 0;
left: 0;
z-index: 9;
box-sizing: border-box;
.search {
width: 144rpx;
height: 100%;
color: #666;
box-sizing: border-box;
padding: 0 24rpx;
display: flex;
align-items: center;
justify-content: center;
.text-center {
font-size: 24rpx;
border-radius: 12rpx;
width: 100%;
font-size: 32rpx;
color: #858A94;
.search-filter {
margin-left: 6rpx;
width: 24rpx;
height: 24rpx;
}
}
}
.search-input {
background: #F7F8FA;
border-radius: 38rpx;
width: 606rpx;
height: 72rpx;
display: flex;
align-items: center;
padding-left: 26rpx;
.input-placeholder {
color: rgba(200, 201, 204, .89);
}
.search-icon {
width: 28rpx;
height: 28rpx;
}
.search-clear {
width: 36rpx;
height: 36rpx;
margin: 0 26rpx 0 10rpx;
}
.input {
font-size: 28rpx;
width: calc(100% - 136rpx);
margin-left: 10rpx;
}
}
}
}
.service-items{
width: 100%;
height: 88rpx;
line-height: 88rpx;
background-color: #FFFFFF;
padding: 0 32rpx;
box-sizing: border-box;
font-size: 28rpx;
color: #323233;
display: flex;
align-items: center;
.item-radio{
display: flex;
align-items: center;
justify-content: center;
margin-right: 16rpx;
}
.radio_class{
width: 36rpx;
height: 36rpx;
}
.radio_disabled{
transform: scale(1.06);
}
.radio{
width: 32rpx;
height: 32rpx;
border: 2rpx solid #ADADAD;
border-radius: 50%;
}
.item-text{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.disabled_text{
color: #C8C9CC;
}
}
.isFullSucreen {
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
}
.btn {
position: sticky;
bottom: 16rpx;
left: 0;
width: calc(100% - 64rpx);
height: 88rpx;
line-height: 88rpx;
text-align: center;
font-size: 28rpx;
color: #FFFFFF;
margin: 16rpx 32rpx 0 32rpx;
}
.btn-blue {
background: var(--btnColor);
border-radius: 8rpx;
}
}
@keyframes show-confirm-box {
0%{
right: -100%;
}
100%{
right: 0;
}
}
\ No newline at end of file
<!--packagesList/mineDetail/components/selectConnectionConfirm/selectConnectionConfirm.wxml-->
<view class="select-connection-page" hidden="{{!show}}" style="margin-top:{{tabBarStyle}}px;">
<view class="search-content">
<view class="search-box">
<view class="search-input">
<glsx-image src="output/searchIcon.png" class="search-icon" />
<input
type="text"
placeholder="请搜索客户"
class="input"
value="{{keyword}}"
placeholder-class="input-placeholder"
bindinput="input"
bindconfirm="search" />
<block wx:if="{{keyword}}">
<image src="/images/clear.png" class="search-clear" bindtap="clear" />
</block>
</view>
<view class="search" bindtap="search" data-value="{{searchKeyword}}">
<view class="text-center">搜索</view>
</view>
</view>
</view>
<scroll-view
scroll-y
enable-back-to-top
refresher-enabled="{{true}}"
bindrefresherrefresh="refreshList"
refresher-threshold="104"
scroll-top="{{scrollTop}}"
class="list"
style="height: calc(100% - {{tabBarStyle}}px - 192rpx - env(safe-area-inset-bottom) - 32rpx);"
data-type="message"
refresher-triggered="{{triggered}}">
<view>
<block wx:for="{{connectionList}}" wx:key="index">
<view hidden="{{!item.show}}">
<view
class="service-items text-hide"
data-index="{{index}}"
data-item="{{item}}"
bindtap="select">
<view class="item-radio">
<view wx:if="{{!item.checked}}" class="radio_class radio {{item.disabled?'disabled': ''}}"></view>
<block wx:if="{{item.disabled && item.checked}}">
<glsx-image src="personal/checked_disabled.png" class="radio_class radio_disabled" />
</block>
<block wx:if="{{item.checked && !item.disabled}}">
<glsx-image src="login/radio.png" class="radio_class" />
</block>
</view>
<view class="item-text {{item.disabled?'disabled_text':''}}">{{item.merchantName}}</view>
</view>
</view>
</block>
</view>
</scroll-view>
<view class="isFullSucreen btn">
<view class="btn-blue" bindtap="handleConfirm">确定</view>
</view>
</view>
// packagesList/mineDetail/pages/staffManage/selectServicePage.js
Component({
options: {
addGlobalClass: true
},
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
observer: function(n) {
if (n) {
let { serviceList, selectInfo } = this.data
let activeIndex = serviceList.findIndex(v => v.yqMerchantId == selectInfo?.yqMerchantId)
serviceList.forEach((item, ind) => {
item.show = true
if (activeIndex == ind) {
item.act = true
} else {
item.act = false
}
this.setData({
serviceList
})
})
this.setData({
searchKeyword: ''
})
}
}
},
serviceList: Array,
selectInfo: Object,
tabBarStyle: String
},
/**
* 组件的初始数据
*/
data: {
searchKeyword: ''
},
/**
* 组件的方法列表
*/
methods: {
select(e) {
let { item } = e.currentTarget.dataset
let { serviceList } = this.data
serviceList.forEach((val, ind) => {
if (item.yqMerchantId == val.yqMerchantId) {
val.act = true
} else {
val.act = false
}
})
this.setData({
serviceList,
selectInfo: item || {}
})
this.triggerEvent('hiddenSelectConfirm', item)
},
search(e) {
let { serviceList } = this.data
let { value } = e.currentTarget.dataset && Object.keys(e.currentTarget.dataset).length ? e.currentTarget.dataset : e.detail
serviceList.forEach(item => {
item.act = false
item.show = item.yqMerchantName?.includes(value)
})
this.setData({
serviceList
})
},
input(e) {
let { value } = e.detail
this.setData({
searchKeyword: value
})
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* packagesList/mineDetail/pages/staffManage/selectServicePage.wxss */
.select-service-page{
position: fixed;
top: 0;
z-index: 10;
height: 100vh;
width: 100%;
box-sizing: border-box;
background-color: #F2F3F7;
animation: show-confirm-box .5s forwards;
.search-content{
height: 108rpx;
background: #FFFFFF;
box-shadow: 0 8rpx 20rpx 0 #b4bacc26;
position: relative;
z-index: inherit;
.search-box {
width: 100%;
height: 104rpx;
padding-left: 32rpx;
display: flex;
align-items: center;
background-color: #fff;
position: sticky;
top: 0;
left: 0;
z-index: 9;
box-sizing: border-box;
.search {
width: 144rpx;
height: 100%;
color: #666;
box-sizing: border-box;
padding: 0 24rpx;
display: flex;
align-items: center;
justify-content: center;
.text-center {
font-size: 24rpx;
border-radius: 12rpx;
width: 100%;
font-size: 32rpx;
color: #858A94;
.search-filter {
margin-left: 6rpx;
width: 24rpx;
height: 24rpx;
}
}
}
.search-input {
background: #F7F8FA;
border-radius: 38rpx;
width: 606rpx;
height: 72rpx;
display: flex;
align-items: center;
padding-left: 26rpx;
.input-placeholder {
color: rgba(200, 201, 204, .89);
}
.search-icon {
width: 28rpx;
height: 28rpx;
}
.search-clear {
width: 36rpx;
height: 36rpx;
margin: 0 26rpx 0 10rpx;
}
.input {
font-size: 28rpx;
width: calc(100% - 136rpx);
margin-left: 10rpx;
}
}
}
}
.service-items{
width: 100%;
height: 88rpx;
line-height: 88rpx;
background-color: #FFFFFF;
padding: 0 32rpx;
box-sizing: border-box;
font-size: 28rpx;
color: #323233;
}
.service-items.active {
background: #F0F7FF;
color: #3666FE;
}
}
@keyframes show-confirm-box {
0%{
right: -100%;
}
100%{
right: 0;
}
}
\ No newline at end of file
<!--packagesList/mineDetail/pages/staffManage/selectServicePage.wxml-->
<view class="select-service-page" hidden="{{!show}}" style="margin-top:{{tabBarStyle}}px;">
<view class="search-content">
<view class="search-box">
<view class="search-input">
<glsx-image src="output/searchIcon.png" class="search-icon" />
<input
type="text"
placeholder="请搜索服务中心"
class="input"
value="{{keyword}}"
placeholder-class="input-placeholder"
bindinput="input"
bindconfirm="search" />
<block wx:if="{{keyword}}">
<image src="/images/clear.png" class="search-clear" bindtap="clear" />
</block>
</view>
<view class="search" bindtap="search" data-value="{{searchKeyword}}">
<view class="text-center">搜索</view>
</view>
</view>
</view>
<scroll-view
scroll-y
enable-back-to-top
refresher-enabled="{{true}}"
bindrefresherrefresh="refreshList"
refresher-threshold="104"
scroll-top="{{scrollTop}}"
class="list"
style="height:100%;"
data-type="message"
refresher-triggered="{{triggered}}">
<block wx:for="{{serviceList}}" wx:key="index">
<view
class="service-items text-hide {{item.act?'active':''}}"
data-item="{{item}}"
hidden="{{!item.show}}"
bindtap="select">
{{item.yqMerchantName}}
</view>
</block>
</scroll-view>
</view>
// pages/tab/output/components/accountSwitchingPop/accountSwitchingPop.js
import { IMG_URL } from '~/utils/constantData.js'
Component({
options: {
addGlobalClass: true
},
/**
* 组件的属性列表
*/
properties: {
popShow: {
type: Boolean,
value: false,
observer: function (n) {
if (n) {
let { serviceRange, selectInfo } = this.data
let activeIndex = serviceRange.findIndex(v => v.yqMerchantId == selectInfo.yqMerchantId)
if (serviceRange.length) serviceRange.unshift({yqMerchantId: '', yqMerchantName: '全部'})
serviceRange.forEach((item, ind) => {
item.show = true
if (activeIndex == (ind - 1)) {
item.act = true
} else {
item.act = false
}
this.setData({
serviceRange
})
})
this.setData({
searchKeyword: ''
})
}
}
},
serviceRange: Object,
selectInfo: Object
},
/**
* 组件的初始数据
*/
data: {
IMG_URL,
serviceList: [],
searchKeyword: ''
},
observers: {
serviceRange: function (e) {
this.setData({
serviceList: e || []
})
}
},
/**
* 组件的方法列表
*/
methods: {
hidePopup() {
this.triggerEvent('hidePopup')
},
confirm() {
let { serviceRange, subIndex } = this.data
let actObj = serviceRange.find((item, index) => {
if (item.act) {
subIndex = index
}
return item.act
})
if (!actObj) {
return wx.$api.showToast({
title: '请选择服务中心',
icon: 'error'
})
} else {
if (actObj.yqMerchantId == '' && actObj.yqMerchantName == '全部') actObj.yqMerchantName = '全部服务中心'
this.changePicker(actObj)
}
},
changePicker(actObj) {
// 修改对应下标显示
wx.$api.showLoading('加载中...')
this.triggerEvent('getStaffList', {...actObj})
this.hidePopup()
},
select(e) {
let { index } = e.currentTarget.dataset
let { serviceRange } = this.data
serviceRange.forEach((item, ind) => {
if (index == ind) {
item.act = true
} else {
item.act = false
}
this.setData({
serviceRange
})
})
},
search(e) {
let { serviceRange } = this.data
let { value } = e.currentTarget.dataset && Object.keys(e.currentTarget.dataset).length ? e.currentTarget.dataset : e.detail
serviceRange.forEach(item => {
item.act = false
item.show = item.yqMerchantName?.includes(value)
})
this.setData({
serviceRange
})
},
input(e) {
let { value } = e.detail
this.setData({
searchKeyword: value
})
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* packagesList/mineDetail/components/selectService/selectService.wxss */
.search-box {
width: 100%;
height: 104rpx;
padding-left: 32rpx;
display: flex;
align-items: center;
background-color: #fff;
position: sticky;
top: 0;
left: 0;
z-index: 9;
box-sizing: border-box;
.search {
width: 144rpx;
height: 100%;
color: #666;
box-sizing: border-box;
padding: 0 24rpx;
.text-center {
font-size: 24rpx;
border-radius: 12rpx;
width: 100%;
font-size: 32rpx;
color: #858A94;
.search-filter {
margin-left: 6rpx;
width: 24rpx;
height: 24rpx;
}
}
}
.search-input {
background: #F7F8FA;
border-radius: 38rpx;
width: 606rpx;
height: 72rpx;
display: flex;
align-items: center;
padding-left: 26rpx;
.input-placeholder {
color: rgba(200, 201, 204, .89);
}
.search-icon {
width: 28rpx;
height: 28rpx;
}
.search-clear {
width: 36rpx;
height: 36rpx;
margin: 0 26rpx 0 10rpx;
}
.input {
font-size: 28rpx;
width: calc(100% - 136rpx);
margin-left: 10rpx;
}
}
}
.list {
height: calc(100% - 100rpx) !important;
}
.itemCon {
box-sizing: border-box;
width: 100%;
height: 80rpx;
color: #323436;
line-height: 80rpx;
padding: 0 32rpx;
}
.active {
background: #F0F7FF;
font-size: 28rpx;
color: #3666FE;
}
\ No newline at end of file
<!--packagesList/mineDetail/components/selectService/selectService.wxml-->
<popup
show="{{popShow}}"
bind:hidePopup="hidePopup"
bindconfirm="confirm"
height="60%">
<view class="search-box">
<view class="search-input">
<glsx-image src="output/searchIcon.png" class="search-icon" />
<input
type="text"
placeholder="请搜索服务中心"
class="input"
value="{{keyword}}"
placeholder-class="input-placeholder"
bindinput="input"
bindconfirm="search" />
<block wx:if="{{keyword}}">
<image src="/images/clear.png" class="search-clear" bindtap="clear" />
</block>
</view>
<view class="search text-center" bindtap="search" data-value="{{searchKeyword}}">
<view class="text-center">搜索</view>
</view>
</view>
<scroll-view
scroll-y
enable-back-to-top
refresher-enabled="{{true}}"
bindrefresherrefresh="refreshList"
refresher-threshold="104"
scroll-top="{{scrollTop}}"
class="list"
style="height:100%;"
data-type="message"
refresher-triggered="{{triggered}}">
<block wx:for="{{serviceList}}" wx:key="index">
<view
class="itemCon text-hide {{item.act?'active':''}}"
data-index="{{index}}"
hidden="{{!item.show}}"
bindtap="select">
{{item.yqMerchantName}}
</view>
</block>
</scroll-view>
</popup>
// packageMine/pages/customerManagement/customerList/customerList.js
import { IMG_URL } from '~/utils/constantData'
import mineCustomerApi from '~/api/mineApi/mineCustomer'
import mineApi from '~/api/mineApi/index'
Page({
/**
* 页面的初始数据
*/
data: {
IMG_URL,
maxNum: 99,
bgUrl: `${IMG_URL}/personal/empty_tran.png`,
selectInfo: {
yqMerchantName: '全部服务中心'
},
popupShow: false,
serviceList: [],
allServiceIds: [],
customerList: [],
total: -1,
pageCof: {
pageNum: 1,
pageSize: 10
},
isAsk: false
},
// 筛选服务中心
filterTypeFn() {
this.setData({
popupShow: !this.data.popupShow
})
},
// 邀请销售
handleSale(e) {
let { target } = e.currentTarget.dataset
wx.$router.go('packageMine.saleList', target)
},
handleTechnician(e) {
let { target } = e.currentTarget.dataset
wx.$router.go('packageMine.technicianList', target)
},
handleEdit(e) {
let { type } = e.currentTarget.dataset
let params = {
addOrEdit: type,
target: e.currentTarget.dataset?.target || {}
}
wx.$router.go('packageMine.editCustomer', params)
},
onRefreshBottom() {
wx.$api.hideLoading()
this.setData({
total: -1,
['pageCof.pageNum']: 1,
})
this.getList(true)
},
handleSearch(e) {
wx.$api.hideLoading()
this.setData({
selectInfo: e.detail,
total: -1,
['pageCof.pageNum']: 1,
})
this.getList(true)
},
scrollonReachBottom() {
this.getList()
},
getList(isReset = false) {
let { customerList, pageCof, total, selectInfo, isAsk } = this.data
let _this = this
if (total == customerList.length || isAsk) {
return true
}
let params = {
...pageCof,
serviceCenterMerchantId: selectInfo?.yqMerchantId || ''
}
this.setData({
isAsk: true
})
mineCustomerApi.getCustomerList(params).then(res => {
let { list, total } = res
this.setData({
customerList: pageCof.pageNum == 1 ? (list || []) : customerList.concat(list || []),
['pageCof.pageNum']: pageCof.pageNum + 1,
triggered: false,
total
})
if (isReset) {
this.setData({
scrollTop: 0
})
}
}).finally(function () {
_this.setData({
isAsk: false
})
})
},
// 获取服务中心数据
getServiceList() {
mineApi.getServiceCenterListAPI({}).then(res => {
let data = res || []
let serviceIds = data.map(val => { return val.yqMerchantId })
this.setData({
serviceList: res || [],
allServiceIds: serviceIds,
['pageCof.pageNum']: 1,
total: -1
})
this.getList(true)
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.setData({
total: -1,
['pageCof.pageNum']: 1,
})
this.getServiceList(true)
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"navigationBarTitleText": "客户管理",
"usingComponents": {
"select-service-popup": "../../../components/selectServicePopup/selectServicePopup"
}
}
\ No newline at end of file
/* packageMine/pages/customerManagement/customerList/customerList.wxss */
.customer-list-page {
width: 100%;
box-sizing: border-box;
padding: 20rpx;
background-color: #F2F3F7;
.btn_box {
width: 100%;
height: 96rpx;
display: flex;
justify-content: center;
align-items: center;
background-color: #FFFFFF;
border-radius: 16rpx;
color: var(--btnColor);
font-size: 28rpx;
font-weight: 600;
margin-bottom: 32rpx;
.icon {
width: 40rpx;
height: 40rpx;
margin-right: 16rpx;
vertical-align: -12rpx
}
}
.title-box {
display: flex;
align-items: center;
justify-content: space-between;
.title {
color: #323436;
font-size: 28rpx;
font-weight: 600;
.number {
color: var(--btnColor)
}
}
.select-btn {
box-sizing: border-box;
padding: 16rpx 0;
display: flex;
align-items: center;
z-index: 2;
background-color: #f2f3f7;
.type {
margin-left: 8px;
display: flex;
justify-content: center;
align-items: center;
padding: 0 16rpx;
height: 24px;
line-height: 24px;
background: #ffffff;
border-radius: 14px;
font-size: 12px;
color: #8a8c90;
text {
max-width: 360rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.point {
margin-left: 2px;
width: 12px;
height: 12px;
}
}
}
}
.item-box {
width: 100%;
background: #FFFFFF;
border-radius: 12rpx;
margin-bottom: 20rpx;
.top {
display: flex;
justify-content: space-between;
align-items: center;
padding: 24rpx 0;
margin: 0 32rpx;
border-bottom: 2rpx dotted #CCCED1;
.message {
display: flex;
.avatar {
flex-shrink: 0;
width: 72rpx;
height: 72rpx;
margin-right: 12rpx;
}
.message-text {
display: flex;
flex-flow: column;
justify-content: center;
.name {
color: #323436;
font-size: 28rpx;
}
.tips {
color: #858A94;
font-size: 26rpx;
}
}
}
.arrow_right {
width: 36rpx;
height: 36rpx;
}
}
.employee-box {
display: flex;
justify-content: space-between;
align-items: center;
padding: 27rpx 12rpx 24rpx 32rpx;
.employee-list {
display: flex;
align-items: center;
font-size: 26rpx;
color: #323436;
.avatar-box {
position: relative;
width: 48rpx;
height: 48rpx;
margin-right: 14rpx;
.avatar-img {
width: 48rpx;
height: 48rpx;
}
.num {
position: absolute;
right: -50%;
top: 0;
width: 36rpx;
height: 22rpx;
line-height: 22rpx;
font-size: 20rpx;
color: #FFFFFF;
text-align: center;
background: #F36261;
border-radius: 12rpx;
}
}
.line {
font-size: 26rpx;
color: #8A8C90;
margin: 0 20rpx;
}
.look-btn {
font-size: 24rpx;
color: #3666FE;
margin-left: 10rpx;
}
}
.no-employee {
font-size: 26rpx;
color: #8A8C90;
}
.employee-btn {
width: 192rpx;
height: 48rpx;
line-height: 48rpx;
background: #3666FE;
border-radius: 24rpx;
font-size: 24rpx;
color: #FFFFFF;
text-align: center;
}
}
.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
<!--packageMine/pages/customerManagement/customerList/customerList.wxml-->
<!-- <wxs src="../index.wxs" module="format" /> -->
<view class="customer-list-page">
<view class="btn_box" bindtap="handleEdit" data-type="add">
<glsx-image src="index/apply.png" class="icon" />
<text>创建新客户</text>
</view>
<view class="content-box">
<view class="title-box">
<view class="title">客户数量:<text class="number">{{total < 0 ? 0 : total}}</text>
</view>
<view class="select-btn">
<view class="type" bindtap="filterTypeFn">
<text>{{selectInfo.yqMerchantName}}</text>
<glsx-image class="point" src="index/point.png" />
</view>
</view>
</view>
<scroll-view wx:if="{{customerList.length}}" scroll-y enable-back-to-top refresher-enabled="{{true}}" bindrefresherrefresh="onRefreshBottom" 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="{{customerList}}" wx:key="index" bindtap="handleEdit" data-type="edit" data-target="{{item}}">
<view class="top">
<view class="message">
<glsx-image src="personal/customer_head.png" class="avatar" />
<view class="message-text">
<view class="name">{{item.merchantName}}</view>
<view class="tips">{{item.merchantId}} | {{item.contactName}} {{item.phone}}</view>
</view>
</view>
<glsx-image src="personal/arrow_right.png" class="arrow_right" />
</view>
<view class="employee-box">
<view class="employee-list">
<!-- 技师 -->
<view class="employee-list" catchtap="handleTechnician" data-target="{{item}}">
<view class="avatar-box">
<glsx-image class="avatar-img" src="personal/tech_defalut_avatar.png" />
<view wx:if="{{item.technicianCount != '0'}}" class="num">{{item.technicianCount > maxNum ? (maxNum + '+') : item.technicianCount}}</view>
</view>
<view class="look-btn">技师</view>
</view>
<view class="line">|</view>
<!-- 销售顾问 -->
<view class="employee-list" wx:if="{{item.employeeNum != '0'}}" catchtap="handleSale" data-target="{{item}}">
<view class="avatar-box">
<glsx-image class="avatar-img" src="personal/staff_defalut_avatar.png" />
<view class="num">{{item.employeeNum > maxNum ? (maxNum + '+') : item.employeeNum}}</view>
</view>
<view class="look-btn">销售顾问</view>
</view>
<view class="no-employee" wx:else>暂无销售顾问,去邀请</view>
</view>
<view class="employee-btn" data-target="{{item}}" catchtap="handleSale">邀请销售顾问</view>
</view>
<view class="bottom">
<view class="service_name">
所属:{{item.serviceCenterMerchantName || '无'}}
</view>
<view class="time">{{item.createdDate}}</view>
</view>
</view>
<view class="bottomTips" wx:if="{{customerList.length == total}}">到底啦!</view>
</scroll-view>
</view>
<view wx:if="{{!customerList.length}}">
<nothing-tips tips="暂无客户~" bgColor="{{'#F2F3F7'}}" bg="{{bgUrl}}" />
</view>
</view>
<select-service-popup wx:if="{{popupShow}}" bind:hidePopup="filterTypeFn" bind:getStaffList="handleSearch" selectInfo="{{selectInfo}}" popShow="{{popupShow}}" serviceRange="{{serviceList}}" />
\ No newline at end of file
const phoneRex = /^[1]([3-9])[0-9]{9}$/
const formRule = {
serviceCenterMerchantId: [{ required: true, message: '请选择所属服务中心' }],
merchantName: [{ required: true, message: '客户名称不能为空' }],
contactName: [{ required: true, message: '联系人不能为空' }],
phone: [
{ required: true, message: '联系电话不能为空' },
{
validator: (rule, value) => {
return !phoneRex.test(value) ? { message: '请输入正确的手机号' } : null
}
}
]
}
const formItems = [{
label: '所属服务中心',
props: 'serviceCenterMerchantId',
valueFn: 'serviceCenterMerchantName',
type: 'select',
placeholder: '请选择服务中心',
pageType: 1
}, {
label: '客户名称',
props: 'merchantName',
type: 'input',
placeholder: '请输入客户的商户名称',
maxlength: 50
}, {
label: '联系人',
props: 'contactName',
type: 'input',
placeholder: '请输入联系人姓名',
maxlength: 10
}, {
label: '联系电话',
props: 'phone',
type: 'input',
inputType: 'number',
placeholder: '请输入手机号码',
maxlength: 11
}, {
label: '业务开通',
props: '',
type: 'business'
}]
export default {
formRule,
formItems
}
\ No newline at end of file
// packageMine/pages/customerManagement/editCustomer/editCustomer.js
import constantData from './constant/data'
import { scenceList } from '~/pages/tab/index/constant/data'
import { IMG_URL } from '~/utils/constantData'
import mineServiceApi from '~/api/mineApi/mineService'
import mineCustomerApi from '~/api/mineApi/mineCustomer'
import outputApi from '~/api/outputApi/index'
const sceneCodeList = ['SC002', 'SC003', 'SC004', 'SC001']
Page({
/**
* 页面的初始数据
*/
data: {
IMGURL: IMG_URL,
addOrEdit: '',
formData: {},
formItems: constantData.formItems,
apiNameObj: {
'add': 'saveCustomer',
'edit': 'updateCustomer'
},
// 服务中心-选择
selectInfo: {},
showServiceConfirm: false,
serviceList: [],
// 场景业务
scenceList,
isConfirm: false,
baseData: {
proList: []
}
},
getProList(sceneCode) {
let { scenceList, addOrEdit, proActList } = this.data
var params = {
sceneCode: sceneCode || ''
}
let list = []
outputApi.findProByScene(params).then(res => {
sceneCodeList.forEach(item => {
let proList = res.find(k => k.sceneCode == item)?.productList
let target = scenceList.find(k => k.sceneCode == item)
if (addOrEdit == 'edit') {
proList.forEach(k => {
if(proActList.includes(k.productCode)) {
k.isCheck = true
}
})
}
target.proList = proList
list.push(target)
})
this.setData({
scenceList: list
})
})
},
getSceneProStatus() {
let { formData } = this.data
var params = {
merchant4sId: formData.merchantId
}
let proActList = []
outputApi.getSceneProStatus(params).then(res => {
console.log(res)
res.forEach(item => {
item.productList.forEach(k => {
if (k.productStatus == 2) {
proActList.push(k.productCode)
}
})
})
this.setData({
proActList: proActList
})
this.getProList()
})
},
getAllServiceList() {
mineServiceApi.getAllServiceList({}).then(res => {
this.setData({
serviceList: res || []
})
})
},
handleProClick(e) {
let { sceneidx, proidx } = e.currentTarget.dataset
this.setData({
[`scenceList[${sceneidx}].proList[${proidx}].isCheck`]: !this.data.scenceList[sceneidx].proList[proidx].isCheck
})
},
// 选择服务中心/客户
jump(e) {
let { addOrEdit } = this.data
if (addOrEdit == 'edit') {
return true
}
let { type } = e.currentTarget.dataset
switch (type) {
// 选择服务中心
case 1:
this.hiddenSelectConfirm()
break
}
},
// 服务中心
hiddenSelectConfirm(e) {
let selectInfo = e?.detail
this.setData({ showServiceConfirm: !this.data.showServiceConfirm })
if (!selectInfo) return
this.setData({
selectInfo: selectInfo,
'formData.serviceCenterMerchantId': selectInfo?.yqMerchantId,
'formData.serviceCenterMerchantName': selectInfo?.yqMerchantName
})
},
handleInput(e) {
let { attr } = e.currentTarget.dataset
let { value } = e.detail
this.setData({
['formData.' + attr]: value
})
},
dealScenePro() {
let sceneArr = []
let arr = []
let { scenceList } = this.data
scenceList.forEach(item => {
item.proList.forEach(k => {
if (k.isCheck) {
arr.push(k.productCode)
if (sceneArr.findIndex(n => n == item.sceneCode) == -1) {
sceneArr.push(item.sceneCode)
}
}
})
})
return { sceneList: sceneArr, productCodeList: arr }
},
handleConfirm() {
let { userInfo } = wx.$storage.get()
let { apiNameObj, addOrEdit, formData, isConfirm } = this.data
let _this = this
if (isConfirm) {
return true
}
let scene = this.dealScenePro()
formData.sceneList = scene.sceneList
formData.productCodeList = scene.productCodeList
let validObj = wx.$util.checkRule(formData, constantData.formRule)
if (validObj) {
wx.$api.showToast(validObj.message)
return
}
if (!formData.productCodeList.length) {
wx.$api.showToast('请至少选择一个产品')
return
}
let message = addOrEdit == 'add' ? '是否确定客户?' : '是否确定修改客户?'
delete formData.serviceCenterMerchantName
wx.showModal({
title: '提示',
content: message,
confirmText: '确定',
cancelText: '取消',
confirmColor: '#3666FE',
success(res) {
if (res.confirm) {
_this.setData({
isConfirm: true
})
wx.$api.showLoading('加载中...')
let params = {
// ...formData,
serviceCenterMerchantId: formData.serviceCenterMerchantId,
merchantName: formData.merchantName,
contactName: formData.contactName,
phone: formData.phone,
sceneList: formData.sceneList,
productCodeList: formData.productCodeList,
oldPhone: formData?.oldPhone,
oldMerchantName: formData.oldMerchantName,
serviceMerchantName: userInfo.merchantName
}
if (addOrEdit == 'edit') {
params.merchantId = formData.merchantId
}
// 创建/编辑接口
mineCustomerApi[apiNameObj[addOrEdit]](params).then(res => {
let { code, data, message } = res
if (code == '0') {
wx.hideLoading()
if (addOrEdit == 'add') {
if (data) {
let params = '&merchantId=' + data.merchantId + '&sceneList=' + data.sceneList
wx.$router.redirectTo(`packageMine.successPage?page=customer${params}`)
} else {
wx.$api.showToast('返回参数有误')
}
} else {
wx.$api.showToast('修改成功')
setTimeout(() => {
wx.$router.back()
}, 1000)
}
} else {
wx.$api.showToast(message)
}
}).finally(() => {
_this.setData({
isConfirm: false
})
})
}
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let { scenceList } = this.data
wx.$router.getData(res => {
let { addOrEdit, target } = res
this.setData({
addOrEdit,
formData: {
...target,
oldPhone: target?.phone,
oldMerchantName: target.merchantName || ''
}
})
if (addOrEdit == 'edit') {
wx.setNavigationBarTitle({ title: '编辑客户' })
scenceList.forEach(item => {
item.isCheck = target.sceneList?.findIndex(k => k == item.sceneCode) != -1
})
this.setData({
scenceList,
selectInfo: {
yqMerchantId: target.serviceCenterMerchantId,
yqMerchantName: target.serviceCenterMerchantName
}
})
this.getSceneProStatus()
} else {
this.getProList()
}
})
this.getAllServiceList()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"navigationBarTitleText": "创建客户",
"usingComponents": {
"select-service-confirm": "../../../components/selectServiceConfirm/selectServiceConfirm"
}
}
\ No newline at end of file
/* packageMine/pages/customerManagement/editCustomer/editCustomer.wxss */
.create-service-page {
margin: 20rpx;
.tips {
padding: 12rpx;
color: #323436;
font-size: 28rpx;
font-weight: 600;
}
.form-content {
background: #FFFFFF;
border-radius: 16rpx;
padding: 44rpx 40rpx 200rpx;
.label {
font-size: 28rpx;
font-weight: 600;
color: #323436;
margin-bottom: 12rpx;
.tips {
font-size: 24rpx;
font-weight: 400;
color: #F35251;
}
}
.input-box,
.select-box {
height: 40rpx;
background: #F8F9FC;
border-radius: 12rpx;
padding: 32rpx 24rpx;
margin-bottom: 16rpx;
color: #323436;
}
.select-box {
display: flex;
justify-content: space-between;
.arrow_right {
width: 36rpx;
height: 36rpx;
}
.name {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.disabled {
background: #E1E2E6;
}
}
.btn {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 88rpx;
background-color: #FFFFFF;
line-height: 88rpx;
text-align: center;
font-size: 28rpx;
color: #FFFFFF;
}
.btn-blue {
width: calc(100% - 64rpx);
background: var(--btnColor);
border-radius: 8rpx;
margin: 20rpx 32rpx 0;
}
}
.flex {
display: flex;
}
.scene {
width: 100%;
font-size: 28rpx;
color: #323436;
}
.scene-item {
display: flex;
align-items: center;
box-sizing: border-box;
background: #FFFFFF;
font-size: 24rpx;
padding: 8rpx 28rpx;
font-weight: 500;
border: 2rpx solid #F2F3F7;
border-radius: 12rpx;
margin-bottom: 16rpx;
}
.pro-box {
display: flex;
flex-wrap: wrap;
}
.pro-item {
position: relative;
box-sizing: border-box;
width: calc((100% - 20rpx) / 2);
margin-right: 20rpx;
height: 64rpx;
line-height: 64rpx;
text-align: center;
background: #F2F3F7;
border-radius: 8rpx;
margin-bottom: 16rpx;
}
.pro-item:nth-child(2n) {
margin-right: 0;
}
.check-icon {
position: absolute;
top: 0;
right: 0;
width: 30rpx;
height: 22rpx;
}
/* 选中 - start */
.active.pro-item {
color: #3666FE;
background: #F0F7FF;
border: 2rpx solid #3E71FE;
}
/* 选中 - end */
.scene-img {
width: 81rpx;
height: 56rpx;
}
/* .notOpened {
color: #8A8C90;
} */
\ No newline at end of file
<!--packageMine/pages/customerManagement/editCustomer/editCustomer.wxml-->
<view class="create-service-page" style="padding-top:{{tabBarStyle}}px;">
<view class="tips" wx:if="{{addOrEdit == 'add'}}">请完善客户资料完成创建:</view>
<view class="form-content">
<block wx:for="{{formItems}}" wx:key="index">
<view class="label">{{item.label}}<text class="tips">{{item.tips}}</text></view>
<view class="input-box" wx:if="{{item.type == 'input'}}">
<input type="text" placeholder="{{item.placeholder || '请输入' + item.label}}" maxlength="{{item.maxlength}}" class="input" value="{{formData[item.props]}}" type="{{item.inputType || 'text'}}" password="{{item.password}}" placeholder-class="input-placeholder" data-attr="{{item.props}}" bindinput="handleInput" />
</view>
<view class="select-box {{addOrEdit == 'edit' ? 'disabled' : ''}}" wx:if="{{item.type == 'select'}}" bindtap="jump" data-type="{{item.pageType}}">
<view class="name" wx:if="{{formData[item.valueFn]}}">{{formData[item.valueFn]}}</view>
<view class="placeholder-text" wx:else>{{item.placeholder}}</view>
<glsx-image src="personal/arrow_right.png" class="arrow_right" />
</view>
<view wx:if="{{item.type == 'business'}}">
<view wx:for="{{scenceList}}" wx:key="index" class="scene">
<view class="scene-item">
<image webp class="scene-img" src="{{IMGURL}}output/caracticon0{{item.sceneid + 1}}.png?v={{img_version}}"></image>
<view>{{item.name}}</view>
</view>
<view class="pro-box">
<view wx:for="{{item.proList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx" class="pro-item {{subItem.isCheck ? 'active' : ''}}" bindtap="handleProClick" data-sceneIdx="{{index}}" data-proIdx="{{idx}}">
<glsx-image wx:if="{{subItem.isCheck}}" src="personal/scene-check.png" class="check-icon" />
{{subItem.productName}}
</view>
</view>
</view>
</view>
</block>
</view>
<view class="isFullSucreen btn">
<view class="btn-blue" bindtap="handleConfirm">{{addOrEdit == 'add' ? '提交' : '保存'}}</view>
</view>
</view>
<select-service-confirm show="{{showServiceConfirm}}" tabBarStyle="{{tabBarStyle}}" serviceList="{{serviceList}}" selectInfo="{{formData.selectInfo}}" bind:hiddenSelectConfirm="hiddenSelectConfirm"></select-service-confirm>
\ No newline at end of file
// packageMine/pages/customerManagement/saleList/saleList.js
import { IMG_URL } from '~/utils/constantData'
import mineCustomerApi from '~/api/mineApi/mineCustomer'
Page({
/**
* 页面的初始数据
*/
data: {
IMG_URL,
bgUrl: `${IMG_URL}/personal/empty_tran.png`,
saleList: [],
total: -1,
customerInfo: {},
// 邀请销售
isPopupShow: false,
popupVal: '',
// 提示
isTipShow: false,
tipObj: {
inviteUrl: '',
qrcodeUrl: ''
}
},
handlePopup() {
this.setData({
isPopupShow: !this.data.isPopupShow,
popupVal: ''
})
},
handlePopupChoose(e) {
let { val } = e.currentTarget.dataset
this.setData({
popupVal: val
})
},
handlePopupConfirm() {
let { popupVal } = this.data
if (!popupVal) {
wx.$api.showToast('请选择邀请方式')
return true
}
this.setData({
isPopupShow: !this.data.isPopupShow
})
this.getInviteCode()
},
handleSeach() {
this.getList(true)
},
getList(isReset = false) {
let { customerInfo } = this.data
mineCustomerApi.getEmployeeList({ merchantId: customerInfo.merchantId }).then(res => {
this.setData({
saleList: res,
triggered: false
})
if (isReset) {
this.setData({
scrollTop: 0
})
}
})
},
// 获取邀请二维码和链接
getInviteCode() {
let { customerInfo, popupVal } = this.data
let _this = this
let sceneStr = ''
let sceneToNum = {
'SC001': 0,
'SC002': 1,
'SC003': 2,
'SC004': 3,
}
if (!customerInfo.sceneList || !customerInfo.sceneList.length) {
wx.$api.showToast('缺少场景值')
return true
}
wx.$api.showLoading('加载中...')
customerInfo.sceneList.forEach(item => {
sceneStr = sceneStr + (sceneStr ? (',' + sceneToNum[item]) : sceneToNum[item])
})
let params = {
merchantId: customerInfo.merchantId,
staffLabel: sceneStr
}
mineCustomerApi.getInviteCode(params).then(res => {
this.setData({
tipObj: res || {}
})
if (popupVal == 'link') {
wx.setClipboardData({
data: res.inviteUrl,
success(res) {
wx.hideToast()
_this.handleShow()
}
})
} else {
this.handleShow()
}
wx.$api.hideLoading()
})
},
handleShow() {
this.setData({
isTipShow: !this.data.isTipShow
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (options?.isRedirect) {
let { merchantId } = options
this.setData({
customerInfo: {
merchantId,
sceneList: options.sceneList.split(',')
}
})
this.getList()
return true
}
wx.$router.getData(res => {
this.setData({
customerInfo: res
})
this.getList()
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"navigationBarTitleText": "销售顾问",
"usingComponents": {}
}
\ No newline at end of file
/* packageMine/pages/customerManagement/saleList/saleList.wxss */
.sale-list-page {
width: 100%;
box-sizing: border-box;
padding: 20rpx;
background-color: #F2F3F7;
.btn_box {
width: 100%;
height: 96rpx;
display: flex;
justify-content: center;
align-items: center;
background-color: #FFFFFF;
border-radius: 16rpx;
color: var(--btnColor);
font-size: 28rpx;
font-weight: 600;
margin-bottom: 32rpx;
.icon {
width: 40rpx;
height: 40rpx;
margin-right: 16rpx;
vertical-align: -12rpx
}
}
.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)
}
}
}
.item-box {
width: 100%;
background: #FFFFFF;
border-radius: 12rpx;
margin-bottom: 20rpx;
.top {
display: flex;
justify-content: space-between;
padding: 24rpx 32rpx;
.message {
display: flex;
.avatar {
flex-shrink: 0;
width: 72rpx;
height: 72rpx;
margin-right: 12rpx;
border-radius: 50%;
}
.message-text {
display: flex;
flex-flow: column;
justify-content: center;
.merchant {
color: #323436;
font-size: 28rpx;
}
.contact {
color: #858A94;
font-size: 26rpx;
}
}
}
.department {
display: flex;
font-size: 24rpx;
color: #323436;
}
.icon-department {
width: 36rpx;
height: 36rpx;
}
}
.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;
}
}
.popup-row {
height: 116rpx;
line-height: 116rpx;
font-weight: 500;
font-size: 32rpx;
color: #323436;
text-align: center;
}
.popup-active {
background: #F0F7FF;
}
// 提示
.layout {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100vw;
height: 100vh;
z-index: 998;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.bg {
position: absolute;
width: 100%;
height: 100%;
z-index: -1;
background: rgba(0, 0, 0, .8);
}
.content {
position: relative;
text-align: center;
box-sizing: border-box;
// background-image: linear-gradient(180deg, #F7F9FF 0%, #FFFFFF 54%);
}
.content.code {
width: 558rpx;
height: 648rpx;
background: #FFFFFF;
border-radius: 16rpx;
overflow: hidden;
.img-box {
padding: 60rpx;
image {
width: 440rpx;
height: 440rpx;
}
}
.code-btn {
display: flex;
justify-content: center;
align-items: center;
height: 90rpx;
line-height: 90rpx;
background: #F7F8FA;
font-size: 32rpx;
color: #3666FE;
.icon-long-press {
width: 40rpx;
height: 40rpx;
margin-right: 12rpx;
}
}
}
.content.link {
width: 614rpx;
height: 440rpx;
background: #FFFFFF;
border-radius: 32rpx;
.title {
height: 110rpx;
line-height: 110rpx;
text-align: center;
font-weight: 600;
font-size: 32rpx;
color: #323436;
border-bottom: 2rpx solid #F5F6F7;
}
.link-content {
font-size: 32rpx;
color: #323436;
padding: 64rpx 82rpx;
}
.link-btn {
height: 110rpx;
line-height: 110rpx;
font-size: 32rpx;
color: #3666FE;
text-align: center;
border-top: 2rpx solid #F5F6F7;
}
}
.close {
position: absolute;
top: 324rpx;
right: 96rpx;
width: 56rpx;
height: 56rpx;
}
\ No newline at end of file
<!--packageMine/pages/customerManagement/saleList/saleList.wxml-->
<view class="sale-list-page">
<view class="btn_box" bindtap="handlePopup">
<glsx-image src="index/apply.png" class="icon" />
<text>邀请加入</text>
</view>
<view class="content-box" wx:if="{{saleList.length}}">
<view class="title-box">
<view class="title">销售顾问:<text class="number">{{saleList.length}}</text></view>
</view>
<scroll-view scroll-y enable-back-to-top refresher-enabled="{{true}}" bindrefresherrefresh="handleSeach" class="list" style="height:calc(100vh - 148rpx - 110rpx);" refresher-threshold="104" refresher-triggered="{{triggered}}">
<view class="item-box" wx:for="{{saleList}}" wx:key="index">
<view class="top">
<view class="message">
<image wx:if="{{item.weChatAvatarUrl}}" src="{{item.weChatAvatarUrl}}" class="avatar" />
<glsx-image wx:else src="personal/staff_defalut_avatar.png" class="avatar" />
<view class="message-text">
<view class="merchant">{{item.employeeName || ''}}</view>
<view class="contact">{{item.phone}}</view>
</view>
</view>
<view wx:if="{{item.departmentName}}" class="department">
<glsx-image src="personal/icon-department.png" class="icon-department" />
<view>{{item.departmentName || ''}}</view>
</view>
</view>
<view class="bottom">
<view class="sale_name">
所属:{{item.merchantCustomerName}}
</view>
<view class="time">{{item.createdDate || ''}}</view>
</view>
</view>
<view class="bottomTips" wx:if="{{saleList.length>10}}">到底啦!</view>
</scroll-view>
</view>
<view wx:else>
<nothing-tips tips="暂无销售顾问~" bgColor="{{'#F2F3F7'}}" bg="{{bgUrl}}" />
</view>
</view>
<!-- 邀请 -->
<popup show="{{isPopupShow}}" title="请选择邀请方式" height="500rpx" bindconfirm="handlePopupConfirm" bindhidePopup="handlePopup">
<view class="popup-row {{popupVal == 'code' ? 'popup-active' : ''}}" data-val="code" bindtap="handlePopupChoose">二维码邀请</view>
<view class="popup-row {{popupVal == 'link' ? 'popup-active' : ''}}" data-val="link" bindtap="handlePopupChoose">链接邀请</view>
</popup>
<!-- 提示 -->
<view wx:if="{{isTipShow}}" class="layout">
<view class="bg" bindtap="handleShow" />
<view wx:if="{{popupVal == 'code'}}" class="content code">
<view class="img-box">
<image src="{{tipObj.qrcodeUrl}}" show-menu-by-longpress></image>
</view>
<view class="code-btn">
<glsx-image src="personal/icon-long-press.png" class="icon-long-press" />
长按图片转发
</view>
</view>
<view wx:if="{{popupVal == 'link'}}" class="content link">
<view class="title">提示</view>
<view class="link-content">
<view>已自动复制邀请链接至剪贴板,</view>
<view>请前往微信粘贴发送</view>
</view>
<view class="link-btn" bindtap="handleShow">确定</view>
</view>
<image wx:if="{{popupVal == 'code'}}" src="{{IMG_URL}}index/close.png" class="close" bindtap="handleShow"></image>
</view>
\ No newline at end of file
const formRule = {
technicianName: [{ required: true, message: '技师名称不能为空' }]
}
const formItems = [{
label: '技师',
props: 'technicianName',
type: 'input',
placeholder: '请输入技师的名称',
maxlength: 15
}]
export default {
formRule,
formItems
}
\ No newline at end of file
// packageMine/pages/customerManagement/technicianList/technicianList.js
import { IMG_URL } from '~/utils/constantData'
import mineServiceApi from '~/api/mineApi/mineService'
import constantData from './constant/data'
Page({
/**
* 页面的初始数据
*/
data: {
IMG_URL,
bgUrl: `${IMG_URL}/personal/empty_tran.png`,
technicianList: [],
total: -1,
pageCof: {
pageNum: 1,
pageSize: 10
},
formData: {
technicianName: ''
},
formItems: constantData.formItems,
targetIdx: '-1',
target: {},
targetIdx: {}
},
handleInput(e) {
let { attr } = e.currentTarget.dataset
let { value } = e.detail
this.setData({
['formData.' + attr]: value.replace(/(^\s*)|(\s*$)/g,"")
})
},
handleDialogShow() {
this.setData({
isDialogShow: !this.data.isDialogShow
})
},
addTech() {
this.handleDialogShow()
},
editTech() {
let { targetIdx } = this.data
this.setData({
[`technicianList[${targetIdx}].isEdit`]: !this.data.technicianList[targetIdx]?.isEdit
})
},
editClear() {
let { addOrEdit } = this.data
addOrEdit == 'add' ? this.addTech() : this.editTech()
this.setData({
targetIdx: '-1',
target: {},
formData: { technicianName: '' }
})
},
handleCancel() {
this.editClear()
},
handleConfirm() {
let { formData, target, customerInfo, addOrEdit } = this.data
let apiName = {
'add': 'addTechnician',
'edit': 'updateTechnician',
}
let params = {
...formData,
merchantId: customerInfo.merchantId,
merchantName: customerInfo.merchantName
}
let validObj = wx.$util.checkRule(formData, constantData.formRule)
if (validObj) {
wx.$api.showToast(validObj.message)
return
}
if (addOrEdit == 'edit') {
if (target.technicianName == formData.technicianName) {
this.editClear()
return true
}
params.id = target.id
}
wx.$api.showLoading('加载中...')
mineServiceApi[apiName[addOrEdit]](params).then(res => {
let { code, data, message } = res
if (code == '0') {
wx.hideLoading()
wx.$api.showToast(addOrEdit == 'add' ? '新增成功' : '修改成功')
this.editClear()
this.handleSearch(true)
} else {
wx.$api.showToast(message)
if (addOrEdit == 'edit') {
this.editClear()
this.handleSearch(true)
}
}
})
},
handleEdit(e) {
let { type, target, idx } = e.currentTarget.dataset
this.setData({
addOrEdit: type,
target: e.currentTarget.dataset?.target || {},
targetIdx: idx || 0
})
switch (type) {
case 'add':
this.addTech()
break
case 'edit':
this.setData({
['formData.technicianName']: target.technicianName
})
this.editTech(target)
break
}
},
handleDelete(e) {
let { target } = e.currentTarget.dataset
let params = {
id: target.id
}
let _this = this
wx.showModal({
title: '删除',
content: '确认删除' + target.technicianName + '技师吗?',
confirmText: '确定',
cancelText: '取消',
confirmColor: '#3666FE',
success(res) {
if (res.confirm) {
wx.$api.showLoading('加载中...')
mineServiceApi.deleteTechnician(params).then(res => {
let { code, data, message } = res
if (code == '0') {
wx.hideLoading()
wx.$api.showToast('删除成功')
_this.handleSearch(true)
} else {
wx.$api.showToast(message)
}
})
}
}
})
},
handleSearch() {
this.setData({
['pageCof.pageNum']: 1,
total: -1
})
this.getList(true)
},
scrollonReachBottom() {
this.getList()
},
getList(isReset = false) {
let { technicianList, pageCof, total, customerInfo } = this.data
let params = {
...pageCof,
merchantId: customerInfo.merchantId
}
mineServiceApi.getTechnicianList(params).then(res => {
let { list, total } = res
this.setData({
technicianList: pageCof.pageNum == 1 ? (list || []) : technicianList.concat(list),
['pageCof.pageNum']: pageCof.pageNum + 1,
triggered: false,
total
})
if (isReset) {
this.setData({
scrollTop: 0
})
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
wx.$router.getData(res => {
this.setData({
customerInfo: res
})
this.getList(true)
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"navigationBarTitleText": "查看技师",
"usingComponents": {}
}
\ No newline at end of file
/* packageMine/pages/customerManagement/technicianList/technicianList.wxss */
.technician-list-page {
width: 100%;
box-sizing: border-box;
padding: 20rpx;
background-color: #F2F3F7;
.btn_box {
width: 100%;
height: 96rpx;
display: flex;
justify-content: center;
align-items: center;
background-color: #FFFFFF;
border-radius: 16rpx;
color: var(--btnColor);
font-size: 28rpx;
font-weight: 600;
margin-bottom: 32rpx;
.icon {
width: 40rpx;
height: 40rpx;
margin-right: 16rpx;
vertical-align: -12rpx
}
}
.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)
}
}
}
.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;
align-items: center;
.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;
}
}
.icon-edit {
width: 36rpx;
height: 36rpx;
margin-left: 4rpx;
}
}
.delete {
font-size: 24rpx;
color: #3666FE;
}
}
.bottom {
padding: 0 32rpx;
height: 72rpx;
background-color: #FFF9F2;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 24rpx;
color: #8A8C90;
.technician_name {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
.bottomTips {
text-align: center;
color: #393b3e;
font-size: 26rpx;
height: 60rpx;
line-height: 40rpx;
}
}
// 弹窗
// 提示
.layout {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100vw;
height: 100vh;
z-index: 998;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.bg {
position: absolute;
width: 100%;
height: 100%;
z-index: -1;
background: rgba(0, 0, 0, .8);
}
.content {
position: relative;
text-align: center;
box-sizing: border-box;
width: 614rpx;
height: 440rpx;
background: #FFFFFF;
border-radius: 32rpx;
.form {
margin: 64rpx 40rpx;
text-align: left;
.input {
width: 534rpx;
height: 88rpx;
background: #F8F9FC;
border-radius: 12rpx;
padding-left: 32rpx;
}
.input-placeholder {
font-size: 28rpx;
color: #858A94;
}
}
.title {
height: 110rpx;
line-height: 110rpx;
text-align: center;
font-weight: 600;
font-size: 32rpx;
color: #323436;
border-bottom: 2rpx solid #F5F6F7;
}
.dialog-btn {
position: absolute;
display: flex;
bottom: 0;
left: 0;
width: 100%;
height: 110rpx;
line-height: 110rpx;
border-top: 2rpx solid #F5F6F7;
font-size: 32rpx;
color: #6C737A;
.cancel-btn {
width: 50%;
}
.default-btn {
width: 50%;
color: #3666FE;
border-left: 2rpx solid #F5F6F7;
}
}
}
.close {
position: absolute;
top: 324rpx;
right: 96rpx;
width: 56rpx;
height: 56rpx;
}
\ No newline at end of file
<!--packageMine/pages/customerManagement/technicianList/technicianList.wxml-->
<view class="technician-list-page">
<view class="btn_box" bindtap="handleEdit" data-type="add">
<glsx-image src="index/apply.png" class="icon" />
<text>新增技师</text>
</view>
<view class="content-box" wx:if="{{technicianList.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="{{technicianList}}" wx:key="index">
<view class="top">
<view class="message">
<glsx-image src="personal/tech_defalut_avatar.png" class="avatar" />
<view class="message-text">
<input wx:if="{{item.isEdit}}" type="text" placeholder="{{formItems[0].placeholder}}" maxlength="{{formItems[0].maxlength}}" class="input" value="{{formData.technicianName}}" focus="{{item.isEdit}}" placeholder-class="input-placeholder" data-attr="{{formItems[0].props}}" confirm-type="done" bindinput="handleInput" bindblur="handleConfirm" />
<view wx:else class="merchant">{{item.technicianName}}</view>
</view>
<glsx-image wx:if="{{!item.isEdit}}" src="personal/icon-edit.png" class="icon-edit" bindtap="handleEdit" data-type="edit" data-target="{{item}}" data-idx="{{index}}" />
</view>
<view class="delete" bindtap="handleDelete" data-target="{{item}}">删除</view>
</view>
<view class="bottom">
<view class="technician_name">
所属:{{item.merchantName}}
</view>
<view class="time">{{item.createdDate}}</view>
</view>
</view>
<view class="bottomTips" wx:if="{{technicianList.length == total}}">到底啦!</view>
</scroll-view>
</view>
<view wx:else>
<nothing-tips tips="暂无技师~" bgColor="{{'#F2F3F7'}}" bg="{{bgUrl}}" />
</view>
</view>
<!-- 新增技师 -->
<view wx:if="{{isDialogShow}}" class="layout">
<view class="bg" bindtap="handleDialogShow" />
<view class="content">
<view class="title">新增技师</view>
<view class="form" wx:for="{{formItems}}" wx:key="index">
<input type="text" placeholder="{{item.placeholder || '请输入' + item.label}}" maxlength="{{item.maxlength}}" class="input" value="{{formData[item.props]}}" type="{{item.inputType || 'text'}}" password="{{item.password}}" placeholder-class="input-placeholder" data-attr="{{item.props}}" bindinput="handleInput" />
</view>
<view class="dialog-btn">
<view class="cancel-btn" bindtap="handleCancel">取消</view>
<view class="default-btn" bindtap="handleConfirm">确定</view>
</view>
</view>
</view>
\ No newline at end of file
{
"component": true,
"usingComponents": {
"msg-box": "../components/msgBox/msgBox",
"tab": "../components/Tab/Tab"
"msg-box": "../../components/msgBox/msgBox",
"tab": "../../components/Tab/Tab"
},
"navigationStyle": "custom"
}
const phoneRex = /^[1]([3-9])[0-9]{9}$/
const formRule = {
merchantName: [{ required: true, message: '服务中心名称不能为空' }],
contactName: [{ required: true, message: '联系人不能为空' }],
phone: [
{ required: true, message: '联系电话不能为空' },
{
validator: (rule, value) => {
return !phoneRex.test(value) ? { message: '请输入正确的手机号' } : null
}
}
],
password: [
{ required: true, message: '登录密码不能为空' },
{
validator: (rule, value) => {
return /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,12}$/.test(value) ? null : { message: '登陆密码请输入6-20位数字和字母组合' }
}
}
],
}
var formItems = [{
label: '商户号',
props: 'merchantId',
type: 'input',
disabled: true
}, {
label: '服务中心名称',
props: 'merchantName',
type: 'input',
maxlength: 50
}, {
label: '联系人',
props: 'contactName',
type: 'input',
placeholder: '请输入联系人姓名',
maxlength: 10
}, {
label: '联系电话',
tips: '(登录凭证)',
props: 'phone',
type: 'input',
inputType: 'number',
placeholder: '请输入手机号码',
maxlength: 11
}, {
label: '登录密码',
tips: '(可用于PC端登录)',
props: 'password',
type: 'input',
password: true,
showPwd: false,
placeholder: '请输入登录密码(6-20位字母+数字)',
maxlength: 20
}]
export default {
formRule,
formItems
}
\ No newline at end of file
// packageMine/pages/serviceManage/editService/editService.js
import constantData from './constant/data'
import mineServiceApi from '~/api/mineApi/mineService'
Page({
/**
* 页面的初始数据
*/
data: {
addOrEdit: '',
formData: {},
formItems: constantData.formItems,
apiNameObj: {
'add': 'saveService',
'edit': 'updateService'
},
isConfirm: false
},
handleInput(e) {
let { attr } = e.currentTarget.dataset
let { value } = e.detail
this.setData({
['formData.' + attr]: value
})
},
handlePwdSwitch(e) {
let { idx } = e.currentTarget.dataset
this.setData({
['formItems[' + idx + '].showPwd']: !this.data.formItems[idx].showPwd
})
},
// 密码清空
handlePwdClear(e) {
let { attr } = e.currentTarget.dataset
this.setData({
['formData.' + attr]: ''
})
},
handleConfirm() {
let { userInfo } = wx.$storage.get()
let { apiNameObj, addOrEdit, formData, isConfirm } = this.data
let _this = this
if (isConfirm) {
return true
}
let validObj = wx.$util.checkRule(formData, constantData.formRule)
if (validObj) {
wx.$api.showToast(validObj.message)
return
}
let message = addOrEdit == 'add' ? '是否确定创建服务中心?' : '是否确定修改服务中心信息?'
wx.showModal({
title: '提示',
content: message,
confirmText: '确定',
cancelText: '取消',
confirmColor: '#3666FE',
success(res) {
if (res.confirm) {
_this.setData({
isConfirm: true
})
wx.$api.showLoading('加载中...')
// 创建/编辑接口
mineServiceApi[apiNameObj[addOrEdit]]({
...formData,
serviceMerchantName: userInfo.merchantName
}).then(res => {
let { code, message } = res
wx.hideLoading()
if (code == '0') {
if (addOrEdit == 'add') {
wx.$router.redirectTo('packageMine.successPage?page=service')
} else {
wx.$api.showToast('修改成功')
setTimeout(() => {
wx.$router.back()
}, 1000)
}
} else {
wx.$api.showToast(message)
}
}).finally(() => {
_this.setData({
isConfirm: false
})
})
}
}
})
},
dealFormItem() {
let { formItems } = this.data
if (this.data.addOrEdit == 'add') {
formItems.shift()
this.setData({
formItems
})
} else {
wx.setNavigationBarTitle({ title: '编辑服务中心' })
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (options?.isRedirect) {
this.setData({
addOrEdit: options?.addOrEdit || 'add'
})
this.dealFormItem()
return true
}
wx.$router.getData(res => {
let { addOrEdit, target } = res
this.setData({
addOrEdit: addOrEdit || 'add',
formData: {
...target,
oldPhone: target.phone || '',
oldMerchantName: target.merchantName || ''
}
})
this.dealFormItem()
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"navigationBarTitleText": "创建服务中心",
"usingComponents": {
"input-icon": "/login/index/components/InputIcon/InputIcon"
}
}
\ No newline at end of file
/* packageMine/pages/serviceManage/editService/editService.wxss */
.create-service-page {
margin: 20rpx;
.tips {
padding: 12rpx;
color: #323436;
font-size: 28rpx;
font-weight: 600;
}
.form-content {
background: #FFFFFF;
border-radius: 16rpx;
padding: 44rpx 40rpx;
.label {
font-size: 28rpx;
font-weight: 600;
color: #323436;
margin-bottom: 12rpx;
.tips {
font-size: 24rpx;
font-weight: 400;
color: #F35251;
}
}
.input-box,
.select-box {
height: 40rpx;
background: #F8F9FC;
border-radius: 12rpx;
padding: 32rpx 24rpx;
margin-bottom: 16rpx;
color: #323436;
}
.input-box {
display: flex;
align-items: center;
}
.input {
flex: 1;
}
.input-icon-box {
display: flex;
}
.disabled {
background: #E1E2E6;
}
.select-box {
display: flex;
justify-content: space-between;
.arrow_right {
width: 36rpx;
height: 36rpx;
}
.name {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
.btn {
position: fixed;
bottom: 16rpx;
left: 0;
width: calc(100% - 64rpx);
height: 88rpx;
line-height: 88rpx;
text-align: center;
font-size: 28rpx;
color: #FFFFFF;
margin: 0 32rpx;
}
.btn-blue {
background: var(--btnColor);
border-radius: 8rpx;
}
}
\ No newline at end of file
<!--packageMine/pages/serviceManage/editService/editService.wxml-->
<!-- <navigation-bar bindnavbarReady="navbarReady" showBack="{{true}}" bindback="back" customBack="{{true}}">
{{!showServiceConfirm ? (addOrEdit == 'add' ? '创建员工' : '编辑员工') : '选择服务中心'}}
</navigation-bar> -->
<view class="create-service-page" style="padding-top:{{tabBarStyle}}px;">
<view class="tips" wx:if="{{addOrEdit == 'add'}}">请完善服务中心资料完成创建:</view>
<view class="form-content">
<block wx:for="{{formItems}}" wx:key="index">
<view class="label">{{item.label}}<text class="tips">{{item.tips}}</text></view>
<view class="input-box {{item.disabled ? 'disabled' : ''}}" wx:if="{{item.type == 'input'}}">
<input placeholder="{{item.placeholder || '请输入' + item.label}}" maxlength="{{item.maxlength}}" class="input" value="{{formData[item.props]}}" password="{{item.password && !item.showPwd}}" disabled="{{item.disabled}}" placeholder-class="input-placeholder" data-attr="{{item.props}}" bindinput="handleInput" />
<view wx:if="{{item.password}}" class="input-icon-box">
<input-icon show bindtap="handlePwdSwitch" type="{{item.showPwd?'showPwd':'hidePwd'}}" data-idx="{{index}}" />
<input-icon show="{{formData.password}}" bindtap="handlePwdClear" data-attr="{{item.props}}" />
</view>
</view>
<view class="select-box" wx:if="{{item.type == 'select'}}" bindtap="jump" data-type="{{item.pageType}}">
<view class="name" wx:if="{{formData[item.valueFn]}}">{{formData[item.valueFn]}}</view>
<view class="placeholder-text" wx:else>{{item.placeholder}}</view>
<glsx-image src="personal/arrow_right.png" class="arrow_right" />
</view>
</block>
</view>
<view class="isFullSucreen btn">
<view class="btn-blue" bindtap="handleConfirm">{{addOrEdit == 'add' ? '提交' : '保存'}}</view>
</view>
</view>
\ No newline at end of file
// packagesList/mineDetail/pages/serviceManage/serviceList/serviceList.js
import { IMG_URL } from '~/utils/constantData'
import mineServiceApi from '~/api/mineApi/mineService'
Page({
/**
* 页面的初始数据
*/
data: {
IMG_URL,
bgUrl: `${IMG_URL}/personal/empty_tran.png`,
serviceList: [],
total: -1,
pageCof: {
pageNum: 1,
pageSize: 10
},
isAsk: false
},
handleEdit(e) {
let { type } = e.currentTarget.dataset
let params = {
addOrEdit: type,
target: e.currentTarget.dataset?.target || {}
}
delete params.target?.createdDate
wx.$router.go('packageMine.editService', params)
},
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
})
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.handleSearch()
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"navigationBarTitleText": "服务中心管理",
"usingComponents": {}
}
\ No newline at end of file
/* packagesList/mineDetail/pages/serviceManage/serviceList/serviceList.wxss */
.service-list-page {
width: 100%;
box-sizing: border-box;
padding: 20rpx;
background-color: #F2F3F7;
.btn_box {
width: 100%;
height: 96rpx;
display: flex;
justify-content: center;
align-items: center;
background-color: #FFFFFF;
border-radius: 16rpx;
color: var(--btnColor);
font-size: 28rpx;
font-weight: 600;
margin-bottom: 32rpx;
.icon {
width: 40rpx;
height: 40rpx;
margin-right: 16rpx;
vertical-align: -12rpx
}
}
.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)
}
}
// .select-btn {
// box-sizing: border-box;
// padding: 16rpx 0;
// display: flex;
// align-items: center;
// z-index: 2;
// background-color: #f2f3f7;
// .type {
// margin-left: 8px;
// display: flex;
// justify-content: center;
// align-items: center;
// padding: 0 16rpx;
// height: 24px;
// line-height: 24px;
// background: #ffffff;
// border-radius: 14px;
// font-size: 12px;
// color: #8a8c90;
// text {
// max-width: 360rpx;
// overflow: hidden;
// text-overflow: ellipsis;
// white-space: nowrap;
// }
// .point {
// margin-left: 2px;
// width: 12px;
// height: 12px;
// }
// }
// }
}
.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;
}
}
}
.arrow_right {
width: 36rpx;
height: 36rpx;
}
}
.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
<!--packagesList/mineDetail/pages/serviceManage/serviceList/serviceList.wxml-->
<view class="service-list-page">
<view class="btn_box" bindtap="handleEdit" data-type="add">
<glsx-image src="index/apply.png" class="icon" />
<text>创建新的服务中心</text>
</view>
<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>
<glsx-image src="personal/arrow_right.png" class="arrow_right" />
</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 tips="暂无服务中心~" bgColor="{{'#F2F3F7'}}" bg="{{bgUrl}}" />
</view>
</view>
\ No newline at end of file
const phoneRex = /^[1]([3-9])[0-9]{9}$/
const formRule = {
selectInfo: [{ required: true, message: '所属服务中心不能为空' }],
staffName: [{ required: true, message: '员工姓名不能为空' }],
staffPhone: [
{ required: true, message: '手机号码不能为空' },
{
validator: (rule, value) => {
return !phoneRex.test(value) ? { message: '请输入正确的手机号' } : null
}
}
]
}
const formItems = [{
label: '所属服务中心',
props: 'selectInfo',
valueFn: 'serviceValue',
type: 'select',
placeholder: '请选择服务中心',
pageType: 1
}, {
label: '员工姓名',
props: 'staffName',
type: 'input',
placeholder: '请输入员工姓名',
maxLength: 20
}, {
label: '手机号码',
tips: '(登录凭证)',
props: 'staffPhone',
type: 'input',
inputType: 'number',
placeholder: '请输入手机号码',
maxLength: 11
}, {
label: '可见客户',
props: 'connectionIds',
type: 'select',
valueFn: 'connectionValue',
placeholder: '请选择可见客户',
pageType: 2
}]
export default {
formRule,
formItems
}
// packagesList/mineDetail/pages/staffManage/createStaff/createStaff.js
import constantData from './constant/data'
import { behavior as computedBehavior } from "~/utils/lib/miniprogram-computed"
import mineApi from '~/api/mineApi/index'
import Util from '~/utils/util'
import { getUserInfo } from '~/utils/cache/userInfo'
Page({
behaviors: [computedBehavior],
/**
* 页面的初始数据
*/
data: {
addOrEdit: 'add',
serviceList: [],
formItems: constantData.formItems,
formData: {
selectedConnectionIds: [],
connectionValue: '全部',
visualType: 0
},
showServiceConfirm: false,
isConfirm: false
},
watch: {
'formData.selectInfo.yqMerchantId': function (e) {
// 获取当前服务中心下的客户列表
this.getConnectionList(e)
let { optionsInfo } = this.data
if (e == optionsInfo?.merchantNo) return
// 将可见客户置为全部
this.setData({
'formData.connectionValue': '全部',
'formData.selectedConnectionIds': []
})
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// 获取服务中心/客户数据
this.getSelectList()
},
onRoute(options) {
// 选择可见客户回退
if (!options.info) return
let optionsInfo = options?.info || {}
let data = options?.info ? {
...options?.info,
selectInfo: {yqMerchantId: optionsInfo.merchantNo, yqMerchantName: optionsInfo.merchantName},
serviceValue: optionsInfo.merchantName,
visualType: optionsInfo.visualType || 0,
connectionValue: optionsInfo.visualType == 1 ? `已选${optionsInfo.visibleMerchantNo?.split(',')?.length}位客户`: '全部',
selectedConnectionIds: optionsInfo.visualType == 1 ? optionsInfo.visibleMerchantNo?.split(',').map((v) => {return v && Number(v)}) : []
} : {}
this.setData({
addOrEdit: options?.info ? 'edit' : 'add',
'formItems[0].disabled': options?.info ? true : false,
formData: data,
optionsInfo: Util.deepClone(optionsInfo)
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
navbarReady(e) {
let { height, statusBarHeight } = e.detail
this.setData({
tabBarStyle: height / 2 + statusBarHeight
})
},
// 获取服务中心下的客户列表
getConnectionList(e) {
mineApi.getConnectionListByServiceAPI({
serviceCenterMerchantId: e
}).then(res => {
// 全部客户
let { allConnectionIds, copyFormData } = this.data
allConnectionIds = res?.map(val => {return val.merchantId})
this.setData({
allConnectionIds
})
})
},
getSelectList() {
// 获取服务中心
mineApi.getServiceCenterListAPI({}).then(res => {
let data = res || []
this.setData({
serviceList: data
})
})
},
back() {
let { showServiceConfirm } = this.data
if (showServiceConfirm){
this.setData({
showServiceConfirm: false
})
} else wx.$router.back()
},
// 选择服务中心/客户
jump(e) {
let { formData } = this.data
let { type, disabled } = e.currentTarget.dataset
if (disabled) return
switch(type) {
// 选择服务中心
case 1:
this.hiddenSelectConfirm()
break
case 2:
if (!formData.selectInfo) return wx.$api.showToast('请先选择所属服务中心')
wx.$router.go('packageMine.selectConnectionPage', this.data.formData)
break
}
},
hiddenSelectConfirm(e) {
let selectInfo = e?.detail
this.setData({ showServiceConfirm: !this.data.showServiceConfirm })
if (!selectInfo) return
this.setData({
'formData.selectInfo': selectInfo,
'formData.serviceValue': selectInfo?.yqMerchantName
})
},
input(e) {
const { value } = e.detail,
{ name } = e.currentTarget.dataset
this.setData({
[`formData.${name}`]: value
})
},
// 提交
handleConfirm() {
let _this = this
let { addOrEdit, formData, allConnectionIds, isConfirm } = _this.data
if (isConfirm) {
return true
}
let validObj = wx.$util.checkRule(formData, constantData.formRule)
if (validObj) {
wx.$api.showToast(validObj.message)
return
}
let userInfo = getUserInfo()
let params = {
merchantNo: formData?.selectInfo?.yqMerchantId,
merchantName: userInfo?.merchantName,
staffUuid: formData?.staffUuid,
staffName: formData?.staffName,
staffPhone: formData?.staffPhone,
createdSource: 3, // 创建来源 固定3 生意助手
visualType: formData?.visualType,
visibleMerchantNoList: formData?.visualType == 0 ? allConnectionIds : formData?.selectedConnectionIds
}
let message = addOrEdit == 'add' ? '是否确定创建员工?' : '是否确定修改员工信息?'
wx.showModal({
title: '提示',
content: message,
confirmText: '确定',
cancelText: '取消',
confirmColor: '#3666FE',
success(res) {
if (res.confirm) {
_this.setData({
isConfirm: true
})
// 创建/编辑接口
let requestEvent = addOrEdit == 'add' ? 'createStaffAPI' : 'updateStaffAPI'
mineApi[requestEvent](params).then(res => {
if (addOrEdit == 'add') {
wx.$router.redirectTo('packageMine.successPage?page=staff')
} else {
wx.$router.back()
}
}).catch(err => {
_this.setData({
isConfirm: false
})
})
}
}
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"usingComponents": {
"select-service-confirm": "../../../components/selectServiceConfirm/selectServiceConfirm"
},
"navigationStyle": "custom"
}
\ No newline at end of file
/* packagesList/mineDetail/pages/staffManage/createStaff/createStaff.wxss */
.create-staff-page{
margin: 20rpx;
.tips{
padding: 12rpx;
color: #323436;
font-size: 28rpx;
font-weight: 600;
}
.form-content{
background: #FFFFFF;
border-radius: 16rpx;
padding: 44rpx 40rpx;
.label{
font-size: 28rpx;
font-weight: 600;
color: #323436;
margin-bottom: 12rpx;
.tips{
font-size: 24rpx;
font-weight: 400;
color: #F35251;
}
}
.input-box,.select-box{
height: 40rpx;
background: #F8F9FC;
border-radius: 12rpx;
padding: 32rpx 24rpx;
margin-bottom: 16rpx;
color: #323436;
}
.select-box{
display: flex;
justify-content: space-between;
.arrow_right{
width: 36rpx;
height: 36rpx;
}
.name{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
.btn {
position: fixed;
bottom: 16rpx;
left: 0;
width: calc(100% - 64rpx);
height: 88rpx;
line-height: 88rpx;
text-align: center;
font-size: 28rpx;
color: #FFFFFF;
margin: 0 32rpx;
}
.btn-blue {
background: var(--btnColor);
border-radius: 8rpx;
}
}
\ No newline at end of file
<!--packagesList/mineDetail/pages/staffManage/createStaff/createStaff.wxml-->
<navigation-bar bindnavbarReady="navbarReady" showBack="{{true}}" bindback="back" customBack="{{true}}">
{{!showServiceConfirm ? (addOrEdit == 'add' ? '创建员工' : '编辑员工') : '选择服务中心'}}
</navigation-bar>
<view class="create-staff-page" style="padding-top:{{tabBarStyle}}px;">
<view class="tips" wx:if="{{addOrEdit == 'add'}}">请完善员工资料完成创建:</view>
<view class="form-content">
<block wx:for="{{formItems}}" wx:key="index">
<view class="label">{{item.label}}<text class="tips">{{item.tips}}</text></view>
<view class="input-box" wx:if="{{item.type == 'input'}}">
<input
type="{{item.inputType || 'text'}}"
placeholder="{{item.placeholder}}"
class="input"
bindinput="input"
data-name="{{item.props}}"
maxlength="{{item.maxLength}}"
value="{{formData[item.props]}}"
placeholder-class="input-placeholder" />
</view>
<view class="select-box" style="background-color: {{item.disabled ? '#E1E2E6' : ''}}" wx:if="{{item.type == 'select'}}" bindtap="jump" data-type="{{item.pageType}}" data-disabled="{{item.disabled}}">
<view class="name" wx:if="{{formData[item.valueFn]}}">{{formData[item.valueFn]}}</view>
<view class="placeholder-text" wx:else>{{item.placeholder}}</view>
<glsx-image src="personal/arrow_right.png" class="arrow_right" />
</view>
</block>
</view>
<view class="isFullSucreen btn">
<view class="btn-blue" bindtap="handleConfirm">{{addOrEdit == 'add' ? '提交' : '保存'}}</view>
</view>
</view>
<select-service-confirm show="{{showServiceConfirm}}" tabBarStyle="{{tabBarStyle}}" serviceList="{{serviceList}}" selectInfo="{{formData.selectInfo}}" bind:hiddenSelectConfirm="hiddenSelectConfirm"></select-service-confirm>
var formatMobile = function (item) {
return item ? item.substring(0,3)+" " + item.substring(3,7) +" "+item.substring(7) : ' '
}
module.exports = {
formatMobile: formatMobile
}
\ No newline at end of file
// packagesList/mineDetail/pages/staffManage/selectConnectionPage/selectConnectionPage.js
import mineApi from '~/api/mineApi/index'
Page({
/**
* 页面的初始数据
*/
data: {
showConnectionConfirm: false,
connectionList: [],
selectTypeList: [{
label: '全部',
tips: '所有客户可见',
type: 0,
active: false
}, {
label: '指定客户可见',
type: 1,
active: false
}],
showConnectionList: false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
onRoute(options) {
let { selectTypeList } = this.data
selectTypeList.map(v => {
// 未指定可见客户
if (options?.visualType == v.type) {
v.active = true
if (v.type == 1) this.setData({
showConnectionList: true
})
}
return v
})
this.setData({selectTypeList})
// 获取服务中心下的客户数据
this.getConnectionList(options)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
navbarReady(e) {
let { height, statusBarHeight } = e.detail
this.setData({
tabBarStyle: height / 2 + statusBarHeight
})
},
getConnectionList(options) {
mineApi.getConnectionListByServiceAPI({
serviceCenterMerchantId: options?.selectInfo?.yqMerchantId
}).then(res => {
this.setData({
connectionList: res || [],
selectedConnectionList: res?.filter(val => { return options?.selectedConnectionIds.length && options.selectedConnectionIds.includes(val.merchantId) }) || []
})
})
},
changeType(e) {
let { type } = e.currentTarget.dataset
let { selectTypeList, showConnectionList } = this.data
selectTypeList.forEach((v, ind) => {
if (type == v.type && v.active) return showConnectionList = !showConnectionList
if (type == v.type && !v.active) {
v.active = true
if (type == 1) showConnectionList = true
else showConnectionList = false
}
else v.active = false
})
this.setData({
selectTypeList,
showConnectionList
})
},
// 显示选择指定客户
showConfirm() {
let { showConnectionConfirm } = this.data
this.setData({
showConnectionConfirm: !showConnectionConfirm
})
},
// 选择指定客户确定
selectConfirm(e) {
let selectedConnectionList = e?.detail || []
this.setData({
selectedConnectionList,
showConnectionConfirm: false
})
},
// 确定
handleConfirm() {
let { selectTypeList, selectedConnectionList } = this.data
let arr = selectTypeList.filter(v => v.active) || []
if (!arr.length || (arr.find(v => v.active && v.type == 1) && !selectedConnectionList?.length)) return wx.showToast({
title: '请选择可见客户',
icon: 'none',
duration: 2000
})
const currentPages = getCurrentPages()
let prevPage = currentPages[currentPages.length - 2]
prevPage.setData({
'formData.connectionValue': arr.find(v => v.active)?.type == 0 ? '全部' : `已选择${selectedConnectionList?.length}位客户`,
'formData.selectedConnectionIds': selectedConnectionList.map(val => { return val.merchantId }),
'formData.visualType': arr.find(v => v.active)?.type || 0
})
this.back()
},
// 返回
back() {
let { showConnectionConfirm } = this.data
if (showConnectionConfirm){
this.setData({
showConnectionConfirm: false
})
} else wx.$router.back()
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"usingComponents": {
"select-connection-confirm": "../../../components/selectConnectionConfirm/selectConnectionConfirm"
},
"navigationStyle": "custom"
}
\ No newline at end of file
/* packagesList/mineDetail/pages/staffManage/selectConnectionPage/selectConnectionPage.wxss */
.select-connection-page{
.select-content{
background-color: #FFFFFF;
padding-left: 48rpx;
.flex_class{
display: flex;
align-items: center;
.flex1{
flex: 1;
}
.checked_class{
flex-shrink: 0;
width: 40rpx;
height: 40rpx;
margin-right: 28rpx;
}
.label{
display: flex;
align-items: center;
justify-content: space-between;
font-size: 28rpx;
color: #323436;
margin-top: 30rpx;
.arrow_up{
width: 36rpx;
height: 36rpx;
transform: rotate(45deg);
transition: all 0.5s;
margin-right: 32rpx;
}
.arrow_down{
transform: rotate(135deg);
transition: all 0.5s;
}
}
.lable_border{
margin-top: 0;
height: 88rpx;
border-top: 1rpx solid #F5F5F5;
border-bottom: 1rpx solid #F5F5F5;
}
.tips{
font-size: 26rpx;
color: #858A94;
margin: 10rpx 0 30rpx 0;
}
}
.connection_box{
padding: 0 40rpx 0 68rpx;
.select_btn{
color: #5C7097;
font-size: 26rpx;
height: 88rpx;
line-height: 88rpx;
}
.list-items{
padding-bottom: 28rpx;
display: flex;
align-items: center;
flex-flow: wrap;
gap: 12rpx;
.item{
height: 54rpx;
line-height: 54rpx;
background: #F0F7FF;
border-radius: 8rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
padding: 0 20rpx;
}
}
}
}
.btn {
position: fixed;
bottom: 16rpx;
left: 0;
width: calc(100% - 64rpx);
height: 196rpx;
line-height: 88rpx;
text-align: center;
font-size: 28rpx;
color: #FFFFFF;
margin: 0 32rpx;
}
.btn-blue {
background: var(--btnColor);
border-radius: 8rpx;
}
.btn-cancel{
background-color: #FFFFFF;
color: var(--btnColor);
margin-top: 20rpx;
border-radius: 8rpx;
}
}
<!--packagesList/mineDetail/pages/staffManage/selectConnectionPage/selectConnectionPage.wxml-->
<navigation-bar bindnavbarReady="navbarReady" showBack="{{true}}" bindback="back" customBack="{{true}}">
{{!showConnectionConfirm ? '可见客户' : '选择客户'}}
</navigation-bar>
<view class="select-connection-page" style="padding-top:{{tabBarStyle}}px;">
<view class="select-content">
<view class="flex_class" wx:for="{{selectTypeList}}" wx:key="index" bindtap="changeType" data-type="{{item.type}}">
<view class="checked_class">
<view hidden="{{!item.active}}">
<glsx-image src="personal/checked.png" class="checked_class" />
</view>
</view>
<view class="flex1">
<view class="label {{item.type == 1?'lable_border':''}}">{{item.label}}<glsx-image wx:if="{{item.type == 1}}" src="personal/arrow_right.png" class="arrow_up {{showConnectionList ? 'arrow_down' : ''}}" /></view>
<view class="tips" wx:if="{{item.tips}}">{{item.tips}}</view>
</view>
</view>
<view class="connection_box" hidden="{{!showConnectionList}}">
<view class="select_btn" bindtap="showConfirm">请选择指定客户</view>
<view class="list-items" wx:if="{{selectedConnectionList.length}}">
<view class="item" wx:for="{{selectedConnectionList}}" wx:key="index">{{item.merchantName}}</view>
</view>
</view>
</view>
<view class="isFullSucreen btn">
<view class="btn-blue" bindtap="handleConfirm">确定</view>
<view class="btn-cancel" bindtap="handleConfirm" bindtap="back">取消</view>
</view>
</view>
<select-connection-confirm show="{{showConnectionConfirm}}" selectedConnectionList="{{selectedConnectionList || []}}" bind:selectConfirm="selectConfirm" connectionList="{{connectionList}}" tabBarStyle="{{tabBarStyle}}"></select-connection-confirm>
// packagesList/mineDetail/pages/staffManage/staffManage.js
import { IMG_URL } from '~/utils/constantData'
import mineApi from '~/api/mineApi/index'
Page({
/**
* 页面的初始数据
*/
data: {
IMG_URL,
bgUrl: `${IMG_URL}/personal/empty_tran.png`,
popupShow: false,
staffList: [],
selectInfo: { yqMerchantName: '全部服务中心' },
total: 0,
serviceList: [],
currentPage: 1,
allServiceIds: [],
nothing: false,
scrollTop: 0,
isAsk: false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
// 获取服务中心数据
mineApi.getServiceCenterListAPI({}).then(res => {
let data = res || []
let serviceIds = data.map(val => { return val.yqMerchantId })
this.setData({
serviceList: res || [],
allServiceIds: serviceIds,
currentPage: 1,
nothing: false,
total: 0
})
// 获取员工列表
this.getList(true)
})
},
getList(isReset = false) {
let { currentPage, selectInfo, allServiceIds, nothing, isAsk } = this.data
let _this = this
let params = {
pageSize: 10,
pageNum: currentPage,
merchantNoList: selectInfo?.yqMerchantId ? [selectInfo?.yqMerchantId] : allServiceIds
}
if (nothing || isAsk) {
return
}
this.setData({
isAsk: true
})
mineApi.getStaffListAPI(params).then(res => {
let tempList = isReset ? res?.list || [] : this.data.staffList.concat(res?.list || [])
this.setData({
staffList: tempList,
currentPage: currentPage + 1,
total: res.total,
nothing: res.total == tempList.length,
triggered: false
})
if (isReset) {
this.setData({
scrollTop: 0
})
}
}).finally(function () {
_this.setData({
isAsk: false
})
})
},
onBottomRefresh() {
this.getList()
},
search() {
this.setData({
currentPage: 1,
nothing: false,
total: 0
})
this.getList(true)
},
// 筛选服务中心
filterTypeFn() {
this.setData({
popupShow: !this.data.popupShow
})
},
// 获取员工列表
getStaffList(e) {
wx.$api.hideLoading()
this.setData({
selectInfo: e.detail,
nothing: false,
currentPage: 1
})
this.getList(true)
},
// 创建/编辑员工
jump(e) {
// 校验是否有配置服务中心
if (!this.data.serviceList.length) {
return wx.showModal({
title: '提示',
content: '您尚无服务中心,请先创建服务中心',
confirmText: '去创建',
cancelText: '取消',
confirmColor: '#3666FE',
success(res) {
if (res.confirm) {
wx.$router.redirectTo('packageMine.editService')
}
}
})
}
let dataset = e.currentTarget.dataset
wx.$router.go('packageMine.createStaff', dataset)
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"navigationBarTitleText": "员工管理",
"usingComponents": {
"select-service-popup": "../../../components/selectServicePopup/selectServicePopup"
}
}
\ No newline at end of file
/* packagesList/mineDetail/pages/staffManage/staffManage.wxss */
.staff-list-page{
width: 100%;
box-sizing: border-box;
padding: 20rpx;
background-color: #F2F3F7;
.btn_box{
width: 100%;
height: 96rpx;
display: flex;
justify-content: center;
align-items: center;
background-color: #FFFFFF;
border-radius: 16rpx;
color: var(--btnColor);
font-size: 28rpx;
font-weight: 600;
margin-bottom: 32rpx;
.icon{
width: 40rpx;
height: 40rpx;
margin-right: 16rpx;
vertical-align: -12rpx
}
}
.title-box{
display: flex;
align-items: center;
justify-content: space-between;
.title{
color: #323436;
font-size: 28rpx;
font-weight: 600;
.number{
color: var(--btnColor)
}
}
.select-btn {
box-sizing: border-box;
padding: 16rpx 0;
display: flex;
align-items: center;
z-index: 2;
background-color: #f2f3f7;
.type {
margin-left: 8px;
display: flex;
justify-content: center;
align-items: center;
padding: 0 16rpx;
height: 24px;
line-height: 24px;
background: #ffffff;
border-radius: 14px;
font-size: 12px;
color: #8a8c90;
text{
max-width: 360rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.point {
margin-left: 2px;
width: 12px;
height: 12px;
}
}
}
}
.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;
border-radius: 50%;
}
.message-text{
display: flex;
flex-flow: column;
justify-content: center;
.name{
color: #323436;
font-size: 28rpx;
}
.mobile{
color: #858A94;
font-size: 26rpx;
}
}
}
.arrow_right{
width: 36rpx;
height: 36rpx;
}
}
.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
<!--packagesList/mineDetail/pages/staffManage/staffManage.wxml-->
<wxs src="../index.wxs" module="format" />
<view class="staff-list-page">
<view class="btn_box" bindtap="jump">
<glsx-image src="index/apply.png" class="icon" />
<text>创建新员工</text>
</view>
<view class="content-box">
<view class="title-box">
<view class="title">员工数量:<text class="number">{{total}}</text></view>
<view class="select-btn">
<view class="type" bindtap="filterTypeFn">
<text>{{selectInfo.yqMerchantName}}</text>
<glsx-image class="point" src="index/point.png" />
</view>
</view>
</view>
<block wx:if="{{staffList.length}}">
<scroll-view scroll-y
enable-back-to-top
refresher-enabled="{{true}}"
bindrefresherrefresh="search"
bindscrolltolower="onBottomRefresh"
class="list"
style="height:calc(100vh - 148rpx - 110rpx);"
refresher-threshold="104"
scroll-top="{{scrollTop}}"
refresher-triggered="{{triggered}}">
<view class="item-box" wx:for="{{staffList}}" wx:key="index" bindtap="jump" data-info="{{item}}">
<view class="top">
<view class="message">
<glsx-image wx:if="{{!item.weChatAvatarUrl}}" src="personal/staff_defalut_avatar.png" class="avatar"/>
<image wx:else src="{{item.weChatAvatarUrl}}" class="avatar"></image>
<view class="message-text">
<view class="name">{{item.staffName}}</view>
<view class="mobile">{{format.formatMobile(item.staffPhone)}}</view>
</view>
</view>
<glsx-image src="personal/arrow_right.png" class="arrow_right" />
</view>
<view class="bottom">
<view class="service_name">
所属:{{item.merchantName}}
</view>
<view class="time">{{item.createdDate}}</view>
</view>
</view>
<view class="bottomTips" wx:if="{{nothing}}">到底啦!</view>
</scroll-view>
</block>
<block wx:else>
<nothing-tips tips="暂无员工~" bgColor="{{'#F2F3F7'}}" bg="{{bgUrl}}" />
</block>
</view>
</view>
<select-service-popup wx:if="{{popupShow}}" bind:hidePopup="filterTypeFn" bind:getStaffList="getStaffList" selectInfo="{{selectInfo}}" popShow="{{popupShow}}" serviceRange="{{serviceList}}" />
// packagesList/mineDetail/pages/successPage/successPage.js
const obj = {
service: {
navigationTitle: '创建服务中心',
primaryBtn: '继续创建服务中心',
primaryCallback: 'packageMine.editService?addOrEdit=add&isRedirect=true',
cancelBtn: 'S后自动跳转我的服务中心'
},
customer: {
navigationTitle: '创建客户',
primaryBtn: '邀请销售顾问',
primaryCallback: 'packageMine.saleList',
cancelBtn: 'S后自动跳转我的客户'
},
staff: {
navigationTitle: '创建员工',
primaryBtn: '继续创建员工',
primaryCallback: 'packageMine.createStaff',
cancelBtn: 'S后自动跳转我的员工'
}
}
Page({
/**
* 页面的初始数据
*/
data: {
paramsObj: {},
count: 5
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (options) {
let { page } = options
this.setData({
paramsObj: JSON.parse(JSON.stringify(obj[page]))
})
if (page == 'customer') {
let { merchantId, sceneList } = options
this.setData({
['paramsObj.primaryCallback']: JSON.parse(JSON.stringify(obj[page].primaryCallback)) + '?merchantId=' + merchantId + '&sceneList=' + sceneList + '&isRedirect=true'
})
}
}
let { count, paramsObj } = this.data
this.countDownTime = setInterval(() => {
this.setData({
count: --count
})
if (this.data.count == 0) wx.$router.back()
}, 1 * 1000)
},
navbarReady(e) {
let { height, statusBarHeight } = e.detail
this.setData({
tabBarStyle: height / 2 + statusBarHeight
})
},
jump(e) {
let { type } = e.currentTarget.dataset
let { paramsObj } = this.data
if (type == 'primary') {
wx.$router.redirectTo(paramsObj?.primaryCallback)
} else {
wx.$router.back()
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
clearInterval(this.countDownTime)
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationStyle": "custom"
}
\ No newline at end of file
/* packagesList/mineDetail/pages/successPage/successPage.wxss */
.success-page{
box-sizing: border-box;
width: 100%;
background-color: #ffffff;
display: flex;
flex-flow: column;
align-items: center;
justify-content: space-between;
padding-bottom: 160rpx;
.success_icon{
width: 160rpx;
height: 160rpx;
}
.success_text{
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 42rpx;
color: #323436;
margin-top: 52rpx;
}
.btn-box{
view{
width: 440rpx;
height: 88rpx;
display: flex;
align-items: center;
justify-content: center;
}
.btn-blue{
background: var(--btnColor);
border-radius: 8rpx;
color: #FFFFFF;
font-size: 28rpx;
}
.btn-cancel{
width: 436rpx;
height: 84rpx;
background: #FFFFFF;
border-radius: 8rpx;
border: 2rpx dashed #AFB0B2;
font-size: 24rpx;
color: #5A6066;
margin-top: 20rpx;
}
}
}
\ No newline at end of file
<!--packagesList/mineDetail/pages/successPage/successPage.wxml-->
<navigation-bar bindnavbarReady="navbarReady" showBack="{{true}}" bindback="back">{{paramsObj.navigationTitle}}</navigation-bar>
<view class="success-page" style="height: 100vh;padding:calc({{tabBarStyle}}px + 160rpx) 0 calc(160rpx + env(safe-area-inset-bottom)) 0;">
<view>
<glsx-image src="personal/success.png" class="success_icon" />
<view class="success_text">创建成功</view>
</view>
<view class="btn-box">
<view class="btn-blue" bindtap="jump" data-type="primary">{{paramsObj.primaryBtn}}</view>
<view class="btn-cancel" bindtap="jump" data-type="cancel">{{count}}{{paramsObj.cancelBtn}}</view>
</view>
</view>
......@@ -30,26 +30,27 @@ const formList = [{
const formObj = {
SC001: [{
label: '总单量',
name: 'totalCount'
}, {
label: '总产值',
name: 'totalAmount',
label: '营业额',
name: 'turnover',
prefix: '¥'
}, {
label: '当月单量',
name: 'monthCount'
label: '推荐客户量',
name: 'customerNum'
}, {
label: '当月产值',
name: 'monthAmount',
prefix: '¥'
label: '成交客户量',
name: 'successNum'
}, {
label: '转化率',
name: 'conversionRate'
label: '融合客单价',
name: 'fuseCustomerPrice',
prefix: '¥'
}, {
label: '单价',
name: 'price',
label: '权益客单价',
name: 'equityCustomerPrice',
prefix: '¥'
}, {
label: '转化率',
name: 'conversionRate',
suffix: '%'
}],
SC002: formList,
SC003: formList
......
......@@ -287,23 +287,30 @@ Page({
* 查询SC001场景值
*/
getEquityRevenue(isFirst = false) {
outputApi.getEquityRevenue({ merchantId: this.data.merchantInfo.merchantId }).then(res => {
// outputApi.getEquityRevenue({ merchantId: this.data.merchantInfo.merchantId }).then(res => {
outputApi.getEquityRevenue({ merchantIds: [this.data.merchantInfo.merchantId] }).then(res => {
// outputApi.getEquityRevenue({ merchantIds: ['44211227'] }).then(res => {
if (res.length) {
var actList = this.data.sceneActivityObj['scene' + this.findSceneIdx('SC001')]
var actCodeList = actList.map(item => item.productCode)
var total = 0
res.forEach(item => {
var idx = actCodeList.findIndex(i => i == item.productCode)
var orderTotal = item.orderTotal
if (item.orderTotal) {
total = (total + Number(item.orderTotal?.totalAmount)).toFixed(2)
item.orderTotal.totalAmount = utils.moneyThreeForTwoThousands(Number(orderTotal.totalAmount).toFixed(2))
item.orderTotal.monthAmount = Number(orderTotal.monthAmount).toFixed(2)
item.orderTotal.price = Number(orderTotal.price).toFixed(2)
}
res.forEach((item, idx) => {
// var idx = actCodeList.findIndex(i => i == item.productCode)
// var orderTotal = item.orderTotal
// if (item.orderTotal) {
// total = (total + Number(item.orderTotal?.totalAmount)).toFixed(2)
// item.orderTotal.totalAmount = utils.moneyThreeForTwoThousands(Number(orderTotal.totalAmount).toFixed(2))
// item.orderTotal.monthAmount = Number(orderTotal.monthAmount).toFixed(2)
// item.orderTotal.price = Number(orderTotal.price).toFixed(2)
// }
item.conversionRate = (item.conversionRate * 100).toFixed(0)
item.turnover = (item.turnover / 100).toFixed(2)
item.fuseCustomerPrice = (item.fuseCustomerPrice / 100).toFixed(2)
item.equityCustomerPrice = (item.equityCustomerPrice / 100).toFixed(2)
total = item.turnover
actList[idx] = {
...actList[idx],
orderTotal: item.orderTotal
orderTotal: res[idx]
}
})
if (!isFirst) {
......@@ -339,9 +346,9 @@ Page({
let upgradeObj = this.data.mockObj.upgradeObj[obj.idx]
item.orderTotal = upgradeObj.orderTotal
} else if (item.orderTotal) {
item.orderTotal.calCustomerUnitPrice = Math.round(orderTotal.totalSubOrderOrderMoney / orderTotal.upgradeCount).toFixed(2)
item.orderTotal.calExperience = Math.round((orderTotal.experienceCount * 100) / orderTotal.toShopCount).toFixed(0)
item.orderTotal.calTransform = Math.round((orderTotal.upgradeCount * 100) / orderTotal.experienceCount).toFixed(0)
item.orderTotal.calCustomerUnitPrice = orderTotal.upgradeCount ? Math.round(orderTotal.totalSubOrderOrderMoney / orderTotal.upgradeCount).toFixed(2) : '0.00'
item.orderTotal.calExperience = orderTotal.toShopCount ? Math.round((orderTotal.experienceCount * 100) / orderTotal.toShopCount).toFixed(0) : '0'
item.orderTotal.calTransform = orderTotal.experienceCount ? Math.round((orderTotal.upgradeCount * 100) / orderTotal.experienceCount).toFixed(0) : '0'
}
actList[idx] = {
...actList[idx],
......
......@@ -17,6 +17,7 @@ Page({
videoList: [],
videoUrl: '',
isShare: false,//是否是被分享出去
tabsActive: 1
},
videoObj: {},
showAuth: false
......@@ -32,17 +33,30 @@ Page({
})
})
if (!utils.isEmptyObj(options)) {
let { isShare, videoIndex, tabActive, sceneCode, leftMenuIndex } = options;
let { isShare, videoIndex, tabActive, sceneCode, leftMenuIndex = 0, tabsActive } = options;
let item = this.data.productData[tabActive].find(item => item.sceneCode == sceneCode)
let videoList = []
let videoUrl = ''
let videoObj = {}
if (tabsActive === '3') {
videoList = item?.operationVideoList
videoUrl = item?.operationVideoList[videoIndex]?.videoUrl
videoObj = item?.operationVideoList[videoIndex]
} else {
videoList = item?.videoList,
videoUrl = item.videoList[videoIndex]?.videoUrl
videoObj = item?.videoList[videoIndex]
}
let videoItem = {
index: videoIndex,
videoList: item?.videoList,
videoUrl: item?.videoList[videoIndex]?.videoUrl
videoList: videoList,
videoUrl: videoUrl,
tabsActive: tabsActive
}
this.setData({
videoItem: videoItem,
isShare: isShare,
videoObj: item?.videoList[videoIndex],
videoObj: videoObj,
leftMenuIndex: leftMenuIndex
})
this.setpagesTitle()
......@@ -52,7 +66,7 @@ Page({
//接受跳转的路由参数(小程序页面跳转)
onRoute(options) {
if (!options || utils.isEmptyObj(options)) return
let { scenIndex, videoList, index, leftMenuIndex } = options
let { scenIndex, videoList, index, leftMenuIndex = 0 } = options
options.videoIndex = index
options.tabActive = scenIndex
this.setData({
......@@ -64,26 +78,26 @@ Page({
},// 分享数据函数
shareDataFn(options) {
if (!options || utils.isEmptyObj(options)) return
let { tabActive, videoIndex } = options
let { tabActive, videoIndex, tabsActive } = options
this.setData({
tabsActive,
tabActive: tabActive,
videoIndex: videoIndex,
}, () => {
//分享的数据
this.changeShareData()
});
//分享的数据
this.changeShareData()
},
changeShareData() {
let { senceData, tabActive, videoIndex, videoObj, leftMenuIndex } = this.data
let { senceData, tabActive, videoIndex, videoObj, leftMenuIndex = 0, tabsActive } = this.data
// // 设置转发标题
// let userInfoObj = wx.$storage.get("userInfo");
// // #服务商账号#取该分享者商户的联系人字段,无则取商户简称,无则取商户全称
// let name = userInfoObj.merchantName;
this.shareTitle = `给您分享一个${videoObj.name} 视频`;
//分享的数据
let senceItem = productData[tabActive][leftMenuIndex]
this.shareQuery = `sceneCode=${senceItem?.sceneCode}&isShare=${true}&tabActive=${tabActive}&videoIndex=${videoIndex}&leftMenuIndex=${leftMenuIndex}`
this.shareQuery = `sceneCode=${senceItem?.sceneCode}&isShare=${true}&tabActive=${tabActive}&videoIndex=${videoIndex}&leftMenuIndex=${leftMenuIndex}&tabsActive=${tabsActive}`
},
// 切换视频
chooseVideo(e) {
......@@ -103,12 +117,12 @@ Page({
let { videoObj } = this.data
let url = videoObj.videoUrl
wx.getSetting({
success: (res)=> {
if(res.authSetting['scope.writePhotosAlbum']===false){
success: (res) => {
if (res.authSetting['scope.writePhotosAlbum'] === false) {
_this.setData({
showAuth: true
})
}else{
} else {
wx.$api.showToast('正在下载视频...')
wx.downloadFile({
url: url,
......
......@@ -19,47 +19,47 @@ const videoList0 = [
videoUrl: `${videoBaseUrl}video/digital_card_30s.mp4`,
posterUrl: `${IMG_URL}index/poster/digital_card_30s_bitmap.png`,
name: '数字无忧卡服务30秒',
manufacturer:'嘀加智慧',
view:1004,
manufacturer: '嘀加智慧',
view: 1004,
},
{
videoUrl: `${videoBaseUrl}video/digital_card_money3.mp4`,
posterUrl: `${IMG_URL}index/poster/digital_card_money3_bitmap.png`,
name: '数字无忧卡3道钱',
manufacturer:'嘀加智慧',
view:1563
manufacturer: '嘀加智慧',
view: 1563
},
{
videoUrl: `${videoBaseUrl}video/digital_card.mp4`,
posterUrl: `${IMG_URL}index/poster/digital_card_bitmap.png`,
name: '数字无忧卡服务',
manufacturer:'嘀加智慧',
view:1320
manufacturer: '嘀加智慧',
view: 1320
},
{
videoUrl: `${videoBaseUrl}video/digital_card_reason6.mp4`,
posterUrl: `${IMG_URL}index/poster/digital_card_reason6_bitmap.png`,
name: '数字无忧卡6大理由',
manufacturer:'嘀加智慧',
view:1485
manufacturer: '嘀加智慧',
view: 1485
}
]
const posterList0 = [
{
src:`${IMG_URL}index/poster/poster3-0.webp`,
name:'劲爆来袭'
src: `${IMG_URL}index/poster/poster3-0.webp`,
name: '劲爆来袭'
},
{
src:`${IMG_URL}index/poster/poster3-1.webp`,
name:'疯狂让利'
src: `${IMG_URL}index/poster/poster3-1.webp`,
name: '疯狂让利'
},
{
src:`${IMG_URL}index/poster/poster3-2.webp`,
name:'娱乐系统'
src: `${IMG_URL}index/poster/poster3-2.webp`,
name: '娱乐系统'
},
{
src:`${IMG_URL}index/poster/poster3-3.webp`,
name:'AR实景导航'
src: `${IMG_URL}index/poster/poster3-3.webp`,
name: 'AR实景导航'
}
]
// 精品升级
......@@ -80,26 +80,26 @@ const videoList1 = [
videoUrl: `${videoBaseUrl}video/solar.mp4`,
posterUrl: `${IMG_URL}index/poster/solar_bitmap.png`,
name: '太阳膜转化售中案例-门店新增产值12w每月',
manufacturer:'嘀加智慧',
view:1178
manufacturer: '嘀加智慧',
view: 1178
}
]
const posterList1 = [
{
src:`${IMG_URL}index/poster/poster4-0.webp`,
name:'一卷窗膜一车舒适'
src: `${IMG_URL}index/poster/poster4-0.webp`,
name: '一卷窗膜一车舒适'
},
{
src:`${IMG_URL}index/poster/poster4-1.webp`,
name:'汽车美容踏入镀晶时代'
src: `${IMG_URL}index/poster/poster4-1.webp`,
name: '汽车美容踏入镀晶时代'
},
{
src:`${IMG_URL}index/poster/poster4-2.webp`,
name:'5系窗膜随意选择'
src: `${IMG_URL}index/poster/poster4-2.webp`,
name: '5系窗膜随意选择'
},
{
src:`${IMG_URL}index/poster/poster4-3.webp`,
name:'四层加厚漆面保护'
src: `${IMG_URL}index/poster/poster4-3.webp`,
name: '四层加厚漆面保护'
}
]
......@@ -118,20 +118,20 @@ const productImgs2 = [
]
const posterList2 = [
{
src:`${IMG_URL}index/poster/poster4-0.webp`,
name:'一卷窗膜一车舒适'
src: `${IMG_URL}index/poster/poster4-0.webp`,
name: '一卷窗膜一车舒适'
},
{
src:`${IMG_URL}index/poster/poster4-1.webp`,
name:'汽车美容踏入镀晶时代'
src: `${IMG_URL}index/poster/poster4-1.webp`,
name: '汽车美容踏入镀晶时代'
},
{
src:`${IMG_URL}index/poster/poster4-2.webp`,
name:'5系窗膜随意选择'
src: `${IMG_URL}index/poster/poster4-2.webp`,
name: '5系窗膜随意选择'
},
{
src:`${IMG_URL}index/poster/poster4-3.webp`,
name:'四层加厚漆面保护'
src: `${IMG_URL}index/poster/poster4-3.webp`,
name: '四层加厚漆面保护'
}
]
const videoList2 = []
......@@ -192,80 +192,289 @@ const videoList2 = []
// 众筹活动
const sceneImgs3 = [
`${IMG_URL}index/scene/scene30.png`,
`${IMG_URL}index/scene/scene31.png`,
`${IMG_URL}index/scene/scene32.png`,
`${IMG_URL}index/scene/scene33.png`,
`${IMG_URL}index/scene/scene30.png`,
`${IMG_URL}index/scene/scene31.png`,
`${IMG_URL}index/scene/scene32.png`,
`${IMG_URL}index/scene/scene33.png`,
]
const productImgs3 = [
`${IMG_URL}index/productImgs/product30.webp`,
`${IMG_URL}index/productImgs/product31.webp`,
`${IMG_URL}index/productImgs/product32.webp`,
`${IMG_URL}index/productImgs/product33.webp`,
`${IMG_URL}index/productImgs/product30.webp`,
`${IMG_URL}index/productImgs/product31.webp`,
`${IMG_URL}index/productImgs/product32.webp`,
`${IMG_URL}index/productImgs/product33.webp`,
]
const videoList3 = [
{
videoUrl: `${videoBaseUrl}video/car_beauty.mp4`,
posterUrl: `${IMG_URL}index/poster/car_beauty.png`,
name: '数字化美容-新增产值20w+',
manufacturer:'嘀加智慧',
view:2561
},
{
videoUrl: `${videoBaseUrl}video/seat.mp4`,
posterUrl: `${IMG_URL}index/poster/seat_bitmap.png`,
name: '座椅通风系统-新增产值20w',
manufacturer:'嘀加智慧',
view:1365
},
{
videoUrl: `${videoBaseUrl}video/AR.mp4`,
posterUrl: `${IMG_URL}index/poster/AR_bitmap.png`,
name: '单品AR导航-新增产值20w+',
manufacturer:'嘀加智慧',
view:1172
},
{
videoUrl: `${videoBaseUrl}video/light.mp4`,
posterUrl: `${IMG_URL}index/poster/light_bitmap.png`,
name: '单品类氛围灯-新增产值27w',
manufacturer:'嘀加智慧',
view:1006
},
{
videoUrl: `${videoBaseUrl}video/360_AR.mp4`,
posterUrl: `${IMG_URL}index/poster/360_AR_bitmap.png`,
name: '360全景导航-新增产值57w+',
manufacturer:'嘀加智慧',
view:1891
},
{
videoUrl: `${videoBaseUrl}video/fragrance.mp4`,
posterUrl: `${IMG_URL}index/poster/fragrance.png`,
name: '智能香氛系统-新增产值57w+',
manufacturer:'嘀加智慧',
view:3101
}
{
videoUrl: `${videoBaseUrl}video/car_beauty.mp4`,
posterUrl: `${IMG_URL}index/poster/car_beauty.png`,
name: '数字化美容-新增产值20w+',
manufacturer: '嘀加智慧',
view: 2561
},
{
videoUrl: `${videoBaseUrl}video/seat.mp4`,
posterUrl: `${IMG_URL}index/poster/seat_bitmap.png`,
name: '座椅通风系统-新增产值20w',
manufacturer: '嘀加智慧',
view: 1365
},
{
videoUrl: `${videoBaseUrl}video/AR.mp4`,
posterUrl: `${IMG_URL}index/poster/AR_bitmap.png`,
name: '单品AR导航-新增产值20w+',
manufacturer: '嘀加智慧',
view: 1172
},
{
videoUrl: `${videoBaseUrl}video/light.mp4`,
posterUrl: `${IMG_URL}index/poster/light_bitmap.png`,
name: '单品类氛围灯-新增产值27w',
manufacturer: '嘀加智慧',
view: 1006
},
{
videoUrl: `${videoBaseUrl}video/360_AR.mp4`,
posterUrl: `${IMG_URL}index/poster/360_AR_bitmap.png`,
name: '360全景导航-新增产值57w+',
manufacturer: '嘀加智慧',
view: 1891
},
{
videoUrl: `${videoBaseUrl}video/fragrance.mp4`,
posterUrl: `${IMG_URL}index/poster/fragrance.png`,
name: '智能香氛系统-新增产值57w+',
manufacturer: '嘀加智慧',
view: 3101
}
]
const posterList3 = [
{
src:`${IMG_URL}index/poster/poster3-0.webp`,
name:'劲爆来袭'
},
{
src:`${IMG_URL}index/poster/poster3-1.webp`,
name:'疯狂让利'
},
{
src:`${IMG_URL}index/poster/poster3-2.webp`,
name:'娱乐系统'
},
{
src:`${IMG_URL}index/poster/poster3-3.webp`,
name:'AR实景导航'
}
{
src: `${IMG_URL}index/poster/poster3-0.webp`,
name: '劲爆来袭'
},
{
src: `${IMG_URL}index/poster/poster3-1.webp`,
name: '疯狂让利'
},
{
src: `${IMG_URL}index/poster/poster3-2.webp`,
name: '娱乐系统'
},
{
src: `${IMG_URL}index/poster/poster3-3.webp`,
name: 'AR实景导航'
}
]
// 操作指引视频
// 会员权益升级
const operationVideoList0 =[
{
videoUrl: `${videoBaseUrl}video/generate_price.mp4`,
posterUrl: `${IMG_URL}index/poster/generate_price.jpg`,
name: '如何生成融合报价单?',
manufacturer: '嘀加智慧',
view: 2854
},
{
videoUrl: `${videoBaseUrl}video/edite_price_content.mp4`,
posterUrl: `${IMG_URL}index/poster/edite_price_content.jpg`,
name: '如何修改已生成的融合报价单内容?',
manufacturer: '嘀加智慧',
view: 1786
},
{
videoUrl: `${videoBaseUrl}video/enter_defeat_order.mp4`,
posterUrl: `${IMG_URL}index/poster/enter_defeat_order.jpg`,
name: '如何录入战败订单?',
manufacturer: '嘀加智慧',
view: 2115
},
{
videoUrl: `${videoBaseUrl}video/how_bill_lading.mp4`,
posterUrl: `${IMG_URL}index/poster/how_bill_lading.jpg`,
name: '如何提单?',
manufacturer: '嘀加智慧',
view: 1361
},
{
videoUrl: `${videoBaseUrl}video/print_contract.mp4`,
posterUrl: `${IMG_URL}index/poster/print_contract.jpg`,
name: '如何打印纸质合同?',
manufacturer: '嘀加智慧',
view: 3008
},
// {
// videoUrl: `${videoBaseUrl}video/why_generate_price.mp4`,
// posterUrl: `${IMG_URL}index/poster/why_generate_price.jpg`,
// name: '为什么要生成融合报价单?',
// manufacturer: '嘀加智慧',
// view: 1968
// },
// {
// videoUrl: `${videoBaseUrl}video/online_system_benefit.mp4`,
// posterUrl: `${IMG_URL}index/poster/online_system_benefit.jpg`,
// name: '使用线上系统有什么好处?',
// manufacturer: '嘀加智慧',
// view: 3361
// },
{
videoUrl: `${videoBaseUrl}video/exllent_case.mp4`,
posterUrl: `${IMG_URL}index/poster/exllent_case.jpg`,
name: '贵州一汽大众驻店卖权益优秀案例',
manufacturer: '嘀加智慧',
view: 2489
},
]
// 精品升级
const operationVideoList1 =  [
      {
        videoUrl: `${videoBaseUrl}video/online_coupon.mp4`,
        posterUrl: `${IMG_URL}index/poster/online_coupon.jpg`,
        name: '如何线上发券呢?',
        manufacturer: '嘀加智慧',
        view: 2301
      }, 
      {
      videoUrl: `${videoBaseUrl}video/customer_get_coupon.mp4`,
      posterUrl: `${IMG_URL}index/poster/customer_get_coupon.jpg`,
      name: '客户如何领券,在哪里可以查看自己的券码?',
      manufacturer: '嘀加智慧',
      view: 1938
    }, 
    {
      videoUrl: `${videoBaseUrl}video/create_online_work_order.mp4`,
      posterUrl: `${IMG_URL}index/poster/create_online_work_order.jpg`,
      name: '如何线上新建客户工单?',
      manufacturer: '嘀加智慧',
      view: 1890
    }, 
    {
      videoUrl: `${videoBaseUrl}video/online_cancel_verification.mp4`,
      posterUrl: `${IMG_URL}index/poster/online_cancel_verification.jpg`,
      name: '驻店员工如何线上进行扫码核销',
      manufacturer: '嘀加智慧',
      view: 1321
    }, 
    {
      videoUrl: `${videoBaseUrl}video/create_online_record.mp4`,
      posterUrl: `${IMG_URL}index/poster/create_online_record.jpg`,
      name: '如何线上建立客户档案?',
      manufacturer: '嘀加智慧',
      view: 2231
    }, 
    {
      videoUrl: `${videoBaseUrl}video/customer_get_warranty.mp4`,
      posterUrl: `${IMG_URL}index/poster/customer_get_warranty.jpg`,
      name: '客户如何领取质保卡?',
      manufacturer: '嘀加智慧',
      view: 2261
    }, 
    {
      videoUrl: `${videoBaseUrl}video/customer_get_wechat.mp4`,
      posterUrl: `${IMG_URL}index/poster/customer_get_wechat.jpg`,
      name: '战败客户如何加微?',
      manufacturer: '嘀加智慧',
      view: 2061
    }, 
    {
      videoUrl: `${videoBaseUrl}video/cancel_work_order.mp4`,
      posterUrl: `${IMG_URL}index/poster/cancel_work_order.jpg`,
      name: '如何撤销工单及工位设置?',
      manufacturer: '嘀加智慧',
      view: 2003
    }, 
    {
      videoUrl: `${videoBaseUrl}video/view_manager_data.mp4`,
      posterUrl: `${IMG_URL}index/poster/view_manager_data.jpg`,
      name: '如何查看经营数据?',
      manufacturer: '嘀加智慧',
      view: 2811
    }, 
    {
      videoUrl: `${videoBaseUrl}video/why_get_coupon.mp4`,
      posterUrl: `${IMG_URL}index/poster/why_get_coupon.jpg`,
      name: '为什么要使用“车生活助手”发券,领券',
      manufacturer: '嘀加智慧',
      view: 2661
    }, 
    {
      videoUrl: `${videoBaseUrl}video/cancel_verification_advance.mp4`,
      posterUrl: `${IMG_URL}index/poster/cancel_verification_advance.jpg`,
      name: '线上扫码核销有哪些好处呢?',
      manufacturer: '嘀加智慧',
      view: 1211
    }, 
    {
      videoUrl: `${videoBaseUrl}video/why_add_work_order.mp4`,
      posterUrl: `${IMG_URL}index/poster/why_add_work_order.jpg`,
      name: '为什么要建档以及新增工单?',
      manufacturer: '嘀加智慧',
      view: 986
    }, 
    {
      videoUrl: `${videoBaseUrl}video/online_warranty_card_advance.mp4`,
      posterUrl: `${IMG_URL}index/poster/online_warranty_card_advance.jpg`,
      name: '线上质保卡的好处有哪些?',
      manufacturer: '嘀加智慧',
      view: 2209
    }, 
    {
      videoUrl: `${videoBaseUrl}video/station_work_effect.mp4`,
      posterUrl: `${IMG_URL}index/poster/station_work_effect.jpg`,
      name: '工位设置和撤销工单有哪些作用?',
      manufacturer: '嘀加智慧',
      view: 2261
    }, 
    {
      videoUrl: `${videoBaseUrl}video/why_view_manage_dat.mp4`,
      posterUrl: `${IMG_URL}index/poster/why_view_manage_dat.jpg`,
      name: '为什么要查看经营数据呢?',
      manufacturer: '嘀加智慧',
      view: 1009
    }, 
    {
      videoUrl: `${videoBaseUrl}video/why_wechat_register.mp4`,
      posterUrl: `${IMG_URL}index/poster/why_wechat_register.jpg`,
      name: '为什么要注册企业微信?',
      manufacturer: '嘀加智慧',
      view: 2676
    }, 
    {
      videoUrl: `${videoBaseUrl}video/register_wechat_flow.mp4`,
      posterUrl: `${IMG_URL}index/poster/register_wechat_flow.jpg`,
      name: '注册企业微信流程有哪些?',
      manufacturer: '嘀加智慧',
      view: 1161
    }, 
    {
      videoUrl: `${videoBaseUrl}video/why_wechat_certificate.mp4`,
      posterUrl: `${IMG_URL}index/poster/why_wechat_certificate.jpg`,
      name: '企业微信为什么要认证?',
      manufacturer: '嘀加智慧',
      view: 1870
    }, 
    {
      videoUrl: `${videoBaseUrl}video/chongqin_solar_excellent_case.mp4`,
      posterUrl: `${IMG_URL}index/poster/chongqin_solar_excellent_case.jpg`,
      name: '重庆上海大众驻店太阳膜升级优秀案例',
      manufacturer: '嘀加智慧',
      view:3244
    }, 
    {
      videoUrl: `${videoBaseUrl}video/solar_excellent_case.mp4`,
      posterUrl: `${IMG_URL}index/poster/solar_excellent_case.png`,
      name: '佛山广汽丰田驻店太阳膜升级优秀案例',
      manufacturer: '嘀加智慧',
      view: 2257
    }, 
  ]
// 次新车转化
const operationVideoList2 = []
// 售后众筹
const operationVideoList3 = []
const scenceList = [
// {
// sceneid: 4,
......@@ -299,7 +508,7 @@ const scenceList = [
{
sceneid: 1,
name: '精品升级',
sceneCode:'SC002',
sceneCode: 'SC002',
sceneImgs: sceneImgs1,
productImgs: productImgs1,
src: `${IMG_URL}index/car2.png`,
......@@ -314,24 +523,25 @@ const scenceList = [
type: 'membrane',
productType: 'sunMembrane',
path: 'solarFilm',
sale:100, //销量
sale: 100, //销量
varType: 0,
flow:10000,
"productCode":"PC002",
"productName":"汽车太阳膜",
"category":"膜类",
flow: 10000,
"productCode": "PC002",
"productName": "汽车太阳膜",
"category": "膜类",
prodImg: `${IMG_URL}index/prod2/prod1-0.png`,
videoInfo: videoList1[0],
tabList: ['项目介绍', '活动方案', '销售场景', '合作案例', '合作说明', 'FAQ'],
}
],
videoList: videoList1,
posterList: posterList1
posterList: posterList1,
operationVideoList: operationVideoList1
},
{
sceneid: 2,
name: '次新车转化',
sceneCode:'SC003',
sceneCode: 'SC003',
sceneImgs: sceneImgs2,
productImgs: productImgs2,
src: `${IMG_URL}index/car3.png`,
......@@ -346,12 +556,12 @@ const scenceList = [
type: 'membrane',
productType: 'protectMembrane',
path: 'paintProtect',
sale:100, //销量
sale: 100, //销量
varType: 0,
flow:10000,
"productCode":"PC003",
"productName":"漆面保护膜",
"category":"膜类",
flow: 10000,
"productCode": "PC003",
"productName": "漆面保护膜",
"category": "膜类",
prodImg: `${IMG_URL}index/prod2/prod2-0.png`,
videoInfo: videoList2[0]
},
......@@ -364,12 +574,12 @@ const scenceList = [
type: 'membrane',
productType: 'colorMembrane',
path: 'changingFilm',
sale:100, //销量
sale: 100, //销量
varType: 0,
flow:10000,
"productCode":"PC004",
"productName":"改色膜",
"category":"膜类",
flow: 10000,
"productCode": "PC004",
"productName": "改色膜",
"category": "膜类",
prodImg: `${IMG_URL}index/prod2/prod2-1.png`,
videoInfo: videoList2[0]
}
......@@ -377,21 +587,22 @@ const scenceList = [
//无视频时显示的图片
noVideoPicture: [
{
posterUrl:`${IMG_URL}index/poster/no-video.png`,
name:'0-6 个月次新车-线上销售轻改精品'
posterUrl: `${IMG_URL}index/poster/no-video.png`,
name: '0-6 个月次新车-线上销售轻改精品'
}
],
videoList: videoList2,
posterList: posterList2
posterList: posterList2,
operationVideoList: operationVideoList2
},
{
sceneid: 3,
name: '售后众筹',
sceneCode:'SC004',
sceneCode: 'SC004',
src: `${IMG_URL}index/car4.png`,
banner: `${IMG_URL}index/banner/banner3.png`,
productList: [
{
{
id: 0,
img: 'product-img5',
proName: '数字化美容',
......@@ -400,12 +611,12 @@ const scenceList = [
type: 'beauty',
productType: 'digitBeauty',
path: 'carBeauty',
sale:100, //销量
sale: 100, //销量
varType: 0,
flow:10000,
"productCode":"PC005",
"productName":"数字化美容",
"category":"美容类",
flow: 10000,
"productCode": "PC005",
"productName": "数字化美容",
"category": "美容类",
prodImg: `${IMG_URL}index/prod2/prod3-4.png`,
videoList: videoList3[0]
},
......@@ -418,16 +629,16 @@ const scenceList = [
type: 'light',
productType: 'chair',
path: 'seatVentilate',
sale:10000, //销量
sale: 10000, //销量
varType: 1,
flow:10000,
"productCode":"PC006",
"productName":"座椅通风",
"category":"轻改类",
flow: 10000,
"productCode": "PC006",
"productName": "座椅通风",
"category": "轻改类",
prodImg: `${IMG_URL}index/prod2/prod3-3.png`,
videoList: videoList3[0]
},
{
},
{
id: 2,
img: 'product-img7',
proName: 'AR导航',
......@@ -436,16 +647,16 @@ const scenceList = [
type: 'light',
productType: 'ar',
path: 'arNavigation',
sale:10000, //销量
sale: 10000, //销量
varType: 1,
flow:10000,
"productCode":"PC007",
"productName":"AR导航",
"category":"轻改类",
flow: 10000,
"productCode": "PC007",
"productName": "AR导航",
"category": "轻改类",
prodImg: `${IMG_URL}index/prod2/prod3-0.png`,
videoList: videoList3[0]
},
{
},
{
id: 3,
img: 'product-img8',
proName: '氛围灯',
......@@ -454,16 +665,16 @@ const scenceList = [
type: 'light',
productType: 'lamp',
path: 'ambientLighting',
sale:10000, //销量
sale: 10000, //销量
varType: 1,
flow:10000,
"productCode":"PC008",
"productName":"氛围灯",
"category":"轻改类",
flow: 10000,
"productCode": "PC008",
"productName": "氛围灯",
"category": "轻改类",
prodImg: `${IMG_URL}index/prod2/prod3-2.png`,
videoList: videoList3[0]
},
{
},
{
id: 4,
img: 'product-img9',
proName: '360全景导航',
......@@ -472,16 +683,16 @@ const scenceList = [
type: 'light',
productType: 'navigation',
path: 'navigationArround',
sale:10000, //销量
sale: 10000, //销量
varType: 1,
flow:10000,
"productCode":"PC009",
"productName":"360全景导航",
"category":"轻改类",
flow: 10000,
"productCode": "PC009",
"productName": "360全景导航",
"category": "轻改类",
prodImg: `${IMG_URL}index/prod2/prod3-1.png`,
videoList: videoList3[0]
},
{
},
{
id: 5,
img: 'product-img9',
proName: '智能香氛系统',
......@@ -490,26 +701,27 @@ const scenceList = [
type: 'light',
productType: 'navigation',
path: 'navigationArround',
sale:10000, //销量
sale: 10000, //销量
varType: 1,
flow:10000,
"productCode":"PC009",
"productName":"智能香氛系统",
"category":"轻改类",
flow: 10000,
"productCode": "PC011",
"productName": "智能香氛系统",
"category": "轻改类",
prodImg: `${IMG_URL}index/prod2/prod3-5.png`,
videoList: videoList3[0]
}
],
sceneImgs: sceneImgs3,
productImgs: productImgs3,
videoList: videoList3,
posterList: posterList3
],
sceneImgs: sceneImgs3,
productImgs: productImgs3,
videoList: videoList3,
posterList: posterList3,
operationVideoList: operationVideoList3
},
{
sceneid: 0,
name: '会员权益/升级',
sceneCode:'SC001',
sceneImgs:sceneImgs0,
sceneCode: 'SC001',
sceneImgs: sceneImgs0,
productImgs: productImgs0,
src: `${IMG_URL}index/car1.png`,
banner: `${IMG_URL}index/banner/banner0.png`,
......@@ -523,18 +735,19 @@ const scenceList = [
type: 'service',
productType: 'benefitCard',
path: 'equity',
sale:100 ,//销量
sale: 100,//销量
varType: 0,
flow:10000,
"productCode":"PC001",
"productName":"数字无忧权益卡",
"category":"服务类",
flow: 10000,
"productCode": "PC001",
"productName": "数字无忧权益卡",
"category": "服务类",
prodImg: `${IMG_URL}index/prod2/prod0-0.png`,
videoInfo: videoList0[0]
}
],
videoList: videoList0,
posterList: posterList0
posterList: posterList0,
operationVideoList: operationVideoList0
},
]
......
......@@ -9,6 +9,212 @@ const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistan
const videoBaseUrl = 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/'
import { subscriptionSystemData } from './systemData'
const operationVideoList0 = [
{
videoUrl: `${videoBaseUrl}video/generate_price.mp4`,
posterUrl: `${IMG_URL}index/poster/generate_price.jpg`,
name: '如何生成融合报价单?',
manufacturer: '嘀加智慧',
view: 2854
},
{
videoUrl: `${videoBaseUrl}video/edite_price_content.mp4`,
posterUrl: `${IMG_URL}index/poster/edite_price_content.jpg`,
name: '如何修改已生成的融合报价单内容?',
manufacturer: '嘀加智慧',
view: 1786
},
{
videoUrl: `${videoBaseUrl}video/enter_defeat_order.mp4`,
posterUrl: `${IMG_URL}index/poster/enter_defeat_order.jpg`,
name: '如何录入战败订单?',
manufacturer: '嘀加智慧',
view: 2115
},
{
videoUrl: `${videoBaseUrl}video/how_bill_lading.mp4`,
posterUrl: `${IMG_URL}index/poster/how_bill_lading.jpg`,
name: '如何提单?',
manufacturer: '嘀加智慧',
view: 1361
},
// {
// videoUrl: `${videoBaseUrl}video/print_contract.mp4`,
// posterUrl: `${IMG_URL}index/poster/print_contract.jpg`,
// name: '如何打印纸质合同?',
// manufacturer: '嘀加智慧',
// view: 3008
// },
// {
// videoUrl: `${videoBaseUrl}video/why_generate_price.mp4`,
// posterUrl: `${IMG_URL}index/poster/why_generate_price.jpg`,
// name: '为什么要生成融合报价单?',
// manufacturer: '嘀加智慧',
// view: 1968
// },
{
videoUrl: `${videoBaseUrl}video/online_system_benefit.mp4`,
posterUrl: `${IMG_URL}index/poster/online_system_benefit.jpg`,
name: '使用线上系统有什么好处?',
manufacturer: '嘀加智慧',
view: 3361
},
{
videoUrl: `${videoBaseUrl}video/exllent_case.mp4`,
posterUrl: `${IMG_URL}index/poster/exllent_case.jpg`,
name: '贵州一汽大众驻店卖权益优秀案例',
manufacturer: '嘀加智慧',
view: 2489
},
]
const operationVideoList1 = [
      {
        videoUrl: `${videoBaseUrl}video/online_coupon.mp4`,
        posterUrl: `${IMG_URL}index/poster/online_coupon.jpg`,
        name: '如何线上发券呢?',
        manufacturer: '嘀加智慧',
        view: 2301
      }, 
      {
      videoUrl: `${videoBaseUrl}video/customer_get_coupon.mp4`,
      posterUrl: `${IMG_URL}index/poster/customer_get_coupon.jpg`,
      name: '客户如何领券,在哪里可以查看自己的券码?',
      manufacturer: '嘀加智慧',
      view: 1938
    }, 
    {
      videoUrl: `${videoBaseUrl}video/create_online_work_order.mp4`,
      posterUrl: `${IMG_URL}index/poster/create_online_work_order.jpg`,
      name: '如何线上新建客户工单?',
      manufacturer: '嘀加智慧',
      view: 1890
    }, 
    {
      videoUrl: `${videoBaseUrl}video/online_cancel_verification.mp4`,
      posterUrl: `${IMG_URL}index/poster/online_cancel_verification.jpg`,
      name: '驻店员工如何线上进行扫码核销',
      manufacturer: '嘀加智慧',
      view: 1321
    }, 
    {
      videoUrl: `${videoBaseUrl}video/create_online_record.mp4`,
      posterUrl: `${IMG_URL}index/poster/create_online_record.jpg`,
      name: '如何线上建立客户档案?',
      manufacturer: '嘀加智慧',
      view: 2231
    }, 
    {
      videoUrl: `${videoBaseUrl}video/customer_get_warranty.mp4`,
      posterUrl: `${IMG_URL}index/poster/customer_get_warranty.jpg`,
      name: '客户如何领取质保卡?',
      manufacturer: '嘀加智慧',
      view: 2261
    }, 
    {
      videoUrl: `${videoBaseUrl}video/customer_get_wechat.mp4`,
      posterUrl: `${IMG_URL}index/poster/customer_get_wechat.jpg`,
      name: '战败客户如何加微?',
      manufacturer: '嘀加智慧',
      view: 2061
    }, 
    {
      videoUrl: `${videoBaseUrl}video/cancel_work_order.mp4`,
      posterUrl: `${IMG_URL}index/poster/cancel_work_order.jpg`,
      name: '如何撤销工单及工位设置?',
      manufacturer: '嘀加智慧',
      view: 2003
    }, 
    {
      videoUrl: `${videoBaseUrl}video/view_manager_data.mp4`,
      posterUrl: `${IMG_URL}index/poster/view_manager_data.jpg`,
      name: '如何查看经营数据?',
      manufacturer: '嘀加智慧',
      view: 2811
    }, 
    {
      videoUrl: `${videoBaseUrl}video/why_get_coupon.mp4`,
      posterUrl: `${IMG_URL}index/poster/why_get_coupon.jpg`,
      name: '为什么要使用“车生活助手”发券,领券',
      manufacturer: '嘀加智慧',
      view: 2661
    }, 
    {
      videoUrl: `${videoBaseUrl}video/cancel_verification_advance.mp4`,
      posterUrl: `${IMG_URL}index/poster/cancel_verification_advance.jpg`,
      name: '线上扫码核销有哪些好处呢?',
      manufacturer: '嘀加智慧',
      view: 1211
    }, 
    {
      videoUrl: `${videoBaseUrl}video/why_add_work_order.mp4`,
      posterUrl: `${IMG_URL}index/poster/why_add_work_order.jpg`,
      name: '为什么要建档以及新增工单?',
      manufacturer: '嘀加智慧',
      view: 986
    }, 
    {
      videoUrl: `${videoBaseUrl}video/online_warranty_card_advance.mp4`,
      posterUrl: `${IMG_URL}index/poster/online_warranty_card_advance.jpg`,
      name: '线上质保卡的好处有哪些?',
      manufacturer: '嘀加智慧',
      view: 2209
    }, 
    {
      videoUrl: `${videoBaseUrl}video/station_work_effect.mp4`,
      posterUrl: `${IMG_URL}index/poster/station_work_effect.jpg`,
      name: '工位设置和撤销工单有哪些作用?',
      manufacturer: '嘀加智慧',
      view: 2261
    }, 
    {
      videoUrl: `${videoBaseUrl}video/why_view_manage_dat.mp4`,
      posterUrl: `${IMG_URL}index/poster/why_view_manage_dat.jpg`,
      name: '为什么要查看经营数据呢?',
      manufacturer: '嘀加智慧',
      view: 1009
    }, 
    {
      videoUrl: `${videoBaseUrl}video/why_wechat_register.mp4`,
      posterUrl: `${IMG_URL}index/poster/why_wechat_register.jpg`,
      name: '为什么要注册企业微信?',
      manufacturer: '嘀加智慧',
      view: 2676
    }, 
    {
      videoUrl: `${videoBaseUrl}video/register_wechat_flow.mp4`,
      posterUrl: `${IMG_URL}index/poster/register_wechat_flow.jpg`,
      name: '注册企业微信流程有哪些?',
      manufacturer: '嘀加智慧',
      view: 1161
    }, 
    {
      videoUrl: `${videoBaseUrl}video/why_wechat_certificate.mp4`,
      posterUrl: `${IMG_URL}index/poster/why_wechat_certificate.jpg`,
      name: '企业微信为什么要认证?',
      manufacturer: '嘀加智慧',
      view: 1870
    }, 
    {
      videoUrl: `${videoBaseUrl}video/chongqin_solar_excellent_case.mp4`,
      posterUrl: `${IMG_URL}index/poster/chongqin_solar_excellent_case.jpg`,
      name: '重庆上海大众驻店太阳膜升级优秀案例',
      manufacturer: '嘀加智慧',
      view:3244
    }, 
    {
      videoUrl: `${videoBaseUrl}video/solar_excellent_case.mp4`,
      posterUrl: `${IMG_URL}index/poster/solar_excellent_case.png`,
      name: '佛山广汽丰田驻店太阳膜升级优秀案例',
      manufacturer: '嘀加智慧',
      view: 2257
    }, 
  ]
const operationVideoList2 = []
const operationVideoList3 = []
/**
* 属性说明:
* sceneImgs:场景详情下的图片
......@@ -96,7 +302,8 @@ const scenario_0 = [
}
],
videoList: videoList0,
posterList: posterList0
posterList: posterList0,
operationVideoList: operationVideoList0
}
]
......@@ -157,7 +364,8 @@ const scenario_1 = [
}
],
videoList: videoList1,
posterList: posterList1
posterList: posterList1,
operationVideoList: operationVideoList1
}
]
......@@ -234,7 +442,8 @@ const scenario_2 = [
}
],
videoList: videoList2,
posterList: posterList2
posterList: posterList2,
operationVideoList: operationVideoList2
}
]
......@@ -330,7 +539,8 @@ const scenario_3 = [
sceneImgs: sceneImgs3,
productImgs: productImgs3,
videoList: videoList3,
posterList: posterList3
posterList: posterList3,
operationVideoList: operationVideoList3
},
{
name: '轻改类',
......@@ -421,7 +631,7 @@ const scenario_3 = [
sale: 10000, //销量
varType: 1,
flow: 10000,
productCode: 'PC009',
productCode: 'PC011',
productName: '智能香氛系统',
category: '轻改类',
prodImg: `${IMG_URL}index/prod2/prod3-5.png`,
......
......@@ -26,7 +26,7 @@ Page({
navStyle,
IMG_URL,
IMG_URLLocal,
actClass: 'right',
actClass: "right",
guideSrcIndex: 1,
guideShow: false,
dataArr: [],
......@@ -34,42 +34,45 @@ Page({
actNum: 3, //car 场景选择
tabIndx: 0,
// navList: ['看线索', '看产品'],
navList: ['看产品', '客户数字化'],
navList: ["看产品", "客户数字化"],
isShowService: false,
// 固定按钮
btnList: [{
imgSrc: 'contact',
name: '在线客服',
bindtap: 'goConsult'
}, {
imgSrc: 'bus-pro',
name: '申请业务',
bindtap: 'openBus'
},
// {
// imgSrc: 'bus-pro',
// name: '申请产品',
// bindtap: 'openPro',
// isHide: false
// },
{
imgSrc: 'valuation',
name: '预估产值',
bindtap: 'showCalculate',
isHide: false
}],
btnList: [
{
imgSrc: "contact",
name: "在线客服",
bindtap: "goConsult",
},
{
imgSrc: "bus-pro",
name: "申请业务",
bindtap: "openBus",
},
// {
// imgSrc: 'bus-pro',
// name: '申请产品',
// bindtap: 'openPro',
// isHide: false
// },
{
imgSrc: "valuation",
name: "预估产值",
bindtap: "showCalculate",
isHide: false,
},
],
// 预估弹框
// visible: false,
isReset: false,
formData: {
sales: 100,
flow: 10000
flow: 10000,
},
lastFormData: {
sales: 100,
flow: 10000
flow: 10000,
},
isFirst: true,
// tabList: pageData.tabList,
......@@ -80,54 +83,56 @@ Page({
// productData,
activityList: [],
// 视频播放地址
videoSrc: '',
videoTitle: '',
videoSrc: "",
videoTitle: "",
headerHeight: 0,
unreadClueCount: 0,
img_version: '0.1.1',
img_version: "0.1.1",
subscriptionBannerUrl: Object.freeze(subscriptionBannerUrl),
subscriptionSystemData: Object.freeze(subscriptionSystemData)
subscriptionSystemData: Object.freeze(subscriptionSystemData),
},
proClick(e) {
let { detail } = e
let { detail } = e;
//登录的用户手机号
let userInfo = wx.$storage.get("userInfo");
let obj = {
actNum: isNaN(detail.scenIndex) ? 99 : detail.scenIndex, //选中的场景 没有就是订阅系统的
sceneid99: detail.sceneid,
activeNavIdx: detail.id, //选中的产品,
phone: userInfo.phone
}
wx.$router.go('/packagesList/pages/productDetail/productDetail', obj)
phone: userInfo.phone,
};
wx.$router.go("/packagesList/pages/productDetail/productDetail", obj);
},
// 跳转视频详情
videoClick(e) {
const { name } = e.target.dataset
const { name } = e.target.dataset;
const {
index,
info: { videoUrl },
scenIndex,
list
} = e.detail
const videoList = list
let userInfo = wx.$storage.get("userInfo")
list,
tabsActive,
} = e.detail;
const videoList = list;
let userInfo = wx.$storage.get("userInfo");
const obj = {
index,
videoList,
scenIndex: isNaN(scenIndex) ? 99 : scenIndex,
videoUrl: videoUrl,
phone: userInfo.phone
phone: userInfo.phone,
tabsActive,
};
if (name == "客户数字化") {
obj.leftMenuIndex = leftMenuIndex;
}
if (name == '客户数字化') {
obj.leftMenuIndex = leftMenuIndex
}
wx.$router.go('/packagesList/pages/videoDetal/videoDetal', obj)
wx.$router.go("/packagesList/pages/videoDetal/videoDetal", obj);
},
// 跳转众筹活动页
activityClick(e) {
const id = e.detail
wx.$router.go('/packagesList/activityDetail/activityDetail', { id })
const id = e.detail;
wx.$router.go("/packagesList/activityDetail/activityDetail", { id });
},
// 场景跳转
......@@ -140,12 +145,12 @@ Page({
// phone: userInfo.phone,
// };
// wx.$router.go("/pages/viewProdBanner/index", obj);
const { scenIndex } = e.detail
const { scenIndex } = e.detail;
let userInfo = wx.$storage.get("userInfo");
wx.$router.go('/packagesList/pages/scenarioDetail/scenarioDetail', {
wx.$router.go("/packagesList/pages/scenarioDetail/scenarioDetail", {
actNum: scenIndex,
phone: userInfo.phone
})
phone: userInfo.phone,
});
},
// 获取全部活动列表
getActivityRecord() {
......@@ -153,84 +158,84 @@ Page({
if (code == -1) {
wx.showToast({
title: message,
icon: 'none',
duration: 2000
})
icon: "none",
duration: 2000,
});
}
this.setData({
activityList: data
})
})
activityList: data,
});
});
},
//引导图
guideFn() {
if (this.data.guideSrcIndex === 4) {
this.setData({
guideShow: false
})
guideShow: false,
});
//显示tabar
wx.pro.showTabBar()
return
wx.pro.showTabBar();
return;
}
this.setData({
guideSrcIndex: ++this.data.guideSrcIndex
})
guideSrcIndex: ++this.data.guideSrcIndex,
});
// console.log('guideSrcIndex',this.data.guideSrcIndex)
},
// navbar高度设置
navbarReady(e) {
let { height, statusBarHeight } = e.detail
let { height, statusBarHeight } = e.detail;
this.setData({
headerHeight: height / 2 + statusBarHeight,
// headerHeight: height / 2 + statusBarHeight + 88 * 2
})
});
},
selectCar(e) {
let actNum = e.detail
let actNum = e.detail;
this.setData({
actNum
})
actNum,
});
},
// 头部看线索,产品切换
changeTabIndx(e) {
// console.log('e.detail: ', e.detail)
let { sessionId } = wx.$storage.get()
let { sessionId } = wx.$storage.get();
// console.log("sessionId: ", sessionId);
let param = {
sessionId
}
sessionId,
};
let first = true
let first = true;
this.setData({
tabIndx: e.detail
})
this.btnIsHide()
tabIndx: e.detail,
});
this.btnIsHide();
},
//看产品下拉刷新
refresherrefresh() {
let { tabIndx } = this.data
let { tabIndx } = this.data;
if (tabIndx == 0) {
// 看产品
this.getProductByscene()
this.getProductByscene();
// // 看线索
// this.getClueInit()
wx.pro.showToast({
title: '刷新成功',
icon: 'loading',
duration: 1500
})
title: "刷新成功",
icon: "loading",
duration: 1500,
});
}
},
// 跳转咨询页面
goConsult() {
// console.log('跳转到咨询页面')
wx.pro.openCustomerServiceChat({
extInfo: { url: 'https://work.weixin.qq.com/kfid/kfcf7b721472201345e' },
corpId: 'ww047bdc0f1e76cc13',
complete: r => {
extInfo: { url: "https://work.weixin.qq.com/kfid/kfcf7b721472201345e" },
corpId: "ww047bdc0f1e76cc13",
complete: (r) => {
// console.log(r)
}
})
},
});
},
// 申请业务、
openBus() {
......@@ -238,7 +243,7 @@ Page({
},
// 开通产品
// openPro() {
// let obj = {
// let obj = {
// scene:3
// }
// wx.$router.go("/packagesList/applyProd/pages/apply",obj);
......@@ -399,16 +404,16 @@ Page({
// },
focus() {
this.setData({
isReset: true
})
return false
isReset: true,
});
return false;
},
// 固定按钮
btnIsHide() {
this.setData({
['btnList[2].isHide']: this.data.tabIndx != 0
})
["btnList[2].isHide"]: this.data.tabIndx != 0,
});
},
/**
......@@ -416,130 +421,130 @@ Page({
*/
onLoad: function (options) {
// console.log('options: ', options);
let { sessionId } = wx.$storage.get()
let { sessionId } = wx.$storage.get();
// console.log("sessionId: ", sessionId);
let param = {
sessionId
}
sessionId,
};
// 看产品
this.getProductByscene()
this.getProductByscene();
// // 看线索
// this.getClueInit()
this.setData({
productData: this.addAll(this.data.productData)
})
this.getActivityRecord()
productData: this.addAll(this.data.productData),
});
this.getActivityRecord();
// //第一次进来储缓存,以后不再用引导图
let firstLogin = wx.$storage.get('firstLogin')
let firstLogin = wx.$storage.get("firstLogin");
if (!firstLogin) {
//第一次隐藏tabar
wx.pro.hideTabBar()
wx.pro.hideTabBar();
this.setData({
guideShow: true
})
wx.$storage.set('firstLogin', 'firstLogin')
guideShow: true,
});
wx.$storage.set("firstLogin", "firstLogin");
}
if (this.data.guideShow) {
wx.$storage.set('disLikeRecordFlag', true)
let disLikeRecordFlag = wx.$storage.get('disLikeRecordFlag')
wx.$storage.set("disLikeRecordFlag", true);
let disLikeRecordFlag = wx.$storage.get("disLikeRecordFlag");
this.setData({
disLikeRecordFlag
})
disLikeRecordFlag,
});
}
//视频弹窗
wx.$eventbus.on('getvideo', e => {
wx.$eventbus.on("getvideo", (e) => {
// console.log('getvideo event bus: ', e);
let url = wx.$util.getCurrentPageUrl()
if (url == '/pages/tab/index/index') {
let url = wx.$util.getCurrentPageUrl();
if (url == "/pages/tab/index/index") {
let obj = {
videoTitle: e.title,
videoSrc: e.src
}
this.getVideoUrl(obj)
videoSrc: e.src,
};
this.getVideoUrl(obj);
wx.nextTick(() => {
this.videocomp.play()
})
this.videocomp.play();
});
}
})
});
},
addAll(data) {
for (let i in data) {
let arr = [],
m = [],
n = []
data[i].map(item => {
arr = arr.concat(item.productList)
m = item.videoList
n = item.posterList
})
n = [];
data[i].map((item) => {
arr = arr.concat(item.productList);
m = item.videoList;
n = item.posterList;
});
const allData = {
name: '全部',
name: "全部",
productList: arr,
videoList: m,
posterList: n
}
data[i].unshift(allData)
posterList: n,
};
data[i].unshift(allData);
}
return data
return data;
},
//接口数据,本地数据对接
compositionData(localData, apiData) {
localData.forEach((item, index) => {
apiData.forEach((inner, idx) => {
if (item.name == inner.stage) {
item.sceneStatus = inner.sceneStatus
item.sceneStatus = inner.sceneStatus;
item.productList.forEach((outChild, outIndex) => {
inner.productList.forEach((innerChild, innerIndex) => {
if (outChild.proName == innerChild.productName) {
outChild.productStatus = innerChild.productStatus
outChild.productStatus = innerChild.productStatus;
}
})
})
});
});
}
})
})
});
});
// console.log('localData, apiData: ', localData);
// this.setData({
// senceData: localData
// })
},
getFirstSenceIndex(param) {
let actTndex = this.data.apiData.findIndex(item => item.sceneStatus == 1)
let actTndex = this.data.apiData.findIndex((item) => item.sceneStatus == 1);
// console.log('actTndex: ', actTndex);
this.setData({
actNum: actTndex
})
actNum: actTndex,
});
},
// 看产品接口
getProductByscene() {
productBysceneApi().then(res => {
let { code, data } = res
productBysceneApi().then((res) => {
let { code, data } = res;
if (code == 0) {
this.setData({
apiData: data
})
apiData: data,
});
// this.compositionData(senceData, this.data.apiData)
// this.getFirstSenceIndex();
}
})
});
},
// 看线索相关
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
this.prompt = this.selectComponent('#toast')
this.videocomp = this.selectComponent('#videocomp')
this.prompt = this.selectComponent("#toast");
this.videocomp = this.selectComponent("#videocomp");
},
// //点击收藏提示框
showToggleToast(e) {
let tipObj = e.detail
let tipObj = e.detail;
this.prompt.showToast({
type: tipObj.type,
title: tipObj.title,
......@@ -547,24 +552,24 @@ Page({
compelete: function () {
// console.log("toast框隐藏之后,会调用该函数");
//例如:跳转页面wx.navigateTo({ url: 'xxx' });
}
})
},
});
},
onReachBottom() {
console.log('滑到底部了')
console.log("滑到底部了");
},
// 展示海报
getSharePost(merchantId) {
battleMessageApi({ serviceMerchantId: merchantId })
.then(result => {
console.log(result)
let posterId = wx.$storage.get('posterId')
console.log(posterId)
if (posterId == result.valueUrl) return
.then((result) => {
console.log(result);
let posterId = wx.$storage.get("posterId");
console.log(posterId);
if (posterId == result.valueUrl) return;
// 为2是已经展示过了
wx.$storage.set('posterId', result.valueUrl)
let updatedTime = deleteSecond(result.createdTime)
console.log(updatedTime)
wx.$storage.set("posterId", result.valueUrl);
let updatedTime = deleteSecond(result.createdTime);
console.log(updatedTime);
this.setData({
posterItem: {
activityName: result.activityName,
......@@ -572,85 +577,87 @@ Page({
posterUrl: result.valueUrl,
// crowdFundActivityId: item.valueUrl,
updatedTime,
type: 'warReport'
}
})
type: "warReport",
},
});
// if (result.status && result.status != 2) {
// }
// debugger
})
.catch(err => { })
.catch((err) => {});
},
/**
* 生命周期函数--监听页面显示
*/
onShow: async function () {
let { userInfo } = wx.$storage.get()
!userInfo.isSuper && this.getSharePost(userInfo.subLoginUser.merchantId)
let { serviceMerchatList } = await getMockData() || { serviceMerchatList: [] }
let { userInfo } = wx.$storage.get();
!userInfo.isSuper && this.getSharePost(userInfo.subLoginUser.merchantId);
let { serviceMerchatList } = (await getMockData()) || {
serviceMerchatList: [],
};
this.setData({
isShowService: serviceMerchatList.includes(userInfo.merchantId + '')
})
isShowService: serviceMerchatList.includes(userInfo.merchantId + ""),
});
},
// 节流函数
throttle(fn, gaptime) {
if (gaptime == null || gaptime == undefined) {
gaptime = 200
gaptime = 200;
}
let _lastTime = null
let _lastTime = null;
return function () {
let _nowTime = +new Date()
let _nowTime = +new Date();
if (_nowTime - _lastTime > gaptime || !_lastTime) {
fn.apply(this, arguments)
_lastTime = _nowTime
fn.apply(this, arguments);
_lastTime = _nowTime;
}
}
};
},
onPageScroll: (function () {
let timer = null
let timer = null;
return function (e) {
// console.log("在滚动");
// 监听页面的滚动开始和结束
clearTimeout(timer)
clearTimeout(timer);
timer = setTimeout(() => {
// console.log("滚动结束");
wx.$eventbus.emit('evt_page_scroll', { scrollTop: e.scrollTop })
}, 300)
}
wx.$eventbus.emit("evt_page_scroll", { scrollTop: e.scrollTop });
}, 300);
};
})(),
//设置视频url
getVideoUrl(params) {
this.setData(params)
this.setData(params);
},
//申请活动
gotoApply() {
wx.$router.go('/packagesList/apply/pages/apply')
wx.$router.go("/packagesList/apply/pages/apply");
},
/** 客户数字化 */
sysMenuClick(e) {
console.log(e)
const { id } = e.detail
leftMenuIndex = id
console.log(e);
const { id } = e.detail;
leftMenuIndex = id;
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () { },
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () { },
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () { },
onPullDownRefresh: function () {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () { },
onShareTimeline: function () { }
})
onShareAppMessage: function () {},
onShareTimeline: function () {},
});
......@@ -3,9 +3,11 @@
import USERAPI from '~/api/usersApi/index'
import mineApi from '~/api/mineApi/index'
const IMAGES = Object.freeze({
icon0: `/personal/icon1.png`,
icon1: `/personal/icon2.png`,
icon2: `/personal/icon3.png`,
icon0: `personal/icon1.png`,
icon1: `personal/icon2.png`,
icon2: `personal/icon3.png`,
icon3: `personal/icon4.png`,
icon4: `personal/icon5.png`,
userAvatarUrl: `/personal/userAvatarUrl.png`
})
import { unreadApi, readApi } from '~/api/index.js'
......@@ -20,18 +22,27 @@ Page({
// isRead: false,
test: `/personal/icon2.png`,
boxItemList: [{
name: '客户管理',
path: 'packagesList.customerManagement'
}, {
name: '消息盒子',
path: 'packagesList.messageBox',
path: 'packageMine.messageBox',
hasRedPot: true,
isRead: false
}, {
name: '看线索',
path: 'packagesList.clue',
path: 'packageMine.clue',
hasRedPot: true,
isRead: false
}, {
name: '服务中心管理',
path: 'packageMine.serviceList',
isHide: true
}, {
name: '员工管理',
path: 'packageMine.staffList',
isHide: true
}, {
name: '客户管理',
path: 'packageMine.customerList',
isHide: true
}],
isShowService: false,
},
......@@ -133,13 +144,26 @@ Page({
})
},
judgeIsHide() {
let { boxItemList, userInfo } = this.data
let nameList = ['服务中心管理', '员工管理', '客户管理']
if(!userInfo.isSuper) {
nameList.forEach(item => {
let idx = boxItemList.findIndex(k => k.name == item)
this.setData({
[`boxItemList[${idx}].isHide`]: false
})
})
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: async function (options) {
let { userInfo } = wx.$storage.get()
let serviceMerchantId = userInfo.subLoginUser.merchantId
let serviceMerchantId = userInfo.subLoginUser?.merchantId
//解决因为使用await 异步导致数据没同步已经开始调用onshow方法
this.setData({
serviceMerchantId,
......@@ -150,6 +174,7 @@ Page({
this.setData({
isShowService: serviceMerchatList.includes(userInfo.merchantId + '')
})
this.judgeIsHide()
console.log(serviceMerchantId)
},
/**
......
......@@ -97,13 +97,17 @@ page {
.boxItemCon {
display: flex;
padding: 0 10rpx;
flex-wrap: wrap;
// padding: 0 10rpx;
.item {
margin-left: 66rpx;
margin-top: 32rpx;
// margin-left: 66rpx;
// margin-top: 32rpx;
// height: 96rpx;
// width: 96rpx;
width: 25%;
margin-top: 32rpx;
display: flex;
flex-direction: column;
align-items: center;
......
......@@ -15,11 +15,13 @@
<view class="utilBoxTitle">常用工具</view>
<view class="boxItemCon">
<view wx:for="{{boxItemList}}" wx:key="index" class="item" data-path="{{item.path}}" data-item="{{item}}" bind:tap="navGO">
<view class="imgcon">
<view wx:if="{{item.hasRedPot}}" class="redPot" hidden="{{!item.isRead}}" />
<glsx-image class="img" src="{{IMAGES['icon' + index]}}" />
</view>
<view class="name">{{item.name}}</view>
<block wx:if="{{!item.isHide}}">
<view class="imgcon">
<view wx:if="{{item.hasRedPot}}" class="redPot" hidden="{{!item.isRead}}" />
<glsx-image class="img" src="{{IMAGES['icon' + index]}}" />
</view>
<view class="name">{{item.name}}</view>
</block>
</view>
<!-- <view class="item" data-path="packagesList.customerManagement" bind:tap="navGO">
<view class="imgcon">
......
// pages/tab/output/components/BusiCard/BusiCard.js
import constantData from './constant/data'
Component({
/**
* 组件的属性列表
*/
properties: {
info: {
type: Object,
value: {}
},
sceneCode: {
type: String,
value: '-1'
},
fromPage: {
type: String,
value: 'client'
},
formData: {
type: Object,
value: () => { }
}
},
lifetimes: {
attached() {
let { fromPage, clientFormObj, staffFormObj } = this.data
let _obj = {}
switch (fromPage) {
case 'staff':
_obj = JSON.parse(JSON.stringify(staffFormObj))
break
default:
_obj = JSON.parse(JSON.stringify(clientFormObj))
break
}
this.setData({
formObj: _obj
})
}
},
/**
* 组件的初始数据
*/
data: {
formObj: {},
timeTabObj: constantData.timeTabObj,
clientFormObj: constantData.clientFormObj,
staffFormObj: constantData.staffFormObj
},
/**
* 组件的方法列表
*/
methods: {
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* pages/tab/output/components/BusiCard/BusiCard.wxss */
.busi-card {
background: #FFFFFF;
box-shadow: 0 2rpx 20rpx 0 #b4bacc52;
border-radius: 8rpx;
margin-bottom: 20rpx;
padding: 20rpx 0;
.title-box {
display: flex;
align-items: center;
padding: 0 20rpx;
.icon {
width: 40rpx;
height: 40rpx;
margin-right: 8rpx;
padding-bottom: 14rpx;
border-radius: 50%;
}
.title {
display: flex;
justify-content: space-between;
width: calc(100% - 40rpx);
border-bottom: 2rpx dotted #E0E0E0;
padding-bottom: 14rpx;
}
.title-tap {
height: 36rpx;
line-height: 36rpx;
background: #3e71fe1f;
border-radius: 4rpx;
font-size: 20rpx;
color: #3E71FE;
padding: 0 8rpx;
}
}
.bf-blue {
padding: 0;
}
.bf-blue::before {
display: inline-block;
content: '';
width: 6rpx;
height: 28rpx;
background: #3666FE;
border-radius: 0 4rpx 4rpx 0;
margin: -12rpx 16rpx 0 0;
}
.content {
display: flex;
flex-wrap: wrap;
padding: 0 20rpx;
}
.content-item {
width: 33.33%;
text-align: center;
font-size: 20rpx;
color: #999999;
margin: 10rpx 0;
.price {
font-weight: 500;
font-size: 28rpx;
color: #323436;
font-weight: 600;
margin-bottom: 16rpx;
}
}
}
\ No newline at end of file
<!--pages/tab/output/components/BusiCard/BusiCard.wxml-->
<wxs src="../index.wxs" module="filter" />
<view class="busi-card">
<view class="title-box" wx:if="{{fromPage == 'staff'}}">
<image wx:if="{{formObj.userAvatar}}" src="{{formObj.userAvatar}}" class="icon" />
<glsx-image wx:else src="personal/staff_defalut_avatar.png" class="icon" />
<view class="title">
{{info.userName}}
<view class="title-tap">{{timeTabObj[formData.timeIdx || '0']}}</view>
</view>
</view>
<view class="title-box bf-blue" wx:else>
<view class="title">{{info.merchantName || info.merchantName4s || ''}}</view>
</view>
<view class="content">
<view wx:for="{{formObj[sceneCode]}}" wx:key="index" class="content-item">
<view wx:if="{{info[item.name] == '未开通'}}" class="price">{{info[item.name]}}</view>
<view wx:else="" class="price">
{{item.prefix || ''}}
{{item.isNum ? filter.money_three_for_two_thousands(info[item.name] || 0.00) : (info[item.name] || 0)}}
{{item.suffix || ''}}
</view>
<view>{{item.label}}</view>
</view>
</view>
</view>
\ No newline at end of file
const timeTabObj = {
0: '今日指标',
1: '本月指标',
2: '累计指标'
}
// -1:全部;SC002:精品升级;SC001:会员权益/升级
const clientFormObj = {
'-1': [{
label: '精品升级',
name: 'boutiqueUpgrade',
prefix: '¥',
isNum: true
}, {
label: '售后众筹',
name: 'afterSalesCrowdfunding',
prefix: '¥',
isNum: true
}, {
label: '会员权益/升级',
name: 'vdUpgrade',
prefix: '¥',
isNum: true
}],
'SC002': [{
label: '营业额',
name: 'totalSubOrderOrderMoney',
prefix: '¥',
isNum: true
}, {
label: '到店贴膜量',
name: 'toShopCount'
}, {
label: '升级订单',
name: 'upgradeCount'
}, {
label: '战败订单',
name: 'noUpgradeCount'
}, {
label: '升级客单价',
name: 'calUpPrice',
prefix: '¥',
isNum: true
}, {
label: '升级转化率',
name: 'calTransform',
suffix: '%'
}],
'SC001': [{
label: '营业额',
name: 'turnover',
prefix: '¥',
isNum: true
}, {
label: '推荐客户量',
name: 'customerNum'
}, {
label: '成交客户量',
name: 'successNum'
}, {
label: '融合客单价',
name: 'fuseCustomerPrice',
prefix: '¥',
isNum: true
}, {
label: '权益客单价',
name: 'equityCustomerPrice',
prefix: '¥',
isNum: true
}, {
label: '转化率',
name: 'conversionRate',
suffix: '%'
}]
}
// -1:全部;SC002:精品升级;SC001:会员权益/升级
const staffFormObj = {
'-1': [{
label: '全部',
name: 'totalAmount',
prefix: '¥',
isNum: true
}, {
label: '精品升级',
name: 'totalBoutiqueAmount',
prefix: '¥',
isNum: true
}, {
label: '会员权益/升级',
name: 'totalVdAmount',
prefix: '¥',
isNum: true
}],
'SC002': [{
label: '营业额',
name: 'orderMoneyTotal',
prefix: '¥',
isNum: true
}, {
label: '升级客单价',
name: 'upgradeUnitPrice',
prefix: '¥',
isNum: true
}, {
label: '到店贴膜量',
name: 'toShopTotal'
}, {
label: '升级订单',
name: 'upgradeTotal'
}, {
label: '战败订单',
name: 'notUpgradeTotal'
}, {
label: '升级转化率',
name: 'upgradeRate',
suffix: '%'
}],
'SC001': [{
label: '营业额',
name: 'orderMoneyTotal',
prefix: '¥',
isNum: true
}, {
label: '推荐客户量',
name: 'recommendTotal'
}, {
label: '成交客户量',
name: 'dealTotal'
}, {
label: '融合客单价',
name: 'fusionUnitPrice',
prefix: '¥',
isNum: true
}, {
label: '权益客单价',
name: 'vdUnitPrice',
prefix: '¥',
isNum: true
}, {
label: '转化率',
name: 'convertRate',
suffix: '%'
}]
}
export default {
timeTabObj,
clientFormObj,
staffFormObj
}
\ No newline at end of file
// pages/tab/output/components/StaffSort/StaffSort.js
import { scenceList } from '~/pages/tab/index/constant/data'
const busiOptSceneCode = ['-1', 'SC001', 'SC002']
import mineApi from '~/api/mineApi/index'
import { getNowMonth } from '~/utils/format'
import { IMG_URL } from '~/utils/constantData'
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
IMG_URL,
busiOptSceneCode,
formData: {
// 0:全部-1;2:精品升级SC002;1:会员权益/升级SC001
busiIdx: 0,
sceneCode: '-1',
yqMerchantName: '服务中心',
timeIdx: 0
},
// 服务中心
popupShow: false,
serviceList: [],
// 筛选项折叠
isFold: false,
isInputClear: false,
baseData: {
busiList: [],
timeList: [{
label: '今日指标',
name: 'todayTime'
}, {
label: '本月指标',
name: 'monthTime'
}, {
label: '累计指标',
name: 'defaultTime'
}]
}
},
lifetimes: {
created() {
this.initTime()
},
attached() {
this.dealBusiList()
this.getSeviceCenter()
}
},
/**
* 组件的方法列表
*/
methods: {
dealSearchTime() {
let { dataObj, formData, baseData: { timeList } } = this.data
var params = dataObj[timeList[formData.timeIdx || 0]?.name || 'todayTime']
return params
},
dealParams() {
let { formData } = this.data
let params = {
sceneType: formData.busiIdx || '',
yqMerchantIds: formData.yqMerchantId || '',
userName: formData.userName || '',
...this.dealSearchTime()
}
return params
},
// handleInputeClear(e) {
// this.setData({
// isInputClear: true,
// ['formData.userName']: ''
// })
// console.log(this.data.isInputClear, 'isInputClear---')
// },
handleInput(e) {
let { attr } = e.currentTarget.dataset
let { value } = e.detail
this.setData({
['formData.' + attr]: value
})
},
changeFold() {
// let { isInputClear } = this.data
// if (isInputClear) {
// this.setData({
// isInputClear: false
// })
// return true
// }
this.setData({
isFold: !this.data.isFold
})
},
handleInputFocus() {
this.changeFold()
},
handleInputBlur() {
this.changeFold()
this.triggerEvent('staffSearch')
},
// 获取服务中心数据
getSeviceCenter() {
mineApi.getServiceCenterListAPI({}).then(res => {
let data = res || []
let serviceIds = data.map(val => { return val.yqMerchantId })
this.setData({
serviceList: res || [],
allServiceIds: serviceIds
})
})
},
// 筛选服务中心
filterTypeFn() {
this.setData({
popupShow: !this.data.popupShow
})
},
// 获取员工列表
handleServiceChange(e) {
wx.$api.hideLoading()
let { formData } = this.data
this.setData({
formData: {
...formData,
yqMerchantId: e.detail.yqMerchantId,
yqMerchantName: e.detail.yqMerchantName
}
})
this.triggerEvent('staffSearch')
},
// 格式化时间
initTime() {
let date = new Date()
let today = date.getDate()
let month = getNowMonth()
const todayTime = {
dataBeginDate: `${month}-${today} 00:00:00`,
dataEndDate: `${month}-${today} 23:59:59`
}
const monthTime = {
dataBeginDate: `${month}-01 00:00:00`,
dataEndDate: `${month}-${today} 23:59:59`
}
const defaultTime = {
dataBeginDate: '',
dataEndDate: `${month}-${today} 23:59:59`
}
this.setData({
dataObj: {
todayTime,
monthTime,
defaultTime
}
})
},
handleTimeChange() {
let { baseData: { timeList } } = this.data
wx.showActionSheet({
itemList: timeList.map(item => item.label),
success: res => {
this.setData({
['formData.timeIdx']: res.tapIndex
})
this.triggerEvent('staffSearch')
}
})
},
dealBusiList() {
let list = [{
name: '全部业务',
sceneCode: '-1'
}]
busiOptSceneCode.forEach(item => {
let _target = scenceList.find(k => k.sceneCode == item)
if (_target) {
list.push({
name: _target.name,
sceneCode: _target.sceneCode
})
}
})
this.setData({
['baseData.busiList']: list
})
},
handleClickTab(e) {
let { baseData: { busiList } } = this.data
// 筛选
wx.showActionSheet({
itemList: busiList.map(item => item.name),
success: res => {
this.setData({
['formData.busiIdx']: res.tapIndex,
['formData.sceneCode']: busiOptSceneCode[res.tapIndex]
})
this.triggerEvent('staffSearch')
}
})
},
}
})
{
"component": true,
"usingComponents": {
"select-service-popup": "../selectServicePopup/selectServicePopup"
}
}
\ No newline at end of file
/* pages/tab/output/components/StaffSort/StaffSort.wxss */
.total-tab {
box-sizing: border-box;
background: #FFFFFF;
display: flex;
justify-content: space-between;
height: 92rpx;
padding: 16rpx;
.tabs-box {
display: flex;
width: calc(100% - 138rpx);
}
.tab {
box-sizing: border-box;
display: inline-block;
width: auto;
height: 60rpx;
background: #F2F3F7;
border-radius: 32rpx;
padding: 13rpx 18rpx;
font-size: 24rpx;
color: #8A8C90;
margin-right: 16rpx;
flex-shrink: 0;
}
.tab.active {
background: #3666fe1a;
color: #3666FE;
}
.tab:last-child {
margin-right: 0;
}
.icon {
width: 32rpx;
height: 32rpx;
}
.right-box {
display: flex;
box-sizing: border-box;
height: 60rpx;
color: #8A8C90;
}
.input {
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
width: 136rpx;
height: 60rpx;
background: #F8F9FC;
border-radius: 38rpx;
padding: 0 20rpx;
margin-left: 10rpx;
transition: width 0.2s ease-out;
}
.input-flex {
display: flex;
align-items: center;
}
.icon-delete {
box-sizing: border-box;
width: 50rpx;
height: 60rpx;
text-align: center;
flex-shrink: 0;
.icon {
margin-top: 16rpx;
}
}
.long-input {
width: calc(100vw - 180rpx);
}
.input-placeholder {
font-size: 24rpx;
color: #858A94;
}
}
\ No newline at end of file
<!--pages/tab/output/components/StaffSort/StaffSort.wxml-->
<view class="total-tab">
<view wx:if="{{isFold}}" class="tab {{(formData.busiIdx != '0' || formData.yqMerchantId || formData.timeIdx != '0') ? 'active' : ''}}">
{{(formData.busiIdx != '0' || formData.yqMerchantId || formData.timeIdx != '0') ? '已选' : '筛选'}}
<glsx-image src="{{(formData.busiIdx != '0' || formData.yqMerchantId || formData.timeIdx != '0') ? 'output/sort.png' : 'output/sort-default.png'}}" class="icon" />
</view>
<scroll-view wx:else scroll-x="{{true}}">
<view class="tabs-box">
<view class="tab {{formData.busiIdx != '0' ? 'active' : ''}}" bindtap="handleClickTab">
{{baseData.busiList[formData.busiIdx || 0].name}}
<glsx-image src="{{formData.busiIdx != '0' ? 'output/icon-arrow-act.png' : 'output/icon-arrow.png'}}" class="icon" />
</view>
<view class="tab {{formData.yqMerchantId ? 'active' : ''}}" data-attr="tabActive" data-val="store" bindtap="filterTypeFn">
{{ formData.yqMerchantName }}
<glsx-image src="{{formData.yqMerchantId ? 'output/icon-arrow-act.png' : 'output/icon-arrow.png'}}" class="icon" />
</view>
<view class="tab {{formData.timeIdx != '0' ? 'active' : ''}}" bindtap="handleTimeChange">
{{baseData.timeList[formData.timeIdx || 0].label}}
<glsx-image src="{{formData.timeIdx != '0' ? 'output/icon-arrow-act.png' : 'output/icon-arrow.png'}}" class="icon" />
</view>
</view>
</scroll-view>
<view class="right-box input {{ isFold ? 'long-input' : '' }}">
<!-- <view class="right-box input long-input"> -->
<view class="input-flex">
<glsx-image src="output/searchIcon.png" class="icon" />
<input type="text" placeholder="{{isFold ? '请输入员工姓名搜索' : '搜索'}}" maxlength="30" value="{{formData.userName}}" placeholder-class="input-placeholder" data-attr="userName" confirm-type="search" bindinput="handleInput" bindfocus="handleInputFocus" bindblur="handleInputBlur" />
</view>
<!-- <view wx:if="{{isFold}}" class="icon-delete" bindtap="handleInputeClear" data-attr="userName">
<glsx-image src="output/icon-delete.png" class="icon" />
</view> -->
</view>
</view>
<select-service-popup wx:if="{{popupShow}}" bind:hidePopup="filterTypeFn" bind:getStaffList="handleServiceChange" selectInfo="{{formData}}" popShow="{{popupShow}}" serviceRange="{{serviceList}}" />
\ No newline at end of file
// pages/tab/output/components/TotalTab/TotalTab.js
import { scenceList } from '~/pages/tab/index/constant/data'
const busiOptSceneCode = ['-1', 'SC002', 'SC004', 'SC001']
import outputApi from '~/api/outputApi/index'
import { getNowMonth } from '~/utils/format'
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
busiOptSceneCode,
tabActive: 'store',
// tabActive: 'business',
formData: {
// 0:全部-1;1:精品升级SC002;2:售后众筹SC004;3:会员权益/升级SC001
busiIdx: 0,
sceneCode: '-1',
// 时间筛选Idx(全部,精品升级,会员权益)
timeIdx: 0,
// 产品/状态筛选Idx(售后众筹)
proIdx: 0,
statusIdx: 0
},
// 众筹-筛选
isCrowdPopupShow: false,
crowdFormData: {
proIdx: 0,
statusIdx: 0
},
baseData: {
busiList: [],
proList: [],
timeList: ['全部', '本月', '本日'],
actStatusList: ['全部', '申请中', '活动中', '已结束']
}
},
lifetimes: {
attached() {
this.initTime()
this.dealBusiList()
this.getProList('SC004')
}
},
/**
* 组件的方法列表
*/
methods: {
resetBusiSearch() {
this.setData({
['formData.timeIdx']: 0,
['formData.proIdx']: 0,
['formData.statusIdx']: 0
})
},
getProList(sceneCode) {
var params = {
sceneCode: sceneCode
}
outputApi.findProByScene(params).then(res => {
let list = res[0]?.productList || []
list.unshift({
productCode: '',
productName: '全部'
})
this.setData({
['baseData.proList']: list
})
})
},
dealBusiList() {
let list = [{
name: '全部',
sceneCode: '-1'
}]
busiOptSceneCode.forEach(item => {
let _target = scenceList.find(k => k.sceneCode == item)
if (_target) {
list.push({
name: _target.name,
sceneCode: _target.sceneCode
})
}
})
this.setData({
['baseData.busiList']: list
})
},
handleSet(e) {
let { attr, val } = e.currentTarget.dataset
this.setData({
[attr]: val
})
this.triggerEvent('tabChange', { tabActive: val })
},
handleClickTab(e) {
let { tabActive, baseData: { busiList } } = this.data
// 切换tab
if (tabActive != 'business') {
this.handleSet(e)
// this.handleSearch()
return true
}
// 筛选
wx.showActionSheet({
itemList: busiList.map(item => item.name),
success: res => {
this.resetBusiSearch()
this.setData({
['formData.busiIdx']: res.tapIndex,
['formData.sceneCode']: busiOptSceneCode[res.tapIndex]
})
this.handleBusiSearch()
}
})
},
handleTimeChange() {
let { baseData: { timeList } } = this.data
wx.showActionSheet({
itemList: timeList,
success: res => {
this.setData({
['formData.timeIdx']: res.tapIndex
})
this.handleBusiSearch()
}
})
},
// 众筹-筛选
handlePopupConChange(e) {
let { idx, attr } = e.currentTarget.dataset
this.setData({
[`crowdFormData.${attr}`]: idx
})
},
handleCrowdPopup() {
let { formData: { proIdx, statusIdx } } = this.data
this.setData({
['crowdFormData.proIdx']: proIdx,
['crowdFormData.statusIdx']: statusIdx,
isCrowdPopupShow: !this.data.isCrowdPopupShow
})
},
handleCrowdConfirm() {
let { crowdFormData: { proIdx, statusIdx } } = this.data
this.setData({
['formData.proIdx']: proIdx,
['formData.statusIdx']: statusIdx,
isCrowdPopupShow: !this.data.isCrowdPopupShow
})
this.handleBusiSearch()
},
// 格式化时间
initTime() {
let date = new Date()
let today = date.getDate()
let month = getNowMonth()
const todayTime = {
startTime: `${month}-${today} 00:00:00`,
endTime: `${month}-${today} 23:59:59`
}
const monthTime = {
startTime: `${month}-01 00:00:00`,
endTime: `${month}-${today} 23:59:59`
}
const defaultTime = {
startTime: '',
endTime: `${month}-${today} 23:59:59`
}
this.setData({
dataObj: {
todayTime,
monthTime,
defaultTime
}
})
},
dealSearchTime() {
let { dataObj, formData } = this.data
var params = {}
switch (formData.timeIdx) {
// 本月
case 1:
params = dataObj.monthTime
break
// 本日
case 2:
params = dataObj.todayTime
break
}
return params
},
dealSearchStatus() {
let { formData } = this.data
var activityStatuList = []
switch (formData.statusIdx) {
case 0:
activityStatuList = [1, 2, 3]
break
// 申请中
case 1:
activityStatuList = [1]
break
// 活动中
case 2:
activityStatuList = [2]
break
// 已结束
case 3:
activityStatuList = [3]
break
}
return activityStatuList
},
dealSearchCrowd() {
let params = []
let { formData, baseData: { proList } } = this.data
let attrToNum = {
'PC005': 1,
'PC006': 2,
'PC007': 3,
'PC008': 4,
'PC009': 5
}
if (formData.busiIdx == 2 && formData?.proIdx) {
params.categoryList = [attrToNum[proList[formData?.proIdx].productCode] || '-1']
params.activityStatusList = this.dealSearchStatus()
}
return params
},
dealParams() {
let { formData } = this.data
let params = {
type: formData.busiIdx || '',
...this.dealSearchTime(),
...this.dealSearchCrowd()
}
return params
},
handleBusiSearch() {
this.triggerEvent('busiSearch')
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* pages/tab/output/components/TotalTab/TotalTab.wxss */
.total-tab {
box-sizing: border-box;
background: #FFFFFF;
display: flex;
justify-content: space-between;
height: 92rpx;
padding: 16rpx;
.flex {
display: flex;
flex-shrink: 0;
}
.tab {
box-sizing: border-box;
height: 60rpx;
background: #F2F3F7;
border-radius: 32rpx;
padding: 13rpx 18rpx;
font-size: 24rpx;
color: #8A8C90;
}
.tab.active {
background: #3666fe1a;
color: #3666FE;
}
.tab:first-child {
margin-right: 16rpx;
}
.icon {
width: 32rpx;
height: 32rpx;
}
.right-box {
display: flex;
box-sizing: border-box;
height: 60rpx;
color: #8A8C90;
padding: 13rpx 0;
}
}
.popup-fix {
bottom: 110rpx !important;
}
.popup {
padding: 32rpx;
.title {
font-weight: 600;
font-size: 28rpx;
color: #000000;
margin-bottom: 16rpx;
}
.content {
display: flex;
flex-wrap: wrap;
}
.popup-tab {
box-sizing: border-box;
height: 60rpx;
background: #F5F3F3;
color: #8A8C90;
border-radius: 32rpx;
padding: 12rpx 20rpx;
margin: 0 16rpx 16rpx 0;
}
.popup-tab.active {
background: #3666fe1a;
color: #3666FE;
}
}
\ No newline at end of file
<!--pages/tab/output/components/TotalTab/TotalTab.wxml-->
<view class="total-tab">
<view class="flex">
<view class="tab {{tabActive =='store' ? 'active' : ''}}" data-attr="tabActive" data-val="store" bindtap="handleSet">门店经营汇总</view>
<view class="tab {{tabActive =='business' ? 'active' : ''}}" data-attr="tabActive" data-val="business" bindtap="handleClickTab">
业务经营汇总 | {{baseData.busiList[formData.busiIdx || 0].name}}
<glsx-image src="{{tabActive =='business' ? 'output/icon-arrow-act.png' : 'output/icon-arrow.png'}}" class="icon" />
</view>
</view>
<view class="right-box" wx:if="{{tabActive =='business'}}">
<view wx:if="{{busiOptSceneCode[formData.busiIdx] == 'SC004'}}" bindtap="handleCrowdPopup">{{baseData.proList[formData.proIdx].productName}}</view>
<view wx:else bindtap="handleTimeChange">{{baseData.timeList[formData.timeIdx]}}</view>
<glsx-image src="output/icon-arrow.png" class="icon" bindtap="{{busiOptSceneCode[formData.busiIdx] == 'SC004' ? 'handleCrowdPopup' : 'handleTimeChange'}}"/>
</view>
</view>
<!-- 众筹-筛选 -->
<popup show="{{isCrowdPopupShow}}" title="筛选" height="784rpx" bindconfirm="handleCrowdConfirm" bindhidePopup="handleCrowdPopup" custom-class="popup-fix">
<view class="popup">
<view class="title">产品筛选</view>
<view class="content">
<view class="popup-tab {{crowdFormData.proIdx == index ? 'active' : ''}}" wx:for="{{baseData.proList}}" wx:key="index" bindtap="handlePopupConChange" data-attr="proIdx" data-idx="{{index}}">{{item.productName}}</view>
</view>
<view class="title">活动状态</view>
<view class="content">
<view class="popup-tab {{crowdFormData.statusIdx == index ? 'active' : ''}}" wx:for="{{baseData.actStatusList}}" wx:key="index" bindtap="handlePopupConChange" data-attr="statusIdx" data-idx="{{index}}">{{item}}</view>
</view>
</view>
</popup>
\ No newline at end of file
......@@ -26,14 +26,38 @@ Component({
pageSize: 10
},
totalPages: -1,
list: []
list: [],
sceneCodeList: ['SC002', 'SC003', 'SC004', 'SC001'],
tabActive: 'store',
// 业务经营汇总
stickyScrollTop: 0,
stickyOffsetTop: 0,
formData: {
// 0:全部-1;1:精品升级SC002;2:售后众筹SC004;3:会员权益/升级SC001
busiIdx: 0,
sceneCode: '-1',
// 时间筛选Idx(全部,精品升级,会员权益)
timeIdx: 0,
// 产品/状态筛选Idx(售后众筹)
proIdx: 0,
statusIdx: 0
},
busiObj: {},
busiTotalList: [],
crowdOrderObj: {},
isAsk: {
client: false,
business: false
}
},
lifetimes: {
attached() {
wx.$eventbus.on('clientRefresh', res => {
this.clientRefresh()
this.getBusinessData()
})
this.getPMerchantInfo()
this.getBusinessData()
this.getClientApi()
}
},
......@@ -42,6 +66,180 @@ Component({
* 组件的方法列表
*/
methods: {
// tab切换
handleTabChange(e) {
let { tabActive } = e.detail
this.setData({
tabActive
})
},
getBusinessData() {
this.getBusiStatistics()
},
// tab-业务经营切换
handleBusiSearch(e) {
this.getBusiStatistics(true, true)
},
// 升降序
handleSort(e) {
let { detail } = e
let sortTabModule = this.selectComponent("#sortTab")
let sortTabFixModule = this.selectComponent("#sortTabFix")
sortTabModule.syncVal(detail)
sortTabFixModule.syncVal(detail)
this.getBusiStatistics(true)
},
// 吸顶
handleBusiScroll: wx.$util.debounce(function (e) {
this.setData({
stickyScrollTop: e?.detail?.scrollTop
})
}, 50),
resetBusiData() {
this.setData({
busiObj: {},
busiTotalList: [],
crowdOrderObj: {}
})
},
// 众筹数据处理
dealCrowdObj(data) {
let _obj = {
totalNum: data.activityTotal,
totalOrderCount: data.orderTotal,
totalAmount: data.totalAmount,
activityList: data.activityList || []
}
_obj.activityList.forEach(k => {
// 时间
k.time = k.startTime.slice(0, 16).replace(/-/g, '.') + ' - ' + k.endTime.slice(0, 16).replace(/-/g, '.')
let startTimeFormat = k.startTime.slice(0, 10).replace(/-/g, '/') + ' 00:00:00'
let nowDateFormat = new Date().toLocaleDateString().replace(/-/g, '/') + ' 23:59:59'
// activityStatus 1:未开始 2:进行中 3:已结束
switch (k.activityStatus) {
case 1:
k.interDays = parseInt((new Date(startTimeFormat).getTime() - new Date().getTime()) / (1000 * 60 * 60 * 24)) + 1
k.realTime = '-'
break
case 2:
let endTimeFormat = k.endTime.slice(0, 10).replace(/-/g, '/') + ' 23:59:59'
k.interDays = parseInt((new Date().getTime() - new Date(startTimeFormat).getTime()) / (1000 * 60 * 60 * 24)) + 1
k.toEndDays = parseInt((new Date(endTimeFormat).getTime() - new Date(nowDateFormat).getTime()) / (1000 * 60 * 60 * 24)) + 1
k.realTime = k.realStartTime?.slice(0, 16).replace(/-/g, '.') + ' - ' + '已开始' + k.interDays + '天'
break
case 3:
k.interDays = parseInt((new Date(nowDateFormat).getTime() - new Date(k.endTime.replace(/-/g, '/')).getTime()) / (1000 * 60 * 60 * 24)) + 1
k.realTime = (k.realStartTime?.slice(0, 16).replace(/-/g, '.') || '') + ' - ' + (k.realEndTime?.slice(0, 16).replace(/-/g, '.') || '')
break
}
})
this.setData({
crowdOrderObj: _obj
})
},
getBusiStatistics(isReset = false, isBusiTab = false) {
let { isAsk: { business } } = this.data
let _this = this
if (business) {
return true
}
let totalTabModule = this.selectComponent('#totalTab')
let busiSearchData = totalTabModule ? totalTabModule.dealParams() : {}
let sortTabModule = this.selectComponent('#sortTab')
if (sortTabModule && isBusiTab) {
sortTabModule.resetAllAsc()
}
let sortSearchData = sortTabModule ? sortTabModule.dealParams() : {}
this.setData({
formData: JSON.parse(JSON.stringify(totalTabModule.data.formData))
})
let { userInfo } = wx.$storage.get()
let { formData } = this.data
let params = {
...busiSearchData,
...sortSearchData,
serviceMerchantId: userInfo.subLoginUser.merchantId
}
this.setData({
['isAsk.business']: true
})
outputApi.getBusiStatistics(params).then(res => {
this.resetBusiData()
if (isReset) {
this.setData({
busiScrollTop: 0
})
}
this.setData({
triggered: false
})
if (formData.sceneCode == 'SC004') {
this.dealCrowdObj(res)
} else {
let _list = []
switch (formData.sceneCode) {
case '-1':
_list = res.merchantList || []
// 0:全部-1;1:精品升级SC002;2:售后众筹SC004;3:会员权益/升级SC001
let _openList = [{
code: 'SC002',
name: 'boutiqueUpgrade'
}, {
code: 'SC004',
name: 'afterSalesCrowdfunding'
}, {
code: 'SC001',
name: 'vdUpgrade'
}]
_list.forEach(item => {
_openList.forEach(k => {
if (!item.sceneCodes) {
item[k.name] = '未开通'
} else if (item.sceneCodes && !item.sceneCodes.includes(k.code)) {
item[k.name] = '未开通'
}
})
})
break
case 'SC002':
res.merchantList.forEach(item => {
let _dto = item.orderSummaryTotalDTO
_dto.calTransform = _dto.experienceCount ? Math.round((_dto.upgradeCount * 100) / _dto.experienceCount).toFixed(0) : '0'
_dto.calUpPrice = _dto.upgradeCount ? Math.round(_dto.totalSubOrderOrderMoney / _dto.upgradeCount).toFixed(2) : '0.00'
_list.push(_dto)
})
break
case 'SC001':
res.merchantList.forEach(item => {
let _dto = item.quotationMerchantStatisticsDTO
_dto.turnover = (_dto.turnover / 100).toFixed(2)
_dto.fuseCustomerPrice = (_dto.fuseCustomerPrice / 100).toFixed(2)
_dto.equityCustomerPrice = (_dto.equityCustomerPrice / 100).toFixed(2)
_dto.conversionRate = (_dto.conversionRate * 100).toFixed(0)
_list.push(_dto)
})
break
}
this.setData({
busiObj: res,
busiTotalList: _list
})
}
}).finally(function () {
_this.setData({
['isAsk.business']: false
})
})
},
// 门店经营汇总-start
getPMerchantInfo() {
let { userInfo } = wx.$storage.get()
this.setData({
......@@ -54,7 +252,6 @@ Component({
},
clientRefresh(isPull = false) {
this.getPMerchantInfo()
console.log('clientRefresh');
this.setData({
['pageObj.currentPage']: 1,
list: []
......@@ -84,12 +281,25 @@ Component({
})
},
getList() {
let { sceneCodeList, isAsk: { client } } = this.data
let _this = this
if (client) {
return true
}
this.setData({
['isAsk.client']: true
})
outputApi.getCustomerPageList({ merchantId: this.data.pMerchantId, ...this.data.pageObj }).then(res => {
var list = this.data.list
list = list.concat(res.list)
list.forEach((item, index) => {
item.scenePriceList = []
item.sceneList.forEach((k, idx) => {
item['scene' + (idx + 1)] = item.sceneList[idx].flag
let i = sceneCodeList.findIndex(m => m == k.sceneCode)
item.scenePriceList[i] = {
total: item.sceneList[idx].totalMoney || 0
}
})
item.isOpenScene = item.sceneList.map(item => item.flag).some(item => item == true)
})
......@@ -97,6 +307,10 @@ Component({
list: list,
totalPages: res.pages
})
}).finally(function () {
_this.setData({
['isAsk.client']: false
})
})
},
onReachBottom() {
......@@ -136,7 +350,6 @@ Component({
},
/**长按海报 */
async longtouch(e) {
console.log('长按海报', e)
this.clientRefresh()
let { activityId } = e.detail
const res = await outputApi.reportPosterTrack({
......@@ -149,17 +362,12 @@ Component({
var params = {
merchantId: currentItem.merchantId,
merchantName: currentItem.merchantName,
// scene1: currentItem.scene1,
// scene2: currentItem.scene2,
// scene3: currentItem.scene3,
// scene4: currentItem.scene4,
// sceneList: currentItem.sceneList,
// sceneCodeList: currentItem.sceneList.map(item => item.sceneCode),
pMerchantId: this.data.pMerchantId,
pMerchantName: this.data.pMerchantInfo.subLoginUser.merchantName,
isSuper: this.data.pMerchantInfo.isSuper
}
wx.$router.go('/packagesList/packageOutput/pages/summary', params)
}
// 门店经营汇总-end
}
})
{
"component": true,
"usingComponents": {
"scene-box": "../../../../../components/SceneBox/SceneBox"
"scene-box": "../../../../../components/SceneBox/SceneBox",
"total-tab": "../TotalTab/TotalTab",
"busi-card": "../BusiCard/BusiCard",
"output-crowdfund": "../outputCrowdfund/outputCrowdfund",
"sort-tab": "../sortTab/sortTab"
}
}
\ No newline at end of file
/* pages/tab/output/components/client/client.wxss */
.client {
box-sizing: border-box;
height: 100%;
height: calc(100% - 92rpx);
color: #323436;
// padding-top: 16rpx;
background-color: #F2F3F7;
// background-color: #F2F3F7;
background-color: #FFFFFF;
}
.client-box {
margin: 0 16rpx;
}
.shadow {
box-shadow: 0 2rpx 20rpx 0 #b4bacc52;
// box-shadow: 0 2rpx 20rpx 0 red;
}
.output-box {
margin: 16rpx 0;
}
.flex {
display: flex;
}
......@@ -42,6 +52,17 @@
}
}
.sort-fix {
box-sizing: border-box;
width: 100%;
height: 86rpx;
padding: 0 16rpx;
}
.sort-hide {
display: none;
}
.price-txt {
// font-family: 'test';
font-weight: Bold;
......
<!-- pages/tab/output/components/client/client.wxml -->
<wxs src="../../index.wxs" module="filter" />
<scroll-view class="client" scroll-y="{{true}}" refresher-enabled="{{true}}" refresher-triggered="{{triggered}}" bindscrolltolower="onReachBottom" bindrefresherrefresh="onBindRefresh" lower-threshold='50' scroll-top="{{scrollTop}}">
<!-- <view class="test">1234567890</view> -->
<total-tab id="totalTab" bindbusiSearch="handleBusiSearch" bindtabChange="handleTabChange"></total-tab>
<view class="sort-fix {{stickyScrollTop >= 96 ? '' : 'sort-hide'}}" wx:if="{{tabActive == 'business'}}">
<sort-tab id="sortTabFix" sceneCode="{{formData.sceneCode}}" bindhandleSort="handleSort"></sort-tab>
</view>
<scroll-view wx:if="{{tabActive == 'store'}}" class="client" scroll-y="{{true}}" refresher-enabled="{{true}}" refresher-triggered="{{triggered}}" bindscrolltolower="onReachBottom" bindrefresherrefresh="onBindRefresh" lower-threshold='50' scroll-top="{{scrollTop}}">
<view class="client-box">
<view class="profit-box flex-between">
<text>总收益</text>
<text class="price-txt">¥{{filter.money_three_for_two_thousands(totalProfit || 0.00)}}</text>
</view>
<view wx:for="{{list}}" wx:key="index" bindtap="handleJump" data-idx="{{index}}">
<view wx:for="{{list}}" class="shadow" wx:key="index" bindtap="handleJump" data-idx="{{index}}">
<view class="box {{item.activityLastUnSharedInfo ? 'share' : ''}}">
<view class="head flex-between">
<view class="name ">{{item.merchantName}}</view>
......@@ -15,7 +18,7 @@
</view>
<!-- 场景内容 -->
<view class="box-content">
<scene-box sceneInfo="{{item}}" hasLockIcon="{{false}}" />
<scene-box sceneInfo="{{item}}" hasLockIcon="{{false}}" scenePriceList="{{item.scenePriceList}}" />
<!-- 通知 -->
<view class="box-bottom">
<view wx:if="{{item.msgList.length}}" class="flex">
......@@ -53,4 +56,34 @@
</view>
</view>
</scroll-view>
<crowdfund-poster item="{{posterItem}}" id="poster" scrollImg="{{false}}" bindlongtouch="longtouch" />
<scroll-view wx:if="{{tabActive == 'business'}}" class="client" id="scroller" scroll-y="{{true}}" refresher-enabled="{{true}}" refresher-triggered="{{triggered}}" bindrefresherrefresh="handleSort" lower-threshold='50' bind:scroll="handleBusiScroll" scroll-top="{{busiScrollTop}}">
<view class="client-box">
<!-- 总收益 -->
<view wx:if="{{formData.sceneCode != 'SC004'}}">
<view class="profit-box flex-between">
<text>总收益</text>
<text class="price-txt">¥{{filter.money_three_for_two_thousands(busiObj.totalAmount || 0.00)}}</text>
</view>
<view>
<sort-tab id="sortTab" sceneCode="{{formData.sceneCode}}" bindhandleSort="handleSort"></sort-tab>
</view>
</view>
<!-- 售后众筹 -->
<view class="output-box" wx:if="{{formData.sceneCode == 'SC004'}}">
<output-crowdfund wx:if="{{formData.sceneCode == 'SC004'}}" orderObj="{{crowdOrderObj}}" proIdx="{{formData.proIdx}}"></output-crowdfund>
<view class="end-txt">
{{ crowdOrderObj.activityList.length ? '到底啦!' : '暂无数据' }}
</view>
</view>
<!-- 0:全部;1:精品升级;3:会员权益/升级 -->
<view wx:else>
<view wx:for="{{busiTotalList}}" wx:key="index">
<busi-card info="{{item}}" sceneCode="{{formData.sceneCode}}"></busi-card>
</view>
<view class="end-txt">
{{busiTotalList.length ? '到底啦!' : '暂无数据'}}
</view>
</view>
</view>
</scroll-view>
<crowdfund-poster item="{{posterItem}}" id="poster" scrollImg="{{false}}" bindlongtouch="longtouch" />
\ No newline at end of file
/**设置千分位 */
var setPrice = function (n = 0.0) {
if ((typeof n == 'string' || typeof n == 'number') && !isNaN(n)) {
n = parseFloat(n).toFixed(2)
var r = getRegExp('(d{1,3})(?=(d{3})+(?:.))', 'g')
var p = n.replace(r, ',')
return p
// var r = getRegExp('/./', 'g')
// var p = n.replace(r, 'test')
// return n
} else {
console.log(n, '不是一个数字', !isNaN(n))
}
}
var threeNumForTwo = {
money_three_for_two_thousands: function (num) {
//num = parseInt(num);
// return num
var num = num + ''
var d = ''
if (num.slice(0, 1) == '-') {
d = num.slice(0, 1)
num = num.slice(1)
}
var len = num.length
var index = num.indexOf('.')
if (index == -1) {
num = num + '.00'
} else if (index + 2 == len) {
num = num + '0'
}
var index = num.indexOf('.') // 字符出现的位置
var num2 = num.slice(-3)
num = num.slice(0, index)
var result = ''
while (num.length > 3) {
result = ',' + num.slice(-3) + result
num = num.slice(0, num.length - 3)
}
if (num) {
result = num + result
}
// return result
return d + (result + num2)
}
}
/*
* 导出
*/
module.exports = {
setPrice: setPrice,
money_three_for_two_thousands: threeNumForTwo.money_three_for_two_thousands //暴露接口调用
}
// packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.js
import { IMG_URL } from '~/utils/constantData'
const IMAGES = Object.freeze({
download: `${IMG_URL}/output/download.webp`
})
Component({
/**
* 组件的属性列表
*/
properties: {
orderObj: {
type: Object,
value: () => { }
},
hasReport: {
type: Boolean,
value: true
},
proIdx: {
type: String,
value: '0'
}
},
options: {
styleIsolation: 'shared'
},
/**
* 组件的初始数据
*/
data: {
IMGURL: IMG_URL,
IMAGES,
isShowTip: true,
isShowPoster: false,
orderFormList: [
{
label: '总场次',
name: 'totalNum'
},
{
label: '总订单',
name: 'totalOrderCount'
},
{
label: '成交金额',
name: 'totalAmount',
prefix: '¥'
}
],
merchantFormList: [
{
label: '预计活动时间',
name: 'time'
},
{
label: '实际活动时间',
name: 'realTime'
},
{
label: '订单数',
name: 'orderCount',
className: 'font-number'
},
{
label: '产值',
name: 'realAmount',
className: 'red font-number',
prefix: '¥',
isNumber: true
},
{
label: '预估产值',
name: 'predictAmount',
className: 'font-number',
prefix: '¥',
isNumber: true
}
]
},
/**
* 组件的方法列表
*/
methods: {}
})
{
"component": true,
"usingComponents": {}
}
/* packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.wxss */
.crowdfund-layout {
padding-bottom: 136rpx;
.crowdfund-box {
background: #FFFFFF;
border-radius: 8rpx;
margin-bottom: 20rpx;
padding: 0;
}
.flex {
display: flex;
}
.order {
background: #FFFAFA;
display: flex;
justify-content: space-between;
align-items: center;
&-block {
width: 33.3%;
text-align: center;
font-weight: 500;
font-size: 28rpx;
color: #393B3E;
padding: 20rpx 0;
}
&-txt {
height: 40rpx;
line-height: 40rpx;
margin-bottom: 14rpx;
font-weight: 700;
// font-family: 'number';
}
&-label {
font-size: 20rpx;
color: #8A8C90;
}
}
.merchant {
padding: 0 32rpx 32rpx;
box-shadow: 0 2rpx 20rpx 0 #b4bacc52;
.head {
box-sizing: border-box;
position: relative;
display: flex;
align-items: center;
// height: 70rpx;
// line-height: 70rpx;
padding: 16rpx 0;
line-height: 40rpx;
font-size: 28rpx;
font-weight: 600;
border-bottom: 1rpx dashed #CCCED1;
margin-bottom: 16rpx;
.icon {
width: 40rpx;
height: 40rpx;
}
&-title {
font-size: 24rpx;
color: #323436;
margin-left: 8rpx;
}
&-link {
font-size: 24rpx;
color: #3666FE;
line-height: 37rpx;
}
.icon-download {
width: 36rpx;
height: 36rpx;
vertical-align: middle;
}
.down-tips {
position: absolute;
right: -40rpx;
top: -50rpx;
height: 52rpx;
line-height: 52rpx;
font-size: 20rpx;
color: #FFFFFF;
background: rgba(0, 0, 0, 0.60);
padding: 0 16rpx;
border-radius: 12rpx;
font-weight: 500;
&::after {
display: inline-block;
content: '';
position: absolute;
bottom: -28rpx;
right: 40rpx;
width: 0;
height: 0;
border: 18rpx solid;
border-color: #686868 transparent transparent;
}
}
}
.content {
&-title {
font-size: 28rpx;
color: #323436;
font-weight: 600;
padding-bottom: 28rpx;
}
// 表单
&-row {
display: flex;
height: 40rpx;
line-height: 40rpx;
font-size: 26rpx;
color: #8A8C90;
margin-bottom: 16rpx;
}
&-label {
width: 156rpx;
flex-shrink: 0;
margin-right: 16rpx;
}
&-txt {
color: #323436;
}
&-txt.red {
color: #F35251;
}
// 排名
&-rank {
background: #F7F8FC;
border-radius: 20rpx;
margin-top: 16rpx;
padding: 0 12rpx;
.rank-title {
position: relative;
height: 72rpx;
line-height: 72rpx;
text-align: center;
font-size: 26rpx;
color: #5A6066;
font-weight: 600;
border-bottom: 1rpx solid rgba(204, 206, 209, 0.50);
// .activity-status {
// position: absolute;
// top: 0;
// right: 22rpx;
// font-size: 24rpx;
// }
}
.rank-table {
color: #5A6066;
font-size: 20rpx;
.rank {
display: flex;
justify-content: space-between;
height: 64rpx;
padding: 20rpx 16rpx;
border-bottom: 1rpx dotted rgba(204, 206, 209, 0.50);
.rank-left {
display: flex;
}
&-num {
width: 40rpx;
line-height: 64rpx;
text-align: center;
}
.rank-head {
position: relative;
width: 64rpx;
height: 64rpx;
margin-right: 12rpx;
.icon-wechat {
position: absolute;
bottom: -4rpx;
right: -4rpx;
width: 40rpx;
height: 40rpx;
}
image {
width: 100%;
height: 100%;
border-radius: 50%;
}
}
.rank-content {
font-size: 20rpx;
.rank-row {
position: relative;
display: flex;
height: 32rpx;
line-height: 32rpx;
margin-bottom: 8rpx;
.down-tips {
position: absolute;
left: -116rpx;
top: -60rpx;
height: 52rpx;
line-height: 52rpx;
font-size: 20rpx;
color: #FFFFFF;
background: rgba(0, 0, 0, 0.60);
padding: 0 16rpx;
border-radius: 12rpx;
font-weight: 500;
&::after {
display: inline-block;
content: '';
position: absolute;
bottom: -27rpx;
right: 67rpx;
width: 0;
height: 0;
border: 18rpx solid;
border-color: #686868 transparent transparent;
}
}
.rank-row-name {
max-width: 200rpx;
font-size: 24rpx;
color: #3666FE;
margin-right: 12rpx;
}
.name-disabled {
max-width: 200rpx;
font-size: 24rpx;
color: #5A6066;
margin-right: 12rpx;
}
&-dept {
color: #8A8C90;
}
&-txt {
color: rgba(90, 96, 102, 1);
padding: 0 10rpx 0 0;
}
&-txt::after {
display: inline-block;
content: '';
background-color: #CCCED1;
width: 1.2rpx;
height: 54%;
margin-left: 10rpx;
}
&-txt:last-child::after {
background-color: transparent;
}
}
.rank-row:last-child {
margin-bottom: 0;
}
}
.rank-price {
text-align: right;
font-size: 26rpx;
color: #8A8C90;
height: 64rpx;
line-height: 64rpx;
}
.txt-red {
color: #F35251;
}
// .th,
// .td {
// width: calc((100% - 116rpx) / 4);
// .icon-rank {
// width: 24rpx;
// height: 24rpx;
// vertical-align: middle;
// padding-right: 4rpx;
// }
// }
}
.rank:last-child {
border: none;
}
.tr-no-data {
text-align: center;
height: 32rpx;
line-height: 32rpx;
padding-bottom: 16rpx;
}
.btn-more {
height: 56rpx;
line-height: 56rpx;
// color: #5A6066;
// border: 2rpx solid #EEEEEE;
// border-radius: 28rpx;
text-align: center;
margin: 0 20rpx;
.icon-more {
width: 92rpx;
height: 36rpx;
}
}
}
}
// 建议
&-suggest {
margin-top: 32rpx;
.suggest-title {
width: 116rpx;
height: 36rpx;
line-height: 36rpx;
font-weight: 600;
font-size: 20rpx;
color: #3E71FE;
background: rgba(62, 113, 254, 0.12);
border-radius: 4rpx;
}
.suggest-txt {
font-size: 24rpx;
color: #323436;
line-height: 40rpx;
margin: 12rpx 0 16rpx;
}
.suggest-block {
line-height: 40rpx;
background: #FFF9F2;
border-radius: 20rpx;
padding: 16rpx;
.suggest-step {
display: flex;
.step-label {
width: 54rpx;
font-size: 20rpx;
color: #323436;
margin-right: 18rpx;
}
.step-txt {
width: calc(100% - 72rpx);
font-size: 22rpx;
color: #8A8C90;
}
}
}
}
// 战报
.new-report {
display: flex;
margin-top: 20rpx;
height: 52rpx;
line-height: 52rpx;
font-size: 20rpx;
color: #5A6066;
.report-left {
box-sizing: border-box;
display: flex;
font-size: 20rpx;
color: #3666FE;
padding: 0 20rpx;
height: 100%;
background: rgba(54, 102, 254, 0.06);
border: 2rpx solid rgba(62, 113, 254, 0.70);
border-radius: 30rpx;
margin-right: 4rpx;
.icon-report {
width: 32rpx;
height: 32rpx;
vertical-align: middle;
margin-top: -2rpx;
}
}
}
}
}
}
.downloadIcon {
width: 40rpx;
height: 40rpx;
}
// .totalAmount{
// font-family: 'number';
// }
\ No newline at end of file
<!-- packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.wxml -->
<wxs src="../index.wxs" module="filter" />
<view class="crowdfund-layout">
<view wx:if="{{proIdx == '0'}}" class="profit-box flex-between">
<text>总收益</text>
<text class="price-txt">¥{{filter.money_three_for_two_thousands(orderObj.totalAmount || 0.00)}}</text>
</view>
<view wx:else class="crowdfund-box order">
<view class="order-block" wx:for="{{orderFormList}}" wx:key="index">
<view class="order-txt font-number">
<text wx:if="{{item.prefix}}">{{item.prefix}}</text>
<text wx:if="{{item.name == 'totalAmount'}}">{{filter.money_three_for_two_thousands(orderObj[item.name] || 0.00)}}</text>
<text wx:else>{{orderObj[item.name]}}</text>
</view>
<view class="order-label">{{item.label}}</view>
</view>
</view>
<view class="crowdfund-box merchant" wx:for="{{orderObj.activityList}}" wx:key="index">
<view class="head">
<!-- text-hide -->
<glsx-image src="output/icon-head.png" class="icon" />
<view class="head-title">{{item.merchantName}}</view>
</view>
<view class="content">
<view class="content-title" data-item="{{item}}">
{{item.activityName}}
</view>
<view class="content-row" wx:for="{{merchantFormList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
<view class="content-label">{{subItem.label}}</view>
<view class="content-txt {{subItem.className}}">
<text wx:if="{{subItem.prefix}}">{{subItem.prefix}}</text>
{{subItem.isNumber ? filter.money_three_for_two_thousands(item[subItem.name]) : item[subItem.name]}}
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
// pages/tab/output/components/accountSwitchingPop/accountSwitchingPop.js
import { IMG_URL } from '~/utils/constantData.js'
Component({
options: {
addGlobalClass: true
},
/**
* 组件的属性列表
*/
properties: {
popShow: {
type: Boolean,
value: false,
observer: function (n) {
if (n) {
let { serviceRange, selectInfo } = this.data
let activeIndex = serviceRange.findIndex(v => v.yqMerchantId == selectInfo.yqMerchantId)
if (serviceRange.length) serviceRange.unshift({yqMerchantId: '', yqMerchantName: '全部'})
serviceRange.forEach((item, ind) => {
item.show = true
if (activeIndex == (ind - 1)) {
item.act = true
} else {
item.act = false
}
this.setData({
serviceRange
})
})
this.setData({
searchKeyword: ''
})
}
}
},
serviceRange: Object,
selectInfo: Object
},
/**
* 组件的初始数据
*/
data: {
IMG_URL,
serviceList: [],
searchKeyword: ''
},
observers: {
serviceRange: function (e) {
this.setData({
serviceList: e || []
})
}
},
/**
* 组件的方法列表
*/
methods: {
hidePopup() {
this.triggerEvent('hidePopup')
},
confirm() {
let { serviceRange, subIndex } = this.data
let actObj = serviceRange.find((item, index) => {
if (item.act) {
subIndex = index
}
return item.act
})
if (!actObj) {
return wx.$api.showToast({
title: '请选择服务中心',
icon: 'error'
})
} else {
if (actObj.yqMerchantId == '' && actObj.yqMerchantName == '全部') actObj.yqMerchantName = '全部服务中心'
this.changePicker(actObj)
}
},
changePicker(actObj) {
// 修改对应下标显示
wx.$api.showLoading('加载中...')
this.triggerEvent('getStaffList', {...actObj})
this.hidePopup()
},
select(e) {
let { index } = e.currentTarget.dataset
let { serviceRange } = this.data
serviceRange.forEach((item, ind) => {
if (index == ind) {
item.act = true
} else {
item.act = false
}
this.setData({
serviceRange
})
})
},
search(e) {
let { serviceRange } = this.data
let { value } = e.currentTarget.dataset && Object.keys(e.currentTarget.dataset).length ? e.currentTarget.dataset : e.detail
serviceRange.forEach(item => {
item.act = false
item.show = item.yqMerchantName?.includes(value)
})
this.setData({
serviceRange
})
},
input(e) {
let { value } = e.detail
this.setData({
searchKeyword: value
})
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* packagesList/mineDetail/components/selectService/selectService.wxss */
.search-box {
width: 100%;
height: 104rpx;
padding-left: 32rpx;
display: flex;
align-items: center;
background-color: #fff;
position: sticky;
top: 0;
left: 0;
z-index: 9;
box-sizing: border-box;
.search {
width: 144rpx;
height: 100%;
color: #666;
box-sizing: border-box;
padding: 0 24rpx;
.text-center {
font-size: 24rpx;
border-radius: 12rpx;
width: 100%;
font-size: 32rpx;
color: #858A94;
.search-filter {
margin-left: 6rpx;
width: 24rpx;
height: 24rpx;
}
}
}
.search-input {
background: #F7F8FA;
border-radius: 38rpx;
width: 606rpx;
height: 72rpx;
display: flex;
align-items: center;
padding-left: 26rpx;
.input-placeholder {
color: rgba(200, 201, 204, .89);
}
.search-icon {
width: 28rpx;
height: 28rpx;
}
.search-clear {
width: 36rpx;
height: 36rpx;
margin: 0 26rpx 0 10rpx;
}
.input {
font-size: 28rpx;
width: calc(100% - 136rpx);
margin-left: 10rpx;
}
}
}
.list {
height: calc(100% - 100rpx) !important;
}
.itemCon {
box-sizing: border-box;
width: 100%;
height: 80rpx;
color: #323436;
line-height: 80rpx;
padding: 0 32rpx;
}
.active {
background: #F0F7FF;
font-size: 28rpx;
color: #3666FE;
}
\ No newline at end of file
<!--packagesList/mineDetail/components/selectService/selectService.wxml-->
<popup
show="{{popShow}}"
bind:hidePopup="hidePopup"
bindconfirm="confirm"
height="60%">
<view class="search-box">
<view class="search-input">
<glsx-image src="output/searchIcon.png" class="search-icon" />
<input
type="text"
placeholder="请搜索服务中心"
class="input"
value="{{keyword}}"
placeholder-class="input-placeholder"
bindinput="input"
bindconfirm="search" />
<block wx:if="{{keyword}}">
<image src="/images/clear.png" class="search-clear" bindtap="clear" />
</block>
</view>
<view class="search text-center" bindtap="search" data-value="{{searchKeyword}}">
<view class="text-center">搜索</view>
</view>
</view>
<scroll-view
scroll-y
enable-back-to-top
refresher-enabled="{{true}}"
bindrefresherrefresh="refreshList"
refresher-threshold="104"
scroll-top="{{scrollTop}}"
class="list"
style="height:100%;"
data-type="message"
refresher-triggered="{{triggered}}">
<block wx:for="{{serviceList}}" wx:key="index">
<view
class="itemCon text-hide {{item.act?'active':''}}"
data-index="{{index}}"
hidden="{{!item.show}}"
bindtap="select">
{{item.yqMerchantName}}
</view>
</block>
</scroll-view>
</popup>
// pages/tab/output/components/sortTab/sortTab.js
Component({
/**
* 组件的属性列表
*/
properties: {
title: {
type: String,
value: '合作门店'
},
sceneCode: {
type: String,
value: '-1'
}
},
/**
* 组件的初始数据
*/
data: {
actIdx: '-1',
imgObj: {
'': 'default',
1: 'up',
2: 'down',
},
// 全部-1;精品升级SC002;会员权益/升级SC001
// asc:''-无, 1-升序,2-降序
formObj: {
'-1': [{
label: '精品升级',
asc: '',
value: 1
}, {
label: '售后众筹',
asc: '',
value: 2
}, {
label: '会员权益/升级',
asc: '',
value: 3
}],
'SC002': [{
label: '营业额',
asc: '',
value: 4
}, {
label: '升级客单价',
asc: '',
value: 5
}, {
label: '到店贴膜量',
asc: '',
value: 6
}, {
label: '升级订单',
asc: '',
value: 7
}, {
label: '战败订单',
asc: '',
value: 8
}, {
label: '升级转化率',
asc: '',
value: 9
}],
'SC001': [{
label: '营业额',
asc: '',
value: 4
}, {
label: '推荐客户量',
asc: '',
value: 5
}, {
label: '成交客户量',
asc: '',
value: 6
}, {
label: '融合客单价',
asc: '',
value: 7
}, {
label: '权益客单价',
asc: '',
value: 8
}, {
label: '转化率',
asc: '',
value: 9
}]
}
},
/**
* 组件的方法列表
*/
methods: {
// 同步值
syncVal(value) {
this.setData({
...value
})
},
// 处理升降序排序参数
dealParams() {
let { actIdx, formObj, sceneCode } = this.data
let _params = {}
if (actIdx != -1) {
let _item = formObj[sceneCode][actIdx]
_params = {
orderBy: _item.value,
asc: _item.asc
}
}
return _params
},
resetAllAsc() {
let { actIdx, sceneCode, formObj } = this.data
if (actIdx == '-1') {
return true
}
let _list = Object.keys(formObj)
_list.forEach(item => {
formObj[item].forEach(k => {
k.asc = ''
})
})
this.setData({
formObj,
actIdx: '-1'
})
},
resetAsc() {
let { actIdx, sceneCode } = this.data
if (actIdx == '-1') {
return true
}
// let _list = Object.keys(formObj)
// _list.forEach(item => {
// formObj[item].forEach(k => {
// k.asc = ''
// })
// })
this.setData({
[`formObj.${sceneCode}[${actIdx}].asc`]: ''
})
},
handleSort(e) {
let { idx } = e.currentTarget.dataset
let { formObj, sceneCode, actIdx } = this.data
if (idx != actIdx) {
this.resetAsc()
}
let _actIdx = idx
let _asc = ''
switch (formObj[sceneCode][idx]?.asc) {
case '1':
_asc = ''
_actIdx = '-1'
break
case '2':
_asc = '1'
break
case '':
_asc = '2'
break
}
this.setData({
[`formObj.${sceneCode}[${idx}].asc`]: _asc,
actIdx: _actIdx
})
this.triggerEvent('handleSort', this.data)
},
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* pages/tab/output/components/sortTab/sortTab.wxss */
.sort-tab {
display: flex;
box-sizing: border-box;
width: calc(100vw - 32rpx);
height: 86rpx;
line-height: 86rpx;
background-color: #FFFFFF;
padding: 0 20rpx;
margin-bottom: 4rpx;
.title {
width: 196rpx;
flex-shrink: 0;
}
.flex {
display: flex;
}
.sort-scroll {
display: flex;
width: calc(100% - 196rpx);
.item {
display: flex;
flex-shrink: 0;
justify-content: center;
align-items: center;
margin-right: 20rpx;
}
.icon {
width: 32rpx;
height: 32rpx;
}
}
}
\ No newline at end of file
<!--pages/tab/output/components/sortTab/sortTab.wxml-->
<view class="sort-tab">
<ciew class="title">{{title}}</ciew>
<scroll-view class="sort-scroll" scroll-x="true">
<view class="flex">
<view wx:for="{{formObj[sceneCode]}}" wx:key="index" class="item" bindtap="handleSort" data-idx="{{index}}">
<view>{{item.label}}</view>
<glsx-image src="output/sort-{{imgObj[item.asc]}}.png" class="icon" />
</view>
</view>
</scroll-view>
</view>
\ No newline at end of file
// pages/tab/output/components/staff/staff.js
import { IMG_URL } from '~/utils/constantData'
import outputApi from '~/api/outputApi/index'
Component({
/**
* 组件的属性列表
......@@ -10,11 +11,64 @@ Component({
* 组件的初始数据
*/
data: {
expectImg: `${IMG_URL}/output/expect.png`
IMG_URL,
bgUrl: `${IMG_URL}/personal/empty_tran.png`,
formData: {
// 0:全部-1;2:精品升级SC002;1:会员权益/升级SC001
busiIdx: 0,
sceneCode: '-1',
yqMerchantName: '服务中心',
timeIdx: 0
},
},
lifetimes: {
attached() {
this.getStaff()
}
},
/**
* 组件的方法列表
*/
methods: {}
methods: {
// tab-业务经营切换
handleSearch(e) {
this.getStaff(true, true)
},
getStaff(isReset = false) {
let staffSortModule = this.selectComponent('#staffSort')
let staffSearchData = staffSortModule ? staffSortModule.dealParams() : {}
this.setData({
formData: JSON.parse(JSON.stringify(staffSortModule.data.formData))
})
let { userInfo } = wx.$storage.get()
let params = {
...staffSearchData,
partnerMerchantId: userInfo.subLoginUser.merchantId
// partnerMerchantId: 44209468
}
outputApi.getStaffList(params).then(res => {
if (isReset) {
this.setData({
busiScrollTop: 0
})
}
this.setData({
triggered: false
})
let _list = []
// 1-会员权益/升级;2-精品升级
let attrToNum = {
'': 'totalStat',
'1': 'vdStat',
'2': 'boutiqueStat'
}
_list = res[attrToNum[staffSearchData.sceneType || '']] || []
this.setData({
staffList: _list
})
})
},
}
})
{
"component": true,
"usingComponents": {}
"usingComponents": {
"staff-sort": "../StaffSort/StaffSort",
"busi-card": "../BusiCard/BusiCard"
}
}
\ No newline at end of file
/* pages/tab/output/components/staff/staff.wxss */
.staffCon {
box-sizing: border-box;
display: flex;
flex-direction: column;
// justify-content: center;
align-items: center;
padding-top: 88rpx;
background-color: #fff;
height: 100%;
}
.img {
width: 512rpx;
height: 512rpx;
.staff {
box-sizing: border-box;
height: calc(100% - 92rpx);
color: #323436;
// padding-top: 16rpx;
// background-color: #F2F3F7;
background-color: #FFFFFF;
.title {
height: 80rpx;
line-height: 80rpx;
font-size: 28rpx;
color: #323436;
}
.label {
margin-top: -50rpx;
.title::before {
display: inline-block;
content: '';
width: 6rpx;
height: 28rpx;
background: #3666FE;
border-radius: 0 4rpx 4rpx 0;
margin-right: 16rpx;
}
}
.staff-content {
margin: 0 16rpx;
}
.end-txt {
font-size: 24rpx;
text-align: center;
color: #CCCED1;
padding-bottom: 60rpx;
}
\ No newline at end of file
<!-- pages/tab/output/components/staff/staff.wxml -->
<view class="staffCon">
<image class="img" src="{{expectImg}}" />
<view class="label">程序员在通宵建设中…</view>
</view>
<staff-sort id="staffSort" bindstaffSearch="handleSearch"></staff-sort>
<scroll-view class="staff" id="scroller" scroll-y="{{true}}" refresher-enabled="{{true}}" refresher-triggered="{{triggered}}" bindrefresherrefresh="handleSearch" lower-threshold='50' scroll-top="{{busiScrollTop}}">
<view wx:for="{{staffList}}" wx:key="index" class="staff-content">
<view class="title">{{item.yqMerchantName || ''}}</view>
<view wx:for="{{item.list}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
<busi-card info="{{subItem}}" fromPage="staff" sceneCode="{{formData.sceneCode}}" formData="{{formData}}"></busi-card>
</view>
</view>
<view wx:if="{{!staffList.length}}" class="end-txt">
<nothing-tips tips="暂无数据~" bgColor="{{'#FFFFFF'}}" bg="{{bgUrl}}" />
</view>
<view wx:else class="end-txt">
<view wx:if="{{formData.sceneCode == 'SC002'}}">数据统计精品升级全品类产品</view>
<view wx:else>到底啦~</view>
</view>
</scroll-view>
</view>
\ No newline at end of file
......@@ -59,7 +59,7 @@ Page({
},
setUserInfo() {
let { userInfo } = wx.$storage.get()
console.log(userInfo)
// console.log(userInfo)
this.setData({
userInfo,
isSuper: userInfo.isSuper
......@@ -79,11 +79,10 @@ Page({
if (e) {
this.setUserInfo()
let clientModule = this.selectComponent('#client')
let merchantModule = this.selectComponent('#merchant')
// console.log('clientModule', clientModule)
// console.log()
// let merchantModule = this.selectComponent('#merchant')
clientModule.getClientApi && clientModule.clientRefresh()
merchantModule.init && merchantModule.init()
clientModule.getBusinessData && clientModule.getBusinessData()
// merchantModule.init && merchantModule.init()
}
let { isSuper, userInfo } = this.data
console.log(isSuper)
......@@ -91,9 +90,9 @@ Page({
if (isSuper) {
USERAPI.adminSelectLogin()
.then(result => {
console.log(result)
// console.log(result)
let { merchantList: merchantRange } = result
console.log(merchantRange)
// console.log(merchantRange)
let subIndex = -1
merchantRange.forEach((item, index) => {
item.show = true
......@@ -125,6 +124,7 @@ Page({
if (page == 'client' && refresh) {
let clientModule = this.selectComponent('#client')
clientModule.getClientApi && clientModule.clientRefresh()
clientModule.getBusinessData && clientModule.getBusinessData()
}
},
/**
......
......@@ -70,11 +70,16 @@
}
.navigation-title .arrow {
width: 20rpx;
height: 16rpx;
width: 26rpx;
height: 26rpx;
margin-left: 4rpx;
transform: translateY(25%);
transition: all 0.5s;
image {
width: 26rpx;
height: 26rpx;
}
}
.navigation-title .move {
......
......@@ -81,16 +81,51 @@ const secretKey = {
}
}[target[index]]
const djSecretKey = {
ip: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
},
dev: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
},
uat: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
},
prod: {
appKey: 'd7ffc3346fc9a45bccaaa35300d59022',
secret: '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
},
preRelease: {
appKey: 'd7ffc3346fc9a45bccaaa35300d59022',
secret: '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
}
}[target[index]]
const domain = {
// ip: 'http://192.168.2.94:8558',
// ip: 'http://192.168.2.3:8315',
ip: 'http://192.168.1.170:8315',
/**登录: 192.168.2.3:8315
商城: 192.168.2.3:8558 */
dev: 'https://scrm.dev.glsx.com.cn',
uat: 'https://scrm.test.glsx.com.cn',
preRelease: 'https://scrm.beta.glsx.com.cn',
prod: 'https://scrm.glsx.com.cn'
ip: {
// dj: 'http://192.168.1.165:8292',
dj: 'http://192.168.1.170:8292',
scrm: 'http://192.168.1.165:8292'
},
dev: {
dj: 'https://dj.dev.glsx.com.cn',
scrm: 'https://scrm.dev.glsx.com.cn'
},
uat: {
dj: 'https://dj.test.glsx.com.cn',
scrm: 'https://scrm.test.glsx.com.cn'
},
prod: {
dj: 'https://dj.glsx.com.cn',
scrm: 'https://scrm.glsx.com.cn'
},
preRelease: {
dj: 'https://dj.beta.glsx.com.cn',
scrm: 'https://scrm.beta.glsx.com.cn'
}
}[target[index]]
const pathEnum = {
......@@ -129,6 +164,7 @@ module.exports = {
domain,
pathEnum,
secretKey,
djSecretKey,
defaultMerchantId,
mockUrl
}
import { secretKey, pathEnum, domain, sign } from './http.js'
import { secretKey, djSecretKey, pathEnum, domain, sign } from './http.js'
import { getSessionId } from '~/utils/cache/storageApi'
import network from '~/utils/network'
/**接口 */
class Request {
get(params, returnAll = false) {
return this.request('GET', params, returnAll)
get(params, returnAll = false, requestPath) {
return this.request('GET', params, returnAll, requestPath)
}
post(params, returnAll = false) {
return this.request('POST', params, returnAll)
post(params, returnAll = false, requestPath) {
return this.request('POST', params, returnAll, requestPath)
}
async request(RequestMethods, params, returnAll) {
async request(RequestMethods, params, returnAll, requestPath = 'scrm') {
const type = await network.getNetworkType()
if (type == 'none') return
return new Promise((resolve, reject) => {
......@@ -17,16 +17,18 @@ class Request {
let header =
RequestMethods === 'POST'
? {
'content-type': 'application/x-www-form-urlencoded'
}
'content-type': 'application/x-www-form-urlencoded'
}
: {}
let projectName = params.apiProjectName || this.getRopProject(params.method)
if (!projectName) projectName = this.getRopProject(params.method)
let path = pathEnum[projectName]
if (!path) path = `/rop-scrm-${projectName}/`
params = this.getData(params)
if (!path) {
path = requestPath == 'dj' ? `/rop-dj-${projectName}/` : `/rop-scrm-${projectName}/`
}
params = this.getData(params, requestPath)
wx.request({
url: `${domain}${path}router?method=${params.method}`,
url: `${domain[requestPath]}${path}router?method=${params.method}`,
data: params,
method: RequestMethods,
header,
......@@ -82,16 +84,20 @@ class Request {
})
})
}
getData(params) {
getData(params, requestPath) {
let projectName = params.projectName
if (!projectName) projectName = this.getRopProject(params.method)
else delete params.projectName
let appKey = '48e5e13229b82c1b4e6e8c96151f0637'
let secret = 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
if (secretKey[projectName]) {
if (requestPath == 'scrm' && secretKey[projectName]) {
appKey = secretKey[projectName].appKey
secret = secretKey[projectName].secret
}
if (requestPath == 'dj') {
appKey = djSecretKey.appKey
secret = djSecretKey.secret
}
const sessionId = getSessionId()
let noSignAttr = []
if (!params.sessionId && sessionId) params.sessionId = sessionId
......
......@@ -108,6 +108,22 @@ const throttle = (fn, gapTime) => {
};
};
/* 防抖函数封装 */
function debounce(fn, interval) {
let timer;
let delay = interval || 1000; // 间隔的时间,如果interval不传,则默认1秒
return function () {
let that = this;
let args = arguments; // 保存此处的arguments,因为setTimeout是全局的,arguments不是防抖函数需要的。
if (timer) {
clearTimeout(timer);
}
timer = setTimeout(function () {
fn.apply(that, args); // 用apply指向调用debounce的对象,相当于this.fn(args);
}, delay);
};
}
/**删除对象里的null值 */
const clearObjNull = (options) => {
let obj = {};
......@@ -288,6 +304,48 @@ const moneyThreeForTwoThousands = num => {
return d + (result + num2)
}
/**
* 动态校验字段
* @param {*} obj 需校验的对象
* @param {*} formRule 校验规则
* formRule = {
* id: [
* { required: true, message: 'xx不能为空' },
* {
* validator: (rule, value) => {
* return value != 'cwq' ? { message: '错误信息' } : null
* }
* }
* ],
* }
*/
const checkRule = function (obj, formRule) {
let target = Object.keys(formRule)
for (let i = 0; i < target.length; i++) {
let attr = target[i]
let item = formRule[attr]
let requirObj = item.find(k => k.required == true)
let validFn = item.find(k => k.validator)
if (requirObj && !obj[attr]) {
return {
...requirObj,
attr
}
}
if (validFn) {
let validObj = validFn.validator({}, obj[attr], obj)
if (validObj) {
return {
...validObj,
attr
}
}
}
}
return false
}
const Util = {
getImgVersion,
......@@ -295,11 +353,13 @@ const Util = {
isFullSucreen,
clearObjNull,
throttle,
debounce,
isEmptyObj,
parseString,
getCurrentPageUrl,
deepClone,
setNavigationBarTitle,
moneyThreeForTwoThousands
moneyThreeForTwoThousands,
checkRule
};
export default Util;
账号登录: 10988866666(超管)xiong110
测试环境 bb123456 密码 bb123456
xiaoxiong1hao a123456
csysfws a123456
生意助手小程序--生意助手2号
账号:ssfwsa a123456
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!