Browse Source

提交

master
jiazhipeng 1 year ago
parent
commit
10ef423dec
  1. 15
      compoents/addressAdd.vue
  2. 265
      compoents/contactAdd.vue
  3. 2
      subPackages/techan/order.vue
  4. 162
      subPackages/ticketBooking/detail.vue
  5. 1213
      subPackages/ticketBooking/order.vue

15
compoents/addressAdd.vue

@ -70,7 +70,22 @@
}, },
methods: { methods: {
init(option) { init(option) {
this.id = null
this.username = ''
this.mobile = ''
this.citySeld = ''
this.detailAddr = ''
this.idDefault = false
this.province = null
this.city = null
this.area = ''
this.provinceId = null
this.cityId = null
this.areaId = null
this.multiIndex = [0, 0, 0]
this.id = option.id this.id = option.id
if (option.id > 0) { if (option.id > 0) {
this.title = '编辑收货地址' this.title = '编辑收货地址'
this.getDetail() this.getDetail()

265
compoents/contactAdd.vue

@ -0,0 +1,265 @@
<template>
<view class="bg">
<view class="list-forms">
<view class="list-item">
<view class="list-item-title">姓名</view>
<view class="list-item-input"><input type="text" v-model="username" placeholder="请输入姓名" /></view>
</view>
<view class="list-item">
<view class="list-item-title">证件类型</view>
<view class="list-item-input">
<picker mode="selector" :range="idcardTypeList" range-key="title" @change="changeIdType">
<input type="text" readonly style="font-size: 35rpx;position: relative;"
v-model="idcardTypeValue" disabled="true" placeholder="请选择"/>
</picker>
</view>
</view>
<view class="list-item">
<view class="list-item-title">证件号</view>
<view class="list-item-input"><input type="text" v-model="idNumber" placeholder="请输入正确的证件号" /></view>
</view>
<view class="list-item">
<view class="list-item-title">联系电话</view>
<view class="list-item-input"><input type="number" v-model="mobile" placeholder="请输入手机号" maxlength="11" /></view>
</view>
<view class="list-item">
<view class="list-item-title">设为默认</view>
<view class="list-item-switch">
<switch :checked="idDefault" @change="switchChange" color="#FEB419"/>
</view>
</view>
</view>
<!-- <view class="btn" @click="submit">保存</view> -->
</view>
</template>
<script>
export default {
data() {
return {
username: '',
mobile: '',
idNumber: '',
idcardTypeValue: '身份证',
show: false,
idcardTypeList: [],
document_type: 'DAM01001',
id: '',
type: '',
idDefault: false,
}
},
methods: {
init (data) {
this.username = ''
this.mobile= ''
this.idNumber= ''
this.idcardTypeValue= '身份证'
this.show= false
this.idcardTypeList= []
this.document_type= 'DAM01001'
this.id= ''
this.type=''
this.idDefault= false
this.type = 'add'
this.getIdcardTypeList()
if (data && data.id) {
this.id = data.id
this.type = 'edit'
this.getDetail()
}
},
switchChange(e){
this.idDefault = e.detail.value
},
getDetail() {
this.Post({
id: this.id
}, '/api/user/contactDetail').then(res => {
if (res.code === 1) {
res = res.data
if (res && res.id > 0) {
this.username = res.name
this.mobile = res.tel
this.idNumber = res.id_number
this.idDefault = res.is_default == 1 ? true : false
this.document_type = res.document_type
this.idcardTypeValue = res.document_type_text
}
}
})
},
//
getIdcardTypeList() {
this.Post({}, '/api/user/getIdcardTypeList').then(res => {
this.idcardTypeList = res.data
})
},
//
changeIdType(e) {
this.idcardTypeValue = this.idcardTypeList[e.detail.value].title
this.document_type = this.idcardTypeList[e.detail.value].document_type
},
//
async submit() {
this.username = this.username.trim()
this.mobile = this.mobile.trim()
this.idNumber = this.idNumber.trim()
if (this.username.length < 1) {
uni.showToast({
title: '请输入姓名',
icon: 'none'
})
return
}
if (!this.IsTel(this.mobile)) {
uni.showToast({
title: '请输入正确的手机号',
icon: 'none'
})
return
}
if (this.idcardTypeValue == '身份证') {
if (!this.idCardNumber(this.idNumber)) {
uni.showToast({
title: '请输入正确的身份证',
icon: 'none'
})
return
}
} else if (this.idcardTypeValue == '护照') {
if (!this.passportValid(this.idNumber)) {
uni.showToast({
title: '请输入正确的护照',
icon: 'none'
})
return
}
} else if (this.idcardTypeValue == '台胞证') {
if (!this.taiwanValid(this.idNumber)) {
uni.showToast({
title: '请输入正确的台胞证',
icon: 'none'
})
return
}
} else if (this.idcardTypeValue == '港澳通行证') {
if (!this.gangaoValid(this.idNumber)) {
uni.showToast({
title: '请输入正确的港澳通行证',
icon: 'none'
})
return
}
} else if (this.idcardTypeValue == '外国人永久居留证') {
if (!this.foreignerValid(this.idNumber)) {
uni.showToast({
title: '请输入正确的外国人永久居留证',
icon: 'none'
})
return
}
} else if (this.idcardTypeValue == '军官证') {
if (!this.officerValid(this.idNumber)) {
uni.showToast({
title: '请输入正确的军官证',
icon: 'none'
})
return
}
}
let res = await this.Post({
id: this.type == 'edit'?this.id:'',
id_number: this.idNumber,
name: this.username,
tel: this.mobile,
document_type: this.document_type,
is_default: this.idDefault ? '1' : '0',
}, this.type=='edit'?'/api/user/editContact':'/api/user/addContact')
if (res.code == 1) {
uni.showModal({
title: '提示',
content: '操作成功',
showCancel: false,
})
}else{
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false,
})
}
return {...res,data: {id: this.id}}
}
}
}
</script>
<style scoped lang="scss">
.bg {
width: 100%;
height: 100%;
position: relative;
}
.list-forms {
padding: 0 33rpx;
.list-item {
display: flex;
border-bottom: 1rpx solid #D8D8D8;
padding: 30rpx 0;
height: 60rpx;
box-sizing: content-box;
align-items: center;
.list-item-title {
font-size: 34rpx;
margin-right: 20rpx;
width: 200rpx;
}
.list-item-input {
flex: 1;
input {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
border: 0;
background-color: transparent;
line-height: 34rpx;
font-size: 34rpx;
text-align: left;
}
input::placeholder {
font-size: 26rpx;
}
}
}
}
.btn {
width: 697rpx;
height: 80rpx;
background: linear-gradient(90deg, #9EE4FE, #7FD491);
border-radius: 40rpx;
text-align: center;
line-height: 80rpx;
font-size: 36rpx;
font-family: PingFang SC;
font-weight: 500;
color: #FFFFFF;
position: absolute;
bottom: 53rpx;
left: 27rpx;
}
</style>

2
subPackages/techan/order.vue

@ -184,7 +184,7 @@
<view class="top-box"> <view class="top-box">
<view class="top flex-between" style="height: fit-content;"> <view class="top flex-between" style="height: fit-content;">
<text class="text-overflow" @click="changeAddressAddPopup('close')">取消</text> <text class="text-overflow" @click="changeAddressAddPopup('close')">取消</text>
<text style="font-size: 35rpx;font-weight: 600;">添加收货地址</text> <text style="font-size: 35rpx;font-weight: 600;">{{addressTitle}}</text>
<text style="color: #71B580;" class="confirm" @click="saveAddress">保存</text> <text style="color: #71B580;" class="confirm" @click="saveAddress">保存</text>
</view> </view>
</view> </view>

162
subPackages/ticketBooking/detail.vue

@ -58,7 +58,7 @@
</view> </view>
</view> </view>
<view class="notice" @click="showSkuInfo(item, itemSku)"> <view class="notice" @click="showSkuInfo(itemSku, item)">
预订须知 > 预订须知 >
</view> </view>
</view> </view>
@ -78,7 +78,7 @@
</view> </view>
<view class="box-title">介绍</view> <view class="box-title">介绍</view>
<view class="common-container"> <view class="common-container" style="padding: 30rpx;">
<view class="" id="cpts" v-html="formateRichText(info.feature_content)"></view> <view class="" id="cpts" v-html="formateRichText(info.feature_content)"></view>
</view> </view>
</view> </view>
@ -86,12 +86,12 @@
<!-- 预订须知的弹窗 --> <!-- 预订须知的弹窗 -->
<uni-popup ref="popupRule" type="bottom" :safe-area="false"> <uni-popup ref="popupRule" type="bottom" :safe-area="false">
<view class="popup-content-date flex-column flex" > <view class="popup-content-date flex-column flex" >
<view class="popup-content-title flex flex-shrink-0"> <view class="popup-content-title flex">
<view class="flex-1 w-1rpx text-overflow"> <view class="flex-1 w-1rpx text-overflow">
{{skuInfo.title}} {{skuInfo.title}}
</view> </view>
<img src="https://static.ticket.sz-trip.com/taizhou/images/cha.png" @click="closePopupRule" <img src="https://static.ticket.sz-trip.com/taizhou/images/cha.png" @click="closePopupRule"
style="width: 31rpx;height: 31rpx;" class="flex-shrink-0"> style="width: 20rpx;height: 20rpx;" class="flex-shrink-0">
</view> </view>
<view class="content flex-1 h-1rpx no-scrollbar"> <view class="content flex-1 h-1rpx no-scrollbar">
<view class="detail-content" v-html="formateRichText(skuInfo.reserve_content)"></view> <view class="detail-content" v-html="formateRichText(skuInfo.reserve_content)"></view>
@ -109,7 +109,7 @@
<img src="https://static.ticket.sz-trip.com/taizhou/images/cha.png" @click="closePopup" <img src="https://static.ticket.sz-trip.com/taizhou/images/cha.png" @click="closePopup"
style="width: 31rpx;height: 31rpx;" class="flex-shrink-0"> style="width: 31rpx;height: 31rpx;" class="flex-shrink-0">
</view> </view>
<view> <view class="order-popup-detail">
<view class="relative"> <view class="relative">
<view class="sku-title">使用日期</view> <view class="sku-title">使用日期</view>
<view class="date-content"> <view class="date-content">
@ -123,13 +123,12 @@
</view> </view>
</view> </view>
<view class="dateMore" @click="openCalendar"> <view class="dateMore" @click="openCalendar">
<view>更多日期</view> <view style="width: 55rpx;">更多日期</view>
<view>></view>
</view> </view>
</view> </view>
<view v-if="timesArr.length > 0 && skuInfo.is_time_stock"> <view v-if="timesArr.length > 0 && skuInfo.is_time_stock">
<view class="sku-title">选择时段</view> <view class="sku-title">选择场次</view>
<view class="time-box"> <view class="time-box">
<view v-for="(item,index) in timesArr" :key="index" <view v-for="(item,index) in timesArr" :key="index"
:class="['time-item',{'time-disable': item.stock_number < 1, 'time-active': item.stock_number > 0 && index == seldTimeIndex}]" :class="['time-item',{'time-disable': item.stock_number < 1, 'time-active': item.stock_number > 0 && index == seldTimeIndex}]"
@ -243,6 +242,7 @@
showSkuInfo (itemSku,goods) { showSkuInfo (itemSku,goods) {
this.skuInfo = itemSku this.skuInfo = itemSku
this.selectGoods = goods this.selectGoods = goods
console.log(itemSku,goods)
this.openPopRule() this.openPopRule()
}, },
@ -302,20 +302,23 @@
// //
clickTab(item, index) { clickTab(item, index) {
if (item.store>0) {
this.seldDateIndex = index this.seldDateIndex = index
this.getTimeStock(item.date) this.getTimeStock(item.date)
}
}, },
// //
changeTime(item, index) { changeTime(item, index) {
if(item.store > 0) { if(item.stock_number > 0) {
this.seldTimeIndex = index this.seldTimeIndex = index
} }
}, },
confirmCalendar (val) { confirmCalendar (val) {
let index = this.allSeldDate.find(v=>v.date == val.fulldate) let index = this.allSeldDate.findIndex(v=>v.date == val.fulldate)
if (index) { if (index>=0) {
this.clickTab({date:val.fulldate},index) this.clickTab(this.allSeldDate[index],index)
} }
}, },
@ -327,20 +330,6 @@
return; return;
} }
this.selectGoods.specifications.forEach(v=>{v.buyNum = 0;v.selPeople = []})
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 = [
{
id:null,id_number:null,name:null,
tel:null,user_id:null,age:null,
},
]
this.selectGoods.specifications.unshift(item);
let param = { let param = {
sInfo: this.skuInfo, sInfo: this.skuInfo,
pInfo: this.selectGoods, pInfo: this.selectGoods,
@ -624,31 +613,54 @@
.popup-content-date { .popup-content-date {
background-color: white; background-color: white;
padding: 0rpx 39rpx 51rpx 39rpx; padding: 0rpx 28rpx 166rpx;
height: 70vh; height: 70vh;
border-radius: 20rpx 20rpx 0 0 ; border-radius: 20rpx 20rpx 0 0 ;
.popup-content-title{ .popup-content-title{
padding: 20rpx 0; font-family: PingFang SC;
font-weight: bold;
font-size: 37rpx;
color: #000000;
padding: 39rpx 0;
display: flex;
align-items: center;
border-bottom: 1px solid #CCCCCC;
} }
// //
.content{ .content{
padding-top: 48rpx;
overflow-y: auto; overflow-y: auto;
} }
.order-popup-detail{
.sku-title{
padding: 48rpx 0 26rpx;
font-family: PingFangSC;
font-weight: 500;
font-size: 31rpx;
color: #000000;
}
}
.dateMore{ .dateMore{
width: 120rpx; width: 120rpx;
height: 180rpx; height: 133rpx;
background: #fff; background: white;
font-weight: 400; border-radius: 10rpx;
font-size: 32rpx; border: 1px solid #000000;
padding-left: 15rpx; font-family: PingFang SC;
color: #0b898e; font-weight: 500;
font-size: 27rpx;
color: #000000;
display: flex; display: flex;
justify-content: center; flex-direction: column;
align-items: center; align-items: center;
justify-content: space-around;
flex-shrink: 0;
padding: 6rpx 0;
position: absolute; position: absolute;
right: 0;
bottom: 0; bottom: 0;
right: 0;
} }
.date-content{ .date-content{
@ -659,25 +671,34 @@
padding-right: 140rpx; padding-right: 140rpx;
.item{ .item{
min-width: 160rpx; width: 120rpx;
height: 180rpx; height: 133rpx;
background: #f5f5f5;
border-radius: 10rpx; border-radius: 10rpx;
margin-right: 20rpx; border: 1px solid #000000;
margin-right: 24rpx;
font-family: PingFang SC;
font-weight: 500; font-weight: 500;
font-size: 32rpx; font-size: 27rpx;
color: #000; color: #000000;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: space-around; justify-content: space-around;
flex-shrink: 0;
padding: 6rpx 0;
} }
.item.active{ .item.active{
background: #0b898e; background: linear-gradient(-56deg, #9EE4FE, #7FD491);
color: #fff; color: #000000;
border: none;
} }
.item.disabled{ .item.disabled{
color: #999; color: #666;
border-color: #CCC;
}
.price{
color: #EE3E3B;
} }
} }
@ -690,58 +711,71 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
flex-wrap: wrap; flex-wrap: wrap;
max-height: 340rpx;
overflow-y: auto;
.time-item { .time-item {
width: 48%; width: 48%;
background: #F5F5F5; height: 60rpx;
border-radius: 10rpx; border-radius: 10rpx;
text-align: center; text-align: center;
font-weight: 400;
font-size: 34rpx; font-size: 34rpx;
color: #000000; margin-bottom: 23rpx;
margin-bottom: 20rpx; font-family: PingFangSC;
padding: 5rpx; font-weight: 400;
font-size: 25rpx;
border: 1px solid #333333;
line-height: 58rpx;
color: #000;
} }
.time-active { .time-active {
background: #0B898E; background: linear-gradient(270deg, #9EE4FE, #7FD491);
color: #fff; border: none;
} }
.time-disable { .time-disable {
color: #999999; color: #666666;
border-color: #CCC;
} }
} }
.sku-bottom { .sku-bottom {
width: 100%; width: 100%;
height: 120rpx; height: 166rpx;
background: #FFFFFF; background: #FFFFFF;
padding: 20rpx; box-shadow: 0rpx -3rpx 8rpx 0rpx rgba(71,71,71,0.1);
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
box-sizing: border-box; box-sizing: border-box;
font-weight: 400; padding: 50rpx 50rpx 85rpx;
font-size: 36rpx; font-family: PingFang SC;
font-weight: 500;
font-size: 28rpx;
color: #393B3E; color: #393B3E;
line-height: 80rpx; position: absolute;
bottom: 0;
left: 0;
right: 0;
.bottom-price { .bottom-price {
font-size: 48rpx;
font-weight: 500; font-weight: 500;
font-size: 50rpx; color: #EE3E3B;
color: #D62828;
} }
.bottom-price::before { .bottom-price::before {
font-size: 27rpx; font-size: 24rpx;
content: '¥'; content: '¥';
} }
.bottom-btn { .bottom-btn {
width: 360rpx; width: 250rpx;
background: #D62828; height: 80rpx;
background: #F74A57;
border-radius: 40rpx; border-radius: 40rpx;
font-size: 32rpx;
text-align: center; text-align: center;
font-weight: bold; font-weight: bold;
font-size: 42rpx;
color: #FFFFFF; color: #FFFFFF;
line-height: 78rpx;
} }
} }
</style> </style>

1213
subPackages/ticketBooking/order.vue

File diff suppressed because it is too large
Loading…
Cancel
Save