Browse Source

酒店、美食、特产

master
jiazhipeng 12 months ago
parent
commit
9ab2efacd3
  1. 2
      compoents/addressAdd.vue
  2. 32
      compoents/cartData.vue
  3. 9
      static/js/CommonFunction.js
  4. 4
      subPackages/food/foodList.vue
  5. 9
      subPackages/hotelHomestay/hotelHomestay.vue
  6. 57
      subPackages/search/searchList.vue
  7. 19
      subPackages/techan/detail.vue
  8. 56
      subPackages/techan/order.vue
  9. 49
      subPackages/techan/techanList.vue
  10. 46
      subPackages/ticketBooking/detail.vue

2
compoents/addressAdd.vue

@ -27,7 +27,7 @@
<view class="list-item" style="border-bottom: 0;">
<view class="list-item-title">设为默认</view>
<view class="list-item-switch">
<switch :checked="idDefault" @change="switchChange" color="#FEB419"/>
<switch :checked="idDefault" @change="switchChange" color="#248BAA"/>
</view>
</view>
<!-- <view class="list-item-btn">

32
compoents/cartData.vue

@ -38,10 +38,10 @@
<view style="font-size: 40rpx;">{{item.Specifications_money/100}}</view>
</view>
<view class="add-num-area">
<image @click.stop="addBuyNum(item,-1,i)"
:src="(item.num==1?'https://yjdtadmin.sz-trip.com/uploads/20231225/634870627318043881f9c417e5ad5b52.png':'https://yjdtadmin.sz-trip.com/uploads/20240726/ea81cd01a1f32a0226d33d8e35119c96.png')" ></image>
<view :class="['ctrl',item.num>1?'':'disabled']" @click.stop="addBuyNum(item,-1,i)" >-</view>
<view>{{item.num}}</view>
<image @click.stop="addBuyNum(item,1,i)" src="https://yjdtadmin.sz-trip.com/uploads/20240726/5028bbc810386a1f301a556672711f19.png" ></image>
<view :class="['ctrl']" @click.stop="addBuyNum(item,1,i)">+</view>
</view>
</view>
</view>
@ -71,7 +71,7 @@
showCart: false,
selectAll: false,
canOpenpop: true,
allPrice: {allPrice:0, iNum:0, fNum:'00'}
allPrice: {allPrice:0, iNum:0, fNum:'00'},
}
},
props:{
@ -86,6 +86,11 @@
uni.$on("updateDataByConnect",this.getDataByConnect)
},
beforeUnmount () {
console.log('触发off')
uni.$off("updateDataByConnect",this.getDataByConnect)
},
beforeDestroy () {
console.log('触发off')
uni.$off("updateDataByConnect",this.getDataByConnect)
},
@ -227,6 +232,7 @@
goodsInfo: {
image: v.Specifications_image,
title:v.good_name,
merchant_name: v.merchant_name,
},
skuInfo: {
title:v.Specifications_name,
@ -240,7 +246,6 @@
let orderInfo = {
// is_post: goods.is_post || "1",
is_post: 1, //
goods: orderData,
post: 0
@ -430,6 +435,21 @@
}
}
.ctrl {
width: 47rpx;
height: 47rpx;
background: #248BAA;
border-radius: 50%;
font-family: PingFang SC;
font-weight: 400;
font-size: 34rpx;
color: #FFFFFF;
line-height: 42rpx;
text-align: center;
}
.ctrl.disabled{
background: #E8E8E8;
color: #999999;
}
</style>

9
static/js/CommonFunction.js

