index.vue
8.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
<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>