###修复和优化

-修复书票组件中条件判断缺失空格问题,确保语法一致性。- 优化登录弹窗的展示与关闭逻辑,提升用户体验。
- 修复加载动画组件对透明度设置不当,确保动画效果正确。- 调整配置文件中的URL格式,去除不必要的斜杠。- 优化智能机器人页面的布局,调整间距以适应新内容。### 代码审查细节

- 在`bookTicket.vue`中,增加空格以确保条件判断的可读性。
- 在`f-login.vue`中,简化`u-popup`组件的展示逻辑。
- 在`loading.vue`中,调整加载动画的透明度设置。
- 在`config.js`中,标准化API根路径的格式。
- 在`zhinengjiqiren.vue`中,增加间距以适应智能机器人页面的新内容。

### 测试- 确保书票组件中的条件判断在各种场景下均能正确执行。
- 验证登录弹窗的显示与关闭逻辑在不同设备上的一致性。- 加载动画应在各种主题模式下正常工作。
- 智能机器人页面应适应不同屏幕尺寸,无布局问题。
lu_quan_dev
Tuzki 1 year ago
parent 247bda8776
commit 6dd325c245
  1. 3
      common/config.js
  2. 4
      components/f-loading/loading.vue
  3. 46
      components/f-login/f-login.vue
  4. 4
      static/css/common.css
  5. 2
      subPageB/jiqiren/jiqiren/zhinengjiqiren.vue
  6. 42
      subPageC/bookTicket/bookTicket.vue

@ -5,9 +5,10 @@
const REAUEST_ROOTPATH = "https://eluyou.ailuquan.cn"; const REAUEST_ROOTPATH = "https://eluyou.ailuquan.cn";
// const REAUEST_ROOTPATH = "http://192.168.0.181:8083/"; // const REAUEST_ROOTPATH = "http://192.168.0.181:8083/";
// const ROOTPATH = "http://192.168.130.205:8083"; // const ROOTPATH = "http://192.168.130.205:8083";
const ROOTPATH = "https://eluyou.ailuquan.cn/"; const ROOTPATH = "https://eluyou.ailuquan.cn";
//票务根 //票务根
const PWPATH = "http://192.168.130.157:48080"; const PWPATH = "http://192.168.130.157:48080";
// const PWPATH = "https://eluyou.ailuquan.cn";
//手绘图项目名称 //手绘图项目名称
const HANDDRAWNNAME = ""; const HANDDRAWNNAME = "";
module.exports = { module.exports = {

@ -1,7 +1,7 @@
<template> <template>
<view class="mask mask-show u_loading" :data-theme="isDark?'dark':'light'" v-if="loadingShow" @touchmove.stop.prevent="preventTouchMove"> <view class="mask mask-show u_loading" :data-theme="isDark?'dark':'light'" v-if="loadingShow" @touchmove.stop.prevent="preventTouchMove">
<!-- 加载动画开始 --> <!-- 加载动画开始 -->
<view class="preloader u-flex u-flex-column u-flex-center"> <view class="preloader u-flex u-flex u-flex-center">
<view class="loader"> <view class="loader">
<view></view> <view></view>
<view></view> <view></view>
@ -52,7 +52,7 @@ export default {
flex-wrap: wrap; flex-wrap: wrap;
} }
&.mask-show { &.mask-show {
background: rgba(255,255,255, 0); background: rgba(255,255,255, 0.15);
} }
.title { .title {
color: #666; color: #666;

@ -1,12 +1,6 @@
<template> <template>
<view> <view>
<u-popup <u-popup :show="loginPopupShow" mode="bottom" :round="10" @close="closeLogin" zIndex="10071">
:show="loginPopupShow"
mode="bottom"
:round="10"
@close="closeLogin"
zIndex="999998"
>
<view class="f__login"> <view class="f__login">
<view class="loginLoading" v-if="isLoading"> <view class="loginLoading" v-if="isLoading">
<u-loadmore status="loading" loadingText="正在登录..."></u-loadmore> <u-loadmore status="loading" loadingText="正在登录..."></u-loadmore>
@ -16,21 +10,12 @@
<view class="loginButton" v-if="!isPhoneLogin"> <view class="loginButton" v-if="!isPhoneLogin">
<!-- #ifdef MP-WEIXIN --> <!-- #ifdef MP-WEIXIN -->
<!-- <button class="button" @click="onAuthorization" :style="{background:PrimaryColor}">微信授权登录</button> --> <!-- <button class="button" @click="onAuthorization" :style="{background:PrimaryColor}">微信授权登录</button> -->
<button <button class="button marginT" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber"
class="button marginT" :style="{ background: PrimaryColor }">
open-type="getPhoneNumber" 微信手机号登录</button><!-- 此功能需微信认证 -->
@getphonenumber="decryptPhoneNumber"
:style="{ background: PrimaryColor }"
>
微信手机号登录</button
><!-- 此功能需微信认证 -->
<!-- #endif --> <!-- #endif -->
<button <button class="button" @click="closeLogin" style="background: #fff; margin-top: 24rpx"
class="button" :style="{ border: '2rpx solid ' + PrimaryColor, color: PrimaryColor }">
@click="closeLogin"
style="background: #fff; margin-top: 24rpx"
:style="{ border: '2rpx solid ' + PrimaryColor, color: PrimaryColor }"
>
暂不登录 暂不登录
</button> </button>
</view> </view>
@ -100,7 +85,7 @@ export default {
// //
decryptPhoneNumber(e) { decryptPhoneNumber(e) {
console.log(e, "授权手机号"); console.log(e, "授权手机号");
// store.commit("setLoadingShow", true); store.commit("setLoadingShow", true);
var that = this; var that = this;
debugger debugger
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
@ -146,7 +131,6 @@ export default {
// this.setUserInfo(userInfo) // this.setUserInfo(userInfo)
//token //token
this.setUserInfo(userInfo); this.setUserInfo(userInfo);
store.commit("setLoadingShow", false);
setTimeout(() => { setTimeout(() => {
uni.showToast({ uni.showToast({
title: "登录成功", title: "登录成功",
@ -155,8 +139,9 @@ export default {
this.closeLogin(); this.closeLogin();
}, 100); }, 100);
}).catch((err) => {
store.commit("setLoadingShow", false); store.commit("setLoadingShow", false);
}).catch((err) => {
this.closeLogin() this.closeLogin()
// this.isPhoneLogin = true; // this.isPhoneLogin = true;
@ -164,11 +149,12 @@ export default {
title: err.msg, title: err.msg,
icon: "none", icon: "none",
}); });
store.commit("setLoadingShow", false);
}); });
}, },
fail: (error) => { fail: (error) => {
// 使 // 使
store.commit("setLoadingShow", false);
this.closeLogin() this.closeLogin()
// this.isPhoneLogin = true; // this.isPhoneLogin = true;
@ -176,6 +162,8 @@ export default {
title: "登陆失败,请重试", title: "登陆失败,请重试",
icon: "none", icon: "none",
}); });
store.commit("setLoadingShow", false);
}, },
}); });
} }
@ -185,24 +173,28 @@ export default {
icon: "none", icon: "none",
}); });
this.closeLogin() this.closeLogin()
store.commit("setLoadingShow", false);
} }
}); });
} else { } else {
// 使 // 使
store.commit("setLoadingShow", false);
this.isPhoneLogin = true; this.isPhoneLogin = true;
uni.showToast({ uni.showToast({
title: "登录失败,请重试", title: "登录失败,请重试",
icon: "none", icon: "none",
}); });
store.commit("setLoadingShow", false);
} }
} else { } else {
uni.showToast({ uni.showToast({
title: "暂无法登录,请重试", title: "已拒绝",
icon: "none", icon: "none",
}); });
this.closeLogin() this.closeLogin()
store.commit("setLoadingShow", false);
} }
// #endif // #endif
}, },

