mirror of
https://gitee.com/elegant_wings/dbd-meeting-wx-small.git
synced 2025-06-21 18:59:36 +08:00
修复BUG
修复部分BUG,切换线上接口
This commit is contained in:
parent
d4d9984851
commit
1cd7aaffed
@ -10,12 +10,12 @@ App({
|
||||
// DOMAIN_NAME: 'http://192.168.0.30:9227', //接口域名
|
||||
// IMG_NAME: 'http://192.168.0.30:9227',
|
||||
// 生产
|
||||
// DOMAIN_NAME_PREFIX: 'https://baoxiu.jsgdha.com/shoot-hand',
|
||||
// DOMAIN_NAME: 'https://baoxiu.jsgdha.com/shoot-hand', //接口域名
|
||||
// IMG_NAME: 'https://baoxiu.jsgdha.com/shoot-hand',
|
||||
DOMAIN_NAME_PREFIX: 'https://company.haxy.com.cn:4443/shoot-hand',
|
||||
DOMAIN_NAME: 'https://company.haxy.com.cn:4443/shoot-hand', //接口域名
|
||||
IMG_NAME: 'https://company.haxy.com.cn:4443/shoot-hand',
|
||||
DOMAIN_NAME_PREFIX: 'https://baoxiu.jsgdha.com/shoot-hand',
|
||||
DOMAIN_NAME: 'https://baoxiu.jsgdha.com/shoot-hand', //接口域名
|
||||
IMG_NAME: 'https://baoxiu.jsgdha.com/shoot-hand',
|
||||
// DOMAIN_NAME_PREFIX: 'https://company.haxy.com.cn:4443/shoot-hand',
|
||||
// DOMAIN_NAME: 'https://company.haxy.com.cn:4443/shoot-hand', //接口域名
|
||||
// IMG_NAME: 'https://company.haxy.com.cn:4443/shoot-hand',
|
||||
globals: {
|
||||
refreshMyPages: false,
|
||||
homedata: {},
|
||||
|
@ -105,7 +105,8 @@ Page({
|
||||
let year = date.getFullYear()
|
||||
let month = date.getMonth() + 1
|
||||
let day = date.getDate()
|
||||
let chooseTime = year + '-' + month + '-' + day + ' 00:00:00'
|
||||
// IOS不支持-,必须用/
|
||||
let chooseTime = year + '/' + month + '/' + day + ' 00:00:00'
|
||||
let chooseTimeStr = new Date(chooseTime).getTime()
|
||||
wx.navigateTo({
|
||||
url: '/pages/meeting/meetingReservation/meetingReservation?time=' + chooseTimeStr + '&dep=' + this.data.depName + '&depId=' + this.data.depId,
|
||||
|
@ -38,7 +38,7 @@
|
||||
<!-- 提示框 -->
|
||||
<van-dialog use-slot title="请认证所在单位" show="{{ showLogin }}" show-cancel-button bind:close="onCloseLogin" bind:confirm="orderLogin" beforeClose="{{ beforeClose }}" zIndex="109">
|
||||
<van-cell-group style="margin: 20px;">
|
||||
<van-field bind:change="onChangeUsername" value="{{ username }}" clearable label="用户名" placeholder="请输入用户名" />
|
||||
<van-field bind:change="onChangePwd" value="{{ pwd }}" type="password" clearable label="密码" placeholder="请输入密码" />
|
||||
<van-field bind:change="onChangeUsername" value="{{ username }}" clearable label="用户名" placeholder="请输入用户名" border="{{ false }}" />
|
||||
<van-field bind:change="onChangePwd" value="{{ pwd }}" type="password" clearable label="密码" placeholder="请输入密码" border="{{ false }}" />
|
||||
</van-cell-group>
|
||||
</van-dialog>
|
@ -474,7 +474,8 @@ Page({
|
||||
let year = date.getFullYear()
|
||||
let month = date.getMonth() + 1
|
||||
let day = date.getDate()
|
||||
let chooseTime = year + '-' + month + '-' + day + ' 00:00:00'
|
||||
// IOS不支持-,必须用/
|
||||
let chooseTime = year + '/' + month + '/' + day + ' 00:00:00'
|
||||
let chooseTimeStr = new Date(chooseTime).getTime()
|
||||
// 加入rId参数,为预约id,用于重新修改
|
||||
wx.navigateTo({
|
||||
|
@ -483,7 +483,8 @@ Page({
|
||||
let year = date.getFullYear()
|
||||
let month = date.getMonth() + 1
|
||||
let day = date.getDate()
|
||||
let chooseTime = year + '-' + month + '-' + day + ' 00:00:00'
|
||||
// IOS不支持-,必须用/
|
||||
let chooseTime = year + '/' + month + '/' + day + ' 00:00:00'
|
||||
let chooseTimeStr = new Date(chooseTime).getTime()
|
||||
// 加入rId参数,为预约id,用于重新修改
|
||||
wx.navigateTo({
|
||||
|
@ -528,7 +528,8 @@ Page({
|
||||
let year = date.getFullYear()
|
||||
let month = date.getMonth() + 1
|
||||
let day = date.getDate()
|
||||
let chooseTime = year + '-' + month + '-' + day + ' 00:00:00'
|
||||
// IOS不支持-,必须用/
|
||||
let chooseTime = year + '/' + month + '/' + day + ' 00:00:00'
|
||||
let chooseTimeStr = new Date(chooseTime).getTime()
|
||||
// 加入rId参数,为预约id,用于重新修改
|
||||
wx.navigateTo({
|
||||
|
@ -3,154 +3,175 @@ let app = getApp();
|
||||
|
||||
//返回 例 2017
|
||||
const formatYear = data => {
|
||||
var date = data.date;
|
||||
var types = data.types;
|
||||
const year = date.getFullYear()
|
||||
const month = date.getMonth() + 1
|
||||
const day = date.getDate()
|
||||
const hour = date.getHours()
|
||||
const minute = date.getMinutes()
|
||||
const second = date.getSeconds()
|
||||
if (types == 'year') {
|
||||
return [year].map(formatNumber).join('-')
|
||||
} else if (types == 'month') {
|
||||
return [month].map(formatNumber).join('-')
|
||||
} else if (types == 'day') {
|
||||
return [day].map(formatNumber).join('-')
|
||||
}
|
||||
var date = data.date;
|
||||
var types = data.types;
|
||||
const year = date.getFullYear()
|
||||
const month = date.getMonth() + 1
|
||||
const day = date.getDate()
|
||||
const hour = date.getHours()
|
||||
const minute = date.getMinutes()
|
||||
const second = date.getSeconds()
|
||||
if (types == 'year') {
|
||||
return [year].map(formatNumber).join('-')
|
||||
} else if (types == 'month') {
|
||||
return [month].map(formatNumber).join('-')
|
||||
} else if (types == 'day') {
|
||||
return [day].map(formatNumber).join('-')
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//返回 例 12月02日
|
||||
const formatDate2 = date => {
|
||||
const month = date.getMonth() + 1
|
||||
const day = date.getDate()
|
||||
return [month].map(formatNumber) + '月' + [day].map(formatNumber) + '日'
|
||||
const month = date.getMonth() + 1
|
||||
const day = date.getDate()
|
||||
return [month].map(formatNumber) + '月' + [day].map(formatNumber) + '日'
|
||||
}
|
||||
|
||||
//返回 例 2017-12-12
|
||||
const formatDate = date => {
|
||||
const year = date.getFullYear()
|
||||
const month = date.getMonth() + 1
|
||||
const day = date.getDate()
|
||||
const hour = date.getHours()
|
||||
const minute = date.getMinutes()
|
||||
const second = date.getSeconds()
|
||||
return [year, month, day].map(formatNumber).join('-')
|
||||
const year = date.getFullYear()
|
||||
const month = date.getMonth() + 1
|
||||
const day = date.getDate()
|
||||
const hour = date.getHours()
|
||||
const minute = date.getMinutes()
|
||||
const second = date.getSeconds()
|
||||
return [year, month, day].map(formatNumber).join('-')
|
||||
}
|
||||
//返回 例 2017-12-12 12:30:00
|
||||
const formatTime = date => {
|
||||
const year = date.getFullYear()
|
||||
const month = date.getMonth() + 1
|
||||
const day = date.getDate()
|
||||
const hour = date.getHours()
|
||||
const minute = date.getMinutes()
|
||||
const second = date.getSeconds()
|
||||
const year = date.getFullYear()
|
||||
const month = date.getMonth() + 1
|
||||
const day = date.getDate()
|
||||
const hour = date.getHours()
|
||||
const minute = date.getMinutes()
|
||||
const second = date.getSeconds()
|
||||
|
||||
return [year, month, day].map(formatNumber).join('-') + ' ' + [hour, minute, second].map(formatNumber).join(':')
|
||||
return [year, month, day].map(formatNumber).join('-') + ' ' + [hour, minute, second].map(formatNumber).join(':')
|
||||
}
|
||||
//返回 例 12-12 12:30:00
|
||||
const formatTime2 = date => {
|
||||
const month = date.getMonth() + 1
|
||||
const day = date.getDate()
|
||||
const hour = date.getHours()
|
||||
const minute = date.getMinutes()
|
||||
const month = date.getMonth() + 1
|
||||
const day = date.getDate()
|
||||
const hour = date.getHours()
|
||||
const minute = date.getMinutes()
|
||||
|
||||
return [month, day].map(formatNumber).join('-') + ' ' + [hour, minute].map(formatNumber).join(':')
|
||||
return [month, day].map(formatNumber).join('-') + ' ' + [hour, minute].map(formatNumber).join(':')
|
||||
}
|
||||
//返回 小时12:00:00
|
||||
const formatHour = data => {
|
||||
var date = data.date;
|
||||
var types = data.types;
|
||||
const hour = date.getHours()
|
||||
const minute = date.getMinutes()
|
||||
const second = date.getSeconds()
|
||||
var date = data.date;
|
||||
var types = data.types;
|
||||
const hour = date.getHours()
|
||||
const minute = date.getMinutes()
|
||||
const second = date.getSeconds()
|
||||
|
||||
if (types == 'hour') {
|
||||
return [hour].map(formatNumber)
|
||||
} else if (types == 'minute') {
|
||||
return [minute].map(formatNumber).join('-')
|
||||
} else if (types == 'second') {
|
||||
return [second].map(formatNumber)
|
||||
}
|
||||
if (types == 'hour') {
|
||||
return [hour].map(formatNumber)
|
||||
} else if (types == 'minute') {
|
||||
return [minute].map(formatNumber).join('-')
|
||||
} else if (types == 'second') {
|
||||
return [second].map(formatNumber)
|
||||
}
|
||||
}
|
||||
function isString(value) {
|
||||
return typeof value === "string";
|
||||
}
|
||||
|
||||
//返回 指定秒数59 , 2017-12-12 12:30:59
|
||||
function selfFormatTimeReturnSecond59(time) {
|
||||
let date = new Date(time);
|
||||
let year = date.getFullYear()
|
||||
let month = date.getMonth() + 1
|
||||
let day = date.getDate()
|
||||
let hour = date.getHours()
|
||||
let minute = date.getMinutes()
|
||||
let second = date.getSeconds()
|
||||
if (typeof time === "string" && time.includes('-')) {
|
||||
time = time.replaceAll('-', '/')
|
||||
}
|
||||
let date = new Date(time);
|
||||
let year = date.getFullYear()
|
||||
let month = date.getMonth() + 1
|
||||
let day = date.getDate()
|
||||
let hour = date.getHours()
|
||||
let minute = date.getMinutes()
|
||||
let second = date.getSeconds()
|
||||
|
||||
return [year, month, day].map(formatNumber).join('-') + ' ' + [hour, minute, '59'].map(formatNumber).join(':')
|
||||
return [year, month, day].map(formatNumber).join('-') + ' ' + [hour, minute, '59'].map(formatNumber).join(':')
|
||||
}
|
||||
|
||||
//返回 2017-12-12 12:30:59
|
||||
function selfFormatTimeYMDHMS(time) {
|
||||
let date = new Date(time);
|
||||
let year = date.getFullYear()
|
||||
let month = date.getMonth() + 1
|
||||
let day = date.getDate()
|
||||
let hour = date.getHours()
|
||||
let minute = date.getMinutes()
|
||||
let second = date.getSeconds()
|
||||
if (typeof time === "string" && time.includes('-')) {
|
||||
time = time.replaceAll('-', '/')
|
||||
}
|
||||
let date = new Date(time);
|
||||
let year = date.getFullYear()
|
||||
let month = date.getMonth() + 1
|
||||
let day = date.getDate()
|
||||
let hour = date.getHours()
|
||||
let minute = date.getMinutes()
|
||||
let second = date.getSeconds()
|
||||
|
||||
return [year, month, day].map(formatNumber).join('-') + ' ' + [hour, minute, second].map(formatNumber).join(':')
|
||||
return [year, month, day].map(formatNumber).join('-') + ' ' + [hour, minute, second].map(formatNumber).join(':')
|
||||
}
|
||||
|
||||
|
||||
//返回 2017-12-12 12:30
|
||||
function selfFormatTimeYMDHM(time) {
|
||||
let date = new Date(time);
|
||||
let year = date.getFullYear()
|
||||
let month = date.getMonth() + 1
|
||||
let day = date.getDate()
|
||||
let hour = date.getHours()
|
||||
let minute = date.getMinutes()
|
||||
let second = date.getSeconds()
|
||||
if (typeof time === "string" && time.includes('-')) {
|
||||
time = time.replaceAll('-', '/')
|
||||
}
|
||||
let date = new Date(time);
|
||||
let year = date.getFullYear()
|
||||
let month = date.getMonth() + 1
|
||||
let day = date.getDate()
|
||||
let hour = date.getHours()
|
||||
let minute = date.getMinutes()
|
||||
let second = date.getSeconds()
|
||||
|
||||
return [year, month, day].map(formatNumber).join('-') + ' ' + [hour, minute].map(formatNumber).join(':')
|
||||
return [year, month, day].map(formatNumber).join('-') + ' ' + [hour, minute].map(formatNumber).join(':')
|
||||
}
|
||||
|
||||
//返回 2017-12-12 12
|
||||
function selfFormatTimeYMDH(time) {
|
||||
let date = new Date(time);
|
||||
let year = date.getFullYear()
|
||||
let month = date.getMonth() + 1
|
||||
let day = date.getDate()
|
||||
let hour = date.getHours()
|
||||
let minute = date.getMinutes()
|
||||
let second = date.getSeconds()
|
||||
if (typeof time === "string" && time.includes('-')) {
|
||||
time = time.replaceAll('-', '/')
|
||||
}
|
||||
let date = new Date(time);
|
||||
let year = date.getFullYear()
|
||||
let month = date.getMonth() + 1
|
||||
let day = date.getDate()
|
||||
let hour = date.getHours()
|
||||
let minute = date.getMinutes()
|
||||
let second = date.getSeconds()
|
||||
|
||||
return [year, month, day].map(formatNumber).join('-') + ' ' + [hour].map(formatNumber).join(':')
|
||||
return [year, month, day].map(formatNumber).join('-') + ' ' + [hour].map(formatNumber).join(':')
|
||||
}
|
||||
|
||||
//返回 例 2017-12-12
|
||||
function selfFormatTimeYMD(time) {
|
||||
let date = new Date(time)
|
||||
let year = date.getFullYear()
|
||||
let month = date.getMonth() + 1
|
||||
let day = date.getDate()
|
||||
let hour = date.getHours()
|
||||
let minute = date.getMinutes()
|
||||
let second = date.getSeconds()
|
||||
return [year, month, day].map(formatNumber).join('-')
|
||||
if (typeof time === "string" && time.includes('-')) {
|
||||
time = time.replaceAll('-', '/')
|
||||
}
|
||||
let date = new Date(time)
|
||||
let year = date.getFullYear()
|
||||
let month = date.getMonth() + 1
|
||||
let day = date.getDate()
|
||||
let hour = date.getHours()
|
||||
let minute = date.getMinutes()
|
||||
let second = date.getSeconds()
|
||||
return [year, month, day].map(formatNumber).join('-')
|
||||
}
|
||||
|
||||
//返回 12:30
|
||||
function selfFormatTimeHM(time) {
|
||||
let date = new Date(time);
|
||||
let year = date.getFullYear()
|
||||
let month = date.getMonth() + 1
|
||||
let day = date.getDate()
|
||||
let hour = date.getHours()
|
||||
let minute = date.getMinutes()
|
||||
let second = date.getSeconds()
|
||||
if (typeof time === "string" && time.includes('-')) {
|
||||
time = time.replaceAll('-', '/')
|
||||
}
|
||||
let date = new Date(time);
|
||||
let year = date.getFullYear()
|
||||
let month = date.getMonth() + 1
|
||||
let day = date.getDate()
|
||||
let hour = date.getHours()
|
||||
let minute = date.getMinutes()
|
||||
let second = date.getSeconds()
|
||||
|
||||
return [hour, minute].map(formatNumber).join(':')
|
||||
return [hour, minute].map(formatNumber).join(':')
|
||||
}
|
||||
|
||||
/**
|
||||
@ -160,29 +181,35 @@ function selfFormatTimeHM(time) {
|
||||
* @return 1天2时3分5秒
|
||||
*/
|
||||
function twoTimeInterval(startTime, endTime) {
|
||||
// 开始时间
|
||||
let date1 = new Date(startTime);
|
||||
// 结束时间
|
||||
let date2 = new Date(endTime);
|
||||
// 时间相差秒数
|
||||
let dateDiff = date2.getTime() - date1.getTime();
|
||||
// 计算出相差天数
|
||||
let days = Math.floor(dateDiff / (24 * 3600 * 1000));
|
||||
// 计算出小时数
|
||||
let residue1 = dateDiff % (24 * 3600 * 1000); // 计算天数后剩余的毫秒数
|
||||
let hours = Math.floor(residue1 / (3600 * 1000));
|
||||
// 计算相差分钟数
|
||||
let residue2 = residue1 % (3600 * 1000); // 计算小时数后剩余的毫秒数
|
||||
let minutes = Math.floor(residue2 / (60 * 1000));
|
||||
// 计算相差秒数
|
||||
let residue3 = residue2 % (60 * 1000); // 计算分钟数后剩余的毫秒数
|
||||
let seconds = Math.round(residue3 / 1000);
|
||||
let returnVal =
|
||||
((days == 0) ? "" : days + "天") +
|
||||
((hours == 0) ? "" : hours + "时") +
|
||||
((minutes == 0) ? "" : minutes + "分")
|
||||
// + ((seconds == 0) ? "" : seconds + "秒");
|
||||
return returnVal;
|
||||
if (typeof startTime === "string" && startTime.includes('-')) {
|
||||
startTime = startTime.replaceAll('-', '/')
|
||||
}
|
||||
if (typeof endTime === "string" && endTime.includes('-')) {
|
||||
endTime = endTime.replaceAll('-', '/')
|
||||
}
|
||||
// 开始时间
|
||||
let date1 = new Date(startTime);
|
||||
// 结束时间
|
||||
let date2 = new Date(endTime);
|
||||
// 时间相差秒数
|
||||
let dateDiff = date2.getTime() - date1.getTime();
|
||||
// 计算出相差天数
|
||||
let days = Math.floor(dateDiff / (24 * 3600 * 1000));
|
||||
// 计算出小时数
|
||||
let residue1 = dateDiff % (24 * 3600 * 1000); // 计算天数后剩余的毫秒数
|
||||
let hours = Math.floor(residue1 / (3600 * 1000));
|
||||
// 计算相差分钟数
|
||||
let residue2 = residue1 % (3600 * 1000); // 计算小时数后剩余的毫秒数
|
||||
let minutes = Math.floor(residue2 / (60 * 1000));
|
||||
// 计算相差秒数
|
||||
let residue3 = residue2 % (60 * 1000); // 计算分钟数后剩余的毫秒数
|
||||
let seconds = Math.round(residue3 / 1000);
|
||||
let returnVal =
|
||||
((days == 0) ? "" : days + "天") +
|
||||
((hours == 0) ? "" : hours + "时") +
|
||||
((minutes == 0) ? "" : minutes + "分")
|
||||
// + ((seconds == 0) ? "" : seconds + "秒");
|
||||
return returnVal;
|
||||
}
|
||||
|
||||
|
||||
@ -193,75 +220,81 @@ function twoTimeInterval(startTime, endTime) {
|
||||
* @return 12时
|
||||
*/
|
||||
function twoTimeIntervalReturnHours(startTime, endTime) {
|
||||
// 开始时间
|
||||
let date1 = new Date(startTime);
|
||||
// 结束时间
|
||||
let date2 = new Date(endTime);
|
||||
// 时间相差秒数
|
||||
let dateDiff = date2.getTime() - date1.getTime();
|
||||
// 计算出小时数
|
||||
let hours = Math.floor(dateDiff / (3600 * 1000));
|
||||
return hours;
|
||||
if (typeof startTime === "string" && startTime.includes('-')) {
|
||||
startTime = startTime.replaceAll('-', '/')
|
||||
}
|
||||
if (typeof endTime === "string" && endTime.includes('-')) {
|
||||
endTime = endTime.replaceAll('-', '/')
|
||||
}
|
||||
// 开始时间
|
||||
let date1 = new Date(startTime);
|
||||
// 结束时间
|
||||
let date2 = new Date(endTime);
|
||||
// 时间相差秒数
|
||||
let dateDiff = date2.getTime() - date1.getTime();
|
||||
// 计算出小时数
|
||||
let hours = Math.floor(dateDiff / (3600 * 1000));
|
||||
return hours;
|
||||
}
|
||||
|
||||
const formatNumber = n => {
|
||||
n = n.toString()
|
||||
return n[1] ? n : '0' + n
|
||||
n = n.toString()
|
||||
return n[1] ? n : '0' + n
|
||||
}
|
||||
|
||||
// 数组sum合计
|
||||
function selfArrSum(list) {
|
||||
let count = 0;
|
||||
list.map(item => {
|
||||
count = count + item
|
||||
})
|
||||
return count
|
||||
let count = 0;
|
||||
list.map(item => {
|
||||
count = count + item
|
||||
})
|
||||
return count
|
||||
}
|
||||
|
||||
// 返回url参数对象
|
||||
function getUrlParamsObj(url) {
|
||||
// 通过 ? 分割获取后面的参数字符串
|
||||
let urlStr = url.split('?')[1]
|
||||
// 创建空对象存储参数
|
||||
let obj = {};
|
||||
// 再通过 & 将每一个参数单独分割出来
|
||||
let paramsArr = urlStr.split('&')
|
||||
for (let i = 0, len = paramsArr.length; i < len; i++) {
|
||||
// 再通过 = 将每一个参数分割为 key:value 的形式
|
||||
let arr = paramsArr[i].split('=')
|
||||
obj[arr[0]] = arr[1];
|
||||
}
|
||||
return obj
|
||||
// 通过 ? 分割获取后面的参数字符串
|
||||
let urlStr = url.split('?')[1]
|
||||
// 创建空对象存储参数
|
||||
let obj = {};
|
||||
// 再通过 & 将每一个参数单独分割出来
|
||||
let paramsArr = urlStr.split('&')
|
||||
for (let i = 0, len = paramsArr.length; i < len; i++) {
|
||||
// 再通过 = 将每一个参数分割为 key:value 的形式
|
||||
let arr = paramsArr[i].split('=')
|
||||
obj[arr[0]] = arr[1];
|
||||
}
|
||||
return obj
|
||||
}
|
||||
|
||||
// 判断是否是图片
|
||||
function checkIsImg(url) {
|
||||
if (!/\.(jpg|jpeg|png|GIF|JPG|PNG)$/.test(url)) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
if (!/\.(jpg|jpeg|png|GIF|JPG|PNG)$/.test(url)) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function uploadFile(url) {
|
||||
let _this = this
|
||||
return new Promise((resolve, reject) => {
|
||||
wx.uploadFile({
|
||||
url: app.DOMAIN_NAME + '/api/dfs/upload',
|
||||
filePath: url,
|
||||
name: 'file',
|
||||
header: {
|
||||
"Authorization": 'Bearer ' + wx.getStorageSync('token')
|
||||
},
|
||||
formData: {},
|
||||
success: res => {
|
||||
resolve(JSON.parse(res.data));
|
||||
},
|
||||
fail: err => {
|
||||
reject(err);
|
||||
}
|
||||
})
|
||||
let _this = this
|
||||
return new Promise((resolve, reject) => {
|
||||
wx.uploadFile({
|
||||
url: app.DOMAIN_NAME + '/api/dfs/upload',
|
||||
filePath: url,
|
||||
name: 'file',
|
||||
header: {
|
||||
"Authorization": 'Bearer ' + wx.getStorageSync('token')
|
||||
},
|
||||
formData: {},
|
||||
success: res => {
|
||||
resolve(JSON.parse(res.data));
|
||||
},
|
||||
fail: err => {
|
||||
reject(err);
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -270,75 +303,75 @@ function uploadFile(url) {
|
||||
// repairId : 工单id,报修人不传
|
||||
// operate : repair报修,feedback维修,eval评价
|
||||
function repairAttachUpload(data) {
|
||||
let _this = this
|
||||
let paramUrl = "?a=a"
|
||||
if (data.repairId) {
|
||||
paramUrl = paramUrl + '&repairId=' + data.repairId
|
||||
}
|
||||
if (data.operate) {
|
||||
paramUrl = paramUrl + '&operate=' + data.operate
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
wx.uploadFile({
|
||||
url: app.DOMAIN_NAME + '/app/repairAttach/upload' + paramUrl,
|
||||
filePath: data.url,
|
||||
name: 'file',
|
||||
header: {
|
||||
"Authorization": 'Bearer ' + wx.getStorageSync('token')
|
||||
},
|
||||
formData: {},
|
||||
success: res => {
|
||||
resolve(JSON.parse(res.data));
|
||||
},
|
||||
fail: err => {
|
||||
reject(err);
|
||||
}
|
||||
})
|
||||
let _this = this
|
||||
let paramUrl = "?a=a"
|
||||
if (data.repairId) {
|
||||
paramUrl = paramUrl + '&repairId=' + data.repairId
|
||||
}
|
||||
if (data.operate) {
|
||||
paramUrl = paramUrl + '&operate=' + data.operate
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
wx.uploadFile({
|
||||
url: app.DOMAIN_NAME + '/app/repairAttach/upload' + paramUrl,
|
||||
filePath: data.url,
|
||||
name: 'file',
|
||||
header: {
|
||||
"Authorization": 'Bearer ' + wx.getStorageSync('token')
|
||||
},
|
||||
formData: {},
|
||||
success: res => {
|
||||
resolve(JSON.parse(res.data));
|
||||
},
|
||||
fail: err => {
|
||||
reject(err);
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 报修上传语音
|
||||
// url: localhost:9227/app/repairAttach/upload/voice
|
||||
function uploadVoice(url) {
|
||||
let _this = this
|
||||
return new Promise((resolve, reject) => {
|
||||
wx.uploadFile({
|
||||
url: app.DOMAIN_NAME + '/app/repairAttach/upload/voice',
|
||||
filePath: url,
|
||||
name: 'file',
|
||||
header: {
|
||||
"Authorization": 'Bearer ' + wx.getStorageSync('token')
|
||||
},
|
||||
formData: {},
|
||||
success: res => {
|
||||
resolve(JSON.parse(res.data));
|
||||
},
|
||||
fail: err => {
|
||||
reject(err);
|
||||
}
|
||||
})
|
||||
let _this = this
|
||||
return new Promise((resolve, reject) => {
|
||||
wx.uploadFile({
|
||||
url: app.DOMAIN_NAME + '/app/repairAttach/upload/voice',
|
||||
filePath: url,
|
||||
name: 'file',
|
||||
header: {
|
||||
"Authorization": 'Bearer ' + wx.getStorageSync('token')
|
||||
},
|
||||
formData: {},
|
||||
success: res => {
|
||||
resolve(JSON.parse(res.data));
|
||||
},
|
||||
fail: err => {
|
||||
reject(err);
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
formatTime: formatTime,
|
||||
formatDate: formatDate,
|
||||
formatYear: formatYear,
|
||||
formatDate2: formatDate2,
|
||||
formatHour: formatHour,
|
||||
formatTime2: formatTime2,
|
||||
selfFormatTimeReturnSecond59,
|
||||
selfFormatTimeYMDHMS,
|
||||
selfFormatTimeYMDHM,
|
||||
selfFormatTimeYMD,
|
||||
selfFormatTimeHM,
|
||||
selfFormatTimeYMDH,
|
||||
twoTimeInterval,
|
||||
twoTimeIntervalReturnHours,
|
||||
selfArrSum,
|
||||
getUrlParamsObj,
|
||||
checkIsImg,
|
||||
uploadFile,
|
||||
repairAttachUpload,
|
||||
uploadVoice
|
||||
formatTime: formatTime,
|
||||
formatDate: formatDate,
|
||||
formatYear: formatYear,
|
||||
formatDate2: formatDate2,
|
||||
formatHour: formatHour,
|
||||
formatTime2: formatTime2,
|
||||
selfFormatTimeReturnSecond59,
|
||||
selfFormatTimeYMDHMS,
|
||||
selfFormatTimeYMDHM,
|
||||
selfFormatTimeYMD,
|
||||
selfFormatTimeHM,
|
||||
selfFormatTimeYMDH,
|
||||
twoTimeInterval,
|
||||
twoTimeIntervalReturnHours,
|
||||
selfArrSum,
|
||||
getUrlParamsObj,
|
||||
checkIsImg,
|
||||
uploadFile,
|
||||
repairAttachUpload,
|
||||
uploadVoice
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user