index.vue 8.64 KB
<template>
	<view class="page">
		<view class="uni-margin-wrap">
			<!-- 			<view class="logobox">
				<image class="logo" :src="venue.venueLogo"></image>
				<text>{{venue.venueName}}</text>
			</view> -->

			<swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
				:duration="duration" indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff">
<!-- 				<swiper-item v-for="(p, index) in venue.venuePicArr" :key="index">
					<view class="swiper-item">
						<image mode="aspectFill" :src="p"></image>
					</view>
				</swiper-item> -->
				<swiper-item>
					<view class="swiper-item">
						<image mode="aspectFill" src="/static/fm.jpg"></image>
					</view>
				</swiper-item>
			</swiper>
		</view>
		<view class="infoArea">

			
			
			<view class="contentbox">
				<view class="name">
					国电培训中心简介
					<!-- <view class="content" v-html="venue.introdution"> -->
					<view class="content" style="margin-top: 20rpx;">
						国网江苏省电力公司营销技能培训中心办公室地址位于传统的江南文化、鱼米之乡盐城,盐城 盐城市大庆东路66号,于2008年10月30日在盐城市工商行政管理局注册成立,注册资本为400万元人民币,在公司发展壮大的15年里,我们始终为客户提供好的产品和技术支持、健全的售后服务,我公司主要经营住宿服务;电力人才交流、培训、信息服务。,我们有好的产品和专业的销售和技术团队,我公司属于盐城电力供应业黄页行业,如果您对我公司的产品服务有兴趣,期待您在线留言或者来电咨询
					</view>
				</view>
				<view class="n9" @click="makeCall">
					联系电话:{{ venue.venueTelno||'0515-66886668' }}
					<image style="position: relative;top: 18rpx;" class="phoneIcon" src="/static/phone.png"></image>
				</view>
				<view class="mapshow" @click="gogo">
					<map class="map" id="map" ref="map" :scale="scale" :longitude="longitude" :latitude="latitude"
						layer-style="1"></map>

					<image class="bg" src="/static/ditu@2x.png"></image>

					<view class="addressBox">
						<view class="adtext">
							<text>{{ venue.venueAddress || '盐城市城南新区新园路29号'}}</text>
							<image class="goicon" src="/static/navigation.png"></image>

						</view>
					</view>
				</view>
			</view>
			<view class="contentbox" style="padding: 0;">
					<view class="content">
						<uni-grid :column="3" :highlight="true" :showBorder="false">
							<uni-grid-item v-for="(item, index) in list" :index="index" :key="index">
								<view class="grid-item-box" @click="goItem(item)">
									<image :src="item.partLogo" class="image" mode="aspectFill" />
									<text class="text">{{ item.name }}</text>
								</view>
							</uni-grid-item>
						</uni-grid>
					</view>
				</view>
			
			<view class="contentbox" v-if="venue.notice">
				<view class="t">培训公告</view>
				<rich-text class="richText" :nodes="venue.notice"></rich-text>
			</view>
		</view>

	</view>
</template>

