修改之前封装方法出错导致出现的bug

master
学习很差啦 2022-09-30 16:29:16 +08:00
parent 4851487ecd
commit d101cd1b6a
3 changed files with 34 additions and 40 deletions

View File

@ -1,6 +1,6 @@
<template>
<view class="wap">
<u-navbar back-text="" title="预存款列表">
<u-navbar title="预存款列表">
</u-navbar>
<view class="wrapper-show-money">
<view class="money-view">
@ -28,7 +28,7 @@
</view>
<u-empty v-if="datas.length==0" mode="history" text="暂无记录" />
<u-loadmore v-else bg-color='#f8f8f8' :status="status" />
</scroll-view>
</swiper-item>
@ -45,7 +45,7 @@ export default {
data() {
return {
walletNum: 0,
status: "loadmore",
current: 0,
swiperCurrent: 0,
userInfo: "", //
@ -82,27 +82,23 @@ export default {
/**分页获取预存款充值记录 */
getRecharge() {
this.status = "loading";
getUserRecharge(this.params).then((res) => {
if (res.data.success) {
if (res.data.result.records.length != 0) {
this.status = "loadmore";
this.datas.push(...res.data.result.records);
} else {
this.status = "nomore";
}
}
});
},
getWallet() {
this.status = "loading";
getWalletLog(this.params).then((res) => {
if (res.data.success) {
if (res.data.result.records.length != 0) {
this.datas.push(...res.data.result.records);
} else {
this.status = "nomore";
}
}
});

View File

@ -331,7 +331,7 @@ export default {
this.initData(0);
}
}
this.loadData(this.status);
// this.loadData(this.status);
},
onLoad(options) {

View File

@ -1,6 +1,6 @@
import Foundation from "./Foundation.js";
import storage from "@/utils/storage.js";
import { getUserInfo } from '@/api/members';
import { getUserInfo } from "@/api/members";
import Vue from "vue";
/**
* 金钱单位置换 2999 --> 2,999.00
@ -107,38 +107,36 @@ export function isLogin(val) {
}
}
export function tipsToLogin(){
if(!isLogin('auth')){
uni.showModal({
title: "提示",
content: "当前用户未登录是否登录?",
confirmText: "确定",
cancelText: "取消",
confirmColor:Vue.prototype.$mainColor,
success: res => {
if (res.confirm) {
navigateToLogin()
} else if (res.cancel) {
uni.navigateBack()
}
},
})
return
}
export function tipsToLogin() {
if (!isLogin("auth")) {
uni.showModal({
title: "提示",
content: "当前用户未登录是否登录?",
confirmText: "确定",
cancelText: "取消",
confirmColor: Vue.prototype.$mainColor,
success: (res) => {
if (res.confirm) {
navigateToLogin();
} else if (res.cancel) {
uni.navigateBack();
}
},
});
return false;
}
return true;
}
/**
* 获取用户信息并重新添加到缓存里面
*/
export async function userInfo(){
let res = await getUserInfo();
if(res.data.success){
storage.setUserInfo(res.data.result);
return res.data.result
}
export async function userInfo() {
let res = await getUserInfo();
if (res.data.success) {
storage.setUserInfo(res.data.result);
return res.data.result;
}
}
/**
@ -149,7 +147,7 @@ export async function userInfo(){
export function forceLogin() {
let userInfo = storage.getUserInfo();
if (!userInfo || !userInfo.id) {
if (!userInfo || !userInfo.id) {
// #ifdef MP-WEIXIN
uni.navigateTo({