hwb0 3 anni fa
parent
commit
8c25d7afb0

+ 99 - 0
components/area-picker/area-picker.vue

@@ -0,0 +1,99 @@
+<template>
+	<view>
+		<u-picker ref="uPicker" :show="areaShow" :defaultIndex="[1, 0, 0]" :columns="columns" @change="changeHandler"
+			@confirm="confirm" @cancel="cancel" keyName="areaName"></u-picker>
+	</view>
+</template>
+
+<script>
+	import $http from '@/utils/request.js'
+	export default {
+		name: "area-picker",
+		props: {
+			areaShow: {
+				type: [Boolean],
+				default: false
+			},
+		},
+		data() {
+			return {
+				columns: []
+			};
+		},
+		methods: {
+			async getArea() {
+				const picker = this.$refs.uPicker
+				let provinceRes = await $http.post('/api/v1/mp/area/listByPid', {
+					pid: 0
+				})
+				let cityRes = await $http.post('/api/v1/mp/area/listByPid', {
+					pid: provinceRes && provinceRes.data && provinceRes.data[1].areaId
+				})
+				let areaRes = await $http.post('/api/v1/mp/area/listByPid', {
+					pid: cityRes && cityRes.data && cityRes.data[0].areaId
+				})
+				picker.setColumnValues(0, provinceRes.data)
+				picker.setColumnValues(1, cityRes.data)
+				picker.setColumnValues(2, areaRes.data)
+			},
+
+			async changeHandler(e) {
+				const {
+					columnIndex,
+					index,
+					value,
+					// 微信小程序无法将picker实例传出来,只能通过ref操作
+					picker = this.$refs.uPicker
+				} = e
+				if (columnIndex === 0) {
+					let cityRes = await $http.post('/api/v1/mp/area/listByPid', {
+						pid: value && value[0].areaId
+					})
+					let areaRes = await $http.post('/api/v1/mp/area/listByPid', {
+						pid: cityRes && cityRes.data && cityRes.data[0].areaId
+					})
+					picker.setColumnValues(1, cityRes.data)
+					picker.setColumnValues(2, areaRes.data)
+				}
+				if (columnIndex === 1) {
+					let areaRes = await $http.post('/api/v1/mp/area/listByPid', {
+						pid: value && value[1].areaId
+					})
+					picker.setColumnValues(2, areaRes.data)
+				}
+
+
+			},
+
+			// 回调参数为包含columnIndex、value、values
+			confirm(e) {
+				const picker = this.$refs.uPicker
+				const {
+					value
+				} = e
+				// console.log(value);
+				let confirmObj = {
+					province: value[0].areaName,
+					provinceId: value[0].areaId,
+					city: value[1].areaName,
+					cityId: value[1].areaId,
+					area: value[2].areaName,
+					areaId: value[2].areaId,
+					cityShow: value.map(item => item.areaName).join('-')
+				}
+				this.$emit('confirmArea', confirmObj)
+			},
+
+			cancel() {
+				this.$emit('cancel')
+			},
+		},
+		mounted() {
+			this.getArea()
+		}
+	}
+</script>
+
+<style lang="scss">
+
+</style>

+ 108 - 0
components/auth/auth.vue

