修改了对应问题,新增了政策模块

This commit is contained in:
chenze 2024-09-27 11:24:58 +08:00
parent b53c39bab1
commit ccf1ec2bbb
19 changed files with 298 additions and 57 deletions

View File

@ -180,3 +180,11 @@ export function saveChangyangMeetingRecordRq(data) {
data data
}); });
} }
//获取政策
export function policyById(id) {
return request({
url: '/api/visitor/policyById/'+id,
method: "get"
});
}

View File

@ -6,10 +6,10 @@ App({
parkId: '26', // 园区id parkId: '26', // 园区id
parkName: '长阳智会云控', // 园区名称 parkName: '长阳智会云控', // 园区名称
// 本地测试 // 本地测试
// DOMAIN_NAME_PREFIX: ' http://192.168.0.30', // DOMAIN_NAME_PREFIX: ' http://192.168.1.47',
// DOMAIN_NAME: ' http://192.168.0.30:9227', //接口域名 // DOMAIN_NAME: ' http://192.168.1.47:9227', //接口域名
// IMG_NAME: ' http://192.168.0.30:9227', // IMG_NAME: ' http://192.168.1.47:9227',
// socketUrl: 'wss://192.168.0.30:9227/changyang-office/websocket-server', // socketUrl: 'wss://192.168.1.47:9227/changyang-office/websocket-server',
// 生产 // 生产
DOMAIN_NAME_PREFIX: 'https://www.chuangzhikj.com', DOMAIN_NAME_PREFIX: 'https://www.chuangzhikj.com',
DOMAIN_NAME: 'https://www.chuangzhikj.com/saas-ics', //接口域名 DOMAIN_NAME: 'https://www.chuangzhikj.com/saas-ics', //接口域名

View File

@ -75,7 +75,8 @@
"pages/meeting/meetingRoom/meetingService/meetingService", "pages/meeting/meetingRoom/meetingService/meetingService",
"pages/meeting/meetingRoom/meetingPerson/meetingPerson", "pages/meeting/meetingRoom/meetingPerson/meetingPerson",
"pages/smartDevice/region/region", "pages/smartDevice/region/region",
"pages/smartDevice/room/room" "pages/smartDevice/room/room",
"pages/meeting/meetingPolicy/meetingPolicy"
], ],
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",

View File

@ -128,6 +128,11 @@ Page({
img: "/profile/static/index/menu-ycmj.png", img: "/profile/static/index/menu-ycmj.png",
path: "/pages/smartDevice/region/region" path: "/pages/smartDevice/region/region"
}, },
{
name: "会议政策",
img: "/profile/static/index/zhengce.png",
path: "/pages/meeting/meetingPolicy/meetingPolicy"
},
// { // {
// name: "远程门禁", // name: "远程门禁",
// img: "/profile/static/index/menu-ycmj.png", // img: "/profile/static/index/menu-ycmj.png",

View File

