# Conflicts: # app/pages/users/login/index.vueproperty-only-app
commit
2608bb1245
@ -0,0 +1,97 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="cus-header" :style="{ marginTop: safeTop + 'px' }">
|
||||||
|
<text class="title">{{ title }}</text>
|
||||||
|
<view class="header-buttons">
|
||||||
|
<view class="back-btn" @click="handleBack" v-if="showBack">
|
||||||
|
<text class="back-icon">←</text>
|
||||||
|
</view>
|
||||||
|
<slot name="right"></slot>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view :style="{ marginTop: safeTop + 'px', height: '40px' }"></view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
showBack: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
safeTop: 30
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
const info = uni.getWindowInfo();
|
||||||
|
this.safeTop = Math.max(info.safeAreaInsets.top, 30);
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleBack() {
|
||||||
|
this.$emit('back');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.cus-header {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cus-header .title {
|
||||||
|
font-size: 52rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #fff;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
text-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-buttons {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 20rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.back-btn {
|
||||||
|
width: 80rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
background: rgba(255, 255, 255, 0.2);
|
||||||
|
border-radius: 50%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
backdrop-filter: blur(10rpx);
|
||||||
|
box-shadow: 0 4rpx 15rpx rgba(0, 0, 0, 0.1);
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.back-btn:active {
|
||||||
|
transform: scale(0.9);
|
||||||
|
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.15);
|
||||||
|
}
|
||||||
|
|
||||||
|
.back-icon {
|
||||||
|
font-size: 40rpx;
|
||||||
|
color: #fff;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -0,0 +1,185 @@
|
|||||||
|
<template>
|
||||||
|
<view class="input-component">
|
||||||
|
<view v-if="label" class="label-wrapper">
|
||||||
|
<text class="label">{{ label }}</text>
|
||||||
|
<text v-if="required" class="required">*</text>
|
||||||
|
</view>
|
||||||
|
<view class="input-wrapper" :class="{ 'textarea-wrapper': textarea }">
|
||||||
|
<view v-if="icon" class="input-icon" :class="{ 'textarea-icon': textarea }">{{ icon }}</view>
|
||||||
|
<input
|
||||||
|
v-if="!textarea"
|
||||||
|
v-model="inputValue"
|
||||||
|
class="input"
|
||||||
|
:type="type"
|
||||||
|
:placeholder="placeholder"
|
||||||
|
:placeholder-class="'placeholder'"
|
||||||
|
@input="handleInput"
|
||||||
|
@focus="handleFocus"
|
||||||
|
@blur="handleBlur"
|
||||||
|
/>
|
||||||
|
<textarea
|
||||||
|
v-else
|
||||||
|
v-model="inputValue"
|
||||||
|
class="textarea"
|
||||||
|
:placeholder="placeholder"
|
||||||
|
:placeholder-class="'placeholder'"
|
||||||
|
:rows="rows"
|
||||||
|
@input="handleInput"
|
||||||
|
@focus="handleFocus"
|
||||||
|
@blur="handleBlur"
|
||||||
|
></textarea>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
value: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
required: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
icon: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
textarea: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
type: {
|
||||||
|
type: String,
|
||||||
|
default: 'text'
|
||||||
|
},
|
||||||
|
placeholder: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
rows: {
|
||||||
|
type: Number,
|
||||||
|
default: 3
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
inputValue: this.value
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
value(newVal) {
|
||||||
|
if (newVal !== this.inputValue) {
|
||||||
|
this.inputValue = newVal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleInput(event) {
|
||||||
|
this.$emit('input', this.inputValue);
|
||||||
|
},
|
||||||
|
handleFocus(event) {
|
||||||
|
this.$emit('focus', event);
|
||||||
|
},
|
||||||
|
handleBlur(event) {
|
||||||
|
this.$emit('blur', event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.input-component {
|
||||||
|
margin-bottom: 50rpx;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label-wrapper {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label {
|
||||||
|
font-size: 34rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.required {
|
||||||
|
color: #ff6b6b;
|
||||||
|
margin-left: 8rpx;
|
||||||
|
font-size: 36rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-wrapper {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
background: #f8f9fa;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
border: 2rpx solid transparent;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-wrapper.textarea-wrapper {
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-wrapper:focus-within {
|
||||||
|
border-color: #2a5298;
|
||||||
|
background: #fff;
|
||||||
|
box-shadow: 0 0 0 6rpx rgba(42, 82, 152, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-icon {
|
||||||
|
width: 80rpx;
|
||||||
|
min-height: 92rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 40rpx;
|
||||||
|
color: #2a5298;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-icon.textarea-icon {
|
||||||
|
align-items: flex-start;
|
||||||
|
padding-top: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input {
|
||||||
|
flex: 1;
|
||||||
|
height: 92rpx;
|
||||||
|
border: none;
|
||||||
|
background: transparent;
|
||||||
|
padding: 0 24rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #333;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input::placeholder {
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.textarea {
|
||||||
|
flex: 1;
|
||||||
|
border: none;
|
||||||
|
background: transparent;
|
||||||
|
padding: 24rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #333;
|
||||||
|
box-sizing: border-box;
|
||||||
|
resize: none;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.textarea::placeholder {
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -0,0 +1,514 @@
|
|||||||
|
<template>
|
||||||
|
<view class="container">
|
||||||
|
<!-- 顶部装饰条 -->
|
||||||
|
<view class="top-decoration"></view>
|
||||||
|
|
||||||
|
<view class="header">
|
||||||
|
<image src="/static/logo.png" class="logo" mode="aspectFit"></image>
|
||||||
|
<text class="title">访客登记</text>
|
||||||
|
<text class="subtitle">请填写以下信息进行登记</text>
|
||||||
|
<view class="header-buttons">
|
||||||
|
<view class="user-center-btn" @click="handleGoHome">
|
||||||
|
<text class="user-icon">🏠</text>
|
||||||
|
<text class="user-text">首页</text>
|
||||||
|
</view>
|
||||||
|
<view class="user-center-btn" @click="handleUserCenter">
|
||||||
|
<text class="user-icon">👤</text>
|
||||||
|
<text class="user-text">我的</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="form-card">
|
||||||
|
<!-- 访客姓名 -->
|
||||||
|
<VisitorInput
|
||||||
|
v-model="form.visitorName"
|
||||||
|
label="姓名"
|
||||||
|
required
|
||||||
|
icon="👤"
|
||||||
|
placeholder="请输入您的姓名"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 访客手机号 -->
|
||||||
|
<VisitorInput
|
||||||
|
v-model="form.visitorPhone"
|
||||||
|
label="手机号"
|
||||||
|
required
|
||||||
|
icon="📱"
|
||||||
|
type="number"
|
||||||
|
placeholder="请输入您的手机号"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 车牌号码 -->
|
||||||
|
<VisitorInput
|
||||||
|
v-model="form.licensePlateNumber"
|
||||||
|
label="车牌号码"
|
||||||
|
required
|
||||||
|
icon="🚙"
|
||||||
|
placeholder="请输入车牌号"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 受访人所在部门 -->
|
||||||
|
<VisitorInput
|
||||||
|
v-model="form.memberOrg"
|
||||||
|
label="受访人所在部门"
|
||||||
|
required
|
||||||
|
icon="🏢"
|
||||||
|
placeholder="请输入受访人所在部门"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 受访人姓名 -->
|
||||||
|
<VisitorInput
|
||||||
|
v-model="form.memberName"
|
||||||
|
label="被访人姓名"
|
||||||
|
required
|
||||||
|
icon="👥"
|
||||||
|
placeholder="请输入受访人姓名"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 受访人手机号 -->
|
||||||
|
<VisitorInput
|
||||||
|
v-model="form.memberPhone"
|
||||||
|
label="被访人手机号"
|
||||||
|
required
|
||||||
|
icon="📱"
|
||||||
|
type="number"
|
||||||
|
placeholder="请输入受访人手机号"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 来访事由 -->
|
||||||
|
<VisitorInput
|
||||||
|
v-model="form.reason"
|
||||||
|
label="来访事由"
|
||||||
|
required
|
||||||
|
icon="📝"
|
||||||
|
textarea
|
||||||
|
rows="2"
|
||||||
|
placeholder="请输入来访事由"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 预约日期 -->
|
||||||
|
<view class="form-item">
|
||||||
|
<text class="form-label required">预约日期</text>
|
||||||
|
<picker mode="date" :value="form.visitDate" :start="minDate" :end="maxDate" @change="handleDateChange">
|
||||||
|
<view class="date-picker-btn">
|
||||||
|
<text>{{ form.visitDate || '请选择预约日期' }}</text>
|
||||||
|
</view>
|
||||||
|
</picker>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 预约时间区间 -->
|
||||||
|
<view class="form-item">
|
||||||
|
<text class="form-label required">选择区间</text>
|
||||||
|
<view class="time-range">
|
||||||
|
<picker mode="time" :value="form.startTime" @change="handleStartTimeChange">
|
||||||
|
<view class="date-picker-btn time-btn">
|
||||||
|
<text>{{ form.startTime || '开始时间' }}</text>
|
||||||
|
</view>
|
||||||
|
</picker>
|
||||||
|
<text class="time-separator">至</text>
|
||||||
|
<picker mode="time" :value="form.endTime" @change="handleEndTimeChange">
|
||||||
|
<view class="date-picker-btn time-btn">
|
||||||
|
<text>{{ form.endTime || '结束时间' }}</text>
|
||||||
|
</view>
|
||||||
|
</picker>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<button class="submit-btn" @click="handleSubmit" :disabled="!isFormValid">
|
||||||
|
<text class="btn-text">提交登记</text>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<!-- 查看访问记录按钮 -->
|
||||||
|
<button class="records-btn" @click="handleViewRecords">
|
||||||
|
<text class="btn-text">查看访问记录</text>
|
||||||
|
</button>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 底部装饰 -->
|
||||||
|
<view class="bottom-decoration"></view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { api_addVisit } from '@/api/property.js';
|
||||||
|
import VisitorInput from './components/VisitorInput.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: { VisitorInput },
|
||||||
|
data() {
|
||||||
|
const today = new Date();
|
||||||
|
const minDate = `${today.getFullYear()}-${String(today.getMonth() + 1).padStart(2, '0')}-${String(today.getDate()).padStart(2, '0')}`;
|
||||||
|
return {
|
||||||
|
minDate,
|
||||||
|
maxDate: '2050-12-31',
|
||||||
|
form: {
|
||||||
|
visitorName: '',
|
||||||
|
visitorPhone: '',
|
||||||
|
memberName: '',
|
||||||
|
memberPhone: '',
|
||||||
|
memberOrg: '',
|
||||||
|
reason: '',
|
||||||
|
visitDate: '',
|
||||||
|
startTime: '',
|
||||||
|
endTime: '',
|
||||||
|
visitStartTime: null,
|
||||||
|
visitEndTime: null,
|
||||||
|
licensePlateNumber: '',
|
||||||
|
openId: ''
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
isFormValid() {
|
||||||
|
return this.form.visitorName &&
|
||||||
|
/^1[3-9]\d{9}$/.test(this.form.visitorPhone) &&
|
||||||
|
this.form.memberName &&
|
||||||
|
/^1[3-9]\d{9}$/.test(this.form.memberPhone) &&
|
||||||
|
this.form.memberOrg &&
|
||||||
|
this.form.reason &&
|
||||||
|
this.form.visitStartTime &&
|
||||||
|
this.form.visitEndTime &&
|
||||||
|
this.form.visitStartTime < this.form.visitEndTime &&
|
||||||
|
this.form.licensePlateNumber;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleDateChange(e) {
|
||||||
|
this.form.visitDate = e.detail.value;
|
||||||
|
this.updateVisitTime();
|
||||||
|
},
|
||||||
|
handleStartTimeChange(e) {
|
||||||
|
this.form.startTime = e.detail.value;
|
||||||
|
this.updateVisitTime();
|
||||||
|
},
|
||||||
|
handleEndTimeChange(e) {
|
||||||
|
this.form.endTime = e.detail.value;
|
||||||
|
this.updateVisitTime();
|
||||||
|
},
|
||||||
|
updateVisitTime() {
|
||||||
|
if (!this.form.visitDate || !this.form.startTime || !this.form.endTime) return;
|
||||||
|
this.form.visitStartTime = `${this.form.visitDate} ${this.form.startTime}:00`;
|
||||||
|
this.form.visitEndTime = `${this.form.visitDate} ${this.form.endTime}:59`;
|
||||||
|
},
|
||||||
|
async getWechatAuth() {
|
||||||
|
try {
|
||||||
|
uni.showLoading({ title: '正在获取授权...' });
|
||||||
|
const { code } = await uni.login();
|
||||||
|
// 实际项目中应将 code 发送到后端换取 openId
|
||||||
|
this.form.openId = 'mock_open_id_' + Date.now();
|
||||||
|
uni.hideLoading();
|
||||||
|
return true;
|
||||||
|
} catch (error) {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({ title: '获取授权失败,请重试', icon: 'none' });
|
||||||
|
console.error('微信授权失败:', error);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async handleSubmit() {
|
||||||
|
const authSuccess = await this.getWechatAuth();
|
||||||
|
if (!authSuccess) return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
uni.showLoading({ title: '正在提交...' });
|
||||||
|
await api_addVisit({ ...this.form });
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({ title: '登记成功', icon: 'success' });
|
||||||
|
|
||||||
|
// 重置表单
|
||||||
|
const openId = this.form.openId;
|
||||||
|
this.form = {
|
||||||
|
visitorName: '',
|
||||||
|
visitorPhone: '',
|
||||||
|
memberName: '',
|
||||||
|
memberPhone: '',
|
||||||
|
memberOrg: '',
|
||||||
|
reason: '',
|
||||||
|
visitDate: '',
|
||||||
|
startTime: '',
|
||||||
|
endTime: '',
|
||||||
|
visitStartTime: null,
|
||||||
|
visitEndTime: null,
|
||||||
|
licensePlateNumber: '',
|
||||||
|
openId
|
||||||
|
};
|
||||||
|
} catch (error) {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({ title: '提交失败,请重试', icon: 'none' });
|
||||||
|
console.error('提交失败:', error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleViewRecords() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/supply_chain/visitor_records/index?openid=${this.form.openId}`
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleUserCenter() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/supply_chain/visitor_user/index?openid=${this.form.openId}`
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleGoHome() {
|
||||||
|
uni.reLaunch({
|
||||||
|
url: '/pages/index/index'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.container {
|
||||||
|
min-height: 100vh;
|
||||||
|
background: linear-gradient(135deg, #3a5da6 0%, #4a72c2 100%);
|
||||||
|
padding: 20rpx;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-decoration {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
height: 10rpx;
|
||||||
|
background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
margin-top: 60rpx;
|
||||||
|
margin-bottom: 60rpx;
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-buttons {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 18rpx;
|
||||||
|
left: 20rpx;
|
||||||
|
right: 20rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-center-btn {
|
||||||
|
width: 98rpx;
|
||||||
|
height: 98rpx;
|
||||||
|
background: rgba(255, 255, 255, 0.2);
|
||||||
|
border-radius: 50%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
backdrop-filter: blur(10rpx);
|
||||||
|
box-shadow: 0 4rpx 15rpx rgba(0, 0, 0, 0.1);
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-center-btn:active {
|
||||||
|
transform: scale(0.9);
|
||||||
|
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.15);
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-icon {
|
||||||
|
font-size: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-text {
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: 300;
|
||||||
|
color: rgba(255, 255, 255, 0.6);
|
||||||
|
line-height: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo {
|
||||||
|
width: 180rpx;
|
||||||
|
height: 180rpx;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
box-shadow: 0 8rpx 30rpx rgba(0, 0, 0, 0.15);
|
||||||
|
background-color: rgba(255, 255, 255, 0.9);
|
||||||
|
padding: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 52rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #fff;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
text-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.subtitle {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: rgba(255, 255, 255, 0.9);
|
||||||
|
font-weight: 300;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-card {
|
||||||
|
background: rgba(255, 255, 255, 0.95);
|
||||||
|
border-radius: 24rpx;
|
||||||
|
padding: 50rpx;
|
||||||
|
box-shadow: 0 20rpx 60rpx rgba(0, 0, 0, 0.15);
|
||||||
|
backdrop-filter: blur(10rpx);
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-item {
|
||||||
|
margin-bottom: 40rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-label {
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #333;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-label.required::after {
|
||||||
|
content: '*';
|
||||||
|
color: #ff6b6b;
|
||||||
|
margin-left: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.date-picker-btn {
|
||||||
|
width: 100%;
|
||||||
|
height: 96rpx;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 32rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #666;
|
||||||
|
border: 2rpx solid #e0e0e0;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.date-picker-btn:active {
|
||||||
|
background-color: #e0e0e0;
|
||||||
|
border-color: #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.time-range {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.time-btn {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.time-separator {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.submit-btn {
|
||||||
|
width: 100%;
|
||||||
|
height: 104rpx;
|
||||||
|
background: linear-gradient(135deg, #3a5da6 0%, #4a72c2 100%);
|
||||||
|
color: #fff;
|
||||||
|
font-size: 38rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
border-radius: 52rpx;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
border: none;
|
||||||
|
box-shadow: 0 12rpx 30rpx rgba(42, 82, 152, 0.4);
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.submit-btn:active {
|
||||||
|
transform: translateY(4rpx);
|
||||||
|
box-shadow: 0 8rpx 20rpx rgba(102, 126, 234, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.submit-btn:disabled {
|
||||||
|
background: linear-gradient(135deg, #c0c4cc 0%, #a0a0a0 100%);
|
||||||
|
box-shadow: 0 8rpx 20rpx rgba(192, 196, 204, 0.3);
|
||||||
|
transform: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.records-btn {
|
||||||
|
width: 100%;
|
||||||
|
height: 104rpx;
|
||||||
|
background: linear-gradient(135deg, #3a5da6 0%, #4a72c2 100%);
|
||||||
|
color: #fff;
|
||||||
|
font-size: 38rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
border-radius: 52rpx;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
border: 2rpx solid #3a5da6;
|
||||||
|
box-shadow: 0 6rpx 20rpx rgba(58, 93, 166, 0.2);
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.records-btn:active {
|
||||||
|
transform: translateY(4rpx);
|
||||||
|
box-shadow: 0 4rpx 15rpx rgba(42, 82, 152, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-text {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
z-index: 1;
|
||||||
|
color: #fff;
|
||||||
|
height: 104rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom-decoration {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
height: 200rpx;
|
||||||
|
background: linear-gradient(180deg, transparent, rgba(42, 82, 152, 0.2));
|
||||||
|
opacity: 0.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 20%;
|
||||||
|
right: 10%;
|
||||||
|
width: 200rpx;
|
||||||
|
height: 200rpx;
|
||||||
|
background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
|
||||||
|
border-radius: 50%;
|
||||||
|
animation: float 6s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
bottom: 30%;
|
||||||
|
left: 5%;
|
||||||
|
width: 150rpx;
|
||||||
|
height: 150rpx;
|
||||||
|
background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
|
||||||
|
border-radius: 50%;
|
||||||
|
animation: float 8s ease-in-out infinite reverse;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes float {
|
||||||
|
0%, 100% {
|
||||||
|
transform: translateY(0rpx) scale(1);
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
transform: translateY(-30rpx) scale(1.1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -0,0 +1,212 @@
|
|||||||
|
<template>
|
||||||
|
<view class="container">
|
||||||
|
<!-- 顶部装饰条 -->
|
||||||
|
<view class="top-decoration"></view>
|
||||||
|
|
||||||
|
<CustomHeader title="个人中心" @back="handleBack" />
|
||||||
|
|
||||||
|
<view class="user-info-card">
|
||||||
|
<view class="user-avatar">
|
||||||
|
<text class="avatar-icon">👤</text>
|
||||||
|
</view>
|
||||||
|
<text class="user-name">{{ userName }}</text>
|
||||||
|
<text class="wechat-status">
|
||||||
|
<text class="status-icon">{{ isWechatBound ? '✓' : '!' }}</text>
|
||||||
|
{{ isWechatBound ? '微信已绑定' : '微信未绑定' }}
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="menu-list">
|
||||||
|
<view class="menu-item" @click="handleVisitRecords">
|
||||||
|
<text class="menu-icon">📋</text>
|
||||||
|
<text class="menu-text">访问记录</text>
|
||||||
|
<text class="menu-arrow">→</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="menu-item" @click="handleAccessCredential">
|
||||||
|
<text class="menu-icon">🎫</text>
|
||||||
|
<text class="menu-text">访问凭证</text>
|
||||||
|
<text class="menu-arrow">→</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="menu-item" @click="handleWechatBind">
|
||||||
|
<text class="menu-icon">🔗</text>
|
||||||
|
<text class="menu-text">微信绑定</text>
|
||||||
|
<text class="menu-arrow">→</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 底部装饰 -->
|
||||||
|
<view class="bottom-decoration"></view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import CustomHeader from '../components/CustomHeader.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: { CustomHeader },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
openid: '',
|
||||||
|
userName: '访客用户',
|
||||||
|
isWechatBound: true
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
this.openid = options.openid || '';
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
// 模拟获取用户信息
|
||||||
|
setTimeout(() => {
|
||||||
|
this.userName = '访客_' + this.openid.slice(-4);
|
||||||
|
}, 500);
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleBack() {
|
||||||
|
uni.navigateBack();
|
||||||
|
},
|
||||||
|
handleVisitRecords() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/supply_chain/visitor_records/index?openid=${this.openid}`
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleAccessCredential() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/supply_chain/visitor_credential/index?openid=${this.openid}`
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleWechatBind() {
|
||||||
|
if (this.isWechatBound) {
|
||||||
|
uni.showToast({ title: '微信已绑定', icon: 'success' });
|
||||||
|
} else {
|
||||||
|
uni.showToast({ title: '微信绑定功能开发中', icon: 'none' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.container {
|
||||||
|
min-height: 100vh;
|
||||||
|
background: linear-gradient(135deg, #3a5da6 0%, #4a72c2 100%);
|
||||||
|
padding: 20rpx;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-decoration {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
height: 10rpx;
|
||||||
|
background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-info-card {
|
||||||
|
background: rgba(255, 255, 255, 0.95);
|
||||||
|
border-radius: 24rpx;
|
||||||
|
padding: 50rpx;
|
||||||
|
box-shadow: 0 20rpx 60rpx rgba(0, 0, 0, 0.15);
|
||||||
|
backdrop-filter: blur(10rpx);
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 40rpx;
|
||||||
|
margin-top: 12rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-avatar {
|
||||||
|
width: 160rpx;
|
||||||
|
height: 160rpx;
|
||||||
|
background: linear-gradient(135deg, #3a5da6 0%, #4a72c2 100%);
|
||||||
|
border-radius: 50%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
box-shadow: 0 12rpx 30rpx rgba(58, 93, 166, 0.4);
|
||||||
|
}
|
||||||
|
|
||||||
|
.avatar-icon {
|
||||||
|
font-size: 80rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-name {
|
||||||
|
font-size: 44rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #333;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wechat-status {
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #666;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-icon {
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #4caf50;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-list {
|
||||||
|
background: rgba(255, 255, 255, 0.95);
|
||||||
|
border-radius: 24rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
box-shadow: 0 20rpx 60rpx rgba(0, 0, 0, 0.15);
|
||||||
|
backdrop-filter: blur(10rpx);
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 40rpx 30rpx;
|
||||||
|
border-bottom: 1rpx solid rgba(58, 93, 166, 0.1);
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-item:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-item:active {
|
||||||
|
background: rgba(58, 93, 166, 0.05);
|
||||||
|
border-radius: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-icon {
|
||||||
|
font-size: 44rpx;
|
||||||
|
margin-right: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-text {
|
||||||
|
flex: 1;
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-arrow {
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom-decoration {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
height: 200rpx;
|
||||||
|
background: linear-gradient(180deg, transparent, rgba(42, 82, 152, 0.2));
|
||||||
|
opacity: 0.6;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Loading…
Reference in new issue