Browse Source

Merge remote-tracking branch 'origin/master'

qinhouyu 1 year ago
parent
commit
28a972c8bd

+ 24 - 1
pages.json

@@ -237,12 +237,35 @@
 			"style": {
 			"style": {
 				"usingComponents": {},
 				"usingComponents": {},
 				"navigationBarBackgroundColor": "#07c160",
 				"navigationBarBackgroundColor": "#07c160",
+				"enablePullDownRefresh": true,
+				"onReachBottomDistance" : 5,
 				"navigationBarTextStyle": "white",
 				"navigationBarTextStyle": "white",
 				"navigationBarTitleText": "行情"
 				"navigationBarTitleText": "行情"
 
 
 
 
 			}
 			}
-		}, {
+		},
+		{
+			"path": "pages/quotations/quotationsForm",
+			"style": {
+				"usingComponents": {},
+				"navigationBarBackgroundColor": "#07c160",
+				"navigationBarTextStyle": "white",
+				"navigationBarTitleText": "新增行情列表"
+			}
+		},
+		{
+			"path": "pages/quotations/quotationsSecond",
+			"style": {
+				"usingComponents": {},
+				"navigationBarBackgroundColor": "#07c160",
+				"enablePullDownRefresh": true,
+				"onReachBottomDistance" : 5,
+				"navigationBarTextStyle": "white",
+				"navigationBarTitleText": "行情列表"
+			}
+		},
+		{
 			"path": "pages/toGovernmentList/toGovernmentList",
 			"path": "pages/toGovernmentList/toGovernmentList",
 			"style": {
 			"style": {
 				"usingComponents": {},
 				"usingComponents": {},

+ 4 - 2
pages/matterAll/matterAll.vue

@@ -1,7 +1,7 @@
 <template>
 <template>
 	<view>
 	<view>
 		<uni-list>
 		<uni-list>
-			<uni-list-item  :title="item.title" v-for="(item,index) in dataList"></uni-list-item>
+			<uni-list-item  :title="item.title" v-for="(item,index) in dataList" @click="onclick(item)"></uni-list-item>
 		</uni-list>
 		</uni-list>
 	</view>
 	</view>
 </template>
 </template>
@@ -24,7 +24,9 @@
 			this.getMatters(data)
 			this.getMatters(data)
 		},
 		},
 		methods: {
 		methods: {
-
+			onclick(data){//点击详情
+				
+			},
 			getMatters(data) {
 			getMatters(data) {
 				let _that = this
 				let _that = this
 				getMattersAll(data).then(res => {
 				getMattersAll(data).then(res => {

+ 53 - 11
pages/quotations/quotations.vue

@@ -15,12 +15,15 @@
     <view class="uni-container">
     <view class="uni-container">
       <uni-table>
       <uni-table>
         <uni-tr>
         <uni-tr>
+          <uni-th width="80" align="center">地区</uni-th>
           <uni-th width="80" align="center">名称</uni-th>
           <uni-th width="80" align="center">名称</uni-th>
           <uni-th width="80" align="center">类型</uni-th>
           <uni-th width="80" align="center">类型</uni-th>
           <uni-th width="80" align="center">价格</uni-th>
           <uni-th width="80" align="center">价格</uni-th>
           <uni-th width="100" align="center">时间</uni-th>
           <uni-th width="100" align="center">时间</uni-th>
         </uni-tr>
         </uni-tr>
         <uni-tr v-for="(item, index) in quotationsList" :key="index">
         <uni-tr v-for="(item, index) in quotationsList" :key="index">
+          <uni-td align="center">{{ item.area+item.address }}
+          </uni-td>
           <uni-td align="center">{{ item.productName }}
           <uni-td align="center">{{ item.productName }}
           </uni-td>
           </uni-td>
           <uni-td align="center">
           <uni-td align="center">
@@ -32,6 +35,7 @@
           </uni-td>
           </uni-td>
         </uni-tr>
         </uni-tr>
       </uni-table>
       </uni-table>
+      <uni-load-more :status="status" :content-text="contentText"/>
       <uni-fab ref="fab" :horizontal="right" :vertical="bottom"
       <uni-fab ref="fab" :horizontal="right" :vertical="bottom"
                @fabClick="fabClick()"/>
                @fabClick="fabClick()"/>
     </view>
     </view>
@@ -64,31 +68,66 @@ export default {
       ],
       ],
       //查询参数
       //查询参数
       queryParams: {
       queryParams: {
-        // pageNum: 1,
-        // pageSize: 10,
+        pageNum: 1,
+        pageSize: 15,
         id: null,
         id: null,
       },
       },
+      //加载更多
+      status: 'more',
+      contentText: {
+        contentdown: '查看更多',
+        contentrefresh: '加载中',
+        contentnomore: '没有更多'
+      },
+
       //表单数据
       //表单数据
       form: {},
       form: {},
       imageList: []
       imageList: []
     }
     }
   },
   },
-  created() {
+  onPullDownRefresh() {
+    this.queryParams.pageNum = 1;
+    this.quotationsList = [];
+    this.getList()
+  },
+  //上拉加载
+  onReachBottom() {
+    if (this.status === 'noMore') {
+      return;
+    }
+    this.queryParams.pageNum++;
+    this.getList();
+  },
+  onLoad() {
     this.getList();
     this.getList();
   },
   },
   methods: {
   methods: {
     getList(row) {
     getList(row) {
       // 这里是获取列表的方法
       // 这里是获取列表的方法
-      listQuotations().then(response => {
-        this.quotationsList = response.rows.map(item => {
-          let date = new Date(item.createTime);
-          item.createTime = date.toLocaleDateString('zh-CN', {dateStyle: 'short'});
-          return item;
-        });
+      listQuotations(this.queryParams).then(response => {
+        if (this.queryParams.pageNum === 1) {
+          this.quotationsList = this.dataFormat(response.rows)
+        } else {
+          this.quotationsList = this.quotationsList.concat(this.dataFormat(response.rows));
+        }
+        // 判断是否还有更多数据
+        if (response.rows.length < this.queryParams.pageSize) {
+          this.status = 'noMore'; // 没有更多数据
+        } else {
+          this.status = 'more'; // 还有更多数据
+        }
       });
       });
       //获取分类树的方法
       //获取分类树的方法
       listConfig().then(response => {
       listConfig().then(response => {
-        this.categories = response.data.quotations;
+        this.categories = response.data.quotations.filter(item => item.homeDisplay === "1");
+      });
+      uni.stopPullDownRefresh();
+    },
+    dataFormat(rows) {
+      return rows.map(item => {
+        let date = new Date(item.createTime);
+        item.createTime = date.toLocaleDateString('zh-CN', {dateStyle: 'short'});
+        return item;
       });
       });
     },
     },
     //根据分类id查询列表
     //根据分类id查询列表
@@ -123,13 +162,16 @@ export default {
   flex-direction: column;
   flex-direction: column;
   align-items: center;
   align-items: center;
   justify-content: center;
   justify-content: center;
-  padding: 0px 0;
+  padding: 0 0;
 }
 }
 
 
 .image {
 .image {
   height: 100%;
   height: 100%;
   width: 100%;
   width: 100%;
 }
 }
+.uni-container{
+  align-items: center;
+}
 
 
 
 
 </style>
 </style>

+ 39 - 21
pages/quotations/quotationsSecond.vue

@@ -32,8 +32,6 @@
           </uni-td>
           </uni-td>
         </uni-tr>
         </uni-tr>
       </uni-table>
       </uni-table>
-      <uni-fab ref="fab" :horizontal="right" :vertical="bottom"
-               @fabClick="fabClick()"/>
     </view>
     </view>
   </view>
   </view>
 </template>
 </template>
@@ -64,11 +62,11 @@ export default {
       quotationsList: [
       quotationsList: [
         // 这里是列表的数据
         // 这里是列表的数据
       ],
       ],
-      //查询参数
       queryParams: {
       queryParams: {
-        // pageNum: 1,
-        // pageSize: 10,
+        pageNum: 1,
+        pageSize: 15,
         id: null,
         id: null,
+        type: null,
       },
       },
       //表单数据
       //表单数据
       form: {},
       form: {},
@@ -77,6 +75,19 @@ export default {
       imageList: []
       imageList: []
     }
     }
   },
   },
+  onPullDownRefresh() {
+    this.queryParams.pageNum = 1;
+    this.quotationsList = [];
+    this.getList()
+  },
+  //上拉加载
+  onReachBottom() {
+    if (this.status === 'noMore') {
+      return;
+    }
+    this.queryParams.pageNum++;
+    this.getList();
+  },
   onLoad(e) {
   onLoad(e) {
     this.FatherType = e.type;
     this.FatherType = e.type;
     this.getList();
     this.getList();
@@ -84,23 +95,36 @@ export default {
   methods: {
   methods: {
     getList(row) {
     getList(row) {
       // 这里是获取列表的方法
       // 这里是获取列表的方法
-      this.form.type = this.FatherType
-      listQuotations(this.form).then(response => {
-        this.quotationsList = response.rows.map(item => {
-          let date = new Date(item.createTime);
-          item.createTime = date.toLocaleDateString('zh-CN', {dateStyle: 'short'});
-          return item;
-        });
+      this.queryParams.type = this.FatherType
+      listQuotations(this.queryParams).then(response => {
+        if (this.queryParams.pageNum === 1) {
+          this.quotationsList = this.dataFormat(response.rows)
+        } else {
+          this.quotationsList = this.quotationsList.concat(this.dataFormat(response.rows));
+        }
+        // 判断是否还有更多数据
+        if (response.rows.length < this.queryParams.pageSize) {
+          this.status = 'noMore'; // 没有更多数据
+        } else {
+          this.status = 'more'; // 还有更多数据
+        }
       });
       });
       this.forms.parentId = this.FatherType
       this.forms.parentId = this.FatherType
       //获取分类树的方法
       //获取分类树的方法
       QuotationsList(this.forms).then(response => {
       QuotationsList(this.forms).then(response => {
         //取出response.rows中所有homeDisplay为1的数据
         //取出response.rows中所有homeDisplay为1的数据
-        this.categories = response.rows.filter(item => item.homeDisplay === 1);
+        this.categories = response.rows
+      });
+      uni.stopPullDownRefresh();
+    },
+    //格式化时间
+    dataFormat(rows) {
+      return rows.map(item => {
+        let date = new Date(item.createTime);
+        item.createTime = date.toLocaleDateString('zh-CN', {dateStyle: 'short'});
+        return item;
       });
       });
     },
     },
-    //递归查询分类的父级
-
     //根据分类id查询列表
     //根据分类id查询列表
     change(e) {
     change(e) {
       this.queryParams.type = e.detail.index;
       this.queryParams.type = e.detail.index;
@@ -112,12 +136,6 @@ export default {
         });
         });
       });
       });
     },
     },
-    //悬浮按钮点击事件
-    fabClick() {
-      uni.navigateTo({
-        url: '../quotations/quotationsForm'
-      });
-    },
     updateImg(imgList) {
     updateImg(imgList) {
       this.imageList = imgList;
       this.imageList = imgList;
     }
     }

+ 10 - 5
pages/topic/topic.vue

@@ -5,10 +5,10 @@
 			</button>
 			</button>
 		</view>
 		</view>
 		<view>
 		<view>
-			<uni-grid :column="2" :square="false" :highlight="false">
-				<uni-grid-item v-for="(item, index) in dataList" :index="index" :key="index">
-					<view class="grid-item-box">
-						<text class="text">{{ item.deptName }}</text>
+			<uni-grid :column="2" :square="false" :highlight="false" >
+				<uni-grid-item v-for="(item, index) in dataList" :index="index" :key="index" >
+					<view class="grid-item-box" @click="onMatters(item)">
+						<text class="text" >{{ item.deptName }}</text>
 					</view>
 					</view>
 				</uni-grid-item>
 				</uni-grid-item>
 			</uni-grid>
 			</uni-grid>
@@ -38,7 +38,12 @@
 			this.getdataList()//初始化数据
 			this.getdataList()//初始化数据
 		},
 		},
 		methods: {
 		methods: {
-			
+			onMatters(data){
+				uni.setStorageSync('data', {type:data.deptName})
+				uni.navigateTo({
+					url: '/pages/matterAll/matterAll',
+				});
+			},
 			getdataList(data){
 			getdataList(data){
 				let _that = this
 				let _that = this
 				if (!data) {
 				if (!data) {