Commit a3787dc8 by zhangxw

bug修复

1 parent c0e0b0e7
...@@ -112,6 +112,19 @@ ...@@ -112,6 +112,19 @@
background: #EFF0F2; background: #EFF0F2;
} }
} }
.nothing {
height: 100%;
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
color: #7A8299;
.icon{
width: 320rpx;
height: 300rpx;
margin-bottom: 20rpx;
}
}
} }
.footer { .footer {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<glsx-image bind:tap="cancel" webp class="icon" src="/index/close.png"></glsx-image> <glsx-image bind:tap="cancel" webp class="icon" src="/index/close.png"></glsx-image>
</view> </view>
<view class="list-pannel"> <view class="list-pannel">
<scroll-view class="scroll" scroll-y="{{true}}"> <scroll-view class="scroll" scroll-y="{{true}}" wx:if="{{address.length}}">
<block wx:for="{{address}}" wx:key="index"> <block wx:for="{{address}}" wx:key="index">
<view bind:tap="toSelect" data-item="{{item}}" data-index="{{index}}" class="cell"> <view bind:tap="toSelect" data-item="{{item}}" data-index="{{index}}" class="cell">
<view class="icon"> <view class="icon">
...@@ -24,6 +24,12 @@ ...@@ -24,6 +24,12 @@
</view> </view>
</block> </block>
</scroll-view> </scroll-view>
<view wx:else class="nothing">
<view class="icon">
<glsx-image webp src="/cart/nothing-icon.png" />
</view>
暂无收货地址
</view>
</view> </view>
<view class="footer flex_cc"> <view class="footer flex_cc">
<view bind:tap="addNew" data-url="/packageMine/pages/address/detail/detail" class="btn flex_cc">新增地址</view> <view bind:tap="addNew" data-url="/packageMine/pages/address/detail/detail" class="btn flex_cc">新增地址</view>
......
...@@ -53,6 +53,13 @@ Component({ ...@@ -53,6 +53,13 @@ Component({
// 替换积分钱包名称 // 替换积分钱包名称
replaceNickName(data) { replaceNickName(data) {
let userInfo = wx.p.storage.get('userInfo') let userInfo = wx.p.storage.get('userInfo')
let { phone, scoreSource } = data
if (!phone || !scoreSource) {
wx.p.sentry.reportParamError(
'替换积分钱包姓名异常:phone, scoreSource',
data
)
}
commonApi.replaceWalletName({ commonApi.replaceWalletName({
nickName: data?.name, nickName: data?.name,
phone: data?.phone, phone: data?.phone,
......
...@@ -48,7 +48,7 @@ Component({ ...@@ -48,7 +48,7 @@ Component({
cartApi.getCartList(para).then(res => { cartApi.getCartList(para).then(res => {
let cartNum = 0 let cartNum = 0
res?.goodsList?.forEach(el => { res?.goodsList?.forEach(el => {
cartNum = NP.plus(cartNum, el.sellQty) cartNum = NP.plus(cartNum, el.sellQty || 0)
}) })
this.setData({ this.setData({
cartNum cartNum
......
...@@ -92,6 +92,19 @@ Page({ ...@@ -92,6 +92,19 @@ Page({
merchantId: userInfo?.merchantId, merchantId: userInfo?.merchantId,
merchantName: userInfo?.merchantName, merchantName: userInfo?.merchantName,
} : {id: reviewId} } : {id: reviewId}
let { goodsId, customerMobile, merchantId } = params
if (e.type == 'add' && (!goodsId || !customerMobile || !merchantId)) {
wx.p.sentry.reportParamError(
'商品详情进入埋点异常:goodsId, customerMobile, merchantId',
params
)
}
if (e.type != 'add' && !reviewId) {
wx.p.sentry.reportParamError(
'商品详情离开埋点异常:id',
{id: reviewId}
)
}
commonApi[eventApi](params).then(res => { commonApi[eventApi](params).then(res => {
this.setData({reviewId: res?.data}) this.setData({reviewId: res?.data})
}) })
...@@ -165,6 +178,12 @@ Page({ ...@@ -165,6 +178,12 @@ Page({
}, },
// 获取详情 // 获取详情
getDetail(options) { getDetail(options) {
if (!options.id) {
wx.p.sentry.reportParamError(
'商品详情异常:id',
id
)
}
homeApi.getGoodsDetailInfo({id: options.id, businessType: 1}).then(res => { 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)
...@@ -216,6 +235,13 @@ Page({ ...@@ -216,6 +235,13 @@ Page({
merchantId: userInfo?.merchantId merchantId: userInfo?.merchantId
} }
if (!detailInfo.goodsStock) return wx.p.wxApi.showToast('暂无库存') if (!detailInfo.goodsStock) return wx.p.wxApi.showToast('暂无库存')
let { goodsId, sellQty, goodsSource, scoreSource, merchantId, specificationData } = PARAMS
if (!goodsId || !sellQty || !goodsSource || !scoreSource || !merchantId || (goodsSource == 2 && !specificationData)) {
wx.p.sentry.reportParamError(
'加入购物车异常:goodsId, sellQty, goodsSource, scoreSource, merchantId, specificationData',
PARAMS
)
}
cartApi.addToCart(PARAMS).then(res => { cartApi.addToCart(PARAMS).then(res => {
wx.p.wxApi.showToast('加入购物车成功') wx.p.wxApi.showToast('加入购物车成功')
this.joinSuccess() this.joinSuccess()
......
...@@ -54,8 +54,8 @@ ...@@ -54,8 +54,8 @@
<view class="flex"> <view class="flex">
<view class="title">已选</view> <view class="title">已选</view>
<view class="content flex_ccc"> <view class="content flex_ccc">
<view wx:if="{{detailInfo.goodsSource == 1}}">{{skuInfo}}</view> <view class="text" wx:if="{{detailInfo.goodsSource == 1}}">{{skuInfo}}</view>
<view wx:else>{{activeSku}}</view> <view class="text" wx:else>{{activeSku}}</view>
</view> </view>
</view> </view>
<mp-icon icon="arrow" color="#B1B1B3" size="{{12}}"></mp-icon> <mp-icon icon="arrow" color="#B1B1B3" size="{{12}}"></mp-icon>
......
...@@ -79,6 +79,19 @@ ...@@ -79,6 +79,19 @@
.address-item .bottom .choose icon { .address-item .bottom .choose icon {
margin-right: 20rpx; margin-right: 20rpx;
} }
.nothing {
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
color: #7A8299;
padding-top: 40rpx;
.icon {
width: 320rpx;
height: 300rpx;
margin-bottom: 20rpx;
}
}
.btn-box { .btn-box {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
......
<view class="layout"> <view class="layout">
<block wx:if="{{addressList.length}}">
<block wx:for="{{addressList}}" wx:key="index"> <block wx:for="{{addressList}}" wx:key="index">
<view class="address-item" catchtap="chooseThis" data-item="{{item}}"> <view class="address-item" catchtap="chooseThis" data-item="{{item}}">
<view class="top"> <view class="top">
...@@ -28,7 +29,15 @@ ...@@ -28,7 +29,15 @@
</view> </view>
</view> </view>
</block> </block>
</block>
<block wx:else>
<view class="nothing">
<view class="icon">
<glsx-image webp src="/cart/nothing-icon.png" />
</view>
暂无收货地址
</view>
</block>
</view> </view>
<view class="btn-box isFullSucreen"> <view class="btn-box isFullSucreen">
<view class="btn text-center" bindtap="jump">新增收货地址</view> <view class="btn text-center" bindtap="jump">新增收货地址</view>
......
...@@ -143,6 +143,12 @@ Page({ ...@@ -143,6 +143,12 @@ Page({
if (!captcha) throw '请输入验证码' if (!captcha) throw '请输入验证码'
if (!phoneRex.test(mobile)) throw '请输入正确的手机号' if (!phoneRex.test(mobile)) throw '请输入正确的手机号'
wx.p.wxApi.showLoading() wx.p.wxApi.showLoading()
if (!mobile || !captcha || !this.sessionId) {
wx.p.sentry.reportParamError(
'手机号验证码登录异常: mobile, captcha, sessionId',
{mobile, captcha, sessionId: this.sessionId}
)
}
const { const {
code, code,
data, data,
...@@ -177,6 +183,13 @@ Page({ ...@@ -177,6 +183,13 @@ Page({
iv: detail.iv, iv: detail.iv,
sessionId: this.sessionId sessionId: this.sessionId
} }
let { encryptedData, iv, sessionId } = obj
if (!encryptedData || !iv || !sessionId) {
wx.p.sentry.reportParamError(
'授权手机号登录异常: encryptedData, iv, sessionId',
obj
)
}
const { const {
code, code,
data, data,
...@@ -202,6 +215,12 @@ Page({ ...@@ -202,6 +215,12 @@ Page({
getSource() { getSource() {
let { loginData } = this.data let { loginData } = this.data
if (!loginData.phone) {
wx.p.sentry.reportParamError(
'获取积分渠道来源异常:staffPhone ',
loginData
)
}
commonApi.getPointsSourceList({ commonApi.getPointsSourceList({
staffPhone: loginData?.phone staffPhone: loginData?.phone
}).then(res => { }).then(res => {
...@@ -227,6 +246,12 @@ Page({ ...@@ -227,6 +246,12 @@ Page({
this.getMerchantList(source, loginData) this.getMerchantList(source, loginData)
}, },
getMerchantList(source, loginData) { getMerchantList(source, loginData) {
if (!loginData.phone || !source) {
wx.p.sentry.reportParamError(
'获取门店列表异常:staffPhone, channelSource',
{...loginData, channelSource: source}
)
}
commonApi.getMerchantData({staffPhone: loginData?.phone, channelSource: source}).then(res => { commonApi.getMerchantData({staffPhone: loginData?.phone, channelSource: source}).then(res => {
let { code, data, message } = res let { code, data, message } = res
if (code == 0) { if (code == 0) {
...@@ -237,6 +262,12 @@ Page({ ...@@ -237,6 +262,12 @@ Page({
if (data?.length == 1) { // 仅有一个门店时跳过选择门店页面 直接登录成功 if (data?.length == 1) { // 仅有一个门店时跳过选择门店页面 直接登录成功
const { merchantId, merchantName } = data[0] || {} const { merchantId, merchantName } = data[0] || {}
wx.p.isLogin = true; wx.p.isLogin = true;
if (!source || !merchantId || !loginData.phone) {
wx.p.sentry.reportParamError(
'门店选择异常:staffPhone, channelSource',
{...loginData, channelSource: source, merchantId, merchantName}
)
}
wx.p.storage.set('userInfo', { wx.p.storage.set('userInfo', {
...loginData, ...loginData,
channelSource: source, channelSource: source,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!