Browse Source

提交

master
chenkainan 3 months ago
parent
commit
99695520b3
  1. 2
      .env.development
  2. 2
      .env.production
  3. 2
      .env.test
  4. 2
      dist/index.html
  5. 1
      dist/static/css/app.0c09c0af.css
  6. 1
      dist/static/css/app.3c10ecc1.css
  7. 1
      dist/static/js/app.02c0cefe.js
  8. 1
      dist/static/js/app.d5255bd2.js
  9. 12
      src/libs/axios.js
  10. 65
      src/libs/utils.js
  11. 103
      src/views/Index.vue
  12. 80
      src/views/compoents/productDetail.vue

2
.env.development

@ -1,5 +1,5 @@
NODE_ENV='development'
# 请求域名前缀
VUE_APP_URL='https://tongli.sz-trip.com'
VUE_APP_URL='https://changshu.js-dyyj.com'
# 打包后输出目录
VUE_APP_OUTPUTDIR='dist_dev'

2
.env.production

@ -1,5 +1,5 @@
NODE_ENV='production'
# 请求域名前缀
VUE_APP_URL='https://tongli.sz-trip.com'
VUE_APP_URL='https://changshu.js-dyyj.com'
# 打包后输出目录
VUE_APP_OUTPUTDIR='dist'

2
.env.test

@ -1,5 +1,5 @@
NODE_ENV='production'
# 请求域名前缀
VUE_APP_URL='https://tongli.sz-trip.com'
VUE_APP_URL='https://changshu.js-dyyj.com'
# 打包后输出目录
VUE_APP_OUTPUTDIR='dist_test'

2
dist/index.html

@ -1 +1 @@
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0"><link rel="icon" href="favicon.ico"><title>地图</title><script charset="utf-8" src="https://map.qq.com/api/gljs?v=1.exp&key=YVOBZ-MWJ3Z-34IXK-7J2GL-O33US-QLF5X"></script><script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script><script src="https://js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.1.5.2.js"></script><script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script><script defer="defer" src="/static/js/chunk-vendors.c33f6caf.js"></script><script defer="defer" src="/static/js/app.d5255bd2.js"></script><link href="/static/css/chunk-vendors.befb54be.css" rel="stylesheet"><link href="/static/css/app.3c10ecc1.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but taihulake doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0"><link rel="icon" href="favicon.ico"><title>地图</title><script charset="utf-8" src="https://map.qq.com/api/gljs?v=1.exp&key=YVOBZ-MWJ3Z-34IXK-7J2GL-O33US-QLF5X"></script><script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script><script src="https://js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.1.5.2.js"></script><script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script><script defer="defer" src="/static/js/chunk-vendors.c33f6caf.js"></script><script defer="defer" src="/static/js/app.02c0cefe.js"></script><link href="/static/css/chunk-vendors.befb54be.css" rel="stylesheet"><link href="/static/css/app.0c09c0af.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but taihulake doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>

1
dist/static/css/app.0c09c0af.css

File diff suppressed because one or more lines are too long

1
dist/static/css/app.3c10ecc1.css

File diff suppressed because one or more lines are too long

1
dist/static/js/app.02c0cefe.js

File diff suppressed because one or more lines are too long

1
dist/static/js/app.d5255bd2.js

File diff suppressed because one or more lines are too long

12
src/libs/axios.js

