Commit 57731243 by chenwq

技师开发,联调

1 parent 1f4d9e20
......@@ -46,7 +46,8 @@ const updateService = data => {
const getTechnicianList = data => {
return api.post(
{
method: 'scrm.api.busassistant.technicianConfig.page',
// method: 'scrm.api.busassistant.technicianConfig.page',
method: 'scrm.api.busassistant.staff.findStaffByPage',
...data
}
)
......
const phoneRex = /^[1]([3-9])[0-9]{9}$/
const formRule = {
technicianName: [{ required: true, message: '技师名称不能为空' }]
technicianName: [{ required: true, message: '技师名称不能为空' }],
technicianPhone: [{ required: true, message: '手机号不能为空' },
{
validator: (rule, value) => {
return !phoneRex.test(value) ? { message: '请输入正确的手机号' } : null
}
}]
}
const formItems = [{
label: '技师',
label: '技师名称',
props: 'technicianName',
type: 'input',
placeholder: '请输入技师的名称',
maxlength: 15
}, {
label: '手机号',
props: 'technicianPhone',
type: 'input',
inputType: 'number',
placeholder: '请输入技师的手机号',
maxlength: 11
}]
export default {
......
......@@ -133,7 +133,7 @@ Page({
let _this = this
wx.showModal({
title: '删除',
content: '确认删除' + target.technicianName + '技师吗?',
content: '确认删除' + target.staffName + '技师吗?',
confirmText: '确定',
cancelText: '取消',
confirmColor: '#3666FE',
......@@ -171,12 +171,14 @@ Page({
let { technicianList, pageCof, total, customerInfo } = this.data
let params = {
...pageCof,
merchantId: customerInfo.merchantId
status: 0,
merchantNoList: [customerInfo.serviceCenterMerchantId],
roleName: '技师'
}
mineServiceApi.getTechnicianList(params).then(res => {
let { list, total } = res
let { data, total } = res
this.setData({
technicianList: pageCof.pageNum == 1 ? (list || []) : technicianList.concat(list),
technicianList: pageCof.pageNum == 1 ? (data || []) : technicianList.concat(data),
['pageCof.pageNum']: pageCof.pageNum + 1,
triggered: false,
total
......
......@@ -153,16 +153,32 @@
text-align: center;
box-sizing: border-box;
width: 614rpx;
height: 440rpx;
background: #FFFFFF;
border-radius: 32rpx;
.form {
margin: 64rpx 40rpx;
.form-box {
margin: 32rpx 40rpx;
text-align: left;
.form {
display: flex;
}
.form:first-child {
margin-bottom: 32rpx;
}
.label {
width: calc(100% - 390rpx);
height: 88rpx;
line-height: 88rpx;
font-size: 28rpx;
color: #323436;
text-align: left;
}
.input {
width: 534rpx;
width: 390rpx;
height: 88rpx;
background: #F8F9FC;
border-radius: 12rpx;
......@@ -186,10 +202,7 @@
}
.dialog-btn {
position: absolute;
display: flex;
bottom: 0;
left: 0;
width: 100%;
height: 110rpx;
line-height: 110rpx;
......
......@@ -15,8 +15,8 @@
<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>
<input wx:if="{{item.isEdit}}" type="text" placeholder="{{formItems[0].placeholder}}" maxlength="{{formItems[0].maxlength}}" class="input" value="{{formData.staffName}}" 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.staffName}}</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>
......@@ -26,7 +26,7 @@
<view class="technician_name">
所属:{{item.merchantName}}
</view>
<view class="time">{{item.createdDate}}</view>
<view class="time">{{item.createdTime}}</view>
</view>
</view>
<view class="bottomTips" wx:if="{{technicianList.length == total}}">到底啦!</view>
......@@ -41,8 +41,11 @@
<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 class="form-box">
<view class="form" wx:for="{{formItems}}" wx:key="index">
<view class="label">{{item.label}}<text class="tips">{{item.tips}}</text></view>
<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>
<view class="dialog-btn">
<view class="cancel-btn" bindtap="handleCancel">取消</view>
......
......@@ -2,6 +2,7 @@
import outputApi from '~/api/outputApi/index'
import { IMG_URL } from '~/utils/constantData'
import { deleteSecond } from '~/utils/format'
import { h5Url } from '~/utils/request/http'
Component({
/**
* 组件的属性列表
......@@ -304,7 +305,7 @@ Component({
}
const { idx } = e.currentTarget.dataset
let obj = this.data.busiTotalList[idx]
let url = 'https://dj.glsx.com.cn/dj-car-revenue-analysis/#/?merchantId=' + obj?.merchantId4s + '&merchantName=' + obj?.merchantName4s
let url = h5Url + '?merchantId=' + obj?.merchantId4s + '&merchantName=' + obj?.merchantName4s
wx.$router.jumpH5(url)
},
......
......@@ -8,6 +8,10 @@ const mockObj = {
test: 'https://oss-config.dev.glsx.com.cn/mock/63fd6c2034c4d918e2f4df4d/config',
product: 'https://oss-config.test.glsx.com.cn/mock/63ff0b507dc47c4edc786e82/config'
}
const h5Obj = {
test: 'https://dj.test.glsx.com.cn/dj-car-revenue-analysis/#/',
product: 'https://dj.glsx.com.cn/dj-car-revenue-analysis/#/'
}
/**
*
......@@ -163,6 +167,14 @@ let mockUrl = {
preRelease: mockObj.product,
prod: mockObj.product
}[target[index]]
let h5Url = {
ip: h5Obj.test,
dev: h5Obj.test,
uat: h5Obj.test,
preRelease: h5Obj.product,
prod: h5Obj.product
}[target[index]]
module.exports = {
index,
domain,
......@@ -170,5 +182,6 @@ module.exports = {
secretKey,
djSecretKey,
defaultMerchantId,
mockUrl
mockUrl,
h5Url
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!