订单页面调整,取消按钮是否显示
This commit is contained in:
parent
5238689f64
commit
4b14dad298
|
@ -372,7 +372,9 @@
|
|||
class="btns">联系客服</u-button>
|
||||
</view>
|
||||
<view class="showBtn tabber" v-if="order.status ==2">
|
||||
<u-button @click="cancelOrder(order)" :custom-style="customStyle" shape="circle" :hair-line="true" class="btns">
|
||||
<u-button
|
||||
v-if="order.cancelBtnShow == 'true'"
|
||||
@click="cancelOrder(order)" :custom-style="customStyle" shape="circle" :hair-line="true" class="btns">
|
||||
取消订单
|
||||
</u-button>
|
||||
<u-button v-if="order.btnShow == 'true'" :custom-style="customStyle2" shape="circle" :plain="true"
|
||||
|
@ -429,7 +431,9 @@
|
|||
</view>
|
||||
<view class="showBtn-view" v-if="gengBtnShow==true"
|
||||
:style="gengNum==index?{display:'inline-block'}:{display:'none'}">
|
||||
<view :custom-style="customStyle2" @click="cancelOrder(order)" shape="circle" class="eject-btns"
|
||||
<view
|
||||
v-if="order.cancelBtnShow == 'true'"
|
||||
:custom-style="customStyle2" @click="cancelOrder(order)" shape="circle" class="eject-btns"
|
||||
:hair-line="true">
|
||||
取消订单
|
||||
</view>
|
||||
|
@ -462,7 +466,9 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="showBtn tabber" v-if="order.status ==7">
|
||||
<u-button @click="cancelOrder(order)" shape="circle" :custom-style="customStyle" :hair-line="true" class="btns">
|
||||
<u-button
|
||||
v-if="order.cancelBtnShow == 'true'"
|
||||
@click="cancelOrder(order)" shape="circle" :custom-style="customStyle" :hair-line="true" class="btns">
|
||||
取消订单
|
||||
</u-button>
|
||||
<u-button
|
||||
|
@ -477,7 +483,9 @@
|
|||
class="btns">联系客服</u-button>
|
||||
</view>
|
||||
<view class="showBtn tabber" v-if="order.status ==8">
|
||||
<u-button class="btns" @click="cancelOrder(order)" shape="circle" :custom-style="customStyle" :hair-line="true">
|
||||
<u-button
|
||||
v-if="order.cancelBtnShow == 'true'"
|
||||
class="btns" @click="cancelOrder(order)" shape="circle" :custom-style="customStyle" :hair-line="true">
|
||||
取消订单
|
||||
</u-button>
|
||||
<u-button
|
||||
|
@ -492,7 +500,9 @@
|
|||
class="btns">联系客服</u-button>
|
||||
</view>
|
||||
<view class="showBtn tabber" v-if="order.status ==9">
|
||||
<u-button class="btns" @click="cancelOrder(order)" shape="circle" :custom-style="customStyle" :hair-line="true">
|
||||
<u-button
|
||||
v-if="order.cancelBtnShow == 'true'"
|
||||
class="btns" @click="cancelOrder(order)" shape="circle" :custom-style="customStyle" :hair-line="true">
|
||||
取消订单
|
||||
</u-button>
|
||||
<u-button v-if="order.refusalContent" :custom-style="customStyle2"
|
||||
|
@ -505,7 +515,9 @@
|
|||
class="btns">联系客服</u-button>
|
||||
</view>
|
||||
<view class="showBtn tabber" v-if="order.status ==10">
|
||||
<u-button @click="cancelOrder(order)" shape="circle" :custom-style="customStyle" :hair-line="true" class="btns">
|
||||
<u-button
|
||||
v-if="order.cancelBtnShow == 'true'"
|
||||
@click="cancelOrder(order)" shape="circle" :custom-style="customStyle" :hair-line="true" class="btns">
|
||||
取消订单
|
||||
</u-button>
|
||||
<u-button :custom-style="customStyle2"
|
||||
|
@ -765,6 +777,7 @@ export default {
|
|||
jiazhong:'',
|
||||
shengji:'',
|
||||
gengBtnShow:false,
|
||||
cancelBtnShow:true,
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
|
@ -1316,7 +1329,8 @@ export default {
|
|||
this.order["technicianTypeName"] = "资深"
|
||||
}
|
||||
var date = new Date(); // 当前日期和时间
|
||||
var timestamp = this.getTimeStampWithoutSeconds(date); // 不含秒的时间戳
|
||||
// var timestamp = this.getTimeStampWithoutSeconds(date); // 不含秒的时间戳
|
||||
var timestamp = parseInt(date.getTime()); // 不含秒的时间戳
|
||||
const twoHoursInMilliseconds = 2 * 60 * 60 * 1000; // 两个小时的毫秒数
|
||||
var twoTime=parseInt(new Date(twoHoursInMilliseconds).getTime())
|
||||
var time=parseInt(new Date(this.order.serveTime).getTime())
|
||||
|
@ -1325,6 +1339,24 @@ export default {
|
|||
}else{
|
||||
this.$set(this.order, 'btnShow', 'false')
|
||||
}
|
||||
const fifteenMinutesInMilliseconds = 15 * 60 * 1000; // 15分钟的毫秒数
|
||||
var fifteenTime=parseInt(new Date(fifteenMinutesInMilliseconds).getTime())
|
||||
if(timestamp-time<fifteenTime){
|
||||
this.$set(this.order, 'cancelBtnShow', 'true')
|
||||
}else{
|
||||
this.$set(this.order, 'cancelBtnShow', 'false')
|
||||
}
|
||||
if(this.order.cancelBtnShow == 'true'){
|
||||
if(this.order.addNum == null){
|
||||
if(this.order.isSupplement == null){
|
||||
this.$set(this.order, 'cancelBtnShow', 'true')
|
||||
}else{
|
||||
this.$set(this.order, 'cancelBtnShow', 'false')
|
||||
}
|
||||
}else{
|
||||
this.$set(this.order, 'cancelBtnShow', 'false')
|
||||
}
|
||||
}
|
||||
let aliphone = this.$queue.getData('aliphone');
|
||||
if (aliphone === '是' && this.order.artificer) {
|
||||
this.ysPhone(this.order.phone, this.order.artificer.phone);
|
||||
|
@ -2281,6 +2313,7 @@ export default {
|
|||
//取消订单扣费
|
||||
that.$Request.post('/app/artificer/cancelOrdersMoney', data).then(resa => {
|
||||
uni.hideLoading();
|
||||
console.log(resa);
|
||||
if (resa.code == 0) {
|
||||
that.page = 1;
|
||||
uni.showModal({
|
||||
|
@ -2297,7 +2330,7 @@ export default {
|
|||
}
|
||||
});
|
||||
} else {
|
||||
that.$queue.showToast(res.msg);
|
||||
that.$queue.showToast(resa.msg);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
@ -290,7 +290,8 @@
|
|||
|
||||
<view class="showBtn tabber">
|
||||
<u-button @click="cancelOrder(order)" shape="circle" :custom-style="customStyle" :hair-line="true" class="btns"
|
||||
v-if="(order.status == 1 || order.status == 2 || order.status == 7 || order.status == 8) && yhqxSel != '否'">取消订单
|
||||
v-if="(order.status != 3 && order.status != 4 && order.status != 5) && yhqxSel != '否' && order.cancelBtnShow == 'true'"
|
||||
>取消订单
|
||||
</u-button>
|
||||
<u-button @click="openpay(order)" shape="circle" :custom-style="customStyle2" :hair-line="true"
|
||||
v-if="order.status == 1" class="btns">立即支付
|
||||
|
@ -539,7 +540,8 @@
|
|||
this.order["technicianTypeName"] = "资深"
|
||||
}
|
||||
var date = new Date(); // 当前日期和时间
|
||||
var timestamp = this.getTimeStampWithoutSeconds(date); // 不含秒的时间戳
|
||||
// var timestamp = this.getTimeStampWithoutSeconds(date); // 不含秒的时间戳
|
||||
var timestamp = parseInt(date.getTime());
|
||||
const twoHoursInMilliseconds = 2 * 60 * 60 * 1000; // 两个小时的毫秒数
|
||||
var twoTime = parseInt(new Date(twoHoursInMilliseconds).getTime())
|
||||
var time = parseInt(new Date(this.order.serveTime).getTime())
|
||||
|
@ -548,6 +550,24 @@
|
|||
} else {
|
||||
this.$set(this.order, 'btnShow', 'false')
|
||||
}
|
||||
const fifteenMinutesInMilliseconds = 15 * 60 * 1000; // 15分钟的毫秒数
|
||||
var fifteenTime=parseInt(new Date(fifteenMinutesInMilliseconds).getTime())
|
||||
if(timestamp-time<fifteenTime){
|
||||
this.$set(this.order, 'cancelBtnShow', 'true')
|
||||
}else{
|
||||
this.$set(this.order, 'cancelBtnShow', 'false')
|
||||
}
|
||||
if(this.order.cancelBtnShow == 'true'){
|
||||
if(this.order.addNum == null){
|
||||
if(this.order.isSupplement == null){
|
||||
this.$set(this.order, 'cancelBtnShow', 'true')
|
||||
}else{
|
||||
this.$set(this.order, 'cancelBtnShow', 'false')
|
||||
}
|
||||
}else{
|
||||
this.$set(this.order, 'cancelBtnShow', 'false')
|
||||
}
|
||||
}
|
||||
console.log("sadasdsa0", this.order)
|
||||
let aliphone = this.$queue.getData('aliphone');
|
||||
if (aliphone === '是' && this.order.artificer) {
|
||||
|
|
|
@ -243,7 +243,7 @@
|
|||
|
||||
<view class="flex tabber padding-top-sm padding-bottom-sm align-center">
|
||||
<u-button @click="cancelOrder(order)" shape="circle" :custom-style="customStyle" :hair-line="true" class="btns"
|
||||
v-if="(order.status == 1 || order.status == 2 || order.status == 7 || order.status == 8) && yhqxSel != '否'">取消订单
|
||||
v-if="(order.status != 3 && order.status != 4 && order.status != 5) && yhqxSel != '否' && order.cancelBtnShow == 'true'">取消订单
|
||||
</u-button>
|
||||
<u-button @click="openpay(order)" shape="circle" :custom-style="customStyle2" :hair-line="true"
|
||||
v-if="order.status == 1"
|
||||
|
@ -492,16 +492,35 @@
|
|||
this.order["technicianTypeName"] = "资深"
|
||||
}
|
||||
var date = new Date(); // 当前日期和时间
|
||||
var timestamp = this.getTimeStampWithoutSeconds(date); // 不含秒的时间戳
|
||||
// var timestamp = this.getTimeStampWithoutSeconds(date); // 不含秒的时间戳
|
||||
var timestamp = parseInt(date.getTime());
|
||||
const twoHoursInMilliseconds = 2 * 60 * 60 * 1000; // 两个小时的毫秒数
|
||||
var twoTime=parseInt(new Date(twoHoursInMilliseconds).getTime())
|
||||
var time=parseInt(new Date(this.order.serveTime).getTime())
|
||||
if(time-timestamp>twoTime){
|
||||
this.$set(this.order, 'btnShow', 'true')
|
||||
if(time-timestamp>twoTime){
|
||||
this.$set(this.order, 'btnShow', 'true')
|
||||
}else{
|
||||
this.$set(this.order, 'btnShow', 'false')
|
||||
}
|
||||
console.log("sadasdsa0",this.order)
|
||||
const fifteenMinutesInMilliseconds = 15 * 60 * 1000; // 15分钟的毫秒数
|
||||
var fifteenTime=parseInt(new Date(fifteenMinutesInMilliseconds).getTime())
|
||||
if(timestamp-time<fifteenTime){
|
||||
this.$set(this.order, 'cancelBtnShow', 'true')
|
||||
}else{
|
||||
this.$set(this.order, 'cancelBtnShow', 'false')
|
||||
}
|
||||
if(this.order.cancelBtnShow == 'true'){
|
||||
if(this.order.addNum == null){
|
||||
if(this.order.isSupplement == null){
|
||||
this.$set(this.order, 'cancelBtnShow', 'true')
|
||||
}else{
|
||||
this.$set(this.order, 'cancelBtnShow', 'false')
|
||||
}
|
||||
}else{
|
||||
this.$set(this.order, 'btnShow', 'false')
|
||||
this.$set(this.order, 'cancelBtnShow', 'false')
|
||||
}
|
||||
console.log("sadasdsa0",this.order)
|
||||
}
|
||||
let aliphone = this.$queue.getData('aliphone');
|
||||
if (aliphone === '是' && this.order.artificer) {
|
||||
this.ysPhone(this.order.phone, this.order.artificer.phone);
|
||||
|
|
|
@ -217,7 +217,7 @@
|
|||
<u-button @click="cancelOrder(order)" shape="circle" :custom-style="customStyle" :hair-line="true"
|
||||
v-if="order.status != 3 &&
|
||||
order.status != 4 &&
|
||||
order.status != 5
|
||||
order.status != 5 && order.cancelBtnShow == 'true'
|
||||
"
|
||||
class="btns">取消订单
|
||||
</u-button>
|
||||
|
@ -579,16 +579,35 @@
|
|||
this.order["technicianTypeName"] = "资深"
|
||||
}
|
||||
var date = new Date(); // 当前日期和时间
|
||||
var timestamp = this.getTimeStampWithoutSeconds(date); // 不含秒的时间戳
|
||||
// var timestamp = this.getTimeStampWithoutSeconds(date); // 不含秒的时间戳
|
||||
var timestamp = parseInt(date.getTime());
|
||||
const twoHoursInMilliseconds = 2 * 60 * 60 * 1000; // 两个小时的毫秒数
|
||||
var twoTime=parseInt(new Date(twoHoursInMilliseconds).getTime())
|
||||
var time=parseInt(new Date(this.order.serveTime).getTime())
|
||||
if(time-timestamp>twoTime){
|
||||
this.$set(this.order, 'btnShow', 'true')
|
||||
if(time-timestamp>twoTime){
|
||||
this.$set(this.order, 'btnShow', 'true')
|
||||
}else{
|
||||
this.$set(this.order, 'btnShow', 'false')
|
||||
}
|
||||
const fifteenMinutesInMilliseconds = 15 * 60 * 1000; // 15分钟的毫秒数
|
||||
var fifteenTime=parseInt(new Date(fifteenMinutesInMilliseconds).getTime())
|
||||
if(timestamp-time<fifteenTime){
|
||||
this.$set(this.order, 'cancelBtnShow', 'true')
|
||||
}else{
|
||||
this.$set(this.order, 'cancelBtnShow', 'false')
|
||||
}
|
||||
if(this.order.cancelBtnShow == 'true'){
|
||||
if(this.order.addNum == null){
|
||||
if(this.order.isSupplement == null){
|
||||
this.$set(this.order, 'cancelBtnShow', 'true')
|
||||
}else{
|
||||
this.$set(this.order, 'cancelBtnShow', 'false')
|
||||
}
|
||||
}else{
|
||||
this.$set(this.order, 'btnShow', 'false')
|
||||
this.$set(this.order, 'cancelBtnShow', 'false')
|
||||
}
|
||||
console.log("sadasdsa0",this.order)
|
||||
}
|
||||
console.log("sadasdsa0",this.order)
|
||||
let aliphone = this.$queue.getData('aliphone');
|
||||
if (aliphone === '是' && this.order.artificer) {
|
||||
this.ysPhone(this.order.phone, this.order.artificer.phone);
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
|
||||
</view>
|
||||
<view class="showBtn" v-if="item.status ==2">
|
||||
<u-button
|
||||
<u-button v-if="item.cancelBtnShow == 'true'"
|
||||
:custom-style="customStyle" shape="circle" :plain="true"
|
||||
class="btns xianshi"
|
||||
@click="cancelOrder(item)">
|
||||
|
@ -129,15 +129,21 @@
|
|||
<view class="gengduo" @click.stop="gengBtn(index)" v-show="item.status ==6||item.status ==1">
|
||||
更多
|
||||
</view>
|
||||
<view class="gengduoShow">
|
||||
<view class="gengduoShow" v-if="item.earlyFinishReason==null">
|
||||
<u-button
|
||||
v-if="item.addNum==null&&item.isSupplement==null&&item.isSupplement!=2"
|
||||
v-if="item.addNum==null&&item.isSupplement==null"
|
||||
:custom-style="customStyle" shape="circle" :plain="true"
|
||||
class="btns"
|
||||
@click="goNav('/my/order/pay?ordersId='+item.ordersId,item)">
|
||||
服务升级
|
||||
</u-button>
|
||||
<u-button
|
||||
v-else-if="item.addNum==null&&item.isSupplement!=2"
|
||||
:custom-style="customStyle" shape="circle" :plain="true"
|
||||
class="btns"
|
||||
@click="goNav('/my/order/pay?ordersId='+item.ordersId,item)">
|
||||
服务升级
|
||||
</u-button>
|
||||
|
||||
<u-button :custom-style="customStyle1" class="btns" shape="circle" :plain="true"
|
||||
@click="goNav('/my/wallet/index?artificerId='+item.artificerId+'&ordersId='+item.ordersId,item)">
|
||||
充值
|
||||
|
@ -147,11 +153,17 @@
|
|||
加钟
|
||||
</u-button>
|
||||
</view>
|
||||
<view class="gengduoShow" v-else>
|
||||
<u-button :custom-style="customStyle1" class="btns" shape="circle" :plain="true"
|
||||
@click="goNav('/my/wallet/index?artificerId='+item.artificerId+'&ordersId='+item.ordersId,item)">
|
||||
充值
|
||||
</u-button>
|
||||
</view>
|
||||
<view class="showBtn-view" v-if="gengBtnShow==true" :style="gengNum==index?{display:'inline-block'}:{display:'none'}">
|
||||
<view @click="goNav('/my/order/pay?ordersId='+item.ordersId,item)" class="gengduoBtn">
|
||||
联系客服
|
||||
</view>
|
||||
<view v-if="item.addNum==null&&item.oldOrdersId==null"
|
||||
<view v-if="item.cancelBtnShow == 'true'"
|
||||
@click="cancelOrder(item)" class="gengduoBtn">
|
||||
取消订单
|
||||
</view>
|
||||
|
@ -179,7 +191,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="showBtn" v-if="item.status ==7">
|
||||
<u-button
|
||||
<u-button v-if="item.cancelBtnShow == 'true'"
|
||||
:custom-style="customStyle" shape="circle" :plain="true"
|
||||
class="btns xianshi"
|
||||
@click="cancelOrder(item)">
|
||||
|
@ -196,7 +208,7 @@
|
|||
</u-button>
|
||||
</view>
|
||||
<view class="showBtn" v-if="item.status ==8">
|
||||
<u-button
|
||||
<u-button v-if="item.cancelBtnShow == 'true'"
|
||||
:custom-style="customStyle" shape="circle" :plain="true"
|
||||
class="btns xianshi"
|
||||
@click="cancelOrder(item)">
|
||||
|
@ -213,7 +225,7 @@
|
|||
</u-button>
|
||||
</view>
|
||||
<view class="showBtn" v-if="item.status ==9">
|
||||
<u-button
|
||||
<u-button v-if="item.cancelBtnShow == 'true'"
|
||||
:custom-style="customStyle" shape="circle" :plain="true"
|
||||
class="btns xianshi"
|
||||
@click="cancelOrder(item)">
|
||||
|
@ -229,7 +241,7 @@
|
|||
</u-button>
|
||||
</view>
|
||||
<view class="showBtn" v-if="item.status ==10">
|
||||
<u-button
|
||||
<u-button v-if="item.cancelBtnShow == 'true'"
|
||||
:custom-style="customStyle" shape="circle" :plain="true"
|
||||
class="btns xianshi"
|
||||
@click="cancelOrder(item)">
|
||||
|
@ -516,24 +528,43 @@
|
|||
page: this.page,
|
||||
limit: this.limit
|
||||
}
|
||||
|
||||
// selectOrdersList
|
||||
this.$Request.get('/app/artificer/selectAppOrdersList', data).then(res => {
|
||||
|
||||
if (res.code == 0) {
|
||||
uni.hideLoading();
|
||||
if (this.page == 1) this.goods = []; //如果是第一页需手动制空列表
|
||||
this.goods = [...this.goods, ...res.data.list]; //追加新数据
|
||||
var timestamp = this.timeToMilliseconds(this.getCurrentTime);
|
||||
// var timestamp = this.timeToMilliseconds(this.getCurrentTime);
|
||||
var timestamp = (new Date()).getTime();
|
||||
var twoTime=2* 60 * 60 * 1000;
|
||||
var fifteenTime = 15 * 60 * 1000; // 15分钟的毫秒数
|
||||
var time='';
|
||||
|
||||
for(var i=0;i<this.goods.length;i++){
|
||||
time=this.timeToMilliseconds(this.goods[i].serveTime.slice(11, 16))
|
||||
// time=this.timeToMilliseconds(this.goods[i].serveTime.slice(11, 16))
|
||||
time= new Date(this.goods[i].serveTime).getTime()
|
||||
if(time - timestamp>twoTime){
|
||||
this.$set(this.goods[i], 'btnShow', 'true')
|
||||
}else{
|
||||
this.$set(this.goods[i], 'btnShow', 'false')
|
||||
}
|
||||
|
||||
if(timestamp-time<fifteenTime){
|
||||
this.$set(this.goods[i], 'cancelBtnShow', 'true')
|
||||
}else{
|
||||
this.$set(this.goods[i], 'cancelBtnShow', 'false')
|
||||
}
|
||||
if(this.goods[i].cancelBtnShow == 'true'){
|
||||
if(this.goods[i].addNum == null){
|
||||
if(this.goods[i].isSupplement == null){
|
||||
this.$set(this.goods[i], 'cancelBtnShow', 'true')
|
||||
}else{
|
||||
this.$set(this.goods[i], 'cancelBtnShow', 'false')
|
||||
}
|
||||
}else{
|
||||
this.$set(this.goods[i], 'cancelBtnShow', 'false')
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log("this.goods[i].serveTime.slice(15, 16)",this.goods)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue