@@ -1,6 +1,7 @@ | |||||
{ | { | ||||
"pages": [ | "pages": [ | ||||
"pages/index/index", | "pages/index/index", | ||||
"pages/integralmall/payIntegcouponStatus/index", | |||||
"pages/integralmall/payIntegcoupondetail/index", | "pages/integralmall/payIntegcoupondetail/index", | ||||
"pages/joinFrDpell/index", | "pages/joinFrDpell/index", | ||||
"pages/spellDetail/index", | "pages/spellDetail/index", | ||||
@@ -262,7 +262,15 @@ var config = { | |||||
/** | /** | ||||
* 专题详情 | * 专题详情 | ||||
*/ | */ | ||||
topicFindById:"/topic/findById" | |||||
topicFindById:"/topic/findById", | |||||
/** | |||||
* 积分兑换 | |||||
*/ | |||||
addIntegral: "/credit/add", | |||||
/** | |||||
* 积分券详情 | |||||
*/ | |||||
integralDetail:'/wxCoupon/findById', | |||||
}, | }, | ||||
weapp: { | weapp: { | ||||
AppId: weappId | AppId: weappId | ||||
@@ -82,7 +82,7 @@ Page({ | |||||
var param = { | var param = { | ||||
pageNum: pageNum, | pageNum: pageNum, | ||||
pageSize: 10, | pageSize: 10, | ||||
targetAd: 5 | |||||
targetAd: 50 | |||||
}; | }; | ||||
var url = config.api.couponChannelList; | var url = config.api.couponChannelList; | ||||
// 请求接口 | // 请求接口 | ||||
@@ -18,7 +18,7 @@ | |||||
<view class='remark'>{{item.subTitle}}</view> | <view class='remark'>{{item.subTitle}}</view> | ||||
<view class='price'> | <view class='price'> | ||||
<view class='price01'> | <view class='price01'> | ||||
<view class='price-num'>{{item.salePriceStr}}</view> | |||||
<view class='price-num'>{{item.creditPrice}}</view> | |||||
<view class='price-unit'>积分</view> | <view class='price-unit'>积分</view> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
@@ -8,7 +8,7 @@ | |||||
<view class='remark'>{{data.subTitle}}</view> | <view class='remark'>{{data.subTitle}}</view> | ||||
<view class='des'> | <view class='des'> | ||||
<view class='des-peoplenum'>售价</view> | <view class='des-peoplenum'>售价</view> | ||||
<view class='des-saleprice'>{{data.salePriceStr}}积分</view> | |||||
<view class='des-saleprice'>{{data.creditPrice}}积分</view> | |||||
</view> | </view> | ||||
<view class='rest' wx:if="{{data.validType==1}}">有效期: | <view class='rest' wx:if="{{data.validType==1}}">有效期: | ||||
<text class='time'>{{data.validStartDate}}至{{data.validEndDate}}<text class="use">(请在有效期内使用)</text></text> | <text class='time'>{{data.validStartDate}}至{{data.validEndDate}}<text class="use">(请在有效期内使用)</text></text> | ||||
@@ -52,7 +52,7 @@ | |||||
<form bindsubmit="submit" report-submit='true' > | <form bindsubmit="submit" report-submit='true' > | ||||
<view class='edit'> | <view class='edit'> | ||||
<button class='goback' bindtap='gotoIndex'><image src='{{wmhome}}' mode="widthFix"></image></button> | <button class='goback' bindtap='gotoIndex'><image src='{{wmhome}}' mode="widthFix"></image></button> | ||||
<button class='edit-left' form-type="submit" wx:if='{{data.id}}' bindtap='gotoBuy'> | |||||
<button class='edit-left' wx:if='{{data.id}}' bindtap='gotoBuy'> | |||||
<view class='edit-left-bottom'>马上兑换</view> | <view class='edit-left-bottom'>马上兑换</view> | ||||
</button> | </button> | ||||
</view> | </view> | ||||
@@ -0,0 +1,86 @@ | |||||
// pages/integralmall/payIntegcouponStatus/index.js | |||||
// pages/spellGroup/mySpellGroup/index.js | |||||
var config = require("../../../config/config.js"); | |||||
const Http = require("../../../utils/HttpBasics"); | |||||
const imgurl = require("../../../utils/imgurl"); | |||||
const utils = require("../../../utils/util.js") | |||||
Page({ | |||||
/** | |||||
* 页面的初始数据 | |||||
*/ | |||||
data: { | |||||
teljpgUrl: imgurl.teljpg.url, | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面加载 | |||||
*/ | |||||
onLoad: function (options) { | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面初次渲染完成 | |||||
*/ | |||||
onReady: function () { | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面显示 | |||||
*/ | |||||
onShow: function () { | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面隐藏 | |||||
*/ | |||||
onHide: function () { | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面卸载 | |||||
*/ | |||||
onUnload: function () { | |||||
}, | |||||
/** | |||||
* 去使用 | |||||
*/ | |||||
gotoUse(){ | |||||
wx.navigateTo({ | |||||
url: '/pages/couponorder/index/index', | |||||
}) | |||||
}, | |||||
/** | |||||
* 返回首页 | |||||
*/ | |||||
gotoIndex(){ | |||||
wx.switchTab({ | |||||
url: '/pages/main/index', | |||||
}) | |||||
}, | |||||
/** | |||||
* 页面相关事件处理函数--监听用户下拉动作 | |||||
*/ | |||||
onPullDownRefresh: function () { | |||||
}, | |||||
/** | |||||
* 页面上拉触底事件的处理函数 | |||||
*/ | |||||
onReachBottom: function () { | |||||
}, | |||||
/** | |||||
* 用户点击右上角分享 | |||||
*/ | |||||
onShareAppMessage: function () { | |||||
} | |||||
}) |
@@ -0,0 +1,7 @@ | |||||
{ | |||||
"navigationBarTitleText": "积分兑换结果", | |||||
"navigationBarTextStyle": "white", | |||||
"navigationBarBackgroundColor":"#52A0FD", | |||||
"enablePullDownRefresh": true, | |||||
"usingComponents": {} | |||||
} |
@@ -0,0 +1,13 @@ | |||||
<view class='pay-status'> | |||||
<view class='tilte'>兑换成功</view> | |||||
<view class='coupon'> | |||||
<view class='c-left'> | |||||
<image src='{{teljpgUrl}}' mode="widthFix"></image> | |||||
</view> | |||||
<view class='c-right'>会员积分兑换2小时停车券</view> | |||||
</view> | |||||
<view class='detail-text'>已存入"我的券包"请您查看使用</view> | |||||
<view class='detail-num'>剩余积分:23234</view> | |||||
<button class='button01' bindtap='gotoUse'>立即使用</button> | |||||
<button class='button02' bindtap='gotoIndex'>返回首页</button> | |||||
</view> |
@@ -0,0 +1,66 @@ | |||||
/* pages/integralmall/payIntegcouponStatus/index.wxss */ | |||||
.tilte{ | |||||
text-align: center; | |||||
height:50rpx; | |||||
font-size:40rpx; | |||||
font-family:PingFang-SC-Bold; | |||||
font-weight:bold; | |||||
color:rgba(51,51,51,1); | |||||
line-height:50rpx; | |||||
margin: 70rpx auto; | |||||
} | |||||
.coupon{ | |||||
overflow: hidden; | |||||
width:690rpx; | |||||
padding: 20rpx 0; | |||||
margin: 0 auto; | |||||
box-shadow:0px 10rpx 27rpx 0rpx rgba(15,15,15,0.09); | |||||
border-radius:20rpx; | |||||
} | |||||
.c-left{ | |||||
width: 160rpx; | |||||
padding-left: 20rpx; | |||||
height: auto; | |||||
float: left; | |||||
box-sizing: border-box; | |||||
} | |||||
.c-left image{ | |||||
width: 120rpx; | |||||
} | |||||
.c-right{ | |||||
width: 510rpx; | |||||
float: left; | |||||
line-height: 120rpx; | |||||
} | |||||
.detail-text{ | |||||
font-size:30rpx; | |||||
padding-left: 30rpx; | |||||
line-height: 40rpx; | |||||
margin-top: 30rpx; | |||||
} | |||||
.detail-num{ | |||||
font-size:30rpx; | |||||
padding-left: 30rpx; | |||||
line-height: 40rpx; | |||||
margin-top: 10rpx; | |||||
} | |||||
.button01{ | |||||
width:710rpx; | |||||
height:94rpx; | |||||
line-height: 94rpx; | |||||
background:rgba(82,160,253,1); | |||||
box-shadow:0px 10rpx 22rpx 2rpx rgba(82,160,253,0.51); | |||||
border-radius:10rpx; | |||||
color: #fff; | |||||
margin-top: 120rpx; | |||||
} | |||||
.button02{ | |||||
width:710rpx; | |||||
height:94rpx; | |||||
line-height: 94rpx; | |||||
background:rgba(82,160,253,1); | |||||
box-shadow:0px 10rpx 22rpx 2rpx rgba(82,160,253,0.51); | |||||
border-radius:10rpx; | |||||
color: #fff; | |||||
margin-top: 30rpx; | |||||
} |
@@ -30,7 +30,7 @@ Page({ | |||||
.then(res => { | .then(res => { | ||||
console.log(res) | console.log(res) | ||||
that.setData({ | that.setData({ | ||||
remainingPoints: Number(res.data.credit) - Number(that.data.data.salePriceStr), | |||||
remainingPoints: Number(res.data.credit) - Number(that.data.data.creditPrice), | |||||
userInfo:res.data, | userInfo:res.data, | ||||
nickName: res.data.nickName, | nickName: res.data.nickName, | ||||
avatarUrl: res.data.avatarUrl | avatarUrl: res.data.avatarUrl | ||||
@@ -59,102 +59,28 @@ Page({ | |||||
// 关闭来自于左上角的分享 | // 关闭来自于左上角的分享 | ||||
wx.hideShareMenu() | wx.hideShareMenu() | ||||
}, | }, | ||||
/** | |||||
* 支付订单更新 | |||||
*/ | |||||
payOrderUpdate: (orderId, payOrderId, status, reason, _this, orderGroupId) => { | |||||
console.log(orderGroupId, 7777) | |||||
let that = this; | |||||
// 支付成功 | |||||
Http.post({ | |||||
url: config.api.payOrderUpdate, | |||||
data: { | |||||
payOrderId: payOrderId, | |||||
orderId: orderId, | |||||
status: status, | |||||
reason: reason | |||||
} | |||||
}) | |||||
.then(res => { | |||||
wx.hideLoading() | |||||
if (res.data.orderStatus == 14) { | |||||
_this.setData({ | |||||
showErr: true | |||||
}) | |||||
return; | |||||
} | |||||
if (orderGroupId == undefined) { | |||||
wx.navigateTo({ | |||||
url: '/pages/order/detail/index?orderId=' + res.data.id, | |||||
}) | |||||
} else { | |||||
_this.goToOrderGroup(orderId, res.data.orderGroupId, _this) | |||||
} | |||||
}) | |||||
.catch(err => { | |||||
console.log(err); | |||||
if (err.code != 12002) { | |||||
setTimeout(function () { | |||||
_this.payOrderUpdate(orderId, payOrderId, status, reason, _this, orderGroupId); | |||||
}, 2000) | |||||
} | |||||
}) | |||||
}, | |||||
gotoPay() { | gotoPay() { | ||||
let that = this; | let that = this; | ||||
wx.showLoading({ | wx.showLoading({ | ||||
title: '支付创建中...', | |||||
title: '订单提交中...', | |||||
}) | }) | ||||
//操作人类型 1:C端用户,2:A端会员,3:B端用户,4:A端用户 | |||||
let param={ | |||||
cuserId:that.data.userInfo.id,//用户id | |||||
operatorType:1,//操作人类型 | |||||
creditType: 11,//积分类型-积分兑换 | |||||
spend:this.data.data.credit,//积分数值 | |||||
couponId: this.data.data.couponId | |||||
} | |||||
Http.post({ | Http.post({ | ||||
url: config.api.payOrderCreate, | |||||
data: { | |||||
orderId: that.data.paramData.orderId | |||||
} | |||||
url: config.api.addIntegral, | |||||
data: param | |||||
}) | }) | ||||
.then(res => { | .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.paramData.orderId, payOrderId, 1, '', that, 0); | |||||
if (res.errMsg == "requestPayment:ok") { | |||||
setTimeout(function () { | |||||
wx.hideLoading(); | |||||
}, 2000); | |||||
} | |||||
}, | |||||
fail: res => { | |||||
/** | |||||
* 支付失败,需要更新订单的状态 | |||||
*/ | |||||
that.payOrderUpdate(that.data.paramData.orderId, payOrderId, 2, '', that, 0); | |||||
that.setData({ | |||||
showbutton: false, | |||||
canSpell: true, | |||||
canBuyIf: true | |||||
}) | |||||
return; | |||||
}, | |||||
complete: res => { } | |||||
}); | |||||
wx.hideLoading() | |||||
/// End payment -------- | /// End payment -------- | ||||
}) | }) | ||||
.catch(err => { | .catch(err => { | ||||
that.setData({ | |||||
canSpell: true, | |||||
canBuyIf: true | |||||
}) | |||||
wx.showToast({ | wx.showToast({ | ||||
title: err.message, | title: err.message, | ||||
icon: 'none', | icon: 'none', | ||||
@@ -193,34 +119,28 @@ Page({ | |||||
* 生命周期函数--监听页面显示 | * 生命周期函数--监听页面显示 | ||||
*/ | */ | ||||
onShow: function () { | onShow: function () { | ||||
this.setData({ | |||||
showTime: true | |||||
}) | |||||
}, | }, | ||||
/** | /** | ||||
* 生命周期函数--监听页面隐藏 | * 生命周期函数--监听页面隐藏 | ||||
*/ | */ | ||||
onHide: function () { | onHide: function () { | ||||
this.setData({ | |||||
showTime: false | |||||
}) | |||||
}, | }, | ||||
/** | /** | ||||
* 生命周期函数--监听页面卸载 | * 生命周期函数--监听页面卸载 | ||||
*/ | */ | ||||
onUnload: function () { | onUnload: function () { | ||||
this.setData({ | |||||
showTime: false | |||||
}) | |||||
}, | }, | ||||
/** | /** | ||||
* 页面相关事件处理函数--监听用户下拉动作 | * 页面相关事件处理函数--监听用户下拉动作 | ||||
*/ | */ | ||||
onPullDownRefresh: function () { | onPullDownRefresh: function () { | ||||
this.getDetail(this.data.paramData); | |||||
this.getDetail(this.data.paramData.couponChannelId); | |||||
}, | }, | ||||
/** | /** | ||||
@@ -15,7 +15,7 @@ | |||||
<view class='des'>{{'价值:'+data.priceStr+'元'}}</view> | <view class='des'>{{'价值:'+data.priceStr+'元'}}</view> | ||||
</view> | </view> | ||||
<view class='detail-top03'> | <view class='detail-top03'> | ||||
<view class='detail-p-price'>{{data.salePriceStr}}积分</view> | |||||
<view class='detail-p-price'>{{data.creditPrice}}积分</view> | |||||
<view class='detail-p-name'>积分售价</view> | <view class='detail-p-name'>积分售价</view> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
@@ -29,7 +29,7 @@ | |||||
</view> | </view> | ||||
<view class='order-list'> | <view class='order-list'> | ||||
<view class='order-title'>兑换使用积分</view> | <view class='order-title'>兑换使用积分</view> | ||||
<view class='order-text'>{{data.salePriceStr}}</view> | |||||
<view class='order-text'>{{data.creditPrice}}</view> | |||||
</view> | </view> | ||||
<view class='order-list'> | <view class='order-list'> | ||||
<view class='order-title'>剩余积分</view> | <view class='order-title'>剩余积分</view> | ||||
@@ -37,7 +37,7 @@ | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class='edit'> | <view class='edit'> | ||||
<button class='user-motto' bindtap='gotoPay'>{{'确认'+data.salePriceStr+'积分支付'}}</button> | |||||
<button class='user-motto' bindtap='gotoPay'>{{'确认'+data.creditPrice+'积分支付'}}</button> | |||||
</view> | </view> | ||||
<view class='al-bg' wx:if='{{showErr}}'></view> | <view class='al-bg' wx:if='{{showErr}}'></view> | ||||
<view class='al-content' wx:if='{{showErr}}'> | <view class='al-content' wx:if='{{showErr}}'> | ||||