Parcourir la source

小程序版本更新

Xiao_123 il y a 6 mois
Parent
commit
34d859651a
3 fichiers modifiés avec 29 ajouts et 3 suppressions
  1. 23 0
      App.vue
  2. 5 2
      pagesA/interview/index.vue
  3. 1 1
      pagesA/vip/index.vue

+ 23 - 0
App.vue

@@ -3,6 +3,29 @@
 		onLaunch: function() {
 			console.log('App Launch')
 			uni.setStorageSync('firstOpen', true)
+
+			const updateManager = uni.getUpdateManager();
+			updateManager.onCheckForUpdate(function(res){});
+			
+			updateManager.onUpdateReady(function(res){
+				uni.showModal({
+					title: '更新提示',
+					content:'发现新版本,是否重启应用',
+					success(res) {
+						if(res.confirm) {
+							updateManager.applyUpdate();
+						}
+					}
+				})
+			});
+			
+			updateManager.onUpdateFailed(function(res) {
+				//新本版下载失败
+				uni.showModal({
+					title:'失败提示',
+					content:'新版本下载失败,请手动删掉小程序后重新搜索进入小程序'
+				})
+			})
 		},
 		onShow: function() {
 			console.log('App Show')

+ 5 - 2
pagesA/interview/index.vue

@@ -46,7 +46,11 @@ const type = ref('')
 const id = ref(null)
 
 onLoad((options) => {
-  if (options?.index) current.value = Number(options.index)
+  if (options?.index) {
+    current.value = Number(options.index)
+    items.value = []
+  }
+  getList()
 })
 
 const getList = async () => {
@@ -68,7 +72,6 @@ const getList = async () => {
   // more.value = list?.length < queryParams.value.pageSize ? 'noMore' : 'more'
   more.value = list?.length === +data.total ? 'noMore' : 'more'
 }
-getList()
 
 const handleChange = (e) => {
   items.value = []

+ 1 - 1
pagesA/vip/index.vue

@@ -43,7 +43,7 @@ const baseInfo = computed(() => useUserStore?.baseInfo)
 const userInfo = computed(() => useUserStore?.userInfo)
 
 let list = [
-	{	title: '简历刷新次数', key: 'resumeRefreshCount', show: true,	path: '/pagesA/vip/template/index'	},					
+	{	title: '简历模板', key: 'resumeRefreshCount', show: true,	path: '/pagesA/vip/template/index'	},					
 	{	title: '简历模板', key: 'resumeTemplate', show: false,	path: '/pagesA/vip/template/index'	},					
 	{	title: '屏蔽企业', key: 'viewersList', show: true,	path: '/pagesA/vip/blockEnt/index'	},			
 ]