|
@@ -11,12 +11,63 @@
|
|
|
<image src="https://cdn.his.cdwjyyh.com/minapp/course_register_img.png" mode="heightFix"></image>
|
|
<image src="https://cdn.his.cdwjyyh.com/minapp/course_register_img.png" mode="heightFix"></image>
|
|
|
<view>注册成功</view>
|
|
<view>注册成功</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <u-popup :show="userlogo" mode="bottom" round='12'>
|
|
|
|
|
+ <view class="userlogo column">
|
|
|
|
|
+ <view class="mtb30 justify-start align-center ml20">
|
|
|
|
|
+ <u-avatar :src="imgPath+'/app/image/logo.png'" size="50"></u-avatar>
|
|
|
|
|
+ <view class="bold mlr20">丝路佳选</view>
|
|
|
|
|
+ <view>申请</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="bold fs36 ml20">授权你的昵称头像信息</view>
|
|
|
|
|
+ <view class="mtb20 justify-between align-center plr20">
|
|
|
|
|
+ <view class="justify-start align-center">
|
|
|
|
|
+ <view class="boxweixin" :class="userinfos.nickname==''?'boxnosel':'boxsel'">
|
|
|
|
|
+ <view v-if="userinfos.nickname">√</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="ml20">
|
|
|
|
|
+ <view class="base-color-3 bold">第一步</view>
|
|
|
|
|
+ <view class="fs32 base-color-9">请点击授权微信昵称</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="button-container">
|
|
|
|
|
+ <input
|
|
|
|
|
+ type="nickname"
|
|
|
|
|
+ class="hidden-input"
|
|
|
|
|
+ @blur="onNickNameInput"
|
|
|
|
|
+ @input="onNickNameInput"
|
|
|
|
|
+ />
|
|
|
|
|
+ <button class="custom-button" :class="nameuser==''?'subname':'subavt'">{{nameuser?"已授权":'允许授权'}}</button>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <!-- <view class="mtb20 justify-between align-center plr20 mt40">
|
|
|
|
|
+ <view class="justify-start align-center">
|
|
|
|
|
+ <view class="boxweixin" :class="userinfos.nickname==''?'boxnosel':'boxsel'">
|
|
|
|
|
+ <view v-if="userinfos.avatar">√</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="ml20">
|
|
|
|
|
+ <view class="base-color-3 bold">第二步</view>
|
|
|
|
|
+ <view class="fs32 base-color-9">请点击授权微信头像</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="button-container">
|
|
|
|
|
+ <button open-type="chooseAvatar" @chooseavatar="onChooseAvatar" class="hidden-input"
|
|
|
|
|
+ v-if="nameuser">
|
|
|
|
|
+ 允许授权
|
|
|
|
|
+ </button>
|
|
|
|
|
+ <button class="custom-button sub" @click="shouquan" v-if="nameuser==''">允许授权</button>
|
|
|
|
|
+ <button class="custom-button " :class="avataruser==''?'subname':'subavt'"
|
|
|
|
|
+ v-else>{{avataruser?"已授权":'允许授权'}}</button>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view> -->
|
|
|
|
|
+ <view class="submitname" @click="confimrname" :class="nameuser&&avataruser?'subact':'sub'">确定</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </u-popup>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import { mapGetters } from 'vuex';
|
|
import { mapGetters } from 'vuex';
|
|
|
- import {getRealLink,handleFsUserWx,isAddCompanyUser,loginByMp} from "@/api/course.js"
|
|
|
|
|
|
|
+ import {getRealLink,handleFsUserWx,isAddCompanyUser,loginByMp,editUser} from "@/api/course.js"
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
@@ -25,11 +76,24 @@
|
|
|
isLoading: false,
|
|
isLoading: false,
|
|
|
urlOption: {},
|
|
urlOption: {},
|
|
|
sortLink: '',
|
|
sortLink: '',
|
|
|
- isLoginH5: 0, // 1服务号授权
|
|
|
|
|
|
|
+ isLoginH5:0, // 1服务号授权
|
|
|
|
|
+ userlogo:false,
|
|
|
|
|
+ imgname:'',
|
|
|
|
|
+ userinfos:{
|
|
|
|
|
+ nickname:"",
|
|
|
|
|
+ avatar:""
|
|
|
|
|
+ },
|
|
|
|
|
+ chatId:''
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
computed:{
|
|
computed:{
|
|
|
...mapGetters(['coureLogin']),
|
|
...mapGetters(['coureLogin']),
|
|
|
|
|
+ nameuser() {
|
|
|
|
|
+ return this.userinfos.nickname
|
|
|
|
|
+ },
|
|
|
|
|
+ avataruser() {
|
|
|
|
|
+ return this.userinfos.avatar
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
|
coureLogin: {
|
|
coureLogin: {
|
|
@@ -40,14 +104,19 @@
|
|
|
uni.removeStorageSync('web_userInfo');
|
|
uni.removeStorageSync('web_userInfo');
|
|
|
uni.removeStorageSync('TOKEN_WEXIN');
|
|
uni.removeStorageSync('TOKEN_WEXIN');
|
|
|
this.isLogin = false
|
|
this.isLogin = false
|
|
|
- this.goLogin()
|
|
|
|
|
|
|
+ if(this.isLoginH5==0){
|
|
|
|
|
+ this.goWXLogin()
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.goLogin()
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
|
- this.urlOption = option.link ? JSON.parse(decodeURIComponent(option.link)) : {}
|
|
|
|
|
|
|
+ this.urlOption = option.link ? JSON.parse(decodeURIComponent(option.link)) : {},
|
|
|
this.sortLink = this.urlOption.link || ''
|
|
this.sortLink = this.urlOption.link || ''
|
|
|
|
|
+ console.log(this.sortLink)
|
|
|
uni.$on('usercode',(data)=>{
|
|
uni.$on('usercode',(data)=>{
|
|
|
if(data) {
|
|
if(data) {
|
|
|
this.goLogin(data)
|
|
this.goLogin(data)
|
|
@@ -61,6 +130,82 @@
|
|
|
uni.$off('usercode')
|
|
uni.$off('usercode')
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ //修改用户昵称以及头像
|
|
|
|
|
+ editUserA(){
|
|
|
|
|
+ this.userinfos=uni.getStorageSync('userInfos')?uni.getStorageSync('userInfos'):this.userinfos
|
|
|
|
|
+ const data={
|
|
|
|
|
+ nickName:this.userinfos.nickname,
|
|
|
|
|
+ // avatar:this.userinfos.avatar,
|
|
|
|
|
+ }
|
|
|
|
|
+ editUser(data).then(res=>{
|
|
|
|
|
+ if(res.code==200){
|
|
|
|
|
+ this.isLogin = true
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ icon:'none',
|
|
|
|
|
+ title:'修改成功!',
|
|
|
|
|
+ });
|
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
|
+ // this.getIsAddKf()
|
|
|
|
|
+ this.getAddCompanyUser()
|
|
|
|
|
+ },100)
|
|
|
|
|
+ }else{
|
|
|
|
|
+ uni.removeStorageSync('userInfos')
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ icon:'none',
|
|
|
|
|
+ title:res.msg+'请重新点击立即学习',
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ shouquan(){
|
|
|
|
|
+ if(this.userinfos.nickname==''){
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ icon:'none',
|
|
|
|
|
+ title: "请先授权微信昵称",
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ confimrname(){
|
|
|
|
|
+ if(this.userinfos.nickname==''){
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ icon:'none',
|
|
|
|
|
+ title: "请授权微信昵称",
|
|
|
|
|
+ });
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ // if(this.userinfos.avatar==''){
|
|
|
|
|
+ // uni.showToast({
|
|
|
|
|
+ // icon:'none',
|
|
|
|
|
+ // title: "请授权微信头像",
|
|
|
|
|
+ // });
|
|
|
|
|
+ // return
|
|
|
|
|
+ // }
|
|
|
|
|
+ uni.setStorageSync('userInfos',this.userinfos)
|
|
|
|
|
+ this.editUserA()
|
|
|
|
|
+ this.userlogo=false
|
|
|
|
|
+ },
|
|
|
|
|
+ onNickNameInput(e){
|
|
|
|
|
+ console.log(e)
|
|
|
|
|
+ this.userinfos.nickname=e.detail.value
|
|
|
|
|
+ },
|
|
|
|
|
+ onChooseAvatar(e){
|
|
|
|
|
+ this.userinfos.avatar=e.detail.avatarUrl
|
|
|
|
|
+ uni.uploadFile({
|
|
|
|
|
+ url: 'https://h5api.his.cdwjyyh.com'+'/app/common/uploadOSS', //仅为示例,非真实的接口地址
|
|
|
|
|
+ filePath: e.detail.avatarUrl,
|
|
|
|
|
+ name: 'file',
|
|
|
|
|
+ formData: {
|
|
|
|
|
+ 'user': 'test' // 上传附带参数
|
|
|
|
|
+ },
|
|
|
|
|
+ success: (uploadFileRes) => {
|
|
|
|
|
+ console.log(uploadFileRes)
|
|
|
|
|
+ // 根据接口具体返回格式 赋值具体对应url
|
|
|
|
|
+ var data=JSON.parse(uploadFileRes.data)
|
|
|
|
|
+ this.headImg=uni.getStorageSync('requestPath')+data.fileName
|
|
|
|
|
+ this.userinfos.avatar=data.url
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
getLink() {
|
|
getLink() {
|
|
|
if(!this.sortLink){
|
|
if(!this.sortLink){
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
@@ -76,6 +221,9 @@
|
|
|
getRealLink({sortLink:this.sortLink}).then(res=>{
|
|
getRealLink({sortLink:this.sortLink}).then(res=>{
|
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
|
if(res.code == 200) {
|
|
if(res.code == 200) {
|
|
|
|
|
+ let linkurl=JSON.parse(res.realLink.split('?link=')[1])
|
|
|
|
|
+ this.chatId=linkurl.chatId
|
|
|
|
|
+ console.log(this.chatId)
|
|
|
if(res.config&&res.config.userCourseAuthDomain) {
|
|
if(res.config&&res.config.userCourseAuthDomain) {
|
|
|
uni.setStorageSync('weixinOauth',res.config.userCourseAuthDomain)
|
|
uni.setStorageSync('weixinOauth',res.config.userCourseAuthDomain)
|
|
|
if(this.isLoginH5==0) {
|
|
if(this.isLoginH5==0) {
|
|
@@ -83,7 +231,12 @@
|
|
|
isLogin => {
|
|
isLogin => {
|
|
|
this.isLogin = isLogin
|
|
this.isLogin = isLogin
|
|
|
if(this.isLogin) {
|
|
if(this.isLogin) {
|
|
|
- this.getAddCompanyUser()
|
|
|
|
|
|
|
+ // this.editUserA()
|
|
|
|
|
+ if(this.chatId!=''||this.chatId){
|
|
|
|
|
+ this.userlogo=true
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.getAddCompanyUser()
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
this.goLogin()
|
|
this.goLogin()
|
|
|
}
|
|
}
|
|
@@ -211,11 +364,16 @@
|
|
|
loginByMp({code: loginRes.code,encryptedData:infoRes.encryptedData,iv:infoRes.iv,appId:getApp().globalData.appId}).then(res=>{
|
|
loginByMp({code: loginRes.code,encryptedData:infoRes.encryptedData,iv:infoRes.iv,appId:getApp().globalData.appId}).then(res=>{
|
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
|
|
|
+ // this.checkUserInfoA()
|
|
|
this.$store.commit('setCoureLogin', 1);
|
|
this.$store.commit('setCoureLogin', 1);
|
|
|
uni.setStorageSync('AppTokenmini_RTCourse', res.token);
|
|
uni.setStorageSync('AppTokenmini_RTCourse', res.token);
|
|
|
uni.setStorageSync('auto_userInfo', JSON.stringify(res.user));
|
|
uni.setStorageSync('auto_userInfo', JSON.stringify(res.user));
|
|
|
this.isLogin = true
|
|
this.isLogin = true
|
|
|
- this.getAddCompanyUser()
|
|
|
|
|
|
|
+ if(this.chatId!=''||this.chatId){
|
|
|
|
|
+ this.userlogo=true
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.getAddCompanyUser()
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
title: res.msg,
|
|
title: res.msg,
|
|
@@ -245,6 +403,77 @@
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
|
|
|
+ .subname{
|
|
|
|
|
+ background-color: #00aa00;
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ }
|
|
|
|
|
+ .subavt{
|
|
|
|
|
+ background-color: #fff;
|
|
|
|
|
+ border: 2rpx #0a0 solid;
|
|
|
|
|
+ color: #00aa00;
|
|
|
|
|
+ }
|
|
|
|
|
+ .boxweixin{
|
|
|
|
|
+ width: 44rpx;
|
|
|
|
|
+ height: 44rpx;
|
|
|
|
|
+ border-radius: 50%;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ line-height: 34rpx;
|
|
|
|
|
+ color: #0a0;
|
|
|
|
|
+ }
|
|
|
|
|
+ .boxnosel{
|
|
|
|
|
+ border: #757575 4rpx solid;
|
|
|
|
|
+ }
|
|
|
|
|
+ .boxsel{
|
|
|
|
|
+ border: #0a0 4rpx solid;
|
|
|
|
|
+ }
|
|
|
|
|
+ .button-container {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ width: 240rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+ .hidden-input {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ top: 0;
|
|
|
|
|
+ left: 0;
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ opacity: 0;
|
|
|
|
|
+ z-index: 2;
|
|
|
|
|
+ }
|
|
|
|
|
+ .custom-button {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ z-index: 1;
|
|
|
|
|
+ /* 其他样式 */
|
|
|
|
|
+ width:100%;
|
|
|
|
|
+ margin: 0 auto;
|
|
|
|
|
+ height: 80rpx;
|
|
|
|
|
+ line-height: 60rpx;
|
|
|
|
|
+ font-size: 28rpx;
|
|
|
|
|
+ padding: 10rpx 20rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+ .submitname{
|
|
|
|
|
+ width: 90%;
|
|
|
|
|
+
|
|
|
|
|
+ margin: 0 auto;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ padding: 30rpx;
|
|
|
|
|
+ margin-top: 40rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+ .sub{
|
|
|
|
|
+ background-color: #f0f0f0;
|
|
|
|
|
+ color: #0a0;
|
|
|
|
|
+ }
|
|
|
|
|
+ .subact{
|
|
|
|
|
+ background-color: #0a0;
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ }
|
|
|
|
|
+ .userlogo{
|
|
|
|
|
+ height: 760rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+ .timepopbox{
|
|
|
|
|
+ width: 560rpx;
|
|
|
|
|
+ padding: 32rpx;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
+ }
|
|
|
.register_box {
|
|
.register_box {
|
|
|
position: relative;
|
|
position: relative;
|
|
|
min-height: 100vh;
|
|
min-height: 100vh;
|