2 次代碼提交 6e13c733a1 ... 8d4d8db73a

作者 SHA1 備註 提交日期
  puyao 8d4d8db73a 合并 1 月之前
  puyao 77f22eab93 解决冲突 1 月之前

+ 0 - 3
App.vue

@@ -4,9 +4,6 @@
 	var isSocketOpen=false;
 	var socket=null;
 	export default {
-		globalData: {
-			appId: 'wxd70f99287830cb51', // appId 看课授权登录微信appId
-		},
 		data() {
 			return {
 			};

+ 12 - 12
api/course.js

@@ -2,27 +2,27 @@ import Request from '../common/request.js';
 let request = new Request().http
 
 export function loginByMp(data) {
- 	 return request('/app/wx/courseLogin2',data,'POST','application/json;charset=UTF-8');
+ 	 return request('/app/wx/courseLogin2',data,'POST','application/json;charset=UTF-8','https://h5api.his.cdwjyyh.com');
  }
 
 // 获取真实链接
 export function getRealLink(data) {
-	return request('/app/course/getRealLink', data, 'GET','');
+	return request('/app/course/getRealLink', data, 'GET','','https://h5api.his.cdwjyyh.com');
 }
 
 // h5课程简介
 export function getH5CourseByVideoId(data) {
-	return request('/app/course/getH5CourseByVideoId', data, 'GET','');
+	return request('/app/course/getH5CourseByVideoId', data, 'GET','','https://h5api.his.cdwjyyh.com');
 }
 
 // h5课程详情加问答
 export function getH5CourseVideoDetails(data) {
-	return request('/app/course/getH5CourseVideoDetails', data, 'GET','');
+	return request('/app/course/getH5CourseVideoDetails', data, 'GET','','https://h5api.his.cdwjyyh.com');
 }
 
 // 答题发红包
 export function courseAnswer(data) {
-	return request('/app/course/courseAnswer', data, 'POST', 'application/json;charset=UTF-8');
+	return request('/app/course/courseAnswer', data, 'POST', 'application/json;charset=UTF-8','https://h5api.his.cdwjyyh.com');
 }
 
 // // 记录看课时间(旧)
@@ -32,36 +32,36 @@ export function courseAnswer(data) {
 
 // 记录看课时间(新)
 export function getFinishCourseVideo(data) {
-	return request('/app/course/updateWatchDuration', data, 'POST', 'application/json;charset=UTF-8');
+	return request('/app/course/updateWatchDuration', data, 'POST', 'application/json;charset=UTF-8','https://h5api.his.cdwjyyh.com');
 }
 
 // 关注客服
 export function getIsAddKf(data) {
-	return request('/app/course/isAddKf', data, 'POST', 'application/json;charset=UTF-8');
+	return request('/app/course/isAddKf', data, 'POST', 'application/json;charset=UTF-8','https://h5api.his.cdwjyyh.com');
 }
 
 // 流量(缓冲百分比)
 export function getInternetTraffic(data) {
-	return request('/app/course/getInternetTraffic', data, 'POST', 'application/json;charset=UTF-8');
+	return request('/app/course/getInternetTraffic', data, 'POST', 'application/json;charset=UTF-8','https://h5api.his.cdwjyyh.com');
 }
 
 // 每十分钟获得积分
 export function getIntegralByH5Video(data) {
-	return request('/app/course/getIntegralByH5Video', data, 'POST', 'application/json;charset=UTF-8');
+	return request('/app/course/getIntegralByH5Video', data, 'POST', 'application/json;charset=UTF-8','https://h5api.his.cdwjyyh.com');
 }
 
 // 发送奖励
 export function sendReward(data) {
-	return request('/app/course/sendReward', data, 'POST', 'application/json;charset=UTF-8');
+	return request('/app/course/sendReward', data, 'POST', 'application/json;charset=UTF-8','https://h5api.his.cdwjyyh.com');
 }
 
 // 播放错误上报
 export function getErrMsg(data) {
-	return request('/app/course/getErrMsg', data, 'POST', 'application/x-www-form-urlencoded');
+	return request('/app/course/getErrMsg', data, 'POST', 'application/x-www-form-urlencoded','https://h5api.his.cdwjyyh.com');
 }
 
 
 // 获取getWxConfig
 export function getWxConfig(data) {
-	return request('/app/wx/mp/getWxConfig', data, 'GET','');
+	return request('/app/wx/mp/getWxConfig', data, 'GET','','https://h5api.his.cdwjyyh.com');
 }

+ 1 - 1
api/user.js

@@ -35,6 +35,6 @@ let request = new Request().http
  }
  //微信小程序登录
  export function loginByMiniApp(data) {
- 	 return request('/app/wx/miniapp/login',data,'POST','application/json;charset=UTF-8');
+ 	 return request('/app/wx/miniapp/loginByMa',data,'POST','application/json;charset=UTF-8');
  }
  

+ 4 - 1
components/courseItem.vue

@@ -41,6 +41,7 @@
 					<button open-type="share" class="share" @click="handleClick()">分享课程</button>
 				</view>
 				<!--#endif-->
+				<!--#ifdef H5-->
 				<view class="sharePop-item y-f" @click="buildimg">
 					<image src="@/static/images/poster_icon.png" mode="aspectFill"></image>
 					<view style="font-weight: bold;margin-bottom: 4px;">生成海报</view>
@@ -51,6 +52,7 @@
 					<view style="font-weight: bold;margin-bottom: 4px;">复制链接</view>
 					<view style="font-size: 12px;color: #888;">生成链接一键复制</view>
 				</view>
+				<!--#endif-->
 			</view>
 		</u-popup>
 		<!-- 设置链接有效时长弹窗 -->
@@ -86,7 +88,8 @@
 				<view class="imgshe">
 					<image src='@/static/image/point.png' class="w300 h300"></image>
 				</view>
-				<view class="column colorf fs32 xu-box fs40 align-center justify-center">
+				<view class="column colorf fs32 xu-box fs40
+				align-center justify-center">
 					<view class="justify-center">点击右上角
 						<image src="@/static/image/wxmore.png" class="w50 h50 mlr10"></image>
 					</view>

+ 1 - 1
components/vipUserItem.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class=" column flex-1 hb" style="height: 100vh;">
+	<view class=" column flex-1 hb" style="height: 100%;">
 		<scroll-view scroll-y="true" class="hb" :refresher-enabled="isEnabled" :refresher-triggered="triggered"
 			refresher-background="rgba(0,0,0,0)" @refresherrefresh="pullDownRefresh"
 			@refresherrestore="triggered = false" :upper-threshold="100" :lower-threshold="100"

+ 0 - 2
note.txt

@@ -1,2 +0,0 @@
-// appId 看课授权登录微信appId
-// 需要在app.vue => globalData中配置

+ 2 - 1
pages/courseManage/manage/userDataDetail.vue

@@ -1,6 +1,7 @@
 <template>
 	<view class="column flex-1 hb">
-		<view class="justify-between align-center plr32 m20 base-bg colorf ptb48 radius20">
+		<view class="justify-between align-center plr32 m20 base-bg 
+		colorf ptb48 radius20">
 			<view>账户可用余额</view>
 			<view class="bold fs40">{{balanceuserDay.balance}}</view>
 		</view>

+ 80 - 18
pages/customer/index.vue

@@ -40,8 +40,7 @@
 						</view>
 					</view>
 					<view class="tagbox-right x-f" @click="openPop('tag')">筛选<u-icon name="arrow-down" color="#1677ff"
-							size="12"></u-icon>
-					</view>
+							size="12"></u-icon></view>
 				</view>
 			</view>
 			<view v-if="current==0">
@@ -67,12 +66,12 @@
 							</view>
 							<view class="boxnav-item x-ac" style="width: 100%;" v-show="registerTimeIndex == 4">
 								<view class="calendar-day x-c" @click="$refs.calendar.open()">
-									<u-icon name="calendar" color="#999" size="20"></u-icon>
-									{{queryParam.startTime || '选择日期'}}
+									<u-icon name="calendar" color="#999"
+										size="20"></u-icon>{{queryParam.startTime || '选择日期'}}
 								</view>
 								<view class="calendar-day x-c" @click="$refs.calendar.open()">
-									<u-icon name="calendar" color="#999" size="20"></u-icon>
-									{{queryParam.endTime || '选择日期'}}
+									<u-icon name="calendar" color="#999"
+										size="20"></u-icon>{{queryParam.endTime || '选择日期'}}
 								</view>
 							</view>
 						</view>
@@ -199,8 +198,8 @@
 					:lower-threshold="100" @refresherabort="triggeredsA = false">
 					<view class="justify-start p32 wrap">
 						<view class="mlr10 mt10 " v-for="(item,index) in changetag" :key='item.tagId'>
-							<u-tag :text="item.tag" :plain="!item.checked" :name="index" @click="choosechangeTag">
-							</u-tag>
+							<u-tag :text="item.tag" :plain="!item.checked" :name="index"
+								@click="choosechangeTag"></u-tag>
 						</view>
 					</view>
 					<view class="center fs24 mt20">
@@ -224,8 +223,8 @@
 		<u-popup :show="invitePop" :round="12" @close="invitePop = false" :zIndex="10074" style="flex: 0;">
 			<view class="popbox">
 				<view class="popbox-head">
-					<u-icon class="close-circle" name="close-circle" color="#ccc" size="24" @click="invitePop = false">
-					</u-icon>
+					<u-icon class="close-circle" name="close-circle" color="#ccc" size="24"
+						@click="invitePop = false"></u-icon>
 					分享方式
 				</view>
 				<view class="popbox-body">
@@ -241,13 +240,28 @@
 						<view class="tagbox-item x-f" @click="chooseTag">未打标签</view>
 						<view class="tagbox-item x-f tag-active">未打标签</view>
 					</view> -->
-					<view class="x-bc" style="margin-top: 30px;">
-						<view class="sharePop-item y-f " @click="shareimg" style="text-align: center;">
+					<!--#ifdef MP-WEIXIN-->
+					<view class="justify-center" style="margin-top: 10px;">
+					<!--#endif-->
+					<!--#ifdef H5-->
+					<view class="justify-center" style="margin-top: 10px;">
+					<!--#endif-->
+					<!-- <view class="x-bc " style="margin-top: 30px;"> -->
+						<!--#ifdef MP-WEIXIN-->
+						<view class="sharePop-item y-f " style="text-align: center;">
+						<!--#endif-->
+						<!--#ifdef H5-->
+						<view class="sharePop-item y-f card-share" @click="shareimg" style="text-align: center;">
+						<!--#endif-->
 							<image src="@/static/images/card_icon.png" mode="aspectFill"
 								style="width: 80rpx; height: 80rpx;margin-top: 20rpx;"></image>
 							<view style="font-weight: bold;margin-bottom: 4px;">生成卡片</view>
 							<view style="font-size: 12px;color: #888;">指导分享轻松转发</view>
+							<!-- #ifdef MP-WEIXIN -->
+							<button open-type="share" class="share" @click="sharecard()">分享卡片</button>
+							<!-- #endif -->
 						</view>
+						<!--#ifdef H5-->
 						<view class="sharePop-item y-f " @click="buildimg" style="text-align: center;">
 							<image src="@/static/images/poster_icon.png" mode="aspectFill"></image>
 							<view style="font-weight: bold;margin-bottom: 4px;">生成海报</view>
@@ -258,6 +272,7 @@
 							<view style="font-weight: bold;margin-bottom: 4px;">复制链接</view>
 							<view style="font-size: 12px;color: #888; ">生成链接一键复制</view>
 						</view>
+						<!--#endif-->
 					</view>
 				</view>
 			</view>
@@ -290,7 +305,8 @@
 				<view class="imgshe">
 					<image src='@/static/image/point.png' class="w300 h300"></image>
 				</view>
-				<view class="column colorf fs32 xu-box fs40 align-center justify-center">
+				<view class="column colorf fs32 xu-box fs40
+				align-center justify-center">
 					<view class="justify-center">点击右上角
 						<image src="@/static/image/wxmore.png" class="w50 h50 mlr10"></image>
 					</view>
@@ -300,8 +316,8 @@
 			</view>
 		</u-overlay>
 		<!-- 更改归属 -->
-		<u-picker :show="showcol" :columns="columns" @cancel='showcol=!showcol' @confirm='receiveA' keyName="nickName">
-		</u-picker>
+		<u-picker :show="showcol" :columns="columns" @cancel='showcol=!showcol' @confirm='receiveA'
+			keyName="nickName"></u-picker>
 	</view>
 </template>
 
@@ -523,14 +539,22 @@
 			}
 		},
 		onLoad() {
-			this.getjssdklist()
+		  // #ifdef MP-WEIXIN
+		  uni.showShareMenu({
+		    withShareTicket: true,
+		    menus: ['shareAppMessage']
+		  });
+		  // #endif
 		},
 		onShow() {
+			// #ifdef H5
+			this.getjssdklist()
+			// #endif
 			this.user = uni.getStorageSync("companyUserInfo") ? JSON.parse(uni.getStorageSync("companyUserInfo")) : {}
 			this.getcompanyTag()
 			this.getvipListnum()
 			this.getsalelist()
-			this.userList = []
+			this.userList=[]
 			this.getfsuserListdata()
 		},
 		mounted() {
@@ -542,6 +566,32 @@
 			},
 		},
 		methods: {
+			sharecard(){
+				console.log(123)
+				uni.share({
+						  provider: 'weixin',
+						  scene: 'WXSceneSession', // 分享到会话
+						  type: 0,
+						  title: this.user.userId+'邀请您成为会员!',
+						  path: '/pages/user/users/becomeVIP?companyId='+
+						this.user.companyId + '&companyUserId=' + this.user.userId + '&tagids=' + this.sharetaglist,
+						  imageUrl: this.imgs,
+						  success: (res) => {
+							console.log('分享成功', res);
+							uni.showToast({
+							  title: '分享成功',
+							  icon: 'none'
+							});
+						  },
+						  fail: (err) => {
+							console.log('分享失败', err);
+							uni.showToast({
+							  title: '分享失败,请稍后再试',
+							  icon: 'none'
+							});
+						  }
+						});
+			},
 			changetagall() {
 				this.showTagSelect = !this.showTagSelect
 				this.tagchangekeywords = ''
@@ -1390,6 +1440,18 @@
 </script>
 
 <style lang="scss" scoped>
+	.card-share{
+		position: relative;
+	}
+	.share{
+			display: inline-block;
+			position: absolute;
+			top: 0;
+			left: 0;
+			width: 100%;
+			height: 100%;
+			opacity: 0;
+		}
 	.imgshe {
 		display: flex;
 		flex-direction: row-reverse
@@ -1695,4 +1757,4 @@
 	.userlist {
 		padding: 24rpx;
 	}
-</style>
+</style>

+ 9 - 4
pages/user/index.vue

@@ -75,22 +75,26 @@
 		<!-- 分享弹窗 -->
 		<u-popup :show="showShare" :closeOnClickOverlay="true" :round='20' @close="closeShare" @open="openShare">
 			<view class="sharePop x-ac">
-				<!-- <view class="sharePop-item y-f" @click="shareimg">
+				<!--#ifdef MP-WEIXIN-->
+				<view class="sharePop-item y-f" @click="shareimg">
 					<image src="@/static/images/card_icon.png" mode="aspectFill"
 						style="width: 80rpx; height: 80rpx;margin-top: 20rpx;"></image>
 					<view style="font-weight: bold;margin-bottom: 4px;">生成卡片</view>
 					<view style="font-size: 12px;color: #888;">指导分享轻松转发</view>
 				</view>
-				<view class="sharePop-item y-f" @click="buildimg">
+				<!--#endif-->
+				<!-- <view class="sharePop-item y-f" @click="buildimg">
 					<image src="@/static/images/poster_icon.png" mode="aspectFill"></image>
 					<view style="font-weight: bold;margin-bottom: 4px;">生成海报</view>
 					<view style="font-size: 12px;color: #888;">保存海报美观宣传</view>
 				</view> -->
+				<!--#ifdef H5-->
 				<view class="sharePop-item y-f" @click="shareSale">
 					<image src="@/static/images/link_icon.png" mode="aspectFill"></image>
 					<view style="font-weight: bold;margin-bottom: 4px;">复制链接</view>
 					<view style="font-size: 12px;color: #888;">生成链接一键复制</view>
 				</view>
+				<!--#endif-->
 			</view>
 		</u-popup>
 		<!-- 长按保存海报 -->
@@ -121,7 +125,8 @@
 				<view class="imgshe" >
 					<image src='@/static/image/point.png' class="w300 h300"></image>
 				</view>
-				<view class="column colorf fs32 xu-box fs40 align-center justify-center">
+				<view class="column colorf fs32 xu-box fs40
+				align-center justify-center">
 					<view class="justify-center">点击右上角
 					<image src="@/static/image/wxmore.png"
 					class="w50 h50 mlr10"></image>
@@ -623,7 +628,7 @@
 			text-align: center;
 			font-size: 30upx;
 			font-family: PingFang SC;
-			color: #111;
+			color: #2979ff;
 		}
 	}
 	.sharePop {

+ 4 - 2
pages/user/users/users.vue

@@ -47,8 +47,10 @@
 									</view>
 									<!-- <view class="fs24 base-color-red mr10 bor-red
 									base-bg-false plr20 radius40 ptb4">已禁用</view> -->
-									<view class="fs24 base-color mr10 bor-blue h52 lh50 base-bg-sure plr20 radius40 " style="width: fit-content;" v-if="subitem.isAudit==1">已审核</view>
-									<view class="fs24 base-color-red mr10 bor-red h52 lh50 base-bg-false plr20 radius40  " style="width: fit-content;z-index: 999;" @click="getidshen(subitem.userId)"
+									<view class="fs24 base-color mr10 bor-blue h52 lh50
+									base-bg-sure plr20 radius40 " style="width: fit-content;" v-if="subitem.isAudit==1">已审核</view>
+									<view class="fs24 base-color-red mr10 bor-red h52 lh50
+									base-bg-false plr20 radius40  " style="width: fit-content;z-index: 999;" @click="getidshen(subitem.userId)"
 									 v-else-if="subitem.isAudit==0&&!selectact">待审核</view>
 								</view>
 							</view>

+ 27 - 1
pages/user/wxuser.vue

@@ -35,7 +35,11 @@
 			 	</view>
 			</view>
 		</view>
-		
+		<view class="p20">
+			<view class="btn-box" >
+				<view class="sub-btn" @click="showLogout()">退出登录</view>
+			</view>
+		</view>
 		<tabbar :actindex="1"></tabbar>
 	</view>
 </template>
@@ -57,6 +61,9 @@
 			this.getCompanyUsers()
 		},
 		methods: {
+			showLogout(){
+				
+			},
 			navTo(url){
 				if(uni.getStorageSync('companyUserInfo')){
 					uni.switchTab({
@@ -220,4 +227,23 @@
 		}
 	}
 }
+.btn-box{
+		margin: 30rpx 0rpx 30rpx;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		.sub-btn{
+			box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
+			border: 1rpx solid #f8f8f8;
+			background: #FFFFFF;
+			width: 100%;
+			border-radius: 10rpx;
+			height: 88upx;
+			line-height: 88upx;
+			text-align: center;
+			font-size: 30upx;
+			font-family: PingFang SC;
+			color: #2979ff;
+		}
+	}
 </style>

+ 59 - 29
pages_course/video.vue

@@ -340,6 +340,23 @@
 				}
 			}
 		},
