浏览代码

删除android代码

gongyan 4 年之前
父节点
当前提交
85d4dbf68f
共有 8 个文件被更改,包括 14 次插入787 次删除
  1. 4 0
      README.md
  2. 2 8
      src/App.vue
  3. 0 232
      src/components/Inner/ExitGame.vue
  4. 0 9
      src/store/index.js
  5. 8 47
      src/utils/utils.js
  6. 0 14
      src/views/Login/LoginBox.vue
  7. 0 472
      src/views/Recall/Recall.vue
  8. 0 5
      src/views/Visitor/Visitor.vue

+ 4 - 0
README.md

@@ -183,3 +183,7 @@ appid
 -   [x] platform wcfml -> wcfml
 -   [x] 鸿币支付, 鸿币不足, 选择鸿币支付, 鸿币足够, 显示支付宝支付
 -   [x] 支付取消 / 完成 关闭当前页
+
+## 2021.7.28 ------ 给忘川伏魔录单独一个版本的代码 -----
+
+-   [ ] 删除 android 相关的代码

+ 2 - 8
src/App.vue

@@ -76,7 +76,7 @@ export default {
       const appid = _appid || this.CONFIG.appid;
       this.appidAction(appid);
 
-      // 获取当前android是哪个(针对特殊处理的包, 比如忘川伏魔录)
+      // 获取当前是哪个(针对特殊处理的包, 比如忘川伏魔录)
       const platform = this.$utils.getQueryString("platform");
       this.platformAction(platform);
 
@@ -255,12 +255,10 @@ export default {
             pay_type,
             uid: this.userInfo.uid,
           };
-          //   let orderList = JSON.parse(localStorage.getItem("orderList")) || [];
           let orderList = this.$utils.readStorage("", "orderList");
           orderList = (orderList && JSON.parse(orderList)) || [];
           orderList.push(orderItem);
 
-          //   localStorage.setItem("orderList", JSON.stringify(orderList));
           this.$utils.writeStorage("", "orderList", JSON.stringify(orderList));
 
           window.location.href = data.url;
@@ -268,9 +266,8 @@ export default {
         });
     },
 
-    // android 和 其他的支付工具函数
+    // 支付工具函数
     onPayUtil(payUrl) {
-      // this.androidPayUtil()
       window.location.href = `${this.$CONFIG.wcfmlPayUrl}?jump=${encodeURI(
         encodeURIComponent(payUrl)
       )}`;
@@ -300,12 +297,10 @@ export default {
         const { code } = res.data;
         // 错误
         if (code) {
-          // localStorage.removeItem("userInfo");
           this.$utils.deleteStorage("", "userInfo");
           return;
         }
 
-        // const userInfo = localStorage.getItem("userInfo");
         const userInfo = this.$utils.readStorage("", "userInfo");
         this.userInfoAction(JSON.parse(userInfo));
       });
