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 4446 additions and 81 deletions
...@@ -46,5 +46,52 @@ class mineApi { ...@@ -46,5 +46,52 @@ class mineApi {
// true // 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 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 \ 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 \ No newline at end of file
...@@ -80,9 +80,10 @@ class outputApi { ...@@ -80,9 +80,10 @@ class outputApi {
/** 查询门店权益订单数据统计-车险升级活动产值 */ /** 查询门店权益订单数据统计-车险升级活动产值 */
getEquityRevenue(data) { getEquityRevenue(data) {
return api.post({ 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 ...data
}) }, false, 'dj')
} }
/** 店面汇总-下载海报 */ /** 店面汇总-下载海报 */
...@@ -115,5 +116,31 @@ class outputApi { ...@@ -115,5 +116,31 @@ class outputApi {
...data ...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 export default outputApi
...@@ -168,5 +168,15 @@ class UsersApi { ...@@ -168,5 +168,15 @@ class UsersApi {
platformEntrance: 'BUSINESS_ASSISTANT' platformEntrance: 'BUSINESS_ASSISTANT'
}) })
} }
// 登录自动创建服务中心
initServiceCenter(data) {
return api.post(
{
method: 'scrm.api.busassistant.serviceCenter.init',
...data
}
)
}
} }
export default UsersApi export default UsersApi
\ No newline at end of file \ 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"], "pages": [
"requiredPrivateInfos": ["getLocation"], "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", "lazyCodeLoading": "requiredComponents",
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",
...@@ -37,37 +53,67 @@ ...@@ -37,37 +53,67 @@
{ {
"root": "packagesList/pages", "root": "packagesList/pages",
"name": "packagesList", "name": "packagesList",
"pages": ["videoDetal/videoDetal", "productDetail/productDetail", "scenarioDetail/scenarioDetail"] "pages": [
"videoDetal/videoDetal",
"productDetail/productDetail",
"scenarioDetail/scenarioDetail"
]
}, },
{ {
"root": "packagesList/packageOutput", "root": "packagesList/packageOutput",
"name": "packageOutput", "name": "packageOutput",
"pages": ["pages/openBusiness", "pages/summary"] "pages": [
}, "pages/openBusiness",
{ "pages/summary"
"root": "packagesList/mineDetail", ]
"name": "mineDetail",
"pages": ["pages/messageBox", "pages/customerManagement", "pages/clue"]
}, },
{ {
"root": "packagesList/apply", "root": "packagesList/apply",
"name": "apply", "name": "apply",
"pages": ["pages/apply"] "pages": [
"pages/apply"
]
}, },
{ {
"root": "packagesList/applyProd", "root": "packagesList/applyProd",
"name": "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": { "preloadRule": {
"pages/tab/mine/mine": { "pages/tab/mine/mine": {
"network": "all", "network": "all",
"packages": ["mineDetail"] "packages": [
"packageMine"
]
}, },
"pages/tab/index/index": { "pages/tab/index/index": {
"network": "all", "network": "all",
"packages": ["apply", "packageOutput"] "packages": [
"apply",
"packageOutput"
]
} }
}, },
"usingComponents": { "usingComponents": {
...@@ -87,4 +133,4 @@ ...@@ -87,4 +133,4 @@
"desc": "你的位置信息将用于小程序位置接口的效果展示" "desc": "你的位置信息将用于小程序位置接口的效果展示"
} }
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -7,6 +7,7 @@ Component({ ...@@ -7,6 +7,7 @@ Component({
navStyle: String, navStyle: String,
custom: Boolean, custom: Boolean,
showBack: Boolean, showBack: Boolean,
customBack: Boolean,
pageTitle: { pageTitle: {
type: String, type: String,
value: '', value: '',
...@@ -88,7 +89,9 @@ Component({ ...@@ -88,7 +89,9 @@ Component({
}) })
}, },
back() { back() {
wx.$router.back() let { customBack } = this.data
if (customBack) this.triggerEvent('back')
else wx.$router.back()
} }
}, },
lifetimes: { lifetimes: {
......
...@@ -5,7 +5,11 @@ Component({ ...@@ -5,7 +5,11 @@ Component({
*/ */
properties: { properties: {
tips: String, tips: String,
bg: String bg: String,
bgColor: {
type: String,
value: '#fff'
}
}, },
/** /**
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
.nothingCon { .nothingCon {
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
background-color: #fff; // background-color: #fff;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
......
<!-- components/Nothing-tips/nothingTips.wxml --> <!-- components/Nothing-tips/nothingTips.wxml -->
<view class="nothingCon"> <view class="nothingCon" style="background-color: {{bgColor}};">
<image <image
wx:if="{{bg}}" wx:if="{{bg}}"
class="bg" class="bg"
......
// tabWorkOrder/pages/createOrder/createOrderComponents/Popup/Popup.js // tabWorkOrder/pages/createOrder/createOrderComponents/Popup/Popup.js
Component({ Component({
externalClasses: ['custom-class'],
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
...@@ -50,7 +51,7 @@ Component({ ...@@ -50,7 +51,7 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
noScroll() {}, noScroll() { },
hidePopup() { hidePopup() {
this.setData({ this.setData({
show: false 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-bg" bindtap="hidePopup"></view>
<view class="popup-content {{close?'close':''}}" style="height:{{height}}"> <view class="popup-content {{close?'close':''}}" style="height:{{height}}">
<block wx:if="{{title}}"> <block wx:if="{{title}}">
......
...@@ -175,5 +175,27 @@ Component({ ...@@ -175,5 +175,27 @@ Component({
getUserInfo(e) { getUserInfo(e) {
this.triggerEvent('getUserInfo', { detail: e.detail }) 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 @@ ...@@ -2,7 +2,7 @@
<view class="view-prod custom-class"> <view class="view-prod custom-class">
<view class="pro-head"> <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}}" /> <image class="no-video" wx:if="{{actNum == 2}}" src="{{prodItemVideo.posterUrl}}?v={{img_version}}" />
<view class="title-wrap"> <view class="title-wrap">
<view class="title">{{prodItemVideo.name}}</view> <view class="title">{{prodItemVideo.name}}</view>
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
</button> </button>
</block> </block>
</image> </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 }}"> <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" /> <video class="crowd-video" id="crowd-video" bindplay="handleVideoPlay" data-attr="videoCtx" src="{{videoBaseUrl}}video/crowd-detail.mp4" />
......
...@@ -30,12 +30,19 @@ Component({ ...@@ -30,12 +30,19 @@ Component({
// password: 'bb123456' // password: 'bb123456'
}, },
phoneReady: false, phoneReady: false,
countDown: null countDown: null,
agree: false
}, },
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
authChoose(e) {
let { detail: agree } = e
this.setData({
agree
})
},
/**隐藏验证码错误 */ /**隐藏验证码错误 */
hideError(name) { hideError(name) {
if (name == 'code') if (name == 'code')
...@@ -129,8 +136,19 @@ Component({ ...@@ -129,8 +136,19 @@ Component({
showPwd: !this.data.showPwd showPwd: !this.data.showPwd
}) })
}, },
checkAgree() {
let { agree } = this.data
console.log('agree', agree)
if (!agree) {
wx.$api.showToast('请同意用户协议')
return true
}
return false
},
/**手机号&帐号密码登录 */ /**手机号&帐号密码登录 */
login() { login() {
const checkAgree = this.checkAgree()
if (checkAgree) return false
const { formData, loginType } = this.data, const { formData, loginType } = this.data,
target = { target = {
1: 'phoneSmsLogin', 1: 'phoneSmsLogin',
......
{ {
"component": true, "component": true,
"usingComponents": { "usingComponents": {
"input-icon":"../InputIcon/InputIcon" "input-icon": "../InputIcon/InputIcon",
"auth-setting": "../authSetting/authSetting"
} }
}
\ No newline at end of file \ No newline at end of file
}
<block wx:if="{{loginType == 0}}"> <block wx:if="{{loginType == 0}}">
<view class="wx opacity-view"> <view class="wx opacity-view">
<view class="title"> <view class="title">
您好 您好
</view> </view>
<view class="subtitle"> <view class="subtitle">
欢迎登录生意助手 欢迎登录生意助手
</view> </view>
<image webp class="img" src="{{IMGURL}}login/login-2.webp" /> <image webp class="img" src="{{IMGURL}}login/login-2.webp" />
</view> </view>
</block> </block>
<block wx:else> <block wx:else>
<view class="box"> <view class="box">
<view class="input-box opacity-view"> <view class="input-box opacity-view">
<view class="title">{{loginType == 1?'手机号':'账号'}}登录</view> <view class="title">{{loginType == 1?'手机号':'账号'}}登录</view>
<block wx:if="{{loginType == 1}}"> <block wx:if="{{loginType == 1}}">
<view class="input"> <view class="input">
<input type="number" placeholder="填写手机号" placeholder-class="placeholder" bindinput="input" data-name="phone" value="{{formData.phone}}" maxlength="11" /> <input
<input-icon show="{{formData.phone}}" bindtap="clear" data-name="phone" /> type="number"
</view> placeholder="填写手机号"
<view class="input"> placeholder-class="placeholder"
<input type="number" placeholder="填写验证码" placeholder-class="placeholder" bindinput="input" data-name="code" value="{{formData.code}}" maxlength="4" /> bindinput="input"
<input-icon show="{{formData.code}}" bindtap="clear" data-name="code" /> data-name="phone"
<button class="sms text-center " bindtap="getSmsCode" disabled="{{count || !phoneReady}}" loading="{{smsLoading}}">{{ value="{{formData.phone}}"
count? count + 's':'获取验证码' maxlength="11" />
}}</button> <input-icon show="{{formData.phone}}" bindtap="clear" data-name="phone" />
<block wx:if="{{smsError}}"> </view>
<view class="error">验证码错误</view> <view class="input">
</block> <input
</view> type="number"
</block> placeholder="填写验证码"
<block wx:else> placeholder-class="placeholder"
<view class="input"> bindinput="input"
<input type="text" placeholder="填写账号" placeholder-class="placeholder" bindinput="input" data-name="account" value="{{formData.account}}" maxlength="15" /> data-name="code"
<input-icon show="{{formData.account}}" bindtap="clear" data-name="account" /> value="{{formData.code}}"
</view> maxlength="4" />
<view class="input"> <input-icon show="{{formData.code}}" bindtap="clear" data-name="code" />
<input type="text" placeholder="填写密码" placeholder-class="placeholder" bindinput="input" data-name="password" value="{{formData.password}}" maxlength="20" password='{{!showPwd}}' /> <button
<input-icon show bindtap="pwdSwitch" type="{{showPwd?'showPwd':'hidePwd'}}" /> class="sms text-center "
<input-icon show="{{formData.password}}" bindtap="clear" data-name="password" /> bindtap="getSmsCode"
</view> disabled="{{count || !phoneReady}}"
</block> loading="{{smsLoading}}">{{
</view> count? count + 's':'获取验证码'
</view> }}
</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>
<block wx:if="{{loginType == 0}}"> <block wx:if="{{loginType == 0 &&agree}}">
<button class="button" disabled="{{disabled}}" hover-class="btn-hover" open-type="getPhoneNumber" bindgetphonenumber="wxLogin" loading="{{loading}}">微信登录</button> <button
class="button"
disabled="{{disabled}}"
hover-class="btn-hover"
open-type="getPhoneNumber"
bindgetphonenumber="wxLogin"
loading="{{loading}}">微信登录
</button>
</block> </block>
<block wx:else> <block wx:else>
<button class="button" disabled="{{disabled}}" hover-class="btn-hover" bindtap="login" loading="{{loading}}">登录</button>
</block>
\ No newline at end of file \ 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 \ No newline at end of file
...@@ -28,7 +28,6 @@ Page({ ...@@ -28,7 +28,6 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow(options, refresh) { onShow(options, refresh) {
1
if (refresh) { if (refresh) {
this.setData({ this.setData({
disabled: true disabled: true
......
...@@ -8,4 +8,4 @@ ...@@ -8,4 +8,4 @@
}, },
"navigationStyle": "custom", "navigationStyle": "custom",
"disableScroll": true "disableScroll": true
}
\ No newline at end of file \ No newline at end of file
}
...@@ -43,10 +43,15 @@ const setLoginInfo = (userInfo, sessionId) => { ...@@ -43,10 +43,15 @@ const setLoginInfo = (userInfo, sessionId) => {
wx.$api.showToast('仅支持服务商类型账户登录') wx.$api.showToast('仅支持服务商类型账户登录')
return return
} }
// 自动创建服务中心
initServiceCenter()
setUserInfo(userInfo) setUserInfo(userInfo)
setSessionId(sessionId) setSessionId(sessionId)
loginSuccess() loginSuccess()
} }
const initServiceCenter = () => {
USERAPI.initServiceCenter({})
}
/**成功跳转 */ /**成功跳转 */
const loginSuccess = () => { const loginSuccess = () => {
const { const {
...@@ -105,5 +110,6 @@ module.exports = { ...@@ -105,5 +110,6 @@ module.exports = {
loginSuccess, loginSuccess,
setRouteData, setRouteData,
setLoginInfo, setLoginInfo,
loginModal loginModal,
initServiceCenter
} }
\ No newline at end of file \ No newline at end of file
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
"integrity": "sha512-R2FyCk0mK2xvUX2dMgVZjVG512RKBj7ELMDxjRJjhQWtw4495WBgbl5Yb4v2A6d4vWJe6z9toKgDJTciN0Bo9A==" "integrity": "sha512-R2FyCk0mK2xvUX2dMgVZjVG512RKBj7ELMDxjRJjhQWtw4495WBgbl5Yb4v2A6d4vWJe6z9toKgDJTciN0Bo9A=="
}, },
"glsx-applet-component": { "glsx-applet-component": {
"version": "1.0.47", "version": "1.1.3",
"resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.0.47.tgz", "resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.1.3.tgz",
"integrity": "sha512-KzdhJD35vbW1NPMhABsTTe+IosDUH1dlPO0pLUCug+JXLCU2/WbhNvIGAq5+y6Dj9xYy98HDAB9fGsQZ677YLw==" "integrity": "sha512-Ze+HdtFJImhOsWLfV+ZzB86Kf18pm9M9CZWhctPel/qJNMEn29g9ywC16NXmeac+gTu07MOpURyF+YmO8ojkJA=="
} }
} }
} }
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"main": "app.js", "main": "app.js",
"dependencies": { "dependencies": {
"@vant/weapp": "^1.10.7", "@vant/weapp": "^1.10.7",
"glsx-applet-component": "^1.0.50" "glsx-applet-component": "^1.1.3"
}, },
"devDependencies": {}, "devDependencies": {},
"scripts": { "scripts": {
......
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ 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 \ 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 \ 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 \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ 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 \ 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 \ 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 \ 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 \ No newline at end of file
{
"navigationBarTitleText": "客户管理",
"usingComponents": {
"select-service-popup": "../../../components/selectServicePopup/selectServicePopup"
}
}
\ No newline at end of file \ 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 \ 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 \ 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 \ 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 \ No newline at end of file
{
"navigationBarTitleText": "创建客户",
"usingComponents": {
"select-service-confirm": "../../../components/selectServiceConfirm/selectServiceConfirm"
}
}
\ No newline at end of file \ 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 \ 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 \ 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 \ No newline at end of file
{
"navigationBarTitleText": "销售顾问",
"usingComponents": {}
}
\ No newline at end of file \ 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 \ 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 \ 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 \ 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 \ No newline at end of file
{
"navigationBarTitleText": "查看技师",
"usingComponents": {}
}
\ No newline at end of file \ 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 \ 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 \ No newline at end of file
{ {
"component": true, "component": true,
"usingComponents": { "usingComponents": {
"msg-box": "../components/msgBox/msgBox", "msg-box": "../../components/msgBox/msgBox",
"tab": "../components/Tab/Tab" "tab": "../../components/Tab/Tab"
}, },
"navigationStyle": "custom" "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 \ 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 \ No newline at end of file
{
"navigationBarTitleText": "创建服务中心",
"usingComponents": {
"input-icon": "/login/index/components/InputIcon/InputIcon"
}
}
\ No newline at end of file \ 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 \ 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 \ 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 \ No newline at end of file
{
"navigationBarTitleText": "服务中心管理",
"usingComponents": {}
}
\ No newline at end of file \ 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 \ 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 \ 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 \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!