From cb36fbf08da49ea51ffb6077b4c1cd9283982f4e Mon Sep 17 00:00:00 2001 From: yvan.ni <765199919@qq.com> Date: Mon, 2 Mar 2020 12:17:05 +0800 Subject: [PATCH] 会员中心的 门店选择的bug优化 --- pages/user/index/index.js | 1 + pages/user/userinfo/userinfo.js | 12 ++++++++---- pages/user/userinfo/userinfo.wxml | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/pages/user/index/index.js b/pages/user/index/index.js index 29acc8d..e5a24f0 100644 --- a/pages/user/index/index.js +++ b/pages/user/index/index.js @@ -107,6 +107,7 @@ Page({ rq.get("/api/weshop/users/getinfo/" + os.stoid + "/" + e.user_id, { success: function(su) { var data = su.data.data; + if(!data) data={}; data.cashcount = parseInt(data.cashcount); s.setData({ udata: data, diff --git a/pages/user/userinfo/userinfo.js b/pages/user/userinfo/userinfo.js index ab855a2..fef23f5 100644 --- a/pages/user/userinfo/userinfo.js +++ b/pages/user/userinfo/userinfo.js @@ -38,7 +38,7 @@ Page({ sort_store: 0, //门店分类 sec_sto: "", more_store: 0, //选择门店 - choice_sort_store: 1, //选择分类门店 + choice_sort_store: 0, //选择分类门店 more_store: 0, //选择门店 lat: null, //维度 lon: null, //经度 @@ -280,7 +280,7 @@ Page({ pageSize: 300 } th.setData({ - sort_store: 1 + sort_store: 0 }); var i = getApp().request; //如果有距离的话 @@ -625,8 +625,12 @@ Page({ req.get("/api/weshop/users/getAndUpdateUser/" + r.stoid + "/" + getApp().globalData.user_id, { success: function(src) { var a = src.data.data; - var time = util.formatTime(a.reg_time, "'Y/M/D"); - var birthday = util.formatTime(a.birthday, "'Y/M/D"); + + if(!a) a={}; + var time ="",birthday =""; + if(a && a.reg_time) util.formatTime(a.reg_time, "'Y/M/D"); + if(a && a.birthday) util.formatTime(a.birthday, "'Y/M/D"); + a.reg_time = time; a.birthday = birthday e.setData({ diff --git a/pages/user/userinfo/userinfo.wxml b/pages/user/userinfo/userinfo.wxml index c501b71..5c64773 100644 --- a/pages/user/userinfo/userinfo.wxml +++ b/pages/user/userinfo/userinfo.wxml @@ -274,9 +274,9 @@ - + - + -- libgit2 0.21.4