|
@@ -290,15 +290,62 @@
|
|
|
<poster :data="canvasData" background-color="#FFF" :width='750' :height='420' @on-success="posterSuccess"
|
|
|
ref="poster" @on-error="posterError"></poster>
|
|
|
<!-- #ifdef MP-WEIXIN -->
|
|
|
- <u-popup :show="isPhone" mode="center" :round="10">
|
|
|
+ <!-- <u-popup :show="isPhone" mode="center" :round="10">
|
|
|
<view class='sq-view'>
|
|
|
<view class="text">
|
|
|
手机登录后才能查看名片哦~
|
|
|
</view>
|
|
|
<button class="confirm" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">授权手机号</button>
|
|
|
</view>
|
|
|
- <!-- <navigator hover-class="none" url="/pages/cardHolder/popup/coupon">领券</navigator> -->
|
|
|
- </u-popup>
|
|
|
+ </u-popup> -->
|
|
|
+ <u-modal :show="showAuthorizePhone"
|
|
|
+ :showConfirmButton="false">
|
|
|
+ <view class="slot-content">
|
|
|
+ <div class="auth-card">
|
|
|
+ <div class="img">
|
|
|
+ <img class="avatar-img"
|
|
|
+ src="@/static/imgs/logo.png"
|
|
|
+ mode="widthFix">
|
|
|
+ </div>
|
|
|
+ <!-- <div class="title">手机登录后才能查看名片哦~</div> -->
|
|
|
+ <div class="content">手机登录后才能查看名片哦~</div>
|
|
|
+ </div>
|
|
|
+ <div class="auth-btncard">
|
|
|
+ <div class="btn-unok"><u-button :customStyle="customStyleUnOk" @click="showAuthorizePhone=false"> 拒绝</u-button></div>
|
|
|
+ <div class="btn-ok"><u-button :customStyle="customStyleOk" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber"> 允许</u-button></div>
|
|
|
+ </div>
|
|
|
+ </view>
|
|
|
+ </u-modal>
|
|
|
+ <u-modal :show="showAuthorizeUser"
|
|
|
+ :showConfirmButton="false">
|
|
|
+ <view class="slot-content">
|
|
|
+ <div class="auth-card">
|
|
|
+ <div class="img">
|
|
|
+ <img class="avatar-img"
|
|
|
+ src="/static/imgs/logo.png"
|
|
|
+ mode="widthFix">
|
|
|
+ </div>
|
|
|
+ <div class="content">邀请您补全个人信息<br></br>(昵称、头像)</div>
|
|
|
+ <div 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="昵称">
|
|
|
+ <input type="nickname" :value="userInfo.nickname" class="weui-input" @blur="userNameInput" placeholder="请输入昵称"/>
|
|
|
+ </u-form-item>
|
|
|
+ </u-form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="auth-btncard">
|
|
|
+ <div class="btn-unok"><u-button :customStyle="customStyleUnOk" @click="showAuthorizeUser=false"> 拒绝</u-button></div>
|
|
|
+ <div class="btn-ok"><u-button :customStyle="customStyleOk" @click="authUser"> 允许</u-button></div>
|
|
|
+ </div>
|
|
|
+ </view>
|
|
|
+ </u-modal>
|
|
|
+
|
|
|
<!-- #endif -->
|
|
|
<u-toast ref="uToast"></u-toast>
|
|
|
</view>
|
|
@@ -306,6 +353,7 @@
|
|
|
|
|
|
<script>
|
|
|
import Poster from '../../components/zhangyuhao-poster/Poster.vue'
|
|
|
+ import { pathToBase64, base64ToPath } from 'image-tools'
|
|
|
import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
|
|
|
export default {
|
|
|
mixins: [MescrollMixin],
|
|
@@ -314,7 +362,7 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- userInfo: {},
|
|
|
+ userInfo: {avatarUrl:'',nickName:''},
|
|
|
downOption: {
|
|
|
auto: false,
|
|
|
},
|
|
@@ -357,9 +405,23 @@
|
|
|
clicknum: 0,
|
|
|
noticeList: [],
|
|
|
status: 0,
|
|
|
+ // 是否弹出登录注册授权弹窗
|
|
|
+ showAuthorizeUser: false,
|
|
|
+ showAuthorizePhone: false,
|
|
|
+ customStyleUnOk: {
|
|
|
+ marginTop: '20rpx', // 注意驼峰命名,并且值必须用引号包括,因为这是对象
|
|
|
+ border:'none',
|
|
|
+ color:'gray'
|
|
|
+ },
|
|
|
+ customStyleOk: {
|
|
|
+ marginTop: '20rpx', // 注意驼峰命名,并且值必须用引号包括,因为这是对象
|
|
|
+ border:'none',
|
|
|
+ color:'#157DFB'
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
onShow() {
|
|
|
+
|
|
|
},
|
|
|
mounted() {
|
|
|
|
|
@@ -378,6 +440,7 @@
|
|
|
} else {
|
|
|
if (uni.getLaunchOptionsSync().scene != 1154) {
|
|
|
this.login()
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
this.status = uni.getLaunchOptionsSync().scene
|
|
@@ -418,6 +481,32 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ //获取昵称输入内容
|
|
|
+ userNameInput(e){
|
|
|
+ this.userInfo.nickname = e.detail.value
|
|
|
+ },
|
|
|
+ onChooseAvatar(e) {
|
|
|
+ console.log(e.detail.avatarUrl)
|
|
|
+ pathToBase64( e.detail.avatarUrl).then(path => {
|
|
|
+ this.userInfo.head = path
|
|
|
+ console.log(path)
|
|
|
+ }).catch(error => {
|
|
|
+ console.log(error)
|
|
|
+ })
|
|
|
+ // this.userInfo.head = e.detail.avatarUrl;
|
|
|
+ },
|
|
|
+ authUser(){
|
|
|
+ if(this.userInfo.nickname==''){
|
|
|
+ that.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: "请输入您的昵称",
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.getTokenAsync1()
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
downCallback(){
|
|
|
this.mescroll.resetUpScroll()
|
|
|
},
|
|
@@ -450,66 +539,45 @@
|
|
|
let data = this.$WXBizDataCrypt.prototype.decryptData(encryptedData, iv, appId, sessionKey)
|
|
|
|
|
|
console.log('解密后 data: ', data)
|
|
|
+ this.showAuthorizePhone = false
|
|
|
this.getTokenAsync(data)
|
|
|
}
|
|
|
|
|
|
},
|
|
|
async getTokenAsync(val) {
|
|
|
let that = this
|
|
|
- uni.getUserInfo({
|
|
|
- provider: 'weixin',
|
|
|
- success: function(info) {
|
|
|
- console.log("info", info)
|
|
|
- that.userInfo.nickname = info.userInfo.nickName
|
|
|
- that.userInfo.head = info.userInfo.avatarUrl
|
|
|
- that.userInfo.phone = val.phoneNumber
|
|
|
- that.$request.baseRequest('commonUserApp', 'edit', {
|
|
|
- commonUserInfo: JSON.stringify(that.userInfo)
|
|
|
- }, failres => {
|
|
|
- that.$refs.uToast.show({
|
|
|
- type: 'error',
|
|
|
- message: failres.errmsg,
|
|
|
- })
|
|
|
- uni.hideLoading()
|
|
|
- }).then(res1 => {
|
|
|
- that.userInfo = res1.data
|
|
|
- uni.setStorageSync("userInfo", that.userInfo)
|
|
|
- that.mescroll.resetUpScroll()
|
|
|
- })
|
|
|
- }
|
|
|
+ that.userInfo.phone = val.phoneNumber
|
|
|
+ that.$request.baseRequest('commonUserApp', 'edit', {
|
|
|
+ commonUserInfo: JSON.stringify(that.userInfo)
|
|
|
+ }, failres => {
|
|
|
+ that.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: failres.errmsg,
|
|
|
+ })
|
|
|
+ uni.hideLoading()
|
|
|
+ }).then(res1 => {
|
|
|
+ that.userInfo = res1.data
|
|
|
+ uni.setStorageSync("userInfo", that.userInfo)
|
|
|
+ that.showAuthorizeUser = true
|
|
|
+ that.mescroll.resetUpScroll()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async getTokenAsync1() {
|
|
|
+ let that = this
|
|
|
+ that.$request.baseRequest('commonUserApp', 'edit', {
|
|
|
+ commonUserInfo: JSON.stringify(that.userInfo)
|
|
|
+ }, failres => {
|
|
|
+ that.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: failres.errmsg,
|
|
|
+ })
|
|
|
+ uni.hideLoading()
|
|
|
+ }).then(res1 => {
|
|
|
+ that.userInfo = res1.data
|
|
|
+ uni.setStorageSync("userInfo", that.userInfo)
|
|
|
+ that.showAuthorizeUser = false
|
|
|
+ that.mescroll.resetUpScroll()
|
|
|
})
|
|
|
- // that.userInfo.phone = val.phoneNumber
|
|
|
- // that.userInfo.userId = that.userInfo.id
|
|
|
- // console.log(that.userInfo)
|
|
|
- // that.$request.baseRequest('user', 'syncUserInfo', that.userInfo).then(syncRes => {
|
|
|
-
|
|
|
- // this.$request.baseRequest('sunMemberInfoApp', 'add', {
|
|
|
- // sunMemberInfo: JSON.stringify({
|
|
|
- // name: that.userInfo.nickname,
|
|
|
- // phone: val.phoneNumber,
|
|
|
- // sex: '1'
|
|
|
- // })
|
|
|
- // }, failres => {
|
|
|
- // console.log('res+++++', failres.errmsg)
|
|
|
- // this.$refs.uToast.show({
|
|
|
- // type: 'error',
|
|
|
- // message: failres.errmsg,
|
|
|
- // })
|
|
|
- // uni.hideLoading()
|
|
|
- // }).then(res => {
|
|
|
- // if (res.errno == 200) {
|
|
|
-
|
|
|
- // uni.setStorageSync('userInfo', that.userInfo)
|
|
|
- // that.$store.commit('login', that.userInfo)
|
|
|
- // // that.$api.setUserInfo(that.userInfo)
|
|
|
- // uni.hideLoading()
|
|
|
- // // that.liangxinLogin()
|
|
|
- // that.init()
|
|
|
- // this.isShowAlert = false
|
|
|
- // }
|
|
|
-
|
|
|
- // })
|
|
|
- // })
|
|
|
},
|
|
|
delVal() {
|
|
|
this.searchVal = ""
|
|
@@ -1077,6 +1145,7 @@
|
|
|
}).then(res => {
|
|
|
console.log(res.data)
|
|
|
that.isPhone = true
|
|
|
+ that.showAuthorizePhone = true
|
|
|
that.userInfo = res.data
|
|
|
})
|
|
|
},
|
|
@@ -1534,4 +1603,59 @@
|
|
|
background-color: green;
|
|
|
overflow: scroll !important;
|
|
|
}
|
|
|
+ .auth-btncard{
|
|
|
+ .btn-unok{
|
|
|
+ width: 50%;
|
|
|
+ float: left;
|
|
|
+ }
|
|
|
+ .btn-ok{
|
|
|
+ width: 50%;
|
|
|
+ float: left;
|
|
|
+ margin: 0;
|
|
|
+ padding: 0;
|
|
|
+ border: 0px solid transparent; //自定义边框
|
|
|
+ outline: none; //消除默认点击蓝色边框效果
|
|
|
+ u-button{
|
|
|
+ margin: 0;
|
|
|
+ padding: 0;
|
|
|
+ border: 0px solid transparent; //自定义边框
|
|
|
+ outline: none; //消除默认点击蓝色边框效果
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .auth-card{
|
|
|
+ text-align: center;
|
|
|
+ .avatar-img{
|
|
|
+ width: 150rpx;
|
|
|
+ height: 150rpx;
|
|
|
+ overflow: hidden;
|
|
|
+ border-radius: 100%;
|
|
|
+ margin-top: 30rpx;
|
|
|
+ }
|
|
|
+ .title{
|
|
|
+ font-size: 20rpx;
|
|
|
+ }
|
|
|
+ .content{
|
|
|
+ margin-top: 10rpx;
|
|
|
+ margin-bottom: 30rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .avatar-wrapper{
|
|
|
+ width: 150rpx;
|
|
|
+ height: 100rpx;
|
|
|
+ color: #333 !important;
|
|
|
+ text-align: center !important;
|
|
|
+ border: none !important;
|
|
|
+ border-radius:0 !important;
|
|
|
+ background-color:transparent !important;
|
|
|
+ }
|
|
|
+ .avatar-wrapper::after {
|
|
|
+ border: none !important;
|
|
|
+ }
|
|
|
+ .avatar{
|
|
|
+ width: 100rpx;
|
|
|
+ height: 100rpx;
|
|
|
+ overflow: hidden;
|
|
|
+ border-radius: 100%;
|
|
|
+ }
|
|
|
</style>
|