feat: 增加界面

This commit is contained in:
2021-11-25 21:13:38 +08:00
parent 52c1603176
commit 29da9c7746
33 changed files with 1896 additions and 870 deletions
+26 -14
View File
@@ -6,8 +6,13 @@
<div class="pay-info">
<h1 class="amount"><b>¥</b>{{query.amount}}</h1>
<div class="order-info">
<h3 class="title">{{query.title}}</h3>
<p class="desc">{{query.subTitle}}</p>
<h3 class="goods_title">{{query.title}}</h3>
<div class="desc">
<!-- subTitle: 规格名称 -->
<span>{{query.subTitle}}</span>
<span>数量:x{{query.quantity}}</span>
</div>
</div>
<div class="pay-type">
@@ -34,7 +39,7 @@
</template>
<script>
import { createFriendlyDayOrder, createBrickDayOrder, createPay, createMeritBoxOrder } from '@/api';
import { createFriendlyDayOrder, createBrickDayOrder, createPay, createMeritBoxOrder, createCommonOrder } from '@/api';
import { requestPayment } from '@/common/wechat-web';
export default {
@@ -49,7 +54,7 @@ export default {
methods: {
async onCreatePayOrder(){
// 创建日行一善支付订单
if(this.query.goods_type === '-1'){
if(this.query.goods_type == '1'){
const request = {
...this.query,
@@ -59,13 +64,13 @@ export default {
return
}
// 创建填砖加瓦订单
if(this.query.goods_type === '-2'){
if(this.query.goods_type == '2'){
const request = {
...this.query,
}
const order = await createBrickDayOrder(request)
this.onPayment(order)
await this.onPayment(order)
return
}
@@ -80,19 +85,24 @@ export default {
return
}
// const request = {
// ...this.query
// }
// 创建通用商品订单
if(this.query.from === 'common_goods'){
const request = {
...this.query,
price: this.query.amount,
buy_quantity: this.query.quantity
}
// createCommonOrder(request)
const order = await createCommonOrder(request);
await this.onPayment(order);
}
},
async onPayment(order){
console.log(order)
const result = await createPay(order.id);
const payResult = await requestPayment(result)
console.log(payResult)
this.$router.push({
await this.$router.push({
name: 'pay-result',
query: {
...result,
@@ -122,14 +132,16 @@ export default {
.order-info{
margin-top: 1rem;
padding: .4rem;
.title{
.goods_title{
font-size: .4rem;
font-weight: bold;
}
.desc{
padding-top: .3rem;
padding-top: .5rem;
color: #666;
font-size: .35rem;
display: flex;
justify-content: space-between;
}
}
.pay-type{