finishUpload.vue
2.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<template>
<div class="finishUpload-page">
<div style="background-color: #F7F7F7; padding-top: 2rem; padding-bottom: 2rem;">
<van-image round width="6rem" height="6rem" style="vertical-align: bottom;" :src="icon_success" />
<p style="font-size: 1.05rem; margin: 0.5rem; font-weight: bold;">提交成功!</p>
<p style="font-size: 0.9rem; margin-bottom: 0.5rem;">您的作品正在等待老师审核</p>
<p style="font-size: 0.9rem;">请耐心等待~~</p>
</div>
<div style=" padding-top: 2rem; padding-bottom: 2rem; font-size: 0.9rem; color: #713610;">
<p style=" margin-bottom: 0.5rem;">您是否愿意与偏远山区的小朋友</p>
<p>共读这么精彩的书籍</p>
</div>
<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%;">
<my-button @on-click="goBack" type="primary">返回</my-button>
</div>
</div>
<donate-book :showPopup="showDonate" :item="donateItem" @on-close="closeDonate"></donate-book>
</template>
<script setup>
import icon_success from '@images/que-sucess@2x.png'
import MyButton from '@/components/MyButton/index.vue'
import DonateBook from '@/components/DonateBook/index.vue'
import { ref, reactive, onMounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import axios from '@/utils/axios';
import $ from 'jquery'
import { Toast } from 'vant';
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);
});
// 弹出捐赠弹框模块
const showDonate = ref(false);
const toDonate = () => {
showDonate.value = true;
// 生成捐赠数据
donateItem.value = {
book_id: donateItem.value.book_id,
avatar: donateItem.value.book_cover,
name: donateItem.value.book_name,
price: donateItem.value.book_price
}
}
const closeDonate = (v) => {
showDonate.value = v;
}
/**********************************/
const goBack = () => {
$router.push({
path: '/client/bookDetail',
query: {
id: donateItem.value.book_id
}
})
}
onMounted(() => {
})
</script>
<script>
import mixin from 'common/mixin';
export default {
mixins: [mixin.init],
data() {
return {
}
},
mounted() {
},
methods: {
}
}
</script>
<style lang="less" scoped>
.finishUpload-page {
color: #222222;
text-align: center;
}
</style>