Commit 1d1a41f5 by 张立顺

Merge branch 'SAAS+V5.3.0-1117' of http://192.168.3.233:8090/saas_plus/dj-car-bo…

…utique-work-wechat into SAAS+V5.3.0-1117
2 parents f6277b40 2bd13cbc
Showing 22 changed files with 437 additions and 269 deletions
......@@ -18,7 +18,7 @@ export const appId = 'wx570d9331f9ace0bd'
* 4预发布
* 5cdptest
*/
let index = 4
let index = 2
const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync()
const envName = accountInfo.miniProgram.envVersion
......
......@@ -383,6 +383,7 @@ Component({
this.getData(name);
},
checkIsPadOrNot() {
let _this = this
wx.getRendererUserAgent({
success(res) {
let isPad = /iPad|Android.*Tablet|Kindle|Silk/i.test(res.userAgent);
......@@ -630,35 +631,42 @@ Component({
icon: "mentorship-manage"
});
}
if ((isStaff || userInfo.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5) && this.merchantDirectSales) {
let {
uuid,
merchantId,
shopMerchantId
} = userInfo
const missingresponse = await checkMissingReception({
merchantId: shopMerchantId,
yqMerchantId: merchantId,
staffUuid: uuid,
sceneType: 0,
reportStartDate: dayjs().subtract(6, 'day').format('YYYY-MM-DD'),
reportEndDate: dayjs().format('YYYY-MM-DD'),
})
if (missingresponse.code == 0) {
let missingRecordTodoList = []
missingresponse.data.reverse().map(e => {
if (e.missingReceptionRecord && !e.hasReceptionReport && !missingRecordTodoList.length) missingRecordTodoList.push(e)
if ((isStaff || userInfo.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5)) {
if (this.merchantDirectSales) {
let {
uuid,
merchantId,
shopMerchantId
} = userInfo
const missingresponse = await checkMissingReception({
merchantId: shopMerchantId,
yqMerchantId: merchantId,
staffUuid: uuid,
sceneType: 0,
reportStartDate: dayjs().subtract(6, 'day').format('YYYY-MM-DD'),
reportEndDate: dayjs().format('YYYY-MM-DD'),
})
let missingRecordTodoList = []
if (missingresponse.code == 0) {
missingresponse.data.reverse().map(e => {
if (e.missingReceptionRecord && !e.hasReceptionReport && !missingRecordTodoList.length) missingRecordTodoList.push(e)
})
}
this.setData({
missingRecordTodoList,
})
if (menuList.every((item) => item.menuText != "接待缺失报备")) menuList.push({
menuText: "接待缺失报备",
path: "packageEquity.missingReception",
icon: "missing-reception",
});
} else {
let delIndex = menuList.findIndex(item => item.menuText == "接待缺失报备")
if (delIndex != -1) menuList = menuList.splice(delIndex, 1)
this.setData({
missingRecordTodoList: [],
})
}
if (menuList.every((item) => item.menuText != "接待缺失报备")) menuList.push({
menuText: "接待缺失报备",
path: "packageEquity.missingReception",
icon: "missing-reception",
});
}
this.checkIsPadOrNot();
this.getData();
......
......@@ -27,19 +27,19 @@ Page({
track_event_code: 'mini_pad_missing_reception', //埋点动作类型
scene: 0
},
jump() {
jump () {
wx.$router.back()
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
onLoad (options) {
console.log(options)
this.initData(options.reportDate)
this.getMissingOptions()
},
async getMissingOptions() {
async getMissingOptions () {
try {
const {
code,
......@@ -59,7 +59,7 @@ Page({
wx.$util.showToast(error)
}
},
navbarReady(e) {
navbarReady (e) {
let navBarHeight = e.detail.height
this.setData({
navBarHeight
......@@ -82,7 +82,7 @@ Page({
})
this.setReportDate()
},
initData(reportDate = '') {
initData (reportDate = '') {
if (reportDate) {
let dateisSunday = dayjs(reportDate).toDate(),
countSundays = this.countSundays(
......@@ -105,7 +105,7 @@ Page({
}
this.setReportDate()
},
countSundays(startDate, endDate) {
countSundays (startDate, endDate) {
let start = new Date(startDate)
let end = new Date(endDate)
let sundays = 0
......@@ -153,7 +153,7 @@ Page({
this.getMissingCustomerList()
},
// 设置报告日期
async setReportDate() {
async setReportDate () {
try {
wx.$util.showLoading()
const {
......@@ -181,7 +181,7 @@ Page({
weekDayList,
selectDay
} = timeBean,
detailObj = {},
detailObj = {},
currentDate = weekDayList[selectDay].date
weekDayList.map(e => {
data.map(i => {
......@@ -201,12 +201,14 @@ Page({
wx.$util.showToast(error)
}
},
async getMissingCustomerList() {
async getMissingCustomerList () {
try {
wx.$util.showLoading()
this.setData({
list: []
list: [],
scrollTop: 0
})
let {
currentDate,
detailObj,
......@@ -226,9 +228,10 @@ Page({
reportDate: currentDate
})
wx.hideLoading()
let total = 0
if (code == 0) {
let responseList = data.list
total = data.total
if (responseList.length) {
list = responseList.map(e => {
return {
......@@ -247,7 +250,7 @@ Page({
if (len) {
for (let index = 0; index < len; index++) {
list.push({
customerName: `客户${index + 1}`
customerName: `客户${index + 1}`,
})
}
}
......@@ -255,6 +258,7 @@ Page({
} else wx.$util.showToast(message)
this.setData({
list,
total,
isDateWithin7Days: dayjs().diff(dayjs(currentDate), 'day') < dayLimit
})
} catch (error) {
......@@ -263,7 +267,7 @@ Page({
if (error) wx.$util.showToast(error)
}
},
inputBlur(e) {
inputBlur (e) {
let {
index
} = e.target.dataset, {
......@@ -274,14 +278,14 @@ Page({
[`list[${index}].inputErrorText`]: value ? '' : '必填不能为空'
})
},
changeReason(e) {
changeReason (e) {
const {
missingOptions
} = this.data, {
index
} = e.target.dataset, {
value
} = e.detail,
index
} = e.target.dataset, {
value
} = e.detail,
item = missingOptions[value]
this.setData({
[`list[${index}].errorText`]: '',
......@@ -289,7 +293,7 @@ Page({
[`list[${index}].reasonCode`]: item.reasonCode,
})
},
cancel() {
cancel () {
wx.showModal({
title: '温馨提示',
content: '接待录音缺失将影响工资绩效,是否确认放弃报备?',
......@@ -301,7 +305,7 @@ Page({
}
})
},
async submit() {
async submit () {
try {
const {
list,
......@@ -316,7 +320,7 @@ Page({
} = userInfo
list.map((e, index) => {
if (!e.reasonCode) this.setData({
[`list[${index}].errorText`]: '请选择缺失原因'
[`list[${index}].errorText`]: '必填不能为空'
})
if (!e.customerName) this.setData({
[`list[${index}].inputErrorText`]: '必填不能为空'
......@@ -332,39 +336,41 @@ Page({
reasonCode: e.reasonCode,
})
})
wx.$util.showLoading('提交中...')
wx.$track.setTrackData(0, 'mini_add_pad_missing_reception')
const {
code,
data,
message
} = await addMissingReception({
missingReceptionReportAddRequests,
reportDate: currentDate,
merchantId: shopMerchantId,
merchantName: shopMerchantName,
staffUuid: uuid,
staffName: name,
staffPhone: phone,
sceneType: 0
})
if (code == 0) {
wx.hideLoading()
let _this = this
wx.showModal({
title: '提示',
content: '提交成功',
showCancel: false,
confirmColor: '#347BFF',
success: (res) => {
if (res.confirm) {
_this.setReportDate()
// wx.$router.back()
}
}
wx.$util.showLoading('提交中...')
// 分批提交,每批最多50条
const batchSize = 50
for (let i = 0; i < missingReceptionReportAddRequests.length; i += batchSize) {
const batch = missingReceptionReportAddRequests.slice(i, i + batchSize)
const {
code,
message
} = await addMissingReception({
missingReceptionReportAddRequests: batch,
reportDate: currentDate,
merchantId: shopMerchantId,
merchantName: shopMerchantName,
staffUuid: uuid,
staffName: name,
staffPhone: phone,
sceneType: 0
})
console.log(data)
} else throw message
if (code != 0) throw message
}
wx.hideLoading()
let _this = this
wx.showModal({
title: '提示',
content: '提交成功',
showCancel: false,
confirmColor: '#347BFF',
success: (res) => {
if (res.confirm) {
_this.setReportDate()
// wx.$router.back()
}
}
})
} catch (error) {
wx.hideLoading()
if (error) wx.$util.showToast(error)
......@@ -373,49 +379,49 @@ Page({
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
onReady () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
onShow () {
this.onPageShow()
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
onHide () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
onUnload () {
this.onPageHide()
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
onPullDownRefresh () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
onReachBottom () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
onShareAppMessage () {
}
})
\ No newline at end of file
......@@ -41,7 +41,7 @@ page {
flex-shrink: 0;
color: #292d33;
font-size: 26rpx;
width: 104rpx;
.num {
margin-top: 8rpx;
color: #2c66f7;
......@@ -148,6 +148,11 @@ page {
width: 100%;
height: 20rpx;
}
.has-reception-report{
.required{
display: none;
}
}
}
}
.bespread{
......
......@@ -5,7 +5,7 @@
<view class="box {{isDateWithin7Days && !detailObj[currentDate].hasReceptionReport && detailObj[currentDate].missingReceptionRecord ? '' : 'bespread'}}" style="padding-top:{{ navBarHeight }}px">
<weekCalendar timeBean="{{ timeBean }}" bind:lastWeek="lastWeek" bind:nextWeek="nextWeek" bind:dayClick="dayClick"></weekCalendar>
<scroll-view scroll-y class="content">
<scroll-view scroll-y class="content" scroll-top="{{scrollTop}}">
<view class="info flex">
<view class="info-item">
售前
......@@ -24,6 +24,7 @@
<view class="num">{{detailObj[currentDate].recordingCount || '0'}}</view>
</view>
</view>
<!-- 超过7天&没日报记录 -->
<block wx:if="{{!isDateWithin7Days && !detailObj[currentDate].hasReceptionReport}}">
<view class="nothing flex">
<image class="no-data-img" src="{{IMG_URL}}equity/reception/no-suggestions.png" />
......@@ -32,12 +33,12 @@
</view>
</block>
<block wx:else>
<block wx:if="{{detailObj[currentDate].missingReceptionRecord}}">
<block wx:if="{{detailObj[currentDate].hasDailyReport}}">
<block wx:if="{{detailObj[currentDate].hasDailyReport}}">
<block wx:if="{{detailObj[currentDate].missingReceptionRecord || list.length}}">
<view class="title flex">
{{detailObj[currentDate].hasReceptionReport?'已':'需'}}报备客户·{{list.length}}
{{detailObj[currentDate].hasReceptionReport?'已':'需'}}报备客户·{{detailObj[currentDate].hasReceptionReport ? total : list.length}}
</view>
<view class="list">
<view class="list {{detailObj[currentDate].hasReceptionReport?'has-reception-report':''}}">
<block wx:for="{{list}}" wx:key="index">
<view class="item">
<view class="num flex">{{index + 1}}</view>
......@@ -45,15 +46,12 @@
<view class="label flex">客户姓名<view class="required">*</view>
</view>
<view class="value {{item.disabled?'disabled':''}}">
<input class="input" type="text" maxlength="20" value="{{item.customerName}}" placeholder="{{item.inputErrorText||'请输入'}}" placeholder-class="placeholder {{item.inputErrorText?'error':''}}"
disabled="{{item.disabled}}"
bindblur="inputBlur" data-index="{{index}}" />
<input class="input" type="text" maxlength="20" value="{{item.customerName}}" placeholder="{{item.inputErrorText||'请输入'}}" placeholder-class="placeholder {{item.inputErrorText?'error':''}}" disabled="{{item.disabled}}" bindblur="inputBlur" data-index="{{index}}" />
</view>
<view class="label flex">缺失原因<view class="required">*</view>
</view>
<view class="value {{item.disabled?'disabled':''}}">
<picker class="picker" mode="selector" range="{{missingOptions}}"
disabled="{{item.disabled}}" range-key="reason" bindchange="changeReason" data-index="{{index}}">
<picker class="picker" mode="selector" range="{{missingOptions}}" disabled="{{item.disabled}}" range-key="reason" bindchange="changeReason" data-index="{{index}}">
<view class="reason flex {{item.reasonText?'':'placeholder'}} {{item.errorText?'error':''}}">{{item.reasonText || item.errorText || '请选择'}}</view>
<view class="arrow">
<image src="/images/arrow-right.png"></image>
......@@ -69,14 +67,14 @@
<block wx:else>
<view class="nothing flex">
<image class="no-data-img" src="{{IMG_URL}}equity/reception/no-suggestions.png" />
请先填写驻店日报
该日期暂无缺失接待记录
</view>
</block>
</block>
<block wx:else>
<view class="nothing flex">
<image class="no-data-img" src="{{IMG_URL}}equity/reception/no-suggestions.png" />
该日期暂无缺失接待记录
请先填写驻店日报
</view>
</block>
</block>
......
......@@ -25,6 +25,7 @@ const RECRUITMENT_INFO_CONFIG = [
{ label: '招聘类型', field: 'recruitmentTypeName' },
{ label: '招聘负责人', field: 'recruiterName' },
{ label: '申请时间', field: 'createdDate' },
{ label: '需求描述', field: 'requirementDescription' },
{ label: '拒绝理由', field: 'recallReason' }
]
......@@ -69,9 +70,11 @@ Page({
handleShowMessagePop: false, // 控制弹窗显示
timeShow: false, // 控制时间选择器显示
currentDate: new Date().getTime(),
today: new Date().getTime(), // 当前日期,用于限制日期选择器的最大值
formData: {}, // 弹窗表单数据
detailLoaded: false, // 标识是否已加载详情
curDataId:'',
isProcessing: false, // 是否正在处理中,防止重复提交
// 时间选择器列表子项展示-格式化处理
formatter(type, value) {
if (type === 'year') {
......@@ -91,7 +94,6 @@ Page({
* 显示时间选择器
*/
showTimePicker(e) {
console.log('打开时间选择器')
if (e) {
e.stopPropagation && e.stopPropagation()
}
......@@ -153,7 +155,6 @@ Page({
// 示例 url,并非真实存在
url: url,
success: function (res) {
console.log(res)
const filePath = res.tempFilePath
wx.openDocument({
filePath: filePath,
......@@ -198,12 +199,20 @@ Page({
recruitment.createdDate = this.formatDate(recruitment.createdDate)
}
// 根据 businessType 动态过滤招聘信息配置
// 当 businessType == 1 时,显示拒绝理由;否则过滤掉拒绝理由项
// 根据字段值是否存在和业务类型动态过滤招聘信息配置
const filteredRecruitmentInfoConfig = RECRUITMENT_INFO_CONFIG.filter(item => {
// 特殊处理:拒绝理由字段仅在businessType为1时显示
if (item.field === 'recallReason') {
return recruitment.businessType == 1
return recruitment.businessType == 1 && recruitment.recallReason
}
// 如果字段值不存在或为空字符串,则不显示该字段
if (recruitment[item.field] === undefined ||
recruitment[item.field] === null ||
recruitment[item.field] === '') {
return false
}
return true
})
......@@ -278,8 +287,8 @@ Page({
let value = e.detail.value
const { formData } = this.data
// 过滤掉空格和换行符
value = value.replace(/[\s\r\n]/g, '')
// 过滤掉空格
value = value.replace(/ /g, '');
formData[field] = value
formData[field + 'Length'] = value.length // 统计字数
......@@ -294,7 +303,8 @@ Page({
hidePopup() {
this.setData({
showPopup: false,
timeShow: false
timeShow: false,
isProcessing: false // 重置处理状态
})
},
......@@ -316,7 +326,11 @@ Page({
* 确认处理
*/
confirmProcess() {
const { formData } = this.data
const { formData, isProcessing } = this.data
// 防止重复提交
if (isProcessing) return;
// 验证必填项
if (!formData.processResult) {
wx.showToast({
......@@ -341,6 +355,12 @@ Page({
})
return
}
// 设置处理状态为true,防止重复提交
this.setData({
isProcessing: true
})
let requestParams = {
id:formData.id,
processResult:formData?.processResult,
......@@ -348,8 +368,9 @@ Page({
interviewResult:formData?.interviewResult,
description:formData?.description,
}
processResumeAPI(requestParams).then((result) => {
let { code, data} = result;
let { code,message, data} = result;
if(code == 0) {
// 处理成功刷新页面数据
this.getDetail(this.curDataId)
......@@ -357,14 +378,28 @@ Page({
title: '处理成功',
icon: 'success'
})
// 处理完成后关闭弹窗
this.hidePopup()
} else {
// 处理失败,重置处理状态
this.setData({
isProcessing: false
})
wx.showToast({
title: message || '处理失败',
icon: 'error'
})
}
}).catch( error => {
// 处理失败,重置处理状态
this.setData({
isProcessing: false
})
wx.showToast({
title: '处理失败',
icon: 'error'
})
})
this.hidePopup()
},
// 更新数据(弹窗确认回调)
......
......@@ -112,6 +112,10 @@ page {
font-size: var(--fontSize30);
flex: 1;
font-weight: 600;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: var(--fontSize460);
}
.tag {
display: inline-block;
......@@ -154,8 +158,8 @@ page {
margin-top: auto; // 推到底部
.phone {
color: #333333;
font-size: var(--fontSize28);
flex: 1;
font-size: var(--fontSize26);
margin-top: auto;
font-weight: 550;
.phone_text {
line-height: var(--fontSize50);
......@@ -165,7 +169,6 @@ page {
height: var(--fontSize48);
}
}
.date {
color: #5A5E66;
font-size: var(--fontSize25);
......@@ -181,54 +184,9 @@ page {
height: var(--fontSize96);
border-radius: var(--fontSize8);
}
.user_contact {
display: flex;
flex-direction: column;
justify-content: space-between;
flex: 1;
min-height: var(--fontSize96); // 与头像高度保持一致
color: #292d33;
font-size: var(--fontSize28);
padding-left: var(--fontSize20);
.name {
color: #292d33;
font-size: var(--fontSize30);
line-height: 1.2;
font-weight: 600;
}
.phone {
color: #333333;
font-size: var(--fontSize26);
margin-top: auto;
font-weight: 550;
.phone_text {
line-height: var(--fontSize50);
}
}
.phone_icon {
width: var(--fontSize48);
height: var(--fontSize48);
}
}
// 独立的日期元素(与 .user_contact 平级)
> .date {
color: #5A5E66;
font-size: var(--fontSize24);
text-align: right;
flex-shrink: 0;
line-height: 1.2;
width: var(--fontSize250);
white-space: nowrap;
padding-bottom: var(--fontSize10);
}
}
// 入职计划模块
.entry_plan {
.card {
min-height: var(--fontSize308);
}
.card_content {
display: flex;
flex-wrap: wrap;
......@@ -289,9 +247,6 @@ page {
}
// 招聘信息模块
.recruit_info {
.card {
min-height: var(--fontSize428);
}
.info_item {
display: flex;
justify-content: space-between;
......@@ -365,6 +320,11 @@ page {
align-items: center;
gap: var(--fontSize16);
margin-left: var(--fontSize20);
.arrow_right {
width: var(--fontSize14);
height: var(--fontSize28);
padding-top: var(--fontSize2);
}
.tag {
padding: var(--fontSize8) var(--fontSize20);
background: #f7f8fa;
......@@ -374,6 +334,7 @@ page {
border: 1px solid transparent;
transition: all 0.3s;
cursor: pointer;
-webkit-tap-highlight-color: transparent;
&.active {
background: #e8f4ff;
color: #347bff;
......@@ -461,6 +422,13 @@ page {
.btn_confirm {
background: #347bff;
color: #ffffff;
&.btn_disabled {
background: #cccccc;
color: #ffffff;
opacity: 0.8;
pointer-events: none;
}
}
}
}
......
......@@ -21,11 +21,16 @@
<view class="card">
<view class="card_top">
<image class="user_icon" src="/packageEquity/pages/image/staff-icon.png" mode="aspectFill"/>
<view class="user_contact">
<view class="name">{{item.personName}}</view>
<view class="phone" data-phone="{{item.phoneNumber}}" bind:tap="phoneCall"><text class="phone_text">{{item.phoneNumber}}</text><image class="phone_icon" src="/packageEquity/pages/image/call-icon.png" mode="widthFix"/></view>
</view>
<view class="date">入职时间:{{item.onboardingDate}}</view>
<view class="user_info">
<view class="user_top">
<view class="name">{{item.personName}}</view>
</view>
<view class="user_bottom">
<view class="phone" data-phone="{{item.phoneNumber}}" bind:tap="phoneCall"><text class="phone_text">{{item.phoneNumber}}</text><image class="phone_icon" src="/packageEquity/pages/image/call-icon.png" mode="widthFix"/></view>
<view class="date">入职时间:{{item.onboardingDate}}</view>
</view>
</view>
</view>
<view class="card_content">
<view class="item" wx:for="{{onboardingFieldsConfig}}" wx:key="field" wx:for-item="fieldItem">
......@@ -122,6 +127,7 @@
<view class="{{formData.dipalyTime ? 'time_text' : 'placeholder_text'}}">
{{formData.dipalyTime || '请选择面试时间'}}
</view>
<image class="arrow_right" src="/packageEquity/pages/image/arrow-right.png" mode="aspectFill"/>
</view>
</view>
<view class="form_item" wx:if="{{formData.processResult == 2}}">
......@@ -150,7 +156,7 @@
</scroll-view>
<view class="popup_footer">
<view class="btn btn_cancel" bindtap="hidePopup">取消</view>
<view class="btn btn_confirm" bindtap="confirmProcess">确认</view>
<view class="btn btn_confirm {{isProcessing ? 'btn_disabled' : ''}}" bindtap="confirmProcess">{{isProcessing ? '处理中...' : '确认'}}</view>
</view>
</view>
</van-popup>
......@@ -170,6 +176,7 @@
bind:cancel="calcelDate"
value="{{ currentDate }}"
formatter="{{ formatter }}"
max-date="{{ today }}"
bind:confirm="bindDateChange"
/>
</van-popup>
......
......@@ -19,7 +19,7 @@ const VALIDATION_CONFIG = {
Page({
data: {
formList:[
{id:0, label:"选择门店名称", placeholder:"请选择招聘门店", options:[]},
{id:0, label:"门店名称", placeholder:"请选择招聘门店", options:[]},
{id:1, label:"业务类型", placeholder:"请选择业务类型", options:[]},
{id:2, label:"招聘数量", placeholder:"请输入招聘数量"},
{id:3, label:"招聘类型", placeholder:"请选择招聘类型", options:[]},
......@@ -34,6 +34,7 @@ Page({
inputValue: '',
keyWord: '', // 搜索关键词
searchTimer: null, // 防抖定时器
isSubmitting: false, // 是否正在提交中,防止重复提交
},
// 显示popup
async showPopup(e) {
......@@ -220,11 +221,37 @@ Page({
inputValue: e.detail.value
});
},
// 数字输入变化
// 数字输入变化 - 仅允许输入整数并自动限制在1-100范围内
onNumberInput(e) {
const index = e.currentTarget.dataset.index;
const value = e.detail.value;
let value = e.detail.value;
const formList = this.data?.formList;
// 过滤非整数输入(去除小数点和非数字字符)
value = value.replace(/\D/g, '');
// 移除前导零
if (value.length > 1 && value.startsWith('0')) {
value = value.replace(/^0+/, '');
}
// 将空值处理为有效值
if (value === '') {
// 允许空值输入,不做处理
} else {
// 将数值转换为整数
let numValue = parseInt(value, 10);
// 自动将值限制在1-100范围内
if (numValue > 100) {
numValue = 100;
value = '100';
} else if (numValue < 1) {
numValue = 1;
value = '1';
}
}
// 更新对应项的值
formList[index].value = value;
formList[index].displayValue = value;
......@@ -232,14 +259,26 @@ Page({
formList
});
},
// textarea输入变化,禁止空格和换行
input(e) {
let {value} = e.detail
this.setData({
keyWord: value
})
},
handleReset() {
this.setData({
keyWord: ''
})
this.performSearch('');
},
// textarea输入变化,允许换行但禁止空格
onTextareaInput(e) {
const index = e.currentTarget.dataset.index;
let value = e.detail.value;
const formList = this.data.formList;
// 过滤掉空格和换行符
value = value.replace(/[\s\r\n]/g, '');
// 只过滤掉空格,保留换行符
value = value.replace(/ /g, '');
// 更新对应项的值
formList[index].value = value;
......@@ -312,6 +351,20 @@ Page({
submit() {
// 验证表单
if (!this.validateForm()) return
// 防止重复提交
if (this.data.isSubmitting) {
wx.showToast({
title: '请勿重复提交',
icon: 'none'
})
return
}
// 设置提交状态为true
this.setData({
isSubmitting: true
})
// 显示确认对话框
Dialog.confirm({
......@@ -325,11 +378,32 @@ Page({
.then(res => {
if (res.code == 0) {
this.navigateToResult()
} else {
// API返回错误,重置提交状态
this.setData({
isSubmitting: false
})
}
})
.catch(err => console.error('提交失败:', err))
.catch(err => {
console.error('提交失败:', err)
// 提交异常,重置提交状态
this.setData({
isSubmitting: false
})
wx.showToast({
title: '提交失败,请重试',
icon: 'none'
})
})
})
.catch(err => {
console.log('用户取消提交')
// 用户取消,重置提交状态
this.setData({
isSubmitting: false
})
})
.catch(err => console.log('用户取消提交'))
},
// 跳转到结果页面
navigateToResult() {
......@@ -392,7 +466,6 @@ Page({
this.setData({
[`formList[${index}].options`]: options
});
console.log(`返回字典数据 index=${index}`, options);
resolve(options);
}
}).catch(err => {})
......
{
"disableScroll": true,
"navigationBarTitleText": "添加招聘需求",
"usingComponents": {
}
}
\ No newline at end of file
......@@ -32,7 +32,6 @@ page {
justify-content: space-between;
height: var(--fontSize104);
align-items: center;
border-bottom: var(--fontSize2) solid #eff0f2;
font-size: var(--fontSize28);
.required {
color: #f24724;
......@@ -157,7 +156,6 @@ page {
}
.popup-fixed-top {
flex: 0 0 auto;
padding: var(--fontSize40) var(--fontSize40) 0;
}
.popup-fixed-bottom {
flex: 0 0 auto;
......@@ -172,32 +170,69 @@ page {
}
.popup-title {
height: var(--fontSize110);
line-height: var(--fontSize110);
font-size: var(--fontSize32);
font-weight: bold;
text-align: center;
margin-bottom: 15px;
border-bottom: var(--fontSize2) solid #E8E8EA;
}
.search-box {
width: var(--fontSize686);
padding: var(--fontSize20) 0;
margin-bottom: var(--fontSize20);
border-top: var(--fontSize2) solid #eee;
border-bottom: var(--fontSize2) solid #eee;
padding: var(--fontSize16) 0;
border-bottom: var(--fontSize2) solid #eff0f2;
margin: 0 var(--fontSize40);
.search-input {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
height: var(--fontSize72);
background-color: #f5f5f5;
border-radius: var(--fontSize36);
padding: 0 var(--fontSize30);
font-size: var(--fontSize28);
text-align: center;
box-sizing: border-box;
position: relative;
.search-icon {
width: var(--fontSize28);
height: var(--fontSize28);
position: absolute;
left: 45%;
top: 50%;
transform: translate(-100%, -50%);
z-index: 1;
margin-left: calc(var(--fontSize-14) - var(--fontSize28));
}
.input {
flex: 1;
height: 100%;
text-align: center;
background-color: transparent;
color: #333;
font-size: var(--fontSize28);
}
.input-placeholder {
color: #999;
text-align: center;
}
.search-clear {
width: var(--fontSize36);
height: var(--fontSize36);
position: absolute;
right: var(--fontSize30);
top: 50%;
z-index: 999;
transform: translateY(-50%);
}
}
}
.popup-options {
padding: var(--fontSize20) 0;
padding: var(--fontSize10) 0;
}
.option-item {
display: flex;
......@@ -206,6 +241,7 @@ page {
padding: var(--fontSize24);
border-bottom: var(--fontSize2) solid #eee;
font-size: var(--fontSize28);
}
.option-item:active {
background-color: #f2f3f5;
......@@ -249,6 +285,7 @@ page {
border-radius: var(--fontSize8);
padding: 0 var(--fontSize20);
box-sizing: border-box;
background-color: chartreuse;
}
.popup-buttons {
......
......@@ -43,7 +43,7 @@
</block>
</view>
<view class="footer">
<view class="btn" bind:tap="submit">提交</view>
<view class="btn {{isSubmitting ? 'btn-disabled' : ''}}" bind:tap="submit">{{isSubmitting ? '提交中...' : '提交'}}</view>
</view>
</view>
</scroll-view>
......@@ -53,12 +53,18 @@
<view class="popup-content">
<!-- 固定顶部区域 -->
<view class="popup-fixed-top">
<view class="popup-title">{{currentItem.label}}</view>
<view class="popup-title">选择{{currentItem.label}}</view>
<!-- 搜索框 -->
<view class="search-box" wx:if="{{currentIndex === 0}}">
<view class="search-input">
<search-input styleValue="border-bottom:none" value="{{keyWord}}" bindsearch="search" placeholder="搜索" />
<block wx:if="{{!keyWord}}">
<image src="/images/search.png" class="search-icon" />
</block>
<input type="text" placeholder="搜索" class="input" confirm-type="search" value="{{keyWord}}" placeholder-class="input-placeholder" bindinput="input" bindconfirm="search" />
<block wx:if="{{keyWord}}">
<image src="/images/clear.png" class="search-clear" bindtap="handleReset" />
</block>
</view>
</view>
</view>
......
......@@ -26,6 +26,8 @@ Page({
onLoad(options) {
let { mentorshipFormData } = this.data
let userInfo = wx.$util.getUserInfo()
this.getWaitstaffstate()
this.search()
// 非区域运营登录,打回到首页
//ll if (userInfo?.loginRole != 3) wx.reLaunch({ url: "/pages/loading/loading" })
if (userInfo?.isSuper) {
......@@ -47,8 +49,8 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
this.getWaitstaffstate()
this.search()
// this.getWaitstaffstate()
// this.search()
},
onBottomRefresh() {
this.getList()
......@@ -112,7 +114,6 @@ Page({
tipText: tipText || '' // 提示文本
}
})
console.log(list);
this.setData({
[`list[${currentPage - 1}]`]: list,
currentPage: currentPage + 1,
......@@ -132,14 +133,17 @@ Page({
// 跳转详情
handleDetail(e) {
const { item } = e.currentTarget.dataset;
console.log("跳转详情",item);
wx.$router.go("/packageEquity/pages/recruitManage/recruitDetail/recruitDetail", {
id: item.id
});
//仅已完成/以驳回可以调用flag接口
if(item.status == 0 || item.status == 1) return;
confiremStaffFlagAPI({id: item.id}).then(res => {
console.log(res);
let { code } = res;
if( code == 0) {
this.getWaitstaffstate()
this.search()
}
})
},
......@@ -150,7 +154,7 @@ Page({
/**
* 处理滚动事件
* 向上滚动超过阈值时隐藏按钮,向下滚动时显示按钮
* 监听向上滚动超过阈值时隐藏按钮,向下滚动时显示按钮
*/
handleScroll(e) {
const { scrollTop } = e.detail;
......@@ -158,7 +162,6 @@ Page({
// 计算滚动方向和距离
const scrollDistance = Math.abs(scrollTop - lastScrollTop);
// 只有滚动距离超过阈值才触发显隐逻辑,避免频繁切换
if (scrollDistance > scrollThreshold) {
// 向上滚动(scrollTop 增大)- 隐藏按钮
......
......@@ -7,6 +7,7 @@ page {
.container_page {
height: 100%;
overflow: hidden;
// 顶部Tab模块
.top_content{
background: #FFFFFF;
padding-top: var(--fontSize24);
......@@ -63,6 +64,7 @@ page {
position: relative;
}
}
// 列表模块
.content {
padding-top: var(--fontSize24);
height: calc(100vh - var(--fontSize120));
......@@ -164,10 +166,12 @@ page {
padding-bottom: var(--fontSize32);
}
}
// 空数据占位
.no_data {
height: 100%;
}
}
// 新增需求按钮
.insert_btn {
display: grid;
place-items: center;
......@@ -206,6 +210,7 @@ page {
opacity: 0;
}
}
// 触底提示
.list-nothing {
color: #999ea8;
font-size: var(--fontSize20);
......
<!-- 招聘管理 -->
<glsx-privacy appletName="招聘管理" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
<view class="container_page">
<!-- 顶部Tab -->
<!-- 顶部Tab模块 -->
<view class="top_content" wx:if="{{tabList.length}}">
<view class="tab_box">
<tab-bar tabList="{{ tabList }}" bindclick="tabClick" activeIndex="{{tabIndex}}" />
</view>
</view>
<!-- 列表模块 -->
<view class="content">
<scroll-view scroll-y enable-back-to-top refresher-enabled="{{ true }}" bindrefresherrefresh="search" bindscrolltolower="onBottomRefresh" bindscroll="handleScroll" class="list" scroll-top="{{ scrollTop }}" lower-threshold="400" refresher-threshold="104" refresher-triggered="{{ triggered }}">
<!-- 需求列表 -->
<!-- 需求列表 -->
<block wx:if="{{ list.length && list[0].length }}">
<block wx:for="{{ list }}" wx:key="ind" wx:for-item="i" wx:for-index="ind">
<view wx:for="{{ i }}" wx:key="index" class="item {{userInfo.isSuper ? 'super_item' : ''}}" bind:tap="handleDetail" data-item="{{item}}">
......@@ -23,7 +24,8 @@
<view class="value">{{item[it.labelName] || '-'}} <text wx:if="{{it.label == '招聘数量'}}">人</text> </view>
</block>
</view>
<view class="item_footer" wx:if="{{item.showTip && item.confirmFlag == 'N' && item.status !== 0}}">
<!-- 提示消息 -->
<view class="item_footer" wx:if="{{tabIndex == 0 && item.showTip && item.confirmFlag == 'N' && item.status !== 0}}">
<view class="msg_tips">
<text>{{item.tipText}}</text>
<image class="arrow_right" src="/packageEquity/pages/image/arrow-right.png" mode="aspectFill"/>
......@@ -35,6 +37,7 @@
<view class="list-nothing">没有更多了</view>
</block>
</block>
<!-- 空数据占位 -->
<view class="no_data" wx:else>
<empty-data />
</view>
......
......@@ -38,7 +38,6 @@ Page({
// 场景类型:0-会员权益/升级,1-精品升级,2-次新车转化,3-售后众筹
const scenePageMap = constantData.pageUrl
const targetPage = scenePageMap[sceneType] || 'tabIndex.index'
console.log('当前场景类型:', sceneType, '跳转页面:', targetPage)
wx.$router.reLaunch(targetPage, {});
},
......
......@@ -58,7 +58,7 @@ module.exports = {
data = {
sceneType: 0,
currentPage: 1,
pageSize: 100,
pageSize: 999999,
...data
}
return api.post('dj.api.smartcarlife.staff.missing.reception.report.mini.list', data)
......
......@@ -251,7 +251,8 @@ export const checkScene = options => {
'tabDateIndex': 'pages/tabDateIndex/pages/tabDateIndex',
'h5AuthPhone': 'pages/h5AuthPhone/h5AuthPhone',
'mentorShipManage': 'tabWorkOrder/pages/mentorshipManage/mentorshipManage',
'refundApply': 'tabWorkOrder/pages/refundApply/refundApply'
'refundApply': 'tabWorkOrder/pages/refundApply/refundApply',
'recruitDetail': 'packageEquity/pages/recruitManage/recruitDetail/recruitDetail'
}
options.path = pagePath[query.page]
}
......
......@@ -1278,6 +1278,7 @@ Page({
},
checkIsPadOrNot() {
let _this = this
wx.getRendererUserAgent({
success(res) {
let isPad = /iPad|Android.*Tablet|Kindle|Silk/i.test(res.userAgent)
......
......@@ -22,78 +22,90 @@ class Request {
let _this = this
return new Promise((resolve, reject) => {
wx.showNavigationBarLoading()
if (!data) data = {}
let header =
RequestMethods === 'POST' ? {
'content-type': 'application/x-www-form-urlencoded'
} : {};
let url = `${domain[domainName]}${requestPath || path}`;
// console.log(requestPath)
if (method) {
data = _this.getData(data, method, noSignAttr, domainName == 'merchants')
url = `${domain[domainName]}${requestPath || path}?method=${method}`;
} else {
header = {
'content-type': 'application/json'
}
}
// console.log('reqData',data?.sessionId);
// delete
// if (data?.sessionId) {
// delete data?.sessionId
// }
wx.request({
url,
data,
method: RequestMethods,
header,
dataType: 'json',
responseType: 'text',
success(response) {
/**业务代码 */
let {
data: {
code,
message,
subErrors
},
data
} = response
if (code == 20 || code == 21) {
let thisPage = wx.$router.getPageInstance()
// console.log(thisPage);
wx.hideLoading()
if (thisPage.route != 'pages/wxLogin/wxLogin') {
getApp().login(true, '', url)
}
} else if (code == -1) {
wx.getNetworkType({
success(res) {
if (res.networkType == "none") {
wx.hideLoading();
wx.showToast({
title: message || '网络请求失败',
icon: 'none'
title: '网络异常',
icon: "none",
})
resolve(data)
} else {
// util.debounce( getApp().test(true),500)
// getApp().test()
// console.log(data,'data');
resolve(data)
return;
}
},
fail(error) {
wx.hideLoading()
console.error(`接口异常:${domain[domainName]}${requestPath || path}?method=${method}`, error)
if (failTips) {
wx.showToast({
title: '系统异常',
icon: 'error'
})
if (!data) data = {}
let header =
RequestMethods === 'POST' ? {
'content-type': 'application/x-www-form-urlencoded'
} : {};
let url = `${domain[domainName]}${requestPath || path}`;
// console.log(requestPath)
if (method) {
data = _this.getData(data, method, noSignAttr, domainName == 'merchants')
url = `${domain[domainName]}${requestPath || path}?method=${method}`;
} else {
header = {
'content-type': 'application/json'
}
}
reject(error)
},
complete() {
wx.stopPullDownRefresh()
wx.hideNavigationBarLoading()
// console.log('reqData',data?.sessionId);
// delete
// if (data?.sessionId) {
// delete data?.sessionId
// }
wx.request({
url,
data,
method: RequestMethods,
header,
dataType: 'json',
responseType: 'text',
success(response) {
/**业务代码 */
let {
data: {
code,
message,
subErrors
},
data
} = response
if (code == 20 || code == 21) {
let thisPage = wx.$router.getPageInstance()
// console.log(thisPage);
wx.hideLoading()
if (thisPage.route != 'pages/wxLogin/wxLogin') {
getApp().login(true, '', url)
}
} else if (code == -1) {
wx.showToast({
title: message || '网络请求失败',
icon: 'none'
})
resolve(data)
} else {
// util.debounce( getApp().test(true),500)
// getApp().test()
// console.log(data,'data');
resolve(data)
}
},
fail(error) {
wx.hideLoading()
console.error(`接口异常:${domain[domainName]}${requestPath || path}?method=${method}`, error)
if (failTips) {
wx.showToast({
title: '系统异常',
icon: 'error'
})
}
reject(error)
},
complete() {
wx.stopPullDownRefresh()
wx.hideNavigationBarLoading()
}
})
}
})
})
......@@ -114,7 +126,7 @@ class Request {
if (!apiName) {
throw new Error('apiName is null')
}
if(apiName.split('.').length > 1) apiName = apiName.split('.')[0]
if (apiName.split('.').length > 1) apiName = apiName.split('.')[0]
if (merchant) apiName = 'merchants'
const appKey = secretKey[apiName].appKey
const secret = secretKey[apiName].secret
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!