<script setup>
	import * as api from '@/common/api.js';
	import * as loginServer from '@/common/login.js';
	import {
		showLogin
	} from '@/common/login.js';
	import {
		onLoad,
		onShow,
		onReady,
		onShareAppMessage,
		onShareTimeline,
		onPullDownRefresh
	} from '@dcloudio/uni-app';
	import {
		ref,
		getCurrentInstance,
		nextTick
	} from 'vue';


	const {
		proxy
	} = getCurrentInstance()
	const app = getApp();

	const projectList = ref([]);
	const venue = ref({});
	const pickList = ref([]);
	const pics = ref([]);
	const index = ref(0);
	const popup = ref(null);
	const popYanZheng = ref(null);

	const map = ref(null);
	const scale = ref(14);
	const latitude = ref('31.547158');
	const longitude = ref('120.305961');
	const agree = ref(true);
	const loading = ref(false);
	const interval = ref('');
	const duration = ref('');
	const indicatorDots = ref(true);
	const autoplay = ref(false);
	const newModel = ref({});
	let proId;
	let goPath;
	const svId = ref(null);
	const list = ref([{
		id: 0,
		name: '培训助手',
		partLogo:'/static/btn01.png',
		path: '/pages_hotel/hotel/index'
	}, {
		id: 2,
		name: '校园风采',
		partLogo:'/static/btn03.png',
		path: ''
	}, {
		id: 3,
		name: '我的',
		partLogo:'/static/btn04.png',
		path: '/pages_hotel/hotel/mycenter'
	}]);

	onShow(() => {
		if (app.globalData.isLogin) {
			init();
		} else {
			app.firstLoadCallback = () => {
				init();
			};
		}
	})
	onLoad(option => {
		if (option.scene) {
			proId = decodeURIComponent(option.scene);
		} 
		if(option.relogo){
			showLogin(()=>{
				uni.redirectTo({
					url: '/pages/index/index'
				});
			})
		}
	});
	onReady(() => {
		proxy._mapContext = uni.createMapContext("map", this)
	})

	let currUser

	function checkUserPhone(path) {
		currUser = uni.getStorageSync('currUser')
		if (!currUser) {
			loginServer.pcLogin().then(() => {
				currUser = uni.getStorageSync('currUser')
				if (currUser.phonenumber) {
					debugger
					return true
				} else {
					popYanZheng.value.open()
					goPath = path
					return false;
				}
			});
		} else {
			if (currUser.phonenumber) {
				return true
			} else {
				popYanZheng.value.open()
				goPath = path
				return false;
			}
		}
	}

	function decryptPhoneNumber(res) {
		// console.log(res)
		loading.value = true
		if (res.detail.errMsg.indexOf('ok') > -1) {
			getWxUserPhone(res.detail).then((data) => {
				console.log(data)
				popYanZheng.value.close()
				uni.redirectTo({
					url: goPath
				})
			}).finally(() => {
				loading.value = false
			});
		} else {
			loading.value = false
		}
	}

	function clickImg() {
		uni.previewImage({
			urls: venue.value.venuePicArr,
			// current: 0,
			success: function(res) {
				console.log('success', res)
			},
			fail: function(res) {
				console.log('fail', res)
			},
			complete: function(res) {
				console.log('complete', res)
			}
		})
	}


	function goCenter() {
		let path = '/pages/usercenter/usercenter';
		if (checkUserPhone(path)) {
			uni.navigateTo({
				url: path
			});
		}
	}

	function popupClose() {
		popup.value.close();
	}

	function init() {
		// venue.value = app.globalData.venue
		// latitude.value = app.globalData.venue.latitude
		// longitude.value = app.globalData.venue.longitude
		// // 修改页头标题
		// uni.setNavigationBarTitle({
		// 	title: venue.value.venueName
		// });
	}

	function open() {
		popup.value.open();
	}

	function makeCall() {
		uni.makePhoneCall({
			phoneNumber: venue.value.venueTelno
		});
	}

	function gogo() {
		//拉起导航软件
		proxy._mapContext.openMapApp({
			latitude: parseFloat(latitude.value),
			longitude: parseFloat(longitude.value),
			destination: venue.value.venueAddress, //目标地址详情
			success() {
				console.log('success');
			},
			fail() {
				console.log('fail');
				uni.showToast({
					title: '请安装导航软件',
					icon: 'none',
					duration: 2000
				});
			},
			complete() {
				console.log('complete');
			}
		});
	}

	function closeMaptypeList() {
		this.showH5maptype = false;
	}

	function goItem(item) {
		if (item.path) {
			let path = item.path
			uni.navigateTo({
				url: item.path
			});
		} else {
			uni.showToast({
				title: `暂未开放`,
				icon: 'none'
			});
		}

	}
</script>
<style scope lang="scss">
	.grid-item-box{text-align: center;
		image{width: 120rpx;height: 120rpx;}
	}
	.singlePop {
		max-height: 60vh;
		overflow: auto;
	}

	.map {
		width: 100rpx;
		height: 100rpx;
		position: absolute;
		opacity: 0;
	}

	.venuePics {
		position: relative;
		width: 680rpx;
		height: 370rpx;
		border-radius: 15rpx;
		overflow: hidden;

		image {
			width: 680rpx;
			position: absolute;
			height: 370rpx;
		}

		text {
			position: absolute;
			right: 20rpx;
			bottom: 20rpx;
			font-size: 28rpx;
			color: #fff;
		}
	}

	.popYanZhengBox {
		text-align: center;

		.popup-content {
			width: 550rpx;
			height: 450rpx;
			box-sizing: border-box;
			background: #FFFFFF;
			border-radius: 15rpx;
		}

		.t {
			font-weight: 500;
			font-size: 34rpx;
			color: #7B7F83;
		}

		.p {
			line-height: 1.8;
			font-size: 30rpx;
			color: #1A1A1A;
			margin-top: 50rpx;
		}

		button {
			width: 268rpx;
			height: 80rpx;
			color: #FFFFFF;
			font-size: 32rpx;
			border: none;
			background: linear-gradient(270deg, #54E1B9, #00CAA6);
			border-radius: 40rpx;
			margin-top: 60rpx;
		}
	}

	.dis {
		color: #b3b3b3;
		border: #fff;
	}
</style>