zpj před 1 měsícem
rodič
revize
470fc288b9

+ 2 - 3
http/ajax.js

@@ -28,12 +28,11 @@ export const request = (url, method, data, show = false) => {
 					if(res.data.code == 1){
 						resolve(res.data)
 					}else{
-						uni.reLaunch({
-							url:`/pages/error?msg=` + res.message
-						})
+						reject(res.data)
 					}
 				} else {
 					tools.error(res.message)
+					reject(res)
 				}
 			},
 			fail: (err) => {

+ 7 - 1
pages.json

@@ -15,7 +15,13 @@
 		{
 			"path": "pages/success",
 			"style": {
-				"navigationBarTitleText": "支付成功"
+				"navigationBarTitleText": "支付结果"
+			}
+		},
+		{
+			"path": "pages/bank-success",
+			"style": {
+				"navigationBarTitleText": "支付结果"
 			}
 		}
 	],

+ 17 - 4
pages/bank-success.vue

@@ -4,9 +4,10 @@
 			返回首页
 		</view>
 		<view class="align-items-center flex-justify-center cg-box">
-			<uni-icons v-if="orderInfo.status === 2 || orderInfo.status === 6" class="mr-18" type="checkbox-filled"
-				size="24" color="#547BFA"></uni-icons>
-			<uni-icons v-else class="mr-18" type="clear" size="24" color="#FF0000"></uni-icons>
+			
+			<image class="mr-18 icon-img" v-if="orderInfo.status === 2 || orderInfo.status === 6" src="@/static/success.png" mode="scaleToFill" />
+			<image class="mr-18 icon-img" v-else src="@/static/ts-icon.png" mode="scaleToFill" />
+			
 			<view class="sys-size-28" v-if="orderInfo.status === 2 || orderInfo.status === 6">
 				支付成功
 			</view>
@@ -69,8 +70,16 @@
 				}).then((res) => {
 					if (res.code === 1) {
 						this.orderInfo = res.data
+					}else{
+						uni.reLaunch({
+							url:`/pages/error?message=` + res.message
+						})
 					}
-				})
+				}).catch((err)=>{
+                    uni.reLaunch({
+                        url:`/pages/error?message=` + ((err && err.message) ? err.message : '查询订单失败')
+                    })
+                })
 			},
 			jumpOut() {
 				if (this.orderInfo.status === 2 || this.orderInfo.status === 6) {
@@ -89,6 +98,10 @@
 </script>
 
 <style lang="scss" scoped>
+	.icon-img{
+		width: 48rpx;
+		height: 48rpx;
+	}
 	.flex-direction {
 		display: flex;
 		flex-direction: column;

+ 5 - 5
pages/error.vue

@@ -2,7 +2,7 @@
 	<view class="error-box">
 		<view class="error-box-info">
 			<image src="@/static/ts-icon.png" mode="scaleToFill" class="success-icon" />
-			<view class="">{{msg}}</view>
+			<view class="">{{message}}</view>
 		</view>
 	</view>
 </template>
@@ -11,14 +11,14 @@
 	export default {
 		data(){
 			return{
-				msg:"",
+				message:"",
 			}
 		},
 		onLoad(res) {
-			if (res.msg) {
-				this.msg = res.msg
+			if (res.message) {
+				this.message = res.message
 			}else{
-				this.msg = '网络错误!请重新扫码!'
+				this.message = '网络错误!请重新扫码!'
 			}
 		},
 	}

+ 40 - 21
pages/index.vue

@@ -23,8 +23,6 @@
 				</view>
 			</view>
 		</view>
-
-		<view v-html="zfbUrl"></view>
 	</view>
 </template>
 
@@ -50,8 +48,7 @@
 				numList: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '.', '0'],
 				totalNum: '',
 				isAJAX: false,
-				zfbUrl: '',
-
+				
 				code_type: 1,
 				shop_code: '',
 				m_id:'',
@@ -88,8 +85,16 @@
 						if (res.code == 1) {
 							uni.setStorageSync('m_id',res.data.m_id)
 							uni.setStorageSync('token',res.data.token)
+						}else{
+							uni.reLaunch({
+								url:`/pages/error?message=` + res.message
+							})
 						}
-					})
+					}).catch((err)=>{
+                        uni.reLaunch({
+                            url:`/pages/error?message=` + ((err && err.message) ? err.message : '微信授权登录失败')
+                        })
+                    })
 				} else {
 					// 认证失败
 					tools.wxLogin();
@@ -111,7 +116,7 @@
 				this.code_type = data.img_type
 			} else {
 				uni.reLaunch({
-					url: `/pages/error?msg=` + '店铺信息错误,请重新扫码。'
+					url: `/pages/error?message=` + '店铺信息错误,请重新扫码。'
 				})
 				return
 			}
