Commit 0b37eaff authored by Mac's avatar Mac

处理登录效果

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