Browse Source

新增农业云H5“通知公告”、“监测信息”、“政策法规”功能

张启 4 năm trước cách đây
mục cha
commit
98372b5345

+ 10 - 0
agrcloud-api/meteorological.js

@@ -0,0 +1,10 @@
+import request from '@/agrcloud-utils/request';
+
+// 列表数据
+export function meteorologicalListData(query) {
+  return request({
+    url: '',
+    method: 'GET',
+    data: query
+  });
+}

+ 19 - 0
agrcloud-api/monitoring.js

@@ -0,0 +1,19 @@
+import request from '@/agrcloud-utils/request';
+
+// 监测信息之列表数据
+export function monitoringListData(query) {
+  return request({
+    url: '/sec/article/door/list',
+    method: 'GET',
+    data: query
+  });
+}
+
+// 监测信息之详情数据
+export function monitoringViewData(query) {
+  return request({
+    url: '/sec/article/door/info',
+    method: 'GET',
+    data: query
+  });
+}

+ 19 - 0
agrcloud-api/notice.js

@@ -0,0 +1,19 @@
+import request from '@/agrcloud-utils/request';
+
+// 通知公告之列表数据
+export function noticeListData(query) {
+  return request({
+    url: '/sec/article/door/list',
+    method: 'GET',
+    data: query
+  });
+}
+
+// 通知公告之详情数据
+export function noticeViewData(query) {
+  return request({
+    url: '/sec/article/door/info',
+    method: 'GET',
+    data: query
+  });
+}

+ 40 - 0
agrcloud-store/modules/expertsdetails.js

@@ -0,0 +1,40 @@
+/**
+ * 封装历史投诉列表项数据缓存
+ * @author Rockery(1113269755@qq.com)
+ */
+
+const expertsDetails = {
+  state: {
+    itemData: {}
+  },
+
+  mutations: {
+    SET_ITEMDATA: (state, itemData) => {
+      state.itemData = itemData;
+    },
+    CLEAR_ITEMDATA: (state, itemData) => {
+      state.itemData = itemData;
+    }
+  },
+
+  actions: {
+    SetExpertsDetails({ commit }, itemData) {
+      return new Promise((resolve, reject) => {
+        if (itemData) {
+          commit('SET_ITEMDATA', itemData);
+          resolve();
+        } else {
+          reject('error');
+        }
+      });
+    },
+    ClearExpertsDetails({ commit }) {
+      return new Promise(resolve => {
+        commit('CLEAR_ITEMDATA', {});
+        resolve()
+      });
+    }
+  }
+}
+
+export default expertsDetails

+ 40 - 0
agrcloud-store/modules/monitoringdetails.js

@@ -0,0 +1,40 @@
+/**
+ * 封装历史投诉列表项数据缓存
+ * @author Rockery(1113269755@qq.com)
+ */
+
+const monitoringDetails = {
+  state: {
+    itemData: {}
+  },
+
+  mutations: {
+    SET_ITEMDATA: (state, itemData) => {
+      state.itemData = itemData;
+    },
+    CLEAR_ITEMDATA: (state, itemData) => {
+      state.itemData = itemData;
+    }
+  },
+
+  actions: {
+    SetMonitoringDetails({ commit }, itemData) {
+      return new Promise((resolve, reject) => {
+        if (itemData) {
+          commit('SET_ITEMDATA', itemData);
+          resolve();
+        } else {
+          reject('error');
+        }
+      });
+    },
+    ClearMonitoringDetails({ commit }) {
+      return new Promise(resolve => {
+        commit('CLEAR_ITEMDATA', {});
+        resolve()
+      });
+    }
+  }
+}
+
+export default monitoringDetails

+ 40 - 0
agrcloud-store/modules/noticedetails.js