@@ -121,11 +126,18 @@
 				code: this.shop_code
 			}).then((res) => {
 				if (res.code === 1) {
-					this.shop_id = res.data.id;
 					this.shop_name = res.data.shop_name;
 					uni.setStorageSync("shopName", this.shop_name)
+				}else{
+					uni.reLaunch({
+						url:`/pages/error?message=` + res.message
+					})
 				}
-			})
+			}).catch((err)=>{
+                uni.reLaunch({
+                    url:`/pages/error?message=` + ((err && err.message) ? err.message : '获取店铺信息失败')
+                })
+            })
 		},
 		methods: {
 			setNum(item) {
@@ -172,17 +184,14 @@
 					m_id:uni.getStorageSync('m_id')?uni.getStorageSync('m_id'):0,
 					token:uni.getStorageSync('token')?uni.getStorageSync('token'):''
 				}).then((res) => {
-
 					if (res.code === 1) {
-
-						this.order_id = res.data.order_id
-						
+						this.order_id = res.data.order_id	
 						if (res.data.is_bank == 0 && res.data.is_yee == 1) {
 							if (pay_type === 1) {
-								this.isAJAX = false
 								if (res.data.pay_data) {
 									this.weiXinPayH5(res.data.pay_data);
 								} else {
+									this.isAJAX = false
 									tools.error("支付生成失败");
 								}
 							} else {
@@ -194,22 +203,32 @@
 
 					} else {
 						this.isAJAX = false
-						tools.error(res.msg);
+						uni.reLaunch({
+							url:`/pages/error?message=` + res.message
+						})
 					}
-				})
-			},
-			payOk(rs_sn) {
-				// uni.redirectTo({
-				// 	url: `/pages-order/pay-success/index?order_id=${this.order_id}&money=${this.totalNum}&rs_sn=${rs_sn}`,
-				// });
+				}).catch((err) => {
+                    this.isAJAX = false
+                    if (err && err.code != 1) {
+                        uni.reLaunch({ 
+							url: `/pages/error?message=` + (err.message || '下单失败') 
+						})
+                    }
+                })
 			},
+			
 			async weiXinPayH5(wxPayData) {
 				const res = await tools.weiXinPay(wxPayData);
+				this.isAJAX = false
 				if (res) {
-					console.log(res);
 					this.payOk(wxPayData.rs_sn);
 				}
 			},
+			payOk(rs_sn) {
+				uni.redirectTo({
+					url: `/pages/success?money=${this.totalNum}`,
+				});
+			},
 		},
 	}
 </script>

+ 11 - 2
pages/success.vue

@@ -2,6 +2,7 @@
   <view class="pay-success-page">
     <view class="main">
       <view class="section">
+		<view class="money">¥{{money}}</view>
         <image src="@/static/success.png" mode="scaleToFill" class="success-icon" />
         <view class="success-text">支付成功</view>
       </view>
