提交 ca5def32 authored 作者: zhenglide's avatar zhenglide

初始化

上级 e6dbbd34
流水线 #149 已取消 于阶段
*{
font-size: 26rpx;
}
::-webkit-scrollbar{ display: none;}
page {
flex: 1;
display: flex;
background: #f7f7f7;
}
.page{
width: 734rpx;
height: auto;
overflow: auto;
margin: 0 auto;
}
.item-avatar-xs{
display: flex;
padding: 30rpx 30rpx;
border-bottom: 1rpx solid #eee;
cursor: pointer;
background: #fff;
position:relative;
}
.button{
margin-top: 50rpx;
}
.graySpace{
padding-left: 40rpx;
background: #eee;
font-size: 12px;
min-height: 18rpx;
}
App({
//E应用初始化
onLaunch(options) {
console.log('App Launch', options);
console.log('getSystemInfoSync', dd.getSystemInfoSync());
console.log('SDKVersion', dd.SDKVersion);
this.globalData.corpId = options.query.corpId;
},
//E应用切换到前台
onShow(options) {
// 从后台被 scheme 重新打开
// options.query == {number:1}
},
//全局数据
globalData: {
domain:"https://dd2.ubainsyun.com",
corpId: '',
userId:'',
person:'',
function:'',
keyword:''
}
});
{
"pages": [
"pages/conference/index/index",
"pages/conference/search/search",
"pages/login/login",
"pages/mine/my/my",
"pages/mine/edit/edit",
"pages/meeting/record/record",
"pages/conference/details/details",
"pages/conference/addmeeting/addmeeting",
"pages/conference/visitor/visitor",
"pages/conference/ex_visitor/ex_visitor",
"pages/conference/modifymeeting/modifymeeting",
"pages/meeting/recording/recording",
"pages/meeting/summary/summary",
"pages/meeting/details/details",
"pages/conference/seat/seat",
"pages/mine/service/service",
"pages/mine/help/help",
"pages/mine/opinion/opinion"
],
"window": {
"defaultTitle": "UBAINS会议",
"allowsBounceVertical":"NO"
},
"tabBar": {
"textColor":"#555555",
"selectedColor":"#1696db",
"items": [
{
"name": "预定",
"pagePath":"pages/conference/index/index",
"icon":"/resource/images/room.png",
"activeIcon":"resource/images/room2.png"
},
{
"name": "会议",
"pagePath": "pages/meeting/record/record",
"icon":"/resource/images/ordain.png",
"activeIcon":"resource/images/ordain2.png"
},
{
"name": "我的",
"pagePath": "pages/mine/my/my",
"icon":"/resource/images/my.png",
"activeIcon":"resource/images/my2.png"
}
]
}
}
/* @import "./search.acss"; */
.item-avatar-xs text,input,radio{
font-size: 32rpx;
line-height: 80rpx;
}
.item-avatar-xs{
display: flex;
padding: 20rpx;
border-bottom: 1rpx solid #eee;
cursor: pointer;
position:relative;
}
.item-avatar-xs input{
width: 60%;
margin-top: 15rpx;
}
.left{
position: absolute;
margin-left: 660rpx;
}
.item-avatar-xs image{
width: 48rpx;
height: 48rpx;
margin-top: 15rpx;
}
.add{
width: 100%;
}
.add input{
width: 80%;
float: left;
}
.add image{
float: right;
margin-right: 50rpx;
}
.item-avatar-xs textarea{
width: 70%;
height: 80rpx;
margin-top: 18rpx;
font-size: 32rpx;
}
.add_bg{
background: #fff;
/* margin-top: 10rpx; */
padding: 50rpx;
}
.add_bg text{
display: block;
height: 40rpx;
line-height: 40rpx;
font-size: 26rpx;
margin-top: -20rpx;
float: left;
}
.add_time{
position: relative;
font-size: 26rpx;
top: -30rpx;
margin-top: -40rpx;
margin-left: 480rpx;
}
.add_time text{
font-size: 32rpx;
color: #156EF3;
padding: 0 10rpx;
}
.times{
width: 99.5%;
height: 500rpx;
margin-top: 10rpx;
border: 1px solid #ccc;
white-space: nowrap;
display:flex;
}
.min_box{
float: left;
margin-top: 32rpx;
width: 100rpx;
height: 470rpx;
}
.min{
width: 100rpx;
height:120rpx;
line-height: 120rpx;
}
.hour{
display: block;
width: 120rpx;
text-align: center;
}
.scroll-view-item_H{
flex-shrink:0;
flex-grow:0;
}
.time-block{
width:120rpx;
height: 120rpx;
border: 1px solid #ccc;
}
.left2{
position: absolute;
margin-left: 580rpx;
margin-top: 8rpx;
}
.add_btn{
margin-left: 80rpx;
margin-top: 10rpx;
}
.se_btning{
background: #156EF3;
color: #fff;
border-radius: 0;
}
.item-avatar-xs button{
width: 180rpx;
height: 60rpx;
line-height: 60rpx;
font-size: 26rpx;
border-radius: 0;
float: right;
}
.item-avatar-xs button::after{
border-radius: 0;
}
.item-avatar-show{
display: block;
}
.item-avatar-hide{
display: none;
}
.mask2{
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background: #000;
z-index: 9000;
opacity: 0.5;
}
.modaltime2{
width: 80%;
height: 520rpx;
position: fixed;
top: 50%;
left: 0;
z-index: 9999;
margin: -340rpx 75rpx;
background-color: #fff;
border-radius: 5rpx;
display: flex;
flex-direction: column;
align-items: center;
padding-top: 10rpx;
padding-bottom: 20rpx;
}
.radio-group{
width: 100%;
height: 100rpx;
margin-top: 20rpx;
border-bottom: 1px solid #eee;
}
.radio{
line-height: 80rpx;
margin-left: 100rpx;
}
.checkbox-group{
width: 100%;
height: 90rpx;
}
.no-checkbox{
display: block;
width: 100%;
height: 90rpx;
line-height: 90rpx;
margin-left: 100rpx;
margin-top: 10rpx;
margin-bottom: 20rpx;
}
.checkbox{
display: block;
width: 100%;
height: 90rpx;
line-height: 90rpx;
margin-left: 100rpx;
margin-top: 30rpx;
}
.selectpocker{
width: 70%;
height: 35px;
line-height: 35px;
text-align: right;
margin-left: 60rpx;
/* overflow-x: scroll; */
}
.checkbox checkbox{
margin-top: 20rpx;
}
.checkbox text{
margin-left: 20rpx;
}
.add{
margin: 20rpx auto;
}
.add_img{
width: 32rpx;
height: 32rpx;
margin-left: 540rpx;
/* margin-top: -6rpx; */
}
.se_btn_hide{
display: none;
height: 80rpx;
position: relative;
margin-top: 0.1rpx;
}
.se_btn_show{
display: block;
}
.check {
display:flex;
flex-wrap:wrap;
justify-content:flex-start;
}
.check label {
width: 140rpx;
height: 60rpx;
font-size: 22rpx;
border-radius: 8rpx;
display: flex;
align-items: center;
margin: 0 8rpx;
justify-content: center;
margin-top: 20rpx;
}
.is_checked {
background-color: #156EF3;
color: #fff;
border: 1rpx solid #fff;
}
.section{
background: #fff;
padding:20rpx;
border-bottom: 1px solid #eee;
}
.section text{
font-size: 32rpx;
line-height: 80rpx;
}
.section image{
width: 40rpx;
height: 40rpx;
float: right;
margin-top: 20rpx;
}
.required{
font-size: 10rpx;
color: red;
margin-right: 10rpx;
}
\ No newline at end of file
<view class="page">
<form onSubmit="formSubmit" onReset="formReset">
<!-- <picker onChange="bindPickerChange" value="{{index}}" range="{{conferenceList}}" range-key="conferenceName" name="conferenceName">
<view class='item-avatar-xs'>
<text>会议室</text>
<text class='selectpocker'>{{conferenceList[index].conferenceName}}</text>
<text class='left'>〉</text>
</view>
</picker> -->
<view class='item-avatar-xs'>
<text><text class="required">*</text>会议名称:</text>
<input type='text' placeholder='请输入会议名称' name="messageName" />
</view>
<view class='item-avatar-xs'>
<text><text class="required">*</text>主持人:</text>
<input type='text' value="{{username}}" placeholder='请输入主持人' name="messageCompere" />
</view>
<view class='item-avatar-xs'>
<text>添加议题:</text>
<input type='text' placeholder='输入议题' name="messageTheme" />
<image src='../../../resource/images/add.png' onTap='addList'></image>
</view>
<view class="item-avatar-xs" a:for="{{lists}}" a:key="{{index}}">
<view class='add'>
<input type='text' placeholder='输入议题' name="messageTheme" />
<image src='../../../resource/images/off.png' onTap='delList'></image>
</view>
</view>
<view class='item-avatar-xs'>
<text>会议信息:</text>
<textarea placeholder='输入内容' name="messageContent"></textarea>
</view>
<view class="graySpace"></view>
<view class='add_bg'>
<!-- <picker mode="date" onChange="bindDateChange" name="startTime">
<text class="picker">日期: {{dates}}</text>
</picker> -->
<text onTap="datePicker">日期: {{dates}}</text>
</view>
<view class='add_time'>
<view>会议时间:
<text>{{time.min}}</text>分钟
</view>
</view>
<view class="graySpace"></view>
<scroll-view class='times scroll-view_H' scroll-x="{{true}}" scroll-with-animation="{{true}}" scroll-left="100rpx">
<view class="min_box">
<view a:for="{{allTime.minutes}}" a:for-item="minute">
<view class="min">{{minute}}分钟</view>
</view>
</view>
<view a:for="{{timeList}}" a:for-item="time" a:for-index="hindex">
<text class="hour">{{hindex}}:00</text>
<view class="scroll-view-item_H" a:for="{{time}}" a:for-item="t" a:for-index="mindex">
<view data-hour="{{t.hour}}"data-unclick="{{t.unclick}}" data-minute="{{t.minute}}" data-hour-index="{{hindex}}" data-min-index="{{mindex}}" style="background-color:{{t.color}}" class="time-block" onTap="selTime"></view>
</view>
</view>
</scroll-view >
<view class="graySpace"></view>
<navigator url="../visitor/visitor?mid={{mid}}&cnum={{cnum}}" open-type="navigate" class='item-avatar-xs'>
<text>公司参与人员</text>
<text class='left'>〉</text>
</navigator>
<navigator url="../ex_visitor/ex_visitor?mid={{mid}}" open-type="navigate" class='item-avatar-xs'>
<text>邀请外部人员</text>
<text class='left'>〉</text>
</navigator>
<!-- <view class='item-avatar-xs'>
<text>是否安排座位</text>
<switch class='left2' name="isSite" onChange="switch"></switch>
</view> -->
<view class="graySpace"></view>
<!-- <view class='item-avatar-xs'>
<text>通知</text>
<view class='add_btn'>
<button class="{{num == 1?'se_btning':'se_btn'}}" data-num = "1" onTap="clickNum">微信</button>
<button class="{{num == 2?'se_btning':'se_btn'}}" data-num = "2" onTap="clickNum">短信</button>
<button class="{{num == 3?'se_btning':'se_btn'}}" data-num = "3" onTap="clickNum">邮箱</button>
</view>
</view> -->
<view class='section'>
<view onTap="onChangeShowState">
<text><text class="required">*</text>方式</text>
<image src="{{showView?'../../../resource/images/bottom2.png':'../../../resource/images/left1.png'}}"></image>
</view>
<view class="se_btn_hide{{ showView==true?'se_btn_hide':''}}">
<checkbox-group name="remindMethod" class="check">
<label onTap='clicks' a:for="{{noticeList}}" a:for-item="notice" class='{{notice.checked?"is_checked":""}}'>
<checkbox value="{{notice.name}}" data-val="{{notice.name}}" name="{{notice.name}}" hidden='false' checked='{{notice.checked}}' /> {{notice.value}}
</label>
</checkbox-group>
</view>
</view>
<checkbox-group value="{{index}}" range="{{msgArray}}" bindchange="checkboxChange">
<view class='item-avatar-xs' onTap='modaltime'>
<text><text class="required">*</text>提醒</text>
<text class='selectpocker' style="font-size:24rpx">{{text}}</text>
<text class='left'>〉</text>
</view>
</checkbox-group>
<view class="add"><button formType="submit" type="primary">预定</button></view>
<view class="mask2" onTap='mask2' catchtouchmove="preventTouchMove" hidden="{{!showModal2}}"></view>
<view class="modaltime2" hidden="{{!showModal2}}" >
<checkbox-group name="remindTime" class="checkbox-group" onChange="checkboxChange">
<label class='checkbox'>
<checkbox name="minTen" value='minTen' ></checkbox>
<text>提前十分钟</text>
</label>
<label class='checkbox'>
<checkbox name="halfHour" value='halfHour'></checkbox>
<text>提前半小时</text>
</label>
<label class='checkbox'>
<checkbox name="oneHour" value='oneHour'></checkbox>
<text>提前一小时</text>
</label>
</checkbox-group>
</view>
</form>
</view>
\ No newline at end of file
let app=getApp();
let domain = app.globalData.domain;
//获取用户信息的url
let addmeetingeUrl = domain + "/dingding/addmeeting";
let conferenceUrl = domain + "/dingding/conference";
let messageListUrl = domain + "/dingding/messageList";
let generateMidUrl = domain + "/dingding/generateMid";
let conferenceListUrl = domain + "/dingding/conferenceList";
let getUsernameUrl= domain+"/dingding/getUsername";
Page({
data: {
showModal: false,
showView: true,
conferenceList: [],
mid:null,
//msgArray: ['无提醒', '提前十分钟', '提前半小时', '提前一小时'],
noticeList: [{ name: 'dingding', value: '钉钉' }, { name: 'wechat', value: '微信' }, { name: 'mailbox', value: '邮箱' }, { name: 'note', value: '短信' }],
showView: false,
dates: dateFtt("yyyy-MM-dd", new Date()),
lists: [{}],
text: '',
cnum:'',
allTime: {
hours: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23],
minutes: [0, 15, 30, 45]
},
timeList:[],
msgTime:[],
time:{
startIndex:null,
endIndex:null,
startTime:null,
endTIme:null,
min:0,
},
username:""
},
//方式选项点击
clicks: function(e) {
let index = e.currentTarget.dataset.index;
let arrs = this.data.checks;
if (arrs[index].checked == false) {
arrs[index].checked = true;
} else {
arrs[index].checked = false;
}
this.setData({
checks: arrs
})
},
//是否安排座位
switch: function() {
//console.log("点击");
var mid=this.data.mid;
console.log("会议室", this.data.cnum)
// if (this.data.cnum==""){
// dd.alert({
// title: "参数错误",
// content: "会议室没有选择",
// buttonText: '确定'
// })
// return false;
// }
var _this=this;
dd.httpRequest({
url: conferenceUrl,
method: 'POST',
data: {
cnum: _this.data.cnum
},
dataType: 'json',
success: function(res) {
console.log('success----', res)
dd.navigateTo({
url: '../seat/seat?mid=' + mid + "&seatNumber=" + res.data.result.maxPerson
})
},
fail: function(res) {
console.log("httpRequestFail---", res)
dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
},
//显示隐藏(方式选项)
onChangeShowState: function() {
var that = this;
that.setData({
showView: (!that.data.showView),
se_btn_hide: false
})
},
formSubmit: function(e) {
console.log('form发生了submit事件,携带数据为:', e.detail.value);
var conferenceList=this.data.conferenceList;
var startTime = this.data.dates+" "+this.data.time.startTime ;
var endTime = this.data.dates + " "+ this.data.time.endTime ;
var _this=this;
// if (typeof (e.detail.value.conferenceName) == "undefined") {
// dd.alert({
// title: "参数错误",
// content: "会议室没有选择",
// buttonText: '确定'
// })
// return false;
// }
if (e.detail.value.remindMethod.length==0){
dd.alert({
title:"参数错误",
content:"提醒方式没有选择",
buttonText: '确定'
})
return false;
}
if (e.detail.value.remindTime.length == 0) {
dd.alert({
title: "参数错误",
content: "提醒时间没有选择",
buttonText: '确定'
})
return false;
}
if (e.detail.value.messageName == "") {
dd.alert({
title: "参数错误",
content: "会议名称没有填写",
buttonText: '确定'
})
return false;
}
if (e.detail.value.messageCompere == "") {
dd.alert({
title: "参数错误",
content: "会议主持人没有填写",
buttonText: '确定'
})
return false;
}
if (this.data.time.startTime == "" && this.data.time.endTime=="") {
dd.alert({
title: "参数错误",
content: "会议时间没有选择",
buttonText: '确定'
})
return false;
}
dd.httpRequest({
url: addmeetingeUrl,
method: 'POST',
data: {
mid: _this.data.mid,
cnum: _this.data.cnum,
startTime: startTime,
endTime: endTime,
userId: app.globalData.userId,
messageName: e.detail.value.messageName,
messageCompere: e.detail.value.messageCompere,
messageContent: e.detail.value.messageContent,
remindMethod : e.detail.value.remindMethod,
remindTime: e.detail.value.remindTime,
},
dataType: 'json',
success: function(res) {
// console.log('success----', res)
if (res.data.success){
//console.log("预定成功");
dd.vibrate({
success: () => {
dd.alert({
title: '预定成功',
content: '预定成功',
buttonText: '确定',
success: () => {
dd.reLaunch({
url: '../index/index'
});
},
});
}
});
}else {
dd.showToast({
type: 'fail',
content: res.data.message,
duration: 3000,
success: () => {
// dd.navigateTo({
// url: '../index/index'
// });
},
});
}
},
fail: function(res) {
console.log("httpRequestFail---", res)
dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
},
datePicker() {
var timeList = this.data.timeList;
var hours = this.data.allTime.hours;
var minutes = this.data.allTime.minutes;
var _this = this;
dd.datePicker({
success: (res) => {
_this.setData({
dates: res.date
});
//查询当天会议时间段
var dates = res.date;
//清空原來的
timeList = [];
_this.setData({
timeList
});
var msgTime = this.data.msgTime;
var nowHour = new Date().getHours();
var nowMinute = new Date().getMinutes();
msgTime = [];
_this.setData({
msgTime
});
dd.httpRequest({
url: messageListUrl,
method: 'POST',
data: {
date: _this.data.dates,
cnum: _this.data.cnum
},
dataType: 'json',
success: function(res) {
console.log('success----message', res)
var msg = res.data.result;
for (var i = 0; i < msg.length; i++) {
var json = {};
json["startTime"] = msg[i].startTimeFormat;
json["endTime"] = msg[i].endTimeFormat;
msgTime.push(json);
}
_this.setData({
msgTime
});
console.log(msgTime)
if (timeList.length == 0) {
for (var i = 0; i < hours.length; i++) {
var arr = new Array;
for (var j = 0; j < minutes.length; j++) {
//console.log(hours[i]);
// console.log(minutes[j]);
//dateCompare(startDate, endDate)
//Date.parse(new Date(e.detail.value)) < Date.parse(new Date())
var json = {};
json["hour"] = hours[i];
json["minute"] = minutes[j];
if (dateCompare(dateFtt("yyyy-MM-dd", new Date()), dates) == 0) {
json["color"] = "#ABABAB";
json["unclick"] = true;
} else if (dateCompare(dateFtt("yyyy-MM-dd", new Date()), dates) == 1) {
if (nowHour > hours[i]) {
json["color"] = "#ABABAB";
json["unclick"] = true;
} else {
json["color"] = "";
json["unclick"] = false;
}
if (nowHour == hours[i]) {
if (nowMinute > minutes[j]) {
json["color"] = "#ABABAB";
json["unclick"] = true;
} else {
json["color"] = "";
json["unclick"] = false;
}
}
}
else if (dateCompare(dateFtt("yyyy-MM-dd", new Date()), dates) == 2) {
json["color"] = "";
json["unclick"] = false;
}
// console.log(msgTime);
if (msgTime.length > 0) {
for (var k = 0; k < msgTime.length; k++) {
var msgstart = Number(msgTime[k].startTime.split(":")[0]);
var msgend = Number(msgTime[k].endTime.split(":")[0]);
var msgstartmin = Number(msgTime[k].startTime.split(":")[1]) - 15;
var msgendmin = Number(msgTime[k].endTime.split(":")[1]);
console.log("会议开始时间", msgstart + ":" + msgstartmin);
// console.log(msgTime[k].startTime.split(":")[0]);
if (time_range(msgstart + ":" + msgstartmin, msgTime[k].endTime, hours[i] + ":" + minutes[j])) {
json["color"] = "#EEAD0E";
json["unclick"] = true;
} else {
json["unclick"] = false;
}
}
}
// console.log("json",json);
//console.log(this.data.time.allTime.hours[i] + this.data.time.allTime.minutes[j])
arr.push(json);
}
timeList.push(arr);
}
}
//console.log(status);
_this.setData({
timeList
})
dd.hideLoading();
},
fail: function(res) {
console.log("httpRequestFail---", res)
dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
}
})
},
//点击小方块
selTime:function(e){
var startTime=this.data.time.startTime;
var endTime = this.data.time.endTime;
var startIndex = this.data.time.startIndex;
var endIndex = this.data.time.endIndex;
var timeList = this.data.timeList;
var unclick= e.currentTarget.dataset.unclick;
// console.log(startIndex);
if (!unclick){
if(startTime==null){
if (e.currentTarget.dataset.hour<10){
var hour = "0" + e.currentTarget.dataset.hour
if (e.currentTarget.dataset.minute==0){
startTime = hour + ":00" ;
}else {
startTime = hour+ ":" + e.currentTarget.dataset.minute;
}
}else {
if (e.currentTarget.dataset.minute == 0) {
startTime = e.currentTarget.dataset.hour + ":00";
} else {
startTime = e.currentTarget.dataset.hour + ":" + e.currentTarget.dataset.minute;
}
}
console.log("会议开始时间"+startTime);
timeList[e.currentTarget.dataset.hourIndex][e.currentTarget.dataset.minIndex].color ="#4876FF";
this.setData({
"time.startTime": startTime,
"time.startIndex": [e.currentTarget.dataset.hourIndex, e.currentTarget.dataset.minIndex]
,timeList});
}
if (startTime != null && endTime == null && startIndex!=null){
if (startIndex[0] == e.currentTarget.dataset.hourIndex){
for (var j = startIndex[1]; j <= e.currentTarget.dataset.minIndex; j++) {
timeList[e.currentTarget.dataset.hourIndex][j].color = "#4876FF";
}
}
if (startIndex[0] < e.currentTarget.dataset.hourIndex) {
for (var i = startIndex[0]; i <= e.currentTarget.dataset.hourIndex; i++) {
if (i == startIndex[0]){
for (var j = startIndex[1]; j <=3; j++){
timeList[i][j].color = "#4876FF";
}
}
if (i > startIndex[0] && i < e.currentTarget.dataset.hourIndex) {
for (var j =0; j <= 3; j++) {
timeList[i][j].color = "#4876FF";
}
}
if (i== e.currentTarget.dataset.hourIndex) {
for (var j = 0; j <= e.currentTarget.dataset.minIndex; j++) {
timeList[i][j].color = "#4876FF";
}
}
}
}
if (e.currentTarget.dataset.hour < 10) {
var hour = "0" + e.currentTarget.dataset.hour
endTime = hour+ ":" + (e.currentTarget.dataset.minute + 15);
} else {
endTime = e.currentTarget.dataset.hour + ":" + (e.currentTarget.dataset.minute + 15);
}
console.log("会议结束时间" + endTime);
var sh =Number(this.data.time.startTime.split(":")[0]);
var sm = Number (this.data.time.startTime.split(":")[1]);
var eh = Number(e.currentTarget.dataset.hour);
var em = Number(e.currentTarget.dataset.minute + 15);
var minutes=(eh*60+em) -(sh*60+sm);
this.setData({
"time.endTime": endTime,
"time.endIndex": [e.currentTarget.dataset.hourIndex, e.currentTarget.dataset.minIndex],
"time.min": minutes,
timeList
});
}
if (startTime != null && endTime != null && startIndex != null && endIndex != null) {
endTime =null;
startTime = null;
if (startIndex[0] ==endIndex[0]) {
for (var j = startIndex[1]; j <= endIndex[1]; j++) {
timeList[startIndex[0]][j].color = "";
}
}
if (startIndex[0] < endIndex[0]) {
for (var i = startIndex[0]; i <= endIndex[0]; i++) {
if (i == startIndex[0]) {
for (var j = startIndex[1]; j <= 3; j++) {
timeList[i][j].color = "";
}
}
if (i > startIndex[0] && i < endIndex[0]) {
for (var j = 0; j <= 3; j++) {
timeList[i][j].color = "";
}
}
if (i == endIndex[0]) {
for (var j = 0; j <= endIndex[1]; j++) {
timeList[i][j].color = "";
}
}
}
}
startIndex=null;
endIndex = null;
this.setData({
"time.endTime": endTime,
"time.startTime": startTime,
"time.startIndex": startIndex,
"time.endIndex": endIndex,
"time.min": 0,
timeList
});
}
}else {
return false;
}
console.log(e.currentTarget.dataset.hour);
console.log(e.currentTarget.dataset.minute);
// console.log(e.currentTarget.dataset.hourIndex);
// console.log(e.currentTarget.dataset.minIndex);
},
getSite:function(){
dd.chooseDepartments({
title: "选择与会人", //标题
multiple: true, //是否多选
limitTips: "超出了", //超过限定人数返回提示
maxDepartments: 100, //最大选择部门数量
pickedDepartments: [], //已选部门
disabledDepartments: [], //不可选部门
requiredDepartments: [], //必选部门(不可取消选中状态)
appId: 158, //微应用的Id
permissionType: "xxx", //选人权限,目前只有GLOBAL这个参数
success: function(res) {
/**
{
userCount:1, //选择人数
departmentsCount:1,//选择的部门数量
departments:[{"id":,"name":"","number":}]//返回已选部门列表,列表中每个对象包含id(部门id)、name(部门名称)、number(部门人数)
}
*/
},
fail: function(err) {
}
});
},
//消息选择
bindPickerChange: function(e) {
// var conferenceList= this.data.conferenceList;
//console.log('picker发送选择改变,携带值为', conferenceList[e.detail.value].conferenceNumber);
this.setData({
index: e.detail.value,
// cnum: conferenceList[e.detail.value].conferenceNumber
});
},
//多项选择框
checkboxChange: function(e) {
var temp1 = e.detail.value
var temp2 = ''
console.log(temp1)
if (temp1.length != 0) {
for (var i = 0, len = temp1.length; i < len; i++) {
if (temp1[i]=="minTen"){
temp2 = temp2 + "提前十分钟" + ','
}
if (temp1[i] == "halfHour") {
temp2 = temp2 + "提前半小时" + ','
}
if (temp1[i] == "oneHour") {
temp2 = temp2 + "提前一小时" + ','
}
}
this.setData({
text: temp2
})
} else {
this.setData({
text: ''
})
}
},
bindDateChange: function(e) {
this.setData({
dates: e.detail.value
});
},
//添加议题
addList: function() {
var lists = this.data.lists;
var newData = {};
lists.push(newData);//实质是添加lists数组内容,使for循环多一次
this.setData({
lists: lists,
})
},
//删除议题
delList: function() {
var lists = this.data.lists;
lists.pop(); //实质是删除lists数组内容,使for循环少一次
this.setData({
lists: lists,
})
},
//时间
modaltime: function() {
this.setData({
showModal2: true
})
},
preventTouchMove: function() {
},
mask: function() {
this.setData({
showModal: false
})
},
mask2: function(e) {
this.setData({
showModal2: false,
})
//this.items.value = e.detail.value
},
onLoad: function(query) {
//showView: (options.showView == "true" ? true : false);
//生成会议id
var _this = this;
// console.log("会议id",_this.data.mid);
if (_this.data.mid==null){
dd.httpRequest({
url: generateMidUrl,
method: 'POST',
dataType: 'json',
success: function(res) {
var mid = res.data.result;
console.log('mid----', res)
_this.setData({
mid: mid
})
},
fail: function(res) {
console.log("httpRequestFail---", res)
dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
}
//查询当天会议时间段
var timeList = this.data.timeList;
var hours = this.data.allTime.hours;
var minutes = this.data.allTime.minutes;
//清空原來的
timeList = [];
this.setData({
timeList,
cnum:query.cnum
});
var msgTime = this.data.msgTime;
var nowHour = new Date().getHours();
var nowMinute = new Date().getMinutes();
msgTime = [];
this.setData({
msgTime
});
dd.httpRequest({
url: messageListUrl,
method: 'POST',
data: {
date: _this.data.dates,
cnum: query.cnum
},
dataType: 'json',
success: function(res) {
console.log('success----message', res)
var msg = res.data.result;
for (var i = 0; i < msg.length; i++) {
var json = {};
json["startTime"] = msg[i].startTimeFormat;
json["endTime"] = msg[i].endTimeFormat;
msgTime.push(json);
}
_this.setData({
msgTime
});
if (timeList.length == 0) {
for (var i = 0; i < hours.length; i++) {
var arr = new Array;
for (var j = 0; j < minutes.length; j++) {
//console.log(hours[i]);
// console.log(minutes[j]);
var json = {};
json["hour"] = hours[i];
json["minute"] = minutes[j];
if (nowHour > hours[i]) {
json["color"] = "#ABABAB";
json["unclick"] = true;
} else {
json["color"] = "";
json["unclick"] = false;
}
if (nowHour == hours[i]) {
if (nowMinute > minutes[j]) {
json["color"] = "#ABABAB";
json["unclick"] = true;
} else {
json["color"] = "";
json["unclick"] = false;
}
}
// console.log(msgTime);
if (msgTime.length > 0) {
for (var k = 0; k < msgTime.length; k++) {
var msgstart = Number(msgTime[k].startTime.split(":")[0]);
var msgend = Number(msgTime[k].endTime.split(":")[0]);
var msgstartmin = Number(msgTime[k].startTime.split(":")[1]) - 15;
var msgendmin = Number(msgTime[k].endTime.split(":")[1]);
console.log("会议开始时间", msgstart + ":" + msgstartmin);
// console.log(msgTime[k].startTime.split(":")[0]);
if (time_range(msgstart + ":" + msgstartmin, msgTime[k].endTime, hours[i] + ":" + minutes[j])) {
json["color"] = "#EEAD0E";
json["unclick"] = true;
}
}
}
// console.log("json",json);
//console.log(this.data.time.allTime.hours[i] + this.data.time.allTime.minutes[j])
arr.push(json);
}
timeList.push(arr);
}
}
//console.log(status);
_this.setData({
timeList
})
console.log("timeList", timeList)
dd.hideLoading();
},
fail: function(res) {
console.log("httpRequestFail---", res)
dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
// console.log(hours);
// console.log(minutes);
//查询所有会议室
dd.httpRequest({
url: conferenceListUrl,
method: 'POST',
data: {
userId: app.globalData.userId,
corpId: app.globalData.corpId
},
dataType: 'json',
success: function(res) {
var conferenceList= _this.data.conferenceList;
conferenceList=res.data.result;
console.log('success----', res)
_this.setData({
conferenceList
})
},
fail: function(res) {
console.log("httpRequestFail---", res)
dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
//查询主持人名称
dd.httpRequest({
url: getUsernameUrl,
method: 'POST',
data: {
userId: app.globalData.userId
},
dataType: 'json',
success: function(res) {
var username = res.data.result;
console.log('success----', res)
_this.setData({
"username":username
})
},
fail: function(res) {
console.log("httpRequestFail---", res)
dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
},
addlist: function() {
var that = this;
that.setData({
showView: (!that.data.showView)
})
},
//点击添加删除class
clickNum: function(e) {
this.setData({
num: e.target.dataset.num
})
},
onReady() {
// 页面加载完成
// console.log(this.data.timeList);
},
onShow() {
// 页面显示
},
onHide() {
// 页面隐藏
},
onUnload() {
// 页面被关闭
},
onTitleClick() {
// 标题被点击
},
onPullDownRefresh() {
// 页面被下拉
},
onReachBottom() {
// 页面被拉到底部
},
onShareAppMessage() {
// 返回自定义分享信息
return {
title: 'My App',
desc: 'My App description',
path: 'pages/index/index',
};
},
});
function dateFtt(fmt, date) { //author: meizz
var o = {
"M+": date.getMonth() + 1, //月份
"d+": date.getDate(), //日
"h+": date.getHours(), //小时
"m+": date.getMinutes(), //分
"s+": date.getSeconds(), //秒
"q+": Math.floor((date.getMonth() + 3) / 3), //季度
"S": date.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt))
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
for (var k in o)
if (new RegExp("(" + k + ")").test(fmt))
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
return fmt;
}
function dateCompare(nowDate, selectDate) {
var aStart = nowDate.split('-'); //转成成数组,分别为年,月,日,下同
var aEnd = selectDate.split('-');
var startDateTemp = aStart[0] + "/" + aStart[1] + "/" + aStart[2];
var endDateTemp = aEnd[0] + "/" + aEnd[1] + "/" + aEnd[2];
if (startDateTemp > endDateTemp)
return 0;
else if (startDateTemp == endDateTemp)
return 1;
else if (startDateTemp < endDateTemp)
return 2;
}
var time_range = function(beginTime, endTime, nowTime) {
var strb = beginTime.split(":");
if (strb.length != 2) {
return false;
}
var stre = endTime.split(":");
if (stre.length != 2) {
return false;
}
var strn = nowTime.split(":");
if (stre.length != 2) {
return false;
}
var b = new Date();
var e = new Date();
var n = new Date();
b.setHours(strb[0]);
b.setMinutes(strb[1]);
e.setHours(stre[0]);
e.setMinutes(stre[1]);
n.setHours(strn[0]);
n.setMinutes(strn[1]);
if (n.getTime() - b.getTime() > 0 && n.getTime() - e.getTime() < 0) {
return true;
} else {
//console.log("当前时间是:" + n.getHours() + ":" + n.getMinutes() + ",不在该时间范围内!");
return false;
}
}
{"defaultTitle": "预定会议"}
\ No newline at end of file
page{
background: #F1F1F1;
}
.list_banner{
width: 100%;
height: 270rpx;
}
.de_bg{
background: #fff;
margin-top: 10rpx;
padding: 16rpx;
}
.de_title{
color: #156EF3;
font-size: 40rpx;
text-align: center;
}
.de_bg label{
width: 100%;
height: auto;
font-size: 25rpx;
}
.de_title2{
font-size: 40rpx;
color: #156EF3;
text-align: center;
}
.de_border{
width: 100rpx;
height: 1rpx;
margin-left: 43%;
background: #156EF3;
margin-top: 20rpx;
}
.de_time{
margin-top: 10rpx;
padding: 16rpx;
font-size: 30rpx;
color: #156EF3;
}
.tr{
width: 100%;
font-size: 26rpx;
padding: 10rpx;
display: flex;
justify-content: space-between;
}
.td{
width: 100%;
text-align: left;
}
.de_btn{
width: 100%;
position: fixed;
background: #fff;
bottom: 0rpx;
}
.de_btn2{
width: 96%;
background: #156EF3;
color: #fff;
margin: 20rpx auto;
}
.de_box{
height:auto;
overflow:hidden;
overflow-y:scroll;
padding-bottom: 140rpx;
}
\ No newline at end of file
<view class="page">
<image class='list_banner' src="{{imageUrl}}{{conference.photoUrl}}" onError="setImageUrl"></image>
<view class='de_bg'>
<view class='de_title'>{{conference.conferenceName}}</view>
<label>功能:<text a:for="{{conference.functions}}" a:for-item="fun">
{{fun.functionName}},
</text></label> <label>人数:{{conference.maxPerson}}人 </label> <label>地点:{{conference.area.areaName}} |{{conference.nextArea.areaName}}</label>
</view>
<view class='de_bg'>
<view class='de_title2'>当天会议</view>
<view class='de_border'></view>
</view>
<view class='de_time'>{{date}}</view>
<view class="de_box">
<view class='de_bg' a:for="{{conference.message}}" a:for-item="msg">
<view class="table">
<view class="tr">
<view class="td td1">会议名称:{{msg.messageName}}</view>
<view class="td td2">发起人:{{msg.manageUser.nickname}}</view>
</view>
<view class="tr">
<view class="td td1">会议时间:{{msg.startTimeFormat}}-{{msg.endTimeFormat}}</view>
<!-- <view class="td td2">会议范围:全体人员</view> -->
</view>
</view>
</view>
</view>
</view>
<view class='de_btn' data-cnum="{{conference.conferenceNumber}}" onTap="goto">
<button class='de_btn2' >添加预定</button>
</view>
\ No newline at end of file
let app = getApp();
let domain = app.globalData.domain;
//获取用户信息的url
let conferenceUrl = domain + "/dingding/conference";
Page({
data: {
conference: null,
imageUrl: "http://139.159.202.24:8888" ,
date: dateFtt("yyyy-MM-dd", new Date())
},
goto:function(e){
var cnum= e.currentTarget.dataset.cnum;
dd.navigateTo({
url: '../addmeeting/addmeeting?cnum=' + cnum
})
},
setImageUrl: function(e) {
console.log("图片加载错误detail");
var index = e.currentTarget.dataset.index;
// document.getElementById(id).src = "../../../resource/images/list-room.png";
var conference = this.data.conference;
if (conference.photoUrl)
conference.photoUrl = "/images/conference/dd-defalut.png"
this.setData({
conference
});
},
onLoad: function(query) {
// 生命周期函数--监听页面加载
console.log("load会议室编号",query);
var _this=this;
_this.setData({
conference: null
})
dd.httpRequest({
url: conferenceUrl,
method: 'POST',
data: {
cnum: query.cnum
},
dataType: 'json',
success: function(res) {
console.log('success----', res)
_this.setData({
conference: res.data.result
})
},
fail: function(res) {
console.log("httpRequestFail---", res)
dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
},
onReady(query) {
// 页面加载完成
console.log("ready会议室编号",query)
},
onShow(query) {
// 页面显示
console.log("show会议室编号",query)
},
onHide() {
// 页面隐藏
},
onUnload() {
// 页面被关闭
},
onTitleClick() {
// 标题被点击
},
onPullDownRefresh() {
// 页面被下拉
},
onReachBottom() {
// 页面被拉到底部
},
onShareAppMessage() {
// 返回自定义分享信息
return {
title: 'My App',
desc: 'My App description',
path: 'pages/index/index',
};
},
});
function dateFtt(fmt, date) { //author: meizz
var o = {
"M+": date.getMonth() + 1, //月份
"d+": date.getDate(), //日
"h+": date.getHours(), //小时
"m+": date.getMinutes(), //分
"s+": date.getSeconds(), //秒
"q+": Math.floor((date.getMonth() + 3) / 3), //季度
"S": date.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt))
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
for (var k in o)
if (new RegExp("(" + k + ")").test(fmt))
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
return fmt;
}
\ No newline at end of file
{"defaultTitle": "会议室详情"}
\ No newline at end of file
page{
background: #fff;
color: #555;
}
.vi_bg{
background: #fff;
padding: 30rpx 0;
}
.vi_search{
width: 600rpx;
height: 60rpx;
line-height: 60rpx;
background: #eee;
border-radius: 30rpx;
margin-left: 8%;
}
.vi_search image{
width: 40rpx;
height: 40rpx;
margin: 10rpx 30rpx;
}
.item-avatar-xs text{
font-size: 30rpx;
}
.item-avatar-xs input{
position: relative;
margin-top: -10rpx;
}
.vi_search input{
position: absolute;
width: 420rpx;
height: 60rpx;
line-height: 60rpx;
color: #555;
font-size:35rpx;
background: none;
}
.item-avatar-xs-a{
padding: 30rpx 30rpx;
border-bottom: 1rpx solid #eee;
cursor: pointer;
background: #fff;
position:relative;
}
.left{
position: absolute;
margin-left: 600rpx;
margin-top: -40rpx;
}
.item-avatar-xs2{
display: flex;
padding: 20rpx 100rpx;
border-bottom: 1rpx solid #eee;
cursor: pointer;
position:relative;
}
.item-avatar-xs-a image{
width: 32rpx;
height: 32rpx;
margin-left: 380rpx;
margin-top: 10rpx;
}
.flex_start{
width: 400rpx;
}
.flex_start icon{
position: absolute;
margin-top: -5rpx;
}
.flex_start text{
font-size: 34rpx;
margin-left: 70rpx;
}
checkbox{
-webkit-appearance: none;
border-radius: 50%;
width: 40rpx;
height: 40rpx;
border:1px solid #ccc;
background: #fff;
}
.depaertment{
width: 90%;
height: auto;
margin-top: -10rpx;
float: right;
}
.item-avatar-xs3{
width: 100%;
margin-top: 0.4rem;
}
.item-avatar-xs4{
width: 100%;
height: 60rpx;
line-height: 60rpx;
}
.li {
padding-left: 100rpx;
display: flex;
font-size: 34rpx;
width: 87%;
height: 100rpx;
margin-top: 20rpx;
}
.checkbox-text{
width: 160rpx;
line-height: 50rpx;
margin-left: 20rpx;
}
.vi_btm{
width: 89.5%;
position: fixed;
background: #fff;
padding: 40rpx 40rpx;
bottom: 0rpx;
border: 1rpx solid #eee;
}
.vi_btm text{
line-height: 40rpx;
font-size: 30rpx;
}
.vi_btm button{
background: #156EF3;
color: #fff;
margin-left: 360rpx;
position: absolute;
margin-top: -10rpx;
}
.ex_btn{
margin-top: 40rpx;
margin-bottom: 40rpx;
}
.del{
width: 40rpx;
float: left;
margin-top: 5rpx;
}
\ No newline at end of file
<view class="page">
<!-- <view class='vi_bg'>
<view class='vi_search'>
<image src='../../../resource/images/search2.png' />
<input type='text' placeholder='请输入参会人员名称' />
</view>
</view>
<view class="graySpace"></view> -->
<form onSubmit="formSubmit" onReset="">
<view class='item-avatar-xs'>
<text>用户名:</text>
<input type="text" name="signName" placeholder="请输入用户名" />
</view>
<view class='item-avatar-xs'>
<text>手机号:</text>
<input type="text" name="signMobile" placeholder="请填写手机号码" />
</view>
<view class='item-avatar-xs'>
<text>邮 箱 :</text>
<input type="text" name="signEmail" placeholder="请输入邮箱号" />
</view>
<button class="ex_btn" type="primary" form-type="submit" >添加</button>
<view class="graySpace"></view>
</form>
<scroll-view scroll-y="{{true}}">
<view a:for="{{employeeList}}" a:for-item="employee" a:for-index="index" class='item-avatar-xs-a'>
<!-- <checkbox value="{{employee.name}}" checked="{{employee.checked}}" /> -->
<view data-index="{{index}}" data-id="{{employee.id}}" onTap="deleteSign" class="del">
<icon type="cancel" size="18" color="red"/>
</view>
<text class="checkbox-text">{{employee.name}}</text>
</view>
</scroll-view>
<!-- <view class='vi_btm'>
<text>已添加:{{personNum}}人 </text>
<button size='mini'>确定</button>
</view> -->
let app = getApp();
let domain = app.globalData.domain;
//获取用户信息的url
let addExSignUrl = domain + "/dingding/addExSign";
let delExSignUrl = domain + "/dingding/delExSign"
Page({
data: {
employeeList:[
],
mid:null,
personNum:0
},
formSubmit: function(e){
console.log('form发生了submit事件,携带数据为:', e.detail.value);
var _this = this;
if (e.detail.value.signMobile.length != 0) {
var phoneReg = /(^1[3|4|5|7|8]\d{9}$)|(^09\d{8}$)/;
var phone = e.detail.value.signMobile;
if (!phoneReg.test(phone)) {
dd.alert({
title: "添加失败",
content: "手机格式错误",
buttonText: '确定'
})
return false;
}
} else {
dd.alert({
title: "添加失败",
content: "手机不为空",
buttonText: '确定'
});
return false;
}
if (e.detail.value.signEmail.length!=0 ) {
var reg = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
var email = e.detail.value.signEmail;
if (!reg.test(email)) {
dd.alert({
title: "添加失败",
content: "邮箱格式错误",
buttonText: '确定'
});
return false;
}
} else {
dd.alert({
title: "添加失败",
content: "邮箱不为空",
buttonText: '确定'
});
return false;
}
dd.httpRequest({
url: addExSignUrl,
method: 'POST',
data: {
mid: _this.data.mid,
signMobile: e.detail.value.signMobile,
signEmail: e.detail.value.signEmail,
signName: e.detail.value.signName,
},
dataType: 'json',
success: function(res) {
// console.log('success----', res)
if (res.data.success) {
//console.log("预定成功");
dd.alert({
title: '添加成功',
content: '添加成功',
buttonText: '确定',
success: () => {
var employeeList= _this.data.employeeList;
var emp={};
emp['name'] = res.data.result.signName;
emp['id'] = res.data.result.signId;
emp['checked'] = true;
employeeList.push(emp);
_this.setData({
personNum: _this.data.personNum + 1,
employeeList
});
},
});
} else {
dd.showToast({
type: 'fail',
content: res.data.message,
duration: 3000,
success: () => {
// dd.navigateTo({
// url: '../index/index'
// });
},
});
}
},
fail: function(res) {
console.log("httpRequestFail---", res)
dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
},
deleteSign:function (e){
//console.log(e);
var _this=this;
dd.httpRequest({
url: delExSignUrl,
method: 'POST',
data: {
signId: e.currentTarget.dataset.id,
},
dataType: 'json',
success: function(res) {
// console.log('success----', res)
if (res.data.success) {
//console.log("预定成功");
const index = e.currentTarget.dataset.index;
var employeeList = _this.data.employeeList;
employeeList = remove(employeeList, index);
_this.setData({
employeeList
})
} else {
dd.showToast({
type: 'fail',
content: res.data.message,
duration: 3000,
success: () => {
// dd.navigateTo({
// url: '../index/index'
// });
},
});
}
},
fail: function(res) {
console.log("httpRequestFail---", res)
dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
},
onLoad: function(query) {
// 生命周期函数--监听页面加载
this.setData({
mid: query.mid
})
},
onReady() {
// 页面加载完成
},
onShow() {
// 页面显示
},
onHide() {
// 页面隐藏
},
onUnload() {
// 页面被关闭
},
onTitleClick() {
// 标题被点击
},
onPullDownRefresh() {
// 页面被下拉
},
onReachBottom() {
// 页面被拉到底部
},
onShareAppMessage() {
// 返回自定义分享信息
return {
title: 'My App',
desc: 'My App description',
path: 'pages/index/index',
};
},
});
function remove(array, index) {
if (index <= (array.length - 1)) {
for (var i = index; i < array.length; i++) {
array[i] = array[i + 1];
}
}
else {
throw new Error('超出最大索引!');
}
array.length = array.length - 1;
return array;
}
{"defaultTitle": "添加外部参与人员"}
\ No newline at end of file
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
}
.banner-bg{
width: 750rpx;
height: 300rpx;
}
.search{
width: 600rpx;
height: 60rpx;
line-height: 60rpx;
background: rgba(0, 0, 0, .4);
border-radius: 30rpx;
position: relative;
margin: -30% 0%;
}
.banner image{
width: 40rpx;
height: 40rpx;
margin: 10rpx 30rpx;
}
.function_text{
display: block;
/* width: 380rpx; */
width: 100%;
text-align: left;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
.search input{
background: none;
font-size: 0.3rem;
position: absolute;
margin-top: 5rpx;
}
.list_box{
margin-top: 30rpx;
}
.list_title {
font-size: 40rpx;
color: #156EF3;
}
.border_a{
width: 120rpx;
height: 1rpx;
background: #156EF3;
margin-top: 20rpx;
margin-left: 20%;
}
.border_b{
width: 200rpx;
height: 1rpx;
background: #156EF3;
margin-top: 30rpx;
}
.list_content{
width:728rpx;
height: auto;
text-align: center;
margin-top: 20rpx;
}
.list_b{
width:350rpx;
height: 320rpx;
float: left;
margin-top: 10rpx;
padding-left: 10rpx;
}
.list_b image{
width: 350rpx;
height: 220rpx;
}
.list_b .list_title2{
width: 350rpx;
height:auto;
line-height: 45rpx;
background: rgba(0, 0, 0, .4);
border-radius: 10rpx;
position: absolute;
margin-top: -91rpx;
}
.list_title2 text{
width: 97%;
color: #fff;
font-size: 25rpx;
text-align: left;
padding-left: 10rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.list_b text{
float: left;
}
.list_btn1{
clear: both;
width: 140rpx;
height: 40rpx;
background: #156EF3;
line-height: 40rpx;
font-size: 25rpx;
color: #fff;
border-radius: 5rpx;
float: left;
margin-left: orpx;
margin-top: 10rpx;
}
.list_btn2{
width: 140rpx;
height: 40rpx;
line-height: 40rpx;
font-size: 25rpx;
color: #ccc;
border-radius: 5rpx;
float: left;
margin-top: 10rpx;
margin-left: 10rpx;
}
<!--index.wxml-->
<view class="container">
<image class='banner-bg' src='../../../resource/images/banner.png'></image>
<view class="banner">
<navigator class='search' url="../search/search?title=search" open-type="navigate" hover-class="navigator-hover">
<image src='../../../resource/images/search.png'></image>
<input type='text' placeholder='请输入会议室名称' disabled="disabled"></input>
</navigator>
</view>
<view class='list_box'>
<text class='list_title'>会议室列表 </text>
<view class='border_a'></view>
<view class='border_b'></view>
</view>
<view class='list_content'>
<view a:for="{{conferenceList}}" a:for-index="index" a:for-item="conference">
<navigator class='list_b' url="../details/details?cnum={{conference.conferenceNumber}}" open-type="navigate">
<image src="{{imageUrl}}{{conference.photoUrl}}" onError="setImageUrl" data-index="{{index}}" id="images-{{index}}"></image>
<view class='list_title2'>
<text>{{conference.area.areaName}} </text>
<text>{{conference.conferenceName}}</text>
</view>
<text class="function_text"> 功能: <block a:for="{{conference.functions}}" a:for-item="fun">{{fun.functionName}},</block>
</text>
<button class='list_btn1'><view a:if="{{conference.enable == 1}}">可用</view><view a:elif="{{conference.enable == 0}}">不可用</view></button>
<button class='list_btn2'>{{conference.maxPerson}}人</button>
</view>
</navigator>
</view>
</view>
</view>
let app = getApp();
//替换成开发者后台设置的安全域名
let domain = app.globalData.domain;
//获取用户信息的url
let url = domain + "/dingding/login";
let conferenceUrl = domain + "/dingding/conferenceList"
let myinfoUrl = domain +"/dingding/myinfo"
Page({
data: {
corpId: '',
authCode: '',
userId: '',
conferenceList: [],
imageUrl: "http://139.159.202.24:8888"
},
//请求授权登录
setImageUrl: function(e) {
console.log("图片加载错误");
var index = e.currentTarget.dataset.index;
// document.getElementById(id).src = "../../../resource/images/list-room.png";
var conferenceList = this.data.conferenceList;
conferenceList[index].photoUrl = "/images/conference/dd-defalut.png"
this.setData({
conferenceList
});
},
goDetail:function(e){
var cnum=e.currentTarget.dataset.cnum;
dd.navigateTo({
url:'../details/details?cnum='+cnum
});
},
onLoad(query) {
// 页面加载
console.info(`Page onLoad with query: ${JSON.stringify(query)}`);
console.log("页面参数",query);
//请求授权登录
let _this = this;
this.setData({
corpId: app.globalData.corpId
})
dd.getAuthCode({
success: (res) => {
_this.setData({
authCode: res.authCode
})
dd.httpRequest({
url: url,
method: 'POST',
data: {
authCode: res.authCode,
corpId: app.globalData.corpId,
},
dataType: 'json',
success: function(res) {
// console.log('success----', res);
let userId = res.data.result.userId;
_this.setData({
userId: userId
});
app.globalData.userId = userId;
console.log('userId----', app.globalData.userId);
//查询用户是否绑定
dd.httpRequest({
url: myinfoUrl,
method: 'POST',
data: {
userId: userId
},
dataType: 'json',
success: function(res) {
console.log('success----', res)
if (res.data.result==null){
dd.reLaunch({
url: '../../login/login'
});
}else {
dd.httpRequest({
url: conferenceUrl,
method: 'POST',
data: {
userId: app.globalData.userId,
corpId: app.globalData.corpId,
person: query.person
},
dataType: 'json',
success: function(res) {
console.log('success----', res)
_this.setData({
conferenceList: res.data.result
})
},
fail: function(res) {
console.log("httpRequestFail---", res)
dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
}
// _this.setData({
// conferenceList: res.data.result
// })
},
fail: function(res) {
console.log("httpRequestFail---", res)
dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
},
fail: function(res) {
console.log("httpRequestFail---", res)
// dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
},
fail: (err) => {
dd.alert({
content: JSON.stringify(err)
})
}
});
},
onReady() {
// 页面加载完成
},
onShow() {
// 页面显示
},
onHide() {
// 页面隐藏
},
onUnload() {
// 页面被关闭
},
onTitleClick() {
// 标题被点击
},
onPullDownRefresh() {
// 页面被下拉
},
onReachBottom() {
// 页面被拉到底部
},
onShareAppMessage() {
// 返回自定义分享信息
return {
title: 'My App',
desc: 'My App description',
path: 'pages/index/index',
};
},
});
{}
\ No newline at end of file
/* @import "./search.acss"; */
.item-avatar-xs text,input,radio{
font-size: 32rpx;
line-height: 80rpx;
}
.item-avatar-xs{
display: flex;
padding: 20rpx;
border-bottom: 1rpx solid #eee;
cursor: pointer;
position:relative;
}
.item-avatar-xs input{
width: 60%;
margin-top: 15rpx;
}
.left{
position: absolute;
margin-left: 660rpx;
}
.item-avatar-xs image{
width: 48rpx;
height: 48rpx;
margin-top: 15rpx;
}
.add{
width: 100%;
}
.add input{
width: 80%;
float: left;
}
.add image{
float: right;
margin-right: 50rpx;
}
.item-avatar-xs textarea{
width: 70%;
height: 80rpx;
margin-top: 18rpx;
font-size: 32rpx;
}
.add_bg{
background: #fff;
/* margin-top: 10rpx; */
padding: 50rpx;
}
.add_bg text{
display: block;
height: 40rpx;
line-height: 40rpx;
font-size: 26rpx;
margin-top: -20rpx;
float: left;
}
.add_time{
position: relative;
font-size: 26rpx;
top: -30rpx;
margin-top: -40rpx;
margin-left: 480rpx;
}
.add_time text{
font-size: 32rpx;
color: #156EF3;
padding: 0 10rpx;
}
.times{
width: 99.5%;
height: 500rpx;
margin-top: 10rpx;
border: 1px solid #ccc;
white-space: nowrap;
display:flex;
}
.min_box{
float: left;
margin-top: 32rpx;
width: 100rpx;
height: 470rpx;
}
.min{
width: 100rpx;
height:120rpx;
line-height: 120rpx;
}
.hour{
display: block;
width: 120rpx;
text-align: center;
}
.scroll-view-item_H{
flex-shrink:0;
flex-grow:0;
}
.time-block{
width:120rpx;
height: 120rpx;
border: 1px solid #ccc;
}
.left2{
position: absolute;
margin-left: 580rpx;
margin-top: 8rpx;
}
.add_btn{
margin-left: 80rpx;
margin-top: 10rpx;
}
.se_btning{
background: #156EF3;
color: #fff;
border-radius: 0;
}
.item-avatar-xs button{
width: 180rpx;
height: 60rpx;
line-height: 60rpx;
font-size: 26rpx;
border-radius: 0;
float: right;
}
.item-avatar-xs button::after{
border-radius: 0;
}
.item-avatar-show{
display: block;
}
.item-avatar-hide{
display: none;
}
.mask2{
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background: #000;
z-index: 9000;
opacity: 0.5;
}
.modaltime2{
width: 80%;
height: 520rpx;
position: fixed;
top: 50%;
left: 0;
z-index: 9999;
margin: -340rpx 75rpx;
background-color: #fff;
border-radius: 5rpx;
display: flex;
flex-direction: column;
align-items: center;
padding-top: 10rpx;
padding-bottom: 20rpx;
}
.radio-group{
width: 100%;
height: 100rpx;
margin-top: 20rpx;
border-bottom: 1px solid #eee;
}
.radio{
line-height: 80rpx;
margin-left: 100rpx;
}
.checkbox-group{
width: 100%;
height: 90rpx;
}
.no-checkbox{
display: block;
width: 100%;
height: 90rpx;
line-height: 90rpx;
margin-left: 100rpx;
margin-top: 10rpx;
margin-bottom: 20rpx;
}
.checkbox{
display: block;
width: 100%;
height: 90rpx;
line-height: 90rpx;
margin-left: 100rpx;
margin-top: 30rpx;
}
.selectpocker{
width: 70%;
height: 35px;
line-height: 35px;
text-align: right;
margin-left: 60rpx;
/* overflow-x: scroll; */
}
.checkbox checkbox{
margin-top: 20rpx;
}
.checkbox text{
margin-left: 20rpx;
}
.add{
margin: 20rpx auto;
}
.add_img{
width: 32rpx;
height: 32rpx;
margin-left: 540rpx;
/* margin-top: -6rpx; */
}
.se_btn_hide{
display: none;
height: 80rpx;
position: relative;
margin-top: 0.1rpx;
}
.se_btn_show{
display: block;
}
.check {
display:flex;
flex-wrap:wrap;
justify-content:flex-start;
}
.check label {
width: 140rpx;
height: 60rpx;
font-size: 22rpx;
border-radius: 8rpx;
display: flex;
align-items: center;
margin: 0 8rpx;
justify-content: center;
margin-top: 20rpx;
}
.is_checked {
background-color: #156EF3;
color: #fff;
border: 1rpx solid #fff;
}
.section{
background: #fff;
padding:20rpx;
border-bottom: 1px solid #eee;
}
.section text{
font-size: 32rpx;
line-height: 80rpx;
}
.section image{
width: 40rpx;
height: 40rpx;
float: right;
margin-top: 20rpx;
}
\ No newline at end of file
<view class="page">
<form onSubmit="formSubmit" onReset="formReset">
<!-- <picker onChange="bindPickerChange" value="{{index}}" range="{{conferenceList}}" range-key="conferenceName" name="conferenceName"><view class='item-avatar-xs'><text>会议室</text><text class='selectpocker'>{{conferenceList[index].conferenceName}}</text><text class='left'>〉</text></view></picker> -->
<view class='item-avatar-xs'>
<text>会议名称:</text>
<input type='text' value="{{message.messageName}}" placeholder='请输入会议名称' name="messageName" />
</view>
<view class='item-avatar-xs'>
<text>主持人:</text>
<input type='text' value="{{message.messageCompere}}" placeholder='请输入主持人' name="messageCompere" />
</view>
<view class='item-avatar-xs'>
<text>添加议题:</text>
<input type='text' placeholder='输入议题' name="messageTheme" />
<image src='../../../resource/images/add.png' onTap='addList'></image>
</view>
<view class="item-avatar-xs" a:for="{{lists}}" a:key="{{index}}">
<view class='add'>
<input type='text' placeholder='输入议题' name="messageTheme" />
<image src='../../../resource/images/off.png' onTap='delList'></image>
</view>
</view>
<view class='item-avatar-xs'>
<text>会议信息:</text>
<textarea placeholder='输入内容' value="{{messageContent}}" name="messageContent"></textarea>
</view>
<view class="graySpace"></view>
<view class='add_bg'>
<!-- <picker mode="date" onChange="bindDateChange" name="startTime"><text class="picker">日期: {{dates}}</text></picker> -->
<text onTap="datePicker">日期: {{dates}}</text>
</view>
<view class='add_time'>
<view>会议时间:
<text>{{time.min}}</text>分钟
</view>
</view>
<view class="graySpace"></view>
<scroll-view class='times scroll-view_H' scroll-x="{{true}}" scroll-with-animation="{{true}}" scroll-left="100rpx">
<view class="min_box">
<view a:for="{{allTime.minutes}}" a:for-item="minute">
<view class="min">{{minute}}分钟</view>
</view>
</view>
<view a:for="{{timeList}}" a:for-item="time" a:for-index="hindex">
<text class="hour">{{hindex}}:00</text>
<view class="scroll-view-item_H" a:for="{{time}}" a:for-item="t" a:for-index="mindex">
<view data-hour="{{t.hour}}"data-unclick="{{t.unclick}}" data-minute="{{t.minute}}" data-hour-index="{{hindex}}" data-min-index="{{mindex}}" style="background-color:{{t.color}}" class="time-block" onTap="selTime"></view>
</view>
</view>
</scroll-view >
<view class="graySpace"></view>
<navigator url="../visitor/visitor?mid={{mid}}" open-type="navigate" class='item-avatar-xs'>
<text>公司参与人员</text>
<text class='left'>〉</text>
</navigator>
<navigator url="../ex_visitor/ex_visitor?mid={{mid}}" open-type="navigate" class='item-avatar-xs'>
<text>邀请外部人员</text>
<text class='left'>〉</text>
</navigator>
<!-- <view class='item-avatar-xs'>
<text>是否安排座位</text>
<switch class='left2' name="isSite" onChange="switch"></switch>
</view> -->
<view class="graySpace"></view>
<!-- <view class='item-avatar-xs'><text>通知</text><view class='add_btn'><button class="{{num == 1?'se_btning':'se_btn'}}" data-num = "1" onTap="clickNum">微信</button><button class="{{num == 2?'se_btning':'se_btn'}}" data-num = "2" onTap="clickNum">短信</button><button class="{{num == 3?'se_btning':'se_btn'}}" data-num = "3" onTap="clickNum">邮箱</button></view></view> -->
<view class='section'>
<view onTap="onChangeShowState">
<text>方式</text>
<image src="{{showView?'../../../resource/images/bottom2.png':'../../../resource/images/left1.png'}}"></image>
</view>
<view class="se_btn_hide{{ showView==true?'se_btn_hide':''}}">
<checkbox-group name="remindMethod" class="check">
<label onTap='clicks' >
<checkbox value="dingding" data-val="dingding" name="dingding" hidden='false' checked="{{message.dingding ==1?'true':'false'}}"/> 钉钉
</label>
<label onTap='clicks' >
<checkbox value="wechat" data-val="wechat" name="wechat" hidden='false' checked="{{message.wechat ==1?'true':'false'}}"/> 微信
</label>
<label onTap='clicks' class='{{notice.checked?"is_checked":""}}'>
<checkbox value="mailbox" data-val="mailbox" name="mailbox" hidden='false' checked="{{message.mailbox ==1?'true':'false'}}"/> 邮箱
</label>
<label onTap='clicks' >
<checkbox value="note" data-val="note" name="note" hidden='false' checked="{{message.note ==1?'true':'false'}}"/> 短信
</label>
</checkbox-group>
</view>
</view>
<checkbox-group value="{{index}}" range="{{msgArray}}" bindchange="checkboxChange">
<view class='item-avatar-xs' onTap='modaltime'>
<text>提醒</text>
<text class='selectpocker' style="font-size:24rpx">{{text}}</text>
<text class='left'>〉</text>
</view>
</checkbox-group>
<view class="add">
<button formType="submit" type="primary">预定</button>
</view>
<view class="mask2" onTap='mask2' catchtouchmove="preventTouchMove" hidden="{{!showModal2}}"></view>
<view class="modaltime2" hidden="{{!showModal2}}">
<checkbox-group name="remindTime" class="checkbox-group" onChange="checkboxChange">
<label class='checkbox'>
<checkbox checked="{{message.minTen ==1?'true':'false'}}" name="minTen" value='minTen' ></checkbox>
<text>提前十分钟</text>
</label>
<label class='checkbox'>
<checkbox checked="{{message.halfHour ==1?'true':'false'}}" name="halfHour" value='halfHour'></checkbox>
<text>提前半小时</text>
</label>
<label class='checkbox'>
<checkbox checked="{{message.oneHour ==1?'true':'false'}}" name="oneHour" value='oneHour'></checkbox>
<text>提前一小时</text>
</label>
</checkbox-group>
</view>
</form>
</view>
\ No newline at end of file
let app=getApp();
let domain = app.globalData.domain;
//获取用户信息的url
let conferenceUrl = domain + "/dingding/conference";
let messageListUrl = domain + "/dingding/messageList";
let getMessageByIdUrl = domain +"/dingding/getMessageById";
let generateMidUrl = domain + "/dingding/generateMid";
let conferenceListUrl = domain + "/dingding/conferenceList";
Page({
data: {
showModal: false,
showView: true,
conferenceList: [],
mid:null,
message:null,
messageContent:"",
//msgArray: ['无提醒', '提前十分钟', '提前半小时', '提前一小时'],
showView: false,
dates: dateFtt("yyyy-MM-dd", new Date()),
lists: [{}],
text: '',
cnum:'',
allTime: {
hours: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23],
minutes: [0, 15, 30, 45]
},
timeList:[],
msgTime:[],
time:{
startIndex:null,
endIndex:null,
startTime:null,
endTIme:null,
min:0,
}
},
//方式选项点击
clicks: function(e) {
let index = e.currentTarget.dataset.index;
let arrs = this.data.checks;
if (arrs[index].checked == false) {
arrs[index].checked = true;
} else {
arrs[index].checked = false;
}
this.setData({
checks: arrs
})
},
//是否安排座位
switch: function() {
//console.log("点击");
var mid=this.data.mid;
console.log("会议室", this.data.cnum)
// if (this.data.cnum==""){
// dd.alert({
// title: "参数错误",
// content: "会议室没有选择",
// buttonText: '确定'
// })
// return false;
// }
var _this=this;
},
//显示隐藏(方式选项)
onChangeShowState: function() {
var that = this;
that.setData({
showView: (!that.data.showView),
se_btn_hide: false
})
},
formSubmit: function(e) {
console.log('form发生了submit事件,携带数据为:', e.detail.value);
var conferenceList=this.data.conferenceList;
var startTime = this.data.dates+" "+this.data.time.startTime ;
var endTime = this.data.dates + " "+ this.data.time.endTime ;
var _this=this;
// if (typeof (e.detail.value.conferenceName) == "undefined") {
// dd.alert({
// title: "参数错误",
// content: "会议室没有选择",
// buttonText: '确定'
// })
// return false;
// }
if (e.detail.value.remindMethod.length==0){
dd.alert({
title:"参数错误",
content:"提醒方式没有选择",
buttonText: '确定'
})
return false;
}
if (e.detail.value.remindTime.length == 0) {
dd.alert({
title: "参数错误",
content: "提醒时间没有选择",
buttonText: '确定'
})
return false;
}
if (e.detail.value.messageName == "") {
dd.alert({
title: "参数错误",
content: "会议名称没有填写",
buttonText: '确定'
})
return false;
}
dd.httpRequest({
url: addmeetingeUrl,
method: 'POST',
data: {
mid: _this.data.mid,
cnum: _this.data.cnum,
startTime: startTime,
endTime: endTime,
userId: app.globalData.userId,
messageName: e.detail.value.messageName,
messageCompere: e.detail.value.messageCompere,
messageContent: e.detail.value.messageContent,
remindMethod : e.detail.value.remindMethod,
remindTime: e.detail.value.remindTime,
},
dataType: 'json',
success: function(res) {
// console.log('success----', res)
if (res.data.success){
//console.log("预定成功");
dd.alert({
title: '预定成功',
content: '预定成功',
buttonText: '确定',
success: () => {
dd.reLaunch({
url: '../index/index'
});
},
});
}else {
dd.showToast({
type: 'fail',
content: res.data.message,
duration: 3000,
success: () => {
// dd.navigateTo({
// url: '../index/index'
// });
},
});
}
},
fail: function(res) {
console.log("httpRequestFail---", res)
dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
},
datePicker() {
var timeList = this.data.timeList;
var hours = this.data.allTime.hours;
var minutes = this.data.allTime.minutes;
var _this = this;
dd.datePicker({
success: (res) => {
_this.setData({
dates: res.date
});
//查询当天会议时间段
var dates = res.date;
//清空原來的
timeList = [];
_this.setData({
timeList
});
var msgTime = this.data.msgTime;
var nowHour = new Date().getHours();
var nowMinute = new Date().getMinutes();
msgTime = [];
_this.setData({
msgTime
});
dd.httpRequest({
url: messageListUrl,
method: 'POST',
data: {
date: _this.data.dates,
cnum: _this.data.message.cnum
},
dataType: 'json',
success: function(res) {
console.log('success----message', res)
var msg = res.data.result;
for (var i = 0; i < msg.length; i++) {
var json = {};
json["startTime"] = msg[i].startTimeFormat;
json["endTime"] = msg[i].endTimeFormat;
msgTime.push(json);
}
_this.setData({
msgTime
});
console.log(msgTime)
if (timeList.length == 0) {
for (var i = 0; i < hours.length; i++) {
var arr = new Array;
for (var j = 0; j < minutes.length; j++) {
//console.log(hours[i]);
// console.log(minutes[j]);
//dateCompare(startDate, endDate)
//Date.parse(new Date(e.detail.value)) < Date.parse(new Date())
var json = {};
json["hour"] = hours[i];
json["minute"] = minutes[j];
if (dateCompare(dateFtt("yyyy-MM-dd", new Date()), dates) == 0) {
json["color"] = "#ABABAB";
json["unclick"] = true;
} else if (dateCompare(dateFtt("yyyy-MM-dd", new Date()), dates) == 1) {
if (nowHour > hours[i]) {
json["color"] = "#ABABAB";
json["unclick"] = true;
} else {
json["color"] = "";
json["unclick"] = false;
}
if (nowHour == hours[i]) {
if (nowMinute > minutes[j]) {
json["color"] = "#ABABAB";
json["unclick"] = true;
} else {
json["color"] = "";
json["unclick"] = false;
}
}
}
else if (dateCompare(dateFtt("yyyy-MM-dd", new Date()), dates) == 2) {
json["color"] = "";
json["unclick"] = false;
}
// console.log(msgTime);
if (msgTime.length > 0) {
for (var k = 0; k < msgTime.length; k++) {
var msgstart = Number(msgTime[k].startTime.split(":")[0]);
var msgend = Number(msgTime[k].endTime.split(":")[0]);
var msgstartmin = Number(msgTime[k].startTime.split(":")[1]) - 15;
var msgendmin = Number(msgTime[k].endTime.split(":")[1]);
console.log("会议开始时间", msgstart + ":" + msgstartmin);
// console.log(msgTime[k].startTime.split(":")[0]);
if (time_range(msgstart + ":" + msgstartmin, msgTime[k].endTime, hours[i] + ":" + minutes[j])) {
json["color"] = "#EEAD0E";
json["unclick"] = true;
}
}
}
// console.log("json",json);
//console.log(this.data.time.allTime.hours[i] + this.data.time.allTime.minutes[j])
arr.push(json);
}
timeList.push(arr);
}
}
//console.log(status);
_this.setData({
timeList
})
dd.hideLoading();
},
fail: function(res) {
console.log("httpRequestFail---", res)
dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
}
})
},
//点击小方块
selTime:function(e){
var startTime=this.data.time.startTime;
var endTime = this.data.time.endTime;
var startIndex = this.data.time.startIndex;
var endIndex = this.data.time.endIndex;
var timeList = this.data.timeList;
var unclick= e.currentTarget.dataset.unclick;
// console.log(startIndex);
if (!unclick){
if(startTime==null){
if (e.currentTarget.dataset.hour<10){
var hour = "0" + e.currentTarget.dataset.hour
if (e.currentTarget.dataset.minute==0){
startTime = hour + ":00" ;
}else {
startTime = hour+ ":" + e.currentTarget.dataset.minute;
}
}else {
if (e.currentTarget.dataset.minute == 0) {
startTime = e.currentTarget.dataset.hour + ":00";
} else {
startTime = e.currentTarget.dataset.hour + ":" + e.currentTarget.dataset.minute;
}
}
console.log("会议开始时间"+startTime);
timeList[e.currentTarget.dataset.hourIndex][e.currentTarget.dataset.minIndex].color ="#4876FF";
this.setData({
"time.startTime": startTime,
"time.startIndex": [e.currentTarget.dataset.hourIndex, e.currentTarget.dataset.minIndex]
,timeList});
}
if (startTime != null && endTime == null && startIndex!=null){
if (startIndex[0] == e.currentTarget.dataset.hourIndex){
for (var j = startIndex[1]; j <= e.currentTarget.dataset.minIndex; j++) {
timeList[e.currentTarget.dataset.hourIndex][j].color = "#4876FF";
}
}
if (startIndex[0] < e.currentTarget.dataset.hourIndex) {
for (var i = startIndex[0]; i <= e.currentTarget.dataset.hourIndex; i++) {
if (i == startIndex[0]){
for (var j = startIndex[1]; j <=3; j++){
timeList[i][j].color = "#4876FF";
}
}
if (i > startIndex[0] && i < e.currentTarget.dataset.hourIndex) {
for (var j =0; j <= 3; j++) {
timeList[i][j].color = "#4876FF";
}
}
if (i== e.currentTarget.dataset.hourIndex) {
for (var j = 0; j <= e.currentTarget.dataset.minIndex; j++) {
timeList[i][j].color = "#4876FF";
}
}
}
}
if (e.currentTarget.dataset.hour < 10) {
var hour = "0" + e.currentTarget.dataset.hour
endTime = hour+ ":" + (e.currentTarget.dataset.minute + 15);
} else {
endTime = e.currentTarget.dataset.hour + ":" + (e.currentTarget.dataset.minute + 15);
}
console.log("会议结束时间" + endTime);
var sh =Number(this.data.time.startTime.split(":")[0]);
var sm = Number (this.data.time.startTime.split(":")[1]);
var eh = Number(e.currentTarget.dataset.hour);
var em = Number(e.currentTarget.dataset.minute + 15);
var minutes=(eh*60+em) -(sh*60+sm);
this.setData({
"time.endTime": endTime,
"time.endIndex": [e.currentTarget.dataset.hourIndex, e.currentTarget.dataset.minIndex],
"time.min": minutes,
timeList
});
}
if (startTime != null && endTime != null && startIndex != null && endIndex != null) {
endTime =null;
startTime = null;
if (startIndex[0] ==endIndex[0]) {
for (var j = startIndex[1]; j <= endIndex[1]; j++) {
timeList[startIndex[0]][j].color = "";
}
}
if (startIndex[0] < endIndex[0]) {
for (var i = startIndex[0]; i <= endIndex[0]; i++) {
if (i == startIndex[0]) {
for (var j = startIndex[1]; j <= 3; j++) {
timeList[i][j].color = "";
}
}
if (i > startIndex[0] && i < endIndex[0]) {
for (var j = 0; j <= 3; j++) {
timeList[i][j].color = "";
}
}
if (i == endIndex[0]) {
for (var j = 0; j <= endIndex[1]; j++) {
timeList[i][j].color = "";
}
}
}
}
startIndex=null;
endIndex = null;
this.setData({
"time.endTime": endTime,
"time.startTime": startTime,
"time.startIndex": startIndex,
"time.endIndex": endIndex,
"time.min": 0,
timeList
});
}
}else {
return false;
}
console.log(e.currentTarget.dataset.hour);
console.log(e.currentTarget.dataset.minute);
// console.log(e.currentTarget.dataset.hourIndex);
// console.log(e.currentTarget.dataset.minIndex);
},
getSite:function(){
dd.chooseDepartments({
title: "选择与会人", //标题
multiple: true, //是否多选
limitTips: "超出了", //超过限定人数返回提示
maxDepartments: 100, //最大选择部门数量
pickedDepartments: [], //已选部门
disabledDepartments: [], //不可选部门
requiredDepartments: [], //必选部门(不可取消选中状态)
appId: 158, //微应用的Id
permissionType: "xxx", //选人权限,目前只有GLOBAL这个参数
success: function(res) {
/**
{
userCount:1, //选择人数
departmentsCount:1,//选择的部门数量
departments:[{"id":,"name":"","number":}]//返回已选部门列表,列表中每个对象包含id(部门id)、name(部门名称)、number(部门人数)
}
*/
},
fail: function(err) {
}
});
},
//消息选择
bindPickerChange: function(e) {
// var conferenceList= this.data.conferenceList;
//console.log('picker发送选择改变,携带值为', conferenceList[e.detail.value].conferenceNumber);
this.setData({
index: e.detail.value,
// cnum: conferenceList[e.detail.value].conferenceNumber
});
},
//多项选择框
checkboxChange: function(e) {
var temp1 = e.detail.value
var temp2 = ''
console.log(temp1)
if (temp1.length != 0) {
for (var i = 0, len = temp1.length; i < len; i++) {
if (temp1[i]=="minTen"){
temp2 = temp2 + "提前十分钟" + ','
}
if (temp1[i] == "halfHour") {
temp2 = temp2 + "提前半小时" + ','
}
if (temp1[i] == "oneHour") {
temp2 = temp2 + "提前一小时" + ','
}
}
this.setData({
text: temp2
})
} else {
this.setData({
text: ''
})
}
},
//添加议题
addList: function() {
var lists = this.data.lists;
var newData = {};
lists.push(newData);//实质是添加lists数组内容,使for循环多一次
this.setData({
lists: lists,
})
},
//删除议题
delList: function() {
var lists = this.data.lists;
lists.pop(); //实质是删除lists数组内容,使for循环少一次
this.setData({
lists: lists,
})
},
//时间
modaltime: function() {
this.setData({
showModal2: true
})
},
preventTouchMove: function() {
},
mask: function() {
this.setData({
showModal: false
})
},
mask2: function(e) {
this.setData({
showModal2: false,
})
//this.items.value = e.detail.value
},
onLoad: function(query) {
//showView: (options.showView == "true" ? true : false);
//生成会议id
var _this = this;
// console.log("会议id",_this.data.mid);
//查询当天会议时间段
var timeList = this.data.timeList;
var hours = this.data.allTime.hours;
var minutes = this.data.allTime.minutes;
//清空原來的
timeList = [];
this.setData({
timeList,
cnum: query.cnum
});
var msgTime = this.data.msgTime;
var nowHour = new Date().getHours();
var nowMinute = new Date().getMinutes();
msgTime = [];
this.setData({
msgTime
});
dd.httpRequest({
url: getMessageByIdUrl,
method: 'GET',
data: {
mid:query.mid
},
dataType: 'json',
success: function(res) {
console.log('success----', res);
_this.setData({
message: res.data.result,
messageContent: res.data.result.messageContent,
});
var noticeList= _this.data.noticeList;
var cnum = res.data.result.cnum;
var message = res.data.result;
dd.httpRequest({
url: messageListUrl,
method: 'POST',
data: {
date: _this.data.dates,
cnum: cnum
},
dataType: 'json',
success: function(res) {
console.log('success----message', res)
var msg = res.data.result;
for (var i = 0; i < msg.length; i++) {
var json = {};
json["startTime"] = msg[i].startTimeFormat;
json["endTime"] = msg[i].endTimeFormat;
msgTime.push(json);
}
_this.setData({
msgTime
});
if (timeList.length == 0) {
for (var i = 0; i < hours.length; i++) {
var arr = new Array;
for (var j = 0; j < minutes.length; j++) {
//console.log(hours[i]);
// console.log(minutes[j]);
var json = {};
json["hour"] = hours[i];
json["minute"] = minutes[j];
if (nowHour > hours[i]) {
json["color"] = "#ABABAB";
json["unclick"] = true;
} else {
json["color"] = "";
json["unclick"] = false;
}
if (nowHour == hours[i]) {
if (nowMinute > minutes[j]) {
json["color"] = "#ABABAB";
json["unclick"] = true;
} else {
json["color"] = "";
json["unclick"] = false;
}
}
// console.log(msgTime);
if (msgTime.length > 0) {
for (var k = 0; k < msgTime.length; k++) {
var msgstart = Number(msgTime[k].startTime.split(":")[0]);
var msgend = Number(msgTime[k].endTime.split(":")[0]);
var msgstartmin = Number(msgTime[k].startTime.split(":")[1]) - 15;
var msgendmin = Number(msgTime[k].endTime.split(":")[1]);
console.log("会议开始时间", msgstart + ":" + msgstartmin);
// console.log(msgTime[k].startTime.split(":")[0]);
if (time_range(msgstart + ":" + msgstartmin, msgTime[k].endTime, hours[i] + ":" + minutes[j])) {
json["color"] = "#EEAD0E";
json["unclick"] = true;
}
}
}
if (dateCompare(dateFtt("yyyy-MM-dd", new Date(message.startTime)) ,_this.data.dates)==1){
// console.log(msgTime[k].startTime.split(":")[0]);
var starttime=new Date(message.startTime);
starttime.setMinutes (starttime.getMinutes()-15)
if (time_range(dateFtt("hh:mm", starttime), dateFtt("hh:mm", new Date(message.endTime)), hours[i] + ":" + minutes[j])) {
var sh = new Date(message.startTime).getHours();
var sm = new Date(message.startTime).getMinutes();
var eh = new Date(message.endTime).getHours();
var em = new Date(message.endTime).getMinutes();
var min = (eh * 60 + em) - (sh * 60 + sm);
_this.setData({
"time.endTime": new Date(message.endTime),
"time.startTime": new Date(message.startTime),
"time.min": min
});
json["color"] = "#4876FF";
json["unclick"] = false;
}
}
// console.log("json",json);
//console.log(this.data.time.allTime.hours[i] + this.data.time.allTime.minutes[j])
arr.push(json);
}
timeList.push(arr);
}
}
//console.log(status);
_this.setData({
timeList
})
console.log("timeList", timeList)
dd.hideLoading();
},
fail: function(res) {
console.log("httpRequestFail---", res)
dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
},
fail: function(res) {
console.log("httpRequestFail---", res)
dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
},
addlist: function() {
var that = this;
that.setData({
showView: (!that.data.showView)
})
},
//点击添加删除class
clickNum: function(e) {
this.setData({
num: e.target.dataset.num
})
},
onReady() {
// 页面加载完成
// console.log(this.data.timeList);
},
onShow() {
// 页面显示
},
onHide() {
// 页面隐藏
},
onUnload() {
// 页面被关闭
},
onTitleClick() {
// 标题被点击
},
onPullDownRefresh() {
// 页面被下拉
},
onReachBottom() {
// 页面被拉到底部
},
onShareAppMessage() {
// 返回自定义分享信息
return {
title: 'My App',
desc: 'My App description',
path: 'pages/index/index',
};
},
});
function dateFtt(fmt, date) { //author: meizz
var o = {
"M+": date.getMonth() + 1, //月份
"d+": date.getDate(), //日
"h+": date.getHours(), //小时
"m+": date.getMinutes(), //分
"s+": date.getSeconds(), //秒
"q+": Math.floor((date.getMonth() + 3) / 3), //季度
"S": date.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt))
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
for (var k in o)
if (new RegExp("(" + k + ")").test(fmt))
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
return fmt;
}
function dateCompare(nowDate, selectDate) {
var aStart = nowDate.split('-'); //转成成数组,分别为年,月,日,下同
var aEnd = selectDate.split('-');
var startDateTemp = aStart[0] + "/" + aStart[1] + "/" + aStart[2];
var endDateTemp = aEnd[0] + "/" + aEnd[1] + "/" + aEnd[2];
if (startDateTemp > endDateTemp)
return 0;
else if (startDateTemp == endDateTemp)
return 1;
else if (startDateTemp < endDateTemp)
return 2;
}
var time_range = function(beginTime, endTime, nowTime) {
var strb = beginTime.split(":");
if (strb.length != 2) {
return false;
}
var stre = endTime.split(":");
if (stre.length != 2) {
return false;
}
var strn = nowTime.split(":");
if (stre.length != 2) {
return false;
}
var b = new Date();
var e = new Date();
var n = new Date();
b.setHours(strb[0]);
b.setMinutes(strb[1]);
e.setHours(stre[0]);
e.setMinutes(stre[1]);
n.setHours(strn[0]);
n.setMinutes(strn[1]);
if (n.getTime() - b.getTime() > 0 && n.getTime() - e.getTime() < 0) {
return true;
} else {
//console.log("当前时间是:" + n.getHours() + ":" + n.getMinutes() + ",不在该时间范围内!");
return false;
}
}
{"defaultTitle": "修改会议"}
\ No newline at end of file
.page{
background: #fff;
}
.section{
/* height: 80rpx;
line-height: 80rpx; */
padding:30rpx;
font-size: 0.6rem;
margin:20rpx;
border-bottom: 1px solid #eee;
}
.section input{
width: 85%;
margin-top: -44rpx;
float: right;
}
.section image{
width: 32rpx;
height: 32rpx;
float: right;
margin-top: -6rpx;
}
.li .icon-xiala ,.icon-shangjiantou {
color: #999;
font-size: 28rpx;
}
.se_btn_hide{
display: none;
height: 80rpx;
position: relative;
margin-top: 0.1rpx;
}
.se_btn_show{
display: block;
}
.radio-group{
width: 83%;
float: right;
}
.radio{
margin-left: 30rpx;
}
label{
width: 2.4rem;
margin-top: -10rpx;
}
.check {
display:flex;
flex-wrap:wrap;
justify-content:flex-start;
}
.check label {
width: 140rpx;
height: 60rpx;
font-size: 22rpx;
border-radius: 8rpx;
display: flex;
align-items: center;
margin: 0 8rpx;
justify-content: center;
margin-top: 20rpx;
}
.is_checked {
background-color: #156EF3;
color: #fff;
border: 1rpx solid #fff;
}
\ No newline at end of file
<view class="page">
<!-- <view class="section">
<picker mode="date" value="{{dates}}" onChange="onChange">
<view class="picker" >日期: {{dates}} </view>
</picker>
</view> -->
<form onSubmit="findConference" onReset="">
<view class="section">
<view>人数:
<input type='number' placeholder='请输入参会人数' name="person"></input>
</view>
</view>
<view class='section'>
<view onTap="onChangeShowState">功能:
<image src="{{showView?'../../../resource/images/bottom.png':'../../../resource/images/left.png'}}"></image>
</view>
<view class="se_btn_hide{{ showView==true?'se_btn_hide':''}}">
<checkbox-group name="function" class="check">
<label bindtap='clicks' a:for="{{checks}}" a:for-item="check" class='{{item.checked?"is_checked":""}}'>
<checkbox value="{{check.name}}" data-val="{{check.name}}" hidden='false' checked='{{check.checked}}' /> {{check.name}}
</label>
</checkbox-group>
</view>
</view>
<view class='section'>
<view>关键字:
<!-- <radio-group class="radio-group">
<label a:for="{{meets}}" a:for-item="meet">{{meet.value}}
<radio class="radio" value="{{meet.name}}" checked="{{meet.checked}}">
</label>
</radio-group> -->
<input type='text' placeholder='请输入关键字' name="keyword"></input>
</view>
</view>
<button class='button' type="primary" formType="submit">查询</button>
</form>
</view>
\ No newline at end of file
let app = getApp();
//替换成开发者后台设置的安全域名
let domain = app.globalData.domain;
Page({
data: {
meets: [
{ name: 'video', value: '视频会议', checked: true },
{ name: 'ordinary', value: '普通会议' }
],
checks: [
{ name: "投影仪", value: '0', checked: false },
{ name: "电视机", value: '1', checked: false },
{ name: "空调", value: '2', checked: false },
{ name: "Wifi", value: '3', checked: false },
],
dates: dateFtt("yyyy-MM-dd", new Date()),
// times: dateFtt("hh:mm", new Date()),
index: 0,
showView: false,
},
clicks: function(e) {
let index = e.currentTarget.dataset.index;
let arrs = this.data.checks;
if (arrs[index].checked == false) {
arrs[index].checked = true;
} else {
arrs[index].checked = false;
}
this.setData({
checks: arrs
})
},
// 点击时间组件确定事件
onChange(e) {
console.log(e.detail.value);
this.setData({
dates: e.detail.value
//times: e.detail.value,
})
},
onLoad: function(options) {
// 生命周期函数--监听页面加载
showView: (options.showView == "true" ? true : false)
},
//显示隐藏
onChangeShowState: function() {
var that = this;
that.setData({
showView: (!that.data.showView),
se_btn_hide: false
})
},
findConference: function(e){
console.log('form发生了submit事件,携带数据为:', e.detail.value)
var num= encodeURIComponent('number=1');
console.log(num);
dd.reLaunch({//& query=number % 3D1 & page=x % 2Fy % 2Fz
url: '../index/index?person=' + e.detail.value.person
// url: '../index/index?query=number%3D1'
})
},
onReady() {
// 页面加载完成
},
onShow() {
// 页面显示
},
onHide() {
// 页面隐藏
},
onUnload() {
// 页面被关闭
},
onTitleClick() {
// 标题被点击
},
onPullDownRefresh() {
// 页面被下拉
},
onReachBottom() {
// 页面被拉到底部
},
onShareAppMessage() {
// 返回自定义分享信息
return {
title: 'My App',
desc: 'My App description',
path: 'pages/index/index',
};
},
});
function dateFtt(fmt, date) { //author: meizz
var o = {
"M+": date.getMonth() + 1, //月份
"d+": date.getDate(), //日
"h+": date.getHours(), //小时
"m+": date.getMinutes(), //分
"s+": date.getSeconds(), //秒
"q+": Math.floor((date.getMonth() + 3) / 3), //季度
"S": date.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt))
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
for (var k in o)
if (new RegExp("(" + k + ")").test(fmt))
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
return fmt;
}
{"defaultTitle": "搜索会议室"}
\ No newline at end of file
.page{
background: #fff;
font-size: 20rpx;
}
.drag{
width: 0.6rem;
height:1rem;
background:url(../../../resource/images/drag.png) center no-repeat;
position: absolute;
z-index: 9999;
}
.left{
width: 20%;
height: 1220rpx;
margin-top: 10rpx;
border: 1px solid #ccc;
float: left;
text-align: center;
}
.title{
display: inline-block;
font-size: 30rpx;
font-weight: 700;
margin-top: 20rpx;
}
.visitor{
width: 100%;
height: 93%;
overflow-x: hidden;
overflow-y: scroll;
}
.visitor text{
display: block;
width: 130rpx;
height: auto;
line-height: 40rpx;
border-radius: 10rpx;
background: #548AF0;
color: #fff;
border-color: #fff;
margin: 20rpx auto;
}
.right{
width: 76%;
height: 1220rpx;
margin-top: 10rpx;
border: 1px solid #ccc;
position: absolute;
margin-left: 160rpx;
overflow-x: hidden;
overflow-y: scroll;
}
.seattitle image{
width: 100%;
height: 100rpx;
}
.noseattop{
width: 100%;
height: 140rpx;
background: url(../../../resource/images/m12.png) center no-repeat;
background-size: 80%;
margin-top: -30rpx;
position: relative;
top: 20rpx;
}
.seattop{
width: 100%;
height: 140rpx;
background: url(../../../resource/images/m11.png) center no-repeat;
background-size: 80%;
margin-top: -30rpx;
position: relative;
top: 20rpx;
margin-left: -3rpx;
}
.seattop view{
text-align: center;
}
.seattop text{
display: block;
margin-top: -30rpx;
}
.seattop label{
display: block;
margin-top: 60rpx;
}
.seatcenter{
width: 99%;
height: 75rpx;
background: url(../../../resource/images/m2.png) center no-repeat;
background-size: 80%;
/* border: 1px solid red; */
}
.seatleft{
width: 51%;
height: 75rpx;
line-height: 75rpx;
float: left;
position: relative;
/* background: url(../../../resource/images/seatleft.png) right / 85% no-repeat ; */
/*border: 1px solid #ccc;*/
}
.seatleft view{
width: 100%;
}
.seatleft text{
width: 44%;
height: 75rpx;
line-height: 75rpx;
text-align: center;
display: block;
float: left;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.seatleft label{
display: block;
width: 10%;
height: 75rpx;
line-height: 75rpx;
float: right;
margin-right: 40rpx;
}
.seatright_box{
width: 50%;
height: auto;
float: right;
position: absolute;
right: 0;
}
.seatright{
width: 99%;
height: 75rpx;
line-height: 75rpx;
/* background: url(../../../resource/images/seatright.png) left / 85% no-repeat ; */
/* border: 1px solid #ccc; */
}
.seatright label{
display: block;
width: 10%;
height: 75rpx;
line-height: 75rpx;
float: left;
margin-left: 40rpx;
}
.seatright text{
display: block;
width: 44%;
height: 75rpx;
line-height: 75rpx;
text-align: center;
float: right;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.seatbottom{
width: 100%;
height: 140rpx;
background: url(../../../resource/images/m4.png) center no-repeat;
background-size: 80%;
margin-top: -75rpx;
margin-left: -3rpx;
}
.seatbottom view{
text-align: center;
}
.seatbottom text{
display: block;
margin-top: 70rpx;
}
.seatbottom label{
display: block;
margin-top: 60rpx;
margin-right: 250rpx;
}
\ No newline at end of file
<view class="page" onTouchMove="move" onTouchEnd="stop">
<view for="" class="drag" style="display:{{drag.display}};left:{{drag.x}};top:{{drag.y}}"></view>
<view class="left">
<text class="title">与会人员</text>
<view class="visitor">
<text a:for="{{visitorList}}" a:for-item="visitor" a:for-index="index" >
<view id="visitor{{index}}" data-id="{{visitor.signId}}" data-name="{{visitor.signName}}" onLongTap="longTap">
{{visitor.signName}}
</view>
</text>
</view>
</view>
<view class="right">
<view class="seattitle" >
<image src="../../../resource/images/3.png" mode="aspectFit" />
</view>
<!-- <view class="seattop" a:for="{{seatList}}" a:for-item="seat">
<view class="name">{{seat.name}}</view>
<image src="{{src}}" mode="seat.mode" onError="imageError" onLoad="imageLoad" />
<view class="num">{{seat.num}}</view>
</view> -->
<view id="top" class="seattop" a:if="{{topSeat!=null}}">
<view >
<text style="color:{{topSeat.color}}">{{topSeat.name}}</text>
<label >{{topSeat.num}}</label>
</view>
</view>
<view class="noseattop" a:if="{{topSeat==null}}">
</view>
<view class="seatleft" id="right{{i}}" a:for="{{leftSeatList}}" a:for-item="leftSeat" a:for-index="i">
<view >
<text style="color:{{leftSeat.color}}">{{leftSeat.name}}</text>
<label>{{leftSeat.num}}</label>
</view>
</view>
<view class="seatright_box">
<view class="seatright" id="right{{i}}" a:for="{{rightSeatList}}" a:for-item="rightSeat" a:for-index="i" >
<view >
<label >{{rightSeat.num}}</label>
<text style="color:{{rightSeat.color}}">{{rightSeat.name}}</text>
</view>
</view>
</view>
<view class="seatcenter" a:for="{{seatNum%2==0?(seatNum-2)/2:(seatNum-1)/2}}" a:for-item="centerSeat" a:for-index="i"></view>
<view class="seatbottom" id="bottom" a:if="{{bottomSeat!=null}}">
<view >
<label >{{bottomSeat.num}}</label>
<text style="color:{{bottomSeat.color}}">{{bottomSeat.name}}</text>
</view>
</view>
</view>
\ No newline at end of file
let app = getApp();
//替换成开发者后台设置的安全域名
let domain = app.globalData.domain;
//获取用户信息的url
let getSignListUrl = domain + "/dingding/getSignList";
let setSeatUrl = domain + "/dingding/setSeat";
Page({
data: {
drag:{
display:"none",
x:0,
y:0,
name:"",
id:"",
isSet:false
},
seatNum:null,
// centerSeatList: null,
leftSeatList:[],
rightSeatList:[],
bottomSeat:null,
topSeat:null,
visitorList:[],
mid:null
},
longTap:function(e){
var _this = this;
var id = e.currentTarget.id;
// console.log(id);
dd.createSelectorQuery().select('#'+id).boundingClientRect().exec((ret) => {
// console.log(ret);
_this.setData({
"drag.x": ret[0].left ,
"drag.y": ret[0].top,
"drag.isSet":true,
"drag.display": "block",
"drag.name": e.currentTarget.dataset.name,
"drag.id": e.currentTarget.dataset.id
});
})
// console.log("长按事件");
},
move:function(e){
this.setData({
"drag.x": e.changedTouches[0].clientX,
"drag.y": e.changedTouches[0].clientY,
});
//console.log("移动"+e);
},
stop: function(e) {
// console.log("停止");
this.setData({
"drag.display": "none"
});
var _this = this;
var isSet=this.data.drag.isSet;
var sid = this.data.drag.id;
// console.log("是否可设置"+isSet);
if (isSet==true){
dd.createSelectorQuery().select('#bottom').
boundingClientRect().selectAll('.seatleft').boundingClientRect().selectAll('.seatright').boundingClientRect().
select('#top').boundingClientRect().exec((ret) => {
//console.log(ret);
if(ret!=null){
// console.log("进入查询节点方法");
var x = e.changedTouches[0].clientX;
var y = e.changedTouches[0].clientY;
// console.log("x坐标"+x);
// console.log("y坐标" + y);
if (x < ret[0].left + ret[0].width && x > ret[0].left && y < ret[0].top + ret[0].height && y > ret[0].top ){
// console.log("在底部");
var name =this.data.drag.name;
var topSeat = this.data.topSeat;
var bottomSeat = this.data.bottomSeat;
var rightSeatList = this.data.rightSeatList;
var leftSeatList = this.data.leftSeatList;
//var rightSeatList = this.data.rightSeatList;
for (var j = 0; j < leftSeatList.length; j++) {
if (name == leftSeatList[j].name) {
leftSeatList[j].name = "未设置";
leftSeatList[j].color = "#999";
}
}
for (var j = 0; j < rightSeatList.length; j++) {
if (name == rightSeatList[j].name) {
rightSeatList[j].name = "未设置";
rightSeatList[j].color = "#999";
}
}
if (name == topSeat.name) {
this.setData({
"topSeat.name": "未设置",
"topSeat.color": "#999"
})
}
if (name == bottomSeat.name) {
this.setData({
"bottomSeat.name": "未设置",
"bottomSeat.color": "#999"
})
}
this.setData({
leftSeatList,
rightSeatList
})
this.setData({
"bottomSeat.name":name,
"bottomSeat.color": "#1696db"
});
dd.httpRequest({
url: setSeatUrl,
method: 'POST',
data: {
mid: _this.data.mid,
sid: sid,
seatNumber: _this.data.bottomSeat.num
},
dataType: 'json',
success: function(res) {
// console.log('success----', res)
},
fail: function(res) {
console.log("httpRequestFail---", res)
dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
}
var leftList = ret[1];
for (var i = 0; i < leftList.length;i++){
// console.log("在左部");
// console.log("宽度" + leftList[i].width + "高度" + leftList[i].height);
// console.log("x" + x + "y" + y);
// console.log("这个点x" + leftList[i].x + "这个点y" + leftList[i].y);
if (x < leftList[i].left + leftList[i].width && x > leftList[i].left && y < leftList[i].top + leftList[i].height && y > leftList[i].top ) {
// console.log("在左部");
// console.log("宽度"+leftList[i].width + "高度"+leftList[i].height);
// console.log("x" + x + "y" + y);
// console.log("这个点x" + leftList[i].x + "这个点y" + leftList[i].y);
var name = this.data.drag.name;
var topSeat = this.data.topSeat;
var bottomSeat = this.data.bottomSeat;
var rightSeatList = this.data.rightSeatList;
var leftSeatList = this.data.leftSeatList;
//var rightSeatList = this.data.rightSeatList;
for (var j = 0; j < leftSeatList.length; j++) {
if (name == leftSeatList[j].name) {
leftSeatList[j].name = "未设置";
leftSeatList[j].color = "#999";
}
}
for (var j = 0; j < rightSeatList.length; j++) {
if (name == rightSeatList[j].name) {
rightSeatList[j].name = "未设置";
rightSeatList[j].color = "#999";
}
}
if (name == topSeat.name) {
this.setData({
"topSeat.name": "未设置",
"topSeat.color": "#999"
})
}
if (name == bottomSeat.name) {
this.setData({
"bottomSeat.name": "未设置",
"bottomSeat.color": "#999"
})
}
this.setData({
leftSeatList,
rightSeatList
})
//赋值
leftSeatList[i].name=name;
leftSeatList[i].color = "#1696db";
this.setData({
leftSeatList
})
dd.httpRequest({
url: setSeatUrl,
method: 'POST',
data: {
mid: _this.data.mid,
sid: sid,
seatNumber: leftSeatList[i].num
},
dataType: 'json',
success: function(res) {
// console.log('success----', res)
},
fail: function(res) {
console.log("httpRequestFail---", res)
dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
}
}
var rightList = ret[2];
for (var i = 0; i < rightList.length; i++) {
if (x < rightList[i].left + rightList[i].width && x > rightList[i].left && y < rightList[i].top + rightList[i].height && y > rightList[i].top ) {
// console.log("在右部");
// console.log("宽度" + leftList[i].width + "高度" + leftList[i].height);
// console.log("x" + x + "y" + y);
//console.log("这个点x" + leftList[i].x + "这个点y" + leftList[i].y);
var name = this.data.drag.name;
var topSeat = this.data.topSeat;
var bottomSeat = this.data.bottomSeat;
var rightSeatList = this.data.rightSeatList;
var leftSeatList = this.data.leftSeatList;
//var rightSeatList = this.data.rightSeatList;
for (var j = 0; j < leftSeatList.length; j++) {
if (name == leftSeatList[j].name) {
leftSeatList[j].name = "未设置";
leftSeatList[j].color = "#999";
}
}
for (var j = 0; j < rightSeatList.length; j++) {
if (name == rightSeatList[j].name) {
rightSeatList[j].name = "未设置";
rightSeatList[j].color = "#999";
}
}
if (name == topSeat.name){
this.setData({
"topSeat.name": "未设置",
"topSeat.color": "#999"
})
}
if (name == bottomSeat.name) {
this.setData({
"bottomSeat.name": "未设置",
"bottomSeat.color": "#999"
})
}
this.setData({
leftSeatList
})
rightSeatList[i].name = name;
rightSeatList[i].color = "#1696db";
this.setData({
rightSeatList
})
dd.httpRequest({
url: setSeatUrl,
method: 'POST',
data: {
mid: _this.data.mid,
sid: sid,
seatNumber: rightSeatList[i].num
},
dataType: 'json',
success: function(res) {
// console.log('success----', res)
},
fail: function(res) {
console.log("httpRequestFail---", res)
dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
}
}
if (ret[3]!=null){
if (x < ret[3].left + ret[3].width && x > ret[3].left && y < ret[3].top + ret[3].height && y > ret[3].top ) {
// console.log("在头部");
var name = this.data.drag.name;
var topSeat = this.data.topSeat;
var bottomSeat = this.data.bottomSeat;
var rightSeatList = this.data.rightSeatList;
var leftSeatList = this.data.leftSeatList;
//var rightSeatList = this.data.rightSeatList;
for (var j = 0; j < leftSeatList.length; j++) {
if (name == leftSeatList[j].name) {
leftSeatList[j].name = "未设置";
leftSeatList[j].color = "#999";
}
}
for (var j = 0; j < rightSeatList.length; j++) {
if (name == rightSeatList[j].name) {
rightSeatList[j].name = "未设置";
rightSeatList[j].color = "#999";
}
}
if (name == topSeat.name) {
this.setData({
"topSeat.name": "未设置",
"topSeat.color": "#999"
})
}
if (name == bottomSeat.name) {
this.setData({
"bottomSeat.name": "未设置",
"bottomSeat.color": "#999"
})
}
this.setData({
leftSeatList,
rightSeatList
})
this.setData({
"topSeat.name": name,
"topSeat.color": "#1696db"
})
dd.httpRequest({
url: setSeatUrl,
method: 'POST',
data: {
mid: _this.data.mid,
sid: sid,
seatNumber: _this.data.topSeat.num
},
dataType: 'json',
success: function(res) {
// console.log('success----', res)
},
fail: function(res) {
console.log("httpRequestFail---", res)
dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
}
}
// ret[0].x + ret[0].width ret[0].x - ret[0].width
// ret[0].y + ret[0].height ret[0].y - ret[0].height
}
})
}
_this.setData({
"drag.isSet": false,
});
// console.log("停止" + e);
},
onLoad(query) {
var visitorList = this.data.visitorList;
var _this=this;
// var centerSeatList = this.data.leftSeatList;
var leftSeatList = this.data.leftSeatList;
var rightSeatList = this.data.rightSeatList;
console.log("座位",query.seatNumber)
this.setData({
mid:query.mid,
seatNum: query.seatNumber
});
var seatNum = this.data.seatNum;
dd.httpRequest({
url: getSignListUrl,
method: 'POST',
data: {
mid: query.mid
},
dataType: 'json',
success: function(res) {
visitorList=res.data.result;
_this.setData({
visitorList
});
leftSeatList = [];
rightSeatList = [];
_this.setData({
leftSeatList,
rightSeatList
})
if (seatNum % 2 != 0) {
var bottom = {};
bottom["name"] = "未设置";
bottom["num"] = seatNum;
bottom["color"] = "#999";
_this.setData({
bottomSeat: bottom
});
for (var i = 1; i <= seatNum - 1; i++) {
if (i % 2 == 0) {
var right = {};
right["name"] = "未设置";
right["num"] = i;
right["color"] = "#999";
rightSeatList.push(right);
} else {
var left = {};
left["name"] = "未设置";
left["num"] = i;
left["color"] = "#999";
leftSeatList.push(left);
}
}
_this.setData({ leftSeatList });
_this.setData({ rightSeatList });
// console.log(this.data.leftSeatList);
} else {
var bottom = {};
bottom["name"] = "未设置";
bottom["num"] = seatNum;
bottom["color"] = "#999";
var top = {};
top["name"] = "未设置";
top["num"] = seatNum - 1;
top["color"] = "#999";
for (var j = 0; j < visitorList.length; j++) {
if (visitorList[j].seatNumber == seatNum-1) {
top["name"] = visitorList[j].signName;
top["color"] = "#1696db";
}
if (visitorList[j].seatNumber == seatNum) {
bottom["name"] = visitorList[j].signName;
bottom["color"] = "#1696db";
}
}
_this.setData({
bottomSeat: bottom,
topSeat: top
});
for (var i = 1; i <= seatNum - 2; i++) {
if (i % 2 == 0) {
var right = {};
right["name"] = "未设置";
right["num"] = i;
right["color"] = "#999";
for (var j = 0; j < visitorList.length; j++) {
if (visitorList[j].seatNumber == i) {
right["name"] = visitorList[j].signName;
right["color"] = "#1696db";
}
}
rightSeatList.push(right);
} else {
var left = {};
left["name"] = "未设置";
left["num"] = i;
left["color"] = "#999";
for (var j = 0; j < visitorList.length; j++) {
if (visitorList[j].seatNumber == i) {
left["name"] = visitorList[j].signName;
left["color"] = "#1696db";
}
}
leftSeatList.push(left);
}
}
_this.setData({ leftSeatList });
_this.setData({ rightSeatList });
// console.log(this.data.leftSeatList);
}
},
fail: function(res) {
console.log("httpRequestFail---", res)
dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
// for(var i=0;i<16;i++){
// var visitor={};
// visitor["name"]="张三三三三三"+i;
// visitorList.push(visitor);
// }
// this.setData({
// visitorList
// });
// 页面加载
},
onReady() {
// 页面加载完成
},
onShow() {
// 页面显示
},
onHide() {
// 页面隐藏
},
onUnload() {
// 页面被关闭
},
onTitleClick() {
// 标题被点击
},
onPullDownRefresh() {
// 页面被下拉
},
onReachBottom() {
// 页面被拉到底部
},
onShareAppMessage() {
// 返回自定义分享信息
},
viewTap() {
// 事件处理
this.setData({
text: 'Set data for update.'
})
},
go() {
// 带参数的跳转,从 page/index 的 onLoad 函数的 query 中读取 xx
// dd.navigateTo({ url: '/page/index?xx=1' })
},
})
\ No newline at end of file
{
"defaultTitle": "座位安排"
}
\ No newline at end of file
page{
background: #fff;
color: #555;
}
.vi_bg{
background: #fff;
padding: 30rpx 0;
}
.vi_search{
width: 600rpx;
height: 60rpx;
line-height: 60rpx;
background: #eee;
border-radius: 30rpx;
margin-left: 8%;
}
.vi_search image{
width: 40rpx;
height: 40rpx;
margin: 10rpx 30rpx;
}
.department-scroll{
padding-bottom: 140rpx;
}
.vi_search input{
position: absolute;
width: 420rpx;
height: 60rpx;
line-height: 60rpx;
color: #555;
font-size:35rpx;
background: none;
}
.item-avatar-xs-a{
padding: 30rpx 30rpx;
border-bottom: 1rpx solid #eee;
cursor: pointer;
background: #fff;
position:relative;
}
.left{
position: absolute;
margin-left: 600rpx;
margin-top: -40rpx;
}
.item-avatar-xs2{
display: flex;
padding: 20rpx 100rpx;
border-bottom: 1rpx solid #eee;
cursor: pointer;
position:relative;
}
.item-avatar-xs-a image{
width: 32rpx;
height: 32rpx;
margin-left: 520rpx;
position: relative;
top: -40rpx;
}
.flex_start{
width: 400rpx;
}
.flex_start icon{
position: absolute;
margin-top: -5rpx;
}
.flex_start text{
font-size: 34rpx;
margin-left: 70rpx;
}
checkbox{
-webkit-appearance: none;
border-radius: 50%;
width: 40rpx;
height: 40rpx;
border:1px solid #ccc;
background: #fff;
}
.depaertment{
width: 90%;
height: 40rpx;
line-height: 40rpx;
float: right;
}
.item-avatar-xs3{
width: 100%;
margin-top: 0.4rem;
}
.item-avatar-xs4{
width: 100%;
height: 100rpx;
line-height: 100rpx;
border-bottom: 1px dotted #eee;
}
.li {
padding-left: 100rpx;
display: flex;
font-size: 34rpx;
width: 87%;
height: 100rpx;
line-height: 100rpx;
}
.item-avatar-xs4:last-child{
border-bottom: none;
}
.li checkbox{
-webkit-appearance: none;
border-radius: 50%;
width: 40rpx;
height: 40rpx;
border: 1px solid rgb(204, 204, 204);
background: rgb(255, 255, 255);
margin-top: 30rpx;
}
.checkbox-text{
width: 160rpx;
margin-left: 20rpx;
}
.vi_btm{
width: 89.5%;
position: fixed;
background: #fff;
padding: 40rpx 30rpx;
bottom: 0rpx;
border: 1rpx solid #eee;
}
.vi_btm text{
line-height: 40rpx;
font-size: 30rpx;
}
.vi_btm button{
background: #156EF3;
color: #fff;
margin-left: 360rpx;
position: absolute;
margin-top: -10rpx;
}
.check_box{
margin-bottom: 120rpx;
}
.de_btn{
width: 98%;
position: fixed;
background: #fff;
bottom: 0rpx;
}
.de_btn2{
width: 96%;
background: #156EF3;
color: #fff;
margin: 20rpx auto;
}
\ No newline at end of file
<view class="page">
<view class='vi_bg'>
<view class='vi_search'>
<image src='../../../resource/images/search2.png' />
<input type='text' onConfirm="search" placeholder='请输入参会人员名称' />
</view>
</view>
<view class="graySpace"></view>
<scroll-view class="department-scroll" scroll-y="{{true}}">
<view class='item-avatar-xs-a'>
<view onTap='select_all' class='flex_start'>
<icon type="success" color="{{selectall.color}}" size="22" />
<text>{{selectall.text}}</text>
</view>
</view>
<checkbox-group>
<view class='item-avatar-xs-a' a:for="{{departmentList}}" a:for-item="department" a:for-index="dIndex" >
<checkbox onChange="selected" data-index="{{dIndex}}" value="{{department.departmentName}},{{department.departmentId}}" checked="{{department.checked}}" />
<view class="depaertment" data-index="{{dIndex}}" onTap='changeToggle'>
<text class="checkbox-text">{{department.departmentName}}</text>
<image src="{{department.isColpand?'../../../resource/images/bottom.png':'../../../resource/images/left.png'}}"></image>
</view>
<view class="item-avatar-xs3" id="item-{{department.departmentId}}" hidden="{{!department.isColpand}}">
<view class="item-avatar-xs4" a:for="{{department.uList}}" a:for-item="u" a:for-index="index" value="{{index}}" >
<view class="li">
<checkbox data-d-index="{{dIndex}}" onChange="single_selected" data-u-index="{{index}}" value="{{objectArray[array]}}" checked="{{u.checked}}" />
{{u.nickname}}
</view>
</view>
</view>
</view>
</checkbox-group>
</scroll-view>
<view class='de_btn'>
<button class='de_btn2' >确定</button>
</view>
<view class='de_btn'>
<!-- <text>已选择:人 </text> -->
<button class='de_btn2' onTap="addInSign" >确定</button>
</view>
\ No newline at end of file
let app = getApp();
//替换成开发者后台设置的安全域名
let domain = app.globalData.domain;
let getDepartmentUrl = domain + "/dingding/getDepartment";
let addInSignUrl = domain + "/dingding/addInSign";
let getInSignUrl = domain +"/dingding/getInSign";
Page({
data: {
departmentList: [
// { name: "工程部", id: 0, employeeList: [{ name: "张三", checked: false }, { name: "李四", checked: false }],isColpand:false ,checked:false},
// { name: "市场部", id: 1, employeeList: [{ name: "张三", checked: false }, { name: "李四", checked: false }], isColpand: false, checked: false},
// { name: "销售部", id: 2, employeeList: [{ name: "张三", checked: false }, { name: "李四", checked: false }], isColpand: false, checked: false }
],
selectall:{
checked:false,
color:"#ccc",
text:"全选"
},
mid:null,
cnum:null
},
search:function(e){
},
select_all:function(e){
if (!this.data.selectall.checked){
var departmentList = this.data.departmentList;
for (var i = 0; i < departmentList.length; i++) {
departmentList[i].checked = true;
for (var j = 0; j < departmentList[i].uList.length; j++) {
departmentList[i].uList[j].checked = true;
}
}
this.setData({
"selectall.text": "取消全选",
"selectall.color": "#156EF3",
"selectall.checked": true,
departmentList
});
}else {
var departmentList = this.data.departmentList;
for (var i = 0; i < departmentList.length; i++) {
departmentList[i].checked = false;
for (var j = 0; j < departmentList[i].uList.length; j++) {
departmentList[i].uList[j].checked = false;
}
}
this.setData({
"selectall.text": "全选",
"selectall.color": "#ccc",
"selectall.checked": false,
departmentList
});
}
},
selected:function(e){
const index = e.currentTarget.dataset.index;
var departmentList= this.data.departmentList
var department = departmentList[index];
if (!department.checked) {
for (var i = 0; i < department.uList.length;i++){
department.uList[i].checked = true;
}
department.checked = true;
} else {
for (var i = 0; i < department.uList.length; i++) {
department.uList[i].checked = false;
}
department.checked = false;
}
this.setData({
departmentList
})
},
single_selected:function(e){
const dIndex = e.currentTarget.dataset.dIndex;
const uIndex = e.currentTarget.dataset.uIndex;
var departmentList = this.data.departmentList
var department = departmentList[dIndex];
if (!department.uList[uIndex].checked) {
department.uList[uIndex].checked = true;
} else {
department.uList[uIndex].checked = false;
}
},
addInSign:function(e){
var departmentList= this.data.departmentList;
var uidList=[];
for (var i=0;i<departmentList.length;i++){
for (var j = 0; j < departmentList[i].uList.length;j++){
if (departmentList[i].uList[j].checked==true){
uidList.push(departmentList[i].uList[j].id);
}
}
}
console.log(uidList)
var _this = this;
if (uidList.length!=0){
dd.httpRequest({
url: addInSignUrl,
method: 'POST',
data: {
mid: _this.data.mid,
uidList: uidList
},
dataType: 'json',
success: function(res) {
// console.log('success----', res)
if (res.data.success) {
//console.log("预定成功");
// const index = e.currentTarget.dataset.index;
// var employeeList = _this.data.employeeList;
// employeeList = remove(employeeList, index);
// _this.setData({
// employeeList
// })
dd.alert({
title: '添加成功',
content: '添加成功',
buttonText: '确定',
success: () => {
dd.navigateBack({
delta: 1
})
},
});
} else {
dd.showToast({
type: 'fail',
content: res.data.message,
duration: 3000,
success: () => {
// dd.navigateTo({
// url: '../index/index'
// });
},
});
}
},
fail: function(res) {
console.log("httpRequestFail---", res)
dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
}
},
// 展开折叠选择
changeToggle: function(e) {
const index = e.currentTarget.dataset.index;
// console.log(index)
console.log(this.data.departmentList[index]);
if (this.data.departmentList[index].isColpand) {
const departmentList = this.data.departmentList;
departmentList[index].isColpand=false;
this.setData({ departmentList });
} else {
const departmentList = this.data.departmentList;
departmentList[index].isColpand = true;
this.setData({ departmentList });
}
},
// selectall:function(){
// if(this.data.departmentList[i].checked=(!this.data.selectall)){
// }
// },
onLoad: function(query) {
// 生命周期函数--监听页面加载
var _this = this;
var userId = app.globalData.userId
this.setData({
mid:query.mid,
cnum:query.cnum
})
dd.httpRequest({
url: getDepartmentUrl,
method: 'POST',
data: {
userId: userId,
},
dataType: 'json',
success: function(res) {
// console.log('success----', res)
if (res.data.success) {
//console.log("预定成功");
// const index = e.currentTarget.dataset.index;
// var employeeList = _this.data.employeeList;
// employeeList = remove(employeeList, index);
// _this.setData({
// employeeList
// })
var departmentList = _this.data.departmentList;
departmentList = res.data.result;
for (var i = 0; i<departmentList.length;i++){
departmentList[i]['isColpand']=false;
departmentList[i]['checked'] = false;
for (var j = 0; j < departmentList[i].uList.length;j++){
departmentList[i].uList[j]['checked']=false;
}
}
_this.setData({
departmentList
})
console.log(departmentList);
dd.httpRequest({
url: getInSignUrl,
method: 'POST',
data: {
mid: _this.data.mid,
},
dataType: 'json',
success: function(res) {
// console.log('success----', res)
if (res.data.success) {
//console.log("预定成功");
// const index = e.currentTarget.dataset.index;
// var employeeList = _this.data.employeeList;
// employeeList = remove(employeeList, index);
// _this.setData({
// employeeList
// })
var departmentList = _this.data.departmentList;
var signList = res.data.result;
for (var i = 0; i < departmentList.length; i++) {
for (var j = 0; j < departmentList[i].uList.length; j++) {
for (var k = 0; k < signList.length; k++) {
if (departmentList[i].uList[j].id == signList[k].uid) {
departmentList[i].uList[j].checked = true;
departmentList[i].isColpand=true;
}
}
}
}
_this.setData({
departmentList
})
console.log(departmentList);
} else {
dd.showToast({
type: 'fail',
content: res.data.message,
duration: 3000,
success: () => {
// dd.navigateTo({
// url: '../index/index'
// });
},
});
}
},
fail: function(res) {
console.log("httpRequestFail---", res)
dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
} else {
dd.showToast({
type: 'fail',
content: res.data.message,
duration: 3000,
success: () => {
// dd.navigateTo({
// url: '../index/index'
// });
},
});
}
},
fail: function(res) {
console.log("httpRequestFail---", res)
dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
},
onReady() {
// 页面加载完成
},
onShow() {
// 页面显示
},
onHide() {
// 页面隐藏
},
onUnload() {
// 页面被关闭
},
onTitleClick() {
// 标题被点击
},
onPullDownRefresh() {
// 页面被下拉
},
onReachBottom() {
// 页面被拉到底部
},
onShareAppMessage() {
// 返回自定义分享信息
return {
title: 'My App',
desc: 'My App description',
path: 'pages/index/index',
};
},
});
{
"defaultTitle": "选择参与人员",
"pullRefresh": false
}
\ No newline at end of file
.logo-a{
width: 100%;
display: flex;
justify-content: space-around;
}
.logo{
width: 200rpx;
height: 200rpx;
margin-top: 100rpx;
}
.yz{
width: 98%;
height: auto;
margin: 40rpx auto;
position: relative;
}
.iphone{
width: 100%;
height: 90rpx;
line-height: 90rpx;
background: #fff;
border-radius: 10rpx;
margin-top: 20rpx;
}
.image{
width:80rpx;
height: 80rpx;
margin-top: 15rpx;
}
.number{
width: 80%;
height: 60rpx;
line-height: 60rpx;
position: absolute;
margin-top: 20rpx;
}
.iphone-a{
width: 100%;
height: 100rpx;
line-height: 100rpx;
border-radius: 10rpx;
margin-top: 20rpx;
position: relative;
}
.iphone-c{
width: 60%;
height: 90rpx;
line-height: 90rpx;
background: #fff;
border: 1px solid #eee;
}
.ver{
width: 45%;
height: 60rpx;
line-height: 60rpx;
position: absolute;
margin-top: 20rpx;
}
.btn{
width: 35%;
float: right;
margin-top: -95rpx;
}
.btn::after{
border: 0;
background: #999;
}
.login{
margin-top: 40rpx;
}
\ No newline at end of file
<view class="page">
<view class="logo-a">
<image class="logo" src="../../resource/images/logo.png" />
</view>
<form onSubmit="submitForm" onReset="">
<view class="yz">
<view class="iphone">
<image class="image" src="../../resource/images/iPhone.png" mode="" />
<input class="number" type="text" onInput="setPhone" name="phonetel" placeholder="请输入手机号码" />
</view>
<view class="iphone-a">
<view class="iphone-c">
<image class="image" src="../../resource/images/yz.png" mode="" />
<input class="ver" type="text" placeholder="请输入验证码" name="code" />
</view>
<button class="btn" type="default" disabled='{{disabled}}' onTap="btnTap">{{time}}</button>
</view>
<button class="login" form-type="submit" type="primary">登录</button>
</view>
</form>
</view>
\ No newline at end of file
let app = getApp();
//替换成开发者后台设置的安全域名
let domain = app.globalData.domain;
//获取用户信息的url
let codeUrl = domain + "/dingding/sendcode";
let bindsUrl = domain + "/dingding/binds";
Page({
data:{
time:'获取验证码',
currentTime:60,
phone:""
},
setPhone:function(e){
// console.log("电话是", e.detail.value)
this.setData({
phone:e.detail.value
})
},
submitForm:function (e){
var userId = app.globalData.userId;
//console.log(e.detail.value.phonetel);
dd.httpRequest({
url: bindsUrl,
method: 'POST',
data: {
phonetel: e.detail.value.phonetel,
code: e.detail.value.code,
userId:userId
},
dataType: 'json',
success: function(res) {
console.log( res);
console.log('success----', res);
if( res.data.success){
dd.alert({
title: '绑定成功',
content: '绑定成功',
buttonText: '确定',
success: () => {
dd.reLaunch({
url: '../conference/index/index'
});
},
});
}else {
dd.alert({
title: '绑定失败',
content: res.data.message,
buttonText: '确定',
success: () => {
dd.reLaunch({
url: '.'
});
},
});
}
// _this.setData({
// conferenceList: res.data.result
// })
},
fail: function(res) {
console.log("httpRequestFail---", res)
dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
},
getCode: function(options) {
var that = this;
var currentTime = that.data.currentTime;
var interval;
interval = setInterval(function() {
currentTime--;
that.setData({
time: currentTime + '秒'
})
if (currentTime <= 0) {
clearInterval(interval);
that.setData({
time: '重新获取',
currentTime: 60,
disabled: false
})
}
}, 1000);
dd.httpRequest({
url: codeUrl,
method: 'POST',
data: {
phone: that.data.phone
},
dataType: 'json',
success: function(res) {
console.log('success----', res)
// _this.setData({
// conferenceList: res.data.result
// })
},
fail: function(res) {
console.log("httpRequestFail---", res)
dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
},
btnTap() {
this.getCode();
var that = this;
that.setData({
disabled: true
});
},
onLoad(query) {
// 页面加载
console.info(`Page onLoad with query: ${JSON.stringify(query)}`);
},
onReady() {
// 页面加载完成
},
onShow() {
// 页面显示
},
onHide() {
// 页面隐藏
},
onUnload() {
// 页面被关闭
},
onTitleClick() {
// 标题被点击
},
onPullDownRefresh() {
// 页面被下拉
},
onReachBottom() {
// 页面被拉到底部
},
onShareAppMessage() {
// 返回自定义分享信息
// return {
// title: 'My App',
// desc: 'My App description',
// path: 'pages/index/index',
// };
},
});
{"defaultTitle": "登录"}
\ No newline at end of file
.list{
width: 99%;
height: auto;
margin: 0 auto;
border: 1px solid #ccc;
margin-top: 10rpx;
}
.row{
width: 100%;
height: 80rpx;
line-height: 80rpx;
border-bottom: 1px solid #ccc;
}
.row label{
/* height: 80rpx; */
line-height: 80rpx;
display: inline-block;
text-align: center;
border-left: 1px solid #ccc;
}
<view class="page">
<form onSubmit="" onReset="">
<view class="list">
<!-- <view class="row">
<label style="width:30%">ID</label>
<label style="width:68%">2018-0830102540264</label>
</view> -->
<view class="row">
<label style="width:30%" >会议名称</label>
<label style="width:68%">{{message.messageName}}</label>
</view>
<view class="row">
<label style="width:30%">会议室名称</label>
<label style="width:68%">{{message.conferenceName}}</label>
</view>
<view class="row">
<label style="width:30%">主持人</label>
<label style="width:68%">{{message.messageCompere}}</label>
</view>
<view class="row">
<label style="width:30%">会议议题</label>
<label style="width:68%">{{message.messageName}}</label>
</view>
<view class="row">
<label style="width:30%">会议开始时间</label>
<label style="width:68%">{{message.startTime}}</label>
</view>
<view class="row">
<label style="width:30%">会议结束时间</label>
<label style="width:68%">{{message.endTime}}</label>
</view>
<view class="row">
<label style="width:30%">部门</label>
<label style="width:68%">{{message.department}}</label>
</view>
<view class="row">
<label style="width:30%">会议内容</label>
<label style="width:68%">{{message.messageContent}}</label>
</view>
<view class="row">
<label style="width:30%">会议状态</label>
<label style="width:68%">{{message.configValueIdString}}</label>
</view>
</view>
</form>
</view>
\ No newline at end of file
Page({
data: {
message:null
},
onReady() {
// 页面加载完成
},
onLoad:function(query){
var message={};
message['messageName']=query.messageName;
message['conferenceName'] = query.conferenceName;
message['messageCompere'] = query.messageCompere;
message['startTime'] = query.startTime;
message['endTime'] = query.endTime;
message['department'] = query.department;
message['messageContent'] = query.messageContent;
message['configValueIdString'] = query.configValueIdString;
this.setData({
message
})
},
onShow() {
},
onHide() {
// 页面隐藏
},
onUnload() {
// 页面被关闭
},
onTitleClick() {
// 标题被点击
},
onPullDownRefresh() {
// 页面被下拉
},
onReachBottom() {
// 页面被拉到底部
},
onShareAppMessage() {
// 返回自定义分享信息
},
});
{
"defaultTitle": "详细信息"
}
\ No newline at end of file
page{
background: #F1F1F1;
}
.tab{
float: left;
width: 50%;
height: 60rpx;
line-height: 60rpx;
text-align: center;
padding: 10rpx 0;
background: #fff;
margin-top: 10rpx;
}
.topTabSwiper{
/* margin-top: 15rpx; */
zoom: 1;
}
.topTabSwiper:after{
content: "";
clear: both;
display: block;
}
.tabBorer{
border-bottom: 1px solid #156EF3;
color: #156EF3;
}
.swiper-item{
height: 100%;
}
.swiper{
width: 100%;
height: 100%;
}
::-webkit-scrollbar{
width: 0;
height: 0;
color: transparent;
}
.swiper_con{
text-align: center;
width: 100%;
height: 100%;
/* margin-top: 20rpx; */
}
.de_bg{
background: #fff;
margin-top: 20rpx;
padding: 16rpx;
}
.tr{
width: 100%;
font-size: 26rpx;
padding: 10rpx;
display: flex;
justify-content: space-between;
}
.td{
width: 100%;
text-align: left;
}
.btn text{
font-size: 26rpx;
position: relative;
top: -15rpx;
}
/* .td button{
margin-left: 140rpx;
margin-top: 5rpx;
} */
.box1 .dateBox{
width: 100%;
height: 70rpx;
line-height: 70rpx;
text-align: center;
margin-top: 10rpx;
font-size: 36rpx;
color: #fff;
background: #156EF3;
}
.box1{
width: 714rpx;
display: flex;
flex-wrap: wrap;
margin: 0 auto;
/* border: 1rpx solid #eee; */
background: #fff;
}
.week{
width: 102rpx;
background: #156EF3;
color: #fff;
}
.box1>view{
height: 60rpx;
line-height: 50rpx;
text-align: center;
font-size: 26rpx;
}
.dateOn{
border-radius: 50%;
background-color: #156EF3;
color: #fff;
}
.btn1{
margin-left: 15rpx;
margin-top: 5rpx;
}
.btn2{
margin-left: 120rpx;
}
.add_bg{
width: auto;
height: 60rpx;
line-height: 60rpx;
text-align: center;
background: #156EF3;
color: #fff;
}
\ No newline at end of file
<view class="page">
<!-- <view bindtouchstart="touchStart" bindtouchend="touchEnd">
<view class='box1'>
<view class='dateBox'>{{ year }} - {{ month}}</view>
<block wx:for='{{ weekArr }}'>
<view class='week' style='width:100%/7rpx'>{{ item }}</view>
</block>
<block wx:for='{{ arr }}'>
<view style='width:102rpx; height:102rpx; line-height:102rpx; margin-top:4rpx;' class='{{ item == getDate ? "dateOn" : ""}} {{font==1?item>7?"font-color":"":font==2?item
<7?"font-color":"":"" }}'>{{ item }}
</view>
</block>
</view>
</view> -->
<view class='add_bg'>
<!-- <picker mode="date" onChange="bindDateChange">
<text class="picker">日期: {{dates}}</text>
</picker> -->
<text onTap="datePicker">日期:{{dates}}</text>
</view>
<view class='topTabSwiper'>
<view class='tab {{currentData == 0 ? "tabBorer" : ""}}' data-current = "0" onTap='checkCurrent'>我的预定</view>
<view class='tab {{currentData == 1 ? "tabBorer" : ""}}' data-current = "1" onTap='checkCurrent'>我的日程</view>
</view>
<swiper current="{{currentData}}" class='swiper' onChange="TabSwiper">
<swiper-item class="swiper-item">
<scroll-view class='swiper_con' scroll-y="{{true}}" onScrollToUpper="upper" onScrollToLower="lower" onScroll="scroll" scroll-into-view="{{toView}}" scroll-top="{{scrollTop}}">
<view class='de_bg' a:for="{{messageList}}" a:for-item="message">
<view>
<view class="tr">
<view class="td td1">会议名称:{{message.messageName}}</view>
<view class="td td2">主持人:{{message.messageCompere}}</view>
</view>
<view class="tr">
<view class="td td1">会议时间:{{message.startTimeFormat}} - {{message.endTimeFormat}}</view>
<view class="td td2">会议范围:{{message.department}}</view>
</view>
<view class="tr btn">
<view class="td td1">
<text>会议操作:</text>
<button class="btn1" size='mini' type='primary' data-mid="{{message.messageId}}" onTap="modify">修改会议</button>
<button class="btn2" size='mini' type='warn' data-mid="{{message.messageId}}" onTap="cancelmeeting">取消会议</button>
</view>
</view>
<view class="tr">
<view class="td td2">地点:{{message.conference.conferenceName}}</view>
</view>
</view>
</view>
</scroll-view>
</swiper-item>
<swiper-item>
<scroll-view class='swiper_con' scroll-y="{{true}}" onScrollToUpper="upper" onScrollToLower="lower" onScroll="scroll" scroll-into-view="{{toView}}" scroll-top="{{scrollTop}}">
<view class='de_bg' a:for="{{mymessageList}}" a:for-item="mymessage">
<view class="table">
<view class="tr">
<view class="td td1">会议名称:{{mymessage.messageName}}</view>
<view class="td td2">主持人:{{mymessage.messageCompere}}</view>
</view>
<view class="tr">
<view class="td td1">会议时间:{{mymessage.startTimeFormat}} - {{mymessage.endTimeFormat}}</view>
<view class="td td2">会议范围:{{mymessage.department}}</view>
</view>
<view class="tr btn">
<view class="td td1">
<text>会议操作:</text>
<button class="btn1" a:if="{{mymessage.configValueId == 4}}" size='mini' type='warn'>已结束</button>
<button class="btn1" a:if="{{mymessage.configValueId == 1}}" size='mini' type='primary'>正在会议</button>
<button class="btn1" a:if="{{mymessage.configValueId == 3}}" size='mini' type='warn'>暂停</button>
<button class="btn1" a:if="{{mymessage.configValueId == 2}}" size='mini' type='default'>未开始</button>
<button class="btn2" size='mini' data-date="{{dates}}" data-conference-name="{{mymessage.conference.conferenceName}}" data-mid="{{mymessage.messageId}}" type='primary' onTap="meetjy">会议纪要</button>
</view>
</view>
<view class="tr">
<view class="td td2" >地点:{{mymessage.conference.conferenceName}}</view>
</view>
</view>
</view>
</scroll-view>
</swiper-item>
</swiper>
</view>
\ No newline at end of file
let app = getApp();
//替换成开发者后台设置的安全域名
let domain = app.globalData.domain;
//获取用户信息的url
let mymessageUrl = domain + "/dingding/mymessage";
let myscheduleUrl = domain +"/dingding/myschedule";
let canclemeetingUrl = domain + "/dingding/canclemeeting";
var time = 0;
var touchDot = 0;//触摸时的原点
var interval = "";
var flag_hd = true;
Page({
data: {
font: "",
arr: [],
screenHeight: 0,
screenWidth: 0,
text: "没有滑动",
currentData: 0,
winHeight: "",//窗口高度
dates: dateFtt("yyyy-MM-dd", new Date()),
messsageList:[],
mymessageList:[]
},
// 点击时间组件确定事件
bindDateChange(e) {
this.setData({
dates: e.detail.value
})
},
onLoad: function(options) {
var that = this;
//高度自适应
var userId= app.globalData.userId;
dd.getSystemInfo({
success: function(res) {
var clientHeight = res.windowHeight,
clientWidth = res.windowWidth,
rpxR = 750 / clientWidth;
var calc = clientHeight * rpxR - 180;
//console.log(calc)
that.setData({
winHeight: calc
});
}
});
},
TabSwiper: function(e) {
const that = this;
that.setData({
currentData: e.detail.current
})
},
//点击切换,滑块index赋值
checkCurrent: function(e) {
const that = this;
if (that.data.currentData === e.target.dataset.current) {
return false;
} else {
that.setData({
currentData: e.target.dataset.current
})
}
},
meetjy: function(e){
var mid = e.currentTarget.dataset.mid;
console.log("conferenceName", e.currentTarget.dataset.conferenceName);
dd.navigateTo({
url: '../summary/summary?mid=' + mid + '&conferenceName=' + e.currentTarget.dataset.conferenceName + "&date=" + e.currentTarget.dataset.date
})
},
onReady() {
// 页面加载完成
},
onShow() {
// 页面显示
var that = this;
var userId = app.globalData.userId;
dd.httpRequest({
url: mymessageUrl,
method: 'POST',
data: {
userId: userId,
date: that.data.dates
},
dataType: 'json',
success: function(res) {
console.log('success----', res)
var messageList = that.data.messageList;
messageList= res.data.result;
that.setData({
messageList
});
console.log(that.data.messageList);
},
fail: function(res) {
console.log("httpRequestFail---", res)
// dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
dd.httpRequest({
url: myscheduleUrl,
method: 'POST',
data: {
userId: userId,
date: that.data.dates
},
dataType: 'json',
success: function(res) {
console.log('success----', res)
var mymessageList = that.data.mymessageList;
mymessageList = res.data.result;
that.setData({
mymessageList
});
console.log(that.data.mymessageList);
},
fail: function(res) {
console.log("httpRequestFail---", res)
// dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
flag_hd = true; //重新进入页面之后,可以再次执行滑动切换页面代码
clearInterval(interval); // 清除setInterval
time = 0;
},
touchStart: function(e) {
touchDot = e.touches[0].pageX; // 获取触摸时的原点
// 使用js计时器记录时间
interval = setInterval(function() {
time++;
}, 100);
},
// 触摸结束事件
touchEnd: function(e) {
var touchMove = e.changedTouches[0].pageX;
// 向左滑动
if (touchMove - touchDot <= -20 && time < 10) {
//执行切换页面的方法
//console.log('left');
this.next()
}
// 向右滑动
if (touchMove - touchDot >= 20 && time < 10) {
//执行切换页面的方法
// console.log('right');
this.last()
}
clearInterval(interval); // 清除setInterval
time = 0;
},
modify:function(e){
dd.navigateTo({
url: '../../conference/modifymeeting/modifymeeting?mid='+e.currentTarget.dataset.mid
})
},
cancelmeeting:function (e){
// dd.alert({
// title: '取消成功',
// content: '取消成功',
// buttonText: '确定',
// success: () => {
// dd.reLaunch({
// url: '../record/record'
// });
// },
// });
var mid= e.currentTarget.dataset.mid;
dd.httpRequest({
url: canclemeetingUrl,
method: 'POST',
data: {
mid: mid
},
dataType: 'json',
success: function(res) {
console.log('success----', res);
if(res.data.success){
dd.alert({
title: '取消成功',
content: '取消成功',
buttonText: '确定',
success: () => {
dd.reLaunch({
url: '../record/record'
});
},
});
}
},
fail: function(res) {
console.log("httpRequestFail---", res)
// dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
},
datePicker() {
var that = this;
dd.datePicker({
success: (res) => {
that.setData({
dates: res.date
});
var userId = app.globalData.userId;
dd.httpRequest({
url: mymessageUrl,
method: 'POST',
data: {
userId: userId,
date: that.data.dates
},
dataType: 'json',
success: function(res) {
console.log('success----', res)
var messageList = that.data.messageList;
messageList = res.data.result;
that.setData({
messageList
});
console.log(that.data.messageList);
},
fail: function(res) {
console.log("httpRequestFail---", res)
// dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
dd.httpRequest({
url: myscheduleUrl,
method: 'POST',
data: {
userId: userId,
date: that.data.dates
},
dataType: 'json',
success: function(res) {
console.log('success----', res)
var mymessageList = that.data.mymessageList;
mymessageList = res.data.result;
that.setData({
mymessageList
});
console.log(that.data.mymessageList);
},
fail: function(res) {
console.log("httpRequestFail---", res)
// dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
},
})
},
onHide() {
// 页面隐藏
},
onUnload() {
// 页面被关闭
},
onTitleClick() {
// 标题被点击
},
onPullDownRefresh() {
// 页面被下拉
},
onReachBottom() {
// 页面被拉到底部
},
onShareAppMessage() {
// 返回自定义分享信息
},
});
function dateFtt(fmt, date) { //author: meizz
var o = {
"M+": date.getMonth() + 1, //月份
"d+": date.getDate(), //日
"h+": date.getHours(), //小时
"m+": date.getMinutes(), //分
"s+": date.getSeconds(), //秒
"q+": Math.floor((date.getMonth() + 3) / 3), //季度
"S": date.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt))
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
for (var k in o)
if (new RegExp("(" + k + ")").test(fmt))
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
return fmt;
}
\ No newline at end of file
{"defaultTitle": "我的会议"}
\ No newline at end of file
page{
background: #F1F1F1;
}
.swiper_con{
text-align: center;
width: 100%;
height: 98%;
/* margin-top: 20rpx; */
}
.de_bg{
background: #fff;
margin-top: 20rpx;
padding: 16rpx;
}
.tr{
width: 100%;
font-size: 26rpx;
padding: 10rpx;
display: flex;
justify-content: space-between;
}
.td{
width: 100%;
text-align: left;
}
.btn text{
font-size: 26rpx;
position: relative;
top: -15rpx;
}
.btn1{
margin-left: 15rpx;
margin-top: 5rpx;
}
.btn3{
margin-left: 60rpx;
}
.btn2{
margin-left: 60rpx;
}
.add_bg{
width: auto;
height: 60rpx;
line-height: 60rpx;
text-align: center;
background: #156EF3;
color: #fff;
}
\ No newline at end of file
<view class="page">
<view class='add_bg'>
<picker mode="date" onChange="bindDateChange">
<text class="picker">日期: {{dates}}</text>
</picker>
</view>
<scroll-view class='swiper_con' scroll-y="{{true}}" onScrollToUpper="upper" onScrollToLower="lower" onScroll="scroll" scroll-into-view="{{toView}}" scroll-top="{{scrollTop}}">
<view class='de_bg' a:for="{{historyList}}" a:for-item="history">
<view>
<view class="tr">
<view class="td td1">会议名称:{{history.messageName}}</view>
<view class="td td2">发起人:{{history.messageCompere}}</view>
</view>
<view class="tr">
<view class="td td1">会议时间:{{history.startTimeFormat}} - {{history.endTimeFormat}}</view>
<view class="td td2">会议范围:{{history.department}}</view>
</view>
<view class="tr">
<view class="td td2">地点:{{history.conference.conferenceName}}</view>
</view>
<view class="tr btn">
<view class="td td1">
<text>会议操作:</text>
<button class="btn1" size='mini' data-mid="{{history.messageId}}" type='primary' onTap="summary">会议纪要</button>
<button class="btn3" size='mini' data-message-name="{{history.messageName}}" data-conference-name="{{history.conference.conferenceName}}"
data-message-compere="{{history.messageCompere}}" data-start-time="{{history.startTimeFormat}}" data-end-time="{{history.endTimeFormat}}"
data-department="{{history.department}}" data-message-content="{{history.messageContent}}" data-config-value-id-string="{{history.configValueIdString}}" type='default' onTap="details">详细信息</button>
<button class="btn2" size='mini' type='default' data-cnum="{{history.conference.conferenceNumber}}" onTap="destine">再次预定</button>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
\ No newline at end of file
let app=getApp();
//替换成开发者后台设置的安全域名
let domain = app.globalData.domain;
let myhistoryUrl = domain + "/dingding/myhistory";
Page({
data: {
dates: null,
historyList:[]
},
// 点击时间组件确定事件
bindDateChange(e) {
this.setData({
dates: e.detail.value
})
var that = this;
var userId = app.globalData.userId;
dd.httpRequest({
url: myhistoryUrl,
method: 'POST',
data: {
userId: userId,
date: that.data.dates
},
dataType: 'json',
success: function(res) {
console.log('success----历史记录', res)
var historyList = that.data.historyList;
historyList = res.data.result;
that.setData({
historyList
});
console.log(that.data.historyList);
},
fail: function(res) {
console.log("httpRequestFail---", res)
// dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
},
summary(e){
var mid= e.currentTarget.dataset.mid;
console.log(e)
dd.navigateTo({
url: '/pages/meeting/summary/summary?mid='+mid ,
type:'redirect'
})
},
destine(e){
var cnum = e.currentTarget.dataset.cnum;
dd.navigateTo({
url: '/pages/conference/addmeeting/addmeeting?cnum=' + cnum
})
},
details(e){
console.log(e.currentTarget.dataset.messageName);
dd.navigateTo({
url: '/pages/meeting/details/details?messageName=' + e.currentTarget.dataset.messageName + '&conferenceName=' + e.currentTarget.dataset.conferenceName + "&messageCompere=" + e.currentTarget.dataset.messageCompere + "&startTime=" + e.currentTarget.dataset.startTime + "&endTime=" + e.currentTarget.dataset.endTime + "&department=" + e.currentTarget.dataset.department + "&messageContent=" + e.currentTarget.dataset.messageContent + "&configValueIdString=" + e.currentTarget.dataset.configValueIdString
})
},
onLoad: function(options) {
var that = this;
//高度自适应
var userId = app.globalData.userId;
},
onReady() {
// 页面加载完成
},
onShow() {
var that = this;
var userId = app.globalData.userId;
dd.httpRequest({
url: myhistoryUrl,
method: 'POST',
data: {
userId: userId,
date: that.data.dates
},
dataType: 'json',
success: function(res) {
console.log('success----历史记录', res)
var historyList = that.data.historyList;
historyList = res.data.result;
that.setData({
historyList
});
console.log(that.data.historyList);
},
fail: function(res) {
console.log("httpRequestFail---", res)
// dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
},
onHide() {
// 页面隐藏
},
onUnload() {
// 页面被关闭
},
onTitleClick() {
// 标题被点击
},
onPullDownRefresh() {
// 页面被下拉
},
onReachBottom() {
// 页面被拉到底部
},
onShareAppMessage() {
// 返回自定义分享信息
},
});
function dateFtt(fmt, date) { //author: meizz
var o = {
"M+": date.getMonth() + 1, //月份
"d+": date.getDate(), //日
"h+": date.getHours(), //小时
"m+": date.getMinutes(), //分
"s+": date.getSeconds(), //秒
"q+": Math.floor((date.getMonth() + 3) / 3), //季度
"S": date.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt))
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
for (var k in o)
if (new RegExp("(" + k + ")").test(fmt))
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
return fmt;
}
\ No newline at end of file
{"defaultTitle": "历史记录"}
\ No newline at end of file
::-webkit-scrollbar{
width: 0;
height: 0;
color: transparent;
}
.jy_title{
height: 50rpx;
line-height: 50rpx;
padding: 20rpx;
position: fixed;
}
.jy_title image{
position: relative;
width: 30rpx;
height: 30rpx;
top: 3rpx;
}
.jy_title label{
font-size: 30rpx;
/* font-weight: 700; */
margin-left: 15rpx;
}
.record{
width: 99%;
height: 430rpx;
border: 1px solid #ccc;
margin: 20rpx auto;
text-align: left;
position: relative;
top: 80rpx;
}
.jl{
text-align: left;
font-weight: 700;
margin-top: 20rpx;
padding-left: 20rpx;
}
.jy_content{
width: 100%;
height: 88%;
overflow: hidden;
overflow-y:scroll;
/* border: 1px solid #ccc; */
}
.con{
width: 100%;
padding-left: 10rpx;
}
.con text{
line-height: 50rpx;
display: inline-block;
float: left;
}
.say{
height: 50rpx;
word-wrap: break-word;
word-break: normal;
}
.lang{
width: 100%;
height: 80rpx;
line-height: 80rpx;
position: relative;
top: 80rpx;
margin: 0 auto;
/* border: 1px solid #ccc; */
}
.lang view{
display: block;
width:32%;
height: 80rpx;
line-height: 80rpx;
float: left;
text-align: center;
color: #007AFF;
}
.lang image{
width: 60rpx;
height: 60rpx;
position: relative;
text-align: center;
top: 10rpx;
}
.con_name{
line-height: 50rpx;
overflow:hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* .picker{
display: block;
width:32%;
height: 80rpx;
line-height: 80rpx;
float: left;
text-align: center;
color: #007AFF;
} */
\ No newline at end of file
<view class="page">
<view class="jy_title" a:for="{{recordList}}" a:for-item="record"><image src="../../../resource/images/blue.png" /> <label>{{date}}</label> <label>{{conferenceName}}</label></view>
<view class="record">
<view class="jl">记录</view>
<view class="jy_content">
<view class="con" a:for="{{recordList}}" a:for-item="record">
<text style="width:18%">{{record.formatTime}}</text>
<text style="width:18%" class="con_name">{{record.userName}}</text>
<text style="width:60%" class="say">{{record.sourceText}}</text>
</view>
</view>
</view>
<view class="lang">
<view>中文</view>
<view><image src="../../../resource/images/zh.png" mode="" /></view>
<picker onChange="bindtran" value="{{index}}" range="{{translate}}">
<view class="picker">{{translate[index]}}</view>
</picker>
</view>
<view class="record">
<view class="jl">翻译</view>
<view class="jy_content">
<view class="con" a:for="{{recordList}}" a:for-item="record">
<text style="width:18%">{{record.formatTime}}</text>
<text style="width:18%" class="con_name">{{record.userName}}</text>
<text style="width:60%" class="say">{{record.translate}}</text>
</view>
</view>
</view>
</view>
\ No newline at end of file
let app=getApp();
//替换成开发者后台设置的安全域名
let domain = app.globalData.domain;
let recordlistUrl = domain + "/dingding/recordlist";
Page({
data: {
websocketServer:"ws://192.168.1.221:9090/websocket/?userId=3",
sendMessageAbility: false,
toSendMessage: 'test',
closeLinkAbility: false,
log: '',
//dates: dateFtt("yyyy-MM-dd", new Date()),
translate: ['中文(简体)', '英文', '韩语', '日语', '俄罗斯语', '意大利语', '法语'],
index: 0,
recordList:[],
conferenceName:null,
date:null
},
bindtran(e){
this.setData({
index: e.detail.value,
});
},
onLoad(query) {
var that = this;
var userId = app.globalData.userId;
//var mid = app.mid;
var mid = query.mid;
this.setData({
conferenceName: query.conferenceName,
date:query.date
});
console.log("会议id", mid);
dd.httpRequest({
url: recordlistUrl,
method: 'POST',
data: {
userId: userId,
mid: mid,
// mid: mid
},
dataType: 'json',
success: function(res) {
console.log('success----', res)
var recordList = that.data.recordList;
recordList = res.data.result;
that.setData({
recordList
});
console.log(that.data.recordList);
},
fail: function(res) {
console.log("httpRequestFail---", res)
// dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
// //websocket实时刷新
// dd.connectSocket({
// url: this.data.websocketServer,
// data: {},
// header: {
// 'content-type': 'application/json'
// },
// method: "GET",
// });
// // 注意: 回调方法的注册在整个E应用启动阶段只要做一次,调多次会有多次回调
// dd.onSocketClose((res) => {
// dd.alert({ content: '连接已关闭!' });
// this.setData({
// sendMessageAbility: false,
// closeLinkAbility: false,
// });
// });
// // 注意: 回调方法的注册在整个E应用启动阶段只要做一次,调多次会有多次回调
// dd.onSocketOpen((res) => {
// dd.alert({ content: '连接已打开!' });
// this.setData({
// sendMessageAbility: true,
// closeLinkAbility: true,
// });
// });
},
onReady() {
// 页面加载完成
},
onShow(query) {
},
onHide() {
// 页面隐藏
},
onUnload() {
// 页面被关闭
},
onTitleClick() {
// 标题被点击
},
onPullDownRefresh() {
// 页面被下拉
},
onReachBottom() {
// 页面被拉到底部
},
onShareAppMessage() {
// 返回自定义分享信息
},
});
{"defaultTitle": "会议纪要"}
\ No newline at end of file
.user_img{
width: 80rpx;
height: 80rpx;
border: 1px solid #ccc;
border-radius: 67rpx;
margin-left: 340rpx;
}
.item-avatar-xs text,input,radio{
font-size: 32rpx;
line-height: 80rpx;
}
.item-avatar-xs input{
/* width: 60%; */
margin-top: 15rpx;
}
.item-avatar-xs radio{
margin-left: 30rpx;
}
.item-avatar-xs label{
width: 160rpx;
margin-top: 20rpx;
}
.item-avatar-xs text{
letter-spacing:8px;
}
\ No newline at end of file
<view class="page">
<form onSubmit="updateInfo" onReset="">
<view class="item-avatar-xs">
<text>头 像 :</text>
<image class='user_img' bindtap="selectImg" src='{{imageurl}}{{user.headPortait}}'></image>
</view>
<view class='item-avatar-xs'>
<text>手 机 :</text>
<input type='number' name="phonetel" value='{{user.phonetel}}'></input>
</view>
<view class='item-avatar-xs'>
<text>昵 称 :
<input value="{{user.nickname}}" name="nickname" placeholder='请输入昵称' /></text>
</view>
<view class='item-avatar-xs'>
<text>邮 箱 :</text>
<input value="{{user.email}}" name="email" placeholder='请输入常用邮箱' />
</view>
<view class='item-avatar-xs'>
<text>性 别 :</text>
<radio-group class="radio-group" name="sex">
<label class="radio" a:for="{{sexs}}" a:for-item="sex" >
{{sex.value}} <radio value="{{sex.name}}" checked="{{sex.checked}}" >
</label>
</radio-group>
</view>
<!-- <view class='item-avatar-xs'>
<text>常居地:深圳市</text>
</view> -->
<button class='button' form-type="submit" type="primary">保存</button>
</form>
</view>
\ No newline at end of file
let app = getApp();
//替换成开发者后台设置的安全域名
let domain = app.globalData.domain;
let updateInfoUrl = domain + "/dingding/updateInfo";
Page({
data: {
imageurl: "http://139.159.202.24:8888",
user:null,
img: "",
sexs:[
{ name: 'man', value: '男' , checked:true},
{ name: 'women', value: '女' }
]
},
selectImg() {
var _self = this
a.chooseImage({
success: function(res) {
var tempFilePaths = res.tempFilePaths;
_self.setData({
img: tempFilePaths
})
console.log("file" + ":" + tempFilePaths[0])
wx.uploadFile({
url: app.globalData.ip + '/upload.php',
filePath: tempFilePaths[0],
name: 'test',
success(data) {
console.log(data);
}
})
}
})
},
onLoad(query) {
// 页面加载
// console.info(`Page onLoad with query: ${JSON.stringify(query)}`);
var user = {};
user['nickname']=query.nickname;
user['phonetel']=query.phonetel;
user['email'] = query.email;
user['id'] = query.id;
user['headPortait'] = query.headPortait;
var sexs=this.data.sexs;
if (query.sex=='男'){
sexs[0]["checked"]=true;
sexs[1]["checked"] = false;
}else {
sexs[1]["checked"] = true;
sexs[0]["checked"] = false;
}
this.setData({
user
});
},
updateInfo:function(e){
console.log("携带参数", e.detail.value);
dd.httpRequest({
url: updateInfoUrl,
method: 'POST',
data: {
id:this.data.user.id,
phonetel: e.detail.value.phonetel,
nickname: e.detail.value.nickname,
email: e.detail.value.email
},
dataType: 'json',
success: function(res) {
// console.log('success----', res)
if (res.data.success) {
//console.log("预定成功");
dd.alert({
title: '修改成功',
content: '修改成功',
buttonText: '确定',
success: () => {
dd.reLaunch({
url: '../my/my'
});
},
});
} else {
dd.showToast({
type: 'fail',
content: res.data.message,
duration: 3000,
success: () => {
// dd.navigateTo({
// url: '../index/index'
// });
},
});
}
},
fail: function(res) {
console.log("httpRequestFail---", res)
dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
},
onReady() {
// 页面加载完成
},
onShow() {
// 页面显示
},
onHide() {
// 页面隐藏
},
onUnload() {
// 页面被关闭
},
onTitleClick() {
// 标题被点击
},
onPullDownRefresh() {
// 页面被下拉
},
onReachBottom() {
// 页面被拉到底部
},
onShareAppMessage() {
// 返回自定义分享信息
},
});
\ No newline at end of file
{"defaultTitle": "编辑信息"}
\ No newline at end of file
.h3{
font-size: 30rpx;
font-weight: 700;
margin: 20rpx 0;
}
.h4{
font-size: 26rpx;
font-weight: 700;
}
text{
display: inline-block;
/* margin: 10rpx 0; */
line-height: 40rpx;
}
image{
display: inline-block;
width: 45%;
margin: 10rpx 10rpx;
border: 1px solid #eee;
}
.boder{
width: 100%;
height: auto;
border: 1px solid #ccc;
}
\ No newline at end of file
<view class="page">
<text class="h3">1、如何查看公司的会议室详情?</text>
<text> (1)打开小程序,点击【预定】,即可看到会议室列表</text>
<text> (2)点击要查看的会议室,进入会议室详情页面</text>
<view>
<image src="../../../resource/images/1.PNG" mode="widthFix" />
<image src="../../../resource/images/2.PNG" mode="widthFix" />
</view>
<text class="h3">2、如何预定会议?</text>
<text> (1)从会议室列表中,点击要预定的会议室,进入会议室详情页面,点击【添加预定】</text>
<view><text class="h4"> (2)填写会议信息:</text><text>填写会议名称->填写主持人->填写会议议题->填写会议内容</text></view>
<view><text class="h4"> (3)选择会议时间:</text><text>点击【日期】,选择会议预定的日期->点击选择日期当天未被预定的空白时间块</text>
<text class="h4"> (4)添加参会人员:</text>
<text> 内部参会人员:点击【公司参与人员】,选中部门列表下的人员,点击【确定】</text>
<text> 外部参会人员:点击【邀请外部人员】,输入用户名->输入手机->输入邮箱,点击【添加】</text>
<text class="h4"> (5)选择提醒方式和提醒时间:</text>
<text> 点击【方式】,选中【钉钉/微信/邮箱/短信】复选框即可</text>
<text> 点击【提醒】,选中【提前十分钟/提前半小时/提前1小时】复选框即可</text>
<text class="h4"> 最后,点击【预定】即可</text>
<view>
<image src="../../../resource/images/3.1.PNG" mode="widthFix" />
<image src="../../../resource/images/4.PNG" mode="widthFix" />
<image src="../../../resource/images/5.PNG" mode="widthFix" />
<image src="../../../resource/images/6.PNG" mode="widthFix" />
</view>
<text class="h3">3、如何查看我预定的会议?</text>
<text> 点击【会议】,选择【日期】,点击【我的预定】</text>
<text class="h4"> (1)如何修改会议?</text>
<text> 点击【会议】,点击【我的预定】,从会议列表中找到要修改的会议,点击【修改会议】</text>
<text class="h4"> (2)如何取消会议?</text>
<text> 点击【会议】,点击【我的预定】,从会议列表中找到要取消的会议,点击【取消会议】</text>
<text class="h3">4、如何查看我需要参加的会议?</text>
<text> 点击【会议】,选择【日期】,点击【我的日程】</text>
<text class="h3"> 5、如何查看会议纪要?</text>
<text> (1)点击【会议】,点击【我的日程】,找到要查看的会议,点击【会议纪要】</text>
<text> (2)点击【我的】,点击【历史记录】,找到要查看的会议,点击【会议纪要】</text>
<view>
<image src="../../../resource/images/7.PNG" mode="widthFix" />
<image src="../../../resource/images/8.PNG" mode="widthFix" />
</view>
<text class="h3">6、如何查看已结束的会议?</text>
<text> 点击【我的】,点击【历史记录】,即可查看历史会议详情</text>
<text class="h3">7、如何再次预定会议?</text>
<text> 点击【我的】,点击【历史记录】,找到要再次预定的会议,点击【再次预定】进行预定</text>
<view>
<image src="../../../resource/images/9.PNG" mode="widthFix" />
<image src="../../../resource/images/10.PNG" mode="widthFix" />
</view>
<text class="h3">8、如何修改我的个人信息?</text>
<text> 点击【我的】,点击【编辑】,修改信息,点击【保存】即可</text>
<view>
<image src="../../../resource/images/11.PNG" mode="widthFix" />
<image src="../../../resource/images/12.PNG" mode="widthFix" />
</view>
</view>
\ No newline at end of file
let app=getApp();
Page({
data:{
},
onLoad: function(options) {
},
onReady() {
// 页面加载完成
},
onShow() {
},
onHide() {
// 页面隐藏
},
onUnload() {
// 页面被关闭
},
onTitleClick() {
// 标题被点击
},
onPullDownRefresh() {
// 页面被下拉
},
onReachBottom() {
// 页面被拉到底部
},
onShareAppMessage() {
// 返回自定义分享信息
},
});
{"defaultTitle": "使用帮助"}
\ No newline at end of file
.scroll-view{
width: 750rpx;
height: auto;
}
.graySpace{
padding-left: 40rpx;
background: #eee;
font-size: 12px;
min-height: 18rpx;
}
.item-avatar-lg{
background: #156EF3;
height: 180rpx;
}
.item-avatar .text_box,.item-avatar-lg .text_box{
display: flex;
flex-direction: column;
}
.set{
width: 150rpx;
position: absolute;
margin-left: 600rpx;
}
.set image{
width: 40rpx;
height: 40rpx;
}
.set text{
position: absolute;
line-height: 40rpx;
font-size: 26rpx;
color: #fff;
margin-top: 6rpx;
margin-left: 15rpx;
}
.flex{
display: flex;
}
.user_title{
font-size: 36rpx;
color: #fff;
margin-top: 30rpx;
margin-left: 30rpx;
}
.user_title2{
font-size: 26rpx;
color: #fff;
margin-left: 30rpx;
}
.title{
font-family: "微软雅黑";
font-size: 26rpx;
}
.item-avatar-lg,.item-avatar-xs{
display: flex;
padding: 20rpx 30rpx;
border-bottom: 1rpx solid #eee;
cursor: pointer;
position:relative;
}
.user_img{
float: left;
width: 124rpx;
height: 124rpx;
box-sizing: border-box;
margin-top: 35rpx;
}
.item-avatar-xs image{
float: left;
width: 60rpx;
height: 60rpx;
margin-top: 5rpx;
box-sizing: border-box;
}
.item-avatar-lg,.item-text,.item-avatar-xs{
padding-left: 10px;
line-height: 68rpx;
}
.left{
position: absolute;
right:20px;
color:#555;
}
.number{
margin-left: 250rpx;
color: #1696db;
font-size: 35rpx;
}
\ No newline at end of file
<scroll-view class="scroll-view" scroll-y="true">
<view class="graySpace"></view>
<view class="item-avatar-lg">
<navigator class='set' url="../edit/edit?title=edit&nickname={{user.nickname}}&phonetel={{user.phonetel}}&email={{user.email}}&sex={{user.sex}}&headPortait={{user.headPortait}}&id={{user.id}}" open-type="navigate" hover-class="navigator-hover">
<image src='../../../resource/images/set.png'></image>
<text>编辑</text>
</navigator>
<image class='user_img' src="{{imageurl}}{{user.headPortait}}" background-size="cover"></image>
<view class="text_box padding">
<view class="flex">
<text class="user_title">{{user.nickname}}</text>
</view>
<view class="flex">
<text class="user_title2">用户名:{{user.userAccount}}</text>
</view>
</view>
</view>
<view a:for="{{url}}" a:for-item="item">
<view class="graySpace"></view>
<view a:if="{{item.type == 'navigate'}}">
<navigator class="item-avatar-xs" data-log="{{item.name}}" url="{{item.url}}" open-type="navigate" hover-class="navigator-hover">
<image src="{{item.img}}" />
<view style="padding-left:10px">
<text class="title">{{item.name}}</text>
<text class='left'>〉</text>
</view>
</navigator>
</view>
<view a:else="{{item.type== 'switchTab'}}">
<navigator class="item-avatar-xs" data-log="{{item.name}}" url="{{item.url}}" open-type="switchTab" hover-class="navigator-hover">
<image src="{{item.img}}" />
<view style="padding-left:10px">
<text class="title">{{item.name}}</text>
<text class='left'>〉</text>
</view>
</navigator>
</view>
</view>
<view class="graySpace"></view>
<view>
<view class="item-avatar-xs" onTap="callphone" >
<image src="../../../resource/images/phone.png" />
<view style="padding-left:10px">
<text class="title">电话客服</text>
<text class="number">17727839040</text>
<text class='left'>〉</text>
</view>
</view>
</view>
<view>
<navigator class="item-avatar-xs" url="../service/service" open-type="navigate" hover-class="navigator-hover">
<image src="../../../resource/images/kf.png" />
<view style="padding-left:10px">
<text class="title">在线客服</text>
<text class='left'>〉</text>
</view>
</navigator>
</view>
</scroll-view>
\ No newline at end of file
let app=getApp();
let domain = app.globalData.domain;
let myinfoUrl = domain + "/dingding/myinfo";
Page({
data:{
imageurl:"http://139.159.202.24:8888",
user:null,
url:
[
{
img: "../../../resource/images/meeting.png",
name: "我的会议",
url: "../../meeting/record/record",
type: "switchTab"
},
{
img: "../../../resource/images/ls.png",
name: "历史记录",
url: "../../meeting/recording/recording",
type: "navigate"
},
// {
// img: "../../../resource/images/phone2.png",
// name: "电话客服",
// url: " ",
// type: "navigate"
// },
// {
// img: "../../../resource/images/kf2.png",
// name: "在线客服",
// url: "../../mine/service/service",
// type: "navigate"
// },
{
img: "../../../resource/images/help.png",
name: "使用帮助",
url: "../../mine/help/help",
type: "navigate"
},
{
img: "../../../resource/images/fk.png",
name: "意见反馈",
url: "../../mine/opinion/opinion",
type: "navigate"
}
]
},
onLoad: function(options) {
},
onReady() {
// 页面加载完成
},
callphone:function(){
dd.showCallMenu({
phoneNumber: '17727839040', // 期望拨打的电话号码
code: '+86', // 国家代号,中国是+86
showDingCall: false, // 是否显示钉钉电话
success: function(res) {
},
fail: function(err) {
}
});
},
onShow() {
// 页面显示
var userId = app.globalData.userId;
var _this = this;
dd.httpRequest({
url: myinfoUrl,
method: 'POST',
data: {
userId: userId
},
dataType: 'json',
success: function(res) {
console.log('success----', res)
_this.setData({
user: res.data.result
})
},
fail: function(res) {
console.log("httpRequestFail---", res)
dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
},
onHide() {
// 页面隐藏
},
onUnload() {
// 页面被关闭
},
onTitleClick() {
// 标题被点击
},
onPullDownRefresh() {
// 页面被下拉
},
onReachBottom() {
// 页面被拉到底部
},
onShareAppMessage() {
// 返回自定义分享信息
},
});
{"defaultTitle": "我的信息"}
\ No newline at end of file
page{
background: #fff;
}
.title{
display: block;
margin: 50rpx 10rpx;
}
.type{
margin:0 30rpx;
}
.textarea textarea{
height: 300rpx;
border: 1px solid #eee;
}
.contact{
margin: 20rpx 10rpx;
position: relative;
line-height: 100rpx;
border-bottom: 1px solid #eee;
}
.contact input{
width: 80%;
position: absolute;
margin-top: 20rpx;
margin-left: 10rpx;
}
.btn{
margin-top: 60rpx;
}
\ No newline at end of file
<view class="page">
<form onSubmit="" onReset="">
<text class="title">意见反馈类型:</text>
<view>
<radio-group>
<label a:for="{{typeList}}" a:for-item="type" class="type">
<radio value="{{type.value}}" />{{type.name}}
</label>
</radio-group>
</view>
<text class="title">反馈意见</text>
<view class="textarea">
<textarea placeholder="您的反馈将帮助我们快速成长" maxlength="300" />
</view>
<view class="contact">
联系方式<input type="text" placeholder="留下联系方式,我们将尽快与您联系" />
</view>
<button class="btn" type="primary" >保存</button>
</form>
</view>
\ No newline at end of file
let app=getApp();
Page({
data:{
typeList: [{ name: "产品建议", value: "产品建议", checked: true }, { name: "产品问题", value: "产品问题" }, { name: "咨询帮助", value: "咨询帮助"}]
},
onLoad: function(options) {
},
onReady() {
// 页面加载完成
},
onShow() {
},
onHide() {
// 页面隐藏
},
onUnload() {
// 页面被关闭
},
onTitleClick() {
// 标题被点击
},
onPullDownRefresh() {
// 页面被下拉
},
onReachBottom() {
// 页面被拉到底部
},
onShareAppMessage() {
// 返回自定义分享信息
},
});
{"defaultTitle": "意见反馈"}
\ No newline at end of file
.img{
width: 100%;
text-align: center;
}
.img image{
width: 53%;
display: block;
margin: 100rpx auto 10rpx;
}
\ No newline at end of file
<view class="img">
<image src="../../../resource/images/weixin.png" mode="" />
<text>长按识别图中二维码</text>
</view>
\ No newline at end of file
let app=getApp();
Page({
data:{
},
onLoad: function(options) {
},
onReady() {
// 页面加载完成
},
onShow() {
},
onHide() {
// 页面隐藏
},
onUnload() {
// 页面被关闭
},
onTitleClick() {
// 标题被点击
},
onPullDownRefresh() {
// 页面被下拉
},
onReachBottom() {
// 页面被拉到底部
},
onShareAppMessage() {
// 返回自定义分享信息
},
});
{"defaultTitle": "在线客服"}
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论