刘翔宇-旅管家 3 years ago
parent 518b437958
commit db2aef8968

@ -15,7 +15,8 @@
<view class="activityBox-row"> <view class="activityBox-row">
<text class="icon-shijian iconfont"></text> <text class="icon-shijian iconfont"></text>
<text>活动时间{{timeFormat(list.start_time,"yyyy年MM月DD日")}} {{getHm(list.start_time)}}-{{getHm(list.end_time)}}</text> <text>活动时间{{timeFormat(list.start_time,"yyyy年MM月DD日")}}
{{getHm(list.start_time)}}-{{getHm(list.end_time)}}</text>
</view> </view>
<!-- <view class="activityBox-row"> <!-- <view class="activityBox-row">
@ -59,35 +60,38 @@
v-if="type=='user'">每单限购{{list.person_max_count}}同一身份证当天限购1张</text> 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=='team'">{{list.team_min_count}}人以上可团体预约一个团体最多{{list.team_max_count}}</text>
</view> </view>
<view> <view>
<view class="box-card-content"> <view class="box-card-content">
<view class="book-box" style="padding-top: 20rpx;"> <view class="book-box" style="padding-top: 20rpx;">
<view class="book-box-card"> <view class="book-box-card">
<view class="book-box-title"> <view class="book-box-title">
常用人 常用人
</view> </view>
<view class=""> <view class="">
<view class="book-box-timerow"> <view class="book-box-timerow">
<block v-for="(item,index) in common_user" :key="index"> <block v-for="(item,index) in common_user" :key="index">
<view class="book-box-row-timeitem" :class="{'book-box-row-timeitem-on':item.checked}" @click="handleCommonUser(item)"> <view class="book-box-row-timeitem"
<view v-if="item.checked" class="book-box-row-timeitem-status"> :class="{'book-box-row-timeitem-on':item.checked}"
<u-icon name="checkmark" color="#fff" size="20rpx" v-if="item.checked"> @click="handleCommonUser(item)">
</u-icon> <view v-if="item.checked" class="book-box-row-timeitem-status">
</view> <u-icon name="checkmark" color="#fff" size="20rpx"
<view>{{item.name}}</view> v-if="item.checked">
<!-- <view>{{item.datef}}</view> --> </u-icon>
</view> </view>
</block> <view>{{item.name}}</view>
</view> <!-- <view>{{item.datef}}</view> -->
</view>
</view> </block>
</view> </view>
</view> </view>
</view>
</view>
</view>
</view>
</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">
@ -149,9 +153,10 @@
<u-radio width="50%" activeColor="#EF9525" v-for="(item, index) in cardType" <u-radio width="50%" activeColor="#EF9525" v-for="(item, index) in cardType"
:key="index" :name=item.id :label="item.name"> :key="index" :name=item.id :label="item.name">
</u-radio> </u-radio>
</u-radio-group> --> </u-radio-group> -->
<u-cell-group :border="false"> <u-cell-group :border="false">
<u-cell @click="showCards" :title="card_type_names" :isLink="true" arrow-direction="down"></u-cell> <u-cell @click="showCards" :title="card_type_names" :isLink="true"
arrow-direction="down"></u-cell>
</u-cell-group> </u-cell-group>
</u-form-item> </u-form-item>
<u-form-item label="证件号码" labelWidth="80" prop="from.idcard" required> <u-form-item label="证件号码" labelWidth="80" prop="from.idcard" required>
@ -184,9 +189,10 @@
<u-radio width="50%" activeColor="#EF9525" v-for="(item, index) in cardType" <u-radio width="50%" activeColor="#EF9525" v-for="(item, index) in cardType"
:key="index" :name=item.id :label="item.name"> :key="index" :name=item.id :label="item.name">
</u-radio> </u-radio>
</u-radio-group> --> </u-radio-group> -->
<u-cell-group :border="false"> <u-cell-group :border="false">
<u-cell @click="showCard" :title="card_type_name" :isLink="true" arrow-direction="down"></u-cell> <u-cell @click="showCard" :title="card_type_name" :isLink="true" arrow-direction="down">
</u-cell>
</u-cell-group> </u-cell-group>
</u-form-item> </u-form-item>
<u-form-item label="证件号码" labelWidth="80" prop="formUser.idcard" ref="formUser.idcard" required> <u-form-item label="证件号码" labelWidth="80" prop="formUser.idcard" ref="formUser.idcard" required>
@ -199,11 +205,13 @@
<u-button type="primary" @click="handleAddUser"></u-button> <u-button type="primary" @click="handleAddUser"></u-button>
</view> </view>
</view> </view>
</u-popup> </u-popup>
<u-picker :show="cardshow" @cancel="cancel" @confirm="confirmCard" ref="uPicker" :columns="cardLists" keyName="label"></u-picker> <u-picker :show="cardshow" @cancel="cancel" @confirm="confirmCard" ref="uPicker" :columns="cardLists"
<u-picker :show="cardshows" @cancel="cancels" @confirm="confirmCards" ref="uPickers" :columns="cardLists" keyName="label"></u-picker> keyName="label"></u-picker>
<u-picker :show="cardshows" @cancel="cancels" @confirm="confirmCards" ref="uPickers" :columns="cardLists"
keyName="label"></u-picker>
<u-popup :show="showInfo" mode="bottom" @close="closeInfo" :round="10" closeable> <u-popup :show="showInfo" mode="bottom" @close="closeInfo" :round="10" closeable>
<view class="mpopup"> <view class="mpopup">
@ -216,18 +224,20 @@
<u-button type="primary" @click="closeInfo"></u-button> <u-button type="primary" @click="closeInfo"></u-button>
</view> </view>
</view> </view>
</u-popup> </u-popup>
<u-popup :show="successshow" customStyle="width:600rpx;height:300rpx;text-align:center" :round="10" mode="center" width="600rpx" height="150rpx"> <u-popup :show="successshow" customStyle="width:600rpx;height:300rpx;text-align:center" :round="10"
<view class=""> mode="center" width="600rpx" height="150rpx">
<view class="successBox"> <view class="">
<!-- <u-icon name="checkmark-circle" size="90" color="#EF9525"></u-icon> --> <view class="successBox">
<view class="h3">您已经预约成功</view> <!-- <u-icon name="checkmark-circle" size="90" color="#EF9525"></u-icon> -->
<view class="p">即将跳转到活动预约 {{time}} s</view> <view class="h3">您已经预约成功</view>
</view> <view class="p">报名成功后具体事宜请联系金老师65166121</view>
<view class="pinkBtn" @click="goHome"></view> <view class="p">即将跳转到活动预约 {{time}} s</view>
</view> </view>
<view class="pinkBtn" @click="goHome"></view>
</view>
</u-popup> </u-popup>
</view> </view>
</template> </template>
@ -235,15 +245,15 @@
<script> <script>
export default { export default {
data() { data() {
return { return {
successshow: false, successshow: false,
time:3, time: 3,
showAdd: false, showAdd: false,
isEdit: false, isEdit: false,
isEditIndex: 0, isEditIndex: 0,
showInfo: false, showInfo: false,
list: {}, list: {},
common_user:[], common_user: [],
form: { form: {
unit: "", unit: "",
leader: "", leader: "",
@ -261,9 +271,9 @@
mobile: "" mobile: ""
}, },
type: "user", type: "user",
rules: [], rules: [],
t:null, t: null,
timer:null, timer: null,
details_rule: { details_rule: {
name: [{ name: [{
required: true, required: true,
@ -281,32 +291,34 @@
trigger: 'change' trigger: 'change'
}] }]
}, },
cardshow:false, cardshow: false,
cardshows:false, cardshows: false,
card_type_name:"身份证", card_type_name: "身份证",
card_type_names:"身份证", card_type_names: "身份证",
// cardLists:['','','','',''], // cardLists:['','','','',''],
cardLists: [[{ cardLists: [
value: 1, [{
label: '身份证' value: 1,
}, label: '身份证'
{ },
value: 2, {
label: '港澳台居民居住证' value: 2,
}, label: '港澳台居民居住证'
{ },
value: 3, {
label: '护照' value: 3,
}, label: '护照'
{ },
value: 4, {
label: '台胞证' value: 4,
}, label: '台胞证'
{ },
value: 5, {
label: '港澳证' value: 5,
} label: '港澳证'
]], }
]
],
currentNotice: {}, currentNotice: {},
notice: [{ notice: [{
title: "预约须知", title: "预约须知",
@ -325,29 +337,29 @@
wx.getStorage({ wx.getStorage({
key: 'activityinfo', key: 'activityinfo',
success(res) { success(res) {
that.list = res.data; that.list = res.data;
if(that.form.type==2){ if (that.form.type == 2) {
that.form.total = 1 that.form.total = 1
}else if(that.form.type==1){ } else if (that.form.type == 1) {
that.form.total = res.data.team_min_count; that.form.total = res.data.team_min_count;
} }
} }
}) })
that.util.getUserInfo(function(r) { that.util.getUserInfo(function(r) {
that.form.mobile = r.mobile; that.form.mobile = r.mobile;
}, true); }, true);
that.loadCommonUser() that.loadCommonUser()
}, },
onHide() { onHide() {
clearInterval(this.t) clearInterval(this.t)
clearTimeout(this.timer) clearTimeout(this.timer)
}, },
onUnload() { onUnload() {
clearInterval(this.t) clearInterval(this.t)
clearTimeout(this.timer) clearTimeout(this.timer)
}, },
methods: { methods: {
getHm(val) { getHm(val) {
@ -357,64 +369,64 @@
}, },
timeFormat(val, format) { timeFormat(val, format) {
return this.$moment(val).format(format) return this.$moment(val).format(format)
}, },
confirmCards(e){ confirmCards(e) {
this.card_type_names = e.value[0].label this.card_type_names = e.value[0].label
this.form.card_type = e.value[0].value this.form.card_type = e.value[0].value
this.cardshows = false this.cardshows = false
}, },
cancel(){ cancel() {
this.cardshow = false this.cardshow = false
}, },
cancels(){ cancels() {
this.cardshows = false this.cardshows = false
}, },
showCards(){ showCards() {
this.cardshows = true this.cardshows = true
}, },
confirmCard(e){ confirmCard(e) {
this.card_type_name = e.value[0].label this.card_type_name = e.value[0].label
this.formUser.card_type = e.value[0].value this.formUser.card_type = e.value[0].value
this.cardshow = false this.cardshow = false
}, },
showCard(){ showCard() {
this.cardshow = true this.cardshow = true
}, },
goHome(){ goHome() {
uni.switchTab({ uni.switchTab({
url: "/pages/index/index" url: "/pages/index/index"
}) })
}, },
loadCommonUser(){ loadCommonUser() {
var that = this; var that = this;
this.util.request({ this.util.request({
api: '/api/mobile/activity/address-book', api: '/api/mobile/activity/address-book',
utilSuccess: function(res) { utilSuccess: function(res) {
for(var m of res){ for (var m of res) {
m.checked = false m.checked = false
} }
that.common_user = res; that.common_user = res;
}, },
utilFail: function(res) { utilFail: function(res) {
} }
}) })
}, },
handleCommonUser(obj){ handleCommonUser(obj) {
obj.checked = !obj.checked obj.checked = !obj.checked
if(obj.checked){ if (obj.checked) {
this.form.details_list.push(obj) this.form.details_list.push(obj)
}else{ } else {
for(var i=0;i<this.form.details_list.length;i++){ for (var i = 0; i < this.form.details_list.length; i++) {
if(this.form.details_list[i].name==obj.name){ if (this.form.details_list[i].name == obj.name) {
this.form.details_list.splice(i,1) this.form.details_list.splice(i, 1)
} }
} }
} }
}, },
tothere() { tothere() {
uni.openLocation({ uni.openLocation({
@ -438,11 +450,11 @@
} }
this.showAdd = true this.showAdd = true
}, },
delUser(index) { delUser(index) {
for(var i=0;i<this.common_user.length;i++){ for (var i = 0; i < this.common_user.length; i++) {
if(this.form.details_list[index].name == this.common_user[i].name){ if (this.form.details_list[index].name == this.common_user[i].name) {
this.common_user[i].checked = false; this.common_user[i].checked = false;
} }
} }
this.form.details_list.splice(index, 1); this.form.details_list.splice(index, 1);
}, },
@ -612,29 +624,19 @@
api: '/api/mobile/activity/order', api: '/api/mobile/activity/order',
method: "POST", method: "POST",
data: this.form, data: this.form,
utilSuccess: function(res) { utilSuccess: function(res) {
that.successshow = true; that.successshow = true;
that.t = setInterval(function() { that.t = setInterval(function() {
if (that.time > 0) if (that.time > 0)
that.time = that.time - 1; that.time = that.time - 1;
}, 1000) }, 1000)
that.timer = setTimeout(function() { that.timer = setTimeout(function() {
uni.redirectTo({ uni.redirectTo({
url: '/pages/order/activityorder' url: '/pages/order/activityorder'
}) })
clearInterval(that.t); clearInterval(that.t);
clearTimeout(that.timer) clearTimeout(that.timer)
}, 3000) }, 3000)
// uni.showToast({
// icon: "none",
// title: "",
// complete() {
// uni.redirectTo({
// url: "/pages/success/success?from=activity&id=" + res.id
// })
// }
// })
}, },
utilFail: function(res) { utilFail: function(res) {
uni.showToast({ uni.showToast({
@ -754,52 +756,56 @@
color: #351C1B; color: #351C1B;
padding-bottom: 25rpx; padding-bottom: 25rpx;
border-bottom: 2px solid #F7F6F4; border-bottom: 2px solid #F7F6F4;
}
.book-box-row-timeitem {
width:160rpx;
text-align: center;
} }
.box-card-content {} .book-box-row-timeitem {
.successBox { width: 160rpx;
text-align: center;
.iconfont { }
color: #00CCB9;
font-size: 180rpx; .box-card-content {}
}
.successBox {
.h3 {
font-size: 40rpx; .iconfont {
font-weight: 500; color: #00CCB9;
color: #333333; font-size: 180rpx;
margin-top: 40rpx; }
}
.h3 {
.p { font-size: 40rpx;
font-size: 28rpx; font-weight: 500;
font-weight: 400; color: #333333;
color: #333333; margin-top: 40rpx;
margin-top: 24rpx; }
}
.p {
} font-size: 28rpx;
font-weight: 400;
.pinkBtn { color: #333333;
width: 50%; margin-top: 24rpx;
background-image: linear-gradient(45deg, #EF9525 0%, #EF9525 100%); }
border-radius: 44rpx;
font-size: 30rpx; }
font-weight: 500;
color: #FFFFFF; .pinkBtn {
text-align: center; width: 50%;
line-height: 70rpx; background-image: linear-gradient(45deg, #EF9525 0%, #EF9525 100%);
margin:30rpx auto; border-radius: 44rpx;
} font-size: 30rpx;
.u-radio-group{ font-weight: 500;
flex-wrap: wrap; color: #FFFFFF;
} text-align: center;
.u-radio-group .u-radio{ line-height: 70rpx;
margin-bottom:10rpx; margin: 30rpx auto;
margin-right:10rpx }
.u-radio-group {
flex-wrap: wrap;
}
.u-radio-group .u-radio {
margin-bottom: 10rpx;
margin-right: 10rpx
} }
</style> </style>

@ -100,6 +100,13 @@
}) })
}, },
onShareAppMessage() {
return {
title: this.list.name,
path: "/pages/activity/info?id=" + this.list.id,
imageUrl: this.list.cover_upload.url
}
},
methods: { methods: {
timeFormat(val, format) { timeFormat(val, format) {
return this.$moment(val).format(format) return this.$moment(val).format(format)

@ -88,13 +88,17 @@
<view class="book-box-row-timeitem-txt">{{item.start_time+'-'+item.end_time}}</view> <view class="book-box-row-timeitem-txt">{{item.start_time+'-'+item.end_time}}</view>
<block v-if="item.isCanbook"> <block v-if="item.isCanbook">
<view class="book-box-row-timeitem-txt" v-if="item.remain_count>0"> <view class="book-box-row-timeitem-txt"
v-if="item.remain_count>0&&item.remain_count<=50">
{{item.remain_count}} {{item.remain_count}}
</view> </view>
<view class="book-box-row-timeitem-txt" v-else-if="item.remain_count>50">
余票充足
</view>
<view class="book-box-row-timeitem-txt" v-else></view> <view class="book-box-row-timeitem-txt" v-else></view>
</block> </block>
<block v-else> <block v-else>
<view class="book-box-row-timeitem-txt" >不可预约</view> <view class="book-box-row-timeitem-txt">不可预约</view>
</block> </block>
</view> </view>
</view> </view>
@ -126,9 +130,9 @@
<view class="mpopup-title"> <view class="mpopup-title">
{{currentNotice.name}} {{currentNotice.name}}
</view> </view>
<view class="mpopup-content" style="padding: 40rpx 20rpx;"> <view class="mpopup-content" style="padding: 40rpx 20rpx;">
<view v-html="currentNotice.content" style="font-size:32rpx;line-height: 50rpx;text-indent: 2em;"> <view v-html="currentNotice.content" style="font-size:32rpx;line-height: 50rpx;text-indent: 2em;">
</view> </view>
<!-- <rich-text :nodes="currentNotice.content"></rich-text> --> <!-- <rich-text :nodes="currentNotice.content"></rich-text> -->
</view> </view>
@ -176,9 +180,9 @@
showAuthorization: false, showAuthorization: false,
openType: 1 openType: 1
} }
}, },
onShareAppMessage() { onShareAppMessage() {
return this.util.shareInfo return this.util.shareInfo
}, },
onLoad() { onLoad() {
this.loadInfo(); this.loadInfo();
@ -187,9 +191,9 @@
onReady() { onReady() {
// //
this.$refs.calendar.setFormatter(this.formatter) this.$refs.calendar.setFormatter(this.formatter)
}, },
onHide() { onHide() {
this.showBook=false; this.showBook = false;
}, },
methods: { methods: {
closePhone() { closePhone() {
@ -296,7 +300,7 @@
this.$forceUpdate(); this.$forceUpdate();
}, },
handleSelectTime(index) { handleSelectTime(index) {
var mod = this.currentDate.rules[index]; var mod = this.currentDate.rules[index];
if (!mod.isCanbook) { if (!mod.isCanbook) {
return false return false
} }
@ -322,8 +326,8 @@
}) })
}, },
openInfo(e) { openInfo(e) {
this.currentNotice = this.listNotice[e]; this.currentNotice = this.listNotice[e];
this.currentNotice.content = this.currentNotice.content.replace(/\<p/gi,"<p class='richp'"); this.currentNotice.content = this.currentNotice.content.replace(/\<p/gi, "<p class='richp'");
this.showInfo = true; this.showInfo = true;
}, },
closeInfo() { closeInfo() {
@ -583,8 +587,9 @@
.footer-img { .footer-img {
width: 421rpx; width: 421rpx;
height: 364rpx; height: 364rpx;
} }
.richp{
margin-bottom:10rpx; .richp {
margin-bottom: 10rpx;
} }
</style> </style>

@ -25,7 +25,7 @@
</view> </view>
<view class="mine-box-nav"> <view class="mine-box-nav">
<view class="mine-box-navtitle"> <view class="mine-box-navtitle">
我的预约 预约记录
</view> </view>
<view class="mine-box-navlist"> <view class="mine-box-navlist">
<view class="mine-box-navitem" @click="toPage(1)"> <view class="mine-box-navitem" @click="toPage(1)">

@ -54,9 +54,13 @@
<u-icon name="checkmark" color="#fff" size="20rpx"></u-icon> <u-icon name="checkmark" color="#fff" size="20rpx"></u-icon>
</view> </view>
<view class="book-box-row-timeitem-txt">{{item.start_time+'-'+item.end_time}}</view> <view class="book-box-row-timeitem-txt">{{item.start_time+'-'+item.end_time}}</view>
<view class="book-box-row-timeitem-txt" v-if="item.remain_count>0"> <view class="book-box-row-timeitem-txt"
v-if="item.remain_count>0&&item.remain_count<=50">
{{item.remain_count}} {{item.remain_count}}
</view> </view>
<view class="book-box-row-timeitem-txt" v-else-if="item.remain_count>50">
余票充足
</view>
<view class="book-box-row-timeitem-txt" v-else></view> <view class="book-box-row-timeitem-txt" v-else></view>
</view> </view>
</view> </view>
@ -744,9 +748,9 @@
var jsonlist = JSON.parse(res.data); var jsonlist = JSON.parse(res.data);
console.log(jsonlist); console.log(jsonlist);
_that.form.total = jsonlist.length||6; _that.form.total = jsonlist.length || 6;
for (var m of jsonlist) { for (var m of jsonlist) {
console.log("m",m); console.log("m", m);
_that.form.details_list.push({ _that.form.details_list.push({
name: m.name, name: m.name,
idcard: m.idcard, idcard: m.idcard,

Loading…
Cancel
Save