pay_fail.vue 4.38 KB
Newer Older
huahua committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188
<template>
	<view class="full-height full-width" style="display: flex;flex-direction: column; ">
		<!-- 自定义头部 -->
		<myhead :worksid="0" :title="myheadtext" :color="'#000'" :titleShow="true" :backShow="true"
			:background="'#fff'"></myhead>

		<view style="width: 100%; height:calc(100% - 100upx);margin: auto; 
		 align-items: center;
         position: absolute;  
        top:0; 
		left:0; bottom:0; right:0;display: flex;flex-direction: column;background: #fff;margin-top: 100upx; ">

			<image src="../../static/img/icon_pay_cancelled.png" mode="widthFix"
				style=" width: 200upx;margin-top: 180upx;"></image>
			<view style="
font-size: 40upx;
font-family: Roboto;
font-weight: 300;
color: #333333;
line-height: 50px;margin-top: 60upx; ">You have canceled the payment. </view>


			<view style="width: 524upx;
height: 260upx;
background: #FFFFFF;
box-shadow: 0px 0px 16px 0px rgba(4, 0, 0, 0.08);
border-radius: 30upx;margin-top: 100upx;
padding-top: 60upx;
padding-left: 80upx;
 display: flex;
 flex-direction: column;">


				<view style="
			   font-size: 36upx;
			   color: #666666;
			   font-family: Roboto;
			   font-weight: 400;">
					Order Detail
				</view>

				<view style="               
			      font-size: 28upx;
			      color: #777;">
					Order ID :&nbsp {{orderId}}
				</view>
				<view style="
						font-size: 28upx;
						color: #777;">
					Order Time : &nbsp {{orderTime}}
				</view>
				<view style="
						font-size: 28upx;
						color: #777;">
					payment platform : &nbsp {{orderPlatform}}
				</view>
			</view>

			<button style="
			margin-top: 120upx;
			background: #854AC2;
			border-radius: 55upx;
			width: 350upx;
			height: 100upx;
			font-size: 36upx;
			font-family: Roboto;
			font-weight: 400;
			text-align: center;
			color: #FFFFFF
			" @click="toLine()">
				home page</button>
		</view>

	</view>
</template>

<script>
	import uParse from '@/components/uParse/src/wxParse.vue'
	import homeservice from '@/service/homeservice.js'
	import myhead from '../mine/head/head.vue';
	export default {
		components: {
			uParse,
			myhead,
		},
		computed: {

		},
		data() {
			return {
				goods: {},
				queryPage: {
					token: '',
				},
				myheadtext: '',
				orderId: "",
				orderTime: "",
				orderPlatform: "",
			};
		},

		methods: {

			//跳转排队列表
			toLine() {
				try {
						const globalData = uni.getStorageSync('globalData');
						if (globalData) {
							//console.log("返回=" + globalData.machine_id)
							//this.globalData = value
							uni.reLaunch({
								url: '../index/detailsphone?machine_id=' + globalData.machine_id
							})
							//console.log("his.userId="+this.userId)
						} else {
							const machine_id = uni.getStorageSync('machine_id');
							if (machine_id) {
								uni.reLaunch({
									url: '../index/detailsphone?machine_id=' + machine_id
								})
							} else {
								uni.navigateBack();
							}
						}
					} catch (e) {
						
						const machine_id = uni.getStorageSync('machine_id');
						if (machine_id) {
							uni.reLaunch({
								url: '../index/detailsphone?machine_id=' + machine_id
							})
						} else {
							uni.navigateBack();
						}
						//uni.navigateBack();
					};
			},

			//支付取消
			loadData() {
				uni.showLoading({
					title: this.$i18n.messages[this.$i18n.locale]['正在加载中'],
					mask: true
				})
				this.$http.post("api/Paypal/cancel", this.queryPage).then(result => {
					this.goods = result
					let data = this.goods.data;
					if (data != null) {
						this.orderId = data.order_id;
						this.orderTime = data.order_time;
						this.orderPlatform = data.order_platform;
					}
					//this.$i18n.messages[this.$i18n.locale]['没有更多数据了'],
					this.myheadtext = this.$i18n.messages[this.$i18n.locale]['支付取消']
					uni.hideLoading();
				}).catch(err => {
					uni.showToast({
						title: this.$i18n.messages[this.$i18n.locale]['支付取消'],
						icon: 'none'
					})
					uni.hideLoading();
				});

			}
		},
		onPullDownRefresh() {
			this.loadData();
		},
		onLoad(options) {
			this.queryPage.token = options.token;
			this.myheadtext = this.$i18n.messages[this.$i18n.locale]['支付取消']
			/* this.orderId = options.order_id;
			this.orderTime = options.order_time;
			this.orderPlatform = options.order_platform; */
			this.loadData();
		},
		onShow() {

		}
	};
</script>

<style lang="scss">
	page {
		background: #999999 !important;

	}
</style>