@@ -320,7 +315,6 @@ export default {
       switch (code) {
         // 2 未登录
         case 2:
-          //   localStorage.removeItem("userInfo");
           this.$utils.deleteStorage("", "userInfo");
           this.userInfoAction({});
           // 跳转登录

+ 0 - 232
src/components/Inner/ExitGame.vue

@@ -1,232 +0,0 @@
-<template>
-  <!-- 退出弹窗 -->
-  <div v-show="isShowExitGame" class="close_win_shade">
-    <div class="close_win_box">
-      <div class="close_win_title">
-        <span>退出确定</span>
-      </div>
-      <div v-if="CONFIG.wechatInfo" class="close_win_content">
-        <div @click="copy" class="close_win_copy">
-          公众号:{{ CONFIG.wechatInfo.wechatName }}
-          <span
-            ref="copyBtn"
-            :data-clipboard-text="CONFIG.wechatInfo.wechatName"
-            >(点击复制)</span
-          >
-        </div>
-        <div class="close_win_hint">
-          <span>搜索关注公众号</span>
-          <span>无需下载即可登录游戏</span>
-        </div>
-        <div class="close_win_qr_code">
-          <img :src="CONFIG.wechatInfo.wechatImg" />
-        </div>
-      </div>
-      <div class="close_win_btn">
-        <div class="close_win_btn_l" @click="outGame">
-          <span>退出游戏</span>
-        </div>
-        <div class="close_win_btn_r" @click="goOnGame">
-          <span>继续游戏</span>
-        </div>
-      </div>
-    </div>
-  </div>
-</template>
-
-<script>
-import { mapState, mapActions } from "vuex";
-import Clipboard from "clipboard";
-import wx from "weixin-js-sdk";
-export default {
-  components: {},
-  data() {
-    return {};
-  },
-  computed: {
-    ...mapState(["CONFIG", "isShowExitGame"]),
-  },
-  watch: {},
-  created() {},
-  mounted() {
-    if (window.history && window.history.pushState) {
-      history.pushState(null, null, document.URL);
-      window.addEventListener("popstate", this.goBack, false);
-    }
-  },
-  destroyed() {
-    window.removeEventListener("popstate", this.goBack, false);
-  },
-  methods: {
-    ...mapActions(["isShowExitGameAction"]),
-    /**
-     * 复制公众号
-     */
-    copy() {
-      let copyBtn = this.$refs.copyBtn;
-      var clipboard = new Clipboard(copyBtn);
-      clipboard.on("success", () => {
-        this.$toast.text("已复制");
-      });
-    },
-
-    /**
-     * 退出游戏
-     */
-    outGame() {
-      window.location.href = "about:blank";
-      wx.closeWindow();
-    },
-
-    /**
-     * 继续游戏
-     */
-    goOnGame() {
-      this.isShowExitGameAction(false);
-    },
-
-    /**
-     * 返回按钮
-     */
-    goBack() {
-      history.pushState(null, null, document.URL);
-      window.android && window.android.exit();
-      this.isShowExitGameAction(true);
-    },
-  },
-};
-</script>
-
-<style lang="less" scoped>
-/* 退出弹窗遮罩层  */
-.close_win_shade {
-  width: 100%;
-  height: 100%;
-  z-index: 9;
-  position: absolute;
-  top: 0;
-  left: 0;
-  display: flex;
-  -webkit-box-pack: center;
-  justify-content: center;
-  -webkit-box-align: center;
-  align-items: center;
-  background: rgba(0, 0, 0, 0.75);
-
-  /* 退出提示弹窗 */
-  .close_win_box {
-    width: 600 / @rem;
-    height: 600 / @rem;
-    position: relative;
-    background: #fff;
-    border-radius: 5px;
-    font-size: 30 / @rem;
-    overflow: hidden;
-  }
-}
-
-.close_win_title {
-  height: 100 / @rem;
-  line-height: 100 / @rem;
-  background-color: #3faeed;
-  border-radius: 5px 5px 0 0;
-  span {
-    color: #fff;
-    font-size: 38 / @rem;
-  }
-}
-.close_win_content {
-  flex: 1;
-}
-.close_win_copy {
-  height: 70 / @rem;
-  line-height: 70 / @rem;
-  color: #ff0000;
-  text-align: center;
-}
-.close_win_copy span {
-  height: 70 / @rem;
-  line-height: 70 / @rem;
-  padding-left: 20 / @rem;
-  color: #ff0000;
-}
-.close_win_hint span {
-  color: #333;
-  height: 40 / @rem;
-  line-height: 40 / @rem;
-}
-.close_win_qr_code img {
-  width: 305 / @rem;
-}
-.close_win_btn {
-  height: 80 / @rem;
-  line-height: 80 / @rem;
-  display: flex;
-  flex-direction: row;
-  justify-content: space-between;
-  align-items: stretch;
-  border-top: 1px solid #ccc;
-  border-radius: 0 0 0.1rem 0.1rem;
-  box-sizing: border-box;
-}
-.close_win_btn_l,
-.close_win_btn_r {
-  flex: 1;
-}
-.close_win_btn_r {
-  border-left: 1px solid #ccc;
-}
-.close_win_btn_l span {
-  color: #333;
-}
-.close_win_btn_r span {
-  color: #3faeed;
-}
-// 横屏
-@media screen and (orientation: landscape),
-  /**竖屏 */ all and (orientation: portrait) and (min-width: 600px) and (min-height: 800px),
-  /**ipad */ all and (min-device-aspect-ratio: 3/4) and (max-device-aspect-ratio: 4/3),
-  all and (device-aspect-ratio: 4/3) {
-  .close_win_shade {
-    /* 退出提示弹窗 */
-    .close_win_box {
-      width: 300 / @rem;
-      height: 270 / @rem;
-      font-size: 15 / @rem;
-    }
-  }
-
-  .close_win_title {
-    height: 40 / @rem;
-    line-height: 40 / @rem;
-    span {
-      font-size: 18 / @rem;
-    }
-  }
-
-  .close_win_copy {
-    height: 35 / @rem;
-    line-height: 35 / @rem;
-  }
-  .close_win_copy span {
-    height: 35 / @rem;
-    line-height: 35 / @rem;
-    padding-left: 10 / @rem;
-  }
-
-  .close_win_qr_code img {
-    width: 135 / @rem;
-  }
-
-  .close_win_hint span {
-    color: #333;
-    height: 20 / @rem;
-    line-height: 20 / @rem;
-  }
-
-  .close_win_btn {
-    height: 38 / @rem;
-    line-height: 38 / @rem;
-  }
-}
-</style>

+ 0 - 9
src/store/index.js

@@ -9,7 +9,6 @@ export default new Vuex.Store({
         finance: 0, // 鸿币余额
         query: {}, // 路由携带参数 pay: game 游戏充值  hb 鸿币充值
         payArg: {}, // 支付传递的参数
-        isShowExitGame: false, // 是否显示退出游戏
         /**
          * gamepay页面
          * 显示哪个菜单内容
@@ -65,10 +64,6 @@ export default new Vuex.Store({
         payArgAction(context, payload) {
             context.commit("payArgMutation", payload)
         },
-        // 是否显示退出游戏
-        isShowExitGameAction(context, payload) {
-            context.commit("isShowExitGameMutation", payload)
-        },
         // appid
         appidAction(context, payload) {
             context.commit("appidMutation", payload)
@@ -103,10 +98,6 @@ export default new Vuex.Store({
         payArgMutation(state, payload) {
             state.payArg = payload
         },
-        // 是否展示退出游戏
-        isShowExitGameMutation(state, payload) {
-            state.isShowExitGame = payload
-        },
         // appid
         appidMutation(state, payload) {
             state.appid = payload

+ 8 - 47
src/utils/utils.js

@@ -108,7 +108,6 @@ const utils = {
     isiOS() {
         if (!this.IsPC()) {
             var u = navigator.userAgent;
-            // var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
             var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
             return isiOS
         }
@@ -212,10 +211,6 @@ const utils = {
 
     // 记住密码工具函数
     rememberFun(account, password) {
-        if (window.android) {
-            return this.onRememberFun(account, password)
-        }
-
         const platform = this.getQueryString("platform");
         // 忘川伏魔录
         if (platform === "wcfml") {
@@ -223,12 +218,11 @@ const utils = {
         }
     },
 
-    // android 记住密码工具函数
+    //  记住密码工具函数
     onRememberFun(account, password) {
         const accountEnc = this.encrypt(account);
         const pwdEnc = this.encrypt(password);
         const accountPwd = `${accountEnc}&&${pwdEnc}`;
-        // let accountLocal = JSON.parse(localStorage.getItem("jhremember"));
         let accountLocal = this.readStorage("", "jhremember");
         accountLocal = accountLocal && JSON.parse(accountLocal);
 
@@ -255,7 +249,6 @@ const utils = {
                 account,
                 pwd: password,
             });
-            // localStorage.setItem("jhremember", JSON.stringify(accountLocal));
             this.writeStorage("", "jhremember", JSON.stringify(accountLocal));
 
             return accountList;
@@ -283,37 +276,24 @@ const utils = {
             account,
             pwd: password,
         });
-        // localStorage.setItem("jhremember", JSON.stringify(accountLocal));
         this.writeStorage("", "jhremember", JSON.stringify(accountLocal));
         return accountList
     },
 
-    // 安卓内 读取数据
+    // 读取数据
     readStorage(bookName, keyName) {
-        // 安卓内部
-        if (window.android) {
-            return window.android.readStorage(bookName, keyName);
-        }
-
         const platform = this.getQueryString("platform");
-        // 忘川伏魔录特制版
+        // 忘川伏魔录
         if (platform == "wcfml") {
             let data = JSON.parse(decodeURI(decodeURIComponent(this.getQueryString('data')))) || {}
             return localStorage.getItem(keyName) || data[keyName];
         }
     },
 
-    // 安卓内 存数据
+    //  存数据
     writeStorage(bookName, keyName, value) {
-        // 安卓内部
-        if (window.android) {
-            window.android.writeStorage(bookName, keyName, value)
-            return
-        }
-
-        // 忘川伏魔录特制版
+        // 忘川伏魔录
         const platform = this.getQueryString("platform");
-        // 忘川伏魔录特制版
         if (platform == "wcfml") {
             localStorage.setItem(keyName, value);
             const query = this.getAllQueryString();
@@ -326,14 +306,8 @@ const utils = {
         }
     },
 
-    // 安卓内 删除数据(keyName)
+    // 删除数据(keyName)
     deleteStorage(bookName, keyName) {
-        // 安卓内部
-        if (window.android) {
-            window.android.deleteStorage(bookName, keyName)
-            return
-        }
-
         // 忘川伏魔录特制版
         const platform = this.getQueryString("platform");
         if (platform == "wcfml") {
@@ -341,23 +315,13 @@ const utils = {
         }
     },
 
-    // 安卓内 销毁数据(bookName)
+    // 销毁数据(bookName)
     destoryStorage(bookName) {
-        // 安卓内部
-        if (window.android) {
-            window.android.destoryStorage(bookName)
-            return
-        }
         // 忘川伏魔录特制版
     },
 
     // 获取所有bookName里面的key列表
     getKeysInStorage(bookName) {
-        // 安卓内部
-        if (window.android) {
-            window.android.getKeysInStorage(bookName)
-            return
-        }
         // 忘川伏魔录特制版
     },
 
@@ -382,10 +346,7 @@ const utils = {
 
     // 关闭支付页面工具函数
     closePayPage() {
-        if (window.android) {
-            return
-        }
-
+        // 忘川伏魔录
         const platform = this.getQueryString("platform");
         if (platform == "wcfml") {
             window.location.href = $CONFIG.wcfmlPayUrl

+ 0 - 14
src/views/Login/LoginBox.vue

@@ -93,10 +93,6 @@ export default {
           data.password
         );
 
-        if (window.android) {
-          this.getFinance();
-        }
-
         // 存储用户信息
         // localStorage.setItem("userInfo", JSON.stringify(data));
         this.$utils.writeStorage("", "userInfo", JSON.stringify(data));
@@ -110,21 +106,11 @@ export default {
 
     // 登录工具函数
     loginUtil(data, routeName, params) {
-      if (window.android) {
-        this.androidLogin(routeName, params);
-      }
       if (this.platform === "wcfml") {
         this.wcfmlLogin(data);
       }
     },
 
-    // android 安卓登录工具函数
-    androidLogin(routeName, params) {
-      // 获取鸿币余额
-      this.getFinance();
-      this.routeLink(routeName, params);
-    },
-
     // wcfml 忘川伏魔录登录工具函数
     wcfmlLogin(data) {
       // 记住密码 todo

+ 0 - 472
src/views/Recall/Recall.vue

@@ -1,472 +0,0 @@
-<template>
-  <div id="recall">
-    <!-- 点击下载提示 -->
-    <DownLoadInfo @onShowControl="onShowControl"></DownLoadInfo>
-
-    <!-- safari添加到桌面提示 -->
-    <SafariTips v-if="showSafariTips" @onShowControl="onShowControl" />
-
-    <!-- 退出页面提示 -->
-    <ExitGame></ExitGame>
-
-    <!-- 页面悬浮球 -->
-    <Float @openInnerBox="openInnerBox"></Float>
-
-    <!-- 游戏iframe -->
-    <GameIframe></GameIframe>
-
-    <!-- 已登录 -->
-    <InnerBox v-show="isLogin && showInnerBox"></InnerBox>
-
-    <!-- 未 显示登录框 -->
-    <UdbBox v-if="!isLogin"></UdbBox>
-  </div>
-</template>
-
-<script>
-import { recallConfig } from "../../config";
-import { mapState, mapActions } from "vuex";
-import DownLoadInfo from "@/components/Inner/DownLoadInfo"; // 点击下载到桌面提示
-import ExitGame from "@/components/Inner/ExitGame.vue"; // 退出页面提示
-import Float from "@/components/Inner/Float"; // 页面悬浮球
-import GameIframe from "@/components/Inner/GameIframe"; // 游戏iframe
-import InnerBox from "@/components/Inner/InnerBox"; // 已登录显示的内容
-import UdbBox from "@/components/UDB/UdbBox"; // 登录框
-import SafariTips from "@/components/Inner/SafariTips"; // safari添加到桌面提示
-export default {
-  name: "Recall",
-  components: {
-    DownLoadInfo,
-    ExitGame,
-    Float,
-    GameIframe,
-    InnerBox,
-    UdbBox,
-    SafariTips,
-  },
-  data() {
-    return {
-      queryTimeout: null, // 订单查询 定时器
-      wechatAppid: "wx2c4f9f89c572aeb5", // 公众号appid
-      showSafariTips: false, // 显示safari组件
-    };
-  },
-  provide() {
-    return {
-      // 校验返回值
-      checkCode: this.checkCode,
-      // 支付校验返回值
-      checkCodeHandler: this.checkCodeHandler,
-      // 刷新登录态
-      refresh: this.refresh,
-      // 获取用户信息
-      getUserInfo: this.getUserInfo,
-      // 获取鸿币余额
-      getFinance: this.getFinance,
-      // 支付
-      payHandler: this.payHandler,
-      // 订单查询
-      queryOrder: this.queryOrder,
-      // 微信内支付
-      wechatPay: this.wechatPay,
-      // 获取微信code
-      getWechatCode: this.getWechatCode,
-    };
-  },
-  computed: {
-    ...mapState(["CONFIG", "isLogin", "showInnerBox", "isPay", "query","appid"]),
-    userInfo() {
-      return this.$store.state.userInfo;
-    },
-  },
-  watch: {
-    // ios url带token 直接登录进去
-    userInfo: {
-      handler(newValue) {
-        if (newValue) {
-          const token = this.$utils.getQueryString("token");
-          if (token) {
-            window.location.href = this.$utils.delQueStr(
-              window.location.href,
-              "token"
-            );
-          }
-        }
-      },
-      deep: true,
-      immediate: true,
-    },
-  },
-  created() {
-    // 携带token 直接登录
-    const token = this.$utils.getQueryString("token");
-    if (token) {
-      localStorage.setItem("x-token", token);
-    }
-  },
-  mounted() {
-    clearTimeout(this.queryTimeout);
-
-    // 设置页面基础配置信息
-    this.setConfigAction(recallConfig);
-
-    // 初始化页面信息
-    this.init();
-  },
-  methods: {
-    ...mapActions([
-      "setConfigAction",
-      "showInnerAction",
-      "userInfoAction",
-      "isLoginAction",
-      "financeAction",
-      "isPayAction",
-      "tokenAction",
-      "isShowExitGameAction",
-      "isWeChatAction",
-    ]),
-
-    onShowControl(showSafariTips) {
-      this.showSafariTips = showSafariTips;
-    },
-
-    // 初始化页面信息
-    async init() {
-      // 微信内
-      const _this = this;
-      document.addEventListener(
-        "WeixinJSBridgeReady",
-        function onBridgeReady() {
-          _this.isWeChatAction(true);
-          // const wechat_open_id = localStorage.getItem("wechat_open_id");
-          const wechat_open_id = _this.$utils.getCookie("wechat_open_id");
-          const wechat_code = _this.$utils.getQueryString("code");
-          if (!wechat_open_id && !wechat_code) {
-            _this.$toast.text("授权过期,请重新授权");
-            _this.getWechatCode();
-            return;
-          }
-
-          // 有code, 没有openid 用code换openid
-          if (!wechat_open_id && wechat_code) {
-            _this.wechatOpenId();
-          }
-        },
-        false
-      );
-
-      // userInfo
-      //   const userInfo = localStorage.getItem("userInfo");
-      //   if (!userInfo) {
-      //     this.isLoginAction(false);
-      //     return;
-      //   }
-
-      // 校验登录态
-      await this.refresh();
-      // 获取用户信息
-      await this.getUserInfo();
-      // 获取鸿币余额
-      await this.getFinance();
-      // 订单查询
-      await this.queryOrder();
-    },
-
-    // 换openid
-    wechatOpenId() {
-      const wechat_code = this.$utils.getQueryString("code");
-      const pay_type = this.$utils.payType("WECHATPAY").h5;
-      this.$api
-        .wechatOpenId({
-          wechat_code,
-          pay_type,
-        })
-        .then((res) => {
-          this.checkCode(res);
-          const { data, code, msg } = res.data;
-          // 错误
-          if (code) {
-            return;
-          }
-          // 成功
-          this.$utils.setCookie("wechat_open_id", data.openId, 30);
-        });
-    },
-
-    // 获取用户信息
-    getUserInfo() {
-      this.$api
-        .info()
-        .then((res) => {
-          this.checkCode(res);
-          const { data, code, msg } = res.data;
-          // 错误
-          if (code) {
-            return;
-          }
-          // 成功
-          this.isLoginAction(true);
-          localStorage.setItem("userInfo", JSON.stringify(data));
-          this.userInfoAction(data);
-          const token = localStorage.getItem("token");
-          this.tokenAction(token);
-        })
-        .then(() => {
-          // 携带token 直接登录
-          const token = this.$utils.getQueryString("token");
-          if (token) {
-            // window.location.href = this.$utils.delQueStr(
-            //   window.location.href,
-            //   "token"
-            // );
-            return;
-          }
-        });
-    },
-
-    // 查询鸿币余额
-    getFinance() {
-      this.$api.finance().then((res) => {
-        this.checkCode(res);
-        const { data, code, msg } = res.data;
-        // 错误
-        if (code) {
-          return;
-        }
-        // 成功
-        this.financeAction(data.hb / 100);
-      });
-    },
-
-    // 微信获取微信code
-    getWechatCode() {
-      const { wechatAppid } = this;
-      let redirect_uri = "";
-      redirect_uri = escape(window.location.href);
-      window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${wechatAppid}&redirect_uri=${redirect_uri}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect`;
-    },
-
-    /**
-     * 支付宝 微信支付
-     * @param {Object} payInfo 支付信息
-     */
-    payHandler(payInfo) {
-      const {
-        server_id,
-        server_name,
-        cp_order_id,
-        role_name,
-        role_id,
-        goods_id,
-        goods_name,
-        amount,
-        pay_type,
-        pay_platform,
-        extra,
-      } = payInfo;
-      const { appid } = this;
-      return this.$api
-        .order({
-          server_id,
-          server_name,
-          cp_order_id,
-          app_id: appid,
-          role_name,
-          role_id,
-          goods_id,
-          goods_name,
-          amount,
-          pay_type,
-          pay_platform,
-          return_url: window.location.href,
-          extra,
-        })
-        .then((res) => {
-          this.checkCodeHandler(res);
-          const { data, code, msg } = res.data;
-          // 错误
-          if (code) {
-            return;
-          }
-          // 成功
-          this.isPayAction(true);
-
-          // 鸿币支付不需要回调
-          if (pay_platform === "HB") {
-            return;
-          }
-
-          const time = new Date().getTime();
-          const orderItem = {
-            order_id: data.order_id,
-            time,
-          };
-          let orderList = JSON.parse(localStorage.getItem("orderList")) || [];
-          orderList.push(orderItem);
-          localStorage.setItem("orderList", JSON.stringify(orderList));
-
-          // 微信内支付
-          const { isWeChat } = this;
-          if (isWeChat) {
-            this.wechatPay(data);
-            return;
-          }
-          window.location.href = data.url;
-        });
-    },
-
-    // 微信内支付
-    wechatPay(res) {
-      if (typeof WeixinJSBridge == "undefined") {
-        if (document.addEventListener) {
-          document.addEventListener(
-            "WeixinJSBridgeReady",
-            this.onBridgeReady(res),
-            false
-          );
-        } else if (document.attachEvent) {
-          document.attachEvent("WeixinJSBridgeReady", this.onBridgeReady(res));
-          document.attachEvent(
-            "onWeixinJSBridgeReady",
-            this.onBridgeReady(res)
-          );
-        }
-      } else {
-        this.onBridgeReady(res);
-      }
-    },
-
-    // 微信内支付
-    onBridgeReady(res) {
-      const { appId, timeStamp, nonceStr, signType, paySign, openId } = res;
-      //   localStorage.setItem("wechat_open_id", openId);
-      this.$utils.setCookie("wechat_open_id", openId, 30);
-      const _this = this;
-      WeixinJSBridge.invoke(
-        "getBrandWCPayRequest",
-        {
-          appId, //公众号ID,由商户传入
-          timeStamp, //时间戳,自1970年以来的秒数
-          nonceStr, //随机串
-          package: res.package,
-          signType, //微信签名方式:
-          paySign, //微信签名
-        },
-        function (res) {
-          if (res.err_msg == "get_brand_wcpay_request:ok") {
-            _this.$toast.text("支付成功");
-            // 使用以上方式判断前端返回,微信团队郑重提示:
-            //res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
-            return;
-          }
-          if (res.err_msg == "get_brand_wcpay_request:cancel") {
-            _this.$toast.text("取消支付");
-            return;
-          }
-          _this.$toast.text("支付失败");
-        }
-      );
-    },
-
-    // 订单查询
-    queryOrder() {
-      //  延迟执行定义定时器
-      this.queryTimeout = setTimeout(() => {
-        let orderList = JSON.parse(localStorage.getItem("orderList")) || [];
-        if (orderList.length == 0) {
-          clearTimeout(this.queryTimeout);
-          return;
-        }
-        const maxTime = 10000;
-        const nowTime = new Date().getTime();
-        let _orderList = JSON.parse(JSON.stringify(orderList));
-        orderList.map((ele, index) => {
-          const flag = nowTime - ele.time > maxTime;
-          if (!flag) {
-            return;
-          }
-          // 大于10s 订单查询
-          this.$api
-            .query({
-              order_id: ele.order_id,
-            })
-            .then((res) => {
-              _orderList.splice(index, 1);
-              localStorage.setItem("orderList", JSON.stringify(_orderList));
-            });
-        });
-        this.queryOrder();
-      }, 5000);
-    },
-
-    // 显示innerBox
-    openInnerBox() {
-      this.showInnerAction(true);
-    },
-
-    // 校验返回值
-    checkCode(res) {
-      // 请求超时
-      if (!res) {
-        this.$toast.text("当前网络拥堵, 请重试");
-        return;
-      }
-      this.checkCodeHandler(res);
-    },
-
-    // 刷新登录态
-    refresh() {
-      return this.$api.refresh().then((res) => {
-        this.checkCode(res);
-        const { data, code, msg } = res.data;
-        // 错误
-        if (code) {
-          this.isLoginAction(false);
-          this.showInnerAction(false);
-          localStorage.removeItem("userInfo");
-          return;
-        }
-
-        const userInfo = localStorage.getItem("userInfo");
-        this.isLoginAction(true);
-        this.userInfoAction(JSON.parse(userInfo));
-      });
-    },
-
-    // 校验返回值====all
-    checkCodeHandler(res) {
-      const { code, msg } = res.data;
-      if (!code) {
-        return;
-      }
-      switch (code) {
-        // 2 未登录
-        case 2:
-          localStorage.removeItem("userInfo");
-          this.showInnerAction(false);
-          this.isLoginAction(false);
-          this.userInfoAction({});
-          this.$toast.text(msg);
-          break;
-        // 7 微信支付code 过期
-        case 7:
-          this.getWechatCode();
-          this.$toast.text(msg);
-          break;
-        default:
-          this.$toast.text(msg);
-      }
-    },
-  },
-};
-</script>
-
-<style lang="less" scoped>
-.focusState {
-  position: absolute;
-  top: 0;
-  left: 0;
-  right: 0;
-  bottom: 0;
-}
-</style>

+ 0 - 5
src/views/Visitor/Visitor.vue

@@ -65,10 +65,6 @@ export default {
     // 进入游戏
     close() {
       console.log("visitor close");
-      // 安卓
-      if (window.android) {
-        return;
-      }
     },
 
     // 复制账密
@@ -92,7 +88,6 @@ export default {
           this.routeLink("Login");
 
           // 2. 调用wcfml的登录
-          // window.open(`${this.$CONFIG.wcfmlLoginUrl}?${query}`);
           window.location.href = `${this.$CONFIG.wcfmlLoginUrl}?${query}`;
         }
       });