소스 검색

[dev]
1、增加lodash.debounce
2、改了一半的app中的下拉刷新
3、完成改成完成释放,释放后增加消息提醒

Neo 1 년 전
부모
커밋
c46b1e2092
3개의 변경된 파일26개의 추가작업 그리고 4개의 파일을 삭제
  1. 1 0
      package.json
  2. 19 2
      pages.json
  3. 6 2
      pages/index/index.vue

+ 1 - 0
package.json

@@ -18,6 +18,7 @@
     },
     "dependencies": {
         "encoding": "^0.1.13",
+        "lodash.debounce": "^4.0.8",
         "vue3-print-nb": "^0.1.4"
     }
 }

+ 19 - 2
pages.json

@@ -6,14 +6,31 @@
             "style" : {
                 "navigationBarTitleText" : "",
                 "enablePullDownRefresh" : false,
-                "navigationStyle" : "custom"
+                "navigationStyle" : "custom",
+								"enablePullDownRefresh" : true
             }
         },
         {
             "path" : "pages/index/index",
             "style" : {
                 // "navigationBarTitleText": "uni-app",
-                "navigationStyle" : "custom"
+                "navigationStyle" : "custom",
+								"app-plus": {
+									"pullToRefresh": {
+										"support": true,
+										"color": "#ff3333",
+										"style": "default",
+										"contentdown": {
+											"caption": "下拉获取最新数据"
+										},
+										"contentover": {
+											"caption": "释放下拉获取最新数据"
+										},
+										"contentrefresh": {
+											"caption": "正在下拉获取最新数据"
+										}
+									}
+								}
             }
         },
         {

+ 6 - 2
pages/index/index.vue

@@ -16,7 +16,7 @@
 						</view>
 						<button type="primary" @click="handleSearch" class="search-button">搜 索</button>
 						<button type="primary" v-if="s=='1'" :disabled="workStatus==='1'?false:true" @click="handleRefresh" :class="workStatus==='1'?'refresh':'refresh active'">{{ccc}}</button>
-						<button type="primary" v-else  @click="handleRelease" :class="'refresh'">完成</button>
+						<button type="primary" v-else  @click="handleRelease" :class="'refresh'">完成释放</button>
 					</view>
 					<view v-else class="history">
 						<view class="searchchoice">
@@ -105,7 +105,7 @@
 import NavBar from "@/components/nav-bar/nav-bar.vue"
 import OrderCard from "@/components/order-card/order-card.vue"
 import { onMounted,ref, getCurrentInstance } from 'vue'
-import { onLoad } from "@dcloudio/uni-app"
+import { onLoad, onPullDownRefresh } from "@dcloudio/uni-app"
 import {receiveOrderList, selectDepartment } from "@/static/js/api.js"
 import {releaseOrder} from "@/static/js/request.js"
 import debounce from 'lodash.debounce'
@@ -368,7 +368,10 @@ const handleRelease  = debounce(async()=>{
 				}
 			})
 			ids.value = []
+			uni.$showMsg(res.msg, 2000)
 		}
+	} else {
+		uni.$showMsg(res.msg, 2000)
 	}
 	s.value = '1'
 	console.log('after handleRelease ids.value', ids.value)
@@ -596,6 +599,7 @@ const loadMoreList = debounce(async()=>{
 	}
 },500)
 
+ 
 const loadPreList = debounce(async()=>{
 	console.log('loadPreList>>>')
 	page.value = 1