@@ -0,0 +1,108 @@
+<template>
+	<view>
+		<u-popup :show="authShow" mode="bottom">
+			<view class="auth-wrap">
+				<view class="tip">为了正常使用功能,请授权用户信息。</view>
+				<button :loading="authIng" @click="getInfo()" type="default">授权</button>
+			</view>
+		</u-popup>
+	</view>
+</template>
+
+<script>
+	import $http from '../../utils/request.js'
+	export default {
+		name: "auth",
+		props: {
+			authShow: {
+				type: Boolean,
+				default: true
+			},
+			authToken: {
+				type: String,
+				default: ''
+			},
+			authMobile: {
+				type: String,
+				default: ''
+			}
+		},
+		data() {
+			return {
+				authIng: false
+			};
+		},
+		methods: {
+			getInfo() {
+				let _this = this
+				if (this.authIng) {
+					return
+				}
+				_this.authIng = true
+				uni.getUserProfile({
+					desc: '用于填充用户默认信息',
+					success(info) {
+						uni.login({
+							success(res) {
+								$http.post('/api/v1/mp/user/wxauth', {
+									...{
+										identity: 1,
+										code: res.code
+									},
+									...info.userInfo
+								}).then(res => {
+									_this.authIng = false
+									if (res.code === 0) {
+										uni.$u.toast('授权成功');
+										_this.authIng = false
+										_this.$emit('close')
+									}
+								}).catch(() => {
+									_this.authIng = false
+								})
+							}
+						})
+					},
+					fail() {
+						_this.authIng = false
+					}
+				})
+			},
+
+			getBaseInfo() {
+				$http.post('/api/v1/mp/user/getLoginUserinfo', {}).then(res => {
+					if (res.code == 0) {
+						uni.setStorageSync('userInfo', res.data)
+					}
+				})
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.auth-wrap {
+		/* #ifndef MP-ALIPAY */
+		padding: 32rpx 32rpx 50rpx;
+		/* #endif */
+		/* #ifdef MP-ALIPAY */
+		padding: 32rpx 32rpx 0;
+		/* #endif */
+
+		/deep/ button {
+			line-height: 76rpx;
+			font-size: 28rpx;
+			height: 76rpx;
+			color: #fff;
+			background-color: $uni-bg-color;
+			border: none;
+			border-radius: 100rpx;
+		}
+	}
+
+	.tip {
+		padding: 50rpx 16rpx;
+		font-size: 26rpx;
+		color: #333;
+	}
+</style>

+ 223 - 0
components/pay-popup/pay-popup.vue

@@ -0,0 +1,223 @@
+<template>
+	<view>
+		<u-popup :show="payShow" mode="bottom" @close="close" :closeable="true">
+			<view class="choiceShow-wrap">
+				<view class="flex goods">
+					<view class="flex image-wrap">
+						<image :src="payInfo.picUrl" mode="aspectFill"></image>
+					</view>
+					<view class="info">
+						<view class="info-title">{{ payInfo.title }}</view>
+						<view class="info-stock">¥{{ $numberFormat( payInfo.salePrice ) }}</view>
+					</view>
+				</view>
+				<view class="flex coupon" @click="toCoupon">
+					<view class="flex coupon-left">
+						<u-icon name="coupon" size="26" color="#333"></u-icon>
+						<view class="txt">代金券</view>
+					</view>
+					<view class="flex coupon-right">
+						<view class="txt">暂无可用代金券</view>
+						<u-icon name="arrow-right" size="16" color="#333"></u-icon>
+					</view>
+				</view>
+				<view class="flex agreement">
+					<view class="txt">同意<text>《盲票购买须知》</text></view>
+					<view class="checked">
+						<u-checkbox-group>
+							<u-checkbox :value="checked" :checked="checked" shape="circle" activeColor="#E96737"
+								@change="changeChecked"></u-checkbox>
+						</u-checkbox-group>
+					</view>
+				</view>
+				<view class="flex btn">
+					<view class="flex btn-left">
+						<view class="title">应付:</view>
+						<view class="flex coin">¥{{ $numberFormat(payInfo.payAmt) }}</view>
+					</view>
+					<view class="btn-right">
+						<view class="confirm" @click="pay">立即支付</view>
+					</view>
+				</view>
+			</view>
+		</u-popup>
+	</view>
+</template>
+
+<script>
+	import $http from '@/utils/request.js'
+	export default {
+		name: "pay-popup",
+		props: {
+			payShow: {
+				type: [Boolean],
+				default: false
+			},
+			payInfo: {
+				type: [Object],
+				default: {}
+			}
+		},
+		data() {
+			return {
+				checked: false,
+				couponIds: [],
+				autoCoupon: 1,
+			};
+		},
+		methods: {
+			changeChecked(e) {
+				console.log(e);
+				this.checked = e
+			},
+
+			toCoupon() {
+				uni.navigateTo({
+					url: '/pages/coupon/index'
+				})
+			},
+
+			close() {
+				this.checked = false
+				this.$emit('close')
+			},
+			
+			pay(){
+				if(!this.checked){
+					uni.$u.toast('请同意《盲票购买须知》!');
+					return
+				}
+				$http.post('/api/v1/mp/user/ticket/order/submit', {}).then(res=>{
+					console.log(res);
+					if(res.code == 0){
+						if(res.data.needPay == 1){
+							$http.post('/api/v1/mp/user/ticket/order/pay', {
+								orderId: res.data.orderId,
+								payType: 2
+							}).then(res=>{
+								if(res.code == 0){
+									uni.$u.toast('支付成功');
+								}else{
+									uni.$u.toast('支付失败!');
+								}
+							}).catch(()=>{
+								uni.$u.toast('支付失败!');
+							})
+						} else{
+							uni.$u.toast('支付成功');
+						}
+					}
+				})
+			},
+		},
+	}
+</script>
+
+<style lang="scss" scoped>
+	.choiceShow-wrap {
+		min-height: 400rpx;
+		padding: 80rpx 0 60rpx;
+
+		.goods {
+			padding: 0 20rpx;
+			justify-content: space-between;
+			margin-bottom: 20rpx;
+
+			.image-wrap {
+				width: 220rpx;
+				height: 220rpx;
+				border: 1px solid rgba(236, 236, 236, 100);
+				border-radius: 10rpx;
+
+				image {
+					width: 174rpx;
+					height: 174rpx;
+				}
+			}
+
+			.info {
+				flex: 1;
+				display: flex;
+				height: 220rpx;
+				flex-direction: column;
+				justify-content: space-between;
+				padding-left: 26rpx;
+
+				&-title {
+					font-size: 32rpx;
+					line-height: 44rpx;
+					font-weight: bold;
+				}
+
+				&-coin {
+					display: flex;
+					align-items: center;
+					font-size: 32rpx;
+					line-height: 44rpx;
+					color: rgba(235, 112, 9, 100);
+					font-weight: bold;
+
+					image {
+						width: 42rpx;
+						height: 42rpx;
+						margin-right: 20rpx;
+					}
+				}
+
+				&-stock {
+					line-height: 44rpx;
+				}
+			}
+		}
+
+		.coupon {
+			justify-content: space-between;
+			padding: 30rpx 40rpx;
+			border-top: 1px solid rgba(187, 187, 187, 100);
+			border-bottom: 1px solid rgba(187, 187, 187, 100);
+
+			.txt {
+				margin: 0 24rpx;
+			}
+		}
+
+		.agreement {
+			justify-content: space-between;
+			padding: 50rpx 40rpx;
+			border-bottom: 1px solid rgba(187, 187, 187, 100);
+
+			.txt text {
+				color: #007aff;
+			}
+		}
+
+		.btn {
+			justify-content: space-between;
+			padding: 20rpx 20rpx;
+
+			&-left {
+				.coin {
+					display: flex;
+					align-items: center;
+					font-size: 32rpx;
+					line-height: 44rpx;
+					color: rgba(235, 112, 9, 100);
+					margin-left: 20rpx;
+				}
+			}
+
+			&-right {
+				.confirm {
+					width: 250rpx;
+					height: 60rpx;
+					line-height: 60rpx;
+					border-radius: 8px;
+					background-color: rgba(235, 112, 9, 100);
+					color: rgba(255, 255, 255, 100);
+					font-size: 28rpx;
+					text-align: center;
+				}
+			}
+		}
+	}
+</style>

+ 1 - 0
components/vear-carousel/vear-carousel.vue

@@ -32,6 +32,7 @@
 				console.log(e);
 				this.dontFirstAnimation = false
 				this.currentIndex = e.detail.current
+				this.$emit('changeTicket', this.currentIndex)
 			},
 			clickImg(item) {
 				this.$emit('selected', item, this.currentIndex)

+ 6 - 0
pages.json

@@ -33,6 +33,12 @@
 		"path": "pages/prize/detail"
 	}, {
 		"path": "pages/coupon/index"
+	}, {
+		"path": "pages/ticketBox/index"
+	}, {
+		"path": "pages/ticketBox/detail"
+	}, {
+		"path": "pages/lucky/index"
 	}],
 	"tabBar": {
 		"custom": true,

+ 3 - 9
pages/address/create.vue

@@ -1,7 +1,6 @@
 <template>
 	<view>
-		<u-navbar :title="addrId ? '编辑地址' : '添加地址'" :border="true" :placeholder="true" :autoBack="true"
-			leftIconColor="#fff" bgColor="#E96737" />
+		<u-navbar :title="addrId ? '编辑地址' : '添加地址'" :border="true" :placeholder="true" :autoBack="true" bgColor="#fff" />
 		<!-- 表单组件 -->
 		<view class="address-add">
 			<u--form labelPosition="left" ref="form" labelWidth="90">
@@ -74,7 +73,7 @@
 
 		methods: {
 			getAddrDetail() {
-				$http.post('/api/v1/mp/channel/mall/addr/query', {
+				$http.post('/api/v1/mp/user/addr/query', {
 					addrId: this.addrId
 				}).then(res => {
 
@@ -193,7 +192,7 @@
 					uni.$u.toast('请输入详细地址');
 					return
 				}
-				let url = this.addrId ? '/api/v1/mp/channel/mall/addr/update' : '/api/v1/mp/channel/mall/addr/create'
+				let url = this.addrId ? '/api/v1/mp/user/addr/update' : '/api/v1/mp/user/addr/create'
 				$http.post(url, this.form).then(res => {
 					if (res.code == 0) {
 						uni.$u.toast('保存成功');
@@ -228,11 +227,6 @@
 	}
 </script>
 
-<style lang="scss" scoped>
-	/deep/ .u-navbar__content__title.u-navbar__content__title {
-		color: #FFFFFF;
-	}
-</style>
 <style lang="scss" scoped>
 	.address-add {
 		background-color: #FFFFFF;

+ 9 - 32
pages/address/index.vue

@@ -1,7 +1,6 @@
 <template>
 	<view>
-		<u-navbar title="我的地址" :border="true" :placeholder="true" :autoBack="true" leftIconColor="#fff"
-			bgColor="#E96737" />
+		<u-navbar title="我的地址" :border="true" :placeholder="true" :autoBack="true" bgColor="#fff" />
 		<view class="addres-list">
 			<view class="address-item" v-for="(item, index) in list" :key="index">
 				<view class="contacts">
@@ -62,18 +61,12 @@
 			}
 		},
 
-		/**
-		 * 生命周期函数--监听页面加载
-		 */
 		onLoad(options) {
 			// 当前页面参数
 			this.options = options
 
 		},
 
-		/**
-		 * 生命周期函数--监听页面显示
-		 */
 		onShow() {
 			// 获取页面数据
 			this.getPageData()
@@ -94,7 +87,7 @@
 
 			// 获取收货地址列表
 			getAddressList() {
-				$http.post('/api/v1/mp/channel/mall/addr/list', {}).then(res => {
+				$http.post('/api/v1/mp/user/addr/list', {}).then(res => {
 					if (res.code == 0) {
 						this.list = res.data
 					}
@@ -103,7 +96,7 @@
 
 			// 获取默认的收货地址
 			getDefaultId() {
-				$http.post('/api/v1/mp/channel/mall/addr/queryDefault', {}).then(res => {
+				$http.post('/api/v1/mp/user/addr/queryDefault', {}).then(res => {
 					if (res.code == 0) {
 						this.defaultId = res.data.addrId
 					}
@@ -118,29 +111,21 @@
 				})
 			},
 
-			/**
-			 * 添加新地址
-			 */
+			// 添加地址
 			handleCreate() {
 				uni.navigateTo({
 					url: "/pages/address/create"
 				})
 			},
 
-			/**
-			 * 编辑地址
-			 * @param {int} addressId 收货地址ID
-			 */
+			// 编辑地址
 			handleUpdate(addressId) {
 				uni.navigateTo({
 					url: `/pages/address/create?addrId=${ addressId }`
 				})
 			},
 
-			/**
-			 * 删除收货地址
-			 * @param {int} addressId 收货地址ID
-			 */
+			// 删除地址
 			handleRemove(addressId) {
 				const _this = this
 				uni.showModal({
@@ -148,7 +133,7 @@
 					content: "您确定要删除当前收货地址吗?",
 					success(res) {
 						if (res.confirm) {
-							$http.post('/api/v1/mp/channel/mall/addr/remove', {
+							$http.post('/api/v1/mp/user/addr/remove', {
 								addrId: addressId
 							}).then(res=>{
 								if(res.code == 0){
@@ -161,12 +146,9 @@
 				});
 			},
 
-			/**
-			 * 设置为默认地址
-			 * @param {Object} addressId
-			 */
+			// 设置默认地址
 			handleSetDefault(addressId) {
-				$http.post('/api/v1/mp/channel/mall/addr/setDefault', {
+				$http.post('/api/v1/mp/user/addr/setDefault', {
 					addrId: addressId
 				}).then(res => {
 					this.getPageData()
@@ -175,11 +157,6 @@
 		}
 	}
 </script>
-<style lang="scss" scoped>
-	/deep/ .u-navbar__content__title.u-navbar__content__title {
-		color: #FFFFFF;
-	}
-</style>
 <style lang="scss" scoped>
 	.addres-list {
 		padding-bottom: calc(constant(safe-area-inset-bottom) + 120rpx);

+ 85 - 8
pages/coupon/index.vue

@@ -12,16 +12,39 @@
 						<view class="txt">适用范围:指定盲票</view>
 					</view>
 					<view class="money">
-						<view class=""><text>¥</text>10,00</view>
+						<view class="">¥<text>10</text></view>
 					</view>
 				</view>
 				<view class="checked">
-					<u-checkbox-group>
-						<u-checkbox :value="checked" :checked="checked" shape="circle" activeColor="#E96737"
-							@change="changeChecked"></u-checkbox>
-					</u-checkbox-group>
+					<view class="flex circle">
+						<view class="action" v-if="actionIndex == 0"></view>
+					</view>
 				</view>
 			</view>
+			<view class="flex coupon-list-item">
+				<view class="flex coupon-list-item-info">
+					<image src="../../static/logo.png" mode=""></image>
+					<view class="flex content">
+						<view class="txt">xx盲票代金券</view>
+						<view class="txt">使用期限:2022.03.02-2022.04.01</view>
+						<view class="txt">适用范围:指定盲票</view>
+					</view>
+					<view class="money">
+						<view class="">¥<text>10</text></view>
+					</view>
+				</view>
+				<view class="checked">
+					<view class="flex circle">
+						<view class="action" v-if="actionIndex == 1"></view>
+					</view>
+				</view>
+			</view>
+		</view>
+		
+		<view class="footer-fixed">
+			<view class="flex btn">
+				<button type="default" @click="exchange">确认</button>
+			</view>
 		</view>
 	</view>
 </template>
@@ -30,7 +53,8 @@
 	export default {
 		data() {
 			return {
-				checked: false
+				checked: false,
+				actionIndex: 0,
 			};
 		},
 		methods:{
@@ -52,19 +76,22 @@
 
 		&-list {
 			margin-top: 100rpx;
-			padding: 0 20rpx;
+			padding: 0 20rpx 100rpx;
 
 			&-item {
 				justify-content: space-between;
-				padding: 40rpx;
+				padding: 20rpx;
 				background-color: #FFFFFF;
+				margin-bottom: 20rpx;
 				
 				&-info{
 					flex: 1;
+					justify-content: flex-start;
 					
 					image{
 						width: 84rpx;
 						height: 132rpx;
+						margin-right: 20rpx;
 					}
 					
 					.content{
@@ -73,7 +100,57 @@
 						align-items: flex-start;
 						justify-content: space-between;
 					}
+					
+					.money{
+						margin-left: 10rpx;
+						font-weight: bold;
+						text{
+							font-size: 50rpx;
+						}
+					}
 				}
+				
+				.circle{
+					width: 40rpx;
+					height: 40rpx;
+					border-radius: 50%;
+					border: 1px solid;
+				}
+				
+				.action{
+					width: 30rpx;
+					height: 30rpx;
+					border-radius: 50%;
+					background-color: $uni-bg-color;
+				}
+			}
+		}
+	}
+	
+	.footer-fixed {
+		position: fixed;
+		bottom: var(--window-bottom);
+		left: 0;
+		right: 0;
+		z-index: 11;
+		box-shadow: 0 -4rpx 40rpx 0 rgba(151, 151, 151, 0.24);
+		background: #fff;
+		// 设置ios刘海屏底部横线安全区域
+		padding-bottom: constant(safe-area-inset-bottom);
+		padding-bottom: env(safe-area-inset-bottom);
+	
+		.btn {
+			padding: 20rpx 40rpx;
+	
+			/deep/ button {
+				width: 100%;
+				line-height: 60rpx;
+				font-size: 28rpx;
+				height: 60rpx;
+				color: #fff;
+				background-color: $uni-bg-color;
+				border: none;
+				border-radius: 100rpx;
 			}
 		}
 	}

+ 69 - 175
pages/index/index.vue

@@ -26,7 +26,7 @@
 				</view>
 			</view>
 			<view class="box-ticket">
-				<carousel :img-list="imgList" url-key="url" @selected="selectedBanner" />
+				<carousel :img-list="imgList" url-key="picUrl" @selected="selectedBanner" @changeTicket="getTicket" />
 			</view>
 			<view class="box-ticket-tip">100%保底必中</view>
 			<view class="box-start flex">
@@ -39,47 +39,7 @@
 		</view>
 		<custom-tab-bar :activeValue="'index'" />
 
-		<u-popup :show="payShow" mode="bottom" @close="close" :closeable="true">
-			<view class="choiceShow-wrap">
-				<view class="flex goods">
-					<view class="flex image-wrap">
-						<image src="../../static/logo.png" mode="aspectFill"></image>
-					</view>
-					<view class="info">
-						<view class="info-title">Apple iPhone 13 (A2634) 128GB 星光色 支持移动联通电信5G 双卡双待手机</view>
-						<view class="info-stock">¥10.00</view>
-					</view>
-				</view>
-				<view class="flex coupon" @click="toCoupon">
-					<view class="flex coupon-left">
-						<u-icon name="coupon" size="26" color="#333"></u-icon>
-						<view class="txt">代金券</view>
-					</view>
-					<view class="flex coupon-right">
-						<view class="txt">选择代金券</view>
-						<u-icon name="arrow-right" size="16" color="#333"></u-icon>
-					</view>
-				</view>
-				<view class="flex agreement">
-					<view class="txt">同意<text>《盲票购买须知》</text></view>
-					<view class="checked">
-						<u-checkbox-group>
-							<u-checkbox :value="checked" :checked="checked" shape="circle" activeColor="#E96737"
-								@change="changeChecked"></u-checkbox>
-						</u-checkbox-group>
-					</view>
-				</view>
-				<view class="flex btn">
-					<view class="flex btn-left">
-						<view class="title">应付:</view>
-						<view class="flex coin">¥10.00</view>
-					</view>
-					<view class="btn-right">
-						<view class="confirm">立即支付</view>
-					</view>
-				</view>
-			</view>
-		</u-popup>
+		<pay-popup :pay-show="payShow" :pay-info="payInfo" @close="close" />
 	</view>
 </template>
 
@@ -87,39 +47,66 @@
 	import env from '../../config/env.js'
 	import $http from '@/utils/request.js'
 	import CustomTabBar from '../../components/custom-tab-bar/custom-tab-bar.vue'
-	import carousel from '@/components/vear-carousel/vear-carousel'
+	import Carousel from '../../components/vear-carousel/vear-carousel'
+	import PayPopup from '../../components/pay-popup/pay-popup.vue'
 	export default {
 		components: {
 			CustomTabBar,
-			carousel
+			Carousel,
+			PayPopup
 		},
 		data() {
 			return {
-				imgList: [{
-					url: 'https://z3.ax1x.com/2021/03/05/6ehghR.jpg',
-					id: 1
-				}, {
-					url: 'https://z3.ax1x.com/2021/03/05/6ehnfI.jpg',
-					id: 2
-				}, {
-					url: 'https://z3.ax1x.com/2021/03/05/6ehfc6.jpg',
-					id: 3
-				}, {
-					url: 'https://z3.ax1x.com/2021/03/05/6efCqg.jpg',
-					id: 4
-				}, ],
+				imgList: [],
 				id: '',
 				value: 1,
 				payShow: false,
-				checked: false
+				checked: false,
+
+				pageNum: 1,
+				total: 100,
+				list: [],
+
+				currentIndex: 0,
+
+				payInfo: {}
 			};
 		},
 		onLoad(opthios) {
 			this.id = opthios.id
+			this.getList()
 		},
 		methods: {
+			getList() {
+				let data = {
+					categoryId: '',
+					tagId: '',
+					type: 'online',
+					noToken: true
+				}
+				$http.post(`/api/v1/mp/user/mall/ticket/list?pageNum=${this.pageNum}&pageSize=100`, data).then(
+					res => {
+						if (res.code == 0) {
+							res.rows.forEach(item => {
+								let picUrlArr = item.picUrl.split(',')
+								item.picUrl = env.filePublic + picUrlArr[0]
+							})
+							this.total = res.total
+							this.imgList = this.imgList.concat(res.rows)
+						}
+					})
+			},
+
 			selectedBanner(item, index) {
 				console.log('馃', item, index)
+				uni.navigateTo({
+					url: '/pages/ticketBox/detail'
+				})
+			},
+
+			getTicket(index) {
+				console.log(index);
+				this.currentIndex = index
 			},
 
 			close() {
@@ -127,18 +114,32 @@
 			},
 
 			exchange() {
-				this.payShow = true
-			},
-
-			changeChecked(e) {
-				console.log(e);
-			},
-
-			toCoupon() {
 				uni.navigateTo({
-					url: '/pages/coupon/index'
+					url: '/pages/lucky/index'
 				})
-			}
+				return
+				this.payInfo = this.imgList[this.currentIndex]
+				let data = {
+					couponIds: [],
+					autoCoupon: 1,
+					boxId: this.payInfo.boxId,
+					orderNum: 1
+				}
+				$http.post('/api/v1/mp/user/ticket/order/settle', data).then(res => {
+					console.log(res);
+					if (res.code == 0) {
+						let info = {
+							...res.data,
+							...this.payInfo
+						}
+						this.payInfo = info
+						this.payShow = true
+						console.log(info);
+					}
+				}).catch(() => {
+					uni.$u.toast('开刮失败,请重试!');
+				})
+			},
 		}
 	}
 </script>
@@ -239,111 +240,4 @@
 			}
 		}
 	}
-
-	.choiceShow-wrap {
-		min-height: 400rpx;
-		padding: 80rpx 0 60rpx;
-
-		.goods {
-			padding: 0 20rpx;
-			justify-content: space-between;
-			margin-bottom: 20rpx;
-
-			.image-wrap {
-				width: 220rpx;
-				height: 220rpx;
-				border: 1px solid rgba(236, 236, 236, 100);
-				border-radius: 10rpx;
-
-				image {
-					width: 174rpx;
-					height: 174rpx;
-				}
-			}
-
-			.info {
-				flex: 1;
-				display: flex;
-				height: 220rpx;
-				flex-direction: column;
-				justify-content: space-between;
-				padding-left: 26rpx;
-
-				&-title {
-					font-size: 32rpx;
-					line-height: 44rpx;
-					font-weight: bold;
-				}
-
-				&-coin {
-					display: flex;
-					align-items: center;
-					font-size: 32rpx;
-					line-height: 44rpx;
-					color: rgba(235, 112, 9, 100);
-					font-weight: bold;
-
-					image {
-						width: 42rpx;
-						height: 42rpx;
-						margin-right: 20rpx;
-					}
-				}
-
-				&-stock {
-					line-height: 44rpx;
-				}
-			}
-		}
-
-		.coupon {
-			justify-content: space-between;
-			padding: 30rpx 40rpx;
-			border-top: 1px solid rgba(187, 187, 187, 100);
-			border-bottom: 1px solid rgba(187, 187, 187, 100);
-
-			.txt {
-				margin: 0 24rpx;
-			}
-		}
-
-		.agreement {
-			justify-content: space-between;
-			padding: 50rpx 40rpx;
-			border-bottom: 1px solid rgba(187, 187, 187, 100);
-
-			.txt text {
-				color: #007aff;
-			}
-		}
-
-		.btn {
-			justify-content: space-between;
-			padding: 20rpx 20rpx;
-
-			&-left {
-				.coin {
-					display: flex;
-					align-items: center;
-					font-size: 32rpx;
-					line-height: 44rpx;
-					color: rgba(235, 112, 9, 100);
-					margin-left: 20rpx;
-				}
-			}
-
-			&-right {
-				.confirm {
-					width: 250rpx;
-					height: 60rpx;
-					line-height: 60rpx;
-					border-radius: 8px;
-					background-color: rgba(235, 112, 9, 100);
-					color: rgba(255, 255, 255, 100);
-					font-size: 28rpx;
-					text-align: center;
-				}
-			}
-		}
-	}
 </style>

+ 35 - 23
pages/login/index.vue

@@ -12,49 +12,61 @@
 				<button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">微信授权登录</button>
 			</view>
 		</view>
+
+		<auth :auth-show="authShow" :auth-token="token" @close="authClose" />
 	</view>
 </template>
 
 <script>
 	import $http from '@/utils/request.js'
+	import Auth from '../../components/auth/auth.vue'
 	export default {
+		components: {
+			Auth
+		},
 		data() {
 			return {
-
+				authShow: false,
+				token: '',
 			};
 		},
 		methods: {
 			getPhoneNumber(e) {
 				$http.post('/api/v1/mp/user/wxauth/mobile', {
 					code: e.detail.code,
-					identity: 2
+					identity: 1
 				}).then(res => {
-				
-				}).catch(() => {
-				
+					if (res.code == 0) {
+						uni.setStorageSync('token', res.token)
+						this.getBaseInfo()
+					}
 				})
 			},
-			getInfo() {
-				uni.getUserProfile({
-					desc: '用于填充用户默认信息',
-					success(info) {
-						uni.login({
-							success(res) {
-								$http.post('/api/v1/mp/user/wxauth', {
-									...{
-										code: res.code
-									},
-									...info.userInfo
-								}).then(res => {
 
-								}).catch(() => {
+			// 关闭授权
+			authClose() {
+				this.authShow = false
+				setTimeout(() => {
+					uni.navigateBack({
+						delta: 1
+					})
+				}, 500)
+			},
 
+			getBaseInfo() {
+				$http.post('/api/v1/mp/user/getLoginUserinfo', {}).then(res => {
+					if (res.code == 0) {
+						uni.setStorageSync('userInfo', res.data)
+						if (res.data.openId) {
+							uni.$u.toast('登录成功');
+							setTimeout(() => {
+								uni.navigateBack({
+									delta: 1
 								})
-							}
-						})
-					},
-					fail() {
-
+							}, 500)
+						} else {
+							this.authShow = true
+						}
 					}
 				})
 			},

+ 144 - 0
pages/lucky/index.vue

@@ -0,0 +1,144 @@
+<template>
+	<view>
+		<u-navbar title="幸运数字" :border="true" :placeholder="true" :autoBack="true" bgColor="#fff" />
+		<view class="lucky">
+			<view class="lucky-number">
+				<view class="flex lucky-number-circle">
+					<view class="title">幸运数字</view>
+					<view class="num" v-if="info.status == 1">?</view>
+					<view class="">{{ info.plainLuckyNum }}</view>
+				</view>
+			</view>
+			<view class="lucky-title">
+				<view class="txt">{{ info.title }}</view>
+				<view class="id">盲票序列号:{{ info.serialNo }}</view>
+			</view>
+			<view class="flex lucky-btn">
+				<view class="pay" @click="pay">支付{{ info.facePrice / 100 }}元 立即查看</view>
+			</view>
+		</view>
+		
+		<pay-popup :pay-show="payShow" :pay-info="payInfo" @close="close" />
+	</view>
+</template>
+
+<script>
+	import env from '../../config/env.js'
+	import $http from '@/utils/request.js'
+	import PayPopup from '../../components/pay-popup/pay-popup.vue'
+	export default {
+		components:{
+			PayPopup
+		},
+		data() {
+			return {
+				serialNo: '',
+				info: '',
+				payInfo: {},
+				payShow: false
+			};
+		},
+
+		onLoad(options) {
+			this.serialNo = options.id
+			this.getDetail()
+		},
+
+		methods: {
+			getDetail() {
+				$http.post('/api/v1/mp/user/ticket/queryLuckyNum', {
+					serialNo: 'T2200044-0003-0000021',
+					noToken: true
+				}).then(res => {
+					console.log(res);
+					if (res.code == 0) {
+						this.info = res.data
+					}
+				})
+			},
+			
+			close() {
+				this.payShow = false
+			},
+			
+			pay(){
+				let data = {
+					couponIds: [],
+					autoCoupon: 1,
+					boxId: this.info.boxId,
+					ticketId: this.info.ticketId,
+					orderNum: 1
+				}
+				$http.post('/api/v1/mp/user/ticket/order/settle', data).then(res => {
+					console.log(res);
+					if (res.code == 0) {
+						let info = {
+							... res.data,
+							picUrl: env.filePublic + picUrl,
+						}
+						this.payInfo = info
+						this.payShow = true
+						console.log(info);
+					}
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.lucky {
+		width: 100%;
+		height: calc(100vh - 50px);
+		background: url(https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic3.zhimg.com%2F50%2Fv2-a6f5c8b5b66fe87e4e79c1fc82a61a36_hd.jpg&refer=http%3A%2F%2Fpic3.zhimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1649658373&t=f216ee4825d5b36e62aa3a490516bfb1) center center;
+
+		&-number {
+			padding-top: 400rpx;
+			&-circle{
+				box-sizing: border-box;
+				flex-direction: column;
+				width: 336rpx;
+				height: 336rpx;
+				background-color: $uni-bg-color;
+				border-radius: 50%;
+				margin: auto;
+				
+				.title{
+					margin-bottom: 20rpx;
+				}
+				
+				.num{
+					font-size: 100rpx;
+				}
+			}
+		}
+		
+		&-title{
+			margin-top: 40rpx;
+			margin-bottom: 70rpx;
+			.txt{
+				text-align: center;
+				font-size: 36rpx;
+				font-weight: bold;
+				line-height: 50rpx;
+				margin-bottom: 8rpx;
+			}
+			.id{
+				line-height: 40rpx;
+				text-align: center;
+			}
+		}
+		
+		&-btn{
+			.pay{
+				width: 400rpx;
+				height: 60rpx;
+				line-height: 60rpx;
+				border-radius: 8rpx;
+				background-color: rgba(235, 112, 9, 100);
+				color: #FFFFFF;
+				text-align: center;
+			}
+		}
+	}
+</style>

+ 21 - 86
pages/order/settlement.vue

@@ -81,15 +81,18 @@
 			</view>
 		</view>
 
-		<u-picker ref="uPicker" :show="show" :columns="columns" @change="changeHandler" @confirm="confirm"
-			@cancel="cancel" keyName="areaName"></u-picker>
+		<area-picker :area-show="areaShow" @cancel="cancel" @confirmArea="confirmArea" />
 	</view>
 </template>
 
 <script>
 	import env from '../../config/env.js'
 	import $http from '@/utils/request.js'
+	import AreaPicker from '../../components/area-picker/area-picker.vue'
 	export default {
+		components:{
+			AreaPicker
+		},
 		data() {
 			return {
 				ids: [],
@@ -111,12 +114,7 @@
 					areaId: '', // 区ID/编码
 					area: '', // 区
 				},
-				show: false,
-				columns: [
-					[],
-					[],
-					[]
-				],
+				areaShow: false,
 				toAddressShow: false,
 			}
 		},
@@ -195,79 +193,26 @@
 					}
 				})
 			},
-
-			async getArea() {
-				const picker = this.$refs.uPicker
-
-				let provinceRes = await $http.post('/api/v1/mp/area/listByPid', {
-					pid: 0
-				})
-
-				let cityRes = await $http.post('/api/v1/mp/area/listByPid', {
-					pid: provinceRes && provinceRes.data && provinceRes.data[0].areaId
-				})
-				let areaRes = await $http.post('/api/v1/mp/area/listByPid', {
-					pid: cityRes && cityRes.data && cityRes.data[0].areaId
-				})
-				picker.setColumnValues(0, provinceRes.data)
-				picker.setColumnValues(1, cityRes.data)
-				picker.setColumnValues(2, areaRes.data)
-
-			},
+			
 			selectArea() {
-				this.getArea()
-				this.show = true
-			},
-
-			async changeHandler(e) {
-				const {
-					columnIndex,
-					index,
-					value,
-					// 微信小程序无法将picker实例传出来,只能通过ref操作
-					picker = this.$refs.uPicker
-				} = e
-				if (columnIndex === 0) {
-					let cityRes = await $http.post('/api/v1/mp/area/listByPid', {
-						pid: value && value[0].areaId
-					})
-					let areaRes = await $http.post('/api/v1/mp/area/listByPid', {
-						pid: cityRes && cityRes.data && cityRes.data[0].areaId
-					})
-					picker.setColumnValues(1, cityRes.data)
-					picker.setColumnValues(2, areaRes.data)
-				}
-				if (columnIndex === 1) {
-					let areaRes = await $http.post('/api/v1/mp/area/listByPid', {
-						pid: value && value[1].areaId
-					})
-					picker.setColumnValues(2, areaRes.data)
-				}
-
-
+				this.areaShow = true
 			},
-			// 回调参数为包含columnIndex、value、values
-			confirm(e) {
-				const picker = this.$refs.uPicker
-				const {
-					value
-				} = e
-				this.form.province = value[0].areaName
-				this.form.provinceId = value[0].areaId
-				this.form.city = value[1].areaName
-				this.form.cityId = value[1].areaId
-				this.form.area = value[2].areaName
-				this.form.areaId = value[2].areaId
-				this.form.cityShow = value.map(item => item.areaName).join('-')
-				this.show = false
-				picker.setColumnValues(0, [])
-				picker.setColumnValues(1, [])
-				picker.setColumnValues(2, [])
+			
+			confirmArea(obj){
+				// console.log(obj);
+				this.form.province = obj.province
+				this.form.provinceId = obj.provinceId
+				this.form.city = obj.city
+				this.form.cityId = obj.cityId
+				this.form.area = obj.area
+				this.form.areaId = obj.areaId
+				this.form.cityShow = obj.cityShow
+				this.areaShow = false
 			},
+			
 			cancel() {
-				this.show = false
+				this.areaShow = false
 			},
-
 			toAddress() {
 				this.toAddressShow = true
 				uni.navigateTo({
@@ -276,16 +221,6 @@
 			},
 
 			saveAddress() {
-				// receiver: '',
-				// mobile: '',
-				// city: '',
-				// addr: '',
-				// privinceId: '', // 省ID/编码
-				// privince: '', // 省
-				// cityId: '', // 市ID/编码
-				// city: '', // 市
-				// areaId: '', // 区ID/编码
-				// area: '', // 区
 				let _this = this
 				if (!_this.form.receiver) {
 					uni.$u.toast('请输入收货人');

+ 38 - 30
pages/prize/index.vue

@@ -81,7 +81,7 @@
 				</navigator>
 			</view>
 		</view>
-		
+
 		<view class="prize-action">
 			<!-- 实物商品提货 -->
 			<view class="flex prize-action-goods" v-if="state == 0">
@@ -91,7 +91,7 @@
 							@change="changeChecked($event, item)"></u-checkbox>
 					</u-checkbox-group>
 				</view>
-				<view class="btn">立即提货</view>
+				<view class="btn" @click="toSettlement">立即提货</view>
 			</view>
 			<!-- 卡券使用记录 -->
 			<view class="flex prize-action-coupon" @click="toCoupon" v-else>
@@ -129,11 +129,17 @@
 			changeChecked() {
 
 			},
-			
+
 			// 查看卡券使用记录
-			toCoupon(){
+			toCoupon() {
 				uni.navigateTo({
-					url:'/pages/prize/coupon'
+					url: '/pages/prize/coupon'
+				})
+			},
+
+			toSettlement() {
+				uni.navigateTo({
+					url: "/pages/order/settlement"
 				})
 			},
 		}
@@ -154,7 +160,7 @@
 		padding: 40rpx 30rpx 100rpx;
 
 		&-list {
-			
+
 			&-item {
 				justify-content: space-between;
 				padding: 36rpx 16rpx;
@@ -206,53 +212,53 @@
 	.prize-coupon {
 		margin-top: 104rpx;
 		padding: 40rpx 30rpx 100rpx;
-		
-		&-list{
-			
-			&-item{
+
+		&-list {
+
+			&-item {
 				justify-content: space-between;
 				background-color: #FFFFFF;
 				padding: 40rpx 20rpx;
 				border-radius: 10rpx;
 				margin-bottom: 40rpx;
-			
-				image{
+
+				image {
 					width: 94rpx;
 					height: 132rpx;
 				}
-				
-				.info{
+
+				.info {
 					justify-content: space-between;
 					flex: 1;
 				}
-				
-				.desc{
+
+				.desc {
 					height: 132rpx;
 					flex-direction: column;
 					justify-content: space-between;
 					align-items: flex-start;
 					padding-left: 20rpx;
 				}
-				
-				.txt{
+
+				.txt {
 					font-size: 24rpx;
 				}
-				
-				.btn{
+
+				.btn {
 					flex-direction: column;
 				}
-				
-				.amt{
+
+				.amt {
 					font-size: 48rpx;
 					font-weight: bold;
 					line-height: 72rpx;
 				}
-				
-				text{
+
+				text {
 					font-size: 24rpx;
 				}
-				
-				.action{
+
+				.action {
 					width: 124rpx;
 					height: 40rpx;
 					line-height: 40rpx;
@@ -263,7 +269,8 @@
 					text-align: center
 				}
 			}
-			&-item:last-child{
+
+			&-item:last-child {
 				margin-bottom: 0;
 			}
 		}
@@ -298,10 +305,11 @@
 				text-align: center;
 			}
 		}
-		
-		&-coupon{
+
+		&-coupon {
 			padding: 30rpx 40rpx;
-			.title{
+
+			.title {
 				margin-right: 20rpx;
 				line-height: 40rpx;
 			}

+ 296 - 0
pages/ticketBox/detail.vue

@@ -0,0 +1,296 @@
+<template>
+	<view>
+		<u-navbar :placeholder="true" bgColor="#fff" :autoBack="true" :border="true" title="盲票详情"></u-navbar>
+		<view class="detail">
+			<view class="detail-top">
+				<u-swiper :list="picUrlArr" height="320" :indicator="true" :circular="true"></u-swiper>
+			</view>
+			<view class="flex detail-info">
+				<view class="detail-info__left">
+					<text class="title">{{ info.title }}</text>
+					<view class="flex num">
+						<u-icon name="gift" size="25" color="#EB7009"></u-icon>
+						<text>100%抽中,商品价值10元-10万元</text>
+					</view>
+					<view class="tip">图片仅供参考,请以实物为准</view>
+				</view>
+				<view class="detail-info__right">
+					<text class="money">¥{{ $numberFormat(info.pkgSalePrice) }}</text>
+					<text>销量 {{ info.saleQty }}</text>
+				</view>
+			</view>
+			<view class="detail-goods">
+				<view class="detail-goods-title">可获得商品</view>
+				<view class="detail-goods-list">
+					<view class="detail-goods-list-item" v-for="(item, index) in prizeList" :key="index">
+						<view class="detail-goods-list-item__value">
+							<view class="flex image-wrap">
+								<image :src="item.picUrl" mode="scaleToFill"></image>
+							</view>
+							<view class="info">
+								<text>{{ item.title }}</text>
+								<text>价值:¥{{ $numberFormat(item.value) }}</text>
+								<text>概率:{{ item.hitRate }}%</text>
+							</view>
+							<view class="name">{{ item.name }}</view>
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="footer-fixed">
+			<view class="flex btn">
+				<button type="default" @click="exchange">10元 立即开刮</button>
+			</view>
+		</view>
+		
+		<pay-popup :pay-show="payShow" @close="close" />
+	</view>
+</template>
+
+<script>
+	import env from '../../config/env.js'
+	import $http from '@/utils/request.js'
+	import PayPopup from '../../components/pay-popup/pay-popup.vue'
+	export default {
+		components: {
+			PayPopup
+		},
+		data() {
+			return {
+				boxId: '',
+				picUrlArr: ['https://z3.ax1x.com/2021/03/05/6ehghR.jpg', 'https://z3.ax1x.com/2021/03/05/6ehghR.jpg'],
+				info: {
+					title: '测试11',
+					saleCommRate: 12,
+					pkgSalePrice: 12,
+					saleQty: 1234,
+					pkgUnit: 123,
+					facePrice: 1234,
+					
+				},
+				prizeList: [{
+					title: '测试1',
+					value: 1000,
+					picUrl: 'https://z3.ax1x.com/2021/03/05/6ehghR.jpg',
+					hitRate: 0.11,
+					name: '测试一'
+				}],
+				
+				payShow: false,
+			};
+		},
+		onLoad(opthios) {
+			// this.getDetail(opthios.boxId)
+		},
+		methods: {
+			getDetail(id) {
+				$http.post('/api/v1/mp/channel/mall/ticket/detail', {
+					boxId: id
+				}).then(res => {
+					if (res.code == 0) {
+						this.info = res.data
+						let picUrlArr = res.data.picUrl.split(',')
+						picUrlArr.forEach(item => {
+							this.picUrlArr.push(env.filePublic + item)
+						})
+
+						let prizeList = res.data.prizeList
+
+						prizeList.forEach(item => {
+							item.picUrl = env.filePublic + item.picUrl
+						})
+
+						this.prizeList = prizeList
+					}
+				})
+			},
+
+			close() {
+				this.payShow = false
+			},
+			
+			exchange() {
+				this.payShow = true
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.detail {
+		padding-bottom: 100rpx;
+
+		&-top {
+			margin-bottom: 20rpx;
+		}
+
+		&-info {
+			justify-content: space-between;
+			box-sizing: border-box;
+			padding: 24rpx 16rpx;
+			background-color: #fff;
+			margin: 10rpx 10rpx 20rpx;
+			border-radius: 10rpx;
+
+			&__left {
+				display: flex;
+				flex-direction: column;
+				justify-content: space-between;
+
+				text {
+					line-height: 24rpx;
+					display: inline-block;
+				}
+
+				.title {
+					color: rgba(16, 16, 16, 100);
+					font-size: 32rpx;
+					line-height: 32rpx;
+					font-weight: bold;
+				}
+
+				.num {
+					color: $uni-text-color;
+					font-size: 28rpx;
+					justify-content: flex-start;
+					margin: 20rpx 0;
+				}
+				
+				.tip{
+					font-size: 24rpx;
+				}
+			}
+
+			&__right {
+				display: flex;
+				flex-direction: column;
+				align-items: flex-end;
+				justify-content: space-between;
+				height: 162rpx;
+
+				text {
+					color: rgba(157, 157, 157, 100);
+					font-size: 14px;
+				}
+
+				.money {
+					font-size: 40rpx;
+					font-weight: bold;
+					line-height: 40rpx;
+					font-weight: bold;
+					color: $uni-text-color;
+					margin-bottom: 40rpx;
+				}
+			}
+		}
+
+		&-sku {
+			background-color: #fff;
+			border-radius: 10rpx;
+			margin: 10rpx 10rpx 20rpx;
+
+			&-title {
+				padding: 24rpx 16rpx 12rpx;
+			}
+
+			&-item {
+				padding-bottom: 10rpx;
+
+				view {
+					padding-left: 50rpx;
+					line-height: 50rpx;
+				}
+			}
+		}
+
+		&-goods {
+			margin: 10rpx 10rpx 20rpx;
+
+			&-title {
+				margin-bottom: 20rpx;
+			}
+
+			&-list {
+				background-color: #FFFFFF;
+
+				&-item {
+					position: relative;
+					margin: 16rpx 0;
+					border-bottom: 1px solid rgba(236, 236, 236, 100);
+
+					&__value {
+						display: flex;
+					}
+
+					.image-wrap {
+						width: 250rpx;
+						height: 250rpx;
+						margin-right: 30rpx;
+
+						image {
+							width: 180rpx;
+							height: 120rpx;
+						}
+					}
+
+					.name {
+						position: absolute;
+						line-height: 28rpx;
+						padding: 6rpx 20rpx;
+						background-color: $uni-bg-color;
+					}
+
+					.info {
+						display: flex;
+						flex-direction: column;
+						font-size: 24rpx;
+
+						text {
+							margin-bottom: 10rpx;
+						}
+
+						text:first-child {
+							font-size: 28rpx;
+							margin-top: 24rpx;
+							margin-bottom: 55rpx;
+							font-weight: bold;
+						}
+					}
+				}
+
+				&-item:last-child {
+					border: none;
+				}
+			}
+		}
+	}
+
+	.footer-fixed {
+		position: fixed;
+		bottom: var(--window-bottom);
+		left: 0;
+		right: 0;
+		z-index: 11;
+		box-shadow: 0 -4rpx 40rpx 0 rgba(151, 151, 151, 0.24);
+		background: #fff;
+		// 设置ios刘海屏底部横线安全区域
+		padding-bottom: constant(safe-area-inset-bottom);
+		padding-bottom: env(safe-area-inset-bottom);
+
+		.btn {
+			padding: 20rpx 40rpx;
+
+			/deep/ button {
+				width: 100%;
+				line-height: 60rpx;
+				font-size: 28rpx;
+				height: 60rpx;
+				color: #fff;
+				background-color: $uni-bg-color;
+				border: none;
+				border-radius: 100rpx;
+			}
+		}
+	}
+</style>

+ 19 - 0
pages/ticketBox/index.vue

@@ -0,0 +1,19 @@
+<template>
+	<view>
+		<u-navbar :placeholder="true" bgColor="#fff" :autoBack="true" :border="true" title="盲票列表"></u-navbar>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				
+			};
+		}
+	}
+</script>
+
+<style lang="scss">
+
+</style>

+ 63 - 13
pages/user/index.vue

@@ -7,11 +7,12 @@
 		<!-- 账户信息 -->
 		<view class="account">
 			<view class="flex account-ava">
-				<image src="../../static/logo.png" mode=""></image>
-				<view class="account-ava-name" v-if="loginState">寒露</view>
-				<view class="account-ava-no" @click="toLogin">登录</view>
+				<image :src="avatar" mode="aspectFill" v-if="loginState"></image>
+				<image src="../../static/logo.png" mode="aspectFill" v-else></image>
+				<view class="account-ava-name" v-if="loginState">{{ userInfo.nickName }}</view>
+				<view class="account-ava-no" @click="toLogin" v-else>登录</view>
 			</view>
-			<view class="flex account-info">
+			<view class="flex account-info" v-if="loginState">
 				<navigator url="/pages/prize/index" class="flex account-info-item" hover-class="navigator-hover">
 					<view>7</view>
 					<view>我的奖品库</view>
@@ -25,12 +26,26 @@
 					<view>我的盲豆</view>
 				</navigator>
 			</view>
+			<view class="flex account-info" v-else @click="notLogin">
+				<view class="flex account-info-item">
+					<view>-</view>
+					<view>我的奖品库</view>
+				</view>
+				<view class="flex account-info-item">
+					<view>-</view>
+					<view>我的盲票包</view>
+				</view>
+				<view class="flex account-info-item">
+					<view>-</view>
+					<view>我的盲豆</view>
+				</view>
+			</view>
 		</view>
 		<!-- 操作项 -->
 		<view class="action">
 			<u-cell-group :border="false">
-				<u-cell icon="order" title="我的订单" :isLink="true" :url="'/pages/order/index'"></u-cell>
-				<u-cell icon="map" title="我的地址" :isLink="true" :url="'/pages/address/index'"></u-cell>
+				<u-cell icon="order" title="我的订单" :isLink="true" @click="toOrder"></u-cell>
+				<u-cell icon="map" title="我的地址" :isLink="true" @click="toAddress"></u-cell>
 				<u-cell icon="kefu-ermai" title="联系客服" :isLink="true"></u-cell>
 				<u-cell icon="info-circle" title="关于我们" :border="false" :isLink="true" :url="'/pages/about/index'">
 				</u-cell>
@@ -41,6 +56,7 @@
 		</view>
 
 		<custom-tab-bar :activeValue="'user'" />
+		
 	</view>
 </template>
 
@@ -48,22 +64,28 @@
 	import env from '../../config/env.js'
 	import $http from '@/utils/request.js'
 	import CustomTabBar from '../../components/custom-tab-bar/custom-tab-bar.vue'
+	import Auth from '../../components/auth/auth.vue'
 	export default {
 		components: {
 			CustomTabBar,
+			Auth
 		},
 		data() {
 			return {
 				loginState: false, // 判断是否登录
+				authState: false,
 				userInfo: {}, //
 				avatar: '',
 				certifyStatus: {},
 				info: {},
+				authShow: false,
 			};
 		},
 
 		onShow() {
 			this.loginState = uni.getStorageSync('token') ? true : false
+			this.userInfo = uni.getStorageSync('userInfo')
+			this.avatar = env.filePublic + this.userInfo.avatar
 		},
 
 		methods: {
@@ -73,21 +95,49 @@
 					url: "/pages/login/index"
 				})
 			},
+			
+			// 我的订单
+			toOrder(){
+				if(!this.loginState){
+					uni.$u.toast('请登录!');
+					return
+				}
+				uni.navigateTo({
+					url:'/pages/order/index'
+				})
+			},
+			
+			// 我的地址
+			toAddress(){
+				if(!this.loginState){
+					uni.$u.toast('请登录!');
+					return
+				}
+				uni.navigateTo({
+					url:'/pages/address/index'
+				})
+			},
+			
+			// 没有登录
+			notLogin(){
+				uni.$u.toast('请登录!');
+			},
 
 			// 注销登录
 			logout() {
+				let _this = this
+				if(!this.loginState){
+					uni.$u.toast('已注销登录!');
+					return
+				}
 				uni.showModal({
 					title: '注销登录',
 					content: '确定要注销登录吗?',
 					success(res) {
 						if (res.confirm) {
-							uni.clearStorage({
-								success: () => {
-									wx.reLaunch({
-										url: '/pages/login/entry',
-									})
-								}
-							})
+							uni.clearStorage()
+							_this.loginState = false
+							_this.authState = false
 						}
 					}
 				})

+ 16 - 8
utils/request.js

@@ -20,7 +20,7 @@ const $http = (url, data, methods) => {
 			url: getSignUrl(url, data, timestamp),
 			header: {
 				'Content-Type': 'application/json;charset=utf-8',
-				'Authorization': uni.getStorageSync('token') ?
+				'Authorization': uni.getStorageSync('token') && !data.noToken ?
 					`Bearer ${uni.getStorageSync('token')}` : '',
 				'x-zz-timestamp': timestamp
 			},
@@ -29,14 +29,22 @@ const $http = (url, data, methods) => {
 
 			success: res => {
 				if (res.data && res.data.code === 401) {
-					uni.showToast({
-						title: res.data.msg || '授权过期,请重新登录。',
-						icon: 'none',
-						duration: 2000
-					})
+					// uni.showToast({
+					// 	title: res.data.msg || '授权过期,请重新登录。',
+					// 	icon: 'none',
+					// 	duration: 2000
+					// })
 					uni.removeStorageSync('token')
-					uni.redirectTo({
-						url: '/pages/login/entry',
+					uni.showModal({
+						title: '提示',
+						content: '登录身份已过期,请重新登录!',
+						success(res) {
+							if (res.confirm) {
+								uni.navigateTo({
+									url: "/pages/login/index"
+								})
+							}
+						}
 					})
 				} else if (res.data && res.data.code !== 0 && res.data.code !== 1016) {
 					uni.showToast({