Browse Source

bug 修复

lilei 2 years ago
parent
commit
37cedf7793

+ 1 - 1
.hbuilderx/launch.json

@@ -4,7 +4,7 @@
     "configurations": [{
      	"app-plus" : 
      	{
-     		"launchtype" : "local"
+     		"launchtype" : "remote"
      	},
      	"default" : 
      	{

+ 9 - 1
App.vue

@@ -54,6 +54,7 @@
 			 
 			// 极光推送-打开debug
 			skJGPush.openDebug()
+			skJGPush.initCrashHandler()
 			 
 			// 极光推送-获取rid
 			skJGPush.getRegistrationID(result => {
@@ -66,11 +67,13 @@
 				// 点击通知
 				if(result.notificationEventType == 'notificationOpened'){
 					this.setRead(result)
-				}else{
+				}else if(result.notificationEventType == 'notificationArrived'){
 					if(bgAudioManager){
 						bgAudioManager.src = '/static/notes.mp3';
 						bgAudioManager.play()
 					}
+				}else{
+					
 				}
 			})
 			
@@ -78,6 +81,11 @@
 			skJGPush.addTagAliasListener(result => {
 				console.log('【业务addTagAliasListener】', result)
 			})	
+			
+			// 连接状态
+			skJGPush.addConnectEventListener(result => {
+				console.log('【连接状态】', result)
+			})
 		},
 		onShow: function() {
 			console.log('App Show')

+ 8 - 3
manifest.json

@@ -92,7 +92,7 @@
             "ios" : {
                 "idfa" : false,
                 "dSYMs" : false,
-                "UIBackgroundModes" : "audio,bluetooth-central",
+                "UIBackgroundModes" : "audio,bluetooth-central,remote-notification",
                 "privacyDescription" : {
                     //可选,JSON对象,iOS隐私信息访问的许可描述
                     "NSPhotoLibraryUsageDescription" : "为了方便识别产品二维码,需要开启相册", //可选,字符串类型,系统相册读取权限描述
@@ -106,7 +106,12 @@
             /* SDK配置 */
             "sdkConfigs" : {
                 "ad" : {},
-                "speech" : {}
+                "speech" : {},
+                "geolocation" : {
+                    "system" : {
+                        "__platform__" : [ "ios", "android" ]
+                    }
+                }
             },
             "icons" : {
                 "android" : {
@@ -204,7 +209,7 @@
                 }
             },
             "JG-JPush" : {
-                "JPUSH_ISPRODUCTION_IOS" : "false",
+                "JPUSH_ISPRODUCTION_IOS" : "",
                 "JPUSH_ADVERTISINGID_IOS" : "",
                 "JPUSH_DEFAULTINITJPUSH_IOS" : "true",
                 "JPUSH_OPPO_APPKEY" : "",

+ 1 - 1
pages/stockCheck/shelfList.vue

@@ -61,7 +61,7 @@
 					</view>
 				</view>
 				<view v-if="shelfList&&shelfList.length==0">
-					<u-empty v-if="status!='loading'" :src="`/static/${$config('themePath')}/def_no_data@3x.png`" icon-size="180" :text="noDataText" mode="list" :margin-top="50"></u-empty>
+					<u-empty v-if="status!='loading'" :src="`/static/${$config('themePath')}/def_no_data@3x.png`" icon-size="180" :text="noDataText" mode="list" :margin-top="100"></u-empty>
 				</view>
 				<view style="padding: 20upx;" v-if="shelfList.length">
 					<u-loadmore :status="status" />

+ 3 - 1
pages/stockCheck/startCheck.vue

@@ -6,7 +6,7 @@
 				<view class="shelfName">
 					<view>{{nowData.shelfName}}</view>
 				</view>
-				<view class="btns" @click="showTab = true">筛选<u-icon size="20" name="arrow-down"></u-icon></view>
+				<view v-if="placeTab.length" class="btns" @click="showTab = true">筛选<u-icon size="20" name="arrow-down"></u-icon></view>
 			</view>
 			<view class="search flex align_center">
 				<view class="input">
@@ -443,6 +443,8 @@
 					for(let a in res.data){
 						this.placeTab.push(a)
 					}
+					// 排序
+					this.placeTab.sort(function(a,b){ return (a+'').localeCompare(b+'');});
 					if(!flag){
 					  this.curTab = ''
 					}

+ 42 - 33
pages/xtNotice/xtNotice.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="container">
-		<view class="message" v-for="(item,index) in messageList" :key="item.id" @click="goToMessageDetail(item)">
+		<view class="message" v-for="(item,index) in messageList" :key="item.id" @click="setRead(item,0)">
 			<view class="message-cons">
 				<view class="flex align_center justify_between">
 					<view class="messageTitle">{{item.notice.title}}</view>
@@ -18,7 +18,7 @@
 				<view class="flex align_center justify_between">
 					<view class="messageTime flex_1">{{item.notice.releaseDate}}</view>
 					<view v-if="item.notice.type == 'tx'">
-						<u-button @click.stop="toAction(item)" shape="circle" plain size="mini" type="primary">
+						<u-button @click.stop="setRead(item,1)" shape="circle" plain size="mini" type="primary">
 						  {{ item.notice.extInfo.bizType == 'SHELF_REPLENISH' ? '立即处理':'点击查看' }}
 						</u-button>
 					</view>
@@ -26,7 +26,7 @@
 			</view>
 		</view>
 		<view class="nodata">
-			<u-empty :src="`/static/${$config('themePath')}/def_no_data@3x.png`" icon-size="150" text="暂无数据" img-width="120" v-if="messageList.length==0 && status!='loading'" mode="list"></u-empty>
+			<u-empty :src="`/static/${$config('themePath')}/def_no_data@3x.png`" :margin-top="100" icon-size="150" text="暂无数据" img-width="120" v-if="messageList.length==0 && status!='loading'" mode="list"></u-empty>
 			<u-loadmore :load-text="$config('loadText')" class="loadmore" v-if="total>pageSize || status=='loading'" :status="status" />
 		</view>
 	</view>
@@ -87,6 +87,12 @@
 					pageSize: this.pageSize
 				}).then(res => {
 					if (res.status == 200) {
+						res.data.list.map(item => {
+							if(item.notice.type == 'tx'){
+								item.notice.extInfo = JSON.parse(item.notice.extInfo)
+							}
+						})
+						
 						if(this.pageNo>1){
 							this.messageList = this.messageList.concat(res.data.list || [])
 						}else{
@@ -102,52 +108,55 @@
 						})
 					}
 					this.status = "loadmore"
-					
-					this.messageList.map(item => {
-						if(item.notice.type == 'tx'){
-							item.notice.extInfo = JSON.parse(item.notice.extInfo)
-						}
-					})
 				})
 			},
-			setRead(item){
+			setRead(data,type){
 				//设置为已读
-				if (item.readFlag==0){
-				  hasRead({msg_id: item.id}).then(res => {
+				if (data.readFlag==0){
+				  hasRead({msg_id: data.id}).then(res => {
 					// 刷新列表
 					if (res.status == 200){
 					    this.pageInit()
+						if(data.notice&&data.notice.type == 'tx' && type == 1){
+							this.toAction(data)
+						}else{
+							this.goToMessageDetail(data)
+						}
 					}
 				  })
+				}else{
+					if(data.notice&&data.notice.type == 'tx' && type == 1){
+						this.toAction(data)
+					}else{
+						this.goToMessageDetail(data)
+					}
 				}
 			},
 			// 查看详细
-			goToMessageDetail(item){
-				this.setRead(item)
+			goToMessageDetail(data){
 				// 跳转到详细页
 				uni.navigateTo({
-				 	url:'./xtNoticeDetail/xtNoticeDetail?item='+ encodeURIComponent(JSON.stringify(item))
+				 	url:'./xtNoticeDetail/xtNoticeDetail?item='+ encodeURIComponent(JSON.stringify(data))
 				})
 			},
 			toAction (data) {
-			  this.setRead(data)
-			  // 急送订单
-			  if (data.notice.extInfo.bizType == 'TEMP_ORDER') {
-				uni.navigateTo({ url: '/pages/sales/edit?pageType=detail&data='+JSON.stringify({ salesBillSn: data.notice.extInfo.bizSn }) })
-			  }
-			  // 补货订单
-			  if (data.notice.extInfo.bizType == 'SHELF_REPLENISH') {
-				uni.navigateTo({ url: '/pages/replenishmentManage/replenishmentList?billState=WAIT_CONFIRM' })
-			  }
-			  // 货架订单
-			  if (data.notice.extInfo.bizType == 'SHELF_ORDER') {
-				uni.navigateTo({ url: '/pages/shelfOrder/orderDetail?pageType=detail&orderBillSn='+data.notice.extInfo.bizSn })
-			  }
-			  // 货架异常
-			  if (data.notice.extInfo.bizType == 'SHELF_WARN') {
-				const shelfName = data.notice.plainContent.split('已经超过')[0]
-				uni.navigateTo({ url: '/pages/shelfOrder/shelfOrder?bizType=SHELF_WARN&shelfSn='+data.notice.extInfo.bizSn+'&shelfName='+shelfName })
-			  }
+				// 急送订单
+				if (data.notice.extInfo.bizType == 'TEMP_ORDER') {
+					uni.navigateTo({ url: '/pages/sales/edit?pageType=detail&data='+JSON.stringify({ salesBillSn: data.notice.extInfo.bizSn }) })
+				}
+				// 补货订单
+				if (data.notice.extInfo.bizType == 'SHELF_REPLENISH') {
+					uni.navigateTo({ url: '/pages/replenishmentManage/replenishmentList?billState=WAIT_CONFIRM' })
+				}
+				// 货架订单
+				if (data.notice.extInfo.bizType == 'SHELF_ORDER') {
+					uni.navigateTo({ url: '/pages/shelfOrder/orderDetail?pageType=detail&orderBillSn='+data.notice.extInfo.bizSn })
+				}
+				// 货架异常
+				if (data.notice.extInfo.bizType == 'SHELF_WARN') {
+					const shelfName = data.notice.plainContent.split('已经超过')[0]
+					uni.navigateTo({ url: '/pages/shelfOrder/shelfOrder?bizType=SHELF_WARN&shelfSn='+data.notice.extInfo.bizSn+'&shelfName='+shelfName })
+				}
 			},
 		},
 		onLoad() {

+ 1 - 1
pages/xtNotice/xtNoticeDetail/xtNoticeDetail.vue

@@ -38,7 +38,7 @@
 		onLoad(options) {
 			let  item = JSON.parse(options.item)
 			this.item = Object.assign(this.item,item)
-			this.item.notice.extInfo = JSON.parse(this.item.notice.extInfo)
+			// this.item.notice.extInfo = JSON.parse(this.item.notice.extInfo)
 			console.log(item)
 		},
 		methods:{