@@ -0,0 +1,40 @@
+/**
+ * 封装历史投诉列表项数据缓存
+ * @author Rockery(1113269755@qq.com)
+ */
+
+const noticeDetails = {
+  state: {
+    itemData: {}
+  },
+
+  mutations: {
+    SET_ITEMDATA: (state, itemData) => {
+      state.itemData = itemData;
+    },
+    CLEAR_ITEMDATA: (state, itemData) => {
+      state.itemData = itemData;
+    }
+  },
+
+  actions: {
+    SetNoticeDetails({ commit }, itemData) {
+      return new Promise((resolve, reject) => {
+        if (itemData) {
+          commit('SET_ITEMDATA', itemData);
+          resolve();
+        } else {
+          reject('error');
+        }
+      });
+    },
+    ClearNoticeDetails({ commit }) {
+      return new Promise(resolve => {
+        commit('CLEAR_ITEMDATA', {});
+        resolve()
+      });
+    }
+  }
+}
+
+export default noticeDetails

+ 171 - 0
pages/index/index-bak.vue

@@ -0,0 +1,171 @@
+<template>
+  <view>
+    <uni-page-head class="cust-uni-page-head">
+      <view class="cust-agrcloud-uni-page-head uni-page-head">
+        <view class="uni-page-head-hd cust-agrcloud-uni-page-head-hd">
+          <view class="uni-page-head-btn">
+            <image class="uni-btn-icon cust-head-icon"
+              src="@/static/agrcloud-images/agrcloud-head-dir-img.png"></image>
+          </view>
+        </view>
+        <view class="uni-page-head-bd">
+          <view class="uni-page-head__title"
+            style="font-size: 16px; opacity: 1;">修文农业云公共服务系统
+          </view>
+        </view>
+      </view>
+    </uni-page-head>
+
+    <view class="page-content">
+      <view class="title">
+        <image class="weather-densefog"
+          src="@/static/agrcloud-images/agrcloud-weather-densefog-img.png"></image>
+        <u-notice-bar class="title-content"
+          mode="horizontal"
+          type="none"
+          :volume-icon="true"
+          :more-icon="true"
+          :is-circular="true"
+          :list="titleContentList"></u-notice-bar>
+      </view>
+      <view class="main-content">
+        <u-waterfall v-model="flowList">
+          <template v-slot:left="{leftList}">
+            <view class="main-warter"
+              v-for="item in leftList"
+              :key="item.id"
+              @click="handleWarterClick(item)">
+              <view class="water-title">
+                {{item.title}}
+              </view>
+            </view>
+          </template>
+          <template v-slot:right="{rightList}">
+            <view class="main-warter"
+              v-for="item in rightList"
+              :key="item.id"
+              @click="handleWarterClick(item)">
+              <view class="water-title">
+                {{item.title}}
+              </view>
+            </view>
+          </template>
+        </u-waterfall>
+      </view>
+      <view id="custcontainer">
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+  import mapinfo from '@/agrcloud-utils/mapinfo';
+
+  export default {
+    data() {
+      return {
+        title: 'Hello',
+        titleContentList: ['气象预警:修文县气象台2020年x月x日x时x分发布大雾'],
+        mainNavigateToObj: {
+          QualitySafetyComplaints: '/pages/complaints/index',
+          MeteorologicalServices: '',
+          PoliciesRegulations: '/pages/regulations/index',
+          AgriculturalTechnologyExpert: '/pages/experts/index',
+          NoticeAnnouncement: '/pages/notice/index',
+          MonitoringInformation: '/pages/monitoring/index'
+        },
+        flowList: [{
+          id: 'QualitySafetyComplaints',
+          title: '质量安全投诉',
+          image: 'http://pic.sc.chinaz.com/Files/pic/pic9/202002/zzpic23327_s.jpg',
+        }, {
+          id: 'MeteorologicalServices',
+          title: '气象服务',
+          image: 'http://pic.sc.chinaz.com/Files/pic/pic9/202002/zzpic23327_s.jpg',
+        }, {
+          id: 'AgriculturalTechnologyExpert',
+          title: '农技专家',
+          image: 'http://pic.sc.chinaz.com/Files/pic/pic9/202002/zzpic23327_s.jpg',
+        }, {
+          id: 'PoliciesRegulations',
+          title: '政策法规',
+          image: 'http://pic.sc.chinaz.com/Files/pic/pic9/202002/zzpic23327_s.jpg',
+        }, {
+          id: 'NoticeAnnouncement',
+          title: '通知公告',
+          image: 'http://pic.sc.chinaz.com/Files/pic/pic9/202002/zzpic23327_s.jpg',
+        }, {
+          id: 'MonitoringInformation',
+          title: '监测信息',
+          image: 'http://pic.sc.chinaz.com/Files/pic/pic9/202002/zzpic23327_s.jpg',
+        }]
+      };
+    },
+    onLoad() {
+      // #ifdef H5
+      mapinfo().then((res) => {
+        debugger
+      });
+      // #endif
+    },
+    methods: {
+      handleWarterClick(itemData) {
+        if (!itemData.id || !this.mainNavigateToObj[itemData.id]) {
+          this.$msgbox('模块建设中...');
+          return;
+        }
+        uni.navigateTo({
+          url: this.mainNavigateToObj[itemData.id]
+        });
+      }
+    }
+  };
+</script>
+
+<style lang="scss"
+  scoped>
+  .page-content {
+    .title {
+      width: 100%;
+
+      .title-logo {
+        padding-top: 9rpx;
+        height: 52rpx;
+        width: 30rpx;
+        float: left;
+      }
+
+      .weather-densefog {
+        padding-top: 6rpx;
+        float: left;
+        width: 36rpx;
+        height: 36rpx;
+      }
+
+      .title-content {
+        width: calc(100% - 36rpx);
+      }
+    }
+
+    .main-content {
+      padding-top: 20rpx;
+      width: 100%;
+
+      .main-warter {
+        width: 100%;
+
+        .water-title {
+          margin: 20rpx;
+          height: 300rpx;
+          border-radius: 20rpx;
+          border: 1rpx solid #c6c6c6;
+          display: flex;
+          flex-direction: column;
+          align-items: center;
+          justify-content: center;
+          cursor: pointer;
+        }
+      }
+    }
+  }
+</style>

