Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-boutique-work-wechat
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7c72e5f1
authored
Apr 11, 2023
by
徐忆琳
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'xuyl_dev_v4.19.0' into 'dev_v4.19.0'
联调代码 See merge request
!52
2 parents
e68e36f6
6b1b98be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
177 additions
and
151 deletions
packageCrowdFunding/pages/balanceNote/balanceNote.js
packageCrowdFunding/pages/balanceNote/balanceNote.js
View file @
7c72e5f
...
...
@@ -6,164 +6,190 @@ const app = getApp()
import
api
from
'../../api'
Page
({
/**
* 页面的初始数据
*/
data
:
{
orderObj
:
constantData
.
orderObj
,
showStatus
:
false
,
orderNoPopup
:
false
,
orderNoList
:
[],
// orderListInfo: {},
orderNoInfo
:
{},
orderInfo
:
{},
orderList
:
[
{
name
:
'客户姓名'
,
value
:
'customerName'
},
{
name
:
'活动名称'
,
value
:
'activityName'
},
{
name
:
'商品名称'
,
isMark
:
true
,
value
:
'goodsName'
},
{
name
:
'订单金额'
,
value
:
'activityPrice'
},
{
name
:
'定金支付时间'
,
value
:
'payedDate'
},
{
name
:
'订单编号'
,
value
:
'subOrderCode'
}
]
},
handleTransaction
()
{
this
.
setData
({
orderNoPopup
:
true
})
},
priceFilter
(
num
)
{
var
pow
=
Math
.
pow
(
10
,
2
)
return
(
Math
.
round
(
num
/
100
*
pow
)
/
pow
).
toFixed
(
2
)
},
initOrderInfo
()
{
const
{
orderObj
,
orderList
}
=
this
.
data
// 商品
if
(
app
.
globalData
?.
crowdFundingShopInfo
&&
orderObj
?.
shopFormList
)
{
if
(
app
.
globalData
?.
crowdFundingShopInfo
?.
length
>
1
)
{
// 多商品
orderList
[
2
].
isMark
=
true
orderObj
.
shopFormList
[
0
].
optionList
=
app
.
globalData
?.
crowdFundingShopInfo
.
map
(
item
=>
{
item
.
shopmallGoodsId
=
item
.
goodsId
return
item
/**
* 页面的初始数据
*/
data
:
{
orderObj
:
constantData
.
orderObj
,
showStatus
:
false
,
orderNoPopup
:
false
,
orderNoList
:
[],
// orderListInfo: {},
orderNoInfo
:
{},
orderInfo
:
{},
orderList
:
[
{
name
:
'客户姓名'
,
value
:
'customerName'
},
{
name
:
'活动名称'
,
value
:
'activityName'
},
{
name
:
'商品名称'
,
isMark
:
true
,
value
:
'goodsName'
},
{
name
:
'订单金额'
,
value
:
'activityPrice'
},
{
name
:
'定金支付时间'
,
value
:
'payedDate'
},
{
name
:
'订单编号'
,
value
:
'subOrderCode'
}
]
},
handleTransaction
()
{
this
.
setData
({
orderNoPopup
:
true
})
}
else
{
// 单商品直接带出商品名称
orderList
[
2
].
isMark
=
false
orderInfo
[
'totalFee'
]
=
arr
[
0
]?.
crowdFundingPrice
||
0
}
}
this
.
setData
({
orderObj
,
orderList
})
},
showPopup
(
e
)
{
this
.
setData
({
showPickerSelect
:
true
,
// orderInfo: this.data.orderListInfo,
pickerObj
:
this
.
data
.
orderObj
.
shopFormList
[
0
]
})
},
confirm
()
{
const
{
orderInfo
}
=
this
.
data
// console.log(orderInfo, orderListInfo)
if
(
!
orderInfo
||
!
orderInfo
.
outTradeNo
)
{
return
wx
.
$util
.
showToast
(
'请选择交易流水号'
)
}
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
},
priceFilter
(
num
)
{
var
pow
=
Math
.
pow
(
10
,
2
)
return
(
Math
.
round
(
num
/
100
*
pow
)
/
pow
).
toFixed
(
2
)
},
initOrderInfo
()
{
const
{
orderObj
,
orderList
}
=
this
.
data
// 商品
if
(
app
.
globalData
?.
crowdFundingShopInfo
&&
orderObj
?.
shopFormList
)
{
if
(
app
.
globalData
?.
crowdFundingShopInfo
?.
length
>
1
)
{
// 多商品
orderList
[
2
].
isMark
=
true
orderObj
.
shopFormList
[
0
].
optionList
=
app
.
globalData
?.
crowdFundingShopInfo
.
map
(
item
=>
{
item
.
shopmallGoodsId
=
item
.
goodsId
return
item
})
}
else
{
// 单商品直接带出商品名称
orderList
[
2
].
isMark
=
false
orderInfo
[
'totalFee'
]
=
arr
[
0
]?.
crowdFundingPrice
||
0
}
}
this
.
setData
({
orderObj
,
orderList
})
},
showPopup
(
e
)
{
this
.
setData
({
showPickerSelect
:
true
,
// orderInfo: this.data.orderListInfo,
pickerObj
:
this
.
data
.
orderObj
.
shopFormList
[
0
]
})
},
confirm
()
{
const
{
orderInfo
}
=
this
.
data
// console.log(orderInfo, orderListInfo)
if
(
!
orderInfo
||
!
orderInfo
.
outTradeNo
)
{
return
wx
.
$util
.
showToast
(
'请选择交易流水号'
)
}
let
{
accountName
}
=
wx
.
$util
.
getUserInfo
()
const
{
goodsId
:
shopmallGoodsId
,
subOrderCode
}
=
orderInfo
let
params
=
{
subOrderCode
,
orderPaySource
:
2
,
shopmallGoodsId
,
selectPayType
:
1
,
updatedBy
:
accountName
}
wx
.
$router
.
redirectTo
(
'activityPay'
,
{
orderCode
:
data
.
subOrderCode
,
outTradeNo
})
}
else
{
wx
.
$util
.
showToast
(
message
||
'接口异常'
)
}
})
},
back
()
{
wx
.
$router
.
back
()
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
(
options
)
{},
onRoute
(
options
)
{
const
{
list
}
=
options
list
.
activityPrice
=
`¥
${
this
.
priceFilter
(
list
.
activityPrice
||
0
)}
`
list
.
totalFee
=
list
.
crowdFundingPrice
||
0
this
.
setData
({
orderInfo
:
list
})
this
.
initOrderInfo
()
},
api
.
createPayOrderAPI
(
params
).
then
(
res
=>
{
let
{
code
,
data
,
message
}
=
res
if
(
code
==
'0'
)
{
// wx.$router.reLaunch
wx
.
$router
.
redirectTo
(
'activityPay'
,
{
orderCode
:
target
.
subOrderCode
})
}
else
{
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
()
{
wx
.
$router
.
back
()
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
(
options
)
{
},
onRoute
(
options
)
{
const
{
list
}
=
options
list
.
activityPrice
=
`¥
${
this
.
priceFilter
(
list
.
activityPrice
||
0
)}
`
list
.
totalFee
=
list
.
crowdFundingPrice
||
0
this
.
setData
({
orderInfo
:
list
})
this
.
initOrderInfo
()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady
()
{},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady
()
{
},
/**
* 生命周期函数--监听页面显示
*/
onShow
()
{},
/**
* 生命周期函数--监听页面显示
*/
onShow
()
{
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide
()
{},
/**
* 生命周期函数--监听页面隐藏
*/
onHide
()
{
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload
()
{},
/**
* 生命周期函数--监听页面卸载
*/
onUnload
()
{
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh
()
{},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh
()
{
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom
()
{},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom
()
{
},
/**
* 用户点击右上角分享
*/
onShareAppMessage
()
{}
/**
* 用户点击右上角分享
*/
onShareAppMessage
()
{
}
})
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment