杜迪迪 3 miesięcy temu
rodzic
commit
20b74928e0
2 zmienionych plików z 230 dodań i 208 usunięć
  1. 20 1
      pages.json
  2. 210 207
      pages/work/index.vue

+ 20 - 1
pages.json

@@ -191,7 +191,26 @@
     {
       "path": "pages/assay/deptList",
       "style": {
-        "navigationBarTitleText": "备案新增"
+        "navigationBarTitleText": "备案新增",
+        "enablePullDownRefresh": true,
+        "app-plus": {
+          "bounce": "none",
+          "titleNView": {
+            "buttons": [
+              {
+                "fontSize": "16px",
+                "text": "新增",
+                "color": "#23a9f2"
+              }
+            ]
+          }
+        }
+      }
+    },
+    {
+      "path": "pages/work/detailInfo",
+      "style": {
+        "navigationBarTitleText": "详情"
       }
     },
     {

+ 210 - 207
pages/work/index.vue

@@ -1,226 +1,229 @@
 <template>
-	<view style="height:100%;background-color:#f3f4f9;padding:20rpx" class="">
-		<view v-for="item in ledgerList"
-			style="background-color: #fff;border-radius: 20rpx;padding:20rpx;margin: 0rpx auto 20rpx;" class="">
-			<view @click="detailInfo(item)" class="">
-				<view style="display: inline-block" class="">
-					<view style="line-height: 60rpx;font-size: 36rpx;font-weight: 700;" class="">
-						{{item.title }}
-					</view>
-					<view style="line-height: 50rpx;color:#929292" class="">
-						{{item.createTime}}
-					</view>
-				</view>
-				<view style="float:right;margin-top:30rpx" class="">
-					<view v-if="item.readStatus==1" style="color:limegreen" class="">
-						已读
-					</view>
-					<view v-if="item.readStatus==0" style="color:red" class="">
-						未读
-					</view>
-				</view>
-			</view>
-
-		</view>
-	</view>
+  <view
+    style="height: 100%; background-color: #f3f4f9; padding: 20rpx"
+    class=""
+  >
+    <view
+      v-for="item in ledgerList"
+      style="
+        background-color: #fff;
+        border-radius: 20rpx;
+        padding: 20rpx;
+        margin: 0rpx auto 20rpx;
+      "
+      class=""
+    >
+      <view @click="detailInfo(item)" class="">
+        <view style="display: inline-block" class="">
+          <view
+            style="line-height: 60rpx; font-size: 36rpx; font-weight: 700"
+            class=""
+          >
+            {{ item.title }}
+          </view>
+          <view style="line-height: 50rpx; color: #929292" class="">
+            {{ item.createTime }}
+          </view>
+        </view>
+        <view style="float: right; margin-top: 30rpx" class="">
+          <view v-if="item.readStatus == 1" style="color: limegreen" class="">
+            已读
+          </view>
+          <view v-if="item.readStatus == 0" style="color: red" class="">
+            未读
+          </view>
+        </view>
+      </view>
+    </view>
+  </view>
 </template>
 
 <script>
-	import {
-		msgList
-	} from '@/api/work.js';
-	import {
-		useDict,
-		paraseDict
-	} from "@/utils/index";
-	export default {
-		data() {
-			return {
-				readColor: {
-					已撤回: "#fa3534",
-					已接收: "#2979ff",
-					待提交: "#2979ff",
-					备案中: "#2979ff",
-					已拒绝: "#fa3534",
-					勿备案: "#fa3534",
-					未备案: "#909399",
-					免备案: "#909399",
-					已退回: "#fa3534",
-				},
+import { msgList } from "@/api/work.js";
+import { useDict, paraseDict } from "@/utils/index";
+export default {
+  data() {
+    return {
+      readColor: {
+        已撤回: "#fa3534",
+        已接收: "#2979ff",
+        待提交: "#2979ff",
+        备案中: "#2979ff",
+        已拒绝: "#fa3534",
+        勿备案: "#fa3534",
+        未备案: "#909399",
+        免备案: "#909399",
+        已退回: "#fa3534",
+      },
 
-				read: [], //备案字典
-				queryParams: {
-					pageNum: 1,
-					pageSize: 10,
-				},
-				ledgerList: [],
-				total: 0,
-				current: 0,
-				swiperDotIndex: 0,
-				data: [{
-						image: "/static/images/banner/banner01.jpg",
-					},
-					{
-						image: "/static/images/banner/banner02.jpg",
-					},
-					{
-						image: "/static/images/banner/banner03.jpg",
-					},
-				],
-			};
-		},
-		onLoad() {
-			// useDict("read_status").then((res) => {
-			// 	this.read = res;
-			// });
-			this.getList()
-			uni.startPullDownRefresh();
-		},
-		onPullDownRefresh() {
-			this.getList();
-			console.log("refresh");
-			setTimeout(function() {
-				uni.stopPullDownRefresh();
-			}, 800);
-		},
-		methods: {
-			detailInfo(item) {
-				uni.navigateTo({
-					url: '/pages/work/detailInfo?contents=' + item.contents
-				})
-			},
-			getList() {
-				msgList({
-					...this.queryParams,
-				}).then(({
-					rows,
-					total
-				}) => {
-					this.ledgerList = rows;
-					this.total = total;
-				});
-			},
-			onReachBottom() {
-				//触底事件
-				if (this.queryParams.pageNum * this.queryParams.pageSize >= this.total) {
-					uni.showToast({
-						title: "没有更多数据了",
-						icon: "none",
-						duration: 1000,
-					});
-					setTimeout(() => {
-						uni.hideLoading();
-					}, 500);
-				} else {
-					if (this.queryParams.pageNum <= this.queryParams.pageNum - 1) {
-						setTimeout(() => {
-							uni.hideLoading();
-						}, 500);
-					} else {
-						uni.showLoading({
-							title: "加载中",
-						});
-						this.queryParams.pageNum++;
+      read: [], //备案字典
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+      },
+      ledgerList: [],
+      total: 0,
+      current: 0,
+      swiperDotIndex: 0,
+      data: [
+        {
+          image: "/static/images/banner/banner01.jpg",
+        },
+        {
+          image: "/static/images/banner/banner02.jpg",
+        },
+        {
+          image: "/static/images/banner/banner03.jpg",
+        },
+      ],
+    };
+  },
+  onLoad() {
+    // useDict("read_status").then((res) => {
+    // 	this.read = res;
+    // });
+    this.getList();
+    uni.startPullDownRefresh();
+  },
+  onPullDownRefresh() {
+    this.getList();
+    console.log("refresh");
+    setTimeout(function () {
+      uni.stopPullDownRefresh();
+    }, 800);
+  },
+  methods: {
+    detailInfo(item) {
+      uni.navigateTo({
+        url: "/pages/work/detailInfo?contents=" + item.contents,
+      });
+    },
+    getList() {
+      msgList({
+        ...this.queryParams,
+      }).then(({ rows, total }) => {
+        this.ledgerList = rows;
+        this.total = total;
+      });
+    },
+    onReachBottom() {
+      //触底事件
+      if (this.queryParams.pageNum * this.queryParams.pageSize >= this.total) {
+        uni.showToast({
+          title: "没有更多数据了",
+          icon: "none",
+          duration: 1000,
+        });
+        setTimeout(() => {
+          uni.hideLoading();
+        }, 500);
+      } else {
+        if (this.queryParams.pageNum <= this.queryParams.pageNum - 1) {
+          setTimeout(() => {
+            uni.hideLoading();
+          }, 500);
+        } else {
+          uni.showLoading({
+            title: "加载中",
+          });
+          this.queryParams.pageNum++;
 
-						msgList({
-							...this.queryParams,
-						}).then(({
-							rows,
-							total
-						}) => {
-							this.ledgerList = [...this.ledgerList, ...rows];
-							this.total = total;
-						});
-					}
-					setTimeout(() => {
-						uni.hideLoading();
-					}, 500);
-				}
-			},
-			clickBannerItem(item) {
-				console.info(item);
-			},
-			changeSwiper(e) {
-				this.current = e.detail.current;
-			},
-			changeGrid(e) {
-				this.$modal.showToast("模块建设中~");
-			},
-		},
-	};
+          msgList({
+            ...this.queryParams,
+          }).then(({ rows, total }) => {
+            this.ledgerList = [...this.ledgerList, ...rows];
+            this.total = total;
+          });
+        }
+        setTimeout(() => {
+          uni.hideLoading();
+        }, 500);
+      }
+    },
+    clickBannerItem(item) {
+      console.info(item);
+    },
+    changeSwiper(e) {
+      this.current = e.detail.current;
+    },
+    changeGrid(e) {
+      this.$modal.showToast("模块建设中~");
+    },
+  },
+};
 </script>
 
 <style lang="scss">