@ -0,0 +1,96 @@
// pages/meeting/meetingPolicy/meetingPolicy.js
const app = getApp()
import {
policyById
} from "../../../api/meeting/meetingRoom.js"
Page({
/**
* 页面的初始数据
*/
data: {
policy: {},
IMG_NAME: app.IMG_NAME,
policyImages:[
"/profile/static/shanghai_changyang/policy/policy0.jpg",
"/profile/static/shanghai_changyang/policy/policy1.jpg",
"/profile/static/shanghai_changyang/policy/policy2.jpg",
"/profile/static/shanghai_changyang/policy/policy3.jpg",
"/profile/static/shanghai_changyang/policy/policy4.jpg",
"/profile/static/shanghai_changyang/policy/policy5.jpg",
]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let _this = this
policyById(15).then(res => {
_this.setData({
policy: res.data
})
})
},
clickImg(e){
console.log(e);
var index = e.currentTarget.dataset.index
console.log(this.data.IMG_NAME);
let img= this.data.policyImages.map(item =>this.data.IMG_NAME +item)
//所有图片
wx.previewImage({
//当前显示图片
current: img[index],
//所有图片
urls: img
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "规章制度"
}

View File

@ -0,0 +1,6 @@
<view class="policy">
<view class="content">
<rich-text class="richText" nodes="{{policy.content}}"></rich-text>
<image wx:for="{{policyImages}}" wx:key="index" data-index="{{index}}" class="img" src="{{IMG_NAME + item}}" mode="aspectFill" bindtap='clickImg'></image>
</view>
</view>

View File

@ -0,0 +1,14 @@
.policy{
height: 100%;
width: 100%;
}
.policy .content{
font-size: 35rpx;
margin: 10rpx;
}
.content .img{
width: 100%;
height: 400rpx;
}

View File

@ -176,8 +176,8 @@ Page({
item.reservations = item.reservations.map(record => { item.reservations = item.reservations.map(record => {
record.startTime = record.startTime.substring(11) record.startTime = record.startTime.substring(11)
record.endDate = record.endDate.substring(11) record.endDate = record.endDate.substring(11)
record.userName = record.userName.substring(0,1) + "某" // record.userName = record.userName.substring(0,1) + "某"
record.phone = record.phone.substring(0,3) + "****" + record.phone.substring(7,record.phone.length) // record.phone = record.phone.substring(0,3) + "****" + record.phone.substring(7,record.phone.length)
return record; return record;
}) })
return item return item

View File

@ -1,7 +1,8 @@
const app = getApp() const app = getApp()
import { import {
meetingRoomDetailRq, meetingRoomDetailRq,
selectCoordinateRq selectCoordinateRq,
policyById
} from "../../../api/meeting/meetingRoom.js" } from "../../../api/meeting/meetingRoom.js"
@ -15,7 +16,8 @@ Page({
meetingRoomId: null, meetingRoomId: null,
detail: {}, detail: {},
bannerList: [], bannerList: [],
mapData: {} mapData: {},
policy:{}
}, },
/** /**
@ -44,8 +46,20 @@ Page({
}) })
// 获取地址信息 // 获取地址信息
_this.getAddress() _this.getAddress()
_this.getPolicy()
}, },
//获取政策信息
getPolicy(){
let _this = this;
policyById(14).then(res =>{
_this.setData({
policy:res.data
})
})
},
// 获取地址信息 // 获取地址信息
getAddress() { getAddress() {
let _this = this; let _this = this;

View File

@ -50,9 +50,15 @@
</view> --> </view> -->
<!-- 地图 --> <!-- 地图 -->
<view class="mapView"> <!-- <view class="mapView">
<view class="leftLineTitle">会议地点</view> <view class="leftLineTitle">会议地点</view>
<map class="myMap" latitude="{{mapData.latitude}}" longitude="{{mapData.longitude}}" markers="{{mapData.markers}}" show-location bindtap="openMap"></map> <map class="myMap" latitude="{{mapData.latitude}}" longitude="{{mapData.longitude}}" markers="{{mapData.markers}}" show-location bindtap="openMap"></map>
</view> -->
<view class="policy">
<view class="leftLineTitle">会议室须知</view>
<view class="content">
<rich-text nodes="{{policy.content}}"></rich-text>
</view>
</view> </view>
<!-- 预约 --> <!-- 预约 -->

View File

@ -146,3 +146,11 @@
height: 500rpx; height: 500rpx;
} }
.policy{
margin: 50rpx 20rpx;
}
.policy .content{
font-size: 30rpx;
margin: 20rpx;
}

View File

@ -3,6 +3,7 @@ const app = getApp()
import Dialog from '@vant/weapp/dialog/dialog'; import Dialog from '@vant/weapp/dialog/dialog';
import Notify from '@vant/weapp/notify/notify'; import Notify from '@vant/weapp/notify/notify';
import { import {
selfFormatTimeYMD, selfFormatTimeYMD,
selfFormatTimeHM selfFormatTimeHM
@ -26,6 +27,7 @@ Page({
data: { data: {
IMG_NAME: app.IMG_NAME, IMG_NAME: app.IMG_NAME,
userData: null, userData: null,
show: false,
dataChange: false, dataChange: false,
tabTitle: '预约记录', tabTitle: '预约记录',
// 预约记录参数 // 预约记录参数
@ -38,6 +40,19 @@ Page({
participatePageSize: 10, participatePageSize: 10,
participateDataList: [], participateDataList: [],
participateIsDataAll: false, participateIsDataAll: false,
//取消原因
cancelResaon: null,
msg:null,
orderId: '',
onBeforeClose(action) {
return new Promise(resolve => {
if (action === 'confirm') {
resolve(false);
} else {
resolve(true);
}
});
}
}, },
/** /**
@ -290,49 +305,101 @@ Page({
tabTitle: event.detail.title tabTitle: event.detail.title
}) })
}, },
//取消订单
onClose() {
this.setData({ show: false,cancelResaon:'' });
},
cancleResaonValue(e){
this.cancelResaon = e.detail
// 取消订单 },
//确定取消
cancelRecord(e) {
let _this = this;
// 参数校验
// 主题
console.log(_this.cancelResaon);
if (_this.cancelResaon == null || _this.cancelResaon =='') {
app.vantNotifyErr(Notify, '请输入取消原因!')
return false;
}
cancelOrderRq({
id:_this.orderId,
cancelResaon:_this.cancelResaon
}).then(res => {
console.log('cancelOrderRq', res);
if (res.code == 0) {
// 刷新预约数据
_this.setData({
reservationPageNum: 1,
reservationDataList: [],
reservationIsDataAll: false,
})
_this.getDataList()
this.onClose()
// 危险通知
Notify({
type: 'success',
message: "取消预约成功"
});
} else {
// 危险通知
Notify({
type: 'danger',
message: res.msg
});
}
resolve(true);
})
},
// 打开弹出框
cancelOrder(e) { cancelOrder(e) {
console.log('cancelOrder', e); console.log('cancelOrder', e);
let _this = this; this.orderId = e.currentTarget.dataset.id
let id = e.currentTarget.dataset.id this.setData({
const beforeClose = (action) => { show: true,
console.log('action', action); })
return new Promise((resolve) => { console.log(this.orderId);
if (action === 'confirm') { // let _this = this;
cancelOrderRq({ // let id = e.currentTarget.dataset.id
id, // const beforeClose = (action) => {
cancelResaon: "" // console.log('action', action);
}).then(res => { // return new Promise((resolve) => {
console.log('cancelOrderRq', res); // if (action === 'confirm') {
if (res.code == 0) { // cancelOrderRq({
// 刷新预约数据 // id,
_this.setData({ // cancelResaon: ""
reservationPageNum: 1, // }).then(res => {
reservationDataList: [], // console.log('cancelOrderRq', res);
reservationIsDataAll: false, // if (res.code == 0) {
}) // // 刷新预约数据
_this.getDataList() // _this.setData({
} else { // reservationPageNum: 1,
// 危险通知 // reservationDataList: [],
Notify({ // reservationIsDataAll: false,
type: 'danger', // })
message: res.msg // _this.getDataList()
}); // } else {
} // // 危险通知
resolve(true); // Notify({
}) // type: 'danger',
} else { // message: res.msg
// 拦截取消操作 // });
resolve(true); // }
} // resolve(true);
}); // })
} // } else {
Dialog.confirm({ // // 拦截取消操作
title: '提示', // resolve(true);
message: '是否取消预约!', // }
beforeClose, // });
}); // }
// Dialog.confirm({
// title: '提示',
// message: '是否取消预约!',
// beforeClose,
// });
}, },
// 开门 // 开门

View File

@ -4,7 +4,8 @@
"van-tabs": "@vant/weapp/tabs/index", "van-tabs": "@vant/weapp/tabs/index",
"van-divider": "@vant/weapp/divider/index", "van-divider": "@vant/weapp/divider/index",
"van-dialog": "@vant/weapp/dialog/index", "van-dialog": "@vant/weapp/dialog/index",
"van-notify": "@vant/weapp/notify/index" "van-notify": "@vant/weapp/notify/index",
"van-field": "@vant/weapp/field/index"
}, },
"navigationBarTitleText": "会议预约记录", "navigationBarTitleText": "会议预约记录",
"onReachBottomDistance": 100 "onReachBottomDistance": 100

View File

@ -61,7 +61,12 @@
</van-tabs> </van-tabs>
<!-- 提示框 --> <!-- 提示框 -->
<van-dialog id="van-dialog" /> <!-- <van-dialog id="van-dialog" /> -->
<!-- bind:confirm="cancelRecord" bind:close="onClose" -->
<van-dialog use-slot title="取消预约" show="{{ show }}" show-cancel-button beforeClose="{{onBeforeClose}}" bind:confirm="cancelRecord" bind:close="onClose" >
<van-field value="{{cancelResaon}}" label="取消原因" placeholder="请输入取消原因" bind:change="cancleResaonValue" />
</van-dialog>
<!-- 提示框 --> <!-- 提示框 -->
<van-notify id="van-notify" /> <van-notify id="van-notify" />

View File

@ -138,3 +138,8 @@
.loadAllLine { .loadAllLine {
margin-top: 80rpx; margin-top: 80rpx;
} }
.van-cell{
margin-top: 30rpx;
margin-bottom: 30rpx;
}

View File

@ -177,7 +177,7 @@ function twoTimeInterval(startTime, endTime) {
let returnVal = let returnVal =
((days == 0) ? "" : days + "天") + ((days == 0) ? "" : days + "天") +
((hours == 0) ? "" : hours + "时") + ((hours == 0) ? "" : hours + "时") +
((minutes == 0) ? "" : minutes + "分") ((minutes == 0) ? "" : minutes + "分")
// + ((seconds == 0) ? "" : seconds + "秒"); // + ((seconds == 0) ? "" : seconds + "秒");
return returnVal; return returnVal;
} }

View File

@ -1,5 +1,5 @@
{ {
"description": "项目配置文件", "description": "项目配置文件详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"packOptions": { "packOptions": {
"ignore": [], "ignore": [],
"include": [] "include": []
@ -25,7 +25,7 @@
"uploadWithSourceMap": true, "uploadWithSourceMap": true,
"compileHotReLoad": false, "compileHotReLoad": false,
"lazyloadPlaceholderEnable": false, "lazyloadPlaceholderEnable": false,
"useMultiFrameRuntime": false, "useMultiFrameRuntime": true,
"useApiHook": false, "useApiHook": false,
"useApiHostProcess": false, "useApiHostProcess": false,
"babelSetting": { "babelSetting": {
@ -48,7 +48,8 @@
"minifyWXML": true, "minifyWXML": true,
"showES6CompileOption": false, "showES6CompileOption": false,
"useCompilerPlugins": false, "useCompilerPlugins": false,
"condition": false "condition": false,
"useStaticServer": true
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "3.4.0", "libVersion": "3.4.0",

View File

@ -1,7 +1,7 @@
{ {
"setting": { "setting": {
"compileHotReLoad": true, "compileHotReLoad": true,
"urlCheck": false "urlCheck": true
}, },
"condition": { "condition": {
"miniprogram": { "miniprogram": {