submit
This commit is contained in:
parent
ee496f298d
commit
e986e2917e
@ -31,6 +31,18 @@ export const historicalTickets = (data) => {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export const sendCode = (data) => {
|
||||||
|
return uniReq.post({
|
||||||
|
url: '/api/user/send/msg',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export const reTicket = (data) => {
|
||||||
|
return uniReq.post({
|
||||||
|
url: '/api/smart/appointment/book/ticket',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
export const upload = (data) => {
|
export const upload = (data) => {
|
||||||
return uniReq.upload({
|
return uniReq.upload({
|
||||||
name: data.name,
|
name: data.name,
|
||||||
@ -56,6 +68,7 @@ export const updateInfo = (data) => {
|
|||||||
export const extractingBlindBoxes= (data) => {
|
export const extractingBlindBoxes= (data) => {
|
||||||
return uniReq.post({
|
return uniReq.post({
|
||||||
url: '/api/smart/appointment/draw/ticket/from/blind/box',
|
url: '/api/smart/appointment/draw/ticket/from/blind/box',
|
||||||
data
|
data,
|
||||||
|
isShowMsg:false,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
import {uniRequest} from "@/http/main";
|
import {uniRequest} from "@/http/main";
|
||||||
const TEST_URL='http://172.16.100.93:9052'
|
const TEST_URL='http://172.16.100.93:9052'
|
||||||
|
const TY_URL='https://warehouse.szjixun.cn/ticket'
|
||||||
|
let configV
|
||||||
const uniReq=uniRequest.created({
|
const uniReq=uniRequest.created({
|
||||||
baseUrl: TEST_URL,
|
baseUrl: TEST_URL,
|
||||||
interceptor: {
|
interceptor: {
|
||||||
request(config){
|
request(config){
|
||||||
|
configV=config
|
||||||
config.header.Authorization=uni.getStorageSync('token')??''
|
config.header.Authorization=uni.getStorageSync('token')??''
|
||||||
if (config.isLoading){
|
if (config.isLoading){
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
@ -17,7 +20,7 @@ const uniReq=uniRequest.created({
|
|||||||
return config
|
return config
|
||||||
},
|
},
|
||||||
response(response) {
|
response(response) {
|
||||||
uni.hideLoading()
|
if (configV.isShowMsg){
|
||||||
if (response.data.code!==200){
|
if (response.data.code!==200){
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: response.data.msg,
|
title: response.data.msg,
|
||||||
@ -25,6 +28,11 @@ const uniReq=uniRequest.created({
|
|||||||
duration: 50000
|
duration: 50000
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (configV.isLoading){
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
|
||||||
return response.data
|
return response.data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@ interface RequestOptions {
|
|||||||
baseUrl?: string;
|
baseUrl?: string;
|
||||||
url?: string;
|
url?: string;
|
||||||
isLoading?: boolean;
|
isLoading?: boolean;
|
||||||
|
isShowMsg?: boolean;
|
||||||
data?: Record<string, any>;
|
data?: Record<string, any>;
|
||||||
method?: HttpMethod;
|
method?: HttpMethod;
|
||||||
header?: Record<string, string>;
|
header?: Record<string, string>;
|
||||||
@ -67,11 +68,13 @@ type ResponseInterceptor = (response: any) => any;
|
|||||||
class uniRequest {
|
class uniRequest {
|
||||||
baseUrl?: string;
|
baseUrl?: string;
|
||||||
isLoading: boolean;
|
isLoading: boolean;
|
||||||
|
isShowMsg: boolean;
|
||||||
defaultHeader: Record<string, string>;
|
defaultHeader: Record<string, string>;
|
||||||
interceptors: { request?: RequestInterceptor; response?: ResponseInterceptor };
|
interceptors: { request?: RequestInterceptor; response?: ResponseInterceptor };
|
||||||
|
|
||||||
constructor(request: RequestOptions) {
|
constructor(request: RequestOptions) {
|
||||||
this.isLoading= request.isLoading??true
|
this.isLoading= request.isLoading??true
|
||||||
|
this.isShowMsg= request.isShowMsg??true
|
||||||
this.baseUrl = request.baseUrl;
|
this.baseUrl = request.baseUrl;
|
||||||
this.defaultHeader = {
|
this.defaultHeader = {
|
||||||
"Content-Type": "application/json;charset=UTF-8",
|
"Content-Type": "application/json;charset=UTF-8",
|
||||||
@ -94,6 +97,7 @@ class uniRequest {
|
|||||||
options = this.buildRequestOptions(options)
|
options = this.buildRequestOptions(options)
|
||||||
options = options || {};
|
options = options || {};
|
||||||
options.isLoading ??= this.isLoading;
|
options.isLoading ??= this.isLoading;
|
||||||
|
options.isShowMsg ??= this.isShowMsg;
|
||||||
options.baseUrl = options.baseUrl || this.baseUrl;
|
options.baseUrl = options.baseUrl || this.baseUrl;
|
||||||
options.url = `${options.baseUrl}${options.url}`;
|
options.url = `${options.baseUrl}${options.url}`;
|
||||||
options.data = options.data || {};
|
options.data = options.data || {};
|
||||||
|
@ -90,6 +90,7 @@
|
|||||||
{
|
{
|
||||||
"path": "pages/setup/index",
|
"path": "pages/setup/index",
|
||||||
"style": {
|
"style": {
|
||||||
|
"navigationStyle": "custom",
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": false,
|
||||||
"app-plus": {
|
"app-plus": {
|
||||||
|
@ -27,6 +27,14 @@
|
|||||||
<div class="wrap4">*即将跳转实名页面</div>
|
<div class="wrap4">*即将跳转实名页面</div>
|
||||||
</div>
|
</div>
|
||||||
</tm-drawer>
|
</tm-drawer>
|
||||||
|
<tm-drawer hideHeader :width="510" :height="324" ref="calendarView" placement="center" v-model:show="showWin3">
|
||||||
|
<div class="content7">
|
||||||
|
<div class="wrap1">领取失败</div>
|
||||||
|
<div class="wrap2">失败原因:{{errMsg}}</div>
|
||||||
|
<div class="wrap3" @click="goHome">确定</div>
|
||||||
|
<div class="wrap4">**即将返回首页</div>
|
||||||
|
</div>
|
||||||
|
</tm-drawer>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -35,28 +43,72 @@ import {ref} from 'vue'
|
|||||||
import {extractingBlindBoxes} from "@/http/apis";
|
import {extractingBlindBoxes} from "@/http/apis";
|
||||||
const imgList=ref([{url:'https://cdns.fontree.cn/fonchain-main/prod/image/1833/avatar/8395f322-b677-4f24-a13d-b79474c09d35.png'},{url:'https://cdns.fontree.cn/fonchain-main/prod/image/1833/avatar/8395f322-b677-4f24-a13d-b79474c09d35.png'}])
|
const imgList=ref([{url:'https://cdns.fontree.cn/fonchain-main/prod/image/1833/avatar/8395f322-b677-4f24-a13d-b79474c09d35.png'},{url:'https://cdns.fontree.cn/fonchain-main/prod/image/1833/avatar/8395f322-b677-4f24-a13d-b79474c09d35.png'}])
|
||||||
const showWin2=ref(false)
|
const showWin2=ref(false)
|
||||||
|
const showWin3=ref(false)
|
||||||
const userInfo=ref(uni.getStorageSync('userInfo'))
|
const userInfo=ref(uni.getStorageSync('userInfo'))
|
||||||
|
const goHome=()=>{
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/index/index'
|
||||||
|
})
|
||||||
|
}
|
||||||
const goRealName=()=>{
|
const goRealName=()=>{
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/facial/index'
|
url: '/pages/facial/index'
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
const errMsg=ref('')
|
||||||
const goGet=async ()=>{
|
const goGet=async ()=>{
|
||||||
if (!userInfo.idNum){
|
if (!userInfo.value.idNum){
|
||||||
showWin2.value=true
|
showWin2.value=true
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const data={
|
const data={
|
||||||
"userName": "邢雨杨", //用户姓名
|
"userName": userInfo.value.realName, //用户姓名
|
||||||
"idCard": "411527200009129056", //用户身份证号
|
"idCard": userInfo.value.idNum, //用户身份证号
|
||||||
"phone": "18606216921", //预约电话
|
"phone": userInfo.value.telNum, //预约电话
|
||||||
"blindBoxName": "博物馆开馆纪念盲盒" //盲盒名称
|
"blindBoxName": "博物馆开馆纪念盲盒" //盲盒名称
|
||||||
}
|
}
|
||||||
const res=await extractingBlindBoxes(data)
|
const res=await extractingBlindBoxes(data)
|
||||||
|
if (res.code===0){
|
||||||
|
showWin3.value=true
|
||||||
|
errMsg.value=res.msg
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.content7{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
.wrap4{
|
||||||
|
margin-top: 6rpx;
|
||||||
|
font-size: 16rpx;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.wrap3{
|
||||||
|
margin-top: 32rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
width: 436rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
background-color: #E84030;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
.wrap2{
|
||||||
|
margin-top: 30rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #644D3F;
|
||||||
|
|
||||||
|
}
|
||||||
|
.wrap1{
|
||||||
|
margin-top: 58rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #B1292E;
|
||||||
|
}
|
||||||
|
}
|
||||||
.content6{
|
.content6{
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<div class="content1">
|
<div class="content1">
|
||||||
<div class="wrap1">
|
<div class="wrap1">
|
||||||
<div class="wrap1_1">
|
<div class="wrap1_1">
|
||||||
<image src="../../static/06.png" alt=""/>
|
<image :src="userInfo.avatar" alt=""/>
|
||||||
</div>
|
</div>
|
||||||
<div class="wrap1_2">
|
<div class="wrap1_2">
|
||||||
<div class="wrap1_2_1">
|
<div class="wrap1_2_1">
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<custom-title class="title-block" title="智慧门票">
|
||||||
|
</custom-title>
|
||||||
<div class="large-container">
|
<div class="large-container">
|
||||||
<div class="content1">
|
<div class="content1">
|
||||||
<div class="wrap1">
|
<div class="wrap1">
|
||||||
<image :src="currentAvatar"></image>
|
<image :src="userInfo.avatar"></image>
|
||||||
</div>
|
</div>
|
||||||
<div class="wrap2">
|
<div class="wrap2">
|
||||||
<div class="wrap2_1">恢复默认头像</div>
|
<div class="wrap2_1">恢复默认头像</div>
|
||||||
@ -13,33 +15,34 @@
|
|||||||
<div class="wrap1">
|
<div class="wrap1">
|
||||||
<div class="wrap1_1">
|
<div class="wrap1_1">
|
||||||
<div class="wrap1_1_1">姓名</div>
|
<div class="wrap1_1_1">姓名</div>
|
||||||
<div class="wrap1_1_2">已实名</div>
|
<div class="wrap1_1_2" v-if="userInfo.idNum">已实名</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="wrap1_2">xxx</div>
|
<div class="wrap1_2">{{userInfo.realName}}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="wrap1">
|
<div class="wrap1">
|
||||||
<div class="wrap1_1">
|
<div class="wrap1_1">
|
||||||
<div class="wrap1_1_1">身份证号</div>
|
<div class="wrap1_1_1">身份证号</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="wrap1_2">292199922283726657</div>
|
<div class="wrap1_2">{{userInfo.idNum}}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="wrap1">
|
<div class="wrap1">
|
||||||
<div class="wrap1_1">
|
<div class="wrap1_1">
|
||||||
<div class="wrap1_1_1">微信号</div>
|
<div class="wrap1_1_1">手机号</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="wrap1_2">12318881999</div>
|
<div class="wrap1_2">{{ userInfo.telNum }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="content3">*来自微信数据共享</div>
|
<div class="content3">*来自微信数据共享</div>
|
||||||
<div class="content4">
|
<div class="content4">
|
||||||
<div class="wrap1">注销账号</div>
|
<div class="wrap1">注销账号</div>
|
||||||
<div class="wrap2">退出登录</div>
|
<div class="wrap2" @click="logOut">退出登录</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import {updateInfo, upload} from "@/http/apis";
|
import {updateInfo, upload} from "@/http/apis";
|
||||||
import {nextTick, ref} from 'vue'
|
import {nextTick, ref} from 'vue'
|
||||||
|
const userInfo=ref(uni.getStorageSync('userInfo'))
|
||||||
const currentAvatar=ref('')
|
const currentAvatar=ref('')
|
||||||
const changeAvatar=()=>{
|
const changeAvatar=()=>{
|
||||||
|
|
||||||
@ -50,23 +53,47 @@ const changeAvatar=()=>{
|
|||||||
name:'file',
|
name:'file',
|
||||||
filePath:res.tempFilePaths[0]
|
filePath:res.tempFilePaths[0]
|
||||||
})
|
})
|
||||||
currentAvatar.value=res1.data.path
|
userInfo.value.avatar=res1.data.path
|
||||||
|
|
||||||
reqAvatar()
|
reqAvatar()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
const logOut=()=>{
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示', // 确认框标题
|
||||||
|
content: '确认退出登录吗', // 确认框内容
|
||||||
|
showCancel: true, // 是否显示取消按钮,默认为 true
|
||||||
|
cancelText: '取消', // 取消按钮的文本,默认为"取消",最多 4 个字符
|
||||||
|
cancelColor: '#000000', // 取消按钮的文本颜色,默认为"#000000"
|
||||||
|
confirmText: '确定', // 确认按钮的文本,默认为"确定",最多 4 个字符
|
||||||
|
confirmColor: '#576B95', // 确认按钮的文本颜色,默认为"#576B95"
|
||||||
|
success: function (res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
uni.clearStorageSync()
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/login/index'
|
||||||
|
})
|
||||||
|
} else if (res.cancel) {
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: function (error) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
const reqAvatar=async ()=>{
|
const reqAvatar=async ()=>{
|
||||||
const res= await updateInfo({
|
const res= await updateInfo({
|
||||||
avatar:currentAvatar.value
|
avatar:currentAvatar.value
|
||||||
})
|
})
|
||||||
if (res.code===200) {
|
if (res.code===200) {
|
||||||
|
uni.setStorageSync('userInfo',userInfo.value)
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '更换头像成功',
|
title: '更换头像成功',
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
duration: 200
|
duration: 200
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
console.log(res,'res')
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #r1 >
|
<template #r1 >
|
||||||
<div>
|
<div>
|
||||||
<input type="text" placeholder="填写手机号" placeholder-style="color:#DBDBDB;fontSize:24rpx"/>
|
<input type="text" v-model="phone" placeholder="填写手机号" placeholder-style="color:#DBDBDB;fontSize:24rpx"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #l2 >
|
<template #l2 >
|
||||||
@ -59,10 +59,9 @@
|
|||||||
<template #r2 >
|
<template #r2 >
|
||||||
<div style="position: relative;width: 100%">
|
<div style="position: relative;width: 100%">
|
||||||
<div >
|
<div >
|
||||||
<input type="text" placeholder="填写验证码" placeholder-style="color:#DBDBDB;fontSize:24rpx"/>
|
<input v-model="code" type="text" placeholder="填写验证码" placeholder-style="color:#DBDBDB;fontSize:24rpx"/>
|
||||||
</div>
|
</div>
|
||||||
|
<div @click="getCode" style="z-index:11;position: absolute;top: 50%;transform: translateY(-50%);right: 12rpx;color: #B1292E;font-size: 24rpx">{{buttonText}}</div>
|
||||||
<div style="position: absolute;top: 50%;transform: translateY(-50%);right: 12rpx;color: #B1292E;font-size: 24rpx">获取验证码</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</display-box>
|
</display-box>
|
||||||
@ -76,7 +75,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #r1 >
|
<template #r1 >
|
||||||
<div class="r1">
|
<div class="r1">
|
||||||
<div class="r1_1">2023年12月16日</div>
|
<div class="r1_1">{{dateStr?dayjs(dateStr).format('YYYY年MM月DD日'):'暂无'}}</div>
|
||||||
<div class="r1_2" @click="showWin=true">
|
<div class="r1_2" @click="showWin=true">
|
||||||
<image src="https://cdns.fontree.cn/fonchain-main/prod/image/1833/avatar/2c4872f9-aee5-4b04-9494-94b08c282ed9.png"></image>
|
<image src="https://cdns.fontree.cn/fonchain-main/prod/image/1833/avatar/2c4872f9-aee5-4b04-9494-94b08c282ed9.png"></image>
|
||||||
</div>
|
</div>
|
||||||
@ -93,13 +92,13 @@
|
|||||||
*单次最多可预约10人
|
*单次最多可预约10人
|
||||||
</div>
|
</div>
|
||||||
<div class="r2_2">
|
<div class="r2_2">
|
||||||
<div class="r2_2_1">
|
<div class="r2_2_1" @click="peoNumChange(-1)">
|
||||||
<image src="../../static/zu1149@3x.png"></image>
|
<image src="../../static/zu1149@3x.png"></image>
|
||||||
</div>
|
</div>
|
||||||
<div class="r2_2_2">
|
<div class="r2_2_2">
|
||||||
<input type="text">
|
<input disabled v-model="peoNum" :max="10" type="text">
|
||||||
</div>
|
</div>
|
||||||
<div class="r2_2_3">
|
<div class="r2_2_3" @click="peoNumChange(1)">
|
||||||
<image src="../../static/zu1150@3x.png"></image>
|
<image src="../../static/zu1150@3x.png"></image>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -111,7 +110,7 @@
|
|||||||
*请填写所有参观人的身份证信息
|
*请填写所有参观人的身份证信息
|
||||||
</div>
|
</div>
|
||||||
<div class="content8">
|
<div class="content8">
|
||||||
<div class="wrap1"> <display-box>
|
<div class="wrap1" v-for="(item,index) in userInfos" :key="index"> <display-box>
|
||||||
<template #l1>
|
<template #l1>
|
||||||
<div class="box-left">
|
<div class="box-left">
|
||||||
真实姓名
|
真实姓名
|
||||||
@ -119,7 +118,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #r1>
|
<template #r1>
|
||||||
<div class="box-right">
|
<div class="box-right">
|
||||||
<input type="text" placeholder="请填写您的真实姓名" placeholder-style="color:#DBDBDB;font-size:24rpx"/>
|
<input type="text" v-model="item.userName" placeholder="请填写您的真实姓名" placeholder-style="color:#DBDBDB;font-size:24rpx"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #l2>
|
<template #l2>
|
||||||
@ -129,14 +128,14 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #r2>
|
<template #r2>
|
||||||
<div class="box-right">
|
<div class="box-right">
|
||||||
<input type="text" placeholder="填写您的身份证号码" placeholder-style="color:#DBDBDB;font-size:24rpx"/>
|
<input type="text" v-model="item.idCard" placeholder="填写您的身份证号码" placeholder-style="color:#DBDBDB;font-size:24rpx"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</display-box></div>
|
</display-box></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="content9">
|
<div class="content9">
|
||||||
<div class="wrap1">*预约后信息不可更改,请仔细核对预约信息</div>
|
<div class="wrap1">*预约后信息不可更改,请仔细核对预约信息</div>
|
||||||
<div class="wrap2">预约</div>
|
<div class="wrap2" @click="goReservation">预约</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<tm-drawer :height="1054" :round="8" hideHeader inContent ref="calendarView" :placement="'bottom'" v-model:show="showWin">
|
<tm-drawer :height="1054" :round="8" hideHeader inContent ref="calendarView" :placement="'bottom'" v-model:show="showWin">
|
||||||
@ -153,7 +152,7 @@
|
|||||||
:model="modeltype"
|
:model="modeltype"
|
||||||
></tm-calendar>
|
></tm-calendar>
|
||||||
<div class="content10" >
|
<div class="content10" >
|
||||||
<div class="wrap1">
|
<div class="wrap1" @click="showWin=false">
|
||||||
<image src="../../static/Close@3x.png"></image>
|
<image src="../../static/Close@3x.png"></image>
|
||||||
</div>
|
</div>
|
||||||
<div class="wrap2">
|
<div class="wrap2">
|
||||||
@ -184,10 +183,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="wrap3"></div>
|
<div class="wrap3"></div>
|
||||||
<div class="wrap6">
|
<div class="wrap6" >
|
||||||
请选择参观时间
|
请选择参观时间
|
||||||
</div>
|
</div>
|
||||||
<div class="wrap7">
|
<div class="wrap7" >
|
||||||
<div class="wrap7_2" @click="selectTime(index)" :class="[isBeforeCurrentTime(`${showDay?.[currentSelectedData]?.day} ${item}`)?'wrap7_1':'',index===currentSelectedTime?'wrap7_3':'']" v-for="(item,index) in info?.admissionTime.split(',')" :key="item">
|
<div class="wrap7_2" @click="selectTime(index)" :class="[isBeforeCurrentTime(`${showDay?.[currentSelectedData]?.day} ${item}`)?'wrap7_1':'',index===currentSelectedTime?'wrap7_3':'']" v-for="(item,index) in info?.admissionTime.split(',')" :key="item">
|
||||||
<div class="wrap7_2_1">{{item}}入场</div>
|
<div class="wrap7_2_1">{{item}}入场</div>
|
||||||
<div class="wrap7_2_2">
|
<div class="wrap7_2_2">
|
||||||
@ -201,7 +200,7 @@
|
|||||||
工作日08:30-18:00、节假日/双休09:00-20:00(具体时间以景区为准)<br/>
|
工作日08:30-18:00、节假日/双休09:00-20:00(具体时间以景区为准)<br/>
|
||||||
</div>
|
</div>
|
||||||
<div class="wrap3" style="margin-bottom: 30rpx"></div>
|
<div class="wrap3" style="margin-bottom: 30rpx"></div>
|
||||||
<div class="wrap9">确定</div>
|
<div class="wrap9" @click="showWin=false">确定</div>
|
||||||
</div>
|
</div>
|
||||||
</tm-drawer>
|
</tm-drawer>
|
||||||
</div>
|
</div>
|
||||||
@ -215,26 +214,112 @@ import displayBox from '@/components/display-box/index.vue'
|
|||||||
dayjs.extend(localizedFormat);
|
dayjs.extend(localizedFormat);
|
||||||
dayjs.locale('zh-cn');
|
dayjs.locale('zh-cn');
|
||||||
import {useMainStore} from "@/store"
|
import {useMainStore} from "@/store"
|
||||||
import {ref} from 'vue'
|
import {ref,onUnmounted} from 'vue'
|
||||||
const showWin=ref(true)
|
import {reTicket, sendCode} from "@/http/apis";
|
||||||
|
const showWin=ref(false)
|
||||||
|
const peoNum=ref(1)
|
||||||
const store=useMainStore()
|
const store=useMainStore()
|
||||||
const modeltype = ref('day')
|
const modeltype = ref('day')
|
||||||
const multiple = ref(false)
|
const multiple = ref(false)
|
||||||
const dateStr = ref('')
|
const dateStr = ref('')
|
||||||
|
const code=ref('')
|
||||||
const showdate = ref(false)
|
const showdate = ref(false)
|
||||||
const currentData=ref(dayjs().format('YYYY-MM-DD'))
|
const currentData=ref(dayjs().format('YYYY-MM-DD'))
|
||||||
const info=ref(uni.getStorageSync('currentBooking'))
|
const info=ref(uni.getStorageSync('currentBooking'))
|
||||||
|
const countdown = ref(5);
|
||||||
|
const isCounting = ref(false);
|
||||||
|
const buttonText = ref(`获取验证码`);
|
||||||
|
const userInfo=ref(uni.getStorageSync('userInfo'))
|
||||||
const viewImg=()=>{
|
const viewImg=()=>{
|
||||||
uni.previewImage({
|
uni.previewImage({
|
||||||
urls:[info.value.ticketImage],
|
urls:[info.value.ticketImage],
|
||||||
indicator:'none'
|
indicator:'none'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
const goReservation=async ()=>{
|
||||||
|
if (!phone.value){
|
||||||
|
uni.showToast({
|
||||||
|
title: '手机号码不能为空',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!code.value){
|
||||||
|
uni.showToast({
|
||||||
|
title: '验证码不能为空',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!dateStr.value){
|
||||||
|
uni.showToast({
|
||||||
|
title: '日期不能为空',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
/* if (!info.value?.admissionTime?.split(',')[currentSelectedTime.value]){
|
||||||
|
uni.showToast({
|
||||||
|
title: '时间不能为空',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}*/
|
||||||
|
const data={
|
||||||
|
ticketUid:info.value.uuid,
|
||||||
|
userName:userInfo.value.realName,
|
||||||
|
idCard:userInfo.value.idNum,
|
||||||
|
phone:phone.value,
|
||||||
|
code:code.value,
|
||||||
|
date:dateStr.value?.replaceAll('-','/'),
|
||||||
|
time:info.value?.admissionTime?.split(',')[currentSelectedTime.value],
|
||||||
|
userInfo:userInfos.value
|
||||||
|
}
|
||||||
|
const res=await reTicket(data)
|
||||||
|
console.log(res,'goReservation')
|
||||||
|
}
|
||||||
|
const getCode=async ()=>{
|
||||||
|
console.log(buttonText.value,'buttonText.value')
|
||||||
|
if (isCounting.value) return;
|
||||||
|
isCounting.value = true;
|
||||||
|
countdown.value = 5;
|
||||||
|
buttonText.value = `剩余 ${countdown.value} 秒`;
|
||||||
|
const res= await sendCode({telNum:phone.value})
|
||||||
|
if (res.code===200){
|
||||||
|
uni.showToast({
|
||||||
|
title: '发送成功',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const intervalId = setInterval(() => {
|
||||||
|
if (countdown.value > 0) {
|
||||||
|
countdown.value--;
|
||||||
|
buttonText.value = `剩余 ${countdown.value} 秒`;
|
||||||
|
} else {
|
||||||
|
clearInterval(intervalId);
|
||||||
|
isCounting.value = false;
|
||||||
|
buttonText.value = `重新获取验证码`;
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
clearInterval(intervalId);
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
const userInfos=ref([{userName:'',idCard:''}])
|
||||||
|
const phone=ref('')
|
||||||
const currentSelectedData=ref(undefined)
|
const currentSelectedData=ref(undefined)
|
||||||
const selectData=(index)=>{
|
const selectData=(index)=>{
|
||||||
if (dayjs(showDay.value[index].day).isBefore(dayjs(), 'day')){
|
if (dayjs(showDay.value[index].day).isBefore(dayjs(), 'day')){
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
dateStr.value=showDay.value[index].day
|
||||||
currentSelectedTime.value=undefined
|
currentSelectedTime.value=undefined
|
||||||
currentSelectedData.value=index
|
currentSelectedData.value=index
|
||||||
}
|
}
|
||||||
@ -250,6 +335,15 @@ const selectTime=(index)=>{
|
|||||||
}
|
}
|
||||||
currentSelectedTime.value=index
|
currentSelectedTime.value=index
|
||||||
}
|
}
|
||||||
|
const peoNumChange=(num)=>{
|
||||||
|
|
||||||
|
peoNum.value=peoNum.value+num
|
||||||
|
if (num>0){
|
||||||
|
userInfos.value.push({userName:'',idCard:''})
|
||||||
|
}else if (num<0){
|
||||||
|
userInfos.value.pop()
|
||||||
|
}
|
||||||
|
}
|
||||||
const confirmData=(data)=>{
|
const confirmData=(data)=>{
|
||||||
currentSelectedData.value=1
|
currentSelectedData.value=1
|
||||||
showDay.value=weekDays(data?.[0]?.replaceAll('/', '-'))
|
showDay.value=weekDays(data?.[0]?.replaceAll('/', '-'))
|
||||||
@ -595,6 +689,7 @@ const goMore=()=>{
|
|||||||
.content8{
|
.content8{
|
||||||
margin-top: 12rpx;
|
margin-top: 12rpx;
|
||||||
.wrap1{
|
.wrap1{
|
||||||
|
margin-bottom: 24rpx;
|
||||||
.box-left{
|
.box-left{
|
||||||
color: #000;
|
color: #000;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
|
Loading…
Reference in New Issue
Block a user