-	/* #ifndef APP-NVUE */
-	page {
-		display: flex;
-		flex-direction: column;
-		box-sizing: border-box;
-		background-color: #fff;
-		min-height: 100%;
-		height: auto;
-	}
+/* #ifndef APP-NVUE */
+page {
+  display: flex;
+  flex-direction: column;
+  box-sizing: border-box;
+  background-color: #fff;
+  min-height: 100%;
+  height: auto;
+}
 
-	view {
-		font-size: 14px;
-		line-height: inherit;
-	}
+view {
+  font-size: 14px;
+  line-height: inherit;
+}
 
-	/* #endif */
+/* #endif */
 
-	.text {
-		text-align: center;
-		font-size: 26rpx;
-		margin-top: 10rpx;
-	}
+.text {
+  text-align: center;
+  font-size: 26rpx;
+  margin-top: 10rpx;
+}
 
-	.grid-item-box {
-		flex: 1;
-		/* #ifndef APP-NVUE */
-		display: flex;
-		/* #endif */
-		flex-direction: column;
-		align-items: center;
-		justify-content: center;
-		padding: 15px 0;
-	}
+.grid-item-box {
+  flex: 1;
+  /* #ifndef APP-NVUE */
+  display: flex;
+  /* #endif */
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  padding: 15px 0;
+}
 
