|
|
@@ -119,7 +119,7 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
title: "",
|
|
|
- isAuth: true,
|
|
|
+ isAuth: false,
|
|
|
scrollVal: Number,
|
|
|
footFlag: true,
|
|
|
btnPos:uni.getMenuButtonBoundingClientRect().top + 6,
|
|
|
@@ -155,15 +155,15 @@ export default {
|
|
|
},
|
|
|
onShow() {
|
|
|
uni.hideTabBar({});
|
|
|
- this.isAuth = getApp().globalData.isAuth;
|
|
|
- this.getHeatList();
|
|
|
- },
|
|
|
+ this.getUserInfo();
|
|
|
+ },
|
|
|
onLoad() {
|
|
|
// uni.showLoading({
|
|
|
// title: "加载中",
|
|
|
// mask: true,
|
|
|
// });
|
|
|
//this.getSwiperList();
|
|
|
+ this.getUserInfo();
|
|
|
},
|
|
|
onShareAppMessage() {
|
|
|
// url: "/pages/index/index";
|
|
|
@@ -174,6 +174,40 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ getUserInfo(){
|
|
|
+ let url = getApp().makeApiUrl("user",'user','info_by_openid');
|
|
|
+ uni.request({
|
|
|
+ url:url,
|
|
|
+ method: 'POST',
|
|
|
+ header: {
|
|
|
+ 'content-type': 'application/x-www-form-urlencoded'
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ openId: getApp().globalData.open_id ? getApp().globalData.open_id : uni.getStorageSync('openId')
|
|
|
+ },
|
|
|
+
|
|
|
+ success: (res) => {
|
|
|
+ console.log(res)
|
|
|
+ if(res.data.code === 200){
|
|
|
+ if (res.data.data.phone === ''){
|
|
|
+ //必须有手机号才算登录成功,系统才可用。
|
|
|
+ // console.log("res.data.data.phone="+res.data.data.phone);
|
|
|
+ getApp().globalData.isAuth = false;
|
|
|
+ this.isAuth = false;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ getApp().globalData.isAuth = true;
|
|
|
+ this.isAuth = true;
|
|
|
+ this.getHeatList();
|
|
|
+ }
|
|
|
+ // uni.hideLoading()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: () => {
|
|
|
+ console.log("连接失败");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
getPhoneNumber(e){
|
|
|
let res = getApp().getPhoneNumber(e);
|
|
|
if (res){
|
|
|
@@ -230,7 +264,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
getHeatList() {
|
|
|
-
|
|
|
+
|
|
|
let url = getApp().makeApiUrl("user",'user','get_order_list');
|
|
|
let postData = {
|
|
|
// page: 1,
|