Commit 3c2a558a authored by qipeng's avatar qipeng

Merge branch 'develop' into chargeback

parents bf4400a5 7a7e3a5b
...@@ -80,16 +80,7 @@ export default { ...@@ -80,16 +80,7 @@ export default {
<style lang="scss"> <style lang="scss">
@import "uview-ui/index.scss"; @import "uview-ui/index.scss";
/*
1.页面背景颜色#f7f7f7
2.分隔线颜色#DBDBDB
3.正常字体颜色#333333
4.灰色字体颜色#666666或者#999999
5.主题颜色#3688FF
6.正常字体大小28rpx,偏小一点的24rpx
8.页面最外层与里面的第一层为padding:0 12px;
9.css单位为rpx
*/
page { page {
font-size: 28rpx; font-size: 28rpx;
color: #333333; color: #333333;
...@@ -110,14 +101,42 @@ export default { ...@@ -110,14 +101,42 @@ export default {
textarea { textarea {
box-sizing: border-box; box-sizing: border-box;
} }
.btn { //小按钮
background: linear-gradient(132deg, #ED400C 0%, #FB862C 100%); .btn{
background:#3688FF;
display: inline-block; display: inline-block;
color: #FFFFFF; color: #FFFFFF;
font-size: 28rpx; width: 135rpx;
border-radius: 8rpx; height: 70rpx;
line-height: 70rpx;
font-size:28rpx;
border-radius:16rpx;
text-align: center;
}
//中等按钮
.middle-btn{
background:linear-gradient(132deg, #ED400C 0%, #FB862C 100%);
display: inline-block;
color: #FFFFFF;
width: 180rpx;
height: 80rpx;
line-height: 80rpx;
font-size:32rpx;
border-radius:20rpx;
text-align: center;
}
//大按钮
.big-btn{
background:linear-gradient(132deg, #ED400C 0%, #FB862C 100%);
display: inline-block;
color: #FFFFFF;
width: 240rpx;
height: 100rpx;
line-height:100rpx;
font-size:36rpx;
border-radius:28rpx;
text-align: center; text-align: center;
padding: 10rpx 20rpx; font-weight: bold;
} }
/*单行溢出*/ /*单行溢出*/
......
...@@ -96,11 +96,14 @@ export default{ ...@@ -96,11 +96,14 @@ export default{
return d*(1 + fl*(h1*sf*(1-sg) - h2*(1-sf)*sg)) return d*(1 + fl*(h1*sf*(1-sg) - h2*(1-sf)*sg))
}, },
phoneReg:function(){//手机正则 phoneReg:function(){//手机正则
return /^(13[0-9]|14[0-9]|15[0-9]|18[0-9]|17[0-9]|19[0-9]|16[0-9])\d{8}$/ return /^(13[0-9]|14[0-9]|15[0-9]|18[0-9]|17[0-9]|19[0-9]|16[0-9]|12[0-9])\d{8}$/
}, },
idReg:function(){//身份证正则 idReg:function(){//身份证正则
return /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X|x)$/ return /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X|x)$/
}, },
nameReg:function(){//中文名字正则
return /^[\u4E00-\u9FA5]{2,40}$/
},
getUrlKey:function(name,url){//通过连接地址获取参数值 getUrlKey:function(name,url){//通过连接地址获取参数值
return(new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(decodeURIComponent(url)) || [, ''])[1].replace(/\+/g, '%20') || '' return(new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(decodeURIComponent(url)) || [, ''])[1].replace(/\+/g, '%20') || ''
}, },
......
<template> <template>
<u-popup :show="showPop" :round="20" @close="showPop=false"> <u-popup :show="showPop" :round="20" @close="showPop=false" closeable>
<view class="son-wrap"> <view class="son-wrap">
<view class="head"> <view class="head">
<view class="head1"> <view class="head1">
<view style="flex: 1;text-align: center;">
购买须知 购买须知
</view>
<u-icon name="close" @click="showPop=false"></u-icon>
</view> </view>
<view class="head2"> <view class="head2">
{{buyKnowData.name}} {{buyKnowData.name}}
...@@ -20,7 +17,7 @@ ...@@ -20,7 +17,7 @@
<view style="flex: 1;overflow-y: scroll;"> <view style="flex: 1;overflow-y: scroll;">
<view class="middle"> <view class="middle">
<view class="middle-list" v-for="(item,a) of buyKnowData.productTitleResVos" :key="a"> <view class="middle-list" v-for="(item,a) of buyKnowData.productTitleData" :key="a">
<view class="middle-title"> <view class="middle-title">
{{item.title}} {{item.title}}
</view> </view>
...@@ -45,7 +42,7 @@ ...@@ -45,7 +42,7 @@
¥ <text>{{buyKnowData.sellingPrice}}</text> ¥ <text>{{buyKnowData.sellingPrice}}</text>
</text> </text>
<view class="bottom-right"> <view class="bottom-right">
<text class="btn" @click="showPop=false"> <text class="middle-btn" @click="showPop=false">
去预订 去预订
</text> </text>
</view> </view>
...@@ -71,8 +68,7 @@ export default { ...@@ -71,8 +68,7 @@ export default {
<style scoped="scoped"> <style scoped="scoped">
.son-wrap{ .son-wrap{
position: relative; height:80vh;
height:85vh;
display: flex; display: flex;
flex-direction:column; flex-direction:column;
} }
...@@ -80,7 +76,7 @@ export default { ...@@ -80,7 +76,7 @@ export default {
padding: 0 24rpx; padding: 0 24rpx;
} }
.head1{ .head1{
display: flex; text-align: center;
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
padding: 30rpx 0; padding: 30rpx 0;
...@@ -113,8 +109,9 @@ export default { ...@@ -113,8 +109,9 @@ export default {
} }
.middle-content { .middle-content {
display: flex; display: flex;
margin-top: 30rpx; margin-top: 20rpx;
position: relative; position: relative;
line-height: 52rpx;
} }
.middle-content>text { .middle-content>text {
color: #666666; color: #666666;
...@@ -160,9 +157,4 @@ export default { ...@@ -160,9 +157,4 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.btn{
padding: 16rpx 48rpx;
border-radius: 20rpx;
font-size: 32rpx;
}
</style> </style>
<template> <template>
<!-- 客服 --> <!-- 客服 -->
<u-popup :show="showPop" :round="20" @close="showPop = false"> <u-popup :show="showPop" :round="20" @close="showPop = false" closeable>
<view class="son-wrap"> <view class="son-wrap">
<view class="title"> <view class="title">
<view style="flex: 1; text-align: center"> 客服电话 </view> 客服电话
<u-icon name="close" @click="showPop = false"></u-icon>
</view> </view>
<view class="middle"> <view class="middle">
<view class="list" v-for="(item, index) in scenicList" :key="index" @click="makePhone(item.phone)"> <view class="list" v-for="(item, index) in scenicList" :key="index" @click="makePhone(item.phone)">
...@@ -45,7 +44,7 @@ export default { ...@@ -45,7 +44,7 @@ export default {
flex-direction: column; flex-direction: column;
} }
.title { .title {
display: flex; text-align: center;
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
padding: 30rpx; padding: 30rpx;
......
<template> <template>
<!-- 商家详情弹窗 --> <!-- 商家详情弹窗 -->
<u-popup :show="showPop" :round="20" @close="showPop=false"> <u-popup :show="showPop" :round="20" @close="showPop=false" closeable>
<view class="son-wrap"> <view class="son-wrap">
<view class="head"> <view class="head">
<view class="head-name"> {{detailData.name}}
{{detailData.name}}
</view>
<u-icon name="close" @click="showPop=false"></u-icon>
</view> </view>
<view style="flex: 1;overflow-y: scroll;"> <view style="flex: 1;overflow-y: scroll;">
<view v-if="detailData.imgList&&detailData.imgList.length>0"> <view v-if="detailData.imgList&&detailData.imgList.length>0">
...@@ -166,7 +163,7 @@ export default { ...@@ -166,7 +163,7 @@ export default {
flex-direction:column; flex-direction:column;
} }
.head{ .head{
display: flex; text-align: center;
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
padding: 30rpx; padding: 30rpx;
......
<template> <template>
<!----------------适用于订单选择券的时候展示券列表--------------------------> <!-- -----------------------适用于下单页面选择券的时候展示券列表-------------------------- -->
<u-popup :show="show" :round="20" closeable @close="show=false"> <u-popup :show="showPop" :round="20" closeable @close="showPop=false">
<view class="title"> <view class="son-wrap">
<view class="titleContent" v-for="(item,index) of navTitle" :key="index" :class="{on:active==index}" @click="navClick(index)"> <view class="head">
<view style="position: relative;top:15rpx;">{{item}}</view> <view class="headlist" v-for="(item,index) of navTitle" :key="index" :class="{on:active==index}" @click="navClick(index)">
<view v-show="active==index"> <text>
<text></text> {{item}}
</text>
</view> </view>
</view> </view>
</view> <!------------------------------------可用-------------------------------------->
<!----------------------------------------------------可用------------------------------------------> <view class="middle" v-if="active==0">
<view v-show="active==0"> <checkbox-group @change="checkboxChange" v-if="masterSlaveCouponList&&masterSlaveCouponList.length>0">
<view class="middle"> <view v-for="(item,index) of masterSlaveCouponList" :key="index" class="list-box">
<checkbox-group @change="checkboxChange" v-if="couponList.masterSlaveCouponList&&couponList.masterSlaveCouponList.length>0"> <label>
<view v-for="(item,index) of couponList.masterSlaveCouponList" :key="index" class="listBox">
<label class="listLabel">
<view> <view>
{{item.couponName}} {{item.couponName}}
<checkbox :value="item.couponId" :checked="item.couponId==chooseCoupon.couponId" /> <checkbox :value="JSON.stringify(item)" :checked="item.couponId==chooseCoupon.couponId" class="blue" />
</view> </view>
<view> <view>
{{item.couponRule}} {{item.couponRule}}
...@@ -33,36 +31,37 @@ ...@@ -33,36 +31,37 @@
</label> </label>
</view> </view>
</checkbox-group> </checkbox-group>
<view class="empty" v-else>
空空如也...
</view>
</view> </view>
<!-- -------------------------------不可用-------------------------------- -->
<view class="empty" v-if="!couponList.masterSlaveCouponList||couponList.masterSlaveCouponList.length==0"> <view v-if="active==1" class="middle">
空空如也... <view v-if="unusableCouponList&&unusableCouponList.length>0">
</view> <view v-for="(item,index) of unusableCouponList" :key="index" class="list-box">
</view> <view>
{{item.couponName}}
<!--------------------------------------不可用------------------------------------------------------------> </view>
<view v-show="active==1"> <view>
<view class="middle" v-if="couponList.unusableCouponList&&couponList.unusableCouponList.length>0"> {{item.couponRule}}
<view v-for="(item,index) of couponList.unusableCouponList" :key="index" class="listBox"> <text v-if="item.savedMoney">
<view> <text>¥</text>{{parseFloat(item.savedMoney.toFixed(2))}}
{{item.couponName}} </text>
</view> </view>
<view>
{{item.couponRule}} <view>
<text v-if="item.savedMoney"> {{item.useStartDate}}-{{item.useEndDate}}
<text>¥</text>{{parseFloat(item.savedMoney.toFixed(2))}} </view>
</text>
</view>
<view>
{{item.useStartDate}}-{{item.useEndDate}}
</view> </view>
</view> </view>
<view class="empty" v-else>
空空如也...
</view>
</view> </view>
<view class="empty" v-if="!couponList.unusableCouponList||couponList.unusableCouponList.length==0"> </view>
空空如也... <view class="bottom-sure" @click="showPop=false">
</view> 确定
</view> </view>
</u-popup> </u-popup>
</template> </template>
...@@ -72,16 +71,25 @@ ...@@ -72,16 +71,25 @@
export default{ export default{
props:['couponData','chooseCouponObj'], props:['couponData','chooseCouponObj'],
watch: { watch: {
couponData:{// couponData:{//劵列表
handler(newValue, oldValue){ handler(newValue, oldValue){
if(newValue){ if(newValue){
this.couponList=this.couponData //可用优惠券去重
this.masterSlaveCouponList=[]
if(newValue.masterSlaveCouponList){
newValue.masterSlaveCouponList.forEach(item=>{
if(!this.masterSlaveCouponList.find(item2=>item2.couponId==item.couponId)){
this.masterSlaveCouponList.push(item)
}
})
}
this.unusableCouponList=newValue.unusableCouponList
} }
}, },
deep:true, deep:true,
immediate:true immediate:true
}, },
chooseCouponObj:{// chooseCouponObj:{//选中的券
handler(newValue, oldValue){ handler(newValue, oldValue){
if(newValue){ if(newValue){
this.chooseCoupon=this.chooseCouponObj this.chooseCoupon=this.chooseCouponObj
...@@ -94,36 +102,26 @@ export default{ ...@@ -94,36 +102,26 @@ export default{
data(){ data(){
return{ return{
active:0,//导航栏下标 active:0,//导航栏下标
show:false,//控制弹窗显示隐藏 showPop:false,//控制弹窗显示隐藏
current:0,//控制选项卡默认显示第几个 masterSlaveCouponList:[],//可用优惠券列表
couponList:'',//券列表 unusableCouponList:[],//不可用优惠券列表
chooseCoupon:'',//选中的劵 chooseCoupon:'',//选中的劵
navTitle:['可用','不可用'],//导航标题 navTitle:['可用','不可用'],//导航标题
} }
}, },
methods:{ methods:{
navClick(index){//------------------------------------------导航栏点击 //---导航栏点击
navClick(index){
this.active=index this.active=index
}, },
showCoupon(){//----------------------------------------展示弹窗
this.show=true
},
//---多选框值变化 //---多选框值变化
checkboxChange(evt){ checkboxChange(e){
if(evt.detail.value.length==2){ let value=e.detail.value
//删除第一个 if(value.length>0){
evt.detail.value.splice(0,1) let obj=JSON.parse(value[value.length-1])
//获取选中券,传值给父组件 this.$emit('couponChoose',obj)
this.chooseCoupon=this.couponList.masterSlaveCouponList.find((item)=>{ }
return item.couponId==evt.detail.value[0] if(value.length==0){
})
this.$emit('couponChoose',this.chooseCoupon)
}else if(evt.detail.value.length==1){
this.chooseCoupon=this.couponList.masterSlaveCouponList.find((item)=>{
return item.couponId==evt.detail.value[0]
})
this.$emit('couponChoose',this.chooseCoupon)
}else if(evt.detail.value.length==0){
this.$emit('couponChoose','') this.$emit('couponChoose','')
} }
} }
...@@ -133,19 +131,80 @@ export default{ ...@@ -133,19 +131,80 @@ export default{
</script> </script>
<style scoped="scoped" lang="scss"> <style scoped="scoped" lang="scss">
.title{display: flex;height: 80rpx;} .son-wrap{
.titleContent{flex:1;text-align: center;font-size:30rpx;} height:80vh;
.titleContent.on{color: $blue;font-weight: bold;} display: flex;
.titleContent view text{width: 40rpx;height: 6rpx;background:$blue;border-radius:6rpx;display:inline-block;position: relative;top:-10rpx;} flex-direction:column;
.middle{padding:24rpx;background:#f5f5f5;} }
.listBox{background: #FFFFFF;padding:24rpx;border-radius:10rpx;} .head{
.middle .listBox:not(:first-child){margin-top:20rpx;} display: flex;
.middle view view:not(:first-child){margin-top:20rpx;} }
.middle view view{display: flex;justify-content: space-between;} .headlist{
.middle view view:first-child{font-weight: bold;} width: 50%;
.middle view view:nth-child(2){font-size:24rpx;} height: 90rpx;
.middle view view:last-child{color: #666666;font-size:24rpx;} line-height: 90rpx;
.middle view text{color:#f9690e;font-size:30rpx;font-weight: bolder;} text-align: center;
.middle view text text{font-size:24rpx;font-weight: 400;} font-size:30rpx;
.empty{padding:100rpx 0;text-align: center;background: #f5f5f5;} }
.headlist.on text{
border-bottom: 6rpx solid $theme;
color: $theme;
font-weight: bold;
}
.middle{
padding:24rpx 24rpx 100rpx 24rpx;
background:#f5f5f5;
flex: 1;
overflow-y: scroll;
}
.list-box{
background: #FFFFFF;
padding:24rpx;
border-radius:10rpx;
}
.middle .list-box:not(:first-child){
margin-top:20rpx;
}
.list-box view:not(:first-child){
margin-top:20rpx;
}
.list-box view{
display: flex;
justify-content: space-between;
}
.list-box view:first-child{
font-weight: bold;
}
.list-box view:last-child{
color: #999999;
font-size:24rpx;
}
.list-box text{
color:#f9690e;
font-size:32rpx;
font-weight: bold;
}
.list-box text text{
font-size:24rpx;
font-weight: 400;
}
.empty{
padding:160rpx 0;
text-align: center;
color: $red;
}
.bottom-sure{
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 100rpx;
display: flex;
align-items: center;
justify-content: center;
background:$theme;
font-size:32rpx;
font-weight: bold;
color: #ffffff;
}
</style> </style>
...@@ -365,7 +365,7 @@ export default { ...@@ -365,7 +365,7 @@ export default {
.button{ .button{
width: 144rpx; width: 144rpx;
height: 64rpx; height: 64rpx;
background: $blue; background: $theme;
border-radius:8rpx; border-radius:8rpx;
display: inline-block; display: inline-block;
color:#ffffff; color:#ffffff;
...@@ -411,7 +411,7 @@ export default { ...@@ -411,7 +411,7 @@ export default {
display: inline-block; display: inline-block;
width: 212rpx; width: 212rpx;
height: 80rpx; height: 80rpx;
background:$blue; background:$theme;
border-radius: 44rpx; border-radius: 44rpx;
text-align: center; text-align: center;
line-height: 80rpx; line-height: 80rpx;
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</view> </view>
<view class="banner"> <view class="banner">
<u-swiper :list="list" @change="e => currentNum = e.current" indicatorStyle="right: 20px" height="300" circular> <u-swiper :list="list" @change="e => currentNum = e.current" indicatorStyle="right: 20px" height="300" circular @click='swiperClick(currentNum)'>
<view slot="indicator" class="indicator-num"> <view slot="indicator" class="indicator-num">
<text class="indicator-num__text">{{ currentNum + 1 }}/{{ list.length }}</text> <text class="indicator-num__text">{{ currentNum + 1 }}/{{ list.length }}</text>
</view> </view>
......
...@@ -344,7 +344,7 @@ export default { ...@@ -344,7 +344,7 @@ export default {
padding-right: 40rpx; padding-right: 40rpx;
} }
.search-btn { .search-btn {
background: $blue; background: $theme;
color: #fff; color: #fff;
border-radius: 32rpx; border-radius: 32rpx;
padding: 12rpx 24rpx; padding: 12rpx 24rpx;
...@@ -388,8 +388,8 @@ export default { ...@@ -388,8 +388,8 @@ export default {
justify-content: space-between; justify-content: space-between;
} }
.right2-left text{ .right2-left text{
color: $blue; color: $theme;
border: 1px solid $blue; border: 1px solid $theme;
font-size: 20rpx; font-size: 20rpx;
padding: 2rpx 4rpx; padding: 2rpx 4rpx;
border-radius: 2rpx; border-radius: 2rpx;
......
...@@ -125,7 +125,7 @@ export default { ...@@ -125,7 +125,7 @@ export default {
white-space: nowrap; white-space: nowrap;
} }
.choose-content.on{ .choose-content.on{
background: $blue; background: $theme;
color: #ffffff; color: #ffffff;
} }
.choose-name{ .choose-name{
......
...@@ -55,7 +55,9 @@ export default { ...@@ -55,7 +55,9 @@ export default {
let data={ let data={
search:this.search,//输入框的值 search:this.search,//输入框的值
userId:uni.getStorageSync('openid')||'', userId:uni.getStorageSync('openid')||'',
merchantCode:this.merchantCode merchantCode:this.merchantCode,
startPlayDate:new Date().Format('yyyy-MM-dd')+' 00:00:00',//开始日期
endPlayDate:new Date().Format('yyyy-MM-dd')+' 23:59:59',//结束日期
} }
uni.showLoading({ uni.showLoading({
title:'加载中' title:'加载中'
...@@ -258,6 +260,7 @@ export default { ...@@ -258,6 +260,7 @@ export default {
} }
.mark-close{ .mark-close{
margin-top: 60rpx; margin-top: 60rpx;
text-align: center; display: flex;
justify-content: center;
} }
</style> </style>
<template> <template>
<view v-show="bodyShow"> <view>
<view class="middle"> <view class="middle" v-show="orderList.length>0">
<view class="main"> <view class="middle-wrap">
<view v-if="orderList.length>0" v-for="item of orderList" :key="item.id" class="product"> <view v-for="item of orderList" :key="item.id" class="product">
<view> <view>
<text> {{ item.merchantName }}{{ item.productName }}</text> <text> {{ item.merchantName }}{{ item.productName }}</text>
...@@ -15,16 +15,14 @@ ...@@ -15,16 +15,14 @@
<text></text> <text> <text style="font-size:24rpx;"></text>{{ item.pdDiscountMoney }} </text> <text></text> <text> <text style="font-size:24rpx;"></text>{{ item.pdDiscountMoney }} </text>
</view> </view>
</view> </view>
<view class="mainP3"> <view class="middle-money">
<text> 实际支付 </text> <view> 实际支付 </view>
<text> <view>
<!--<i> <text style="font-size:28rpx;">¥</text>
¥{{totalMoney}} {{ pdOrderMoney }}
</i>--> </view>
<text> <text style="font-size:28rpx;">¥</text>{{ pdOrderMoney }} </text>
</text>
</view> </view>
<view class="mainview"> <view class="middle-image">
<!-- #ifdef MP-WEIXIN --> <!-- #ifdef MP-WEIXIN -->
<image src="@/static/img/orderPayment/weixin.png" style="width:70rpx;height:62rpx;" /> <view> 微信支付 </view> <image src="@/static/img/orderPayment/weixin.png" style="width:70rpx;height:62rpx;" /> <view> 微信支付 </view>
<!-- #endif --> <!-- #endif -->
...@@ -36,16 +34,20 @@ ...@@ -36,16 +34,20 @@
</view> </view>
</view> </view>
</view> </view>
<view v-show="errorMessage1||errorMessage2">
错误1:{{errorMessage1}}
错误2:{{errorMessage2}}
</view>
<view class="bottom"> <view class="bottom">
<view class="bottomFirst"> <view class="bottom-left">
<text> 实付款 </text> <text>实付款 </text>
<text v-show="pdOrderMoney">
<text> <text>¥</text>{{ pdOrderMoney }} </text> <text style="font-size: 28rpx;">¥</text>
{{pdOrderMoney}}
</text>
</view> </view>
<view class="bottom-right">
<view class="bottomLast"> <u-icon name="chat" size="40" @click="makePhone()"></u-icon>
<text href="tel:400-072-0368"> <!-- <img src="@/assets/img/combination/kefu11.png" style="width: 0.31rpx;" /> --> </text>
<text @click="goPay()" :style="{ background: background }">去支付</text> <text @click="goPay()" :style="{ background: background }">去支付</text>
</view> </view>
</view> </view>
...@@ -59,14 +61,14 @@ export default { ...@@ -59,14 +61,14 @@ export default {
orderList:[], //订单列表 orderList:[], //订单列表
pdOrderMoney: '', //实际总价 pdOrderMoney: '', //实际总价
totalMoney: '', //原价总价 totalMoney: '', //原价总价
errorMessage: '', //错误信息 errorMessage1: '', //错误信息1,接口成功返回的错误信息
bodyShow: false, //控制初始化数据成功显示 errorMessage2: '', //错误信息2,接口失败返回的错误信息
payType: '', //支付类型 payType: '', //支付类型
timeStamp: '', //支付参数 timeStamp: '', //微信支付参数
nonceStr: '', nonceStr: '',//微信支付参数
package: '', package: '',//微信支付参数
signType: '', signType: '',//微信支付参数
paySign: '', paySign: '',//微信支付参数
orderInfo: '', //支付宝订单号 orderInfo: '', //支付宝订单号
background: '', //去支付的背景颜色 background: '', //去支付的背景颜色
orderId: '', //订单Id orderId: '', //订单Id
...@@ -141,13 +143,22 @@ export default { ...@@ -141,13 +143,22 @@ export default {
} }
}) })
}, },
//---拨打电话
makePhone() {
uni.makePhoneCall({
phoneNumber:'400-072-0368'
})
},
//---初始化产品信息,以及获取支付需要的参数
initDetail() { initDetail() {
//---初始化产品信息,以及获取支付需要的参数
let data = { let data = {
orderId: this.orderId, //订单Id orderId: this.orderId, //订单Id
userId: this.openid, //用户Id userId: this.openid, //用户Id
payType: this.payType //支付类型 payType: this.payType //支付类型
} }
uni.showLoading({
mask:true
})
this.$request('orderc/order/findOrderInfo', data).then(res => { this.$request('orderc/order/findOrderInfo', data).then(res => {
if (res.code == '00') { if (res.code == '00') {
if(this.albumOrderdetail==1){ if(this.albumOrderdetail==1){
...@@ -159,8 +170,6 @@ export default { ...@@ -159,8 +170,6 @@ export default {
this.afterBuyUrl='/pages/my/order/orderList/orderList' this.afterBuyUrl='/pages/my/order/orderList/orderList'
} }
} }
this.bodyShow = true
//支付参数开始 //支付参数开始
this.timeStamp = res.data.timestamp this.timeStamp = res.data.timestamp
this.nonceStr = res.data.noncestr this.nonceStr = res.data.noncestr
...@@ -176,7 +185,7 @@ export default { ...@@ -176,7 +185,7 @@ export default {
url: '/pages/payment/paySuccess/paySuccess?orderId=' + this.orderId+'&afterBuyUrl=' + this.afterBuyUrl + '&ifyukuaiCode=' + this.ifyukuaiCode url: '/pages/payment/paySuccess/paySuccess?orderId=' + this.orderId+'&afterBuyUrl=' + this.afterBuyUrl + '&ifyukuaiCode=' + this.ifyukuaiCode
}) })
} }
this.errorMessage = res.data.errorMessage this.errorMessage1 = res.data.errorMessage
this.totalMoney = res.data.totalMoney this.totalMoney = res.data.totalMoney
this.orderList = res.data.orderList||[] this.orderList = res.data.orderList||[]
if (this.orderList.length==0) { if (this.orderList.length==0) {
...@@ -195,14 +204,15 @@ export default { ...@@ -195,14 +204,15 @@ export default {
title: res.message, title: res.message,
icon: 'none' icon: 'none'
}) })
this.errorMessage2=res.message
} }
}) })
}, },
//----去支付
goPay() { goPay() {
//-------------------------------------------------------去支付 if (this.errorMessage1) {
if (this.errorMessage) {
uni.showToast({ uni.showToast({
title: this.errorMessage, title: this.errorMessage1,
icon: 'none' icon: 'none'
}) })
return return
...@@ -211,8 +221,14 @@ export default { ...@@ -211,8 +221,14 @@ export default {
setTimeout(() => { setTimeout(() => {
this.background = 'f9690e' this.background = 'f9690e'
}, 1000) }, 1000)
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
if(!this.timeStamp||!this.nonceStr||!this.package||!this.signType||!this.paySign){
uni.showToast({
title: '缺少支付参数',
icon: 'none'
})
return
}
uni.requestPayment({ uni.requestPayment({
provider: 'wxpay', provider: 'wxpay',
timeStamp: this.timeStamp, timeStamp: this.timeStamp,
...@@ -235,6 +251,13 @@ export default { ...@@ -235,6 +251,13 @@ export default {
//#endif //#endif
// #ifdef MP-ALIPAY // #ifdef MP-ALIPAY
if(!this.orderInfo){
uni.showToast({
title: '缺少支付参数',
icon: 'none'
})
return
}
uni.requestPayment({ uni.requestPayment({
provider: 'alipay', // 服务提供商 支付宝支付: alipay 微信支付: wxpay provider: 'alipay', // 服务提供商 支付宝支付: alipay 微信支付: wxpay
orderInfo: this.orderInfo, // 支付宝订单号 orderInfo: this.orderInfo, // 支付宝订单号
...@@ -264,7 +287,7 @@ export default { ...@@ -264,7 +287,7 @@ export default {
.middle { .middle {
padding: 30rpx 24rpx 0 24rpx; padding: 30rpx 24rpx 0 24rpx;
} }
.main { .middle-wrap {
padding: 10rpx 24rpx 20rpx 24rpx; padding: 10rpx 24rpx 20rpx 24rpx;
background: #ffffff; background: #ffffff;
border-radius: 20rpx; border-radius: 20rpx;
...@@ -296,7 +319,7 @@ export default { ...@@ -296,7 +319,7 @@ export default {
.product view.coupon text { .product view.coupon text {
font-size: 30rpx; font-size: 30rpx;
} }
.mainP3 { .middle-money {
height: 120rpx; height: 120rpx;
color: #000000; color: #000000;
border-bottom: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5;
...@@ -306,25 +329,24 @@ export default { ...@@ -306,25 +329,24 @@ export default {
box-sizing: border-box; box-sizing: border-box;
justify-content: space-between; justify-content: space-between;
} }
.mainP3 text:nth-child(2) { .middle-money view:nth-child(2) {
font-size: 24rpx; font-size: 24rpx;
color: #666666; color: #666666;
} }
.mainP3 text:nth-child(2) text:nth-child(1) { .middle-money view:nth-child(2) {
font-size: 36rpx; font-size: 36rpx;
color: #f9690e; color: #f9690e;
margin-left: 20rpx;
font-weight: bold; font-weight: bold;
} }
.mainview { .middle-image {
margin-top: 50rpx; margin-top: 50rpx;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.mainview > image:first-child { .middle-image > image:first-child {
margin: 0 20rpx 0 10rpx; margin: 0 20rpx 0 10rpx;
} }
.mainview > view { .middle-image > view {
flex: 1; flex: 1;
} }
.bottom { .bottom {
...@@ -337,41 +359,25 @@ export default { ...@@ -337,41 +359,25 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.bottomFirst { .bottom-left {
border-right: 1px solid #cccccc; border-right: 1px solid #cccccc;
padding-left: 40rpx; padding-left: 40rpx;
width: 40%; width: 40%;
box-sizing: border-box;
} }
.bottomFirst text:nth-child(2) { .bottom-left text:nth-child(2) {
font-size: 40rpx; font-size: 40rpx;
color: #f9690e; color: #f9690e;
margin-left: 10rpx; margin-left: 10rpx;
font-weight: bold; font-weight: bold;
} }
.bottomFirst text:nth-child(2) text { .bottom-right {
font-size: 28rpx; padding-left:30rpx;
}
.bottomLast {
padding-left: 20rpx;
display: flex; display: flex;
width: 60%; width: 60%;
padding-right: 20rpx; padding-right:30rpx;
box-sizing: border-box;
align-items: center; align-items: center;
} }
.bottomLast text:first-child { .bottom-right text:nth-child(2) {
display: block;
text-align: center;
width: 60rpx;
}
.bottomLast text:first-child text {
margin-top: 10rpx;
display: inline-block;
font-size: 24rpx;
color: #666666;
}
.bottomLast text:nth-child(2) {
flex: 1; flex: 1;
height: 70rpx; height: 70rpx;
display: inline-block; display: inline-block;
...@@ -382,5 +388,6 @@ export default { ...@@ -382,5 +388,6 @@ export default {
margin-left: 30rpx; margin-left: 30rpx;
border-radius: 20rpx; border-radius: 20rpx;
font-size: 32rpx; font-size: 32rpx;
font-weight: bold;
} }
</style> </style>
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
</view> </view>
</view> </view>
</template> </template>
<!-- 显示增加数量页面 -->
<template v-if="showNumber"> <template v-if="showNumber">
<view class="top2"> <view class="top2">
<view class="top2-name"> <view class="top2-name">
...@@ -100,9 +100,10 @@ ...@@ -100,9 +100,10 @@
v-model="buyNum" v-model="buyNum"
bg-color='#3688FF' bg-color='#3688FF'
color='#ffffff' color='#ffffff'
:input-height="60" iconStyle='color:#ffffff;font-size:32rpx;'
:min="1" buttonSize='60'
size='28'> input-width="100"
:min="1">
</u-number-box> </u-number-box>
</view> </view>
<view class="top2-price"> <view class="top2-price">
...@@ -363,7 +364,7 @@ export default { ...@@ -363,7 +364,7 @@ export default {
}, },
showCoupon() { showCoupon() {
//---展示券列表 //---展示券列表
this.$refs.orderCoupon.showCoupon() this.$refs.orderCoupon.showPop=true
}, },
//---初始化获取商家名称,大商家 //---初始化获取商家名称,大商家
initMerchant() { initMerchant() {
...@@ -396,20 +397,21 @@ export default { ...@@ -396,20 +397,21 @@ export default {
this.$request('user/newCompany/findCompanyById', data).then(res => { this.$request('user/newCompany/findCompanyById', data).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.code == '00') { if (res.code == '00') {
this.companyAttribute = res.data.companyAttribute
this.paydJumpUrl = res.data.paydJumpUrl this.paydJumpUrl = res.data.paydJumpUrl
if (this.companyAttribute == 5) { let list=res.data.companyTollPointVoList||[]
//出租车显示联系人姓名,其他显示公司名称
this.companyName = res.data.contactName
} else {
this.companyName = res.data.companyName
}
let list=res.data.companyTollPointVoList
list.forEach(item=>{ list.forEach(item=>{
if(item.tollPoints==this.extendInfo){ if(item.tollPoints==this.extendInfo){
this.tollPoint=item this.tollPoint=item
} }
}) })
this.companyAttribute = res.data.companyAttribute
if (this.companyAttribute == 5) {
//出租车显示联系人姓名
this.companyName = res.data.contactName
} else {
//优先取收费点名称,然后是公司名称,然后是联系人名称
this.companyName=this.tollPoint.tollPointByname||res.data.companyName||res.data.contactName
}
if(this.tollPoint.tollPointsModel==0){ if(this.tollPoint.tollPointsModel==0){
//显示输入金额页面 //显示输入金额页面
this.showMoney=true this.showMoney=true
...@@ -426,8 +428,6 @@ export default { ...@@ -426,8 +428,6 @@ export default {
icon: 'none' icon: 'none'
}) })
} }
//优先取收费点名称,然后是公司名称,然后是联系人名称
this.companyName=this.tollPoint.tollPointByname||res.data.companyName||res.data.contactName
} }
} else { } else {
uni.showToast({ uni.showToast({
...@@ -604,11 +604,11 @@ export default { ...@@ -604,11 +604,11 @@ export default {
success:res=>{ success:res=>{
if (this.companyAttribute == 5) { if (this.companyAttribute == 5) {
//出租车跳转分销组合票页面 //出租车跳转分销组合票页面
uni.navigateTo({ uni.reLaunch({
url: this.paydJumpUrl url: this.paydJumpUrl
}) })
} else { } else {
uni.navigateTo({ uni.reLaunch({
url: '/pages/payment/paySuccess/paySuccess?orderId=' + this.orderId url: '/pages/payment/paySuccess/paySuccess?orderId=' + this.orderId
}) })
} }
...@@ -629,11 +629,11 @@ export default { ...@@ -629,11 +629,11 @@ export default {
success:res=>{ success:res=>{
if (this.companyAttribute == 5) { if (this.companyAttribute == 5) {
//出租车跳转分销组合票页面 //出租车跳转分销组合票页面
uni.navigateTo({ uni.reLaunch({
url: this.paydJumpUrl url: this.paydJumpUrl
}) })
} else { } else {
uni.navigateTo({ uni.reLaunch({
url: '/pages/payment/paySuccess/paySuccess?orderId=' + this.orderId url: '/pages/payment/paySuccess/paySuccess?orderId=' + this.orderId
}) })
} }
......
...@@ -660,7 +660,7 @@ export default { ...@@ -660,7 +660,7 @@ export default {
} }
.tabbar .on { .tabbar .on {
// background: url('../../../static/img/scenic/tabbar.png') no-repeat; // background: url('../../../static/img/scenic/tabbar.png') no-repeat;
background: $blue; background: $theme;
background-size: 100% 100%; background-size: 100% 100%;
color: #fff; color: #fff;
font-weight: bold; font-weight: bold;
...@@ -750,7 +750,7 @@ export default { ...@@ -750,7 +750,7 @@ export default {
align-items: center; align-items: center;
} }
.product-rule { .product-rule {
color: $blue; color: $theme;
} }
.product-rule::after { .product-rule::after {
display: inline-block; display: inline-block;
......
<template> <template>
<div>
<u-calendar <u-calendar
:show="show" :show="show"
@confirm="onConfirm" @confirm="onConfirm"
...@@ -8,51 +7,37 @@ ...@@ -8,51 +7,37 @@
:defaultDate="defaultDate" :defaultDate="defaultDate"
:formatter='formatter' :formatter='formatter'
ref="calendar2" ref="calendar2"
rowHeight='112'
round='20'
closeOnClickOverlay='true'
></u-calendar> ></u-calendar>
</div>
</template> </template>
<script> <script>
export default { export default {
props: ['dateList'], props: ['dateList'],
watch: { watch: {
dateList:{ dateList:{
handler(newValue, oldValue){ handler(newValue, oldValue){
if(newValue&&newValue.length>0){ if(newValue&&newValue.length>0){
this.maxDate=newValue[newValue.length-1].startTime.substr(0,10) this.maxDate=newValue[newValue.length-1].startTime.substr(0,10)
} }
}, },
deep:true, deep:true,
immediate:true immediate:true
} }
}, },
data() { data() {
return { return {
date: '', //选择的日期
show: false, //控制日历显示隐藏 show: false, //控制日历显示隐藏
defaultDate:'', //默认日期 defaultDate:'', //默认日期
maxDate:'',//最大日期 maxDate:'',//最大日期
} }
}, },
mounted() { //默认为第一天 mounted() {
this.$refs.calendar2.setFormatter(this.formatter) this.$refs.calendar2.setFormatter(this.formatter)
}, },
methods: { 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) { onConfirm(date) {
this.show = false this.show = false
...@@ -73,23 +58,16 @@ export default { ...@@ -73,23 +58,16 @@ export default {
//真机调试手极端报错,暂时注释 //真机调试手极端报错,暂时注释
// this.dateList.forEach((item, index) => { // this.dateList.forEach((item, index) => {
// if (item.startTime.substr(0, 10) == dates) { // if (item.startTime.substr(0, 10) == dates) {
// day.bottomInfo = "¥" + item.sellingPrice // day.bottomInfo = '¥' + item.sellingPrice
// day.dot = true // day.dot = true
// } // }
// }) // })
// if (!day.bottomInfo) { // if (!day.bottomInfo) {
// day.type = "disabled" // day.type = 'disabled'
// } // }
return day 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> </script>
......
<template> <template>
<view class="area-box"> <view class="area-box">
<view class="top" @click="sure()"> <view class="top" @click="closeSon()">
<view class="top-left"> <view class="top-left">
选择(索道)出发站点 选择(索道)出发站点
</view> </view>
<view> <view>
<u-icon name="close"></u-icon> <u-icon name="close" bold></u-icon>
</view> </view>
</view> </view>
<!-- 没有默认站点时-->
<view v-if="defaultAreaCode" class="defaultArea"> <template v-if="!defaultAreaCode">
<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/scenic/chooseArea.jpg" mode="widthFix"></image>
</view>
<view>
<a class="middle-btn" @click="sure()">确定</a>
</view>
</view>
<template v-else>
<view class="bottom"> <view class="bottom">
<view class="bottom1"> <view class="bottom1">
<view> <view>
...@@ -72,7 +21,7 @@ ...@@ -72,7 +21,7 @@
</view> </view>
<view class="bottom1-btn"> <view class="bottom1-btn">
<text class="btn" @click="getSort(item)" v-for="(item,index) of areaList" :key="index"> <text class="btn" @click="chooseArea(item)" v-for="(item,index) of areaList" :key="index">
{{item.areaName}} {{item.areaName}}
</text> </text>
</view> </view>
...@@ -121,7 +70,7 @@ ...@@ -121,7 +70,7 @@
</text> </text>
</view> </view>
</template> </template>
<view> <!-- <view>
<text> <text>
退票规则: 退票规则:
</text> </text>
...@@ -129,19 +78,19 @@ ...@@ -129,19 +78,19 @@
<text> <text>
不可退 不可退
</text> </text>
</view> </view> -->
<view> <view>
返程时,根据现场情况需重新取号 返程时,根据现场情况需重新取号
</view> </view>
<view v-if="!sortIfo" style="font-size:32rpx;color: #ff0000;"> <view v-if="!sortIfo" style="font-size:32rpx;color:#FC6703;">
未找到本站信息,请根据现场大屏幕信息合理购票 未找到本站信息,请根据现场大屏幕信息合理购票
</view> </view>
<view style="text-align: center;"> <view style="text-align: center;">
<text class="middle-btn" @click="hidePop()" style="color: #333;margin-right: 48rpx;"> <text class="btn" @click="hidePop()" style="color: #555;margin-right: 48rpx;">
取消 取消
</text> </text>
<text class="middle-btn" @click="sure()"> <text class="btn" @click="sure()">
确定 确定
</text> </text>
</view> </view>
...@@ -149,7 +98,56 @@ ...@@ -149,7 +98,56 @@
</view> </view>
</template> </template>
<!-- 有默认站点时 -->
<view v-else 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/scenic/chooseArea.jpg" mode="widthFix"></image>
</view>
<view>
<a class="btn" @click="closeSon()">确定</a>
</view>
</view>
</view> </view>
</template> </template>
...@@ -162,7 +160,7 @@ export default { ...@@ -162,7 +160,7 @@ export default {
showPop: false, //控制弹窗显示隐藏 showPop: false, //控制弹窗显示隐藏
distanceIndex:0, //最小距离下标 distanceIndex:0, //最小距离下标
distanceList: [], //所有距离列表 distanceList: [], //所有距离列表
sortIfo: '', //排信息 sortIfo: '', //排信息
areaObj: { areaObj: {
areaCode: '', //选中的区域编码 areaCode: '', //选中的区域编码
areaName: '', //选中的区域名字 areaName: '', //选中的区域名字
...@@ -174,18 +172,12 @@ export default { ...@@ -174,18 +172,12 @@ export default {
created() { created() {
//如果有默认站点 //如果有默认站点
if(this.defaultAreaCode&&this.sortArr.length>0){ if(this.defaultAreaCode&&this.sortArr.length>0){
this.sortArr.forEach(item=>{ this.sortArr.forEach(item=>{
if(item.projectId==this.defaultAreaCode){ if(item.projectId==this.defaultAreaCode){
this.sortIfo=item this.sortIfo=item
this.sortIfo.peopleNumber = Math.max(item.sortTotalCapacity-item.showEnd,0) 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 return
} }
uni.getLocation({ uni.getLocation({
...@@ -198,27 +190,23 @@ export default { ...@@ -198,27 +190,23 @@ export default {
}) })
}, },
methods: { methods: {
//---关闭组件
closeSon(){
this.$parent.closeArea()
},
//---隐藏弹窗 //---隐藏弹窗
hidePop() { hidePop() {
this.showPop = false this.showPop = false
}, },
//---返回隐藏该组件 //---确定选择站点
returnClose() {
this.$parent.closeArea()
},
//---隐藏该组件
sure() { sure() {
this.showPop = false this.showPop = false
this.$parent.closeArea() this.$parent.closeArea()
this.$emit('areaSure', this.areaObj) this.$emit('areaSure', this.areaObj)
}, },
//---获取排号信息 //---选择站点,获取排号信息
getSort(item) { chooseArea(item) {
this.showPop = true this.showPop = true
let data = {
areaCode: item.areaCode,
merchantCode: this.merchantCode, //商户code
}
this.areaObj.areaCode = item.areaCode //获取选中的站点code,便于找到返回数据的下标 this.areaObj.areaCode = item.areaCode //获取选中的站点code,便于找到返回数据的下标
this.areaObj.areaName = item.areaName this.areaObj.areaName = item.areaName
this.sortArr.forEach((item)=>{ this.sortArr.forEach((item)=>{
...@@ -255,7 +243,7 @@ export default { ...@@ -255,7 +243,7 @@ export default {
text-align: center; text-align: center;
} }
.defaultArea view text:last-child{ .defaultArea view text:last-child{
color: #e70313; color: $red;
font-size:32rpx; font-size:32rpx;
font-weight: bold; font-weight: bold;
} }
...@@ -266,7 +254,7 @@ export default { ...@@ -266,7 +254,7 @@ export default {
right: 0; right: 0;
bottom: 0; bottom: 0;
z-index:99; z-index:99;
background: #f5f5f5; background: #ECF3FE;
} }
.top{ .top{
display: flex; display: flex;
...@@ -288,7 +276,7 @@ export default { ...@@ -288,7 +276,7 @@ export default {
} }
.bottom1-choose{ .bottom1-choose{
font-size: 32rpx; font-size: 32rpx;
color: #ff0000; color: $red;
text{ text{
font-weight: bold; font-weight: bold;
font-size: 36rpx; font-size: 36rpx;
...@@ -300,12 +288,12 @@ export default { ...@@ -300,12 +288,12 @@ export default {
.bottom2{ .bottom2{
margin-top: 60rpx; margin-top: 60rpx;
font-size: 32rpx; font-size: 32rpx;
color: #ff0000; color:$red;
text-align: center; text-align: center;
} }
// 弹窗 // 弹窗
.pop-wrap{ .pop-wrap{
background: rgba(0,0,0,0.1); background: rgba(0,0,0,0.4);
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
...@@ -328,6 +316,6 @@ export default { ...@@ -328,6 +316,6 @@ export default {
.pop-content view:not(:last-child) text:last-child{ .pop-content view:not(:last-child) text:last-child{
font-size:36rpx; font-size:36rpx;
font-weight: bolder; font-weight: bolder;
color: #f40000 color:$red;
} }
</style> </style>
<template> <template>
<view class="contact-box"> <view v-show="showPop">
<u-popup :show="contactsShow" @close="contactsShow=false"> <view class="list-box">
<view class="top"> <view class="top">
<u-icon name="close" @click="contactsShow=false"></u-icon> <view class="top-num">
<text> <text>
需填写{{buyNum}}位联系人 需填写{{contactNum}}位联系人
<text v-if="buyNum-chooseContact.length>0">
,还需
<text class="top-number">{{buyNum-chooseContact.length}}</text>
位出行人
</text> </text>
</text> <view class="top-icon" @click="showPop=false">
<u-icon name="close" bold></u-icon>
<text @click="config()" class="top-sure"> </view>
确定 </view>
</text> <view @click="showEdit()" class="top-add">
</view>
<view class="bottom">
<view @click="showEdit()" class="bottom-add">
<text> <text>
+添加旅客信息 +添加旅客信息
</text> </text>
</view> </view>
</view>
<view class="bottom">
<checkbox-group @change="chooseContactChange"> <checkbox-group @change="chooseContactChange">
<view class="bottom-list" v-for="(item,index) of contactData" :key="item.id"> <view class="bottom-list" v-for="(item,index) of listTotal" :key="item.id">
<label> <label>
<checkbox :value="JSON.stringify(item)" :checked="item.ifChoose" color="#3688ff" /> <checkbox class="blue" :value="JSON.stringify(item)" :checked="item.ifChoose" color="#3688ff" />
<view class="bottom-content"> <view class="bottom-content">
<view> <view>
{{item.name}} {{item.name}}
</view> </view>
<view> <view>
<text> <text>
身份证 身份证
</text> </text>
{{item.credentialNumber?item.credentialNumber.substr(0,3)+"****"+item.credentialNumber.substr(14,4):"无"}} {{item.credentialNumber?item.credentialNumber.substr(0,3)+"****"+item.credentialNumber.substr(14,4):"无"}}
</view> </view>
<view>
<text>
手机号
</text>
{{item.phone?item.phone.substr(0,3)+"****"+item.phone.substr(7,4):"无"}}
</view>
</view> </view>
</label> </label>
<view @click="goEdit(item)" style="margin-right:20rpx;"> <view @click="goEdit(item)" style="margin-right:20rpx;">
<u-icon name="edit-pen" color="#3688ff" size="28"></u-icon> <u-icon name="edit-pen" color="#3688ff" size="56"></u-icon>
</view> </view>
<view @click="clickDele(item.id)"> <view @click="clickDele(item.id)">
<u-icon name="trash-fill" color="#3688ff" size="28"></u-icon> <u-icon name="trash-fill" color="#3688ff" size="56"></u-icon>
</view> </view>
</view>
<u-modal :show="showModal" @confirm="confirmDele" @cancel="showModal=false" showCancelButton title="确认删除该联系人" ></u-modal> <view style="margin: 40rpx 0;text-align: center;" v-if='listTotal&&listTotal.length>0'>
已展示所有联系人
</view> </view>
</checkbox-group> </checkbox-group>
</view>
</u-popup> <view class="bottom-sure" @click="config()">
确定
</view>
</view>
</view>
<u-modal :show="showModal" @confirm="confirmDele" @cancel="showModal=false" showCancelButton title="确认删除该联系人" ></u-modal>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
props: ["contactData", "orderTouristList", "buyNum"], props: ['contactTotal', 'contactNum'],
watch: { watch: {
orderTouristList: { contactTotal: {
handler(newValue, oldValue) { handler(newValue, oldValue) {
if (newValue) { if (newValue) {
this.chooseContact = this.orderTouristList this.listTotal = this.contactTotal
} }
}, },
deep: true, deep: true,
immediate: true immediate: true
} }
}, },
data() { data() {
return { return {
contactsShow: false, //控制联系人弹窗显示隐藏 showPop: false, //控制联系人弹窗显示隐藏
chooseContact: [], //选中的联系人 listTotal:[],//所有联系人
showModal: false, //确认弹窗显示隐藏 showModal: false, //确认弹窗显示隐藏
contactId:'',//删除联系人的Id contactId:'',//删除联系人的Id
} }
}, },
methods: { methods: {
//---点击新增,展示编辑联系人弹窗,并传空值给编辑弹窗 //---点击新增,展示编辑联系人弹窗,并传空值给编辑弹窗
showEdit() { showEdit() {
this.contactsShow=false this.$parent.showEdit()
this.$parent.showEdit() this.$emit('getEditContact', '')
this.$emit("getEditContact", "") },
}, //---展示编辑弹窗,并传值给编辑弹窗
//---展示编辑弹窗,并传值给编辑弹窗 goEdit(obj) {
goEdit(obj) { this.$parent.showEdit()
this.contactsShow=false this.$emit('getEditContact', obj)
this.$parent.showEdit() },
this.$emit("getEditContact", obj) //---确定选中的联系人
}, config() {
//---确定选中的联系人 this.showPop = false
config() { //选中的排在前面
this.contactsShow = false this.listTotal.sort(function (a, b) {
this.$emit("contactListConfig", this.chooseContact) return b.ifChoose-a.ifChoose
})
}, this.$parent.contactTotal=this.listTotal
//---联系人姓名变化 let chooseArr=[]
chooseContactChange(e){ this.listTotal.forEach(item=>{
let value=e.detail.value if(item.ifChoose){
let arr=[] chooseArr.push(item)
value.forEach(item=>{ }
arr.push(JSON.parse(item)) })
}) this.$parent.chooseContact=chooseArr
this.chooseContact=arr },
if (arr.length == this.buyNum) { //当选择的人数等于需要填的人数时关闭弹窗 //---联系人姓名变化
this.config() chooseContactChange(e){
} let value=e.detail.value
if (arr.length > this.buyNum) { if (value.length > this.contactNum) {
arr.shift() let number=value.length-this.contactNum
this.config() value=value.slice(number)
} }
}, let arr=[]
//---点击删除 value.forEach(item=>{
clickDele(id) { arr.push(JSON.parse(item))
this.showModal = true })
this.contactId=id //先全部取消选中,后面根据选中的值来判断谁选中
}, this.listTotal.forEach(item=>{
//---确认删除 item.ifChoose=false
confirmDele(){ })
let data={ arr.forEach(item=>{
id:this.contactId this.listTotal.forEach(item2=>{
} if(item.id==item2.id){
this.$request('wechatUser/contact/deleteContact', data).then((res) => { item2.ifChoose=true
if (res.code == '00') { }
uni.showToast({ })
title:'删除成功', })
icon:'none' },
}) //---点击删除
this.showModal = false clickDele(id) {
this.contactsShow=false this.showModal = true
this.$parent.getContactList() this.contactId=id
} else { },
uni.showToast({ //---确认删除
title:res.message, confirmDele(){
icon:'none' let data={
}) id:this.contactId
} }
}).catch(() => { this.$request('wechatUser/contact/deleteContact', data).then((res) => {
this.showModal = false if (res.code == '00') {
}) uni.showToast({
} title:'删除成功',
} icon:'none'
} })
this.showModal = false
this.$parent.getContactList()
} else {
uni.showToast({
title:res.message,
icon:'none'
})
}
}).catch(() => {
this.showModal = false
})
}
}
}
</script> </script>
<style scoped="scoped" lang="scss"> <style scoped="scoped" lang="scss">
.top { .list-box{
height:100rpx; background: #F5F5F5;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 999;
display: flex; display: flex;
justify-content: space-between; flex-direction: column;
background: #f0f0f0;
align-items: center;
padding: 0 24rpx;
} }
.top-sure { .top-num{
color: var(--main-color); height: 100rpx;
font-size: 28rpx; display: flex;
} align-items: center;
.top-number{ background: #FFF1E8;
color: #f9690e; color: #FC771D;
justify-content: center;
font-weight: bold;
font-size: 32rpx; font-size: 32rpx;
font-weight:bold; position: relative;
} }
.top-icon{
.bottom { position: absolute;
padding:0 24rpx 80rpx 24rpx; right: 24rpx;
} }
.top-add {
.bottom-add { height:150rpx;
height:130rpx;
display: flex; display: flex;
align-items: center; align-items: center;
border-bottom: 1px solid #e6e6e6;
width: 100%;
justify-content: center; justify-content: center;
border-bottom: 1px solid #e6e6e6;
padding: 0 24rpx;
background: #ECF3FE;
} }
.top-add text{
.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; display: inline-block;
width:100%;
height: 76rpx;
text-align: center;
line-height:76rpx;
border: 1px solid $theme;
color:$theme;
border-radius:5rpx; border-radius:5rpx;
box-shadow:0px 0px 12px 2px rgba(0,0,0,0.08);
}
.bottom {
padding:0 24rpx 100rpx 24rpx;
flex: 1;
overflow-y: scroll;
} }
.bottom-list{ .bottom-list{
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
...@@ -198,29 +228,38 @@ ...@@ -198,29 +228,38 @@
border-bottom: 1px solid #E6E6E6; border-bottom: 1px solid #E6E6E6;
padding:25rpx 0; padding:25rpx 0;
} }
.bottom-list label { .bottom-list label {
display: flex; display: flex;
flex: 1; flex: 1;
align-items: center; align-items: center;
} }
.bottom-content { .bottom-content {
flex: 1; flex: 1;
margin-left: 40rpx; margin-left: 40rpx;
} }
.bottom-content view { .bottom-content view {
font-size:28rpx; font-size:28rpx;
color: #666666; color: #666666;
} }
.bottom-content view:not(:first-child) { .bottom-content view:not(:first-child) {
margin-top: 10rpx; margin-top: 10rpx;
} }
.bottom-content view text { .bottom-content view text {
display: inline-block; display: inline-block;
width: 100rpx; width: 100rpx;
} }
.bottom-sure{
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 100rpx;
display: flex;
align-items: center;
justify-content: center;
background:$theme;
font-size:32rpx;
font-weight: bold;
color: #ffffff;
}
</style> </style>
<template> <template>
<view> <u-popup :show="showPop" :round="20" @close="showPop = false" closeable>
<u-popup :show="show" :round="10" closeable @close="show=false"> <view class="son-wrap">
<view class="detail"> <view class="detail-title">
<view class="detail-title"> 订单明细
费用明细 </view>
</view>
<view class="detail-content">
<view class="content-box">
<text>
{{merchantName}}({{name}})
</text>
<view class="content-right"> <view style="flex: 1; overflow-y: scroll">
<view>¥{{sellingPrice}}x{{buyNum}}</view> <view class="content-box">
<view v-if="productDepositTotal">押金:{{productDepositTotal}}</view> <text> {{ merchantName }}({{ name }}) </text>
</view>
</view>
<!-- ---------------------------------------额外服务------------------------------------------- -->
<view class="content-box" v-for="(item,index) of choooseServiceData" :key="index">
<text>
{{item.name}}
</text>
<view class="content-right"> <view class="content-right">
<view>¥{{item.sellingPrice}}x{{buyNum}}</view> <view>¥{{ sellingPrice }}x{{ buyNum }}</view>
<view v-if="item.depositTotal">押金:{{item.depositTotal}}</view> <view v-if="productDepositTotal">押金:{{ productDepositTotal }}</view>
</view>
</view> </view>
<view class="content-box" v-if="chooseCouponObj&&chooseCouponObj.savedMoney>0"> </view>
<text> <!-- ---------------------------------------额外服务------------------------------------------- -->
<view class="content-box" v-for="(item, index) of chooseService" :key="index">
</text> <text>
{{ item.name }}
</text>
<text class="content-right"> <view class="content-right">
{{parseFloat(chooseCouponObj.savedMoney.toFixed(2))}} <view>¥{{ item.sellingPrice }}x{{ buyNum }}</view>
</text> <view v-if="item.depositTotal">押金:{{ item.depositTotal }}</view>
</view> </view>
</view>
<view class="content-box" v-if="chooseCouponObj && chooseCouponObj.savedMoney > 0">
<text></text>
<view class="content-box content-total"> <text class="content-right">{{ parseFloat(chooseCouponObj.savedMoney.toFixed(2)) }} </text>
<text> </view>
合计
</text>
<text class="content-right"> <view class="content-box content-total">
¥<text style="font-size:36rpx;">{{sellTotal}}</text> <text> 合计 </text>
</text>
</view> <text class="content-right">
¥<text style="font-size: 36rpx">{{ sellTotal }}</text>
</text>
</view> </view>
</view> </view>
</u-popup> </view>
</view> </u-popup>
</template> </template>
<script> <script>
export default { export default {
props: ["merchantName", "name", "buyNum", "sellingPrice", "productDepositTotal", "chooseCouponObj", "choooseService"], props: [
watch: { 'merchantName',
choooseService: { 'name',
handler(newValue, oldValue) { 'buyNum',
if (newValue) { 'sellingPrice',
this.choooseServiceData = this.choooseService 'productDepositTotal',
'chooseCouponObj',
} 'chooseService',
}, 'sellTotal'
deep: false, ],
immediate: false data() {
} return {
}, showPop: false, //控制弹窗显示隐藏
data() { }
return { },
show: false, //控制弹窗显示隐藏
extraPrice: 0, //额外服务价格
depositTotal: 0, //额外服务总押金
choooseServiceData: [], //选中的服务
}
},
computed: {
sellTotal() { //卖价总价
let savedMoney=0
if(this.chooseCouponObj){
savedMoney = this.chooseCouponObj.savedMoney
}
if (this.choooseServiceData.length > 0) { //额外服务价格
let singleMoney = 0 //单个产品总押金,用于算出总押金
this.extraPrice = 0
this.depositTotal = 0 //总押金
for (let i = 0; i < this.choooseServiceData.length; i++) {
this.extraPrice += parseFloat((this.choooseServiceData[i].sellingPrice * this.buyNum).toFixed(2))
if (this.choooseServiceData[i].depositType == 1) { //---------------------------------------------------------------------------等于1,押金金额跟数量没关系
singleMoney = this.choooseServiceData[i].deposit
this.choooseServiceData[i].depositTotal = this.choooseServiceData[i].deposit //单个产品总押金
} else if (this.choooseServiceData[i].depositType == 2) { //----------------------------------------------------------------------等于2,押金单价乘购买数量
singleMoney = parseFloat((this.choooseServiceData[i].deposit * this.buyNum).toFixed(2))
this.choooseServiceData[i].depositTotal = parseFloat((this.choooseServiceData[i].deposit * this.buyNum).toFixed(2)) //单个产品总押金
}
this.depositTotal += singleMoney
}
} else {
this.extraPrice = 0
this.depositTotal = 0
}
return parseFloat((this.sellingPrice * this.buyNum + this.extraPrice + this.depositTotal + this.productDepositTotal - savedMoney).toFixed(2))
}
},
methods: { methods: {}
}
}
}
</script> </script>
<style scoped="scoped"> <style scoped="scoped">
.detail-title { .son-wrap {
height:120rpx; position: relative;
display: flex; height: 65vh;
align-items: center; display: flex;
justify-content: center; flex-direction: column;
font-size: 32rpx; }
border-bottom:var(--border-bottom); .detail-title {
} text-align: center;
.content-box { font-size: 32rpx;
padding: 0 30rpx; font-weight: bold;
border-bottom: 1px solid #f0f0f0; padding: 30rpx 24rpx;
height: 120rpx; border-radius: 20rpx 20rpx 0 0;
display: flex; }
justify-content: space-between; .content-box {
align-items: center; padding: 0 30rpx;
font-size:28rpx; border-bottom: 1px solid #f0f0f0;
} height: 120rpx;
.content-right{ display: flex;
text-align: right; justify-content: space-between;
flex-shrink: 0; align-items: center;
margin-left: 20rpx; font-size: 28rpx;
} }
.content-total { .content-right {
color: #f45803; text-align: right;
font-weight: bolder; flex-shrink: 0;
font-size:32rpx; margin-left: 20rpx;
} }
.content-total {
color: #f45803;
font-weight: bolder;
font-size: 32rpx;
}
</style> </style>
<template> <template>
<view class="editBox" v-show="showEdit"> <view class="editBox" v-show="showEdit">
<view @click="close()" class="return"> <view class="return">
<u-icon name="close"></u-icon> <!-- 新增的时候 -->
<view v-if="!reviseContactId">
已新增{{contactTotal.length}}位联系人
</view>
<view @click="showEdit = false" class="return-icon">
<u-icon name="close" bold></u-icon>
</view>
</view> </view>
<view class="editTop"> <view class="editTop">
</view> </view>
<view class="editBottom"> <view class="editBottom">
<view class="bottomContent"> <view class="bottomContent">
<view> <view>
<text> <text>
姓名: 姓名:
</text> </text>
<input v-model.trim="name" placeholder="请输入中文姓名" /> <input v-model.trim="name" placeholder="请输入中文姓名,必填" />
</view> </view>
<view> <view>
<text> <text>
身份证: 身份证:
</text> </text>
<input v-model.trim="credentialNumber" maxlength="18" placeholder="请输入身份证号码" /> <input v-model.trim="credentialNumber" maxlength="18" placeholder="请输入身份证号码,必填" />
</view> </view>
<view> <view>
<!--编辑--> <text>
<a class="middle-btn" @click="keepEdit()" v-if="editBtn">完成</a> 联系电话:
<!--新增--> </text>
<a class="middle-btn" @click="keepPlus()" v-else="">完成</a> <input v-model.trim="phone" maxlength="11" placeholder="用于接收行程信息" />
</view>
<view>
<a class="complete" @click="keepSave()">完成</a>
</view> </view>
</view> </view>
...@@ -37,147 +45,123 @@ ...@@ -37,147 +45,123 @@
</template> </template>
<script> <script>
export default { export default {
props: ["editContact"], props: ['editContact','contactTotal'],
data() { data() {
return { return {
showEdit: false, //控制组件显示隐藏 showEdit: false, //控制组件显示隐藏
name: "", //姓名 name: '', //姓名
credentialNumber: "", //身份证号 credentialNumber: '', //身份证号
reviseContactId: "", //被修改人id phone:'',//手机号码
editBtn: "", //控制编辑完成按钮显示隐藏 reviseContactId: '', //被修改人id
} }
}, },
watch: { watch: {
editContact: { // editContact: {
handler(newValue, oldValue) { handler(newValue, oldValue) {
if (newValue) { this.name = newValue.name||''
this.editBtn = true this.credentialNumber = newValue.credentialNumber||''
} else { this.reviseContactId = newValue.id||''
this.editBtn = false this.phone=newValue.phone||''
} },
this.name = newValue.name||'' deep: true,
this.credentialNumber = newValue.credentialNumber||'' immediate: true
this.reviseContactId = newValue.id||'' }
}, },
deep: false, methods: {
immediate: false //---保存
} keepSave() {
}, if (!this.$commonjs.nameReg().test(this.name)) {
methods: { uni.showToast({
//---关闭弹窗 title:'请输入正确的中文名字',
close() { icon:'none'
this.showEdit = false })
}, return
//---新增保存 }
keepPlus() { if (!this.$commonjs.idReg().test(this.credentialNumber)) {
if (!this.$commonjs.nameReg().test(this.name)) { uni.showToast({
uni.showToast({ title:'请输入正确身份证号',
title:'请输入正确的中文名字', icon:'none'
icon:'none' })
}) return
return }
} if (this.phone&&!this.$commonjs.phoneReg().test(this.phone)) {
if (!this.$commonjs.idReg().test(this.credentialNumber)) { uni.showToast({
uni.showToast({ title:'请输入正确电话号码',
title:'请输入正确身份证号', icon:'none'
icon:'none' })
}) return
return }
} let data = {
let data = { name: this.name, //保存姓名
name: this.name, //保存姓名 phone:this.phone, //电话号码
phone: "", //电话号码 credentialNumber: this.credentialNumber, //身份证号
credentialNumber: this.credentialNumber, //身份证号 openid: uni.getStorageSync('openid'), //用户Id
category: "", //成人或者儿童 merchantType: 1, //商户类型,1.景区,2.酒店,3.餐饮
openid: uni.getStorageSync("openid"), //用户Id id: this.reviseContactId, //被修改人id
credentialsType: "", //证件类型 category: '', //成人或者儿童
merchantType: 1, //商户类型,1.景区,2.酒店,3.餐饮 credentialsType: '', //证件类型
} }
this.$request("wechatUser/contact/saveContact", data).then((res) => { let queryUrl=''
if (res.code == "00") { if(this.reviseContactId){
uni.showToast({ queryUrl='wechatUser/contact/updateContact'
title:'保存成功', }else{
icon:'none' queryUrl='wechatUser/contact/saveContact'
}) }
this.$parent.addChoose() this.$request(queryUrl, data).then((res) => {
this.showEdit = false if (res.code == '00') {
this.name = "" //成功之后清空数据,防止下次新增的时候出现之前的数据 uni.showToast({
this.credentialNumber = "" title:'保存成功',
} else { icon:'none'
uni.showToast({ })
title:res.message, if(!this.reviseContactId){
icon:'none' //新增的时候
}) this.$parent.addChoose()
} //成功之后清空数据,防止下次新增的时候出现之前的数据
}) this.name = ''
}, this.credentialNumber = ''
//---编辑保存 this.phone=''
keepEdit() { }
if (!this.$commonjs.nameReg().test(this.name)) { if(this.reviseContactId){
uni.showToast({ //修改的时候
title:'请输入正确的中文名字', this.showEdit = false
icon:'none' }
}) } else {
return uni.showToast({
} title:res.message,
if (!this.$commonjs.idReg().test(this.credentialNumber)) { icon:'none'
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> </script>
<style scoped="scoped"> <style scoped="scoped" lang="scss">
.editBox { .editBox {
height: 100%;
background: #F5F5F5; background: #F5F5F5;
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
z-index: 10000; z-index: 1000;
overflow-y: auto;
font-size:28rpx;
} }
.return { .return {
height:100rpx; height: 100rpx;
padding: 0 24rpx;
background: #FFFFFF;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content:flex-end; background: #FFF1E8;
color: #FC771D;
justify-content: center;
font-weight: bold;
font-size: 32rpx;
position: relative;
}
.return-icon{
position: absolute;
right: 24rpx;
} }
.editTop { .editTop {
height:200rpx; height:200rpx;
...@@ -201,7 +185,7 @@ ...@@ -201,7 +185,7 @@
} }
.bottomContent view text { .bottomContent view text {
display: inline-block; display: inline-block;
width: 120rpx; width: 140rpx;
text-align-last: justify; text-align-last: justify;
margin-right: 20rpx; margin-right: 20rpx;
} }
...@@ -209,10 +193,17 @@ ...@@ -209,10 +193,17 @@
flex: 1; flex: 1;
} }
.bottomContent view:last-child { .bottomContent view:last-child {
display: flex;
justify-content: center;
align-items: center;
margin-top: 60rpx; margin-top: 60rpx;
border: none; border: none;
} }
.complete{
width:100%;
height:70rpx;
border-radius:16rpx;
color: #FFFFFF;
text-align: center;
line-height:70rpx;
background:$theme;
display: inline-block;
}
</style> </style>
<template> <template>
<u-popup :show="show" :round="10" closeable @close="show=false"> <u-popup :show="showPop" :round="20" @close="showPop=false" closeable>
<view class="time"> <view class="son-wrap">
<view class="time-title"> <view class="time-title">
时间选择 时间选择
</view> </view>
<view class="time-content" v-if="chooseTimeList&&chooseTimeList.length>0"> <view style="flex: 1;overflow-y: scroll;padding: 0 30rpx;">
<!--库存大于零并且当前时间小于班次的开始时间才显示--> <view class="time-content" v-if="chooseTimeList&&chooseTimeList.length>0">
<view <!--库存大于零并且当前时间小于班次的开始时间才显示-->
class='time-list' <view class='time-list'
v-for="(item,index) of chooseTimeList" v-for="(item,index) of chooseTimeList"
:class="{on:active==index}" :class="{on:active==index}"
@click="chooseTime(index)" @click="chooseTime(index)"
:key="index" v-if="item.last>0" :key="index" v-if="item.last>0">
> <view>
<view> {{item.startPlanTime?item.startPlanTime.substr(0,5):""}}
{{item.startPlanTime?item.startPlanTime.substr(0,5):""}} <text v-if="item.endPlanTime">-</text>
<text v-if="item.endPlanTime">-</text> {{item.endPlanTime?item.endPlanTime.substr(0,5):""}}
{{item.endPlanTime?item.endPlanTime.substr(0,5):""}} </view>
</view> <view>
<view> 剩余:{{item.last}}
剩余:{{item.last}} </view>
</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>
</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> </view>
</u-popup> </u-popup>
</template> </template>
<script> <script>
export default { export default {
props: ["chooseTimeList", "chooseTimeData", "timeActive"], props: ['chooseTimeList', 'chooseTimeData', 'timeActive'],
watch: { watch: {
timeActive: { //父组件选中的下标 timeActive: { //父组件选中的下标
handler(newValue, oldValue) { handler(newValue, oldValue) {
if (newValue >= 0) { if (newValue >= 0) {
this.active = newValue this.active = newValue
} }
}, },
deep: false, deep: false,
immediate: false immediate: false
}, },
}, },
data() { data() {
return { return {
show: false, //控制该组件显示隐藏 showPop: false, //控制该组件显示隐藏
active: 10000, //默认不选中 active: 10000, //默认不选中
times: "", //时间 times: '', //时间
timeNumber: "", //当前时间转化为数字 timeNumber: '', //当前时间转化为数字
} }
}, },
methods: { methods: {
//---时间选择
//---时间选择 chooseTime(i) {
chooseTime(i) { this.active = i
this.active = i this.times = this.chooseTimeList[i].startPlanTime
this.times = this.chooseTimeList[i].startPlanTime },
}, //---时间确认事件
//---时间确认事件 confirm(date) {
confirm(date) { this.showPop = false
this.show = false; this.$emit('timeConfig', this.times)
this.$emit("timeConfig", this.times) },
}, },
}, mounted() {
mounted() { let times = new Date().Format('yyyy-MM-dd hh:mm:ss')
let times = new Date().Format("yyyy-MM-dd hh:mm:ss") this.timeNumber = parseInt(this.$commonjs.changeTime(times))
this.timeNumber = parseInt(this.$commonjs.changeTime(times)) }
} }
}
</script> </script>
<style scoped="scoped"> <style scoped="scoped" lang="scss">
.time { .son-wrap {
padding:30rpx 20rpx 60rpx 20rpx; position: relative;
text-align: center; height:65vh;
display: flex;
flex-direction:column;
} }
.time-title{ .time-title{
font-size:32rpx; text-align: center;
font-weight: bolder; font-size: 32rpx;
font-weight: bold;
padding: 30rpx 24rpx;
border-radius: 20rpx 20rpx 0 0;
} }
.time-content { .time-content {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
} }
.time-list { .time-list {
width: 30%; width:30%;
height: 80rpx; height: 90rpx;
text-align: center;
line-height: 30rpx; line-height: 30rpx;
color: #666666; text-align: center;
background: rgb(242, 242, 242); margin-right:5%;
border-radius: 16rpx; border-radius: 15rpx;
margin-right: 5%; display: inline-block;
margin-top: 30rpx; background:#f2f2f2;
} position: relative;
padding-bottom: 8rpx;
.time-list view:first-child {
margin-top: 10rpx;
} }
.time-list view { .time-list view {
width: 100%; margin-top: 10rpx;
text-align: center;
} }
.time-content view:nth-child(3n) { .time-content view:nth-child(3n) {
margin-right: 0; margin-right: 0;
} }
.time-list.on { .time-list.on {
background: none; border: 1px solid $theme;
color: #3dbcff; background: #DAE6F6;
border: 1px solid #3dbcff;
box-sizing: border-box;
} }
.time-sure{ .time-sure{
margin-top: 30rpx; margin-top:60rpx;
text-align: center;
} }
</style> </style>
...@@ -2,18 +2,18 @@ ...@@ -2,18 +2,18 @@
<view class="orderBox"> <view class="orderBox">
<view class="head"> </view> <view class="head"> </view>
<view class="middle"> <view class="middle">
<!-- --------------------------------------------产品信息部分----------------------------------- --> <view class="middle-top">
<view class="middle1"> <!-- --------------------------------------------产品信息部分------------------------------------- -->
<view class="middle1Product"> <view class="middle-Product">
<view class="merchantName"> <view class="merchantName">
<text> <text class="title-text">
{{ productIfo.merchantName || '' }} {{ productIfo.merchantName || '' }}
</text> </text>
<text> <text>
{{ productIfo.name || '' }} {{ productIfo.name || '' }}
</text> </text>
</view> </view>
<view @click="showBuyKnow()" class="buyKnow"> <view @click="showBuyKnow()" class="buyKnow">
<view> <view>
<text v-if="productIfo.backChangeRule == 0">不可退换</text> <text v-if="productIfo.backChangeRule == 0">不可退换</text>
...@@ -23,145 +23,229 @@ ...@@ -23,145 +23,229 @@
</view> </view>
<view> <view>
购买须知 购买须知
<u-icon name="arrow-right"></u-icon> <u-icon name="arrow-right" color='#FC6703'></u-icon>
</view> </view>
</view> </view>
</view> </view>
<!--需要排队并且站点数大于1--> <!--需要排队并且站点数大于1-->
<view class="middle-place" @click="openArea()" v-if="productIfo.isFetch == 1 && productIfo.productAreaList.length > 1 && showOpenArea"> <view class="middle-place" @click="openArea()" v-if="productIfo.isFetch == 1 && productIfo.productAreaList.length > 1 && showOpenArea">
<view> 出发站点 </view> <view> 出发站点 </view>
<view> <view>
{{ areaObj.areaName || '请选择站点' }} {{ areaObj.areaName || '请选择站点' }}
</view> </view>
<view> <view>
<u-icon name="arrow-right" color="#3688FF"></u-icon> <u-icon name="arrow-right" color="#3688FF"></u-icon>
</view> </view>
</view> </view>
<!--需要排队并且为一个站点--> <!--需要排队并且为一个站点-->
<view class="middle-place" v-if="productIfo.isFetch == 1 && productIfo.productAreaList.length == 1 && showOpenArea" @click="getSortInfor()"> <!-- <view class="middle-place" v-if="productIfo.isFetch == 1 && productIfo.productAreaList.length == 1 && showOpenArea" @click="getSortInfor()">
<view> 获取排队信息 </view> <view> 获取排队信息 </view>
<view> <view>
{{ areaObj.areaName }} {{ areaObj.areaName }}
</view> </view>
<view> <view>
<u-icon name="arrow-right" color="#3688FF"></u-icon> <u-icon name="arrow-right" color="#3688FF"></u-icon>
</view> </view>
</view> </view> -->
<view class="middle1Date">
<text>游玩日期</text> <view class="middle-Date">
<scroll-view class="date-content" scroll-x="true" :scroll-left="dateScroll" v-if="dateList.length > 0"> <view class="title-text">游玩日期</view>
<view class="date-list" v-for="(item, index) of dateList" :class="{ on: active == index }" @click="dateChoose(index)" :key="index"> <view class="middle-Datelist">
<view class="date-time"> <scroll-view class="date-content" scroll-x="true" :scroll-left="dateScroll" v-if="dateList.length > 0">
<text v-if="item.week"> <view class="date-list" v-for="(item, index) of dateList" :class="{ on: active == index }" @click="dateChoose(index)" :key="index">
<view v-if="item.week">
<text v-if="item.week != '今天' && item.week != '明天' && item.week != '后天'"></text> <text v-if="item.week != '今天' && item.week != '明天' && item.week != '后天'"></text>
{{ item.week }} {{ item.week }}
</text> </view>
{{ item.startTime ? item.startTime.substr(5, 5) : '' }} <view>
</view> {{ item.startTime ? item.startTime.substr(5, 5) : '' }}
</view>
<view class="date-price"> <view class="date-price">
<text>¥</text><text>{{ item.sellingPrice }}</text> ¥<text style="font-weight: bold;">{{ item.sellingPrice }}</text>
</view>
<view v-if="active == index" class="date-icon">
<u-icon name="checkmark" color="#ffffff"></u-icon>
</view>
</view> </view>
</scroll-view>
<view v-if="active == index" class="date-icon"> <text v-else class="no-date"> 不可购买 </text>
<u-icon name="checkmark" color="#ffffff"></u-icon> <view class="dateMore" @click="showCalendar()">
<view class="date-more-content">
<view>更多</view>
<view>日期</view>
</view> </view>
<u-icon name="arrow-right"></u-icon>
</view> </view>
</scroll-view>
<text v-else class="no-date"> 不可购买 </text>
<view class="dateMore" @click="showCalendar()">
<view class="date-more-content">
<view>更多</view>
<view>日期</view>
</view>
<u-icon name="arrow-right" color="#3688FF"></u-icon>
</view> </view>
</view> </view>
<view class="middle1Time" v-if="productIfo.productType == 3"> <view class="middle-time" v-if="productIfo.productType == 3">
<text> 游玩时间 </text> <view class="title-text"> 场次 </view>
<scroll-view class="time-content" scroll-x="true" :scroll-left="timeScroll" v-if="timeList > 0"> <view class="middle-timelist">
<view class="time-list" v-for="(item, index) of timeList" @click="chooseTime(index)" :class="{ on: timeActive == index }" :key="index"> <scroll-view class="time-content" scroll-x="true" :scroll-left="timeScroll" v-if="timeList.length> 0">
<view> <view class="time-list" v-for="(item, index) of timeList" @click="chooseTime(index)" :class="{ on: timeActive == index }" :key="index">
{{ item.startPlanTime ? item.startPlanTime.substr(0, 5) : '' }} <view>
<text v-if="item.endPlanTime">-</text> {{ item.startPlanTime ? item.startPlanTime.substr(0, 5) : '' }}
{{ item.endPlanTime ? item.endPlanTime.substr(0, 5) : '' }} <text v-if="item.endPlanTime">-</text>
{{ item.endPlanTime ? item.endPlanTime.substr(0, 5) : '' }}
</view>
<view> 剩余:{{ item.last }} </view>
<view v-if="timeActive == index" class="date-icon">
<u-icon name="checkmark" color="#ffffff"></u-icon>
</view>
</view> </view>
<view> 剩余:{{ item.last }} </view> </scroll-view>
</view> <text class="no-time" v-if="startDate && endDate && timeList.length == 0"> 该日票种已售罄,请选择其他日期 </text>
</scroll-view> <text class="no-time" v-if="!startDate || !endDate"> 请先选游玩日期 </text>
<text class="no-time" v-if="startDate && endDate && timeList.length == 0"> 该日票种已售罄,请选择其他日期 </text> <view class="timeMore" @click="showTime()">
<text class="no-time" v-if="!startDate || !endDate"> 请先选游玩日期 </text> <view class="time-more-content">
<view class="timeMore" @click="showTime()"> <view>更多</view>
<view class="time-more-content"> <view>场次</view>
<view>更多</view> </view>
<view>时间</view> <u-icon name="arrow-right"></u-icon>
</view> </view>
<u-icon name="arrow-right" color="#3688FF"></u-icon>
</view> </view>
</view> </view>
<view class="middle-divider">
<view class="middle1Number">
<view style="font-size: 32rpx; font-weight: bolder"> 购买数量 </view> </view>
<view class="middle-Number">
<view class="title-text"> 购买数量 </view>
<view> <view>
<u-number-box <u-number-box v-model="buyNum">
button-size="36" <view slot="minus" class="number-minus" >
inputWidth="40" <u-icon name="minus" color="#FFFFFF" size="32"></u-icon>
</view>
<text slot="input" class="number-input">{{buyNum}}</text>
<view slot="plus" class="number-plus">
<u-icon name="plus" color="#FFFFFF" size="32"></u-icon>
</view>
</u-number-box>
<!-- <u-number-box
@change='buyNumChange'
v-model="buyNum"
bg-color='#3688FF'
color='#ffffff'
iconStyle='color:#ffffff;font-size:32rpx;'
buttonSize='60'
input-width="100"
:min="1" :min="1"
:max="maxBookNum" :max="maxBookNum">
integer </u-number-box> -->
v-model="buyNum"
@change="buyNumChange"
color="#fff"
bgColor="#3688FF"
iconStyle="color: #fff"
></u-number-box>
</view> </view>
</view> </view>
</view> <view class=" middle-coupon" v-if="couponData.length>0" @click="showCoupon()">
<!------------------------------------------------------额外服务部分----------------------------------------------------> <view>
<!-- <view class="extraService" v-if="loadProductResVoList.length>0&&showErmai">
<view v-for="(item,index) of loadProductResVoList" :key="item.id"> </view>
<text> <!-- 有可用优惠券,并且未选中 -->
<text style="font-size: 28rpx;font-weight: bold;"> <template v-if="couponData.masterSlaveCouponList&&couponData.masterSlaveCouponList.length>0&&!chooseCouponObj">
{{item.name}} <view>
</text> {{couponData.masterSlaveCouponList[0].couponName}}
</view>
<text style="font-size:20rpx;color: #666666;" v-if="item.deposit">(押金:¥{{item.deposit}})</text> <view >
</text> 未使用优惠券
</view>
<label> </template>
¥{{item.sellingPrice}} <!-- 有可用优惠券 -->
<input type="checkbox" style="margin-left: 20rpx;" :value="item" v-model="choooseService" @change="extraChange(item,index)" /> <template v-if="chooseCouponObj&&savedMoney>0">
</label> <view>
{{chooseCouponObj.couponName}}
</view>
<view style="font-size: 32rpx;">
<text style="font-size: 24rpx;position: relative;top: 6rpx;">¥</text>
{{parseFloat(savedMoney.toFixed(2))}}
</view>
</template>
<!-- 可用优惠券条件-->
<template v-if="ableConpon">
<view>
{{ableConpon.couponName}}
</view>
<view>
{{ableConpon.couponRule}}
</view>
</template>
<u-icon name="arrow-right" color="#3688FF"></u-icon>
</view> </view>
</view> -->
<!-- ----------------------------------------------游客信息----------------------------------------- --> <!-- --------------------------------------------额外服务部分-------------------------------------------- -->
<view class="middle2" v-if="productIfo.tripTemplateFlag != 2"> <view class="extraService" v-if="serviceList.length>0&&showErmai">
<view class="middle2Visitor"> <checkbox-group @change="extraChange">
<view v-for="(item,index) of serviceList" :key="item.id">
<label>
<view>
<text>{{item.name}}</text>
<text style="font-size:20rpx;color: #666666;" v-if="item.deposit">(押金:¥{{item.deposit}})</text>
</view>
<view>
<text style="font-size: 24rpx;">¥</text>
<text style="font-size: 32rpx;font-weight: bold;">{{item.sellingPrice}}</text>
<checkbox class="blue" :value="JSON.stringify(item)" style="transform: scale(0.7);position: relative;left: 10rpx;" :checked="item.ifChoose" />
</view>
</label>
</view>
</checkbox-group>
</view>
<!-- -----------------------------------支付之后有额外服务,没有选额外服务的弹窗------------------------- -->
<u-popup :show="showExtraPop" :round="20" @close="showExtraPop = false" closeable>
<view class="extra-wrap">
<view style="font-weight: bold;font-size: 32rpx;">
云智能导览耳机
</view>
<view style="color: #666666;margin:40rpx 0;">
深度了解索道典故由来,周边攻略推荐
</view>
<view>
<text @click="extraNo()" class="btn" style="background: #fff;color: #333;border: 1px solid #c0c0c0;">
不需要
</text>
<text @click="extraYes()" class="btn" style="margin-left: 40rpx;">
需要
</text>
</view>
</view>
</u-popup>
</view>
<view class="middle-divider">
</view>
<!-- ---------------------------------------------游客信息-------------------------------------------- -->
<view class="middle-bottom" v-if="productIfo.tripTemplateFlag != 2">
<view class="middle-visitor">
<view class="visitorTitle"> <view class="visitorTitle">
<text> 游客信息 </text> <text class="title-text"> 用户信息 </text>
<text> <text>
需填<text class="title-bold">{{ contactNum }}</text 需填<text class="title-bold">{{ contactNum }}</text>位出行人
>位出行人 <!-- <text class="title-bold" v-if="contactNum - chooseContact.length > 0">,还需{{ contactNum - chooseContact.length }}位</text> -->
<text class="title-bold" v-if="contactNum - orderTouristList.length > 0">,还需{{ contactNum - orderTouristList.length }}</text>
</text> </text>
</view> </view>
<view class="visitorPlus" v-if="contactTotal.length>0">
<view class="visitorPlus"> <!-- 这里key必须是index,如果是id会出现数据改变和样式不改变的bug -->
<view <view
class="plus-list" class="plus-list"
:class="{ on: item.ifChoose == true }" :class="{on:item.ifChoose}"
v-for="(item, index) of contactData.slice(0, 3)" v-for="(item, index) of contactTotal.slice(0, 3)"
@click="visitorChoose(index)" @click="visitorChoose(index)"
:key="item.id" :key="index"
> >
{{ item.name }} {{ item.name }}
<view v-if="item.ifChoose" class="date-icon">
<u-icon name="checkmark" color="#ffffff"></u-icon>
</view>
</view> </view>
<view @click="showContacts()" class="plus-list plus-list-last"> <view @click="showContacts()" class="plus-list plus-list-last">
...@@ -169,11 +253,15 @@ ...@@ -169,11 +253,15 @@
<u-icon name="arrow-right" color="#3688FF"></u-icon> <u-icon name="arrow-right" color="#3688FF"></u-icon>
</view> </view>
</view> </view>
<view class="visitorBtn" v-else @click="$refs.editContacts.showEdit = true">
<u-icon name="plus-circle" color="#3688FF" size="52"></u-icon>
<text style="margin-left:16rpx;">新增</text>
</view>
<view class="visitorEdit" v-show="orderTouristList.length > 0"> <view class="visitorEdit" v-show="chooseContact.length > 0">
<view class="edit-list" v-for="(item, index) of orderTouristList" :key="item.id"> <view class="edit-list" v-for="(item, index) of chooseContact" :key="item.id">
<view @click="delChooseContact(item, index)"> <view @click="delChooseContact(item, index)">
<u-icon name="close-circle" color="#3688ff" size="20"></u-icon> <u-icon name="close-circle" color="#3688ff" size="40"></u-icon>
</view> </view>
<view> <view>
...@@ -185,75 +273,27 @@ ...@@ -185,75 +273,27 @@
</view> </view>
<view @click="showEdit(item)"> <view @click="showEdit(item)">
<u-icon name="edit-pen-fill" color="#3688ff" size="24"></u-icon> <u-icon name="edit-pen-fill" color="#3688ff" size="48"></u-icon>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="middle2Phone" v-if="productIfo.tripTemplateFlag != 2"> <view class="middle-phone" v-if="productIfo.tripTemplateFlag != 2">
<view class="phoneTitle"> 联系信息 </view> <text> 联系电话: </text>
<input type="number" maxlength="11" placeholder="请输入联系电话" v-model.trim="ticketPhone" />
<view class="phoneNumber">
<text> 联系电话: </text>
<input type="number" maxlength="11" placeholder="请输入联系电话" v-model.trim="ticketPhone" />
</view>
</view> </view>
</view> </view>
<!-- --------------------------------------------------------产品押金部分-------------------------------------------------- --> <!-- ---------------------------------------------产品押金部分---------------------------------------- -->
<view class="productDeposit" v-if="productIfo.deposit"> <view class="productDeposit" v-if="productIfo.deposit">
<text>
{{ productIfo.name }}
押金
</text>
<text style="color: #ff0000"> {{ productIfo.deposit }}</text>
</view>
<!-- ----------------------------------选中了额外服务之后,不再选额外服务的弹窗 ------------------------------------------------ -->
<!-- <view class="extraPop" v-show="showExtraPop">
<view> <view>
<view> {{ productIfo.name }}
{{extraChangeData.name}} <text style="color: #FC6703;margin-left: 10rpx;">押金</text>
</view>
<view>
{{extraChangeData.details}}
</view>
<view>
<text @click="extraNo()">
不想感受
</text>
<text @click="extraYes()">
取消
</text>
</view>
</view> </view>
</view> -->
<!-- -----------------------------------支付之后有额外服务,没有选额外服务的弹窗------------------------------------- -->
<!-- <view class="extraPop" v-show="showPayExtraPop">
<view>
<view>
云智能导览耳机
</view>
<view style="text-align: center;">
深度了解索道典故由来,周边攻略推荐
</view>
<view>
<text @click="payExtraNo()">
不需要
</text>
<text @click="payExtraYes()"> <view style="color: #FC6703"> {{ productIfo.deposit }}元 </view>
需要 </view>
</text>
</view>
</view>
</view> -->
</view> </view>
<view class="bottom"> <view class="bottom">
...@@ -269,25 +309,25 @@ ...@@ -269,25 +309,25 @@
<u-icon name="arrow-down"></u-icon> <u-icon name="arrow-down"></u-icon>
</view> </view>
<view class="btn" :style="{ background: payBackground }"> <view class="bottom-btn" :style="{ background: payBackground }">
<text v-if="productIfo.status == 1">已下架</text> <text v-if="productIfo.status == 1">已下架</text>
<text v-if="parseInt(maxBookNum) <1" style="background: #c0c0c0">暂无库存</text> <text v-if="parseInt(maxBookNum) <1" style="background: #c0c0c0">暂无库存</text>
<text v-if="productIfo.status != 1 && parseInt(maxBookNum) >= 1" @click="jugeOrder()">去支付</text> <text v-if="productIfo.status != 1 && parseInt(maxBookNum) >= 1" @click="goPay()">去支付</text>
<text class="btn-paying" v-show="showPaying">支付中...</text>
<text class="mask" v-show="showPaying"></text>
</view> </view>
</view> </view>
</view> </view>
<!-- <calendar ref="calendar" @dateConfig="dateConfig" :dateList="dateList" v-if="dateList.length > 0"></calendar> --> <calendar ref="calendar" @dateConfig="dateConfig" :dateList="dateList" v-if="dateList.length > 0"></calendar>
<buyKnow ref="buyKnow" :buyKnowData="buyKnowData"></buyKnow> <buyKnow ref="buyKnow" :buyKnowData="buyKnowData"></buyKnow>
<detail <detail
ref="detail" ref="detail"
:sellTotal='sellTotal'
:merchantName="productIfo.merchantName" :merchantName="productIfo.merchantName"
:name="productIfo.name" :name="productIfo.name"
:buyNum="buyNum" :buyNum="buyNum"
:sellingPrice="sellingPrice" :sellingPrice="sellingPrice"
:choooseService="choooseService" :chooseService="chooseService"
:productDepositTotal="productDepositTotal" :productDepositTotal="productDepositTotal"
:chooseCouponObj="chooseCouponObj"
></detail> ></detail>
<chooseArea <chooseArea
v-if="showArea" v-if="showArea"
...@@ -297,18 +337,16 @@ ...@@ -297,18 +337,16 @@
:defaultAreaCode="defaultAreaCode" :defaultAreaCode="defaultAreaCode"
></chooseArea> ></chooseArea>
<times ref="times" :chooseTimeList="timeList" @timeConfig="timeConfig" :chooseTimeData="chooseTimeData" :timeActive="timeActive"></times> <times ref="times" :chooseTimeList="timeList" @timeConfig="timeConfig" :chooseTimeData="chooseTimeData" :timeActive="timeActive"></times>
<editContacts ref="editContacts" :editContact="editContact"></editContacts> <editContacts ref="editContacts" :editContact="editContact" :contactTotal="contactTotal"></editContacts>
<contactList <contactList
ref="contactList" ref="contactList"
@getEditContact="getEditContact" @getEditContact="getEditContact"
:contactData="contactData" :contactTotal="contactTotal"
@contactListConfig="contactListConfig" :contactNum="contactNum"
:orderTouristList="orderTouristList"
:buyNum="contactNum"
></contactList> ></contactList>
<orderCoupon :couponData="couponData" ref="orderCoupon" @couponChoose="couponChoose" :chooseCouponObj="chooseCouponObj"></orderCoupon>
<!--一个站点时获取排队信息弹窗--> <!--一个站点时获取排队信息弹窗-->
<u-popup :show="sortInforPop" :round="10" closeable @close="sortInforPop = false"> <!-- <u-popup :show="sortInforPop" :round="10" closeable @close="sortInforPop = false">
<view style="padding: 40rpx 60rpx"> <view style="padding: 40rpx 60rpx">
<view> <view>
景区名称: 景区名称:
...@@ -333,13 +371,14 @@ ...@@ -333,13 +371,14 @@
<text class="middle-btn">确定</text> <text class="middle-btn">确定</text>
</view> </view>
</view> </view>
</u-popup> </u-popup> -->
</view> </view>
</template> </template>
<script> <script>
import calendar from '../scenicComponents/calendar' //日历组件 import calendar from '../scenicComponents/calendar' //日历组件
import buyKnow from '@/components/buyKnow.vue' //购票须知 import buyKnow from '@/components/buyKnow.vue' //购票须知
import orderCoupon from '@/components/orderCoupon' //优惠券
import detail from '../scenicComponents/detail.vue' //明细弹窗 import detail from '../scenicComponents/detail.vue' //明细弹窗
import chooseArea from '../scenicComponents/chooseArea' //选择站点 import chooseArea from '../scenicComponents/chooseArea' //选择站点
import contactList from '../scenicComponents/contactList' //联系人弹窗 import contactList from '../scenicComponents/contactList' //联系人弹窗
...@@ -354,7 +393,8 @@ export default { ...@@ -354,7 +393,8 @@ export default {
contactList, contactList,
editContacts, editContacts,
times, times,
chooseArea chooseArea,
orderCoupon
}, },
data() { data() {
return { return {
...@@ -378,13 +418,13 @@ export default { ...@@ -378,13 +418,13 @@ export default {
merchantId: '', //商户Id merchantId: '', //商户Id
ticketPhone: '', //联系电话 ticketPhone: '', //联系电话
productIfo: '', //初始化产品基本信息 productIfo: '', //初始化产品基本信息
originalPrice: 0, //原价 originalPrice: 0, //原价单价
sellingPrice: 0, //卖价 sellingPrice: 0, //卖价单价
interfaceCode: '', //接口编号 interfaceCode: '', //接口编号
merchantCode: '', //商户code merchantCode: '', //商户code
productCode: '', //产品code productCode: '', //产品code
contactData: [], //联系人列表数据 contactTotal: [], //所有联系人列表
orderTouristList: [], //选中的游客信息列表 chooseContact: [], //选中的游客信息列表
contactNum: 1, //需要选择几位联系人数量 contactNum: 1, //需要选择几位联系人数量
cruisePlanId: '', //班次Id cruisePlanId: '', //班次Id
chooseTimeData: '', //选中的时间传给子组件 chooseTimeData: '', //选中的时间传给子组件
...@@ -395,27 +435,26 @@ export default { ...@@ -395,27 +435,26 @@ export default {
endPlayTime: '', //结束时间 endPlayTime: '', //结束时间
areaObj: '', //区域组件的传值 areaObj: '', //区域组件的传值
templateList: [], //该产品联系人必须要填写的信息 templateList: [], //该产品联系人必须要填写的信息
flag: '', //setTimeout函数 timeFlag: '', //setTimeout函数
savedMoney: 0, //优惠价格 savedMoney: 0, //优惠价格
loadProductResVoList: [], //所有额外服务 serviceList: [], //所有额外服务
choooseService: [], //选中的额外服务 chooseService: [], //选中的额外服务
extraPrice: 0, //额外服务总价格 extraPrice: 0, //额外服务总价格
showExtraPop: false, //控制额外服务弹窗显示隐藏 showExtraPop: false, //控制支付时有额外服务,没有选中额外服务的弹窗显示隐藏
showPayExtraPop: false, //控制支付时有额外服务,没有选中额外服务的弹窗显示隐藏
extraChangeData: '', //额外服务变化时,变化的那个额外服务值
orderProductList: [], //额外服务,儿童票等入参 orderProductList: [], //额外服务,儿童票等入参
extraextraDepositTotal: 0, //额外服务总押金
productDepositTotal: 0, //产品总押金 productDepositTotal: 0, //产品总押金
orderSource: '', //订单来源 1公众号平台、2公众号组合页面1、3公众号组合页面2、4胖丁伙伴app、5第三方自助机、6第三方票房窗口 orderSource: '', //订单来源 1公众号平台、2公众号组合页面1、3公众号组合页面2、4胖丁伙伴app、5第三方自助机、6第三方票房窗口
thirdOpenid: '', //第三方openid thirdOpenid: '', //第三方openid
beforeBookDays: '', //需提前预定天数 beforeBookDays: '', //需提前预定天数
afterBuyUrl: '', //支付成功后页面跳转地址
companyId: '', //公司Id companyId: '', //公司Id
docQuery: '', //元素变量 docQuery: '', //元素变量
payBackground: '', //支付按钮背景颜色 payBackground: '', //支付按钮背景颜色
showPaying: false, //是否显示支付中按钮
dateScroll: '', //日期滚动值 dateScroll: '', //日期滚动值
timeScroll: '' //时间滚动值 timeScroll: '' ,//时间滚动值
openid:uni.getStorageSync('openid') || '',//openid
couponData:[], //所有劵数据
chooseCouponObj: '', //默认选中最优价格优惠券
ableConpon: '', //没有可用优惠券时,达到一定条件可用,显示达到的条件
} }
}, },
onLoad(option) { onLoad(option) {
...@@ -432,19 +471,19 @@ export default { ...@@ -432,19 +471,19 @@ export default {
computed: { computed: {
originalTotal() { originalTotal() {
//原价总价 //原价总价
if (this.choooseService.length > 0) { if (this.chooseService.length > 0) {
//额外服务价格和押金总价格 //额外服务价格和押金总价格
let singleProduct = 0 //单个产品押金 let singleProduct = 0 //单个产品押金
this.extraPrice = 0 this.extraPrice = 0
this.extraDepositTotal = 0 //总押金 this.extraDepositTotal = 0 //总押金
for (let i = 0; i < this.choooseService.length; i++) { for (let i = 0; i < this.chooseService.length; i++) {
this.extraPrice += parseFloat((this.choooseService[i].sellingPrice * this.buyNum).toFixed(2)) this.extraPrice += parseFloat((this.chooseService[i].sellingPrice * this.buyNum).toFixed(2))
if (this.choooseService[i].depositType == 1) { if (this.chooseService[i].depositType == 1) {
//等于1,押金金额跟数量没关系 //等于1,押金金额跟数量没关系
singleProduct = this.choooseService[i].deposit singleProduct = this.chooseService[i].deposit
} else if (this.choooseService[i].depositType == 2) { } else if (this.chooseService[i].depositType == 2) {
//等于2,押金单价乘购买数量 //等于2,押金单价乘购买数量
singleProduct = parseFloat((this.choooseService[i].deposit * this.buyNum).toFixed(2)) singleProduct = parseFloat((this.chooseService[i].deposit * this.buyNum).toFixed(2))
} }
this.extraDepositTotal += singleProduct this.extraDepositTotal += singleProduct
} }
...@@ -468,7 +507,7 @@ export default { ...@@ -468,7 +507,7 @@ export default {
}, },
sellTotal() { sellTotal() {
//卖价总价 //卖价总价
if (this.choooseService.length == 0) { if (this.chooseService.length == 0) {
this.extraPrice = 0 this.extraPrice = 0
this.extraDepositTotal = 0 this.extraDepositTotal = 0
} }
...@@ -478,9 +517,6 @@ export default { ...@@ -478,9 +517,6 @@ export default {
} }
}, },
methods: { methods: {
xxx(){
console.log(123)
},
//---获取排号信息 //---获取排号信息
getSortInfor() { getSortInfor() {
let data = { let data = {
...@@ -488,7 +524,8 @@ export default { ...@@ -488,7 +524,8 @@ export default {
merchantCode: this.merchantCode //商户code merchantCode: this.merchantCode //商户code
} }
uni.showLoading({ uni.showLoading({
title: '加载中' title: '加载中',
mask:true
}) })
this.$request('distribution/distribution/findNewFetchInfoFromSceinc', data).then(res => { this.$request('distribution/distribution/findNewFetchInfoFromSceinc', data).then(res => {
if (res.code == '00') { if (res.code == '00') {
...@@ -503,68 +540,23 @@ export default { ...@@ -503,68 +540,23 @@ export default {
} }
}) })
}, },
//---排号是否上下架
sortUpDown() {
let data = {
merchantCode: this.merchantCode //商户code
}
uni.showLoading({
title: '加载中'
})
this.$request('distribution/distribution/findNewFetchInfoFromSceinc', data).then(res => {
if (res.code == '00') {
this.sortArr = res.data.data
let data = res.data
if (this.productIfo.productAreaList.length > 1) {
//有库存并且需要选择两个站点以上的票种,显示区域组件
for (let item in data.main) {
if (data.main[item].sceneSortStatus == '1') {
this.showArea = true
this.showOpenArea = true
}
}
} else if (this.productIfo.productAreaList.length == 1) {
//只有一个站点时,直接选中站点
for (let item in data.main) {
if (data.main[item].sceneSortStatus == '1') {
this.areaObj = this.productIfo.productAreaList[0]
this.showOpenArea = true
}
}
}
}
})
},
//---购买额外服务
extraYes() {
this.showExtraPop = false
this.choooseService.push(this.extraChangeData)
},
//---不购买额外服务
extraNo() {
this.showExtraPop = false
},
//---额外服务多选框变化
extraChange(item, i) {
if (!document.querySelectorAll('.extraService input')[i].checked) {
this.showExtraPop = true
this.extraChangeData = item
}
},
//---获取子组件的传值 //---获取子组件的传值
areaSure(data) { areaSure(data) {
this.areaObj = data this.areaObj = data
if (this.areaObj.areaCode == 'cjsd_project_0001') { if (this.areaObj.areaCode == 'cjsd_project_0001') {
//选择了南站不显示耳麦 //选择了南站不显示耳麦
this.showErmai = false this.showErmai = false
this.choooseService = [] this.chooseService = []
//多选框状态设置成未选中
this.serviceList.forEach(item=>{
item.ifChoose=false
})
} else { } else {
this.showErmai = true this.showErmai = true
} }
}, },
//---展示选择站点 //---展示选择站点
openArea() { openArea() {
this.areaObj = ''
this.showArea = true this.showArea = true
}, },
//---关闭选择站点 //---关闭选择站点
...@@ -573,7 +565,7 @@ export default { ...@@ -573,7 +565,7 @@ export default {
}, },
//---展示详情弹窗 //---展示详情弹窗
showDetail() { showDetail() {
this.$refs.detail.show = true this.$refs.detail.showPop = true
}, },
//---展示日历 //---展示日历
showCalendar() { showCalendar() {
...@@ -593,8 +585,9 @@ export default { ...@@ -593,8 +585,9 @@ export default {
//如果为班次票,点击时,请求班次票接口 //如果为班次票,点击时,请求班次票接口
this.cruisePlanId = '' //清空班次id this.cruisePlanId = '' //清空班次id
this.timeActive = 10000 this.timeActive = 10000
this.getTimeStock() uni.$u.throttle(this.getTimeStock, 3000)
} }
this.initCoupon()
}, },
//---日历确认事件 //---日历确认事件
dateConfig(data) { dateConfig(data) {
...@@ -602,16 +595,13 @@ export default { ...@@ -602,16 +595,13 @@ export default {
return item.startTime.substr(0, 10) == data return item.startTime.substr(0, 10) == data
}) })
this.dateChoose(index) //选中确认的日期 this.dateChoose(index) //选中确认的日期
this.docQuery this.docQuery.selectAll('.date-list').boundingClientRect(data => {
.selectAll('.date-list') this.dateScroll = (data[index].width + 4) * index
.boundingClientRect(data => { }).exec()
this.dateScroll = (data[index].width + 4) * index
})
.exec()
}, },
//---展示更多时间 //---展示更多时间
showTime() { showTime() {
this.$refs.times.show = true this.$refs.times.showPop = true
}, },
//---时间选择 //---时间选择
chooseTime(i) { chooseTime(i) {
...@@ -631,12 +621,9 @@ export default { ...@@ -631,12 +621,9 @@ export default {
if (index > -1) { if (index > -1) {
//子组件点击确认之后有选择的时间 //子组件点击确认之后有选择的时间
this.chooseTime(index) //选中确认的日期 this.chooseTime(index) //选中确认的日期
this.docQuery this.docQuery.selectAll('.time-list').boundingClientRect(data => {
.selectAll('.time-list') this.timeScroll = (data[index].width + 4) * index
.boundingClientRect(data => { }).exec()
this.timeScroll = (data[index].width + 4) * index
})
.exec()
} }
}, },
//---获取点击的编辑联系人信息,传给编辑联系人组件 //---获取点击的编辑联系人信息,传给编辑联系人组件
...@@ -646,52 +633,23 @@ export default { ...@@ -646,52 +633,23 @@ export default {
//---删除选中的联系人 //---删除选中的联系人
delChooseContact(item, index) { delChooseContact(item, index) {
//所有联系人中找到删除联系人下标,改成未选中状态 //所有联系人中找到删除联系人下标,改成未选中状态
let sub = this.contactData.findIndex(item2 => item2.id == item.id) let sub = this.contactTotal.findIndex(item2 => item2.id == item.id)
this.contactData[sub].ifChoose = false this.contactTotal[sub].ifChoose = false
this.orderTouristList.splice(index, 1) //删除数组 this.chooseContact.splice(index, 1) //删除数组
}, },
//---展示编辑联系人 //---展示编辑联系人
showEdit(obj) { showEdit(obj) {
this.$refs.editContacts.showEdit = true this.$refs.editContacts.showEdit = true
this.editContact = obj this.editContact = obj
}, },
//---联系人列表选中确定之后传值事件
contactListConfig(data) {
//把选中的联系人放在前面
this.contactData.forEach((item, index) => {
data.forEach(item2 => {
if (item.id == item2.id) {
delete this.contactData[index]
}
})
})
this.contactData = this.contactData.filter(function (val) {
return val
})
this.contactData = data.concat(this.contactData)
//获取选中的联系人
this.orderTouristList = data
//清空之前的选中状态
this.contactData.forEach(item => {
item.ifChoose = false
})
//选中的联系人,设为选中状态
this.contactData.forEach(item => {
this.orderTouristList.forEach(item2 => {
if (item.id == item2.id) {
item.ifChoose = true
}
})
})
},
//---展示新增联系人,并获取联系人列表 //---展示新增联系人,并获取联系人列表
showContacts() { showContacts() {
this.$refs.contactList.contactsShow = true this.$refs.contactList.showPop = true
}, },
//---游客选择 //---游客选择
visitorChoose(i) { visitorChoose(i) {
let chooseList = this.orderTouristList let chooseList = this.chooseContact
let data = this.contactData let data = this.contactTotal
data[i].ifChoose = !data[i].ifChoose data[i].ifChoose = !data[i].ifChoose
if (data[i].ifChoose) { if (data[i].ifChoose) {
if (chooseList.length == this.contactNum) { if (chooseList.length == this.contactNum) {
...@@ -718,20 +676,35 @@ export default { ...@@ -718,20 +676,35 @@ export default {
} }
if (this.productIfo.tripTemplateFlag == 1) { if (this.productIfo.tripTemplateFlag == 1) {
//实名制 //实名制
this.contactNum = e.value //需要填写的联系人数量等于购买数量 this.contactNum = e.value
if (this.contactNum < this.orderTouristList.length) { if (this.chooseContact.length>this.contactNum) {
//当选中联系人数量大于购买数量时 //当选中联系人数量大于购买数量时
this.orderTouristList.splice(this.orderTouristList.length - 1, 1) //删除多余的联系人 this.chooseContact.splice(this.chooseContact.length - 1, 1) //删除多余的联系人
//联系人列表重新判断是否选中
this.contactTotal.forEach(item=>{
item.ifChoose=false
})
this.chooseContact.forEach(item=>{
this.contactTotal.forEach(item2=>{
if(item.id==item2.id){
item2.ifChoose=true
}
})
})
} }
} else if (this.productIfo.tripTemplateFlag == 0) { }
if (this.productIfo.tripTemplateFlag == 0) {
//非实名制 //非实名制
this.contactNum = 1 this.contactNum = 1
} }
clearTimeout(this.timeFlag)
this.timeFlag = setTimeout(()=>{
this.initCoupon()
}, 1500)
}, },
//---展示购票须知 //---展示购票须知
showBuyKnow() { showBuyKnow() {
console.log(111) this.$refs.buyKnow.showPop = true
this.$refs.buyKnow.buyKnowShow = true
}, },
//---页面初始化数据,获取产品基本信息 //---页面初始化数据,获取产品基本信息
initData() { initData() {
...@@ -739,13 +712,14 @@ export default { ...@@ -739,13 +712,14 @@ export default {
id: this.productId //产品id id: this.productId //产品id
} }
uni.showLoading({ uni.showLoading({
title: '加载中' title: '加载中',
mask:true
}) })
this.$request('scenic/groupGood/loadProduct', data).then(res => { this.$request('scenic/groupGood/loadProduct', data).then(res => {
if (res.code == '00') { if (res.code == '00') {
this.productIfo = res.data this.productIfo = res.data
this.defaultAreaCode = this.productIfo.defaultAreaCode || '' this.defaultAreaCode = this.productIfo.defaultAreaCode || ''
//找到站点默认站点数据 //通过默认站点找到站点数据
if (this.defaultAreaCode) { if (this.defaultAreaCode) {
this.productIfo.productAreaList.forEach(item => { this.productIfo.productAreaList.forEach(item => {
if (item.areaCode == this.defaultAreaCode) { if (item.areaCode == this.defaultAreaCode) {
...@@ -760,9 +734,8 @@ export default { ...@@ -760,9 +734,8 @@ export default {
this.merchantId = res.data.merchantId //重新赋值商户id this.merchantId = res.data.merchantId //重新赋值商户id
this.beforeBookDays = res.data.beforeBookDays || 0 //提前预定天数 this.beforeBookDays = res.data.beforeBookDays || 0 //提前预定天数
this.buyKnowData = res.data //购买须知,传给子组件 this.buyKnowData = res.data //购买须知,传给子组件
this.loadProductResVoList = res.data.loadProductResVoList //额外服务 this.serviceList = res.data.loadProductResVoList //额外服务
this.afterBuyUrl = res.data.afterBuyUrl || '' //支付成功后页面跳转 //this.chooseService=res.data.data.loadProductResVoList//默认全部选中
//this.choooseService=res.data.data.loadProductResVoList//默认全部选中
if (this.productIfo.status == 1) { if (this.productIfo.status == 1) {
//下架状态 //下架状态
this.payBackground = '#C0C0C0' this.payBackground = '#C0C0C0'
...@@ -839,9 +812,9 @@ export default { ...@@ -839,9 +812,9 @@ export default {
if (this.dateList.length == 1 && this.beforeBookDays == 0) { if (this.dateList.length == 1 && this.beforeBookDays == 0) {
//长度为1而且只能预订当天,默认选中第一个日期 //长度为1而且只能预订当天,默认选中第一个日期
//真机模拟的时候手机端不显示今天,明天后天,延迟执行 //真机模拟的时候手机端不显示今天,明天后天,延迟执行
// setTimeout(item => { setTimeout(item => {
// this.$refs.calendar.defaultDate = this.dateList[0].startTime.substr(0, 10) this.$refs.calendar.defaultDate = this.dateList[0].startTime.substr(0, 10)
// }, 1000) }, 1000)
this.maxBookNum = Math.min(this.dateList[0].surplus, this.productIfo.maxBookNum) //剩余量 this.maxBookNum = Math.min(this.dateList[0].surplus, this.productIfo.maxBookNum) //剩余量
this.startDate = this.dateList[0].startTime //开始日期 this.startDate = this.dateList[0].startTime //开始日期
this.endDate = this.dateList[0].endTime //结束日期 this.endDate = this.dateList[0].endTime //结束日期
...@@ -852,6 +825,7 @@ export default { ...@@ -852,6 +825,7 @@ export default {
//如果为班次票,请求班次票接口 //如果为班次票,请求班次票接口
this.getTimeStock() this.getTimeStock()
} }
this.initCoupon() //获取优惠券
} }
} else { } else {
uni.showToast({ uni.showToast({
...@@ -884,6 +858,39 @@ export default { ...@@ -884,6 +858,39 @@ export default {
} }
}) })
}, },
//---排号是否上下架
sortUpDown() {
let data = {
merchantCode: this.merchantCode //商户code
}
uni.showLoading({
title: '加载中',
mask:true
})
this.$request('distribution/distribution/findNewFetchInfoFromSceinc', data).then(res => {
if (res.code == '00') {
this.sortArr = res.data.data
let data = res.data
if (this.productIfo.productAreaList.length > 1) {
//有库存并且需要选择两个站点以上的票种,显示区域组件
for (let item in data.main) {
if (data.main[item].sceneSortStatus == '1'){
this.showArea = true
this.showOpenArea = true
}
}
} else if (this.productIfo.productAreaList.length == 1) {
//只有一个站点时,直接选中站点(现目前还没有一个站点的景区)
for (let item in data.main) {
if (data.main[item].sceneSortStatus == '1') {
this.areaObj = this.productIfo.productAreaList[0]
this.showOpenArea = true
}
}
}
}
})
},
//---获取班次票 //---获取班次票
getTimeStock() { getTimeStock() {
let data = { let data = {
...@@ -894,7 +901,8 @@ export default { ...@@ -894,7 +901,8 @@ export default {
productCode: this.productIfo.code //产品code productCode: this.productIfo.code //产品code
} }
uni.showLoading({ uni.showLoading({
title: '加载中' title: '加载中',
mask:true
}) })
this.$request('distribution/distribution/getTimeStock', data).then(res => { this.$request('distribution/distribution/getTimeStock', data).then(res => {
if (res.code == '00') { if (res.code == '00') {
...@@ -917,27 +925,27 @@ export default { ...@@ -917,27 +925,27 @@ export default {
//---初始化联系人列表 //---初始化联系人列表
getContactList() { getContactList() {
let data = { let data = {
openid: uni.getStorageSync('openid') || '' openid:this.openid
} }
this.$request('wechatUser/contact/findContactList', data).then(res => { this.$request('wechatUser/contact/findContactList', data).then(res => {
if (res.code == '00') { if (res.code == '00') {
this.contactData = res.data this.contactTotal = res.data
this.contactData.forEach(item => { this.contactTotal.forEach(item => {
//用于判断是否被选中 //用于判断是否被选中
item.ifChoose = false item.ifChoose = false
}) })
//编辑成功重新调该方法时,把之前选中的游客,设为选中状态 //编辑成功重新调该方法时,把之前选中的游客,设为选中状态
this.contactData.forEach(item => { this.contactTotal.forEach(item => {
this.orderTouristList.forEach(item2 => { this.chooseContact.forEach(item2 => {
if (item.id == item2.id) { if (item.id == item2.id) {
item.ifChoose = true item.ifChoose = true
} }
}) })
}) })
//删除联系人成功重新调该方法时,之前选中的联系人,数据库可能被删除,删除该联系人 //删除联系人成功重新调该方法时,之前选中的联系人,数据库可能被删除,删除该联系人
this.orderTouristList.forEach((item, index) => { this.chooseContact.forEach((item, index) => {
if (!this.contactData.find(item2 => item.id == item2.id)) { if (!this.contactTotal.find(item2 => item.id == item2.id)) {
this.orderTouristList.splice(index, 1) this.chooseContact.splice(index, 1)
} }
}) })
} else { } else {
...@@ -951,18 +959,18 @@ export default { ...@@ -951,18 +959,18 @@ export default {
//---添加并选中联系人--用于添加联系人之后直接从联系人列表选出需要填写的几位联系人 //---添加并选中联系人--用于添加联系人之后直接从联系人列表选出需要填写的几位联系人
addChoose() { addChoose() {
let data = { let data = {
openid: uni.getStorageSync('openid') || '' openid:this.openid
} }
this.$request('wechatUser/contact/findContactList', data).then(res => { this.$request('wechatUser/contact/findContactList', data).then(res => {
if (res.code == '00') { if (res.code == '00') {
this.contactData = res.data this.contactTotal = res.data
for (let i = 0; i < this.contactNum; i++) { for (let i = 0; i < this.contactNum; i++) {
let item = this.contactData[i] || null let item = this.contactTotal[i] || null
if (item) { if (item) {
item.ifChoose = true item.ifChoose = true
} }
} }
this.orderTouristList = this.contactData.slice(0, this.contactNum) this.chooseContact = this.contactTotal.slice(0, this.contactNum)
} else { } else {
uni.showToast({ uni.showToast({
title: res.message, title: res.message,
...@@ -971,40 +979,128 @@ export default { ...@@ -971,40 +979,128 @@ export default {
} }
}) })
}, },
//---加载优惠券
initCoupon() {
let savedMoneyList = []
this.chooseCouponObj = ''
this.ableConpon = ''
this.couponData=[]
let data = {
productId: this.productId, //产品id
tickets: this.buyNum, //房间数量
singleMoney: this.sellingPrice, //单价
money: parseFloat((this.buyNum * this.sellingPrice).toFixed(2)), //订单总价,不算券,和现金红包
merchantId: this.merchantId, //商户Id
openid:this.openid
}
this.$request('wechatUser/myPage/usableCouponList', data).then((res) => {
if (res.code == '00') {
this.couponData = res.data
let masterSlaveCouponList=res.data.masterSlaveCouponList
if (masterSlaveCouponList&&masterSlaveCouponList.length>0) {
masterSlaveCouponList.forEach((item) => { //获取最优券
savedMoneyList.push(item.savedMoney)
})
let maxMoney = Math.max.apply(null, savedMoneyList)
let arr=masterSlaveCouponList.filter((item)=>{//找到最大值的数组
return item.savedMoney==maxMoney
})
if(arr.length==1){
this.chooseCouponObj=arr[0]
}else{
let index=arr.findIndex((item)=>{//如果有多个,找到是否有平台券,平台劵优先
return item.createSource==1
})
if(index>-1){
this.chooseCouponObj=arr[index]
}else{
this.chooseCouponObj=arr[0]
}
}
this.savedMoney=this.chooseCouponObj.savedMoney
} else {
if (res.data.unusableCouponList.length > 0) {
res.data.unusableCouponList.forEach((item, i) => { //没有可用优惠券,有达到条件可以用的优惠券,先显示条件,达到条件时显示可用优惠券
if (item.isProduct == 1) {
this.ableConpon = item
}
})
}
}
}
})
},
//---获取优惠价格 //---获取优惠价格
getDiscountPrice() { getDiscountPrice() {
let data = { let data = {
productId: this.productId, //产品ID productId: this.productId, //产品ID
merchantId: this.merchantId, //商家ID merchantId: this.merchantId, //商家ID
companyId: this.companyId, //公司ID companyId: this.companyId, //公司ID
openid: uni.getStorageSync('openid') || '' //openid openid: this.openid //openid
} }
this.$request('scenic/user/productRule/getProductRule', data).then(res => {}) this.$request('scenic/user/productRule/getProductRule', data).then(res => {})
},
//---子组件券选择之后触发的事件
couponChoose(data) {
if(data){
this.chooseCouponObj = data
this.savedMoney=this.chooseCouponObj.savedMoney||0
}else{
this.chooseCouponObj = ''
this.savedMoney=0
}
},
//---展示券列表
showCoupon() {
this.$refs.orderCoupon.showPop=true
},
//---额外服务多选框变化
extraChange(e) {
this.chooseService=[]
//解决数据修改之后,多选框未选中bug
this.serviceList.forEach(item=>{
item.ifChoose=false
})
let value=e.detail.value
value.forEach(item=>{
this.chooseService.push(JSON.parse(item))
})
//获取选中的多选框为选中状态
this.serviceList.forEach(item=>{
this.chooseService.forEach(item2=>{
if(item.id==item2.id){
item.ifChoose=true
}
})
})
}, },
//---不需要享受耳麦服务 //---不需要享受耳麦服务
payExtraNo() { extraNo() {
this.showPayExtraPop = false this.showExtraPop = false
this.placeOrder() this.placeOrder()
}, },
//---需要享受耳麦服务 //---需要享受耳麦服务
payExtraYes() { extraYes() {
this.showPayExtraPop = false this.showExtraPop = false
this.choooseService = this.loadProductResVoList this.serviceList.forEach(item=>{
item.ifChoose=true
})
this.chooseService = this.serviceList
this.placeOrder() this.placeOrder()
}, },
//---点击去支付判断是否直接下单 //---点击去支付
jugeOrder() { goPay() {
if (this.loadProductResVoList.length == 0) { if (this.serviceList.length == 0) {
//没有额外服务,直接支付 //没有额外服务,直接支付
this.placeOrder() this.placeOrder()
} }
if (this.loadProductResVoList.length > 0) { if (this.serviceList.length > 0) {
//有额外服务,并且选择了额外服务的,直接支付 //有额外服务,并且选择了额外服务的,直接支付
if (this.choooseService.length > 0) { if (this.chooseService.length > 0) {
this.placeOrder() this.placeOrder()
} }
} }
if (this.loadProductResVoList.length > 0) { if (this.serviceList.length > 0) {
//有额外服务,没有选中额外服务的,弹出提示框 //有额外服务,没有选中额外服务的,弹出提示框
if (this.productIfo.tripTemplateFlag != 2) { if (this.productIfo.tripTemplateFlag != 2) {
if (!this.$commonjs.phoneReg().test(this.ticketPhone)) { if (!this.$commonjs.phoneReg().test(this.ticketPhone)) {
...@@ -1018,7 +1114,7 @@ export default { ...@@ -1018,7 +1114,7 @@ export default {
} }
if (this.productIfo.tripTemplateFlag == 1) { if (this.productIfo.tripTemplateFlag == 1) {
//实名制 //实名制
if (this.orderTouristList.length != this.buyNum) { if (this.chooseContact.length != this.buyNum) {
uni.showToast({ uni.showToast({
title: '需要添加' + this.buyNum + '位出行人', title: '需要添加' + this.buyNum + '位出行人',
icon: 'none' icon: 'none'
...@@ -1027,7 +1123,7 @@ export default { ...@@ -1027,7 +1123,7 @@ export default {
} }
} else if (this.productIfo.tripTemplateFlag == 0) { } else if (this.productIfo.tripTemplateFlag == 0) {
//非实名制 //非实名制
if (this.orderTouristList.length < 1) { if (this.chooseContact.length < 1) {
uni.showToast({ uni.showToast({
title: '需要添加一位出行人', title: '需要添加一位出行人',
icon: 'none' icon: 'none'
...@@ -1055,11 +1151,11 @@ export default { ...@@ -1055,11 +1151,11 @@ export default {
return return
} }
} }
if (this.choooseService.length == 0 && this.showErmai) { if (this.chooseService.length == 0 && this.showErmai) {
//没有购买额外服务,并且选择的北站,跳出弹窗 //没有购买额外服务,并且选择的北站,跳出弹窗
this.showPayExtraPop = true this.showExtraPop = true
} }
if (this.choooseService.length == 0 && !this.showErmai) { if (this.chooseService.length == 0 && !this.showErmai) {
//没有购买额外服务,并且选择的南站,直接购买 //没有购买额外服务,并且选择的南站,直接购买
this.placeOrder() this.placeOrder()
} }
...@@ -1095,7 +1191,7 @@ export default { ...@@ -1095,7 +1191,7 @@ export default {
} }
if (this.productIfo.tripTemplateFlag == 1) { if (this.productIfo.tripTemplateFlag == 1) {
//实名制 //实名制
if (this.orderTouristList.length != this.buyNum) { if (this.chooseContact.length != this.buyNum) {
uni.showToast({ uni.showToast({
title: '需要添加' + this.buyNum + '位出行人', title: '需要添加' + this.buyNum + '位出行人',
icon: 'none' icon: 'none'
...@@ -1104,7 +1200,7 @@ export default { ...@@ -1104,7 +1200,7 @@ export default {
} }
} else if (this.productIfo.tripTemplateFlag == 0) { } else if (this.productIfo.tripTemplateFlag == 0) {
//非实名制 //非实名制
if (this.orderTouristList.length < 1) { if (this.chooseContact.length < 1) {
uni.showToast({ uni.showToast({
title: '需要添加一位出行人', title: '需要添加一位出行人',
icon: 'none' icon: 'none'
...@@ -1132,102 +1228,116 @@ export default { ...@@ -1132,102 +1228,116 @@ export default {
return return
} }
} }
this.showPaying = true this.preOrder()
setTimeout(() => {
this.showPaying = false
}, 6000)
// this.preOrder()
}, },
//---预下单 //---预下单
preOrder() { preOrder() {
//时间戳转化
let bookStartTime = ''
if (this.$commonjs.today() == this.startDate.substr(0, 10)) {
//如果是当天就取当前时间+10秒
bookStartTime = new Date().getTime() + 10 * 1000
} else {
//不是当天就取开始时间
//手机兼容
let startDate = this.startDate.replace(/-/g, '/')
bookStartTime = new Date(startDate).getTime()
}
//手机兼容
let endDate = this.endDate.replace(/-/g, '/')
let bookEndTime = new Date(endDate).getTime()
//参数游客信息组装 //参数游客信息组装
let reservationInfoList = [] let orderTouristList = this.contactTotal.map((item) => {
this.orderTouristList.forEach((item, index) => { return {
reservationInfoList.push({
category: 0, category: 0,
name: item.name, name: item.name,
identificationNumber: item.credentialNumber credentialNumber: item.credentialNumber
}) }
}) })
//商品库 spu & 非商品库 sku let couponList = []
tt.createOrder({ if (this.chooseCouponObj) {
skuList: [ if(this.chooseCouponObj.slaveList.length>0){//有从券取值从券,没有从券取值主劵
{ couponList=[//券列表
skuId: this.productIfo.distributionProductId, // sku 商品Id 必传 {
skuType: 1, // sku 商品类型 必传 1-商品库商品 2-非商品库商品 couponId:this.chooseCouponObj.slaveCouponId,//券id
quantity: this.buyNum, // 数量 必传 isMerchant:this.chooseCouponObj.slaveCreateSource,//是否是商户的券
price: parseFloat((this.sellingPrice * 100).toFixed(2)), // 价格 非商品库 sku 商品必传 myCouponId:this.chooseCouponObj.slaveId,//领取人编号
goodsInfo: { couponType:this.chooseCouponObj.couponType,//券类型
goodsName: this.productIfo.name, // 商品名称 couponPrice:this.chooseCouponObj.savedMoney,//券价格
goodsPhoto: 'http://picture.pangdly.com/company/2022-02/2022-02-10/zip/z001644484223062b28c62cc60b0c65e.jpg', // 商品图片链接
goodsId: this.productIfo.distributionProductId, // 商品ID
goodsType: 1, //1-商品库商品2-非商品库商品
GoodsBookInfo: {
bookType: 1 //预约类型:1. 不需要预约 2. 在线预约
}
} }
// extraInfo: { ]
// ticketName: '成人票', // 票种,非商品库门票类 sku 必传 }else{
// date: '2023-05-16', // 日期,非商品库门票类 sku 必传 couponList=[
// },
}
],
bookInfo: {
itemBookInfoList: [
{ {
poiId: this.productIfo.poiId, // 预约门店的 poiId,必填 couponId:this.chooseCouponObj.couponId,//券id
shopName: this.productIfo.merchantName, // 预约店铺名称,必填 isMerchant:this.chooseCouponObj.createSource,//是否是商户的券
outShopId: this.productIfo.merchantId, // 预约门店的外部店铺id,必填 myCouponId:this.chooseCouponObj.id,//领取人编号
goodsId: this.productIfo.distributionProductId, // 商品id,必填 couponType:this.chooseCouponObj.couponType,//券类型
bookStartTime, // 预定开始时间(ms),13位毫秒时间戳,必填 couponPrice:this.chooseCouponObj.savedMoney,//券价格
bookEndTime, //预定结束时间(ms),13位毫秒时间戳,必填
reservationInfoList // 留资信息 非必填
} }
] ]
}, }
payment: { }
totalAmount: parseFloat((this.buyNum * this.sellingPrice * 100).toFixed(2)) // 订单总价 必填 //额外服务不为空,联票购买不为空,带有儿童票,组合购买不为空,单品购买为空
}, if (this.chooseService.length > 0) {
contactInfo: { this.orderProductList = this.chooseService.map((item) => {
//联系人 return {
phoneNumber: this.ticketPhone // 手机号 非必传 distributionPrice: item.sellingPrice, //临时用
}, productId: item.id, //产品Id
callbackData: { buyNum: this.buyNum, //购买数量
productAreaCode: this.areaObj.areaCode || this.defaultAreaCode //站点信息 subOrderType: 0, //产品类型,网络
}, unitPrice: item.sellingPrice, //产品单价
success: res => { merchantId: item.merchantId, //商户id
const { orderId, outOrderNo } = res orderTouristList, //游客信息
uni.navigateTo({ playDate: this.startDate.substr(0, 10), //开始日期
url: '/pages/salePay/paySuccess/paySuccess?orderId=' + outOrderNo endPlayDate: this.endDate.substr(0, 10), //结束日期
}) isMaster: 1, //是否主产品 1 否, 0 是
}, startPlayTime: this.startPlayTime, //开始时间
fail: res => { endPlayTime: this.endPlayTime, //结束时间
const { orderId, outOrderNo, errNo, errMsg, errLogId } = res
if (errLogId) {
console.log('预下单失败', errNo, errMsg, errLogId)
} }
if (errMsg || errNo) { })
console.log('支付失败', errNo, errMsg, orderId, outOrderNo) }else{
this.orderProductList=[]
}
let data = {
companyId: this.companyId, //公司Id
buyMethod: 1, // 单品购买,2套票、联票购买,3组合购买
userId: this.openid,//用户id
ticketPhone: this.ticketPhone, //联系电话
cash: 0, //现金红包
orderMoney: this.sellTotal, //订单总价 = 订单原价 - 优惠券价格 - 现金抵扣价格
orderType: 1, //订单类型,景区
orderSource:this.orderSource||1, //订单来源 1公众号平台、2公众号组合页面1、3公众号组合页面2、4胖丁伙伴app、5第三方自助机、6第三方票房窗口
orderProductList: this.orderProductList, //额外服务不为空,联票购买不为空,带有儿童票,组合购买不为空,单品购买为空
orderProductVo: //产品信息列表
{
bookTime:this.productIfo.bookTime,//最晚预定时间
earlyBookTime:this.productIfo.earlyBookTime,//最早预定时间
extendContent:'{"openid":'+'"'+this.openid+'"'+','+'"zr":'+'"'+this.thirdOpenid+'"'+'}',
productId: this.productId, //产品Id
buyNum: this.buyNum, //购买数量
subOrderType: 0, //产品类型,网络
cruisePlanId: this.cruisePlanId, //班次id
unitPrice: this.sellingPrice, //产品单价
distributionPrice: this.sellingPrice, //临时用
merchantId: this.merchantId, //商户id
orderTouristList, //游客信息
playDate: this.startDate.substr(0, 10), //开始日期
endPlayDate: this.endDate.substr(0, 10), //结束日期
isMaster: 0, //是否主产品 1 否, 0 是
startPlayTime: this.startPlayTime, //开始时间
endPlayTime: this.endPlayTime, //结束时间
productAreaCode:this.areaObj.areaCode, //选择的站点编码
couponList, //券列表
} }
}
uni.showLoading({
title:'加载中',
mask:true
})
this.$request('orderc/order/createOrder', data).then((res) => {
if (res.code == '00') {
if (res.data.id) {
uni.navigateTo({
url: '/pages/payment/orderPayment/orderPayment?orderId='+res.data.id
})
} else {
uni.showToast({
title: '下单失败',
icon: 'none'
})
}
} else {
uni.showToast({ uni.showToast({
title: errMsg, title: res.message,
icon: 'none', icon: 'none'
duration: 3000
}) })
} }
}) })
...@@ -1241,49 +1351,30 @@ export default { ...@@ -1241,49 +1351,30 @@ export default {
height: 160rpx; height: 160rpx;
background: linear-gradient(to bottom, #2984ef, #d8eaf6); background: linear-gradient(to bottom, #2984ef, #d8eaf6);
} }
.orderBox { .orderBox {
min-height: 100%; min-height: 100%;
background: #f5f5f5; background: #f5f5f5;
} }
.middle { .middle {
position: relative; position: relative;
top: -100rpx; top: -100rpx;
padding: 0 20rpx; padding: 30rpx 20rpx;
padding-bottom: 20rpx;
}
/*中间第一部分*/
.middle1 {
padding: 32rpx 20rpx 0 20rpx;
background: #ffffff; background: #ffffff;
border-radius: 10rpx;
} }
.title-text{
.middle1 > view:not(:last-child) { font-size: 32rpx;
border-bottom: 1px solid #e5e5e5; font-weight: bold;
}
.middle1Product {
padding-bottom: 20rpx;
} }
/*中间上面部分*/
.merchantName { .merchantName {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.merchantName text:first-child {
font-size: 36rpx;
font-weight: bolder;
}
.merchantName text:nth-child(2) { .merchantName text:nth-child(2) {
color: #666666; color: #666666;
margin-left: 20rpx; margin-left: 20rpx;
} }
.buyKnow { .buyKnow {
margin-top: 20rpx; margin-top: 20rpx;
background: #fef0e6; background: #fef0e6;
...@@ -1294,97 +1385,69 @@ export default { ...@@ -1294,97 +1385,69 @@ export default {
padding-left: 10rpx; padding-left: 10rpx;
align-items: center; align-items: center;
border-radius: 5rpx; border-radius: 5rpx;
color:$red;
} }
.buyKnow view:first-child {
color: #f9690e;
}
.buyKnow view:nth-child(2) { .buyKnow view:nth-child(2) {
color: #6d4d00;
display: flex; display: flex;
} }
.middle-place { .middle-place {
height: 100rpx; height: 100rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
} }
.middle-place view:nth-child(2) { .middle-place view:nth-child(2) {
flex: 1; flex: 1;
margin-left: 20rpx; margin-left: 20rpx;
color: #f9690e; color: $theme;
font-size: 28rpx; font-size: 28rpx;
font-weight: bolder; font-weight: bolder;
} }
.middle-Date{
.middle1Date { margin-top: 40rpx;
}
.middle-Datelist {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 30rpx 0; margin-top: 30rpx;
}
.middle1Date > text:first-child {
flex-shrink: 0;
} }
.date-content { .date-content {
flex: 1; flex: 1;
margin-left: 20rpx;
overflow-x: scroll; overflow-x: scroll;
white-space: nowrap; white-space: nowrap;
height: 90rpx;
} }
.date-content::-webkit-scrollbar { .date-content::-webkit-scrollbar {
display: none; display: none;
} }
.date-list { .date-list {
width: 130rpx; width: 140rpx;
height: 90rpx;
text-align: center; text-align: center;
border: 1px solid #cccccc; margin-right:12rpx;
margin-right: 8rpx;
border-radius: 10rpx; border-radius: 10rpx;
position: relative; position: relative;
display: inline-block; display: inline-block;
background: #f2f2f2;
padding-bottom: 8rpx;
} }
.date-list.on { .date-list.on {
border: 1px solid var(--main-color); border: 1px solid $theme;
} background: #DAE6F6;
.no-date {
color: #ff0000;
flex: 1;
margin-left: 30rpx;
font-weight: bolder;
} }
.date-time { .date-list>view{
font-size: 24rpx; margin-top: 6rpx;
margin-top: 8rpx;
} }
.date-price { .date-price {
margin-top: 8rpx; font-size: 32rpx;
color: #f9690e; color: $red;
} }
.no-date {
.date-price text { color: $red;
flex: 1;
margin-left: 30rpx;
font-weight: bolder; font-weight: bolder;
font-size: 30rpx;
} }
.date-price text:first-child {
font-weight: 400;
font-size: 24rpx;
}
.date-icon { .date-icon {
position: absolute; position: absolute;
right: -1px; right: -1px;
...@@ -1392,141 +1455,162 @@ export default { ...@@ -1392,141 +1455,162 @@ export default {
display: inline-block; display: inline-block;
width: 30rpx; width: 30rpx;
height: 28rpx; height: 28rpx;
background: var(--main-color); background:$theme;
border-radius: 10rpx 0; border-radius: 10rpx 0;
} }
.dateMore { .dateMore {
flex-shrink: 0; flex-shrink: 0;
width: 100rpx; padding: 20rpx 0;
height: 90rpx; width: 120rpx;
border: 1px solid var(--main-color);
border-radius: 10rpx;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.date-more-content { .date-more-content {
margin: 0 4rpx; margin-right:8rpx;
color: var(--main-color);
} }
.middle-time{
.middle1Time { margin-top: 40rpx;
}
.middle-timelist {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 30rpx 0; margin-top: 30rpx;
}
.middle1Time > text:first-child {
flex-shrink: 0;
} }
.time-content { .time-content {
flex: 1; flex: 1;
margin-left: 20rpx;
overflow-x: scroll; overflow-x: scroll;
white-space: nowrap; white-space: nowrap;
height: 90rpx; height: 90rpx;
} }
.time-content::-webkit-scrollbar { .time-content::-webkit-scrollbar {
display: none; display: none;
} }
.time-list { .time-list {
width: 180rpx; width: 200rpx;
height: 90rpx; height: 90rpx;
line-height: 30rpx; line-height: 30rpx;
text-align: center; text-align: center;
margin-right: 8rpx; margin-right: 8rpx;
border-radius: 15rpx; border-radius: 15rpx;
display: inline-block; display: inline-block;
background: rgb(242, 242, 242); background:#f2f2f2;
position: relative;
padding-bottom: 8rpx;
} }
.time-list view { .time-list view {
margin-top: 10rpx; margin-top: 10rpx;
} }
.time-list.on { .time-list.on {
background: none; border: 1px solid $theme;
color: var(--main-color); background: #DAE6F6;
border: 1px solid var(--main-color);
box-sizing: border-box;
} }
.timeMore { .timeMore {
flex-shrink: 0; flex-shrink: 0;
width: 100rpx; width: 120rpx;
height: 90rpx;
border: 1px solid var(--main-color);
border-radius: 10rpx;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.time-more-content { .time-more-content {
margin: 0 4rpx; margin-right:8rpx;
color: var(--main-color);
} }
.no-time { .no-time {
color: #ff0000; color:$red;
flex: 1; flex: 1;
margin-left: 30rpx;
font-weight: bolder; font-weight: bolder;
} }
.middle-divider{
.middle1Number { height: 2rpx;
background:$divider;
margin: 40rpx 0;
}
.middle-Number {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding: 36rpx 0;
align-items: center; align-items: center;
} }
.number-minus {
/*中间第二部分*/ width: 52rpx;
.middle2 { height: 52rpx;
padding: 40rpx 20rpx; background:#ccc;
background: #ffffff; border-radius: 50%;
border-radius: 10rpx; display: flex;
margin-top: 20rpx; justify-content: center;
align-items: center;
} }
.number-input {
.middle2Visitor { padding:0 20rpx;
padding-bottom: 40rpx; width: 100rpx;
border-bottom: 1px solid #e5e5e5; text-align: center;
font-size: 40rpx;
} }
.number-plus{
.visitorTitle { width: 52rpx;
position: relative; height: 52rpx;
background:$theme;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
} }
.middle-coupon{
.visitorTitle > text:first-child { display: flex;
font-size: 32rpx; justify-content: space-between;
font-weight: bolder; align-items: center;
padding:30rpx 0;
}
.middle-coupon view:first-child{
width: 36rpx;
height: 36rpx;
background: $theme;
color: #FFFFFF;
text-align: center;
line-height:32rpx;
border-radius:4rpx;
}
.middle-coupon view:nth-child(2){
flex: 1;
margin-left: 10rpx;
}
.middle-coupon view:nth-child(3){
display: flex;
color: $theme;
font-weight: bold;
} }
/*中间下面部分*/
.middle-visitor {
padding-bottom: 40rpx;
border-bottom: 1px solid $divider;
}
.visitorTitle > text:nth-child(2) { .visitorTitle > text:nth-child(2) {
font-size: 24rpx; font-size: 24rpx;
color: #666666; color: #666666;
margin-left: 10rpx; margin-left: 10rpx;
} }
.title-bold { .title-bold {
color: #f9690e; color: #f9690e;
font-weight: bolder; font-weight: bolder;
font-size: 28rpx; font-size: 28rpx;
} }
.visitorBtn{
display: flex;
align-items: center;
justify-content: center;
height: 88rpx;
background:#ECF3FE;
margin-top: 40rpx;
color: $theme;
font-size: 32rpx;
border-radius:20rpx;
}
.visitorPlus { .visitorPlus {
margin-top: 30rpx; margin-top: 20rpx;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
} }
.plus-list { .plus-list {
height: 70rpx; height: 70rpx;
display: flex; display: flex;
...@@ -1536,44 +1620,35 @@ export default { ...@@ -1536,44 +1620,35 @@ export default {
padding: 5rpx 0; padding: 5rpx 0;
width: 145rpx; width: 145rpx;
text-align: center; text-align: center;
color: #999999; background: #f2f2f2;
border: 1px solid #999999;
margin-right: 15rpx;
border-radius: 5rpx; border-radius: 5rpx;
position: relative; position: relative;
box-sizing: border-box; margin: 20rpx 15rpx 0 0;
margin-top: 20rpx;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.plus-list-last { .plus-list-last {
color: var(--main-color); color: $theme;
background: #efefef; background: #efefef;
width: 160rpx; width: 170rpx;
border: none; border: none;
} }
.plus-list.on { .plus-list.on {
border: 1px solid var(--main-color); border: 1px solid $theme;
color: var(--main-color); background: #DAE6F6;
} }
.visitorEdit { .visitorEdit {
margin-top: 40rpx; margin-top: 40rpx;
} }
.visitorEdit > view:not(first-child) { .visitorEdit > view:not(first-child) {
margin-top: 25rpx; margin-top: 25rpx;
} }
.edit-list { .edit-list {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
} }
.edit-list view:nth-child(2) { .edit-list view:nth-child(2) {
display: inline-block; display: inline-block;
width: 120rpx; width: 120rpx;
...@@ -1582,29 +1657,17 @@ export default { ...@@ -1582,29 +1657,17 @@ export default {
overflow: hidden; overflow: hidden;
margin-left: 30rpx; margin-left: 30rpx;
} }
.edit-list view:nth-child(3) { .edit-list view:nth-child(3) {
flex: 1; flex: 1;
} }
.middle-phone {
.phoneTitle {
font-size: 28rpx;
font-weight: bolder;
margin-top: 30rpx; margin-top: 30rpx;
}
.phoneNumber {
margin-top: 30rpx;
border-bottom: 1px solid #e6e6e6;
display: flex; display: flex;
align-items: center; align-items: center;
padding-bottom: 10rpx;
} }
.middle-phone input {
.phoneNumber input {
flex: 1; flex: 1;
} }
/*押金部分*/ /*押金部分*/
.productDeposit { .productDeposit {
padding: 40rpx 15rpx; padding: 40rpx 15rpx;
...@@ -1613,88 +1676,29 @@ export default { ...@@ -1613,88 +1676,29 @@ export default {
margin-top: 20rpx; margin-top: 20rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center;
} }
/*额外服务部分*/ /*额外服务部分*/
.extraService { .extraService {
padding: 30rpx 20rpx; padding: 20rpx;
background: #ffffff; background:#DAE6F6;
margin-top: 30rpx;
border-radius: 10rpx; border-radius: 10rpx;
margin-top: 20rpx;
} }
.extraService label {
.extraService view { width: 100%;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
line-height: 30rpx; font-weight: bold;
color:#f45803;
} }
.extra-wrap{
.extraService view:not(:first-child) {
margin-top: 30rpx;
}
.extraService view label {
font-weight: bolder;
color: #f45803;
flex-shrink: 0;
}
.extraPop {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.3);
display: flex;
justify-content: center;
align-items: center;
z-index: 99;
}
.extraPop view {
width: 85%;
background: #ffffff;
border-radius: 10rpx;
padding: 40rpx 30rpx;
}
.extraPop view view:first-child {
text-align: center;
font-size: 28rpx;
font-weight: bolder;
}
.extraPop view view:nth-child(2) {
margin-top: 20rpx;
color: #666666;
line-height: 30rpx;
}
.extraPop view view:nth-child(3) {
margin-top: 40rpx;
text-align: center;
}
.extraPop view view:nth-child(3) text {
display: inline-block;
width: 145rpx;
height: 60rpx;
text-align: center; text-align: center;
line-height: 60rpx; padding-top: 100rpx;
border-radius: 10rpx; height: 65vh;
}
.extraPop view view:nth-child(3) text:nth-child(1) {
border: 1px solid #e8e8e8;
color: #666666;
margin-right: 40rpx;
}
.extraPop view view:nth-child(3) text:nth-child(2) {
background: linear-gradient(#ff5454, #ff8538);
color: #ffffff;
} }
/*底部部分*/ /*底部部分*/
.bottom { .bottom {
height: 100rpx; height: 100rpx;
...@@ -1711,44 +1715,39 @@ export default { ...@@ -1711,44 +1715,39 @@ export default {
box-sizing: border-box; box-sizing: border-box;
box-shadow: 0 0 3rpx #666666; box-shadow: 0 0 3rpx #666666;
} }
.bottom-left > text:first-child { .bottom-left > text:first-child {
font-size: 28rpx; font-size: 28rpx;
text-decoration: line-through; text-decoration: line-through;
margin-right: 16rpx; margin-right: 16rpx;
} }
.bottom-left text:nth-child(2) { .bottom-left text:nth-child(2) {
font-size: 40rpx; font-size: 40rpx;
font-weight: bolder; font-weight: bolder;
color: #f45803; color: #f45803;
} }
.bottom-left text:nth-child(2) text { .bottom-left text:nth-child(2) text {
font-size: 32rpx; font-size: 32rpx;
} }
.bottom-right { .bottom-right {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.bottom-detail { .bottom-detail {
display: flex; display: flex;
} }
.bottom-btn {
.btn {
position: relative; position: relative;
width: 200rpx; width: 240rpx;
height: 80rpx; height: 80rpx;
margin-left: 20rpx; margin-left: 20rpx;
line-height: 80rpx; line-height: 80rpx;
font-size: 32rpx; font-size: 32rpx;
font-weight: bolder; font-weight: bolder;
border-radius: 16rpx; border-radius: 24rpx;
background: $red;
text-align: center;
} }
.bottom-btn text {
.btn text {
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100%; height: 100%;
...@@ -1757,20 +1756,6 @@ export default { ...@@ -1757,20 +1756,6 @@ export default {
color: #ffffff; color: #ffffff;
top: 0; top: 0;
} }
.btn-paying {
z-index: 1;
background: #c0c0c0;
border-radius: 16rpx;
}
.btn .mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.1);
}
.sortPoptext { .sortPoptext {
font-size: 30rpx; font-size: 30rpx;
font-weight: bolder; font-weight: bolder;
......
...@@ -12,74 +12,28 @@ ...@@ -12,74 +12,28 @@
* *
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/ */
/*分割线颜色*/
$divider:#DBDBDB; /*
1.页面背景颜色#f7f7f7
2.分隔线颜色#DBDBDB
3.正常字体颜色#333333
4.灰色字体颜色#666666或者#999999
5.主题颜色#3688FF
6.正常字体大小28rpx,偏小一点的24rpx
8.页面最外层与里面的第一层为padding:0 12px;
9.css单位为rpx
*/
/*主题颜色*/ /*主题颜色*/
$blue:#3688FF; $theme:#3688FF;
/*红色*/ /*红色*/
$red:#FC6703; $red:#FC6703;
/*灰色*/ /*灰色*/
$grey:#999; $grey:#999;
/* 颜色变量 */ // 分割线颜色
$divider:#f3f3f3;
/* 行为相关颜色 */
$uni-color-primary: #007aff;
$uni-color-success: #4cd964;
$uni-color-warning: #f0ad4e;
$uni-color-error: #dd524d;
/* 文字基本颜色 */
$uni-text-color:#333;//基本色
$uni-text-color-inverse:#fff;//反色
$text-grey:#999;//辅助灰色,如加载更多的提示信息
$uni-text-color-placeholder: #808080;
$uni-text-color-disable:#c0c0c0;
/* 背景颜色 */
$uni-bg-color:#ffffff;
$uni-bg-color-grey:#f8f8f8;
$uni-bg-color-hover:#f1f1f1;//点击状态颜色
$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
/* 边框颜色 */
$border-color:#c8c7cc;
/* 尺寸变量 */
/* 文字尺寸 */
$uni-font-size-sm:24rpx;
$uni-font-size-base:28rpx;
$uni-font-size-lg:32rpx;
/* 图片尺寸 */
$uni-img-size-sm:40rpx;
$uni-img-size-base:52rpx;
$uni-img-size-lg:80rpx;
/* Border Radius */
$uni-border-radius-sm: 4rpx;
$uni-border-radius-base: 6rpx;
$uni-border-radius-lg: 12rpx;
$uni-border-radius-circle: 50%;
/* 水平间距 */
$uni-spacing-row-sm: 10px;
$uni-spacing-row-base: 20rpx;
$uni-spacing-row-lg: 30rpx;
/* 垂直间距 */
$uni-spacing-col-sm: 8rpx;
$uni-spacing-col-base: 16rpx;
$uni-spacing-col-lg: 24rpx;
/* 透明度 */
$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
/* 文章场景相关 */
$uni-color-title: #2C405A; // 文章标题颜色
$uni-font-size-title:40rpx;
$uni-color-subtitle: #555555; // 二级标题颜色
$uni-font-size-subtitle:36rpx;
$uni-color-paragraph: #3F536E; // 文章段落颜色
$uni-font-size-paragraph:30rpx;
\ No newline at end of file
...@@ -35,23 +35,23 @@ ...@@ -35,23 +35,23 @@
</template> </template>
<script> <script>
// #ifdef APP-NVUE // #ifdef APP-NVUE
// nvue通过weex的dom模块引入字体,相关文档地址如下: // nvue通过weex的dom模块引入字体,相关文档地址如下:
// https://weex.apache.org/zh/docs/modules/dom.html#addrule // https://weex.apache.org/zh/docs/modules/dom.html#addrule
const fontUrl = 'https://at.alicdn.com/t/font_2225171_8kdcwk4po24.ttf' const fontUrl = 'https://at.alicdn.com/t/font_2225171_8kdcwk4po24.ttf'
const domModule = weex.requireModule('dom') const domModule = weex.requireModule('dom')
domModule.addRule('fontFace', { domModule.addRule('fontFace', {
'fontFamily': "uicon-iconfont", 'fontFamily': 'uicon-iconfont',
'src': `url('${fontUrl}')` 'src': `url('${fontUrl}')`
}) })
// #endif // #endif
// 引入图标名称,已经对应的unicode // 引入图标名称,已经对应的unicode
import icons from './icons' import icons from './icons'
import props from './props.js';; import props from './props.js'
/** /**
* icon 图标 * icon 图标
* @description 基于字体的图标集,包含了大多数常见场景的图标。 * @description 基于字体的图标集,包含了大多数常见场景的图标。
* @tutorial https://www.uviewui.com/components/icon.html * @tutorial https://www.uviewui.com/components/icon.html
...@@ -77,72 +77,72 @@ ...@@ -77,72 +77,72 @@
* @event {Function} touchstart 事件触摸时触发 * @event {Function} touchstart 事件触摸时触发
* @example <u-icon name="photo" color="#2979ff" size="28"></u-icon> * @example <u-icon name="photo" color="#2979ff" size="28"></u-icon>
*/ */
export default { export default {
name: 'u-icon', name: 'u-icon',
data() { data() {
return { return {
} }
}, },
mixins: [uni.$u.mpMixin, uni.$u.mixin,props], mixins: [uni.$u.mpMixin, uni.$u.mixin,props],
computed: { computed: {
uClasses() { uClasses() {
let classes = [] let classes = []
classes.push(this.customPrefix + '-' + this.name) classes.push(this.customPrefix + '-' + this.name)
// // uView的自定义图标类名为u-iconfont // // uView的自定义图标类名为u-iconfont
// if (this.customPrefix == 'uicon') { // if (this.customPrefix == 'uicon') {
// classes.push('u-iconfont') // classes.push('u-iconfont')
// } else { // } else {
// classes.push(this.customPrefix) // classes.push(this.customPrefix)
// } // }
// 主题色,通过类配置 // 主题色,通过类配置
if (this.color && uni.$u.config.type.includes(this.color)) classes.push('u-icon__icon--' + this.color) if (this.color && uni.$u.config.type.includes(this.color)) classes.push('u-icon__icon--' + this.color)
// 阿里,头条,百度小程序通过数组绑定类名时,无法直接使用[a, b, c]的形式,否则无法识别 // 阿里,头条,百度小程序通过数组绑定类名时,无法直接使用[a, b, c]的形式,否则无法识别
// 故需将其拆成一个字符串的形式,通过空格隔开各个类名 // 故需将其拆成一个字符串的形式,通过空格隔开各个类名
//#ifdef MP-ALIPAY || MP-TOUTIAO || MP-BAIDU //#ifdef MP-ALIPAY || MP-TOUTIAO || MP-BAIDU
classes = classes.join(' ') classes = classes.join(' ')
//#endif //#endif
return classes return classes
}, },
iconStyle() { iconStyle() {
let style = {} let style = {}
style = { style = {
fontSize: uni.$u.addUnit(this.size), fontSize: uni.$u.addUnit(this.size),
lineHeight: uni.$u.addUnit(this.size), lineHeight: uni.$u.addUnit(this.size),
fontWeight: this.bold ? 'bold' : 'normal', fontWeight: this.bold ? 'bold' : 'normal',
// 某些特殊情况需要设置一个到顶部的距离,才能更好的垂直居中 // 某些特殊情况需要设置一个到顶部的距离,才能更好的垂直居中
top: uni.$u.addUnit(this.top) top: uni.$u.addUnit(this.top)
} }
// 非主题色值时,才当作颜色值 // 非主题色值时,才当作颜色值
if (this.color && !uni.$u.config.type.includes(this.color)) style.color = this.color if (this.color && !uni.$u.config.type.includes(this.color)) style.color = this.color
return style return style
}, },
// 判断传入的name属性,是否图片路径,只要带有"/"均认为是图片形式 // 判断传入的name属性,是否图片路径,只要带有"/"均认为是图片形式
isImg() { isImg() {
return this.name.indexOf('/') !== -1 return this.name.indexOf('/') !== -1
}, },
imgStyle() { imgStyle() {
let style = {} let style = {}
// 如果设置width和height属性,则优先使用,否则使用size属性 // 如果设置width和height属性,则优先使用,否则使用size属性
style.width = this.width ? uni.$u.addUnit(this.width) : uni.$u.addUnit(this.size) style.width = this.width ? uni.$u.addUnit(this.width) : uni.$u.addUnit(this.size)
style.height = this.height ? uni.$u.addUnit(this.height) : uni.$u.addUnit(this.size) style.height = this.height ? uni.$u.addUnit(this.height) : uni.$u.addUnit(this.size)
return style return style
}, },
// 通过图标名,查找对应的图标 // 通过图标名,查找对应的图标
icon() { icon() {
// 如果内置的图标中找不到对应的图标,就直接返回name值,因为用户可能传入的是unicode代码 // 如果内置的图标中找不到对应的图标,就直接返回name值,因为用户可能传入的是unicode代码
return icons['uicon-' + this.name] || this.name return icons['uicon-' + this.name] || this.name
} }
}, },
methods: { methods: {
clickHandler(e) { clickHandler(e) {
this.$emit('click', this.index) this.$emit('click', this.index)
// 是否阻止事件冒泡 // 是否阻止事件冒泡
this.stop && this.preventEvent(e) this.stop && this.preventEvent(e)
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -162,7 +162,6 @@ ...@@ -162,7 +162,6 @@
font-family: 'uicon-iconfont'; font-family: 'uicon-iconfont';
src: url('https://at.alicdn.com/t/font_2225171_8kdcwk4po24.ttf') format('truetype'); src: url('https://at.alicdn.com/t/font_2225171_8kdcwk4po24.ttf') format('truetype');
} }
/* #endif */ /* #endif */
.u-icon { .u-icon {
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<u-icon <u-icon
name="close" name="close"
color="#909399" color="#909399"
size="18" size="36"
bold bold
></u-icon> ></u-icon>
</view> </view>
...@@ -45,9 +45,9 @@ ...@@ -45,9 +45,9 @@
</template> </template>
<script> <script>
import props from './props.js'; import props from './props.js'
/** /**
* popup 弹窗 * popup 弹窗
* @description 弹出层容器,用于展示弹窗、信息提示等内容,支持上、下、左、右和中部弹出。组件只提供容器,内部内容由用户自定义 * @description 弹出层容器,用于展示弹窗、信息提示等内容,支持上、下、左、右和中部弹出。组件只提供容器,内部内容由用户自定义
* @tutorial https://www.uviewui.com/components/popup.html * @tutorial https://www.uviewui.com/components/popup.html
...@@ -71,158 +71,158 @@ ...@@ -71,158 +71,158 @@
* @event {Function} close 弹出层收起 * @event {Function} close 弹出层收起
* @example <u-popup v-model="show"><text>出淤泥而不染,濯清涟而不妖</text></u-popup> * @example <u-popup v-model="show"><text>出淤泥而不染,濯清涟而不妖</text></u-popup>
*/ */
export default { export default {
name: 'u-popup', name: 'u-popup',
mixins: [uni.$u.mpMixin, uni.$u.mixin, props], mixins: [uni.$u.mpMixin, uni.$u.mixin, props],
data() { data() {
return { return {
overlayDuration: this.duration + 50 overlayDuration: this.duration + 50
} }
}, },
watch: { watch: {
show(newValue, oldValue) { show(newValue, oldValue) {
if (newValue === true) { if (newValue === true) {
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
const children = this.$children const children = this.$children
this.retryComputedComponentRect(children) this.retryComputedComponentRect(children)
// #endif // #endif
} }
} }
}, },
computed: { computed: {
transitionStyle() { transitionStyle() {
const style = { const style = {
zIndex: this.zIndex, zIndex: this.zIndex,
position: 'fixed', position: 'fixed',
display: 'flex', display: 'flex',
} }
style[this.mode] = 0 style[this.mode] = 0
if (this.mode === 'left') { if (this.mode === 'left') {
return uni.$u.deepMerge(style, { return uni.$u.deepMerge(style, {
bottom: 0, bottom: 0,
top: 0, top: 0,
}) })
} else if (this.mode === 'right') { } else if (this.mode === 'right') {
return uni.$u.deepMerge(style, { return uni.$u.deepMerge(style, {
bottom: 0, bottom: 0,
top: 0, top: 0,
}) })
} else if (this.mode === 'top') { } else if (this.mode === 'top') {
return uni.$u.deepMerge(style, { return uni.$u.deepMerge(style, {
left: 0, left: 0,
right: 0 right: 0
}) })
} else if (this.mode === 'bottom') { } else if (this.mode === 'bottom') {
return uni.$u.deepMerge(style, { return uni.$u.deepMerge(style, {
left: 0, left: 0,
right: 0, right: 0,
}) })
} else if (this.mode === 'center') { } else if (this.mode === 'center') {
return uni.$u.deepMerge(style, { return uni.$u.deepMerge(style, {
alignItems: 'center', alignItems: 'center',
'justify-content': 'center', 'justify-content': 'center',
top: 0, top: 0,
left: 0, left: 0,
right: 0, right: 0,
bottom: 0 bottom: 0
}) })
} }
}, },
contentStyle() { contentStyle() {
const style = {} const style = {}
// 通过设备信息的safeAreaInsets值来判断是否需要预留顶部状态栏和底部安全局的位置 // 通过设备信息的safeAreaInsets值来判断是否需要预留顶部状态栏和底部安全局的位置
// 不使用css方案,是因为nvue不支持css的iPhoneX安全区查询属性 // 不使用css方案,是因为nvue不支持css的iPhoneX安全区查询属性
const { const {
safeAreaInsets safeAreaInsets
} = uni.$u.sys() } = uni.$u.sys()
if (this.mode !== 'center') { if (this.mode !== 'center') {
style.flex = 1 style.flex = 1
} }
// 背景色,一般用于设置为transparent,去除默认的白色背景 // 背景色,一般用于设置为transparent,去除默认的白色背景
if (this.bgColor) { if (this.bgColor) {
style.backgroundColor = this.bgColor style.backgroundColor = this.bgColor
} }
if(this.round) { if(this.round) {
const value = uni.$u.addUnit(this.round) const value = uni.$u.addUnit(this.round)
if(this.mode === 'top') { if(this.mode === 'top') {
style.borderBottomLeftRadius = value style.borderBottomLeftRadius = value
style.borderBottomRightRadius = value style.borderBottomRightRadius = value
} else if(this.mode === 'bottom') { } else if(this.mode === 'bottom') {
style.borderTopLeftRadius = value style.borderTopLeftRadius = value
style.borderTopRightRadius = value style.borderTopRightRadius = value
} else if(this.mode === 'center') { } else if(this.mode === 'center') {
style.borderRadius = value style.borderRadius = value
} }
} }
return uni.$u.deepMerge(style, uni.$u.addStyle(this.customStyle)) return uni.$u.deepMerge(style, uni.$u.addStyle(this.customStyle))
}, },
position() { position() {
if (this.mode === 'center') { if (this.mode === 'center') {
return this.zoom ? 'fade-zoom' : 'fade' return this.zoom ? 'fade-zoom' : 'fade'
} }
if (this.mode === 'left') { if (this.mode === 'left') {
return 'slide-left' return 'slide-left'
} }
if (this.mode === 'right') { if (this.mode === 'right') {
return 'slide-right' return 'slide-right'
} }
if (this.mode === 'bottom') { if (this.mode === 'bottom') {
return 'slide-up' return 'slide-up'
} }
if (this.mode === 'top') { if (this.mode === 'top') {
return 'slide-down' return 'slide-down'
} }
}, },
}, },
methods: { methods: {
// 点击遮罩 // 点击遮罩
overlayClick() { overlayClick() {
if (this.closeOnClickOverlay) { if (this.closeOnClickOverlay) {
this.$emit('close') this.$emit('close')
} }
}, },
close(e) { close(e) {
this.$emit('close') this.$emit('close')
}, },
afterEnter() { afterEnter() {
this.$emit('open') this.$emit('open')
}, },
clickHandler() { clickHandler() {
// 由于中部弹出时,其u-transition占据了整个页面相当于遮罩,此时需要发出遮罩点击事件,是否无法通过点击遮罩关闭弹窗 // 由于中部弹出时,其u-transition占据了整个页面相当于遮罩,此时需要发出遮罩点击事件,是否无法通过点击遮罩关闭弹窗
if(this.mode === 'center') { if(this.mode === 'center') {
this.overlayClick() this.overlayClick()
} }
this.$emit('click') this.$emit('click')
}, },
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
retryComputedComponentRect(children) { retryComputedComponentRect(children) {
// 组件内部需要计算节点的组件 // 组件内部需要计算节点的组件
const names = ['u-calendar-month', 'u-album', 'u-collapse-item', 'u-dropdown', 'u-index-item', 'u-index-list', const names = ['u-calendar-month', 'u-album', 'u-collapse-item', 'u-dropdown', 'u-index-item', 'u-index-list',
'u-line-progress', 'u-list-item', 'u-rate', 'u-read-more', 'u-row', 'u-row-notice', 'u-scroll-list', 'u-line-progress', 'u-list-item', 'u-rate', 'u-read-more', 'u-row', 'u-row-notice', 'u-scroll-list',
'u-skeleton', 'u-slider', 'u-steps-item', 'u-sticky', 'u-subsection', 'u-swipe-action-item', 'u-tabbar', 'u-skeleton', 'u-slider', 'u-steps-item', 'u-sticky', 'u-subsection', 'u-swipe-action-item', 'u-tabbar',
'u-tabs', 'u-tooltip' 'u-tabs', 'u-tooltip'
] ]
// 历遍所有的子组件节点 // 历遍所有的子组件节点
for (let i = 0; i < children.length; i++) { for (let i = 0; i < children.length; i++) {
const child = children[i] const child = children[i]
// 拿到子组件的子组件 // 拿到子组件的子组件
const grandChild = child.$children const grandChild = child.$children
// 判断如果在需要重新初始化的组件数组中名中,并且存在init方法的话,则执行 // 判断如果在需要重新初始化的组件数组中名中,并且存在init方法的话,则执行
if (names.includes(child.$options.name) && typeof child?.init === 'function') { if (names.includes(child.$options.name) && typeof child?.init === 'function') {
// 需要进行一定的延时,因为初始化页面需要时间 // 需要进行一定的延时,因为初始化页面需要时间
uni.$u.sleep(50).then(() => { uni.$u.sleep(50).then(() => {
child.init() child.init()
}) })
} }
// 如果子组件还有孙组件,进行递归历遍 // 如果子组件还有孙组件,进行递归历遍
if (grandChild.length) { if (grandChild.length) {
this.retryComputedComponentRect(grandChild) this.retryComputedComponentRect(grandChild)
} }
} }
} }
// #endif // #endif
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
!(function (t, e) { !(function (t, e) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = e() : typeof define === 'function' typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = e() : typeof define === 'function'
&& define.amd ? define(e) : t.dayjs = e() && define.amd ? define(e) : t.dayjs = e()
}(this, () => { }(this, () => {
'use strict' 'use strict'
const t = 'millisecond' const t = 'millisecond'
const e = 'second' const e = 'second'
const n = 'minute' const n = 'minute'
const r = 'hour' const r = 'hour'
const i = 'day' const i = 'day'
const s = 'week' const s = 'week'
const u = 'month' const u = 'month'
const a = 'quarter' const a = 'quarter'
const o = 'year' const o = 'year'
const f = 'date' const f = 'date'
const h = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?.?(\d+)?$/ const h = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?.?(\d+)?$/
const c = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g const c = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g
const d = { const d = {
name: 'en', name: 'en',
weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_') months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_')
}
const $ = function (t, e, n) {
const r = String(t)
return !r || r.length >= e ? t : `${Array(e + 1 - r.length).join(n)}${t}`
}
const l = {
s: $,
z(t) {
const e = -t.utcOffset()
const n = Math.abs(e)
const r = Math.floor(n / 60)
const i = n % 60
return `${(e <= 0 ? '+' : '-') + $(r, 2, '0')}:${$(i, 2, '0')}`
},
m: function t(e, n) {
if (e.date() < n.date()) return -t(n, e)
const r = 12 * (n.year() - e.year()) + (n.month() - e.month())
const i = e.clone().add(r, u)
const s = n - i < 0
const a = e.clone().add(r + (s ? -1 : 1), u)
return +(-(r + (n - i) / (s ? i - a : a - i)) || 0)
},
a(t) {
return t < 0 ? Math.ceil(t) || 0 : Math.floor(t)
},
p(h) {
return {
M: u,
y: o,
w: s,
d: i,
D: f,
h: r,
m: n,
s: e,
ms: t,
Q: a
}[h] || String(h || '').toLowerCase().replace(/s$/, '')
},
u(t) {
return void 0 === t
} }
const $ = function (t, e, n) { }
const r = String(t) let y = 'en'
return !r || r.length >= e ? t : `${Array(e + 1 - r.length).join(n)}${t}` const M = {}
M[y] = d
const m = function (t) {
return t instanceof S
}
const D = function (t, e, n) {
let r
if (!t) return y
if (typeof t === 'string') M[t] && (r = t), e && (M[t] = e, r = t)
else {
const i = t.name
M[i] = t, r = i
} }
const l = { return !n && r && (y = r), r || !n && y
s: $, }
z(t) { const v = function (t, e) {
const e = -t.utcOffset() if (m(t)) return t.clone()
const n = Math.abs(e) const n = typeof e === 'object' ? e : {}
const r = Math.floor(n / 60) return n.date = t, n.args = arguments, new S(n)
const i = n % 60 }
return `${(e <= 0 ? '+' : '-') + $(r, 2, '0')}:${$(i, 2, '0')}` const g = l
}, g.l = D, g.i = m, g.w = function (t, e) {
m: function t(e, n) { return v(t, {
if (e.date() < n.date()) return -t(n, e) locale: e.$L,
const r = 12 * (n.year() - e.year()) + (n.month() - e.month()) utc: e.$u,
const i = e.clone().add(r, u) x: e.$x,
const s = n - i < 0 $offset: e.$offset
const a = e.clone().add(r + (s ? -1 : 1), u) })
return +(-(r + (n - i) / (s ? i - a : a - i)) || 0) }
}, var S = (function () {
a(t) { function d(t) {
return t < 0 ? Math.ceil(t) || 0 : Math.floor(t) this.$L = D(t.locale, null, !0), this.parse(t)
},
p(h) {
return {
M: u,
y: o,
w: s,
d: i,
D: f,
h: r,
m: n,
s: e,
ms: t,
Q: a
}[h] || String(h || '').toLowerCase().replace(/s$/, '')
},
u(t) {
return void 0 === t
}
}
let y = 'en'
const M = {}
M[y] = d
const m = function (t) {
return t instanceof S
}
const D = function (t, e, n) {
let r
if (!t) return y
if (typeof t === 'string') M[t] && (r = t), e && (M[t] = e, r = t)
else {
const i = t.name
M[i] = t, r = i
}
return !n && r && (y = r), r || !n && y
} }
const v = function (t, e) { const $ = d.prototype
if (m(t)) return t.clone() return $.parse = function (t) {
const n = typeof e === 'object' ? e : {} this.$d = (function (t) {
return n.date = t, n.args = arguments, new S(n) const e = t.date
} const n = t.utc
const g = l if (e === null) return new Date(NaN)
g.l = D, g.i = m, g.w = function (t, e) { if (g.u(e)) return new Date()
return v(t, { //由于苹果手机警告,修改了代码
locale: e.$L, if (e instanceof Date){
utc: e.$u, if(e&&e.toString().includes('000Z')){
x: e.$x, return new Date(e.slice(0, -5))
$offset: e.$offset }else{
}) return new Date(e)
} }
var S = (function () { }
function d(t) { if (typeof e === 'string' && !/Z$/i.test(e)) {
this.$L = D(t.locale, null, !0), this.parse(t) const r = e.match(h)
} if (r) {
const $ = d.prototype const i = r[2] - 1 || 0
return $.parse = function (t) { const s = (r[7] || '0').substring(0, 3)
this.$d = (function (t) { return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s)) : new Date(r[1], i, r[3]
const e = t.date
const n = t.utc
if (e === null) return new Date(NaN)
if (g.u(e)) return new Date()
if (e instanceof Date) return new Date(e)
if (typeof e === 'string' && !/Z$/i.test(e)) {
const r = e.match(h)
if (r) {
const i = r[2] - 1 || 0
const s = (r[7] || '0').substring(0, 3)
return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s)) : new Date(r[1], i, r[3]
|| 1, r[4] || 0, r[5] || 0, r[6] || 0, s) || 1, r[4] || 0, r[5] || 0, r[6] || 0, s)
} }
}
return new Date(e)
}(t)), this.$x = t.x || {}, this.init()
}, $.init = function () {
const t = this.$d
this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(),
this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds()
}, $.$utils = function () {
return g
}, $.isValid = function () {
return !(this.$d.toString() === 'Invalid Date')
}, $.isSame = function (t, e) {
const n = v(t)
return this.startOf(e) <= n && n <= this.endOf(e)
}, $.isAfter = function (t, e) {
return v(t) < this.startOf(e)
}, $.isBefore = function (t, e) {
return this.endOf(e) < v(t)
}, $.$g = function (t, e, n) {
return g.u(t) ? this[e] : this.set(n, t)
}, $.unix = function () {
return Math.floor(this.valueOf() / 1e3)
}, $.valueOf = function () {
return this.$d.getTime()
}, $.startOf = function (t, a) {
const h = this
const c = !!g.u(a) || a
const d = g.p(t)
const $ = function (t, e) {
const n = g.w(h.$u ? Date.UTC(h.$y, e, t) : new Date(h.$y, e, t), h)
return c ? n : n.endOf(i)
}
const l = function (t, e) {
return g.w(h.toDate()[t].apply(h.toDate('s'), (c ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e)), h)
}
const y = this.$W
const M = this.$M
const m = this.$D
const D = `set${this.$u ? 'UTC' : ''}`
switch (d) {
case o:
return c ? $(1, 0) : $(31, 11)
case u:
return c ? $(1, M) : $(0, M + 1)
case s:
var v = this.$locale().weekStart || 0
var S = (y < v ? y + 7 : y) - v
return $(c ? m - S : m + (6 - S), M)
case i:
case f:
return l(`${D}Hours`, 0)
case r:
return l(`${D}Minutes`, 1)
case n:
return l(`${D}Seconds`, 2)
case e:
return l(`${D}Milliseconds`, 3)
default:
return this.clone()
}
}, $.endOf = function (t) {
return this.startOf(t, !1)
}, $.$set = function (s, a) {
let h; const c = g.p(s)
const d = `set${this.$u ? 'UTC' : ''}`
const $ = (h = {}, h[i] = `${d}Date`, h[f] = `${d}Date`, h[u] = `${d}Month`, h[o] = `${d}FullYear`, h[r] = `${d}Hours`,
h[n] = `${d}Minutes`, h[e] = `${d}Seconds`, h[t] = `${d}Milliseconds`, h)[c]
const l = c === i ? this.$D + (a - this.$W) : a
if (c === u || c === o) {
const y = this.clone().set(f, 1)
y.$d[$](l), y.init(), this.$d = y.set(f, Math.min(this.$D, y.daysInMonth())).$d
} else $ && this.$d[$](l)
return this.init(), this
}, $.set = function (t, e) {
return this.clone().$set(t, e)
}, $.get = function (t) {
return this[g.p(t)]()
}, $.add = function (t, a) {
let f; const
h = this
t = Number(t)
const c = g.p(a)
const d = function (e) {
const n = v(h)
return g.w(n.date(n.date() + Math.round(e * t)), h)
}
if (c === u) return this.set(u, this.$M + t)
if (c === o) return this.set(o, this.$y + t)
if (c === i) return d(1)
if (c === s) return d(7)
const $ = (f = {}, f[n] = 6e4, f[r] = 36e5, f[e] = 1e3, f)[c] || 1
const l = this.$d.getTime() + t * $
return g.w(l, this)
}, $.subtract = function (t, e) {
return this.add(-1 * t, e)
}, $.format = function (t) {
const e = this
if (!this.isValid()) return 'Invalid Date'
const n = t || 'YYYY-MM-DDTHH:mm:ssZ'
const r = g.z(this)
const i = this.$locale()
const s = this.$H
const u = this.$m
const a = this.$M
const o = i.weekdays
const f = i.months
const h = function (t, r, i, s) {
return t && (t[r] || t(e, n)) || i[r].substr(0, s)
}
const d = function (t) {
return g.s(s % 12 || 12, t, '0')
}
const $ = i.meridiem || function (t, e, n) {
const r = t < 12 ? 'AM' : 'PM'
return n ? r.toLowerCase() : r
}
const l = {
YY: String(this.$y).slice(-2),
YYYY: this.$y,
M: a + 1,
MM: g.s(a + 1, 2, '0'),
MMM: h(i.monthsShort, a, f, 3),
MMMM: h(f, a),
D: this.$D,
DD: g.s(this.$D, 2, '0'),
d: String(this.$W),
dd: h(i.weekdaysMin, this.$W, o, 2),
ddd: h(i.weekdaysShort, this.$W, o, 3),
dddd: o[this.$W],
H: String(s),
HH: g.s(s, 2, '0'),
h: d(1),
hh: d(2),
a: $(s, u, !0),
A: $(s, u, !1),
m: String(u),
mm: g.s(u, 2, '0'),
s: String(this.$s),
ss: g.s(this.$s, 2, '0'),
SSS: g.s(this.$ms, 3, '0'),
Z: r
}
return n.replace(c, (t, e) => e || l[t] || r.replace(':', ''))
}, $.utcOffset = function () {
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15)
}, $.diff = function (t, f, h) {
let c; const d = g.p(f)
const $ = v(t)
const l = 6e4 * ($.utcOffset() - this.utcOffset())
const y = this - $
let M = g.m(this, $)
return M = (c = {}, c[o] = M / 12, c[u] = M, c[a] = M / 3, c[s] = (y - l) / 6048e5, c[i] = (y - l) / 864e5, c[r] = y / 36e5, c[n] = y / 6e4, c[e] = y / 1e3, c)[d] || y, h ? M : g.a(M)
}, $.daysInMonth = function () {
return this.endOf(u).$D
}, $.$locale = function () {
return M[this.$L]
}, $.locale = function (t, e) {
if (!t) return this.$L
const n = this.clone()
const r = D(t, e, !0)
return r && (n.$L = r), n
}, $.clone = function () {
return g.w(this.$d, this)
}, $.toDate = function () {
return new Date(this.valueOf())
}, $.toJSON = function () {
return this.isValid() ? this.toISOString() : null
}, $.toISOString = function () {
return this.$d.toISOString()
}, $.toString = function () {
return this.$d.toUTCString()
}, d
}())
const p = S.prototype
return v.prototype = p, [
['$ms', t],
['$s', e],
['$m', n],
['$H', r],
['$W', i],
['$M', u],
['$y', o],
['$D', f]
].forEach((t) => {
p[t[1]] = function (e) {
return this.$g(e, t[0], t[1])
} }
}), v.extend = function (t, e) { //由于苹果手机警告,修改了代码
return t.$i || (t(e, S, v), t.$i = !0), v if(e&&e.toString().includes('000Z')){
}, v.locale = D, v.isDayjs = m, v.unix = function (t) { return new Date(e.slice(0, -5))
return v(1e3 * t)
}, v.en = M[y], v.Ls = M, v.p = {}, v }else{
return new Date(e)
}
}(t)), this.$x = t.x || {}, this.init()
}, $.init = function () {
const t = this.$d
this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(),
this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds()
}, $.$utils = function () {
return g
}, $.isValid = function () {
return !(this.$d.toString() === 'Invalid Date')
}, $.isSame = function (t, e) {
const n = v(t)
return this.startOf(e) <= n && n <= this.endOf(e)
}, $.isAfter = function (t, e) {
return v(t) < this.startOf(e)
}, $.isBefore = function (t, e) {
return this.endOf(e) < v(t)
}, $.$g = function (t, e, n) {
return g.u(t) ? this[e] : this.set(n, t)
}, $.unix = function () {
return Math.floor(this.valueOf() / 1e3)
}, $.valueOf = function () {
return this.$d.getTime()
}, $.startOf = function (t, a) {
const h = this
const c = !!g.u(a) || a
const d = g.p(t)
const $ = function (t, e) {
const n = g.w(h.$u ? Date.UTC(h.$y, e, t) : new Date(h.$y, e, t), h)
return c ? n : n.endOf(i)
}
const l = function (t, e) {
return g.w(h.toDate()[t].apply(h.toDate('s'), (c ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e)), h)
}
const y = this.$W
const M = this.$M
const m = this.$D
const D = `set${this.$u ? 'UTC' : ''}`
switch (d) {
case o:
return c ? $(1, 0) : $(31, 11)
case u:
return c ? $(1, M) : $(0, M + 1)
case s:
var v = this.$locale().weekStart || 0
var S = (y < v ? y + 7 : y) - v
return $(c ? m - S : m + (6 - S), M)
case i:
case f:
return l(`${D}Hours`, 0)
case r:
return l(`${D}Minutes`, 1)
case n:
return l(`${D}Seconds`, 2)
case e:
return l(`${D}Milliseconds`, 3)
default:
return this.clone()
}
}, $.endOf = function (t) {
return this.startOf(t, !1)
}, $.$set = function (s, a) {
let h; const c = g.p(s)
const d = `set${this.$u ? 'UTC' : ''}`
const $ = (h = {}, h[i] = `${d}Date`, h[f] = `${d}Date`, h[u] = `${d}Month`, h[o] = `${d}FullYear`, h[r] = `${d}Hours`,
h[n] = `${d}Minutes`, h[e] = `${d}Seconds`, h[t] = `${d}Milliseconds`, h)[c]
const l = c === i ? this.$D + (a - this.$W) : a
if (c === u || c === o) {
const y = this.clone().set(f, 1)
y.$d[$](l), y.init(), this.$d = y.set(f, Math.min(this.$D, y.daysInMonth())).$d
} else $ && this.$d[$](l)
return this.init(), this
}, $.set = function (t, e) {
return this.clone().$set(t, e)
}, $.get = function (t) {
return this[g.p(t)]()
}, $.add = function (t, a) {
let f; const
h = this
t = Number(t)
const c = g.p(a)
const d = function (e) {
const n = v(h)
return g.w(n.date(n.date() + Math.round(e * t)), h)
}
if (c === u) return this.set(u, this.$M + t)
if (c === o) return this.set(o, this.$y + t)
if (c === i) return d(1)
if (c === s) return d(7)
const $ = (f = {}, f[n] = 6e4, f[r] = 36e5, f[e] = 1e3, f)[c] || 1
const l = this.$d.getTime() + t * $
return g.w(l, this)
}, $.subtract = function (t, e) {
return this.add(-1 * t, e)
}, $.format = function (t) {
const e = this
if (!this.isValid()) return 'Invalid Date'
const n = t || 'YYYY-MM-DDTHH:mm:ssZ'
const r = g.z(this)
const i = this.$locale()
const s = this.$H
const u = this.$m
const a = this.$M
const o = i.weekdays
const f = i.months
const h = function (t, r, i, s) {
return t && (t[r] || t(e, n)) || i[r].substr(0, s)
}
const d = function (t) {
return g.s(s % 12 || 12, t, '0')
}
const $ = i.meridiem || function (t, e, n) {
const r = t < 12 ? 'AM' : 'PM'
return n ? r.toLowerCase() : r
}
const l = {
YY: String(this.$y).slice(-2),
YYYY: this.$y,
M: a + 1,
MM: g.s(a + 1, 2, '0'),
MMM: h(i.monthsShort, a, f, 3),
MMMM: h(f, a),
D: this.$D,
DD: g.s(this.$D, 2, '0'),
d: String(this.$W),
dd: h(i.weekdaysMin, this.$W, o, 2),
ddd: h(i.weekdaysShort, this.$W, o, 3),
dddd: o[this.$W],
H: String(s),
HH: g.s(s, 2, '0'),
h: d(1),
hh: d(2),
a: $(s, u, !0),
A: $(s, u, !1),
m: String(u),
mm: g.s(u, 2, '0'),
s: String(this.$s),
ss: g.s(this.$s, 2, '0'),
SSS: g.s(this.$ms, 3, '0'),
Z: r
}
return n.replace(c, (t, e) => e || l[t] || r.replace(':', ''))
}, $.utcOffset = function () {
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15)
}, $.diff = function (t, f, h) {
let c; const d = g.p(f)
const $ = v(t)
const l = 6e4 * ($.utcOffset() - this.utcOffset())
const y = this - $
let M = g.m(this, $)
return M = (c = {}, c[o] = M / 12, c[u] = M, c[a] = M / 3, c[s] = (y - l) / 6048e5, c[i] = (y - l) / 864e5, c[r] = y / 36e5, c[n] = y / 6e4, c[e] = y / 1e3, c)[d] || y, h ? M : g.a(M)
}, $.daysInMonth = function () {
return this.endOf(u).$D
}, $.$locale = function () {
return M[this.$L]
}, $.locale = function (t, e) {
if (!t) return this.$L
const n = this.clone()
const r = D(t, e, !0)
return r && (n.$L = r), n
}, $.clone = function () {
return g.w(this.$d, this)
}, $.toDate = function () {
return new Date(this.valueOf())
}, $.toJSON = function () {
return this.isValid() ? this.toISOString() : null
}, $.toISOString = function () {
return this.$d.toISOString()
}, $.toString = function () {
return this.$d.toUTCString()
}, d
}())
const p = S.prototype
return v.prototype = p, [
['$ms', t],
['$s', e],
['$m', n],
['$H', r],
['$W', i],
['$M', u],
['$y', o],
['$D', f]
].forEach((t) => {
p[t[1]] = function (e) {
return this.$g(e, t[0], t[1])
}
}), v.extend = function (t, e) {
return t.$i || (t(e, S, v), t.$i = !0), v
}, v.locale = D, v.isDayjs = m, v.unix = function (t) {
return v(1e3 * t)
}, v.en = M[y], v.Ls = M, v.p = {}, v
})) }))
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