Commit 0b37eaff authored by Mac's avatar Mac

处理登录效果

parent 9c5cd8be
......@@ -341,12 +341,20 @@
</view>
<auth
v-if="showAuth"
@changeuserinfo="reloadUserinfo"
@gbAuth="gbAuth"
></auth>
</view>
</template>
<script>
import auth from "@/components/auth/index.vue";
export default{
components: {
auth
},
data(){
return{
Id:0,
......@@ -354,6 +362,8 @@
RankList:[],
type:1,//1位列表过来的 2 为自己报名列表过来的
controls:false,
showAuth:false,
u: {}
}
},
onLoad(options) {
......@@ -370,13 +380,31 @@
})
if(options && options.Id){
this.Id = options.Id
this.getDetails()
this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) {
this.u = {
nickName: "未登录",
avatarUrl: "",
};
this.showAuth = true;
} else {
this.getDetails()
}
}
if(options && options.type){
this.type = options.type
}
},
methods:{
reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo");
this.getDetails()
},
//关闭登录窗口
gbAuth() {
uni.navigateBack()
},
enlarge(file) {
// 全屏
this.videoContext = uni.createVideoContext(file);
......
......@@ -112,11 +112,20 @@
<div style='width: 100%;height: 30px;'></div>
</scroll-view>
</view>
<auth
v-if="showAuth"
@changeuserinfo="reloadUserinfo"
@gbAuth="gbAuth"
></auth>
</view>
</template>
<script>
import auth from "@/components/auth/index.vue";
export default{
components: {
auth
},
data(){
return{
titleStyle: {},
......@@ -151,6 +160,8 @@
loading: "努力加载中",
nomore: "没有更多了",
},
showAuth:false,
u: {}
}
},
created() {
......@@ -169,9 +180,27 @@
that.mainColor = that.$uiConfig.mainColor;
var myDate = new Date();
that.msg.Year = myDate.getFullYear();
that.getList()
this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) {
this.u = {
nickName: "未登录",
avatarUrl: "",
};
this.showAuth = true;
} else {
that.getList()
}
},
methods:{
reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo");
that.getList()
},
//关闭登录窗口
gbAuth() {
uni.navigateBack()
},
goback() {
uni.navigateBack({
delta: 1,
......
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