Browse Source

Signed-off-by: liuboyan <632697560@qq.com>
1

liuboyan 4 years ago
parent
commit
bc0ec8450e

+ 79 - 2
pages/index/index.vue

@@ -2,6 +2,17 @@
 	<view class="content">
 		<u-navbar back-icon-size="0" :back-text="locationText" title="星火纵横" :title-color="mainColor" title-bold></u-navbar>
 		<u-swiper :list="swiperList" mode="rect" effect3d border-radius="30" name="url" style="margin-bottom: 10px;"></u-swiper>
+		<view class="section-title">
+			<u-image width="20px" height="10px" :src="sectionIcon"></u-image>
+			<u-section title="会员开通" font-size="32" :right="false" :show-line="false"></u-section>
+		</view>
+		<view class="menber-box">
+			<view class="menber-col" v-for="(item, index) in menberList" :key="index" @click="goToPay(item)">
+				<view class="menber-label">{{item.typeValue}}</view>
+				<view class="menber-num">¥{{item.amount}}</view>
+				<view class="menber-icon iconfont iconzu4931"></view>
+			</view>
+		</view>
 		<view class="section-title">
 			<u-image width="20px" height="10px" :src="sectionIcon"></u-image>
 			<u-section title="附近场馆" font-size="32" :right="false" :show-line="false"></u-section>
@@ -31,7 +42,7 @@
 		<view class="video-box">
 			<view v-for="(item, index) in videoList" :key="index" class="video-card">
 				<view class="video-col">
-					<video :src="item.url" object-fit="cover" controls></video>
+					<video :src="item.url" object-fit="cover" controls :id="'video' + index"></video>
 				</view>
 				<!-- <u-image :src="item.url" mode="aspectFill" height="30vw" border-radius="10px"></u-image> -->
 				<view class="video-name">{{item.title}}</view>
@@ -60,8 +71,9 @@
 				latitude: '',
 				locationText: '',
 				swiperList: [],
+				menberList: [],
 				venueList: [],
-				videoList: []
+				videoList: [],
 			}
 		},
 		onLoad(options) {
@@ -71,6 +83,11 @@
 					data: options.shareParams
 				})
 			}
+			// setTimeout(()=>{
+			// 	let videoContext = uni.createVideoContext('video1')
+			// 	videoContext.play()
+			// 	console.log(12)
+			// },6000)
 			uni.getLocation({
 				type: 'wgs84',
 				geocode: true,
@@ -110,6 +127,14 @@
 						type: 'warning',
 					})
 				})
+				NET.request(API.getMemberCardList, {}, 'POST').then(res => {
+					this.menberList = res.data
+				}).catch(error => {
+					this.$refs.uTips.show({
+						title: error.message,
+						type: 'warning',
+					})
+				})
 				NET.request(API.getAddressInfo, uni.getStorageSync('locationData'), 'POST').then(res => {
 					this.locationText = res.data.province + '-' + res.data.city + '-' + res.data.district
 				}).catch(error => {
@@ -135,6 +160,12 @@
 					})
 				})
 			},
