<template>
	<view>
		<button @click="pay">测试小程序支付</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				params:{}
			}
		},
		methods: {
			pay() {
				console.log(this.params)
				wx.requestPayment({
					appId:this.params.appId,
					timeStamp: this.params.timeStamp,
					nonceStr: this.params.nonceStr,
					package: this.params.nonceStr,
					signType: this.params.signType,
					paySign: this.params.paySign,
					success(res) {
						console.log("小程序成功。。。。")

						console.log(res)

					},
					fail(res) {
						console.log("shibai 。。。。")
						console.log(res)

					}

				})
			}
		},
		onLoad(option){
			let {data,orderId} = option;
			console.log(option);
			this.params = JSON.parse(decodeURIComponent(data));
			console.log(this.params);
		}
	}
		
</script>

<style>

</style>
