提交 b4edfa36 authored 作者: 劳广强's avatar 劳广强

feat: 我的页面 接入接口

上级 699ba102
......@@ -73,14 +73,13 @@
"devServer" : {
"proxy" : {
"/api" : {
// "target" : "https://csssptest.yuhuofei.cn",
// "target" : "https://csssptest.yuhuofei.cn",
"target" : "https://devrxssph5.yuhuofei.cn/",
"pathRewrite" : {
// "^/api" : ""
}
"pathRewrite" : {}
}
}
},
// "^/api" : ""
"sdkConfigs" : {
"maps" : {
"amap" : {
......
......@@ -70,6 +70,13 @@
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
{
"path": "pages/mine-about/index",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
],
"tabBar": {
......
<template>
<view>
<view class="u-content">
<u-parse :content="content" />
</view>
</view>
</template>
<script>
export default {
data() {
return {
content: '',
};
},
onLoad(query) {
this.fetchContent();
},
methods: {
async fetchContent() {
const { list } = await uni.$u.http.get('/api/app/textintroduction/list', { params: { text_type: 5 } });
this.content = list[0]?.content ?? '';
},
},
};
</script>
<style scoped lang="scss">
@import 'index.scss';
</style>
......@@ -71,11 +71,11 @@
</template>
<script>
import { photoDetail } from '@/pages/mine-picture-detail/mock';
export default {
data() {
return {
query: {},
status: 1,
id: null,
photoList: [],
......@@ -84,11 +84,14 @@ export default {
};
},
onLoad(query) {
this.query = query;
this.fetchPhotoDetail();
},
methods: {
async fetchPhotoDetail() {
const dataList = [photoDetail];
const { detail } = await uni.$u.http.get('/api/app/phototask/detail', { params: { id: this.query.id } });
const dataList = [detail];
dataList.forEach((item) => {
item.image_list = item.image_list.split(',');
......
......@@ -10,8 +10,7 @@
</view>
<view class="container">
<template v-if="ExamineIdx === 0">
<view class="detail" v-for="(item, index) in examineList" :key="item.id">
<navigator hover-class="none" url="/package-two/my-phtot-detail/my-phtot-detail?id=item.id"></navigator>
<view class="detail" v-for="(item, index) in list.data" :key="item.id" @click="onItemClick(item, index)">
<view v-if="item.status === 1">
<view class="detail_item">
<view class="date">{{ item.put_date }}</view>
......@@ -40,8 +39,7 @@
</view>
</template>
<template v-if="ExamineIdx === 1">
<view class="detail" v-for="(item, index) in examineList" :key="item.id">
<navigator hover-class="none" url="/package-two/my-phtot-detail/my-phtot-detail?id=item.id"></navigator>
<view class="detail" v-for="(item, index) in list.data" :key="item.id" @click="onItemClick(item, index)">
<view v-if="item.status === 2">
<view class="detail_item">
<view class="date">{{ item.put_date }}</view>
......@@ -70,8 +68,7 @@
</view>
</template>
<template v-if="ExamineIdx === 2">
<view class="detail" v-for="(item, index) in examineList" :key="item.id">
<navigator hover-class="none" url="/package-two/my-phtot-detail/my-phtot-detail?id=item.id"></navigator>
<view class="detail" v-for="(item, index) in list.data" :key="item.id" @click="onItemClick(item, index)">
<view v-if="item.status === 3">
<view class="detail_item">
<view class="date">{{ item.put_date }}</view>
......@@ -101,7 +98,7 @@
</view>
</template>
<view class="data_none" v-if="examineList.length === 0">
<view class="data_none" v-if="list.data.length === 0 && list.status !== 'loading'">
<image mode="aspectFill" class="data_img" src="/static/pic_wushuju@2x.png" />
<view class="data_title">暂无数据</view>
</view>
......@@ -111,6 +108,7 @@
<script>
import { examineItem, examineList } from '@/pages/mine-picture/mock';
import { getList, createList } from '@/utils/list';
export default {
data() {
......@@ -119,27 +117,35 @@ export default {
ExamineIdx: 0,
status: 1,
examineList,
list: createList(),
};
},
onLoad(query) {
this.fetchExamineList();
},
methods: {
async fetchExamineList() {
const type = this.data.ExamineIdx + 1;
const res = await request.get(`/api/app/phototask/list?status=${type}`, {});
this.setData({
examineList: res.data.list,
});
this.data.examineList.forEach((item) => {
item.put_date = item.put_date.substring(0, 16);
});
this.setData({
examineList: this.data.examineList,
const status = this.ExamineIdx + 1;
await getList(this, 'list', ['api/app/phototask/list', { status }], {
transform: (list) => list.map((value) => ({ ...value })),
abandon: () => status !== this.ExamineIdx + 1,
});
console.log(this.data.examineList);
console.log(this.list);
},
async changeExamine(item, index) {
changeExamine(item, index) {
if (this.ExamineIdx === index) return;
this.ExamineIdx = index;
// this.examineList()
this.list = createList();
this.fetchExamineList();
},
onItemClick(item, index) {
uni.$u.route({ url: 'pages/mine-picture-detail/index', params: { id: item.id } });
},
},
};
......
......@@ -24,7 +24,7 @@
<view class="my_item_box">
<!-- 我的随手拍 -->
<view class="my_items" bindtap="myPhoto">
<view class="my_items" @click="myPhoto">
<view class="my_item_left">
<image mode="aspectFill" class="task_icon" src="/static/icon/ic_wd_ssp@2x.png" />
<view class="item_name">我的随手拍</view>
......@@ -32,7 +32,7 @@
<image mode="aspectFill" class="arrow_right" src="/static/icon/arrow_right1@2x.png" />
</view>
<!-- 关于我们 -->
<view class="my_items" bindtap="about">
<view class="my_items" @click="about">
<view class="my_item_left">
<image mode="aspectFill" class="task_icon" src="/static/icon/ic_wd_gy@2x.png" />
<view class="item_name">关于我们</view>
......@@ -40,7 +40,7 @@
<image mode="aspectFill" class="arrow_right" src="/static/icon/arrow_right1@2x.png" />
</view>
<!-- 注销登录 -->
<view class="my_items" bindtap="tailor">
<view class="my_items" @click="tailor">
<view class="my_item_left">
<image mode="aspectFill" class="task_icon" src="/static/icon/ic_wd_srdz@2x.png" />
<view class="item_name">注销登录</view>
......@@ -66,17 +66,44 @@
</template>
<script>
import { userDetail } from '@/pages/mine/mock';
export default {
data() {
return {
token: null,
canIUseGetUserProfile: false,
userDetail,
userDetail: {},
};
},
methods: {},
onLoad(query) {},
onShow() {
this.token = '1234qwer1234';
this.fetchUserInfo();
},
methods: {
async fetchUserInfo() {
const { detail } = await uni.$u.http.get('/api/user_center/detail');
this.userDetail = detail;
},
myPhoto() {
uni.$u.route({ url: 'pages/mine-picture/index' });
},
about() {
uni.$u.route({ url: 'pages/mine-about/index' });
},
async tailor() {
try {
await uni.$u.http.get('/api/user/logout', { params: { token: '' } });
uni.$u.toast('注销登录成功');
} finally {
}
},
},
};
</script>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论