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,93 @@
<template>
<div class="home">
<navbar title="失物招领" :show-back="false"></navbar>
<page :top="46">
<div class="top">
<van-swipe class="my-swipe" :autoplay="3000" :show-indicators="false" :loop="false" indicator-color="white">
<van-swipe-item><img class="imgone" src="../../static/images/Rotating/1.jpg" alt=""></van-swipe-item>
<van-swipe-item><img class="imgone" src="../../static/images/Rotating/2.jpg" alt=""></van-swipe-item>
<van-swipe-item><img class="imgone" src="../../static/images/Rotating/3.jpg" alt=""></van-swipe-item>
<van-swipe-item><img class="imgone" src="../../static/images/Rotating/news.png" alt=""></van-swipe-item>
</van-swipe>
</div>
<div class="searchcont" @click="entersearch()">
<van-icon size="25" name="search" />
<div class="searchtext">搜索更多..</div>
</div>
<div class="fabu">
<div @click="enterPush(item)" class="enterpush" v-for=" item, index in action " :key="index">
<div class="leftenter">
<img v-if="item.id==1" class="imgico" src="../../static/images/icon/release.png" alt="">
<img v-else class="imgico" src="../../static/images/icon/search.png" alt="">
<div class="textset">+发布</div>
</div>
<div class="absone">
{{ item.text }}
</div>
</div>
</div>
<p class="tps">tps:听说点击小飞机和放大镜,会进入神秘世界...</p>
<div class="lastbottom">
<div class="titlelast">
<van-icon name="volume-o" />
<div textone>最新消息</div>
</div>
<div class="context" v-for=" item, index in a " :key="index">
<van-icon name="circle" color="yellow" />
<div class="contextlast">{{ item }}</div>
</div>
</div>
</page>
</div>
</template>
<script>
export default {
data() {
return {
action: [
{ text: '失物招领', id: 1 },
{ text: '寻物启事', id: 2 },
],
a:[]
}
},
created() {
this.getNoticeList()
// console.log(2222);
},
methods: {
entersearch() {
this.$router.push({
name:"inq"
})
},
enterPush({ id }) {
this.$router.push({
name: "Push",
query: { id }
})
},
async getNoticeList() {
let res = await this.$http.home.notice();
console.log(res)
for (let i in res) {
this.a.push(res[i].notice_text);
}
},
Inquire(){
this.$router.push({
name:"inq"
})
}
}
}
</script>
<style scoped lang='less'>
@import "~@less/Home";
</style>

View File

