first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1 @@
60c1ddf3-a8ef-4313-a94a-1d7aa3e6b1ca

View File

@@ -0,0 +1,142 @@
const {
user,
util
} = getApp().globalData
Page({
/**
* 页面的初始数据
*/
data: {
userInfo: {},
thingTypeArr: [
{text: '失物招领', nums: 20, path: '/pages/history/history?id=1'},
{text: '寻物启事', nums: 100, path: '/pages/history/history?id=2'},
],
listArr: [
{text: '关于', icon: 'icon-guanyu', path: '', is: false},
{text: '反馈', icon: 'icon-jianyi', path: '', is: false},
{text: '帮助', icon: 'icon-bangzhu', path: '', is: false},
{text: '协议', icon: 'icon-_buchongxieyi', path: '', is: false},
{text: '退 出 登 录', icon: 'icon-shouji', path: '', is: true},
],
StatisticsList: {}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
if (util.checkIsLogin()) {
this.setData({
userInfo: wx.getStorageSync('user')
}, () => this.Statistics());
}
},
enterHistory(e) {
wx.navigateTo({
url: e.currentTarget.dataset.path
})
},
enterEdit() {
wx.navigateTo({ url: '/pages/edit/edit' })
},
async Statistics() {
let { userInfo } = this.data;
let res = await user.Statistics({
user_id: userInfo.user_id
});
this.setData({
[`thingTypeArr[0].nums`]: res.lose_matter,
[`thingTypeArr[1].nums`]: res.search_matter,
})
},
tagClick(e) {
let {listArr} = this.data;
let { index } = e.currentTarget.dataset;
if (listArr[index].is) {
wx.showModal({
title: '提示',
content: '确定退出账户吗?',
success(res) {
if (res.confirm) {
wx.clearStorageSync();
wx.switchTab({url: '/pages/index/index'})
}
}
})
} else {
switch (index) {
case 0:
wx.showModal({
title: '关于',
content: '校园失物招领管理系统(拾金小程序)的主要功能就是帮助校内同学更快的找到自己的丢失之物。\n小程序系统UI界面简洁清晰、用户操作简易、没有繁杂的信息流、广告弹窗等众多干扰元素、减少使用成本提高使用效率增强用户粘性和归属感,为同学们提供最便捷优质的服务。',
showCancel: false
})
break;
case 1:
break;
case 2:
break;
case 3:
break;
}
}
// console.log("index; ",e.currentTarget.dataset.index)
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

View File

@@ -0,0 +1,6 @@
{
"usingComponents": {
"van-icon": "@vant/weapp/icon/index"
},
"navigationBarTitleText": ""
}

View File

@@ -0,0 +1,78 @@
<view class="user">
<view class="main content">
<view class="user_tips">
<view class="title">我的</view>
<view class="desc">浏览和管理您的设置</view>
</view>
<view class="user_card">
<view class="card_three"></view>
<view class="card_two"></view>
<view class="card_main">
<view class="card_main_user van-hairline--bottom" bind:tap="enterEdit">
<view class="user_left">
<image src="{{ userInfo.user_portrait }}"></image>
<view class="user_text">
<text class="user_name">{{ userInfo.user_name.length == 0 ? '暂未填写' : userInfo.user_name }}</text>
<view class="user_desc">{{ userInfo.user_school.length == 0 ? '暂未填写' : userInfo.user_school }}</view>
</view>
</view>
<van-icon name="arrow" color="#ccc" size="13px"/>
</view>
<view class="card_main_nums">
<view class="nums_item"
wx:for="{{ thingTypeArr }}"
bind:tap="enterHistory"
data-path="{{ item.path }}"
wx:key="text">
<view class="item_text">{{ item.text }}</view>
<view class="item_info">{{ item.nums }}</view>
</view>
</view>
</view>
</view>
<view class="card_main_nums card_user">
<view class="nums_item">
<view class="item_text">城市</view>
<view class="item_info">
{{
userInfo.user_city.length == 0
? '暂未填写'
: userInfo.user_city
}}
</view>
</view>
<view class="nums_item">
<view class="item_text">电话</view>
<view class="item_info">
{{
userInfo.user_phone.length == 0
? '暂未填写'
: userInfo.user_phone
}}
</view>
</view>
</view>
<view class="user_info">
<view class="user_info_item"></view>
<view class="user_info_item"></view>
<view class="user_info_item"></view>
</view>
<view class="user_list" >
<view class="list_item {{ item.is ? 'logout' : '' }}"
wx:for="{{ listArr }}"
bindtap="tagClick"
data-index="{{ index }}"
wx:key="text">
<view class="list_item_left">
<text wx:if="{{ !item.is }}" class="iconfont {{ item.icon }}"></text>
<view class="list_text">{{ item.text }}</view>
</view>
<van-icon wx:if="{{ !item.is }}" name="arrow" color="#ccc" size="13px"/>
</view>
</view>
</view>
</view>

View File

@@ -0,0 +1,167 @@
page {
/*background: #fff;*/
}
.user {
}
.main {
background: #ffd23c;
height: 27.2vh;
box-sizing: border-box;
}
.user_tips {
color: #fff;
}
.user_tips .title {
font-size: 44rpx;
font-weight: bolder;
margin-bottom: 7rpx;
}
.user_tips .desc {
font-size: 28rpx;
color: rgba(251,251,251,0.74);
}
.user .user_card {
position: relative;
left: 50%;
margin-top: 100rpx;
transform: translateX(-50%);
}
.card_two,
.card_three {
height: 50%;
background: #fff;
position: absolute;
border-radius: 17rpx;
left: 50%;
transform: translateX(-50%);
box-shadow: 1px 5px 12px #a7a1a1;
}
.card_three {
z-index: -2;
width: 80%;
top: -58rpx;
}
.card_two {
top: -30rpx;
z-index: -1;
width: 90%;
}
.card_main {
background: #fff;
width: 100%;
height: 100%;
border-radius: 17rpx;
z-index: 17;
box-shadow: 1px 4px 16px #cecece;
display: flex;
flex-direction: column;
padding: 30rpx 34rpx;
box-sizing: border-box;
}
.card_main_user {
height: 45%;
display: flex;
align-items: center;
padding-bottom: 25rpx;
justify-content: space-between;
}
.user_left {
display: flex;
align-items: center;
flex: 1;
}
.user_left image {
width: 100rpx;
height: 100rpx;
border-radius: 100%;
margin-right: 20rpx;
}
.card_main_user .user_text {
flex: 1;
}
.card_main_user .user_text .user_name {
font-size: 34rpx;
font-weight: 400;
}
.card_main_user .user_text .user_desc {
font-size: 26rpx;
color: #999;
width: 460rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
}
.card_main_nums {
display: flex;
flex: 1;
padding-top: 18px;
}
.card_main_nums .nums_item {
width: 50%;
text-align: center;
}
.card_main_nums .nums_item .item_text{
font-size: 23rpx;
color: #999;
}
.card_main_nums .nums_item .item_info{
font-size: 39rpx;
margin-top: 10rpx;
}
.card_user {
padding: 50rpx !important;
}
.user_list,
.card_user {
background: #fff;
border-radius: 17rpx;
box-shadow: 1px 4px 16px #cecece;
margin-top: 40rpx;
padding: 35rpx 50rpx;
box-sizing: border-box;
}
.card_user .item_info{
font-size: 30rpx !important;
}
.list_item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 30rpx 0;
}
.list_item .list_item_left {
display: flex;
align-items: center;
}
.list_item .list_item_left .iconfont {
font-size: 46rpx;
margin-right: 20rpx;
}
.list_item .list_item_left .list_text {}
.logout {
justify-content: center;
background: #ffd23c;
border-radius: 28rpx;
margin-top: 60rpx;
box-shadow: 3px 4px 18px #ffd23c;
}
.logout .list_text{
color: #fff;
font-size: 32rpx;
}