|
|
@@ -115,7 +115,7 @@
|
|
|
|
|
|
<script>
|
|
|
import {mapGetters} from 'vuex';
|
|
|
- import { getLuckyBagInfo, receiveLuckyBag,loginByMp,editUser,isAddCompanyUser}from '@/api/course.js'
|
|
|
+ import { getLuckyBagInfo, receiveLuckyBag,loginByMp,editUser,isAddCompanyUser,registerQwFsUserFinish}from '@/api/course.js'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -189,6 +189,25 @@
|
|
|
uni.$off('usercode')
|
|
|
},
|
|
|
methods: {
|
|
|
+ registerQwFsUserFinish() {
|
|
|
+ uni.showLoading({
|
|
|
+ title: '领取中...'
|
|
|
+ });
|
|
|
+ registerQwFsUserFinish(this.urlOption).then(res=>{
|
|
|
+ uni.hideLoading()
|
|
|
+ if(res.code==200) {
|
|
|
+ this.receiveLuckyBag()
|
|
|
+ } else {
|
|
|
+ if (this.chatId) {
|
|
|
+ this.userlogo = true
|
|
|
+ } else {
|
|
|
+ this.getAddCompanyUser()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).catch(()=>{
|
|
|
+ uni.hideLoading()
|
|
|
+ })
|
|
|
+ },
|
|
|
getAddCompanyUser() {
|
|
|
if(this.registerLoading) return;
|
|
|
uni.showLoading({
|
|
|
@@ -213,7 +232,7 @@
|
|
|
},
|
|
|
//修改用户昵称以及头像
|
|
|
editUserA(){
|
|
|
- this.userinfos=uni.getStorageSync('userinfos')?uni.getStorageSync('userinfos'):this.userinfos
|
|
|
+ this.userinfos=uni.getStorageSync('web_userInfo')?uni.getStorageSync('web_userInfo'):this.userinfos
|
|
|
const data={
|
|
|
nickName:this.userinfos.nickname,
|
|
|
// avatar:this.userinfos.avatar,
|
|
|
@@ -229,7 +248,7 @@
|
|
|
this.getAddCompanyUser()
|
|
|
},100)
|
|
|
}else{
|
|
|
- uni.removeStorageSync('userinfos')
|
|
|
+ uni.removeStorageSync('web_userInfo')
|
|
|
uni.showToast({
|
|
|
icon:'none',
|
|
|
title:res.msg+'请重新领取福袋',
|
|
|
@@ -260,7 +279,7 @@
|
|
|
// });
|
|
|
// return
|
|
|
// }
|
|
|
- uni.setStorageSync('userinfos',this.userinfos)
|
|
|
+ uni.setStorageSync('web_userInfo',this.userinfos)
|
|
|
this.editUserA()
|
|
|
this.userlogo=false
|
|
|
},
|
|
|
@@ -291,41 +310,22 @@
|
|
|
this.utils.isLoginCourse().then(
|
|
|
isLogin => {
|
|
|
this.isLogin = isLogin
|
|
|
- console.log("==isLogin=",this.isLogin)
|
|
|
if (this.isLogin) {
|
|
|
- // this.editUserA()
|
|
|
- if (this.chatId) {
|
|
|
- this.userlogo = true
|
|
|
- } else {
|
|
|
- this.getAddCompanyUser()
|
|
|
- }
|
|
|
+ this.registerQwFsUserFinish()
|
|
|
} else {
|
|
|
this.goLogin()
|
|
|
}
|
|
|
},
|
|
|
rej => {}
|
|
|
);
|
|
|
- } else {
|
|
|
- this.utils.isLoginResCourse().then(
|
|
|
- isLogin => {
|
|
|
- this.isLogin = isLogin
|
|
|
- if (this.isLogin) {
|
|
|
- this.getAddCompanyUser()
|
|
|
- } else {
|
|
|
- this.goLogin()
|
|
|
- }
|
|
|
- },
|
|
|
- rej => {}
|
|
|
- );
|
|
|
- }
|
|
|
+ }
|
|
|
},
|
|
|
receiveLuckyBag() {
|
|
|
if(this.btnLoading) {
|
|
|
return
|
|
|
}
|
|
|
- uni.showToast({
|
|
|
+ uni.showLoading({
|
|
|
title: '领取中...',
|
|
|
- icon: 'loading'
|
|
|
});
|
|
|
this.btnLoading = true
|
|
|
const param = {
|
|
|
@@ -419,11 +419,7 @@
|
|
|
uni.setStorageSync('auto_userInfo',
|
|
|
JSON.stringify(res.user));
|
|
|
this.isLogin = true
|
|
|
- if(this.chatId){
|
|
|
- this.userlogo=true
|
|
|
- }else{
|
|
|
- this.receiveLuckyBag()
|
|
|
- }
|
|
|
+ this.registerQwFsUserFinish()
|
|
|
} else {
|
|
|
uni.showToast({
|
|
|
title: res.msg,
|