@@ -0,0 +1,150 @@
<template>
<div class="individual">
<navbar title="个人信息" style="background-color: gold;"></navbar>
<page>
<ul class="indi">
<li class="indi_li">
<div class="indi_li_zi">头像</div>
<div class="indi_li_you">
<div class="indi_li_you_ssd">
<img class="indi_li_you_img" :src="induser.user_portrait" @click="indimg()">
<van-uploader preview-size="38px" class="indi_li_you_ssd_butt" :after-read="afterRead" />
</div>
<img src="../../static/images/common/next.png">
</div>
</li>
<li class="indi_li" @click="nameshow = true">
<div class="indi_li_zi">昵称</div>
<div class="indi_li_you">
<div class="indi_li_you_zi">{{ induser.user_name }}</div>
<img src="../../static/images/common/next.png">
</div>
</li>
<li class="indi_li">
<div class="indi_li_zi">手机</div>
<div class="indi_li_you">
<div class="indi_li_you_zi">15675526951</div>
<img src="../../static/images/common/next.png">
</div>
</li>
<li class="indi_li" @click="addressshow = true">
<div class="indi_li_zi">城市</div>
<div class="indi_li_you">
<div class="indi_li_you_zi">{{ induser.user_city == "" ? "请选择城市" : induser.user_city }}</div>
<img src="../../static/images/common/next.png">
</div>
</li>
<li class="indi_li" @click="schoolshow = true">
<div class="indi_li_zi">学校</div>
<div class="indi_li_you">
<div class="indi_li_you_zi">{{ induser.user_school == "" ? "请填写" : induser.user_school }} </div>
<img src="../../static/images/common/next.png">
</div>
</li>
</ul>
<div class="indi_buttom" @click="submit()">
提交
</div>
<van-popup class="school" v-model="schoolshow" position="bottom" closeable :style="{ height: '25%' }">
<div class="school_titie">学校</div>
<van-cell-group>
<van-field :clearable="true" :boder="false" class="school_text" v-model="induser.user_school"
placeholder="请输入学校的名称" maxlength="20" />
</van-cell-group>
<div class="school_buttom" @click="indclose()">完成</div>
</van-popup>
<van-popup class="school" v-model="nameshow" position="bottom" closeable :style="{ height: '25%' }">
<div class="school_titie">昵称</div>
<van-cell-group>
<van-field :clearable="true" :boder="false" class="school_text" v-model="induser.user_name"
placeholder="请输入学校的名称" maxlength="20" />
</van-cell-group>
<div class="school_buttom" @click="indclose()">完成</div>
</van-popup>
<!-- 日历 -->
<van-popup class="school" v-model="addressshow" position="bottom" :style="{ height: '45%' }">
<!-- :columns-placeholder="dddfd" -->
<van-area :columns-num="3" title="标题" :area-list="areaList" @cancel="addressshow=false" @confirm="confirm" />
</van-popup>
</page>
</div>
</template>
<script>
import { areaList } from '@vant/area-data';
import config from '@/config';
export default {
data() {
return {
areaList,
schoolshow: false,//学校显示
nameshow: false,//昵称显示
addressshow: false,
induser: [],//用户初始数据
induserall: [],//最终数据
dddfd:['请选择','请选择','请选择'],
}
},
created() {
this.induser = this.$utils.getItem("token") //获取用户信息
this.induserall = this.induser;
//设置地址默认值
//this.dddfd = this.induser.user_city.split(",")
console.log(this.dddfd)
},
methods: {
indclose() {
if (this.schoolshow == true) {
this.induserall.user_school = this.induser.user_school
this.schoolshow = false
} else if (this.nameshow == true) {
this.induserall.user_name = this.induser.user_name
this.nameshow = false
}
},
confirm(e) {
this.induserall.user_city=[]
e.forEach(v => {
this.induserall.user_city += `${v.name},`
})
this.induserall.user_city = this.induserall.user_city.substr(0, this.induserall.user_city.length - 1) //获取地址
console.log(this.induserall.user_city)
this.addressshow = false;
},
async afterRead(fileImg) {
let aliyunOssToken = await this.$http.home.token();
let form = new FormData()
form.append("OSSAccessKeyId", aliyunOssToken.OSSAccessKeyId)
form.append("policy", aliyunOssToken.policy)
form.append("Signature", aliyunOssToken.signature)
form.append("key", fileImg.file.name)
form.append("file", fileImg.file)
await this.$http.home.uploadFile(form, {
"Content-Type": "multipart/form-data",
});
this.induser.user_portrait = `${config.aliOss.host}/${fileImg.file.name}`
this.induserall.user_portrait = `${config.aliOss.host}/${fileImg.file.name}`
},
async submit(){
let ret = await this.$http.me.meinfo(this.induserall);
this.$utils.setItem("token",this.induserall)
this.$toast.success('修改成功');
}
}
}
</script>
<style scoped lang="less">
@import "~@less/individual";
</style>

View File

@@ -0,0 +1,76 @@
<template>
<div class="Inquire">
<navbar title="搜索" :show-back="true" style="background-color: gold;"></navbar>
<page>
<div>
<div class="Square">
<div class="Square-search">
<img @click="trigger(clicks)" class="Square-img" src="../../static/images/icon/search.png">
<input v-model="initext" @change="trigger(clicks)" class="Square-text" type="text" >
</div>
</div>
</div>
<van-list v-model="dd" :immediate-check="false" :finished="dd" finished-text="没有更多了" @load="getTabList">
<div class="nodata" v-if="Ininfo.length == 0">
<img src="../../static/images/img/noLogin.png">
<p style="text-align: center;">没有数据</p>
</div>
<template v-else>
<item :list="Ininfo"></item>
</template>
</van-list>
</page>
</div>
</template>
<script>
export default {
data() {
return {
dd: false,
dd1: false,
Ininfo: [],//存储数据
initext: "",//搜索值
pagemax:6,//最大页数
pageindex:1,//初始页数
clicks:"click"
}
},
created() {
}
,
methods: {
async trigger(cka) {
if (this.initext != "") {
if(cka=="click"){
this.Ininfo=[]; //搜索内容改变数据制空
this.pageindex=1;
}
let res = await this.$http.home.trigger({keyword: this.initext,page:2});//获取搜索内容
res.forEach(v=>{ this.Ininfo.push(v)}) //循环添加数据
}else{
this.Ininfo=[] //搜索内容为空 数据制空
}
},
getTabList(){
this.pageindex+=1 //页数加一
this.trigger()//再次获取搜索内容
//判断页数是否达到最大页数
if(this.pageindex>this.pagemax){
this.dd1=true; //加载完成后不再触发load事件
}else{
this.dd=false; // 触发 load 事件
}
}
}
}
</script>
<style scoped lang="less">
@import "~@less/Inquire";
</style>