+ 180 - 0
pages/monitoring/details/index.vue

@@ -0,0 +1,180 @@
+<template>
+  <view class="page-content regulationsdetails">
+    <view class="regulationsdetails-content">
+      <view class="regulationsdetails-item regulationsdetails-arttitle">
+        <view class="item-content">
+          <view class="item-text">
+            <view class="item-textlable">
+              <text class="item-lable">标题:</text>
+            </view>
+            <view class="item-textvalue">
+              <text class="item-value">{{ regulationsDetailsObj.artTitle }}</text>
+            </view>
+          </view>
+        </view>
+      </view>
+      <view class="regulationsdetails-item regulationsdetails-artauthor">
+        <view class="item-content">
+          <view class="item-text">
+            <view class="item-textlable">
+              <text class="item-lable">作者:</text>
+            </view>
+            <view class="item-textvalue">
+              <text class="item-value">{{ regulationsDetailsObj.artAuthor }}</text>
+            </view>
+          </view>
+        </view>
+      </view>
+      <view class="regulationsdetails-item regulationsdetails-artsummary">
+        <view class="item-content">
+          <view class="item-text">
+            <view class="item-textlable">
+              <text class="item-lable">简介:</text>
+            </view>
+            <view class="item-textvalue">
+              <text class="item-value">{{ regulationsDetailsObj.artSummary }}</text>
+            </view>
+          </view>
+        </view>
+      </view>
+      <view class="regulationsdetails-artcontent">
+        <view class="artcontent-text">
+          <view class="artcontent-textlable">
+            <text class="artcontent-lable">内容:</text>
+          </view>
+          <view class="artcontent-textvalue">
+            <view class="u-content">
+              <u-parse
+                :html="regulationsDetailsObj.artContent"
+                :selectable="false"
+                :show-with-animation="true"
+              ></u-parse>
+            </view>
+          </view>
+        </view>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+import { regulationsViewData } from '@/agrcloud-api/regulations';
+
+export default {
+  name: 'regulationsDetails',
+  data() {
+    return {
+      regulationsDetailsObj: {
+        artTitle: '',
+        artAuthor: '',
+        artSummary: '',
+        artContent: ''
+      }
+    };
+  },
+  onLoad() {
+    this.initData();
+  },
+  methods: {
+    /** 初始化数据 */
+    initData() {
+      const currRegulationDetailsItem = (this.$store.getters || {}).regulationsDetailsObj || {};
+      regulationsViewData({
+        id: currRegulationDetailsItem.artId
+      }).then(res => {
+        this.regulationsDetailsObj = res.data || {};
+      }).catch(() => {
+        this.regulationsDetailsObj = {};
+      });
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.regulationsdetails {
+  padding: 0;
+
+  .regulationsdetails-content {
+    width: 100%;
+    padding-top: 24rpx;
+
+    .regulationsdetails-item {
+      height: 138rpx;
+      padding-left: 24rpx;
+      background-color: #ffffff;
+
+      .item-content {
+        height: 138rpx;
+        border-bottom: 1px solid #eeeeee;
+
+        .item-text {
+          padding: 24rpx 24rpx 24rpx 0;
+
+          .item-textlable {
+            height: 42rpx;
+            line-height: 42rpx;
+
+            .item-lable {
+              height: 42rpx;
+              font-size: 30rpx;
+              font-family: PingFangSC-Regular, PingFang SC;
+              font-weight: 400;
+              color: #666666;
+              line-height: 42rpx;
+            }
+          }
+
+          .item-textvalue {
+            height: 48rpx;
+            line-height: 48rpx;
+
+            .item-value {
+              height: 48rpx;
+              font-size: 34rpx;
+              font-family: PingFangSC-Regular, PingFang SC;
+              font-weight: 400;
+              color: #333333;
+              line-height: 48rpx;
+            }
+          }
+        }
+      }
+    }
+
+    .regulationsdetails-artcontent {
+      margin-top: 24rpx;
+      background-color: #ffffff;
+      min-height: 154rpx;
+
+      .artcontent-text {
+        padding: 24rpx;
+
+        .artcontent-textlable {
+          height: 42rpx;
+          line-height: 42rpx;
+
+          .artcontent-lable {
+            height: 42rpx;
+            font-size: 30rpx;
+            font-family: PingFangSC-Regular, PingFang SC;
+            font-weight: 400;
+            color: #666666;
+            line-height: 42rpx;
+          }
+        }
+
+        .artcontent-textvalue {
+          .artcontent-textarea {
+            min-height: 48rpx;
+            font-size: 34rpx;
+            font-family: PingFangSC-Regular, PingFang SC;
+            font-weight: 400;
+            color: #333333;
+          }
+        }
+      }
+    }
+  }
+}
+</style>

+ 180 - 0
pages/notice/details/index.vue

@@ -0,0 +1,180 @@
+<template>
+  <view class="page-content regulationsdetails">
+    <view class="regulationsdetails-content">
+      <view class="regulationsdetails-item regulationsdetails-arttitle">
+        <view class="item-content">
+          <view class="item-text">
+            <view class="item-textlable">
+              <text class="item-lable">标题:</text>
+            </view>
+            <view class="item-textvalue">
+              <text class="item-value">{{ regulationsDetailsObj.artTitle }}</text>
+            </view>
+          </view>
+        </view>
+      </view>
+      <view class="regulationsdetails-item regulationsdetails-artauthor">
+        <view class="item-content">
+          <view class="item-text">
+            <view class="item-textlable">
+              <text class="item-lable">作者:</text>
+            </view>
+            <view class="item-textvalue">
+              <text class="item-value">{{ regulationsDetailsObj.artAuthor }}</text>
+            </view>
+          </view>
+        </view>
+      </view>
+      <view class="regulationsdetails-item regulationsdetails-artsummary">
+        <view class="item-content">
+          <view class="item-text">
+            <view class="item-textlable">
+              <text class="item-lable">简介:</text>
+            </view>
+            <view class="item-textvalue">
+              <text class="item-value">{{ regulationsDetailsObj.artSummary }}</text>
+            </view>
+          </view>
+        </view>
+      </view>
+      <view class="regulationsdetails-artcontent">
+        <view class="artcontent-text">
+          <view class="artcontent-textlable">
+            <text class="artcontent-lable">内容:</text>
+          </view>
+          <view class="artcontent-textvalue">
+            <view class="u-content">
+              <u-parse
+                :html="regulationsDetailsObj.artContent"
+                :selectable="false"
+                :show-with-animation="true"
+              ></u-parse>
+            </view>
+          </view>
+        </view>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+import { regulationsViewData } from '@/agrcloud-api/regulations';
+
+export default {
+  name: 'regulationsDetails',
+  data() {
+    return {
+      regulationsDetailsObj: {
+        artTitle: '',
+        artAuthor: '',
+        artSummary: '',
+        artContent: ''
+      }
+    };
+  },
+  onLoad() {
+    this.initData();
+  },
+  methods: {
+    /** 初始化数据 */
+    initData() {
+      const currRegulationDetailsItem = (this.$store.getters || {}).regulationsDetailsObj || {};
+      regulationsViewData({
+        id: currRegulationDetailsItem.artId
+      }).then(res => {
+        this.regulationsDetailsObj = res.data || {};
+      }).catch(() => {
+        this.regulationsDetailsObj = {};
+      });
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.regulationsdetails {
+  padding: 0;
+
+  .regulationsdetails-content {
+    width: 100%;
+    padding-top: 24rpx;
+
+    .regulationsdetails-item {
+      height: 138rpx;
+      padding-left: 24rpx;
+      background-color: #ffffff;
+
+      .item-content {
+        height: 138rpx;
+        border-bottom: 1px solid #eeeeee;
+
+        .item-text {
+          padding: 24rpx 24rpx 24rpx 0;
+
+          .item-textlable {
+            height: 42rpx;
+            line-height: 42rpx;
+
+            .item-lable {
+              height: 42rpx;
+              font-size: 30rpx;
+              font-family: PingFangSC-Regular, PingFang SC;
+              font-weight: 400;
+              color: #666666;
+              line-height: 42rpx;
+            }
+          }
+
+          .item-textvalue {
+            height: 48rpx;
+            line-height: 48rpx;
+
+            .item-value {
+              height: 48rpx;
+              font-size: 34rpx;
+              font-family: PingFangSC-Regular, PingFang SC;
+              font-weight: 400;
+              color: #333333;
+              line-height: 48rpx;
+            }
+          }
+        }
+      }
+    }
+
+    .regulationsdetails-artcontent {
+      margin-top: 24rpx;
+      background-color: #ffffff;
+      min-height: 154rpx;
+
+      .artcontent-text {
+        padding: 24rpx;
+
+        .artcontent-textlable {
+          height: 42rpx;
+          line-height: 42rpx;
+
+          .artcontent-lable {
+            height: 42rpx;
+            font-size: 30rpx;
+            font-family: PingFangSC-Regular, PingFang SC;
+            font-weight: 400;
+            color: #666666;
+            line-height: 42rpx;
+          }
+        }
+
+        .artcontent-textvalue {
+          .artcontent-textarea {
+            min-height: 48rpx;
+            font-size: 34rpx;
+            font-family: PingFangSC-Regular, PingFang SC;
+            font-weight: 400;
+            color: #333333;
+          }
+        }
+      }
+    }
+  }
+}
+</style>