支付祈福订单-待完善
This commit is contained in:
parent
4ddb9bfd5c
commit
cc471533cf
32
api/order/order.js
Normal file
32
api/order/order.js
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
import request from "../../utils/request";
|
||||||
|
|
||||||
|
// 祈愿订单接口
|
||||||
|
export function ordersPray(data = {}) {
|
||||||
|
return request({
|
||||||
|
url: "/app/orders/pray",
|
||||||
|
method: "POST",
|
||||||
|
data: {
|
||||||
|
channelId: 1,
|
||||||
|
templeId: 12,
|
||||||
|
...data,
|
||||||
|
}, // POST请求应该使用data而不是params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 法会订单接口
|
||||||
|
export function ordersFormed(data = {}) {
|
||||||
|
return request({
|
||||||
|
url: "/app/orders/formed",
|
||||||
|
method: "POST",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 供奉订单接口
|
||||||
|
export function ordersEnshrined(data = {}) {
|
||||||
|
return request({
|
||||||
|
url: "/app/orders/enshrined",
|
||||||
|
method: "POST",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
19
page_user/webView/webView.vue
Normal file
19
page_user/webView/webView.vue
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
<template>
|
||||||
|
<view class="pages">
|
||||||
|
<web-view :src="https"></web-view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
https: "",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLoad(option) {
|
||||||
|
this.https = decodeURIComponent(decodeURIComponent(option.https));
|
||||||
|
console.log("https:" + option.https);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
@ -19,5 +19,3 @@ export default {
|
||||||
methods: {},
|
methods: {},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
|
||||||
|
|
|
||||||
|
|
@ -251,6 +251,13 @@
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "VR"
|
"navigationBarTitleText": "VR"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "webView/webView",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText" : ""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -211,10 +211,11 @@ export default {
|
||||||
uni.showToast({ title: "祈福成功!", icon: "success" });
|
uni.showToast({ title: "祈福成功!", icon: "success" });
|
||||||
this.resetForm();
|
this.resetForm();
|
||||||
|
|
||||||
|
let prayId = response.data.prayId;
|
||||||
// 跳转到祈福成功页面
|
// 跳转到祈福成功页面
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pages/pray/praySuccess",
|
url: "/pages/pray/praySuccess?prayId=" + prayId,
|
||||||
});
|
});
|
||||||
}, 1500);
|
}, 1500);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,14 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="page">
|
<view class="page">
|
||||||
<custom-navbar title="祈福成功" />
|
<custom-navbar title="祈福成功" />
|
||||||
<view class="header" :style="{ backgroundColor: CommonEnum.BASE_COLOR }">
|
<view :style="{ backgroundColor: CommonEnum.BASE_COLOR }" class="header">
|
||||||
<!-- 孔明灯图标 -->
|
<!-- 孔明灯图标 -->
|
||||||
<view class="lantern-container">
|
<view class="lantern-container">
|
||||||
<image class="lantern-image" :src="CommonEnum.KongmingLantern" mode="aspectFit" />
|
<image
|
||||||
|
:src="CommonEnum.KongmingLantern"
|
||||||
|
class="lantern-image"
|
||||||
|
mode="aspectFit"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 确认信息 -->
|
<!-- 确认信息 -->
|
||||||
|
|
@ -25,205 +29,231 @@
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 捐赠弹窗 -->
|
<!-- 捐赠弹窗 -->
|
||||||
<donate-modal :visible="showDonate" @close="closeDonateModal" @confirm="handleConfirmDonate" />
|
<donate-modal
|
||||||
|
:visible="showDonate"
|
||||||
|
@close="closeDonateModal"
|
||||||
|
@confirm="handleConfirmDonate"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import CommonEnum from '../../enum/common'
|
import CommonEnum from "../../enum/common";
|
||||||
import CustomNavbar from '../../components/custom-navbar/custom-navbar.vue'
|
import CustomNavbar from "../../components/custom-navbar/custom-navbar.vue";
|
||||||
import DonateModal from '../../components/donate-modal/donate-modal.vue'
|
import DonateModal from "../../components/donate-modal/donate-modal.vue";
|
||||||
|
import { ordersPray } from "../../api/order/order";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
CustomNavbar,
|
CustomNavbar,
|
||||||
DonateModal,
|
DonateModal,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
CommonEnum,
|
CommonEnum,
|
||||||
loading: false,
|
loading: false,
|
||||||
showDonate: true,
|
showDonate: true,
|
||||||
|
PostData: {},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
this.PostData.prayId = options.prayId;
|
||||||
|
// 页面加载时获取数据
|
||||||
|
this.loadPageData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 加载页面数据
|
||||||
|
async loadPageData() {
|
||||||
|
this.loading = true;
|
||||||
|
try {
|
||||||
|
// TODO: 调用页面数据API
|
||||||
|
// const response = await getPageData()
|
||||||
|
// 模拟加载
|
||||||
|
setTimeout(() => {
|
||||||
|
this.loading = false;
|
||||||
|
}, 1000);
|
||||||
|
} catch (error) {
|
||||||
|
console.error("获取页面数据失败:", error);
|
||||||
|
this.loading = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
|
||||||
// 页面加载时获取数据
|
// 处理捐赠香火钱
|
||||||
this.loadPageData()
|
handleDonate() {
|
||||||
|
uni.showToast({
|
||||||
|
title: "捐赠功能开发中",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
|
||||||
// 加载页面数据
|
|
||||||
async loadPageData() {
|
|
||||||
this.loading = true
|
|
||||||
try {
|
|
||||||
// TODO: 调用页面数据API
|
|
||||||
// const response = await getPageData()
|
|
||||||
// 模拟加载
|
|
||||||
setTimeout(() => {
|
|
||||||
this.loading = false
|
|
||||||
}, 1000)
|
|
||||||
} catch (error) {
|
|
||||||
console.error('获取页面数据失败:', error)
|
|
||||||
this.loading = false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// 处理捐赠香火钱
|
// 返回首页
|
||||||
handleDonate() {
|
handleReturnHome() {
|
||||||
uni.showToast({
|
uni.reLaunch({
|
||||||
title: '捐赠功能开发中',
|
url: "/pages/nearbystores/index",
|
||||||
icon: 'none',
|
});
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
// 返回首页
|
|
||||||
handleReturnHome() {
|
|
||||||
uni.reLaunch({
|
|
||||||
url: '/pages/nearbystores/index',
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
// 显示捐赠弹窗
|
|
||||||
showDonateModal() {
|
|
||||||
this.showDonate = true
|
|
||||||
},
|
|
||||||
|
|
||||||
// 关闭捐赠弹窗
|
|
||||||
closeDonateModal() {
|
|
||||||
this.showDonate = false
|
|
||||||
},
|
|
||||||
|
|
||||||
// 确认捐赠
|
|
||||||
handleConfirmDonate(data) {
|
|
||||||
const amount = data.isRandom ? '随缘' : data.amount
|
|
||||||
uni.showModal({
|
|
||||||
title: '提示',
|
|
||||||
content: `您确定要捐赠 ${amount} 元吗?`,
|
|
||||||
success: res => {
|
|
||||||
if (res.confirm) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '捐赠成功!',
|
|
||||||
icon: 'success',
|
|
||||||
})
|
|
||||||
this.closeDonateModal()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
})
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
|
||||||
|
// 显示捐赠弹窗
|
||||||
|
showDonateModal() {
|
||||||
|
this.showDonate = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
// 关闭捐赠弹窗
|
||||||
|
closeDonateModal() {
|
||||||
|
this.showDonate = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
// 确认捐赠
|
||||||
|
handleConfirmDonate(data) {
|
||||||
|
const amount = data.isRandom ? "随缘" : data.amount;
|
||||||
|
uni.showModal({
|
||||||
|
title: "提示",
|
||||||
|
content: `您确定要捐赠 ${amount} 元吗?`,
|
||||||
|
success: async (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
this.PostData.payAmount = amount;
|
||||||
|
|
||||||
|
this.backCallPay();
|
||||||
|
|
||||||
|
uni.showToast({
|
||||||
|
title: "捐赠成功!",
|
||||||
|
icon: "success",
|
||||||
|
});
|
||||||
|
this.closeDonateModal();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
async backCallPay() {
|
||||||
|
const res = await ordersPray(this.PostData);
|
||||||
|
console.log("@@@@@@@@@", res);
|
||||||
|
console.log("@@@@@@@@@", res.data);
|
||||||
|
console.log("@@@@@@@@@", res.data.payParams);
|
||||||
|
console.log("@@@@@@@@@", res.data.payParams.payUrl);
|
||||||
|
const encodedUrl = encodeURIComponent(
|
||||||
|
encodeURIComponent(res.data.payParams.payUrl),
|
||||||
|
);
|
||||||
|
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/page_user/webView/webView?https=" + encodedUrl,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
page {
|
page {
|
||||||
background: #f5f0e7;
|
background: #f5f0e7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
min-height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
width: 100%;
|
||||||
|
min-height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 0 15rpx;
|
||||||
|
padding-top: 120rpx;
|
||||||
|
padding-bottom: 200rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lantern-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 60rpx;
|
||||||
|
|
||||||
|
.lantern-image {
|
||||||
|
width: 400rpx;
|
||||||
|
height: 400rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.confirmation-message {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 80rpx;
|
||||||
|
|
||||||
|
.message-title {
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #695347;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page {
|
.message-subtitle {
|
||||||
position: relative;
|
font-size: 28rpx;
|
||||||
width: 100%;
|
color: #695347;
|
||||||
min-height: 100vh;
|
text-align: center;
|
||||||
|
line-height: 1.5;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.header {
|
.action-buttons {
|
||||||
width: 100%;
|
display: flex;
|
||||||
min-height: 100vh;
|
flex-direction: column;
|
||||||
display: flex;
|
align-items: center;
|
||||||
align-items: center;
|
width: 100%;
|
||||||
flex-direction: column;
|
gap: 30rpx;
|
||||||
padding: 0 15rpx;
|
|
||||||
padding-top: 120rpx;
|
|
||||||
padding-bottom: 200rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.lantern-container {
|
.donate-button {
|
||||||
|
width: 600rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
background-color: #8b2e2e;
|
||||||
|
border-radius: 50rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: 100%;
|
box-shadow: 0 8rpx 20rpx rgba(139, 46, 46, 0.3);
|
||||||
margin-bottom: 60rpx;
|
transition: all 0.3s ease;
|
||||||
|
|
||||||
.lantern-image {
|
&:active {
|
||||||
width: 400rpx;
|
background-color: #7a2a2a;
|
||||||
height: 400rpx;
|
transform: scale(0.98);
|
||||||
border-radius: 20rpx;
|
|
||||||
padding: 20rpx;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.confirmation-message {
|
.button-text {
|
||||||
display: flex;
|
color: #ffffff;
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
margin-bottom: 80rpx;
|
|
||||||
|
|
||||||
.message-title {
|
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #695347;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.message-subtitle {
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #695347;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 1.5;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.action-buttons {
|
.return-button {
|
||||||
|
width: 600rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
background-color: #f5f0e7;
|
||||||
|
border: 2rpx solid #8b2e2e;
|
||||||
|
border-radius: 50rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: 100%;
|
box-shadow: 0 4rpx 12rpx rgba(139, 46, 46, 0.1);
|
||||||
gap: 30rpx;
|
transition: all 0.3s ease;
|
||||||
|
|
||||||
.donate-button {
|
&:active {
|
||||||
width: 600rpx;
|
background-color: #f0ebe0;
|
||||||
height: 100rpx;
|
transform: scale(0.98);
|
||||||
background-color: #8b2e2e;
|
|
||||||
border-radius: 50rpx;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
box-shadow: 0 8rpx 20rpx rgba(139, 46, 46, 0.3);
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
|
|
||||||
&:active {
|
|
||||||
background-color: #7a2a2a;
|
|
||||||
transform: scale(0.98);
|
|
||||||
}
|
|
||||||
|
|
||||||
.button-text {
|
|
||||||
color: #ffffff;
|
|
||||||
font-size: 36rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.return-button {
|
.button-text {
|
||||||
width: 600rpx;
|
color: #8b2e2e;
|
||||||
height: 100rpx;
|
font-size: 36rpx;
|
||||||
background-color: #f5f0e7;
|
font-weight: bold;
|
||||||
border: 2rpx solid #8b2e2e;
|
|
||||||
border-radius: 50rpx;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
box-shadow: 0 4rpx 12rpx rgba(139, 46, 46, 0.1);
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
|
|
||||||
&:active {
|
|
||||||
background-color: #f0ebe0;
|
|
||||||
transform: scale(0.98);
|
|
||||||
}
|
|
||||||
|
|
||||||
.button-text {
|
|
||||||
color: #8b2e2e;
|
|
||||||
font-size: 36rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user