View File

@@ -0,0 +1,19 @@
<template>
<div class="layout">
<router-view/>
<tabbar></tabbar>
</div>
</template>
<script>
export default {
data () {
return {}
}
}
</script>
<style scoped lang='less'>
</style>

View File

@@ -0,0 +1,195 @@
<template>
<div class="me">
<page :top="0">
<div class="me-s"> </div>
<div class="cencer">
<div class="user_tips">
<div class="user_tips_title">我的</div>
<div class="user_tips_desc">浏览和管理您的设置</div>
</div>
<div class="user_card">
<div class="user_card_One">
<div class="user_card_One_s" @click="Individual">
<div class="user_card_One_s_div">
<img :src="meuser.user_portrait" alt="">
</div>
<div class="user_card_One_s_div1">
<div class="user_card_One_s_div1_l">{{ meuser.user_name }}</div>
<div class="user_card_One_s_div1_l1">暂未填写</div>
</div>
<img src="../../static/images/common/next.png">
</div>
<!-- //寻回历史记录 -->
<ul class="user_card_One_x">
<li @click="Recruitment(v)" v-for="v, i in mething" :key="i" class="user_card_One_x_div">
<div class="user_card_One_x_z">{{ v.name }}</div>
<div class="user_card_One_x_z1">{{ v.index }}</div>
</li>
</ul>
</div>
<div class="user_card_Two"></div>
<div class="user_card_Three"></div>
</div>
<ul class="user_address">
<li class="address_div" v-for="v, i in meaddress" :key="i">
<div class="address_div_z">{{ v.name }}</div>
<div class="address_div_z1">{{ v.text }}</div>
</li>
</ul>
<ul class="user_list">
<li @click="concerning(v.index)" v-for="v, i in melist" :key="i">
<div>
<img :src="v.src">
<div>{{ v.text }}</div>
</div>
<img src="../../static/images/common/next.png">
</li>
<li @click="mebuttom()" class="user_list_buttom">{{ button }}</li>
</ul>
</div>
</page>
</div>
</template>
<script>
import page from '../components/page.vue'
export default {
components: { page },
data() {
return {
button: "退出登录",
//历史记录
mething: [
{
name: '失物招领',
id: 1,
index: 0
},
{
name: '寻物启事',
id: 2,
index: 0
}
],
//电话 地址
meaddress: [
{
name: '城市',
text: null,
},
{
name: '电话',
text: null,
}
],
//列表
melist: [
{
src: "../../static/images/icon/edit.png",
text: '关于',
index: 1,
txt: "校园失物招领管理系统(拾金小程序)的主要功能就是帮助校内同学更快的找到自己的丢失之物。小程序系统UI界面简洁清晰、用户操作简易、没有繁杂的信息流、广告弹窗等众多干扰元素、减少使用成本提高使用效率增强用户粘性和归属感,为同学们提供最便捷优质的服务。"
},
{
src: "../../static/images/icon/edit.png",
text: '反馈',
index: 2,
txt: ""
},
{
src: "../../static/images/icon/edit.png",
text: '帮助',
index: 3,
txt: ""
},
{
src: "../../static/images/icon/edit.png",
text: '协议',
index: 4,
txt: ""
}
],
meuser: []
}
},
async created() {
this.meuser = this.$utils.getItem("token") //获取用户信息
let ret = await this.$http.me.history({ id: this.meuser.user_id }) //获取历史
console.log(ret)
this.meaddress[0].text = this.meuser.user_city == "" ? "暂未选择" : this.meuser.user_city;//地址
this.meaddress[1].text = this.meuser.user_phone//电话号码
this.mething.index = ret.lose_matter//失物
this.mething[0].index = ret.lose_matter//寻物
console.log(this.meuser)
},
methods: {
Recruitment({ id }) {
//进入历史界面修改这个name 便可!
this.$router.push({
name: "history",
query: {
id
}
})
},
//列表弹窗提示 目前只有关于 其他有的时候将 && v.index==1 删了即可
concerning(id) {
this.melist.forEach((v, i) => {
if (id == v.index && v.index == 1) {
this.$dialog.alert({
title: v.text,
message: v.txt,
});
}
})
},
//进入个人编辑
Individual() {
this.$router.push({
name: "ind"
})
},
mebuttom() {
this.$dialog.confirm({
title: '提示',
message: '确定退出当前账号吗?',
})
.then(() => {
localStorage.removeItem("token")
// on confirm
this.$router.push({
name: "Home"
})
})
.catch(() => {
// on cancel
});
}
}
}
</script>
<style scoped lang='less'>
@import "~@less/Me";
</style>

