From 2df025341573a9ef6a05b15f83f3a94c5974e0b8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AE=8B=E9=9B=84?= <babyqcwr@126.com>
Date: Wed, 16 Aug 2023 18:31:59 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 components/authorization.vue       |   1 -
 components/user-vatar.vue          |   2 +-
 config/api.js                      |  11 +++
 pages.json                         |   5 ++
 pages/home/index.vue               |   8 +-
 pages/mine/index.vue               |   8 +-
 pages/myInformation/index.vue      |   2 +-
 pages/payCost/index.vue            |   2 +-
 pages/payCostDetails/index.vue     |  32 +++++---
 pages/payCostProperty/index.vue    |   2 +-
 pages/payCostStatistical/index.vue |   2 +-
 pages/payStatus/index.vue          | 124 +++++++++++++++++++++++++++++
 12 files changed, 173 insertions(+), 26 deletions(-)
 create mode 100644 pages/payStatus/index.vue

diff --git a/components/authorization.vue b/components/authorization.vue
index 6dfa36b..4a8ff08 100644
--- a/components/authorization.vue
+++ b/components/authorization.vue
@@ -98,7 +98,6 @@
 			},
 			// 获取手机号
 			async getUserPhone(e) {
-				
 				let res = await analysisMobileApi({
 					code: e.detail.code,
 					iv: e.detail.iv,
diff --git a/components/user-vatar.vue b/components/user-vatar.vue
index 37e3ce8..8326464 100644
--- a/components/user-vatar.vue
+++ b/components/user-vatar.vue
@@ -8,7 +8,7 @@
 					<view class="picture-box">
 						<text class="text">头像</text>
 						<button class="button" open-type="chooseAvatar" @chooseavatar="onChooseAvatar" hover-class="none">
-							<image class="avatar" :src="userForm.userAvatarUrl || 'https://life.cloud.hjxbc.cn/sys/common/static/scott/pic/lxLTJxnMqmF4536a26893262a4d66527a51bcab612c9_1687861702460.png'" mode="aspectFill"></image>
+							<image class="avatar" :src="userForm.userAvatarUrl || 'https://life.cloud.hjxbc.cn/sys/common/static/miniapp/avatar.png'" mode="aspectFill"></image>
 						</button>
 					</view>
 					<view class="picture-box">
diff --git a/config/api.js b/config/api.js
index 895af23..b8f4ddd 100644
--- a/config/api.js
+++ b/config/api.js
@@ -612,4 +612,15 @@ export const uploadFile = (params = {}, config = {})=> {
         .then(res=> { resolve(res) })
         .catch(err=> { reject(err) })
     })
+}
+
+// 支付
+export const payOrderApi = (params = {}, config = {})=> {
+    return new Promise((resolve, reject)=> {
+        http.post('/property-community/wechat/communityPayment/payOrder',
+            { ...params },
+            { ...config })
+        .then(res=> { resolve(res) })
+        .catch(err=> { reject(err) })
+    })
 }
\ No newline at end of file
diff --git a/pages.json b/pages.json
index 24c0ba7..2e349ab 100644
--- a/pages.json
+++ b/pages.json
@@ -146,6 +146,11 @@
 			"style": {
 				"navigationBarTitleText": "缴费详情"
 			}
+		}, {
+			"path": "pages/payStatus/index",
+			"style": {
+				"navigationBarTitleText": "缴费状态"
+			}
 		}, {
 			"path": "pages/payCostStatistical/index",
 			"style": {
diff --git a/pages/home/index.vue b/pages/home/index.vue
index 4bc969a..79a0a72 100644
--- a/pages/home/index.vue
+++ b/pages/home/index.vue
@@ -7,7 +7,7 @@
 					<image mode="aspectFill" src="../../static/images/icon_up.png" class="icon"></image>
 				</view>
 				<view class="nav-top" v-else>
-					<view class="title" @click="quickEntry">请选择小区</view>
+					<view class="title" @click.stop="quickEntry">请选择小区</view>
 				</view>
 			</view>
 			<view class="banner">
@@ -245,7 +245,7 @@
 				if(bannerList.length === 0) {
 					this.bannerList.push({
 						id: '123423423',
-						imageUrl: 'https://life.cloud.hjxbc.cn/sys/common/static/scott/pic/Q3xhphkpF4EF3143e0a21b5cf40fc5ff8cc5d1bbfa88_1687863385027.jpg'
+						imageUrl: 'https://life.cloud.hjxbc.cn/sys/common/static/miniapp/banner.jpg'
 					})
 				} else {
 					this.bannerList = bannerList
@@ -711,7 +711,7 @@
 		background-position: top center;
 		background-repeat: no-repeat;
 		background-size: cover;
-		background-image: url('https://life.cloud.hjxbc.cn/sys/common/static/scott/pic/fG1tlfXpaIgzd8acb4b81de5c80e74c292351e26460b_1687860842910.png');
+		background-image: url('https://life.cloud.hjxbc.cn/sys/common/static/miniapp/bg_home.png');
 	}
 
 	.page {
@@ -842,7 +842,7 @@
 		background-position: top center;
 		background-repeat: no-repeat;
 		background-size: cover;
-		background-image: url('https://life.cloud.hjxbc.cn/sys/common/static/scott/pic/HIoZ0YFlMHhnc5dd3b7fc0345f4383c75e72a2d26ea1_1687860931825.png');
+		background-image: url('https://life.cloud.hjxbc.cn/sys/common/static/miniapp/bg_guanjia.png');
 		padding: 20rpx 30rpx;
 		margin: 30rpx 0;
 
diff --git a/pages/mine/index.vue b/pages/mine/index.vue
index c0132ad..0e11ae3 100644
--- a/pages/mine/index.vue
+++ b/pages/mine/index.vue
@@ -2,7 +2,7 @@
 	<view class="container">
 		<view class="page">
 			<view class="user">
-				<image :src="userAvatar || 'https://life.cloud.hjxbc.cn/sys/common/static/scott/pic/lxLTJxnMqmF4536a26893262a4d66527a51bcab612c9_1687861702460.png'" class="icon"></image>
+				<image :src="userAvatar || 'https://life.cloud.hjxbc.cn/sys/common/static/miniapp/avatar.png'" class="icon"></image>
 				<view class="name" v-if="userName">{{userName}}</view>
 				<view class="name" v-else @click="quickEntry">请认证</view>
 				<view class="phone" v-if="userName">{{userPhone}}</view>
@@ -252,10 +252,8 @@
 	}
 
 	.user {
-		background-image: url('https://life.cloud.hjxbc.cn/sys/common/static/scott/pic/6WNT5CXhljet5e81b552ffa70bf463a4557dc95a0df9_1687861430349.png');
-		background-position: top center;
-		background-repeat: no-repeat;
-		background-size: cover;
+		background: url('https://life.cloud.hjxbc.cn/sys/common/static/miniapp/bg_mine.png') no-repeat 100%/100%;
+		background-size: 1;
 		border-radius: 16rpx;
 		display: flex;
 		flex-direction: column;
diff --git a/pages/myInformation/index.vue b/pages/myInformation/index.vue
index 8c9edfb..83c1d59 100644
--- a/pages/myInformation/index.vue
+++ b/pages/myInformation/index.vue
@@ -9,7 +9,7 @@
 								头像
 							</view>
 							<view class="form-item-fr">
-								<image :src="formData.avatar || 'https://life.cloud.hjxbc.cn/sys/common/static/scott/pic/lxLTJxnMqmF4536a26893262a4d66527a51bcab612c9_1687861702460.png'" class="icon"></image>
+								<image :src="formData.avatar || 'https://life.cloud.hjxbc.cn/sys/common/static/miniapp/avatar.png'" class="icon"></image>
 								<uni-icons type="forward" color="#E4E4EA"></uni-icons>
 							</view>
 						</view>
diff --git a/pages/payCost/index.vue b/pages/payCost/index.vue
index d86e7e5..b30e213 100644
--- a/pages/payCost/index.vue
+++ b/pages/payCost/index.vue
@@ -65,7 +65,7 @@
 		background-position: top center;
 		background-repeat: no-repeat;
 		background-size: cover;
-		background-image: url('https://life.cloud.hjxbc.cn/sys/common/static/scott/pic/FsmkoAO0xopVfd9d2ef557272cd792026eb115d8d69f_1687861255975.png');
+		background-image: url('https://life.cloud.hjxbc.cn/sys/common/static/miniapp/bg_pay.png');
 	}
 
 	.page {
diff --git a/pages/payCostDetails/index.vue b/pages/payCostDetails/index.vue
index c8be826..ede3639 100644
--- a/pages/payCostDetails/index.vue
+++ b/pages/payCostDetails/index.vue
@@ -41,6 +41,7 @@
 
 <script>
 	import {
+		payOrderApi,
 		communityPaymentDetailApi
 	} from '@/config/api.js'
 	export default {
@@ -54,17 +55,26 @@
 				let res = await communityPaymentDetailApi({id})
 				this.payDetail = res.result
 			},
-			onSubmit() {
-				uni.requestPayment({
-					provider: 'alipay',
-					orderInfo: 'orderInfo', //微信、支付宝订单数据 【注意微信的订单信息,键值应该全部是小写,不能采用驼峰命名】
-					success: function (res) {
-						console.log('success:' + JSON.stringify(res));
-					},
-					fail: function (err) {
-						console.log('fail:' + JSON.stringify(err));
-					}
-				});
+			async onSubmit() {
+				// uni.requestPayment({
+				// 	provider: 'alipay',
+				// 	orderInfo: 'orderInfo', //微信、支付宝订单数据 【注意微信的订单信息,键值应该全部是小写,不能采用驼峰命名】
+				// 	success: function (res) {
+				// 		console.log('success:' + JSON.stringify(res));
+				// 	},
+				// 	fail: function (err) {
+				// 		console.log('fail:' + JSON.stringify(err));
+				// 	}
+				// });
+				payOrderApi({id: this.payDetail.id}).then(res=> {
+					uni.navigateTo({
+						url: `/pages/payStatus/index?id=${this.payDetail.id}&type=1&price=${this.payDetail.totalAmount}`
+					});
+				}).catch(err=> {
+					uni.navigateTo({
+						url: `/pages/payStatus/index?id=${this.payDetail.id}&type=0&price=${this.payDetail.totalAmount}`
+					});
+				})
 			}
 		},
 		onLoad(option) {
diff --git a/pages/payCostProperty/index.vue b/pages/payCostProperty/index.vue
index fd66698..2831819 100644
--- a/pages/payCostProperty/index.vue
+++ b/pages/payCostProperty/index.vue
@@ -121,7 +121,7 @@
 				background-position: top center;
 				background-repeat: no-repeat;
 				background-size: cover;
-				background-image: url('https://life.cloud.hjxbc.cn/sys/common/static/scott/pic/htzJ6ruOcDUeca5cbf2cebdb71687d0c742f74997109_1687861702873.png');
+				background-image: url('https://life.cloud.hjxbc.cn/sys/common/static/miniapp/bg_cost.png');
 				border-radius: 16rpx;
 				padding: 40rpx;
 
diff --git a/pages/payCostStatistical/index.vue b/pages/payCostStatistical/index.vue
index dae4ed7..f2c7f6d 100644
--- a/pages/payCostStatistical/index.vue
+++ b/pages/payCostStatistical/index.vue
@@ -111,7 +111,7 @@
 			background-position: top center;
 			background-repeat: no-repeat;
 			background-size: cover;
-			background-image: url('https://life.cloud.hjxbc.cn/sys/common/static/scott/pic/htzJ6ruOcDUeca5cbf2cebdb71687d0c742f74997109_1687861702873.png');
+			background-image: url('https://life.cloud.hjxbc.cn/sys/common/static/miniapp/bg_cost.png');
 			border-radius: 16rpx;
 			padding: 40rpx;
 
diff --git a/pages/payStatus/index.vue b/pages/payStatus/index.vue
new file mode 100644
index 0000000..997f14f
--- /dev/null
+++ b/pages/payStatus/index.vue
@@ -0,0 +1,124 @@
+<template>
+	<view class="content">
+		<view class="box">
+			<text class="text">{{type === '0'?'支付失败':'支付成功'}}</text>
+			<view class="money">ï¿¥<text class="number">{{totalPrice}}</text></view>
+			<view class="payment-fail" v-if="type === '0'">
+				抱歉,你的订单支付失败
+			</view>
+			<button v-if="type === '1'" @click="goDetail" type="default" class="custom-btn">返回</button>
+			<view v-else class="btn-fail">
+				<button @click="onPay" type="default" class="custom-btn">重新支付</button>
+				<button @click="goDetail" type="default" class="view-order">返回</button>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		payOrderApi,
+	} from '@/config/api.js'
+	export default {
+		data() {
+			return {
+				id: '',
+				type: '0', // 0:支付失败  1:支付成功
+				totalPrice: '0.00' // 订单总价
+			}
+		},
+		onLoad(options) {
+			this.id = options.id
+			this.totalPrice = options.price
+			this.type = options.type
+		},
+		methods: {
+			onPay() {
+				payOrderApi({id: this.id}).then(res=> {
+					this.type = '1'
+				}).catch(err=> {
+					this.type = '0'
+				})
+			},
+			goDetail() {
+				uni.switchTab({
+					url: '/pages/home/index'
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.content {
+		min-height: 100vh;
+		background-color: #fff;
+
+		.box {
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			padding-top: 68rpx;
+			padding-bottom: 100rpx;
+
+			.text {
+				font-size: 28rpx;
+				font-weight: 500;
+				color: #3D3D3D;
+			}
+
+			.money {
+				margin-top: 64rpx;
+				font-size: 24rpx;
+				font-weight: 500;
+				color: #3D3D3D;
+
+				.number {
+					font-size: 60rpx;
+					font-weight: bold;
+					color: #3D3D3D;
+				}
+			}
+
+			.payment-fail {
+				margin-top: 11px;
+				font-size: 24rpx;
+				font-family: Source Han Sans CN-Regular, Source Han Sans CN;
+				font-weight: 400;
+				color: #AAAAAA;
+			}
+
+			.custom-btn {
+				width: 220rpx;
+				height: 64rpx;
+				line-height: 64rpx;
+				border-radius: 32rpx;
+				background-color: #F1615B;
+				margin-top: 72rpx;
+				font-size: 24rpx;
+				font-weight: 400;
+				color: #FFFFFF;
+
+				&::after {
+					border: none;
+				}
+			}
+
+			.view-order {
+				width: 220rpx;
+				height: 64rpx;
+				line-height: 64rpx;
+				border-radius: 32rpx;
+				background-color: #E7E7E7;
+				margin-top: 32rpx;
+				font-size: 24rpx;
+				font-weight: 400;
+				color: #767676;
+
+				&::after {
+					border: none;
+				}
+			}
+		}
+	}
+</style>
-- 
2.17.1