| | |
| | | <template> |
| | | <view class="login-container" v-if="!loadding"> |
| | | |
| | | |
| | | <view class="wechatapp"> |
| | | <view class="header"> |
| | | <text class="icon iconfont icon-xuanze"></text> |
| | |
| | | <view class="login-btn"> |
| | | <button class="btn-normal" @click="closeWindow">关闭页面</button> |
| | | </view> |
| | | |
| | | |
| | | </view> |
| | | </template> |
| | | |
| | |
| | | /*获取个人中心数据*/ |
| | | this.getData(); |
| | | }, |
| | | onLoad(){ |
| | | onLoad(options){ |
| | | let self = this; |
| | | |
| | | //#ifdef MP-WEIXIN |
| | | console.log('开始微信授权'); |
| | | wx.login({ |
| | | success(res) { |
| | | // 发送用户信息 |
| | |
| | | } |
| | | }); |
| | | //#endif |
| | | |
| | | //#ifdef H5 |
| | | // H5环境直接显示成功页面 |
| | | setTimeout(() => { |
| | | self.loadding = false; |
| | | }, 1000); |
| | | //#endif |
| | | }, |
| | | methods: { |
| | | /*获取数据*/ |
| | |
| | | self._get('user.index/detail', { |
| | | url: self.url |
| | | }, function(res) { |
| | | uni.showToast({ |
| | | title:res.msg |
| | | }); |
| | | self.loadding = false; |
| | | uni.stopPullDownRefresh(); |
| | | self.isloadding = false; |
| | | }); |
| | | }, |
| | | closeWindow() { |
| | | WeixinJSBridge.call('closeWindow'); |
| | | if (typeof WeixinJSBridge !== 'undefined') { |
| | | WeixinJSBridge.call('closeWindow'); |
| | | } else { |
| | | uni.showToast({ |
| | | title: '请在微信浏览器中使用', |
| | | icon: 'none' |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | } |