提现优化数值精确度

master
Santaner 9 months ago
parent 91a40f0797
commit 758d5f6cf3
  1. 2
      manifest.json
  2. 2
      pages/user/index.vue
  3. 40
      pages/users/user_payout/index.vue

@ -1,6 +1,6 @@
{
"name" : "CRMEB",
"appid" : "__UNI__3DEF511",
"appid" : "__UNI__6105009",
"description" : "",
"versionName" : "1.0.4",
"versionCode" : 127,

@ -86,7 +86,7 @@
</view> -->
<view class="num-item" @click="goMenuPage('/pages/users/user_wallet/index')">
<text class="num">{{brandInfo.all_value || 0}}</text>
<view class="txt">贡献值</view>
<view class="txt">当前贡献值</view>
</view>
<view class="num-item" @click="goMenuPage('/pages/users/user_wallet/index')">
<text class="num">{{userInfo.asset_price || 0}}</text>

@ -47,10 +47,10 @@
type='digit' v-model="extract_price"></input></view>
</view>
<view class='tip mt25'>
提现资产价值<text class="price">{{extract_price*proportion}}</text>,当前生命值: <text class="price">{{hpValue}}</text>
提现资产价值<text class="price">{{pre_price}}</text>,当前生命值: <text class="price">{{hpValue}}</text>
</view>
<view class='tip mt25'>
实际提现金额<text class="price">{{extract_price*proportion*0.7*0.94}}</text>,可提现增值积分: <text class="price">{{brokerage_price}}</text>
实际提现金额<text class="price">{{real_price}}</text>,可提现增值积分: <text class="price">{{brokerage_price}}</text>
</view>
<view class='tip'>
<!-- 说明: 每笔佣金的冻结期为{{userInfo.broken_day}}到期后可提现 -->
@ -142,13 +142,19 @@
brokerage_price:'',
may_value:'',
shouxufei:'',
real_price:'',
pre_price:''
// real_price:'',
// pre_price:''
};
},
computed: {
...mapGetters(['isLogin','viewColor']),
... configMap(['sys_extension_type', 'withdraw_type'])
... configMap(['sys_extension_type', 'withdraw_type']),
pre_price: function(){
return this.accMul(this.extract_price,this.proportion);
},
real_price: function(){
return this.accMul(this.pre_price,0.658);
}
},
watch: {
withdraw_type: {
@ -330,8 +336,8 @@
// title: '' + that.minPrice
// });
value.extract_type = this.currentTab
value.pre_price = this.extract_price*this.proportion;
value.real_price = this.extract_price*this.proportion*0.7*0.94;
// value.pre_price = this.extract_price*this.proportion;
// value.real_price = this.extract_price*this.proportion*0.7*0.94;
console.log(value, 'value')
that.load = true;
if(that.sys_extension_type && that.currentTab == 1)
@ -358,6 +364,26 @@
});
});
},
/**
* 浮点数据转化
*
*/
accMul(arg1, arg2) {
var m = 0, s1 = arg1.toString(), s2 = arg2.toString();
try {
m += s1.split(".")[1].length;
}
catch (e) {
}
try {
m += s2.split(".")[1].length;
}
catch (e) {
}
return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m);
},
/**
* 打开支付组件
*

Loading…
Cancel
Save