Browse Source

离线push解绑

devlop
邓雄飞 4 years ago
parent
commit
88a9775295
5 changed files with 29 additions and 6 deletions
  1. 10
      App.vue
  2. 11
      apis/commonApi.js
  3. 5
      pages.json
  4. 2
      pages/setting/index.vue
  5. 7
      utils/hook.js

10
App.vue

@ -37,7 +37,7 @@ export default {
let title = msg.title let title = msg.title
let payload = JSON.stringify(msg.payload) let payload = JSON.stringify(msg.payload)
plus.push.createMessage(content, payload, { plus.push.createMessage(content, payload, {
title: title,
title: title
}) })
} }
} }
@ -45,9 +45,13 @@ export default {
let title = msg.title let title = msg.title
let content = msg.content let content = msg.content
plus.push.createMessage(content, JSON.stringify(msg.payload), { plus.push.createMessage(content, JSON.stringify(msg.payload), {
title: title,
title: title
}) })
} }
// 线
// if(mes.payload.messageType == 1){
// }
}, },
false false
) )
@ -58,7 +62,7 @@ export default {
// //
plus.runtime.setBadgeNumber(0) plus.runtime.setBadgeNumber(0)
}, },
onHide: function () {},
onHide: function () {}
} }
</script> </script>

11
apis/commonApi.js

@ -129,6 +129,17 @@ export function pushCustomerBind(cid, platformType = 'android', appId = XAPPID)
}) })
} }
/**
* 推送客户绑定
*
*/
export function pushCustomerOff(cid, platformType = 'android', appId = XAPPID) {
return http.post({
url: '/base-paper-trading/user/geTui/offline',
data: { cid, appId, platformType }
})
}
/** /**
* 营业执照OCR识别 photoUrl * 营业执照OCR识别 photoUrl
*/ */

5
pages.json

@ -63,7 +63,10 @@
"style": { "style": {
"navigationBarTitleText": "登录", "navigationBarTitleText": "登录",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationStyle": "custom"
"navigationStyle": "custom",
"app-plus": {
"softinputMode": "adjustResize"
}
} }
}, },
{ {

2
pages/setting/index.vue

@ -28,7 +28,7 @@
</template> </template>
<script> <script>
import { back, go2, uploadFile, exit } from '@/utils/hook.js'
import { back, go2, exit } from '@/utils/hook.js'
export default { export default {
data() { data() {
return { return {

7
utils/hook.js

@ -1,6 +1,6 @@
import store from '@/store/index' import store from '@/store/index'
import { uploadUrl, XAPPID } from '@/enums/index.js' import { uploadUrl, XAPPID } from '@/enums/index.js'
import { pushCustomerOff } from '@/apis/commonApi'
// 框架方法封装 // 框架方法封装
const tabList = ['client', 'trade', 'mall', 'mine'] const tabList = ['client', 'trade', 'mall', 'mine']
@ -89,6 +89,11 @@ export function loginGo2(url, data = {}, isRedirect) {
*/ */
export function exit(redirect = false) { export function exit(redirect = false) {
store.dispatch('logout') store.dispatch('logout')
// #ifdef APP-PLUS
let cid = plus.push.getClientInfo().clientid
let platform = uni.getSystemInfoSync().platform
pushCustomerOff(cid, platform)
// #endif
go2('login', {}, redirect) go2('login', {}, redirect)
} }

Loading…
Cancel
Save