+		//发送给朋友
+		onShareAppMessage(res) {
+			return {
+				title: "御君方互联网医院",
+				path: '/pages/index/index',
+				imageUrl: 'https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20230106/6b459adfb1004c1a96219bcdf07e337c.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
+			}
+			
+		},
+		//分享到朋友圈
+		onShareTimeline(res) {
+			return {
+				title: "御君方互联网医院",
+				imageUrl: 'https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20230106/6b459adfb1004c1a96219bcdf07e337c.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
+			}
+			
+		},
 		onLoad(option) {
 			this.code = option.code
 			this.urlOption = option.course ? JSON.parse(option.course) : {}
@@ -371,7 +388,7 @@
 		onShow() {
 			this.tipsOpen = false
 			this.isExpand = true
-			// this.isLogin = this.utils.isLogin()
+			// this.isLogin = this.$isLoginCourse()
 			this.uuId = generateRandomString(16)
 			if (this.videoId) {
 				this.getH5CourseByVideo()
@@ -662,25 +679,30 @@
 					return
 				}
 				// 登录
-				this.isLogin = this.utils.isLogin()
-				if(this.isLogin){
-					if (this.isAddKf == 1) {
-						// 答题
-						this.courseAnswer()
-					} else {
-						// 添加客服
-						if (this.videoId && this.qwUserId) {
-							this.getIsAddKf()
-						} else {
-							uni.showToast({
-								title: '请添加客服',
-								icon: 'none'
-							})
+				this.$isLoginCourse().then(
+					res => {
+						if(res){
+							if (this.isAddKf == 1) {
+								// 答题
+								// 您已提交过答案,请领取红包
+								this.courseAnswer()
+							} else {
+								// 添加客服
+								if (this.videoId && this.qwUserId) {
+									this.getIsAddKf()
+								} else {
+									uni.showToast({
+										title: '请添加客服',
+										icon: 'none'
+									})
+								}
+							} 
+						} else{
+							this.goLogin()
 						}
-					} 
-				} else{
-					this.goLogin()
-				}
+					},
+					rej => {}
+				);
 			},
 			// 答题
 			courseAnswer() {
@@ -768,8 +790,8 @@
 					const param = {
 						...this.urlOption,
 						rewardType: Number(this.currentReward),
-						source: 2, // 小程序
-						appId: getApp().globalData.appId
+						source: 2,
+						appId: 'wxa9be7360a11024a4'
 					}
 					sendReward(param).then(res => {
 						uni.showToast({
@@ -940,11 +962,12 @@
 									code: loginRes.code,
 									encryptedData:infoRes.encryptedData,
 									iv:infoRes.iv,
-									appId: getApp().globalData.appId
+									appId: 'wxa9be7360a11024a4'
 								}).then(res=>{
 									 uni.hideLoading();
 									 if (res.code == 200) {
-										uni.setStorageSync('AppToken', res.token);
+										uni.setStorageSync('AppTokenmini_RTCourse', res.token);
+										uni.setStorageSync('userInfo', JSON.stringify(res.user));
 										this.isLogin = true
 										this.getIsAddKf() 
 									 } else {
@@ -966,6 +989,8 @@
 				})
 			},
 			getLink() {
+				this.goLogin()
+				return
 				let that = this;
 				this.msg = ''
 				getRealLink({sortLink:this.sortLink}).then(res=>{
@@ -977,12 +1002,17 @@
 							this.getH5CourseVideoDetails()
 						}
 						if (this.videoId && this.isAddKf != 1) {
-							this.isLogin = this.utils.isLogin()
-							if(this.isLogin){
-								this.getIsAddKf() 
-							} else {
-								this.goLogin()
-							}
+							this.$isLoginCourse().then(
+								isLogin => {
+									this.isLogin = isLogin
+									if(isLogin){
+										this.getIsAddKf() 
+									} else {
+										this.goLogin()
+									}
+								},
+								rej => {}
+							);
 						}
 					} else {
 						this.isExpire = true