| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293 |
- <template>
- <view>
- <view class="status_bar"></view>
- <view class="" style="position: relative;top: 44px;">
- <view style="position: fixed;z-index: 100;">
- <uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回" title="四情基地"></uni-nav-bar>
- <u-icon name="plus-circle" class="tianjia" @click="clickRight"></u-icon>
- </view>
- <view class="bases_search">
- <view class="bases_search_text">
- <u-icon name="search" class="search" @click="search"></u-icon>
- <input type="text" v-model="data.search" placeholder="请输入基地名称" @input="searchinput" />
- </view>
- <<<<<<< HEAD
- <view class="bases_list_text">
- <p><span style="margin-right: 30rpx;">{{items.base_name}}</span><span>{{items.base_area}}㎡</span></p>
- <p style="font-size: 24rpx;">联系人:{{items.base_charge}}</p>
- <p style="font-size: 24rpx;">联系电话:{{items.base_phone}}</p>
- <p style="font-size: 24rpx;">地址:{{items.base_name}}</p>
- </view>
- <u-icon name="more-dot-fill" class="bases_list_xiangqing" @click.native.stop="XQclick(items)"></u-icon>
- <view class="photoshow">
- <image src="../../static/image/fourMoodBase/cbd.png" mode=""></image>
- <image src="../../static/image/fourMoodBase/scd.png" mode=""></image>
- <image src="../../static/image/fourMoodBase/qxz.png" mode=""></image>
- <view class="photoshow_num">
- 6+
- =======
- </view>
- <view class="bases">
- <view class="bases_list" v-for="(items,index) in baselist" :key="index" @click="details(items.id)">
- <view class="bases_list_bgi">
- <image :src="items.base_img" mode=""></image>
- <view class="bgcolor">
- </view>
- </view>
- <view class="bases_list_text">
- <p><span style="margin-right: 30rpx;">{{items.base_name}}</span><span>{{items.base_area}}㎡</span></p>
- <p style="font-size: 24rpx;">联系人:{{items.base_charge}}</p>
- <p style="font-size: 24rpx;">联系电话:{{items.base_phone}}</p>
- <p style="font-size: 24rpx;">地址:{{items.base_name}}</p>
- </view>
- <u-icon name="more-dot-fill" class="bases_list_xiangqing" @click.native.stop="XQclick(items)"></u-icon>
- <view class="photoshow">
- <image src="../../static/image/fourMoodBase/测报灯.png" mode=""></image>
- <image src="../../static/image/fourMoodBase/杀虫灯.png" mode=""></image>
- <image src="../../static/image/fourMoodBase/环境监测.png" mode=""></image>
- <view class="photoshow_num">
- {{items.num}}+
- </view>
- >>>>>>> 1c31f0ba3e58f06f275858f2857f9f7f3e3fafc8
- </view>
- </view>
- <u-action-sheet :list="actionSheetList" v-model="post_show" @click="message"></u-action-sheet>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- Debounce,
- Throttle
- } from "../../util/anitthro.js"
- export default {
- data() {
- return {
- data: {
- ret: 'list',
- search: '',
- page_size: 10,
- page: 1
- },
- baselist: [],
- actionSheetList: [{
- text: "编辑基地"
- }, {
- text: "删除基地"
- }],
- post_show: false,
- delid: "",
- facilitynum: ""
- }
- },
- methods: {
- async getFourbase() { //基地列表
- const res = await this.$myRequest({
- url: '/api/api_gateway?method=base.bases.base_list',
- data: this.data
- })
- this.baselist = this.baselist.concat(res.data)
- console.log(this.baselist)
- for(var i=0;i<this.baselist.length;i++){
- var arr = this.baselist[i].base_equip.split("#")
- this.baselist[i].num = arr.length
- }
- },
- async delbase() { //基地列表
- const res = await this.$myRequest({
- url: '/api/api_gateway?method=base.bases.base_list',
- data: {
- ret: "del",
- base_id: this.delid.id
- }
- })
- },
- clickLeft() { //返回主页
- uni.switchTab({
- url: "../index/index"
- })
- },
- clickRight() { //添加基地
- uni.navigateTo({
- url: "./addbase"
- })
- },
- searchinput() { //搜索
- this.data.page = 1
- this.baselist = []
- Debounce(() => {
- this.getFourbase()
- }, 1000)()
- },
- search() { //搜索按钮
- this.data.page = 1
- this.baselist = []
- this.getFourbase()
- this.$forceUpdate()
- },
- details(id) { //详情页
- uni.navigateTo({
- url: "./basefacility?id=" + id
- })
- },
- XQclick(item) { //编辑
- this.post_show = !this.post_show
- this.delid = item
- },
- message(index) { //编辑或者删除
- console.log(index)
- if (index == 1) {
- console.log(this.delid.id)
- uni.showModal({
- title: '提示',
- content: '确定要删除该基地吗?',
- success: (res) => {
- if (res.confirm) {
- this.delbase()
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }
- });
- } else {
- uni.navigateTo({
- url: "./modification?id=" + JSON.stringify(this.delid)
- })
- }
- this.$forceUpdate()
- }
- },
- onLoad() {
- this.getFourbase()
- },
- onReachBottom() { //滑动到底部加载
- this.data.page++
- this.getFourbase()
- },
- onShow() {
- this.$forceUpdate()
- }
- }
- </script>
- <style lang="scss">
- .tianjia {
- position: absolute;
- top: 24rpx;
- right: 24rpx;
- font-size: 38rpx;
- }
- .bases_search {
- width: 100%;
- position: fixed;
- top: 88px;
- z-index: 100;
- background-color: #FFFFFF;
- .bases_search_text {
- width: 90%;
- margin: 0 auto;
- background-color: #F8F8F8;
- height: 60rpx;
- border-radius: 30rpx;
- display: flex;
- line-height: 60rpx;
- .search {
- padding: 0 20rpx;
- font-size: 34rpx;
- }
- input {
- width: 80%;
- margin-top: 10rpx;
- font-size: 28rpx;
- }
- }
- }
- .bases {
- width: 100%;
- position: relative;
- top: 170rpx;
- .bases_list {
- width: 90%;
- margin: 0 auto 20rpx;
- height: 276rpx;
- position: relative;
- .bases_list_bgi {
- .bgcolor {
- width: 100%;
- height: 276rpx;
- background-color: rgba(0, 0, 0, 0.3);
- border-radius: 25rpx;
- }
- image {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 276rpx;
- border-radius: 25rpx;
- z-index: -1;
- }
- }
- .bases_list_text {
- position: absolute;
- top: 0;
- left: 0;
- z-index: 10;
- padding: 40rpx;
- color: #FFFFFF;
- p {
- margin-bottom: 10rpx;
- }
- }
- .bases_list_xiangqing {
- position: absolute;
- top: 20rpx;
- right: 20rpx;
- transform: rotate(90deg);
- font-size: 26rpx;
- color: #FFFFFF;
- }
- .photoshow {
- width: 160rpx;
- height: 34rpx;
- display: flex;
- position: absolute;
- bottom: 26rpx;
- right: 36rpx;
- background-color: #a7a8a0;
- border-radius: 18rpx;
- padding: 4rpx;
- image {
- width: 32rpx;
- height: 32rpx;
- margin-right: 4rpx;
- }
- .photoshow_num {
- width: 50rpx;
- height: 30rpx;
- border: 1px solid #FFFFFF;
- border-radius: 17rpx;
- text-align: center;
- line-height: 28rpx;
- font-size: 24rpx;
- color: #FFFFFF;
- }
- }
- }
- }
- </style>
|