@ -169,7 +169,7 @@ page{ background: #f5f5f5;}
.jqr_main{ margin-bottom: 240rpx; position: relative; z-index: 3;} .jqr_main{ margin-bottom: 240rpx; position: relative; z-index: 3;}
.jqr_dig_pic{ width: 60rpx; height: 60rpx; margin:0 0rpx 0 40rpx} .jqr_dig_pic{ width: 60rpx; height: 60rpx; margin:0 0rpx 0 40rpx}
.jqr_box, .jqr_box_txt{ background: #fff; border-radius: 0% 30rpx 30rpx 30rpx; border:2rpx solid #eee; box-shadow: rgba(200,200,200,.3) 0 0 10rpx; overflow: hidden;margin-left: 20rpx; width:100%; padding:20rpx 0rpx 100rpx 0rpx } .jqr_box, .jqr_box_txt{ background: #fff; border-radius: 0% 30rpx 30rpx 30rpx; border:2rpx solid #eee; box-shadow: rgba(200,200,200,.3) 0 0 10rpx; overflow: hidden;margin-left: 20rpx; width:100%; padding:20rpx 0rpx 125rpx 0rpx }
.left_dig, .right_dig{ margin-bottom: 40rpx; position: relative; } .left_dig, .right_dig{ margin-bottom: 40rpx; position: relative; }
.right_dig .jqr_box{background:linear-gradient(225deg,#18cec3,#6fa2ff); border-radius: 30rpx 0 30rpx 30rpx; margin-left: 0; border:none; padding-bottom:30rpx ; } .right_dig .jqr_box{background:linear-gradient(225deg,#18cec3,#6fa2ff); border-radius: 30rpx 0 30rpx 30rpx; margin-left: 0; border:none; padding-bottom:30rpx ; }
.left_dig{ margin-top:60rpx} .left_dig{ margin-top:60rpx}
@ -187,7 +187,7 @@ page{ background: #f5f5f5;}
.right_dig .qus_txt{ color: #fff;} .right_dig .qus_txt{ color: #fff;}
.dig_gd{max-height:400rpx ; overflow: hidden; position: relative;} .dig_gd{max-height:400rpx ; overflow: hidden; position: relative;}
.dig_more{ height: 80rpx; width:100%; background: #f5f5f5; text-align: center; color: #666; font-size: 28rpx; line-height: 80rpx;border-radius: 0 0 30rpx 30rpx; position: absolute; bottom:0; left:0; z-index: 10;} .dig_more{ height: 80rpx; width:100%; background: #f5f5f5; text-align: center; color: #666; font-size: 28rpx; line-height: 80rpx;border-radius: 0 0 30rpx 30rpx; position: absolute; left:0; z-index: 10;}
.jqr_box_txt .janw_link:before{ display: none;} .jqr_box_txt .janw_link:before{ display: none;}

@ -444,7 +444,7 @@ innerAudioContext.autoplay = true;
} }
.jqr_dig_scroll{ .jqr_dig_scroll{
padding-bottom: 150rpx; padding-bottom: 200rpx;
} }
.jqr_tol_box{ .jqr_tol_box{

@ -52,7 +52,7 @@
<view class="m-one-third-row"> <view class="m-one-third-row">
<view class="m-ticket-count"> <view class="m-ticket-count">
<view class="m-ticket-count-label">购票数量</view> <view class="m-ticket-count-label">购票数量</view>
<view class="m-ticket-count-value" v-if="ticket&&ticket.qmxId == null"> <view class="m-ticket-count-value" v-if="ticket && ticket.qmxId == null">
<uni-number-box v-if="maxNum == -1" :min="0" v-model="ticket.num" :disabled="!ticket.date" <uni-number-box v-if="maxNum == -1" :min="0" v-model="ticket.num" :disabled="!ticket.date"
@change="changeCount($event, ticket)" /> @change="changeCount($event, ticket)" />
<uni-number-box v-else :min="0" :max="maxNum" v-model="ticket.num" :disabled="!ticket.date" <uni-number-box v-else :min="0" :max="maxNum" v-model="ticket.num" :disabled="!ticket.date"
@ -75,8 +75,8 @@
</view> </view>
</view> </view>
</view> </view>
<view class="m-card m-card-two" v-if="ticket && ticket.touristInformation != 1 && ticket.date!=null"> <view class="m-card m-card-two" v-if="ticket && ticket.touristInformation != 1 && ticket.date != null && ticket.num >0">
<view class="m-card-title" v-if="ticket &&ticket.qmxId != null"> <view class="m-card-title" v-if="ticket && ticket.qmxId != null">
<view class="contact-user-box" <view class="contact-user-box"
v-if="ticket.qmxTicketInfoVO.needContactName != false || ticket.qmxTicketInfoVO.needContactPhone != false || ticket.qmxTicketInfoVO.needContactIdCard != false"> v-if="ticket.qmxTicketInfoVO.needContactName != false || ticket.qmxTicketInfoVO.needContactPhone != false || ticket.qmxTicketInfoVO.needContactIdCard != false">
<view class="m-title">联系人信息</view> <view class="m-title">联系人信息</view>
@ -333,12 +333,12 @@
</view> </view>
</uni-popup> </uni-popup>
<!-- 新增 --> <!-- 新增 -->
<uni-popup ref="mAddPerson" type="bottom" border-radius="10px 10px 0 0" :safe-area="false"> <uni-popup ref="mAddPerson" type="bottom" border-radius="10px 10px 0 0" :safe-area="false" :mask-click="false">
<view class="m-purchase-notice m-pop-bg"> <view class="m-purchase-notice m-pop-bg">
<view class="m-green-bg"></view> <view class="m-green-bg"></view>
<view class="m-red-bg"></view> <view class="m-red-bg"></view>
<view class="m-pop-title">{{ titleName }}游客</view> <view class="m-pop-title">{{ titleName }}游客</view>
<view class="m-form-box" v-if="ticket&& ticket.qmxId == null"> <view class="m-form-box" v-if="ticket && ticket.qmxId == null">
<uni-forms class="m-form" ref="peopleForm" :modelValue="baseFormData"> <uni-forms class="m-form" ref="peopleForm" :modelValue="baseFormData">
<uni-row class="m-row"> <uni-row class="m-row">
<!-- <uni-col class="m-col" :span="ticket.ischeckedIdcard == 1 ? 18 : 24"> --> <!-- <uni-col class="m-col" :span="ticket.ischeckedIdcard == 1 ? 18 : 24"> -->
@ -418,8 +418,11 @@ const validateID = (idType, value) => {
let regex; let regex;
debugger debugger
switch (idType) { switch (idType) {
case 1: //
regex = /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}$)/;
break;
case '1': // case '1': //
regex = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/; regex = /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}$)/;
break; break;
case '2': // case '2': //
regex = /^[A-Za-z0-9]{5,20}$/; regex = /^[A-Za-z0-9]{5,20}$/;
@ -454,6 +457,7 @@ const validateID = (idType, value) => {
default: default:
return false; return false;
} }
console.log(idType, value, regex.test(value))
return regex.test(value); return regex.test(value);
}; };
export default { export default {
@ -737,7 +741,7 @@ export default {
getdateTicket() { getdateTicket() {
let that = this; let that = this;
debugger debugger
if (this.ticket&&this.ticket.qmxId == null) { if (this.ticket && this.ticket.qmxId == null) {
if (this.ticket.datesettings == 1) { if (this.ticket.datesettings == 1) {
// //
this.ticket.date = that.parseTime(new Date()) this.ticket.date = that.parseTime(new Date())
@ -861,7 +865,7 @@ export default {
if (fullDate < that.parseTime(new Date())) { if (fullDate < that.parseTime(new Date())) {
fullDate = that.parseTime(new Date()); fullDate = that.parseTime(new Date());
} }
if (that.ticket&&that.ticket.qmxId == null) { if (that.ticket && that.ticket.qmxId == null) {
if (that.ticket.inventorySettings == 1 || that.ticket.inventorySettings == 2) { if (that.ticket.inventorySettings == 1 || that.ticket.inventorySettings == 2) {
const params = { const params = {
ticketId: that.ticket.id, ticketId: that.ticket.id,
@ -949,7 +953,7 @@ export default {
}, },
// //
peopleNums() { peopleNums() {
if(this.ticket.touristInformation == 3){ if (this.ticket.touristInformation == 3) {
return Number(this.ticket.usersNumber ? this.ticket.usersNumber : 0) * Number(this.ticket.num ? this.ticket.num : 0); return Number(this.ticket.usersNumber ? this.ticket.usersNumber : 0) * Number(this.ticket.num ? this.ticket.num : 0);
} }
if (this.ticket.touristInformation == 2) { if (this.ticket.touristInformation == 2) {
@ -1096,7 +1100,7 @@ export default {
phoneNumber: null, phoneNumber: null,
id: null, id: null,
selected: false, selected: false,
idtype: this.ticket&&this.ticket.qmxId == null ? '1' : this.ticketIdType idtype: this.ticket && this.ticket.qmxId == null ? '1' : this.ticketIdType
} }
}) })
@ -1120,7 +1124,7 @@ export default {
phoneNumber: null, phoneNumber: null,
id: null, id: null,
selected: false, selected: false,
idtype: this.ticket&&this.ticket.qmxId == null ? '1' : this.ticketIdType idtype: this.ticket && this.ticket.qmxId == null ? '1' : this.ticketIdType
} }
this.$refs.mAddPerson.open(); this.$refs.mAddPerson.open();
this.$refs.scroll.close(); this.$refs.scroll.close();
@ -1133,7 +1137,7 @@ export default {
this.$refs.scroll.close(); this.$refs.scroll.close();
this.$refs.mAddPerson.open(); this.$refs.mAddPerson.open();
this.titleName = "编辑"; this.titleName = "编辑";
if (this.ticket&&this.ticket.qmxId == null) { if (this.ticket && this.ticket.qmxId == null) {
this.baseFormData = val; this.baseFormData = val;
} else { } else {
this.baseFormData = val; this.baseFormData = val;
@ -1216,7 +1220,7 @@ export default {
debugger debugger
if (that.ticket&&that.ticket.qmxId == null) { if (that.ticket && that.ticket.qmxId == null) {
if (that.ticket.touristInformation == 1) { if (that.ticket.touristInformation == 1) {
const httpData = { const httpData = {
@ -1398,8 +1402,16 @@ export default {
true true
) )
.then(res => { .then(res => {
this.orderInfo = res.data; if (res.code == 0 && res.data != null) {
this.isPayPopup = true; this.orderInfo = res.data;
this.isPayPopup = true;
}
else {
uni.showToast({
title: res.msg+'请检查',
icon: 'none'
});
}
}) })
.catch(err => { .catch(err => {
console.log(err); console.log(err);

Loading…
Cancel
Save