Browse Source

Merge branch 'master' of http://150.158.33.144:3000/lalalashen/MoeNovaClient

lalalashen 2 months ago
parent
commit
f8535c1ba1
2 changed files with 363 additions and 0 deletions
  1. 125 0
      pages/vip/M_purchase.scss
  2. 238 0
      pages/vip/M_purchase.vue

+ 125 - 0
pages/vip/M_purchase.scss

@@ -0,0 +1,125 @@
+
+page {
+	background-color: #161616;
+}
+.page {
+	background-color: #161616;
+	width: 100%;
+	height: 100vh;
+	background: url('http://c.yujianmate.com/images/v1/bg.png');
+	background-size: 750rpx 1624rpx;
+	background-repeat: repeat-y;
+}
+.topbg {
+}
+.topBody {
+	width:750rpx;
+}
+.header {
+	display: flex;flex-direction: row;justify-content: space-between;align-items: center;color:$title;
+
+	.title {
+		font-size: 34rpx;
+	}
+}
+.thread {
+	height:210rpx;
+	padding:50rpx;font-size: 52rpx;color:#6E6A6A;padding-top: 80rpx;
+}
+.myinfo {
+	width: 720rpx;display:flex;flex-direction: column;margin:0rpx 30rpx 60rpx;justify-content: flex-start;
+	
+	.purchaseList {
+		display: flex;flex-direction: row;justify-content: center;align-items: center;
+		flex-wrap: wrap;
+
+		.item {
+			display: flex;justify-content: center;flex-direction: column;
+			border-radius: 28rpx 28rpx 28rpx 28rpx;
+			border: 2rpx solid #28292D;
+			width:214rpx;height:162rpx;
+			margin-right:24rpx;
+			margin-bottom:24rpx;
+			.num1 {
+				text-align: center;display: flex;flex-direction: column;justify-content: center;align-items: center;
+				.name {
+					font-size: 36rpx;color:#FFFFFF;margin-top: 12rpx;
+				}
+			}
+			.num2 {
+				text-align: center;display: flex;flex-direction: column;justify-content: center;align-items: center;
+				.name {
+					font-size: 28rpx;color:#999999;margin-top: 12rpx;
+				}
+			}
+		
+		}
+		.itemSel{
+			background: #321A23;
+			border-radius: 28rpx 28rpx 28rpx 28rpx;
+			border: 4rpx solid #FF3B85;
+			.num1 {
+				.name {
+					color:#FF3B85;
+				}
+			}
+			.num2{
+				.name {
+					color:#FFFFFF;
+				}
+			}
+		}
+			
+	}
+	.mingxiList {
+		display: flex;flex-direction: row;justify-content: space-between;align-items: center;
+		position: relative;
+		.left {
+			display: flex;flex-direction: row;justify-content: flex-start;align-items: center;
+			padding-left:10rpx;
+			padding-top: 20rpx;
+			.icon{
+				padding-left:5rpx;
+				width: 48rpx;
+			}
+			width: 750rpx;
+			height: 112rpx;
+			background: rgba(22,22,22,0);
+			border-radius: 0rpx 0rpx 0rpx 0rpx;
+		}
+		.right{
+			display: flex;flex-direction: row;justify-content: flex-start;align-items: center;
+			padding-right:40rpx;
+			padding-top: 20rpx;
+			.icon{
+				padding-left:5rpx;
+				height: 32rpx;
+			}
+		}
+	
+	}
+	.line{
+		width: 690rpx;
+		height: 2rpx;
+		margin-top: 20rpx;
+		background: #393939;
+		border-radius: 0rpx 0rpx 0rpx 0rpx;
+	}
+	
+	.btn_submit {
+		width: 660rpx;height: 96rpx;position: fixed;bottom:150rpx;left:45rpx;
+		background: linear-gradient( 142deg, #FF5967 0%, #FF2A95 100%);
+		border-radius: 28rpx;font-weight: bold;font-size: 32rpx;color: #FFFFFF;
+		display: flex;flex-direction: row;justify-content: center;align-items: center;
+	}
+	.bottom{
+		width: 660rpx;height: 96rpx;position: fixed;bottom:50rpx;left:45rpx;
+		display: flex;flex-direction: row;justify-content: center;align-items: center;
+	}
+	
+
+	
+}
+.blankHeight {
+	height:100rpx;
+}

+ 238 - 0
pages/vip/M_purchase.vue

@@ -0,0 +1,238 @@
+<template>
+	<view class="page">
+		<view class="topBody">
+			<view class="header">
+			</view>
+			<view class="myinfo">
+
+				<view class="purchaseList" style="margin-top: 60rpx;">
+					<view class="item" :class="index==sel?'itemSel':''" v-for="(item,index) in list"
+						@click="selTA(item,index)">
+						<view class="num1">
+							<view class="name">{{ item.num_gmm }}M{{$t('txt.币')}}</view>
+						</view>
+						<view class="num2">
+							<view class="name">{{ item.money }}{{$t('txt.¥')}}</view>
+						</view>
+					</view>
+				</view>
+
+				<view style="padding-top: 20rpx;margin-left: 10rpx;" class="jinchu">
+					<text style="color:#FFFFFF;font-size: 32rpx;font-weight: bold;">{{$t('txt.支付方式')}}</text>
+				</view>
+
+				<view class="mingxiList" @click="selPay('wechat')">
+					<view class="left">
+						<image class="icon" src="../../static/me/icon_wechat.png" mode="widthFix" />
+						<text style="font-size: 28rpx;margin-left: 20rpx;color: #ffffff;">{{$t('txt.微信支付')}}</text>
+					</view>
+					<view class="right">
+						<image class="icon"
+							:src="payType=='wechat'?'../../static/me/icon_select.png':'../../static/me/icon_unsel.png'"
+							mode="heightFix" />
+					</view>
+				</view>
+				<!-- <view class="line"></view>
+				<view class="mingxiList" @click="selPay('alipay')">
+					<view class="left">
+						<image class="icon" src="../../static/me/icon_alipay.png" mode="widthFix" />
+						<text style="font-size: 28rpx;margin-left: 20rpx;color: #ffffff;">{{$t('txt.支付宝支付')}}</text>
+					</view>
+					<view class="right">
+						<image class="icon"
+							:src="payType=='alipay'?'../../static/me/icon_select.png':'../../static/me/icon_unsel.png'"
+							mode="heightFix" />
+					</view>
+				</view -->>
+				<view class="line"></view>
+				<view class="btn_submit" @click="submitData">{{$t('txt.立即支付')}}{{$t('txt.¥')}}{{money}}</view>
+				<view class="bottom" @click="goPage('/pages/AboutUs/pay_xy')">
+					<text style="font-size: 28rpx;color: #FFFFFF;">{{$t('txt.点击支付即代表同意')}}</text>
+					<text style="font-size: 28rpx;color: #FF2A95;">{{$t('txt.M币充值协议')}}</text>
+				</view>
+			</view>
+
+
+
+			<view class="blankHeight"></view>
+		</view>
+
+
+		<!-- 提示框 -->
+		<DialogBox ref="DialogBox"></DialogBox>
+	</view>
+</template>
+
+<script>
+	export default {
+		components: {},
+		data() {
+			return {
+				title: '',
+				sel: 1,
+				payType: 'wechat',
+				list: [],
+				money: 0,
+				tid: 0,
+				linkid: '',
+
+			}
+		},
+		onLoad() {
+			// setTimeout(function() {
+			// 	uni.setNavigationBarColor({
+			// 		frontColor: '#ffffff',
+			// 		backgroundColor: '#00000000',
+			// 		animation: {
+			// 			duration: 400,
+			// 			timingFunc: 'easeIn'
+			// 		}
+			// 	})
+			// }, 200);
+		},
+		onShow() {
+			this.loadData();
+			let that = this;
+		},
+		methods: {
+			onBack() {},
+			goPage(page) {
+				uni.navigateTo({
+					url: page,
+				})
+			},
+			selTA(item, se) {
+				this.tid = item.id;
+				this.sel = se;
+				if (this.list != null && this.list != undefined) {
+					this.money = this.list[se]['money'];
+				}
+
+			},
+			selPay(se) {
+				this.payType = se;
+			},
+			chkSel() {
+				if (this.sel == 1) {
+					this.sel = 0;
+				} else {
+					this.sel = 1;
+				}
+			},
+			submitData() {
+				// #ifdef H5
+				uni.showToast({
+					title: '请使用app充值',
+					icon: "error"
+				});
+				return;
+				// #endif
+				let that = this;
+				uni.request({
+					url: this.$apiHost + '/Order/submit', //仅为示例,并非真实接口地址。
+					data: {
+						uuid: getApp().globalData.uuid,
+						product_id: this.tid,
+						type: 'buyM',
+						payType: 'wechat'
+					},
+					header: {
+						'content-type': 'application/json' //自定义请求头信息
+					},
+					success: (res) => {
+						console.log("res-pay", res.data);
+						if (res.data.success == 'yes') {
+							this.linkid = res.data.linkid;
+
+							uni.requestPayment({
+								"provider": "wxpay",
+								"orderInfo": res.data.wepay,
+								success(res) {
+									console.log("res-suu:", res)
+									setTimeout(function() {
+										that.showPayCall();
+									}, 1000);
+								},
+								fail(e) {
+									console.log("fail", e);
+								}
+							});
+						} else {
+							uni.showToast({
+								title: '创建订单失败,请联系客服',
+								icon: "error"
+							});
+						}
+					}
+				});
+			},
+			showPayCall() {
+				let that = this;
+				this.$refs['DialogBox'].confirm({
+					title: '提示',
+					content: '我已经支付完成',
+					DialogType: 'inquiry',
+					btn1: '否',
+					btn2: '是',
+					animation: 0
+				}).then((res) => {
+					uni.request({
+						url: this.$apiHost + "/Order/getstatus",
+						data: {
+							uuid: getApp().globalData.uuid,
+							linkid: that.linkid
+						},
+						header: {
+							"content-type": "application/json"
+						},
+						success: (res) => {
+							if (res.data.success == "yes") {
+								uni.showToast({
+									title: '充值成功',
+									icon: "none"
+								});
+							} else {
+								uni.showToast({
+									title: '还未检测到充值状态,请稍后再试',
+									icon: "none"
+								});
+								setTimeout(function() {
+									that.showPayCall();
+								}, 1000);
+							}
+						},
+						complete: (com) => {},
+					});
+				})
+			},
+			loadData() {
+				var offset = (this.page - 1) * 20;
+				uni.request({
+					url: this.$apiHost + '/User/getCzList',
+					data: {
+						uuid: getApp().globalData.uuid
+					},
+					header: {
+						'content-type': 'application/json'
+					},
+					success: (res) => {
+						console.log("res", res.data)
+						this.num = res.data.num;
+						if (res.data.list != null && res.data.list != undefined) {
+							this.list = res.data.list;
+							this.tid = this.list[1]['id'];
+							this.sel = 1;
+							this.money = this.list[1]['money'];
+						}
+					}
+				});
+
+			},
+
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	@import 'M_purchase.scss';
+</style>