Commit b6accc7b authored by 潘永坪's avatar 潘永坪

图片修改

parent 6b6e686b
<template>
<div>
<u-calendar
:show="show"
@confirm="onConfirm"
@close="show=false"
:maxDate="maxDate"
:defaultDate="defaultDate"
:formatter='formatter'
ref="calendar2"
></u-calendar>
</div>
</template>
<script>
export default {
props: ["dateList"],
watch: {
dateList:{
handler(newValue, oldValue){
if(newValue&&newValue.length>0){
this.maxDate=newValue[newValue.length-1].startTime.substr(0,10)
}
},
deep:true,
immediate:true
}
},
data() {
return {
date: '', //选择的日期
show: false, //控制日历显示隐藏
defaultDate:'', //默认日期
maxDate:'',//最大日期
}
},
created() { //默认为第一天
this.$refs.calendar2.setFormatter(this.formatter)
},
methods: {
//---年月日转化
formatDate(date) {
let year = date.getFullYear()
let month = date.getMonth() + 1;
if (month < 10) {
month = '0' + month
}
let days = date.getDate();
if (days < 10) {
days = '0' + days
}
let dates = year + "-" + month + "-" + days
return dates
},
//---日期确认事件
onConfirm(date) {
this.show = false;
this.$emit("dateConfig", date[0])
},
//---时间格式转换
formatter(day) {
let year = day.date.getFullYear()
let month = day.date.getMonth() + 1;
if (month < 10) {
month = '0' + month
}
let days = day.date.getDate();
if (days < 10) {
days = '0' + days
}
let dates = year + "-" + month + "-" + days
//真机调试手极端报错,暂时注释
// this.dateList.forEach((item, index) => {
// if (item.startTime.substr(0, 10) == dates) {
// day.bottomInfo = "¥" + item.sellingPrice
// day.dot = true
// }
// })
// if (!day.bottomInfo) {
// day.type = "disabled"
// }
return day
},
//---设置默认日期方法
setDefaultDate(val) {
let dates = val.split("-")
let year = parseInt(dates[0])
let month = parseInt(dates[1]) - 1
let day = parseInt(dates[2])
this.defaultDate = new Date(year, month, day)
},
}
}
</script>
<style scoped="scoped">
</style>
<template>
<view class="area-box">
<view class="top" @click="sure()">
<view class="top-left">
选择(索道)出发站点
</view>
<view>
<u-icon name="close"></u-icon>
</view>
</view>
<view v-if="defaultAreaCode" class="defaultArea">
<view>
<text>
当前站点:
</text>
<text>
{{areaObj.areaName}}
</text>
</view>
<view>
<text>
当前排队人数:
</text>
<text>
{{sortIfo.peopleNumber}}
</text>
</view>
<view>
<text>
预计进入排队等候区时间:
</text>
<text>
{{sortIfo.sortTotalTime}}
</text>
</view>
<view>
<text>
退票规则:
</text>
<text>
不可退
</text>
</view>
<view>
<image src="../static/images/scenicSingleOrder/chooseArea.jpg" mode="widthFix"></image>
</view>
<view>
<a class="middle-btn" @click="sure()">确定</a>
</view>
</view>
<template v-else>
<view class="bottom">
<view class="bottom1">
<view>
您所在位置距离“{{areaList[distanceIndex].areaName}}”较近
</view>
<view class="bottom1-choose">
建议选择<text>{{areaList[distanceIndex].areaName}}</text>
</view>
<view class="bottom1-btn">
<text class="btn" @click="getSort(item)" v-for="(item,index) of areaList" :key="index">
{{item.areaName}}
</text>
</view>
</view>
<view class="bottom2">
<image src="../static/images/scenicSingleOrder/chooseArea.jpg" mode="widthFix"></image>
<view style="margin-top: 20rpx;">选错站点可导致排队号码无效。</view>
<view>若无法确定站点,请向索道工作人员咨询。</view>
</view>
</view>
<view class="pop-wrap" v-show="showPop">
<view class="pop-content">
<view>
<text>
您选择的站点是:
</text>
<text>
{{areaObj.areaName}}
</text>
</view>
<template v-if="sortIfo">
<view>
<text>
当前排队人数:
</text>
<text>
{{sortIfo.peopleNumber}}
</text>
</view>
<view>
<text>
预计进入排队等候区时间:
</text>
<text>
{{sortIfo.sortTotalTime}}
</text>
</view>
</template>
<view>
<text>
退票规则:
</text>
<text>
不可退
</text>
</view>
<view>
返程时,根据现场情况需重新取号
</view>
<view v-if="!sortIfo" style="font-size:32rpx;color: #ff0000;">
未找到本站信息,请根据现场大屏幕信息合理购票
</view>
<view style="text-align: center;">
<text class="middle-btn" @click="hidePop()" style="color: #333;margin-right: 48rpx;">
取消
</text>
<text class="middle-btn" @click="sure()">
确定
</text>
</view>
</view>
</view>
</template>
</view>
</template>
<script>
export default {
props: ['areaList', 'sortArr','defaultAreaCode'],
data() {
return {
showPop: false, //控制弹窗显示隐藏
distanceIndex:0, //最小距离下标
distanceList: [], //所有距离列表
sortIfo: '', //排队信息
areaObj: {
areaCode: '', //选中的区域编码
areaName: '', //选中的区域名字
},
longitude:'',//当前位置经度
latitude:'',//当前位置纬度
}
},
created() {
//如果有默认站点
if(this.defaultAreaCode&&this.sortArr.length>0){
this.sortArr.forEach(item=>{
if(item.projectId==this.defaultAreaCode){
this.sortIfo=item
this.sortIfo.peopleNumber = Math.max(item.sortTotalCapacity-item.showEnd,0)
}
})
this.areaList.forEach(item=>{
if(item.areaCode==this.defaultAreaCode){
this.areaObj.areaCode=item.areaCode
this.areaObj.areaName=item.areaName
}
})
return
}
uni.getLocation({
type: 'wgs84',
success:(res)=>{
this.longitude=res.longitude
this.latitude=res.latitude
this.getMinDistance()
}
})
},
methods: {
//---隐藏弹窗
hidePop() {
this.showPop = false
},
//---返回隐藏该组件
returnClose() {
this.$parent.closeArea()
},
//---隐藏该组件
sure() {
this.showPop = false
this.$parent.closeArea()
this.$emit('areaSure', this.areaObj)
},
//---获取排号信息
getSort(item) {
this.showPop = true
let data = {
areaCode: item.areaCode,
merchantCode: this.merchantCode, //商户code
}
this.areaObj.areaCode = item.areaCode //获取选中的站点code,便于找到返回数据的下标
this.areaObj.areaName = item.areaName
this.sortArr.forEach((item)=>{
item.peopleNumber = Math.max(item.sortTotalCapacity-item.showEnd,0)
})
this.sortIfo=this.sortArr.find(item=>item.projectId==this.areaObj.areaCode)||''
},
//---计算距离
getMinDistance() {
if (this.areaList.length > 0) {
this.areaList.forEach((item) => { //计算两个站点的分别距离
let lat1=this.latitude||0
let lng1=this.longitude||0
let lat2=item.latitude||0
let lng2=item.longitude||0
let distance = this.$commonjs.getDistance(lat1,lng1,lat2,lng2)
this.distanceList.push(distance)
})
let minDistance = Math.min.apply(null, this.distanceList)
this.distanceIndex = this.distanceList.indexOf(minDistance)
}
}
}
}
</script>
<style scoped="scoped" lang="scss">
/* 默认站点 */
.defaultArea{
padding:24rpx;
}
.defaultArea view{
margin-top:40rpx;
text-align: center;
}
.defaultArea view text:last-child{
color: #e70313;
font-size:32rpx;
font-weight: bold;
}
.area-box{
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index:99;
background: #f5f5f5;
}
.top{
display: flex;
justify-content: space-around;
background: #fff;
height: 80rpx;
align-items: center;
padding: 0 24rpx;
}
.top-left{
flex: 1;
text-align: center;
}
.bottom1{
text-align: center;
view{
margin-top:30rpx;
}
}
.bottom1-choose{
font-size: 32rpx;
color: #ff0000;
text{
font-weight: bold;
font-size: 36rpx;
}
}
.bottom1-btn text:not(:last-child){
margin-right: 48rpx;
}
.bottom2{
margin-top: 60rpx;
font-size: 32rpx;
color: #ff0000;
text-align: center;
}
// 弹窗
.pop-wrap{
background: rgba(0,0,0,0.1);
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 100;
}
.pop-content{
background: #FFFFFF;
width: 85%;
border-radius: 10rpx;
padding: 50rpx 20rpx;
-webkit-box-sizing: border-box;
box-sizing: border-box;
margin: 300rpx auto 0 auto;
view:not(:first-child){
margin-top: 30rpx;
}
}
.pop-content view:not(:last-child) text:last-child{
font-size:36rpx;
font-weight: bolder;
color: #f40000
}
</style>
<template>
<view class="contact-box">
<u-popup :show="contactsShow" @close="contactsShow=false">
<view class="top">
<u-icon name="close" @click="contactsShow=false"></u-icon>
<text>
需填写{{buyNum}}位联系人
<text v-if="buyNum-chooseContact.length>0">
,还需
<text class="top-number">{{buyNum-chooseContact.length}}</text>
位出行人
</text>
</text>
<text @click="config()" class="top-sure">
确定
</text>
</view>
<view class="bottom">
<view @click="showEdit()" class="bottom-add">
<text>
+添加旅客信息
</text>
</view>
<checkbox-group @change="chooseContactChange">
<view class="bottom-list" v-for="(item,index) of contactData" :key="item.id">
<label>
<checkbox :value="JSON.stringify(item)" :checked="item.ifChoose" color="#3688ff" />
<view class="bottom-content">
<view>
{{item.name}}
</view>
<view>
<text>
身份证
</text>
{{item.credentialNumber?item.credentialNumber.substr(0,3)+"****"+item.credentialNumber.substr(14,4):"无"}}
</view>
</view>
</label>
<view @click="goEdit(item)" style="margin-right:20rpx;">
<u-icon name="edit-pen" color="#3688ff" size="28"></u-icon>
</view>
<view @click="clickDele(item.id)">
<u-icon name="trash-fill" color="#3688ff" size="28"></u-icon>
</view>
<u-modal :show="showModal" @confirm="confirmDele" @cancel="showModal=false" showCancelButton title="确认删除该联系人" ></u-modal>
</view>
</checkbox-group>
</view>
</u-popup>
</view>
</template>
<script>
export default {
props: ["contactData", "orderTouristList", "buyNum"],
watch: {
orderTouristList: {
handler(newValue, oldValue) {
if (newValue) {
this.chooseContact = this.orderTouristList
}
},
deep: true,
immediate: true
}
},
data() {
return {
contactsShow: false, //控制联系人弹窗显示隐藏
chooseContact: [], //选中的联系人
showModal: false, //确认弹窗显示隐藏
contactId:'',//删除联系人的Id
}
},
methods: {
//---点击新增,展示编辑联系人弹窗,并传空值给编辑弹窗
showEdit() {
this.contactsShow=false
this.$parent.showEdit()
this.$emit("getEditContact", "")
},
//---展示编辑弹窗,并传值给编辑弹窗
goEdit(obj) {
this.contactsShow=false
this.$parent.showEdit()
this.$emit("getEditContact", obj)
},
//---确定选中的联系人
config() {
this.contactsShow = false
this.$emit("contactListConfig", this.chooseContact)
},
//---联系人姓名变化
chooseContactChange(e){
let value=e.detail.value
let arr=[]
value.forEach(item=>{
arr.push(JSON.parse(item))
})
this.chooseContact=arr
if (arr.length == this.buyNum) { //当选择的人数等于需要填的人数时关闭弹窗
this.config()
}
if (arr.length > this.buyNum) {
arr.shift()
this.config()
}
},
//---点击删除
clickDele(id) {
this.showModal = true
this.contactId=id
},
//---确认删除
confirmDele(){
let data={
id:this.contactId
}
this.$request('wechatUser/contact/deleteContact', data).then((res) => {
if (res.code == '00') {
uni.showToast({
title:'删除成功',
icon:'none'
})
this.showModal = false
this.contactsShow=false
this.$parent.getContactList()
} else {
uni.showToast({
title:res.message,
icon:'none'
})
}
}).catch(() => {
this.showModal = false
})
}
}
}
</script>
<style scoped="scoped" lang="scss">
.top {
height:100rpx;
display: flex;
justify-content: space-between;
background: #f0f0f0;
align-items: center;
padding: 0 24rpx;
}
.top-sure {
color: var(--main-color);
font-size: 28rpx;
}
.top-number{
color: #f9690e;
font-size: 32rpx;
font-weight:bold;
}
.bottom {
padding:0 24rpx 80rpx 24rpx;
}
.bottom-add {
height:130rpx;
display: flex;
align-items: center;
border-bottom: 1px solid #e6e6e6;
width: 100%;
justify-content: center;
}
.bottom-add text{
width:280rpx;
height: 65rpx;
text-align: center;
line-height:65rpx;
border: 1px solid var(--main-color);
color:var(--main-color);
display: inline-block;
border-radius:5rpx;
}
.bottom-list{
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid #E6E6E6;
padding:25rpx 0;
}
.bottom-list label {
display: flex;
flex: 1;
align-items: center;
}
.bottom-content {
flex: 1;
margin-left: 40rpx;
}
.bottom-content view {
font-size:28rpx;
color: #666666;
}
.bottom-content view:not(:first-child) {
margin-top: 10rpx;
}
.bottom-content view text {
display: inline-block;
width: 100rpx;
}
</style>
<template>
<view class="editBox" v-show="showEdit">
<view @click="close()" class="return">
<u-icon name="close"></u-icon>
</view>
<view class="editTop">
</view>
<view class="editBottom">
<view class="bottomContent">
<view>
<text>
姓名:
</text>
<input v-model.trim="name" placeholder="请输入中文姓名" />
</view>
<view>
<text>
身份证:
</text>
<input v-model.trim="credentialNumber" maxlength="18" placeholder="请输入身份证号码" />
</view>
<view>
<!--编辑-->
<a class="middle-btn" @click="keepEdit()" v-if="editBtn">完成</a>
<!--新增-->
<a class="middle-btn" @click="keepPlus()" v-else="">完成</a>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
props: ["editContact"],
data() {
return {
showEdit: false, //控制组件显示隐藏
name: "", //姓名
credentialNumber: "", //身份证号
reviseContactId: "", //被修改人id
editBtn: "", //控制编辑完成按钮显示隐藏
}
},
watch: {
editContact: { //
handler(newValue, oldValue) {
if (newValue) {
this.editBtn = true
} else {
this.editBtn = false
}
this.name = newValue.name||''
this.credentialNumber = newValue.credentialNumber||''
this.reviseContactId = newValue.id||''
},
deep: false,
immediate: false
}
},
methods: {
//---关闭弹窗
close() {
this.showEdit = false
},
//---新增保存
keepPlus() {
if (!this.$commonjs.nameReg().test(this.name)) {
uni.showToast({
title:'请输入正确的中文名字',
icon:'none'
})
return
}
if (!this.$commonjs.idReg().test(this.credentialNumber)) {
uni.showToast({
title:'请输入正确身份证号',
icon:'none'
})
return
}
let data = {
name: this.name, //保存姓名
phone: "", //电话号码
credentialNumber: this.credentialNumber, //身份证号
category: "", //成人或者儿童
openid: uni.getStorageSync("openid"), //用户Id
credentialsType: "", //证件类型
merchantType: 1, //商户类型,1.景区,2.酒店,3.餐饮
}
this.$request("wechatUser/contact/saveContact", data).then((res) => {
if (res.code == "00") {
uni.showToast({
title:'保存成功',
icon:'none'
})
this.$parent.addChoose()
this.showEdit = false
this.name = "" //成功之后清空数据,防止下次新增的时候出现之前的数据
this.credentialNumber = ""
} else {
uni.showToast({
title:res.message,
icon:'none'
})
}
})
},
//---编辑保存
keepEdit() {
if (!this.$commonjs.nameReg().test(this.name)) {
uni.showToast({
title:'请输入正确的中文名字',
icon:'none'
})
return
}
if (!this.$commonjs.idReg().test(this.credentialNumber)) {
uni.showToast({
title:'请输入正确身份证号',
icon:'none'
})
return
}
let data = {
name: this.name, //保存姓名
phone: "", //电话号码
credentialNumber: this.credentialNumber, //身份证号
category: "", //成人或者儿童
openid: uni.getStorageSync("openid"), //用户Id
credentialsType: "", //证件类型
merchantType: 1, //商户类型,1.景区,2.酒店,3.餐饮
id: this.reviseContactId, //被修改人id
}
this.$request("wechatUser/contact/updateContact", data).then((res) => {
if (res.code == "00") {
uni.showToast({
title:'修改成功',
icon:'none'
})
this.$parent.getContactList()
this.showEdit = false
} else {
uni.showToast({
title:res.message,
icon:'none'
})
}
})
}
}
}
</script>
<style scoped="scoped">
.editBox {
height: 100%;
background: #F5F5F5;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 10000;
overflow-y: auto;
font-size:28rpx;
}
.return {
height:100rpx;
padding: 0 24rpx;
background: #FFFFFF;
display: flex;
align-items: center;
justify-content:flex-end;
}
.editTop {
height:200rpx;
background: linear-gradient(to bottom, #2984ef, #d8eaf6);
}
.editBottom {
position: relative;
top: -80rpx;
padding: 0 20rpx;
}
.bottomContent {
border-radius: 20rpx;
background: #FFFFFF;
padding: 20rpx 20rpx 60rpx 20rpx;
}
.bottomContent view {
height: 100rpx;
align-items: center;
display: flex;
border-bottom: 1px solid #f0f0f0;
}
.bottomContent view text {
display: inline-block;
width: 120rpx;
text-align-last: justify;
margin-right: 20rpx;
}
.bottomContent view input {
flex: 1;
}
.bottomContent view:last-child {
display: flex;
justify-content: center;
align-items: center;
margin-top: 60rpx;
border: none;
}
</style>
<template>
<u-popup :show="show" :round="10" closeable @close="show=false">
<view class="time">
<view class="time-title">
时间选择
</view>
<view class="time-content" v-if="chooseTimeList&&chooseTimeList.length>0">
<!--库存大于零并且当前时间小于班次的开始时间才显示-->
<view
class='time-list'
v-for="(item,index) of chooseTimeList"
:class="{on:active==index}"
@click="chooseTime(index)"
:key="index" v-if="item.last>0"
>
<view>
{{item.startPlanTime?item.startPlanTime.substr(0,5):""}}
<text v-if="item.endPlanTime">-</text>
{{item.endPlanTime?item.endPlanTime.substr(0,5):""}}
</view>
<view>
剩余:{{item.last}}
</view>
</view>
</view>
<view style="padding: 0.5rem 0rem;color: #FF0000;" v-else>
空空如也...
</view>
<view class="time-sure">
<text class="big-btn" @click="confirm()">确定</text>
</view>
</view>
</u-popup>
</template>
<script>
export default {
props: ["chooseTimeList", "chooseTimeData", "timeActive"],
watch: {
timeActive: { //父组件选中的下标
handler(newValue, oldValue) {
if (newValue >= 0) {
this.active = newValue
}
},
deep: false,
immediate: false
},
},
data() {
return {
show: false, //控制该组件显示隐藏
active: 10000, //默认不选中
times: "", //时间
timeNumber: "", //当前时间转化为数字
}
},
methods: {
//---时间选择
chooseTime(i) {
this.active = i
this.times = this.chooseTimeList[i].startPlanTime
},
//---时间确认事件
confirm(date) {
this.show = false;
this.$emit("timeConfig", this.times)
},
},
mounted() {
let times = new Date().Format("yyyy-MM-dd hh:mm:ss")
this.timeNumber = parseInt(this.$commonjs.changeTime(times))
}
}
</script>
<style scoped="scoped">
.time {
padding:30rpx 20rpx 60rpx 20rpx;
text-align: center;
}
.time-title{
font-size:32rpx;
font-weight: bolder;
}
.time-content {
display: flex;
flex-wrap: wrap;
}
.time-list {
width: 30%;
height: 80rpx;
text-align: center;
line-height: 30rpx;
color: #666666;
background: rgb(242, 242, 242);
border-radius: 16rpx;
margin-right: 5%;
margin-top: 30rpx;
}
.time-list view:first-child {
margin-top: 10rpx;
}
.time-list view {
width: 100%;
text-align: center;
}
.time-content view:nth-child(3n) {
margin-right: 0;
}
.time-list.on {
background: none;
color: #3dbcff;
border: 1px solid #3dbcff;
box-sizing: border-box;
}
.time-sure{
margin-top: 30rpx;
}
</style>
This diff is collapsed.
static/img/index/home.png

1.79 KB | W: | H:

static/img/index/home.png

1.31 KB | W: | H:

static/img/index/home.png
static/img/index/home.png
static/img/index/home.png
static/img/index/home.png
  • 2-up
  • Swipe
  • Onion skin
static/img/index/homeChoose.png

1.45 KB | W: | H:

static/img/index/homeChoose.png

1.28 KB | W: | H:

static/img/index/homeChoose.png
static/img/index/homeChoose.png
static/img/index/homeChoose.png
static/img/index/homeChoose.png
  • 2-up
  • Swipe
  • Onion skin
static/img/index/my.png

2.22 KB | W: | H:

static/img/index/my.png

1.97 KB | W: | H:

static/img/index/my.png
static/img/index/my.png
static/img/index/my.png
static/img/index/my.png
  • 2-up
  • Swipe
  • Onion skin
static/img/index/myChoose.png

1.76 KB | W: | H:

static/img/index/myChoose.png

1.99 KB | W: | H:

static/img/index/myChoose.png
static/img/index/myChoose.png
static/img/index/myChoose.png
static/img/index/myChoose.png
  • 2-up
  • Swipe
  • Onion skin
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment