Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
tswj
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2022-05-13 15:41:02 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0ba16910dfbcc02ef71143d8b3993e3d70528a10
0ba16910
1 parent
b7504535
✨ feat(家长,老师上传模块): 处理上传跳转回页面数据问题
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
9 deletions
src/views/business/index.vue
src/views/client/finishUpload.vue
src/views/business/index.vue
View file @
0ba1691
...
...
@@ -45,7 +45,7 @@
</van-row>
</div>
<template v-for="(item, key) in kgInfo.book" :key="key">
<book-card :item="item" type="B" @on-click="onClick(item)"></book-card>
<book-card :item="item" type="B"
:user_id="kgInfo.user_id"
@on-click="onClick(item)"></book-card>
</template>
</div>
<div style="height: 1rem;"></div>
...
...
src/views/client/finishUpload.vue
View file @
0ba1691
...
...
@@ -10,7 +10,7 @@
<p style=" margin-bottom: 0.5rem;">您是否愿意与偏远山区的小朋友</p>
<p>共读这么精彩的书籍</p>
</div>
<div style="padding: 0 15% 0.5rem 15%;">
<div
v-if="book_id"
style="padding: 0 15% 0.5rem 15%;">
<my-button @on-click="toDonate" type="plain">我要爱心捐书</my-button>
</div>
<div style="padding: 0 15% 1rem 15%;">
...
...
@@ -36,20 +36,43 @@ const $route = useRoute();
const $router = useRouter();
/*************** 捐书模块START ***************/
const donateItem = ref({})
const book_id = $route.query.x_field_1 ? $route.query.x_field_1.split('-')[1] : '';
if (!book_id) {
Toast.fail('书籍数据不全');
}
axios.get('/srv/?a=default_perf', {
params: {
book_id
}
})
.then(res => {
if (res.data.code === 1) {
donateItem.value = res.data.data;
} else {
console.warn(res);
Toast({
icon: 'close',
message: res.data.msg
});
}
})
.catch(err => {
console.error(err);
});
// TODO: 作品上传完成后,回调到成功页面,需要返回书籍的详情
// 弹出捐赠弹框模块
const showDonate = ref(false);
const toDonate = () => {
showDonate.value = true;
//
TODO: 这些信息到时候需要后台带过来
//
生成捐赠数据
donateItem.value = {
book_id:
'314134'
,
avatar:
'https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPngc434046fdf1f9499d251b280af2568ddbe64839799d00a9aee226edbeb710aed'
,
name:
'逃家小兔绘本'
,
price:
'59'
book_id:
donateItem.value.book_id
,
avatar:
donateItem.value.book_cover
,
name:
donateItem.value.book_name
,
price:
donateItem.value.book_price
}
}
...
...
@@ -60,7 +83,10 @@ const closeDonate = (v) => {
const goBack = () => {
$router.push({
path: '/client/bookDetail'
path: '/client/bookDetail',
query: {
id: donateItem.value.book_id
}
})
}
...
...
Please
register
or
login
to post a comment