刘翔宇-旅管家 4 years ago
parent 38f2fb771a
commit 0b50e78f4f

@ -45,17 +45,20 @@
<u--form labelPosition="left" :model="form" :rules="rules" ref="form"> <u--form labelPosition="left" :model="form" :rules="rules" ref="form">
<view class="box-card"> <view class="box-card">
<view class="box-card-title"> <view class="box-card-title">
参与人 参与人
</view> </view>
<view class="box-card-content"> <view class="box-card-content">
<u-form-item label="参观人数" labelWidth="120" prop="total" ref="total"> <u-form-item label="参观人数" labelWidth="120" prop="total" ref="total">
<u-number-box slot="right" v-model="form.total" inputWidth="44" color="#EF9525" <u-number-box slot="right" v-model="form.total" inputWidth="44" color="#EF9525"
bgColor="#FCF6E3" :min="(type=='user'?1:list.team_min_count)" :max="(type=='user'?list.person_max_count:list.team_max_count)" class="plus"> bgColor="#FCF6E3" :min="(type=='user'?1:list.team_min_count)"
:max="(type=='user'?list.person_max_count:list.team_max_count)" class="plus">
</u-number-box> </u-number-box>
</u-form-item> </u-form-item>
<view class="box-tips"> <view class="box-tips">
<text class="box-tips-txt" v-if="type=='user'">{{list.person_max_count}}1</text> <text class="box-tips-txt"
<text class="box-tips-txt" v-if="type=='team'">{{list.team_min_count}}{{list.team_max_count}}</text> v-if="type=='user'">每单限购{{list.person_max_count}}同一身份证当天限购1张</text>
<text class="box-tips-txt"
v-if="type=='team'">{{list.team_min_count}}人以上可团体预约一个团体最多{{list.team_max_count}}</text>
</view> </view>
<view class="box-visitor"> <view class="box-visitor">
<block v-for="(item,index) in form.details_list" :key="index"> <block v-for="(item,index) in form.details_list" :key="index">
@ -186,7 +189,7 @@
isEdit: false, isEdit: false,
isEditIndex: 0, isEditIndex: 0,
showInfo: false, showInfo: false,
list:{}, list: {},
form: { form: {
unit: "", unit: "",
leader: "", leader: "",
@ -194,7 +197,7 @@
idcard: "", idcard: "",
total: 1, total: 1,
type: "", type: "",
mobile:"", mobile: "",
details_list: [] details_list: []
}, },
formUser: { formUser: {
@ -247,12 +250,12 @@
this.form.activity_id = parseInt(options.activity_id); this.form.activity_id = parseInt(options.activity_id);
var that = this; var that = this;
wx.getStorage({ wx.getStorage({
key: 'activityinfo', key: 'activityinfo',
success (res) { success(res) {
that.list = res.data that.list = res.data
} }
}) })
console.log(this.list) console.log(this.list)
that.util.getUserInfo(function(r) { that.util.getUserInfo(function(r) {
that.form.mobile = r.mobile; that.form.mobile = r.mobile;
@ -310,7 +313,7 @@
}) })
return false; return false;
} }
if (!uni.$u.test.idCard(that.formUser.idcard)) { if (!that.util.isValidCardID(that.formUser.idcard)) {
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
title: "请正确输入身份证号" title: "请正确输入身份证号"
@ -416,7 +419,7 @@
} }
if (this.form.card_type == 1) { if (this.form.card_type == 1) {
if (!uni.$u.test.idCard(this.form.idcard)) { if (!this.util.isValidCardID(this.form.idcard)) {
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
title: "请正确输入身份证号" title: "请正确输入身份证号"
@ -478,6 +481,7 @@
<style> <style>
@import url("@/static/css/bookbox.css"); @import url("@/static/css/bookbox.css");
@import url("@/static/css/activitybox.css"); @import url("@/static/css/activitybox.css");
.box-visitor-item { .box-visitor-item {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;

@ -20,7 +20,7 @@
<view class="tag tag_green"> <view class="tag tag_green">
<text>{{isUnde(item.target_name)}}</text> <text>{{isUnde(item.target_name)}}</text>
</view> </view>
<view v-if="item.rate_name=='进行中'" class="activityBox-btn tag"> <view class="tag" :class="{activityBox_btn:item.isCanBook}">
<text>立即报名</text> <text>立即报名</text>
</view> </view>
</view> </view>
@ -90,24 +90,26 @@
}) })
}, },
openInfo(obj) { openInfo(obj) {
if (obj.rate_name == "进行中")
uni.navigateTo({
url: "info?id=" + obj.id
})
else {
this.util.toast("当前选择活动" + obj.rate_name + "不可报名");
} uni.navigateTo({
url: "info?id=" + obj.id
})
}, },
loadActivity() { loadActivity() {
var that = this; var that = this;
var nt = new Date();
this.util.request({ this.util.request({
api: '/api/mobile/activity/index', api: '/api/mobile/activity/index',
data: { data: {
latitude: that.latitude, latitude: that.latitude,
longitude: that.longitude longitude: that.longitude,
page_size: 100
}, },
utilSuccess: function(res) { utilSuccess: function(res) {
for (var mod of res.data) {
mod.isCanBook = that.$moment(nt).isBefore(mod.end_plan);
}
that.list = res.data; that.list = res.data;
}, },
utilFail: function(res) { utilFail: function(res) {

@ -5,7 +5,8 @@
<view class="activityBox-top"> <view class="activityBox-top">
<!-- <image src="../../static/img/img_activity.jpg" style="width: 100%;height: 333rpx;"></image> --> <!-- <image src="../../static/img/img_activity.jpg" style="width: 100%;height: 333rpx;"></image> -->
<swiper autoplay="true" :interval="4000" :duration="1000" :indicator-dots="true" <swiper autoplay="true" :interval="4000" :duration="1000" :indicator-dots="true"
indicator-active-color="rgba(255, 255, 255, 0.7)" indicator-color="rgba(239, 149, 37, 1)" :current="topSwiperIndex" @change="topSwiperTab"> indicator-active-color="rgba(255, 255, 255, 0.7)" indicator-color="rgba(239, 149, 37, 1)"
:current="topSwiperIndex" @change="topSwiperTab">
<swiper-item v-for="(item,index) in list.banners" :key="index"> <swiper-item v-for="(item,index) in list.banners" :key="index">
<view class="swiper-item"> <view class="swiper-item">
<image :src="item.upload.url" mode="aspectFill"></image> <image :src="item.upload.url" mode="aspectFill"></image>
@ -48,7 +49,7 @@
</view> </view>
</view> </view>
<view class="colortext activityBox-row" v-if="list.status==1"> <view class="colortext activityBox-row" v-if="list.status==1">
{{list.status==0?"已结束":"活动进行中"}} (已报名{{list.orders_total}}) {{list.rate_name}} (已报名{{list.orders_total}})
</view> </view>
@ -62,7 +63,7 @@
<rich-text :nodes="list.content"></rich-text> <rich-text :nodes="list.content"></rich-text>
</view> </view>
</view> </view>
<view class="infofooter flex-row" v-if="list.status!=0"> <view class="infofooter flex-row" v-if="list.isCanBook">
<view style="margin-right: 14rpx;flex: 1;"> <view style="margin-right: 14rpx;flex: 1;">
<u-button type="primary" @click="tobook('team')"></u-button> <u-button type="primary" @click="tobook('team')"></u-button>
</view> </view>
@ -78,21 +79,21 @@
export default { export default {
data() { data() {
return { return {
id:"", id: "",
latitude:"", latitude: "",
longitude:"", longitude: "",
list:{}, list: {},
topSwiperIndex: 0, topSwiperIndex: 0,
} }
}, },
onLoad(options){ onLoad(options) {
var that = this; var that = this;
that.id=options.id; that.id = options.id;
wx.getLocation({ wx.getLocation({
success(res) { success(res) {
console.log(res) console.log(res)
that.latitude=res.latitude; that.latitude = res.latitude;
that.longitude=res.longitude; that.longitude = res.longitude;
that.loadActiveInfo() that.loadActiveInfo()
} }
}) })
@ -110,25 +111,27 @@
tobook(type) { tobook(type) {
uni.navigateTo({ uni.navigateTo({
url: "book?type=" + type + "&activity_id="+this.id url: "book?type=" + type + "&activity_id=" + this.id
}) })
}, },
loadActiveInfo(){ loadActiveInfo() {
var that = this; var that = this;
var nt = new Date();
this.util.request({ this.util.request({
api: '/api/mobile/activity/show', api: '/api/mobile/activity/show',
data:{ data: {
id:that.id, id: that.id,
latitude:that.latitude, latitude: that.latitude,
longitude:that.longitude longitude: that.longitude
}, },
utilSuccess: function(res) { utilSuccess: function(res) {
res.isCanBook = that.$moment(nt).isBefore(res.end_plan);
that.list = res; that.list = res;
that.list.end_time = that.$moment(res.end_time).format("HH:mm") that.list.end_time = that.$moment(res.end_time).format("HH:mm");
wx.setStorage({ wx.setStorage({
key: 'activityinfo', key: 'activityinfo',
data: res, data: res,
success: ()=> { success: () => {
console.log('存储成功'); console.log('存储成功');
} }
}) })
@ -142,10 +145,10 @@
var that = this; var that = this;
this.topSwiperIndex = Number(e.target.current); this.topSwiperIndex = Number(e.target.current);
}, },
isUnde(val){ isUnde(val) {
if(val){ if (val) {
return val return val
}else{ } else {
return "" return ""
} }
} }
@ -193,14 +196,17 @@
padding: 22rpx 25rpx; padding: 22rpx 25rpx;
box-sizing: border-box; box-sizing: border-box;
} }
swiper{
height:333rpx swiper {
height: 333rpx
} }
swiper image{
width:100%; swiper image {
height:333rpx; width: 100%;
height: 333rpx;
} }
.colortext{
color:#D98012 .colortext {
color: #D98012
} }
</style> </style>

@ -253,10 +253,7 @@
var nt = this.$moment().format("yyyy-MM-DD"); var nt = this.$moment().format("yyyy-MM-DD");
let list = this.listDatePrice; let list = this.listDatePrice;
let cdate = list[index]; let cdate = list[index];
if (nt == cdate.date) {
this.util.toast("请提前一天预约");
return;
}
if (cdate.is_open === 0) { if (cdate.is_open === 0) {
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
@ -401,7 +398,7 @@
var that = this; var that = this;
that.listDatePrice = []; that.listDatePrice = [];
var edate = this.$moment(sdate).add('days', 2).format("yyyy-MM-DD"); var edate = this.$moment(sdate).add('days', 2).format("yyyy-MM-DD");
var ndate = this.$moment(sdate).add('days', 1).format("yyyy-MM-DD") var ndate = this.$moment(sdate).add('days', 0).format("yyyy-MM-DD")
var nt = this.$moment().format("yyyy-MM-DD"); var nt = this.$moment().format("yyyy-MM-DD");
var mt = this.$moment().add('days', 1).format("yyyy-MM-DD"); var mt = this.$moment().add('days', 1).format("yyyy-MM-DD");
var ht = this.$moment().add('days', 2).format("yyyy-MM-DD"); var ht = this.$moment().add('days', 2).format("yyyy-MM-DD");

@ -10,7 +10,7 @@
<view class="orderBoxInfoRow flex-row" style="margin-bottom: 20rpx;"> <view class="orderBoxInfoRow flex-row" style="margin-bottom: 20rpx;">
<text class="iconfont icon-youkexuzhi"></text> <text class="iconfont icon-youkexuzhi"></text>
<text <text
class="orderBoxInfoRowTxt">订单信息{{$u.timeFormat(new Date(info.activity.start_time), 'mm月dd日')}} {{getHm(info.activity.start_time)}}-{{getHm(info.activity.end_time)}}{{info.total}}观众</text> class="orderBoxInfoRowTxt">订单信息{{$u.timeFormat(new Date(info.activity.start_time), 'mm月dd日')}}{{getHm(info.activity.start_time)}}-{{getHm(info.activity.end_time)}}{{info.total}}人员</text>
</view> </view>
<view class="orderBoxInfoRow flex-row"> <view class="orderBoxInfoRow flex-row">
<text class="iconfont icon-iconfontgerenzhongxin"></text> <text class="iconfont icon-iconfontgerenzhongxin"></text>
@ -45,7 +45,7 @@
<view class="orderBoxList p0"> <view class="orderBoxList p0">
<view class="orderBox"> <view class="orderBox">
<view class="orderBoxTitle flex-row" style="justify-content: space-between;"> <view class="orderBoxTitle flex-row" style="justify-content: space-between;">
<text class="orderBoxTitleTxt">观众信息</text> <text class="orderBoxTitleTxt">参与人员信息</text>
<text v-if="false" :class="isuse?'share shareuse orderBoxInfoRowTxt':'share orderBoxInfoRowTxt'"> <text v-if="false" :class="isuse?'share shareuse orderBoxInfoRowTxt':'share orderBoxInfoRowTxt'">
分享二维码 分享二维码
</text> </text>
@ -64,16 +64,6 @@
</view> </view>
</view> </view>
</view> </view>
<view class="orderBoxList p0">
<view class="orderBoxTitle flex-row">
<text class="stars orderBoxTitleTxt">*</text>
<text class="orderBoxTitleTxt">参与须知</text>
</view>
<view class="orderBoxTitle flex-row">
<text
class="orderBoxInfoRowTxt">预约时需要个人姓名联系方式和参观时间等信息预约成功后生成预约二维码可于个人中心查看当天凭有效身份证件或预约二维码核销入场</text>
</view>
</view>
</view> </view>
</template> </template>

@ -630,13 +630,7 @@
var nt = this.$moment().format("yyyy-MM-DD"); var nt = this.$moment().format("yyyy-MM-DD");
let list = this.listDatePrice; let list = this.listDatePrice;
let cdate = list[index]; let cdate = list[index];
if (nt == cdate.date) {
uni.showToast({
icon: "none",
title: "请提前一天预约"
})
return;
}
if (cdate.is_open === 0) { if (cdate.is_open === 0) {
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
@ -682,7 +676,7 @@
var that = this; var that = this;
that.listDatePrice = []; that.listDatePrice = [];
var edate = this.$moment(sdate).add('days', 2).format("yyyy-MM-DD"); var edate = this.$moment(sdate).add('days', 2).format("yyyy-MM-DD");
var ndate = this.$moment(sdate).add('days', 1).format("yyyy-MM-DD") var ndate = this.$moment(sdate).add('days', 0).format("yyyy-MM-DD")
var nt = this.$moment().format("yyyy-MM-DD"); var nt = this.$moment().format("yyyy-MM-DD");
var mt = this.$moment().add('days', 1).format("yyyy-MM-DD"); var mt = this.$moment().add('days', 1).format("yyyy-MM-DD");
var ht = this.$moment().add('days', 2).format("yyyy-MM-DD"); var ht = this.$moment().add('days', 2).format("yyyy-MM-DD");

@ -1,107 +1,106 @@
.tomap {
.tomap { width: 34rpx;
width: 34rpx; height: 34rpx;
height: 34rpx; background: rgba(242, 214, 188, .4);
background: rgba(242, 214, 188, .4); border-radius: 50%;
border-radius: 50%; display: flex;
display: flex; justify-content: center;
justify-content: center; align-items: center;
align-items: center; align-content: center;
align-content: center; margin-left: 30rpx;
margin-left: 30rpx; }
}
.iconfont {
.iconfont { color: #6EAC97;
color: #6EAC97; font-size: 24rpx;
font-size: 24rpx; margin-right: 19rpx;
margin-right: 19rpx; }
}
.icon-ditu-dibiao {
.icon-ditu-dibiao { color: #787BA2;
color: #787BA2; }
}
.tag {
.tag { height: 37rpx;
height: 37rpx; background: #ccc;
background: #6EAC97; border-radius: 8rpx;
border-radius: 8rpx; padding: 7rpx 16rpx;
padding: 7rpx 16rpx; font-size: 24rpx;
font-size: 24rpx; font-family: PingFang SC;
font-family: PingFang SC; font-weight: 400;
font-weight: 400; color: #FFFFFF;
color: #FFFFFF; }
}
.activityBox-row {
.activityBox-row { font-size: 24rpx;
font-size: 24rpx; font-family: PingFang SC;
font-family: PingFang SC; font-weight: 400;
font-weight: 400; color: #828282;
color: #828282; margin-bottom: 15rpx;
margin-bottom: 15rpx; }
}
.activityBox_btn {
.activityBox-btn {
background: #EF9525;
background: #EF9525; }
}
.activityBox {
.activityBox { background-color: #ffffff;
background-color: #ffffff; margin-bottom: 26rpx;
margin-bottom: 26rpx; }
}
.activityBox-title {
.activityBox-title { flex: 1;
flex: 1; font-size: 28rpx;
font-size: 28rpx; font-family: PingFang SC;
font-family: PingFang SC; font-weight: 400;
font-weight: 400; color: #4E4E4E;
color: #4E4E4E; }
}
.activityBox-content {
.activityBox-content { padding: 31rpx 24rpx;
padding: 31rpx 24rpx; box-sizing: border-box;
box-sizing: border-box; }
}
.activityBox-top {
.activityBox-top { position: relative;
position: relative;
}
}
.book-status {
.book-status { background: url("@/static/img/status_bg.png") no-repeat;
background: url("@/static/img/status_bg.png") no-repeat; background-size: cover;
background-size: cover; width: 255rpx;
width: 255rpx; height: 48rpx;
height: 48rpx; position: absolute;
position: absolute; margin-left: -127.5rpx;
margin-left: -127.5rpx; left: 50%;
left: 50%; top: 142.5rpx;
top: 142.5rpx; text-align: center;
text-align: center; font-size: 28rpx;
font-size: 28rpx; font-family: PingFang SC;
font-family: PingFang SC; font-weight: 400;
font-weight: 400; color: #FFFFFF;
color: #FFFFFF; line-height: 48rpx;
line-height: 48rpx; }
}
.book-num {
.book-num { background: #FFFFFF;
background: #FFFFFF; opacity: 0.85;
opacity: 0.85; position: absolute;
position: absolute; right: 0;
right: 0; bottom: 21rpx;
bottom: 21rpx; padding: 12rpx 34rpx;
padding: 12rpx 34rpx; border-top-left-radius: 53rpx;
border-top-left-radius: 53rpx; border-bottom-left-radius: 53rpx;
border-bottom-left-radius: 53rpx; font-size: 20rpx;
font-size: 20rpx; color: #4E4E4E;
color: #4E4E4E; }
}
.book-num-y {
.book-num-y { color: #D98012;
color: #D98012; font-size: 34rpx;
font-size: 34rpx; }
}

Loading…
Cancel
Save