Browse Source

1.录入报告 对接口
2.分页 加载更多 逻辑 修改

guo 3 years ago
parent
commit
1da155f244
21 changed files with 206 additions and 131 deletions
  1. 83 57
      operatingCompany/pages/entryReport/entryReport.vue
  2. 17 13
      operatingCompany/pages/reportManage/reportManage.vue
  3. 3 1
      operatingCompany/pages/team/manageStore.vue
  4. 4 2
      operatingCompany/pages/team/myTeam.vue
  5. 4 2
      operatingCompany/pages/teamStore/teamStore.vue
  6. 4 2
      operatingCompany/pages/upcoming/upcoming.vue
  7. 1 1
      operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/pages/entryReport/entryReport.js.map
  8. 1 1
      operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/pages/reportManage/reportManage.js.map
  9. 1 1
      operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/pages/team/manageStore.js.map
  10. 1 1
      operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/pages/team/myTeam.js.map
  11. 1 1
      operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/pages/teamStore/teamStore.js.map
  12. 1 1
      operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/pages/upcoming/upcoming.js.map
  13. 56 26
      operatingCompany/unpackage/dist/dev/mp-weixin/pages/entryReport/entryReport.js
  14. 1 1
      operatingCompany/unpackage/dist/dev/mp-weixin/pages/entryReport/entryReport.wxml
  15. 7 12
      operatingCompany/unpackage/dist/dev/mp-weixin/pages/entryReport/entryReport.wxss
  16. 8 4
      operatingCompany/unpackage/dist/dev/mp-weixin/pages/reportManage/reportManage.js
  17. 1 1
      operatingCompany/unpackage/dist/dev/mp-weixin/pages/reportManage/reportManage.wxml
  18. 3 1
      operatingCompany/unpackage/dist/dev/mp-weixin/pages/team/manageStore.js
  19. 3 1
      operatingCompany/unpackage/dist/dev/mp-weixin/pages/team/myTeam.js
  20. 3 1
      operatingCompany/unpackage/dist/dev/mp-weixin/pages/teamStore/teamStore.js
  21. 3 1
      operatingCompany/unpackage/dist/dev/mp-weixin/pages/upcoming/upcoming.js

+ 83 - 57
operatingCompany/pages/entryReport/entryReport.vue

@@ -37,29 +37,35 @@
 			<view v-for="(item,index) in shopData" :key="index">
 				<view class="shopBox">
 					<view class="shopTop">
-						<view class="shopName">门店名称门店名称门店名称称门店名称</view>
-						<!-- 地址和电话 -->
-						<view class="addresAndPhone">
-							<image class="ditu" src="../../static/img/icon_daohang_def@2x.png" mode="widthFix">
-							</image>
-							<image class="phone" src="../../static/img/icon_phone_def@2x.png" mode="widthFix">
-							</image>
-						</view>
+						<view class="shopName">{{item.ShopName}}</view>
+						
+						
+							<!-- 地址 和电话 图标 -->
+							<image class="tubiao" src="../../static/img/icon_daohang_def@2x.png" @click="goAddress(item)">
+							</image>
+							<image class="tubiao" src="../../static/img/icon_phone_def@2x.png"
+								@click="call(item.ContactorPhone)">
+							</image>
+						
+						
 
 
 					</view>
-					<!-- 门店类型-开业时间-联系人 -->
-					<view class="shopType"><text style='color: #B98B5D;'>门店类型</text> · 开业时间 · 联系人:{{lianxiren}}</view>
-					<!-- 详细地址 -->
-					<view class="addressView">
-						<view class="address">山东省济南市历下区齐鲁软件园创业广场广场…</view>
-						<view class="distance">1.6km</view>
+					<!-- 门店类型-开业时间-联系人 -->
+					<view class="shopType"><text style='color: #B98B5D;'>{{item.levelName}}</text> ·
+						<text v-if="item.OpeningTime != null">{{item.OpeningTime}}</text> 联系人:{{item.Contactor}}
+					</view>
+					
+					<!-- 详细地址 -->
+					<view class="addressView">
+						<view class="address">{{item.Address}}</view>
+						<view class="distance">{{item.distance}}km</view>
 					</view>
 
 					<!-- 提交信息 -->
 					<view class="tijao">
-						<view class="time">距上次提交:<text style='color: #FF4F00;'>30</text>天</view>
-						<view class="xiangmu"><text style='color: #FF4F00;'>2</text>项需要检测</view>
+						<view class="time">距上次提交:<text style='color: #FF4F00;'>{{item.maxTime}}</text>天</view>
+						<view class="xiangmu"><text style='color: #FF4F00;'>{{item.checkCount}}</text>项需要检测</view>
 					</view>
 
 					<!-- btns -->
@@ -73,7 +79,7 @@
 		</view>
 
 		<!-- 上拉 加载更多 -->
-		<view class="noMore" v-if="noMoreShow">没有更多数据</view>
+		<!-- <view class="noMore" v-if="noMoreShow">没有更多数据</view> -->
 		<!-- 无数据空白页 -->
 		<view class="nodataBox" v-if="shopData.length == 0">
 			<image src="../../static/img/pic_empty_def.png" mode="widthFix" class="nodataImg"></image>
@@ -91,10 +97,9 @@
 				lng: '',
 				lat: '',
 				firstIndex: null,
-				firstName: '',
 				firstArr: ['不限', '1-15天', '15-30天', '30天以上'],
 				isHave: false,
-				shopData: [1, 2, 3, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
+				shopData: [],
 				page: 1,
 				noMoreShow: false,
 			}
@@ -109,7 +114,7 @@
 					that.lat = res.latitude
 					
 					that.page = 1
-					 //that.getShopData()
+					 that.getShopData()
 				}
 			})
 		},
@@ -122,37 +127,57 @@
 			searchDone() {
 				this.searchValue = e.target.value;
 				this.page = 1
-				// this.getShopData()
+				this.getShopData()
 			},
 			bindPickerChange(e) {
 				this.firstIndex = Number(e.target.value)
-				this.firstName = this.firstArr[this.firstIndex]
 				this.page = 1
-				// this.getShopData()
+				this.getShopData()
 			},
-
+			
 			changeHave() {
 				this.isHave = !this.isHave
 				this.page = 1
-				// this.getShopData()
+				this.getShopData()
+			},
+			goAddress(v) {
+			
+				uni.openLocation({
+					latitude: Number(v.lat),
+					longitude: Number(v.lng),
+					name: v.shopName,
+					address: v.Address,
+				});
+			},
+			call(e) {
+				if (e.length != 0) {
+					uni.makePhoneCall({
+						phoneNumber: e
+					})
+				}
 			},
-
 
 			getShopData() {
 				uni.showLoading({
 					title: '加载中'
-				})
-				let url = 'accompany/SuperAccounts/queryShopListByManagerID',
+				})
+				var maxTime = ''
+				if(this.firstIndex == 0){
+					maxTime = ''
+				}
+
+				let url = 'accompany/SuperAccounts/queryShopListByMyTeam',
 					params = {
-						page: this.page,
-						limit: 20,
-						managerID: this.managerID,
+						// page: this.page,
+						// limit: 20,
 						shopName: this.searchValue,
 						lng: this.lng,
-						lat: this.lat,
+						lat: this.lat,
+						maxTime:maxTime,
+						checkCount:Number(this.isHave),
 					}
 				this.$http(url, params, 'GET').then(res => {
-					var list = res.data.Items
+					var list = res.data
 					
 					// 处理 undefined和null转为空白字符串
 					list.forEach((item, index) => {
@@ -160,15 +185,19 @@
 							item[key] = this.$praseStrEmpty(item[key])
 						}
 					})
+					this.shopData = list
 					
-					if (list.length < 20) {
-						this.noMoreShow = true
-					}
-					if (this.page == 1) {
-						this.shopData = list
-					} else {
-						this.shopData = this.shopData.concat(list)
-					}
+					
+					// if (this.page == 1 && list.length == 0) {
+					// 	this.noMoreShow = false
+					// } else if (list.length < 20) {
+					// 	this.noMoreShow = true
+					// }
+					// if (this.page == 1) {
+					// 	this.shopData = list
+					// } else {
+					// 	this.shopData = this.shopData.concat(list)
+					// }
 
 				})
 			},
@@ -181,10 +210,10 @@
 				uni.stopPullDownRefresh();
 			}, 1000);
 		},
-		onReachBottom() {
-			this.page++;
-			this.getShopData()
-		},
+		// onReachBottom() {
+		// 	this.page++;
+		// 	this.getShopData()
+		// },
 	}
 </script>
 
@@ -291,24 +320,19 @@
 	}
 
 	.shopName {
-
 		font-size: 30rpx;
 		font-weight: bold;
 		color: #3C3C3C;
-		margin-right: 20rpx;
+		margin-right: 20rpx;
+		width: 500rpx;
 	}
 
-	.addresAndPhone {
-		display: flex;
-		justify-content: space-between;
-		width: 136rpx;
+	.tubiao {
+		width: 48rpx;
+		height: 48rpx;
+		padding-left: 40rpx;
 	}
 
-	.ditu,
-	.phone {
-		width: 48rpx;
-		height: 48rpx;
-	}
 
 	.shopType {
 		padding: 10rpx 20rpx;
@@ -320,7 +344,9 @@
 		padding: 10rpx 20rpx;
 		display: flex;
 		font-size: 26rpx;
-		color: #999999;
+		color: #999999;
+		display: flex;
+		justify-content: space-between;
 	}
 
 	.address {

+ 17 - 13
operatingCompany/pages/reportManage/reportManage.vue

@@ -53,17 +53,17 @@
 			<view v-for="(item,index) in shopData" :key="index">
 
 				<!-- shopBox -->
-				<view class="shopBox">
-					<view class="shopTop">
+				<view class="shopBox" @click="goAppraise(item)">
+					<view class=" shopTop">
 
 						<view class="shopName">{{item.ShopName}}</view>
 
 						<!-- 订单状态 1 待提交 草稿 2 已提交 待作业 3 已作业 待点评 4 已评价 待回复,5 已回复 已完成 -->
-						<view class="type" v-if="item.State == 1" @click="goAppraise(item)">待提交</view>
-						<view class="type" v-if="item.State == 2" @click="goAppraise(item)">已提交</view>
-						<view class="type" v-if="item.State == 3" @click="goAppraise(item)">已作业</view>
-						<view class="type" v-if="item.State == 4" @click="goAppraise(item)">已评价</view>
-						<view class="type" v-if="item.State == 5" @click="goAppraise(item)">已回复</view>
+						<view class="type" v-if="item.State == 1">待提交</view>
+						<view class="type" v-if="item.State == 2">已提交</view>
+						<view class="type" v-if="item.State == 3">已作业</view>
+						<view class="type" v-if="item.State == 4">已评价</view>
+						<view class="type" v-if="item.State == 5">已回复</view>
 
 					</view>
 
@@ -127,14 +127,13 @@
 		methods: {
 			tabClick(num) {
 				this.tabIndex = num;
-				this.shopData = [];
-				this.noMoreShow = false
-				this.page = 1;
+
 				if (num == 0) {
 					this.status = ''
 				} else {
 					this.status = num;
 				}
+				this.page = 1;
 				this.getShopData()
 			},
 			searchDone(e) {
@@ -200,7 +199,9 @@
 						}
 					})
 
-					if (list.length < 20) {
+					if (this.page == 1 && list.length == 0) {
+						this.noMoreShow = false
+					} else if (list.length < 20) {
 						this.noMoreShow = true
 					}
 					if (this.page == 1) {
@@ -210,6 +211,9 @@
 					}
 
 				})
+			},
+			goAppraise(v) {
+
 			}
 
 		},
@@ -343,8 +347,8 @@
 	}
 
 	.bottomView {
-		padding: 28rpx 20rpx;
-		display: flex;
+		padding: 28rpx 20rpx;
+		display: flex;
 		justify-content: space-between;
 	}
 

+ 3 - 1
operatingCompany/pages/team/manageStore.vue

@@ -106,7 +106,9 @@
 						}
 					})
 					
-					if (list.length < 20) {
+					if (this.page == 1 && list.length == 0) {
+						this.noMoreShow = false
+					} else if (list.length < 20) {
 						this.noMoreShow = true
 					}
 					if (this.page == 1) {

+ 4 - 2
operatingCompany/pages/team/myTeam.vue

@@ -92,8 +92,10 @@
 						}
 					})
 
-					if (list.length < 20) {
-						this.noMoreShow = true
+					if (this.page == 1 && list.length == 0) {
+						this.noMoreShow = false
+					} else if (list.length < 20) {
+						this.noMoreShow = true
 					}
 					if (this.page == 1) {
 						this.shopData = list

+ 4 - 2
operatingCompany/pages/teamStore/teamStore.vue

@@ -201,8 +201,10 @@
 						}
 					})
 
-					if (list.length < 20) {
-						this.noMoreShow = true
+					if (this.page == 1 && list.length == 0) {
+						this.noMoreShow = false
+					} else if (list.length < 20) {
+						this.noMoreShow = true
 					}
 					if (this.page == 1) {
 						this.shopData = list

+ 4 - 2
operatingCompany/pages/upcoming/upcoming.vue

@@ -80,8 +80,10 @@
 						}
 					})
 
