Browse Source

酒店民宿

master
jiazhipeng 1 year ago
parent
commit
24fef20608
  1. 18
      pages.json
  2. 9
      static/js/CommonFunction.js
  3. 2
      static/js/request.js
  4. 761
      subPackages/hotelHomestay/detail.vue
  5. 45
      subPackages/hotelHomestay/hotelHomestay.vue
  6. 600
      subPackages/hotelHomestay/order.vue
  7. 110
      subPackages/hotelHomestay/policy.vue
  8. 16
      subPackages/techan/detail.vue
  9. 52
      subPackages/techan/order.vue
  10. 15
      subPackages/ticketBooking/detail.vue
  11. 203
      subPackages/ticketBooking/order.vue
  12. 17
      subPackages/ticketBooking/ticketBooking.vue

18
pages.json

@ -138,6 +138,24 @@
"navigationStyle": "custom"
}
},
{
"path": "hotelHomestay/detail",
"style": {
"navigationBarTitleText": "酒店详情"
}
},
{
"path": "hotelHomestay/policy",
"style": {
"navigationBarTitleText": "设施/政策"
}
},
{
"path": "hotelHomestay/order",
"style": {
"navigationBarTitleText": "酒店民宿"
}
},
{
"path": "food/taocanDetail",
"style": {

9
static/js/CommonFunction.js

@ -196,3 +196,12 @@ Date.prototype.Format = function(fmt)
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
return fmt;
}
// 获取最大优惠券 params:{money:100,sku_ids:1,2}
Vue.prototype.getMaxCoupon = async function (param) {
let res = await this.Post(param, "/api/coupon/use_max_coupon_list")
if (res.code == 1 && res.data.id) {
this.$store.commit("choseCoupon",res.data);
}
return res.data
}

2
static/js/request.js

@ -16,7 +16,7 @@ Vue.prototype.Post = (params, apiurl) => {
data: params || {},
header: params.header || {
'content-type': 'application/json',
'token': params.token || '2dd9b712-f118-41f6-b3a8-602e4fbb0ce3'
'token': params.token || '75895d8b-1804-42e1-8be8-bfdaa9574a5f'
},
success: res => {
uni.hideLoading()

761
subPackages/hotelHomestay/detail.vue

@ -0,0 +1,761 @@
<template>
<view class="bg">
<view class="swipe-box">
<swiper class="swiper" :autoplay="true" :interval="3000" :duration="1000" circular indicator-dots indicator-color="rgba(255,255,255,.5)"
indicator-active-color="#fff" @change="swiperChange">
<swiper-item v-for="(item, index) in info.list_images.split(',')" :key="item.id">
<view class="swiper-item">
<image class="item-img" :src="showImg(item)" mode="aspectFill"></image>
</view>
</swiper-item>
</swiper>
<view class="swiper-pointer">
{{swiperCurrent}}/{{info.list_images.split(',').length}}
</view>
<view class="collect" @click.stop="collect()">
<image src="https://tongli.sz-trip.com/uploads/20240829/9dbb80cafe8375bd6d5c96fccb617962.png" v-if="info.is_collect"></image>
<image src="https://tongli.sz-trip.com/uploads/20240826/564af778708591f5de29174d3b14bbff.png" v-else></image>
</view>
</view>
<view class="detail-container">
<view class="common-container info-container">
<view>
<view class="info-title text-overflowRows">{{info.title}}</view>
</view>
<view class="flex-between time-container">
<view class="flex-1 w-1rpx">
<view class="tag-container no-scrollbar" v-if="info.label">
<view class="tag" v-for="(tag,tagIndex) in info.label.split(',')" :key="tagIndex">{{tag}}</view>
</view>
</view>
<view class="policy-btn flex-shrink-0 flex flex-items-center" style="justify-content: flex-end;" @click="goPolicy">
设施/政策
<uni-icons color="#71B580" style="height: 35rpx;" type="right" size="12"></uni-icons>
</view>
</view>
<view class="flex-between">
<view class="address-container flex flex-shrink-0 flex-between" @click="goMap">
<view class="address-title text-overflowRows">
{{info.address}}
</view>
<view class="flex-column flex-center">
<image :src="showImg('/uploads/20240827/5b19517f2a630f3a766ea03ac621a3be.png')">
<view class="tip" style="padding-top: 11rpx;">地图</view>
</view>
</view>
<view class="phone-container flex-column flex-center" @click="callPhone">
<image :src="showImg('/uploads/20240829/b38a84c91eef12d3040deaef50eaf697.png')">
<view class="tip" style="padding-top: 11rpx;">电话</view>
</view>
</view>
</view>
<view class="common-container hotel-container" style="padding: 0;background: none;">
<view class="order-time flex-between" style="justify-content: space-around;"
@click="openCalendar()">
<view class="time">
<view style="font-size: 35rpx;font-weight: bold;">{{new Date(selectDate.startDay).Format('MM-dd')}}</view>
<view style="padding:0 14rpx">{{ ShowDateDay(new Date(selectDate.startDay).getDay()) }}</view>
<view style="color: #71B580;">入住</view>
</view>
<view class="cal-day">
{{selectDate.differDays}}
</view>
<view class="time">
<view style="font-size: 35rpx;font-weight: bold;">{{new Date(selectDate.endDay).Format('MM-dd')}}</view>
<view style="padding:0 14rpx">{{ShowDateDay(new Date(selectDate.endDay).getDay()) }}</view>
<view style="color: #71B580;">离店</view>
</view>
</view>
<view style="padding:0 34rpx;">
<view v-for="(item, index) in sku" :key="index">
<view class="scenic-item flex" v-if="(!showMore&&index<=2)||showMore">
<view class="scenic-image flex-shrink-0">
<image style="width: 100%;height: 100%;" :src="showImg(item.image)"></image>
</view>
<view class="flex-1 w-1rpx flex-column" style="padding: 14rpx;justify-content: space-between;">
<view class="flex flex-items-center" @click="viewDetail(item)">
<view class="scenic-title text-overflow">{{item.title}}</view>
<uni-icons style="height: 40rpx;font-weight: bold;" type="right" size="15"></uni-icons>
</view>
<view>
<view class="scenic-content text-overflowRows">
<text>{{item.showTag}}</text>
<text>{{item.lastShowTag}}</text>
</view>
</view>
<view class="price-container">
<view class="price">{{item.price/100}}</view>
<view class="btn" @click="goOrder(item)">预定</view>
</view>
</view>
</view>
</view>
<view class="showMore" v-if="!showMore&&sku.length>3" @click="changeShowMore">
查看剩余房型
</view>
</view>
</view>
<view style="padding: 0rpx 29rpx;">
<view class="box-title">酒店介绍</view>
<view class="common-container" style="padding: 30rpx 40rpx;">
<view class="" id="cpts" v-html="formateRichText(info.feature_content)"></view>
</view>
<view class="box-title">设施与政策</view>
<view class="common-container policy-container" style="padding: 30rpx 40rpx;">
<view class="common-container1">
<view class="info-title1 box-title1 text-overflowRows">{{info.title}}</view>
<view class="flex-between phone-container1">
<view>
联系电话{{info.tel}}
</view>
<view @click="callPhone">
<image :src="showImg('/uploads/20240830/8b5750ff23837fe4a187e13775f9424c.png')">
</view>
</view>
</view>
<view class="common-container1">
<view class="box-title1">服务设施</view>
<view style="padding-top: 34rpx;" v-html="formateRichText(info.cost_content)"></view>
</view>
<view class="common-container1">
<view class="box-title1">入住须知</view>
<view style="padding-top: 34rpx;" v-html="formateRichText(info.describe_content)"></view>
</view>
</view>
</view>
</view>
<!-- 酒店详情弹窗 -->
<uni-popup ref="popupRule" type="bottom" :safe-area="false" background-color="#F7F7F7">
<view class="popup-content-date" >
<view class="popup-content-title flex">
<view class="flex-1 w-1rpx text-overflow">
{{skuInfo.title}}
</view>
<img src="https://static.ticket.sz-trip.com/taizhou/images/cha.png" @click="closePopupRule"
style="width: 31rpx;height: 31rpx;" class="flex-shrink-0">
</view>
<view class="content">
<view class="swipe-box" style="height: 347rpx;" v-if="skuInfo.list_images">
<swiper class="swiper" :autoplay="true" :interval="3000" :duration="1000" circular indicator-dots indicator-color="rgba(255,255,255,.5)"
indicator-active-color="#fff" @change="popSwiperChange" :current="0">
<swiper-item v-for="(item, index) in skuInfo.list_images.split(',')" :key="item.id">
<view class="swiper-item" style="height: 347rpx;">
<image class="item-img pop-swiper-image" :src="showImg(item)" mode="aspectFill"></image>
</view>
</swiper-item>
</swiper>
<view class="swiper-pointer" style="right:30rpx;bottom: 20rpx;">
{{popSwiperCurrent}}/{{skuInfo.list_images.split(',').length}}
</view>
</view>
<view class="pop-detail-container">
<view class="pop-detail-title">房型信息</view>
<view v-html="formateRichText(skuInfo.use_explain)"></view>
</view>
</view>
</view>
</uni-popup>
<uni-calendar ref="calendar" class="uni-calendar--hook" :clear-date="false"
:insert="false" :range="true" :startDate="calendarParam.startDate"
:endDate="calendarParam.endDate" @confirm="confirmCalendar"/>
</view>
</template>
<script>
export default {
data() {
return {
headImg: "https://tongli.sz-trip.com/uploads/20240826/8653c32761e01ee683505eddba1ae22b.png",
id: null,
swiperCurrent: 1,
popSwiperCurrent: 1,
info: {list_images:''},
sku: [],
showMore: false,
skuInfo: {}, //
selectDate: {
startDay:new Date().Format('yyyy-MM-dd'),
endDay:new Date((new Date()).getFullYear(), (new Date()).getMonth(), new Date().getDate()+1).Format('yyyy-MM-dd'),
differDays: 1
},
minSeldDate: new Date().Format('yyyy-MM-dd'),
maxSeldDate: new Date((new Date()).getFullYear(), (new Date()).getMonth() + 3, 0).Format('yyyy-MM-dd'),
calendarParam: {
stratDate:'',endDate: '', selected: []
},
}
},
onShow(options) {
},
onLoad(options) {
this.id = options.id;
this.getInfo();
this.getGoodsList()
},
methods: {
swiperChange (e) {
this.swiperCurrent = e.detail.current+1
},
popSwiperChange (e) {
this.popSwiperCurrent = e.detail.current+1
},
changeShowMore () {
this.showMore = !this.showMore
},
goPolicy () {
uni.navigateTo({
url:`/subPackages/hotelHomestay/policy?id=${this.id}`
})
},
callPhone () {
let _this = this
uni.showActionSheet({
itemList: [this.info.tel,'呼叫'],
success: function (res) {
_this.clickPhone(_this.info.tel)
}
});
// this.clickPhone(this.info.tel)
},
goMap () {
uni.openLocation({
latitude: Number(this.info.lat),
longitude: Number(this.info.lon),
name: this.info.title,
address: this.info.address,
success: function () {
console.log('success');
}
});
},
//
getInfo() {
this.Post({id: this.id},'/api/scenic/getScenicById').then(res => {
if (res.data.flag == 0) {
uni.showToast({title: '商品不存在或已下架',icon: 'none'})
setTimeout(() => {this.goBack()}, 2000)
}
let info = res.data;
try {
info.times_list_info = JSON.parse(info.times_list)[0]
} catch(e) {
console.log(e)
info.times_list_info = {start:'',end:''}
}
this.info = info
console.log(info)
});
},
// id
getGoodsList(){
this.Post({
scenic_id: this.id
},'/api/scenic/getGoodsByScenicId').then(res => {
let result = res.data || []
let data = []
result.forEach(item=>{
item.specifications.forEach(v=>{
let showTag = ''
let lastShowTag = ''
if (v.specifications_new_tag) {
let tags = v.specifications_new_tag.split(',')
showTag = (tags.slice(0,-1)||[]).join(' | ')
if (tags.length>1) {
showTag += ' | '
}
lastShowTag = tags[tags.length-1]||''
}
v.showTag = showTag
v.lastShowTag = lastShowTag
data.push(v)
})
})
// this.sku = data
this.sku = [...data,...data,...data,...data]
})
},
//
collect() {
this.Post({type: 4,id: this.id},'/api/scenic/collect').then(res => {
if (res) {
uni.showToast({title: res.msg,icon: 'none'});
this.info.is_collect = !this.info.is_collect
}
});
},
calDate (startDate, endDate) {
var start = new Date(startDate);
var end = new Date(endDate);
var diff = end - start;
var days = Math.floor(diff / (1000 * 60 * 60 * 24)); //
return days;
},
openCalendar () {
this.calendarParam = {
startDate: this.minSeldDate,
endDate: this.maxSeldDate,
// selected: this.allSeldDate.filter(v=>v.store>0).map(v=>{
// return {
// date: v.date,
// info: ''+this.showNoPriceNew(v.money),
// notNeedDot:true,
// }
// })
}
this.$refs.calendar.open();
},
confirmCalendar (val) {
if (val.range.data.length<2) {
uni.showToast({
title:'请选择日期',
icon:'none'
})
return
}
this.selectDate.startDay = val.range.before
this.selectDate.endDay = val.range.after
this.selectDate.differDays = this.calDate(this.selectDate.startDay,this.selectDate.endDay)
},
//
viewDetail (item) {
this.skuInfo = item
this.popSwiperCurrent = 1
this.openPopRule()
},
//
goOrder (item) {
// if (item.xx) {
// return
// }
let param = {
skuInfo: item,
selectDate: this.selectDate
}
uni.setStorageSync('hotelOrderInfo', JSON.stringify(param))
uni.navigateTo({
url:`/subPackages/hotelHomestay/order`
})
},
closePopupRule() {
this.$refs.popupRule.close()
},
openPopRule(){
this.$refs.popupRule.open()
},
//
showNoPriceNew(price) {
if (price && price > 0) {
return (price / 100)
} else {
return '0'
}
},
}
}
</script>
<style scoped lang="scss">
*{
box-sizing: border-box;
}
.bg{
min-height: 100vh;
background: #F8F8F8;
}
.swipe-box {
height: 484rpx;
position: relative;
.swiper-item-num {
width: 90rpx;
height: 40rpx;
background: rgba(0, 0, 0, 0.5);
border-radius: 20rpx;
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #ffffff;
text-align: center;
line-height: 40rpx;
position: absolute;
right: 30rpx;
bottom: 50rpx;
}
.collect{
position: absolute;
right: 36rpx;
top: 36rpx;
font-size: 23rpx;
image{
width: 36rpx;
height: 36rpx;
}
}
.swiper-pointer{
position: absolute;
right: 36rpx;
bottom: 80rpx;
background: rgba(22,22,22,0.5);
border-radius: 23rpx;
font-family: PingFang SC;
font-weight: 500;
font-size: 24rpx;
color: #FFFFFF;
padding: 6rpx 14rpx;
}
}
.swiper {
height: 484rpx;
position: relative;
.swiper-item {
width: 100%;
height: 484rpx;
.item-img {
width: 750rpx;
height: 484rpx;
}
.item-img.pop-swiper-image{
height: 347rpx;
border-radius: 13rpx;
}
}
}
.detail-container{
width: 100%;
z-index: 2;
position: relative;
top: -52rpx;
}
.common-container{
background: white;
border-radius: 20rpx;
margin-bottom: 20rpx;
padding: 22rpx 26rpx;
}
.info-container{
font-family: PingFang;
font-weight: 500;
font-size: 27rpx;
color: #000000;
padding: 36rpx 29rpx;
.time-container{
padding: 22rpx 0;
.tag-container{
display: flex;
flex-wrap: nowrap;
overflow-x: auto;
.tag{
border-radius: 5rpx 4rpx 4rpx 5rpx;
border: 1px solid #71B580;
padding: 7rpx 14rpx;
font-family: PingFang SC;
font-weight: 500;
font-size: 25rpx;
color: #71B580;
text-align: center;
margin-right: 15rpx;
flex-shrink: 0;
}
}
.policy-btn{
width: 160rpx;
height: 35rpx;
font-family: PingFang SC;
font-weight: 500;
font-size: 27rpx;
text-align: right;
color: #71B580;
}
}
.info-title{
width: 100%;
height: 85rpx;
font-family: PingFang SC;
font-weight: bold;
font-size: 35rpx;
color: #000000;
}
.address-container{
width: 587rpx;
height: 107rpx;
border-radius: 20rpx;
padding: 25rpx 20rpx 25rpx 33rpx;
font-family: PingFang SC;
font-weight: 500;
font-size: 27rpx;
color: #000000;
background-color: #E8F6EB;
background-image: url('https://tongli.sz-trip.com/uploads/20240830/e8089886a03786e925bd4d4bbc441320.png');
background-repeat: no-repeat;
background-size: 100% 100%;
image{
width: 30rpx;
height: 30rpx;
}
.tip{
font-family: PingFang SC;
font-weight: 500;
font-size: 24rpx;
color: #333333;
}
}
.phone-container{
width: 93rpx;
height: 107rpx;
background: #E8F6EB;
border-radius: 20rpx;
font-family: PingFang SC;
font-weight: 500;
font-size: 24rpx;
color: #333333;
image{
width: 30rpx;
height: 30rpx;
}
.tip{
font-family: PingFang SC;
font-weight: 500;
font-size: 24rpx;
color: #333333;
}
}
}
.hotel-container{
.order-time{
height: 107rpx;
background: linear-gradient(180deg, #FFFFFF, #F7F7F7);
.time{
display: flex;
font-family: PingFang SC;
font-size: 24rpx;
color: #000000;
align-items: center;
}
}
.cal-day{
background: #E8F6EB;
border-radius: 17rpx;
padding: 5rpx 16rpx;
font-family: PingFang SC;
font-weight: 500;
font-size: 24rpx;
color: #000000;
}
.showMore{
width: 100%;
height: 67rpx;
background: #FFFFFF;
border-radius: 20rpx;
font-family: PingFang SC;
font-weight: 500;
font-size: 27rpx;
color: #666666;
line-height: 67rpx;
text-align: center;
}
}
.box-title {
margin: 52rpx 0 26rpx 12rpx;
font-family: PingFang;
font-weight: bold;
font-size: 37rpx;
color: #000000;
}
.address-icon{
margin-right: 9rpx;
width: 26rpx;
height: 26rpx;
}
.scenic-item{
display: flex;
width: 100%;
height: 213rpx;
background: #FFFFFF;
border-radius: 20rpx;
padding: 7rpx;
margin-bottom: 20rpx;
.scenic-image{
width: 173rpx;
height: 100%;
flex-shrink: 0;
image{
border-radius: 20rpx;
}
}
.scenic-title {
font-family: PingFang SC;
font-weight: bold;
font-size: 31rpx;
color: #000000;
flex-shrink: 0;
max-width: 90%;
}
.scenic-content{
width: 100%;
height: 66rpx;
font-family: PingFang SC;
font-weight: 500;
font-size: 24rpx;
color: #666666;
line-height: 33rpx;
text:last-of-type{
color: #71B580;
}
}
.price-container{
width: 100%;
display: flex;
align-items: center;
justify-content: flex-end;
.price{
font-family: PingFang SC;
font-weight: bold;
font-size: 37rpx;
color: #D60000;
padding-right: 20rpx;
}
.price::before{
content: "¥";
font-size: 24rpx;
}
.btn{
width: 120rpx;
height: 47rpx;
background: linear-gradient(90deg, #FD6F34, #F4A61F);
border-radius: 23rpx;
font-family: PingFang SC;
font-weight: bold;
font-size: 29rpx;
color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
}
}
}
.bottom {
.notice {
font-weight: 400;
color: #0B898E;
}
}
.popup-content-date{
position: relative;
background: #F7F7F7;
top: -33rpx;
padding: 25rpx 44rpx;
border-radius: 33rpx;
.popup-content-title{
font-family: PingFang SC;
font-weight: 500;
font-size: 35rpx;
color: #000000;
text-align: center;
padding-bottom: 26rpx;
}
.pop-detail-container{
background: #FFFFFF;
border-radius: 13rpx;
padding: 20rpx;
margin-top: 26rpx;
max-height: 600rpx;
.pop-detail-title{
font-family: PingFang SC;
font-weight: 500;
font-size: 32rpx;
color: #000000;
}
}
}
.policy-container{
.common-container1{
width: 100%;
background: white;
border-radius: 13rpx;
margin-bottom: 20rpx;
padding: 20rpx 18rpx;
}
.box-title1 {
font-family: PingFang SC;
font-weight: bold;
font-size: 35rpx;
color: #000000;
}
.info-title1{
height: 88rpx;
}
.phone-container1{
padding-top: 20rpx;
font-family: PingFang SC;
font-weight: 400;
font-size: 28rpx;
color: #000000;
image{
width: 33.33rpx;
height: 33.33rpx;
}
}
}
</style>

45
subPackages/hotelHomestay/hotelHomestay.vue

@ -9,10 +9,10 @@
<view class="goodBox">
<navigator :url="'/subPackages/ticketBooking/detail?id='+item.id" class="goodItem flex-column" v-for="(item,index) in list" :key="index">
<navigator :url="'/subPackages/hotelHomestay/detail?id='+item.id" class="goodItem flex-column" v-for="(item,index) in list" :key="index">
<view class="left-image flex-shrink-0 relative">
<image class="left-image " :src="showImg(item.image)" mode="aspectFill"></image>
<view class="collect" @click="like(item)">
<view class="collect" @click.stop="like(item)">
<image src="https://tongli.sz-trip.com/uploads/20240826/81b1f86ff8534db09472853b4c0b6748.png" v-if="item.is_collect"></image>
<image src="https://tongli.sz-trip.com/uploads/20240826/564af778708591f5de29174d3b14bbff.png" v-else></image>
</view>
@ -22,11 +22,12 @@
<view class="contentBox flex-column flex-1 h-1rpx">
<view class="title text-overflow">{{item.title}}</view>
<view class="flex-between">
<view class="tag-container">
<view class="tag">盐都精选</view>
<view class="tag">盐都精选</view>
<view class="flex-1 w-1rpx">
<view class="tag-container no-scrollbar" v-if="item.label">
<view class="tag" v-for="(tag,tagIndex) in item.label.split(',')" :key="tagIndex">{{tag}}</view>
</view>
</view>
<view class="priceBox">
<view class="priceBox flex-shrink-0">
<view class="price">{{showPrice(item.price)}}</view>
</view>
</view>
@ -39,7 +40,7 @@
</view>
</navigator>
</view>
<view class="finished-text" v-if="finished">没有更多数据了</view>
<!-- <view class="finished-text" v-if="finished">没有更多数据了</view> -->
</view>
</template>
@ -59,20 +60,17 @@
headImg:null,
navList: [],
actNavIndex: 0,
type_id: 9,//id
type_id: 11,//id
}
},
onShow() {
this.headImg = 'https://tongli.sz-trip.com/uploads/20240826/8653c32761e01ee683505eddba1ae22b.png'
this.finished = false
this.list = [
{id:1, title:'景点名称景点名称景点名称 景点名称',
address:'景点名称景点名称景点名称 景点名称景点名称景点名称景点名称 景点名称',price:10000,
image:'https://tongli.sz-trip.com/uploads/20240826/a87488f6225789aa19dbb437671d388d.png',
}
]
// this.getHeadImg('piaowu')
},
onReady() {
this.getList()
},
onLoad(options) {
let that = this
uni.getSystemInfo({
@ -107,10 +105,11 @@
//
getList(){
this.Post({
tag_id: this.navList[this.actNavIndex].id,
offset: this.list.length,
limit: 10
},'https://yjdtadmin.sz-trip.com/api/scenic/getScenicByTagId').then(res => {
scenic_type_id: this.type_id,offset: this.list.length,limit: 10,
lon: uni.getStorageSync('location').lon || '120',
lat: uni.getStorageSync('location').lat || '30',
},
'/api/Scenic/getScenicByType').then(res => {
this.list = [...this.list, ...res.data];
if (res.data.length < 10) {
this.finished = true
@ -123,9 +122,9 @@
this.Post({
type: 4,
id: item.id
}, 'https://yjdtadmin.sz-trip.com/api/scenic/collect').then(res => {
if (res.code == 200) {
uni.showToast({title: res.msg})
}, '/api/scenic/collect').then(res => {
if (res.code == 1) {
uni.showToast({title: res.msg,icon:'none'})
if (item.is_collect == 1) {
item.is_collect = 0
} else {
@ -213,6 +212,8 @@
.tag-container{
display: flex;
flex-wrap: nowrap;
overflow-x: auto;
.tag{
background: rgba(205,233,209,0.3);
border-radius: 7rpx 5rpx 5rpx 7rpx;
@ -224,11 +225,13 @@
color: #4E7956;
text-align: center;
margin-right: 12rpx;
flex-shrink: 0;
}
}
.priceBox{
width: 120rpx;
.price{
font-family: PingFang SC;
font-weight: bold;

600
subPackages/hotelHomestay/order.vue

@ -0,0 +1,600 @@
<template>
<view class="bg">
<view class="detail-container">
<view class="common-container info-container">
<view class="flex-between" style="align-items: flex-start;">
<view class="info-title text-overflowRows">{{skuInfo.title}}</view>
<view class="policy-btn flex-shrink-0 flex flex-items-center" @click="openPopRule">
房型信息
<uni-icons color="#71B580" style="height: 32rpx;" type="right" size="12"></uni-icons>
</view>
</view>
<view class="tag-container text-overflow">
<text>{{skuInfo.showTag}}</text>
<text>{{skuInfo.lastShowTag}}</text>
</view>
<view class="order-time flex-between" style="justify-content: space-around;">
<view class="time">
<view style="font-size: 35rpx;font-weight: bold;">{{new Date(selectDate.startDay).Format('MM-dd')}}</view>
<view style="padding-left:14rpx">{{ ShowDateDay(new Date(selectDate.startDay).getDay()) }}</view>
<view>入住</view>
</view>
<view class="cal-day">
{{selectDate.differDays}}
</view>
<view class="time">
<view style="font-size: 35rpx;font-weight: bold;">{{new Date(selectDate.endDay).Format('MM-dd')}}</view>
<view style="padding-left:14rpx">{{ShowDateDay(new Date(selectDate.endDay).getDay()) }}</view>
<view>离店</view>
</view>
</view>
<view class="notice-container">
<view class="flex">
<view class="flex-shrink-0" style="padding-top: 4rpx;">
<image :src="showImg('/uploads/20240830/aa84c8b1de80651f645fed67a1997ced.png')"></image>
</view>
<view class="flex-1 w-1rpx" style="padding-left: 14rpx;">
<view>订单确认后您在{{new Date(selectDate.startDay).Format('yyyy年MM月dd日')}}20:00前之免费取消或 变更订单20:00后将收取30%房费作为违约费用</view>
<view style="color: #F84A56;">预期不可取消或/修改扣取全额房费</view>
</view>
</view>
<view class="flex" style="padding-top: 22rpx;">
<view class="flex-shrink-0" style="padding-top: 4rpx;">
<image :src="showImg('/uploads/20240830/59d2f01f0391f72a537cc9004bc2071d.png')"></image>
</view>
<view class="flex-1 w-1rpx" style="padding-left: 14rpx;">
<view>证件要求大陆居民身份证登记入住</view>
</view>
</view>
</view>
</view>
<view class="common-container form-container">
<view class="form-title">
<text style="font-weight: bold;font-size: 35rpx;padding-right: 28rpx;">预定信息</text>
<text>姓名需与证件一致</text>
</view>
<view class="btn-box flex-column">
<view class="line w-full" style="border-top: none;">
<view class="left">房间数</view>
<view class="input flex" style="justify-content: flex-end;">
<view class="num-box">
<view :class="['ctrl',buyNum>1?'':'disabled']" @click="reduce()">-</view>
<input class="num" type="text" v-model="buyNum" :disabled='true' />
<view :class="['ctrl']" @click="plus()">+</view>
</view>
</view>
</view>
<view class="line w-full" v-for="(user,index) in roomUser" :key="index">
<view class="left">房间{{index+1}}</view>
<input class="input" type="text" placeholder="请输入住客姓名" v-model="user.name" />
</view>
<view class="line w-full">
<view class="left">联系电话</view>
<view class="flex flex-items-center input">
<input class="input" type="text" placeholder="请输入联系手机号" v-model="phone" />
<uni-icons v-if="phone.length>0" style="margin-left: 30rpx;"
type="closeempty" size="14" @click="phone = ''"></uni-icons>
</view>
</view>
</view>
</view>
</view>
<view class="btn-list">
<view class="price-box">
<view class="text">合计:</view>
<view class="price">{{ total() }}</view>
<!-- <view class="post-text" v-if="sendType==1&&post">含邮费:¥{{ post / 100 }}</view> -->
</view>
<view class="btn" @click="order()">立即预订</view>
</view>
<!-- 酒店详情弹窗 -->
<uni-popup ref="popupRule" type="bottom" :safe-area="false" background-color="#F7F7F7">
<view class="popup-content-date" >
<view class="popup-content-title flex">
<view class="flex-1 w-1rpx text-overflow">
{{skuInfo.title}}
</view>
<img src="https://static.ticket.sz-trip.com/taizhou/images/cha.png" @click="closePopupRule"
style="width: 31rpx;height: 31rpx;" class="flex-shrink-0">
</view>
<view class="content">
<view class="swipe-box" style="height: 347rpx;" v-if="skuInfo.list_images">
<swiper class="swiper" :autoplay="true" :interval="3000" :duration="1000" circular indicator-dots indicator-color="rgba(255,255,255,.5)"
indicator-active-color="#fff" @change="popSwiperChange" :current="0">
<swiper-item v-for="(item, index) in skuInfo.list_images.split(',')" :key="item.id">
<view class="swiper-item" style="height: 347rpx;">
<image class="item-img pop-swiper-image" :src="showImg(item)" mode="aspectFill"></image>
</view>
</swiper-item>
</swiper>
<view class="swiper-pointer" style="right:30rpx;bottom: 20rpx;">
{{popSwiperCurrent}}/{{skuInfo.list_images.split(',').length}}
</view>
</view>
<view class="pop-detail-container">
<view class="pop-detail-title">房型信息</view>
<view v-html="formateRichText(skuInfo.use_explain)"></view>
</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
export default {
data() {
return {
id: null,
popSwiperCurrent: 1,
skuInfo: {}, //
selectDate: {
startDay:new Date().Format('yyyy-MM-dd'),
endDay:new Date((new Date()).getFullYear(), (new Date()).getMonth(), new Date().getDate()+1).Format('yyyy-MM-dd'),
differDays: 1
},
phone: '',
buyNum: 1,
roomUser: [{
name: ''
}]
}
},
onShow(options) {
},
onLoad(options) {
this.initOrderDate()
},
methods: {
popSwiperChange (e) {
this.popSwiperCurrent = e.detail.current+1
},
//
initOrderDate () {
let data = {}
try {
data = JSON.parse(uni.getStorageSync('hotelOrderInfo'));
} catch (e) {
data = {}
setTimeout(()=>{
uni.navigateBack()
},1000)
}
this.skuInfo = data.skuInfo
this.selectDate = data.selectDate
this.buyNum = 1
this.roomUser = [{name: ''}]
},
//
viewDetail () {
this.popSwiperCurrent = 1
this.openPopRule()
},
plus() {
this.buyNum += 1;
this.roomUser.push({name: ''})
},
reduce() {
if (this.buyNum > 1) {
this.buyNum -= 1;
this.roomUser.pop()
}
},
total () {
return this.skuInfo.price/100 * this.buyNum || 0
},
order () {
//
if (!this.isTel(this.phone)){
uni.showToast({
title: '请输入自提人手机号',
icon: 'none'
});
return;
}
if (this.roomUser.some(v=>v.trim().length<0)) {
uni.showToast({
title: '请输入住客姓名',
icon: 'none'
});
return;
}
let goods = []
let goodsItem = {
num:this.buyNum,
specifications_id: this.skuInfo.id,
start_date: this.selectDate.startDay,
end_date: this.selectDate.endDay,
customer_name: this.roomUser.map(v=>v.name).join('、'),
reserve_mobile: this.phone,
}
goods.push(goodsItem)
let data = {
goods: goods,
reserve_phone: this.phone,
}
return
this.Post({
method: 'POST',
data: JSON.stringify(data)
},'/api/order/place').then(res => {
console.log('成功');
if(res.code == 200){
uni.removeStorageSync('hotelOrderInfo')
this.Post({
order_id: res.data.order_id,
type: "miniprogram",
platform: 'miniprogram'
},'/api/pay/unify').then(res => {
if(res.data){
uni.requestPayment({
nonceStr: res.data.nonceStr,
package: res.data.package,
paySign: res.data.paySign,
signType: res.data.signType,
timeStamp: res.data.timeStamp,
complete() {
uni.navigateTo({
url: '/subPackages/order/trades'
})
}
})
}
})
}
})
},
closePopupRule() {
this.$refs.popupRule.close()
},
openPopRule(){
this.$refs.popupRule.open()
},
}
}
</script>
<style scoped lang="scss">
*{
box-sizing: border-box;
}
.bg{
min-height: 100vh;
background: #F8F8F8;
}
.swipe-box {
height: 484rpx;
position: relative;
.swiper-item-num {
width: 90rpx;
height: 40rpx;
background: rgba(0, 0, 0, 0.5);
border-radius: 20rpx;
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #ffffff;
text-align: center;
line-height: 40rpx;
position: absolute;
right: 30rpx;
bottom: 50rpx;
}
.collect{
position: absolute;
right: 36rpx;
top: 36rpx;
font-size: 23rpx;
image{
width: 36rpx;
height: 36rpx;
}
}
.swiper-pointer{
position: absolute;
right: 36rpx;
bottom: 80rpx;
background: rgba(22,22,22,0.5);
border-radius: 23rpx;
font-family: PingFang SC;
font-weight: 500;
font-size: 24rpx;
color: #FFFFFF;
padding: 6rpx 14rpx;
}
}
.swiper {
height: 484rpx;
position: relative;
.swiper-item {
width: 100%;
height: 484rpx;
.item-img {
width: 750rpx;
height: 484rpx;
}
.item-img.pop-swiper-image{
height: 347rpx;
border-radius: 13rpx;
}
}
}
.detail-container{
width: 100%;
padding: 26rpx;
padding-bottom: 200rpx;
}
.common-container{
background: white;
border-radius: 20rpx;
margin-bottom: 20rpx;
padding: 22rpx 26rpx;
}
.info-container{
font-family: PingFang SC;
font-weight: 500;
font-size: 24rpx;
color: #666666;
.info-title{
width: 100%;
font-family: PingFang SC;
font-weight: bold;
font-size: 35rpx;
color: #000000;
}
.policy-btn{
width: 160rpx;
height: 35rpx;
font-family: PingFang SC;
font-weight: 500;
font-size: 24rpx;
color: #666666;
text-align: right;
display: flex;
align-items: center;
justify-content: flex-end;
}
.tag-container{
width: 100%;
padding: 35rpx 0;
}
.time-container{
padding: 22rpx 0;
}
.notice-container{
background:rgba(232, 246, 235, 0.7);
border-radius: 13rpx;
font-family: PingFang SC;
font-weight: 500;
font-size: 23rpx;
color: #000000;
padding: 22rpx 16rpx;
margin-top: 28rpx;
image{
width: 25rpx;
height: 25rpx;
}
}
}
.order-time{
.time{
display: flex;
font-family: PingFang SC;
font-size: 24rpx;
color: #000000;
align-items: center;
}
}
.cal-day{
background: #E8F6EB;
border-radius: 17rpx;
padding: 5rpx 16rpx;
font-family: PingFang SC;
font-weight: 500;
font-size: 24rpx;
color: #000000;
}
.popup-content-date{
position: relative;
background: #F7F7F7;
top: -33rpx;
padding: 25rpx 44rpx;
border-radius: 33rpx;
.popup-content-title{
font-family: PingFang SC;
font-weight: 500;
font-size: 35rpx;
color: #000000;
text-align: center;
padding-bottom: 26rpx;
}
.pop-detail-container{
background: #FFFFFF;
border-radius: 13rpx;
padding: 20rpx;
margin-top: 26rpx;
max-height: 600rpx;
.pop-detail-title{
font-family: PingFang SC;
font-weight: 500;
font-size: 32rpx;
color: #000000;
}
}
}
.btn-list {
width: 100%;
height: 166rpx;
background: #ffffff;
box-shadow: 0rpx -3rpx 9rpx 1rpx rgba(227, 229, 232, 0.5);
display: flex;
position: fixed;
bottom: 0;
padding: 20rpx 20rpx;
align-items: center;
justify-content: space-between;
.btn {
width: 294rpx;
height: 88rpx;
background: #F84A56;
border-radius: 43rpx;
text-align: center;
line-height: 88rpx;
font-size: 36rpx;
font-family: PingFang SC;
font-weight: 500;
color: #FFFFFF;
}
.price-box {
display: flex;
align-items: center;
.text {
font-size: 29rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 500;
color: #333;
}
.price {
margin-left: 15rpx;
font-size: 36rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #fc5109;
&:before {
content: '¥';
display: inline-block;
color: #fc5109;
font-size: 36rpx;
}
}
.post-text {
margin-left: 15rpx;
color: #fc5109;
font-size: 24rpx;
}
}
}
.form-container{
.form-title{
font-family: PingFang SC;
color: #000000;
font-weight: 500;
font-size: 23rpx;
display: flex;
align-items: baseline;
}
.left{
width: 160rpx;
font-family: PingFang SC;
font-weight: bold;
font-size: 29rpx;
color: #000000;
flex-shrink: 0;
}
.line{
display: flex;
align-items: center;
border-top:1rpx solid #D8D8D8;
height: 92rpx;
}
.input{
flex: 1;
}
input{
font-family: PingFang SC;
font-weight: 500;
font-size: 29rpx;
color: #000000;
}
}
.num-box {
display: flex;
align-items: center;
margin-left: 20rpx;
width: 160rpx;
justify-content: space-between;
.num {
text-align: center;
width: 50rpx;
}
.ctrl {
width: 47rpx;
height: 47rpx;
background: #71B580;
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>

110
subPackages/hotelHomestay/policy.vue

@ -0,0 +1,110 @@
<template>
<view class="bg">
<view class="common-container">
<view class="info-title box-title text-overflowRows">{{info.title}}</view>
<view class="flex-between phone-container">
<view>
联系电话{{info.tel}}
</view>
<view @click="callPhone">
<image :src="showImg('/uploads/20240830/8b5750ff23837fe4a187e13775f9424c.png')">
</view>
</view>
</view>
<view class="common-container">
<view class="box-title">服务设施</view>
<view style="padding-top: 34rpx;" v-html="formateRichText(info.cost_content)"></view>
</view>
<view class="common-container">
<view class="box-title">入住须知</view>
<view style="padding-top: 34rpx;" v-html="formateRichText(info.describe_content)"></view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
id: null,
info: {},
}
},
onShow(options) {
},
onLoad(options) {
this.id = options.id;
this.getInfo();
},
methods: {
callPhone () {
let _this = this
uni.showActionSheet({
itemList: [this.info.tel,'呼叫'],
success: function (res) {
_this.clickPhone(_this.info.tel)
}
});
// this.clickPhone(this.info.tel)
},
//
getInfo() {
this.Post({id: this.id},'/api/scenic/getScenicById').then(res => {
if (res.data.flag == 0) {
uni.showToast({title: '商品不存在或已下架',icon: 'none'})
setTimeout(() => {this.goBack()}, 2000)
}
this.info = res.data
});
},
}
}
</script>
<style scoped lang="scss">
*{
box-sizing: border-box;
}
.bg{
min-height: 100vh;
background: #F7F7F7;
padding: 20rpx;
}
.common-container{
width: 100%;
background: white;
border-radius: 13rpx;
margin-bottom: 20rpx;
padding: 20rpx 18rpx;
}
.box-title {
font-family: PingFang SC;
font-weight: bold;
font-size: 35rpx;
color: #000000;
}
.info-title{
height: 88rpx;
}
.phone-container{
padding-top: 20rpx;
font-family: PingFang SC;
font-weight: 400;
font-size: 28rpx;
color: #000000;
image{
width: 33.33rpx;
height: 33.33rpx;
}
}
</style>

16
subPackages/techan/detail.vue

@ -31,7 +31,7 @@
选择
</view>
<view class="flex-1">
{{sku[productIndex].title}}
{{sku[productIndex].title || '暂无可选规格'}}
</view>
</view>
<uni-icons class="flex-shrink-0" style="height: 36rpx;margin-right: 20rpx;" type="right" size="18"></uni-icons>
@ -181,7 +181,7 @@
'/api/goods/getSpecificationsByGoodsId'
).then(res => {
if (res) {
this.sku = res.data;
this.sku = res.data || [];
}
});
},
@ -218,6 +218,14 @@
this.$refs.popup.close()
},
openPop() {
if (!this.sku||this.sku.length<=0) {
uni.showToast({
title:'暂无可选规格',
icon:'none'
})
return
}
if (!this.popShow) {
this.$refs.popup.open()
} else {
@ -227,8 +235,8 @@
order(item) {
let goods = this.sku[this.productIndex]
goods.buyNum = this.buyNum
uni.setStorageSync('order', JSON.stringify(goods)); //
uni.setStorageSync('info', JSON.stringify(this.info)); //
uni.setStorageSync('teChanOrder', JSON.stringify(goods)); //
uni.setStorageSync('teChanInfo', JSON.stringify(this.info)); //
uni.navigateTo({
url: '/subPackages/techan/order'
});

52
subPackages/techan/order.vue

@ -117,7 +117,7 @@
</view>
</view>
<!-- 优惠券 -->
<navigator :url="'/subPackages/order/orderCoupon?needDefault=1&allprice='+ allprice + '&sku_ids='+ info.id" class="tickets-box flex-between top-line">
<navigator :url="'/subPackages/order/orderCoupon?allprice='+ allprice + '&sku_ids='+ info.id" class="tickets-box flex-between top-line">
<view class="order-title">优惠券</view>
<view class="coupon-btn" v-if="coupon==''">
<view class="select">请选择</view>
@ -233,8 +233,8 @@ export default {
},
onLoad() {
this.$store.commit("choseCoupon", "");
this.info = JSON.parse(uni.getStorageSync('order'));
this.detail = JSON.parse(uni.getStorageSync('info'));
this.info = JSON.parse(uni.getStorageSync('teChanOrder'));
this.detail = JSON.parse(uni.getStorageSync('teChanInfo'));
if (!this.info) {
uni.navigateBack();
return
@ -257,6 +257,15 @@ export default {
},
onUnload(){
uni.$off("updateDataByConnect",this.getDataByConnect)
},
onReady () {
this.$nextTick(()=>{
setTimeout(()=>{
this.getMaxCouponData()
},1000)
})
},
methods: {
getContacts() {
@ -409,7 +418,7 @@ export default {
}
} else{
price = ((this.info.money) * this.info.buyNum + postPrice) - (((this.info.money) * this.info.buyNum + postPrice) * this.coupon.percent)
price = ((this.info.money) * this.info.buyNum + postPrice) - (((this.info.money) * this.info.buyNum + postPrice) * this.coupon.percent/100)
}
} else {
price = (this.info.money) * this.info.buyNum + postPrice
@ -441,7 +450,7 @@ export default {
});
return;
}
if (!this.IsTel(this.pickupPerson)) {
if (!this.IsTel(this.pickupPerson.phone)) {
uni.showToast({
title: '请输入自提人手机号',
icon: 'none'
@ -462,7 +471,6 @@ export default {
if (this.sendType == 2) {
goodsItem.extract_id = this.pickupAddress.id;
goodsItem.contact_id = this.pickupPerson.id;
} else if (this.sendType == 1){
goodsItem.consignee_id = this.contacts.id
}
@ -473,9 +481,8 @@ export default {
coupon: this.coupon ? this.coupon.id : "",
remark: this.remark,
is_post: this.info.is_post,
reserve_name: this.reserve_name,
reserve_phone: this.reserve_phone,
reserve_idcard: this.reserve_idcard
reserve_name: this.pickupPerson.name,
reserve_phone: this.pickupPerson.phone,
};
this.Post(
{
@ -484,6 +491,8 @@ export default {
},
'/api/order/place'
).then(res => {
uni.removeStorageSync('teChanOrder')
uni.removeStorageSync('teChanInfo')
if (res.code == 1) {
this.Post(
{
@ -523,6 +532,15 @@ export default {
}
},
//
async getMaxCouponData () {
let param = {money:this.allprice,sku_ids:this.info.id}
let res = await this.getMaxCoupon(param)
if (res.id) {
this.coupon = res
}
}
}
@ -801,20 +819,20 @@ view {
}
}
.btn-list {
width: 750rpx;
width: 100%;
height: 166rpx;
background: #ffffff;
box-shadow: 0rpx -3rpx 9rpx 1rpx rgba(227, 229, 232, 0.5);
display: flex;
position: fixed;
bottom: 0;
padding: 20rpx 50rpx;
padding: 20rpx 20rpx;
align-items: center;
justify-content: space-between;
.btn {
width: 294rpx;
height: 88rpx;
background: linear-gradient(90deg, #F84A56, #FF9834);
background: #F84A56;
border-radius: 43rpx;
text-align: center;
line-height: 88rpx;
@ -829,14 +847,14 @@ view {
display: flex;
align-items: center;
.text {
font-size: 28rpx;
font-size: 29rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #393b3e;
font-weight: 500;
color: #333;
}
.price {
margin-left: 15rpx;
font-size: 48rpx;
font-size: 36rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #fc5109;
@ -844,7 +862,7 @@ view {
content: '¥';
display: inline-block;
color: #fc5109;
font-size: 24rpx;
font-size: 36rpx;
}
}
.post-text {

15
subPackages/ticketBooking/detail.vue

@ -25,7 +25,7 @@
<image class="address-icon flex-shrink-0" :src="showImg('/uploads/20240827/3d357e6e562de9395f373dc380a790a7.png')" mode=""></image>
<view class="title text-overflowRows">
<text style="margin-right: 28rpx;">营业时间</text>
{{info.times_list_info.start}}-{{info.times_list_info.end}}
{{info.open_description}}
</view>
</view>
<view></view>
@ -44,8 +44,8 @@
</view>
</view>
<view class="box-title">门票预定</view>
<view class="common-container">
<view class="box-title" v-if="sku.length>0">门票预定</view>
<view class="common-container" v-if="sku.length>0">
<view class="scenic-list" v-for="(item, index) in sku" :key="index">
<view class="list-title text-overflow">{{ item.title }}</view>
<view class="scenic-item com-flex-tao" v-for="(itemSku, indexSku) in item.specifications" :key="indexSku">
@ -76,7 +76,7 @@
</view>
</view>
<view class="box-title">景点简</view>
<view class="box-title"></view>
<view class="common-container">
<view class="" id="cpts" v-html="formateRichText(info.feature_content)"></view>
</view>
@ -321,7 +321,12 @@
let orderSkuIndex = this.selectGoods.specifications.findIndex(v=>v.id == that.skuInfo.id)
let item = this.selectGoods.specifications.splice(orderSkuIndex, 1)[0]; //
item.buyNum = 1
item.selPeople = [{}]
item.selPeople = [
{
id:null,id_number:null,name:null,
tel:null,user_id:null,age:null,
},
]
this.selectGoods.specifications.unshift(item);
let param = {

203
subPackages/ticketBooking/order.vue

@ -28,17 +28,30 @@
</view>
<view class="people-box" >
<view class="people-box-sku" v-for="(skuItem,skuIndex) in pInfo.specifications.filter(v=>v.buyNum>=1)" :key="skuIndex">
<view>{{skuItem.title}}</view>
<view v-for="(person,personIndex) in skuItem.selPeople" :key="personIndex" @click="person.id=1;showAddressPopUp(person)">
<view v-if="person.id">123</view>
<view v-else>点击添加出行人信息</view>
<!-- 按地址引用 不能用filter -->
<!-- <view class="people-box-sku" v-for="(skuItem,skuIndex) in pInfo.specifications.filter(v=>v.buyNum>=1)" :key="skuIndex"> -->
<view v-for="(skuItem,skuIndex) in pInfo.specifications" :key="skuIndex">
<view class="people-box-sku" v-if="skuItem.buyNum>=1">
<view>{{skuItem.title}}</view>
<view v-for="(person,personIndex) in skuItem.selPeople" :key="personIndex" @click="showAddressPopUp(person,skuItem.selPeople)">
<view v-if="person.id" class="flex">
<view>出行人1</view>
<view>{{person.name}}</view>
</view>
<view v-else>点击添加出行人信息</view>
</view>
</view>
</view>
</view>
<view class="btn-list">
<view class="price-box">
<view class="text">合计:</view>
<view class="price">{{ 10 }}</view>
<!-- <view class="post-text" v-if="sendType==1&&post">含邮费:¥{{ post / 100 }}</view> -->
</view>
<view class="btn" @click="order()">立即购买</view>
</view>
<!-- 选择出行人 -->
<uni-popup ref="addressPopup" type="bottom" backgroundColor="#F4F4F4" >
<view class="people-popup">
@ -50,7 +63,8 @@
</view>
<view class="button">添加出行人</view>
<view class="popup-list" v-if="addressList.length > 0">
<view :class="['popup-item',addressSelect.id==item.id?'active':'']" v-for="(item, index) in addressList" :key="index" @click="seldThisAddress(item)">
<view :class="['popup-item',addressSelect.id==item.id?'active':'',currentPerson.id!=item.id&&currentPersonIds.includes(item.id)?'disabled':'']"
v-for="(item, index) in addressList" :key="index" @click="seldThisAddress(item)">
<view class="item-top flex-between">
<view style="padding-right: 71rpx;">
<view class="name flex-start">
@ -91,9 +105,10 @@
buyNum: 0,
addressList: [],
currentPerson: {},
addressSelect: {},
addressList: [], //
currentPerson: {}, //
currentPersonIds: [], //
addressSelect: {}, //
}
},
@ -129,9 +144,15 @@
},
//
showAddressPopUp (person) {
person.id = 1
showAddressPopUp (person,personList) {
this.currentPerson = person
this.currentPersonIds = []
personList.forEach(v=>{
if (v.id) {
this.currentPersonIds.push(v.id)
}
})
if (person.id) {
this.addressSelect = person
} else {
@ -151,6 +172,7 @@
if (confirm) {
//
this.currentPerson.id = this.addressSelect.id
this.currentPerson.name = this.addressSelect.name
this.currentPerson.id_number = this.addressSelect.id_number
this.currentPerson.tel = this.addressSelect.tel
this.currentPerson.user_id = this.addressSelect.user_id
@ -164,7 +186,16 @@
this.$forceUpdate();
},
seldThisAddress(item){
this.addressSelect = item
if (this.addressSelect.id == item.id) {
this.addressSelect = {}
} else {
if (this.currentPersonIds.includes(item.id)&&item.id!=this.currentPerson.id) {
return
} else {
this.addressSelect = item
}
}
},
@ -214,9 +245,15 @@
// this.$toast(""+this.max_num+"")
// }
if (Array.isArray(skuItem.selPeople)) {
skuItem.selPeople.push({})
skuItem.selPeople.push({
id:null,id_number:null,name:null,
tel:null,user_id:null,age:null,
})
} else {
skuItem.selPeople = [{}]
skuItem.selPeople = [{
id:null,id_number:null,name:null,
tel:null,user_id:null,age:null,
}]
}
},
@ -290,6 +327,79 @@
})
},
order() {
let use_date = this.allSeldDate[this.seldDateIndex].date
let start_time =this.timesArr[this.seldTimeIndex].start_time
let end_time = this.timesArr[this.seldTimeIndex].end_time
let goods = []
//
console.log(this.pInfo)
this.pInfo.specifications.forEach(sku=>{
if (sku.buyNum != sku.selPeople.length) {
uni.showToast({
title:'请选择出行人',
icon:'none'
})
}
if (sku.buyNum>=1) {
let param = {
specifications_id: sku.id,
num: sku.buyNum,
contact_id: sku.selPeople.filter(v=>v.id).map(v=>v.id),
date: use_date,
start_time: start_time,
end_time: end_time,
}
goods.push(param)
}
})
console.log(goods)
let data = {
goods: goods,
coupon: this.coupon ? this.coupon.id : "",
// reserve_name: this.reserve_name,
// reserve_phone: this.reserve_phone
// remark: this.remark
}
console.log('data数据',data);
this.Post({
method: 'POST',
data: JSON.stringify(data)
}, '/api/order/place').then(res => {
if (res.code == 200) {
console.log(res.data.order_id);
let order_id = res.data.order_id
this.$store.commit("changeOrderInfo", null);
this.$store.commit("choseCoupon", "");
this.Post({
order_id: order_id,
type: "miniprogram",
platform: 'miniprogram'
}, '/api/pay/unify').then(res => {
if (res.data) {
uni.requestPayment({
nonceStr: res.data.nonceStr,
package: res.data.package,
paySign: res.data.paySign,
signType: res.data.signType,
timeStamp: res.data.timeStamp,
complete() {
uni.navigateTo({
url: '/subPackages/order/trades'
})
}
})
}
})
}
})
}
}
}
</script>
@ -574,6 +684,11 @@
.popup-item.active{
background-image: linear-gradient(135deg, #9EE4FE, #7FD491);
}
.popup-item.disabled{
.item-top {
background-color: #999;
}
}
}
.button {
@ -592,4 +707,60 @@
}
}
.btn-list {
width: 750rpx;
height: 166rpx;
background: #ffffff;
box-shadow: 0rpx -3rpx 9rpx 1rpx rgba(227, 229, 232, 0.5);
display: flex;
position: fixed;
bottom: 0;
padding: 20rpx 50rpx;
align-items: center;
justify-content: space-between;
.btn {
width: 294rpx;
height: 88rpx;
background: linear-gradient(90deg, #F84A56, #FF9834);
border-radius: 43rpx;
text-align: center;
line-height: 88rpx;
font-size: 36rpx;
font-family: PingFang SC;
font-weight: 500;
color: #FFFFFF;
}
.price-box {
display: flex;
align-items: center;
.text {
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #393b3e;
}
.price {
margin-left: 15rpx;
font-size: 48rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #fc5109;
&:before {
content: '¥';
display: inline-block;
color: #fc5109;
font-size: 24rpx;
}
}
.post-text {
margin-left: 15rpx;
color: #fc5109;
font-size: 24rpx;
}
}
}
</style>

17
subPackages/ticketBooking/ticketBooking.vue

@ -18,7 +18,12 @@
<view class="text-overflow">{{item.address}}</view>
</view>
<view class="priceBox">
<view class="price">{{showPrice(item.price)}}</view>
<!-- <view :class="['price',item.price>0?'price-money':'']">
{{item.price>0?showPrice(item.price):'免费'}}
</view> -->
<view class="price price-money">
{{showPrice(item.price)}}
</view>
</view>
</view>
</navigator>
@ -42,15 +47,17 @@
finished: false,
headImg:null,
type_id: 10,//id
type_id: 10,//id
}
},
onShow() {
this.headImg = 'https://tongli.sz-trip.com/uploads/20240826/a87488f6225789aa19dbb437671d388d.png'
this.finished = false
this.getList()
// this.getHeadImg('piaowu')
},
onReady() {
this.getList()
},
onLoad(options) {
let that = this
uni.getSystemInfo({
@ -173,12 +180,12 @@
color: #F02A2A;
text-align: right;
}
.price::before{
.price-money::before{
content: '¥';
color: #F02A2A;
font-size: 24rpx;
}
.price::after{
.price-money::after{
content: '起';
color: #999;
font-size: 24rpx;

Loading…
Cancel
Save