shish 11 месяцев назад
Родитель
Сommit
7c19b38fc1
3 измененных файлов с 235 добавлено и 2 удалено
  1. 227 0
      hdh5/admin/cg/alipay.vue
  2. 5 0
      hdh5/api/purchase/index.js
  3. 3 2
      hdh5/pages.json

+ 227 - 0
hdh5/admin/cg/alipay.vue

@@ -0,0 +1,227 @@
+<template>
+	<div class="app-content pay-wrap">
+		<div class="delivery-wrap">
+			<div class="btn-wrap">
+				<!-- #ifdef H5 -->
+				<button class="button-com red" @click="go()" v-if="hasRenew == 1">正在打开支付宝...</button>
+				<view style="margin-top:50upx;font-size:40upx;font-weight:bold;text-align: center;" v-if="hasRenew == 0">商家还未开通此功能</view>
+				<!-- #endif -->
+			</div>
+		</div>
+	</div>
+</template>
+<script>
+import { purchaseAliPay } from '@/api/purchase'
+export default {
+    name: 'alipay',
+    components: {
+    },
+    mixins: [],
+    data() {
+        return {
+            constant: this.$constant,
+			payUrl:'',
+			hasRenew:1
+        }
+    },
+    computed: {
+    },
+    onLoad() {
+        // #ifdef H5
+        this.payInit()
+        // #endif
+    },
+    mounted() {},
+    methods: {
+        init(){
+
+        },
+		go(){
+			if(this.hasRenew == 1){
+				window.location.href = this.payUrl
+			}
+		},
+        payInit() {
+            let orderSn = this.option.orderSn ? this.option.orderSn:''
+            if (this.$util.isEmpty(orderSn)){
+                this.$msg('没有找到订单编号')
+                return false
+            }
+            purchaseAliPay({orderSn:orderSn}).then(res=>{
+                if(res.code == 0){
+                    this.$msg(res.msg)
+                    return false
+                }
+				this.hasRenew = res.data.hasRenew?res.data.hasRenew:0
+				if(res.data.hasRenew && res.data.hasRenew == 1){
+					this.payUrl = res.data.payUrl
+					window.location.href = this.payUrl
+				}
+            })
+        }
+    }
+}
+</script>
+
+<style lang="scss">
+	.app-content {
+		min-height: calc(100vh - 20upx);
+		padding-top: 20upx;
+	}
+	.tabs-wrap {
+		position: fixed;
+		top: 0;
+		width: 100%;
+		height: 80upx;
+		line-height: 80upx;
+		text-align: center;
+		background-color: #fff;
+		font-size: 30upx;
+		box-shadow: 4upx 4upx 10upx #eee;
+	}
+	.pay-wrap {
+		.pay-input-wrap {
+			background-color: #fff;
+			border-top-left-radius: 20upx;
+			border-top-right-radius: 20upx;
+			padding: 50upx 80upx 28upx;
+			margin-bottom: 0 !important;
+			.balance {
+				margin-top: 30upx;
+				color: $fontColor2;
+			}
+			.btn-wrap {
+				width: 100%;
+				margin-top: 64upx;
+				.button-com {
+					display: block;
+					margin-bottom: 20upx;
+					padding-top: 30upx;
+					padding-bottom: 30upx;
+				}
+			}
+		}
+	}
+
+	// 我要配送
+	.delivery-wrap {
+		.module-com {
+			margin-bottom: 20upx;
+			background-color: #fff;
+			.module-tit {
+				padding: 20upx 18upx;
+				font-size: 28upx;
+				font-weight: 600;
+				border-bottom: 1upx solid $borderColor;
+			}
+			.module-det {
+				padding: 0 30upx;
+			}
+		}
+		// 金额
+		.pay-input-wrap {
+			padding: 50upx 36upx 38upx;
+			.balance {
+				margin-top: 30upx;
+				color: $fontColor2;
+			}
+		}
+		.shop-logo-wrap {
+			padding-bottom: 20upx;
+			@include disFlex(center, center);
+			.logo-img {
+				width: 100%;
+				margin: 10upx auto;
+				align-items: center;
+				.logo {
+					width: 100upx;
+					height:100upx;
+					border-radius: 10upx;
+					margin-left:10upx;
+					float: left;
+				}
+				.title{
+					margin-left:20upx;
+					float:left;
+					width:600upx;
+					height:100upx;
+					line-height:100upx;
+					font-size:38upx;
+					font-weight: bold;
+				}
+			}
+		}
+		// 可选优惠
+		.discount-wrap {
+			.module-det {
+				padding-top: 20upx;
+				padding-bottom: 20upx;
+			}
+		}
+		// 匿名派送
+		.none-name-delivery {
+			// padding-left: 30upx;
+			padding: 26upx 30upx;
+			// margin-top: 40upx;
+			margin-bottom: 20upx;
+			background-color: #fff;
+			.none-name-text {
+				margin-left: 14upx;
+				color: $fontColor2;
+			}
+		}
+		// 按钮
+		.btn-wrap {
+			width: calc(100% - 60upx);
+			margin: 64upx auto 0;
+			padding-bottom: 20upx;
+			.button-com {
+				display: block;
+				margin-bottom: 20upx;
+				padding-top: 30upx;
+				padding-bottom: 30upx;
+				&:last-child {
+					margin-bottom: 0;
+				}
+			}
+		}
+
+		// 查看更多
+		.view-more {
+			width: auto;
+			padding-bottom: 20upx;
+			margin-bottom: 20upx;
+			font-size: 28upx;
+			@include disFlex(center, center);
+			background-color: #fff;
+			color: #666565;
+			justify-content: flex-start;
+			z-index:9999999;
+			.view-more-text {
+				margin-right: 14upx;
+			}
+			padding-left:40upx;
+			i {
+				font-size: 30upx;
+				font-weight: 600;
+			}
+			.fill-get-man{
+				color:red;
+				margin-left:10upx;
+				font-weight:600;
+				text-decoration:underline;
+			}
+			.pack-up{
+				margin-left:20upx;
+				font-weight:600;
+				color:red;
+				text-decoration:underline;
+			}
+			&.open {
+				i {
+					transform: rotate(180deg);
+				}
+			}
+		}
+	}
+</style>

+ 5 - 0
hdh5/api/purchase/index.js

@@ -0,0 +1,5 @@
+import https from '@/plugins/luch-request_0.0.7/request'
+
+export const purchaseAliPay = async data => {
+    return https.post("/purchase/ali-pay", data);
+};

+ 3 - 2
hdh5/pages.json

@@ -21,15 +21,16 @@
 			}
 		},
 		{
-			"path": "admin/ghs/success",
+			"path": "admin/cg/alipay",
 			"style": {
-				"navigationBarTitleText": "支付成功",
+				"navigationBarTitleText": "支付",
 				"navigationStyle": "custom",
 				"h5": {
 					"titleNView": false
 				}
 			}
 		}
+
 	],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",