@ -6,12 +6,22 @@ import axios from "axios";
import {Dialog, Toast} from "vant";
import store from '@/store';
const http = axios.create({
baseURL: process.env.VUE_APP_URL,
// baseURL: process.env.VUE_APP_URL,
timeout: 6000 // 请求超时时间 当请求时间超过`秒还未取得结果时 提示用户请求超时
})
//添加请求拦截器
http.interceptors.request.use((config) => {
const { customBaseURL } = config.params || {}; // 从请求参数中获取自定义的 baseURL
if (customBaseURL) {
config.baseURL = customBaseURL; // 如果有自定义的 baseURL,则使用它
// 移除自定义的 baseURL 参数,避免传递到后端
delete config.params.customBaseURL;
} else {
// 默认的 baseURL,可以根据环境变量设置
config.baseURL = process.env.VUE_APP_URL;
}
const token = store.state.user.userInfo.token;
config.headers['token'] = token
config.headers['Content-Type'] = 'application/json;charset=UTF-8'

65
src/libs/utils.js

@ -58,8 +58,8 @@ export default {
openMap(item) {
let data = {
type: 'map',
lon: item.tengxun_map.lon,
lat: item.tengxun_map.lat,
lon: item.scene_lon,
lat: item.scene_lat,
name: item.title,
address: item.address
}
@ -72,7 +72,7 @@ export default {
if (img.indexOf('https://') != -1 || img.indexOf('http://') != -1) {
return img;
} else {
return 'https://tongli.sz-trip.com' + img;
return 'https://changshu.js-dyyj.com' + img;
}
},
// 跳回小程序
@ -90,37 +90,38 @@ export default {
return
}else if(item.link_type == 2){
// 外部H5
window.location.href = item.ext_link
// window.location.href = item.ext_link
window.location.href = 'https://m.cloud.sz-trip.com/MailMerchandiseDetail?type=ticket&id=' + item.id
return
}
switch (item.genre){
// 景点
case 'ticket':
uni.navigateTo({
url: '/subPackages/ticketBooking/detail?id=' + item.id
})
break;
// 酒店
case 'hotel':
uni.navigateTo({
url: '/subPackages/hotelHomestay/detail?id=' + item.id
})
break;
// 美食
case 'food':
uni.navigateTo({
url: '/subPackages/food/foodDetail?id=' + item.id
})
break;
// 攻略
case 'article':
uni.navigateTo({
url: '/subPackages/travelGuide/detail?id=' + item.id
})
break;
default:
break;
}
// switch (item.genre){
// // 景点
// case 'ticket':
// uni.navigateTo({
// url: '/subPackages/ticketBooking/detail?id=' + item.id
// })
// break;
// // 酒店
// case 'hotel':
// uni.navigateTo({
// url: '/subPackages/hotelHomestay/detail?id=' + item.id
// })
// break;
// // 美食
// case 'food':
// uni.navigateTo({
// url: '/subPackages/food/foodDetail?id=' + item.id
// })
// break;
// // 攻略
// case 'article':
// uni.navigateTo({
// url: '/subPackages/travelGuide/detail?id=' + item.id
// })
// break;
// default:
// break;
// }
}
}
}

103
src/views/Index.vue

@ -4,6 +4,10 @@
<!-- 点位分类 -->
<div class="type-box" v-if="typeShow">
<div class="search">
<img src="https://static.ticket.sz-trip.com/changshu/images/map/search.png" alt="" />
搜索
</div>
<div :class="['type-item',{'type-active': index == typeIndex}]" v-for="(item,index) in mapType"
@click="getSpotsByCategory(index)">{{item.name}}</div>
</div>
@ -24,7 +28,7 @@
</div>
</div>
<!-- 行程线路 -->
<div>
<!-- <div>
<div class="area-item area-items" @click="addLine" v-if="isMyLine">
<img src="https://static.ticket.sz-trip.com/yandu/images/map/myLine.png" alt="" />
我的<br>行程
@ -37,14 +41,14 @@
<img src="https://static.ticket.sz-trip.com/yandu/images/map/line.png" alt="" />
线路<br>推荐
</div>
</div>
</div> -->
</div>
<!-- 详情弹框 -->
<van-popup v-model="detailShow" @close="audioPause" :overlay-style="{'background-color': 'rgba(0, 0, 0, 0)'}"
position="bottom" round>
<ProductDetail ref="detailRef" :type="productType" :info="detailInfo" :audioSrc="audioSrc"
:genreType="genreType" />
:genreType="genreType" :content="detailContent" :imgList="imgList" :isCanBuy="isCanBuy" :tel="tel" />
</van-popup>
<!-- 输入线路信息弹框 -->
@ -130,6 +134,10 @@
audioSrc: '',
genreType: '',
isMyLine: false, // 线
detailContent: '',
imgList: '',
isCanBuy: false,
tel: ''
};
},
mounted() {
@ -157,7 +165,7 @@
if (res.data.length > 0) {
this.getAreaDetail()
this.getCategory()
this.getMyLine()
// this.getMyLine()
}
})
},
@ -168,7 +176,7 @@
this.mapObj.destroy()
this.getAreaDetail()
this.getCategory()
this.getMyLine()
// this.getMyLine()
},
// code
getAreaDetail() {
@ -323,13 +331,15 @@
this.maps.forEach(item => {
markers.push({
"styleId": 'marker',
id: item.goods ? (item.goods.genre == 'food' ? item.goods.id : item.goods
.scenic_id) : '', // id
id: item.goods.id, // id
genre: item.goods ? item.goods.genre : '', //
name: item.name, //
address: item.address, //
address: item.address, // ,
audioSrc: item.audio_file, //
spotId: item.id, // id
detailContent: item.detail_content, //
imgList: item.album_images, //
tel: item.tel, //
position: new TMap.LatLng(JSON.parse(item.poi)[1], JSON.parse(item.poi)[0])
})
@ -353,7 +363,7 @@
"marker": new TMap.MarkerStyle({
"width": 27,
"height": 33,
"src": 'https://static.ticket.sz-trip.com/yandu/images/map/scenic.png',
"src": 'https://static.ticket.sz-trip.com/changshu/images/map/scenic.png',
"src": this.util.showImg(this.mapType.find(i => {
return i.id == this.maps[0].category_id
}).icon_image)
@ -427,29 +437,41 @@
} else {
this.audioSrc = evt.geometry.audioSrc
this.genreType = evt.geometry.genre
if (['ticket', 'hotel'].includes(evt.geometry.genre)) {
//
this.detailContent = evt.geometry.detailContent
this.imgList = evt.geometry.imgList
this.tel = evt.geometry.tel
if (['ticket'].includes(evt.geometry.genre)) {
//
this.get({
id: evt.geometry.id
}, '/api/scenic/getScenicById').then(res => {
id: evt.geometry.id,
customBaseURL: 'https://api.cloud.sz-trip.com'
}, '/api/product/get_product_detail').then(res => {
if (res.data) {
//
if(evt.geometry.genre == 'ticket') {
this.isCanBuy = true
this.productType = true
}
this.detailInfo = res.data
this.detailInfo.genre = evt.geometry.genre
this.detailShow = true
}
})
} else if (evt.geometry.genre == 'food') {
this.get({
goods_id: evt.geometry.id
}, '/api/goods/getGoodDetail').then(res => {
if (res.data) {
this.productType = true
this.detailInfo = res.data
this.detailShow = true
}
})
} else {
// else if (evt.geometry.genre == 'food') {
// this.get({
// goods_id: evt.geometry.id
// }, '/api/goods/getGoodDetail').then(res => {
// if (res.data) {
// this.productType = true
// this.detailInfo = res.data
// this.detailShow = true
// }
// })
// }
else {
//
this.detailInfo = {
title: evt.geometry.name,
@ -458,7 +480,7 @@
lat: evt.geometry.position.lat
}
console.log(this.detailInfo)
this.productType = false
this.productType = true
this.detailShow = true
}
}
@ -680,28 +702,47 @@
.type-box {
position: fixed;
z-index: 2000;
width: 723px;
height: 53px;
top: 22px;
left: 27px;
width: 750px;
top: 0;
left: 0;
display: flex;
overflow-x: auto;
padding: 16px;
background-color: #fff;
.type-item {
padding: 0 26px;
line-height: 53px;
background: #FFFFFF;
background: #F2F2F2;
border-radius: 13px;
font-weight: 500;
font-size: 27px;
color: #000000;
color: #333333;
margin-right: 27px;
flex-shrink: 0;
}
.type-active {
background: linear-gradient(130deg, #9EE4FE, #7FD491);
background: #00AEA0;
color: #fff;
}
.search {
padding-right: 21px;
font-weight: bold;
font-size: 27px;
color: #00AEA0;
border-right: 1px solid #CCCCCC;
display: flex;
align-items: center;
margin-right: 18px;
white-space: nowrap;
img {
width: 25px;
height: 25px;
margin-right: 8px;
}
}
}

80
src/views/compoents/productDetail.vue

@ -3,11 +3,15 @@
<div class="bg">
<div class="top flex-between">
{{info.title}}
<div class="top-btn" v-if="type" @click="util.gotoDetailMini(info)">购买</div>
<div v-if="type && audioSrc">
<img src="https://static.ticket.sz-trip.com/changshu/images/map/pause.png" v-if="isAudioPlay" @click="audioPlay(false)">
<img src="https://static.ticket.sz-trip.com/changshu/images/map/play.png" v-else @click="audioPlay(true)">
<div>讲解</div>
</div>
</div>
<div class="img-box" v-if="type && info.list_images">
<img v-for="(item,index) in info.list_images.split(',')" :src="util.showImg(item)" alt="" />
<div class="img-box" v-if="type && imgList">
<img v-for="(item,index) in imgList.split(',')" :src="util.showImg(item)" alt="" />
</div>
<div class="scenic-detail flex-between" :style="{marginTop: type ? '' : '0'}">
@ -16,23 +20,24 @@
<div :class="[type ? 'text-overflow' : 'text-overflowRows']">地址{{info.address}}</div>
</div>
<div class="scenic-right flex-between">
<div v-if="type && audioSrc">
<img src="https://static.ticket.sz-trip.com/yandu/images/map/pause.png" v-if="isAudioPlay" @click="audioPlay(false)">
<img src="https://static.ticket.sz-trip.com/yandu/images/map/play.png" v-else @click="audioPlay(true)">
<div>讲解</div>
<div v-if="type && tel" @click="goTel">
<img src="https://static.ticket.sz-trip.com/changshu/images/map/phone.png">
<div>电话</div>
</div>
<div v-else></div>
<div @click="util.openMap(info)">
<img src="https://static.ticket.sz-trip.com/yandu/images/map/navigation.png" alt="">
<img src="https://static.ticket.sz-trip.com/changshu/images/map/location.png" alt="">
<div>导航</div>
</div>
</div>
</div>
<div class="buy-btn" v-if="isCanBuy" @click="util.gotoDetailMini(info)">在线预订</div>
<div class="scenic-content" v-if="type">
简介:
<div v-html="util.formateRichText(info.feature_content)"></div>
<div v-html="util.formateRichText(content)"></div>
</div>
<!-- 音频讲解 -->
<audio :src="audioSrc" ref="audio" controls v-show="false" @ended="endAudio"></audio>
@ -48,15 +53,31 @@
},
info: {
type: Object,
detault: {}
default: {}
},
audioSrc: {
type: String,
detault: ''
default: ''
},
genreType: {
type: String,
detault: ''
default: ''
},
imgList: {
type: String,
default: ''
},
content: {
type: String,
default: ''
},
isCanBuy: {
type: Boolean,
default: false
},
tel: {
type: String,
default: ''
}
},
data() {
@ -65,9 +86,14 @@
}
},
mounted() {
this.$refs.audio.src = this.util.showImg(this.audioSrc)
this.$refs.audio.src = this.util.showImg(this.audioSrc) || ''
this.info.link_type = 2
},
methods: {
//
goTel() {
window.location.href = 'tel:' + this.tel;
},
audioPlay(status) {
console.log(this.$refs.audio.paused)
if(status) {
@ -100,16 +126,32 @@
font-size: 40px;
color: #000000;
.top-btn {
width: 133px;
line-height: 59px;
background: #F74A57;
img {
width: 37px;
height: 37px;
margin-bottom: 5px;
}
div {
text-align: center;
font-weight: 500;
font-size: 24px;
color: #00AEA0;
white-space: nowrap;
}
}
.buy-btn {
margin: 36px 0 0 auto;
width: 200px;
height: 59px;
background: #FF7F00;
border-radius: 13px;
line-height: 59px;
text-align: center;
font-weight: bold;
font-size: 32px;
color: #FFFFFF;
}
}
.img-box {
overflow-x: auto;
display: flex;
@ -153,7 +195,7 @@
width: 150px;
font-weight: 500;
font-size: 24px;
color: #71B580;
color: #00AEA0;
img {
width: 37px;

Loading…
Cancel
Save