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

17
pages/assets/recharge.vue

@ -31,16 +31,17 @@
size="mini" size="mini"
@click="changeRechargeType(1)" @click="changeRechargeType(1)"
>OMNI</view> --> >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" <view class="rounded-xs p-x-lg p-y-ms m-r-md"
size="mini" size="mini"
@click="changeRechargeType(2)" @click="changeRechargeType(2)"
:class="rechargeType==2?'bor-active':'bg-panel-3 border'" :class="rechargeType==2?'bor-active':'bg-panel-3 border'"
>ERC20</view> >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> </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> <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 { return {
coinListShow: false, coinListShow: false,
coin: "", coin: "",
rechargeType: 2, rechargeType: 3,
address: "", address: "",
form: { form: {
coin_id: "", coin_id: "",
@ -176,7 +177,7 @@ export default {
if (this.coin != "USDT") { if (this.coin != "USDT") {
this.rechargeType = 1; this.rechargeType = 1;
}else{ }else{
this.rechargeType = 2; this.rechargeType = 3;
} }
this.walletImage(); this.walletImage();
} }
@ -211,7 +212,7 @@ export default {
address_type: this.rechargeType, address_type: this.rechargeType,
}; };
Wallet.walletImage(data).then(res => { Wallet.walletImage(data).then(res => {
console.info(res) // console.info(res)
this.form.address = res.data.address; this.form.address = res.data.address;
}); });
}, },

1
pages/auth/primary.vue

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

Loading…
Cancel
Save