@ -248,19 +248,22 @@ Vue.prototype.goOtherDetail = (item,type) => {
uni.navigateToMiniProgram({
shortLink: item.ext_link
})
return
return true
}else if(item.link_type == 2){
// 外部H5
uni.navigateTo({
url: '/subPackages/webPage/webPage?url=' + item.ext_link
});
return
return true
}
}
// 根据类型判断详情页
Vue.prototype.goDetailByType= function(item){
this.goOtherDetail(item)
let res = this.goOtherDetail(item)
if (res) {
return
}
let urlData = [
{name:'景区门票', url: '/subPackages/ticketBooking/detail',genre:'ticket'},

4
subPackages/food/foodList.vue

@ -1,7 +1,7 @@
<template>
<view class="bg">
<span class="iconfont topLeft" @click="goBack">&#xe660;</span>
<img :src="headImg" class="topImg" />
<img :src="showImg(headImg)" class="topImg" />
<view class="item" v-for="item in list" :key="item.id" @click="viewDetail(item)">
<image class="img" :src="showImg(item.image)" mode=""></image>
<view class="content">
@ -13,7 +13,7 @@
</view> -->
<view>
<view class="distance text-overflow" v-if="item.open_description">
<text >营业时间{{ item.open_description }}</text>
<text >营业时间:{{ item.open_description }}</text>
</view>
<view class="distance text-overflow" style="padding-top: 12rpx;" v-if="item.distance">
<text >距您约{{ item.distance/1000 }}km</text>

9
subPackages/hotelHomestay/hotelHomestay.vue

@ -10,8 +10,8 @@
<view class="goodBox">
<view class="type-container">
<view :class="['type',activeType==0?'active':'']" @click="changeActiveType(0)">精选酒店</view>
<view :class="['type',activeType==1?'active':'']" @click="changeActiveType(1)">特色民宿</view>
<view :class="['type',activeType==13?'active':'']" @click="changeActiveType(13)">精选酒店</view>
<view :class="['type',activeType==14?'active':'']" @click="changeActiveType(14)">特色民宿</view>
</view>
<view class="goodItem" v-for="(item,index) in list" :key="index" @click="viewDetail(item)">
@ -74,8 +74,7 @@
finished: false,
headImg:null,
navList: [],
activeType: 0,
type_id: 11,//id
activeType: 13,
}
},
onShow() {
@ -113,7 +112,7 @@
//
getList(){
this.Post({
scenic_type_id: this.type_id,offset: this.list.length,limit: 10,
scenic_type_id: this.activeType,offset: this.list.length,limit: 10,
lon: uni.getStorageSync('location').lon || '120',
lat: uni.getStorageSync('location').lat || '30',
},

57
subPackages/search/searchList.vue

@ -18,21 +18,21 @@
</view>
<div class="search-list">
<view @click="gotoDetail(item)" v-for="(item, key) in list" :key="item.id" class="search-item">
<image class="img" :src="showImg(item.image)" mode=""></image>
<image class="img" :src="showImg(item.search_data.image)" mode=""></image>
<view class="content">
<view class="title text-overflowRows">
{{item.title}}
</view>
<!-- 美食 -->
<view v-if="item.search_data.genre=='food'">
<view class="distance text-overflow" v-if="item.open_description">
<view v-if="item.search_data.genre=='food'" style="display: flex;">
<view class="distance text-overflow" v-if="item.search_data.open_description">
<image :src="showImg('/uploads/20241024/bd5ef34fb88f8aee2c444512a5311c79.png')" class="icon-tip"></image>
<text>营业时间{{ item.open_description }}</text>
<text>营业时间:{{ item.search_data.open_description }}</text>
</view>
</view>
<view class="bottom" v-if="['ticket','hotel','pgoods'].includes(item.search_data.genre)">
<view class="distance text-overflow" style="padding-top: 12rpx;" >
<view class="distance text-overflow" >
<image v-if="item.search_data.address" :src="showImg('/uploads/20241024/b7d33bf405526f09212ff3d9485e6d06.png')" class="icon-tip"></image>
<text v-if="item.search_data.address">{{item.search_data.address}}</text>
</view>
@ -42,23 +42,23 @@
</view>
<view class="bottom" v-else-if="item.search_data.genre=='food'">
<view class="distance text-overflow" style="padding-top: 12rpx;" >
<image :src="showImg('/uploads/20241024/bd5ef34fb88f8aee2c444512a5311c79.png')" class="icon-tip"></image>
<view class="distance text-overflow" >
<image v-if="item.search_data.distance" :src="showImg('/uploads/20241024/b7d33bf405526f09212ff3d9485e6d06.png')" class="icon-tip"></image>
<text v-if="item.search_data.distance">距您约{{ item.search_data.distance/1000 }}km</text>
</view>
<view class="price food-price">
{{item.money/100}}
{{item.search_data.money/100}}
</view>
</view>
<view class="bottom" v-else>
<view class="distance text-overflow" style="padding-top: 12rpx;" >
<view class="distance text-overflow" >
<image :src="showImg('/uploads/20241024/852c8a49a8d78410bebd93b02c9e41a4.png')" class="icon-tip"></image>
<text >同里文旅</text>
</view>
<view class="view-num flex-between flex-shrink-0">
<image :src="showImg('/uploads/20241024/4226315bfd2eac83e90746295851966a.png')" class="icon-tip"></image>
<text class="distance">{{iem.search_data.view||0}}</text>
<text class="distance">{{item.search_data.view||0}}</text>
</view>
</view>
</view>
@ -81,28 +81,36 @@
data() {
return {
typeList: [{
id: 'ALL',
id: '',
name: '全部'
},
{
id: 'WAIT_PAYMENT',
id: 'ticket',
name: '景点'
},
{
id: 'PAYMENT_SUCCESSFULLY',
id: 'food',
name: '美食'
},
{
id: 'PAYMENT_SUCCESSFULLY',
id: 'hotel',
name: '酒店'
},
{
id: 'POST',
name: '资讯'
id: 'pgoods',
name: '特产文创'
},
{
id: 'WAIT_REFUND,REFUND_SUCCESS,REFUND_REFUSAL,REFUND_ERROR,REFUND_PART',
id: 'line',
name: '特色体验'
},
{
id: 'article',
name: '攻略'
},
{
id: 'activity',
name: '活动'
}
],
typeIndex: 0,
@ -155,7 +163,10 @@
this.Post({
name: this.keywords,
offset: this.list.length,
type: this.typeList[this.typeIndex].id,
limit: 30,
lon: uni.getStorageSync('location').lon || '120',
lat: uni.getStorageSync('location').lat || '36',
}, '/api/search/search').then(res => {
res.data.forEach(v=>{
if (v.type!=='goods') {
@ -267,6 +278,17 @@
flex: 1;
width: 1rpx;
padding-right: 10rpx;
image{
flex-shrink: 0;
}
text{
flex: 1;
width: 1rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.price {
@ -296,6 +318,7 @@
align-items: center;
justify-content: center;
flex-direction: column;
margin: 26rpx 0;
}
.list-common-empty-tip{

19
subPackages/techan/detail.vue

@ -107,7 +107,7 @@
</view>
</view>
<cartDataVue ref="cartDataVueRef" :paramData="paramData" @changeParamData="changeParamData" ></cartDataVue>
<cartDataVue ref="cartDataVueRef" :paramData="paramData" @changeParamData="changeParamData" :key="new Date().getTime()"></cartDataVue>
<uni-popup ref="popup" type="bottom" @change="changPopShow" style="position: relative;z-index: 50;">
<view class="popup-content" v-if="sku.length>0">
@ -135,6 +135,7 @@
<view class="noStore-text" v-if="botItem.store==0">
不可购买
</view>
<view class="noStore-text" v-else-if="is_post==1&&botItem.is_post!=1">不可加购</view>
</view>
</view>
@ -224,8 +225,9 @@
if (res) {
this.sku = res.data || [];
// todo
if (this.sku.length>0) {
this.is_post = this.sku[0].is_post
this.is_post = "2"
if (this.sku.length>0 && this.sku.some(v=>v.is_post == 1)) {
this.is_post = "1"
}
}
@ -289,8 +291,8 @@
goods.buyNum = this.buyNum
let orderInfo = {
// is_post: goods.is_post || "1",
is_post: 2,
is_post: goods.is_post || "1",
// is_post: 2,
goods: [{goodsInfo: this.info, skuInfo: goods }],
post: 0,
}
@ -303,6 +305,13 @@
},
addToCart () {
let goods = this.sku[this.productIndex]
if(goods.is_post!=1) {
uni.showToast({
title: '此规格不支持加入购物车',
icon: 'none'
})
return
}
goods.buyNum = this.buyNum
let goodsInfo = {goodsInfo:this.info, skuInfo: goods, isSelected: true}

56
subPackages/techan/order.vue

@ -77,9 +77,10 @@
</view>
</view>
<view class="new-box" v-for="(sku,index) in info.goods" :key="index">
<view class="box shop-name text-overflow">
店家名称店家名称店家名称店家名称店家名称店家名称店家名称
<template v-for="(merchantGroup,merchantIndex) in orderGoods">
<view class="new-box" v-for="(sku,index) in merchantGroup" :key="index">
<view class="box shop-name text-overflow" v-if="sku.goodsInfo.merchant_name">
{{sku.goodsInfo.merchant_name}}
</view>
<view class="commodity box">
<image class="img" :src="showImg(sku.goodsInfo.image)" mode="aspectFill"></image>
@ -110,19 +111,24 @@
</view>
</view>
<view class="post top-line flex-between" v-show="sku.info.is_post===1">
<view class="post top-line flex-between" v-show="info.is_post==1">
<view class="">
运费
</view>
<view style="font-weight: 500;" >
{{sku.post==0?'免邮':sku.post/100}}
{{!sku.post?'免邮':sku.post/100}}
</view>
</view>
<view class="remark top-line">
<view class="remark-title" >订单备注:</view>
<input style="z-index:0;text-align: right;" type="text" placeholder="选填" v-model="sku.skuInfo.remark" maxlength="50"/>
</view>
</view>
</template>
<view class="tickets-box flex-between">
<view class="remark">
<view class="remark-title" >订单备注:</view>
<input style="z-index:0;text-align: right;" type="text" placeholder="选填" v-model="remark" maxlength="50"/>
</view>
</view>
<!-- 优惠券 -->
@ -217,6 +223,9 @@ export default {
contacts: null,
info: null,//
detail:null,//
orderGoods: [],
post: 0,
flag: true,
addressList: [],
@ -241,6 +250,7 @@ export default {
this.$store.commit("choseCoupon", "");
this.info = JSON.parse(uni.getStorageSync('teChanOrder'));
if (!this.info) {
uni.navigateBack();
return
@ -252,6 +262,7 @@ export default {
this.isPost = this.info.is_post || "1"
// this.info.is_post = this.isPost==3?1:this.isPost
}
this.handleOrderGoods()
console.log(this.isPost)
},
onShow() {
@ -274,6 +285,27 @@ export default {
},
methods: {
handleOrderGoods () {
let merchantArray = new Set(this.info.goods.map(v=>v.goodsInfo.merchant_name))
this.orderGoods = []
merchantArray.forEach(x=>{
// let tempArray = this.info.goods.filter(v=>v.goodsInfo.merchant_name==x)
// this.orderGoods.push(tempArray)
// filter for this.infogoods
let tempArray = []
this.info.goods.forEach(v=>{
if(v.goodsInfo.merchant_name == x) {
tempArray.push(v)
}
})
this.orderGoods.push(tempArray)
})
console.log(this.orderGoods)
},
goOrderCoupon () {
let allPrice = 0
let skuIds= []
@ -354,6 +386,7 @@ export default {
if (this.flag) {
this.getPost();
}
this.handleOrderGoods()
});
}
@ -492,7 +525,6 @@ export default {
let goodsItem = {
specifications_id: v.skuInfo.id,
num: v.skuInfo.buyNum,
remark: v.skuInfo.remark
// consignee_id: this.info.is_post == 1 ? this.contacts.id : null
};
@ -1152,7 +1184,7 @@ view {
min-height: 120rpx;
background: #ffffff;
margin: 0 auto;
border-radius: 0 0 14rpx 14rpx;
border-radius: 14rpx;
.remark-title{
font-size: 31rpx;
@ -1194,7 +1226,7 @@ view {
.new-box{
background: #fff;
width: 698rpx;
margin: 0 auto;
margin: 0 auto 20rpx;
border-radius: 14rpx;
}

49
subPackages/techan/techanList.vue

@ -5,7 +5,7 @@
<view class="type-container">
<view class="send-type-container">
<view :class="['type',type1==0?'active':'']" @click.stop="changeType('type1',0)">
<image :src="showImg(type1==0?'/uploads/20241023/0d46c6d4ba08c7eb428770d27abf90aa.png':'/uploads/20241023/fbc0d085d012bdad49d865c5aa85f4a9.png')"></image>
<image :src="showImg(type1==0?'/uploads/20241023/0d46c6d4ba08c7eb428770d27abf90aa.png':'/uploads/20241023/4562e1c05835c0b38576345f207e0d8e.png')"></image>
自提专区
</view>
<view :class="['type',type1==1?'active':'']" @click.stop="changeType('type1',1)">
@ -21,18 +21,18 @@
</view>
<view class="box">
<view class="item" v-for="item in list" :key="item.id" @click="viewDetail(item)">
<image class="item-img" :src="showImg(item.image)" mode=""></image>
<view class="item" v-for="item in list" :key="item.goods.id" @click="viewDetail(item.goods)">
<image class="item-img" :src="showImg(item.goods.image)" mode=""></image>
<view class="content">
<view class="title text-overflowRows">{{item.title}}</view>
<view class="title text-overflowRows">{{item.goods.title}}</view>
<view class="bottom">
<view class="price">
{{item.money/100}}
{{item.goods.money/100}}
</view>
<view class="buy" v-show="type1==0">
立即购买
</view>
<view class="buy-cart" v-show="type1==1" @click.stop="showOrderCart(item)">
<view class="buy-cart" v-show="type1==1" @click.stop="showOrderCart(item.goods)">
<image :src="showImg('/uploads/20241023/3a0fafaf120c9a1bdd90d44fe465e1f6.png')"></image>
</view>
</view>
@ -100,6 +100,7 @@
<view class="noStore-text" v-if="botItem.store==0">
不可购买
</view>
<view class="noStore-text" v-else-if="botItem.is_post!=1">不可加购</view>
</view>
</view>
@ -144,6 +145,13 @@
type1:0,
type2:0,
typeParam: {
'00':57, // -
'01':58, // -
'10':59, // -
'11':60, // -
},
list:[],
finished: false,
@ -168,18 +176,21 @@
if (this[typeName]!==value) {
this[typeName]=value
// this.list = []
// this.getList()
this.list = []
this.getList()
}
},
//
getList(){
let typeKey = `${this.type1}${this.type2}`
let tag_id = this.typeParam[typeKey]
this.Post({
type_id: 19,
tag_id: tag_id,
offset: this.list.length,
limit: 10,
},'/api/goods/getGoodsByType').then(res => {
},'/api/tag/getGoodsByTagId').then(res => {
this.list = [...this.list, ...res.data];
if (res.data.length < 10) {
this.finished = true
@ -217,7 +228,14 @@
this.currentGoods = JSON.parse(JSON.stringify(item))
this.getSpecificationsByGoodsId(item.id)
},
changeProduct(index) {
changeProduct(item,index) {
if (item.store==0) {
uni.showToast({
title:"库存不足!",
icon:'none'
})
return
}
this.productIndex = index
},
getSpecificationsByGoodsId(goods_id) {
@ -254,6 +272,15 @@
},
order() {
let goods = this.sku[this.productIndex]
if(goods.is_post!=1) {
uni.showToast({
title: '此规格不支持加入购物车',
icon: 'none'
})
return
}
goods.buyNum = this.buyNum
let goodsInfo = {goodsInfo:this.currentGoods, skuInfo: goods, isSelected: true}

46
subPackages/ticketBooking/detail.vue

@ -63,14 +63,14 @@
</view>
</view>
<view class="box-title">语音讲解</view>
<view class="common-container info-container" >
<view class="box-title" v-if="currentAudio.multimedia_url">语音讲解</view>
<view class="common-container info-container" v-if="currentAudio.multimedia_url">
<view class="info-title text-overflowRows" style="font-weight: normal;">{{info.title}}</view>
<view class='flex flex-between audio' >
<view class='flex-shrink-0'>{{getTime(Math.round(currentAudio.currentTime.toFixed(0)))}}</view>
<Voice-play :duration="133" :play="false"></Voice-play>
<view class='flex-1' style="width: 10rpx;padding:0 30rpx">
<slider @change="audioSeek" style="width: 100%;margin: 0;" :block-size="12" backgroundColor='#E4F1F5'
<slider @change="audioSeek" @changing="audioChanging" style="width: 100%;margin: 0;" :block-size="12" backgroundColor='#E4F1F5'
activeColor='#248BAA' :min='0' :max='currentAudio.video_length.toFixed(0)' :value='currentAudio.currentTime.toFixed(0)' :step='0.1'></slider>
</view>
@ -222,13 +222,14 @@
stratDate:'',endDate: '', selected: []
},
currentAudio: {multimedia_url:'https://tlgz.sz-trip.com/uploads/20241023/3a9cb5a1b60daaad9039e985115509c9.mp3', video_length: 0, currentTime: 0},
currentAudio: {multimedia_url:'', video_length: 0, currentTime: 0},
curPlay: false,
curPlayCopy: false,
}
},
onShow(options) {
this.headImg = 'https://tongli.sz-trip.com/uploads/20240826/8653c32761e01ee683505eddba1ae22b.png'
},
onLoad(options) {
this.id = options.id;
@ -277,6 +278,12 @@
console.log(e)
info.times_list_info = {start:'',end:''}
}
if(Array.isArray(info.multimedia)&&info.multimedia.length>0) {
this.currentAudio.multimedia_url = this.showImg(info.multimedia[0].multimedia_url)
this.currentAudio.video_length = info.multimedia[0].video_length
this.currentAudio.currentTime = 0
}
this.info = info
console.log(info)
});
@ -507,15 +514,6 @@
//
setCurrentAudio (data) {
// this.currentAudio.article_id = data.article_id
this.currentAudio.multimedia_url = data.multimedia_url
// this.currentAudio.title = data.title
this.currentAudio.video_length = data.video_length || 0
this.currentAudio.currentTime = data.currentTime || 0
this.currentAudio.qr_code_path = data.qr_code_path || ''
},
initPlayer () {
let that = this;
if (innerAudioContext2) {
@ -542,7 +540,7 @@
});
innerAudioContext2.onTimeUpdate(() => {
console.log('timeUpdate')
that.currentAudio.duration = innerAudioContext2.duration;
that.currentAudio.video_length = innerAudioContext2.duration;
that.currentAudio.currentTime = innerAudioContext2.currentTime;
})
},
@ -557,6 +555,24 @@
innerAudioContext2.pause()
this.curPlay = false
},
//
audioSeek (event) {
let value = event.detail.value
innerAudioContext2.seek(value)
if (this.curPlayCopy) {
innerAudioContext2.play()
this.curPlay = this.curPlayCopy
this.curPlayCopy = false
}
},
//
audioChanging () {
//
if (this.curPlay) {
this.curPlayCopy = this.curPlay
this.pauseVoice()
}
},
getTime(time) {
let m = parseInt(time / 60);

Loading…
Cancel
Save