+			//  跳转开通支付
+			goToPay(site) {
+				uni.navigateTo({
+					url: '/pagesMain/openMember?id=' + site.id
+				});
+			},
 			//  跳转场馆详情
 			goToVenueDetail(item) {
 				uni.navigateTo({
@@ -172,6 +203,52 @@
 			}
 		}
 
+		.menber-box {
+			width: 100vw;
+			float: left;
+			padding-left: 5px;
+			overflow-x: auto;
+			white-space: nowrap;
+
+			.menber-col {
+				width: 70vw;
+				margin: 10px 15px;
+				padding: 15px 20px;
+				display: inline-block;
+				background-color: #FFFFFF;
+				border-radius: 15px;
+				box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);
+				position: relative;
+				overflow: hidden;
+
+				.menber-label {
+					width: 100%;
+					margin-bottom: 10px;
+					float: left;
+					font-size: 14px;
+					font-weight: bold;
+					line-height: 20px;
+				}
+
+				.menber-num {
+					width: 100%;
+					float: left;
+					font-size: 26px;
+					line-height: 28px;
+					color: $mainColor;
+				}
+
+				.menber-icon {
+					font-size: 80px;
+					color: $mainColor;
+					position: absolute;
+					right: -15px;
+					bottom: -15x;
+					opacity: 0.5;
+				}
+			}
+		}
+
 		.venue-box {
 			width: 100vw;
 			float: left;

+ 4 - 0
pages/login/index.vue

@@ -13,9 +13,13 @@
 					</u-cell-item>
 				</u-cell-group>
 				<u-button type="warning" :ripple="true" :custom-style="{...customStyle, margin: '10px 0'}" @click="login()">登录</u-button>
+				<!-- #ifdef APP-PLUS -->
 				<u-button type="warning" :ripple="true" :custom-style="{...customStyle, margin: '10px 0'}" @click="login1()">app微信授权登录</u-button>
+				<!-- #endif -->
+				<!-- #ifdef MP-WEIXIN -->
 				<u-button type="warning" :ripple="true" :custom-style="{...customStyle, backgroundColor: '#07c160'}" open-type="getPhoneNumber"
 				 @getphonenumber="getUserinfoWechat" withCredentials="true">微信一键登录</u-button>
+				<!-- #endif -->
 			</view>
 		</u-card>
 		<u-top-tips ref="uTips"></u-top-tips>

+ 1 - 1
pages/member/index.vue

@@ -16,7 +16,7 @@
 						<view class="class-content" slot="body">
 							<view class="class-info-text">
 								<u-icon name="clock"></u-icon>
-								{{site.classStartDate}}&nbsp;&nbsp;{{site.classStartHours}}&nbsp;&nbsp;{{site.residue}}课时
+								{{site.classStartDate}}&nbsp;&nbsp;{{site.classStartHours}}
 							</view>
 							<view class="class-info-text">
 								<u-icon name="map"></u-icon>

+ 23 - 3
pages/user/index.vue

@@ -94,6 +94,11 @@
 						path: 'subscribeList',
 						icon: API.getServerImg + 'yuyue.png'
 					},
+					{
+						label: '订阅通知',
+						path: 'sendMessage',
+						icon: API.getServerImg + 'yuyue.png'
+					},
 				],
 				studentList: []
 			}
@@ -130,9 +135,24 @@
 			},
 			//  跳转我的各列表界面
 			goToHandle(site) {
-				uni.navigateTo({
-					url: '/pagesMain/' + site.path
-				});
+				if (site.path == 'sendMessage') {
+					wx.requestSubscribeMessage({
+						tmplIds: ['tVb_KMiqovKWBk6BMmiZAy0taSlMx-pNIL62k0jf7k4', '3y7b65I9HW9sI7JDAKa_OAu3KwlL_Kgjb8_AFsHMSa8',
+							'TryB3hO6Evw4Nz-qMF7yf1SFgqij-dqsUShJvVrLaoQ'
+						],
+						success: (res) => {},
+						fail: (error) => {
+							this.$refs.uTips.show({
+								title: '订阅失败:' + error.errMsg,
+								type: 'warning',
+							})
+						},
+					})
+				} else {
+					uni.navigateTo({
+						url: '/pagesMain/' + site.path
+					});
+				}
 			},
 			//  分享
 			share() {

+ 47 - 19
pagesMain/contractInfo.vue

@@ -1,14 +1,17 @@
 <template>
 	<view class="content">
-		<!-- <u-image width="100vw" height="100vh" :src="contractInfo.url"></u-image> -->
-		<!-- <web-view :src="contractInfo.url" class="web-view"></web-view> -->
-		<view class="canvas-container">
-			<canvas canvas-id="canvas" id="canvas" :disable-scroll="true" style="width: 100%; height: 200px;background-color: #FFFFFF;"
-			 @touchstart="handleTouchStart($event)" @touchmove="handleTouchMove($event)" @touchend="handleTouchEnd($event)"
-			 @touchcancel="handleEnd($event)"></canvas>
-		</view>
+		<rich-text :nodes="contractInfo.url" class="web-view"></rich-text>
+		<u-cell-group style="width: 100%; float: left;">
+			<u-cell-item title="乙方签字" :arrow="false" :title-style="{width: '100%'}" required>
+				<view class="canvas-container" slot="label">
+					<canvas canvas-id="canvas" id="canvas" :disable-scroll="true" style="width: 100%; height: 200px;background-color: #FFFFFF;"
+					 @touchstart="handleTouchStart($event)" @touchmove="handleTouchMove($event)" @touchend="handleTouchEnd($event)"
+					 @touchcancel="handleEnd($event)"></canvas>
+				</view>
+			</u-cell-item>
+		</u-cell-group>
 		<view class="handle-fix-box">
-			<u-button type="warning" shape="circle" :ripple="true" :custom-style="customStyle" @click="toPay()">确定支付</u-button>
+			<u-button type="warning" shape="circle" :ripple="true" :custom-style="customStyle" @click="submitContract()">确定支付</u-button>
 		</view>
 		<u-top-tips ref="uTips"></u-top-tips>
 	</view>
@@ -39,6 +42,7 @@
 					id: '',
 					url: '',
 				},
