Преглед изворни кода

feat: 新增课程分享-分享给微信好友

wenxingxing пре 14 часа
родитељ
комит
97cf8bf300
3 измењених фајлова са 47 додато и 35 уклоњено
  1. 1 1
      App.vue
  2. 34 26
      components/share-box/share-box.vue
  3. 12 8
      pages/course/info.vue

+ 1 - 1
App.vue

@@ -107,7 +107,7 @@
 			aiWSUrl: 'ws://webim.zkhj6.com',
 			kfurl: 'https://work.weixin.qq.com/kfid/kfc3731c5008ebd8906', //企业微信客服链接
 			corpId: 'ww70ac72e824957fc9', //客服企业id
-			miniprogamId: 'gh_5db2859e4e72',
+			miniprogamId: 'gh_b51445318864',
 			shareCorpId: '', // 分享企业id
 			shareSchema: "", // 应用跳转标识,显示在具体应用下的 Schema字段
 			shareAgentid: "", // 企业微信管理后台 应用唯一标识。显示在具体应用下的 AgentId字段

+ 34 - 26
components/share-box/share-box.vue

@@ -3,11 +3,11 @@
 		<view class="share-inner">
 			<view class="share-item" @click="wxShare(0)">
 				<image src="/static/images/icon_wx.png" mode=""></image>
-				<text class="text">微信</text>
+				<text class="text">分享给微信好友</text>
 			</view>
-			<view class="share-item" @click="wxShare(1)">
+			<view v-if="false" class="share-item" @click="wxShare(1)">
 				<image src="/static/images/icon_pyq.png" mode=""></image>
-				<text class="text">朋友圈</text>
+				<text class="text">分享到朋友圈</text>
 			</view>
 			<!-- <view class="share-item" @click="qwShare()">
 				<image src="/static/images/icon_qwshare.png"  mode=""></image>
@@ -26,7 +26,7 @@
 						<text class="text">二维码</text>
 					</view> -->
 
-			<view class="share-item" @click="copyUrl()">
+			<view v-if="false" class="share-item" @click="copyUrl()">
 				<image src="/static/images/icon_copy_link.png" mode=""></image>
 				<text class="text">复制链接</text>
 			</view>
@@ -184,7 +184,7 @@
 					type: 5,
 					imageUrl: imageUrl, //分享封面图片
 					title: this.shareItem.title, // 分享标题
-					//summary: this.shareItem.summary,    // 分享内容文字
+					summary: this.shareItem.summary,    // 分享内容文字
 					miniProgram: {
 						id: getApp().globalData.miniprogamId,
 						path: this.shareItem.path,
@@ -192,7 +192,8 @@
 						webUrl: "http://uniapp.dcloud.io"
 					},
 					success: function(res) {
-						that.doShare();
+						// that.doShare();
+						that.closeShare()
 						uni.showToast({
 							title: "分享成功",
 							icon: 'none'
@@ -336,48 +337,55 @@
 
 <style lang="scss" scoped>
 	.share-content {
-		background-color: #FFF;
-		border-radius: 40upx 40upx 0px 0px;
+		background-color: #F4F6F7;
+		border-radius: 20rpx 20rpx 0px 0px;
+		padding: 24rpx 24rpx 30rpx;
+		box-sizing: border-box;
 
 		.share-inner {
-			padding: 70upx 0 0 0;
+			padding: 40rpx;
+			background: #FFFFFF;
+			border-radius: 12rpx;
 			display: flex;
-			flex-wrap: wrap;
+			flex-direction: column;
+			// flex-wrap: wrap;
 
 			.share-item {
-				width: 25%;
+				width: 100%;
 				display: flex;
-				flex-direction: column;
+				flex-direction: row;
 				align-items: center;
-				justify-content: center;
-				margin-bottom: 66upx;
+				margin-bottom: 40rpx;
 
 				image {
-					width: 80upx;
-					height: 80upx;
-					margin-bottom: 20upx;
+					width: 80rpx;
+					height: 80rpx;
 				}
 
 				.text {
-					font-size: 28upx;
-					font-family: PingFang SC;
-					font-weight: 500;
-					color: #111111;
-					line-height: 1;
+					font-weight: 400;
+					font-size: 36rpx;
+					color: rgba(0,0,0,0.85);
+					margin-left: 20rpx;
 				}
 			}
+			.share-item:last-child{
+				margin-bottom: 0;
+			}
 		}
 
 		.cancel-btn {
 			height: 96upx;
 			line-height: 96upx;
 			text-align: center;
-			font-size: 32upx;
+			font-size: 32rpx;
 			font-family: PingFang SC;
-			font-weight: 500;
-			color: #111111;
-			border-top: 2upx solid #E8E8E8;
+			font-weight: 400;
+			color: rgba(0,0,0,0.85);
 			background-color: #FFF;
+			margin-top: 20rpx;
+			margin-bottom: 20rpx;
+			border-radius: 48rpx;
 		}
 	}
 </style>

+ 12 - 8
pages/course/info.vue

@@ -286,7 +286,7 @@
 			<input type="text" v-model="inputComment" placeholder="发表我的态度" :maxlength="50" class="input-box"
 				confirm-type="send" @confirm="sendCommentMsg" />
 			<view class="send-btn" @click="sendCommentMsg">发送</view>
-			<view v-if="false" class="icon-btn" @tap="openShare">
+			<view class="icon-btn" @tap="openShare">
 				<image src="/static/image/hall/share_icon.png" mode="aspectFill"></image>
 				<text>分享</text>
 			</view>
@@ -1137,15 +1137,19 @@ export default {
 			if (this.$isEmpty(this.pickCatalog.title)) {
 				this.shareItem.title = this.data.courseName;
 			} else {
-				this.shareItem.title = this.data.courseName + "-" + this.pickCatalog.title;
+				// this.shareItem.title = this.data.courseName + "-" + this.pickCatalog.title;
+				this.shareItem.title = this.pickCatalog.title;
 			}
-			this.shareItem.isMini = false
-			this.shareItem.imageUrl = this.data.imgUrl;
-			this.shareItem.compressImage = 1;
+			this.shareItem.isMini = true
+			// this.shareItem.imageUrl = this.data.imgUrl;
+			this.shareItem.imageUrl = this.pickCatalog.thumbnail;
+			this.shareItem.compressImage = 0;
 			this.shareItem.courseId = this.courseId;
 			this.shareItem.summary = !this.$isEmpty(this.data.description) ? this.data.description : "";
-			let cdn = uni.getStorageSync('h5Path');
-			this.shareItem.url = cdn + "/pages/course/info?courseId=" + this.courseId;
+			// let cdn = uni.getStorageSync('h5Path');
+			let cdn = '';
+			this.shareItem.url = cdn + "/pages_index/courseDetail?courseId=" + this.courseId;
+			this.shareItem.path = "/pages_index/courseDetail?courseId=" + this.courseId;
 			this.showShare = true;
 		},
 		goToComment() {
@@ -3437,7 +3441,7 @@ export default {
 		text-align: center;
 		color: #FFFFFF;
 		line-height: 96rpx;
-		// margin-right: 25rpx;
+		margin-right: 25rpx;
 	}
 
 	.icon-btn {