Commit 49ab890a by 张立顺

feat 功能联调

1 parent 81446f6c
......@@ -18,7 +18,7 @@ export const appId = "wx570d9331f9ace0bd";
* 4预发布
* 5cdptest
*/
let index = 0;
let index = 2;
const accountInfo = wx.getAccountInfoSync();
const systemInfo = wx.getSystemInfoSync();
const envName = accountInfo.miniProgram.envVersion;
......
// 0待报价、1待确认、2待支付、3已支付、4已支付 5(已完成)、-1战败
const orderStatusObj = {
'0': '待报价',
'1': '待确认',
'2': '待支付',
'3': '已支付',
'4': '已支付',
'5': '已完成',
0: '待报价',
1: '待确认',
2: '待支付',
3: '已支付',
4: '已支付',
5: '已完成',
'-1': '战败',
'9': '已撤销',
'11': '已失效',
'6': '已退款'
9: '已撤销',
11: '已失效',
6: '已退款',
14: '审批中'
}
const orderStatusList = [{
const orderStatusList = [
{
confName: '待报价',
confId: '0'
}, {
},
{
confName: '待确认',
confId: '1'
}, {
},
{
confName: '待支付',
confId: '2'
}, {
},
{
confName: '已支付',
confId: '3'
}, {
},
{
confName: '已完成',
confId: '5'
}, {
},
{
confName: '已退款',
confId: '6'
},
......@@ -37,7 +44,8 @@ const orderStatusList = [{
{
confName: '错误订单',
confId: '11'
}, {
},
{
confName: '战败',
confId: '-1'
}
......@@ -46,4 +54,4 @@ const orderStatusList = [{
export default {
orderStatusObj,
orderStatusList
}
\ No newline at end of file
}
......@@ -820,6 +820,9 @@ Page({
console.log('调接口---')
// 标记错误--补录订单
if (orderInfo.resetOrder && orderInfo.id) {
orderInfo.zyPayUrl = '' // 标记错误工单重新下单,将合同协议字段清除,需重新校验是否上传并重新上传
orderInfo.payType = 5 // 支付方式 5:嘀加收款
orderInfo.payee = 0 // 收款方 0:嘀加收款
orderInfo.oldQuotationId = orderInfo.id
orderInfo.transactionNo =
orderInfo.transactionNo || orderInfo.outTradeNo
......
......@@ -324,6 +324,14 @@
background: #FFF5E6;
padding: var(--fontSize4) var(--fontSize8);
border-radius: var(--fontSize4);
font-size: var(--fontSize24);
}
.approving-txt {
color: #FF9D0A;
background: #ff9d0a1a;
padding: var(--fontSize4) var(--fontSize8);
border-radius: var(--fontSize4);
}
.list .content {
......@@ -503,7 +511,7 @@
color: #347BFF;
}
.refund-box{
.refund-box {
margin-left: var(--fontSize16);
background: #FFF2E0;
padding: var(--fontSize4) var(--fontSize8);
......@@ -835,6 +843,7 @@
padding-left: var(--fontSize24);
margin: 0 auto;
}
.modalbox:last-child {
margin-top: var(--fontSize16);
}
......@@ -865,65 +874,112 @@
width: calc(100% - 36rpx);
}
.repeal-modal{
background: rgba(0, 0, 0, 0.6);
position: fixed;
top: 0;
right: 0;
left: 0;
bottom: 0;
z-index: 999;
}
.repeal-wrap{
width: 622rpx;
height: 496rpx;
background: #FFFFFF;
border-radius: 20rpx;
transform: translate(-50%, -50%);
position: absolute;
top: 50%;
left: 50%;
padding: 40rpx 0 0;
box-sizing: border-box;
}
.repeal-wrap .title{
font-weight: 600;
font-size: 32rpx;
color: #222222;
text-align: center;
line-height: 48rpx;
}
.repeal-wrap .textarea-wrap{
margin: 40rpx 0;
padding: 0 40rpx ;
width: 100%;
box-sizing: border-box;
}
.repeal-wrap .textarea{
background: #F4F5F7;
width: 100%;
height: 224rpx;
padding: 24rpx;
box-sizing: border-box;
border-radius: 12rpx;
}
.repeal-wrap .footer{
position: absolute;
bottom: 0;
border-top: 2rpx solid #EBEDF0;
display: flex;
width: 100%;
}
.repeal-wrap .footer .btn{
height: 96rpx;
line-height: 96rpx;
flex: 1;
font-weight: 400;
font-size: 32rpx;
color: #333333;
text-align: center;
}
.repeal-wrap .footer .btn:last-child{
color: #3582EE;
border-left: 2rpx solid #EBEDF0;
.repeal-modal {
background: rgba(0, 0, 0, 0.6);
position: fixed;
top: 0;
right: 0;
left: 0;
bottom: 0;
z-index: 999;
}
.repeal-wrap {
width: 622rpx;
height: 496rpx;
background: #FFFFFF;
border-radius: 20rpx;
transform: translate(-50%, -50%);
position: absolute;
top: 50%;
left: 50%;
padding: 40rpx 0 0;
box-sizing: border-box;
}
.repeal-wrap .title {
font-weight: 600;
font-size: 32rpx;
color: #222222;
text-align: center;
line-height: 48rpx;
}
.repeal-wrap .textarea-wrap {
margin: 40rpx 0;
padding: 0 40rpx;
width: 100%;
box-sizing: border-box;
}
.repeal-wrap .textarea {
background: #F4F5F7;
width: 100%;
height: 224rpx;
padding: 24rpx;
box-sizing: border-box;
border-radius: 12rpx;
}
.repeal-wrap .footer {
position: absolute;
bottom: 0;
border-top: 2rpx solid #EBEDF0;
display: flex;
width: 100%;
}
.repeal-wrap .footer .btn {
height: 96rpx;
line-height: 96rpx;
flex: 1;
font-weight: 400;
font-size: 32rpx;
color: #333333;
text-align: center;
}
.repeal-wrap .footer .btn:last-child {
color: #3582EE;
border-left: 2rpx solid #EBEDF0;
}
.error-order-box {
box-sizing: border-box;
padding: 16rpx;
border-radius: 8rpx;
// opacity: 1;
// border: 2rpx solid #181a1f1a;
background: #f7f8fa;
margin-bottom: 16rpx;
.label {
color: #999EA8;
margin-right: 30rpx;
}
.value {
color: #5A5E66;
}
.row+.row {
margin-top: 6rpx;
}
}
.abnormal-tag {
display: flex;
.text {
margin-left: 15rpx;
}
}
.error-icon {
display: inline-block;
width: 28rpx;
height: 24rpx;
margin-left: 9rpx;
// margin-right: 6rpx;
margin-top: 3rpx;
}
\ No newline at end of file
......@@ -41,17 +41,17 @@ Page({
wx.hideLoading()
// 跳转到智能体后添加返回拦截
if (param.needIntercept) {
wx.enableAlertBeforeUnload && wx.enableAlertBeforeUnload({
message: '您还没有完成本次短课程学习,是否确定退出?',
success: (modalRes) => {
if (modalRes.confirm) {
wx.navigateBack()
wx.enableAlertBeforeUnload &&
wx.enableAlertBeforeUnload({
message: '您还没有完成本次短课程学习,是否确定退出?',
success: modalRes => {
if (modalRes.confirm) {
wx.navigateBack()
}
}
}
})
})
// 没有返回触发事件, 使用定时器轮询学习状态,是否卸载返回拦截弹窗
this.setTime(param)
}
}
},
......
......@@ -364,6 +364,16 @@ Page({
// 处理subOrderList 商品为空的情况
e.subOrderList = e.subOrderList.filter(item => item.merchantGoodsId)
// e.subOrderList = e.subOrderList.filter(item => item.id)
const orderTypeMap = { 1: '正常订单', 2: '打折策略', 3: '买赠策略', 4: '冲量活动', 5: '组合付款' }
const approveStatusMap = { 0: '审批中', 1: '审批通过', 2: '审批驳回' }
e.orderTypeText = orderTypeMap[e.orderType] || ''
if (e.approveStatus != null) {
e.approveStatusText = approveStatusMap[e.approveStatus] || ''
}
if (e.oldOrderFinalPrice) {
e.oldOrderFinalPrice = Number(wx.$util.decimal(e.oldOrderFinalPrice, 2)).toFixed(2)
}
// 处理显示订单右上角文字
// console.log(status[e.status])
......
......@@ -438,23 +438,23 @@ Page({
},
showStorePicker() {
let { userInfo } = this.data
; (userInfo?.isSuper ||
userInfo?.loginRole == 3 ||
userInfo?.loginRole == 5) &&
this.setData({
showPicker: true,
pickerType: 'merchant'
})
;(userInfo?.isSuper ||
userInfo?.loginRole == 3 ||
userInfo?.loginRole == 5) &&
this.setData({
showPicker: true,
pickerType: 'merchant'
})
},
showStaffPicker() {
let { userInfo } = this.data
; (userInfo?.isSuper ||
userInfo?.loginRole == 3 ||
userInfo?.loginRole == 5) &&
this.setData({
showPicker: true,
pickerType: 'staff'
})
;(userInfo?.isSuper ||
userInfo?.loginRole == 3 ||
userInfo?.loginRole == 5) &&
this.setData({
showPicker: true,
pickerType: 'staff'
})
},
navbarReady(e) {
let navBarHeight = e.detail.height
......@@ -474,7 +474,7 @@ Page({
['orderObj.staffUuid']: '',
['orderObj.staffName']: '',
staffCurrent: 0,
tabIndex: 0, // 重新设置为默认第一个
tabIndex: 0 // 重新设置为默认第一个
// ['orderObj.yqMerchantId']: merchantRange[value].yqMerchantId,
// ['orderObj.yqMerchantName']: merchantRange[value].yqMerchantName
})
......@@ -580,7 +580,7 @@ Page({
showCancel: false,
confirmText: '确定',
confirmColor: '#347BFF',
success(res) { }
success(res) {}
})
} else {
wx.$util.showToast(message)
......@@ -719,7 +719,7 @@ Page({
showCancel: false,
confirmText: '确定',
confirmColor: '#347BFF',
success(res) { }
success(res) {}
})
} else {
wx.$util.showToast(message)
......@@ -1442,7 +1442,7 @@ Page({
wx.$util.message(message)
}
})
.catch(err => { })
.catch(err => {})
},
inputSearch(e) {
let { pickerType } = this.data
......@@ -1651,7 +1651,7 @@ Page({
}
// }
})
.catch(err => { })
.catch(err => {})
},
/**
* 生命周期函数--监听页面加载
......@@ -1773,5 +1773,5 @@ Page({
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () { }
onReady: function () {}
})
......@@ -335,23 +335,23 @@ Page({
},
showStorePicker() {
let { userInfo } = this.data
; (userInfo?.isSuper ||
userInfo?.loginRole == 3 ||
userInfo?.loginRole == 5) &&
this.setData({
showPicker: true,
pickerType: 'merchant'
})
;(userInfo?.isSuper ||
userInfo?.loginRole == 3 ||
userInfo?.loginRole == 5) &&
this.setData({
showPicker: true,
pickerType: 'merchant'
})
},
showStaffPicker() {
let { userInfo } = this.data
; (userInfo?.isSuper ||
userInfo?.loginRole == 3 ||
userInfo?.loginRole == 5) &&
this.setData({
showPicker: true,
pickerType: 'staff'
})
;(userInfo?.isSuper ||
userInfo?.loginRole == 3 ||
userInfo?.loginRole == 5) &&
this.setData({
showPicker: true,
pickerType: 'staff'
})
},
navbarReady(e) {
let navBarHeight = e.detail.height
......@@ -476,7 +476,7 @@ Page({
showCancel: false,
confirmText: '确定',
confirmColor: '#347BFF',
success(res) { }
success(res) {}
})
} else {
wx.$util.showToast(message)
......@@ -617,7 +617,7 @@ Page({
showCancel: false,
confirmText: '确定',
confirmColor: '#347BFF',
success(res) { }
success(res) {}
})
} else {
// console.log(object);
......@@ -1329,7 +1329,7 @@ Page({
wx.$util.message(message)
}
})
.catch(err => { })
.catch(err => {})
},
inputSearch(e) {
let { pickerType } = this.data
......@@ -1536,7 +1536,7 @@ Page({
}
// }
})
.catch(err => { })
.catch(err => {})
},
/**
* 生命周期函数--监听页面加载
......@@ -1649,5 +1649,5 @@ Page({
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () { }
onReady: function () {}
})
......@@ -61,8 +61,8 @@ const domain_items = {
// dj: "http://192.168.1.86:8594", //蔡远明
// dj: 'http://192.168.1.104:8292',//范富荣
// dj: 'http://192.168.1.89:8292', //周杭
// dj: 'http://192.168.1.76:8292', //璐琦
dj: 'http://192.168.1.122:8292', //庞善天
dj: 'http://192.168.1.76:8292', //璐琦
// dj: 'http://192.168.1.122:8292', //庞善天
// dj: 'http://192.168.1.227:8292',//陈希
// dj: 'http://192.168.1.67:8292',//周立明
// dj: 'http://192.168.148.235:8292',// 熊正顺
......
......@@ -3,16 +3,18 @@
* var weekDay = {week: '',day: ''}
* 参数:selectWeek 0为本周,数字代表前几周或者后几周,例如1是下一周
*/
function getWeekDayList(selectWeek, selectDay, customerDisabled,) {
function getWeekDayList(selectWeek, selectDay, customerDisabled) {
// 1.获取周一对应得时间
// 2.用循环七次添加周一到周日对应得周几和几号
var selectWeekTime = getCurrentTimeStamp(selectDay) + selectWeek * 7 * 24 * 60 * 60 * 1000
var mondayTime = selectWeekTime - (getWeekNumber(selectWeekTime) - 1) * 24 * 60 * 60 * 1000
var selectWeekTime =
getCurrentTimeStamp(selectDay) + selectWeek * 7 * 24 * 60 * 60 * 1000
var mondayTime =
selectWeekTime - (getWeekNumber(selectWeekTime) - 1) * 24 * 60 * 60 * 1000
// let testDate = new Date(mondayTime)
console.log(selectWeekTime, 'selectWeekTime');
console.log(selectWeekTime, 'selectWeekTime')
// console.log(getWeekNumber(selectWeekTime), getWeekNumber(selectWeekTime) - 1, 'getWeekNumber(selectWeekTime) - 1')
// console.log(getDataFormat(selectWeekTime), 'selectWeekTime')
console.log(selectWeekTime, 'selectWeekTime');
console.log(selectWeekTime, 'selectWeekTime')
// console.log(getDataFormat(mondayTime), 'mondayTime')
var timeBean = {
selectDay: 0,
......@@ -20,7 +22,7 @@ function getWeekDayList(selectWeek, selectDay, customerDisabled,) {
weekDayList: []
}
timeBean.yearMonth = getYearMonth(selectWeekTime)
console.log(timeBean.yearMonth, 'timeBean.yearMonth');
console.log(timeBean.yearMonth, 'timeBean.yearMonth')
const yearLabel = getYearMonth(selectWeekTime, '/')
// 获取当前时间戳(以毫秒为单位)
const currentTimestamp = Date.now()
......@@ -35,7 +37,9 @@ function getWeekDayList(selectWeek, selectDay, customerDisabled,) {
weekDay.week = getWeek(dataStr)
weekDay.day = getMyDay(dataStr)
weekDay.date = getDataFormat(dataStr)
weekDay.disabled = customerDisabled ? dataStr > (currentTimestamp + 24 * 60 * 60 * 1000) : dataStr > currentTimestamp
weekDay.disabled = customerDisabled
? dataStr > currentTimestamp + 24 * 60 * 60 * 1000
: dataStr > currentTimestamp
timeBean.weekDayList.push(weekDay)
if (i == 0) {
timeBean.starDay = getMyDay(dataStr)
......@@ -46,7 +50,10 @@ function getWeekDayList(selectWeek, selectDay, customerDisabled,) {
timeBean.endDayLabel = getYearMonth(dataStr, '/') + '/' + weekDay.day
timeBean.reportEndDate = getDataFormat(dataStr)
// console.log(dataStr)
timeBean.isInCurrentWeek = isTimestampInCurrentWeek(dataStr, customerDisabled)
timeBean.isInCurrentWeek = isTimestampInCurrentWeek(
dataStr,
customerDisabled
)
}
}
......@@ -110,19 +117,19 @@ function getWeek(res) {
// var m = time.getMonth() + 1
// var d = time.getDate()
// return '日一二三四五六'.charAt(new Date(y + '-' + m + '-' + d).getDay())
var days = ['日', '一', '二', '三', '四', '五', '六'];
var time = new Date(res);
var dayIndex = time.getDay();
return days[dayIndex];
var days = ['日', '一', '二', '三', '四', '五', '六']
var time = new Date(res)
var dayIndex = time.getDay()
return days[dayIndex]
}
//时间戳转周几 0123456 --
function getWeekNumber(res) {
// var days = [6, 0, 1, 2, 3, 4, 5,];
var days = [7, 1, 2, 3, 4, 5, 6];
var time = new Date(res);
var dayIndex = time.getDay();
return days[dayIndex];
var days = [7, 1, 2, 3, 4, 5, 6]
var time = new Date(res)
var dayIndex = time.getDay()
return days[dayIndex]
// var time = new Date(res)
// var y = time.getFullYear()
// var m = time.getMonth() + 1
......@@ -156,25 +163,43 @@ function getDataFormat(res) {
// return targetDate >= currentWeekStart && targetDate <= currentWeekEnd
// }
function isTimestampInCurrentWeek(timestamp, customerDisabled) {
const currentDate = new Date();
const currentDay = currentDate.getDay(); // 获取当前日期是星期几
const currentDate = new Date()
const currentDay = currentDate.getDay() // 获取当前日期是星期几
// 计算当前周的起始日期(周一)
const currentWeekStart = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate() - currentDay + (currentDay === 0 ? -6 : 1));
const currentWeekStart = new Date(
currentDate.getFullYear(),
currentDate.getMonth(),
currentDate.getDate() - currentDay + (currentDay === 0 ? -6 : 1)
)
// 计算当前周的结束日期(周日)
const currentWeekEnd = new Date(currentWeekStart.getFullYear(), currentWeekStart.getMonth(), currentWeekStart.getDate() + 6, 23, 59, 59, 999);
const currentWeekEnd = new Date(
currentWeekStart.getFullYear(),
currentWeekStart.getMonth(),
currentWeekStart.getDate() + 6,
23,
59,
59,
999
)
const targetDate = new Date(timestamp);
const targetDate = new Date(timestamp)
if (customerDisabled) {
let startOfTargetDate = new Date(targetDate.getFullYear(), targetDate.getMonth(), targetDate.getDate())
let endOfTargetDate = new Date(startOfTargetDate.getTime() + (24 * 60 * 60 * 1000) - 1)
let tomorrow = new Date(new Date().getTime() + (24 * 60 * 60 * 1000))
let startOfTargetDate = new Date(
targetDate.getFullYear(),
targetDate.getMonth(),
targetDate.getDate()
)
let endOfTargetDate = new Date(
startOfTargetDate.getTime() + 24 * 60 * 60 * 1000 - 1
)
let tomorrow = new Date(new Date().getTime() + 24 * 60 * 60 * 1000)
return tomorrow <= endOfTargetDate
}
return targetDate >= currentWeekStart && targetDate <= currentWeekEnd;
return targetDate >= currentWeekStart && targetDate <= currentWeekEnd
}
function getWeeksDiff(startDate, endDate) {
......@@ -197,12 +222,15 @@ function getWeeksDiff(startDate, endDate) {
const daysDiff = (dayOfWeek + 7 - firstDayOfWeek) % 7
// 计算结束日期距离一周第一天的周数差
const weeksDiff = Math.floor((endTimestamp + daysDiff * 24 * 3600 * 1000 - startTimestamp) / (7 * 24 * 3600 * 1000))
const weeksDiff = Math.floor(
(endTimestamp + daysDiff * 24 * 3600 * 1000 - startTimestamp) /
(7 * 24 * 3600 * 1000)
)
return weeksDiff
}
function isDateWithin7Days(date) {
console.log(date, 'isDateWithin7Daysdate');
console.log(date, 'isDateWithin7Daysdate')
// console.log(date, 'date');
const oneDay = 24 * 60 * 60 * 1000 // 一天的毫秒数
const currentDate = new Date() // 当前日期
......@@ -246,4 +274,5 @@ module.exports = {
getWeekDayList: getWeekDayList,
isDateWithin7Days: isDateWithin7Days,
isDateWithin60Days: isDateWithin60Days
// isDateWithin30Days: isDateWithin30Days
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!