|
@@ -0,0 +1,127 @@
|
|
|
+<template>
|
|
|
+ <div class="mianBox">
|
|
|
+ <van-row class="headerBox">
|
|
|
+ <van-icon name="arrow-left" @click="$router.go(-1)" />
|
|
|
+ 选择充值方式
|
|
|
+ </van-row>
|
|
|
+ <van-row class="contentBox">
|
|
|
+ <van-row>
|
|
|
+ <van-col @click="openApp({app:'weixin://scanqrcode',downA:'https://dldir1.qq.com/weixin/android/weixin8011android1980_arm64.apk',downI:'https://itunes.apple.com/cn/app/wei/id414478124',})"></van-col>
|
|
|
+ <van-col @click="openApp({app:'alipayqr://platformapi/startapp?saId=10000007',downA:'https://t.alipayobjects.com/L1/71/100/and/alipay_wap_main.apk',downI:'https://itunes.apple.com/cn/app/id333206289?mt=8',})"></van-col>
|
|
|
+ <van-col @click="openApp({app:'ysf',downA:'',downI:'',})"></van-col>
|
|
|
+ </van-row>
|
|
|
+ <van-row>
|
|
|
+ 请选择微信、支付宝或云闪付进行充值。
|
|
|
+ </van-row>
|
|
|
+ </van-row>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { Dialog, Notify } from "vant";
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ [Notify.Component.name]: Notify.Component,
|
|
|
+ [Dialog.Component.name]: Dialog.Component,
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ iosApp: "",
|
|
|
+ };
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ if (this.isWeixin()) {
|
|
|
+ this.iosApp = true;
|
|
|
+ } else {
|
|
|
+ //显示手动打开外置浏览器提示
|
|
|
+ this.iosApp = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ isWeixin() {
|
|
|
+ return navigator.userAgent.toLowerCase().indexOf("micromessenger") !== -1;
|
|
|
+ },
|
|
|
+ openApp(url = "") {
|
|
|
+ if (!url) return;
|
|
|
+ if (url.app === 'ysf') return Notify({ type: 'primary', message: '暂不可用' });
|
|
|
+ if (this.iosApp) return Notify({ type: 'primary', message: '请使用浏览器打开' });
|
|
|
+ // 非微信浏览器
|
|
|
+ window.navigator.userAgent.toLowerCase();
|
|
|
+ if (navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) {
|
|
|
+ window.location.href = url.app;
|
|
|
+ const loadDateTime = +new Date();
|
|
|
+ window.setTimeout( ()=> {
|
|
|
+ const timeOutDateTime = +new Date();
|
|
|
+ if (timeOutDateTime - loadDateTime > 5000) {
|
|
|
+ window.location.href = url.downI;
|
|
|
+ } else {
|
|
|
+ window.close();
|
|
|
+ Dialog.confirm({
|
|
|
+ title: '提示',
|
|
|
+ message: '是否已完成充值?',
|
|
|
+ }).then(() => {
|
|
|
+ this.$router.push('/record')
|
|
|
+ }).catch((e) => {
|
|
|
+ console.log(e)
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }, 2000);
|
|
|
+ } else if (navigator.userAgent.match(/android/i)) {
|
|
|
+ try {
|
|
|
+ window.location.href = url.app;
|
|
|
+ setTimeout(function () {
|
|
|
+ window.location.href = url.downA;
|
|
|
+ }, 500);
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.mianBox {
|
|
|
+ height: 100%;
|
|
|
+ width: 100%;
|
|
|
+ color: #000;
|
|
|
+ padding-top: 44px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ .contentBox {
|
|
|
+ width: 100%;
|
|
|
+ height: auto;
|
|
|
+ padding: 15px 10px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ &>.van-row:nth-child(1){
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ height: 86px;
|
|
|
+ width: 100%;
|
|
|
+ &::after{
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+ &>.van-col:nth-child(1){
|
|
|
+ background: url('../../assets/image/wx.png') no-repeat;
|
|
|
+ }
|
|
|
+ &>.van-col:nth-child(2){
|
|
|
+ background: url('../../assets/image/zfb.png') no-repeat;
|
|
|
+ }
|
|
|
+ &>.van-col:nth-child(3){
|
|
|
+ background: url('../../assets/image/ysf.png') no-repeat;
|
|
|
+ }
|
|
|
+ &>.van-col{
|
|
|
+ width: 86px;
|
|
|
+ height: 86px;
|
|
|
+ background-size: 100% 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ &>.van-row:nth-child(2){
|
|
|
+ margin-top: 20px;
|
|
|
+ font-size: 16px;
|
|
|
+ color: #CCC;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|