mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 19:03:27 +08:00
【修复】修复消息模板中定义了date,日期包含时间的,导致消息发送失败的问题,使用DateTime.Now截取年月日处理。
【优化】支付成功后跳转到查询页面,在页面loading两秒,防止微信支付回调接口延迟,导致状态查询失败,但是已经支付成功的情况。
This commit is contained in:
@@ -135,7 +135,7 @@ namespace CoreCms.Net.RedisMQ
|
|||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(parameters["createTime"]!.ToString()))
|
if (!string.IsNullOrEmpty(parameters["createTime"]!.ToString()))
|
||||||
{
|
{
|
||||||
templateMessageData[templateData.data03] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["createTime"].ToString() };
|
templateMessageData[templateData.data03] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = Convert.ToDateTime(parameters["createTime"].ToString()).ToString("yyyy年MM月dd日 HH:mm") };
|
||||||
}
|
}
|
||||||
templateMessageData[templateData.data04] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = "订单即将失效,请及时付款!" };
|
templateMessageData[templateData.data04] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = "订单即将失效,请及时付款!" };
|
||||||
pageUrl = "/pages/member/order/detail/detail?orderId=" + parameters["orderId"];
|
pageUrl = "/pages/member/order/detail/detail?orderId=" + parameters["orderId"];
|
||||||
@@ -152,7 +152,7 @@ namespace CoreCms.Net.RedisMQ
|
|||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(parameters["paymentTime"]!.ToString()))
|
if (!string.IsNullOrEmpty(parameters["paymentTime"]!.ToString()))
|
||||||
{
|
{
|
||||||
templateMessageData[templateData.data03] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["paymentTime"].ToString() };
|
templateMessageData[templateData.data03] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = Convert.ToDateTime(parameters["paymentTime"].ToString()).ToString("yyyy年MM月dd日 HH:mm") };
|
||||||
}
|
}
|
||||||
pageUrl = "/pages/member/order/detail/detail?orderId=" + parameters["orderId"];
|
pageUrl = "/pages/member/order/detail/detail?orderId=" + parameters["orderId"];
|
||||||
}
|
}
|
||||||
@@ -212,7 +212,7 @@ namespace CoreCms.Net.RedisMQ
|
|||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(parameters["createTime"]!.ToString()))
|
if (!string.IsNullOrEmpty(parameters["createTime"]!.ToString()))
|
||||||
{
|
{
|
||||||
templateMessageData[templateData.data05] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = parameters["createTime"].ToString() };
|
templateMessageData[templateData.data05] = new CgibinMessageSubscribeSendRequest.Types.DataItem() { Value = Convert.ToDateTime(parameters["createTime"].ToString()).ToString("yyyy年MM月dd日 HH:mm") };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var result = await Send(weChatUserInfo.openid, templateData.templateId, templateMessageData, pageUrl);
|
var result = await Send(weChatUserInfo.openid, templateData.templateId, templateMessageData, pageUrl);
|
||||||
@@ -311,11 +311,25 @@ namespace CoreCms.Net.RedisMQ
|
|||||||
{
|
{
|
||||||
jm.status = true;
|
jm.status = true;
|
||||||
jm.msg = "消息已发送,请注意查收";
|
jm.msg = "消息已发送,请注意查收";
|
||||||
|
jm.otherData = new
|
||||||
|
{
|
||||||
|
openId,
|
||||||
|
templateId,
|
||||||
|
tmpData,
|
||||||
|
pageUrl
|
||||||
|
};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
jm.status = false;
|
jm.status = false;
|
||||||
jm.msg = response.ErrorMessage;
|
jm.msg = response.ErrorMessage;
|
||||||
|
jm.otherData = new
|
||||||
|
{
|
||||||
|
openId,
|
||||||
|
templateId,
|
||||||
|
tmpData,
|
||||||
|
pageUrl
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return jm;
|
return jm;
|
||||||
|
|||||||
@@ -92,8 +92,8 @@
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getPayments();
|
this.getPayments();
|
||||||
console.log('类型:' + this.type);
|
//console.log('类型:' + this.type);
|
||||||
console.log('订单号:' + this.orderId);
|
//console.log('订单号:' + this.orderId);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取可用支付方式列表
|
// 获取可用支付方式列表
|
||||||
@@ -164,12 +164,10 @@
|
|||||||
signType: res.data.paymentParameters.signType,
|
signType: res.data.paymentParameters.signType,
|
||||||
paySign: res.data.paymentParameters.paySign,
|
paySign: res.data.paymentParameters.paySign,
|
||||||
success: function (e) {
|
success: function (e) {
|
||||||
|
uni.hideLoading();
|
||||||
if (e.errMsg === 'requestOrderPayment:ok') {
|
if (e.errMsg === 'requestOrderPayment:ok') {
|
||||||
_this.$u.route({ type: 'redirectTo', url: '/pages/payment/result/result?id=' + res.data.paymentId });
|
_this.$u.route({ type: 'redirectTo', url: '/pages/payment/result/result?id=' + res.data.paymentId });
|
||||||
}
|
}
|
||||||
setTimeout(function () {
|
|
||||||
uni.hideLoading();
|
|
||||||
}, 500);
|
|
||||||
},
|
},
|
||||||
fail: function (res) {
|
fail: function (res) {
|
||||||
if (res.errMsg === 'requestPayment:fail cancel') {
|
if (res.errMsg === 'requestPayment:fail cancel') {
|
||||||
@@ -191,12 +189,10 @@
|
|||||||
signType: res.data.signType,
|
signType: res.data.signType,
|
||||||
paySign: res.data.paySign,
|
paySign: res.data.paySign,
|
||||||
success: function (e) {
|
success: function (e) {
|
||||||
|
uni.hideLoading();
|
||||||
if (e.errMsg === 'requestPayment:ok') {
|
if (e.errMsg === 'requestPayment:ok') {
|
||||||
_this.$u.route({ type: 'redirectTo', url: '/pages/payment/result/result?id=' + res.data.paymentId });
|
_this.$u.route({ type: 'redirectTo', url: '/pages/payment/result/result?id=' + res.data.paymentId });
|
||||||
}
|
}
|
||||||
setTimeout(function () {
|
|
||||||
uni.hideLoading();
|
|
||||||
}, 500);
|
|
||||||
},
|
},
|
||||||
fail: function (res) {
|
fail: function (res) {
|
||||||
if (res.errMsg === 'requestPayment:fail cancel') {
|
if (res.errMsg === 'requestPayment:fail cancel') {
|
||||||
@@ -225,10 +221,8 @@
|
|||||||
*/
|
*/
|
||||||
this.$u.api.pay(data).then(res => {
|
this.$u.api.pay(data).then(res => {
|
||||||
if (res.status) {
|
if (res.status) {
|
||||||
|
uni.hideLoading();
|
||||||
this.$u.route({ type: 'redirectTo', url: '/pages/payment/result/result?id=' + res.data.paymentId });
|
this.$u.route({ type: 'redirectTo', url: '/pages/payment/result/result?id=' + res.data.paymentId });
|
||||||
setTimeout(function () {
|
|
||||||
uni.hideLoading();
|
|
||||||
}, 500);
|
|
||||||
} else {
|
} else {
|
||||||
//this.popHide();
|
//this.popHide();
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
|
|||||||
@@ -64,11 +64,19 @@
|
|||||||
if (options.orderId) {
|
if (options.orderId) {
|
||||||
this.orderId = options.orderId;
|
this.orderId = options.orderId;
|
||||||
}
|
}
|
||||||
},
|
this.doGetData();
|
||||||
mounted() {
|
|
||||||
this.getPaymentInfo();
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
doGetData() {
|
||||||
|
uni.showLoading({
|
||||||
|
title: '获取支付结果中',
|
||||||
|
mask: true
|
||||||
|
});
|
||||||
|
var _this = this;
|
||||||
|
setTimeout(function () {
|
||||||
|
_this.getPaymentInfo();
|
||||||
|
}, 2000);
|
||||||
|
},
|
||||||
getPaymentInfo() {
|
getPaymentInfo() {
|
||||||
if (!this.paymentId) {
|
if (!this.paymentId) {
|
||||||
this.status = true;
|
this.status = true;
|
||||||
@@ -93,7 +101,13 @@
|
|||||||
this.orderId = info.sourceId;
|
this.orderId = info.sourceId;
|
||||||
this.status = true;
|
this.status = true;
|
||||||
this.paymentInfo = info;
|
this.paymentInfo = info;
|
||||||
|
setTimeout(function () {
|
||||||
|
uni.hideLoading();
|
||||||
|
}, 500);
|
||||||
} else {
|
} else {
|
||||||
|
setTimeout(function () {
|
||||||
|
uni.hideLoading();
|
||||||
|
}, 500);
|
||||||
this.$u.toast(res.msg);
|
this.$u.toast(res.msg);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -360,7 +360,7 @@
|
|||||||
// #ifdef MP
|
// #ifdef MP
|
||||||
uni.getSystemInfo({
|
uni.getSystemInfo({
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
console.log("所获取设备数据皆来自设备本身", res)
|
//console.log("所获取设备数据皆来自设备本身", res)
|
||||||
var systemInfo = res;
|
var systemInfo = res;
|
||||||
if (systemInfo.deviceType != 'pc') {
|
if (systemInfo.deviceType != 'pc') {
|
||||||
var values = systemInfo.version.split('.');
|
var values = systemInfo.version.split('.');
|
||||||
@@ -481,12 +481,12 @@
|
|||||||
},
|
},
|
||||||
// 跳转到门店列表
|
// 跳转到门店列表
|
||||||
goStorelist() {
|
goStorelist() {
|
||||||
console.log("跳转到门店列表");
|
//console.log("跳转到门店列表");
|
||||||
this.$u.route('/pages/placeOrder/storeList/storeList')
|
this.$u.route('/pages/placeOrder/storeList/storeList')
|
||||||
},
|
},
|
||||||
// 没有收货地址时跳转
|
// 没有收货地址时跳转
|
||||||
goAddress() {
|
goAddress() {
|
||||||
console.log("没有收货地址时跳转");
|
//console.log("没有收货地址时跳转");
|
||||||
this.$u.route('/pages/member/address/list/list?type=order')
|
this.$u.route('/pages/member/address/list/list?type=order')
|
||||||
},
|
},
|
||||||
// 获取不同类型营销下单支持的配送方式
|
// 获取不同类型营销下单支持的配送方式
|
||||||
@@ -623,13 +623,13 @@
|
|||||||
// 优惠券已经过期 15011
|
// 优惠券已经过期 15011
|
||||||
let errStatus = [15009, 15010, 15011, 15013, 15014, 15015,]
|
let errStatus = [15009, 15010, 15011, 15013, 15014, 15015,]
|
||||||
if (errStatus.indexOf(res.data) !== -1) {
|
if (errStatus.indexOf(res.data) !== -1) {
|
||||||
console.log('删除使用的优惠券号码');
|
//console.log('删除使用的优惠券号码');
|
||||||
// 删除使用的优惠券号码
|
// 删除使用的优惠券号码
|
||||||
if (_that.current === 1) {
|
if (_that.current === 1) {
|
||||||
_that.removeCouponCode(_that.inputCouponCode, _that.current)
|
_that.removeCouponCode(_that.inputCouponCode, _that.current)
|
||||||
} else {
|
} else {
|
||||||
// 取消选择使用的状态
|
// 取消选择使用的状态
|
||||||
console.log(_that.optCoupon);
|
//console.log(_that.optCoupon);
|
||||||
if (_that.optCoupon) {
|
if (_that.optCoupon) {
|
||||||
_that.userCoupons.forEach(item => {
|
_that.userCoupons.forEach(item => {
|
||||||
if (item.couponCode === _that.optCoupon) {
|
if (item.couponCode === _that.optCoupon) {
|
||||||
@@ -638,10 +638,10 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
_that.removeCouponCode(_that.optCoupon, _that.current)
|
_that.removeCouponCode(_that.optCoupon, _that.current)
|
||||||
console.log(_that.optCoupon);
|
//console.log(_that.optCoupon);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log('未判断出内容');
|
//console.log('未判断出内容');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -835,17 +835,29 @@
|
|||||||
subscription() {
|
subscription() {
|
||||||
this.$u.api.getSubscriptionTmplIds(null).then(res => {
|
this.$u.api.getSubscriptionTmplIds(null).then(res => {
|
||||||
if (res.status) {
|
if (res.status) {
|
||||||
console.log(res.data);
|
//console.log(res.data);
|
||||||
if (res.data.length > 0) {
|
if (res.data.length > 0) {
|
||||||
console.log('进入订阅发起');
|
wx.getSetting({
|
||||||
uni.requestSubscribeMessage({
|
withSubscriptions: true,
|
||||||
tmplIds: res.data,
|
success(resSetting) {
|
||||||
success(ress) {
|
//console.log('subscriptionsSetting', resSetting.subscriptionsSetting)
|
||||||
if (res.errMsg == "requestSubscribeMessage:ok") {
|
if (wx.requestSubscribeMessage) {
|
||||||
console.log(ress);
|
wx.requestSubscribeMessage({
|
||||||
|
tmplIds: res.data, //购买,发货,收货通知
|
||||||
|
success: function (ress) {
|
||||||
|
//console.log(ress);
|
||||||
|
},
|
||||||
|
fail: function (ress) {
|
||||||
|
//console.log(ress);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: '请更新您微信版本,来获取订阅消息功能',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}, fail(ress) {
|
|
||||||
console.log(ress);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user