提交 0e8454b2 编写于 作者: 小刘28's avatar 小刘28 💬

style:格式化页面代码;

上级 3174ce1a
...@@ -7,90 +7,90 @@ ...@@ -7,90 +7,90 @@
* @Description: 模板1.基本常用的方案和数据内容 * @Description: 模板1.基本常用的方案和数据内容
--> -->
<template> <template>
<view> <view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
data() { data( ) {
return { return {
/** /**
* @description 是否处于加载操作中 * @description 是否处于加载操作中
**/ **/
isLoading:false, isLoading: false,
/** /**
* @description 是否显示页面内容 * @description 是否显示页面内容
**/ **/
isShowPage:false isShowPage: false
} }
}, },
onLoad(options) { onLoad( options ) {
}, },
onShow() { onShow( ) {
}, },
onPageScroll() { onPageScroll( ) {
}, },
onReachBottom() { onReachBottom( ) {
}, },
onPullDownRefresh(){ onPullDownRefresh( ) {
}, },
onBackPress() { onBackPress( ) {
}, },
methods: { methods: {
// 1.网络请求处理部分 // 1.网络请求处理部分
/** /**
* @description 获取数据的请求 * @description 获取数据的请求
* @date 2022年7月17日08:48:03 * @date 2022年7月17日08:48:03
**/ **/
getData(){ getData( ) {
}, },
/** /**
* @description 发送数据的请求 * @description 发送数据的请求
* @date 2022年7月17日08:48:03 * @date 2022年7月17日08:48:03
**/ **/
sendData(){ sendData( ) {
}, },
// 2.组件事件处理部分 // 2.组件事件处理部分
// 3.数据校验,逻辑判断处理部分 // 3.数据校验,逻辑判断处理部分
// 4.数据处理部分 // 4.数据处理部分
/** /**
* @description 格式化接收的数据 * @description 格式化接收的数据
* @date 2022年7月17日08:48:03 * @date 2022年7月17日08:48:03
* @param {Array} array 待处理数据 * @param {Array} array 待处理数据
* @return {Array} 已处理数据 * @return {Array} 已处理数据
**/ **/
formateReceiveData(object = {}){ formateReceiveData( object = {} ) {
let arr = []; let arr = [ ];
return arr; return arr;
}, },
/** /**
* @description 格式化发送的数据 * @description 格式化发送的数据
* @date 2022年7月17日08:48:03 * @date 2022年7月17日08:48:03
* @param {Array} array 待处理数据 * @param {Array} array 待处理数据
* @return {Array} 已处理数据 * @return {Array} 已处理数据
**/ **/
formateSendData(array = []){ formateSendData( array = [ ] ) {
let arr = []; let arr = [ ];
return arr; return arr;
} }
}
} }
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -8,14 +8,27 @@ ...@@ -8,14 +8,27 @@
--> -->
<template> <template>
<div> <div>
<web-view src="https://www.baidu.com"></web-view> <web-view :src="webSrc"></web-view>
</div> </div>
</template> </template>
<script> <script>
export default {
data(){
return {
webSrc:''
}
},
onLoad( options ) {
this.webSrc = options.src|| 'http://www.baidu.com';
},
methods:{
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
</style> </style>
\ No newline at end of file
...@@ -7,130 +7,130 @@ ...@@ -7,130 +7,130 @@
* @Description: 模板3.基本的列表页效果模板 * @Description: 模板3.基本的列表页效果模板
--> -->
<template> <template>
<view> <view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
data() { data( ) {
return { return {
/** /**
* @description 新闻列表 * @description 新闻列表
**/ **/
newsList:[], newsList: [ ],
/** /**
* @description 新闻列表查询参数 * @description 新闻列表查询参数
**/ **/
newsListQuery:{ newsListQuery: {
page:1, page: 1,
pageSize:10, pageSize: 10,
total:0, total: 0,
searchKey:'' searchKey: ''
},
/**
* @description 是否上拉加载更多
**/
isDownMore:true,
/**
* @description 是否处于加载操作中
**/
isLoading:false,
/**
* @description 是否显示页面内容
**/
isShowPage:false
}
}, },
onLoad(options) { /**
this.isDownMore = false; * @description 是否上拉加载更多
this.getData(); **/
}, isDownMore: true,
onShow() { /**
* @description 是否处于加载操作中
}, **/
onPageScroll() { isLoading: false,
/**
}, * @description 是否显示页面内容
onReachBottom() { **/
this.isDownMore = true; isShowPage: false
if (Math.ceil(this.newsListQuery.total / this.newsListQuery.pageSize) > this.newsListQuery.page) { }
this.newsListQuery.page = this.newsListQuery.page + 1; },
this.getData(); onLoad( options ) {
} else { this.isDownMore = false;
uni.showToast({ this.getData( );
icon: 'none', },
title: "已全部加载" onShow( ) {
});
}
}, },
onPullDownRefresh(){ onPageScroll( ) {
this.isDownMore = false;
this.newsListQuery.page = 1; },
}, onReachBottom( ) {
onBackPress() { this.isDownMore = true;
if ( Math.ceil( this.newsListQuery.total / this.newsListQuery.pageSize ) > this.newsListQuery.page ) {
}, this.newsListQuery.page = this.newsListQuery.page + 1;
methods: { this.getData( );
// 1.网络请求处理部分 } else {
uni.showToast( {
/** icon: 'none',
* @description 获取数据的请求 title: "已全部加载"
* @date 2022年7月17日08:48:03 } );
**/ }
getData(){
let data = { },
page:this.newsListQuery.page, onPullDownRefresh( ) {
searchKey:this.newsListQuery.searchKey this.isDownMore = false;
}; this.newsListQuery.page = 1;
},
if(this.isDownMore){ onBackPress( ) {
this.newsList = this.newsList.concat(this.formateReceiveData([]));
// this.newsListQuery.total = 100; },
}else{ methods: {
this.newsList = this.formateReceiveData([]); // 1.网络请求处理部分
this.newsListQuery.total = 100;
} /**
}, * @description 获取数据的请求
/** * @date 2022年7月17日08:48:03
* @description 发送数据的请求 **/
* @date 2022年7月17日08:48:03 getData( ) {
**/ let data = {
sendData(){ page: this.newsListQuery.page,
searchKey: this.newsListQuery.searchKey
}, };
// 2.组件事件处理部分 if ( this.isDownMore ) {
this.newsList = this.newsList.concat( this.formateReceiveData( [ ] ) );
// this.newsListQuery.total = 100;
// 3.数据校验,逻辑判断处理部分 } else {
this.newsList = this.formateReceiveData( [ ] );
this.newsListQuery.total = 100;
// 4.数据处理部分
/**
* @description 格式化接收的数据
* @date 2022年7月17日08:48:03
* @param {Array} array 待处理数据
* @return {Array} 已处理数据
**/
formateReceiveData(object = {}){
let arr = [];
return arr;
},
/**
* @description 格式化发送的数据
* @date 2022年7月17日08:48:03
* @param {Array} array 待处理数据
* @return {Array} 已处理数据
**/
formateSendData(array = []){
let arr = [];
return arr;
}
} }
},
/**
* @description 发送数据的请求
* @date 2022年7月17日08:48:03
**/
sendData( ) {
},
// 2.组件事件处理部分
// 3.数据校验,逻辑判断处理部分
// 4.数据处理部分
/**
* @description 格式化接收的数据
* @date 2022年7月17日08:48:03
* @param {Array} array 待处理数据
* @return {Array} 已处理数据
**/
formateReceiveData( object = {} ) {
let arr = [ ];
return arr;
},
/**
* @description 格式化发送的数据
* @date 2022年7月17日08:48:03
* @param {Array} array 待处理数据
* @return {Array} 已处理数据
**/
formateSendData( array = [ ] ) {
let arr = [ ];
return arr;
}
} }
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -15,9 +15,21 @@ ...@@ -15,9 +15,21 @@
</template> </template>
<script> <script>
export default {
data(){
return {
}
},
onLoad( options ) {
},
methods:{
}
}
</script> </script>
<style> <style>
</style> </style>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册