123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- <template>
- <view class="car">
- <view class="cartop">
- <!-- <view class="toptit">
- <image :src="djtop"></image>本社区党员共<text>367</text>人
- </view> -->
- <view class="tabtop flexc">
- <view class="tabt" :class="ttopval==ite.val?'act':''" v-for="(ite,idx) in ttoplist" :key="idx" @click="getTabtop(ite.val)">{{ite.tit}}</view>
- </view>
- </view>
- <!-- 列表 -->
- <view class="carlists">
- <box-list :datainfo="list" :topval="ttopval" :wtdt="wtdt" type='delivery' @getDetail="getDetail"></box-list>
- </view>
- <loading></loading>
- </view>
- </template>
- <script>
- import config from '@/config'
- const baseUrl = config.baseUrl
- import boxList from "@/mine/components/box/list.vue"
- import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
- export default{
- components:{boxList},
- data(){
- return{
- cxrq:"",
- text:'',
- list:[{tit:'皖A IC520',type:1,right:0},{tit:'晋E KD783',type:2,right:0},],
- pageSize: 10,
- pageNum: 1,
- reachflag: true,
- wtdt:'',
- ttopval:'0',
- ttoplist:[{tit:'在途快递',val:0},{tit:'最近签收',val:1}]
- }
- },
- onLoad: function() {
-
- },
- // 上拉触底加载更多触发事件
- onReachBottom() {
- if (this.reachflag) {
- this.pageNum++
- this.getDataFn()
- }
- },
- methods:{
- checkPermi, checkRole,
- getDetail(){
- this.$tab.navigateTo("/mine/pages/delivery/detail")
- },
- getTabtop(val){
- this.ttopval=val
- },
- getrefreshData(){
- this.pageNum=1;
- this.list=[];
- this.reachflag=true;
- this.getDataFn()
- },
- getTabFn(val){
- this.tabval=val
- },
- bindDateChangea(e){
- var val=e.detail.value;
- this.cxrq=val;
- },
- getDataFn(){
- var params={
- pageSize:this.pageSize,
- pageNum: this.pageNum,
- }
- params.noticeType=this.tabidx
- getNoticeList(params).then(res=>{
- if(res.code==200){
- if (res.rows.length < this.pageSize) {
- this.reachflag = false
- this.wtdt = '到底了~';
- } else {
- var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
- if (num < res.total) {
- this.reachflag = true
- this.wtdt = ''
- } else {
- this.reachflag = false
- this.wtdt = '到底了~';
- }
- }
- var newArr=JSON.parse(JSON.stringify(res.rows))
- newArr.forEach(ite=>{
- ite.right=0;
- })
- // console.log(newArr,555)
- if (this.pageNum == 1) {
- this.list = newArr;
- } else {
- this.list = this.list.concat(newArr)
- }
- }else{
- this.$toast(res.msg)
- }
- })
-
- },
- }
- }
- </script>
- <style>
- page{background: #F3F3F0;}
- </style>
- <style lang="scss" scoped>
- .car{padding: 134rpx 0 10rpx;}
- .cartop{position: fixed;left: 0;right: 0;top: 0;background-color: #ffffff;z-index: 2;
- .toptit{display: flex;justify-content: center;font-weight: 500;font-size: 26rpx;color: #8592AA;height: 70rpx;align-items: center;
- background: #E4EDFF;
- text{font-size: 32rpx;color: #0156FE;padding: 0 10rpx;}
- image{width: 28rpx;height: 26rpx;flex: 0 0 auto;margin-right: 12rpx;}
- }
- .tabtop{padding-bottom: 40rpx;padding-top: 14rpx;
- .tabt{font-weight: 500;font-size: 32rpx;color: #666666;position: relative;line-height: 56rpx;padding: 0 40rpx;
- &.act{font-weight: bold;font-size: 32rpx;color: #272727;
- &::after{content: '';width: 40rpx;height: 10rpx;background: #0156FE;border-radius: 6rpx;position: absolute;left: 50%;margin-left: -20rpx;bottom: -10rpx;}
- }
- }
- }
- }
- .carlists{padding: 0 18rpx;}
- </style>
|