jqy
parent
aaca346538
commit
5d1de382fa
@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "物品详情"
|
||||
}
|
||||
@ -0,0 +1,146 @@
|
||||
<view class="container">
|
||||
<view class="detail-card" wx:if="{{!showMap}}">
|
||||
<!-- 物品图标和名称 -->
|
||||
<view class="item-header">
|
||||
<text class="item-icon">{{currentItem.icon}}</text>
|
||||
<text class="item-title">{{currentItem.name}}</text>
|
||||
</view>
|
||||
|
||||
<!-- 详细信息 -->
|
||||
<view class="info-section">
|
||||
<view class="info-row">
|
||||
<text class="info-label">物品名称:</text>
|
||||
<text class="info-value">{{currentItem.name}}</text>
|
||||
</view>
|
||||
|
||||
<view class="info-row">
|
||||
<text class="info-label">颜色:</text>
|
||||
<text class="info-value">{{currentItem.color}}</text>
|
||||
</view>
|
||||
|
||||
<view class="info-row">
|
||||
<text class="info-label">特征:</text>
|
||||
<text class="info-value">{{currentItem.feature}}</text>
|
||||
</view>
|
||||
|
||||
<view class="info-row">
|
||||
<text class="info-label">品牌:</text>
|
||||
<text class="info-value">{{currentItem.brand}}</text>
|
||||
</view>
|
||||
|
||||
<view class="info-row">
|
||||
<text class="info-label">联系方式:</text>
|
||||
<text class="info-value">{{currentItem.telephone}}</text>
|
||||
</view>
|
||||
|
||||
<view class="info-row">
|
||||
<text class="info-label">当前位置:</text>
|
||||
<text class="info-value">{{currentItem.location}}</text>
|
||||
</view>
|
||||
|
||||
<view class="info-row full-width">
|
||||
<text class="info-label">详细描述:</text>
|
||||
<text class="info-value description">{{currentItem.description}}</text>
|
||||
</view>
|
||||
|
||||
<!-- 新增:物品照片 -->
|
||||
<view class="info-row full-width" wx:if="{{currentItem.photo}}">
|
||||
<text class="info-label">物品照片:</text>
|
||||
<view class="photo-container">
|
||||
<image
|
||||
src="{{currentItem.photo}}"
|
||||
class="item-photo"
|
||||
mode="aspectFit"
|
||||
bindtap="previewPhoto"
|
||||
binderror="onImageError"
|
||||
/>
|
||||
<text class="photo-tip">点击查看大图</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<view class="action-buttons">
|
||||
<button class="contact-btn" bindtap="showMapView">查看地图</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 地图视图 -->
|
||||
<view class="map-container" wx:if="{{showMap}}">
|
||||
<view class="map-header">
|
||||
<view class="back-btn" bindtap="hideMapView">
|
||||
<text class="back-icon">←</text>
|
||||
<text class="back-text">返回详情</text>
|
||||
</view>
|
||||
<text class="map-title">物品位置 - {{currentItem.location}}</text>
|
||||
</view>
|
||||
|
||||
<map
|
||||
id="campusMap"
|
||||
class="campus-map"
|
||||
longitude="{{mapLongitude}}"
|
||||
latitude="{{mapLatitude}}"
|
||||
scale="18"
|
||||
markers="{{markers}}"
|
||||
show-location
|
||||
bindmarkertap="onMarkerTap"
|
||||
>
|
||||
</map>
|
||||
|
||||
<view class="map-info">
|
||||
<text class="location-info">📍 {{currentItem.location}}</text>
|
||||
<text class="item-info">{{currentItem.name}} - {{currentItem.color}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 物品状态信息 -->
|
||||
<view class="status-section">
|
||||
<view class="section-header">
|
||||
<text class="section-title">物品状态</text>
|
||||
</view>
|
||||
|
||||
<view class="status-item">
|
||||
<text class="status-label">物品状态:</text>
|
||||
<text class="status-value {{currentItem.state === '已领取' ? 'claimed' : 'unclaimed'}}">
|
||||
{{currentItem.state || '未领取'}}
|
||||
</text>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{currentItem.state === '已领取' && currentItem.claim_phone}}" class="status-item">
|
||||
<text class="status-label">认领人手机:</text>
|
||||
<text class="claim-phone">{{currentItem.claim_phone}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 认领按钮 -->
|
||||
<view wx:if="{{currentItem.state !== '已领取'}}" class="claim-section">
|
||||
<button class="claim-btn" bindtap="showClaimModal">
|
||||
我要认领
|
||||
</button>
|
||||
</view>
|
||||
|
||||
<!-- 认领模态框 -->
|
||||
<view wx:if="{{showClaimModal}}" class="modal-mask">
|
||||
<view class="modal-content">
|
||||
<view class="modal-header">
|
||||
<text class="modal-title">认领物品</text>
|
||||
</view>
|
||||
<view class="modal-body">
|
||||
<text class="modal-tip">请输入您的手机号进行认领:</text>
|
||||
<input
|
||||
class="phone-input {{phoneError ? 'error' : ''}}"
|
||||
type="number"
|
||||
placeholder="请输入11位手机号"
|
||||
maxlength="11"
|
||||
value="{{claimPhone}}"
|
||||
bindinput="onClaimPhoneInput"
|
||||
/>
|
||||
<text wx:if="{{phoneError}}" class="error-text">手机号格式不正确</text>
|
||||
</view>
|
||||
<view class="modal-footer">
|
||||
<button class="btn-cancel" bindtap="hideClaimModal">取消</button>
|
||||
<button class="btn-confirm" bindtap="confirmClaim">确认认领</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -0,0 +1,468 @@
|
||||
.container {
|
||||
padding: 40rpx;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.detail-card {
|
||||
background: white;
|
||||
border-radius: 32rpx;
|
||||
padding: 60rpx 40rpx;
|
||||
box-shadow: 0 20rpx 60rpx rgba(0, 0, 0, 0.1);
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
/* 物品头部 */
|
||||
.item-header {
|
||||
text-align: center;
|
||||
margin-bottom: 60rpx;
|
||||
padding-bottom: 40rpx;
|
||||
border-bottom: 2rpx solid #f0f0f0;
|
||||
}
|
||||
|
||||
.item-icon {
|
||||
font-size: 120rpx;
|
||||
display: block;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.item-title {
|
||||
font-size: 48rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
/* 信息区域 */
|
||||
.info-section {
|
||||
margin-bottom: 60rpx;
|
||||
}
|
||||
|
||||
.info-row {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 40rpx;
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 1rpx solid #f8f8f8;
|
||||
}
|
||||
|
||||
.info-row.full-width {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.info-label {
|
||||
width: 200rpx;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
font-weight: bold;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.info-value {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.info-value.description {
|
||||
background-color: #f8f8f8;
|
||||
padding: 30rpx;
|
||||
border-radius: 16rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
/* 新增:照片容器样式 */
|
||||
.photo-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.item-photo {
|
||||
width: 100%;
|
||||
height: 400rpx;
|
||||
border-radius: 16rpx;
|
||||
background-color: #f8f8f8;
|
||||
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.photo-tip {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
margin-top: 16rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* 操作按钮 */
|
||||
.action-buttons {
|
||||
display: flex;
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.contact-btn {
|
||||
flex: 1;
|
||||
background-color: #007AFF;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 16rpx;
|
||||
padding: 28rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* 地图容器 */
|
||||
.map-container {
|
||||
height: 1300rpx;
|
||||
background: white;
|
||||
border-radius: 32rpx;
|
||||
overflow: hidden;
|
||||
margin-top: 20rpx;
|
||||
box-shadow: 0 20rpx 60rpx rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.map-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 30rpx 40rpx;
|
||||
background: linear-gradient(135deg, #007AFF 0%, #0056CC 100%);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.back-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 15rpx 25rpx;
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
border-radius: 25rpx;
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
|
||||
.back-icon {
|
||||
font-size: 32rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.back-text {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.map-title {
|
||||
flex: 1;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.campus-map {
|
||||
width: 100%;
|
||||
height: 1030rpx;
|
||||
}
|
||||
|
||||
.map-info {
|
||||
padding: 30rpx 40rpx;
|
||||
background: #f8f8f8;
|
||||
}
|
||||
|
||||
.location-info {
|
||||
display: block;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
margin-bottom: 15rpx;
|
||||
}
|
||||
|
||||
.item-info {
|
||||
display: block;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
/* 在原有样式基础上添加以下样式 */
|
||||
|
||||
/* 在原有样式基础上添加以下样式 */
|
||||
|
||||
.container {
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.section-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.refresh-btn {
|
||||
background: #1989fa;
|
||||
color: white;
|
||||
font-size: 24rpx;
|
||||
padding: 10rpx 20rpx;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.item-card {
|
||||
background: #fff;
|
||||
padding: 30rpx;
|
||||
margin: 20rpx;
|
||||
border-radius: 15rpx;
|
||||
box-shadow: 0 4rpx 15rpx rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
.item-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.item-icon {
|
||||
font-size: 48rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.item-name {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.item-info {
|
||||
margin-bottom: 25rpx;
|
||||
}
|
||||
|
||||
.item-description {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.item-details {
|
||||
border-top: 1rpx solid #f0f0f0;
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
|
||||
.detail-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 12rpx 0;
|
||||
border-bottom: 1rpx solid #f8f8f8;
|
||||
}
|
||||
|
||||
.detail-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.detail-label {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.detail-value {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.map-section {
|
||||
background: #fff;
|
||||
padding: 30rpx;
|
||||
margin: 20rpx;
|
||||
border-radius: 15rpx;
|
||||
box-shadow: 0 4rpx 15rpx rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
.map-container {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.map-placeholder {
|
||||
background: #f8f9fa;
|
||||
border: 2rpx dashed #dee2e6;
|
||||
border-radius: 10rpx;
|
||||
padding: 60rpx 20rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.map-tip {
|
||||
font-size: 28rpx;
|
||||
color: #6c757d;
|
||||
}
|
||||
|
||||
.map-actions {
|
||||
margin-top: 20rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
background: #6c757d;
|
||||
color: white;
|
||||
font-size: 28rpx;
|
||||
padding: 15rpx 30rpx;
|
||||
border-radius: 25rpx;
|
||||
}
|
||||
|
||||
/* 状态信息样式 */
|
||||
.status-section {
|
||||
background: #fff;
|
||||
padding: 30rpx;
|
||||
margin: 20rpx;
|
||||
border-radius: 15rpx;
|
||||
box-shadow: 0 4rpx 15rpx rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
.status-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
}
|
||||
|
||||
.status-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.status-label {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.status-value {
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.status-value.unclaimed {
|
||||
color: #e74c3c;
|
||||
}
|
||||
|
||||
.status-value.claimed {
|
||||
color: #27ae60;
|
||||
}
|
||||
|
||||
.claim-phone {
|
||||
font-size: 28rpx;
|
||||
color: #27ae60;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* 认领按钮样式 */
|
||||
.claim-section {
|
||||
padding: 0 20rpx;
|
||||
margin: 30rpx 20rpx;
|
||||
}
|
||||
|
||||
.claim-btn {
|
||||
background: #07c160;
|
||||
color: white;
|
||||
border-radius: 50rpx;
|
||||
font-size: 32rpx;
|
||||
padding: 25rpx 0;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.claim-btn:active {
|
||||
background: #06a952;
|
||||
}
|
||||
|
||||
/* 模态框样式 */
|
||||
.modal-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
background: white;
|
||||
border-radius: 20rpx;
|
||||
width: 600rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.modal-header {
|
||||
padding: 30rpx;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.modal-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.modal-body {
|
||||
padding: 40rpx 30rpx;
|
||||
}
|
||||
|
||||
.modal-tip {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
margin-bottom: 30rpx;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.phone-input {
|
||||
border: 2rpx solid #e0e0e0;
|
||||
border-radius: 10rpx;
|
||||
padding: 20rpx;
|
||||
font-size: 28rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.phone-input.error {
|
||||
border-color: #e74c3c;
|
||||
}
|
||||
|
||||
.error-text {
|
||||
color: #e74c3c;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.modal-footer {
|
||||
display: flex;
|
||||
border-top: 1rpx solid #f0f0f0;
|
||||
}
|
||||
|
||||
.btn-cancel, .btn-confirm {
|
||||
flex: 1;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
padding: 25rpx 0;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.btn-cancel {
|
||||
background: #f8f8f8;
|
||||
color: #666;
|
||||
border-right: 1rpx solid #f0f0f0;
|
||||
}
|
||||
|
||||
.btn-confirm {
|
||||
background: #07c160;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-cancel:active {
|
||||
background: #e8e8e8;
|
||||
}
|
||||
|
||||
.btn-confirm:active {
|
||||
background: #06a952;
|
||||
}
|
||||
@ -0,0 +1,125 @@
|
||||
// pages/login/login.js
|
||||
const defaultAvatarUrl = 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'
|
||||
|
||||
const API_BASE_URL = 'http://192.168.174.1:8000'
|
||||
Page({
|
||||
data: {
|
||||
userInfo: {
|
||||
avatarUrl: defaultAvatarUrl,
|
||||
nickName: '',
|
||||
},
|
||||
canLogin: false,
|
||||
defaultAvatarUrl: defaultAvatarUrl
|
||||
},
|
||||
|
||||
onLoad: function(options) {
|
||||
// 从首页传递过来的回调页面
|
||||
if (options.from) {
|
||||
this.setData({
|
||||
fromPage: options.from
|
||||
})
|
||||
}
|
||||
// 检查本地是否有用户信息
|
||||
this.checkUserInfo()
|
||||
},
|
||||
|
||||
checkUserInfo: function() {
|
||||
const userInfo = wx.getStorageSync('userInfo')
|
||||
if (userInfo) {
|
||||
this.setData({
|
||||
userInfo: userInfo,
|
||||
canLogin: true
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
onChooseAvatar: function(e) {
|
||||
const { avatarUrl } = e.detail
|
||||
const { nickName } = this.data.userInfo
|
||||
this.setData({
|
||||
"userInfo.avatarUrl": avatarUrl,
|
||||
canLogin: nickName && avatarUrl && avatarUrl !== defaultAvatarUrl,
|
||||
})
|
||||
},
|
||||
|
||||
onInputChange: function(e) {
|
||||
const nickName = e.detail.value
|
||||
const { avatarUrl } = this.data.userInfo
|
||||
this.setData({
|
||||
"userInfo.nickName": nickName,
|
||||
canLogin: nickName && avatarUrl && avatarUrl !== defaultAvatarUrl,
|
||||
})
|
||||
},
|
||||
|
||||
onGetUserInfo: function(e) {
|
||||
if (e.detail.userInfo) {
|
||||
// 用户同意授权
|
||||
const userInfo = e.detail.userInfo
|
||||
this.setData({
|
||||
userInfo: userInfo,
|
||||
canLogin: true
|
||||
})
|
||||
this.handleWechatLogin(userInfo)
|
||||
} else {
|
||||
// 用户拒绝授权
|
||||
wx.showToast({
|
||||
title: '授权失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
handleWechatLogin: function(userInfo) {
|
||||
wx.showLoading({
|
||||
title: '登录中...',
|
||||
})
|
||||
|
||||
wx.request({
|
||||
url: `${API_BASE_URL}/api/wechat/login/`,
|
||||
method: 'POST',
|
||||
data: {
|
||||
nickname: userInfo.nickName,
|
||||
},
|
||||
success: (res) => {
|
||||
wx.hideLoading()
|
||||
if (res.data.code === 200) {
|
||||
const userData = res.data.data
|
||||
|
||||
// 保存用户信息到本地
|
||||
wx.setStorageSync('userInfo', {
|
||||
nickName: userData.nickname,
|
||||
user_id: userData.user_id,
|
||||
wechat_id: userData.wechat_id
|
||||
})
|
||||
wx.setStorageSync('isLoggedIn', true)
|
||||
wx.setStorageSync('user_id', userData.user_id)
|
||||
|
||||
wx.showToast({
|
||||
title: '登录成功',
|
||||
icon: 'success',
|
||||
duration: 1500,
|
||||
success: () => {
|
||||
setTimeout(() => {
|
||||
wx.redirectTo({
|
||||
url: '/pages/match/match'
|
||||
})
|
||||
}, 1500)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: res.data.message || '登录失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
wx.hideLoading()
|
||||
wx.showToast({
|
||||
title: '网络连接失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "登录"
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
<!--logs.wxml-->
|
||||
<!--pages/login/login.wxml-->
|
||||
<view class="login-container">
|
||||
<view class="login-header">
|
||||
<text class="title">用户登录</text>
|
||||
<text class="subtitle">请先登录以使用搜索匹配功能</text>
|
||||
</view>
|
||||
|
||||
<view class="login-content">
|
||||
<view class="avatar-section">
|
||||
<view class="avatar-wrapper">
|
||||
<image class="avatar" src="{{userInfo.avatarUrl || defaultAvatarUrl}}" mode="aspectFill"></image>
|
||||
<button class="avatar-btn" wx:if="{{!userInfo.avatarUrl}}" open-type="chooseAvatar" bindchooseavatar="onChooseAvatar">
|
||||
选择头像
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="nickname-section">
|
||||
<view class="form-item">
|
||||
<text class="label">昵称</text>
|
||||
<input
|
||||
class="nickname-input"
|
||||
type="nickname"
|
||||
placeholder="请输入昵称"
|
||||
value="{{userInfo.nickName}}"
|
||||
bindinput="onInputChange"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <button class="login-btn" bindtap="handleLogin" disabled="{{!canLogin}}">
|
||||
{{canLogin ? '立即登录' : '请填写完整信息'}}
|
||||
</button> -->
|
||||
|
||||
<button class="wechat-login-btn" open-type="getUserInfo" bindgetuserinfo="onGetUserInfo">
|
||||
微信一键登录
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
@ -0,0 +1,105 @@
|
||||
/* pages/login/login.wxss */
|
||||
.login-container {
|
||||
padding: 60rpx 40rpx;
|
||||
min-height: 100vh;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
}
|
||||
|
||||
.login-header {
|
||||
text-align: center;
|
||||
margin-bottom: 80rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
display: block;
|
||||
font-size: 48rpx;
|
||||
font-weight: bold;
|
||||
color: white;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
font-size: 28rpx;
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
|
||||
.login-content {
|
||||
background: white;
|
||||
border-radius: 20rpx;
|
||||
padding: 60rpx 40rpx;
|
||||
box-shadow: 0 10rpx 30rpx rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.avatar-section {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-bottom: 60rpx;
|
||||
}
|
||||
|
||||
.avatar-wrapper {
|
||||
position: relative;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
border-radius: 50%;
|
||||
border: 4rpx solid #667eea;
|
||||
}
|
||||
|
||||
.avatar-btn {
|
||||
margin-top: 20rpx;
|
||||
font-size: 24rpx;
|
||||
background: #667eea;
|
||||
color: white;
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.label {
|
||||
display: block;
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
margin-bottom: 20rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.nickname-input {
|
||||
border: 2rpx solid #e0e0e0;
|
||||
border-radius: 12rpx;
|
||||
padding: 24rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.nickname-input:focus {
|
||||
border-color: #667eea;
|
||||
}
|
||||
|
||||
.login-btn {
|
||||
width: 100%;
|
||||
height: 88rpx;
|
||||
background: #667eea;
|
||||
color: white;
|
||||
border-radius: 44rpx;
|
||||
font-size: 32rpx;
|
||||
margin-bottom: 30rpx;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.login-btn:disabled {
|
||||
background: #cccccc;
|
||||
}
|
||||
|
||||
.wechat-login-btn {
|
||||
width: 100%;
|
||||
height: 88rpx;
|
||||
background: #07c160;
|
||||
color: white;
|
||||
border-radius: 44rpx;
|
||||
font-size: 32rpx;
|
||||
border: none;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue