Browse Source

优化

master
ltlzx 4 years ago
parent
commit
98524e9dbd
  1. 7
      api/serve/index.js
  2. 17
      pages/assets/recharge.vue
  3. 1
      pages/auth/primary.vue

7
api/serve/index.js

@ -83,7 +83,9 @@ x.fn = x.prototype = {
let reg=new RegExp('/','g')//g代表全部
let newMsg=options.url.replace(reg,'_');
if(Cache.get(newMsg).data){
resolve(Cache.get(newMsg).data);
if(newMsg!='_user_walletImage'){
resolve(Cache.get(newMsg).data);
}
uni.request({
url: this.url,
data: this.data,
@ -92,6 +94,7 @@ x.fn = x.prototype = {
dataType: this.dataType,
sslVerify: false,
success: (res) => {
// console.info(res)
let message = res.data.message
let code = res.data.code
if (code != 200) {
@ -121,7 +124,9 @@ x.fn = x.prototype = {
});
}
} else {
// console.info(Cache.set(newMsg,res.data))
Cache.set(newMsg,res.data);
// console.info(res.data)
resolve(res.data); // 直接返回数据
if (config.toast&&message) {
uni.showToast({

17
pages/assets/recharge.vue

@ -31,16 +31,17 @@
size="mini"
@click="changeRechargeType(1)"
>OMNI</view> -->
<view class="rounded-xs p-x-lg p-y-ms"
size="mini"
@click="changeRechargeType(3)"
:class="rechargeType==3?'bor-active':'bg-panel-3 border'"
>TRC20</view>
<view class="rounded-xs p-x-lg p-y-ms m-r-md"
size="mini"
@click="changeRechargeType(2)"
:class="rechargeType==2?'bor-active':'bg-panel-3 border'"
>ERC20</view>
<view class="rounded-xs p-x-lg p-y-ms"
size="mini"
@click="changeRechargeType(3)"
:class="rechargeType==3?'bor-active':'bg-panel-3 border'"
>TRC20</view>
</view>
</view>
<view class="color-sell fn-12 p-x-lg">{{$t('recharge.a1')}}<span v-if="coin=='USDT'">{{text}}</span> {{coin}}{{$t('recharge.a2')}}</view>
@ -141,7 +142,7 @@ export default {
return {
coinListShow: false,
coin: "",
rechargeType: 2,
rechargeType: 3,
address: "",
form: {
coin_id: "",
@ -176,7 +177,7 @@ export default {
if (this.coin != "USDT") {
this.rechargeType = 1;
}else{
this.rechargeType = 2;
this.rechargeType = 3;
}
this.walletImage();
}
@ -211,7 +212,7 @@ export default {
address_type: this.rechargeType,
};
Wallet.walletImage(data).then(res => {
console.info(res)
// console.info(res)
this.form.address = res.data.address;
});
},

1
pages/auth/primary.vue

@ -72,6 +72,7 @@ export default {
getCountryCode() {
Member.getCountryCode()
.then((res) => {
// console.info(res)
this.countryList = res.data;
this.form.country_id = this.countryList[0].id;
})

Loading…
Cancel
Save