Commit 06b8c40e authored by leiqingsong's avatar leiqingsong

优化

parent b15b4b9b
......@@ -8,9 +8,6 @@ import "amfe-flexible";
import "@/plugins/vant-ui.js";
import "@/plugins/echarts-plugins.js";
import Vconsole from "vconsole";
import { getUserId, getUserAvatar } from "./utils/localGetter";
Vue.prototype.$userId = getUserId();
Vue.prototype.$userAvatar = getUserAvatar();
import bridgeToAppFun from "@/utils/bridgeToAppFun";
Vue.prototype.$bridgeToAppFun = new bridgeToAppFun();
......
export function getUserId() {
let userInfo = localStorage.getItem("user");
if (userInfo) {
return JSON.parse(userInfo).userId;
} else {
return "";
}
}
export function getUserAvatar() {
let userInfo = localStorage.getItem("user");
if (userInfo) {
return JSON.parse(userInfo).headImage;
} else {
return "";
}
}
......@@ -44,7 +44,7 @@ export default {
data() {
return {
total: 0,
userPoolVos: [{ userId: this.$userId }],
userPoolVos: [],
timer: null
};
},
......
......@@ -91,7 +91,7 @@ export default {
this.$toast.fail("请填写银行卡号");
return;
} else if (!this.form.name) {
this.$$toast.fail("请填写姓名");
this.$toast.fail("请填写姓名");
return;
}
const params = this.form;
......@@ -112,7 +112,7 @@ export default {
});
} else {
const addParams = params;
addParams.userId = this.$userId;
addParams.userId =JSON.parase(localStorage.getItem('user')).userId;
addUserBankInfo(params)
.then(res => {
if (res.code === 0) {
......@@ -131,7 +131,7 @@ export default {
},
getBankInfo() {
const params = {
userId: this.$userId
userId:JSON.parase(localStorage.getItem('user')).userId
};
getUserBankInfo(params).then(res => {
if (res.code === 0 && res.data) {
......
......@@ -59,7 +59,7 @@ export default {
methods: {
getWithdrawal() {
const params = {
userId: this.$userId
userId:JSON.parase(localStorage.getItem('user')).userId
};
getWithdrawalAmount(params).then(res => {
if (res.code === 0) {
......
......@@ -74,7 +74,7 @@ export default {
},
getRecordList(yearMonth) {
const params = {
userId: this.$userId,
userId:JSON.parase(localStorage.getItem('user')).userId,
yearMonth: yearMonth
};
getWithdrawalRecord(params).then(res => {
......
......@@ -96,7 +96,7 @@ export default {
name: "CashOut",
data() {
return {
userPhone: this.$userId,
userPhone:JSON.parase(localStorage.getItem('user')).userId,
bank: "",
money: null,
account: 0,
......@@ -128,7 +128,7 @@ export default {
},
canCashOut() {
const params = {
userId: this.$userId
userId:JSON.parase(localStorage.getItem('user')).userId
};
getWithdrawalAmount(params).then(res => {
if (res.code === 0) {
......@@ -158,7 +158,7 @@ export default {
return;
}
const params = {
userId: this.$userId
userId:JSON.parase(localStorage.getItem('user')).userId
};
sendSms(params).then();
this.validCode = null;
......@@ -176,7 +176,7 @@ export default {
},
getUserInfo() {
const params = {
userId: this.$userId
userId:JSON.parase(localStorage.getItem('user')).userId
};
getUserBankInfo(params).then(res => {
if (res.code === 0) {
......
......@@ -52,7 +52,7 @@ export default {
},
getCustomerData() {
let params = {
userId: this.$userId
userId:JSON.parase(localStorage.getItem('user')).userId
};
getCustomer(params).then(res => {
if (res.code === 0) {
......
......@@ -115,7 +115,7 @@ export default {
this.$router.push({ name: urlName });
},
getstatus() {
const userId = this.$userId;
const userId =JSON.parase(localStorage.getItem('user')).userId;
console.log(userId);
const _this = this;
getForestStatus(userId).then(res => {
......
......@@ -28,7 +28,7 @@ export default {
methods: {
getAllRecord() {
const params = {
userId: this.$userId
userId:JSON.parase(localStorage.getItem('user')).userId
};
showIncomeRecord(params).then(res => {
if (res.code === 0) {
......
......@@ -231,7 +231,7 @@ export default {
},
getDetail() {
const params = {
userId: this.$userId
userId:JSON.parase(localStorage.getItem('user')).userId
};
queryIncomeDetail(params).then(res => {
if (res.code === 0) {
......
......@@ -75,7 +75,7 @@ export default {
// 获取用户钱包展示信息
getWalletInfo() {
const params = {
userId: this.$userId
userId:JSON.parase(localStorage.getItem('user')).userId
};
getMoneyPackage(params)
.then(res => {
......
......@@ -50,7 +50,7 @@ export default {
this.canSubmit = false;
const params = {
headImage: this.imageUrl,
userId: this.$userId
userId:JSON.parase(localStorage.getItem('user')).userId
};
setAvatar(params).then(res => {
if (res.code === 0) {
......
......@@ -20,7 +20,7 @@ export default {
methods: {
getMoment() {
const params = {
userId: this.$userId
userId:JSON.parase(localStorage.getItem('user')).userId
};
findByUserId(params).then(res => {
console.log(res);
......
......@@ -51,7 +51,7 @@ export default {
fd.append("files", file.file);
});
fd.append("zxField", this.message);
fd.append("userId", this.$userId);
fd.append("userId",JSON.parase(localStorage.getItem('user')).userId);
uploadImage(fd).then();
},
openPopup() {
......
......@@ -88,7 +88,7 @@ export default {
},
data() {
return {
avatar: process.env.VUE_APP_BASE_URL + this.$userAvatar,
avatar: '',
inviteeArr: [],
userRecommendInfo: {},
activeTab: "",
......@@ -148,6 +148,10 @@ export default {
this.getRecommendInfo();
this.getRecommendDetail(0);
},
mounted() {
const userAvatar = JSON.parse(localStorage.getItem('user')).headImage;
this.avatar = process.env.VUE_APP_BASE_URL + userAvatar
},
methods: {
changeTab(name) {
this.getRecommendDetail(name);
......@@ -160,7 +164,7 @@ export default {
},
getRecommendInfo() {
const params = {
userId: this.$userId
userId:JSON.parase(localStorage.getItem('user')).userId
};
recomendInfo(params).then(res => {
if (res.code === 0) {
......@@ -177,7 +181,7 @@ export default {
},
getRecommendDetail(level) {
const params = {
userId: this.$userId,
userId:JSON.parase(localStorage.getItem('user')).userId,
userlevel: level
};
recommendDetail(params).then(res => {
......
......@@ -78,7 +78,7 @@ export default {
data() {
return {
form: {
userId: this.$userId,
userId:JSON.parase(localStorage.getItem('user')).userId,
sms: "",
beInvitedCode: ""
},
......
......@@ -120,7 +120,7 @@ export default {
},
getData() {
const params = {
userId: this.$userId
userId:JSON.parase(localStorage.getItem('user')).userId
};
monthRewards(params).then(res => {
if (res.code === 0) {
......
......@@ -124,7 +124,7 @@ export default {
this.inviteeCode = this.fillCode;
const params = {
inviteCode: this.fillCode,
userId: this.$userId
userId:JSON.parase(localStorage.getItem('user')).userId
};
fillInviteCode(params).then();
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment