123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- <template>
- <view>
- <view>
- <u-navbar
- :title="title"
- title-color="#fff"
- :custom-back="customBack"
- :border-bottom="false"
- back-icon-color="#CCE8FF"
- :background="{background: 'linear-gradient(99deg, #7A4398 0%, #5A5DB9 100%)' }"></u-navbar>
- </view>
- <mescroll-uni ref="mescrollRef" @init="mescrollInit" :top="config.platform=='h5'?100:180" @down="downCallback" :up="upOption" @up="upCallback" @emptyclick="emptyClick">
- <view class="device-list u-flex u-flex-wrap u-row-start">
- <view class="device-item"
- @click="goListPage(item)"
- v-for="item in dataList" :key="item.roadNo"
- >
- <u-icon name="star-fill" color="#0082FF" size="45"></u-icon>
-
- {{item.deviceName}}
- <view class="txt u-line-1">{{item.roadName}}</view>
- </view>
- </view>
- </mescroll-uni>
- </view>
- </template>
- <script>
- import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
- export default{
- mixins: [MescrollMixin],
- data(){
- return{
- title:"选择路段",
- deviceTypeId:'',
- dataList:[],
- upOption:{
-
-
-
-
-
- noMoreSize: 4,
- empty:{
- tip: '~ 暂无数据 ~',
-
- }
- },
- }
- },
- onLoad(page){
-
- this.deviceType = page.param;
- },
- onShow(){
-
- },
- methods:{
-
- upCallback(page) {
-
-
-
- let type = '';
- if(this.deviceType==1){
- type=1
- }else if(this.deviceType==2){
- type=1
- }else if(this.deviceType==3){
- type=2
- }
- let params ={
- type:type,
- pageNum:page.num,
- pageSize:page.size
- }
- this.$u.api.getRoadAllList(params).then(curPageData=>{
- console.log('curPageData',curPageData)
-
-
- this.mescroll.endBySize(curPageData.data.length, curPageData.data.length);
-
- if(page.num == 1) this.dataList = [];
- this.dataList=this.dataList.concat(curPageData.data);
- if(this.dataList.length>=1){
-
- }
- }).catch((err)=>{
- uni.showToast({
- title:'链接失败'
- });
- console.log('err',err)
-
- this.mescroll.endErr();
- })
- },
-
- emptyClick(){
-
- },
- customBack(){
- uni.reLaunch({
- url: '/pages/index/index'
- });
- },
- goListPage(roadItem) {
- console.log('this.deviceType',this.deviceType)
- console.log('roadItem',roadItem)
- let path = '';
- if(this.deviceType==1){
- path = 'pages/deviceList/deviceListType1/deviceListType1'
- }else if(this.deviceType==2){
- path = 'pages/deviceList/deviceListType2/deviceListType2'
- }else if(this.deviceType==3){
- path = 'pages/deviceList/deviceListType3/deviceListType3'
- }
- this.$u.route({
- url: path,
- params:{
- roadNo:roadItem.roadNo,
- roadName:roadItem.roadName,
- deviceType:this.deviceType
- }
- })
- },
- openPage(path,param) {
- this.$u.route({
- url: path,
- params:{
- param:param,
- deviceTypeId:this.deviceTypeId
- }
- })
- },
-
- }
- }
- </script>
- <style lang="scss" scoped>
- page{background-color: #fff;}
- // @import './deviceList.scss'
- .device-list{
- margin: 24rpx 0;
- .device-item{
- background-color: #F1F8FF;
- border-radius: 10rpx;
- box-sizing: border-box;
- padding: 20rpx 10rpx;
- text-align: center;
- width: 45%;
- margin: 0 0 24rpx 3.3%;
- .img{
- width: 57rpx;
- height: 55rpx;
- margin-bottom: 10rpx;
- }
- .device-name{
- font-size: 24rpx;
- color: #606266;
- margin-bottom: 5rpx;
- }
- .text{
- font-size: 28rpx;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #474747;
- line-height: 40rpx;
- letter-spacing: 1px;
- }
- }
- }
- </style>
|