@@ -16,7 +17,14 @@
 export default {
   name: "pay-success",
   data() {
-    return {};
+    return {
+		money:0,
+	};
+  },
+  onLoad(e) {
+  	if(e.money){
+		this.money = e.money;
+	}
   },
   methods: {
     goHomePage() {
@@ -45,7 +53,8 @@ export default {
 
   .money {
     margin-top: 24rpx;
-    font-size: 28rpx;
+	margin-bottom: 24rpx;
+    font-size: 36rpx;
     color: #666666;
   }
 

+ 2 - 2
service/tools.js

@@ -199,10 +199,10 @@ tools.wxLogin = function(urlPath) {
 	let appid = 'wx27df73f402695133'; //正式
 	let url = window.location.href;
 	var type = '';
-	if(appid = 'wx27df73f402695133'){
+	if(appid === 'wx27df73f402695133'){
 		type = 1
 	}else{
-		type = window.location.host === 'testwap.jhcs888.com' ? '3' : '1'; 
+		type = window.location.host === 'tepayh5ap.jhcs888.com' ? '3' : '1'; 
 	}
 	url = url.replace('&code=', '&code_a=1')
 	url = encodeURIComponent(url);

binární
unpackage/dist/build/web.zip


+ 1 - 0
unpackage/dist/build/web/assets/_plugin-vue_export-helper.BCo6x5W8.js

@@ -0,0 +1 @@
+const o=(o,t)=>{const c=o.__vccOpts||o;for(const[s,n]of t)c[s]=n;return c};export{o as _};

+ 1 - 0
unpackage/dist/build/web/assets/bank-success-C8qGz3xd.css

@@ -0,0 +1 @@
+.icon-img[data-v-f05055de]{width:1.5rem;height:1.5rem}.flex-direction[data-v-f05055de]{display:flex;flex-direction:column}.box-sizing-border[data-v-f05055de]{box-sizing:border-box}.sys-radius-200[data-v-f05055de]{border-radius:6.25rem}.text-align-center[data-v-f05055de]{text-align:center}.sys-color-4D72FA[data-v-f05055de]{color:#4d72fa}.sys-size-28[data-v-f05055de]{font-size:.875rem}.sys-weight-600[data-v-f05055de]{font-weight:600}.align-items-center[data-v-f05055de]{display:flex;align-items:center}.flex-justify-center[data-v-f05055de]{display:flex;justify-content:center}.pb-32[data-v-f05055de]{padding-bottom:1rem}.mb-24[data-v-f05055de]{margin-bottom:.75rem}.sys-color-3489FF[data-v-f05055de]{color:#3489ff}.sys-size-60[data-v-f05055de]{font-size:1.875rem}.sys-weight-bold[data-v-f05055de]{font-weight:700}.flex-justify-space[data-v-f05055de]{display:flex;justify-content:space-between}.flex-shrink0[data-v-f05055de]{flex-shrink:0}.sys-color-9[data-v-f05055de]{color:#999}.box-b[data-v-f05055de]{position:relative}.plr-40-24[data-v-f05055de]{padding:.75rem 1.25rem 0}.pt-50[data-v-f05055de]{padding-top:1.5625rem}.cg-box[data-v-f05055de]{padding-bottom:.25rem;padding-top:1rem}.pay_money-box[data-v-f05055de]{border-bottom:.03125rem solid #F5F5F5}.but-box[data-v-f05055de]{width:4.625rem;height:1.5rem;line-height:1.5rem;border:.03125rem solid #4D72FA;position:absolute;right:1.25rem;top:1.25rem}

+ 1 - 0
unpackage/dist/build/web/assets/error-BU24rLQv.css

@@ -0,0 +1 @@
+.error-box[data-v-8da81e6a]{width:100%;height:100vh}.error-box .success-icon[data-v-8da81e6a]{width:3.0625rem;height:3.0625rem}.error-box .error-box-info[data-v-8da81e6a]{box-sizing:border-box;padding-top:20vh;font-size:.875rem;font-weight:600;text-align:center}.error-box .error-box-info uni-view[data-v-8da81e6a]{margin-top:.9375rem}

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
unpackage/dist/build/web/assets/index-BgCuxJG8.css


+ 1 - 0
unpackage/dist/build/web/assets/index-BunnDqjH.css

@@ -0,0 +1 @@
+.pay-view[data-v-e04293ec]{width:100%;height:100vh;display:flex;flex-direction:column}.pay-view .pay-head[data-v-e04293ec]{font-size:1.25rem;font-weight:600;text-align:center;background-color:#fff}.pay-view .pay-info[data-v-e04293ec]{flex:1;overflow:auto;box-sizing:border-box;padding:.625rem}.pay-view .pay-info .pay-info-sumit[data-v-e04293ec]{margin-top:.9375rem;width:100%;height:2.8125rem;line-height:2.8125rem;text-align:center;border-radius:6.25rem;background:linear-gradient(to right,#fe9387,#fb604e,#f83820);color:#fff;font-size:1rem}.pay-view .pay-info .pay-info-input[data-v-e04293ec]{width:100%;height:10.3125rem;background-color:#fff;box-sizing:border-box;padding:.625rem}.pay-view .pay-info .pay-info-input .info-text[data-v-e04293ec]{font-size:.9375rem;color:#aaa}.pay-view .pay-info .pay-info-input .info-input[data-v-e04293ec]{width:100%;height:3.125rem;line-height:3.125rem;margin:1.125rem 0;padding-bottom:.625rem;border-bottom:.03125rem solid #E4E4E4;font-size:1.625rem;font-weight:600}.pay-view .pay-num[data-v-e04293ec]{width:100%;height:18.75rem;background:#d0d3dc;display:flex;justify-content:space-between;flex-flow:row wrap;box-sizing:border-box;padding:.9375rem}.pay-view .pay-num .pay-num-input[data-v-e04293ec]{width:6.71875rem;height:3.4375rem;background-color:#fff;border-radius:.5rem;text-align:center;line-height:3.4375rem;font-size:1.25rem;font-weight:700}.pay-view .pay-num .pay-num-del[data-v-e04293ec]{margin-top:1.1875rem;box-sizing:border-box;padding-left:.78125rem;line-height:1.09375rem!important;font-weight:400!important}.pay-view .pay-num .pay-num-del-wrap[data-v-e04293ec]{margin:0 auto;width:1.25rem;height:1.25rem;background-color:#dedede;position:relative}.pay-view .pay-num .pay-num-del-wrap[data-v-e04293ec]:after{content:"";position:absolute;left:-1.25rem;border:.625rem solid transparent;border-right:.625rem solid #dedede}

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 12 - 0
unpackage/dist/build/web/assets/index-DSi8EM0e.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
unpackage/dist/build/web/assets/pages-bank-success.hzcg0n3M.js


+ 1 - 0
unpackage/dist/build/web/assets/pages-error.CAaFnhFp.js

@@ -0,0 +1 @@
+import{c as s,w as a,i as e,o,d as r,e as t,t as c,j as d}from"./index-DSi8EM0e.js";import{_ as i}from"./ts-icon.Y44ZMBwA.js";import{_ as l}from"./_plugin-vue_export-helper.BCo6x5W8.js";const m=l({data:()=>({message:""}),onLoad(s){s.message?this.message=s.message:this.message="网络错误!请重新扫码!"}},[["render",function(l,m,n,f,u,_){const p=d,g=e;return o(),s(g,{class:"error-box"},{default:a((()=>[r(g,{class:"error-box-info"},{default:a((()=>[r(p,{src:i,mode:"scaleToFill",class:"success-icon"}),r(g,{class:""},{default:a((()=>[t(c(u.message),1)])),_:1})])),_:1})])),_:1})}],["__scopeId","data-v-8da81e6a"]]);export{m as default};

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
unpackage/dist/build/web/assets/pages-index.DrlZfNT7.js


+ 1 - 0
unpackage/dist/build/web/assets/pages-success.FqMXc316.js

@@ -0,0 +1 @@
+import{c as s,w as e,i as a,o,d as c,e as t,t as n,j as l}from"./index-DSi8EM0e.js";import{_ as m}from"./success.CwSO4d10.js";import{_ as u}from"./_plugin-vue_export-helper.BCo6x5W8.js";const d=u({name:"pay-success",data:()=>({money:0}),onLoad(s){s.money&&(this.money=s.money)},methods:{goHomePage(){window.location.href="https://wap.jhcs888.com"}}},[["render",function(u,d,i,r,f,p){const _=a,y=l;return o(),s(_,{class:"pay-success-page"},{default:e((()=>[c(_,{class:"main"},{default:e((()=>[c(_,{class:"section"},{default:e((()=>[c(_,{class:"money"},{default:e((()=>[t("¥"+n(f.money),1)])),_:1}),c(y,{src:m,mode:"scaleToFill",class:"success-icon"}),c(_,{class:"success-text"},{default:e((()=>[t("支付成功")])),_:1})])),_:1}),c(_,{class:"button-box"},{default:e((()=>[c(_,{class:"button home",onClick:p.goHomePage},{default:e((()=>[t("返回首页")])),_:1},8,["onClick"])])),_:1})])),_:1})])),_:1})}],["__scopeId","data-v-209868be"]]);export{d as default};

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
unpackage/dist/build/web/assets/shop_order.D5t-g8Nz.js


+ 1 - 0
unpackage/dist/build/web/assets/success-CFhsL0nc.css

@@ -0,0 +1 @@
+.main[data-v-209868be]{background-color:#fff;box-sizing:border-box;padding-top:3.125rem}.main .success-icon[data-v-209868be]{width:3.0625rem;height:3.0625rem}.main .success-text[data-v-209868be]{font-size:1.0625rem;margin-top:.4375rem;font-weight:500}.main .money[data-v-209868be]{margin-top:.75rem;margin-bottom:.75rem;font-size:1.125rem;color:#666}.main .section[data-v-209868be]{display:flex;flex-direction:column;align-items:center;padding:.5625rem 0 1.3125rem;border-bottom:.0625rem dashed #c6c6c6}.button-box[data-v-209868be]{display:flex;justify-content:center;padding:1.25rem 5.5rem}.button-box .button[data-v-209868be]{width:5.625rem;height:2.25rem;font-size:.875rem;border-radius:2.25rem;text-align:center;line-height:2.25rem}.button-box .button[data-v-209868be]:active{background-color:#f2f2f2}.button-box .home[data-v-209868be]{border:.0625rem solid #6f6f6f}.button-box .order[data-v-209868be]{border:.0625rem solid #ed301d;color:#ed301d}

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
unpackage/dist/build/web/assets/success.CwSO4d10.js


+ 1 - 0
unpackage/dist/build/web/assets/ts-icon.Y44ZMBwA.js

@@ -0,0 +1 @@
+const A="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAAAvVBMVEUAAAC/gAD/gAD2lybtiSTtkiT4kiTxjiPxjivyjCbykybuiynukSnykyf2kyf2kyvzkijwjyn0kCj0kCv0kyjxkSfykSr1kSrvjynzkSnykinzkSnzkSnykSrzkSrykCnykCrykSrykCnykinykSrykSnykSrykSrykSrykSnykCrykSryki3yljT1qlv1q1z1rF/1rmL2sWj2sWn50qj60qj617L62bb748n85c399Ov+9u7++/j+/fv///8aEc+LAAAAK3RSTlMABAQbHBwjJCQoKCwsOzs7P0RHR0dIT09Qa3d7p6urr6+3v7/Dx8fn7/f7Lzs85AAAAUBJREFUOMudlelWgzAUhKFFSysqRBQLVlukBXJbrfuC5v0fy0C3bBBk/jHnO8lJcmcwjK7qOX4QeKNeM3UcLjBUypPIrsXce+A0O1Ni/SlIuj2SOZSBQikSuTEGpfBY4KBWHInY9Z6L4oVdk9m9n7JLFIQU7Hd2ONENtxeh4oy7HXcOzSC4W3CmA+MNZ4MOhEEFRnowrMBED85Lzsz1IDYpOAI9CA4FvTagT8HrNuDVf8DLNqBHQacNOCyvRxzZX0J+BCsvr8eYC+4bIa+ClVQvE4r7rNeiEymHAp4kcDMURsy774R8CAHfBZ9zV+WpV5y1LwIu+kuame8l60z2mbG48D98fj1yJWAdYniB63ONUZcCaF8ptCxSFZchuc6sicxNLWVDngoBj93azrWjZBs1vAgHzTVuDr0g8E/Mzn+LP3KNuNXIAzE6AAAAAElFTkSuQmCC";export{A as _};

+ 1 - 0
unpackage/dist/build/web/assets/uni.fb3b81c8.css

@@ -0,0 +1 @@
+uni-image{width:320px;height:240px;display:inline-block;overflow:hidden;position:relative}uni-image[hidden]{display:none}uni-image>div{width:100%;height:100%;background-repeat:no-repeat}uni-image>img{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;display:block;position:absolute;top:0;left:0;width:100%;height:100%;opacity:0}uni-image>.uni-image-will-change{will-change:transform}@keyframes once-show{0%{top:0}}uni-resize-sensor,uni-resize-sensor>div{position:absolute;left:0;top:0;right:0;bottom:0;overflow:hidden}uni-resize-sensor{display:block;z-index:-1;visibility:hidden;animation:once-show 1ms}uni-resize-sensor>div>div{position:absolute;left:0;top:0}uni-resize-sensor>div:first-child>div{width:100000px;height:100000px}uni-resize-sensor>div:last-child>div{width:200%;height:200%}uni-view{display:block}uni-view[hidden]{display:none}uni-toast{position:fixed;top:0;right:0;bottom:0;left:0;z-index:999;display:block;box-sizing:border-box;pointer-events:none;font-size:16px}.uni-sample-toast{position:fixed;z-index:999;top:50%;left:50%;transform:translate(-50%,-50%);text-align:center;max-width:80%}.uni-simple-toast__text{display:inline-block;vertical-align:middle;color:#fff;background-color:rgba(17,17,17,.7);padding:10px 20px;border-radius:5px;font-size:13px;text-align:center;max-width:100%;word-break:break-all;white-space:normal}uni-toast .uni-mask{pointer-events:auto}.uni-toast{position:fixed;z-index:999;width:8em;top:50%;left:50%;transform:translate(-50%,-50%);background:rgba(17,17,17,.7);text-align:center;border-radius:5px;color:#fff}.uni-toast *{box-sizing:border-box}.uni-toast__icon{margin:20px 0 0;width:38px!important;height:38px!important;vertical-align:baseline!important}.uni-icon_toast{margin:15px 0 0}.uni-icon_toast.uni-icon-success-no-circle:before{color:#fff;font-size:55px}.uni-icon_toast.uni-loading{margin:20px 0 0;width:38px;height:38px;vertical-align:baseline}.uni-toast__content{margin:0 0 15px}

+ 24 - 0
unpackage/dist/build/web/index.html

@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <link rel="stylesheet" href="/assets/uni.fb3b81c8.css">
+
+    <meta charset="UTF-8" />
+    <script>
+      var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
+        CSS.supports('top: constant(a)'))
+      document.write(
+        '<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
+        (coverSupport ? ', viewport-fit=cover' : '') + '" />')
+    </script>
+    <title>zh-h5-pay</title>
+    <!--preload-links-->
+    <!--app-context-->
+    <script type="module" crossorigin src="/assets/index-DSi8EM0e.js"></script>
+    <link rel="stylesheet" crossorigin href="/assets/index-BgCuxJG8.css">
+  </head>
+  <body>
+    <div id="app"><!--app-html--></div>
+	<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js" type="text/javascript"></script>
+  </body>
+</html>

binární
unpackage/dist/build/web/static/success.png


binární
unpackage/dist/build/web/static/ts-icon.png


Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů