lilei 2 gadi atpakaļ
vecāks
revīzija
b4cdf19a47

+ 11 - 9
App.vue

@@ -25,6 +25,7 @@
 		},
 		onLaunch: function() {
 			console.log('App launch')
+			let bgAudioManager = uni.getBackgroundAudioManager();
 			if(uni.getSystemInfoSync().platform == "ios"){
 				// 请求定位权限
 				let locationServicesEnabled = skJGPush.locationServicesEnabled()
@@ -46,10 +47,10 @@
 						skJGPush.openSettingsForNotification()
 					}
 				})
+			}else{
+				// 极光推送-init
+				skJGPush.initJPushService()
 			}
-			
-			// 极光推送-init
-			skJGPush.initJPushService()
 			 
 			// 极光推送-打开debug
 			skJGPush.openDebug()
@@ -62,20 +63,21 @@
 			// 极光推送-通知事件回调
 			skJGPush.addNotificationListener(result => {
 				console.log('【业务addNotificationListener】', result)
-				// 收到消息,创建本地通知
+				// 点击通知
 				if(result.notificationEventType == 'notificationOpened'){
 					this.setRead(result)
-				} 
+				}else{
+					if(bgAudioManager){
+						bgAudioManager.src = '/static/notes.mp3';
+						bgAudioManager.play()
+					}
+				}
 			})
 			
 			// 极光推送-标签别名事件回调
 			skJGPush.addTagAliasListener(result => {
 				console.log('【业务addTagAliasListener】', result)
 			})	
-			
-			skJGPush.isNotificationEnabled(result => {
-				console.log('是否开启通知', result)
-			})
 		},
 		onShow: function() {
 			console.log('App Show')

+ 15 - 0
api/user.js

@@ -10,6 +10,14 @@ export const login = params => {
 	data: params
   },true)
 };