-					if (list.length < 20) {
-						this.noMoreShow = true
+					if (this.page == 1 && list.length == 0) {
+						this.noMoreShow = false
+					} else if (list.length < 20) {
+						this.noMoreShow = true
 					}
 					if (this.page == 1) {
 						this.shopData = list

File diff suppressed because it is too large
+ 1 - 1
operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/pages/entryReport/entryReport.js.map


File diff suppressed because it is too large
+ 1 - 1
operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/pages/reportManage/reportManage.js.map


File diff suppressed because it is too large
+ 1 - 1
operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/pages/team/manageStore.js.map


File diff suppressed because it is too large
+ 1 - 1
operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/pages/team/myTeam.js.map


File diff suppressed because it is too large
+ 1 - 1
operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/pages/teamStore/teamStore.js.map


File diff suppressed because it is too large
+ 1 - 1
operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/pages/upcoming/upcoming.js.map


+ 56 - 26
operatingCompany/unpackage/dist/dev/mp-weixin/pages/entryReport/entryReport.js

@@ -215,6 +215,12 @@ __webpack_require__.r(__webpack_exports__);
 //
 //
 //
+//
+//
+//
+//
+//
+//
 var _default =
 {
   data: function data() {
@@ -223,10 +229,9 @@ var _default =
       lng: '',
       lat: '',
       firstIndex: null,
-      firstName: '',
       firstArr: ['不限', '1-15天', '15-30天', '30天以上'],
       isHave: false,
-      shopData: [1, 2, 3, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
+      shopData: [],
       page: 1,
       noMoreShow: false };
 
@@ -241,7 +246,7 @@ var _default =
         that.lat = res.latitude;
 
         that.page = 1;
-        //that.getShopData()
+        that.getShopData();
       } });
 
   },
@@ -254,37 +259,57 @@ var _default =
     searchDone: function searchDone() {
       this.searchValue = e.target.value;
       this.page = 1;
-      // this.getShopData()
+      this.getShopData();
     },
     bindPickerChange: function bindPickerChange(e) {
       this.firstIndex = Number(e.target.value);
-      this.firstName = this.firstArr[this.firstIndex];
       this.page = 1;
-      // this.getShopData()
+      this.getShopData();
     },
 
     changeHave: function changeHave() {
       this.isHave = !this.isHave;
       this.page = 1;
-      // this.getShopData()
+      this.getShopData();
+    },
+    goAddress: function goAddress(v) {
+
+      uni.openLocation({
+        latitude: Number(v.lat),
+        longitude: Number(v.lng),
+        name: v.shopName,
+        address: v.Address });
+
     },
+    call: function call(e) {
+      if (e.length != 0) {
+        uni.makePhoneCall({
+          phoneNumber: e });
 
+      }
+    },
 
     getShopData: function getShopData() {var _this = this;
       uni.showLoading({
         title: '加载中' });
 
-      var url = 'accompany/SuperAccounts/queryShopListByManagerID',
+      var maxTime = '';
+      if (this.firstIndex == 0) {
+        maxTime = '';
+      }
+
+      var url = 'accompany/SuperAccounts/queryShopListByMyTeam',
       params = {
-        page: this.page,
-        limit: 20,
-        managerID: this.managerID,
+        // page: this.page,
+        // limit: 20,
         shopName: this.searchValue,
         lng: this.lng,
-        lat: this.lat };
+        lat: this.lat,
+        maxTime: maxTime,
+        checkCount: Number(this.isHave) };
 
       this.$http(url, params, 'GET').then(function (res) {
-        var list = res.data.Items;
+        var list = res.data;
 
         // 处理 undefined和null转为空白字符串
         list.forEach(function (item, index) {
@@ -292,15 +317,19 @@ var _default =
             item[key] = _this.$praseStrEmpty(item[key]);
           }
         });
+        _this.shopData = list;
 
-        if (list.length < 20) {
-          _this.noMoreShow = true;
-        }
-        if (_this.page == 1) {
-          _this.shopData = list;
-        } else {
-          _this.shopData = _this.shopData.concat(list);
-        }
+
+        // if (this.page == 1 && list.length == 0) {
+        // 	this.noMoreShow = false
+        // } else if (list.length < 20) {
+        // 	this.noMoreShow = true
+        // }
+        // if (this.page == 1) {
+        // 	this.shopData = list
+        // } else {
+        // 	this.shopData = this.shopData.concat(list)
+        // }
 
       });
     } },
@@ -312,11 +341,12 @@ var _default =
     setTimeout(function () {
       uni.stopPullDownRefresh();
     }, 1000);
