puyao před 4 týdny
rodič
revize
258472915a

+ 1 - 1
api/courseManage.js

@@ -345,7 +345,7 @@ export function getuserTrajectory(data){
 	return request('/companyapp/app/operationLog/page',data, 'POST', 'application/json;charset=UTF-8');
 }
 
-//查看用户轨迹
+//生成小程序链接
 export function copyuniLink(data){
 	return request('/companyapp/app/fs/course/getGotoWxAppLink',data, 'GET', 'application/json;charset=UTF-8');
 }

+ 5 - 5
common/request.js

@@ -16,8 +16,8 @@ export default class Request {
 		//刘明欣
 		// let path = 'http://x8489c8e.natappfree.cc'//
 		 
-		// let path = 'https://userapp.fbylive.com'//福本源
-		let path = 'https://userapp.zkhj6.com'//中康
+		let path = 'https://userapp.fbylive.com'//福本源
+		// let path = 'https://userapp.zkhj6.com'//中康
 		// let path = 'https://company.h5.test.ylrztop.com/api'//云融融智
 		// let path = 'https://userapp.ashyisheng.com'//蜂巢快药
 		// let path = 'https://userapp.whhm.ylrzcloud.com/prod-api'//惠名大药房
@@ -41,11 +41,11 @@ export default class Request {
 		// }
 		if(router.indexOf("/course_uniapp")!=-1){
 			router =router.replace('/course_uniapp','')
-			// path = 'https://userapp.fbylive.com'//福本源
+			path = 'https://userapp.fbylive.com'//福本源
 			// // path = 'https://scrm.gjh2024.com'//金康键
 			//张玉朋
 			// let path = 'http://192.168.10.158:7014'//
-			path = 'https://userapp.zkhj6.com'//中康
+			// path = 'https://userapp.zkhj6.com'//中康
 			// path = 'https://company.h5.test.ylrztop.com/api'//云融融智
 			// path = 'https://userapp.ashyisheng.com'//蜂巢快药(爱上嘉园)
 			// path = 'https://userapp.liangmiaoedu.com'//良苗
@@ -63,7 +63,7 @@ export default class Request {
 			token =uni.getStorageSync('TOKEN_KEY')
 			// #endif
 		}
-		// 自动发
+		// 企微看
 		if(router.indexOf("/course_auto")!=-1){
 			router =router.replace('/course_auto','')
 			// path = 'https://userapp.gjh2024.com/apis'//金康键

+ 2 - 1
main.js

@@ -13,11 +13,12 @@ import {setData} from './utils/common.js'
 Vue.prototype.setData = setData;
 import {formatSeconds}from './utils/tools.js'
 Vue.prototype.$formatSeconds = formatSeconds;
-import {isLoginCourse,isLoginCourseqw} from './utils/common.js'
+import {isLoginCourse,isLoginCourseqw,isLoginCourseH5} from './utils/common.js'
 import {isLoginCourseAuto} from './utils/courseTool.js'
 Vue.prototype.$isLoginCourse = isLoginCourse
 Vue.prototype.$isLoginCourseqw = isLoginCourseqw
 Vue.prototype.$isLoginCourseAuto= isLoginCourseAuto
+Vue.prototype.$isLoginCourseH5= isLoginCourseH5
 import store from './router/router.js' // 确保路径正确
 Vue.prototype.$store = store;
 //import router from '@/router/router.js'  

+ 2 - 2
manifest.json

@@ -1,7 +1,7 @@
 {
     "name" : "直播管理",
     "appid" : "__UNI__7F50713",
-    "description" : "",
+    "description" : "福本源",
     "versionName" : "1.0.8",
     "versionCode" : 108,
     "transformPx" : false,
@@ -109,7 +109,7 @@
     "quickapp" : {},
     /* 小程序特有相关 */
     "mp-weixin" : {
-        "appid" : "wx414427b10866c04e",
+        "appid" : "wxb9b453d37c5fad45",
         "setting" : {
             "urlCheck" : true,
             "postcss" : true

+ 2 - 1
pages.json

@@ -472,7 +472,8 @@
 					"path" : "course/becomeSale",
 					"style" : 
 					{
-						"navigationBarTitleText" : "注册"
+						"navigationBarTitleText" : "注册",
+						"navigationStyle": "custom"
 					}
 				},
 				{

+ 7 - 4
pages/common/launch.vue

@@ -28,7 +28,10 @@
 		  },
 		onShow() {
 			// this.getUserId();
-			this.navigatHandler();
+			// this.navigatHandler();
+			uni.reLaunch({
+				url: '/pages_course/videovip',
+			})
 		},
 		methods: {
 			navigatHandler() {
@@ -40,9 +43,9 @@
 				// #ifdef MP-WEIXIN
 				console.log('现在')
 				if(uni.getStorageSync('AppToken')){
-					uni.reLaunch({
-						url: '/pages/index/index',
-					})
+					// uni.reLaunch({
+					// 	url: '/pages/index/index',
+					// })
 				}else{
 					uni.reLaunch({
 						url: '/pages/enterprise/enterprise',

+ 0 - 13
pages/course/course.vue

@@ -79,15 +79,6 @@
 			}
 		},
 		methods: {
-			copyuniLinks(){
-				const data={
-					
-					linkStr:this.childdata.path + "?course=" + JSON.stringify(this.childdata.params),
-				}
-				copyuniLink(data).then(res=>{
-					console.log(res)
-				})
-			},
 			copy(){
 				uni.showLoading({
 					title: "处理中..."
@@ -126,10 +117,6 @@
 						});
 					}
 				})
-
-				// copyuniLinks(){
-					
-				// },
 				
 			},
 			closeShare() {

+ 1 - 1
pages/customer/index.vue

@@ -357,7 +357,7 @@
 	export default {
 		components: {
 			vipUserItem,
-			dropdownPanel,
+			dropdownPanel
 		},
 		data() {
 			return {

+ 109 - 56
pages_course/videovip.vue

@@ -1,9 +1,9 @@
 <template>
 	<view class="content " >
-		<view class="header-nav" :style="{height: `calc(88rpx + ${statusBarHeight}px)`,paddingTop: statusBarHeight + 'px'}">
+		<!-- <view class="header-nav" :style="{height: `calc(88rpx + ${statusBarHeight}px)`,paddingTop: statusBarHeight + 'px'}">
 			<u-icon name="arrow-left" size="28" @click="tosales" v-if="appToken"></u-icon>
 			<view class="header-title" :style="{width:menuButtonLeft + 'px',height:menuButtonH+'px',lineHeight:menuButtonH+'px'}">{{courseInfo.title}}</view>
-		</view>
+		</view> -->
 		<view class="video-box">
 			<image v-if="!isLogin || isAddKf!=1" class="video-poster" :src="courseInfo.imgUrl" mode="aspectFill">
 			</image>
@@ -246,7 +246,7 @@
 				<view class="submitname" @click="confimrname" :class="nameuser&&avataruser?'subact':'sub'">确定</view>
 			</view>
 		</u-popup>
-		<view class="footer-tips">重庆云联融智提供技术支持</view>
+		<!-- <view class="footer-tips">重庆云联融智提供技术支持{{AppTokenAPP}}</view> -->
 		<!-- footer -->
 		<view class="footer" v-if="videoId">
 			<view class="btns"  >
@@ -268,8 +268,8 @@
 				@click="submit">{{isLogin&&isAddKf==1 ?'提交答案领取奖励' : '立即学习'}}</button>
 			</view>
 		</view>
-		<u-loading-page :loading="viewload" iconSize="32" loadingColor="#3c9cff" fontSize="24"
-		:loading-text="loadingtext"></u-loading-page>
+		<!-- <u-loading-page :loading="viewload" iconSize="32" loadingColor="#3c9cff" fontSize="24"
+		:loading-text="loadingtext"></u-loading-page> -->
 	</view>
 </template>
 
@@ -415,8 +415,10 @@
 					avatar:""
 				},
 				headImg:'',
-				authType:0,//0微信登录 1手机号登录
+				authType:1,//0微信登录 1手机号登录
 				userdisabled:false,
+				AppTokenAPP:null,
+				projectId:null
 			}
 		},
 		filters: {
@@ -476,7 +478,10 @@
 			
 		// },
 		onLoad(option) {
+			console.log(option)
 			this.videoContext = uni.createVideoContext('video-content-box', this)
+			
+			// #ifdef MP-WEIXIN
 			this.code = option.code
 			if(uni.getStorageSync('userInfo')&&JSON.stringify(uni.getStorageSync('userInfo'))!='{}') {
 				this.userInfo = JSON.parse(uni.getStorageSync('userInfo'))
@@ -484,7 +489,6 @@
 				this.userInfo = {}
 			}
 			this.appToken=uni.getStorageSync('companyUserInfo')
-			// decodeURIComponent()
 			if(!option.course){
 				const keys = decodeURIComponent(Object.keys(option)[0]);
 				this.urlOption=JSON.parse(keys.split('course=')[1])
@@ -499,28 +503,43 @@
 			this.timeid=this.urlOption.id
 			console.log(this.urlOption)
 			console.log(decodeURIComponent(option.course))
-			// this.sortLink = this.urlOption.link || ''
 			this.getMenuButton()
-			// #ifdef MP-WEIXIN
-			// if(this.$store.state.logoname!=='乐氏本源'&&!uni.getStorageSync('userInfos')){
-			// 	this.userlogo=true
-			// }
-			console.log(uni.getStorageSync('userInfos'))
-			if(!uni.getStorageSync('userInfos')&&this.$store.state.logoname=='乐氏本源'){
-				uni.navigateTo({
-					url:'/pages_course/webview'
+			// #endif
+			// #ifdef H5
+			console.log(option)
+			if(option.s){
+				this.sortLink = option.s || ''
+				console.log(option.s)
+			}else if(option.course){
+				console.log(option.course)
+				this.urlOption = option.course ? JSON.parse(option.course) : {},
+				this.videoId = this.urlOption.videoId
+				this.courseId = this.urlOption.courseId
+				this.periodId = this.urlOption.periodId
+				this.companyId = this.urlOption.companyId
+				this.companyUserId = this.urlOption.companyUserId
+				this.timeid=this.urlOption.id
+				this.projectId=this.urlOption.projectId
+				this.plusReady(() => {
+				 	this.AppTokenAPP = plus.storage.getItem('AppToken');
+					// this.AppTokenAPP='eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxMDgwNTA5IiwiaWF0IjoxNzU3Mzk1MDYxLCJleHAiOjE3ODg5MzEwNjF9.aRF0amePt9AHZoCglJ8zLGs6AB3z-0uZQ1SiddAu7WAcv98FPVsTyRjpGrCb96ir_0fU5g8ZQj70HIhTGMFrKA'
+					// console.log("AppToken= onLoad====",AppTokenAPP)
+					uni.setStorageSync('TOKEN_KEY',this.AppTokenAPP);
 				})
-				return
+				// this.AppTokenAPP='eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxMDgwNTA5IiwiaWF0IjoxNzU3Mzk1MDYxLCJleHAiOjE3ODg5MzEwNjF9.aRF0amePt9AHZoCglJ8zLGs6AB3z-0uZQ1SiddAu7WAcv98FPVsTyRjpGrCb96ir_0fU5g8ZQj70HIhTGMFrKA'
+				// console.log("AppToken= onLoad====",this.AppTokenAPP)
+				// uni.setStorageSync('TOKEN_KEY',this.AppTokenAPP);
 			}
 			// #endif
 		},
 		onShow() {
-			this.tipsOpen = false
-			this.isExpand = true
-			this.uuId = generateRandomString(16)
 			if (this.videoId) {
 				this.getH5CourseByVideo()
 			}
+			// #ifdef MP-WEIXIN
+			this.tipsOpen = false
+			this.isExpand = true
+			this.uuId = generateRandomString(16)
 			const AppToken=uni.getStorageSync('TOKEN_WEXIN')
 			console.log(AppToken)
 			if(AppToken){
@@ -528,18 +547,37 @@
 				if(this.isAddKf == 1){
 					this.getH5CourseVideoDetails()
 				} else{
+					if(this.companyUserId!=''){
+						this.getIsAddKf()
+					}
 					this.checkUserInfoA()
-					// this.getIsAddKf()
 				}
 			}
-			// if(this.sortLink){
-			// 	this.getLink()
-			// } else {
-			// 	uni.showToast({
-			// 		title: 'sortLink is not found',
-			// 		icon: 'none'
-			// 	});
-			// }
+			// #endif
+			
+			// #ifdef H5
+			console.log('大家萨克贷记卡',uni.getStorageSync('TOKEN_KEY'))
+			if(uni.getStorageSync('TOKEN_KEY')){
+				this.isLogin=true
+				if(this.isAddKf == 1){
+					this.getH5CourseVideoDetails()
+				} else{
+					if(this.companyUserId){
+						this.getIsAddKf()
+					}
+					this.checkUserInfoA()
+				}
+			}
+			if(this.sortLink){
+				this.getLink()
+			} else if(!this.sortLink&&!this.videoId) {
+				uni.showToast({
+					title: 'sortLink is not found',
+					icon: 'none'
+				});
+			}
+			// #endif
+			
 		},
 		mounted() {
 			// this.getIP()
@@ -575,6 +613,13 @@
 			this.clearIntegral()
 		},
 		methods: {
+			plusReady(callback) {
+			  if (window.plus) {
+				callback()
+			  } else {
+				document.addEventListener('plusready', callback, { once: true })
+			  }
+			},
 			//检查用户昵称以及头像
 			checkUserInfoA(){
 				checkUserInfo().then(res=>{
@@ -929,8 +974,8 @@
 				this.errorCount++
 				if (this.errorCount > 3) return
 				console.log(e)
-				this.getErrMsg(e.target.errMsg)
-				this.getH5CourseVideoDetails('error')
+				// this.getErrMsg(e.target.errMsg)
+				// this.getH5CourseVideoDetails('error')
 			},
 			// 当开始/继续播放时触发play事件
 			getPlay() {
@@ -1166,15 +1211,19 @@
 				}
 			},
 			submit() {
-				if(this.isExpire){
-					uni.showToast({
-						title: '课程已过期或链接无效',
-						icon: 'none'
-					});
+				if(this.isAddKf==0){
+					this.getIsAddKf()
 					return
 				}
+				// if(this.isExpire){
+				// 	uni.showToast({
+				// 		title: '课程已过期或链接无效',
+				// 		icon: 'none'
+				// 	});
+				// 	return
+				// }
 				// 登录
-				this.$isLoginCourse().then(
+				this.$isLoginCourseH5().then(
 					res => {
 						console.log(res)
 						if(res){
@@ -1214,6 +1263,7 @@
 			},
 			// 答题
 			courseAnswer() {
+				console.log(this.errTitle)
 				let time = this.playTime
 				if (this.isEnded||this.isFinish==1) {
 					time = this.duration
@@ -1263,7 +1313,7 @@
 								}
 								this.remain = res.remain || 0
 								if (res.remain > 0) {
-									this.answerPopup=true
+									// this.answerPopup=true
 									this.errTitle = "很遗憾答错了"
 									this.errDesc = `<span style="color:#FF5C03">还有${res.remain}次机会,继续加油</span>`
 									// this.$refs.answerPopup.open("center")
@@ -1271,14 +1321,17 @@
 								}
 							} else {
 								this.errTitle = "恭喜你,回答正确"
-								uni.login({
-									provider: 'weixin',
-									success: async loginRes => {
-										console.log(loginRes)
-										var code=loginRes
-										this.closeAnswerPopup(loginRes.code)
-									}
-								})
+								if(res.msg=='答题成功'){
+									this.closeAnswerPopup()
+									// uni.login({
+									// 	provider: 'weixin',
+									// 	success: async loginRes => {
+									// 		console.log(loginRes)
+									// 		var code=loginRes
+									// 		this.closeAnswerPopup(loginRes.code)
+									// 	}
+									// })
+								}
 								// 答题成功
 								// this.errDesc = `请选择奖励`
 								// this.$refs.answerPopup.open("center")
@@ -1306,6 +1359,7 @@
 				this.currentReward = e.detail.value
 			},
 			closeAnswerPopup(code) {
+				// console.log("closeAnswerPopup===",code)
 				// this.$refs.answerPopup.close()
 				uni.showLoading({
 					title: "加载中..."
@@ -1315,7 +1369,7 @@
 						...this.urlOption,
 						userId:this.userInfo.userId,
 						// rewardType: Number(this.currentReward),
-						source: 2, // 小程序
+						source: 3, // 2 小程序 3 app
 						appId: this.appid,
 						code:code
 					}
@@ -1359,7 +1413,7 @@
 					})
 				}else{
 					uni.hideLoading()
-					this.answerPopup=!this.answerPopup
+					this.answerPopup=false
 				}
 			},
 			// 线路
@@ -1426,13 +1480,16 @@
 					companyUserId:this.companyUserId,
 					companyId:this.companyId,
 					courseId:this.courseId,
-					periodId:this.periodId
+					periodId:this.periodId,
+					projectId:this.projectId
 				}
 				// {videoId: this.videoId,qwUserId: this.qwUserId,corpId: this.corpId}
 				getIsAddKf(data).then(res => {
 						if (res.code == 200) {
 							this.isLogin = true
 							if(res.data){
+								this.userInfo= res.data
+								uni.setStorageSync('userInfo', JSON.stringify(res.user));
 								this.isAddKf = 1
 								this.getH5CourseVideoDetails()
 							}
@@ -1548,20 +1605,16 @@
 				getErrMsg({
 					msg: JSON.stringify(msgerr)
 				})
-			},
-			goLogin() {
-				
 			},
 			getLink() {
-				this.goLogin()
-				return
+				// if(plus.storage.getItem('AppToken'))return
 				let that = this;
 				this.msg = ''
 				getRealLink({sortLink:this.sortLink}).then(res=>{
 					if(res.code == 200) {
 						this.isExpire = false
 						// 如果响应中包含真实链接,则跳转到真实链接
-						// window.location.href = res.realLink +"&sortLink="+this.sortLink+"&code="+this.code+"&time="+new Date().getTime()
+						window.location.href = res.realLink +"&sortLink="+this.sortLink+"&code="+this.code+"&time="+new Date().getTime()
 						if (this.isLogin && this.isAddKf == 1) {
 							this.getH5CourseVideoDetails()
 						}
@@ -2116,7 +2169,7 @@
 	}
 
 	.content {
-		padding-bottom: calc(var(--window-bottom) + 164rpx);
+		padding-bottom: calc(var(--window-bottom) + 140rpx);
 		.video-box {
 			width: 100%;
 			height: 420rpx;

+ 6 - 6
router/router.js

@@ -9,17 +9,17 @@ export default new Vuex.Store({
 	// imgpath: 'https://hylj-1323137866.cos.ap-chongqing.myqcloud.com',//云联融智图片请求地址
 	// logoname:'云联融智优选',
 	// appid:'wxd70f99287830cb51',
-	// imgpath: 'https://fbylive.obs.cn-southwest-2.myhuaweicloud.com',//福本源图片请求地址
-	// logoname:'乐氏本源',
-	// appid:'wxb9b453d37c5fad45',
+	imgpath: 'https://fbylive.obs.cn-southwest-2.myhuaweicloud.com',//福本源图片请求地址
+	logoname:'乐氏本源',
+	appid:'wxb9b453d37c5fad45',
 	// imgpath: 'https://sft-1361917636.cos.ap-chongqing.myqcloud.com',//四福堂图片请求地址
 	// logoname:'四福堂',
 	// imgpath: 'https://zkzh-2025.oss-cn-beijing.aliyuncs.com',//中康图片请求地址
 	// logoname:'中康未来智慧',
 	// appid:'wxedde588767b358b1',
-	imgpath: 'https://zkzh-2025.oss-cn-beijing.aliyuncs.com',//新中康图片请求地址
-	logoname:'中康未来智慧',
-	appid:'wx414427b10866c04e',
+	// imgpath: 'https://zkzh-2025.oss-cn-beijing.aliyuncs.com',//新中康图片请求地址
+	// logoname:'中康未来智慧',
+	// appid:'wx414427b10866c04e',
 	// imgpath: 'https://fc-1361520560.cos.ap-beijing.myqcloud.com',//蜂巢快药图片请求地址
 	// logoname:'蜂巢快药',
 	// appid:'wx903d9aee9cffb320',////蜂巢快药

+ 12 - 1
utils/common.js

@@ -180,6 +180,16 @@ export function isLoginCourse() {
 		}
 	}); 
 }
+export function isLoginCourseH5() {
+	return new Promise((resolve, reject) => {
+		let token = uni.getStorageSync('TOKEN_KEY');
+		if (token==null||token==undefined||token=="" ) {
+			resolve(false);
+		} else {
+			resolve(true);
+		}
+	}); 
+}
 export function isLoginCourseqw() {
 	return new Promise((resolve, reject) => {
 		let token = uni.getStorageSync('TOKEN_KEYQW');
@@ -209,5 +219,6 @@ module.exports = {
 	isLogin: isLogin,
 	generateRandomString,
 	isLoginCourse:isLoginCourse,
-	isLoginCourseqw:isLoginCourseqw
+	isLoginCourseqw:isLoginCourseqw,
+	isLoginCourseH5:isLoginCourseH5
 };