فهرست منبع

1. 新增鸿币可输入功能 2.打包不生成 map 文件

gongyan 4 سال پیش
والد
کامیت
4e28ff5364
4فایلهای تغییر یافته به همراه82 افزوده شده و 19 حذف شده
  1. 9 0
      README.md
  2. 1 1
      config/index.js
  3. 2 2
      src/components/Menu/MenuPay/MenuPay.vue
  4. 70 16
      src/components/Menu/MenuPay/MenuPayH5.vue

+ 9 - 0
README.md

@@ -15,6 +15,11 @@ node 10.16.0
 1. 修复 ios 登录问题(更改了获取 url 中参数的方法, 优先取哈希)
 2. 登录相关新增关闭页面按钮
 
+## v1.0.2
+
+1. 新增鸿币可输入功能
+2. 打包不生成 map 文件
+
 # pay
 
 ## order cp 给的参数都随机生成
@@ -226,3 +231,7 @@ appid
 -   [x] 注册
 -   [x] 忘记密码
 -   [x] 快速登录
+
+## 8.18
+
+-   [x] 鸿币可输入

+ 1 - 1
config/index.js

@@ -55,7 +55,7 @@ module.exports = {
          * Source Maps
          */
 
-        productionSourceMap: true,
+        productionSourceMap: false, // true 打包会生成map文件
         // https://webpack.js.org/configuration/devtool/#production
         devtool: '#source-map',
 

+ 2 - 2
src/components/Menu/MenuPay/MenuPay.vue

@@ -136,10 +136,10 @@ export default {
   all and (device-aspect-ratio: 4/3) {
   .menu_pay {
     width: 350 / @rem;
-    height: 430 / @rem;
+    height: 450 / @rem;
     left: 50%;
     top: 50%;
-    margin-top: -215 / @rem;
+    margin-top: -225 / @rem;
     margin-left: -175 / @rem;
     padding: 7.5 / @rem 10 / @rem;
     border-radius: 20 / @rem;

+ 70 - 16
src/components/Menu/MenuPay/MenuPayH5.vue

@@ -121,17 +121,6 @@
           >
             {{ payCountList[3] }} HB
           </li>
-          <!-- <li
-            class="count_input"
-            :class="{
-              active: currentCount === -1,
-            }"
-            @click="onSelectCount(null, -1)"
-            @keyup.enter="onConfirmCount"
-          >
-            <input type="number" v-model="payCount2" />
-            <div class="confirm" @click="onConfirmCount">确认</div>
-          </li> -->
           <li class="count clear">
             <div class="reduce" @click="reduce(3)">-</div>
             <input
@@ -145,6 +134,17 @@
             />
             <div class="add" @click="add(3)">+</div>
           </li>
+          <!-- 可输入框 -->
+          <li class="default input_left">
+            <input
+              type="number"
+              placeholder="请输入鸿币数"
+              v-model="payCount2"
+            />
+          </li>
+          <li class="count clear input_right">
+            <div class="confirm" @click="onConfirmCount">确认</div>
+          </li>
         </ul>
       </div>
     </div>
@@ -214,8 +214,7 @@ export default {
   inject: ["checkCode", "getFinance", "checkCodeHandler", "onRecharge"],
   data() {
     return {
-      payCountList: ["0.01", "200", "500", "1000"], // 可选充值金额列表
-    //   payCountList: ["100", "200", "500", "1000"], // 可选充值金额列表
+      payCountList: ["100", "200", "500", "1000"], // 可选充值金额列表
       currentCount: 0, // 默认选中的充值金额
       payPlatform: "ALIPAY", // 默认支付方式
       payCount: 0, // 应付金额
@@ -228,6 +227,7 @@ export default {
       allCount: 0, // 本应付金额
       oldHB: 0, // 原得鸿币
       newHB: 0, // 应得鸿币
+      confirmInput: false, // 输入内容确定
     };
   },
   computed: {
@@ -243,24 +243,42 @@ export default {
   watch: {
     // 第一档 100
     firstCount(firstCountNew) {
+      if (this.confirmInput) {
+        return;
+      }
+      this.payCount2 = "";
       this.checkInput(0);
       this.computeMoney();
     },
     // 第二档 200
     secondCount(secondCountNew) {
+      if (this.confirmInput) {
+        return;
+      }
+      this.payCount2 = "";
       this.checkInput(1);
       this.computeMoney();
     },
     // 第三档 500
     thirdCount(thirdCountNew) {
+      if (this.confirmInput) {
+        return;
+      }
+      this.payCount2 = "";
       this.checkInput(2);
       this.computeMoney();
     },
     // 第四档 1000
     fourthCount(fourthCountNew) {
+      if (this.confirmInput) {
+        return;
+      }
+      this.payCount2 = "";
       this.checkInput(3);
       this.computeMoney();
     },
+    // 输入鸿币数
+    payCount2(payCount2) {},
   },
   created() {},
   mounted() {
@@ -291,6 +309,7 @@ export default {
 
     // 选中充值金额
     select(index) {
+      this.confirmInput = false;
       switch (index) {
         // 100
         case 0:
@@ -326,12 +345,19 @@ export default {
 
     // 自定义金额
     onConfirmCount() {
-      if (!this.payCount2) {
-        this.$toast.text("请输入正确的金额");
+      if (!parseInt(this.payCount2) || !/^[1-9]\d*$/.test(this.payCount2)) {
+        this.$toast.text("请输入一个正整数");
         return;
       }
-      this.payCount2 = Math.ceil(parseFloat(this.payCount2 * 100)) / 100;
+      // 确认清空其他档位
+      this.confirmInput = true;
+      this.firstCount = 0;
+      this.secondCount = 0;
+      this.thirdCount = 0;
+      this.fourthCount = 0;
+
       this.payCount = this.payCount2;
+      this.discount(this.payCount);
     },
 
     //  充值鸿币 立即付款
@@ -379,6 +405,7 @@ export default {
      * @param index 档位下标
      */
     reduce(index) {
+      this.confirmInput = false;
       switch (index) {
         // 100
         case 0:
@@ -417,6 +444,7 @@ export default {
      * @param index 档位下标
      */
     add(index) {
+      this.confirmInput = false;
       switch (index) {
         // 100
         case 0:
@@ -529,6 +557,9 @@ export default {
 
 <style lang='less' scoped>
 .menu_pay_h5 {
+  height: 680 / @rem;
+  overflow-y: auto;
+
   .pay_account,
   .pay_money,
   .pay_type,
@@ -586,6 +617,23 @@ export default {
       margin-bottom: 10 / @rem;
     }
 
+    .input_left {
+      input {
+        width: 100%;
+        font-size: 32 / @rem;
+        color: #555555;
+        text-align: center;
+      }
+    }
+
+    .input_right {
+      border-radius: 8 / @rem;
+      color: #fff;
+      background-color: #3faeed;
+      border: 2px solid #3faeed;
+      box-sizing: border-box;
+    }
+
     .count {
       .reduce,
       input,
@@ -765,6 +813,12 @@ export default {
         margin-bottom: 8 / @rem;
       }
 
+      .input_left {
+        input {
+          font-size: 16 / @rem;
+        }
+      }
+
       .count {
         .reduce,
         input,