123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218 |
- <template>
- <view class='loginWrap'>
- <view style='text-align:center;padding:60rpx;'>
- <u--image width='80' height='80' src="/static/logo.png" radius='10' shape="square"></u--image>
- </view>
- <view style='width:80%;margin:0 auto;'>
- <u-button :customStyle="customStyleOk" open-type="getPhoneNumber"
- @getphonenumber="getPhoneNumber"> 微信用户一键登录</u-button>
- </view>
- <!-- <view><u-button :customStyle="customStyleUnOk" @click="showAuthorizePhone=false" :plain="true">
- 拒绝</u-button></view> -->
- <view style='margin:40rpx 0;'>
- <view style='width: 77%;margin: 0 auto;' class='flex'>
- <view style='margin-right:5rpx;'>
- <u--image @click='value= !value' width='16' height='16' :src="value?'/static/image/login/checked.png':'/static/image/login/no-checked.png'" radius='10' shape="square"></u--image>
- </view>
- 登录代表您已同意<navigator
- url="/pageA/webview?can_share=false&url=https://liangxin.zthymaoyi.com/youyuquan.html"
- class="path" hover-class="navigator-hover">用户服务协议和隐私政策</navigator>
- </view>
- </view>
- <u-modal :show="showAuthorizeUser" :showConfirmButton="false">
- <view class="slot-content">
- <view class="auth-card">
- <view class="img">
- <img class="avatar-img" src="@/static/logo.png" mode="widthFix">
- </view>
- <view class="content">邀请您补全个人信息<br></br>(昵称、头像)</view>
- <view style="margin-left: 100rpx;margin-right: 100rpx">
- <u-form :model="userInfo" ref="uForm">
- <u-form-item label="头像">
- <button class="avatar-wrapper" open-type="chooseAvatar" @chooseavatar="onChooseAvatar"
- slot="right">
- <image class="avatar"
- :src="userInfo.head?userInfo.head:'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'">
- </image>
- </button>
- </u-form-item>
- <u-form-item label="昵称">
- <u-input inputAlign='right' v-model="userInfo.nickname" class="weui-input"
- @blur="userNameInput" placeholder="请输入昵称" border="false" />
- <!-- <input type="nickname" :value="userInfo.nickname" class="weui-input" @blur="userNameInput" placeholder="请输入昵称"/> -->
- </u-form-item>
- </u-form>
- </view>
- </view>
- <view class="auth-btncard">
- <view class="btn-unok"><u-button :customStyle="customStyleUnOk" @click="authUser(0)">
- 拒绝</u-button>
- </view>
- <view class="btn-ok">
- <u-button :customStyle="customStyleOk" @click="authUser(1)"> 允许</u-button>
- </view>
- </view>
- </view>
- </u-modal>
- </view>
- </template>
- <script>
- var that
- export default {
- data() {
- return {
- userInfo: {
- head: '',
- nickname: '',
- phone: '',
- },
- showAuthorizeUser:false,
- value:false,
- customStyleUnOk: {
- marginTop: '20rpx',
- color: '#eaad1a',
- border: '2px solid #eaad1a',
- "border-radius": "10px",
- fontSize: "32rpx"
- },
- customStyleOk: {
- marginTop: '20rpx',
- color: '#000',
- // border: '2px solid #eaad1a',
- "border-radius": "10px",
- fontSize: "32rpx",
- padding:'0 5px',
- background: " linear-gradient(to right,#FED41E,#FDC21D);"
- },
- };
- },
- props: {
-
- content: {
- type: String,
- default: ""
- },
- },
-
- watch:{
-
- },
-
- mounted() {
- that = this
- },
- computed: {
-
- },
- methods: {
- radiochange(e){
-
- },
- open(){
- this.showAuthorizePhone=true
- },
- async getPhoneNumber(e) {
- if(this.value){
- console.log(0)
- that.userInfo = await this.$request.wxlogin()
- console.log(that.userInfo,1111)
- that.userInfo.phone = await this.$request.getPhone(e, that.userInfo)
- console.log(that.userInfo,2222)
- this.showAuthorizeUser = true
- }else{
- uni.showToast({
- icon: "none",
- title: '请阅读并勾选用户协议和隐私政策',
- duration: 3000
- });
- }
-
-
- },
- async authUser(type) {
- //同步信息,没有头像和昵称自动生成
- this.userInfo = await this.$request.syncInfo(this.userInfo)
- if (this.userInfo.openId) {
- uni.setStorageSync("userInfo", that.userInfo)
- that.showAuthorizeUser = false
- uni.navigateBack()
- // that.mescroll.resetUpScroll()
- }
- },
- }
- }
- </script>
- <style lang='scss' scoped>
- .loginWrap{
- background:#fff;
- height:100vh;
- }
- /deep/.u-transition{
- align-items: center;
- }
- .path{
- color:#FDC21D;
- }
- /deep/.u-radio-group{
- flex: 0.7 !important;
- }
- .auth-btncard {
- display: flex !important;
- justify-content: space-between !important;
-
- .btn-unok {
- width: 40%;
- }
-
- .btn-ok {
- width: 40%;
- }
- }
-
- .auth-card {
- text-align: center;
-
- .avatar-img {
- width: 250rpx;
- }
-
- .title {
- font-size: 20rpx;
- }
-
- .content {
- font-size: 32rpx;
- font-weight: bold;
- color: #1A1A1A;
- margin-bottom: 30rpx;
- }
- }
-
- .avatar-wrapper {
- color: #333 !important;
- border: none !important;
- border-radius: 0 !important;
- background-color: transparent !important;
- padding: 0;
- }
-
- .avatar-wrapper::after {
- border: none !important;
- }
-
- .avatar {
- width: 100rpx;
- height: 100rpx;
- overflow: hidden;
- border-radius: 100%;
- }
-
- /deep/.u-popup__content {
- border-radius: 20rpx !important;
- }
- /deep/.u-button--normal{
- padding: 0 5px;
- }
- </style>
|