Browse Source

2023-12-23 实战营报名

zhiquz 1 year ago
parent
commit
b92e422733

+ 32 - 0
pages.json

@@ -377,6 +377,38 @@
 		
 		},
 		{
+			"path": "pages/payment-xx/payment",
+			"style": {
+				"navigationBarTitleText": "报名支付",
+				"enablePullDownRefresh": true
+			}
+		
+		},
+		{
+			"path": "pages/payment-xx/bankPay",
+			"style": {
+				"navigationBarTitleText": "报名支付",
+				"enablePullDownRefresh": false
+			}
+		
+		},
+		{
+			"path": "pages/payment-xx/singup",
+			"style": {
+				"navigationBarTitleText": "抢占结果",
+				"enablePullDownRefresh": false
+			}
+		
+		},
+		{
+			"path": "pages/payment-xx/information",
+			"style": {
+				"navigationBarTitleText": "信息填写",
+				"enablePullDownRefresh": false
+			}
+		
+		},
+		{
 			"path": "pages/howSend/howSend",
 			"style": {
 				"navigationBarTitleText": "扫码发货教程",

+ 5 - 0
pages/index-my/index-my.vue

@@ -90,6 +90,11 @@
 		// 	url: 'address-manage/address-manage'
 		// },
 		{
+			name: '实战营报名',
+			icon: '8.png',
+			url: 'payment-xx/payment'
+		},
+		{
 			name: '直播报名',
 			icon: '8.png',
 			url: 'payment/payment'

+ 2 - 2
pages/index/index.vue

@@ -217,9 +217,9 @@
 				}
 				let teamModules = []
 				teamModules.push({
-					name: '直播报名',
+					name: '实战营报名',
 					icon: require(`@/${requireBaseUrl}3_4.png`),
-					url: 'payment/payment'
+					url: 'payment-xx/payment'
 				})
 				// teamModules.push({
 				// 	name: '争霸赛报名',

+ 249 - 0
pages/payment-xx/bankPay.vue

@@ -0,0 +1,249 @@
+<template>
+	<view>
+		<view style="padding-top: 50rpx;">
+			<view class="pay">
+				<image src="https://qnys.chuliu.cc/daweiboshi_szy/1_1615541900_nrG1vctYn8.jpg"
+					mode="widthFix" style="width: 750rpx;margin-bottom: 60rpx;"></image>
+				<view class="pay_title">
+					第{{ data.season }}届大卫博士创业实战营
+				</view>
+				<view class="item">
+					<input maxlength="6" type="number" v-model="sms_code" placeholder="请输入验证码" />
+					<view v-throttle="2000" class="countdown" @tap="getCode">
+						{{ countDown ? `重新获取(${countDown}s)` : '获取验证码' }}
+					</view>
+				</view>
+				<view v-throttle="2000" class="pay_btnSig" :class="status ? 'red' : 'gray'" @click="singup">支付{{ data.cost }}报名</view>
+			</view>
+			<view class="payB" @click="goUnbank">
+				支付不了,重新绑定?
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import { getSignPackage } from '@/apis/app.js';
+	import { _API_HuiFuCheck, _API_QuickBankPay, _API_QuickBankSms, _API_CheckStatus } from '../../apis/szy.js';
+	const jweixin = require('jweixin-module');
+	export default {
+		data() {
+			return {
+				status: true,
+				countDown: 0, // 倒计时,
+				sms_code: '', // 验证码,
+				id: '',
+				payId: ''
+			}
+		},
+		computed: {
+			data() {
+				return this.$store.state.singup.szy_data
+			}
+		},
+		onLoad(option) {
+			this.id = option.id
+		},
+		methods: {
+			// 去重新绑定
+			goUnbank() {
+				uni.navigateTo({
+					url: '../zbs/unBank?type=2'
+				})
+			},
+			// 1.发送验证码
+			getCode() {
+				let that = this
+				_API_QuickBankPay({ id: this.id }).then(res => {
+					if (res.code == 200) {
+						uni.showModal({
+							content: '验证码发送成功',
+							showCancel: false,
+							success: (e) => {
+								if (e.confirm) {
+									that.payId = res.data.id
+									that.countDown = 180;
+									that.timer = setInterval(() => {
+										that.countDown--;
+										if (!that.countDown) {
+											that.countDown = 0;
+											clearInterval(that.timer);
+										}
+									}, 1000);
+								}
+							}
+						})
+					} else {
+						uni.showModal({
+							content: res.message || '获取验证码失败',
+							showCancel: false
+						});
+						return false;
+					}
+				})
+			},
+			// 2. 携带验证码支付
+			singup() {
+				let that = this
+				if (!this.sms_code) {
+					uni.showModal({
+						content: '请先输入验证码',
+						showCancel: false
+					})
+					return
+				}
+				uni.showModal({
+					title: '提示',
+					content: '确定要支付吗?',
+					success: (res) => {
+						if (res.confirm) {
+							_API_QuickBankSms({ id: that.payId, sms_code: that.sms_code }).then(res => {
+								if (res.code == 200) {
+									if (res.data.status == 0) {
+										that.SearchStatus()
+									} else if (res.data.status == 1) {
+										uni.navigateBack({
+										  delta: 2
+										})
+									}
+								} else {
+									uni.showModal({
+										title: '失败',
+										content: res.message || '获取失败',
+										showCancel: false
+									})
+									return false;
+								}
+							})
+								.catch(err => {})
+								.finally(() => {
+									setTimeout(() => {}, 3000)
+								})
+						}
+					}
+				})
+			},
+			// 3. 查询支付状态
+			SearchStatus() {
+				let that = this
+				uni.showLoading({
+				    title: '查询支付状态中...',
+				    mask: true
+				});
+				_API_CheckStatus({ id: this.payId }).then(res => {
+					if (res.code == 200) {
+						if (res.data.status == 1) {
+							uni.hideLoading()
+							uni.navigateBack({
+							  delta: 2
+							})
+						} else {
+							that.SearchStatus()
+						}
+					} else {
+						uni.hideLoading()
+						uni.showModal({
+							content: res.message || '查询失败',
+							showCancel: false
+						})
+					}
+				}).catch(err => {
+					uni.hideLoading()
+					uni.showModal({
+						content: err || '查询失败',
+						showCancel: false
+					})
+				})
+			}
+		}
+	}
+</script>
+<style>
+	page {
+		background-color: #F5F5F5;
+	}
+</style>
+<style lang="scss" scoped>
+	
+	.payB {
+		margin-top: 30rpx;
+		text-align: center;
+		color: #FF232C;
+		font-weight: bold;
+	}
+	.pay {
+		margin: 0 30rpx 0 30rpx;
+		border-radius: 16rpx;
+		background-color: #fff;
+		padding: 40rpx 20rpx 40rpx 20rpx;
+		&_title {
+			font-size: 34rpx;
+			font-weight: bold;
+		}
+		
+		&_time {
+			margin-top: 20rpx;
+			font-size: 32rpx;
+		}
+		
+		&_btnSig {
+			margin: 50rpx auto 0;
+			width: 600rpx;
+			line-height: 88rpx;
+			border-radius: 44rpx;
+			text-align: center;
+			color: #fff;
+			font-size: 32rpx;
+		}
+		.red {
+			background: linear-gradient(93deg, #FF232C 0%, #FF571B 100%);
+		}
+		.gray {
+			background-color: #E1E1E1;
+		}
+	}
+	.item {
+		@include flex();
+		height: 104rpx;
+		box-sizing: border-box;
+		color: $app-sec-text-color;
+		background: #F8F8F8;
+		margin: 50rpx 0 40rpx 0;
+		border-radius: 8rpx;
+		padding-left: 24rpx;
+	
+	
+	
+		.login_icon {
+			width: 36rpx;
+			height: 44rpx;
+		}
+	
+		.icon,
+		.cuIcon-roundclosefill {
+			margin: 0 20rpx;
+			font-size: 36rpx;
+		}
+	
+		input {
+			flex: 1;
+			height: 104rpx;
+			margin-left: 15rpx;
+		}
+	
+		.countdown {
+			@include flex();
+			height: 60rpx;
+			font-size: 24rpx;
+			padding: 0 20rpx;
+			border: 2rpx solid #FB231F;
+			margin-right: 20rpx;
+			border-radius: 33rpx;
+			color: $base-color;
+	
+			text {
+				margin-left: 8rpx;
+			}
+		}
+	}
+</style>

+ 268 - 0
pages/payment-xx/information.vue

@@ -0,0 +1,268 @@
+<template>
+	<view style="padding-top: 30rpx;">
+		<view class="paybox">
+			<view class="paybox_title">
+				<image src="../../static/team/user.png" mode="widthFix" style="width: 52rpx;margin-right: 20rpx;" />
+				确认收货人信息
+			</view>
+			<view class="paybox-top">
+				<view class="title">
+					<text>收货人</text>
+					<text class="star">*</text>
+				</view>
+				<input v-model="address.username" type="text" class="paybox-input" placeholder-class="input_placeholder" placeholder="请填写真实姓名" />
+			</view>
+			<view class="paybox-top">
+				<view class="title">
+					<text>手机号</text>
+					<text class="star">*</text>
+				</view>
+				<input v-model="address.mobile" type="number" class="paybox-input" placeholder-class="input_placeholder" placeholder="请填写手机号码" maxlength="11" />
+			</view>
+			<view class="paybox-top">
+				<view class="title">
+					<text>省市区</text>
+					<text class="star">*</text>
+				</view>
+				<view class="picker flexB" @tap="choosePicker">
+					<view :style="{ color: local ? '#333' : '#cbcbcb' }">{{ local ? local : '请选择所在地区' }}</view>
+					<text class="iconfont iconzhcc_xiangxiajiantou"></text>
+				</view>
+			</view>
+			<view class="paybox-bottom" style="border: none;">
+				<view class="title">
+					<text>详细地址</text>
+					<text class="star">*</text>
+				</view>
+				<view class="textpaybox">
+					<textarea v-model="address.address" type="text" placeholder="请填写详细地址" class="paybox-input" placeholder-class="input_placeholder" />
+				</view>
+			</view>
+		</view>
+		<view v-if="title" class="toptitle">
+			若信息不准确,请手动修改。
+		</view>
+		<view class="bottom"><view v-throttle="2000" class="bottom-btn" @click="save">保存地址</view></view>
+		<w-picker ref="Selector" mode="region" :defaultVal="pickerDefaultVal" themeColor="#F76454" @confirm="onConfirm" />
+	</view>
+</template>
+
+<script>
+	import WPicker from '@/components/w-picker/w-picker.vue';
+	import cityData from '@/components/citypicker/city-data/city.js';
+	import areaData from '@/components/citypicker/city-data/area.js';
+	import cityPicker from '@/components/citypicker/city-picker.vue';
+	import provinceData from '@/components/citypicker/city-data/province.js';
+	import{ 
+		GetEnrollUserAddress,
+		UpdateAddAddress
+	} from '@/apis/szy.js';
+	export default {
+		components: { WPicker, cityPicker },
+		data() {
+			return {
+				local: '',
+				title: false,
+				address: {
+					username: '',
+					mobile: '',
+					province: '',
+					city: '',
+					area: '',
+					address: '',
+				},
+				pickerDefaultVal: ['河南省', '郑州市', '金水区']
+			}
+		},
+		onLoad() {
+			this.getAddress()
+		},
+		methods: {
+			// 获取地址信息
+			getAddress() {
+				GetEnrollUserAddress().then(res => {
+					if (res.code === 200) {
+						if (res.data.province) {
+							this.address = res.data
+							const data = res.data
+							this.local =`${data.province}-${data.city}-${data.area}`
+							this.pickerDefaultVal = [ data.province, data.city, data.area ]
+							this.title = true
+						} else {
+							this.title = false
+						}
+					} else {
+						uni.showModal({
+							content: res.message || '获取失败',
+							showCancel: false
+						})
+					}
+				})
+			},
+			choosePicker() {
+				// 显示地址选择器
+				this.$refs.Selector.show();
+			},
+			onConfirm(e) {
+				// 选择地址选择器
+				this.local = `${e.checkArr[0]}-${e.checkArr[1]}-${e.checkArr[2]}`;
+				this.address.province = e.checkArr[0];
+				this.address.city = e.checkArr[1];
+				this.address.area = e.checkArr[2];
+			},
+			save() {
+				console.log(this.address)
+				// 保存/修改地址
+				if (!this.address.username.match(/^[\u4E00-\u9FA5\uf900-\ufa2d·s]{2,20}$/)) {
+					// 校验姓名
+					uni.toast('真实姓名不符合要求');
+					return;
+				}
+				if (!this.address.mobile.match(/^1\d{10}$/)) {
+					// 校验手机号
+					uni.toast('手机号码不符合要求');
+					return;
+				}
+				if (!this.local.trim().length) {
+					// 校验是否选择地区
+					uni.toast('请选择所在地区');
+					return;
+				}
+				if (!this.address.address.trim().length) {
+					// 校验是否填写详细地址
+					uni.toast('详细地址不能为空');
+					return;
+				}
+				const address = {
+					username: this.address.username,
+					mobile: this.address.mobile,
+					province: this.address.province,
+					city: this.address.city,
+					area: this.address.area,
+					address: this.address.address,
+				};
+				uni.showLoading({ mask: true });
+				UpdateAddAddress(address).then(res => {
+					if (res.code === 200) {
+						uni.toast('保存成功')
+					} else {
+						uni.showModal({
+							content: res.message || '提交失败',
+							showCancel: false
+						})
+					}
+				})
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+.toptitle {
+	font-size: 32rpx;
+	font-weight: bold;
+	color: #FF0000;
+	margin-top: 54rpx;
+	text-align: center;
+}
+.paybox {
+	margin: 0 24rpx;
+	background-color: #fff;
+	border-radius: 24rpx;
+	&_title {
+		display: flex;
+		align-items: center;
+		font-size: 36rpx;
+		font-weight: bold;
+		color: #333333;
+		padding: 32rpx 0 0 24rpx;
+	}
+	&-input {
+		font-size: 30rpx;
+		min-height: 126rpx;
+		width: 75%;
+		margin-left: 20rpx;
+	}
+	&-top {
+		min-height: 128rpx;
+		margin: 0 30rpx;
+		paybox-sizing: border-paybox;
+		border-bottom: 2rpx solid #eeeeee;
+		display: flex;
+		justify-content: flex-start;
+		align-items: center;
+		.title {
+			font-size: 34rpx;
+			font-weight: bold;
+			.star {
+				color: $base-color;
+				margin-left: 10rpx;
+				font-size: 40rpx;
+			}
+		}
+		.picker {
+			width: 75%;
+			min-height: 128rpx;
+			margin-left: 20rpx;
+			font-size: 30rpx;
+			.iconfont {
+				color: #cbcbcb;
+			}
+		}
+		.input_placeholder {
+			font-size: 30rpx;
+			color: #cbcbcb;
+		}
+	}
+	&-bottom {
+		height: 166rpx;
+		padding: 20rpx 30rpx;
+		paybox-sizing: border-paybox;
+		border-bottom: 2rpx solid #eeeeee;
+		display: flex;
+		justify-content: flex-start;
+		align-items: flex-start;
+		.title {
+			font-size: 34rpx;
+			font-weight: bold;
+			.star {
+				color: $base-color;
+				margin-left: 10rpx;
+				font-size: 40rpx;
+			}
+		}
+		.input_placeholder {
+			font-size: 30rpx;
+			color: #cbcbcb;
+		}
+		.textpaybox {
+			height: 166rpx;
+			.paybox-input {
+				width: 440rpx;
+				height: 120rpx;
+				font-size: 30rpx;
+			}
+		}
+	}
+}
+.bottom {
+	position: fixed;
+	bottom: 0;
+	width: 100%;
+	height: 100rpx;
+	padding: 6rpx 30rpx;
+	background-color: #fff;
+	border-top: 1px solid #eeeeee;
+	&-btn {
+		color: #fff;
+		text-align: center;
+		font-size: 32rpx;
+		font-weight: bold;
+		line-height: 88rpx;
+		height: 88rpx;
+		background: linear-gradient(90deg, #F30000 0%, #FE4815 100%);
+		opacity: 1;
+		border-radius: 44px;
+	}
+}
+</style>

+ 400 - 0
pages/payment-xx/payment -_xx_pay.vue

@@ -0,0 +1,400 @@
+<template>
+	<view style="padding-top: 50rpx;">
+		<view class="top" v-if="!showSignup">
+			<image src="https://qnys.chuliu.cc/daweiboshi_szy/1_1615541900_nrG1vctYn8.jpg"
+				mode="widthFix" style="width: 750rpx;margin-bottom: 60rpx;"></image>
+			<view class="title">
+				第{{ data.season }}届大卫博士创业实战营
+			</view>
+			<view class="time">
+				举办时间:{{ data.start + '-' + data.end }}
+			</view>
+			<view v-if="data.status == 1" class="btnSig gray">已报名</view>
+			<view v-else class="btnSig" :class="status ? 'red' : 'gray'" v-throttle="2000" @click="singup">支付{{ data.cost }}元报名</view>
+		</view>
+		<view class="voucher" v-else>
+			<image src="../../static/new_my/bg.png" class="bgImg" mode="widthFix" style="width: 750rpx;"></image>
+			<view class="bgImg">
+				<text style="margin-top: 30rpx;">第{{ data.season }}届大卫博士创业实战营</text>
+			</view>
+			<view class="voucher_con">
+				<view class="voucher_icon">
+					<image src="../../static/icon/success.png" mode="widthFix" style="width: 300rpx;margin-top: 78rpx;">
+					<!-- <image :src="`../../static/icon/${data.pay_status ? 'success' : 'show'}.png`" mode="widthFix" style="width: 300rpx;margin-top: 78rpx;"> -->
+					</image>
+					<view class="success">{{ data.pay_status ? '报名成功' : '获取名额成功,请完成支付' }}</view>
+					<view class="timed">
+						举办时间:{{ data.start+ '-' +data.end }}
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="bottom" v-if="showSignup">
+			<view v-if="data.pay_status " class="bottom-btn" @click="goBack">返回首页</view>
+			<view v-else class="bottom-btn" v-throttle="2000" @click="singup">立即支付</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		_API_payment,
+		_API_SearchStatus,
+		GetEnrollInfo,
+		GetEnrollUserAddress,
+		GetSzyGiftInfo
+	} from '@/apis/szy.js';
+	export default {
+		data() {
+			return {
+				status: false,
+				data: {
+					season: '',
+					start: '',
+					end: '',
+					name: '',
+					mobile: '',
+					cost: '',
+					local: ''
+				},
+				noClick: true,
+				showSignup: false,
+			}
+		},
+		onLoad() {
+			this.getInfo()
+		},
+		computed: {
+			userinfo() {
+				return this.$store.state.userinfo
+			}
+		},
+		onPullDownRefresh() {
+			this.getInfo()
+		},
+		methods: {
+			// 查看物流信息
+			toLogistics() {
+				uni.navigateTo({
+					url: "/pages/szy-logistics/szy-logistics?info=" + JSON.stringify(this.logInfo)
+				})
+			},
+			// 返回首页
+			goBack() {
+				uni.switchTab({
+					url: '/pages/index/index'
+				})
+			},
+			// 获取赛季信息
+			getInfo() {
+				GetEnrollInfo().then(res => {
+					if (res.code == 200) {
+						res.data = {
+							cost: 199,
+							end: "2023.11.25",
+							end_time: "2023-11-25 18:00:00",
+							enroll_end_time: "2023-11-21 16:00:00",
+							enroll_start_time: "2023-11-14 10:30:00",
+							limit_num: 100000,
+							num: 0,
+							pay_status: 0,
+							season: 63,
+							start: "2023.10.24",
+							start_time: "2023-11-24 08:00:00",
+							status: 0
+						}
+						this.data = res.data
+						this.data.start = this.getTimes(res.data.start_time)
+						this.data.end = this.getTimes(res.data.end_time)
+						
+						const a = new Date(res.data.enroll_start_time.replace(/-/g,'/')).getTime()
+						const b = new Date(res.data.enroll_end_time.replace(/-/g,'/')).getTime()
+						const now = Date.parse(new Date())
+						if (now > a && now < b &&  res.data.limit_num >  res.data.num) {
+							this.status = true
+						}
+						if (res.data.status == 1) {
+							this.showSignup = true
+						} else {
+							this.showSignup = false
+						}
+					} else {
+						uni.showModal({
+							content: res.message || '获取失败',
+							showCancel: false
+						})
+					}
+				})
+			},
+			getTimes(data) {
+				var time = new Date(data)
+				var year = time.getFullYear()
+				var month = time.getMonth() + 1 < 10 ? '0' + (time.getMonth() + 1) : time.getMonth() + 1;
+				var day = time.getDate() < 10 ? '0' + time.getDate() : time.getDate();
+				var today = year + '.' + month + '.' + day;
+				return today;
+			},
+			// 支付状态
+			SearchStatus() {
+				uni.showLoading({
+				    mask: true
+				})
+				_API_SearchStatus().then(res => {
+					uni.hideLoading()
+					if (res.code == 200) {
+						this.getInfo()
+					} else {
+						uni.showModal({
+							content: res.message || '获取失败',
+							showCancel: false
+						})
+					}
+				})
+			},
+			//WeixinJSBridge判断
+			wxJsPay(data, callback_succ_func, callback_error_func) {
+				if (typeof WeixinJSBridge == 'undefined') {
+					if (document.addEventListener) {
+						document.addEventListener('WeixinJSBridgeReady', this.jsApiCall, false);
+					} else if (document.attachEvent) {
+						document.attachEvent('WeixinJSBridgeReady', this.jsApiCall);
+						document.attachEvent('onWeixinJSBridgeReady', this.jsApiCall);
+					}
+				} else {
+					this.jsApiCall(data, callback_succ_func, callback_error_func);
+				}
+			},
+			//调起支付
+			jsApiCall(data, callback_succ_func, callback_error_func) {
+				let that = this
+				//使用原生的,避免初始化appid问题
+				WeixinJSBridge.invoke(
+					'getBrandWCPayRequest', {
+						appId: data.appId,
+						timeStamp: data.timestamp,
+						nonceStr: data.nonceStr,
+						package: data.package,
+						signType: data.signType,
+						paySign: data.paySign
+					},
+					function(res) {
+						var msg = res.err_msg ? res.err_msg : res.errMsg;
+						switch (msg) {
+							//支付成功时
+							case 'get_brand_wcpay_request:ok':
+								if (callback_succ_func) {
+									uni.showModal({
+										title: '支付成功',
+										showCancel: false
+									})
+									callback_succ_func(res);
+								}
+								break;
+							default:
+								//支付失败时
+								WeixinJSBridge.log('支付失败!' + msg + ',请返回重试.');
+								if (callback_error_func) {
+									callback_error_func({
+										msg: msg
+									});
+								}
+								break;
+						}
+					}
+				);
+			},
+			singup() {
+				if (!this.status && !this.data.status) {
+					return
+				}
+				let that = this
+				_API_payment().then(res => {
+						if (res.code == 200) {
+							let callback_succ_func = res => {
+								uni.showModal({
+									content: '支付成功!',
+									showCancel: false,
+									success: function(res) {
+										that.SearchStatus()
+									}
+								})
+							}
+							let callback_error_func = res => {
+								uni.showModal({
+									content: '支付失败!',
+									showCancel: false
+								})
+							}
+							this.wxJsPay(res.data, callback_succ_func, callback_error_func)
+						} else {
+							uni.showToast({
+								title: res.message || '失败',
+								icon: 'none'
+							})
+							return false;
+						}
+					})
+					.catch(err => {})
+					.finally(() => {
+						setTimeout(() => {}, 3000)
+					})
+			}
+		},
+	}
+</script>
+
+<style lang="scss" scoped>
+	.top {
+		margin: 0 30rpx 0 30rpx;
+		border-radius: 16rpx;
+		background-color: #fff;
+		padding: 40rpx 20rpx 40rpx 20rpx;
+	}
+
+	.title {
+		font-size: 34rpx;
+		font-weight: bold;
+	}
+
+	.time {
+		margin-top: 20rpx;
+		font-size: 32rpx;
+	}
+
+	.btnSig {
+		margin: 50rpx auto 0;
+		width: 600rpx;
+		line-height: 88rpx;
+		border-radius: 44rpx;
+		text-align: center;
+		color: #fff;
+		font-size: 32rpx;
+	}
+	.red {
+		background: linear-gradient(93deg, #FF232C 0%, #FF571B 100%);
+	}
+	.gray {
+		background-color: #E1E1E1;
+	}
+
+	.voucher {
+		hieght: 100vh;
+		min-height: 100vh;
+		width: 100vw;
+		position: relative;
+
+		.bgImg {
+			height: 100vh;
+			width: 100vw;
+			position: fixed;
+			top: 0;
+			left: 0;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			font-size: 46rpx;
+			font-weight: bold;
+
+			text {
+				color: #FFFFFF;
+				margin-top: 10rpx;
+			}
+
+		}
+
+		.voucher_con {
+			position: fixed;
+			height: 85%;
+			width: 100%;
+			bottom: 0;
+			left: 0;
+			background: #fff;
+			border-top-left-radius: 60rpx;
+			border-top-right-radius: 60rpx;
+
+			.line {
+				width: 128rpx;
+				height: 8rpx;
+				background: #f1f3f5;
+				margin: 36rpx auto 0;
+			}
+
+			.title {
+				color: #333;
+				font-size: 38rpx;
+				// margin: 48rpx auto 60rpx;
+				text-align: center;
+				font-weight: bold;
+			}
+
+			.voucher_icon {
+				text-align: center;
+
+				// image {
+				// 	height: 192rpx;
+				// 	width: 192rpx;
+				// 	margin-bottom: 30rpx;
+				// }
+				.success {
+					margin-top: 18rpx;
+					font-size: 48rpx;
+					color: #333;
+					font-weight: bold;
+				}
+
+				.timed {
+					margin-top: 36rpx;
+					font-size: 40rpx;
+					font-weight: bold;
+					color: #FF0000;
+				}
+			}
+
+			.logistics {
+				width: 250rpx;
+				height: 68rpx;
+				margin: 0 auto;
+				background: rgba(255, 244, 243, 0.39);
+				border: 2rpx solid #FB231F;
+				opacity: 1;
+				border-radius: 44rpx;
+				color: #FB231F;
+			}
+
+			.info {
+				margin: 68rpx 50rpx 40rpx 50rpx;
+				color: #333333;
+
+				text {
+					font-size: 32rpx;
+				}
+
+				>view {
+					margin-top: 20rpx;
+				}
+			}
+		}
+	}
+
+	.bottom {
+		position: fixed;
+		bottom: 0;
+		width: 100%;
+		height: 100rpx;
+		padding: 6rpx 30rpx;
+		background-color: #fff;
+		border-top: 1px solid #eeeeee;
+
+		&-btn {
+			color: #fff;
+			text-align: center;
+			font-size: 32rpx;
+			font-weight: bold;
+			line-height: 88rpx;
+			height: 88rpx;
+			background: linear-gradient(90deg, #F30000 0%, #FE4815 100%);
+			opacity: 1;
+			border-radius: 44px;
+		}
+	}
+</style>

+ 369 - 0
pages/payment-xx/payment.vue

@@ -0,0 +1,369 @@
+<template>
+	<view style="padding-top: 50rpx;">
+		<view class="top" v-if="!showSignup">
+			<image src="https://qnys.chuliu.cc/daweiboshi_szy/1_1615541900_nrG1vctYn8.jpg"
+				mode="widthFix" style="width: 750rpx;margin-bottom: 60rpx;"></image>
+			<view class="title">
+				第{{ data.season }}届大卫博士创业实战营
+			</view>
+			<view class="time">
+				举办时间:{{ data.start + '-' + data.end }}
+			</view>
+			<view v-if="data.status == 1" class="btnSig gray">已获取名额</view>
+			<view v-else class="btnSig" :class="status ? 'red' : 'gray'" v-throttle="2000" @click="singup">点击获取名额</view>
+		</view>
+		<view class="voucher" v-else>
+			<image src="../../static/new_my/bg.png" class="bgImg" mode="widthFix" style="width: 750rpx;"></image>
+			<view class="bgImg">
+				<text style="margin-top: 30rpx;">第{{ data.season }}届大卫博士创业实战营</text>
+			</view>
+			<view class="voucher_con">
+				<view class="voucher_icon">
+					<image src="../../static/icon/success.png" mode="widthFix" style="width: 300rpx;margin-top: 78rpx;">
+					</image>
+					<view class="success">报名成功</view>
+					<view class="timed">
+						举办时间:{{ data.start+ '-' +data.end }}
+					</view>
+					<view class="timed">
+						<view class="left">人脸照片:</view>
+						<view class="right">
+							<image v-if="data.path" :src="data.path" @click="initFace" mode="widthFix" style="width: 160rpx;height: 160rpx;">
+							</image>
+							<image v-else src="../../static/icon/uploadF.png" mode="widthFix" style="width: 160rpx;"
+								@click="initFace"></image>
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		_API_payment,
+		_API_SearchStatus,
+		GetEnrollInfo
+	} from '@/apis/szy.js';
+	import {
+		UploadSzyImg
+	} from '@/common/util/request'
+	export default {
+		data() {
+			return {
+				status: false,
+				data: {
+					season: '',
+					start: '',
+					end: '',
+					name: '',
+					mobile: '',
+					cost: '',
+					local: ''
+				},
+				noClick: true,
+				showSignup: false,
+			}
+		},
+		onLoad() {
+			this.getInfo()
+			// this.getData()
+		},
+		computed: {
+			userinfo() {
+				return this.$store.state.userinfo
+			}
+		},
+		onPullDownRefresh() {
+			this.getInfo()
+		},
+		methods: {
+			initFace() {
+				uni.chooseImage({
+						count: 1, //默认9
+						sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
+						sourceType: ['album'], //从相册选择
+						success: res => {
+							const tempFilePaths = res.tempFilePaths;
+							uni.uploadFile({
+								url: UploadSzyImg,
+								filePath: tempFilePaths[0],
+								name: 'image',
+								header: {
+									Authorization: 'Bearer ' + this.$store.state.app.token
+								},
+								success: (res) => {
+									const data = JSON.parse(res.data)
+									if (data.code == 200) {
+										this.getInfo()
+									} else {
+										uni.showToast({
+											title: res.message || '上传失败',
+											icon: 'none'
+										})
+									}
+								},
+								fail: err => {
+									uni.showToast({
+										title: '上传失败1',
+										icon: 'none'
+									})
+								}
+							});
+						}
+					})
+			},
+			getTimes(data) {
+				var time = new Date(data)
+				var year = time.getFullYear()
+				var month = time.getMonth() + 1 < 10 ? '0' + (time.getMonth() + 1) : time.getMonth() + 1;
+				var day = time.getDate() < 10 ? '0' + time.getDate() : time.getDate();
+				var today = year + '.' + month + '.' + day;
+				return today;
+			},
+			// 支付状态
+			SearchStatus() {
+				uni.showLoading({
+				    mask: true
+				})
+				_API_SearchStatus().then(res => {
+					uni.hideLoading()
+					if (res.code == 200) {
+						this.getInfo()
+					} else {
+						uni.showModal({
+							content: res.message || '获取失败',
+							showCancel: false
+						})
+					}
+				})
+			},
+			// 获取赛季信息
+			getInfo() {
+				GetEnrollInfo().then(res => {
+					if (res.code == 200) {
+						// res.data.enroll_start_time = "2023-12-23 10:30:00" // 报名时间
+						// res.data.enroll_end_time = "2023-12-24 12:30:00" // 报名时间
+						this.data = res.data
+						uni.setStorageSync("szy_data", res.data)
+						this.data.start = this.getTimes(res.data.start_time)
+						this.data.end = this.getTimes(res.data.end_time)
+						const a = new Date(res.data.enroll_start_time.replace(/-/g,'/')).getTime()
+						const b = new Date(res.data.enroll_end_time.replace(/-/g,'/')).getTime()
+						const now = Date.parse(new Date())
+						if (now > a && now < b &&  res.data.limit_num >  res.data.num) {
+							this.status = true
+						}
+						if (res.data.status == 1 && res.data.pay_status == 1) {
+							this.showSignup = true
+						} else if (res.data.status == 1 && res.data.pay_status == 0) {
+							this.showSignup = false
+							uni.navigateTo({
+								url: './singup'
+							})
+						} else {
+							this.showSignup = false
+						}
+					} else {
+						uni.showModal({
+							content: res.message || '获取失败',
+							showCancel: false
+						})
+					}
+				})
+			},
+			singup() {
+				if (!this.status && !this.data.status) {
+					return
+				}
+				let that = this
+				uni.showModal({
+					title: '提示',
+					content: '确定要获取名额吗?',
+					success: (res) => {
+						if (res.confirm) {
+							_API_payment().then(res => {
+								if (res.code == 200) {
+										// that.SearchStatus()
+										uni.navigateTo({
+											url: './singup'
+										})
+									} else {
+										uni.showModal({
+											title: '失败',
+											content: res.message || '获取失败',
+											showCancel: false
+										})
+										return false;
+									}
+								})
+								.catch(err => {})
+								.finally(() => {
+									setTimeout(() => {}, 3000)
+							})
+						}
+					}
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.top {
+		margin: 0 30rpx 0 30rpx;
+		border-radius: 16rpx;
+		background-color: #fff;
+		padding: 40rpx 20rpx 40rpx 20rpx;
+	}
+
+	.title {
+		font-size: 34rpx;
+		font-weight: bold;
+	}
+
+	.time {
+		margin-top: 20rpx;
+		font-size: 32rpx;
+	}
+
+	.btnSig {
+		margin: 50rpx auto 0;
+		width: 600rpx;
+		line-height: 88rpx;
+		border-radius: 44rpx;
+		text-align: center;
+		color: #fff;
+		font-size: 32rpx;
+	}
+	.red {
+		background: linear-gradient(93deg, #FF232C 0%, #FF571B 100%);
+	}
+	.gray {
+		background-color: #E1E1E1;
+	}
+
+	.voucher {
+		hieght: 100vh;
+		min-height: 100vh;
+		width: 100vw;
+		position: relative;
+
+		.bgImg {
+			height: 100vh;
+			width: 100vw;
+			position: fixed;
+			top: 0;
+			left: 0;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			font-size: 46rpx;
+			font-weight: bold;
+
+			text {
+				color: #FFFFFF;
+				margin-top: 10rpx;
+			}
+
+		}
+
+		.voucher_con {
+			position: fixed;
+			height: 85%;
+			width: 100%;
+			bottom: 0;
+			left: 0;
+			background: #fff;
+			border-top-left-radius: 60rpx;
+			border-top-right-radius: 60rpx;
+
+			.line {
+				width: 128rpx;
+				height: 8rpx;
+				background: #f1f3f5;
+				margin: 36rpx auto 0;
+			}
+
+			.title {
+				color: #333;
+				font-size: 38rpx;
+				// margin: 48rpx auto 60rpx;
+				text-align: center;
+				font-weight: bold;
+			}
+
+			.voucher_icon {
+				text-align: center;
+
+				// image {
+				// 	height: 192rpx;
+				// 	width: 192rpx;
+				// 	margin-bottom: 30rpx;
+				// }
+				.success {
+					margin-top: 18rpx;
+					font-size: 48rpx;
+					color: #333;
+					font-weight: bold;
+				}
+
+				.timed {
+					margin-top: 36rpx;
+					font-size: 30rpx;
+					font-weight: bold;
+					// color: #FF0000;
+					display: flex;
+					padding-left: 60rpx;
+				}
+			}
+
+			.logistics {
+				width: 250rpx;
+				height: 68rpx;
+				margin: 0 auto;
+				background: rgba(255, 244, 243, 0.39);
+				border: 2rpx solid #FB231F;
+				opacity: 1;
+				border-radius: 44rpx;
+				color: #FB231F;
+			}
+
+			.info {
+				margin: 68rpx 50rpx 40rpx 50rpx;
+				color: #333333;
+
+				text {
+					font-size: 32rpx;
+				}
+
+				>view {
+					margin-top: 20rpx;
+				}
+			}
+		}
+	}
+
+	.bottom {
+		position: fixed;
+		bottom: 0;
+		width: 100%;
+		height: 100rpx;
+		padding: 6rpx 30rpx;
+		background-color: #fff;
+		border-top: 1px solid #eeeeee;
+
+		&-btn {
+			color: #fff;
+			text-align: center;
+			font-size: 32rpx;
+			font-weight: bold;
+			line-height: 88rpx;
+			height: 88rpx;
+			background: linear-gradient(90deg, #F30000 0%, #FE4815 100%);
+			opacity: 1;
+			border-radius: 44px;
+		}
+	}
+</style>

+ 441 - 0
pages/payment-xx/payment_xs.vue

@@ -0,0 +1,441 @@
+<template>
+	<view style="padding-top: 50rpx;">
+		<view v-if="!showSignup">
+			<view class="top">
+				<image src="https://qnys.chuliu.cc/daweiboshi_szy/1_1615541900_nrG1vctYn8.jpg"
+					mode="widthFix" style="width: 750rpx;margin-bottom: 60rpx;"></image>
+				<view class="title">
+					第{{ data.season }}届大卫博士创业实战营(线上)
+				</view>
+				<view class="time">
+					举办时间:{{ data.start + '-' + data.end }}
+				</view>
+				<view v-if="data.status == 1" class="btnSig gray">已获取名额</view>
+				<view v-else class="btnSig" :class="status ? 'red' : 'gray'" v-throttle="2000" @click="singup">点击获取名额</view>
+			</view>
+		</view>
+		<view class="voucher" v-else>
+			<image src="../../static/new_my/bg.png" class="bgImg" mode="widthFix" style="width: 750rpx;"></image>
+			<view class="bgImg">
+				<text style="margin-top: 30rpx;">第{{ data.season }}届大卫博士创业实战营(线上)</text>
+			</view>
+			<view class="voucher_con">
+				<view class="voucher_icon">
+					<image src="../../static/icon/success.png" mode="widthFix" style="width: 300rpx;margin-top: 78rpx;">
+					<!-- <image :src="`../../static/icon/${data.pay_status ? 'success' : 'show'}.png`" mode="widthFix" style="width: 300rpx;margin-top: 78rpx;"> -->
+					</image>
+					<view class="success">{{ data.pay_status ? '报名成功' : '报名成功,请把钱转给老大' }}</view>
+					<view class="timed">
+						举办时间:{{ data.start+ '-' +data.end }}
+					</view>
+				</view>
+				<view class="info" v-show="data.pay_status">
+					<view>
+						<text>收货人:</text>
+						<text>{{ info.username }}</text>
+					</view>
+					<view>
+						<text>手机号:</text>
+						<text>{{ info.mobile }}</text>
+					</view>
+					<view>
+						<text>收货地址:</text>
+						<text>{{ info.local }}</text>
+					</view>
+					<navigator url="./information" class="info_btn">编辑地址</navigator>
+				</view>
+			</view>
+		</view>
+		<!-- <view class="bottom" v-if="showSignup">
+			<view class="bottom-btn" @click="goBack">返回首页</view>
+			<view v-else class="bottom-btn" v-throttle="2000" @click="singup">立即支付</view>
+		</view> -->
+	</view>
+</template>
+
+<script>
+	import {
+		_API_payment,
+		_API_SearchStatus,
+		GetEnrollInfo,
+		GetEnrollUserAddress,
+		GetSzyGiftInfo
+	} from '@/apis/szy.js';
+	export default {
+		data() {
+			return {
+				showTip: false,
+				status: false,
+				info: {},
+				data: {
+					season: '',
+					start: '',
+					end: '',
+					username: '',
+					mobile: '',
+					cost: '',
+					local: ''
+				},
+				noClick: true,
+				showSignup: false,
+			}
+		},
+		onShow() {
+			this.getInfo()
+		},
+		computed: {
+			userinfo() {
+				return this.$store.state.userinfo
+			}
+		},
+		onPullDownRefresh() {
+			this.getInfo()
+		},
+		methods: {
+			// 查看物流信息
+			toLogistics() {
+				uni.navigateTo({
+					url: "/pages/szy-logistics/szy-logistics?info=" + JSON.stringify(this.logInfo)
+				})
+			},
+			// 返回首页
+			goBack() {
+				uni.switchTab({
+					url: '/pages/index/index'
+				})
+			},
+			// 获取赛季信息
+			getInfo() {
+				GetEnrollInfo().then(res => {
+					if (res.code == 200) {
+						console.log(res.data)
+						// res.data.status = 1
+						// res.data.pay_status = 1
+						this.data = res.data
+						this.data.start = this.getTimes(res.data.start_time)
+						this.data.end = this.getTimes(res.data.end_time)
+						// res.data.enroll_start_time = '2023-10-15 10:30:00'
+						const a = new Date(res.data.enroll_start_time.replace(/-/g,'/')).getTime()
+						const b = new Date(res.data.enroll_end_time.replace(/-/g,'/')).getTime()
+						const now = Date.parse(new Date())
+						if (now > a && now < b &&  res.data.limit_num >  res.data.num) {
+							this.status = true
+						}
+						if (res.data.status == 1) {
+							this.showSignup = true
+						} else {
+							this.showSignup = false
+						}
+						if (res.data.pay_status) {
+							this.getAddress()
+						}
+					} else {
+						uni.showModal({
+							content: res.message || '获取失败',
+							showCancel: false
+						})
+					}
+				})
+			},
+			getAddress() {
+				GetEnrollUserAddress().then(res => {
+					if (res.code === 200) {
+						this.info = res.data
+						const data = res.data
+						this.info.local = data.province + data.city + data.area + data.address
+					} else {
+						uni.showModal({
+							content: res.message || '获取失败',
+							showCancel: false
+						})
+					}
+				})
+			},
+			getTimes(data) {
+				var time = new Date(data.replace(/-/g,'/'))
+				var year = time.getFullYear()
+				var month = time.getMonth() + 1 < 10 ? '0' + (time.getMonth() + 1) : time.getMonth() + 1;
+				var day = time.getDate() < 10 ? '0' + time.getDate() : time.getDate();
+				var today = year + '.' + month + '.' + day;
+				return today;
+			},
+			// 支付状态
+			SearchStatus() {
+				uni.showLoading({
+				    mask: true
+				})
+				_API_SearchStatus().then(res => {
+					uni.hideLoading()
+					if (res.code == 200) {
+						this.getInfo()
+					} else {
+						uni.showModal({
+							content: res.message || '获取失败',
+							showCancel: false
+						})
+					}
+				})
+			},
+			//WeixinJSBridge判断
+			wxJsPay(data, callback_succ_func, callback_error_func) {
+				if (typeof WeixinJSBridge == 'undefined') {
+					if (document.addEventListener) {
+						document.addEventListener('WeixinJSBridgeReady', this.jsApiCall, false);
+					} else if (document.attachEvent) {
+						document.attachEvent('WeixinJSBridgeReady', this.jsApiCall);
+						document.attachEvent('onWeixinJSBridgeReady', this.jsApiCall);
+					}
+				} else {
+					this.jsApiCall(data, callback_succ_func, callback_error_func);
+				}
+			},
+			//调起支付
+			jsApiCall(data, callback_succ_func, callback_error_func) {
+				let that = this
+				//使用原生的,避免初始化appid问题
+				WeixinJSBridge.invoke(
+					'getBrandWCPayRequest', {
+						appId: data.appId,
+						timeStamp: data.timestamp,
+						nonceStr: data.nonceStr,
+						package: data.package,
+						signType: data.signType,
+						paySign: data.paySign
+					},
+					function(res) {
+						var msg = res.err_msg ? res.err_msg : res.errMsg;
+						switch (msg) {
+							//支付成功时
+							case 'get_brand_wcpay_request:ok':
+								if (callback_succ_func) {
+									uni.showModal({
+										title: '支付成功',
+										showCancel: false
+									})
+									callback_succ_func(res);
+								}
+								break;
+							default:
+								//支付失败时
+								WeixinJSBridge.log('支付失败!' + msg + ',请返回重试.');
+								if (callback_error_func) {
+									callback_error_func({
+										msg: msg
+									});
+								}
+								break;
+						}
+					}
+				);
+			},
+			singup() {
+				if (!this.status && !this.data.status) {
+					return
+				}
+				let that = this
+				uni.showModal({
+					title: '提示',
+					content: '确定要获取名额吗?',
+					success: (res) => {
+						if (res.confirm) {
+							_API_payment().then(res => {
+								if (res.code == 200) {
+										that.SearchStatus()
+									} else {
+										uni.showModal({
+											title: '失败',
+											content: res.message || '获取失败',
+											showCancel: false
+										})
+										return false;
+									}
+								})
+								.catch(err => {})
+								.finally(() => {
+									setTimeout(() => {}, 3000)
+							})
+						}
+					}
+				})
+			}
+		},
+	}
+</script>
+<style>
+</style>
+<style lang="scss" scoped>
+	.top {
+		margin: 0 30rpx 0 30rpx;
+		border-radius: 16rpx;
+		background-color: #fff;
+		padding: 40rpx 20rpx 40rpx 20rpx;
+		
+	}
+	
+	.tip {
+		font-size: 36rpx;
+		text-align: center;
+		font-weight: bold;
+		margin-top: 30rpx;
+		color: #FB231F;
+	}
+	.title {
+		font-size: 34rpx;
+		font-weight: bold;
+	}
+
+	.time {
+		margin-top: 20rpx;
+		font-size: 32rpx;
+	}
+
+	.btnSig {
+		margin: 50rpx auto 0;
+		width: 600rpx;
+		line-height: 88rpx;
+		border-radius: 44rpx;
+		text-align: center;
+		color: #fff;
+		font-size: 32rpx;
+	}
+	.red {
+		background: linear-gradient(93deg, #FF232C 0%, #FF571B 100%);
+	}
+	.gray {
+		background-color: #E1E1E1;
+	}
+
+	.voucher {
+		hieght: 100vh;
+		min-height: 100vh;
+		width: 100vw;
+		position: relative;
+
+		.bgImg {
+			height: 100vh;
+			width: 100vw;
+			position: fixed;
+			top: 0;
+			left: 0;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			font-size: 46rpx;
+			font-weight: bold;
+
+			text {
+				color: #FFFFFF;
+				margin-top: 10rpx;
+			}
+
+		}
+
+		.voucher_con {
+			position: fixed;
+			height: 85%;
+			width: 100%;
+			bottom: 0;
+			left: 0;
+			background: #fff;
+			border-top-left-radius: 60rpx;
+			border-top-right-radius: 60rpx;
+
+			.line {
+				width: 128rpx;
+				height: 8rpx;
+				background: #f1f3f5;
+				margin: 36rpx auto 0;
+			}
+
+			.title {
+				color: #333;
+				font-size: 38rpx;
+				// margin: 48rpx auto 60rpx;
+				text-align: center;
+				font-weight: bold;
+			}
+
+			.voucher_icon {
+				text-align: center;
+
+				// image {
+				// 	height: 192rpx;
+				// 	width: 192rpx;
+				// 	margin-bottom: 30rpx;
+				// }
+				.success {
+					margin-top: 18rpx;
+					font-size: 48rpx;
+					color: #333;
+					font-weight: bold;
+				}
+
+				.timed {
+					margin-top: 36rpx;
+					font-size: 40rpx;
+					font-weight: bold;
+					color: #FF0000;
+				}
+			}
+
+			.logistics {
+				width: 250rpx;
+				height: 68rpx;
+				margin: 0 auto;
+				background: rgba(255, 244, 243, 0.39);
+				border: 2rpx solid #FB231F;
+				opacity: 1;
+				border-radius: 44rpx;
+				color: #FB231F;
+			}
+
+			.info {
+				margin: 68rpx 50rpx 40rpx 50rpx;
+				color: #333333;
+
+				text {
+					font-size: 32rpx;
+				}
+
+				>view {
+					margin-top: 20rpx;
+				}
+				&_btn {
+					margin: 30rpx auto 0 !important;
+					width: 388rpx;
+					line-height: 80rpx;
+					text-align: center;
+					background: #FFF4F3;
+					border: 2rpx solid #FB231F;
+					opacity: 1;
+					border-radius: 44rpx;
+					font-size: 30rpx;
+					font-weight: bold;
+					color: #FB231F;
+				}
+			}
+		}
+	}
+
+	.bottom {
+		position: fixed;
+		bottom: 0;
+		width: 100%;
+		height: 100rpx;
+		padding: 6rpx 30rpx;
+		background-color: #fff;
+		border-top: 1px solid #eeeeee;
+
+		&-btn {
+			color: #fff;
+			text-align: center;
+			font-size: 32rpx;
+			font-weight: bold;
+			line-height: 88rpx;
+			height: 88rpx;
+			background: linear-gradient(90deg, #F30000 0%, #FE4815 100%);
+			opacity: 1;
+			border-radius: 44px;
+		}
+	}
+</style>

+ 330 - 0
pages/payment-xx/payment_xx.vue

@@ -0,0 +1,330 @@
+<template>
+	<view style="padding-top: 50rpx;">
+		<view class="top" v-if="!showSignup">
+			<image src="https://qnys.chuliu.cc/daweiboshi_szy/1_1615541900_nrG1vctYn8.jpg"
+				mode="widthFix" style="width: 750rpx;margin-bottom: 60rpx;"></image>
+			<view class="title">
+				第{{ data.season }}届大卫博士创业实战营
+			</view>
+			<view class="time">
+				举办时间:{{ data.start + '-' + data.end }}
+			</view>
+			<view v-if="data.status == 1" class="btnSig gray">已获取名额</view>
+			<view v-else class="btnSig" :class="status ? 'red' : 'gray'" v-throttle="2000" @click="singup">点击获取名额</view>
+		</view>
+		<view class="voucher" v-else>
+			<image src="../../static/new_my/bg.png" class="bgImg" mode="widthFix" style="width: 750rpx;"></image>
+			<view class="bgImg">
+				<text style="margin-top: 30rpx;">第{{ data.season }}届大卫博士创业实战营</text>
+			</view>
+			<view class="voucher_con">
+				<view class="voucher_icon">
+					<image src="../../static/icon/success.png" mode="widthFix" style="width: 300rpx;margin-top: 78rpx;">
+					</image>
+					<view class="success">获取名额成功,请联系批发商</view>
+					<view class="timed">
+						举办时间:{{ data.start+ '-' +data.end }}
+					</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		_API_payment,
+		_API_SearchStatus,
+		GetEnrollInfo,
+	} from '@/apis/szy.js';
+	export default {
+		data() {
+			return {
+				status: false,
+				data: {
+					season: '',
+					start: '',
+					end: '',
+					name: '',
+					mobile: '',
+					cost: '',
+					local: ''
+				},
+				noClick: true,
+				showSignup: false,
+			}
+		},
+		onLoad() {
+			this.getInfo()
+		},
+		computed: {
+			userinfo() {
+				return this.$store.state.userinfo
+			}
+		},
+		onPullDownRefresh() {
+			this.getInfo()
+		},
+		methods: {
+			// 返回首页
+			goBack() {
+				uni.switchTab({
+					url: '/pages/index/index'
+				})
+			},
+			// 获取赛季信息
+			getInfo() {
+				GetEnrollInfo().then(res => {
+					if (res.code == 200) {
+						// res.data = {
+						// 	cost: 199,
+						// 	end: "2023.11.25",
+						// 	end_time: "2023-11-25 18:00:00",
+						// 	enroll_end_time: "2023-11-21 16:00:00",
+						// 	enroll_start_time: "2023-11-14 10:30:00", // 报名时间
+						// 	limit_num: 100000,
+						// 	num: 0,
+						// 	pay_status: 1, // 是否支付
+						// 	season: 63,
+						// 	start: "2023.10.24",
+						// 	start_time: "2023-11-24 08:00:00", // 举办时间
+						// 	status: 0 // 是否报名
+						// }
+						// res.data.enroll_start_time = "2023-11-14 10:30:00" // 报名时间
+						this.data = res.data
+						this.data.start = this.getTimes(res.data.start_time)
+						this.data.end = this.getTimes(res.data.end_time)
+						
+						const a = new Date(res.data.enroll_start_time.replace(/-/g,'/')).getTime()
+						const b = new Date(res.data.enroll_end_time.replace(/-/g,'/')).getTime()
+						const now = Date.parse(new Date())
+						if (now > a && now < b &&  res.data.limit_num >  res.data.num) {
+							this.status = true
+						}
+						if (res.data.status == 1) {
+							this.showSignup = true
+						} else {
+							this.showSignup = false
+						}
+					} else {
+						uni.showModal({
+							content: res.message || '获取失败',
+							showCancel: false
+						})
+					}
+				})
+			},
+			getTimes(data) {
+				var time = new Date(data)
+				var year = time.getFullYear()
+				var month = time.getMonth() + 1 < 10 ? '0' + (time.getMonth() + 1) : time.getMonth() + 1;
+				var day = time.getDate() < 10 ? '0' + time.getDate() : time.getDate();
+				var today = year + '.' + month + '.' + day;
+				return today;
+			},
+			// 支付状态
+			SearchStatus() {
+				uni.showLoading({
+				    mask: true
+				})
+				_API_SearchStatus().then(res => {
+					uni.hideLoading()
+					if (res.code == 200) {
+						this.getInfo()
+					} else {
+						uni.showModal({
+							content: res.message || '获取失败',
+							showCancel: false
+						})
+					}
+				})
+			},
+			singup() {
+				if (!this.status && !this.data.status) {
+					return
+				}
+				let that = this
+				uni.showModal({
+					title: '提示',
+					content: '确定要获取名额吗?',
+					success: (res) => {
+						if (res.confirm) {
+							_API_payment().then(res => {
+								if (res.code == 200) {
+										that.SearchStatus()
+									} else {
+										uni.showModal({
+											title: '失败',
+											content: res.message || '获取失败',
+											showCancel: false
+										})
+										return false;
+									}
+								})
+								.catch(err => {})
+								.finally(() => {
+									setTimeout(() => {}, 3000)
+							})
+						}
+					}
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.top {
+		margin: 0 30rpx 0 30rpx;
+		border-radius: 16rpx;
+		background-color: #fff;
+		padding: 40rpx 20rpx 40rpx 20rpx;
+	}
+
+	.title {
+		font-size: 34rpx;
+		font-weight: bold;
+	}
+
+	.time {
+		margin-top: 20rpx;
+		font-size: 32rpx;
+	}
+
+	.btnSig {
+		margin: 50rpx auto 0;
+		width: 600rpx;
+		line-height: 88rpx;
+		border-radius: 44rpx;
+		text-align: center;
+		color: #fff;
+		font-size: 32rpx;
+	}
+	.red {
+		background: linear-gradient(93deg, #FF232C 0%, #FF571B 100%);
+	}
+	.gray {
+		background-color: #E1E1E1;
+	}
+
+	.voucher {
+		hieght: 100vh;
+		min-height: 100vh;
+		width: 100vw;
+		position: relative;
+
+		.bgImg {
+			height: 100vh;
+			width: 100vw;
+			position: fixed;
+			top: 0;
+			left: 0;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			font-size: 46rpx;
+			font-weight: bold;
+
+			text {
+				color: #FFFFFF;
+				margin-top: 10rpx;
+			}
+
+		}
+
+		.voucher_con {
+			position: fixed;
+			height: 85%;
+			width: 100%;
+			bottom: 0;
+			left: 0;
+			background: #fff;
+			border-top-left-radius: 60rpx;
+			border-top-right-radius: 60rpx;
+
+			.line {
+				width: 128rpx;
+				height: 8rpx;
+				background: #f1f3f5;
+				margin: 36rpx auto 0;
+			}
+
+			.title {
+				color: #333;
+				font-size: 38rpx;
+				// margin: 48rpx auto 60rpx;
+				text-align: center;
+				font-weight: bold;
+			}
+
+			.voucher_icon {
+				text-align: center;
+
+				// image {
+				// 	height: 192rpx;
+				// 	width: 192rpx;
+				// 	margin-bottom: 30rpx;
+				// }
+				.success {
+					margin-top: 18rpx;
+					font-size: 48rpx;
+					color: #333;
+					font-weight: bold;
+				}
+
+				.timed {
+					margin-top: 36rpx;
+					font-size: 40rpx;
+					font-weight: bold;
+					color: #FF0000;
+				}
+			}
+
+			.logistics {
+				width: 250rpx;
+				height: 68rpx;
+				margin: 0 auto;
+				background: rgba(255, 244, 243, 0.39);
+				border: 2rpx solid #FB231F;
+				opacity: 1;
+				border-radius: 44rpx;
+				color: #FB231F;
+			}
+
+			.info {
+				margin: 68rpx 50rpx 40rpx 50rpx;
+				color: #333333;
+
+				text {
+					font-size: 32rpx;
+				}
+
+				>view {
+					margin-top: 20rpx;
+				}
+			}
+		}
+	}
+
+	.bottom {
+		position: fixed;
+		bottom: 0;
+		width: 100%;
+		height: 100rpx;
+		padding: 6rpx 30rpx;
+		background-color: #fff;
+		border-top: 1px solid #eeeeee;
+
+		&-btn {
+			color: #fff;
+			text-align: center;
+			font-size: 32rpx;
+			font-weight: bold;
+			line-height: 88rpx;
+			height: 88rpx;
+			background: linear-gradient(90deg, #F30000 0%, #FE4815 100%);
+			opacity: 1;
+			border-radius: 44px;
+		}
+	}
+</style>

+ 110 - 0
pages/payment-xx/singup.vue

@@ -0,0 +1,110 @@
+<template>
+	<view v-if="show">
+		<view class="top">
+			<image :src="limitState == 0? image[0] : image[1]" mode="widthFix" style="width: 450rpx;"></image>
+			<text class="text">{{ limitState == 1? '抱歉 报名失败' : '恭喜 获取报名资格' }}</text>
+		</view>
+		<view class="submit_container">
+			<view
+				@click="topayNext"
+				class="sign_up flexC"
+			>
+				下一步
+			</view>
+		</view>
+	</view>
+</template>
+<script>
+	import { _API_HuiFuCheck } from '../../apis/szy.js';
+	export default {
+		data() {
+			return {
+				image: [
+					require('../../static/icon/szySuc.png'),
+					require('../../static/icon/szyErr.png')
+				],
+				show: true,
+				limitState: 0, //是否为不报名,0报名,1排队
+				season: '',
+				id: ''
+			}
+		},
+		methods: {
+			// 查询报名信息
+			topayNext() {
+				uni.showLoading()
+				_API_HuiFuCheck().then(res => {
+					uni.hideLoading()
+					if (res.code == 200) {
+						uni.navigateTo({
+							url: './bankPay?id=' + res.data.id
+						})
+					} else if (res.code == 50014) {
+						uni.showModal({
+							title: '提示',
+							content: '检测到您还未绑定银行卡,请前往绑定',
+							showCancel: false,
+							success: (res) => {
+								if (res.confirm) {
+									uni.navigateTo({
+										url: '../zbs/form?type=2'
+									})
+								}
+							}
+						})
+						return
+					} else {
+						uni.showModal({
+							content: res.message || '获取失败',
+							showCancel: false
+						});
+						return false;
+					}
+				})
+			},
+		}
+	}
+</script>
+<style>
+	page {
+		background-color: #fff !important;
+	}
+</style>
+<style lang="scss" scoped>
+	.top {
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		background-color: #fff;
+		border-radius: 24rpx 24rpx 0px 0px;
+		margin-top: -54rpx;
+		padding-top: 30%;
+		.text {
+			font-size: 52rpx;
+			font-weight: bold;
+			color: #333;
+			margin: 20rpx 0 0 0;
+		}
+	}
+	.submit_container {
+		width: 100%;
+		position: fixed;
+		left: 0;
+		bottom: 0;
+		z-index: 9999;
+		height: 118rpx;
+		display: flex;
+		align-items: center;
+		background-color: #fff;
+		border-top: 2rpx solid #EEEEEE;
+		.sign_up {
+			width: 690rpx;
+			height: 90rpx;
+			margin: 0 auto;
+			background: linear-gradient(93deg, #FF232C 0%, #FF571B 100%);
+			font-size: 36rpx;
+			border-radius: 45rpx;
+			color: #ffffff;
+		}
+	}
+</style>

+ 1 - 1
store/modules/app.js

@@ -8,7 +8,7 @@ export default {
 		indextabbarHeight: uni.upx2px(98), // 首页 tabbar 高
 		token: uni.getStorageSync('token'),
 		// token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9hcGkuYXBwLmNsaXUuY2NcL2FwaVwvbG9naW5cL2dldF91c2VyX29wZW5pZCIsImlhdCI6MTY5ODgxNTc0OSwiZXhwIjoxNjk5Njc5NzQ5LCJuYmYiOjE2OTg4MTU3NDksImp0aSI6InRMU25oSTdmMHVOZEZFamgiLCJzdWIiOjM5NTE2LCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.9W32gsVAoq1N1P1W38SCc-H8lCqKLxUfhWwHaGWszoM',
-		// token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9hcGkuYXBwLmNsaXUuY2NcL2FwaVwvbG9naW5cL2dldF91c2VyX29wZW5pZCIsImlhdCI6MTcwMTI1NDY5NSwiZXhwIjoxNzAyMTE4Njk1LCJuYmYiOjE3MDEyNTQ2OTUsImp0aSI6IjJNbXlnNjlGdVBUSVprYkQiLCJzdWIiOjc1NjYwLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.qH90YDzqfzozW4N23DeN_ysFLs8NDOxG5P_WXJvF38g',
+		token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9hcGkuYXBwLmNsaXUuY2NcL2FwaVwvbG9naW5cL2dldF91c2VyX29wZW5pZCIsImlhdCI6MTcwMzMwMTQxNSwiZXhwIjoxNzA0MTY1NDE1LCJuYmYiOjE3MDMzMDE0MTUsImp0aSI6ImNWMXpFcVJReU9jSmxjM0QiLCJzdWIiOjc1NjYwLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.UAr-E_J-wrHLxPmNGDstJ3qDh0I3BpIidlVLOwO12Wk',
 	},
 	mutations: {
 		LOGIN(state, payload) { // 登录 保存 token