-  },
-  onReachBottom: function onReachBottom() {
-    this.page++;
-    this.getShopData();
-  } };exports.default = _default;
+  }
+  // onReachBottom() {
+  // 	this.page++;
+  // 	this.getShopData()
+  // },
+};exports.default = _default;
 /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
 
 /***/ }),

File diff suppressed because it is too large
+ 1 - 1
operatingCompany/unpackage/dist/dev/mp-weixin/pages/entryReport/entryReport.wxml


+ 7 - 12
operatingCompany/unpackage/dist/dev/mp-weixin/pages/entryReport/entryReport.wxss

@@ -97,25 +97,16 @@
 	padding-right: 20rpx;
 }
 .shopName {
-
 	font-size: 30rpx;
 	font-weight: bold;
 	color: #3C3C3C;
 	margin-right: 20rpx;
+	width: 500rpx;
 }
-.addresAndPhone {
-	display: -webkit-box;
-	display: -webkit-flex;
-	display: flex;
-	-webkit-box-pack: justify;
-	-webkit-justify-content: space-between;
-	        justify-content: space-between;
-	width: 136rpx;
-}
-.ditu,
-.phone {
+.tubiao {
 	width: 48rpx;
 	height: 48rpx;
+	padding-left: 40rpx;
 }
 .shopType {
 	padding: 10rpx 20rpx;
@@ -129,6 +120,10 @@
 	display: flex;
 	font-size: 26rpx;
 	color: #999999;
+	display: flex;
+	-webkit-box-pack: justify;
+	-webkit-justify-content: space-between;
+	        justify-content: space-between;
 }
 .address {
 	margin-right: 20rpx;

+ 8 - 4
operatingCompany/unpackage/dist/dev/mp-weixin/pages/reportManage/reportManage.js

@@ -259,14 +259,13 @@ var _default =
   methods: {
     tabClick: function tabClick(num) {
       this.tabIndex = num;
-      this.shopData = [];
-      this.noMoreShow = false;
-      this.page = 1;
+
       if (num == 0) {
         this.status = '';
       } else {
         this.status = num;
       }
+      this.page = 1;
       this.getShopData();
     },
     searchDone: function searchDone(e) {
@@ -332,7 +331,9 @@ var _default =
           }
         });
 
-        if (list.length < 20) {
+        if (_this2.page == 1 && list.length == 0) {
+          _this2.noMoreShow = false;
+        } else if (list.length < 20) {
           _this2.noMoreShow = true;
         }
         if (_this2.page == 1) {
@@ -342,6 +343,9 @@ var _default =
         }
 
       });
+    },
+    goAppraise: function goAppraise(v) {
+
     } },
 
 

File diff suppressed because it is too large
+ 1 - 1
operatingCompany/unpackage/dist/dev/mp-weixin/pages/reportManage/reportManage.wxml


+ 3 - 1
operatingCompany/unpackage/dist/dev/mp-weixin/pages/team/manageStore.js

@@ -238,7 +238,9 @@ var _default =
           }
         });
 
-        if (list.length < 20) {
+        if (_this.page == 1 && list.length == 0) {
+          _this.noMoreShow = false;
+        } else if (list.length < 20) {
           _this.noMoreShow = true;
         }
         if (_this.page == 1) {

+ 3 - 1
operatingCompany/unpackage/dist/dev/mp-weixin/pages/team/myTeam.js

@@ -224,7 +224,9 @@ var _default =
           }
         });
 
-        if (list.length < 20) {
+        if (_this.page == 1 && list.length == 0) {
+          _this.noMoreShow = false;
+        } else if (list.length < 20) {
           _this.noMoreShow = true;
         }
         if (_this.page == 1) {

+ 3 - 1
operatingCompany/unpackage/dist/dev/mp-weixin/pages/teamStore/teamStore.js

@@ -333,7 +333,9 @@ var _default =
           }
         });
 
-        if (list.length < 20) {
+        if (_this2.page == 1 && list.length == 0) {
+          _this2.noMoreShow = false;
+        } else if (list.length < 20) {
           _this2.noMoreShow = true;
         }
         if (_this2.page == 1) {

+ 3 - 1
operatingCompany/unpackage/dist/dev/mp-weixin/pages/upcoming/upcoming.js

@@ -212,7 +212,9 @@ var _default =
           }
         });
 
-        if (list.length < 20) {
+        if (_this.page == 1 && list.length == 0) {
+          _this.noMoreShow = false;
+        } else if (list.length < 20) {
           _this.noMoreShow = true;
         }
         if (_this.page == 1) {