hookehuyr

✨ feat: 证书背景图调整

...@@ -147,8 +147,6 @@ const cancelDonate = () => { ...@@ -147,8 +147,6 @@ const cancelDonate = () => {
147 closeBtn(); 147 closeBtn();
148 } 148 }
149 149
150 -// TODO: 微信支付
151 -
152 onMounted(() => { 150 onMounted(() => {
153 151
154 }) 152 })
......
...@@ -34,11 +34,23 @@ ...@@ -34,11 +34,23 @@
34 </div> 34 </div>
35 </div> 35 </div>
36 <div class="date">{{ item.donate_date }}</div> 36 <div class="date">{{ item.donate_date }}</div>
37 - <div style="color: #713610; padding: 1rem 2rem; font-size: 0.9rem;"> 37 + <div style="color: #713610; padding-left: 10%; font-size: 0.9rem; position: relative; bottom: 1rem;">
38 证书编号:{{ item.cert_code }} 38 证书编号:{{ item.cert_code }}
39 </div> 39 </div>
40 - <div class="wrapper-border" /> 40 + <div style="height: 3rem;" />
41 - <div style="height: 2rem;" /> 41 + <div class="wrapper-border">
42 + <div class="top-bg">
43 + <van-image :src="donate_top" style="width: 100%; height: 10rem;" />
44 + </div>
45 + <div class="center-bg">
46 + <!-- <van-image :src="donate_center" style="width: 100%;" /> -->
47 + <img :src="donate_center" :style="style">
48 + </div>
49 + <div class="bottom-bg">
50 + <van-image :src="donate_bottom" style="width: 100%;" />
51 + </div>
52 + <div style="height: 3rem;" />
53 + </div>
42 </div> 54 </div>
43 </template> 55 </template>
44 56
...@@ -47,6 +59,11 @@ ...@@ -47,6 +59,11 @@
47 import icon_cert from '@images/zhengshu@2x.png' 59 import icon_cert from '@images/zhengshu@2x.png'
48 import icon_stamp01 from '@images/stamp01.png' 60 import icon_stamp01 from '@images/stamp01.png'
49 import icon_stamp02 from '@images/stamp02.png' 61 import icon_stamp02 from '@images/stamp02.png'
62 +import donate_bg_c_2 from '@images/donate_bg_c_2.png'
63 +import donate_top from '@images/donate_top.png'
64 +import donate_center from '@images/donate_center.png'
65 +import donate_bottom from '@images/donate_bottom.png'
66 +import $ from 'jquery'
50 67
51 </script> 68 </script>
52 69
...@@ -60,11 +77,17 @@ export default { ...@@ -60,11 +77,17 @@ export default {
60 return { 77 return {
61 name: '', 78 name: '',
62 price: '', 79 price: '',
63 - datetime: '' 80 + datetime: '',
81 + style: ''
64 } 82 }
65 }, 83 },
66 mounted() { 84 mounted() {
67 - 85 + // 动态计算背景图高度
86 + const wrapper_height = $('.donate-certificate').height()
87 + const top_height = $('.top-bg').height()
88 + const bottom_height = $('.bottom-bg').height()
89 + const height = (wrapper_height - top_height - bottom_height).toFixed();
90 + this.style = `width: 100%;height:${height}px;`;
68 }, 91 },
69 methods: { 92 methods: {
70 93
...@@ -138,12 +161,37 @@ export default { ...@@ -138,12 +161,37 @@ export default {
138 } 161 }
139 .wrapper-border { 162 .wrapper-border {
140 position: absolute; 163 position: absolute;
141 - border: 1px dashed #11D2B1; 164 + // border: 0.5px solid #11D2B1;
142 height: 95%; 165 height: 95%;
143 top: 0; 166 top: 0;
144 width: 93%; 167 width: 93%;
145 margin: 3%; 168 margin: 3%;
146 - border-radius: 1rem; 169 + // border-radius: 1.5rem;
170 + // overflow: hidden;
171 + .top-bg {
172 + margin: 0;
173 + padding: 0;
174 + font-size: 0;
175 + position: absolute;
176 + top: 0;
177 + width: 100%;
178 + }
179 + .center-bg {
180 + margin: 0;
181 + padding: 0;
182 + font-size: 0;
183 + position: absolute;
184 + top: 10%;
185 + width: 100%;
186 + }
187 + .bottom-bg {
188 + margin: 0;
189 + padding: 0;
190 + font-size: 0;
191 + position: absolute;
192 + bottom: 0;
193 + width: 100%;
194 + }
147 } 195 }
148 } 196 }
149 </style> 197 </style>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
2 * @Author: hookehuyr hookehuyr@gmail.com 2 * @Author: hookehuyr hookehuyr@gmail.com
3 * @Date: 2022-05-31 22:09:58 3 * @Date: 2022-05-31 22:09:58
4 * @LastEditors: hookehuyr hookehuyr@gmail.com 4 * @LastEditors: hookehuyr hookehuyr@gmail.com
5 - * @LastEditTime: 2022-06-09 18:32:49 5 + * @LastEditTime: 2022-06-16 15:12:18
6 * @FilePath: /tswj/src/components/DonateFlower/index.vue 6 * @FilePath: /tswj/src/components/DonateFlower/index.vue
7 * @Description: 捐花组件 7 * @Description: 捐花组件
8 --> 8 -->
...@@ -29,12 +29,13 @@ ...@@ -29,12 +29,13 @@
29 <div class="donate-number"> 29 <div class="donate-number">
30 <van-row v-if="more_donate"> 30 <van-row v-if="more_donate">
31 <van-col span="18" style="text-align: right;"> 31 <van-col span="18" style="text-align: right;">
32 - <van-field style="border: 1px solid #11D2B1; padding: 0.4rem 1rem;" v-model="donate_number" type="digit" 32 + <van-field v-model="donate_number" style="border: 1px solid #11D2B1; padding: 0.4rem 1rem;" type="digit"
33 input-align="center" label="" placeholder="请输入花花数量" /> 33 input-align="center" label="" placeholder="请输入花花数量" />
34 </van-col> 34 </van-col>
35 <van-col span="6" style="line-height: 2.5;">&nbsp;朵花花</van-col> 35 <van-col span="6" style="line-height: 2.5;">&nbsp;朵花花</van-col>
36 </van-row> 36 </van-row>
37 - <div v-else style="border: 1px solid #11D2B1; padding: 0.4rem 1rem;" @click="showMoreDonate">更多花花</div> 37 + <div v-else style="border: 1px solid #11D2B1; padding: 0.4rem 1rem;" @click="more_donate = true">更多花花
38 + </div>
38 </div> 39 </div>
39 <div v-if="userType === USER_TYPE.CHILDREN || userType === USER_TYPE.KINDERGARTEN" class="donate-name"> 40 <div v-if="userType === USER_TYPE.CHILDREN || userType === USER_TYPE.KINDERGARTEN" class="donate-name">
40 <van-row> 41 <van-row>
...@@ -96,7 +97,7 @@ ...@@ -96,7 +97,7 @@
96 <script setup> 97 <script setup>
97 import { icon_flower } from '@/utils/generateIcons' 98 import { icon_flower } from '@/utils/generateIcons'
98 import MyButton from '@/components/MyButton/index.vue' 99 import MyButton from '@/components/MyButton/index.vue'
99 -import { ref, onMounted, watch, nextTick } from 'vue' 100 +import { ref, watch, nextTick } from 'vue'
100 import { useRouter } from 'vue-router' 101 import { useRouter } from 'vue-router'
101 import { $, Toast } from '@/utils/generatePackage' 102 import { $, Toast } from '@/utils/generatePackage'
102 import { addDonateAPI } from '@/api/C/donate.js' 103 import { addDonateAPI } from '@/api/C/donate.js'
...@@ -147,8 +148,12 @@ const addDonate = async (params) => { ...@@ -147,8 +148,12 @@ const addDonate = async (params) => {
147 const { data } = await addDonateAPI(params); 148 const { data } = await addDonateAPI(params);
148 if (data.id) { 149 if (data.id) {
149 closeBtn(); 150 closeBtn();
151 + // TODO: 微信支付
152 + // wechatPay(data.id);
150 // 交易成功跳转回调页面 153 // 交易成功跳转回调页面
151 - // TEMP: 临时传参 donate_id 154 + // TEMP: 临时传参 donate_id, 页面到时候给到后端跳转
155 + // 回调地址
156 + // http://voice.onwall.cn/f/voice/#/client/wechatpayCallback?donate_id=xxx
152 $router.push({ 157 $router.push({
153 path: '/client/wechatpayCallback', 158 path: '/client/wechatpayCallback',
154 query: { 159 query: {
...@@ -202,26 +207,12 @@ const cancelDonate = () => { ...@@ -202,26 +207,12 @@ const cancelDonate = () => {
202 } 207 }
203 208
204 // TODO: 微信支付 209 // TODO: 微信支付
205 -onMounted(async () => { 210 +const wechatPay = (id) => {
206 - // 获取 wx 配置文件 211 + const base = 'http://voice.onwall.cn/WxpayAPI/voice_pay/jsapi_voice.php'
207 - // const { data } = await wxJsAPI() 212 + location.href = `${base}?i=${id}`
208 - // const cfg = data 213 +}
209 - // wx.config(cfg);
210 - // wx.ready((res) => {
211 - // });
212 - // wx.error((err) => {
213 - // console.error(err);
214 - // });
215 -});
216 -// const wxPay = async () => {
217 -// const params = { bill_id: bill_id }
218 -// const { data } = await wxPayAPI(params)
219 -// }
220 214
221 const more_donate = ref(false); 215 const more_donate = ref(false);
222 -const showMoreDonate = () => {
223 - more_donate.value = true
224 -}
225 // 选择捐赠数量 216 // 选择捐赠数量
226 const selectDonate = (index) => { 217 const selectDonate = (index) => {
227 donate_number.value = index 218 donate_number.value = index
......