+				signUrl: '',
 				canvasData: []
 			}
 		},
@@ -72,15 +76,7 @@
 				NET.request(API.getContractInfo, {
 					cardId: this.orderInfo.id
 				}, 'POST').then(res => {
-					uni.downloadFile({
-						url: res.data.url,
-						success: (res2) => {
-							uni.openDocument({
-								filePath: res2.tempFilePath,
-							});
-						}
-					})
-					// this.contractInfo = res.data
+					this.contractInfo = res.data
 				}).catch(error => {
 					this.$refs.uTips.show({
 						title: error.message,
@@ -125,10 +121,42 @@
 					}
 				})
 			},
+			//  提交签字
+			submitContract() {
+				let that = this
+				uni.canvasToTempFilePath({
+					canvasId: 'canvas',
+					success: res => {
+						uni.uploadFile({
+							url: API.uploadFile,
+							filePath: res.tempFilePath,
+							name: 'file',
+							header: {
+								Authorization: uni.getStorageSync('token')
+							},
+							success: (uploadFileRes) => {
+								that.signUrl = JSON.parse(uploadFileRes.data).data.id
+								NET.request(API.submitContractForm, {
+									contractId: that.contractInfo.id,
+									fileId: that.signUrl,
+								}, 'POST').then(res => {
+									that.toPay(res.data.id)
+								}).catch(error => {
+									that.$refs.uTips.show({
+										title: error.message,
+										type: 'warning',
+									})
+								})
+							}
+						});
+					}
+				})
+			},
 			//  支付
