123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- <template>
- <view class="content">
- <mescroll-body top="0rpx" bottom="0" ref="mescrollRef" @init="mescrollInit" :down="downOption" :up="upOption" @down="downCallback" @up="upCallback">
- <view class="sop-list">
- <view class="sop-item" v-for="(item) in dataList" @click.stop="navTo('/pages/user/qwSop/sopLosList?sopId='+item.id)" >
- <view class="name-box">
- <view class="name">{{item.name}}</view>
- </view>
- <view class="desc-box">
- <view class="label">创建时间:</view>
- <view class="value">{{item.createTime}}</view>
- </view>
- </view>
- </view>
- </mescroll-body>
- </view>
- </template>
- <script>
- import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
-
- import {getQwSopList} from '@/api/qw.js'
- export default {
- mixins: [MescrollMixin], // 使用mixin
- data() {
- return {
- mescroll:null,
- downOption: {
- auto:false//不要自动加载
- },
- upOption: {
- onScroll:false,
- use: true, // 是否启用上拉加载; 默认true
- page: {
- num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
- size: 10 // 每页数据的数量,默认10
- },
- noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
- textNoMore:"已经到底了",
- empty: {
- icon:'/static/images/empty.png',
- tip: '暂无数据'
- }
- },
- dataList: []
- }
- },
- onShow() {
- },
- methods: {
- mescrollInit(mescroll) {
- this.mescroll = mescroll;
- },
- /*下拉刷新的回调 */
- downCallback(mescroll) {
- mescroll.resetUpScroll()
- },
- upCallback(page) {
- //联网加载数据
- var that = this;
- var data={
- pageNum: page.num,
- pageSize: page.size
- };
- uni.showLoading({
- title:"加载中..."
- })
- getQwSopList(data).then(res => {
- uni.hideLoading()
- if(res.code==200){
- //设置列表数据
- if (page.num == 1) {
- that.dataList = res.data.list;
-
- } else {
- that.dataList = that.dataList.concat(res.data.list);
-
- }
- that.mescroll.endBySize(res.data.list.length, res.data.total);
-
- }else{
- uni.showToast({
- icon:'none',
- title: "请求失败",
- });
- that.dataList = null;
- that.mescroll.endErr();
- }
- });
- },
- navTo(url){
- uni.navigateTo({
- url: url
- })
- }
- }
- }
- </script>
- <style lang="scss">
- page{
-
- height: 100%;
- background: #f6f6f6;
- }
- </style>
- <style scoped lang="scss">
- .content{
- height: 100%;
- padding: 0rpx;
- .tabs{
- z-index: 10000;
- position: absolute;
- top:0rpx;
- left:0rpx;
- height: 88rpx;
- background-color: #fff;
- width: 100%;
- }
- .sop-list{
- display: flex;
- flex-direction: column;
- padding: 15rpx;
- .sop-item{
- padding: 15rpx;
- border-radius: 15rpx;
- background-color: #fff;
- margin-bottom: 15rpx;
- width: 100%;
- .name-box{
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: flex-start;
- .name{
- flex: 1;
- font-size: 32rpx;
- color:#111;
- }
- .btns{
- .btn{
- margin-left: 10rpx;
- width: 40rpx;
- height:40rpx;
- }
- }
- }
- .desc-box{
- margin-top: 15rpx;
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: flex-start;
- .label{
- font-size: 28rpx;
- color: #a8a8a8;
- }
- .value{
- font-size: 28rpx;
- color: #a8a8a8;
- }
-
-
- }
- }
- }
- }
- </style>
|