常用人预约

dev
lion 4 years ago
parent c227e83911
commit f57f65bccf

@ -60,6 +60,35 @@
<text class="box-tips-txt"
v-if="type=='team'">{{list.team_min_count}}人以上可团体预约一个团体最多{{list.team_max_count}}</text>
</view>
<view>
<view class="box-card-content">
<view class="book-box" style="padding-top: 20rpx;">
<view class="book-box-card">
<view class="book-box-title">
常用人
</view>
<view class="">
<view class="book-box-timerow">
<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 v-if="item.checked" class="book-box-row-timeitem-status">
<u-icon name="checkmark" color="#fff" size="20rpx" v-if="item.checked">
</u-icon>
</view>
<view>{{item.name}}</view>
<!-- <view>{{item.datef}}</view> -->
</view>
</block>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="box-visitor">
<block v-for="(item,index) in form.details_list" :key="index">
<view class="box-visitor-item">
@ -190,6 +219,7 @@
isEditIndex: 0,
showInfo: false,
list: {},
common_user:[],
form: {
unit: "",
leader: "",
@ -208,6 +238,7 @@
},
type: "user",
rules: [],
details_rule: {
name: [{
required: true,
@ -265,8 +296,40 @@
that.util.getUserInfo(function(r) {
that.form.mobile = r.mobile;
}, true);
that.loadCommonUser()
},
methods: {
loadCommonUser(){
var that = this;
this.util.request({
api: '/api/mobile/activity/address-book',
utilSuccess: function(res) {
for(var m of res){
m.checked = false
}
that.common_user = res;
},
utilFail: function(res) {
}
})
},
handleCommonUser(obj){
obj.checked = !obj.checked
if(obj.checked){
this.form.details_list.push(obj)
}else{
for(var i=0;i<this.form.details_list.length;i++){
if(this.form.details_list[i].name==obj.name){
this.form.details_list.splice(i,1)
}
}
}
},
tothere() {
uni.openLocation({
latitude: parseFloat(this.list.latitude),
@ -290,6 +353,11 @@
this.showAdd = true
},
delUser(index) {
for(var i=0;i<this.common_user.length;i++){
if(this.form.details_list[index].name == this.common_user[i].name){
this.common_user[i].checked = false;
}
}
this.form.details_list.splice(index, 1);
},
closeInfo() {
@ -588,6 +656,10 @@
padding-bottom: 25rpx;
border-bottom: 2px solid #F7F6F4;
}
.book-box-row-timeitem {
width:160rpx;
text-align: center;
}
.box-card-content {}
</style>

@ -90,6 +90,35 @@
<text class="box-tips-txt"
v-if="type=='team'">{{minCount}}人以上可团体预约一个团体最多{{maxCount}}</text>
</view>
<view class="commonuser">
<view class="box-card-content">
<view class="book-box" style="padding-top: 20rpx;">
<view class="book-box-card">
<view class="book-box-title">
常用人
</view>
<view class="">
<view class="book-box-timerow">
<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 v-if="item.checked" class="book-box-row-timeitem-status">
<u-icon name="checkmark" color="#fff" size="20rpx" v-if="item.checked">
</u-icon>
</view>
<view>{{item.name}}</view>
<!-- <view>{{item.datef}}</view> -->
</view>
</block>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="box-visitor">
<block v-for="(item,index) in form.details_list" :key="index">
<view class="box-visitor-item">
@ -259,6 +288,7 @@
}],
specialtype:false,
specialid:0,
common_user:[],
form: {
date: "",
rule_id: "",
@ -357,6 +387,8 @@
that.form.mobile = r.mobile;
}, true);
that.loadCommonUser();
},
methods: {
@ -371,6 +403,38 @@
// if(this.$refs.radio.currentValue){
// this.specialtype = val;
// }
},
loadCommonUser(){
var that = this;
this.util.request({
api: '/api/mobile/visit/address-book',
utilSuccess: function(res) {
for(var m of res){
m.checked = false
}
that.common_user = res;
console.log(that.common_user)
},
utilFail: function(res) {
}
})
},
handleCommonUser(obj){
obj.checked = !obj.checked
if(obj.checked){
this.form.details_list.push(obj)
}else{
for(var i=0;i<this.form.details_list.length;i++){
if(this.form.details_list[i].name==obj.name){
this.form.details_list.splice(i,1)
}
}
}
},
loadConfig() {
@ -419,6 +483,8 @@
this.currentNotice = this.notice[type];
},
submitOrder() {
console.log(this.form);
this.form.date = this.currentDate.date;
this.form.rule_id = this.currentTime.id;
if(this.specialid){
@ -673,6 +739,7 @@
}
return day
},
handleDate(index) {
var nt = this.$moment().format("yyyy-MM-DD");
let list = this.listDatePrice;
@ -829,6 +896,11 @@
this.showAdd = true
},
delUser(index) {
for(var i=0;i<this.common_user.length;i++){
if(this.form.details_list[index].name == this.common_user[i].name){
this.common_user[i].checked = false;
}
}
this.form.details_list.splice(index, 1);
}
}
@ -945,6 +1017,10 @@
padding-bottom: 25rpx;
border-bottom: 2px solid #F7F6F4;
}
.commonuser .book-box-row-timeitem{
width:160rpx;
text-align: center;
}
.box-card-content {}
</style>

Loading…
Cancel
Save