| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- <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" title="查看图片"></uni-nav-bar>
- </view>
- <p class="tishi" v-if="tishi">暂无数据</p>
- <view class="imglist">
- <view class="imglist_box" v-for="(item,index) in imglists" :key="index">
- <view class="imglist_left">
- <image src="../../../../static/image/cb/jiazai.ui.gif" mode=""></image>
- <image :src="item.addr" mode=""></image>
- </view>
- <view class="imglist_right">
- <view class="icon_box" @click="delimg(item.id)">
- <p class="iconfont icon-shanchu">删除</p>
- </view>
- <view class="icon_box" @click="shibie(item.id)">
- <p class="iconfont icon-shibie">识别</p>
- </view>
- <view class="icon_box" @click="tongji(item.id)">
- <p class="iconfont icon-tongji2">手动统计</p>
- </view>
- <view class="icon_box" @click="add(item.id)">
- <p class="iconfont icon-iconzhengli_shouxieqianpi">手动添加</p>
- </view>
- <p style="color: #06B535;">{{item.addtime|timeFormat()}}</p>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- page: 1,
- imglists: [],
- tishi: true
- }
- },
- methods: {
- //forecast.forecast_system.equip_photofo
- async imglistdata() { //获取图片列表
- const res = await this.$myRequest({
- url: '/api/api_gateway?method=forecast.forecast_system.equip_photo',
- data: {
- device_id: this.device_id,
- page: this.page,
- ret: "list"
- }
- })
- this.imglists = this.imglists.concat(res.data)
- console.log(this.imglists)
- if (this.imglists.length == 0) {
- this.tishi = true
- } else {
- this.tishi = false
- }
- },
- //forecast.forecast_system.equip_photo_del
- async del(id) { //删除图片
- const res = await this.$myRequest({
- url: '/api/api_gateway?method=forecast.forecast_system.equip_photo_del',
- data: {
- device_id: this.device_id,
- addrlist: id
- }
- })
- },
- //forecast.forecast_system.equip_photo_discern识别
- async discern(id) { //识别图片
- const res = await this.$myRequest({
- url: '/api/api_gateway?method=forecast.forecast_system.equip_photo_discern',
- data: {
- img_id: id,
- ret: "see"
- }
- })
- },
- //forecast.forecast_system.equip_photo_species pest_list
- //forecast.forecast_system.equip_photo_species统计
- async species(id) { //统计
- const res = await this.$myRequest({
- url: '/api/api_gateway?method=forecast.forecast_system.equip_photo_species',
- data: {
- ret: "photo_desc",
- img_id: id
- }
- })
- },
- clickLeft() {
- uni.navigateBack({
- delta: 1
- })
- },
- delimg(id) { //删除图片
- uni.showModal({
- title: '提示',
- content: '是否删除此图片?',
- success: function(res) {
- if (res.confirm) {
- // this.del(id)
- console.log('用户点击确定');
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }
- });
- },
- shibie(id) { //识别
- this.discern(id)
- },
- tongji(id) { //统计
- this.species(id)
- },
- add(id) {
- uni.navigateTo({
- url: "./addimg?id=" + id + "&device_id" + this.device_id
- })
- }
- },
- onLoad(option) {
- console.log(option)
- this.device_id = option.device_id
- this.imglistdata()
- },
- onReachBottom() {
- this.page++
- this.imglistdata()
- }
- }
- </script>
- <style lang="scss">
- .tishi {
- position: absolute;
- top: 84px;
- width: 95%;
- left: 2.5%;
- text-align: center;
- font-size: 40rpx;
- }
- .imglist {
- position: absolute;
- top: 54px;
- width: 95%;
- left: 2.5%;
- .imglist_box {
- display: flex;
- box-shadow: 0 0 10rpx #bcb9ca;
- padding: 20rpx;
- margin-bottom: 20rpx;
- }
- .imglist_left {
- width: 50%;
- position: relative;
- image {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 280rpx;
- }
- }
- .imglist_right {
- margin-left: 40rpx;
- padding: 10rpx 0;
- .icon_box{
- margin-bottom: 12rpx;
- font-size: 24rpx;
- .iconfont {
- margin-right: 20rpx;
- color: #56C877;
- font-size: 32rpx;
- }
- }
- p:last-child {
- margin-bottom: 0;
- }
- }
- }
- </style>
|