代码拉取完成,页面将自动刷新
<script>
//导入接口请求文件
import {
Request
} from './utils/request.js';
import Config from './utils/config.js';
export default {
globalData: {
//用户登陆状态
Logincode: '',
//用户openid
openid: '',
//用户id
userid: '',
//
state: '',
//
code: '',
host: '',
//
houseList: '',
//版本参数:development 开发版本,online 上线版本
DevelopVersion: 'online',
//项目名:使用上线版本是需传入->项目名参数:renthouse 使用开发版本传入->项目名参数:huali
project: 'renthouse',
// 租客上线版本的小程序版本的appid:wx96570dd0829f1548
// 测试板appid:wx1a26121e88e594bc
//此参数为首页筛选 的变量名
select_city: '',
select_hotid: '' ,
select_district: '',
select_chooseTimeId: '',
select_startmoney: '',
select_endmoney: '',
select_livingId: '',
select_bedId: '',
select_toiletId: '',
select_labelName: '',
},
onLaunch: function() {
this.$scope.globalData.host = Config.service.host;
var date = new Date('2021-04-01 19:43:00');
// 有三种方式获取
// var time1 = date.getTime();
// var time2 = date.valueOf();
// var time3 = Date.parse(date);
// console.log(time1);//1398250549123
// console.log(time2);//1398250549123
// console.log(time3);//1398250549000
// console.log('App Launch');
//login接口拿到code给后台,拿去交换openid
uni.login({
success: (res) => {
// console.log('成功',res)
this.code = res.code
this.$scope.globalData.code = res.code
//获取openid,用户信息接口
new Request('User_Login/GetUserOpendInfoAndRegister').request(
() => {return 'POST';},
() => {
return {
code: this.code,
DevelopVersion: this.$scope.globalData.DevelopVersion,
project: this.$scope.globalData.project,
}
},
(res) => {
this.$scope.globalData.Logincode = res.data.data.LoginCode
this.$scope.globalData.openid = res.data.data.openid
this.$scope.globalData.userid = res.data.data.userid
// this.$scope.globalData.userid = 47;
// this.$scope.globalData.openid = 'oYJnf4jSbRlcJlx26unZeuZUA_Y4';
// this.$scope.globalData.openid = 'oYJnf4l0VQJTGS0gFayRKDoV-VHU';
// this.$scope.globalData.userid = 45;
// this.$scope.globalData.openid = 'oYJnf4sospOztdLzgwuCSlylzC4k';
// this.$scope.globalData.userid = 122;
// console.log(this.$scope.globalData.openid)
}
);
},
fail: (err) => {
// console.log('失败')
}
})
},
onShow: function() {
// console.log('App Show')
},
onHide: function() {
// console.log('App Hide')
}
}
</script>
<style>
/*每个页面公共css */
</style>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。