Explorar el Código

Signed-off-by: liuboyan <632697560@qq.com>
下拉

liuboyan hace 4 años
padre
commit
183697a2a0

+ 12 - 7
pages.json

@@ -49,7 +49,8 @@
 		"pages": [{
 			"path": "goodList",
 			"style": {
-				"navigationBarTitleText": "商品列表"
+				"navigationBarTitleText": "商品列表",
+				"enablePullDownRefresh":true
 			}
 		}, {
 			"path": "goodForm",
@@ -90,7 +91,8 @@
 		"pages": [{
 			"path": "orderList",
 			"style": {
-				"navigationBarTitleText": "订单列表"
+				"navigationBarTitleText": "订单列表",
+				"enablePullDownRefresh":true
 			}
 		}, {
 			"path": "orderDetail",
@@ -115,7 +117,8 @@
 		}, {
 			"path": "messageList",
 			"style": {
-				"navigationBarTitleText": "留言板"
+				"navigationBarTitleText": "留言板",
+				"enablePullDownRefresh":true
 			}
 		}, {
 			"path": "messageForm",
@@ -123,19 +126,21 @@
 				"navigationBarTitleText": "发布留言"
 			}
 		}, {
-			"path": "couponForm",
+			"path": "couponList",
 			"style": {
-				"navigationBarTitleText": "我的优惠券"
+				"navigationBarTitleText": "我的优惠券",
+				"enablePullDownRefresh":true
 			}
 		}, {
-			"path": "couponList",
+			"path": "couponForm",
 			"style": {
 				"navigationBarTitleText": "发放优惠券"
 			}
 		}, {
 			"path": "authorizeList",
 			"style": {
-				"navigationBarTitleText": "授权列表"
+				"navigationBarTitleText": "授权列表",
+				"enablePullDownRefresh":true
 			}
 		}, {
 			"path": "authorizeForm",

+ 3 - 0
pagesGood/goodList.vue

@@ -115,6 +115,9 @@
 		onShow(options) {
 			this.reasetList()
 		},
+		onPullDownRefresh() {
+			this.reasetList()
+		},
 		methods: {
 			//  搜索商品
 			search(data) {

+ 11 - 1
pagesMain/authorizeList.vue

@@ -46,6 +46,13 @@
 			this.authorizeList = []
 			this.getList()
 		},
+		onPullDownRefresh() {
+			this.pageIndex = 1
+			this.isOver = false
+			this.loadingData = false
+			this.authorizeList = []
+			this.getList('refresh')
+		},
 		methods: {
 			//  生成授权码
 			creatAuthorize() {
@@ -73,9 +80,12 @@
 				}
 			},
 			//  获取列表数据
-			getList() {
+			getList(type) {
 				this.loadingData = true
 				NET.request(API.getAuthorizeList + this.pageIndex + '/10', {}, 'GET').then(res => {
+					if (type == 'refresh') {
+						uni.stopPullDownRefresh();
+					}
 					this.loadingData = false
 					this.isOver = res.data.list.length != 10
 					this.authorizeList = this.authorizeList.concat(res.data.list)

+ 15 - 3
pagesMain/couponList.vue

@@ -44,6 +44,13 @@
 			this.couponList = []
 			this.getList()
 		},
+		onPullDownRefresh() {
+			this.pageIndex = 1
+			this.isOver = false
+			this.loadingData = false
+			this.couponList = []
+			this.getList('refresh')
+		},
 		methods: {
 			//  新增优惠券
 			addCoupon() {
@@ -59,12 +66,15 @@
 				}
 			},
 			//  获取列表数据
-			getList() {
+			getList(type) {
 				this.loadingData = true
 				NET.request(API.getCouponList, {
 					pageIndex: this.pageIndex,
 					pageSize: 10,
 				}, 'GET').then(res => {
+					if (type == 'refresh') {
+						uni.stopPullDownRefresh();
+					}
 					this.loadingData = false
 					this.isOver = res.data.pageInfoResVo.list.length != 10
 					this.couponList = this.couponList.concat(res.data.pageInfoResVo.list)
@@ -201,9 +211,11 @@
 				}
 			}
 		}
-		/deep/.u-divider{
-			background-color: transparent!important;
+
+		/deep/.u-divider {
+			background-color: transparent !important;
 		}
+
 		.form-handle {
 			width: 100%;
 			height: 60px;

+ 9 - 1
pagesMain/messageList.vue

@@ -42,6 +42,11 @@
 			this.messageList = []
 			this.getMessageList()
 		},
+		onPullDownRefresh() {
+			this.pageIndex = 1
+			this.messageList = []
+			this.getMessageList('refresh')
+		},
 		methods: {
 			//  懒加载
 			handleLoadMore() {
@@ -51,11 +56,14 @@
 				}
 			},
 			//  获取全部留言
-			getMessageList() {
+			getMessageList(type) {
 				NET.request(API.getMessageList + this.pageIndex + '/10', {
 					flag: 2,
 					orderId: this.orderId
 				}, 'GET').then(res => {
+					if (type == 'refresh') {
+						uni.stopPullDownRefresh();
+					}
 					this.isOver = res.data.list.length != 10
 					this.messageList = this.messageList.concat(res.data.list)
 				}).catch(error => {

+ 10 - 1
pagesMain/orderList.vue

@@ -71,6 +71,12 @@
 			this['orderList' + (this.tabIndex + 1)] = []
 			this.getOrderList(this.tabIndex + 1)
 		},
+		onPullDownRefresh() {
+			this['pageIndex' + (this.tabIndex + 1)] = 1
+			this['isOver' + (this.tabIndex + 1)] = false
+			this['orderList' + (this.tabIndex + 1)] = []
+			this.getOrderList(this.tabIndex + 1, 'refresh')
+		},
 		methods: {
 			//  切换tab
 			changeTabs(index) {
@@ -92,10 +98,13 @@
 				}
 			},
 			//  获取全部订单
-			getOrderList(type) {
+			getOrderList(type, refresh) {
 				NET.request(API.getOrderList + this['pageIndex' + type] + '/10', {
 					flag: type,
 				}, 'GET').then(res => {
+					if (refresh == 'refresh') {
+						uni.stopPullDownRefresh();
+					}
 					this['isOver' + type] = res.data.list.length != 10
 					this['orderList' + type] = this['orderList' + type].concat(res.data.list)
 				}).catch(error => {