+// 注册
+export const register = params => {
+  return axios.request({
+    url: 'register',
+    method: 'post',
+    data: params
+  }, true)
+}
 // 退出
 export const logout = params => {
   return axios.request({
@@ -140,6 +148,13 @@ export const getMessage = params => {
     method: 'post'
   })
 }
+// 设置所有已读
+export const setReadAllNotice = params => {
+  return axios.request({
+    url: `noticeUser/setReadAllNotice`,
+    method: 'get'
+  })
+}
 // 获取用户信息
 export const getUserInfo = params => {
   return axios.request({

+ 3 - 2
libs/axios.js

@@ -1,5 +1,6 @@
 import { objToUrl } from '@/libs/tools.js';
 const baseUrl = getApp().globalData.baseUrl
+import store from '@/store/index.js'
 //带Token请求
 const request = (opts, hasToken) => {
 	const authorization = getApp().globalData.token
@@ -57,11 +58,11 @@ const request = (opts, hasToken) => {
 					if(ret.status == '401' || ret.status == '1099'){  //  未登录或登录过期
 					   uni.showToast({
 					   	icon:'none',
-					   	title: '未登录或登录已过期,请重新登录',
+					   	title: '登录已过期,请重新登录',
 					   	duration: 5000 
 					   })
+					   store.state.vuex_token = ''
 					   setTimeout(function() {
-					   	const currentRoute = getRoutePath();
 					   	const url = `/pages/login/login`
 					   	uni.redirectTo({ url })
 					   }, 1000)

+ 4 - 8
manifest.json

@@ -73,6 +73,7 @@
                     "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
                     "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
                     "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
+                    "<uses-permission android:name=\"android.permission.INTERNET\"/>",
                     "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
                     "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
                     "<uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/>",
@@ -82,6 +83,7 @@
                     "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
                     "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
                     "<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
+                    "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
                     "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
                 ],
                 "abiFilters" : [ "armeabi-v7a", "arm64-v8a" ]
@@ -104,13 +106,7 @@
             /* SDK配置 */
             "sdkConfigs" : {
                 "ad" : {},
-                "speech" : {
-                    "baidu" : {
-                        "appid" : "27051620",
-                        "apikey" : "uFrhrEO2NhtO72CKuRYB9MNt",
-                        "secretkey" : "GWNVXBvBY21B7h2PvB6pvmXTgN6jdndR"
-                    }
-                }
+                "speech" : {}
             },
             "icons" : {
                 "android" : {
@@ -208,7 +204,7 @@
                 }
             },
             "JG-JPush" : {
-                "JPUSH_ISPRODUCTION_IOS" : "",
+                "JPUSH_ISPRODUCTION_IOS" : "false",
                 "JPUSH_ADVERTISINGID_IOS" : "",
                 "JPUSH_DEFAULTINITJPUSH_IOS" : "true",
                 "JPUSH_OPPO_APPKEY" : "",

+ 16 - 2
pages.json

@@ -13,7 +13,7 @@
 			"path": "pages/login/apply-trial",  //  申请试用
 			"style": {
 				"navigationStyle": "default",  //  是否显示导航栏  default显示,custom不显示
-				"navigationBarTitleText": "申请试用"
+				"navigationBarTitleText": "申请注册"
 			}
 		},
 		{
@@ -53,7 +53,21 @@
 		{
 			"path": "pages/xtNotice/xtNotice",		//  我的>消息
 			"style": {
-				"navigationBarTitleText": "消息"
+				"navigationBarTitleText": "消息",
+				"navigationStyle":"custom",
+				"app-plus":{
+					"titleNView": {
+						"titleAlign": "left",
+						"buttons": [ //原生标题栏按钮配置,
+							{
+								"text": "设置全部已读" ,//原生标题栏增加分享按钮,点击事件可通过页面的 onNavigationBarButtonTap 函数进行监听u
+								"fontSize": "14",
+								"color": "#00aaff",
+								"width":"100px"
+							}
+						]
+					}
+				}
 			}
 		},
 		{

+ 3 - 2
pages/login/apply-trial.vue

@@ -28,6 +28,7 @@
 <script>
 	import Address from '@/components/address.vue'
 	import { clzConfirm } from '@/libs/tools.js'
+	import { register } from '@/api/user.js'
 	export default{
 		components: {
 			Address,
@@ -101,7 +102,7 @@
 				uni.showLoading({
 					title: '正在提交申请...'
 				})
-				setTimeout(() => {
+				register(obj).then(res => {
 					uni.hideLoading()
 					clzConfirm({
 					    title: '提示',
@@ -115,7 +116,7 @@
 					        }
 					    }
 					})
-				},500)
+				})
 			},
 			//  选择省区市
 			areaConfirm(e) {

+ 4 - 3
pages/login/login.vue

@@ -24,7 +24,7 @@
 				</view>
 				<view class="form-btn-con">
 					<button class="form-btn" :disabled="isDisabled" :style="{'background':isDisabled?'#e5e5e5':$config('primaryColor')}" form-type="submit">登录</button>
-					<text class="apply-btn" @click="applyTrial">没有账号?马上申请试用</text>
+					<text class="apply-btn" v-if="isIos" @click="applyTrial">没有账号?请申请注册</text>
 				</view>
 			</form>
 		</view>
@@ -59,7 +59,8 @@ export default {
 			isAuthuserYs: false, // 是否同意隐私政策
 			envTips: '',
 			showEnvTips: false,
-			theme: ''
+			theme: '',
+			isIos: false
 		};
 	},
 	computed: {
@@ -69,10 +70,10 @@ export default {
 	},
 	onLoad() {
 		const token = this.$store.state.vuex_token
-		console.log(token)
 		if(token){
 			this.toMain();
 		}
+		this.isIos = uni.getSystemInfoSync().platform == "ios"
 	},
 	onShow() {
 		this.isRemember = this.$store.state.vuex_isRemember;

+ 23 - 7
pages/xtNotice/xtNotice.vue

@@ -13,7 +13,7 @@
 					</view>
 				</view>
 				<view class="ellipsis-one message-info">
-					{{item.notice.content|filterHtml}}
+					{{item.notice.plainContent}}
 				</view>
 				<view class="flex align_center justify_between">
 					<view class="messageTime flex_1">{{item.notice.releaseDate}}</view>
@@ -33,7 +33,7 @@
 </template>
 
 <script> 
-	import {getMessage,hasRead} from "@/api/user.js"
+	import {getMessage,hasRead,setReadAllNotice} from "@/api/user.js"
 	export default{
 		data(){
 			return{
@@ -52,8 +52,7 @@
 		watch: {
 			// 有新消息时刷新列表
 			wsMessage(newValue, oldValue) {
-				this.pageNo = 1
-				this.getMessageList()
+				this.pageInit()
 			}
 		},
 		filters: {
@@ -61,7 +60,25 @@
 				return str?str.replace(/<.*?>/g,""):""
 			}
 		},
+		onNavigationBarButtonTap(e) {
+			uni.showLoading({
+				mask:true,
+				title: '正在设置...'
+			})
+			setReadAllNotice().then(res => {
+				if(res.status == 200){
+					uni.hideLoading()
+					this.pageInit()
+				}
+			})
+		},
 		methods:{
+			pageInit(){
+				this.messageList = []
+				this.total = 0
+				this.pageNo = 1
+				this.getMessageList()
+			},
 			// 获取数据列表
 			getMessageList(){
 				this.status = "loading"
@@ -99,8 +116,7 @@
 				  hasRead({msg_id: item.id}).then(res => {
 					// 刷新列表
 					if (res.status == 200){
-					  this.pageNo = 1
-					  this.getMessageList()
+					    this.pageInit()
 					}
 				  })
 				}
@@ -135,7 +151,7 @@
 			},
 		},
 		onLoad() {
-			this.getMessageList()
+			this.pageInit()
 		},
 		// scroll-view到底部加载更多
 		onReachBottom(){

BIN
static/notes.mp3


BIN
证书/ios/push-dev证书.p12


BIN
证书/ios/push-pro证书.p12


BIN
证书/ios/push_dev证书.p12


BIN
证书/ios/push_pro证书.p12


BIN
证书/ios/发布证书/distributioh证书.p12


BIN
证书/ios/发布证书/iscmApp_pro.mobileprovision


BIN
证书/ios/发布证书/pro证书.p12


BIN
证书/ios/开发证书/dev证书.p12


BIN
证书/ios/开发证书/iscmApp.mobileprovision


BIN
证书/ios/开发证书/证书.p12