智方网络_吖荣 3 năm trước cách đây
mục cha
commit
d65b220e9f

+ 6 - 6
src/pages/start/index.vue

@@ -460,8 +460,8 @@ export default {
               .slice(0, 4)
           : Math.round($data["theta"]);
       var $beta =
-        Math.round($data["theta"]) > 1000
-          ? Math.round($data["delta"])
+        Math.round($data["beta"]) > 1000
+          ? Math.round($data["beta"])
               .toString()
               .slice(0, 4)
           : Math.round($data["beta"]);
@@ -497,10 +497,10 @@ export default {
 
       $this.attList.push($data["att"]);
       $this.medList.push($data["med"]);
-      $this.deltaList.push($delta);
-      $this.alphaList.push($alpha);
-      $this.betaList.push($beta);
-      $this.thetaList.push($theta);
+      $this.deltaList.push($data["delta"]);
+      $this.alphaList.push($data["alpha"]);
+      $this.betaList.push($data["beta"]);
+      $this.thetaList.push($data["theta"]);
 
       game_store.setters.setGameAttMedDatas({
         attList: $this.attList,

+ 3 - 4
src/pages/user_center/confirmPay/index.vue

@@ -37,7 +37,7 @@
            <label class="radio" @click='radiocon'>
                <!-- <checkbox id="checkBox" class='round orange' :class="checked?'checked':''" :checked="checked?true:false" @click="setPrice"
 			 	value='1'></checkbox> -->
-                <radio  :checked="check" id="radios" ref="radio" ></radio>
+                <checkbox  :checked="data.check" id="radios"></checkbox>
                <text class="text-lg text-orange">&emsp;加购{{ data.add_price }}元,获得有效期增加{{ data.add_month }}个月</text>
            </label>
 
@@ -88,9 +88,8 @@ export default {
     },
     radiocon() {
       //   $this.check = !$this.check;
-      $this.check = false;
-      console.log("用户打勾的是 ", $this.check);
-      console.log($this.$refs);
+      $this.data.check = !$this.data.check;
+      console.log("用户打勾的是 ", $this.data.check);
     },
   },
 };

+ 0 - 1
src/pages/user_center/confirmPay/main.json

@@ -1,6 +1,5 @@
 {
     "usingComponents": {
-       
     }
   }
   

+ 1 - 1
src/pages/user_center/recharge/index.vue

@@ -353,7 +353,7 @@ export default {
     //   $this.selection_card = $item;
     // },
     to_confirm($item) {
-      // console.log("data",$item)
+      console.log("data",$item)
       //实付
       if($item.coupon.type==3){
         $item["total_price"] = $item.price*$item.coupon.discount

+ 1 - 0
static/vant/checkbox/index.d.ts

@@ -0,0 +1 @@
+export {};

+ 74 - 0
static/vant/checkbox/index.js

@@ -0,0 +1,74 @@
+import { VantComponent } from '../common/component';
+function emit(target, value) {
+  target.$emit('input', value);
+  target.$emit('change', value);
+}
+VantComponent({
+  field: true,
+  relation: {
+    name: 'checkbox-group',
+    type: 'ancestor',
+    current: 'checkbox',
+  },
+  classes: ['icon-class', 'label-class'],
+  props: {
+    value: Boolean,
+    disabled: Boolean,
+    useIconSlot: Boolean,
+    checkedColor: String,
+    labelPosition: String,
+    labelDisabled: Boolean,
+    shape: {
+      type: String,
+      value: 'round',
+    },
+    iconSize: {
+      type: null,
+      value: 20,
+    },
+  },
+  data: {
+    parentDisabled: false,
+  },
+  methods: {
+    emitChange(value) {
+      if (this.parent) {
+        this.setParentValue(this.parent, value);
+      } else {
+        emit(this, value);
+      }
+    },
+    toggle() {
+      const { parentDisabled, disabled, value } = this.data;
+      if (!disabled && !parentDisabled) {
+        this.emitChange(!value);
+      }
+    },
+    onClickLabel() {
+      const { labelDisabled, parentDisabled, disabled, value } = this.data;
+      if (!disabled && !labelDisabled && !parentDisabled) {
+        this.emitChange(!value);
+      }
+    },
+    setParentValue(parent, value) {
+      const parentValue = parent.data.value.slice();
+      const { name } = this.data;
+      const { max } = parent.data;
+      if (value) {
+        if (max && parentValue.length >= max) {
+          return;
+        }
+        if (parentValue.indexOf(name) === -1) {
+          parentValue.push(name);
+          emit(parent, parentValue);
+        }
+      } else {
+        const index = parentValue.indexOf(name);
+        if (index !== -1) {
+          parentValue.splice(index, 1);
+          emit(parent, parentValue);
+        }
+      }
+    },
+  },
+});

+ 6 - 0
static/vant/checkbox/index.json

@@ -0,0 +1,6 @@
+{
+  "component": true,
+  "usingComponents": {
+    "van-icon": "../icon/index"
+  }
+}

+ 20 - 0
static/vant/checkbox/index.wxml

@@ -0,0 +1,20 @@
+<wxs src="../wxs/utils.wxs" module="utils" />
+<wxs src="./index.wxs" module="computed" />
+
+<view class="van-checkbox custom-class">
+  <view class="van-checkbox__icon-wrap" bindtap="toggle">
+    <slot wx:if="{{ useIconSlot }}" name="icon" />
+    <van-icon
+      wx:else
+      name="success"
+      size="0.8em"
+      class="{{ utils.bem('checkbox__icon', [shape, { disabled: disabled || parentDisabled, checked: value }]) }}"
+      style="{{ computed.iconStyle(checkedColor, value, disabled, parentDisabled, iconSize) }}"
+      custom-class="icon-class"
+      custom-style="line-height: 1.25em;"
+    />
+  </view>
+  <view class="label-class {{ utils.bem('checkbox__label', [labelPosition, { disabled: disabled || parentDisabled }]) }}" bindtap="onClickLabel">
+    <slot />
+  </view>
+</view>

+ 20 - 0
static/vant/checkbox/index.wxs

@@ -0,0 +1,20 @@
+/* eslint-disable */
+var utils = require('../wxs/utils.wxs');
+
+function iconStyle(checkedColor, value, disabled, parentDisabled, iconSize) {
+  var styles = [['font-size', utils.addUnit(iconSize)]];
+  if (checkedColor && value && !disabled && !parentDisabled) {
+    styles.push(['border-color', checkedColor]);
+    styles.push(['background-color', checkedColor]);
+  }
+
+  return styles
+    .map(function(item) {
+      return item.join(':');
+    })
+    .join(';');
+}
+
+module.exports = {
+  iconStyle: iconStyle
+};

+ 1 - 0
static/vant/checkbox/index.wxss

@@ -0,0 +1 @@
+@import '../common/index.wxss';.van-checkbox{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;overflow:hidden;-webkit-user-select:none;user-select:none}.van-checkbox__icon-wrap,.van-checkbox__label{line-height:20px;line-height:var(--checkbox-size,20px)}.van-checkbox__icon-wrap{-webkit-flex:none;flex:none}.van-checkbox__icon{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;width:1em;height:1em;color:transparent;text-align:center;transition-property:color,border-color,background-color;font-size:20px;font-size:var(--checkbox-size,20px);border:1px solid #c8c9cc;border:1px solid var(--checkbox-border-color,#c8c9cc);transition-duration:.2s;transition-duration:var(--checkbox-transition-duration,.2s)}.van-checkbox__icon--round{border-radius:100%}.van-checkbox__icon--checked{color:#fff;color:var(--white,#fff);background-color:#1989fa;background-color:var(--checkbox-checked-icon-color,#1989fa);border-color:#1989fa;border-color:var(--checkbox-checked-icon-color,#1989fa)}.van-checkbox__icon--disabled{background-color:#ebedf0;background-color:var(--checkbox-disabled-background-color,#ebedf0);border-color:#c8c9cc;border-color:var(--checkbox-disabled-icon-color,#c8c9cc)}.van-checkbox__icon--disabled.van-checkbox__icon--checked{color:#c8c9cc;color:var(--checkbox-disabled-icon-color,#c8c9cc)}.van-checkbox__label{word-wrap:break-word;margin-left:10px;margin-left:var(--checkbox-label-margin,10px);color:#323233;color:var(--checkbox-label-color,#323233)}.van-checkbox__label--left{float:left;margin:0 10px 0 0;margin:0 var(--checkbox-label-margin,10px) 0 0}.van-checkbox__label--disabled{color:#c8c9cc;color:var(--checkbox-disabled-label-color,#c8c9cc)}.van-checkbox__label:empty{margin:0}