|
@@ -138,21 +138,17 @@ export default {
|
|
|
|
|
|
//如果已选城市且没有添加客服每天弹窗一次
|
|
|
if (this.$checkAccess.getCity() && this.$checkAccess.getFollowQrcode()) {
|
|
|
- uni.getStorage({
|
|
|
- key: "followPopupTime",
|
|
|
- success: (res) => {
|
|
|
- if (!res.data || new Date().getTime() - res.data > 1000 * 60 * 60 * 24) {
|
|
|
- uni.setStorage({
|
|
|
- key: "followPopupTime",
|
|
|
- data: new Date().getTime(),
|
|
|
- });
|
|
|
- this.$refs.addFollow.open("center");
|
|
|
- }
|
|
|
- },
|
|
|
- fail: (err) => {
|
|
|
- this.$refs.addFollow.open("center");
|
|
|
- },
|
|
|
- });
|
|
|
+ // 获取弹出时间
|
|
|
+ let followPopupTime = uni.getStorageSync('followPopupTime');
|
|
|
+ // 现在的时候
|
|
|
+ let nowTime = new Date().getTime();
|
|
|
+ // 时间戳
|
|
|
+ followPopupTime = followPopupTime ? followPopupTime : 0;
|
|
|
+ // 弹出结果
|
|
|
+ if( followPopupTime <= 0 || followPopupTime - nowTime > 86400000 ) {
|
|
|
+ this.$refs.addFollow.open("center");
|
|
|
+ uni.setStorageSync('followPopupTime',nowTime);
|
|
|
+ }
|
|
|
}
|
|
|
this.isManager = this.$checkAccess.isManager();
|
|
|
// 没有数据的话,或者请求中,不允许刷新
|