XSLu08042 1 maand geleden
bovenliggende
commit
681889612f
5 gewijzigde bestanden met toevoegingen van 38 en 38 verwijderingen
  1. 4 0
      api/course.js
  2. 27 31
      pages_course/activity.vue
  3. 1 1
      pages_course/courseExpiration.vue
  4. 5 6
      pages_course/register.vue
  5. 1 0
      pages_course/videoDetail.vue

+ 4 - 0
api/course.js

@@ -9,6 +9,10 @@ export function handleFsUserWx(data) {
 	return request('/course_register/app/wx/handleFsUserWx', data, 'POST', 'application/json;charset=UTF-8','https://h5api.his.cdwjyyh.com');
 }
 
+export function registerQwFsUserFinish(data) {
+	return request('/course_register/app/course/registerQwFsUserFinish', data, 'POST', 'application/json;charset=UTF-8','https://h5api.his.cdwjyyh.com');
+}
+
 export function isAddCompanyUser(data) {
 	return request('/course_register/app/course/registerQwFsUser', data, 'POST', 'application/json;charset=UTF-8','https://h5api.his.cdwjyyh.com');
 }

+ 27 - 31
pages_course/activity.vue

@@ -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,

+ 1 - 1
pages_course/courseExpiration.vue

@@ -2,7 +2,7 @@
 	<view class="container-body">
 		<text class="user" v-if="userId">#{{userId}}</text>
 		<image src="https://cdn.his.cdwjyyh.com/minapp/course/course_expiration_img.png" mode="aspectFill"></image>
-			<view class="title">{{msg}}</view>
+		<u-parse class="title" :content="msg"></u-parse>
 		<view style="margin-bottom: 10vh;" v-show="code">状态码:{{code}}</view>
 	</view>
 </template>

+ 5 - 6
pages_course/register.vue

@@ -135,7 +135,7 @@
 		methods: {
 			//修改用户昵称以及头像
 			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,
@@ -152,7 +152,7 @@
 							this.getAddCompanyUser()
 						},100)
 					}else{
-						uni.removeStorageSync('userInfos')
+						uni.removeStorageSync('web_userInfo')
 						uni.showToast({
 							icon:'none',
 							title:res.msg+'请重新点击立即学习',
@@ -183,7 +183,7 @@
 				// 	});
 				// 	return
 				// }
-				uni.setStorageSync('userInfos',this.userinfos)
+				uni.setStorageSync('web_userInfo',this.userinfos)
 				this.editUserA()
 				this.userlogo=false
 			},
@@ -398,9 +398,8 @@
 							uni.getUserInfo({
 							   provider: provider,
 							   success: (infoRes)=> {
-								    uni.showToast({
-										title: '报名中...',
-										icon: 'loading'
+								    uni.showLoading({
+										title: '报名中...'
 								    });
 									loginByMp({code: loginRes.code,encryptedData:infoRes.encryptedData,iv:infoRes.iv,appId:getApp().globalData.appId}).then(res=>{
 										 uni.hideLoading();

+ 1 - 0
pages_course/videoDetail.vue

@@ -1122,6 +1122,7 @@
 								title: res.msg,
 								icon: 'none'
 							});
+							if(res.code==401) return;
 							uni.redirectTo({
 								url: '/pages_course/courseExpiration?code='+res.code+'&msg='+res.msg
 							})