-			toPay() {
+			toPay(contractId) {
 				NET.request(API.getPayParams, {
-					...this.orderInfo
+					...this.orderInfo,
+					contractId: contractId
 				}, 'POST').then(res => {
 					if (this.memberInfo.realPayAmount <= 0) {
 						this.goToPayResult(res.data.oderNo)

+ 1 - 1
pagesMain/evaluateList.vue

@@ -12,7 +12,7 @@
 				<view class="class-content" slot="body">
 					<view class="class-info-text">
 						<u-icon name="clock"></u-icon>
-						{{item.classStartDate}}&nbsp;&nbsp;{{item.classStartHours}}&nbsp;&nbsp;{{item.residue}}课时
+						{{item.classStartDate}}&nbsp;&nbsp;{{item.classStartHours}}
 					</view>
 					<view class="class-info-text">
 						<u-icon name="map"></u-icon>

+ 51 - 41
pagesMain/openMember.vue

@@ -10,13 +10,13 @@
 			<u-cell-item title="优惠金额" :value="couponId ? '-¥' + memberInfo.discountsAmount : ''" @click="couponShow = true"></u-cell-item>
 			<u-cell-item title="学员姓名" :value="studentName" @click="studentShow = true" required></u-cell-item>
 			<u-cell-item title="实际金额" :value="'¥' + memberInfo.realPayAmount" :arrow="false"></u-cell-item>
-			<u-cell-item title="乙方签字" :arrow="false" :title-style="{width: '100%'}" required>
+			<!-- <u-cell-item title="乙方签字" :arrow="false" :title-style="{width: '100%'}" required>
 				<view class="canvas-container" slot="label">
 					<canvas canvas-id="canvas" id="canvas" :disable-scroll="true" v-show="!couponShow && !studentShow" style="width: 100%; height: 200px;background-color: #FFFFFF;"
 					 @touchstart="handleTouchStart($event)" @touchmove="handleTouchMove($event)" @touchend="handleTouchEnd($event)"
 					 @touchcancel="handleEnd($event)"></canvas>
 				</view>
-			</u-cell-item>
+			</u-cell-item> -->
 		</u-cell-group>
 		<u-popup v-model="couponShow" mode="bottom" border-radius="30" closeable>
 			<scroll-view scroll-y style="height:300px;margin: 30px 0 15px 0;">
@@ -36,8 +36,8 @@
 			</scroll-view>
 		</u-popup>
 		<view class="handle-fix-box">
-			<text class="contract-link" @click="checkContract()">点击查看合同协议</text>
-			<u-button type="warning" shape="circle" :ripple="true" :custom-style="customStyle" @click="submitContract()">确定支付¥{{memberInfo.realPayAmount}}</u-button>
+			<!-- <text class="contract-link" @click="checkContract()">点击查看合同协议</text> -->
+			<u-button type="warning" shape="circle" :ripple="true" :custom-style="customStyle" @click="toPay()">确定支付¥{{memberInfo.realPayAmount}}</u-button>
 		</view>
 		<u-popup v-model="studentShow" mode="bottom" border-radius="30">
 			<scroll-view scroll-y class="student-box">
@@ -48,7 +48,8 @@
 					</view>
 				</u-card>
 			</scroll-view>
-			<u-button type="warning" shape="circle" :ripple="true" :custom-style="{...customStyle,margin:'15px'}" @click="goToSubscribelForm()">新增学员</u-button>
+			<u-button type="warning" shape="circle" :ripple="true" :custom-style="{...customStyle,margin:'15px',float: 'left',width: 'calc(100% - 30px)'}"
+			 @click="goToSubscribelForm()">新增学员</u-button>
 		</u-popup>
 		<u-top-tips ref="uTips"></u-top-tips>
 	</view>
@@ -279,43 +280,50 @@
 			},
 			//  支付
 			toPay(contractId) {
-				NET.request(API.getPayParams, {
-					id: this.memberCardId,
-					couponId: this.couponId,
-					studentId: this.studentId,
-					contractId: contractId
-				}, 'POST').then(res => {
-					if (this.memberInfo.realPayAmount <= 0) {
-						this.goToPayResult(res.data.oderNo)
-						return false
-					}
-					uni.requestPayment({
-						provider: 'wxpay',
-						timeStamp: res.data.timeStamp,
-						nonceStr: res.data.nonceStr,
-						package: res.data.packageString,
-						signType: res.data.signType,
-						paySign: res.data.paySign,
-						success: (payRes) => {
-							this.goToPayResult(res.data.oderNo)
-						},
-						fail: (error) => {
-							this.$refs.uTips.show({
-								title: '支付未成功',
-								type: 'warning',
-							})
-						}
-					})
-				}).catch(error => {
+				if (!this.studentId) {
 					this.$refs.uTips.show({
-						title: error.message,
+						title: '请选择学员',
 						type: 'warning',
 					})
-				})
-				// uni.navigateTo({
-				// 	url: '/pagesMain/contractInfo?memberCardId=' + this.memberCardId + '&couponId=' + this.couponId + '&studentId=' +
-				// 		this.studentId
-				// });
+					return
+				}
+				// NET.request(API.getPayParams, {
+				// 	id: this.memberCardId,
+				// 	couponId: this.couponId,
+				// 	studentId: this.studentId,
+				// 	contractId: contractId
+				// }, 'POST').then(res => {
+				// 	if (this.memberInfo.realPayAmount <= 0) {
+				// 		this.goToPayResult(res.data.oderNo)
+				// 		return false
+				// 	}
+				// 	uni.requestPayment({
+				// 		provider: 'wxpay',
+				// 		timeStamp: res.data.timeStamp,
+				// 		nonceStr: res.data.nonceStr,
+				// 		package: res.data.packageString,
+				// 		signType: res.data.signType,
+				// 		paySign: res.data.paySign,
+				// 		success: (payRes) => {
+				// 			this.goToPayResult(res.data.oderNo)
+				// 		},
+				// 		fail: (error) => {
+				// 			this.$refs.uTips.show({
+				// 				title: '支付未成功',
+				// 				type: 'warning',
+				// 			})
+				// 		}
+				// 	})
+				// }).catch(error => {
+				// 	this.$refs.uTips.show({
+				// 		title: error.message,
+				// 		type: 'warning',
+				// 	})
+				// })
+				uni.navigateTo({
+					url: '/pagesMain/contractInfo?memberCardId=' + this.memberCardId + '&couponId=' + this.couponId + '&studentId=' +
+						this.studentId
+				});
 			},
 			//  跳转支付结果
 			goToPayResult(oderNo) {
@@ -339,7 +347,8 @@
 	.content {
 		width: 100%;
 		float: left;
-		padding: 15px 15px 85px 15px;
+		// padding: 15px 15px 85px 15px;
+		padding: 15px 15px 60px 15px;
 		box-sizing: border-box;
 
 		.card-list {
@@ -428,7 +437,8 @@
 		}
 
 		.handle-fix-box {
-			height: 85px;
+			// height: 85px;
+			height: 60px;
 			text-align: center;
 
 			.contract-link {

+ 1 - 1
pagesMain/subscribeList.vue

@@ -12,7 +12,7 @@
 				<view class="class-content" slot="body">
 					<view class="class-info-text">
 						<u-icon name="clock"></u-icon>
-						{{item.classStartDate}}&nbsp;&nbsp;{{item.classStartHours}}&nbsp;&nbsp;{{item.residue}}课时
+						{{item.classStartDate}}&nbsp;&nbsp;{{item.classStartHours}}
 					</view>
 					<view class="class-info-text">
 						<u-icon name="map"></u-icon>

+ 7 - 4
pagesMember/classDetail.vue

@@ -45,7 +45,8 @@
 					</view>
 				</u-card>
 			</scroll-view>
-			<u-button type="warning" shape="circle" :ripple="true" :custom-style="{...customStyle,margin:'15px'}" @click="goToSubscribelForm()">新增学员</u-button>
+			<u-button type="warning" shape="circle" :ripple="true" :custom-style="{...customStyle,margin:'15px',float: 'left',width: 'calc(100% - 30px)'}"
+			 @click="goToSubscribelForm()">新增学员</u-button>
 		</u-popup>
 		<u-popup v-model="subscribeShow" mode="bottom" border-radius="30">
 			<scroll-view scroll-y class="student-box">
@@ -56,11 +57,13 @@
 					</view>
 				</u-card>
 			</scroll-view>
-			<u-button type="warning" shape="circle" :ripple="true" :custom-style="{...customStyle,margin:'15px'}" @click="goToSubscribelForm()">新增学员</u-button>
+			<u-button type="warning" shape="circle" :ripple="true" :custom-style="{...customStyle,margin:'15px',float: 'left',width: 'calc(100% - 30px)'}"
+			 @click="goToSubscribelForm()">新增学员</u-button>
 		</u-popup>
 		<view class="handle-fix-box">
-			<u-button type="warning" shape="circle" :ripple="true" :custom-style="{...customStyle,...handleStyleLeft}" @click="subscribeShow = true">预约体验</u-button>
-			<u-button type="warning" shape="circle" :ripple="true" :custom-style="{...customStyle,...handleStyleRight}" @click="enlistShow = true">立即报名</u-button>
+			<u-button type="warning" shape="circle" :ripple="true" :custom-style="customStyle" @click="subscribeShow = true">预约体验</u-button>
+			<!-- <u-button type="warning" shape="circle" :ripple="true" :custom-style="{...customStyle,...handleStyleLeft}" @click="subscribeShow = true">预约体验</u-button> -->
+			<!-- <u-button type="warning" shape="circle" :ripple="true" :custom-style="{...customStyle,...handleStyleRight}" @click="enlistShow = true">立即报名</u-button> -->
 		</view>
 		<u-top-tips ref="uTips" zIndex="100000"></u-top-tips>
 	</view>

+ 11 - 9
pagesMember/subscribelForm.vue

@@ -4,18 +4,18 @@
 			<u-form-item label="学生姓名" prop="studentName" required>
 				<u-input v-model="subscribelForm.studentName" placeholder="请输入学生姓名" />
 			</u-form-item>
-			<u-form-item label="家长姓名" prop="fatherName" required>
+			<!-- <u-form-item label="家长姓名" prop="fatherName" required>
 				<u-input v-model="subscribelForm.fatherName" placeholder="请输入家长姓名" />
-			</u-form-item>
+			</u-form-item> -->
 			<u-form-item label="学生性别" prop="sex" required>
 				<u-input v-model="subscribelForm.sex" placeholder="请选择学生性别" :select-open="sexShow" type="select" @click="sexShow = true" />
 			</u-form-item>
 			<u-form-item label="学生年龄" prop="age" required>
 				<u-input v-model="subscribelForm.age" placeholder="请输入学生年龄" type="number" />
 			</u-form-item>
-			<u-form-item label="学生生日" prop="birthday" required>
+			<!-- <u-form-item label="学生生日" prop="birthday" required>
 				<u-input v-model="subscribelForm.birthday" placeholder="请选择学生生日" :select-open="birthdayShow" type="select" @click="birthdayShow = true" />
-			</u-form-item>
+			</u-form-item> -->
 			<u-form-item label="手机号码" prop="phone" required>
 				<u-input v-model="subscribelForm.phone" type="number" placeholder="请输入手机号码" />
 			</u-form-item>
@@ -51,13 +51,13 @@
 			return {
 				subscribelForm: {
 					studentName: '',
-					fatherName: '',
+					// fatherName: '',
 					sex: '',
 					age: '',
-					birthday: '',
+					// birthday: '',
 					phone: '',
-					placeSchool: '',
-					experience: '',
+					// placeSchool: '',
+					// experience: '',
 				},
 				rules: {
 					studentName: [{
@@ -120,7 +120,9 @@
 				availableList: []
 			}
 		},
-		onLoad(options) {},
+		onLoad(options) {
+			this.subscribelForm.phone = uni.getStorageSync('userData').phone
+		},
 		onReady() {
 			this.$refs.subscribelForm.setRules(this.rules);
 		},

+ 6 - 4
pagesMember/venueDetail.vue

@@ -19,7 +19,7 @@
 					<view class="class-info">
 						<view class="class-info-row">
 							<u-icon name="clock"></u-icon>
-							{{item.classStartDate}}&nbsp;&nbsp;{{item.classStartHours}}&nbsp;&nbsp;{{item.residue}}课时
+							{{item.classStartDate}}&nbsp;&nbsp;{{item.classStartHours}}
 						</view>
 						<view class="class-info-row">
 							<u-icon name="map"></u-icon>
@@ -30,7 +30,7 @@
 				<view class="class-content" slot="foot" style="padding-bottom: 10px;text-align: right;">
 					<u-button type="default" shape="circle" :ripple="true" :custom-style="handleDefaultCustomStyle" size="mini"
 					 :hair-line="false" plain @click.stop="cardHandle(item, 1)">体验</u-button>
-					<u-button type="warning" shape="circle" :ripple="true" :custom-style="handleCustomStyle" size="mini" @click.stop="cardHandle(item, 2)">报名</u-button>
+					<!-- <u-button type="warning" shape="circle" :ripple="true" :custom-style="handleCustomStyle" size="mini" @click.stop="cardHandle(item, 2)">报名</u-button> -->
 				</view>
 			</u-card>
 		</view>
@@ -43,7 +43,8 @@
 					</view>
 				</u-card>
 			</scroll-view>
-			<u-button type="warning" shape="circle" :ripple="true" :custom-style="{...customStyle,margin:'15px'}" @click="goToSubscribelForm()">新增学员</u-button>
+			<u-button type="warning" shape="circle" :ripple="true" :custom-style="{...customStyle,margin:'15px',float: 'left',width: 'calc(100% - 30px)'}"
+			 @click="goToSubscribelForm()">新增学员</u-button>
 		</u-popup>
 		<u-popup v-model="subscribeShow" mode="bottom" border-radius="30">
 			<scroll-view scroll-y class="student-box">
@@ -54,7 +55,8 @@
 					</view>
 				</u-card>
 			</scroll-view>
-			<u-button type="warning" shape="circle" :ripple="true" :custom-style="{...customStyle,margin:'15px'}" @click="goToSubscribelForm()">新增学员</u-button>
+			<u-button type="warning" shape="circle" :ripple="true" :custom-style="{...customStyle,margin:'15px',float: 'left',width: 'calc(100% - 30px)'}"
+			 @click="goToSubscribelForm()">新增学员</u-button>
 		</u-popup>
 		<u-top-tips ref="uTips" zIndex="100000"></u-top-tips>
 	</view>