Commit 125e5ca3 by 前端

Merge branch 'SAAS+V4.41' of http://192.168.3.233:8090/saas_plus/dj-car-boutique…

…-work-wechat into SAAS+V4.41
2 parents 73b8fad3 55bd98fe
...@@ -59,7 +59,7 @@ Component({ ...@@ -59,7 +59,7 @@ Component({
filmOrder: String // 下单类型 filmOrder: String // 下单类型
}, },
lifetimes: { lifetimes: {
attached() {} attached() { }
}, },
/** /**
* 组件的初始数据 * 组件的初始数据
...@@ -260,7 +260,9 @@ Component({ ...@@ -260,7 +260,9 @@ Component({
c.disabled = true c.disabled = true
if (c.active) { if (c.active) {
delete orderObj.merchantCouponId delete orderObj.merchantCouponId
orderObj.customerCouponId = e.merchantCoupon.id if (orderObj.customerCouponId == null) {
orderObj.customerCouponId = e.merchantCoupon.id
}
thisPage.setData({ thisPage.setData({
orderObj orderObj
}) })
......
...@@ -139,7 +139,10 @@ Component({ ...@@ -139,7 +139,10 @@ Component({
userInfo: {}, userInfo: {},
sufferReason: "", sufferReason: "",
// mode: 0, // mode: 0,
showRendering: false showRendering: false,
repealVisible: false,
repealReason: '',
repealId: ''
}, },
observers: { observers: {
mode: function (value) { mode: function (value) {
...@@ -698,25 +701,36 @@ Component({ ...@@ -698,25 +701,36 @@ Component({
//返回角度 /Math.atan()返回数字的反正切值 //返回角度 /Math.atan()返回数字的反正切值
return (360 * Math.atan(_Y / _X)) / (2 * Math.PI); return (360 * Math.atan(_Y / _X)) / (2 * Math.PI);
}, },
cancelRepeal() {
this.clearData()
},
textareaInput(e) {
let { value } = e.detail
this.setData({
repealReason: value
})
},
confirmRepeal() {
const {repealReason, repealId} = this.data
if(!repealReason){
wx.showToast({
title: '请填写撤销原因',
duration: 2000,
icon: 'none'
})
return
}
this.repeal(repealId, repealReason);
},
toConfirmReturanOrder(e) { toConfirmReturanOrder(e) {
console.log(e.currentTarget.dataset, 'e.currentTarget.dataset') console.log(e.currentTarget.dataset, 'e.currentTarget.dataset')
const { id, repeal, status } = e.currentTarget.dataset; const { id, repeal, status } = e.currentTarget.dataset;
let _this = this; let _this = this;
if(repeal && status==-1) { if(repeal && status==-1) {
wx.showModal({ this.setData({
title: "撤销原因", repealVisible: true,
placeholderText: "请输入撤销原因", repealId: id
editable: true, })
confirmText: "是",
confirmColor: "#347BFF",
cancelText: "否",
success(res) {
if (res.confirm) {
// _this.showLoading('取消中...')
_this.repeal(id, res.content);
}
},
});
}else{ }else{
wx.showModal({ wx.showModal({
title: "", title: "",
...@@ -752,6 +766,7 @@ Component({ ...@@ -752,6 +766,7 @@ Component({
cancelOrderById(params).then((_res_) => { cancelOrderById(params).then((_res_) => {
let { code, message } = _res_; let { code, message } = _res_;
if (code == 0) { if (code == 0) {
_this.clearData()
wx.showToast({ wx.showToast({
title: "操作成功", title: "操作成功",
icon: "success", icon: "success",
...@@ -764,6 +779,13 @@ Component({ ...@@ -764,6 +779,13 @@ Component({
} }
}); });
}, },
clearData() {
this.setData({
repealVisible: false,
repealId: '',
repealReason: ''
})
},
toshowErrorOrder(e) { toshowErrorOrder(e) {
const { item } = e.currentTarget.dataset; const { item } = e.currentTarget.dataset;
this.setData( this.setData(
......
...@@ -287,4 +287,24 @@ ...@@ -287,4 +287,24 @@
<view wx:if="{{ showRendering }}"> <view wx:if="{{ showRendering }}">
<order-screen show="{{ show_confirm }}" userInfo="{{ userInfo }}" navBarHeight="{{ navBarHeight }}" status="{{ orderStatus }}" bindconfirm="searchScreen" /> <order-screen show="{{ show_confirm }}" userInfo="{{ userInfo }}" navBarHeight="{{ navBarHeight }}" status="{{ orderStatus }}" bindconfirm="searchScreen" />
</view> </view>
</page-container>
\ No newline at end of file \ No newline at end of file
</page-container>
<view class="repeal-modal" wx:if="{{repealVisible}}">
<view class="repeal-wrap">
<view class="title">
撤销原因
</view>
<view class='textarea-wrap'>
<textarea class='textarea' maxlength="{{30}}" value='{{repealReason}}' focus="{{true}}"
placeholder="请填写撤销工单原因,最多30个字" bindinput='textareaInput' ></textarea>
</view>
<view class="footer">
<view class="btn" bindtap="cancelRepeal">
取消
</view>
<view class="btn" bindtap="confirmRepeal">
确定
</view>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
...@@ -813,4 +813,67 @@ ...@@ -813,4 +813,67 @@
.text-hideWidth { .text-hideWidth {
width: calc(100% - 36rpx); width: calc(100% - 36rpx);
}
\ No newline at end of file \ No newline at end of file
}
.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;
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
var dateContrast = function (params) { var dateContrast = function (params) {
var oneDay = 24 * 60 * 60 * 1000 // 一天的毫秒数 var oneDay = 24 * 60 * 60 * 1000 // 一天的毫秒数
var currentDate = getDate().getTime() // 当前日期 var currentDate = getDate().getTime() // 当前日期
var targetDate = getDate(params + ' 00:00:00').getTime() // 给定的日期 零点的时间戳 var targetDate = getDate(params).getTime() - (8 * 60 * 60 * 1000) // 给定的日期 零点的时间戳
return targetDate < currentDate + oneDay return targetDate < currentDate + oneDay
} }
...@@ -10,9 +10,9 @@ var dateContrast = function (params) { ...@@ -10,9 +10,9 @@ var dateContrast = function (params) {
var isShowBtns = function (date) { var isShowBtns = function (date) {
var oneDay = 24 * 60 * 60 * 1000 // 一天的毫秒数 var oneDay = 24 * 60 * 60 * 1000 // 一天的毫秒数
var currentDate = getDate() // 当前日期 var currentDate = getDate() // 当前日期
var targetDate = getDate(date + ' 00:00:00') // 给定的日期 var targetDate = getDate(date) // 给定的日期
// 计算给定日期与当前日期的时间差(以毫秒为单位) // 计算给定日期与当前日期的时间差(以毫秒为单位)
var diffMilliseconds = targetDate - currentDate var diffMilliseconds = (targetDate - 8 * 60 * 60 * 1000) - currentDate // targetDate是当天8点 减去8小时
// 计算时间差对应的天数 // 计算时间差对应的天数
var diffDays = Math.floor(diffMilliseconds / oneDay) var diffDays = Math.floor(diffMilliseconds / oneDay)
return diffDays >= -1 return diffDays >= -1
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!