View File

@@ -0,0 +1,141 @@
<template>
<div class="push">
<navbar title="发布信息"></navbar>
<page :bottom="0">
<div class="shang">
<van-field v-model="pushParmas.thing_title" maxlength="50" :clearable="true" rows="2" type="textarea" :autosize="minHeightTa"
placeholder="物品的标题" />
<van-field v-model="pushParmas.thing_introduce" :clearable="true" rows="5" type="textarea" maxlength="500"
placeholder="请描述清楚时间,地点,物品特征等基本信息(限500字)" show-word-limit />
<van-uploader v-model="uploadFileList" class="shangchaun" :after-read="afterRead" :max-count="1"/>
</div>
<div class="last">
<div class="lasttitle">物品类型</div>
<div :class="thingTypeIndex == index ? 'active lastBottom' : 'lastBottom'" @click="clickOne(index)"
v-for="(item, index) in typeOne" :key="index">
{{ item.title }}
</div>
</div>
<div class="last">
<div class="lasttitle">物品类别</div>
<div :class="thingCategoryIndex == index ? 'active lastBottom' : 'lastBottom'" @click="clickTwo(index)"
v-for="(item, index) in typeTwo" :key="index">
{{ item.title }}
</div>
</div>
<div class="zuilast">
<van-icon class="zuilastclcl" name="smile-o" @click="pushEvent"/>
</div>
</page>
</div>
</template>
<script>
import config from '@/config';
export default {
data() {
return {
pushParmas: {
user_id: 0,
thing_title: "",
thing_introduce: "",
thing_img: null,
thing_type: null,
thing_category: null,
},
minHeightTa: { maxHeight: 100, minHeight: 0 },
uploadFileList: [],
thingTypeIndex: 0,
thingCategoryIndex: 0,
typeOne: [
{ title: '失物招领', type: 1 },
{ title: '寻物启事', type: 2 },
],
typeTwo: [
{ title: '证件', type: 1 },
{ title: '服装', type: 2 },
{ title: '数码', type: 3 },
{ title: '日用品', type: 4 },
{ title: '其他', type: 5 },
],
}
},
created() {
this.pushParmas.user_id = this.$utils.getItem("token").user_id
this.thingTypeIndex = this.$route.query.id ? this.$route.query.id - 1 : this.thingTypeIndex
console.log(this.$route.query.id )
this.pushParmas.thing_type = this.typeOne[this.thingTypeIndex].type
this.pushParmas.thing_category = this.typeTwo[this.thingCategoryIndex].type
},
methods: {
clickOne(index) {
this.pushParmas.thing_type = this.typeOne[index].type
this.thingTypeIndex = index
},
clickTwo(index) {
this.thingCategoryIndex = index
this.pushParmas.thing_category = this.typeTwo[index].type
},
async afterRead(fileImg) {
let aliyunOssToken = await this.$http.home.token();
let form = new FormData()
for (const key in aliyunOssToken) {
form.append(key, aliyunOssToken[key])
}
form.append("key", fileImg.file.name)
form.append("file", fileImg.file)
await this.$http.home.uploadFile(form,{
"Content-Type": "multipart/form-data",
});
this.pushParmas.thing_img = `${config.aliOss.host}/${fileImg.file.name}`
},
async pushEvent() {
if (this.pushParmas.thing_title.length == 0) {
this.$toast("标题不能为空")
return;
}
if (this.pushParmas.thing_introduce.length == 0) {
this.$toast("内容不能为空")
return;
}
console.log("pushParmas: ",this.pushParmas);
let res = await this.$http.home.push(this.pushParmas);
this.$toast({
message: "发布成功",
onClose: () => {
this.$router.push({ name: "Square" })
}
})
}
}
}
</script>
<style scoped lang='less'>
@import "~@less/Push";
</style>

View File

@@ -0,0 +1,104 @@
<template>
<div class="Square">
<navbar title="广场" :show-back="false"></navbar>
<page :top="133">
<van-tabs v-model="active" class="fa" @change="childrenChange">
<van-tab v-for="item, index in hall" :title="item.title" :key="index">
<van-tabs swipeable v-model="item.index" @change="childrenChange" class="chil">
<van-tab v-for="v, i in item.children" :title="v.title" :key="i">
<van-list v-model="v.loading" :immediate-check="false" :finished="v.finished" finished-text="没有更多了"
@load="getTabList">
<div class="nodata" v-if="v.content.length == 0">
<p>没有数据</p>
</div>
<template v-else>
<item :list="v.content"></item>
</template>
</van-list>
</van-tab>
</van-tabs>
</van-tab>
</van-tabs>
</page>
</div>
</template>
<script>
export default {
data() {
return {
active: 0,
hall: [
{
type: 1,
title: '失物招领',
index: 0,
children: [
{ title: '全部', type: -1, page: 1, loading: false, finished: false, totalpage: 3, content: [] },
{ title: '证件', type: 1, page: 1, loading: false, finished: false, totalpage: 3, content: [] },
{ title: '服装', type: 2, page: 1, loading: false, finished: false, totalpage: 5, content: [] },
{ title: '数码', type: 3, page: 1, loading: false, finished: false, totalpage: 2, content: [] },
{ title: '日用品', type: 4, page: 1, loading: false, finished: false, totalpage: 1, content: [] },
{ title: '其他', type: 5, page: 1, loading: false, finished: false, totalpage: 4, content: [] },
]
},
{
type: 2,
title: '寻物启事',
index: 0,
children: [
{ title: '全部', type: -1, page: 1, loading: false, finished: false, totalpage: 4, content: [] },
{ title: '证件', type: 1, page: 1, loading: false, finished: false, totalpage: 3, content: [] },
{ title: '服装', type: 2, page: 1, loading: false, finished: false, totalpage: 5, content: [] },
{ title: '数码', type: 3, page: 1, loading: false, finished: false, totalpage: 2, content: [] },
{ title: '日用品', type: 4, page: 1, loading: false, finished: false, totalpage: 1, content: [] },
{ title: '其他', type: 5, page: 1, loading: false, finished: false, totalpage: 4, content: [] },
]
}
]
}
},
created() {
this.getTabList("click")
},
methods: {
async getTabList(type) {
let childrenObj = this.hall[this.active].children[this.hall[this.active].index]
let a = async () => {
let res = await this.$http.home.tab({
thing_type: this.hall[this.active].type,
thing_category: childrenObj.type,
page: childrenObj.page
});
childrenObj.content = [
...childrenObj.content,
...res
]
childrenObj.page += 1;
if (childrenObj.page > childrenObj.totalpage) {
childrenObj.finished = true
} else {
childrenObj.loading = false
}
}
type == "click"
? childrenObj.content.length == 0 ? a() : null
: a()
},
childrenChange() {
this.getTabList("click")
// console.log('99',click)
}
}
}
</script>
<style scoped lang='less'>
@import "~@less/Square";
</style>

View File

@@ -0,0 +1,131 @@
<template>
<div class="user">
<img src="/static/images/img/loginBack.png" alt="">
<div v-if="status" class="login">
<van-cell-group :border="false">
<van-field v-model="loginParams.phone" :maxlength="11" type="number" :clearable="true" placeholder="输入手机号">
<template #left-icon>
<van-icon class="set_icon" name="phone-o" size="23" />
</template>
</van-field>
<van-field v-model="loginParams.pwd" type="password" :clearable="true" placeholder="输入密码">
<template #left-icon>
<van-icon class="set_icon" name="shield-o" size="23" />
</template>
</van-field>
</van-cell-group>
<div class="login_but">
<van-button type="primary" round @click="UserLogin">登 录</van-button>
<div class="reg_tx" @click="status = false">注册账号</div>
</div>
</div>
<div v-else class="reg login">
<van-cell-group :border="false">
<van-field v-model="addParams.phone" :clearable="true" :maxlength="11" type="number" placeholder="输入手机号">
<template #left-icon>
<van-icon class="set_icon" name="phone-o" size="23" />
</template>
</van-field>
<van-field v-model="addParams.pwd" type="password" :clearable="true" placeholder="输入密码">
<template #left-icon>
<van-icon class="set_icon" name="shield-o" size="23" />
</template>
</van-field>
<van-field v-model="addParams.againPwd" type="password" :clearable="true" placeholder="输入确认密码">
<template #left-icon>
<van-icon class="set_icon" name="shield-o" size="23" />
</template>
</van-field>
</van-cell-group>
<div class="login_but">
<van-button type="primary" round @click="UserAdd">注 册</van-button>
<div class="reg_tx" @click="status = true">登录账号</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
status: true, // true 登录 false 注册
loginParams: {
phone: '15155145354',
pwd: 'Lb714500.'
},
addParams: {
phone: '15155145354',
pwd: 'Lb714500.',
againPwd: 'Lb714500.'
}
}
},
methods: {
async UserAdd() {
if (!this.$utils.isPhone(this.addParams.phone)) {
this.$toast("手机号不正确")
return;
}
if (!this.$utils.checkPwd(this.addParams.pwd)) {
this.$toast("密码不符合要求")
return;
}
if (this.addParams.pwd != this.addParams.againPwd) {
this.$toast("确认密码不符合要求")
return;
}
delete this.addParams.againPwd
let res = await this.$http.user.add(this.addParams);
this.$toast({
message: "恭喜注册成功",
onClose: () => {
this.status = true
}
})
},
async UserLogin() {
if (!this.$utils.isPhone(this.loginParams.phone)) {
this.$toast("手机号不正确")
return;
}
if (!this.$utils.checkPwd(this.loginParams.pwd)) {
this.$toast("密码不符合要求")
return;
}
let userInfo = await this.$http.user.login(this.loginParams);
this.$utils.setItem("token", userInfo);
this.$toast({
message: "恭喜登录成功",
onClose: () => {
if (this.$route.query.from) {
this.$router.push(this.$route.query.from)
} else {
this.$router.push("/")
}
}
})
}
}
}
</script>
<style scoped lang='less'>
@import "~@less/User";
</style>

View File

@@ -0,0 +1,159 @@
<template>
<div class="history">
<navbar title="历史记录" :show-back="true"></navbar>
<page :top="90">
<van-tabs v-model="active" class="fa" @change="childrenChange">
<!-- //头部z -->
<van-tab class="tabvan" v-for="item, index in historyArr" :title="item.title" :key="index">
<!-- //内容z -->
<div class="content" v-for="v, i in historyList" :title="v.title" :key="i">
<div class="nodata" v-if="v.length == 0">
<img src="../../static/images/img/noLogin.png">
<p style="text-align: center;">没有数据</p>
</div>
<div v-else class="contentone">
<div class="img" @click="enterInfo(v.thing_id)">
<img :src="v.thing_img">
<div class="search" v-if="v.thing_status == 1 && item.thing == 1">已认领</div>
<div class="search" v-else-if="v.thing_status == 0 && item.thing == 1">未认领</div>
<div class="search" v-else-if="v.thing_status == 1 && item.thing == 2">已寻回</div>
<div class="search" v-else-if="v.thing_status == 0 && item.thing == 2">未寻回</div>
</div>
<div class="right" @click="enterInfo(v.thing_id)">
<div class="title">{{ v.thing_title }}</div>
<div class="context">{{ v.thing_introduce }}</div>
</div>
</div>
<template>
<div class="queren" @click="telphonek(v.thing_id)"
v-if="v.thing_status == 0 && item.thing == 1">确认被认领
</div>
<div class="querene" @click="telphonek(v.thing_id)"
v-else-if="v.thing_status == 0 && item.thing == 2">确认已寻回
</div>
</template>
</div>
</van-tab>
</van-tabs>
</page>
</div>
</template>
<script>
import { Dialog } from 'vant';
export default {
data() {
return {
active: 0,
historyArr: [
{
title: '失物招领',
thing: 1,
},
{
title: '寻物启事',
thing: 2,
},
],
//接口反的
historyList: [],
zhuangtai: 0,
tokenid: 0,
success: '',
}
},
created() {
//获取本地user_id
this.tokenid = this.$utils.getItem("token").user_id
console.log("本地token", this.tokenid);
this.zhuangtai = this.$route.query.id;
this.active = this.$route.query.id - 1;
console.log('传过来的', this.zhuangtai);
this.getHistoryList();
},
methods: {
//进入详情
enterInfo(id) {
this.$router.push({
path: "/info",
query: {
id
}
})
},
telphonek(id) {
//弹窗
Dialog.confirm({
message: '请确定已与【失主】或【物主】进行详细沟通并成功拿到丢失物品,一但确定不可取消!',
})
.then(async () => {
// 接口改变状态
console.log("id", id)
let ayay = await this.$http.home.changeStatus({
user_id: this.tokenid,//用户id
thing_id: id,//物品的id
thing_status: 1, // 要修改的状态
});
this.message = ayay
console.log("this.message 修改 :", this.message);
this.getHistoryList()
})
.catch(() => {
// Toast('提示内容');
console.log(5555);
});
},
childrenChange() {
if (this.zhuangtai == 1) {
this.zhuangtai = 2
this.getHistoryList();
console.log("1变2", this.zhuangtai);
} else if (this.zhuangtai == 2) {
this.zhuangtai = 1
this.getHistoryList();
console.log("2变1", this.zhuangtai);
}
},
async getHistoryList() {
let res = await this.$http.home.history({
user_id: this.tokenid,
thing_type: this.zhuangtai,
});
this.historyList = res
},
// async getChangeStatusList() {
// let ayay = await this.$http.home.changeStatus({
// user_id: this.tokenid,
// thing_id: this.zhuangtai,//物品的id
// // 要修改的状态
// thing_status: 1,
// });
// this.message = ayay
// console.log("this.message 修改 :", this.message);
// },
}
}
</script>
<style scoped lang='less'>
@import "~@less/history";
</style>

