123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- <template>
- <view class="container">
- <view class="logo"><image src="https://wx.fujinyangche.com/nvrnetwork/images/accredit_logo.png"></image></view>
- <!-- 横线 -->
- <view class="line"></view>
- <view class="title">申请获取以下权限</view>
- <view class="title title1">您暂未授权附近养车网获取你的信息,将无法正常使用小程序的功能,如需要正常使用,请点击"授权按钮",打开头像昵称等信息的授权</view>
- <button class="login" open-type="getUserInfo" @getuserinfo="getUserInfo">授权登录</button>
- <view class="no_login" @tap="navBack">取消</view>
- </view>
- </template>
- <script>
- let app = getApp();
- export default {
- data() {
- return {
- params:'',//接收路径传递过来的参数
- }
- },
- onLoad(options) {
- console.log(options);
- this.params = options.params;
- },
- methods: {
- //授权登陆
- getUserInfo(e){
- app.globalData.userInfo = e.detail.userInfo;
- uni.setStorageSync('userInfo',e.detail.userInfo);
- let pages = getCurrentPages(); //获取当前页面信息栈
- // let beforePage = pages[pages.length - 2];
- uni.login({
- success: (res) => {
- uni.request({
- url:'http://192.168.3.136/nvrnetwork/user',
- data:{
- code:res.code,
- nickName:e.detail.userInfo.nickName,
- img:e.detail.userInfo.avatarUrl
- },
- success: (res) => {
- console.log(res);
- let token = res.data.data.data;
- app.globalData.token = token;
- uni.setStorageSync('token',token);
- if(pages[0].route == 'pages/packageOne/service/serviceView/serviceView'){ //说明是从首页跳转过来
- uni.reLaunch({
- url:"/pages/packageOne/service/serviceView/serviceView?index=" + this.params
- })
- }else{
- uni.navigateBack({
- delta:1
- })
- }
-
- }
- })
- }
- })
- }
- }
- }
- </script>
- <style>
- .container {
- height: 100%;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: space-between;
- padding: 200rpx 0;
- box-sizing: border-box;
- overflow: hidden;
- }
- .logo{
- width:138rpx;
- height:138rpx;
- }
- .logo image{
- display: block;
- width:100%;
- height:100%;
- }
- .line{
- width:80%;
- height:2rpx;
- background-color: #000000;
- margin-top:100rpx;
- }
- .title{
- width:80%;
- color:#333333;
- font-size: 24rpx;
- text-align: left;
- margin-top:60rpx;
- }
- .title1{
- margin-top:10rpx;
- }
- .login{
- width: 574rpx;
- height: 74rpx;
- background:linear-gradient(270deg,rgba(254,107,21,1) 0%,rgba(254,163,48,1) 100%);
- text-align: center;
- line-height: 74rpx;
- color:#ffffff;
- font-size: 26rpx;
- border-radius: 56rpx;
- margin-top:100rpx;
- }
- .no_login{
- width: 574rpx;
- height: 74rpx;
- background-color: #ffffff;
- color:#E77817;
- text-align: center;
- line-height: 74rpx;
- font-size: 26rpx;
- border-radius: 56rpx;
- margin-top:40rpx;
- border:1px solid rgba(231,120,23,1);
- }
- </style>
|