Commit 2056aa59 by zeyang

1.优化登录

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