提现优化数值精确度

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", "name" : "CRMEB",
"appid" : "__UNI__3DEF511", "appid" : "__UNI__6105009",
"description" : "", "description" : "",
"versionName" : "1.0.4", "versionName" : "1.0.4",
"versionCode" : 127, "versionCode" : 127,

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

@ -47,10 +47,10 @@
type='digit' v-model="extract_price"></input></view> type='digit' v-model="extract_price"></input></view>
</view> </view>
<view class='tip mt25'> <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>
<view class='tip mt25'> <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>
<view class='tip'> <view class='tip'>
<!-- 说明: 每笔佣金的冻结期为{{userInfo.broken_day}}到期后可提现 --> <!-- 说明: 每笔佣金的冻结期为{{userInfo.broken_day}}到期后可提现 -->
@ -142,13 +142,19 @@
brokerage_price:'', brokerage_price:'',
may_value:'', may_value:'',
shouxufei:'', shouxufei:'',
real_price:'', // real_price:'',
pre_price:'' // pre_price:''
}; };
}, },
computed: { computed: {
...mapGetters(['isLogin','viewColor']), ...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: { watch: {
withdraw_type: { withdraw_type: {
@ -330,8 +336,8 @@
// title: '' + that.minPrice // title: '' + that.minPrice
// }); // });
value.extract_type = this.currentTab value.extract_type = this.currentTab
value.pre_price = this.extract_price*this.proportion; // value.pre_price = this.extract_price*this.proportion;
value.real_price = this.extract_price*this.proportion*0.7*0.94; // value.real_price = this.extract_price*this.proportion*0.7*0.94;
console.log(value, 'value') console.log(value, 'value')
that.load = true; that.load = true;
if(that.sys_extension_type && that.currentTab == 1) 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