添加佛前供灯

This commit is contained in:
2022-03-09 10:56:14 +08:00
parent 442fea23f5
commit c0b25db38d
32 changed files with 1095 additions and 49 deletions
+28 -3
View File
@@ -40,8 +40,16 @@
</template>
<script>
import { createFriendlyDayOrder, createBrickDayOrder, createPay, createMeritBoxOrder, createCommonOrder } from '@/api';
import {
createFriendlyDayOrder,
createBrickDayOrder,
createPay,
createMeritBoxOrder,
createCommonOrder,
createLightOrder
} from "@/api";
import { requestPayment } from '@/common/wechat-web';
import { mapState } from "vuex";
export default {
components: {
@@ -52,10 +60,14 @@ export default {
payType: '1'
}
},
computed: {
...mapState(['temple_merit_id', 'launch']),
},
mounted(){
this.wechatReady(() => {
})
},
methods: {
onContinuePayOrder(){
@@ -79,9 +91,11 @@ export default {
// 创建功德箱订单
if(this.query.from === 'meritBox'){
const domain = this.launch?.agent_id ? '2': '3'
const request = {
temple_id: this.query.temple_id,
price: this.query.amount
temple_id: this.temple_merit_id || this.query.temple_id,
price: this.query.amount,
domain
}
const order = await createMeritBoxOrder(request)
this.onPayment(order)
@@ -100,6 +114,17 @@ export default {
await this.onPayment(order);
}
// 创建佛前供灯订单
if(this.query.from === 'goods_light'){
const request = {
...this.query,
price: this.query.amount,
buy_quantity: this.query.quantity
}
const order = await createLightOrder(request);
await this.onPayment(order);
}
},
async onPayment(order){
const result = await createPay(order.id);