zzp 2 years ago
parent
commit
98765f090f
4 changed files with 83 additions and 36 deletions
  1. 4 3
      config/api.js
  2. 16 3
      pages/index/index.vue
  3. 1 1
      pagesMain/openMember.vue
  4. 62 29
      pagesMain/orderList.vue

+ 4 - 3
config/api.js

@@ -1,10 +1,10 @@
 // const API_BASE = 'https://xinghuolanqiu.com/newApi'
 //const API_BASE = 'http://192.168.1.126:30000'
-//const API_BASE = 'http://192.168.1.145/newApi'
+const API_BASE = 'http://192.168.1.145/newApi'
 
 // const API_BASE = 'http://192.168.1.117:8089/'
 // const API_BASE = 'http://192.168.1.126:30000'
-const API_BASE = 'http://192.168.1.117:8089'
+// const API_BASE = 'http://192.168.1.117:8089'
 
 module.exports = {
 	//  微信授权登录
@@ -17,7 +17,8 @@ module.exports = {
 	getAddressInfo: API_BASE + '/v2/location/pointToAddress',
 	//  获取订阅模板
 	getTemplate: API_BASE + '/v2/student/myCenter/getTemplate',
-	
+	//  根据省市区code获取场馆
+	getCodeVenueList: API_BASE + '/v2/student/myCenter/getCodeVenueList',
 	
 	//  获取首页轮播图列表
 	getIndexSwiperList: API_BASE + '/v2/home/getRollAdvertisingHomeList',

+ 16 - 3
pages/index/index.vue

@@ -33,7 +33,7 @@
 					<view class="venue-name">{{item.name}}</view>
 				</view>
 				<view class="venue-content" slot="body">
-					<view class="info-text">
+					<view class="info-text" v-if="item.distance">
 						<u-icon name="car"></u-icon>
 						距您{{item.distance}}
 					</view>
@@ -144,10 +144,23 @@
 			}, 500)
 		},
 		methods: {
+			//  选择省市区
 			handleChoosePlaceClick(e) {
+				console.log(e);
 				this.locationText = e.province.label + '-' + e.city.label + '-' + e.area.label
-				const code = e.area.value
-				console.log(code);
+				const provinceCode = e.province.value + '0000'
+				const cityCode = e.city.value + '00'
+				const district = e.area.value
+				NET.request(API.getCodeVenueList, { provinceCode, cityCode, district }, 'POST').then(res => {
+					const venueData = res.data.map( item => {
+						return {
+							id: item.venueId,
+							name: item.name,
+							address: item.detailedAddress
+						}
+					})
+					this.venueList = venueData.length <= 4 ? venueData : venueData.slice(0,4)
+				})
 			},
 			//  获取初始化数据
 			initialize() {

+ 1 - 1
pagesMain/openMember.vue

@@ -50,7 +50,7 @@
 			 @click="goToSubscribelForm()">新增学员</u-button>
 		</u-popup>
 		<!-- 优惠券 -->
-		<u-popup v-model="couponShow" mode="bottom" border-radius="30" closeable>
+		<u-popup v-model="couponShow" mode="bottom" border-radius="30">
 			<scroll-view scroll-y style="height:300px;margin: 30px 0 15px 0;">
 				<template v-if="couponList.length">
 					<u-card :show-head="false" :show-foot="false" padding="0px" margin="0px 30px 20px 30px" borderRadius="40" v-for="(item, index) in couponList"

+ 62 - 29
pagesMain/orderList.vue

@@ -35,17 +35,17 @@
 		<u-modal v-model="qrCodeShow" title="二维码">
 			<u-image :src="qrCodeUrl" mode="aspectFill" height="45vw" width="45vw" style="display: flex; justify-content: center;"></u-image>
 		</u-modal>
-		<u-popup v-model="contractShow" mode="center" border-radius="30" width="600rpx" height="400px">
+		<u-popup v-model="contractShow" mode="center" border-radius="30" width="600rpx" height="500px">
 			<view class="common-title">合同列表</view>
-			<view class="menber-box">
-				<u-card :head-border-bottom="false" padding="0px" margin="10px" borderRadius="40" v-for="(item, index) in contractUrls">
-					 <view  class="card-item" slot="body">
-							 1111111111
-					 </view>
-				</u-card>
+			<view class="menber-box" style="overflow-y: auto;height:390px;">
+				<template v-for="(item, index) in contractUrls">
+					<view class="card-item" :key="index" @click="handleContractShowClick(item)">
+						{{ item.name }}
+					</view>
+				</template>
 			</view>
-			<view class="menber-box">
-				<u-button type="warning" shape="circle" :ripple="true" :custom-style="customStyle" @click="recordShow = false">确定</u-button>
+			<view class="button-box">
+				<u-button type="warning" shape="circle" :ripple="true" :custom-style="customStyle" @click="contractShow = false">确定</u-button>
 			</view>
 		</u-popup>
 		<u-top-tips ref="uTips"></u-top-tips>
@@ -61,6 +61,7 @@
 	export default {
 		computed: {
 			...mapGetters([
+				'customStyle',
 				'handleCustomStyle',
 				'handleDefaultCustomStyle',
 			])
@@ -139,20 +140,21 @@
 				});
 			},
 			//  查看合同
+			handleContractShowClick(item) {
+				uni.downloadFile({
+					url: item.url,
+					success: (res) => {
+						console.log(res);
+						uni.openDocument({
+							filePath: res.tempFilePath,
+						});
+					}
+				})
+			},
+			//  显示合同列表
 			checkContract(item) {
 				this.contractUrls = item.url
 				this.contractShow = true 
-				// uni.downloadFile({
-				// 	url: item.url,
-				// 	success: (res) => {
-				// 		uni.openDocument({
-				// 			filePath: res.tempFilePath,
-				// 		});
-				// 	}
-				// })
-				// uni.navigateTo({
-				// 	url: '/pagesMain/contractList?contractUrls=' + encodeURIComponent(JSON.stringify(item))
-				// })
 			},
 		},
 	}
@@ -204,20 +206,51 @@
 			}
 		}
 	}
+	
+	.menber-box {
+		width: 100%;
+		padding: 10px 15px;
+		
+		.menber-col {
+			width: 100%;
+			padding: 15px;
+			display: inline-block;
+			background-color: #FFFFFF;
+			border-radius: 15px;
+			box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);
+			position: relative;
+			overflow: hidden;
+			box-sizing: border-box;
+			
+			.menber-label {
+				width: 100%;
+				font-size: 14px;
+				// line-height: 20px;
+			}
+			.menber-num {
+				width: 100%;
+				font-size: 26px;
+				line-height: 28px;
+				color: $mainColor;
+			}
+		}
+	}
 	.common-title {
 		width:100%;
 		text-align: center;
 		font-size: 20px;
-		margin: 10px 0;
+		padding: 10px 0;
 	}
-	.menber-box {
-		width: 100%;
-		// float: left;
+	.button-box {
+		// width: 100%;
 		padding: 10px 15px;
-		margin-bottom: 10px;
-		
-		.card-item {
-			padding: 10px;
-		}
+		box-sizing: border-box;
+	}
+	.card-item {
+		width: 100%;
+		padding:8px;
+		border-radius: 10px;
+		background-color: #ff6e3e;
+		margin-bottom: 8px;
 	}
 </style>