Commit 6b1b98be by 前端

联调代码

1 parent e68e36f6
...@@ -55,7 +55,7 @@ Page({ ...@@ -55,7 +55,7 @@ Page({
return (Math.round(num / 100 * pow) / pow).toFixed(2) return (Math.round(num / 100 * pow) / pow).toFixed(2)
}, },
initOrderInfo() { initOrderInfo() {
const { orderObj, orderList } = this.data const {orderObj, orderList} = this.data
// 商品 // 商品
if (app.globalData?.crowdFundingShopInfo && orderObj?.shopFormList) { if (app.globalData?.crowdFundingShopInfo && orderObj?.shopFormList) {
if (app.globalData?.crowdFundingShopInfo?.length > 1) { if (app.globalData?.crowdFundingShopInfo?.length > 1) {
...@@ -71,7 +71,7 @@ Page({ ...@@ -71,7 +71,7 @@ Page({
orderInfo['totalFee'] = arr[0]?.crowdFundingPrice || 0 orderInfo['totalFee'] = arr[0]?.crowdFundingPrice || 0
} }
} }
this.setData({ orderObj, orderList }) this.setData({orderObj, orderList})
}, },
showPopup(e) { showPopup(e) {
this.setData({ this.setData({
...@@ -81,39 +81,57 @@ Page({ ...@@ -81,39 +81,57 @@ Page({
}) })
}, },
confirm() { confirm() {
const { orderInfo } = this.data const {orderInfo} = this.data
// console.log(orderInfo, orderListInfo) // console.log(orderInfo, orderListInfo)
if (!orderInfo || !orderInfo.outTradeNo) { if (!orderInfo || !orderInfo.outTradeNo) {
return wx.$util.showToast('请选择交易流水号') return wx.$util.showToast('请选择交易流水号')
} }
let {accountName} = wx.$util.getUserInfo()
let { default4SStoreInfo_crowdFunding: merchantInfo } = wx.$util.getUserInfo() const {goodsId: shopmallGoodsId, subOrderCode} = orderInfo
const { customerName, customerPhone, activityName, activityId, referrer, goodsName, shareStaffUuid: userId, shopmallGoodsId } = orderInfo
let params = { let params = {
outTradeNo: orderInfo.outTradeNo, subOrderCode,
customerName,
customerPhone,
activityName,
activityId: activityId || '10228',
goodsName,
orderPaySource: 2, orderPaySource: 2,
employeeName: referrer,
userId,
shopmallGoodsId, shopmallGoodsId,
merchantId: merchantInfo.merchantId, selectPayType: 1,
merchantName: merchantInfo.merchantName updatedBy: accountName
} }
api.createFullPayOrderAPI(params).then(res => { api.createPayOrderAPI(params).then(res => {
let { code, data, message } = res let {code, data, message} = res
if (code == '0') { if (code == '0') {
// wx.$router.reLaunch // wx.$router.reLaunch
wx.$router.redirectTo('activityPay', {orderCode: target.subOrderCode})
wx.$router.redirectTo('activityPay', { orderCode: data.subOrderCode, outTradeNo })
} else { } else {
wx.$util.showToast(message || '接口异常') wx.$util.showToast(message || '接口异常')
} }
}) })
// let { default4SStoreInfo_crowdFunding: merchantInfo } = wx.$util.getUserInfo()
// const { customerName, customerPhone, activityName, activityId, referrer, goodsName, shareStaffUuid: userId, shopmallGoodsId } = orderInfo
// let params = {
// outTradeNo: orderInfo.outTradeNo,
// customerName,
// customerPhone,
// activityName,
// activityId: activityId || '10228',
// goodsName,
// orderPaySource: 2,
// employeeName: referrer,
// userId,
// shopmallGoodsId,
// merchantId: merchantInfo.merchantId,
// merchantName: merchantInfo.merchantName
// }
//
// api.createFullPayOrderAPI(params).then(res => {
// let { code, data, message } = res
// if (code == '0') {
// // wx.$router.reLaunch
//
// wx.$router.redirectTo('activityPay', { orderCode: data.subOrderCode, outTradeNo })
// } else {
// wx.$util.showToast(message || '接口异常')
// }
// })
}, },
back() { back() {
wx.$router.back() wx.$router.back()
...@@ -121,9 +139,10 @@ Page({ ...@@ -121,9 +139,10 @@ Page({
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) {}, onLoad(options) {
},
onRoute(options) { onRoute(options) {
const { list } = options const {list} = options
list.activityPrice = `¥${this.priceFilter(list.activityPrice || 0)}` list.activityPrice = `¥${this.priceFilter(list.activityPrice || 0)}`
list.totalFee = list.crowdFundingPrice || 0 list.totalFee = list.crowdFundingPrice || 0
this.setData({ this.setData({
...@@ -135,35 +154,42 @@ Page({ ...@@ -135,35 +154,42 @@ Page({
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady() {}, onReady() {
},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() {}, onShow() {
},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide() {}, onHide() {
},
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload() {}, onUnload() {
},
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh() {}, onPullDownRefresh() {
},
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom() {}, onReachBottom() {
},
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() {} onShareAppMessage() {
}
}) })
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!