更新支付失败时的错误提示,更新logo、名称

This commit is contained in:
shengliang 2019-11-29 20:06:49 +08:00
parent 59adb8c1d0
commit 0088f922f5
19 changed files with 48 additions and 85 deletions

View File

@ -12,6 +12,7 @@
"pages/ucenter/index/index",
"pages/ucenter/settings/index",
"pages/ucenter/order-list/index",
"pages/ucenter/goods-list/index",
"pages/ucenter/order-details/index",
"pages/ucenter/express-info/index",
"pages/ucenter/footprint/index",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

View File

@ -2,7 +2,7 @@
<view class='logo'>
<image class='logo-img' src='http://lucky-icon.meiweiyuxian.com/hio/logo.png'></image>
</view>
<view class='logo-name'>海鸥商城</view>
<view class='logo-name'>海风小店</view>
<view class='intro'>开源微信小程序商城</view>
<view class='login'>请完成微信授权以继续使用</view>
<button class='btn-login' open-type="getUserInfo" bindgetuserinfo='getUserInfo'>

View File

@ -72,6 +72,9 @@ Page({
cartTotal: res.data.cartTotal,
hasCartGoods: hasCartGoods
});
if (res.data.cartTotal.numberChange == 1) {
util.showErrorToast('部分商品库存有变动');
}
}
that.setData({
checkedAllStatus: that.isCheckedAll()
@ -140,11 +143,10 @@ Page({
}
},
updateCart: function(productId, goodsId, number, id) {
updateCart: function (itemIndex,productId, number, id) {
let that = this;
util.request(api.CartUpdate, {
productId: productId,
goodsId: goodsId,
number: number,
id: id
}, 'POST').then(function(res) {
@ -153,9 +155,13 @@ Page({
cartGoods: res.data.cartList,
cartTotal: res.data.cartTotal
});
let cartItem = that.data.cartGoods[itemIndex];
cartItem.number = number;
that.getCartNum();
}
else{
util.showErrorToast('库存不足了')
}
that.setData({
checkedAllStatus: that.isCheckedAll()
});
@ -163,32 +169,30 @@ Page({
},
cutNumber: function(event) {
let itemIndex = event.target.dataset.itemIndex;
let cartItem = this.data.cartGoods[itemIndex];
if (cartItem.number - 1 == 0) {
util.showErrorToast('再减没啦,要删除左滑试试')
util.showErrorToast('删除左滑试试')
}
let number = (cartItem.number - 1 > 1) ? cartItem.number - 1 : 1;
cartItem.number = number;
// cartItem.number = number;
this.setData({
cartGoods: this.data.cartGoods,
});
this.updateCart(cartItem.product_id, cartItem.goods_id, number, cartItem.id);
this.updateCart(itemIndex,cartItem.product_id, number, cartItem.id);
},
clicknone: function() {
},
addNumber: function(event) {
let itemIndex = event.target.dataset.itemIndex;
let cartItem = this.data.cartGoods[itemIndex];
let number = Number(cartItem.number) + 1;
cartItem.number = number;
// cartItem.number = number;
this.setData({
cartGoods: this.data.cartGoods,
});
this.updateCart(cartItem.product_id, cartItem.goods_id, number, cartItem.id);
this.updateCart(itemIndex,cartItem.product_id, number, cartItem.id);
},
getCartNum: function() {
util.request(api.CartGoodsCount).then(function(res) {

View File

@ -49,7 +49,7 @@
</block>
<block wx:else>
<view class="loading-wrap">
<image class="img" src="http://lucky-icon.meiweiyuxian.com/hio/loading.gif"></image>
<image class="img" src="http://lucky-icon.meiweiyuxian.com/hio/loading2.gif"></image>
<view class="text">正在加载...</view>
</view>
</block>

View File

@ -117,6 +117,7 @@ page {
}
.catalog .cate .loading-wrap .text{
font-size: 26rpx;
color: #999;
}
.catalog .cate .banner-container {

View File

@ -225,9 +225,8 @@ Page({
});
// console.error('规格所对应货品不存在');
wx.showToast({
image: 'http://lucky-icon.meiweiyuxian.com/hio/icon_error.png',
image: '/images/icon/icon_error.png',
title: '规格所对应货品不存在',
mask: true
});
return;
}
@ -241,9 +240,8 @@ Page({
soldout: true
});
wx.showToast({
image: 'http://lucky-icon.meiweiyuxian.com/hio/icon_error.png',
image: '/images/icon/icon_error.png',
title: '库存不足',
// mask: true
});
return false;
}
@ -368,9 +366,8 @@ Page({
//提示选择完整规格
if (!this.isCheckedAllSpec()) {
wx.showToast({
image: 'http://lucky-icon.meiweiyuxian.com/hio/icon_error.png',
image: '/images/icon/icon_error.png',
title: '请选择规格',
mask: true
});
return false;
}
@ -380,9 +377,8 @@ Page({
if (!checkedProductArray || checkedProductArray.length <= 0) {
//找不到对应的product信息提示没有库存
wx.showToast({
image: 'http://lucky-icon.meiweiyuxian.com/hio/icon_error.png',
image: '/images/icon/icon_error.png',
title: '库存不足',
mask: true
});
return false;
}
@ -391,9 +387,8 @@ Page({
if (checkedProduct.goods_number < this.data.number) {
//要买的数量比库存多
wx.showToast({
image: 'http://lucky-icon.meiweiyuxian.com/hio/icon_error.png',
image: '/images/icon/icon_error.png',
title: '库存不足',
mask: true
});
return false;
}
@ -414,7 +409,6 @@ Page({
} else {
wx.showToast({
title: '添加成功',
// mask: true
});
if (productLength != 1 || that.data.openAttr == true) {
that.setData({
@ -430,9 +424,8 @@ Page({
}
} else {
wx.showToast({
image: 'http://lucky-icon.meiweiyuxian.com/hio/icon_error.png',
image: '/images/icon/icon_error.png',
title: _res.errmsg,
mask: true
});
}
@ -459,9 +452,8 @@ Page({
//提示选择完整规格
if (!this.isCheckedAllSpec()) {
wx.showToast({
image: 'http://lucky-icon.meiweiyuxian.com/hio/icon_error.png',
image: '/images/icon/icon_error.png',
title: '请选择规格',
mask: true
});
return false;
}
@ -470,9 +462,8 @@ Page({
if (!checkedProductArray || checkedProductArray.length <= 0) {
//找不到对应的product信息提示没有库存
wx.showToast({
image: 'http://lucky-icon.meiweiyuxian.com/hio/icon_error.png',
image: '/images/icon/icon_error.png',
title: '库存不足',
mask: true
});
return false;
}
@ -481,9 +472,8 @@ Page({
if (checkedProduct.goods_number < this.data.number) {
//要买的数量比库存多
wx.showToast({
image: 'http://lucky-icon.meiweiyuxian.com/hio/icon_error.png',
image: '/images/icon/icon_error.png',
title: '库存不足',
mask: true
});
return false;
}
@ -504,9 +494,8 @@ Page({
});
} else {
wx.showToast({
image: 'http://lucky-icon.meiweiyuxian.com/hio/icon_error.png',
image: '/images/icon/icon_error.png',
title: _res.errmsg,
mask: true
});
}
});

View File

@ -46,7 +46,7 @@ Page({
onShareAppMessage: function() {
let info = wx.getStorageSync('userInfo');
return {
title: '海鸥商城',
title: '海风小店',
desc: '开源微信小程序商城',
path: '/pages/index/index?id=' + info.id
}

View File

@ -1,3 +1,3 @@
{
"navigationBarTitleText": "海鸥商城"
"navigationBarTitleText": "海风小店"
}

View File

@ -98,6 +98,6 @@
<view class="no-more-goods ">没有更多商品啦</view>
</view>
<view class="loading" style="height:{{sysHeight}}px" wx:else>
<image class="img" src="http://lucky-icon.meiweiyuxian.com/hio/loading.gif"></image>
<image class="img" src="http://lucky-icon.meiweiyuxian.com/hio/loading2.gif"></image>
<view class="text">努力加载中</view>
</view>

View File

@ -18,8 +18,8 @@
}
.loading .img {
width: 60rpx;
height: 60rpx;
width: 90rpx;
height: 90rpx;
}
.loading .text {

View File

@ -14,11 +14,11 @@ Page({
addressId: 0,
goodsCount: 0,
postscript: '',
outStock: 0
},
toGoodsList: function (e) {
let orderId = this.data.orderId;
wx.navigateTo({
url: '/pages/ucenter/goods-list/index?type=1',
url: '/pages/ucenter/goods-list/index?id=0',
});
},
toSelectAddress: function () {
@ -119,6 +119,9 @@ Page({
if (res.data.outStock == 1) {
util.showErrorToast('有部分商品缺货或已下架');
}
else if (res.data.numberChange == 1){
util.showErrorToast('部分商品库存有变动');
}
}
});
},
@ -141,7 +144,7 @@ Page({
formId: formId,
actualPrice: actualPrice,
}, 'POST').then(res => {
const orderId = res.data.orderInfo.id;
console.log(res);
if (res.errno === 0) {
wx.removeStorageSync('orderId');
wx.setStorageSync('addressId', 0);
@ -156,7 +159,7 @@ Page({
});
});
} else {
util.showErrorToast('下单失败');
util.showErrorToast(res.errmsg);
}
});
}

View File

@ -34,7 +34,7 @@ Page({
status: true
});
}).catch(res => {
util.showErrorToast('支付失败');
util.showErrorToast(res.errmsg);
});
}
})

View File

@ -94,7 +94,7 @@
</view>
<view class="company">
<view class="c-wrap">
<view class="text">海鸥商城</view>
<view class="text">海风小店</view>
<view class="line"></view>
</view>
<view class="tip">开源微信小程序商城</view>

View File

@ -60,12 +60,9 @@ Page({
payOrder: function(e) {
let that = this;
pay.payOrder(parseInt(that.data.orderId)).then(res => {
// this.setData({
// status: true
// });
that.getOrderDetail();
}).catch(res => {
util.showErrorToast('支付失败');
util.showErrorToast(res.errmsg);
});
},
toSelectAddress: function() {
@ -155,15 +152,6 @@ Page({
onPosting: 1,
express: express
});
// var traces = res.data.traces;
// that.setData({
// expressList: expressList
// });
// if (traces.length == 0) {
// that.setData({
// hasExpress: 0
// });
// }
}
});
},

View File

@ -37,7 +37,7 @@
</view>
</view>
<view class="onPosting" wx:if="{{orderInfo.shipping_status && onPosting == 0}}">
<image class='loading' src='http://lucky-icon.meiweiyuxian.com/hio/loading.gif'></image>
<image class='loading' src='http://lucky-icon.meiweiyuxian.com/hio/loading2.gif'></image>
<view class='t'>快递信息查询中。。。</view>
</view>
<view wx:elif="{{orderInfo.shipping_status && onPosting == 1}}" class="express">

View File

@ -38,7 +38,8 @@ Page({
that.getOrderList();
that.getOrderInfo();
}).catch(res => {
util.showErrorToast('支付失败');
console.log(res);
util.showErrorToast(res.errmsg);
});
},
getOrderInfo: function(e) {
@ -61,16 +62,6 @@ Page({
}).then(function(res) {
if (res.errno === 0) {
let count = res.data.count;
// var orderList = res.data.data;
// that.setData({
// orderList: orderList
// });
// if (orderList.length == 0) {
// that.setData({
// hasOrder: 1
// });
// }
that.setData({
allCount: count,
allOrderList: that.data.allOrderList.concat(res.data.data),
@ -78,14 +69,11 @@ Page({
orderList: that.data.allOrderList.concat(res.data.data)
});
let hasOrderData = that.data.allOrderList.concat(res.data.data);
if (count == 0) {
that.setData({
hasOrder: 1
});
}
}
});
},
@ -94,9 +82,7 @@ Page({
url: '/pages/index/index'
});
},
onLoad: function() {
},
onLoad: function() {},
onShow: function() {
let showType = wx.getStorageSync('showType');
let nowShowType = this.data.showType;
@ -113,13 +99,6 @@ Page({
}
this.getOrderInfo();
},
// onPullDownRefresh: function () {
// wx.showNavigationBarLoading()
// this.getOrderList();
// this.getOrderInfo();
// wx.hideNavigationBarLoading() //完成停止加载
// wx.stopPullDownRefresh() //停止下拉刷新
// },
switchTab: function(event) {
let showType = event.currentTarget.dataset.index;
wx.setStorageSync('showType', showType);
@ -166,10 +145,8 @@ Page({
}
});
},
onReachBottom: function() {
let that = this;
if (that.data.allCount / that.data.size < that.data.allPage) {
that.setData({
showTips: 1
@ -181,5 +158,4 @@ Page({
});
that.getOrderList();
}
})

View File

@ -10,6 +10,7 @@ function payOrder(orderId) {
}).then((res) => {
if (res.errno === 0) {
const payParam = res.data;
console.log(res.data);
wx.requestPayment({
'timeStamp': payParam.timeStamp,
'nonceStr': payParam.nonceStr,