123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- <template>
- <view class="site-wrapper">
- <!-- 筛选框start -->
- <view style="height:100rpx"></view>
- <view class="ding">
- <view class="cu-bar search bg-gray filter-section">
- <view class="search-form round bg-white">
- <text class="cuIcon-search"></text>
- <input class="" @focus="InputFocus" v-model="siteName" @blur="InputBlur" :adjust-position="false"
- type="text" placeholder="请输入站点" confirm-type="search"></input>
- </view>
- <view class="action">
- <button class="cu-btn bg-blue round" @click="searchData()">查询</button>
- </view>
- </view>
- </view>
- <!-- 筛选框end -->
- <view style="height: calc(100vh - 290rpx);overflow:scroll">
- <view class="cu-list menu-avatar">
- <view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''"
- v-for="(item,index) in siteArchiveData" :key="index" :data-target="'move-box-' + index"
- @tap="goArchiveDetail(item.id)" @touchstart="ListTouchStart" @touchmove="ListTouchMove"
- @touchend="ListTouchEnd">
- <view class="cu-avatar round lg" style="background-image:url(../../../static/archiveIcon.png)">
- </view>
- <view class="content">
- <view class="pro-title">
- <view class="cut">{{item.site_name}} (现场档案)</view>
- </view>
- </view>
- <view class="nav-right num">
- <view class="text-grey">
- <text class="icon iconfont margin-right-sm margin-left-lg"></text>
- </view>
- </view>
- <view class="move" style="width: 66px;">
- <view class="bg-grey" @click.stop="editItem(item)">编辑</view>
- </view>
- </view>
- </view>
- </view>
- <!-- 新增按钮start -->
- <view class="plus">
- <image src="../../static/plus.png" style="width:100rpx;height:100rpx" @tap="goAddPage()"></image>
- </view>
- <!-- 新增按钮end -->
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- modalName: null,
- siteArchiveData: [],
- siteName: ''
- };
- },
- onLoad: function(option) {
- this.getDataList();
- },
- methods: {
- searchData() {
- this.getDataList({
- "site_name": this.siteName,
- })
- },
- InputFocus(e) {
- this.InputBottom = e.detail.height
- },
- InputBlur(e) {
- this.InputBottom = 0
- },
- //编辑
- editItem(item) {
- uni.navigateTo({
- url: '/pages/siteArchive/siteArchiveAdd/siteArchiveAdd?id=' + item.id + '',
- });
- },
- //数据请求
- async getDataList(params = {}) {
- const res = await this.$myRequest({
- url: 'Archives/getArchivesList',
- showLoading: true,
- data: params
- })
- console.log('res.data.data')
- console.log(res.data.data)
- this.siteArchiveData = res.data.data
- },
- // 页面跳转
- goArchiveDetail(id) {
- uni.navigateTo({
- url: '/pages/siteArchive/archiveDetail/archiveDetail?id=' + id,
- });
- },
- goAddPage(item) {
- uni.navigateTo({
- url: '/pages/siteArchive/siteArchiveAdd/siteArchiveAdd',
- });
- },
- // ListTouch触摸开始
- ListTouchStart(e) {
- this.listTouchStart = e.touches[0].pageX
- },
- // ListTouch计算方向
- ListTouchMove(e) {
- this.listTouchDirection = e.touches[0].pageX - this.listTouchStart < -80 ? 'left' : 'right'
- },
- // ListTouch计算滚动
- ListTouchEnd(e) {
- if (this.listTouchDirection == 'left') {
- this.modalName = e.currentTarget.dataset.target
- } else {
- this.modalName = null
- }
- this.listTouchDirection = null
- }
- }
- }
- </script>
- <style lang="scss">
- .cu-item {
- height: 160rpx !important
- }
- .cu-list.menu-avatar>.cu-item .content {
- left: 110rpx;
- }
- .cu-list>.cu-item.move-cur {
- -webkit-transform: translateX(-66px);
- }
- </style>
|