|
|
|
|
@ -5,39 +5,39 @@
|
|
|
|
|
<view class="box-card-title">
|
|
|
|
|
预约的活动
|
|
|
|
|
</view>
|
|
|
|
|
<view class="box-card-content activityBox-content">
|
|
|
|
|
<view class="activityBox-row flex-row justify-between">
|
|
|
|
|
<text class="activityBox-title">{{list.name}}</text>
|
|
|
|
|
<view class="tag tag_green">
|
|
|
|
|
<text>{{list.target_name}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="activityBox-row">
|
|
|
|
|
<text class="icon-shijian iconfont"></text>
|
|
|
|
|
<text>活动时间:{{list.start_time}}-{{list.end_time.substring(11,list.end_time.length)}}</text>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
<view class="activityBox-row">
|
|
|
|
|
<text class="icon-huodongfangshi iconfont"></text>
|
|
|
|
|
<text>活动方式:{{list.area_name}}</text>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
<view class="activityBox-row">
|
|
|
|
|
<text class="icon-huodong iconfont"></text>
|
|
|
|
|
<text>活动地址:{{list.address}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="activityBox-row">
|
|
|
|
|
<text class="icon-renshu iconfont"></text>
|
|
|
|
|
<text>人数限制:{{list.total==0?'不限':list.total}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="activityBox-row flex-row align-center">
|
|
|
|
|
<text class="icon-ditu-dibiao iconfont"></text>
|
|
|
|
|
<text>距离:{{list.distance}}km</text>
|
|
|
|
|
<view class="tomap">
|
|
|
|
|
<text class="icon-daohang1 iconfont" style="margin-right: 0;"></text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="box-card-content activityBox-content">
|
|
|
|
|
<view class="activityBox-row flex-row justify-between">
|
|
|
|
|
<text class="activityBox-title">{{list.name}}</text>
|
|
|
|
|
<view class="tag tag_green">
|
|
|
|
|
<text>{{list.target_name}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="activityBox-row">
|
|
|
|
|
<text class="icon-shijian iconfont"></text>
|
|
|
|
|
<text>活动时间:{{list.start_time}}-{{list.end_time}}</text>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
<view class="activityBox-row">
|
|
|
|
|
<text class="icon-huodongfangshi iconfont"></text>
|
|
|
|
|
<text>活动方式:{{list.area_name}}</text>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
<view class="activityBox-row">
|
|
|
|
|
<text class="icon-huodong iconfont"></text>
|
|
|
|
|
<text>活动地址:{{list.address}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="activityBox-row">
|
|
|
|
|
<text class="icon-renshu iconfont"></text>
|
|
|
|
|
<text>人数限制:{{list.total==0?'不限':list.total}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="activityBox-row flex-row align-center">
|
|
|
|
|
<text class="icon-ditu-dibiao iconfont"></text>
|
|
|
|
|
<text>距离:{{list.distance}}km</text>
|
|
|
|
|
<view class="tomap">
|
|
|
|
|
<text class="icon-daohang1 iconfont" style="margin-right: 0;"></text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
@ -50,12 +50,12 @@
|
|
|
|
|
<view class="box-card-content">
|
|
|
|
|
<u-form-item label="参观人数" labelWidth="120" prop="total" ref="total">
|
|
|
|
|
<u-number-box slot="right" v-model="form.total" inputWidth="44" color="#EF9525"
|
|
|
|
|
bgColor="#FCF6E3" :min="(type=='user'?1:8)" :max="(type=='user'?5:50)" 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-form-item>
|
|
|
|
|
<view class="box-tips">
|
|
|
|
|
<text class="box-tips-txt" v-if="type=='user'">每单限购5张,同一身份证当天限购1张</text>
|
|
|
|
|
<text class="box-tips-txt" v-if="type=='team'">8人以上可团体预约,一个团体最多50人</text>
|
|
|
|
|
<text class="box-tips-txt" 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 class="box-visitor">
|
|
|
|
|
<block v-for="(item,index) in form.details_list" :key="index">
|
|
|
|
|
@ -76,26 +76,26 @@
|
|
|
|
|
</block>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="box-footer">
|
|
|
|
|
<view class="box-footer-left">
|
|
|
|
|
<view class="box-button" @click="openAdd">
|
|
|
|
|
<u-icon name="plus" color="#EF9525"></u-icon>
|
|
|
|
|
<text class="box-button-txt">添加观众</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="box-footer-right" v-if="type=='team'">
|
|
|
|
|
<view class="box-button" @click="selectFile">
|
|
|
|
|
<u-icon name="plus" color="#EF9525"></u-icon>
|
|
|
|
|
<text class="box-button-txt">批量导入观众</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="book-box-selectInfo" v-if="type=='team'" style="width: 100%; margin-top: 20rpx;">
|
|
|
|
|
|
|
|
|
|
<view class="book-box-selectInfo-right" @click="openNoticeInfo(1)">
|
|
|
|
|
<u-icon name="question-circle-fill" color="#EF9525" size="40rpx"></u-icon>
|
|
|
|
|
<text class="book-box-selectInfo-righttxt" style="margin-left: 20rpx;">批量导入说明</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="box-footer">
|
|
|
|
|
<view class="box-footer-left">
|
|
|
|
|
<view class="box-button" @click="openAdd">
|
|
|
|
|
<u-icon name="plus" color="#EF9525"></u-icon>
|
|
|
|
|
<text class="box-button-txt">添加观众</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="box-footer-right" v-if="type=='team'">
|
|
|
|
|
<view class="box-button" @click="selectFile">
|
|
|
|
|
<u-icon name="plus" color="#EF9525"></u-icon>
|
|
|
|
|
<text class="box-button-txt">批量导入观众</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="book-box-selectInfo" v-if="type=='team'" style="width: 100%; margin-top: 20rpx;">
|
|
|
|
|
|
|
|
|
|
<view class="book-box-selectInfo-right" @click="openNoticeInfo(1)">
|
|
|
|
|
<u-icon name="question-circle-fill" color="#EF9525" size="40rpx"></u-icon>
|
|
|
|
|
<text class="book-box-selectInfo-righttxt" style="margin-left: 20rpx;">批量导入说明</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
@ -161,19 +161,19 @@
|
|
|
|
|
<u-button type="primary" @click="handleAddUser">确定</u-button>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</u-popup>
|
|
|
|
|
|
|
|
|
|
<u-popup :show="showInfo" mode="bottom" @close="closeInfo" :round="10" closeable>
|
|
|
|
|
<view class="mpopup">
|
|
|
|
|
<view class="mpopup-title">
|
|
|
|
|
{{currentNotice.title}}
|
|
|
|
|
</view>
|
|
|
|
|
<view class="mpopup-content" style="margin-top: 60rpx;">
|
|
|
|
|
<rich-text :nodes="currentNotice.content"></rich-text>
|
|
|
|
|
<view style="margin-top: 80px;"></view>
|
|
|
|
|
<u-button type="primary" @click="closeInfo">知道了</u-button>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</u-popup>
|
|
|
|
|
|
|
|
|
|
<u-popup :show="showInfo" mode="bottom" @close="closeInfo" :round="10" closeable>
|
|
|
|
|
<view class="mpopup">
|
|
|
|
|
<view class="mpopup-title">
|
|
|
|
|
{{currentNotice.title}}
|
|
|
|
|
</view>
|
|
|
|
|
<view class="mpopup-content" style="margin-top: 60rpx;">
|
|
|
|
|
<rich-text :nodes="currentNotice.content"></rich-text>
|
|
|
|
|
<view style="margin-top: 80px;"></view>
|
|
|
|
|
<u-button type="primary" @click="closeInfo">知道了</u-button>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</u-popup>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
@ -181,20 +181,20 @@
|
|
|
|
|
<script>
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
showAdd: false,
|
|
|
|
|
isEdit: false,
|
|
|
|
|
isEditIndex: 0,
|
|
|
|
|
showInfo: false,
|
|
|
|
|
list: {},
|
|
|
|
|
return {
|
|
|
|
|
showAdd: false,
|
|
|
|
|
isEdit: false,
|
|
|
|
|
isEditIndex: 0,
|
|
|
|
|
showInfo: false,
|
|
|
|
|
list:{},
|
|
|
|
|
form: {
|
|
|
|
|
unit: "",
|
|
|
|
|
leader: "",
|
|
|
|
|
card_type: 1,
|
|
|
|
|
idcard: "",
|
|
|
|
|
total: 1,
|
|
|
|
|
type: "",
|
|
|
|
|
mobile: "",
|
|
|
|
|
type: "",
|
|
|
|
|
mobile:"",
|
|
|
|
|
details_list: []
|
|
|
|
|
},
|
|
|
|
|
formUser: {
|
|
|
|
|
@ -230,32 +230,32 @@
|
|
|
|
|
id: 2,
|
|
|
|
|
name: '护照',
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
currentNotice: {},
|
|
|
|
|
notice: [{
|
|
|
|
|
title: "预约须知",
|
|
|
|
|
content: "预约须知的内容"
|
|
|
|
|
}, {
|
|
|
|
|
title: "批量上传帮助",
|
|
|
|
|
content: "<p>1.批量上传EXCEL的以xlsx结尾</p><p>2.第一列为标题列 姓名 手机号 证件号</p><p>3.文件是从微信聊天记录中选取或者微信文件传输助手</p>"
|
|
|
|
|
],
|
|
|
|
|
currentNotice: {},
|
|
|
|
|
notice: [{
|
|
|
|
|
title: "预约须知",
|
|
|
|
|
content: "预约须知的内容"
|
|
|
|
|
}, {
|
|
|
|
|
title: "批量上传帮助",
|
|
|
|
|
content: "<p>1.批量上传EXCEL的以xlsx结尾</p><p>2.第一列为标题列 姓名 手机号 证件号</p><p>3.文件是从微信聊天记录中选取或者微信文件传输助手</p>"
|
|
|
|
|
}]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onLoad(options) {
|
|
|
|
|
this.type = options.type;
|
|
|
|
|
this.form.type = (options.type == 'user' ? 2 : 1);
|
|
|
|
|
this.form.activity_id = parseInt(options.activity_id);
|
|
|
|
|
var that = this;
|
|
|
|
|
wx.getStorage({
|
|
|
|
|
key: 'activityinfo',
|
|
|
|
|
success(res) {
|
|
|
|
|
that.list = res.data
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
console.log(this.list)
|
|
|
|
|
|
|
|
|
|
that.util.getUserInfo(function(r) {
|
|
|
|
|
that.form.mobile = r.mobile;
|
|
|
|
|
this.type = options.type;
|
|
|
|
|
this.form.type = (options.type == 'user' ? 2 : 1);
|
|
|
|
|
this.form.activity_id = parseInt(options.activity_id);
|
|
|
|
|
var that = this;
|
|
|
|
|
wx.getStorage({
|
|
|
|
|
key: 'activityinfo',
|
|
|
|
|
success (res) {
|
|
|
|
|
that.list = res.data
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
console.log(this.list)
|
|
|
|
|
|
|
|
|
|
that.util.getUserInfo(function(r) {
|
|
|
|
|
that.form.mobile = r.mobile;
|
|
|
|
|
}, true);
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
@ -275,29 +275,38 @@
|
|
|
|
|
},
|
|
|
|
|
delUser(index) {
|
|
|
|
|
this.form.details_list.splice(index, 1);
|
|
|
|
|
},
|
|
|
|
|
closeInfo() {
|
|
|
|
|
this.showInfo = false;
|
|
|
|
|
},
|
|
|
|
|
openNoticeInfo(type) {
|
|
|
|
|
this.showInfo = true;
|
|
|
|
|
this.currentNotice = this.notice[type];
|
|
|
|
|
},
|
|
|
|
|
closeInfo() {
|
|
|
|
|
this.showInfo = false;
|
|
|
|
|
},
|
|
|
|
|
openNoticeInfo(type) {
|
|
|
|
|
this.showInfo = true;
|
|
|
|
|
this.currentNotice = this.notice[type];
|
|
|
|
|
},
|
|
|
|
|
handleAddUser() {
|
|
|
|
|
var that = this;
|
|
|
|
|
//验证表单
|
|
|
|
|
try {
|
|
|
|
|
if (this.util.isNull(this.formUser.name)) {
|
|
|
|
|
this.util.toast("请填写观众姓名");
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: "请填写观众姓名"
|
|
|
|
|
})
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (that.formUser.card_type == 1) {
|
|
|
|
|
if (this.util.isNull(this.formUser.idcard)) {
|
|
|
|
|
this.util.toast("请填写身份证号");
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: "请填写身份证号"
|
|
|
|
|
})
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (!uni.$u.test.idCard(that.formUser.idcard)) {
|
|
|
|
|
this.util.toast("请正确输入身份证号");
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: "请正确输入身份证号"
|
|
|
|
|
})
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -316,56 +325,56 @@
|
|
|
|
|
//TODO handle the exception
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
selectFile() {
|
|
|
|
|
let _that = this
|
|
|
|
|
wx.chooseMessageFile({
|
|
|
|
|
count: 1, //最多可以选择的文件个数,可以 0~100
|
|
|
|
|
type: 'file', //所选的文件的类型,具体看官方文档
|
|
|
|
|
success(res) {
|
|
|
|
|
// tempFilePath可以作为img标签的src属性显示图片
|
|
|
|
|
const tempFilePaths = res.tempFiles[0].path
|
|
|
|
|
let filename = res.tempFiles[0].name; //用于页面显示的名字
|
|
|
|
|
// 这一步判断可以省略,如果需求没有格式要求的话
|
|
|
|
|
if (filename.indexOf(".xlsx") == -1) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: "暂时仅支持xlsx格式的文件"
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
} else {
|
|
|
|
|
console.log("开始上传");
|
|
|
|
|
uni.showLoading({
|
|
|
|
|
title: "正在上传"
|
|
|
|
|
})
|
|
|
|
|
wx.uploadFile({
|
|
|
|
|
url: _that.util.HOST + '/api/mobile/visit/excel-analyse', //上传的路径
|
|
|
|
|
filePath: tempFilePaths, //刚刚在data保存的文件路径
|
|
|
|
|
name: 'file', //后台获取的凭据
|
|
|
|
|
formData: { //如果是需要带参数,请在formData里面添加,不需要就去掉这个就可以的
|
|
|
|
|
"token": uni.getStorageSync("userInfo_token").token
|
|
|
|
|
},
|
|
|
|
|
success(res) {
|
|
|
|
|
var jsonlist = JSON.parse(res.data)
|
|
|
|
|
for (var m of jsonlist) {
|
|
|
|
|
|
|
|
|
|
_that.form.details_list.push({
|
|
|
|
|
name: m.name,
|
|
|
|
|
idcard: m.idcard,
|
|
|
|
|
mobile: m.mobile,
|
|
|
|
|
card_type: 1
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
uni.hideLoading();
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
console.log('上传到服务器')
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
selectFile() {
|
|
|
|
|
let _that = this
|
|
|
|
|
wx.chooseMessageFile({
|
|
|
|
|
count: 1, //最多可以选择的文件个数,可以 0~100
|
|
|
|
|
type: 'file', //所选的文件的类型,具体看官方文档
|
|
|
|
|
success(res) {
|
|
|
|
|
// tempFilePath可以作为img标签的src属性显示图片
|
|
|
|
|
const tempFilePaths = res.tempFiles[0].path
|
|
|
|
|
let filename = res.tempFiles[0].name; //用于页面显示的名字
|
|
|
|
|
// 这一步判断可以省略,如果需求没有格式要求的话
|
|
|
|
|
if (filename.indexOf(".xlsx") == -1) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: "暂时仅支持xlsx格式的文件"
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
} else {
|
|
|
|
|
console.log("开始上传");
|
|
|
|
|
uni.showLoading({
|
|
|
|
|
title: "正在上传"
|
|
|
|
|
})
|
|
|
|
|
wx.uploadFile({
|
|
|
|
|
url: _that.util.HOST + '/api/mobile/visit/excel-analyse', //上传的路径
|
|
|
|
|
filePath: tempFilePaths, //刚刚在data保存的文件路径
|
|
|
|
|
name: 'file', //后台获取的凭据
|
|
|
|
|
formData: { //如果是需要带参数,请在formData里面添加,不需要就去掉这个就可以的
|
|
|
|
|
"token": uni.getStorageSync("userInfo_token").token
|
|
|
|
|
},
|
|
|
|
|
success(res) {
|
|
|
|
|
var jsonlist = JSON.parse(res.data)
|
|
|
|
|
for (var m of jsonlist) {
|
|
|
|
|
|
|
|
|
|
_that.form.details_list.push({
|
|
|
|
|
name: m.name,
|
|
|
|
|
idcard: m.idcard,
|
|
|
|
|
mobile: m.mobile,
|
|
|
|
|
card_type: 1
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
uni.hideLoading();
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
console.log('上传到服务器')
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
submitOrder() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.util.isNull(this.form.leader)) {
|
|
|
|
|
if (this.type == "user") {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
@ -424,8 +433,7 @@
|
|
|
|
|
if (this.form.details_list.length != this.form.total) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: "请正确添加观众数量",
|
|
|
|
|
duration: 2000
|
|
|
|
|
title: "请正确添加观众数量"
|
|
|
|
|
})
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
@ -462,7 +470,6 @@
|
|
|
|
|
<style>
|
|
|
|
|
@import url("@/static/css/bookbox.css");
|
|
|
|
|
@import url("@/static/css/activitybox.css");
|
|
|
|
|
|
|
|
|
|
.box-visitor-item {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|