Browse Source

处理冲突

zhangli 2 years ago
parent
commit
d710b643aa
5 changed files with 95 additions and 9 deletions
  1. 3 1
      config/api.js
  2. 1 1
      pages.json
  3. 16 3
      pages/index/index.vue
  4. 5 3
      pagesMain/openMember.vue
  5. 70 1
      pagesMain/orderList.vue

+ 3 - 1
config/api.js

@@ -1,6 +1,7 @@
 // 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.109/newApi'
 // const API_BASE = 'http://192.168.1.117:8089/'
 // const API_BASE = 'http://192.168.1.126:30000'
@@ -17,7 +18,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',

+ 1 - 1
pages.json

@@ -80,7 +80,7 @@
 			"style": {
 				"navigationBarTitleText": "我的订单"
 			}
-		}, {
+		},{
 			"path": "studentList",
 			"style": {
 				"navigationBarTitleText": "我的学员"

+ 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() {

+ 5 - 3
pagesMain/openMember.vue

@@ -29,9 +29,9 @@
 			<u-form-item label="家长名称" required>
 				<u-input v-model="form.parentName" placeholder="请输入家长姓名" />
 			</u-form-item>
-			<u-form-item label="家长性别" prop="sex" required right-icon="arrow-right" @click.native="sexShow = true">
+	<!-- 		<u-form-item label="家长性别" prop="sex" required right-icon="arrow-right" @click.native="sexShow = true">
 				<text>{{form.sex}}</text>
-			</u-form-item>
+			</u-form-item> -->
 		</u-form>
 		<view class="handle-fix-box">
 			<u-button type="warning" shape="circle" :ripple="true" :custom-style="customStyle" @click="toPay()">确定支付¥{{ discountsAmount ? getRealPrice : realPayAmount }}</u-button>
@@ -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"
@@ -287,9 +287,11 @@
 			},
 			// 选择学员
 			selectStudent(item) {
+				console.log(item);
 				this.studentId = item.studentId
 				this.studentName = item.studentName
 				this.studentShow = false
+				this.form.sex = item.sex
 				// this.couponId = ''
 				// this.getMemberInfo(1)
 				this.getCouponList()

+ 70 - 1
pagesMain/orderList.vue

@@ -35,6 +35,19 @@
 		<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="500px">
+			<view class="common-title">合同列表</view>
+			<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="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>
 	</view>
 </template>
@@ -48,6 +61,7 @@
 	export default {
 		computed: {
 			...mapGetters([
+				'customStyle',
 				'handleCustomStyle',
 				'handleDefaultCustomStyle',
 			])
@@ -56,6 +70,8 @@
 			return {
 				qrCodeShow: false,
 				qrCodeUrl: '',
+				contractShow: false,
+				contractUrls: [],
 				triggered: false,
 				isOver: false,
 				pageIndex: 1,
@@ -124,16 +140,22 @@
 				});
 			},
 			//  查看合同
-			checkContract(item) {
+			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 
+			},
 		},
 	}
 </script>
@@ -184,4 +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;
+		padding: 10px 0;
+	}
+	.button-box {
+		// width: 100%;
+		padding: 10px 15px;
+		box-sizing: border-box;
+	}
+	.card-item {
+		width: 100%;
+		padding:8px;
+		border-radius: 10px;
+		background-color: #ff6e3e;
+		margin-bottom: 8px;
+	}
 </style>