Commit 6d5d05d2 by chenwq

工作日报和h5

1 parent 3d41c6f4
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
"pages/log/log", "pages/log/log",
"pages/changeScene/changeScene", "pages/changeScene/changeScene",
"pages/materails/index", "pages/materails/index",
"pages/pointsReview/pointsReview" "pages/pointsReview/pointsReview",
"pages/h5AuthPhone/h5AuthPhone"
], ],
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",
......
// pages/h5AuthPhone/h5AuthPhone.js
import api from '../../api/api.js'
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onShow(options) {
// this.init()
this.login()
},
jumpH5(target) {
const url = 'http://scrm.dev.glsx.com.cn/dj-scrm-wx-work-main-cwq/#/group?roleType=99&authPhone=' + target.phone
wx.navigateTo({
url: `/pages/webView/webView?url=${encodeURIComponent(url)}`
})
},
login() {
wx.$util.showLoading()
let _this = this
wx.login({
success({
code
}) {
if (code) {
api
.wxLogin({
code,
appId: wx.getAccountInfoSync().miniProgram.appId
})
.then(res => {
wx.$util.hideLoading()
if (res.code == '0') {
_this.setData({
loginToken: res.data
})
}
})
} else {
wx.$util.showToast('登录失败')
}
}
})
},
/**
* 获取授权手机号
*/
getPhoneNumber(e) {
let {
loginToken
} = this.data
let {
encryptedData,
iv
} = e.detail
if (!encryptedData) return
wx.$util.showLoading('加载中...')
api
.authPhone({
encryptedData,
loginToken,
iv,
noSignIn: false
})
.then(({
code,
data,
message
}) => {
wx.hideLoading()
console.log(data, 'data---')
if (code == 0) {
let {
loginUserInfoList,
sessionId,
noSignInUuid,
needSelectAccount
} = data
if (loginUserInfoList.length) {
this.jumpH5(loginUserInfoList[0])
} else {
wx.$router.reLaunch('pages.nothing')
}
} else {
wx.hideLoading()
wx.showModal({
title: '温馨提示',
content: message,
showCancel: false,
confirmText: '知道了',
confirmColor: '#347BFF'
})
}
})
},
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* pages/h5AuthPhone/h5AuthPhone.wxss */
.button {
width: 100% !important;
height: 88rpx;
background: var(--btnColor);
border-radius: 16rpx;
font-weight: 500;
font-size: 28rpx;
color: #FFFFFF;
line-height: 88rpx;
padding: 0;
transition: all .1s;
background-color: black;
}
\ No newline at end of file \ No newline at end of file
<!--pages/h5AuthPhone/h5AuthPhone.wxml-->
<view>
<button class="button" hover-class="btn-hover" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">授权登录
</button>
</view>
\ No newline at end of file \ No newline at end of file
...@@ -267,6 +267,6 @@ module.exports = { ...@@ -267,6 +267,6 @@ module.exports = {
/** 获取与会驻店人员 */ /** 获取与会驻店人员 */
getStaffList(data) { getStaffList(data) {
return api.get("dj.api.mindworkplate.app.daily.report.staffBaseInfo.pageList", data); return api.post("dj.api.mindworkplate.app.daily.report.staffBaseInfo.pageList", data);
}, },
}; };
// tabWorkOrder/pages/supervisorDaily/components/selectPopup/selectPopup.js
Component({
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
observer: function (n) {
if (n) {
this.setData({
nothing: !this.data.optionList.length,
keyword: '',
scrollTop: 0
})
this.search();
}
}
},
title: {
type: String,
value: '标题'
},
optionList: Array,
optionLabel: {
type: String,
value: 'confLabel'
}
},
/**
* 组件的初始数据
*/
data: {
keyword: '',
scrollTop: 0,
nothing: false,
isLoad: false
},
/**
* 组件的方法列表
*/
methods: {
clear() {
this.setData({
keyword: ""
});
this.search();
},
input(e) {
let {
value
} = e.detail;
this.setData({
keyword: value
});
},
search() {
var { keyword, isLoad } = this.data
if(isLoad) {
return true
}
this.setData({
isLoad: true
})
wx.$util.showLoading()
this.triggerEvent('search', {staffName: keyword})
},
choose(e) {
let { idx, item } = e.currentTarget.dataset
this.triggerEvent('click', {idx, item})
},
confirm() {
var { isLoad } = this.data
if(isLoad) {
return true
}
this.triggerEvent('confirm')
},
hidePopup() {
var { isLoad } = this.data
if(isLoad) {
return true
}
this.triggerEvent('cancel')
},
}
})
\ 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
/* tabWorkOrder/pages/supervisorDaily/components/selectPopup/selectPopup.wxss */
.title{
margin-bottom: var(--fontSize20);
color: #292D33;
font-weight: 400;
font-size: var(--fontSize32);
}
.store-select-box{
height: calc(100% - var(--fontSize168));
}
.merchant-box{
height:100%;
}
.merchant-box .item{
display: flex;
height: var(--fontSize88);
align-items: center;
color: #292D33;
border-bottom: var(--fontSize1) solid #EFF0F2;
}
.merchant-box .item:last-child{
border-bottom: none;
}
.merchant-box .item.active{
color: #347BFF;
}
.item .merchant_item{
height: var(--fontSize88);
font-size: var(--fontSize28);
display: flex;
align-items: center;
width:94%;
}
.item .merchant_item .text-hide{
max-width: calc(100% - var(--fontSize192));
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.item .icon {
width: var(--fontSize32);
height: var(--fontSize32);
display: block;
margin-right: var(--fontSize20);
flex-shrink: 0;
}
.item .icon .arc {
width: 100%;
height: 100%;
border: var(--fontSize2) solid #979797;
border-radius: 100%;
box-sizing: border-box;
}
.mark{
width:var(--fontSize32);
height: var(--fontSize32);
}
.list-nothing,
.list-not {
text-align: center;
}
.search-input {
// border: 1rpx solid #979797;
background: #F7F8FA;
border-radius: var(--fontSize38);
//width: calc(100% - var(--fontSize64));
height: var(--fontSize72);
display: flex;
align-items: center;
margin: 16rpx 0;
}
.search-input .search-icon {
width: var(--fontSize28);
height: var(--fontSize28);
margin: 0 var(--fontSize10) 0 var(--fontSize26);
}
.search-input .search-clear {
width: var(--fontSize36);
height: var(--fontSize36);
margin: 0 var(--fontSize26) 0 var(--fontSize10);
}
.search-input .input {
font-size: var(--fontSize28);
height: var(--fontSize38);
line-height: var(--fontSize38);
width: calc(100% - var(--fontSize136));
}
.input-placeholder {
color: rgba(200, 201, 204, .89);
}
\ No newline at end of file \ No newline at end of file
<!--tabWorkOrder/pages/supervisorDaily/components/selectPopup/selectPopup.wxml-->
<popup title="{{title}}" show="{{ show }}" bindconfirm="confirm" height="85%" bindcancel="hidePopup" class="store-wrap">
<view class="search-input">
<image src="/images/search.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>
<block wx:if="{{!isLoad}}">
<scroll-view class="store-select-box" scroll-top="{{scrollTop}}" style="height: calc(100% - var(--fontSize60));" enhanced="{{true}}" show-scrollbar="{{false}}" scroll-y bindscrolltolower="mineReachBottom">
<view class="merchant-box" wx:if="{{optionList.length>0}}">
<block wx:for="{{optionList}}" wx:key="index">
<view class="item {{item.active?'active':''}}" bindtap="choose" data-item="{{ item }}" data-idx="{{ index }}">
<view class="merchant_item">
<view class="text-hide">{{item[optionLabel]}}</view>
</view>
<view class="mark" wx:if="{{item.active}}">
<gl-image class="icon" src="/equity/mark.png" />
</view>
</view>
</block>
<block wx:if="{{nothing}}">
<view class="list-nothing">到底了~</view>
</block>
</view>
<view class="no-data" wx:else>
<empty-data />
</view>
</scroll-view>
</block>
</popup>
\ No newline at end of file \ No newline at end of file
...@@ -49,7 +49,7 @@ Page({ ...@@ -49,7 +49,7 @@ Page({
isChangeTab: false, isChangeTab: false,
isConfirm: false, isConfirm: false,
tabChange: true, tabChange: true,
staffCheckList: []
}, },
/** /**
...@@ -247,8 +247,8 @@ Page({ ...@@ -247,8 +247,8 @@ Page({
imgObj imgObj
}) })
}, },
// 问题选择 // 与会驻店选择
handleProblemPicker(e) { handleStaffPicker(e) {
let { pname, name } = e.currentTarget.dataset; let { pname, name } = e.currentTarget.dataset;
let { isDisable } = this.data let { isDisable } = this.data
if (isDisable) { if (isDisable) {
...@@ -272,21 +272,22 @@ Page({ ...@@ -272,21 +272,22 @@ Page({
showSelectItemPopup: true, showSelectItemPopup: true,
}); });
}, },
// 问题选择确定 // 与会驻店人员选择确定
changePromble(e) { changeStaff(e) {
// if (programeFlag) return; let { selectItemName, tmlpFormData, staffCheckList } = this.data;
// programeFlag = true;
let { mutiOption, selectItemName, tmlpFormData } = this.data;
tmlpFormData[selectItemName] = ""; tmlpFormData[selectItemName] = "";
tmlpFormData[selectItemName + "Txt"] = ""; tmlpFormData[selectItemName + "Txt"] = "";
// 与会驻店人员的ids
tmlpFormData.staffIds = "";
var list = []; var list = [];
mutiOption[selectItemName].optionList.forEach((item) => { var ids = []
if (item.active) { staffCheckList.forEach((item) => {
list.push(item.staffName); list.push(item.staffName);
} ids.push(item.id)
}); });
tmlpFormData[selectItemName] = list.join(","); tmlpFormData[selectItemName] = list.join(",");
tmlpFormData[selectItemName + 'Txt'] = list.join(',') tmlpFormData[selectItemName + 'Txt'] = list.join(',')
tmlpFormData.staffIds = ids.join(",")
let selectedStr = list.slice(0, 2).join(';') let selectedStr = list.slice(0, 2).join(';')
let selectTxt = (list.length > 2 ? ';等' + list.length + '人' : '') let selectTxt = (list.length > 2 ? ';等' + list.length + '人' : '')
this.setData( this.setData(
...@@ -298,12 +299,22 @@ Page({ ...@@ -298,12 +299,22 @@ Page({
} }
); );
}, },
staffSearch(e) {
let { staffName } = e.detail
console.log(staffName, 'staffname')
this.getStaffList(staffName)
},
click(e) { click(e) {
let { idx } = e.detail let { idx, item } = e.detail
let { mutiOption, selectPName, let { mutiOption, selectPName,
selectItemName } = this.data selectItemName, staffCheckList } = this.data
const checkIdx = staffCheckList.findIndex(k => k.id == item.id)
checkIdx == -1 ? staffCheckList.push(item) : staffCheckList.splice(checkIdx, 1)
this.setData({ this.setData({
[`mutiOption.${selectItemName}.optionList[${idx}].active`]: !this.data.mutiOption[selectItemName].optionList[idx].active [`mutiOption.${selectItemName}.optionList[${idx}].active`]: !this.data.mutiOption[selectItemName].optionList[idx].active,
staffCheckList
}) })
this.setData({ this.setData({
showSelectItemPopup: true, showSelectItemPopup: true,
...@@ -388,8 +399,8 @@ Page({ ...@@ -388,8 +399,8 @@ Page({
frontConfig.labelName = k.key + 'Txt' frontConfig.labelName = k.key + 'Txt'
} }
tempTmlpItemObj[val.key][k.key] = { tempTmlpItemObj[val.key][k.key] = {
placeholder: k.placeholder, placeholder: k.placeholder,
maxlength: frontConfig.maxlength || '140' maxlength: frontConfig.maxlength || '140'
} }
list.push({ list.push({
label: k.name, label: k.name,
...@@ -447,7 +458,7 @@ Page({ ...@@ -447,7 +458,7 @@ Page({
this.setData({ this.setData({
tmlpObj: obj, tmlpObj: obj,
tmlpFormData, tmlpFormData,
tmlpItemObj :tempTmlpItemObj, tmlpItemObj: tempTmlpItemObj,
imgObj, imgObj,
selectedStr, selectedStr,
selectTxt, selectTxt,
...@@ -455,31 +466,50 @@ Page({ ...@@ -455,31 +466,50 @@ Page({
}, () => { }, () => {
const staffIdx = obj?.organizeTraining?.findIndex(k => k.name == 'attendingStaff') || -1 const staffIdx = obj?.organizeTraining?.findIndex(k => k.name == 'attendingStaff') || -1
if (staffIdx != -1) { if (staffIdx != -1) {
this.getStaffList(staffIdx) this.getStaffList()
} }
this.dealOrganizeTraining() this.dealOrganizeTraining()
}) })
}, },
getStaffList(staffIdx) { getStaffList(staffName) {
let that = this let that = this
let params = { let params = {
staffName: staffName,
pageNum: 1, pageNum: 1,
pageSize: 99999 pageSize: 99999
} }
//organizeTraining //organizeTraining
api.getStaffList(params).then(res => { api.getStaffList(params).then(res => {
console.log(res, 'res-staff----') console.log(res, 'res-staff----')
let { tmlpObj } = that.data let { tmlpObj, staffCheckList, mutiOption } = that.data
const staffIdx = tmlpObj?.organizeTraining?.findIndex(k => k.name == 'attendingStaff') || -1 const staffIdx = tmlpObj?.organizeTraining?.findIndex(k => k.name == 'attendingStaff') || -1
if (staffIdx != -1) { if (staffIdx != -1) {
if (staffCheckList.length) {
staffCheckList.forEach(item => {
let findIdx = res.data.list.findIndex(i => i.id == item.id)
if (findIdx != -1) {
res.data.list[findIdx].active = true
}
})
}
tmlpObj.organizeTraining[staffIdx].optionId = 'id' tmlpObj.organizeTraining[staffIdx].optionId = 'id'
tmlpObj.organizeTraining[staffIdx].optionLabel = 'staffName' tmlpObj.organizeTraining[staffIdx].optionLabel = 'staffName'
tmlpObj.organizeTraining[staffIdx].optionList = res.data.list tmlpObj.organizeTraining[staffIdx].optionList = res.data.list
mutiOption.attendingStaff = {
optionList: tmlpObj.organizeTraining[staffIdx].optionList
}
this.setData({ this.setData({
mutiOption,
tmlpObj tmlpObj
}) })
} }
}).finally(() => {
const staffPopup = this.selectComponent("#staffPopup");
wx.$util.hideLoading()
staffPopup.setData({
isLoad: false
})
}) })
}, },
...@@ -509,6 +539,8 @@ Page({ ...@@ -509,6 +539,8 @@ Page({
noOrganAttrList.forEach(item => { noOrganAttrList.forEach(item => {
delete params[item] delete params[item]
}) })
delete params.staffIds
delete params.attendingStaffTxt
} }
if (params.attendingStaff) { if (params.attendingStaff) {
params.attendingStaff = params.attendingStaffTxt params.attendingStaff = params.attendingStaffTxt
...@@ -543,6 +575,24 @@ Page({ ...@@ -543,6 +575,24 @@ Page({
}); });
}, },
validLink(formData) {
//https://meeting.tencent.com/crm/;无录屏
if (/https:\/\/meeting.tencent.com\/crm\//.test(formData.tencentMeetingRecordingLink) || formData.tencentMeetingRecordingLink.includes('无录屏')) {
return false
} else {
wx.showModal({
title: '温馨提示',
content: '请参考示例,填写正确的录屏链接,如没有录屏链接则填写“无录屏”。',
confirmText: '好的',
confirmColor: '#347BFF',
showCancel: false,
success(res) {
}
})
return true
}
},
handleConfirm() { handleConfirm() {
// var { tabActive } = this.data // var { tabActive } = this.data
// let formRule = allRuleObj[tabActive] // let formRule = allRuleObj[tabActive]
...@@ -557,7 +607,6 @@ Page({ ...@@ -557,7 +607,6 @@ Page({
const attrList = Object.keys(allRuleObj) const attrList = Object.keys(allRuleObj)
for (let i = 0; i < attrList.length; i++) { for (let i = 0; i < attrList.length; i++) {
let formRule = allRuleObj[attrList[i]] let formRule = allRuleObj[attrList[i]]
console.log(attrList[i])
let validObj = fn.checkRequired(formData, formRule) let validObj = fn.checkRequired(formData, formRule)
if (validObj) { if (validObj) {
this.setData({ this.setData({
...@@ -567,9 +616,16 @@ Page({ ...@@ -567,9 +616,16 @@ Page({
return return
} }
} }
if (this.validLink(formData)) {
this.setData({
isConfirm: false
})
return
}
let params = { let params = {
formJson: this.dealParams() formJson: this.dealParams()
} }
console.log(JSON.parse(JSON.stringify(params)), 'params-----')
this.secondConfirm(params) this.secondConfirm(params)
}, },
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
"usingComponents": { "usingComponents": {
"van-overlay": "@vant/weapp/overlay/index", "van-overlay": "@vant/weapp/overlay/index",
"weekCalendar": "../staffDaily/components/weekCalendar/weekCalendar", "weekCalendar": "../staffDaily/components/weekCalendar/weekCalendar",
"select-item-popup": "../staffDaily/components/selectItemPopup/selectItemPopup" "select-item-popup": "../staffDaily/components/selectItemPopup/selectItemPopup",
"select-popup": "./components/selectPopup/selectPopup"
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<gl-cust-form wx:if="{{tmlpObj && tabChange}}" id="{{tabActive}}" formData="{{ tmlpFormData }}" disable="{{isDisable}}" dataAttrName="{{ dataAttrName }}" formDataList="{{ tmlpObj[tabActive] }}" bind:radioEvent="radioEvent"> <gl-cust-form wx:if="{{tmlpObj && tabChange}}" id="{{tabActive}}" formData="{{ tmlpFormData }}" disable="{{isDisable}}" dataAttrName="{{ dataAttrName }}" formDataList="{{ tmlpObj[tabActive] }}" bind:radioEvent="radioEvent">
<!-- 与会人员 --> <!-- 与会人员 -->
<view wx:if="{{tabActive == 'organizeTraining'}}" slot='attendingStaff' class="attendingStaff"> <view wx:if="{{tabActive == 'organizeTraining'}}" slot='attendingStaff' class="attendingStaff">
<view class="picker" bindtap="handleProblemPicker" data-name="attendingStaff" data-pname="organizeTraining"> <view class="picker" bindtap="handleStaffPicker" data-name="attendingStaff" data-pname="organizeTraining">
<image class="pickerArrow" src="/components/images/arrow-x.png" /> <image class="pickerArrow" src="/components/images/arrow-x.png" />
<view class="flex" wx:if="{{selectedStr}}"> <view class="flex" wx:if="{{selectedStr}}">
<view class="text-hide">{{ selectedStr }}</view> <view class="text-hide">{{ selectedStr }}</view>
...@@ -71,7 +71,8 @@ ...@@ -71,7 +71,8 @@
</view> </view>
</view> </view>
<!-- 与会人员多选 --> <!-- 与会人员多选 -->
<select-item-popup show="{{showSelectItemPopup}}" title="{{selectItemTitle}}" optionList="{{mutiOption[selectItemName].optionList}}" index="1" optionLabel="staffName" bindconfirm="changePromble" bindcancel="closeSlectItemPopup" bindclick="click" /> <!-- <select-item-popup show="{{showSelectItemPopup}}" title="{{selectItemTitle}}" optionList="{{mutiOption[selectItemName].optionList}}" index="1" optionLabel="staffName" bindconfirm="changeStaff" bindcancel="closeSlectItemPopup" bindclick="click" /> -->
<select-popup show="{{showSelectItemPopup}}" id="staffPopup" title="{{selectItemTitle}}" optionList="{{mutiOption[selectItemName].optionList}}" index="1" optionLabel="staffName" bindconfirm="changeStaff" bindcancel="closeSlectItemPopup" bindclick="click" bindsearch="staffSearch"></select-popup>
<van-overlay show="{{ imgShow }}" bind:click="onClickHide" z-index="99999999"> <van-overlay show="{{ imgShow }}" bind:click="onClickHide" z-index="99999999">
<view class="wrapper"> <view class="wrapper">
<image src="{{IMG_URL}}/{{imgName}}.png" mode="widthFix" /> <image src="{{IMG_URL}}/{{imgName}}.png" mode="widthFix" />
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!