View File

@@ -0,0 +1,108 @@
<template>
<div class="info">
<navbar title="详情" :show-back="true"></navbar>
<page :top="46">
<div class="top">
<div class="toplist">
<img class="imgtop" :src="infolistL.user_portrait" alt="">
<div>
<div class="name">{{ infolistL.user_name }}</div>
<div class="message" v-if="infolistL.user_school !== ''">{{ infolistL.user_school }}</div>
<div v-else class="message">用户未填写学校信息</div>
</div>
</div>
<div class="toprigth" @click="clickone" v-if="infolistL.thing_status == 0">我要认领</div>
<div class="toprigthw" v-else @click="showPopup">已经认领
<!-- <van-cell is-link>展示弹出层</van-cell> -->
</div>
</div>
<div class="ceshitext">
<div class="leftceshi">
<div class="leftext">{{ infolistL.thing_title }}</div>
<div class="lefttime">{{ infolistL.thing_createdtime }}</div>
</div>
<div v-if="infolistL.thing_category == 1" class="righttext">证件</div>
<div v-else-if="infolistL.thing_category == 2" class="righttext">服装</div>
<div v-else-if="infolistL.thing_category == 3" class="righttext">数码</div>
<div v-else-if="infolistL.thing_category == 4" class="righttext">日用品</div>
<div v-else class="righttext">其他</div>
</div>
<div class="foot">
<div class="foottext">
{{ infolistL.thing_introduce }}
</div>
<div class="footimga">
<img class="footimg" :src="infolistL.thing_img">
</div>
</div>
<div class="shouone">
<van-popup v-model="show">抱歉已经认领了哦</van-popup>
</div>
</page>
<van-overlay class="imgthree" :show="shouad" @click="clickone">
<div class="wrapper">
<img class="imgtitle" :src="infolistL.user_portrait" alt="">
<div class="tetext" @click="telphonek">电话联系我</div>
<div class="lasttext">请勿轻易相信他人,线下见面请注意个人安全</div>
</div>
</van-overlay>
</div>
</template>
<script>
import { Dialog } from 'vant';
export default {
data() {
return {
infolistL: [],
show: false,
shouad: false,
iphone: ''
}
},
created() {
this.getInfoList()
},
methods: {
telphonek() {
//弹窗
Dialog.confirm({
title: '标题',
message: '拨打' + `${this.iphone}`,
})
.then(() => {
this.shouad = false
})
.catch(() => {
this.shouad = false
});
},
showPopup() {
this.show = true;
},
clickone() {
this.shouad = true
},
async getInfoList() {
let res = await this.$http.home.info({
thing_id: this.$route.query.id
});
this.infolistL = res
this.iphone = res.user_phone
console.log(55555, this.iphone);
},
}
}
</script>
<style scoped lang='less'>
@import "~@less/info";
// .tetext{
// color: red;
// }
</style>