Commit a5ae9687 authored by Mac's avatar Mac

1

parent 6a8a2996
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"easycom": { "easycom": {
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
}, },
"pages": [{ "pages": [{"path":"pages/user-center/user-center"},{
"path": "pages/index/index", "path": "pages/index/index",
"enablePullDownRefresh": true, "enablePullDownRefresh": true,
"style": { "style": {
...@@ -91,19 +91,19 @@ ...@@ -91,19 +91,19 @@
"path": "share" "path": "share"
}] }]
}, },
{ // {
"root": "pages/user-center", // "root": "pages/user-center",
"pages": [{ // "pages": [{
"path": "integral-detail/integral-detail" // "path": "integral-detail/integral-detail"
}, // },
{ // {
"path": "user-center", // "path": "user-center",
"style": { // "style": {
"navigationStyle": "custom" // "navigationStyle": "custom"
} // }
} // }
] // ]
}, // },
{ {
"root": "pages/mySupplier", "root": "pages/mySupplier",
"pages": [{ "pages": [{
...@@ -384,7 +384,10 @@ ...@@ -384,7 +384,10 @@
},{ },{
"path":"personal/cardList"//学习卡中心 "path":"personal/cardList"//学习卡中心
},{ },{
"path":"mystudy/mystudy" "path":"mystudy/mystudy",
"style": {
"navigationStyle": "custom"
}
}] }]
}, },
......
<template> <template>
<scroll-view <view class="mystudy">
:scroll-y="true" <view style="padding-top: 74px;">
@scroll="scrollHandler"
@scrolltoupper="scrollTopHandler"
style="height: 100vh;">
<view class="mystudy">
<view <view
class="headStatus" class="headStatus"
v-if="scrollTop > 50 "
:style="[ :style="[
headStyle, headStyle,
{
zIndex: scrollTop < 10 ? 'unset' : 2,
opacity: scrollTop < 10 ? '100' : scrollTop,
background:'#FFF'
},
]" ]"
> >
<view class="arrow" @click="goback"> <view class="arrow" @click="goback">
<u-icon name="arrow-left" size="48" color="#000"></u-icon> <u-icon name="arrow-left" size="48" color="#000"></u-icon>
</view> </view>
<view class="title" style="color: #000000;" v-if="scrollTop > 50">{{pageTitle}}</view> <view style="width: 400rpx;">
<u-tabs :list="list" :is-scroll="false" :current="current" @change="change" :active-color='mc'></u-tabs>
</view>
<view class="arrow"></view> <view class="arrow"></view>
</view> </view>
<view class="goback" @click="goback" :style="{'padding-top':paddingHTop}">
<u-icon name="arrow-left" size="48" color="#121212"></u-icon>
</view>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth= 'gob'></auth>
</view> </view>
</scroll-view> <auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth= 'goback'></auth>
</view>
</template> </template>
<script> <script>
import hParse from "@/components/u-parse/parse.vue"; import hParse from "@/components/u-parse/parse.vue";
import auth from "@/components/auth/index.vue"; import auth from "@/components/auth/index.vue";
export default { export default {
...@@ -46,15 +32,19 @@ ...@@ -46,15 +32,19 @@
pricecolor:'', pricecolor:'',
secondary:'', secondary:'',
paddingHTop:0, paddingHTop:0,
id:0, list: [{
teacher:{}, name: '学习概况'
}, {
name: '课程缓存'
}],
windowWidth:0, windowWidth:0,
scrollTop:0, scrollTop:0,
headStyle:{}, headStyle:{},
pageTitle:'教师详情', pageTitle:'我的学习',
UserId:0, UserId:0,
u:{}, u:{},
showAuth:false, showAuth:false,
current:0
} }
}, },
components: { components: {
...@@ -62,15 +52,7 @@ ...@@ -62,15 +52,7 @@
auth auth
}, },
onLoad(options) { onLoad(options) {
console.log(options,'options')
if(options && options.ID){
this.id = options.ID
if(uni.getStorageSync("mall_UserInfo")){
this.UserId = uni.getStorageSync("mall_UserInfo").UserId ? uni.getStorageSync("mall_UserInfo").UserId:0
}
}
}, },
created() { created() {
this.mc = this.$uiConfig.mainColor; this.mc = this.$uiConfig.mainColor;
...@@ -80,33 +62,50 @@ ...@@ -80,33 +62,50 @@
this.paddingHTop = this.nav +'px'; this.paddingHTop = this.nav +'px';
this.windowWidth = this.$utils.SystemInfo().windowWidth; this.windowWidth = this.$utils.SystemInfo().windowWidth;
this.headStyle.paddingTop = this.nav +'px'; this.headStyle.paddingTop = this.nav +'px';
let currentPages = getCurrentPages();
let u = "/" + currentPages[currentPages.length - 1].route;
let pages = wx.getStorageSync("basedata")
? wx.getStorageSync("basedata").bar_title
: [];
pages.forEach((x) => {
if (x.value == u) {
this.pageTitle = x.new_name ? x.new_name : x.name;
}
});
uni.setNavigationBarTitle({
title: this.pageTitle,
});
this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) {
this.u = {
nickName: "未登录",
avatarUrl: ""
};
this.showAuth = true;
} else{
// this.init();
}
}, },
methods:{ methods:{
clickDescription(e) {
console.log(e);
},
goback(){ goback(){
uni.navigateBack({}) uni.navigateBack({})
}, },
clickHandler(item) {
uni.navigateTo({ url: "/pages/school/courseInfo?GoodsId=" + item.Id });
},
scrollHandler(e) { scrollHandler(e) {
this.scrollTop = e.detail.scrollTop; this.scrollTop = e.detail.scrollTop;
}, },
scrollTopHandler() { scrollTopHandler() {
this.scrollTop = 0; this.scrollTop = 0;
}, },
reloadUserinfo() { reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo"); this.u = uni.getStorageSync("mall_UserInfo");
}, },
gob(){
this.showAuth = false; change(val){
}, console.log(val)
this.current = val
}
} }
...@@ -114,7 +113,12 @@ ...@@ -114,7 +113,12 @@
</script> </script>
<style> <style>
.mystudy .headStatus { .mystudy {
width: 100%;
height: 100vh;
background: #FAF8F9;
}
.mystudy .headStatus {
overflow: hidden; overflow: hidden;
position: relative; position: relative;
width: 140vw; width: 140vw;
...@@ -128,18 +132,12 @@ ...@@ -128,18 +132,12 @@
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
background: #FFF;
} }
.mystudy .arrow { .mystudy .arrow {
height: 24px; height: 24px;
margin: 5px 10px; margin: 5px;
width: 24px; width: 24px;
} }
.mystudy .goback{
margin-left: 8px;
position: fixed;
top: 0;
left: 0;
}
</style> </style>
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