Commit 3bf664ba by wangzhihui

添加sentry报错

1 parent 3fd4a3b1
...@@ -120,7 +120,7 @@ Page({ ...@@ -120,7 +120,7 @@ Page({
if (res.code == 0) { if (res.code == 0) {
this.setData({ this.setData({
//0-关闭,1-打开 //0-关闭,1-打开
isEnabled: res.data?res.data.isEnabled == 0 ? false : true:false isEnabled: res.data ? res.data.isEnabled == 0 ? false : true : false
}) })
resolve() resolve()
} }
...@@ -351,43 +351,55 @@ Page({ ...@@ -351,43 +351,55 @@ Page({
formData.channelSource = channelSource formData.channelSource = channelSource
formData.merchantId = merchantId formData.merchantId = merchantId
formData.merchantName = merchantName formData.merchantName = merchantName
const { try {
code, const {
message, code,
data message,
} = await wx.p.api.withdrawalApi.insetorupdateStaffBank(formData) data
if (code == '0') { } = await wx.p.api.withdrawalApi.insetorupdateStaffBank(formData)
//返回类型:0:失败,1:成功,2:提示 建议您不要添加同一个人的多张卡片,避免提现时个人税务汇算累积 if (code == '0') {
let resultObj = { //返回类型:0:失败,1:成功,2:提示 建议您不要添加同一个人的多张卡片,避免提现时个人税务汇算累积
0: () => { let resultObj = {
this.setData({ 0: () => {
showModal: true, this.setData({
success: 'fail', showModal: true,
dialogText: `原因:${message}` success: 'fail',
}) dialogText: `原因:${message}`
}, })
1: () => { },
this.setData({ 1: () => {
showModal: true, this.setData({
success: 'success', showModal: true,
dialogText: item ? '您的银行账户修改成功!' : '您的银行账户添加成功!' success: 'success',
}) dialogText: item ? '您的银行账户修改成功!' : '您的银行账户添加成功!'
}, })
2: () => { },
this.setData({ 2: () => {
repeatShowModal: true this.setData({
}) repeatShowModal: true
})
}
} }
} resultObj[data]()
resultObj[data]()
} else { } else {
this.setData({ this.setData({
showModal: true, showModal: true,
success: 'fail', success: 'fail',
dialogText: `原因:${message}` dialogText: `原因:${message}`
}) })
// wx.$api.showToast(message) wx.p.sentry.reportError(`添加账户异常:${message}`, {
...formData,
message
});
// wx.$api.showToast(message)
}
} catch (err) {
wx.p.sentry.reportError(`添加账户异常:${err.message}`, {
...formData,
err
});
} }
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -36,7 +36,6 @@ Page({ ...@@ -36,7 +36,6 @@ Page({
*/ */
onLoad(options) { onLoad(options) {
wx.p.router.getRouterParams().then(params => { wx.p.router.getRouterParams().then(params => {
console.log(params)
this.setData(params) this.setData(params)
}) })
this.getBankList() this.getBankList()
......
...@@ -34,13 +34,13 @@ Page({ ...@@ -34,13 +34,13 @@ Page({
if (num === null || num === undefined || isNaN(num)) { if (num === null || num === undefined || isNaN(num)) {
return ''; return '';
} }
// 处理大于等于10000的数字 // 处理大于等于10000的数字
if (Math.abs(num) >= 10000) { if (Math.abs(num) >= 10000) {
const wan = (num / 10000).toFixed(1); const wan = (num / 10000).toFixed(1);
// 去掉末尾的.0 // 去掉末尾的.0
return parseFloat(wan) == parseInt(wan) ? parseInt(wan) + '万' : wan + '万'; return parseFloat(wan) == parseInt(wan) ? parseInt(wan) + '万' : wan + '万';
} }
// 处理小于10000但大于等于1000的数字 // 处理小于10000但大于等于1000的数字
else if (Math.abs(num) >= 1000) { else if (Math.abs(num) >= 1000) {
const qian = (num / 10000).toFixed(1); const qian = (num / 10000).toFixed(1);
...@@ -59,10 +59,11 @@ Page({ ...@@ -59,10 +59,11 @@ Page({
pageNum: 1, pageNum: 1,
pageSize: 8, pageSize: 8,
canExchange: 1, canExchange: 1,
businessType:1, businessType: 1,
staffPhone: userInfo?.phone, staffPhone: userInfo?.phone,
staffPlatform: userInfo?.channelSource, staffPlatform: userInfo?.channelSource,
merchantNo: userInfo?.merchantId merchantNo: userInfo?.merchantId,
storeEnd: this.data.sumbitScore
} }
wx.p.api.homeApi.getGoodsStockroomList(params).then(res => { wx.p.api.homeApi.getGoodsStockroomList(params).then(res => {
...@@ -92,12 +93,15 @@ Page({ ...@@ -92,12 +93,15 @@ Page({
// wx.p.wxApi.showToast('加入购物车成功') // wx.p.wxApi.showToast('加入购物车成功')
// }) // })
// } else { // } else {
// 获取商品详情 // 获取商品详情
this.getDetail(value) this.getDetail(value)
// } // }
}, },
getDetail(options) { getDetail(options) {
wx.p.api.homeApi.getGoodsDetailInfo({id: options.id, businessType: 1}).then(res => { wx.p.api.homeApi.getGoodsDetailInfo({
id: options.id,
businessType: 1
}).then(res => {
// if (res && res.specificationResponses?.length) { // if (res && res.specificationResponses?.length) {
// this.toGetSpecString(res, res.startQty) // this.toGetSpecString(res, res.startQty)
// } // }
...@@ -131,9 +135,9 @@ Page({ ...@@ -131,9 +135,9 @@ Page({
}).then(res => { }).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.setData({ this.setData({
taxRateObj:{ taxRateObj: {
...res.data, ...res.data,
baseIncome:this.simpleWanConvert(res.data.baseIncome) baseIncome: this.simpleWanConvert(res.data.baseIncome)
} }
}) })
} }
...@@ -173,7 +177,7 @@ Page({ ...@@ -173,7 +177,7 @@ Page({
sumbitScore, sumbitScore,
disclaimerAgreementUrl, disclaimerAgreementUrl,
bankId bankId
} = this.data,{ } = this.data, {
phone, phone,
channelSource, channelSource,
merchantId, merchantId,
...@@ -182,24 +186,33 @@ Page({ ...@@ -182,24 +186,33 @@ Page({
if (this.submit) return if (this.submit) return
this.submit = true this.submit = true
wx.p.wxApi.showLoading('提交中') wx.p.wxApi.showLoading('提交中')
wx.p.api.withdrawalApi.saveWithdrawal({ let params = {
withdrawalScore: sumbitScore, withdrawalScore: sumbitScore,
disclaimerAgreementUrl, disclaimerAgreementUrl,
bankId, bankId,
merchantId, merchantId,
merchantName, merchantName,
channelSource:channelSource, channelSource: channelSource,
staffPhone:phone, staffPhone: phone,
}).then(res => { }
wx.p.api.withdrawalApi.saveWithdrawal(params).then(res => {
wx.p.wxApi.hideLoading(); wx.p.wxApi.hideLoading();
if (res.code == 0) { if (res.code == 0) {
wx.p.router.redirectTo('/packageIndex/pages/integral/withdrawalSuccess/withdrawalSuccess') wx.p.router.redirectTo('/packageIndex/pages/integral/withdrawalSuccess/withdrawalSuccess')
} else { } else {
wx.p.wxApi.showToast(res.message) wx.p.wxApi.showToast(res.message)
this.submit = false this.submit = false
wx.p.sentry.reportError(`积分提现异常:${res.message}`, {
...params,
res
});
} }
}).catch((err) => { }).catch((err) => {
this.submit = false this.submit = false
wx.p.sentry.reportError(`积分提现异常:${err.message}`, {
...params,
err
});
wx.p.wxApi.showToast(JSON.stringify(err)) wx.p.wxApi.showToast(JSON.stringify(err))
}).finally(() => { }).finally(() => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!