Commit 2056aa59 by zeyang

1.优化登录

parent a05df948
<template> <template>
<!-- <movable-area style="width: 100vw; height: 100vh; pointer-events:none; z-index: 9999;position:fixed;top:0;left:0;" <!-- <movable-area style="width: 100vw; height: 100vh; pointer-events:none; z-index: 9999;position:fixed;top:0;left:0;"
@tap="tokefu()"> @tap="tokefu()">
<movable-view direction="all" <movable-view direction="all"
style="width: 100rpx; pointer-events:auto; height: 80rpx;top: 50%;left: 85%;text-align: center;"> style="width: 100rpx; pointer-events:auto; height: 80rpx;top: 50%;left: 85%;text-align: center;">
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
<text class="iconfont icon-31tishi" @click="getIntroduce('center')"></text> <text class="iconfont icon-31tishi" @click="getIntroduce('center')"></text>
</view> </view>
<!--搜索组件--> <!--搜索组件-->
<search :isSearch="0" :userId = "userId"></search> <search :isSearch="0" :userId="userId"></search>
<!--轮播组件--> <!--轮播组件-->
<view class="banner"> <view class="banner">
<view class="uni-margin-wrap"> <view class="uni-margin-wrap">
<carousel :carouselList="cffpUserInfo.fileUploadItemList"></carousel> <carousel :carouselList="cffpUserInfo.fileUploadItemList"></carousel>
</view> </view>
</view> </view>
</view> </view>
...@@ -53,7 +53,10 @@ ...@@ -53,7 +53,10 @@
<!-- <courselist :onlyShowList="0"></courselist> --> <!-- <courselist :onlyShowList="0"></courselist> -->
<view class="ulBox" v-if="cffpCourseInfos.length>0"> <view class="ulBox" v-if="cffpCourseInfos.length>0">
<view class="liBox" v-for="item in cffpCourseInfos" :key="item.fileId" @click="goDetail(item)"> <view class="liBox" v-for="item in cffpCourseInfos" :key="item.fileId" @click="goDetail(item)">
<course-item :thumbnailPath="item.displayImage" :title="item.fileTitle" :summaryBox="item.fileSynopsis" :dataList="{coursePrice:item.coursePrice,salesNumber:item.salesNumber}" :tagList="{v1:item.fileLecturerRanks,v2:item.fileLecturerName}"></course-item> <course-item :thumbnailPath="item.displayImage" :title="item.fileTitle"
:summaryBox="item.fileSynopsis"
:dataList="{coursePrice:item.coursePrice,salesNumber:item.salesNumber}"
:tagList="{v1:item.fileLecturerRanks,v2:item.fileLecturerName}"></course-item>
</view> </view>
</view> </view>
</view> </view>
...@@ -79,7 +82,7 @@ ...@@ -79,7 +82,7 @@
export default { export default {
data() { data() {
return { return {
cffpCourseInfos:[], cffpCourseInfos: [],
x: 0, x: 0,
y: 0, y: 0,
old: { old: {
...@@ -160,7 +163,7 @@ ...@@ -160,7 +163,7 @@
shareId: null, shareId: null,
kefu: '../../static/kefu.png', kefu: '../../static/kefu.png',
loginornot: true, loginornot: true,
queryName:'' queryName: ''
} }
}, },
components: { components: {
...@@ -171,61 +174,63 @@ ...@@ -171,61 +174,63 @@
courseItem courseItem
}, },
onShow() { onShow() {
this.init();
}, },
onLoad() { onLoad() {
if (uni.getStorageSync('isLogin')) { if (uni.getStorageSync('isLogin')) {
this.queryAreaCenterInfo(); this.queryAreaCenterInfo();
this.announcementQuery(); this.announcementQuery();
this.courseList() this.courseList();
let loginType = uni.getStorageSync('loginType')
if(loginType == "visitor" ){
this.loginornot = false
};
} else {
/* uni.navigateTo({
url: '/components/login/login'
}) */
api.loginVerification({"loginType":1}).then((res)=>{
if(res['success']){
this.userId = String(res['data']['userId']);
uni.setStorageSync('isLogin','1');
uni.setStorageSync('cffp_userId',this.userId);
uni.setStorageSync('loginType', 'visitor');
uni.setStorageSync('uni-token', res.data['token']);
this.loginornot = false;
this.queryAreaCenterInfo();
this.announcementQuery();
this.courseList()
}else{
uni.showToast({
title: res['message'],
duration: 2000,
icon: 'none'
})
}
})
} }
}, },
methods: { methods: {
goDetail(item){ init() {
if (uni.getStorageSync('isLogin')) {
let loginType = uni.getStorageSync('loginType')
if (loginType == "visitor") {
this.loginornot = false
};
} else {
api.loginVerification({
"loginType": 1
}).then((res) => {
if (res['success']) {
this.userId = String(res['data']['userId']);
uni.setStorageSync('isLogin', '1');
uni.setStorageSync('cffp_userId', this.userId);
uni.setStorageSync('loginType', 'visitor');
uni.setStorageSync('uni-token', res.data['token']);
this.loginornot = false;
this.queryAreaCenterInfo();
this.announcementQuery();
this.courseList();
} else {
uni.showToast({
title: res['message'],
duration: 2000,
icon: 'none'
})
}
})
}
},
goDetail(item) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/courseDetail/courseDetail?fileId=${item.fileId}` url: `/pages/courseDetail/courseDetail?fileId=${item.fileId}`
}); });
}, },
courseList(){ courseList() {
const param = { const param = {
queryName:this.queryName queryName: this.queryName
} }
api.courseList(param).then(res=>{ api.courseList(param).then(res => {
if(res['success']){ if (res['success']) {
this.cffpCourseInfos = res['data']['data']; this.cffpCourseInfos = res['data']['data'];
}else{ } else {
uni.showToast({ uni.showToast({
title: res['message'], title: res['message'],
duration: 2000, duration: 2000,
icon: 'none' icon: 'none'
}) })
} }
}) })
...@@ -244,7 +249,7 @@ ...@@ -244,7 +249,7 @@
}, },
featureSelect(featureItem) { featureSelect(featureItem) {
console.log(featureItem) console.log(featureItem)
if(this.loginornot == false && featureItem.name != "学习认证" && featureItem.name != "更多功能"){ if (this.loginornot == false && featureItem.name != "学习认证" && featureItem.name != "更多功能") {
uni.showToast({ uni.showToast({
title: "请登陆个人账户使用该功能", title: "请登陆个人账户使用该功能",
duration: 2000, duration: 2000,
...@@ -252,12 +257,13 @@ ...@@ -252,12 +257,13 @@
}); });
uni.clearStorageSync(); uni.clearStorageSync();
uni.redirectTo({ uni.redirectTo({
url:'/components/login/login' url: '/components/login/login'
}) })
return false return false
} }
if(featureItem.key=='02'){ if (featureItem.key == '02') {
if(this.cffpUserInfo.levelCode =='C1' || this.cffpUserInfo.levelCode =='C2' || this.cffpUserInfo.levelCode =='C3'){ if (this.cffpUserInfo.levelCode == 'C1' || this.cffpUserInfo.levelCode == 'C2' || this.cffpUserInfo
.levelCode == 'C3') {
uni.showToast({ uni.showToast({
title: "您已是区域服务中心,无需申请加盟", title: "您已是区域服务中心,无需申请加盟",
duration: 2000, duration: 2000,
...@@ -274,11 +280,11 @@ ...@@ -274,11 +280,11 @@
}); });
return false return false
} else if (featureItem.isOpen && featureItem.link) { } else if (featureItem.isOpen && featureItem.link) {
if(featureItem.key=='07'){ if (featureItem.key == '07') {
uni.switchTab({ uni.switchTab({
url:featureItem.link url: featureItem.link
}) })
}else{ } else {
uni.navigateTo({ uni.navigateTo({
url: featureItem.link url: featureItem.link
}) })
...@@ -342,14 +348,14 @@ ...@@ -342,14 +348,14 @@
this.old.y = e.detail.y this.old.y = e.detail.y
} }
}, },
mounted() { mounted() {}
}
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.container { .container {
padding: 30rpx 30rpx 20rpx; padding: 30rpx 30rpx 20rpx;
.top { .top {
.compony { .compony {
display: flex; display: flex;
...@@ -369,6 +375,7 @@ ...@@ -369,6 +375,7 @@
font-size: 40rpx; font-size: 40rpx;
} }
} }
.banner { .banner {
border-radius: 20rpx; border-radius: 20rpx;
overflow: hidden; overflow: hidden;
...@@ -433,6 +440,7 @@ ...@@ -433,6 +440,7 @@
background: #fff; background: #fff;
position: relative; position: relative;
padding-bottom: 30rpx; padding-bottom: 30rpx;
.tag { .tag {
padding: 20rpx; padding: 20rpx;
display: flex; display: flex;
...@@ -456,16 +464,19 @@ ...@@ -456,16 +464,19 @@
} }
} }
} }
.ulBox{
.ulBox {
flex-direction: column; flex-direction: column;
} }
.liBox{
.liBox {
background-color: #fff; background-color: #fff;
border-radius: 20rpx; border-radius: 20rpx;
margin-bottom: 10rpx; margin-bottom: 10rpx;
padding: 10rpx; padding: 10rpx;
} }
.description { .description {
padding: 40rpx; padding: 40rpx;
} }
</style> </style>
\ No newline at end of file
...@@ -142,7 +142,9 @@ ...@@ -142,7 +142,9 @@
let loginType = uni.getStorageSync('loginType') let loginType = uni.getStorageSync('loginType')
if(loginType == "visitor" ){ if(loginType == "visitor" ){
this.loginornot = false this.loginornot = false
}; }else{
this.loginornot = true;
}
uni.$on("handClick", res => { uni.$on("handClick", res => {
console.log('接受到监听') console.log('接受到监听')
this.customerBasicInfo = res.data this.customerBasicInfo = res.data
......
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