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 @@
d97e6a10-2503-436b-bd6b-755c3f8199a5

View File

@@ -0,0 +1 @@
ae5722bb-b5d5-4fb7-bef5-51819d1647bf

View File

@@ -0,0 +1,175 @@
const {
user,
util
} = getApp().globalData
Page({
/**
* 页面的初始数据
*/
data: {
isShowLogin: true,
phone: '', // 手机号
pwd: '', // 密码
confirmPwd: '', // 确认密码
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(user);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
async UserLogin() {
let { phone, pwd } = this.data
if (!util.checkPhone(phone)) {
wx.showToast({
title: '号码错误',
icon: 'none',
duration: 2000
})
return false;
}
if (pwd.length == 0) {
wx.showToast({
title: '密码必填',
icon: 'none',
duration: 2000
})
return false;
}
let res = await user.login({
phone: phone,
pwd: pwd
});
wx.setStorageSync('user', res);
util.showToast({
title: '登录成功',
icon: 'success',
duration: 2000,
close: () => wx.switchTab({ url: '/pages/index/index' })
})
},
async UserRegister() {
let { phone, pwd, confirmPwd } = this.data
if (!util.checkPhone(phone)) {
wx.showToast({
title: '号码错误',
icon: 'none',
duration: 2000
})
return false;
}
if (pwd.length == 0) {
wx.showToast({
title: '密码必填',
icon: 'none',
duration: 2000
})
return false;
}
if (confirmPwd.length == 0 || confirmPwd != pwd) {
wx.showToast({
title: '确认密码必填,且必须和密码一致',
icon: 'none',
duration: 2000
})
return false;
}
let res = await user.add({
phone: phone,
pwd: pwd
});
util.showToast({
title: '注册成功,即将跳转登录!',
icon: 'none',
duration: 2000,
close: () => this.setData({ isShowLogin: true })
})
},
// 手机号
bindPhoneInput(e) {
this.setData({
phone: e.detail.value
})
},
// 确认密码
bindConfirmPwdInput(e) {
this.setData({
confirmPwd: e.detail.value
})
},
// 密码
bindPwdInput(e) {
this.setData({
pwd: e.detail.value
})
},
changeStatus() {
this.setData({
isShowLogin: !this.data.isShowLogin
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

View File

@@ -0,0 +1,7 @@
{
"usingComponents": {
"van-icon": "@vant/weapp/icon/index"
},
"navigationBarTitleText": "账户中心",
"navigationStyle": "custom"
}

View File

@@ -0,0 +1,33 @@
<view class="account">
<image class="login_back" src="../../images/img/loginBack.png"></image>
<view class="login" wx:if="{{ isShowLogin }}">
<view class="inpu bottom van-hairline--bottom">
<text class="iconfont icon-shouji"></text>
<input type="text" bindinput="bindPhoneInput" placeholder="输入手机号" />
</view>
<view class="inpu van-hairline--bottom">
<text class="iconfont icon-31mima"></text>
<input type="password" bindinput="bindPwdInput" placeholder="输入密码" />
</view>
<view class="login_submit" bindtap="UserLogin">登 录</view>
</view>
<view class="register" wx:else>
<view class="inpu bottom van-hairline--bottom">
<text class="iconfont icon-shouji"></text>
<input type="text" bindinput="bindPhoneInput" placeholder="输入手机号" />
</view>
<view class="inpu van-hairline--bottom">
<text class="iconfont icon-31mima"></text>
<input type="password" bindinput="bindPwdInput" placeholder="输入密码" />
</view>
<view class="inpu van-hairline--bottom">
<text class="iconfont icon-31mima"></text>
<input type="password" bindinput="bindConfirmPwdInput" placeholder="输入确认密码" />
</view>
<view class="login_submit" bindtap="UserRegister">注 册</view>
</view>
<view class="other" bindtap="changeStatus">{{ isShowLogin ? '注册账号': '立即登录' }}</view>
</view>

View File

@@ -0,0 +1,50 @@
.account {
}
.login_back {
width: 100%;
height: 440rpx;
}
.login,
.register {
padding: 0 50rpx;
margin-top: 60rpx;
}
.inpu {
width: 100%;
display: flex;
align-items: center;
height: 90rpx;
margin-bottom: 22rpx;
}
.inpu .iconfont {
font-size: 45rpx;
}
.inpu input {
flex: 1;
padding-left: 30rpx;
box-sizing: border-box;
}
.login_submit {
width: 70%;
height: 90rpx;
margin: 70rpx auto 0 auto;
text-align: center;
background: -webkit-linear-gradient(90deg, #8817cd , #c63ba2); /* Safari 5.1 - 6.0 */
background: -o-linear-gradient(90deg, #8817cd , #c63ba2); /* Opera 11.1 - 12.0 */
background: -moz-linear-gradient(90deg, #8817cd , #c63ba2); /* Firefox 3.6 - 15 */
background: linear-gradient(90deg, #8817cd , #c63ba2);
line-height: 90rpx;
border-radius: 53rpx;
color: #fff;
font-size: 34rpx;
}
.other {
text-align: center;
margin-top: 20rpx;
font-size: 28rpx;
color: #bdbaba;
}

View File

@@ -0,0 +1 @@
b42fbb72-51bd-448c-9c26-95c4610bf308

View File

@@ -0,0 +1,168 @@
const {
user,
index,
util
} = getApp().globalData
Page({
data: {
ossUrl: 'https://losta.oss-cn-shanghai.aliyuncs.com',
userInfo: {},
fileList: [],
customItem: '全部',
showSchool: false,
showUserName: false
},
onLoad: function (options) {
if (util.checkIsLogin()) {
let info = wx.getStorageSync('user')
if (info.user_city.length != 0) {
info.user_city = info.user_city.split(",")
}
this.setData({ userInfo: info });
this.setData({
fileList: [
{
url: this.data.userInfo.user_portrait,
name: '图片1',
}
]
})
}
},
async edit() {
let { userInfo } = this.data;
userInfo.user_city = userInfo.user_city.toString();
console.log("userInfo : ", userInfo)
let res = await user.edit(userInfo)
console.log(res)
wx.setStorageSync('user', userInfo);
util.showToast({
title: '修改成功',
icon: 'success',
duration: 2000,
// close: () => wx.switchTab({ url: '/pages/index/index' })
})
},
async afterRead(event) {
const { file } = event.detail;
this.setData({ fileList: [ file ] })
console.log("file === ", file)
let arr = file.url.split(".")
let fileType = arr[arr.length - 1]; // 文件后缀
let ossConfig = await index.token();
let fileName = `${util.random()}.${fileType}`;
console.log("fileName === ", fileName)
wx.uploadFile({
url: this.data.ossUrl,
filePath: file.url,
name: 'file',
formData: { key: fileName, ...ossConfig },
success: (res) => {
console.log("uploadFile success ", res)
if (res.statusCode == 204) {
this.setData({
['userInfo.user_portrait']: `${this.data.ossUrl}/${fileName}`
});
} else {
wx.showToast({
title: "图片上传错误,稍后再试",
icon: 'none',
duration: 3000
});
}
}
});
},
bindRegionChange: function (e) {
this.setData({
'userInfo.user_city': e.detail.value
})
},
onSchoolChange(e) {
this.setData({
'userInfo.user_school': e.detail
})
},
onUserNameChange(e) {
this.setData({
'userInfo.user_name': e.detail
})
},
showSheet() {
this.setData({showSchool: true})
},
showNameSheet() {
this.setData({showUserName: true})
},
onUserClose() {
this.setData({showUserName: false})
},
onClose() {
this.setData({showSchool: false})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

View File

@@ -0,0 +1,12 @@
{
"usingComponents": {
"van-cell": "@vant/weapp/cell/index",
"van-cell-group": "@vant/weapp/cell-group/index",
"van-image": "@vant/weapp/image/index",
"van-uploader": "@vant/weapp/uploader/index",
"van-action-sheet": "@vant/weapp/action-sheet/index",
"van-field": "@vant/weapp/field/index",
"van-button": "@vant/weapp/button/index"
},
"navigationBarTitleText": "个人信息"
}

View File

@@ -0,0 +1,66 @@
<view class="edit">
<van-cell-group>
<van-cell title="头像" is-link center border="{{ false }}">
<van-uploader
deletable="{{ false }}"
preview-size="40px"
file-list="{{ fileList }}"
bind:after-read="afterRead" />
</van-cell>
<van-cell title="昵称" bind:tap="showNameSheet" value="{{ userInfo.user_name }}" is-link center border="{{ false }}"/>
<van-cell title="手机" value="{{ userInfo.user_phone }}" center border="{{ false }}"/>
<van-cell title="城市" is-link center border="{{ false }}">
<picker mode="region" bindchange="bindRegionChange" value="{{ userInfo.user_city }}" custom-item="请选择">
<view wx:if="{{ userInfo.user_city.length != 0 }}" class="picker">{{userInfo.user_city[0]}}, {{userInfo.user_city[1]}}, {{userInfo.user_city[2]}}</view>
<view wx:else>请选择城市</view>
</picker>
</van-cell>
<van-cell bind:tap="showSheet" title="学校" value="" is-link center border="{{ false }}">
<view wx:if="{{ userInfo.user_school.length != 0 }}">{{ userInfo.user_school }}</view>
<view wx:else>请填写</view>
</van-cell>
</van-cell-group>
<van-action-sheet
title="学校"
show="{{ showSchool }}"
bind:close="onClose"
bind:cancel="onClose"
cancel-text="完成">
<van-field
type="text"
confirm-type="确定"
value="{{ userInfo.user_school }}"
clearable="{{ true }}"
placeholder="请输入学校名称"
border="{{ false }}"
bind:change="onSchoolChange"
/>
</van-action-sheet>
<van-action-sheet
title="昵称"
show="{{ showUserName }}"
bind:close="onUserClose"
bind:cancel="onUserClose"
cancel-text="完成">
<van-field
type="text"
confirm-type="确定"
value="{{ userInfo.user_name }}"
clearable="{{ true }}"
placeholder="请输入用户昵称"
border="{{ false }}"
bind:change="onUserNameChange"
/>
</van-action-sheet>
<view class="submit">
<van-button bind:tap="edit" class="submit" type="primary" round color="#ffd23c" size="large">提 交</van-button>
</view>
</view>

View File

@@ -0,0 +1,18 @@
.edit {
}
.van-uploader__upload {
position: absolute !important;
opacity: 0;
z-index: 999;
}
.van-uploader__preview-image {
border-radius: 60rpx;
}
.submit {
width: 80%;
margin: 60rpx auto;
}

View File

@@ -0,0 +1 @@
d8e28b0c-04e0-4d44-b513-8b4bd5463bad

View File

@@ -0,0 +1,105 @@
const {
index,
util
} = getApp().globalData
Page({
/**
* 页面的初始数据
*/
data: {
active: 0,
hall: [
{
title: '失物招领',
index: 0,
children: [
{ title: '全部', type: -1, page: 1, content: [] },
{ title: '证件', type: 1, page: 1, content: [] },
{ title: '服装', type: 2, page: 1, content: [] },
{ title: '数码', type: 3, page: 1, content: [] },
{ title: '日用品', type: 4, page: 1, content: [] },
{ title: '其他', type: 5, page: 1, content: [] },
]
},
{
title: '寻物启事',
index: 0,
children: [
{ title: '全部', type: -1, page: 1, content: [] },
{ title: '证件', type: 1, page: 1, content: [] },
{ title: '服装', type: 2, page: 1, content: [] },
{ title: '数码', type: 3, page: 1, content: [] },
{ title: '日用品', type: 4, page: 1, content: [] },
{ title: '其他', type: 5, page: 1, content: [] },
]
}
]
},
onLoad: function (options) {
this.getList()
},
onReady: function () {},
onShow: function () {},
async getList() {
let { hall, active } = this.data;
let res = await index.tab({
thing_type: active + 1,
thing_category: hall[active].children[hall[active].index].type,
page: 1
});
var temp = `hall[${active}].children`
var oth = `${temp}[${hall[active].index}].content`
this.setData({ [oth]: res })
},
// 改变子项激活的下标
changeChildren(e) {
var temp = `hall[${this.data.active}].index`
this.setData({ [temp]: e.target.dataset.cid}, () => this.getList())
},
onChange(event) {
this.setData({ active: event.detail.name },() => this.getList())
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

View File

@@ -0,0 +1,8 @@
{
"usingComponents": {
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index",
"item": "../../component/item/item"
},
"navigationBarTitleText": "广场"
}

View File

@@ -0,0 +1,24 @@
<view class="hall">
<van-tabs animated swipeable
color="#ffd23c"
id="tabs"
active="{{ active }}" bind:change="onChange">
<van-tab wx:for="{{ hall }}" title="{{ item.title }}" wx:key="type">
<view class="children_wrap van-hairline--top">
<view class="children_item {{ i == item.index ? 'active' : ''}}"
wx:for="{{ item.children }}"
wx:for-index="i"
wx:key="type"
wx:for-item="v" data-cid="{{ i }}"
bindtap="changeChildren">
{{ v.title }}
</view>
</view>
<item show-desc="{{ false }}"
search-list="{{ item.children[item.index].content }}">
</item>
</van-tab>
</van-tabs>
</view>

View File

@@ -0,0 +1,46 @@
page {
background: #fff;
}
.hall_head {
position: fixed;
top: 0;
width: 100%;
left: 0;
right: 0;
background: #ffd23c;
box-sizing: border-box;
}
.van-dropdown-menu {
background-color: #fff0 !important;
box-shadow: none !important;
display: inline-block !important;
height: auto !important;
position: absolute;
}
.down_item .van-dropdown-item {
top: 120rpx !important;
}
.hall_head input {
width: 100%;
background-color: #fff;
height: 64rpx;
border-radius: 60rpx;
}
.children_wrap {
display: flex;
justify-content: space-evenly;
height: 90rpx;
align-items: center;
background: #fff;
}
.children_wrap .children_item {
padding: 9rpx 20rpx;
border-radius: 53rpx;
font-size: 28rpx;
}
.children_wrap .active {
background: #ffd23c;
}

View File

@@ -0,0 +1 @@
4fb5866b-d4e5-44b4-b30a-ecd77821c0b5

View File

@@ -0,0 +1,136 @@
const {
user,
util
} = getApp().globalData
Page({
data: {
active: 0,
historyArr: [
{
title: '失物招领',
thing_type: 1,
content: []
},
{
title: '寻物启事',
thing_type: 2,
content: []
},
],
userInfo: {},
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if (util.checkIsLogin()) {
this.setData({ userInfo: wx.getStorageSync('user') });
this.setData({
active: options.id - 1
});
this.history();
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
async history() {
let { userInfo, historyArr, active } = this.data;
let res = await user.history({
user_id: userInfo.user_id,
thing_type: historyArr[active].thing_type
})
let temp = `historyArr[${active}].content`
this.setData({ [ temp ]: res })
},
async changeItemStatus(e) {
wx.showModal({
title: '',
content: '请确定已与【失主】或【物主】进行详细沟通并成功拿到丢失物品,一但确定不可取消!',
success: async (res) => {
if (res.confirm) {
let item = e.currentTarget.dataset.item;
if (item.thing_status == 0) {
let res = await user.changeStatus({
thing_status: !item.thing_status * true,
thing_id: item.thing_id,
user_id: item.user_id
})
util.showToast({
title: '更新成功',
icon: 'none',
duration: 2000,
close: () => {
this.history();
}
})
}
}
}
})
},
onChange(event) {
this.setData({ active: event.detail.name });
this.history();
},
enterInfo(e) {
wx.navigateTo({
url: `/pages/info/info?id=${e.currentTarget.dataset.id}`
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

View File

@@ -0,0 +1,10 @@
{
"usingComponents": {
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index",
"item": "../../component/item/item",
"van-card": "@vant/weapp/card/index",
"van-button": "@vant/weapp/button/index"
},
"navigationBarTitleText": "历史记录"
}

View File

@@ -0,0 +1,30 @@
<view class="history">
<van-tabs color="#ffd23c" active="{{ active }}" bind:change="onChange" animated swipeable>
<van-tab title="{{ item.title }}" wx:for="{{ historyArr }}" wx:key="thing_type">
<view wx:if="{{ item.content.length != 0 }}">
<van-card
wx:for="{{ item.content }}"
wx:for-item="v"
wx:for-index="i"
wx:key="thing_img"
tag="{{ v.thing_type == 1 ? v.thing_status == 1 ? '已认领' : '未认领' : v.thing_status == 1 ? '已寻回' : '未寻回' }}"
bind:tap="enterInfo"
data-id="{{ v.thing_id }}"
title="{{ v.thing_title }}"
thumb="{{ v.thing_img }}">
<view slot="desc" class="van-multi-ellipsis--l2">{{ v.thing_introduce }}</view>
<view slot="footer">
<van-button data-item="{{ v }}" catchtap="changeItemStatus" wx:if="{{ v.thing_type == 1 && v.thing_status == 0 }}" type="primary" plain size="small">确认被认领</van-button>
<van-button data-item="{{ v }}" catchtap="changeItemStatus" wx:if="{{ v.thing_type == 2 && v.thing_status == 0 }}" type="info" plain size="small">确认已寻回</van-button>
</view>
</van-card>
</view>
<view wx:else class="ondata">
<image src="../../images/img/noLogin.png"></image>
<view class="tips">无数据</view>
</view>
</van-tab>
</van-tabs>
</view>

View File

@@ -0,0 +1,3 @@
.van-card {
background: #fff !important;
}

View File

@@ -0,0 +1 @@
597b9df1-5d1c-4593-997e-d02f9d47b4be

View File

@@ -0,0 +1,51 @@
// index.js
const {
index,
util
} = getApp().globalData
Page({
data: {
recruit: [
{ type: 1, title: '失物招领', src: '../../images/index-icon/release.png' },
{ type: 2, title: '寻物寻事', src: '../../images/index-icon/search.png' },
],
movies: [{
url: '../../images/Rotating/3.jpg'
},
{
url: '../../images/Rotating/news.png'
},
{
url: '../../images/Rotating/1.jpg'
},
{
url: '../../images/Rotating/2.jpg'
}
],
noticeList: []
},
onLoad() {
this.getNotice();
// if (typeof wx.getStorageSync('user') == "object" ) {
// }
},
enterSearch() {
wx.navigateTo({
url: '/pages/search/search',
})
},
enterPush(e) {
wx.navigateTo({
url: `/pages/push/push?id=${e.currentTarget.dataset.id}`,
})
},
async getNotice() {
let res = await index.notice();
this.setData({
noticeList: res
})
}
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {
}
}

View File

@@ -0,0 +1,47 @@
<view class="index">
<view class="banner">
<swiper indicator-dots='true' autoplay='true' interval='3000' duration='1000' circular='true' class="swip">
<swiper-item wx:for="{{movies}}" wx:for-index="index" wx:key="*this">
<image src='{{item.url}}' mode='widthFix'></image>
</swiper-item>
</swiper>
</view>
<view class="content">
<view class="search" bindtap="enterSearch">
<image src="../../images/index-icon/search.png"></image>
<text>搜索更多..</text>
</view>
<view class="push">
<view class="recruit" wx:for="{{ recruit }}"
data-id="{{ item.type }}" bindtap="enterPush"
wx:key="type">
<view class="recruit_action">
<image src="{{ item.src }}"></image>
<view class="add">+发布</view>
</view>
<view class="recruit_tips">{{ item.title }}</view>
</view>
</view>
<view class="tips_text">tps:听说点击小飞机和放大镜,会进入神秘世界...</view>
<view class="hot_news">
<view class="news_title">
<image src="../../images/index-icon/announcement.png"></image>
<text>最新消息</text>
</view>
<view class="news_content">
<view class="news_item" wx:for="{{noticeList}}" wx:key="notice_id">
<view class="icon"></view>
<text>{{ item.notice_text }}</text>
</view>
</view>
</view>
</view>
</view>

View File

@@ -0,0 +1,136 @@
.banner {
background-color: #ffd23c;
height: 400rpx;
border-bottom-right-radius: 80rpx;
border-bottom-left-radius: 80rpx;
padding-top: 30rpx;
box-sizing: border-box;
}
.content {
padding: 0 30rpx;
}
.swip {
box-shadow: 4rpx 4rpx 8rpx rgba(0, 0, 0, 0.3);
margin: 0 auto;
height: 280rpx;
width: 650rpx;
border-radius: 20rpx;
overflow: hidden;
}
.swip image {
width: 100%;
}
.search {
display: flex;
width: 100%;
background-color: #fff;
height: 90rpx;
margin: 0 auto;
margin-top: -40rpx;
border-radius: 60rpx;
align-items: center;
border: 1px solid #e2e2e2;
line-height: 90rpx;
}
.search image {
width: 50rpx;
height: 50rpx;
margin-left: 20rpx;
}
.search text {
padding-left: 30rpx;
color: #b6b6b6;
font-size: 30rpx;
flex: 1;
height: 100%;
padding-right: 30rpx;
}
.push {
margin-top: 30rpx;
display: flex;
justify-content: space-between;
}
.push .recruit{
width: 48%;
height: 260rpx;
background-color: #fff;
border-radius: 30rpx;
padding: 20rpx 30rpx;
box-sizing: border-box;
display: flex;
flex-direction: column;
justify-content: space-around;
}
.push .recruit .recruit_action{
display: flex;
align-items: center;
justify-content: space-between;
}
.push .recruit .recruit_action image{
width: 70rpx;
height: 70rpx;
}
.push .recruit .recruit_action .add{
background-color: #ffd23c;
width: 140rpx;
height: 70rpx;
text-align: center;
border-radius: 30rpx;
line-height: 70rpx;
}
.tips_text {
font-size: 24rpx;
color: rgb(175, 175, 175);
padding-left: 10rpx;
margin-top: 16rpx;
}
.hot_news {
background: #fff;
margin-top: 40rpx;
border-radius: 30rpx;
box-sizing: border-box;
padding: 20rpx 30rpx;
}
.hot_news .news_title {
display: flex;
align-items: center;
height: 80rpx;
margin-bottom: 20rpx;
}
.hot_news .news_title image{
width: 60rpx;
height: 60rpx;
}
.hot_news .news_title text{
font-size: 34rpx;
margin-left: 20rpx;
font-weight: 500;
}
.hot_news .news_content {
box-sizing: border-box;
padding-left: 19rpx;
}
.hot_news .news_content .news_item {
display: flex;
align-items: center;
margin-bottom: 19rpx;
}
.news_item text {
font-size: 28rpx;
}
.hot_news .news_content .news_item image{}
.hot_news .news_content .news_item .icon{
width: 30rpx;
height: 30rpx;
background: #ffd23c;
border-radius: 100%;
margin-right: 29rpx;
}

View File

@@ -0,0 +1 @@
0e636c3b-2219-4a18-b899-882f50e4071c

View File

@@ -0,0 +1,113 @@
const {
index,
util
} = getApp().globalData
Page({
/**
* 页面的初始数据
*/
data: {
id: 0,
listInfo: {},
isShow: false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({ id: options.id })
this.GetInfo()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
async GetInfo() {
let res = await index.info({
thing_id: this.data.id
});
console.log(res);
this.setData({
listInfo: res
})
},
iWant() {
if (this.data.listInfo.thing_status == 0) {
this.setData({ isShow: true })
} else {
wx.showToast({
title: '抱歉,已认领了哦 😁',
icon: 'none',
duration: 2000
})
}
},
showGallery() {
wx.previewImage({
current: 0,
urls: [ this.data.listInfo.thing_img ]
})
},
tellPhone() {
wx.makePhoneCall({
phoneNumber: this.data.listInfo.user_phone
})
},
onClose() {
this.setData({ isShow: false });
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

View File

@@ -0,0 +1,7 @@
{
"usingComponents": {
"van-popup": "@vant/weapp/popup/index",
"van-tag": "@vant/weapp/tag/index"
},
"navigationBarTitleText": "详情"
}

View File

@@ -0,0 +1,51 @@
<view class="info content">
<view class="user_info">
<image src="{{ listInfo.user_portrait }}"></image>
<view class="user_text">
<view class="name">{{ listInfo.user_name }}</view>
<view class="school">
{{ listInfo.user_school.length == 0 ? '用户未填写学校信息': listInfo.user_school }}
</view>
</view>
<view bindtap="iWant" class="status {{ listInfo.thing_status == 0 ? 'no' : 'yes' }}">
{{
listInfo.thing_type == 1
? listInfo.thing_status == 0 ? '我要认领' : '已认领'
: listInfo.thing_status == 0 ? '我要归还' : '已寻回'
}}
</view>
</view>
<view class="goods">
<view class="title">
<view class="left_text">
{{ listInfo.thing_title }}
<view class="time">{{ listInfo.thing_createdtime }}</view>
</view>
<van-tag class="right_type" color="#ffd23c" round size="medium" plain type="primary">
{{ listInfo.thing_category == 1
? '证件'
: listInfo.thing_category == 2
? '服装'
: listInfo.thing_category == 3
? '数码'
: listInfo.thing_category == 4
? '日用品'
: '其他'
}}
</van-tag>
</view>
<view class="desc">{{ listInfo.thing_introduce }}</view>
<image src="{{ listInfo.thing_img }}" mode="widthFix" bindtap="showGallery"></image>
</view>
<van-popup show="{{ isShow }}" closeable round bind:close="onClose">
<view class="popup">
<view class="top">
<image src="{{ listInfo.user_portrait }}"></image>
<!-- <view class="popup_text">{{ listInfo.user_name }}</view> -->
<view class="tell" bindtap="tellPhone">电话联系我</view>
</view>
<view class="security">请勿轻易相信他人,线下见面请注意个人安全</view>
</view>
</van-popup>
</view>

View File

@@ -0,0 +1,109 @@
page {
background: #fff;
}
.info {
padding-top: 40rpx;
}
.user_info {
display: flex;
position: relative;
align-items: center;
}
.status {
position: absolute;
right: 0;
top: 24rpx;
padding: 17rpx 30rpx;
font-size: 31rpx;
color: #171717;
border-radius: 36rpx;
transform: rotate(28deg);
box-shadow: 3px 4px 18px #ffd23c;
}
.no {
background: #ffd23c;
}
.yes {
background: no-repeat;
box-shadow: none;
border: 1px solid #8d8d8d;
color: #999 !important;
}
.user_info image {
width: 120rpx;
height: 120rpx;
border-radius: 100%;
margin-right: 20rpx;
}
.user_info .user_text {}
.user_info .user_text .name {
font-size: 38rpx;
font-weight: 600;
}
.user_info .user_text .school,
.time {
font-size: 26rpx;
color: #999;
}
.goods {
margin-top: 48rpx;
}
.goods .title{
font-size: 34rpx;
margin-bottom: 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.goods .desc{
margin-bottom: 15rpx;
line-height: 42rpx;
font-size: 28rpx;
}
.goods image{
margin: 0 auto;
display: block;
}
.popup {
text-align: center;
padding: 30rpx 38rpx;
box-sizing: border-box;
width: 81vw;
height: 53vh;
display: flex;
flex-direction: column;
}
.popup image{
width: 240rpx;
height: 240rpx;
border-radius: 100%;
}
.top {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.popup .popup_text{}
.popup .tell{
width: 40%;
height: 86rpx;
line-height: 86rpx;
text-align: center;
border-radius: 46rpx;
border: 1px solid #ffd23c;
font-size: 30rpx;
color: #ecb600;
margin: 0 auto;
margin-top: 60rpx;
}
.security {
font-size: 24rpx;
color: #999;
}

View File

@@ -0,0 +1 @@
eea885d6-b43c-4c7a-93f7-e94324b0d82a

View File

@@ -0,0 +1,198 @@
const {
index,
util
} = getApp().globalData
Page({
/**
* 页面的初始数据
*/
data: {
ossUrl: 'https://losta.oss-cn-shanghai.aliyuncs.com',
showTips: true,
fileList: [],
thingTypeIndex: 0,
thingTypeArr: [
{ title: '失物招领', type: 1 },
{ title: '寻物启事', type: 2 },
],
thingCategoryIndex: 0,
thingCategoryArr: [
{ title: '证件', type: 1 },
{ title: '服装', type: 2 },
{ title: '数码', type: 3 },
{ title: '日用品', type: 4 },
{ title: '其他', type: 5 },
],
pushParams: {
user_id: 0,
thing_title: '',
thing_introduce: '',
thing_img: '',
thing_type: 1,
thing_category: 1
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if (util.checkIsLogin()) {
this.setData({ thingTypeIndex: options.id - 1 })
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
onShow: function () {
setTimeout(()=> {
this.setData({ showTips: false })
},4000)
},
thingTitleInput(e) {
this.setData({
['pushParams.thing_title']: e.detail.value
});
},
thingIntrInput(e) {
this.setData({
['pushParams.thing_introduce']: e.detail.value
})
},
changeThingTypeIndex(e) {
this.setData({ thingTypeIndex: e.target.dataset.id })
},
changeThingCategoryIndex(e) {
this.setData({ thingCategoryIndex: e.target.dataset.id })
},
async PushThing() {
let userInfo = wx.getStorageSync('user');
let {
fileList, pushParams,
thingTypeIndex, thingTypeArr,
thingCategoryIndex, thingCategoryArr
} = this.data;
if (pushParams.thing_title.length == 0) {
wx.showToast({
title: '标题必填',
icon: 'none',
duration: 2000
});
return false;
}
if (pushParams.thing_introduce.length == 0 || pushParams.thing_introduce.length > 500) {
wx.showToast({
title: '介绍必填且字数不能大于500',
icon: 'none',
duration: 2000
});
return false;
}
if (pushParams.thing_img.length == 0) {
wx.showToast({
title: '图片必须上传',
icon: 'none',
duration: 2000
});
return false;
}
pushParams.user_id = userInfo.user_id;
pushParams.thing_type = thingTypeArr[thingTypeIndex].type;
pushParams.thing_category = thingCategoryArr[thingCategoryIndex].type;
console.log("请求参数:", pushParams)
let res = await index.push(pushParams);
console.log(res);
util.showToast({
title: '发布成功',
icon: 'success',
duration: 2000,
close: () => {
wx.navigateBack()
}
})
},
async afterRead(event) {
const { file } = event.detail;
this.setData({ fileList: [ file ] })
console.log("file === ", file)
let arr = file.url.split(".")
let fileType = arr[arr.length - 1]; // 文件后缀
let ossConfig = await index.token();
let fileName = `${util.random()}.${fileType}`;
console.log("fileName === ", fileName)
wx.uploadFile({
url: this.data.ossUrl,
filePath: file.url,
name: 'file',
formData: { key: fileName, ...ossConfig },
success: (res) => {
console.log("uploadFile success ", res)
if (res.statusCode == 204) {
this.setData({
['pushParams.thing_img']: `${this.data.ossUrl}/${fileName}`
});
} else {
wx.showToast({
title: "图片上传错误,稍后再试",
icon: 'none',
duration: 3000
});
}
}
});
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

View File

@@ -0,0 +1,8 @@
{
"usingComponents": {
"van-uploader": "@vant/weapp/uploader/index",
"van-divider": "@vant/weapp/divider/index",
"van-icon": "@vant/weapp/icon/index"
},
"navigationBarTitleText": "发布信息"
}

View File

@@ -0,0 +1,42 @@
<div class="push content">
<input bindinput="thingTitleInput" class="thing_title" type="text" placeholder="物品的标题"></input>
<textarea bindinput="thingIntrInput"
maxlength="500" class="thing_introduce"
auto-height
placeholder="请描述清楚时间地点物品特征等基本信息限500字"/>
<van-uploader
file-list="{{ fileList }}"
max-count="1"
bind:after-read="afterRead" />
<view class="action_title">物品类型</view>
<view class="type">
<view class="type_item {{ thingTypeIndex == index ? 'active' : '' }}"
wx:for="{{thingTypeArr}}"
data-id="{{ index }}"
bind:tap="changeThingTypeIndex"
wx:key="type">
{{ item.title }}
</view>
</view>
<view class="action_title">物品类别</view>
<view class="category">
<view class="category_item {{ thingCategoryIndex == index ? 'active' : '' }}"
wx:key="type"
data-id="{{ index }}"
bind:tap="changeThingCategoryIndex"
wx:for="{{thingCategoryArr}}">
{{ item.title }}
</view>
</view>
<movable-area class="push_wrap">
<movable-view bind:tap="PushThing" class="push_action" x="{{46}}" y="{{13}}" direction="all">
<van-icon color="#c19503" name="guide-o" size="60rpx"/>
<view class="tips" wx:if="{{showTips}}">按住,可以拖动哦</view>
</movable-view>
</movable-area>
</div>

View File

@@ -0,0 +1,92 @@
page {
background: #fff;
}
.push {
}
.thing_title {
height: 120rpx;
font-size: 30rpx;
}
.thing_introduce {
width: 100%;
height: 250rpx !important;
font-size: 30rpx;
}
.action_title {
margin: 30rpx 0px 19rpx 20rpx;
color: rgba(69,90,100,.6);
font-size: 27rpx;
}
.type {
margin-bottom: 67rpx;
}
.type,
.category {
display: flex;
}
.type .type_item,
.category .category_item {
margin-right: 15rpx;
color: #151515;
text-align: center;
width: 160rpx;
height: 65rpx;
font-size: 28rpx;
line-height: 65rpx;
border-radius: 20px;
background: #e8e8e8;
}
.category {}
.category .category_item{}
.active {
background: #ffd23c !important;
}
.push_wrap {
position: fixed;
width: 100%;
left: 0;
bottom: 0;
height: 200rpx;
}
.push_action {
width: 120rpx;
height: 120rpx;
border-radius: 100%;
background: #ffd23c;
display: flex;
align-items: center;
justify-content: center;
position: relative;
border: 1px solid #fbcb2d;
box-shadow: 3px 3px 21px #ffd23c;
}
.push_wrap .tips {
position: absolute;
right: -150rpx;
top: -63rpx;
width: 225rpx;
background: #ffd23c;
padding: 10rpx 19rpx;
border-radius: 8px;
transform: rotate(14deg) scale(1,1);
font-size: 26rpx;
animation: shak 2s ease-in-out infinite reverse;
}
@keyframes shak {
0% {
transform: rotate(14deg) scale(1,1);
}
50% {
transform: rotate(30deg) scale(1.2,1.2);
}
100% {
transform: rotate(14deg) scale(1,1);
}
}

View File

@@ -0,0 +1 @@
51de4fef-0ad3-4629-a69f-0782d499bd56

View File

@@ -0,0 +1,80 @@
const {
index,
util
} = getApp().globalData
Page({
/**
* 页面的初始数据
*/
data: {
keyWord: '',
searchList: []
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
async onSearch(e) {
this.setData({
searchList: await index.search({
keyword: e.detail,
page: 1
})
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

View File

@@ -0,0 +1,9 @@
{
"usingComponents": {
"van-search": "@vant/weapp/search/index",
"van-row": "@vant/weapp/row/index",
"van-col": "@vant/weapp/col/index",
"item": "../../component/item/item"
},
"navigationBarTitleText": "搜索"
}

View File

@@ -0,0 +1,4 @@
<view class="search">
<van-search value="{{ keyWord }}" shape="round" placeholder="输入搜索关键词" bind:search="onSearch" />
<item search-list="{{ searchList }}"></item>
</view>

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;
}