-	.uni-margin-wrap {
-		width: 690rpx;
-		width: 100%;
-	}
+.uni-margin-wrap {
+  width: 690rpx;
+  width: 100%;
+}
 
-	.swiper {
-		height: 300rpx;
-	}
+.swiper {
+  height: 300rpx;
+}
 
-	.swiper-box {
-		height: 150px;
-	}
+.swiper-box {
+  height: 150px;
+}
 
-	.swiper-item {
-		/* #ifndef APP-NVUE */
-		display: flex;
-		/* #endif */
-		flex-direction: column;
-		justify-content: center;
-		align-items: center;
-		color: #fff;
-		height: 300rpx;
-		line-height: 300rpx;
-	}
+.swiper-item {
+  /* #ifndef APP-NVUE */
+  display: flex;
+  /* #endif */
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+  color: #fff;
+  height: 300rpx;
+  line-height: 300rpx;
+}
 
-	@media screen and (min-width: 500px) {
-		.uni-swiper-dot-box {
-			width: 400px;
-			/* #ifndef APP-NVUE */
-			margin: 0 auto;
-			/* #endif */
-			margin-top: 8px;
-		}
+@media screen and (min-width: 500px) {
+  .uni-swiper-dot-box {
+    width: 400px;
+    /* #ifndef APP-NVUE */
+    margin: 0 auto;
+    /* #endif */
+    margin-top: 8px;
+  }
 
-		.image {
-			width: 100%;
-		}
-	}
-</style>
+  .image {
+    width: 100%;
+  }
+}
+</style>