培训文档,文档资料代码优化
This commit is contained in:
62
src/styles/docment.scss
Normal file
62
src/styles/docment.scss
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
@import "@/styles/mixin.scss";
|
||||||
|
.wrap{
|
||||||
|
@include wh(100%,100%);
|
||||||
|
background-color: #F4F5F7;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
.navBar{
|
||||||
|
margin-bottom: 46px;
|
||||||
|
}
|
||||||
|
.rightWrap {
|
||||||
|
@include flexCenter;
|
||||||
|
.img2 {
|
||||||
|
@include wh(17px, 17px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.contentWrap{
|
||||||
|
@include sizingPadding(0,8px);
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 20px;
|
||||||
|
.itemWrap{
|
||||||
|
margin-bottom: 16px;
|
||||||
|
@include wh(100%, 300px);
|
||||||
|
background: #FFFFFF;
|
||||||
|
box-shadow: 0px 2px 10px 0px rgba(216, 216, 216, 0.5);
|
||||||
|
@include sizingPadRadius(6px ,0,3px);
|
||||||
|
@include flexAround;
|
||||||
|
@include fontWeightSize(400, 12px);
|
||||||
|
.flexBetween{
|
||||||
|
@include flexColBet;
|
||||||
|
}
|
||||||
|
.common{
|
||||||
|
margin: 0 15px ;
|
||||||
|
}
|
||||||
|
.imgWrap{
|
||||||
|
@include wh(100%,200px);
|
||||||
|
position: relative;
|
||||||
|
img{
|
||||||
|
@include wh(100%,200px);
|
||||||
|
}
|
||||||
|
.name{
|
||||||
|
position: absolute;
|
||||||
|
left: 30px;
|
||||||
|
bottom: 30px;
|
||||||
|
@include fontWeightSize(bold,14px);
|
||||||
|
color: #FFFFFF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.left{
|
||||||
|
color: red;
|
||||||
|
@include fontWeightSize(bold,15px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
.empty{
|
||||||
|
@include flexTwoCenter;
|
||||||
|
height:calc(100% - 86px);
|
||||||
|
background-color: #FAFAFA;
|
||||||
|
img{
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
@ -31,6 +31,10 @@
|
|||||||
@include flexColumn;
|
@include flexColumn;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
@mixin flexAround(){
|
||||||
|
@include flexColumn;
|
||||||
|
justify-content: space-around;
|
||||||
|
}
|
||||||
@mixin flexColBet(){
|
@mixin flexColBet(){
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
@ -42,4 +46,25 @@
|
|||||||
@mixin flexBetCen{
|
@mixin flexBetCen{
|
||||||
@include flexColBet;
|
@include flexColBet;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
}
|
||||||
|
@mixin flexTwoCenter(){
|
||||||
|
@include flexCenter;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
@mixin colorOpa($col,$alpha){
|
||||||
|
color: $col;
|
||||||
|
opacity: $alpha;
|
||||||
|
}
|
||||||
|
@mixin radiusSizing($rad){
|
||||||
|
border-radius: $rad;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
@mixin sizingPadding($tb,$lr){
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: $tb $lr;
|
||||||
|
}
|
||||||
|
@mixin sizingPadRadius( $tb,$lr,$rad){
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: $tb $lr;
|
||||||
|
border-radius: $rad;
|
||||||
}
|
}
|
@ -34,6 +34,21 @@ export const myMixins = {
|
|||||||
window.android.sendMessage("goBack");
|
window.android.sendMessage("goBack");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
goH5Detail(item){//h5传参到app文档资料,培训文档
|
||||||
|
let data = {
|
||||||
|
"action": "goTraining",
|
||||||
|
"params": {
|
||||||
|
"id": item.id,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
let u = navigator.userAgent;
|
||||||
|
let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
|
||||||
|
if(isiOS){
|
||||||
|
window.webkit.messageHandlers.nativeObject.postMessage(data);
|
||||||
|
}else {
|
||||||
|
window.android.sendMessage("articleId=" + item.id);
|
||||||
|
}
|
||||||
|
},
|
||||||
h5GoBack(){
|
h5GoBack(){
|
||||||
this.$router.back();
|
this.$router.back();
|
||||||
},
|
},
|
||||||
|
@ -50,8 +50,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</van-pull-refresh>
|
</van-pull-refresh>
|
||||||
</div>
|
</div>
|
||||||
<div class="empty" style="display: flex;justify-content: center;align-items: center;height:calc(100% - 86px);background-color: #FAFAFA" v-show="showEmpty">
|
<div class="empty" v-show="showEmpty">
|
||||||
<img src="@/assets/empty.png" style="width: 100%"/>
|
<img src="@/assets/empty.png" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -80,21 +80,6 @@ export default {
|
|||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
goH5Detail(item){
|
|
||||||
let data = {
|
|
||||||
"action": "goTraining",
|
|
||||||
"params": {
|
|
||||||
"id": item.id,
|
|
||||||
}
|
|
||||||
};
|
|
||||||
let u = navigator.userAgent;
|
|
||||||
let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
|
|
||||||
if(isiOS){
|
|
||||||
window.webkit.messageHandlers.nativeObject.postMessage(data);
|
|
||||||
}else {
|
|
||||||
window.android.sendMessage("articleId=" + item.id);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onRefresh() {
|
onRefresh() {
|
||||||
this.getList()
|
this.getList()
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@ -138,28 +123,13 @@ export default {
|
|||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@import "@/styles/common.scss";
|
@import "@/styles/common.scss";
|
||||||
@import "@/styles/mixin.scss";
|
@import "@/styles/mixin.scss";
|
||||||
.wrap{
|
@import "@/styles/docment.scss";
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background-color: #F4F5F7;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
.navBar{
|
|
||||||
margin-bottom: 46px;
|
|
||||||
}
|
|
||||||
.rightWrap {
|
|
||||||
@include flexCenter;
|
|
||||||
.img2 {
|
|
||||||
@include wh(17px, 17px)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.tab_wrap {
|
.tab_wrap {
|
||||||
@include fontWeightSize(bolder, 15px);
|
@include fontWeightSize(bolder, 15px);
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
padding: 5px 0 5px 0;
|
padding: 5px 0 5px 0;
|
||||||
color: #737373;
|
@include colorOpa(#737373,0.7);
|
||||||
opacity: .7;
|
|
||||||
div {
|
div {
|
||||||
padding-top: 8px;
|
padding-top: 8px;
|
||||||
}
|
}
|
||||||
@ -167,12 +137,10 @@ export default {
|
|||||||
color: #3678FF;
|
color: #3678FF;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.active:after {
|
.active:after {
|
||||||
content: '';
|
content: '';
|
||||||
display: block;
|
display: block;
|
||||||
width: 50px;
|
@include wh(50px,3px);
|
||||||
height: 3px;
|
|
||||||
background: linear-gradient(270deg, #33A3FF 0%, #176AFE 100%);
|
background: linear-gradient(270deg, #33A3FF 0%, #176AFE 100%);
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@ -181,53 +149,4 @@ export default {
|
|||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.contentWrap{
|
|
||||||
padding: 0 8px;
|
|
||||||
width: 100%;
|
|
||||||
box-sizing: border-box;
|
|
||||||
|
|
||||||
.itemWrap{
|
|
||||||
margin-top: 16px;
|
|
||||||
@include wh(100%, 300px);
|
|
||||||
background: #FFFFFF;
|
|
||||||
box-shadow: 0px 2px 10px 0px rgba(216, 216, 216, 0.5);
|
|
||||||
border-radius: 3px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
@include flexColumn;
|
|
||||||
justify-content: space-around;
|
|
||||||
padding: 6px 0;
|
|
||||||
@include fontWeightSize(400, 12px);
|
|
||||||
.flexBetween{
|
|
||||||
@include flexColBet;
|
|
||||||
}
|
|
||||||
.common{
|
|
||||||
margin: 0 15px ;
|
|
||||||
}
|
|
||||||
.imgWrap{
|
|
||||||
width: 100%;
|
|
||||||
height: 200px;
|
|
||||||
position: relative;
|
|
||||||
//background-color: #6C81CD;
|
|
||||||
img{
|
|
||||||
width: 100%;
|
|
||||||
height: 200px;
|
|
||||||
}
|
|
||||||
.name{
|
|
||||||
position: absolute;
|
|
||||||
left: 30px;
|
|
||||||
bottom: 30px;
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #FFFFFF;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.left{
|
|
||||||
color: red;
|
|
||||||
font-size: 15px;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
@ -44,8 +44,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</van-pull-refresh>
|
</van-pull-refresh>
|
||||||
</div>
|
</div>
|
||||||
<div class="empty" style="display: flex;justify-content: center;align-items: center;height:calc(100% - 46px);background-color: #FAFAFA" v-show="showEmpty">
|
<div class="empty" v-show="showEmpty">
|
||||||
<img src="@/assets/empty.png" style="width: 100%"/>
|
<img src="@/assets/empty.png" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -67,32 +67,12 @@ export default {
|
|||||||
show:false,
|
show:false,
|
||||||
showEmpty:false,
|
showEmpty:false,
|
||||||
isLoading:false,
|
isLoading:false,
|
||||||
userId:'',
|
|
||||||
supplierId:''
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
const urlParams = new URLSearchParams(window.location.search);
|
|
||||||
this.supplierId = urlParams.get('supplierId');
|
|
||||||
this.userId = urlParams.get('userId');
|
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
goH5Detail(item){
|
|
||||||
let data = {
|
|
||||||
"action": "goTraining",
|
|
||||||
"params": {
|
|
||||||
"id": item.id,
|
|
||||||
}
|
|
||||||
};
|
|
||||||
let u = navigator.userAgent;
|
|
||||||
let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
|
|
||||||
if(isiOS){
|
|
||||||
window.webkit.messageHandlers.nativeObject.postMessage(data);
|
|
||||||
}else {
|
|
||||||
window.android.sendMessage("articleId=" + item.id);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onRefresh() {
|
onRefresh() {
|
||||||
this.getList()
|
this.getList()
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@ -113,81 +93,16 @@ export default {
|
|||||||
}else {
|
}else {
|
||||||
this.showEmpty = false
|
this.showEmpty = false
|
||||||
}
|
}
|
||||||
console.log(res)
|
|
||||||
|
|
||||||
},
|
},
|
||||||
initShow(){
|
initShow(){
|
||||||
this.keyword= '',
|
this.keyword= '',
|
||||||
this.getList()
|
this.getList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@import "@/styles/common.scss";
|
@import "@/styles/common.scss";
|
||||||
@import "@/styles/mixin.scss";
|
@import "@/styles/mixin.scss";
|
||||||
.wrap{
|
@import "@/styles/docment.scss";
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background-color: #F4F5F7;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
.navBar{
|
|
||||||
margin-bottom: 46px;
|
|
||||||
}
|
|
||||||
.rightWrap {
|
|
||||||
@include flexCenter;
|
|
||||||
.img2 {
|
|
||||||
@include wh(17px, 17px)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.contentWrap{
|
|
||||||
padding: 0 8px;
|
|
||||||
width: 100%;
|
|
||||||
box-sizing: border-box;
|
|
||||||
margin-top: 20px;
|
|
||||||
.itemWrap{
|
|
||||||
margin-bottom: 16px;
|
|
||||||
@include wh(100%, 300px);
|
|
||||||
background: #FFFFFF;
|
|
||||||
box-shadow: 0px 2px 10px 0px rgba(216, 216, 216, 0.5);
|
|
||||||
border-radius: 3px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
@include flexColumn;
|
|
||||||
justify-content: space-around;
|
|
||||||
padding: 6px 0;
|
|
||||||
@include fontWeightSize(400, 12px);
|
|
||||||
.flexBetween{
|
|
||||||
@include flexColBet;
|
|
||||||
}
|
|
||||||
.common{
|
|
||||||
margin: 0 15px ;
|
|
||||||
}
|
|
||||||
.imgWrap{
|
|
||||||
width: 100%;
|
|
||||||
height: 200px;
|
|
||||||
position: relative;
|
|
||||||
//background-color: #6C81CD;
|
|
||||||
img{
|
|
||||||
width: 100%;
|
|
||||||
height: 200px;
|
|
||||||
}
|
|
||||||
.name{
|
|
||||||
position: absolute;
|
|
||||||
left: 30px;
|
|
||||||
bottom: 30px;
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #FFFFFF;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.left{
|
|
||||||
color: red;
|
|
||||||
font-size: 15px;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
Reference in New Issue
Block a user