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

feat: 我的页面 接入接口

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