Procházet zdrojové kódy

1. 新增鸿币充值页面 2. 修复绑定角色不更新gameInfo bug 3. 领取优惠券成功跳转鸿币充值页面

gongyan před 4 roky
rodič
revize
497abf8d10

+ 6 - 3
README.md

@@ -236,10 +236,13 @@ appid
 
 -   [x] 鸿币可输入
 -   [ ] 登录之后跳转活动页, 活动页之后再进入游戏
--   [ ] 活动页转盘奖品 去领取 跳转鸿币页面 去领取(报错)
 
 ## 8.19
 
 -   [x] 活动页新增 选择角色
--   [ ] 未选择角色点击提现报错
--   [ ] 新增鸿币充值页面
+-   [x] 未选择角色点击提现报错
+
+## 8.20
+
+-   [x] 新增鸿币充值页面
+-   [x] 修复绑定角色不更新 gameInfo bug

+ 1 - 1
build/webpack.test.prod.conf.js

@@ -44,7 +44,7 @@ const devWebpackConfig = merge(baseWebpackConfig, {
     },
     plugins: [
         new webpack.DefinePlugin({
-            'process.env': require('../config/prod.env')
+            'process.env': require('../config/test.prod.env')
         }),
         new webpack.HotModuleReplacementPlugin(),
         new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.

+ 1 - 1
config/test.env.js

@@ -4,6 +4,6 @@ const prodEnv = require('./prod.env')
 
 module.exports = merge(prodEnv, {
     NODE_ENV: '"development"',
-    API_ROOT: '"http://42.193.163.133:30000"', // 本地开发测试环境地址
+    API_ROOT: '"https://api.jhfly.cn"', // 正式环境地址
     API_HB: '"https://api.jhfly.cn"', // 正式环境 红包活动
 })

+ 9 - 0
config/test.prod.env.js

@@ -0,0 +1,9 @@
+'use strict'
+const merge = require('webpack-merge')
+const prodEnv = require('./prod.env')
+
+module.exports = merge(prodEnv, {
+    NODE_ENV: '"development"',
+    API_ROOT: '"http://42.193.163.133:30000"', // 本地开发测试环境地址
+    API_HB: '"https://api.jhfly.cn"', // 正式环境 红包活动
+})

+ 1 - 1
src/components/Menu/MenuPay/MenuHbPay.vue

@@ -67,7 +67,7 @@ export default {
     // 返回游戏内支付页面
     back() {
       this.showInnerControl("");
-      this.$utils.closePayPage(this.userInfo.uid);
+      this.$utils.closePage(this.userInfo.uid);
     },
 
     // 充值鸿币

+ 16 - 7
src/router/index.js

@@ -52,9 +52,9 @@ const router = new Router({
             name: 'GamePay',
             component: () =>
                 import ("@/views/GamePay/GamePay"),
-            // meta: {
-            //     isLogin: true
-            // }
+            meta: {
+                isLogin: true
+            }
         },
         // 收银台
         {
@@ -73,11 +73,20 @@ const router = new Router({
             name: 'ActivityHb',
             component: () =>
                 import ("@/views/Active/Hb/Hb"),
-            // meta: {
-            //     isLogin: true
-            // }
+            meta: {
+                isLogin: true
+            }
+        },
+        // 鸿币充值
+        {
+            path: '/hb_recharge',
+            name: 'HbRecharge',
+            component: () =>
+                import ("@/views/HbRecharge/HbRecharge"),
+            meta: {
+                isLogin: true
+            }
         },
-
     ]
 });
 // 全局前置守卫

+ 1 - 1
src/utils/utils.js

@@ -357,7 +357,7 @@ const utils = {
     },
 
     // 关闭支付页面工具函数
-    closePayPage(uid) {
+    closePage(uid) {
         // 忘川伏魔录
         const platform = this.getQueryString("platform");
         const data = this.getQueryString("data");

+ 13 - 7
src/views/Active/Hb/HbTask/HbTask.vue

@@ -53,7 +53,7 @@ export default {
     HbTaskTips,
     HbDialog,
   },
-  inject: ["checkCode"],
+  inject: ["checkCode", "routeLink"],
   data() {
     return {
       /**
@@ -184,6 +184,12 @@ export default {
       deep: true,
       immediate: true,
     },
+    // 用户角色信息
+    gameRoleInfo: {
+      handler(newValue) {},
+      deep: true,
+      immediate: true,
+    },
   },
   created() {},
   mounted() {
@@ -399,11 +405,10 @@ export default {
           if (code) {
             return;
           }
+          this.$toast.text("领取成功, 前往使用");
 
-          // 关闭当前 打开鸿币
-          this.onShowDialog("");
-          // 打开鸿币
-          this.$emit("onShowControl", { showMenuPay: true });
+          // 关闭当前 打开鸿币页面
+          this.routeLink("HbRecharge");
           // 更新优惠券列表
           this.onGetCouponList();
         });
@@ -421,14 +426,15 @@ export default {
       const { appid } = this;
       // 更新当前角色
       this.gameRoleInfoAction(roleInfo);
-      // 2. 更新任务列表 用户任务信息
+      // 2. 更新任务列表 用户任务信息 更新用户优惠券列表
       this.userHbInfoAction({
         arg: { ...roleInfo },
         appid,
         checkCode: this.checkCode,
       });
       this.taskInfoAction({ ...roleInfo, appid });
-      // 3. 活动的绑定按钮隐藏 展示角色信息 todo 在userHbInfo由内容之后更新
+      this.onGetCouponList();
+      // 3. 活动的绑定按钮隐藏 展示角色信息 在userHbInfo由内容之后更新
     },
   },
 };

+ 1 - 1
src/views/Counter/Counter.vue

@@ -114,7 +114,7 @@ export default {
 
     // 返回游戏
     back() {
-      this.$utils.closePayPage(this.userInfo.uid);
+      this.$utils.closePage(this.userInfo.uid);
     },
   },
 };

+ 1 - 1
src/views/GamePay/GamePayBox.vue

@@ -28,7 +28,7 @@ export default {
     // 返回
     back() {
       this.$emit("close");
-      this.$utils.closePayPage(this.userInfo.uid);
+      this.$utils.closePage(this.userInfo.uid);
     },
   },
 };

+ 71 - 0
src/views/HbRecharge/HbRecharge.vue

@@ -0,0 +1,71 @@
+<template>
+  <!-- 鸿币充值 -->
+  <div class="hb_recharge">
+    <div class="inner_box" @click="close"></div>
+    <!-- 鸿币充值 -->
+    <MenuPay
+      v-if="showGameInner === 'hb'"
+      @showInnerControl="showInnerControl"
+    />
+
+    <!-- 鸿币充值优惠明细 -->
+    <MenuHbDetail
+      v-if="showGameInner == 'hbDetail'"
+      @showInnerControl="showInnerControl"
+    />
+  </div>
+</template>
+
+<script>
+import MenuPay from "@/components/Menu/MenuPay/MenuPay"; // 鸿币充值
+import MenuHbDetail from "@/components/Menu/MenuPay/MenuHbDetail"; // 鸿币充值优惠明细
+import { mapState } from "vuex";
+export default {
+  name: "HbRecharge",
+  components: {
+    MenuPay,
+    MenuHbDetail,
+  },
+  inject: ["getFinance"],
+  data() {
+    return {
+      showGameInner: "hb", // 控制显示哪个组件
+    };
+  },
+  computed: {
+    ...mapState(["userInfo"]),
+  },
+  watch: {
+    userInfo: {
+      handler: function () {},
+      deep: true,
+      immediate: true,
+    },
+  },
+  created() {},
+  mounted() {
+    this.getFinance();
+  },
+  methods: {
+    // 控制显示哪个组件
+    showInnerControl(showGameInner) {
+      // 如果不存在, 就是关闭
+      if (!showGameInner) {
+        this.close();
+        return;
+      }
+      this.showGameInner = showGameInner;
+    },
+
+    // 关闭当前窗口 打开游戏
+    close() {
+      this.$utils.closePage(this.userInfo.uid);
+    },
+  },
+};
+</script>
+
+<style lang='less' scoped>
+.hb_recharge {
+}
+</style>