Commit 50e543dd authored by 罗林杰's avatar 罗林杰

修改bug

parent bf094bb8
......@@ -79,8 +79,6 @@
watch: {
currentIndex: {
handler(newVal) {
console.log("currentIndex切换到了第:" + newVal)
console.log('this.tabIndex:',this.tabIndex)
if (newVal === this.tabIndex) {
if (newVal === 0){
const token = uni.getStorageSync('token')
......
......@@ -105,8 +105,7 @@
onShow() {
//发布动态后 需要主动刷新一下最近的列表信息
if (uni.getStorageSync("isRefresh")) {
this.current = 1
this.$refs.listItem[1].reload()
this.$refs.listItem[this.current].reload()
uni.setStorageSync("isRefresh", false)
}
},
......
......@@ -90,9 +90,9 @@
})
uni.setStorageSync("isRefresh", true)
setTimeout(() => {
uni.switchTab({
url: '/pages/tab/article',
});
uni.navigateBack({
delta: 1, //返回层数,2则上上页
})
},1000)
} else if (res.data.code === 1002){
//留言超出限制 是否采用金币进行留言
......
......@@ -108,7 +108,12 @@
this.isConfirm = true;
this.tipMsg = "发送成功";
this.$refs.elm.showDialog();
}else {
} else if (res.data.code === 1001){
uni.showToast({
title: res.data.message,
icon: 'none'
})
} else {
this.isMessageConfirm = true;
this.tipMsg = res.data.message;
this.$refs.elmMessage.showDialog();
......
......@@ -15,6 +15,7 @@
login,
phoneLogin
} from '../api/login/index';
import {getUserInfo} from "../api/user";
export default {
data() {
return {
......@@ -71,10 +72,10 @@
if (res.data.token !== undefined && res.data.token !== null) {
this.token = res.data.token
this.openId = res.data.data.wxOpenid
this.userInfo = res.data.data
this.userInfo.memberId = res.data.memberId
uni.setStorageSync('token', this.token)
uni.setStorageSync('userInfo', this.userInfo)
getUserInfo().then(res => {
uni.setStorageSync('userInfo', res.data.data)
})
//停止加载
uni.hideLoading()
uni.switchTab({
......@@ -142,12 +143,12 @@
// 第一次登录请求
await phoneLogin(params).then((res) => {
this.token = res.data.token
let userInfo = res.data.data
userInfo.memberId = res.data.memberId
// 存储token
// 存储用户信息
uni.setStorageSync('token', this.token)
uni.setStorageSync('userInfo', userInfo)
getUserInfo().then(res => {
uni.setStorageSync('userInfo', res.data.data)
})
}).catch(res => {
//错误信息
if (res.message === '该员工账号不存在' || res.message === '您的手机号被占用,请联系客服') {
......
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