小程序登录优化
parent
c3d962f791
commit
2905ebdbf0
|
|
@ -524,4 +524,27 @@ App({
|
|||
}
|
||||
},
|
||||
|
||||
// 登录校验
|
||||
is_login_check(res) {
|
||||
if(res.code == -400)
|
||||
{
|
||||
wx.clearStorage();
|
||||
wx.showModal({
|
||||
title: '温馨提示',
|
||||
content: '授权用户信息',
|
||||
confirmText: '确认',
|
||||
cancelText: '暂不',
|
||||
success: (result) => {
|
||||
if (result.confirm) {
|
||||
wx.navigateTo({
|
||||
url: "/pages/login/login?event_callback=init"
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
});
|
||||
|
|
@ -78,6 +78,7 @@ textarea {
|
|||
.br-r { border-right: solid 1px #efefef; }
|
||||
|
||||
/* 虚线边框 */
|
||||
.br-dashed { border: dashed 1px #efefef; }
|
||||
.br-b-dashed { border-bottom: dashed 1px #efefef; }
|
||||
.br-t-dashed { border-top: dashed 1px #efefef; }
|
||||
.br-l-dashed { border-left: dashed 1px #efefef; }
|
||||
|
|
|
|||
|
|
@ -131,7 +131,9 @@ Page({
|
|||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
app.showToast(res.data.msg);
|
||||
if (app.is_login_check(res.data)) {
|
||||
app.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ Page({
|
|||
data_bottom_line_status: true,
|
||||
data_list_loding_msg: '购物车空空如也',
|
||||
|
||||
// 是否展示型
|
||||
// 站点模式
|
||||
common_site_type: data.common_site_type || 0,
|
||||
common_is_exhibition_mode_btn_text: data.common_is_exhibition_mode_btn_text || '立即咨询',
|
||||
customer_service_tel: data.customer_service_tel || null,
|
||||
|
|
@ -87,7 +87,9 @@ Page({
|
|||
data_bottom_line_status: false,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
app.showToast(res.data.msg);
|
||||
if (app.is_login_check(res.data)) {
|
||||
app.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
|
|
|
|||
|
|
@ -315,7 +315,9 @@ Page({
|
|||
});
|
||||
app.showToast(res.data.msg, "success");
|
||||
} else {
|
||||
app.showToast(res.data.msg);
|
||||
if (app.is_login_check(res.data)) {
|
||||
app.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
|
|
@ -350,7 +352,9 @@ Page({
|
|||
this.popup_close_event();
|
||||
app.showToast(res.data.msg, "success");
|
||||
} else {
|
||||
app.showToast(res.data.msg);
|
||||
if (app.is_login_check(res.data)) {
|
||||
app.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
|
|
@ -866,5 +870,4 @@ Page({
|
|||
path: '/pages/goods-detail/goods-detail?goods_id=' + this.data.goods.id +'&referrer='+user_id
|
||||
};
|
||||
},
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@
|
|||
<!-- 在线客服 -->
|
||||
<view wx:if="{{common_app_is_online_service == 1}}">
|
||||
<import src="/pages/lib/online-service/content.wxml" />
|
||||
<template is="online_service"></template>
|
||||
<template is="online_service" data="{{title: goods.title, path: '/pages/goods-detail/goods-detail?goods_id='+goods.id, img: goods.images, card: true}}"></template>
|
||||
</view>
|
||||
|
||||
<!-- 购物车 -->
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template name="online_service">
|
||||
<button open-type="contact" class="common-quick-nav common-online-service">
|
||||
<button open-type="contact" class="common-quick-nav common-online-service" send-message-title="{{title || ''}}" send-message-path="{{path || ''}}" send-message-img="{{img || ''}}" show-message-card="{{card || false}}">
|
||||
<image src="/pages/lib/online-service/icon.png" class="dis-block"></image>
|
||||
</button>
|
||||
</template>
|
||||
|
|
@ -77,8 +77,9 @@ Page({
|
|||
this.setData({
|
||||
data_list_loding_status: 0
|
||||
});
|
||||
|
||||
app.showToast(res.data.msg);
|
||||
if (app.is_login_check(res.data)) {
|
||||
app.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
|
|
|
|||
|
|
@ -91,8 +91,9 @@ Page({
|
|||
this.setData({
|
||||
data_list_loding_status: 0
|
||||
});
|
||||
|
||||
app.showToast(res.data.msg);
|
||||
if (app.is_login_check(res.data)) {
|
||||
app.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
|
|
|
|||
|
|
@ -66,7 +66,9 @@ Page({
|
|||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
app.showToast(res.data.msg);
|
||||
if (app.is_login_check(res.data)) {
|
||||
app.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
|
|
|
|||
|
|
@ -89,8 +89,9 @@ Page({
|
|||
this.setData({
|
||||
data_list_loding_status: 0
|
||||
});
|
||||
|
||||
app.showToast(res.data.msg);
|
||||
if (app.is_login_check(res.data)) {
|
||||
app.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
|
|
|
|||
|
|
@ -88,8 +88,9 @@ Page({
|
|||
this.setData({
|
||||
data_list_loding_status: 0
|
||||
});
|
||||
|
||||
app.showToast(res.data.msg);
|
||||
if (app.is_login_check(res.data)) {
|
||||
app.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
|
|
|
|||
|
|
@ -91,8 +91,9 @@ Page({
|
|||
this.setData({
|
||||
data_list_loding_status: 0
|
||||
});
|
||||
|
||||
app.showToast(res.data.msg);
|
||||
if (app.is_login_check(res.data)) {
|
||||
app.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
<!-- 商品列表 -->
|
||||
<view class="goods bg-white spacing-mb">
|
||||
<view wx:for="{{detail.items}}" wx:key="item" class="goods-item oh">
|
||||
<view wx:for="{{detail.items}}" wx:key="item" class="goods-item br-b-dashed oh">
|
||||
<navigator url="/pages/goods-detail/goods-detail?goods_id={{item.goods_id}}" hover-class="none">
|
||||
<image class="goods-image fl" src="{{item.images}}" mode="aspectFill" />
|
||||
<view class="goods-base">
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
<view wx:if="{{(site_fictitious.tips || null) != null}}" class="tips-value">
|
||||
<rich-text nodes="{{site_fictitious.tips}}"></rich-text>
|
||||
</view>
|
||||
<view wx:for="{{detail.items}}" wx:key="item" class="item br-b oh">
|
||||
<view wx:for="{{detail.items}}" wx:key="item" class="item br-b-dashed oh">
|
||||
<image class="left-image br fl" src="{{item.images}}" mode="aspectFill" />
|
||||
<view class="right-value fr">
|
||||
<rich-text wx:if="{{(item.fictitious_goods_value || null) != null}}" nodes="{{item.fictitious_goods_value}}"></rich-text>
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@
|
|||
min-height: 160rpx;
|
||||
margin-left: 180rpx;
|
||||
}
|
||||
.goods .goods-item:not(:last-child) {
|
||||
border-bottom: 1px dashed #efefef;
|
||||
.goods .goods-item:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
.goods-item {
|
||||
padding: 20rpx 10rpx;
|
||||
|
|
|
|||
|
|
@ -156,8 +156,9 @@ Page({
|
|||
data_list_loding_status: 0,
|
||||
load_status: 1,
|
||||
});
|
||||
|
||||
app.showToast(res.data.msg);
|
||||
if (app.is_login_check(res.data)) {
|
||||
app.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
<text class="cr-666">{{item.add_time}}</text>
|
||||
<text class="fr cr-main">{{item.status_name}}</text>
|
||||
</view>
|
||||
<view wx:for="{{item.items}}" wx:key="key" wx:for-item="detail" class="goods-item oh">
|
||||
<view wx:for="{{item.items}}" wx:key="key" wx:for-item="detail" class="goods-item br-b-dashed oh">
|
||||
<navigator url="/pages/user-order-detail/user-order-detail?id={{item.id}}" hover-class="none">
|
||||
<image class="goods-image fl" src="{{detail.images}}" mode="aspectFill" />
|
||||
<view class="goods-base">
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@
|
|||
.goods-title {
|
||||
line-height: 36rpx;
|
||||
}
|
||||
.list-item .goods-item:not(:last-child) {
|
||||
border-bottom: 1px dashed #efefef;
|
||||
.list-item .goods-item:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
.goods-item {
|
||||
padding: 20rpx 10rpx;
|
||||
|
|
|
|||
|
|
@ -134,8 +134,9 @@ Page({
|
|||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
|
||||
app.showToast(res.data.msg);
|
||||
if (app.is_login_check(res.data)) {
|
||||
app.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
|
|
|
|||
|
|
@ -107,7 +107,10 @@ Page({
|
|||
common_app_is_head_vice_nav: data.common_app_is_head_vice_nav || 0,
|
||||
});
|
||||
} else {
|
||||
app.showToast(res.data.msg);
|
||||
if(app.is_login_check(res.data))
|
||||
{
|
||||
app.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
|
|
@ -119,7 +122,7 @@ Page({
|
|||
|
||||
// 清除缓存
|
||||
clear_storage(e) {
|
||||
wx.clearStorage()
|
||||
wx.clearStorage();
|
||||
app.showToast("清除缓存成功", "success");
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
|
||||
<view class="nav-item br-b" bindtap="clear_storage">
|
||||
<image src="/images/user-nav-cache-icon.png" class="item-icon" mode="widthFix" />
|
||||
<text class="item-name">清除缓存</text>
|
||||
<text class="item-name">安全退出</text>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{customer_service_tel != null}}" class="nav-item" bindtap="call_event">
|
||||
|
|
|
|||
Loading…
Reference in New Issue