puyao hace 1 mes
padre
commit
77f22eab93
Se han modificado 6 ficheros con 103 adiciones y 9 borrados
  1. 1 1
      api/user.js
  2. 2 0
      components/courseItem.vue
  3. 1 1
      components/vipUserItem.vue
  4. 65 3
      pages/customer/index.vue
  5. 7 3
      pages/user/index.vue
  6. 27 1
      pages/user/wxuser.vue

+ 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');
  }
  

+ 2 - 0
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>
 		<!-- 设置链接有效时长弹窗 -->

+ 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"

+ 65 - 3
pages/customer/index.vue

@@ -240,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>
@@ -257,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>
@@ -523,9 +539,17 @@
 			}
 		},
 		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()
@@ -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

+ 7 - 3
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>
 		<!-- 长按保存海报 -->
@@ -624,7 +628,7 @@
 			text-align: center;
 			font-size: 30upx;
 			font-family: PingFang SC;
-			color: #111;
+			color: #2979ff;
 		}
 	}
 	.sharePop {

+ 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>