冲突
This commit is contained in:
parent
d44cd1516a
commit
ea320f4e54
132
App.vue
132
App.vue
@ -73,80 +73,80 @@ export default {
|
|||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// uni-app客户端获取push客户端标记,代码可以实现在App.vue中
|
// uni-app客户端获取push客户端标记,代码可以实现在App.vue中
|
||||||
uni.getPushClientId({
|
// uni.getPushClientId({
|
||||||
success: (res) => {
|
// success: (res) => {
|
||||||
let push_clientid = res.cid
|
// let push_clientid = res.cid
|
||||||
uni.setStorageSync("push_clientid", push_clientid)
|
// uni.setStorageSync("push_clientid", push_clientid)
|
||||||
console.log('客户端推送标识cid:',push_clientid)
|
// console.log('客户端推送标识cid:',push_clientid)
|
||||||
|
|
||||||
const systemInfo = uni.getSystemInfoSync();
|
// const systemInfo = uni.getSystemInfoSync();
|
||||||
console.log("systemInfo:", systemInfo)
|
// console.log("systemInfo:", systemInfo)
|
||||||
|
|
||||||
|
|
||||||
let userInfo= uni.getStorageSync('userInfo')
|
// let userInfo= uni.getStorageSync('userInfo')
|
||||||
console.log("userinfo:", userInfo)
|
// console.log("userinfo:", userInfo)
|
||||||
if(!userInfo){
|
// if(!userInfo){
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
if(userInfo.uuid){
|
// if(userInfo.uuid){
|
||||||
let client_type = ""
|
// let client_type = ""
|
||||||
if (systemInfo.platform === 'android') {
|
// if (systemInfo.platform === 'android') {
|
||||||
client_type = "A"
|
// client_type = "A"
|
||||||
} else if (systemInfo.platform === 'ios') {
|
// } else if (systemInfo.platform === 'ios') {
|
||||||
client_type = "I"
|
// client_type = "I"
|
||||||
}
|
// }
|
||||||
console.log("client_type:", client_type)
|
// console.log("client_type:", client_type)
|
||||||
if(client_type){
|
// if(client_type){
|
||||||
my_api.addUniappCid({
|
// my_api.addUniappCid({
|
||||||
user_uuid: userInfo.uuid,
|
// user_uuid: userInfo.uuid,
|
||||||
client_type:client_type,
|
// client_type:client_type,
|
||||||
cid: push_clientid
|
// cid: push_clientid
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
fail(err) {
|
// fail(err) {
|
||||||
console.error("unipush: ", err)
|
// console.error("unipush: ", err)
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
|
|
||||||
|
|
||||||
uni.onPushMessage((res)=>{
|
// uni.onPushMessage((res)=>{
|
||||||
console.log("收到推送消息:", res)
|
// console.log("收到推送消息:", res)
|
||||||
|
|
||||||
let app_isback = uni.getStorageSync("app_isback")
|
// let app_isback = uni.getStorageSync("app_isback")
|
||||||
console.log("app_isback:", app_isback)
|
// console.log("app_isback:", app_isback)
|
||||||
uni.showModal({
|
// uni.showModal({
|
||||||
title: res.data.title,
|
// title: res.data.title,
|
||||||
content: res.type,
|
// content: res.type,
|
||||||
showCancel: false
|
// showCancel: false
|
||||||
});
|
// });
|
||||||
|
|
||||||
if(res.type === 'click' ){
|
// if(res.type === 'click' ){
|
||||||
|
|
||||||
}else{
|
// }else{
|
||||||
if(app_isback){
|
// if(app_isback){
|
||||||
uni.createPushMessage({
|
// uni.createPushMessage({
|
||||||
title: res.data.title,
|
// title: res.data.title,
|
||||||
content: res.data.content,
|
// content: res.data.content,
|
||||||
payload: res.data.payload,
|
// payload: res.data.payload,
|
||||||
delay: 1,
|
// delay: 1,
|
||||||
success: (res) => {
|
// success: (res) => {
|
||||||
console.log("创建推送消息成功", res)
|
// console.log("创建推送消息成功", res)
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
}else{
|
// }else{
|
||||||
console.log('[App] emit global-dialog:show', res)
|
// console.log('[App] emit global-dialog:show', res)
|
||||||
uni.$emit('global-dialog:show', {
|
// uni.$emit('global-dialog:show', {
|
||||||
title: res.data.title || '消息通知',
|
// title: res.data.title || '消息通知',
|
||||||
content: res.data.content || '',
|
// content: res.data.content || '',
|
||||||
confirmText: '我知道了',
|
// confirmText: '我知道了',
|
||||||
position: 'top',
|
// position: 'top',
|
||||||
offsetTop: '160rpx'
|
// offsetTop: '160rpx'
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
|
|
||||||
/** 设置语言 (此处为了方便demo切换语言,将其存到本地,实际需根据业务情况设置)*/
|
/** 设置语言 (此处为了方便demo切换语言,将其存到本地,实际需根据业务情况设置)*/
|
||||||
setLanguage(
|
setLanguage(
|
||||||
|
|||||||
@ -21,13 +21,8 @@
|
|||||||
"Payment" : {},
|
"Payment" : {},
|
||||||
"Share" : {},
|
"Share" : {},
|
||||||
"Webview-x5" : {},
|
"Webview-x5" : {},
|
||||||
<<<<<<< HEAD
|
|
||||||
"UIWebview" : {}
|
|
||||||
=======
|
|
||||||
"UIWebview" : {},
|
"UIWebview" : {},
|
||||||
"Push" : {},
|
|
||||||
"VideoPlayer" : {}
|
"VideoPlayer" : {}
|
||||||
>>>>>>> 2532aa055c0df42bb4696ce75410718e31df24d1
|
|
||||||
},
|
},
|
||||||
/* 模块配置 */
|
/* 模块配置 */
|
||||||
"distribute" : {
|
"distribute" : {
|
||||||
@ -82,23 +77,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"speech" : {},
|
"speech" : {},
|
||||||
<<<<<<< HEAD
|
|
||||||
"push" : {}
|
"push" : {}
|
||||||
=======
|
|
||||||
"push" : {
|
|
||||||
"unipush" : {
|
|
||||||
"version" : "2",
|
|
||||||
"offline" : false,
|
|
||||||
"honor" : {},
|
|
||||||
"meizu" : {},
|
|
||||||
"mi" : {},
|
|
||||||
"vivo" : {},
|
|
||||||
"oppo" : {},
|
|
||||||
"hms" : {},
|
|
||||||
"fcm" : {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>>>>>>> 2532aa055c0df42bb4696ce75410718e31df24d1
|
|
||||||
},
|
},
|
||||||
"splashscreen" : {
|
"splashscreen" : {
|
||||||
"androidStyle" : "common",
|
"androidStyle" : "common",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user