瀏覽代碼

[砍价和停车][修复];[bug的修复]

tags/C.7.1.0
meo 6 年之前
父節點
當前提交
1c2aa16338
共有 5 個檔案被更改,包括 243 行新增265 行删除
  1. +220
    -222
      pages/bargain/bargainDatail/bargainDatail.js
  2. +3
    -3
      pages/bargain/bargainDatail/bargainDatail.wxml
  3. +6
    -21
      pages/bargain/bargainDatail/bargainDatail.wxss
  4. +2
    -0
      pages/coupon/detail/index.js
  5. +12
    -19
      pages/passCar/passCar.js

+ 220
- 222
pages/bargain/bargainDatail/bargainDatail.js 查看文件

@@ -24,7 +24,6 @@ Page({
discountStatus: null,
disabled: false,
display: "block!important",
showButton: false,
showButton1: false
},

@@ -69,7 +68,6 @@ Page({
var todayDate = new Date().getTime();
that.setData({
todayDate: todayDate,
showButton: false,
showButton1: false
})
if (that.data.pressEndDate) {
@@ -294,226 +292,226 @@ Page({
/**
* 按原价付款
*/
orderFunc1(e) {
var that = this;
let formId = e.detail.formId;
that.setData({
showButton: true
})
Http.get({
url: config.api.checkPhoneStatus,
data: {}
})
.then(res => {
that.setData({
showButton: false
})
/**
* orderSave 下单
*/
var data = {
couponChannelId:e.currentTarget.dataset.couponchannelid,
couponId:e.currentTarget.dataset.couponid,
formId:formId
}
return Http.post({
url: config.api.orderSave,
data: data
});
})
.catch(err => {
that.setData({
showButton: true
})
if (err.code == 2011) {
wx.showToast({
title: "商户信息没找到",
image: './../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == 2013) {
wx.showToast({
title: "商户信息禁用",
image: './../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == 3000) {
wx.showToast({
title: "库存不足",
image: './../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == 3001) {
wx.showToast({
title: "您已超过限购",
image: './../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == 3002) {
wx.showToast({
title: "订单失败",
image: './../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == 3003) {
wx.showToast({
title: "订单不存在",
image: './../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == 3004) {
wx.showToast({
title: "订单不存在",
image: './../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == 4003) {
wx.showToast({
title: "卡券已作废",
image: './../../../assets/images/fail.png',
duration: 2000,
mask: false
});
} else if (err.code == 3012) {
wx.showModal({
title: '提示',
content: "您有未支付订单,请到'我的-我的砍价'进行支付",
showCancel: false,
success: function (res) {
console.log(res.confirm)
if (res.confirm) {
}
}
})
}else if (err.code == 11005) {
/**
* 将值传到用户手机号授权的页面
*
*/
wx.redirectTo({
url: "/pages/getphoneInfo/index?couponChannelId=" +
that.data.couponChannelId +
"&couponId=" +
that.data.couponId
});
} else if (err.code == 11006) {
// 用户手机已加密
wx.redirectTo({
url: "/pages/phoneinput/phoneinput?couponChannelId=" +
that.data.couponChannelId +
"&couponId=" +
that.data.couponId
});
} else {
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000,
mask: false
});
}
}).then(res => {
console.log(res);
if (typeof(res) != "undefined") {
let orderId = "" + res.data.id;
that.setData({
orderId: orderId
});
if (e.currentTarget.dataset.saleprice / 100 > 0 || e.currentTarget.dataset.price / 100 > 0) {
/**
* 支付订单创建
*/
Http.post({
url: config.api.payOrderCreate,
data: {
orderId: orderId
}
})
.then(res => {
var payOrderId = "" + res.data.payOrderId;
wx.hideLoading();
wx.requestPayment({
timeStamp: res.data.timeStamp,
nonceStr: res.data.nonceStr,
package: res.data.package,
signType: (res.data.signType) ? res.data.signType : "MD5",
paySign: res.data.paySign,
success: res => {
wx.showLoading({
title: '订单正在处理中...',
})
setTimeout(function() {
wx.hideLoading()
}, 5000)
that.payOrderUpdate(that.data.orderId, payOrderId, 1, '', '', that);
if (res.errMsg == "requestPayment:ok") {
setTimeout(function() {
wx.hideLoading();
}, 2000);
/**
* 用户支付成功以后跳转到券包列表
*/
if (that.data.cardType == 100) {
wx.setStorage({
key: 'couponNum2',
data: "couponNum2"
})
} else {
wx.setStorage({
key: 'couponNum',
data: "couponNum"
})
}
}
},
fail: res => {
/**
* 支付失败,需要更新订单的状态
*/
that.payOrderUpdate(that.data.orderId, payOrderId, 2, '', 'fail', that);
that.setData({
showbutton: false
})
return;
},
complete: res => {}
});
/// End payment --------
})
.catch(err => {
console.log(err);
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000,
mask: false
});
})
} else {
// 免费券
that.payOrderUpdate(orderId, "0", 1, '', 'free', that);
if (that.data.cardType == 100) {
wx.setStorage({
key: 'couponNum2',
data: "couponNum2"
})
} else {
wx.setStorage({
key: 'couponNum',
data: "couponNum"
})
}
}
}
})
},
// orderFunc1(e) {
// var that = this;
// let formId = e.detail.formId;
// that.setData({
// showButton: true
// })
// Http.get({
// url: config.api.checkPhoneStatus,
// data: {}
// })
// .then(res => {
// that.setData({
// showButton: false
// })
// /**
// * orderSave 下单
// */
// var data = {
// couponChannelId:e.currentTarget.dataset.couponchannelid,
// couponId:e.currentTarget.dataset.couponid,
// formId:formId
// }
// return Http.post({
// url: config.api.orderSave,
// data: data
// });
// })
// .catch(err => {
// that.setData({
// showButton: true
// })
// if (err.code == 2011) {
// wx.showToast({
// title: "商户信息没找到",
// image: './../../../assets/images/fail.png',
// duration: 2000,
// mask: false
// });
// } else if (err.code == 2013) {
// wx.showToast({
// title: "商户信息禁用",
// image: './../../../assets/images/fail.png',
// duration: 2000,
// mask: false
// });
// } else if (err.code == 3000) {
// wx.showToast({
// title: "库存不足",
// image: './../../../assets/images/fail.png',
// duration: 2000,
// mask: false
// });
// } else if (err.code == 3001) {
// wx.showToast({
// title: "您已超过限购",
// image: './../../../assets/images/fail.png',
// duration: 2000,
// mask: false
// });
// } else if (err.code == 3002) {
// wx.showToast({
// title: "订单失败",
// image: './../../../assets/images/fail.png',
// duration: 2000,
// mask: false
// });
// } else if (err.code == 3003) {
// wx.showToast({
// title: "订单不存在",
// image: './../../../assets/images/fail.png',
// duration: 2000,
// mask: false
// });
// } else if (err.code == 3004) {
// wx.showToast({
// title: "订单不存在",
// image: './../../../assets/images/fail.png',
// duration: 2000,
// mask: false
// });
// } else if (err.code == 4003) {
// wx.showToast({
// title: "卡券已作废",
// image: './../../../assets/images/fail.png',
// duration: 2000,
// mask: false
// });
// } else if (err.code == 3012) {
// wx.showModal({
// title: '提示',
// content: "您有未支付订单进行支付",
// showCancel: false,
// success: function (res) {
// console.log(res.confirm)
// if (res.confirm) {
// }
// }
// })
// }else if (err.code == 11005) {
// /**
// * 将值传到用户手机号授权的页面
// *
// */
// wx.redirectTo({
// url: "/pages/getphoneInfo/index?couponChannelId=" +
// that.data.couponChannelId +
// "&couponId=" +
// that.data.couponId
// });
// } else if (err.code == 11006) {
// // 用户手机已加密
// wx.redirectTo({
// url: "/pages/phoneinput/phoneinput?couponChannelId=" +
// that.data.couponChannelId +
// "&couponId=" +
// that.data.couponId
// });
// } else {
// wx.showToast({
// title: err.message,
// icon: 'none',
// duration: 2000,
// mask: false
// });
// }
// }).then(res => {
// console.log(res);
// if (typeof(res) != "undefined") {
// let orderId = "" + res.data.id;
// that.setData({
// orderId: orderId
// });
// if (e.currentTarget.dataset.saleprice / 100 > 0 || e.currentTarget.dataset.price / 100 > 0) {
// /**
// * 支付订单创建
// */
// Http.post({
// url: config.api.payOrderCreate,
// data: {
// orderId: orderId
// }
// })
// .then(res => {
// var payOrderId = "" + res.data.payOrderId;
// wx.hideLoading();
// wx.requestPayment({
// timeStamp: res.data.timeStamp,
// nonceStr: res.data.nonceStr,
// package: res.data.package,
// signType: (res.data.signType) ? res.data.signType : "MD5",
// paySign: res.data.paySign,
// success: res => {
// wx.showLoading({
// title: '订单正在处理中...',
// })
// setTimeout(function() {
// wx.hideLoading()
// }, 5000)
// that.payOrderUpdate(that.data.orderId, payOrderId, 1, '', '', that);
// if (res.errMsg == "requestPayment:ok") {
// setTimeout(function() {
// wx.hideLoading();
// }, 2000);
// /**
// * 用户支付成功以后跳转到券包列表
// */
// if (that.data.cardType == 100) {
// wx.setStorage({
// key: 'couponNum2',
// data: "couponNum2"
// })
// } else {
// wx.setStorage({
// key: 'couponNum',
// data: "couponNum"
// })
// }
// }
// },
// fail: res => {
// /**
// * 支付失败,需要更新订单的状态
// */
// that.payOrderUpdate(that.data.orderId, payOrderId, 2, '', 'fail', that);
// that.setData({
// showbutton: false
// })
// return;
// },
// complete: res => {}
// });
// /// End payment --------
// })
// .catch(err => {
// console.log(err);
// wx.showToast({
// title: err.message,
// icon: 'none',
// duration: 2000,
// mask: false
// });
// })
// } else {
// // 免费券
// that.payOrderUpdate(orderId, "0", 1, '', 'free', that);
// if (that.data.cardType == 100) {
// wx.setStorage({
// key: 'couponNum2',
// data: "couponNum2"
// })
// } else {
// wx.setStorage({
// key: 'couponNum',
// data: "couponNum"
// })
// }
// }
// }
// })
// },
/**
* 发起支付
*/


+ 3
- 3
pages/bargain/bargainDatail/bargainDatail.wxml 查看文件

@@ -62,11 +62,11 @@

<form bindsubmit="submit" report-submit='true' >
<view class="btns clearfix" wx:if="{{data.orderStatus != 7&&discountStatus==1&&todayDate<=data.pressEndDate&&data.orderStatus!=1&&data.orderStatus != 9}}" hover-class="none" hover-stop-propagation="false">
<button class="fl" form-type="submit" bindtap='orderFunc1' data-couponChannelId="{{data.couponChannelId}}" data-price="{{data.price/100}}" data-couponId="{{data.productId}}" disabled='{{showButton}}' data-rushtobuy='rushtobuy'>
<!-- <button class="fl" form-type="submit" bindtap='orderFunc1' data-couponChannelId="{{data.couponChannelId}}" data-price="{{data.price/100}}" data-couponId="{{data.productId}}" disabled='{{showButton}}' data-rushtobuy='rushtobuy'>
<text>{{data.price/100}}元</text>
<text>立即购买</text>
</button>
<button class='share user-motto fr' data-orderId='{{data.id}}' id="shareBtn" open-type="share" hover-class="other-button-hover">邀请好友砍价</button>
</button> -->
<button class='share user-motto' data-orderId='{{data.id}}' id="shareBtn" open-type="share" hover-class="other-button-hover">邀请好友砍价</button>
</view>
</form>
<view style='display:{{display}}' wx:if="{{data.orderStatus == 7&&discountStatus == 1}}" class="btns01 clearfix" hover-class="none" hover-stop-propagation="false">


+ 6
- 21
pages/bargain/bargainDatail/bargainDatail.wxss 查看文件

@@ -224,15 +224,16 @@ page{
/* background: #fff; */
}
.btns button{
width: 320rpx!important;
width: 500rpx!important;
height: 95rpx;
border-radius:48rpx;
text-align: center;
}
.btns .fl{
margin: 0 auto;
font-size: 30rpx;
color: #fff;
background:#FFAF02;
box-shadow:0px 8px 8px 1px rgba(255,169,2,0.32);
line-height: 95rpx;
background:linear-gradient(90deg,rgba(229,54,40,1) 0%,rgba(243,75,30,1) 99%);
box-shadow:0px 8px 8px 1px rgba(204,26,13,0.32);
}
.goback{
position: fixed;
@@ -255,22 +256,6 @@ page{
bottom: 0;
margin: auto;
}
.btns .fl text{
display: block;
font-size: 30rpx;
line-height: 34rpx;
}
.btns .fl text:nth-of-type(1){
margin-top: 12rpx;
}
.btns .fr{
font-size: 30rpx;
color: #fff;
line-height: 95rpx;
width: 256rpx;
background:linear-gradient(90deg,rgba(229,54,40,1) 0%,rgba(243,75,30,1) 99%);
box-shadow:0px 8px 8px 1px rgba(204,26,13,0.32);
}
.helpDiscount{
display: block;
width: 200rpx;


+ 2
- 0
pages/coupon/detail/index.js 查看文件

@@ -320,6 +320,7 @@ Page({
.then(res => {
wx.hideLoading();
if (res.data == undefined) {
// 立即购买
that.orderFunc(discount);
that.setData({
flag: false
@@ -668,6 +669,7 @@ Page({
data: {}
})
.then(res => {
// 发起砍价
if (discount == 'discount') {
var data = {
couponChannelId: "" + that.data.couponChannelId,


+ 12
- 19
pages/passCar/passCar.js 查看文件

@@ -503,25 +503,18 @@ Page({
* flag ==flags
* 表示从首页onShow进来的
*/
// if (flag == "flags" && res.data.length > 0) {
// var listCardNum = res.data[0].carNumber;
// that.setData({
// listCardNum: listCardNum
// })
// /**
// * 获得停车费用
// */
// that.getStopFee(listCardNum);
// }
var listCardNum = res.data[0].carNumber;
that.setData({
listCardNum: listCardNum,
current:0
})
/**
* 获得停车费用
*/
that.getStopFee(listCardNum);
if (res.data&&res.data.length > 0) {
var listCardNum = res.data[0].carNumber;
that.setData({
listCardNum: listCardNum,
current: 0
})
/**
* 获得停车费用
*/
that.getStopFee(listCardNum);
}
})
.catch(err => {
wx.showToast({


Loading…
取消
儲存