Pārlūkot izejas kodu

完成通知公告,招商专区页面开发

adminthw 4 gadi atpakaļ
vecāks
revīzija
a814bf4125

+ 38 - 0
App.vue

@@ -1,4 +1,5 @@
 <script>
+import md5 from '@/common/md5.js';
 export default {
   globalData: {
     //shareUrl: 'https://gdoctor.xazhima.com/api/v1.0/api.php', //开发环境全局接口域名 线上:https://guolu.xazhima.com/
@@ -17,6 +18,7 @@ export default {
   },
   onLaunch: function () {
     console.log("App Launch");
+	this.loginLoad();
   },
   onShow: function () {
     console.log("App Show");
@@ -24,6 +26,42 @@ export default {
   onHide: function () {
     console.log("App Hide");
   },
+  methods:{
+	  loginLoad(){
+	  	let that = this;
+	  	uni.login({
+	  		success(res) {
+	  			that.loginRequest(res.code)
+	  		}
+	  	})
+	  },
+	  loginRequest(codeRes){
+	  	let md5Sign = md5("method="+'user'+"&timestamp="+getApp().globalData.globalTimestamp+"&secret="+getApp().globalData.secret)
+	  	let url = getApp().globalData.shareUrl+'api/api.php'+'?method=user&source=user&action=login&timestamp='+getApp().globalData.globalTimestamp +'&sign='+md5Sign
+	  	uni.request({
+	  		url:url,
+	  		method: 'POST',
+	  		header: {
+	  			'content-type': 'application/x-www-form-urlencoded'
+	  		},
+	  		data: {
+	  			code:codeRes
+	  		},
+	  		success: (res) => {
+	  			console.log(res)
+	  			if(res.data.code === 200){
+	  				getApp().globalData.session_key = res.data.data.session_key;
+	  				getApp().globalData.open_id = res.data.data.openid;
+					getApp().globalData.user_status = res.data.data.status;
+					getApp().globalData.user_phone = res.data.data.phone;
+	  			}
+	  		},
+	  		fail: () => {
+	  			console.log("连接失败");
+	  		}
+	  	});
+	  },
+  }
 };
 </script>
 

+ 7 - 3
components/foot-tabs/footTabs.vue

@@ -32,6 +32,7 @@
   .hover_menu {
     display: flex;
     justify-content: space-around;
+	margin-top: 10rpx;
     .menu_icon {
       transition: all 0.5s;
       img {
@@ -75,9 +76,12 @@ export default {
       let res_src = this.check(src);
       // console.log(res_url,res_src);
       if (!(res_url && res_src) && !(res_url == false && res_src == false)) {
-        uni.navigateTo({
-          url: "/" + src,
-        });
+        // uni.redirectTo({
+        // 	 url: "/" + src,
+        // });
+		uni.navigateTo({
+			url: "/" + src,
+		});
       }
     },
     check(url) {

+ 32 - 33
pages/auth/index.vue

@@ -24,25 +24,17 @@
 			return {
 				iv:'',
 				encryptedData:'',
-				isNeedPhone:getApp().globalData.user_phone,
-			    isAuth:getApp().globalData.isAuth
+				isNeedPhone:Boolean,
+			    isAuth:Boolean
 			}
 		},
 		onLoad() {
-			this.loginLoad()
+			this.getUserInfo() 
 		},
 		methods:{
-			loginLoad(){
-				let that = this;
-				uni.login({
-					success(res) {
-						that.loginRequest(res.code)
-					}
-				})
-			},
-			loginRequest(codeRes){
+			getUserInfo(){
 				let md5Sign = md5("method="+'user'+"&timestamp="+getApp().globalData.globalTimestamp+"&secret="+getApp().globalData.secret)
-				let url = getApp().globalData.shareUrl+'api/api.php'+'?method=user&source=user&action=login&timestamp='+getApp().globalData.globalTimestamp +'&sign='+md5Sign
+				let url = getApp().globalData.shareUrl+'api/api.php'+'?method=user&action=info_by_openid&timestamp='+getApp().globalData.globalTimestamp +'&sign='+md5Sign
 				uni.request({
 					url:url,
 					method: 'POST',
@@ -50,11 +42,16 @@
 						'content-type': 'application/x-www-form-urlencoded'
 					},
 					data: {
-						code:codeRes
+							openId:getApp().globalData.open_id
 					},
 					success: (res) => {
-						console.log(res)
 						if(res.data.code === 200){
+								if(res.data.data.nickname){
+									this.isAuth = true;
+									this.isNeedPhone = false;
+								}else{
+									this.isAuth = false;
+								}
 						}
 					},
 					fail: () => {
@@ -71,11 +68,12 @@
 						this.iv = res.iv;
 						this.encryptedData = res.encryptedData;
 						this.isAuth = true;
-						getApp().globalData.isAuth = true;
-						//this.loginUserInfo()
+						getApp().globalData.isAuth = true; 
+						this.loginUserInfo()
 					},
 					fail:(err)=> {
 						getApp().globalData.isAuth = false;
+						this.isAuth = false;
 					}
 				})
 				// if (e.detail.errMsg == "getUserInfo:ok") {
@@ -93,6 +91,7 @@
 			getPhoneNumber(e){
 				let that = this;
 				 if (e.detail.errMsg == 'getPhoneNumber:ok') { //允许授权执行跳转
+				 console.log(e.detail)
 				  that.phoneRequest(e.detail.iv, e.detail.encryptedData, getApp().globalData.session_key)
 				} else { //
 				      that.isNeedPhone = false;
@@ -110,8 +109,9 @@
 					},
 					data: {
 						iv:myIv,
-						sessionKey:sKey ||'MlkY744GF9fmIqXzS4YEkw==',
+						sessionKey:sKey,
 						encryptedData:myEncryptedData,
+						openId:getApp().globalData.open_id
 					},
 					success: (res) => {
 						console.log(res)
@@ -131,32 +131,31 @@
 			},
 			loginUserInfo(){
 				let that = this;
+				let md5Sign = md5("method="+'user'+"&timestamp="+getApp().globalData.globalTimestamp+"&secret="+getApp().globalData.secret)
+				let url = getApp().globalData.shareUrl+'api/api.php'+'?method=user&source=user&action=update&timestamp='+getApp().globalData.globalTimestamp +'&sign='+md5Sign
 				uni.request({
-					url:getApp().globalData.shareUrl, //需要设置为全局
+					url:url, //需要设置为全局
 					method: 'POST',
 					header: {
 						'content-type': 'application/x-www-form-urlencoded'
 					},
 					data: {
-						method: 'auth',
-						timestamp: getApp().globalData.globalTimestamp, //Date.now()
-						id:getApp().globalData.user_id,
-						sign: md5('auth' + getApp().globalData.globalTimestamp),
+						openId:getApp().globalData.open_id,
 						nickname:getApp().globalData.user_name,
 						headimg:getApp().globalData.user_headUrl,
-						auth_status:1,
 					},
 					success: res => {
 						if(res.data.code === 200){
-							getApp().globalData.user_id = res.data.msg.id;
-							getApp().globalData.open_id = res.data.msg.openid;
-							getApp().globalData.isAuth = true;
-							getApp().globalData.user_headUrl = res.data.msg.headimg;
-							getApp().globalData.user_name = res.data.msg.name;
-							getApp().globalData.user_status = res.data.msg.status;
-							getApp().globalData.user_phone = res.data.msg.phone;
-							that.isNeedPhone = res.data.msg.phone;
-							that.isAuth = getApp().globalData.isAuth;
+							console.log(res.data)
+							// getApp().globalData.user_id = res.data.msg.id;
+							// getApp().globalData.open_id = res.data.msg.openid;
+							// getApp().globalData.isAuth = true;
+							// getApp().globalData.user_headUrl = res.data.msg.headimg;
+							// getApp().globalData.user_name = res.data.msg.name;
+							// getApp().globalData.user_status = res.data.msg.status;
+							// getApp().globalData.user_phone = res.data.msg.phone;
+							// that.isNeedPhone = res.data.msg.phone;
+							// that.isAuth = getApp().globalData.isAuth;
 						}
 						else {
 							uni.showToast({

+ 210 - 0
pages/index/index.vue

@@ -272,6 +272,7 @@
 </template>
 
 <script>
+<<<<<<< HEAD
 import md5 from "@/common/md5.js";
 export default {
   data() {
@@ -522,6 +523,215 @@ export default {
     },
   },
 };
+=======
+	import md5 from '@/common/md5.js';
+	export default {
+		data() {
+			return {
+			    swiperList:[
+					{
+						img:'/static/swiper/swiper1.jpg'
+					},
+					{
+						img:'/static/swiper/swiper2.jpg'
+					},
+				],
+				swiperCurrent:0,
+			    navList:[
+					{
+						url:'/static/navList/appeal.png',
+						path:'/pages/appeal/index',
+						content:'提诉求'
+					},
+					{
+						url:'/static/navList/policy.png',
+						path:'/pages/policy/index',
+						content:'搜政策'
+					},
+					{
+						url:'/static/navList/park.png',
+						path:'/pages/park/index',
+						content:'找园区'
+					},
+					{
+						url:'/static/navList/activity.png',
+						path:'/pages/activity/index',
+						content:'找活动'
+					},
+					{
+						url:'/static/navList/supply.png',
+						path:'/pages/supply/index',
+						content:'发供需'
+					},
+					{
+						url:'/static/navList/enterprise.png',
+						path:'/pages/enterprise/index',
+						content:'查企业'
+					},
+					{
+						url:'/static/navList/service.png',
+						path:'/pages/service/index',
+						content:'找服务'
+					},
+				],
+				noticeList:[
+					{
+						url:'/static/navList/policy-icon.png',
+						title:'政策速览 | 小微企业、个体工商户税费...',
+						time:'2021-08-05'
+					},
+					{
+						url:'/static/navList/activity-icon.png',
+						title:'活动预告 | 想了解跨境电商?8月5日带...',
+						time:'2021-08-04'
+					},
+					{
+						url:'/static/navList/notice-icon.png',
+						title:'通知公告 | 2022年首批次重点新材料扶...',
+						time:'2021-08-03'
+					},
+				],
+				parkList:[
+					// {
+					// 	url:'/static/park/1.png',
+					// 	title:'华潮科技产业园',
+					// 	time:'2015-10-25',
+					// 	num:484,
+					// 	area1:1.72,
+					// 	area2:1.01
+						
+					// },
+					// {
+					// 	url:'/static/park/1.png',
+					// 	title:'华潮科技产业园',
+					// 	time:'2015-10-25',
+					// 	num:484,
+					// 	area1:1.72,
+					// 	area2:1.01
+					// },
+					// {
+					// 	url:'/static/park/1.png',
+					// 	title:'华潮科技产业园',
+					// 	time:'2015-10-25',
+					// 	num:484,
+					// 	area1:1.72,
+					// 	area2:1.01
+					// },
+				],
+			    attractList:[
+			    	{
+			    		url:'/static/attract/1.png',
+			    		title:'工业互联网',
+						subtitle:'工业互联网是全球工业系统与高级计算、分析、...',
+			    		time:'2021-09-05'
+			    	},
+			    	{
+			    		url:'/static/attract/2.png',
+			    		title:'生产性服务业',
+						subtitle:'生产性服务业是指为保持工业生产过程的连续性...',
+			    		time:'2021-09-05'
+			    	},
+			    ],
+				activityList:[
+					{
+						url:'/static/activity/2.png',
+						title:'400场讲座,200门课程,免费送上门!就等你申请',
+						isOnline:1,
+						department:'区人力资源局', 
+						time:'2021-09-05',
+						browe:'322',
+						share:'2'
+					},
+					{
+						url:'/static/activity/1.png',
+						title:'智能制造商标品牌培育系列培训活动',
+						isOnline:0,
+						department:'市场监督管理局',
+						time:'2021-09-05',
+						browe:'322',
+						share:'2'
+					},
+				],
+			}
+		},
+		onLoad() {
+           this.getSwiperList();
+		   this.getPark();
+		//   this.loginLoad();
+		},
+		methods: {
+			swiperChange(e){
+				this.swiperCurrent = e.detail.current
+			},
+			getSwiperList(){
+				let md5Sign = md5("method="+'common'+"&timestamp="+getApp().globalData.globalTimestamp+"&secret="+getApp().globalData.secret)
+				let url = getApp().globalData.shareUrl+'api/api.php'+'?method=common&source=main_pics&action=list&timestamp='+getApp().globalData.globalTimestamp +'&sign='+md5Sign
+				uni.request({
+					url:url,
+					method: 'POST',
+					header: {
+						'content-type': 'application/x-www-form-urlencoded'
+					},
+					data: {
+						order_by:"weight desc",
+						s_status:1,
+						page:1,
+						page_size:7
+					},
+					success: (res) => {
+						console.log(res)
+						if(res.data.code === 200){
+							res.data.data.list.forEach((item)=>{item.pic_path = getApp().globalData.shareUrl + item.pic_path})
+							this.swiperList = res.data.data.list;
+					  	
+						}
+					},
+					fail: () => {
+						console.log("连接失败");
+					}
+				});
+			},
+			getPark(){
+				let md5Sign = md5("method="+'park'+"&timestamp="+getApp().globalData.globalTimestamp+"&secret="+getApp().globalData.secret)
+				let url = getApp().globalData.shareUrl+'api/api.php'+'?method=park&source=park&action=list&timestamp='+getApp().globalData.globalTimestamp +'&sign='+md5Sign
+				uni.request({
+					url:url,
+					method: 'POST',
+					header: {
+						'content-type': 'application/x-www-form-urlencoded'
+					},
+					data: {
+						order_by:"weight desc",
+						s_show:1,
+						// page:1,
+						// page_size:7
+					},
+					success: (res) => {
+						console.log(res)
+						if(res.data.code === 200){
+							res.data.data.list.forEach((item)=>{
+								if(item.park_pics.length){
+									item.park_pics[0].pic_path = getApp().globalData.shareUrl + item.park_pics[0].pic_path
+								}else {
+									item.park_pics = [{pic_path:'/static/park/1.png'}]
+								}
+								});
+							this.parkList = res.data.data.list;
+						}
+					},
+					fail: () => {
+						console.log("连接失败");
+					}
+				});
+			},
+			goParkDetailFn(id){
+				uni.navigateTo({
+					url:'/pages/park/park_deatil?id='+id
+				})
+			},
+		}
+	}
+>>>>>>> 14903aa639e80b06049d11354c85f1a3a170c287
 </script>
 
 <style>

+ 14 - 12
pages/park/index.vue

@@ -2,7 +2,8 @@
 	<view class="content">
 		
 		<view class="display-flex-start map-header-box">
-			<uni-easyinput prefixIcon="search" v-model="headerVal" placeholder="请输入园区名称搜索" @iconClick="headerSerach()" class="map-search-box"></uni-easyinput>
+			<uni-easyinput prefixIcon="search" v-model="headerVal" confirmType="search" placeholder="请输入园区名称搜索"
+			 @confirm="headerSerach()" @iconClick="headerSerach()" class="map-search-box"></uni-easyinput>
 			<!-- <view class="input-box">
 			  <image src="/static/policy/u377.png" alt="search" @click="headerSerach()"/>
 			  <input type="text" placeholder="请输入园区名称搜索" v-model="headerVal"/>
@@ -40,18 +41,18 @@
 					 <view class="park-footer-box display-between">
 						  <view class="display-between-column width-30">
 							  <view class="display-flex-start"><image src="/static/park/park-num.png" mode="aspectFill" class="park-footer-img"></image>{{item.company_count  || '-'}}</view>
-							  <view class="park-footer-font">企业数量</view>
+							  <view class="park-footer-font">入驻企业</view>
 						  </view>
 						  <view class="display-between-column width-30">
 							  <view class="display-flex-start">
 								  <image src="/static/park/park-area.png" mode="aspectFill" class="park-footer-img"></image>
-								  {{item.cover_area  || '-'}}<text style="font-size: 12rpx;">万㎡</text></view>
-							  <view class="park-footer-font">占地面积</view>
+								  {{item.cover_area  || '-'}}<text style="font-size: 16rpx;">亩</text></view>
+							  <view class="park-footer-font">占地亩数</view>
 						  </view>
 						  <view class="display-between-column width-30">
 							  <view class="display-flex-start">
 								  <image src="/static/park/park-area2.png" mode="aspectFill" class="park-footer-img"></image>
-								  {{item.building_area  || '-'}}<text style="font-size: 12rpx;">万㎡</text></view>
+								  {{item.building_area  || '-'}}<text style="font-size: 16rpx;">万㎡</text></view>
 							  <view class="park-footer-font">建设面积</view>
 						  </view>
 					 </view>
@@ -98,7 +99,7 @@
 				],
 				filterList:[
 					{
-						name:'工业厂房',
+						name:'标准厂房',
 						isSelected:false,
 						typeId:'1'
 					},
@@ -108,7 +109,7 @@
 						typeId:'2'
 					},
 					{
-						name:'商综合体',
+						name:'商综合体',
 						isSelected:false,
 						typeId:'3'
 					},
@@ -138,6 +139,7 @@
 				this.filterBoxFlag = !this.filterBoxFlag;
 			},
 			goParkDetailFn(id){
+				console.log(id)
 				uni.navigateTo({
 					url:'/pages/park/park_deatil?id='+id
 				})
@@ -258,15 +260,15 @@
 	.park-box {
 		border-radius: 32rpx;
 		position: relative;
-		height: 500rpx;
+		height: 570rpx;
 	}
 	.park-content-box {
 		width: calc(100% - 58rpx);
 		background-color: #FFFFFF;
 		border-radius: 56rpx 0px 32rpx 32rpx;
 		position: absolute;
-	    top: 250rpx;
-		font-size: 24rpx;
+	    top: 300rpx;
+		font-size: 28rpx;
 		padding: 30rpx;
 		box-shadow: 0px 2px 16px rgba(0, 0, 0, 0.1);
 	}
@@ -278,7 +280,7 @@
 	}
 	.park-address {
 		font-weight: 600;
-		font-size: 19rpx;
+		font-size: 20rpx;
 		letter-spacing: 0.02em;
 		color: #CFCFCF;
 		margin-top: 10rpx;
@@ -298,7 +300,7 @@
 	}
 	.park-footer-font {
 		color: #CFCFCF;
-		font-size: 19rpx;
+		font-size: 20rpx;
 		margin-top: 10rpx;
 	}
 	.width-30 {

+ 8 - 5
pages/park/map_search.vue

@@ -1,6 +1,6 @@
 <template>
     <view style="height: 100%;">
-		<map style="width: 100%;height: 100%;" :latitude="latitude" :longitude="longitude" :markers="covers" @markertap="markertap">
+		<map style="width: 100%;height: 100%;" :scale="scale" :latitude="latitude" :longitude="longitude" :markers="covers" @markertap="markertap">
 		</map>
 		<cover-view class="map-pop-box" v-show="isShowPop" @click="goParkDetail()">
 			<cover-view class="display-between">
@@ -27,6 +27,7 @@
 	            title: 'map',
 	            latitude: 34.438387,
 	            longitude: 108.762834,
+				scale:13,
 				isShowPop:false,
 				startList:[],
 				nowId:'',
@@ -84,8 +85,8 @@
 						},
 					});
 				}
-			   // this.covers = arrayData;
-				this.covers = arrayData.slice(0,1);
+			     this.covers = arrayData;
+				//this.covers = arrayData.slice(0,1);
 				console.log(this.covers);
 			 },
 	//地图点击事件
@@ -162,12 +163,14 @@
 		color: #0D1937;
 	}
 	.pop-subtitle{
-		font-size: 20rpx;
+		font-size: 22rpx;
 		color: #CFCFCF;
 		margin-right: 10rpx;
+		width: 20%;
 	}
 	.pop-value {
-		font-size: 20rpx;
+		font-size: 22rpx;
 		color: #0D1937;
+		white-space: break-spaces;
 	}
 </style>

+ 35 - 17
pages/park/park_deatil.vue

@@ -26,28 +26,28 @@
 				<view class="display-between-column items-center width-30 margin-bottom-20">
 					  <view class="display-flex-start">
 						  <image src="/static/park/detail/mu.png" mode="aspectFill" class="park-footer-img"></image>
-						  {{detailObj.cover_area || '-'}}<text style="font-size: 12rpx;">万亩</text>
+						  {{detailObj.cover_area || '-'}}<text style="font-size: 16rpx;">亩</text>
 					  </view>
 					  <view class="park-footer-font">占地亩数</view>
 				</view>
 				<view class="display-between-column items-center width-30 margin-bottom-20">
 					  <view class="display-flex-start">
 						  <image src="/static/park/detail/rent.png" mode="aspectFill" class="park-footer-img"></image>
-						  {{detailObj.price || '-'}}<text style="font-size: 12rpx;">元/㎡/月</text>
+						  {{detailObj.price || '-'}}<text style="font-size: 16rpx;">元/㎡/月</text>
 					  </view>
 					  <view class="park-footer-font">租赁价格</view>
 				</view>
 				<view class="display-between-column items-center width-30 margin-bottom-20">
 					  <view class="display-flex-start">
 						  <image src="/static/park/detail/area.png" mode="aspectFill" class="park-footer-img"></image>
-						  {{detailObj.building_area || '-'}}<text style="font-size: 12rpx;">万㎡</text>
+						  {{detailObj.building_area || '-'}}<text style="font-size: 16rpx;">万㎡</text>
 					  </view>
 					  <view class="park-footer-font">建设面积</view>
 				</view>
 				<view class="display-between-column items-center width-30 margin-bottom-20">
 					  <view class="display-flex-start">
 						  <image src="/static/park/detail/area1.png" mode="aspectFill" class="park-footer-img"></image>
-						  {{detailObj.area_left_industry || '-'}}<text style="font-size: 12rpx;">万㎡</text>
+						  {{detailObj.area_left_industry || '-'}}<text style="font-size: 16rpx;">万㎡</text>
 					  </view>
 					  <view class="park-footer-font">出租面积</view>
 				</view>
@@ -81,27 +81,27 @@
 				</view>
 				<view class="display-flex-start items-center margin-bottom-20">
 					<view class="width-30 margin-left-60 color-cf">物业费</view>
-					<view class="width-70">{{detailObj.service_price || '-'}}<text style="font-size: 16rpx;">元/㎡/月</text></view>
+					<view class="width-70">{{detailObj.service_price || '-'}}<text style="font-size: 20rpx;">元/㎡/月</text></view>
 				</view>
 				<view class="display-flex-start items-center margin-bottom-20">
 					<view class="width-30 margin-left-60 color-cf">电费</view>
-					<view class="width-70">{{detailObj.power_price || '-'}}<text style="font-size: 16rpx;">KW·h</text></view>
+					<view class="width-70">{{detailObj.power_price || '-'}}<text style="font-size:20rpx;">KW·h</text></view>
 				</view>
 				<view class="display-flex-start items-center margin-bottom-20">
 					<view class="width-30 margin-left-60 color-cf">水费</view>
-					<view class="width-70">{{detailObj.water_price || '-'}}<text style="font-size: 16rpx;">m³</text></view>
+					<view class="width-70">{{detailObj.water_price || '-'}}<text style="font-size: 20rpx;">元/m³</text></view>
 				</view>
 				<view class="display-flex-start items-center margin-bottom-20">
 					<view class="width-30 margin-left-60 color-cf">一层楼高</view>
-					<view  class="width-70">{{detailObj.max_height || '-'}}<text style="font-size: 16rpx;">m</text></view>
+					<view  class="width-70">{{detailObj.max_height || '-'}}<text style="font-size: 20rpx;">m</text></view>
 				</view>
 				<view  class="display-flex-start items-center margin-bottom-20">
 					<view class="width-30 margin-left-60 color-cf">最大承重</view>
-					<view  class="width-70">{{detailObj.max_weight || '-'}}<text style="font-size: 16rpx;">kg</text></view>
+					<view  class="width-70">{{detailObj.max_weight || '-'}}<text style="font-size: 20rpx;">kg</text></view>
 				</view>
 				<view class="display-flex-start items-center margin-bottom-20">
 					<view class="width-30 margin-left-60 color-cf">联系电话</view>
-					<view  class="width-70"  @click="makeCall(detailObj.tel)" style="color: #007AFF;">{{detailObj.phone}}</view>
+					<view  class="width-70"  @click="makeCall(detailObj.phone)" style="color: #007AFF;">{{detailObj.phone}}</view>
 				</view>
 				<view class="display-flex-start items-center">
 					<view class="width-30 margin-left-60 color-cf">详细地址</view>
@@ -196,14 +196,21 @@
 			}
 		},
 		onLoad(option) {
-           console.log(option)
+           console.log(option) 
 		 //  this.nowId = option.id;
 		   this.getDetailInfo(option.id)
 		},
 		methods: {
 			makeCall(tel){
+				let telStr = tel;
+				if(telStr.indexOf(';') !== -1){
+					tel = telStr.split(';')
+				}else {
+					tel = telStr.split(';')
+				}
+				console.log(tel)
 				uni.makePhoneCall({
-					phoneNumber:tel
+					phoneNumber:tel[1]
 				})
 			},
 			goTxMap(la,lo){
@@ -231,6 +238,17 @@
 					}
 				})
 			},
+			showFacilities(room,restaurant,traffic){
+				if(room && restaurant){
+					this.detailObj.facilities = room + ',' + restaurant + ',' + traffic;
+				}else if (room && !restaurant){
+					this.detailObj.facilities = room + ','  + traffic;
+				} else if(!room && restaurant){
+					this.detailObj.facilities = restaurant + ','  + traffic;
+				}else if (!room && !restaurant){
+					this.detailObj.facilities =  traffic;
+				}
+			},
 			getDetailInfo(parkId){
 				let md5Sign = md5("method="+'park'+"&timestamp="+getApp().globalData.globalTimestamp+"&secret="+getApp().globalData.secret)
 				let url = getApp().globalData.shareUrl+'api/api.php'+'?method=park&source=park&action=info_by_id&timestamp='+getApp().globalData.globalTimestamp +'&sign='+md5Sign
@@ -262,7 +280,7 @@
 							let room = this.detailObj.room == '1' ? '宿舍':'';
 							let restaurant = this.detailObj.restaurant == '1' ? '餐厅':'';
 							let traffic = this.trafficList[this.detailObj.traffic];
-							this.detailObj.facilities = room + ',' + restaurant + ',' + traffic;
+						    this.showFacilities(room,restaurant,traffic);
 						}else {
 							uni.showToast({
 								 title:res.data.msg,
@@ -306,7 +324,7 @@
 		color: #8f8f94;
 	}
 	.header-title {
-		font-size: 28rpx;
+		font-size: 30rpx;
 		font-weight: 600;
 		line-height: 36rpx;
 		letter-spacing: 0.02em;
@@ -314,7 +332,7 @@
 		margin: 20rpx 0 25rpx 10rpx;
 	}
 	.header-content-box {
-		font-size: 24rpx;
+		font-size: 28rpx;
 	}
 	.header-detail-box {
 		width: 90%;
@@ -330,7 +348,7 @@
 	}
 	.park-footer-font {
 		color: #CFCFCF;
-		font-size: 19rpx;
+		font-size: 22rpx;
 		margin-top: 10rpx;
 	}
 	.width-30 {
@@ -340,7 +358,7 @@
 		width: 70%;
 	}
 	.content-font {
-		font-size: 20rpx;
+		font-size: 24rpx;
 	}
 	.margin-left-60 {
 		margin-left: 60rpx;

+ 106 - 13
pages/selfCenter/index.vue

@@ -2,18 +2,18 @@
   <view class="content">
     <foot-tabs></foot-tabs>
     <div class="self-inf">
+		<div class="img-name-box" v-if="isAuth">
+		  <image :src="userHeadImg" alt="" class="heade-img" mode="aspectFill"></image>
+		  <p  class="nickname">{{userNickName}}</p>
+		</div>
 	   <view class="img-name-box" v-if="!isAuth">
 		   <button  @click="goAuthPage()" class="auth-btn">点击去授权</button>
 	   </view>
-      <div class="img-name-box" v-if="isAuth">
-        <image :src="userHeadImg" alt="" class="heade-img" mode="aspectFill"></image>
-        <p  class="nickname">{{userNickName}}</p>
-      </div>
       <image class="bg-img" :src="swiperBackground" mode="aspectFill"></image>
 	  <image src="../../static/Intersect.svg" class="groove-img"></image>
     </div>
     <div class="options">
-      <div v-for="(item, idx) in list" :key="idx" class="options-item">
+      <div v-for="(item, idx) in list" :key="idx" class="options-item" @click="goDetailFn(idx)">
         <div class="img-box">
           <img :src="item.icoin" alt="" class="options-item-img" /><span></span>
         </div>
@@ -34,9 +34,9 @@ export default {
   data() {
     return {
       message: "我的",
-	  isAuth:getApp().globalData.isAuth,
-	  userHeadImg:getApp().globalData.user_headUrl,
-	  userNickName:getApp().globalData.user_name,
+	  isAuth:true,
+	  userHeadImg:'',
+	  userNickName:'',
       list: [
         { icoin: "/static/selfCenter/suggest.png", name: "我的建议" },
         { icoin: "/static/selfCenter/sign.png", name: "我的报名" },
@@ -48,13 +48,15 @@ export default {
   },
   onLoad() {
 	  this.getSwiperList();
+	  
   },
   onShow() {
-  	 this.isAuth = getApp().globalData.isAuth;
-	 if(this.isAuth){
-		 this.userHeadImg = getApp().globalData.user_headUrl;
-		 this.userNickName = getApp().globalData.user_name;
-	 }
+  // 	 this.isAuth = getApp().globalData.isAuth;
+	 // if(this.isAuth){
+		//  this.userHeadImg = getApp().globalData.user_headUrl;
+		//  this.userNickName = getApp().globalData.user_name;
+	 // }
+	 this.getUserInfo()
   },
   methods: {
 	  goAuthPage(){
@@ -62,6 +64,97 @@ export default {
 		  	url:'../auth/index'
 		  })
 	  },
+	  goDetailFn(index){
+		  let that = this;
+		  switch (index){
+		  	case 0:  //我的建议
+		  		break;
+		  	case 1:  //我的报名
+		  		break;
+		  	case 2:  //我的收藏
+		  		break;
+		  	case 3:  //退出登录
+			 if(that.isAuth){
+				uni.showModal({
+					title:'确定退出登录吗?',
+					success(res) {
+						if(res.confirm){
+							that.loginOut(); 	
+						}else if (res.cancel){
+							console.log('用户点击取消');
+						}
+					}
+				})
+			 }else{
+				 uni.showToast({
+				 	title:'您还没有登录',
+					duration:2500,
+					icon:'none'
+				 })
+			 }
+		  		break;												
+		  }
+	  },
+	  loginOut(){
+		  let md5Sign = md5("method="+'user'+"&timestamp="+getApp().globalData.globalTimestamp+"&secret="+getApp().globalData.secret)
+		  let url = getApp().globalData.shareUrl+'api/api.php'+'?method=user&action=logout&timestamp='+getApp().globalData.globalTimestamp +'&sign='+md5Sign
+		  uni.request({
+		  	url:url,
+		  	method: 'POST',
+		  	header: {
+		  		'content-type': 'application/x-www-form-urlencoded'
+		  	},
+		  	data: {
+		  		openId:getApp().globalData.open_id
+		  	},
+		  	success: (res) => {
+		  		if(res.data.code === 200){
+					this.isAuth = false;
+					getApp().globalData.isAuth = false;
+					getApp().globalData.user_headUrl = '';
+					getApp().globalData.user_name = '';
+					getApp().globalData.user_phone = '';
+					uni.showToast({
+						title:'退出登录成功',
+						duration:2500,
+						icon:'none'
+					})
+		  		}
+		  	},
+		  	fail: () => {
+		  		console.log("连接失败");
+		  	}
+		  });
+	  },
+	  getUserInfo(){
+	  	let md5Sign = md5("method="+'user'+"&timestamp="+getApp().globalData.globalTimestamp+"&secret="+getApp().globalData.secret)
+	  	let url = getApp().globalData.shareUrl+'api/api.php'+'?method=user&action=info_by_openid&timestamp='+getApp().globalData.globalTimestamp +'&sign='+md5Sign
+	  	uni.request({
+	  		url:url,
+	  		method: 'POST',
+	  		header: {
+	  			'content-type': 'application/x-www-form-urlencoded'
+	  		},
+	  		data: {
+				openId:getApp().globalData.open_id
+	  		},
+	  		success: (res) => {
+	  			if(res.data.code === 200){
+					if(res.data.data.nickname){
+						this.isAuth = true;
+						this.userHeadImg = res.data.data.headimg;
+						this.userNickName = res.data.data.nickname;
+						getApp().globalData.user_phone = res.data.data.phone;
+					}else{
+						this.isAuth = false;
+					}
+	  			}
+	  		},
+	  		fail: () => {
+	  			console.log("连接失败");
+	  		}
+	  	});
+	  }, 
 	  getSwiperList(){
 	  	let md5Sign = md5("method="+'common'+"&timestamp="+getApp().globalData.globalTimestamp+"&secret="+getApp().globalData.secret)
 	  	let url = getApp().globalData.shareUrl+'api/api.php'+'?method=common&source=main_pics&action=list&timestamp='+getApp().globalData.globalTimestamp +'&sign='+md5Sign