1.对接安卓app 推送通知

huipay-app-dev
杨杰 1 year ago
parent 9b8ae23c76
commit aeae307634
  1. 24
      App.vue
  2. 13
      Utils/Api.js
  3. 12
      manifest.json
  4. 76
      pages.json
  5. 1
      pages/index/collectNotes/collectNotes.vue
  6. 9
      pages/index/serviceApplicationList/serviceApplicationList.vue
  7. 13
      pages/login/login.vue
  8. 194
      pages/tabBar/home/home.vue
  9. 2
      pages/welcome/welcome.vue

@ -4,11 +4,11 @@
// url: 'http://192.168.3.4:9301/crest',
// imgUrl: 'https://192.168.3.4:9301/filesystem/',
//
// url: 'https://pay.dctpay.com/crest',
// imgUrl: 'https://gratia-pay.obs.cn-southwest-2.myhuaweicloud.com',
url: 'https://pay.dctpay.com/crest',
imgUrl: 'https://gratia-pay.obs.cn-southwest-2.myhuaweicloud.com',
//
url: 'https://gratia-pay.dctpay.com/crest',
imgUrl: 'https://gratia-pay-test.obs.cn-east-3.myhuaweicloud.com',
// url: 'https://gratia-pay.dctpay.com/crest',
// imgUrl: 'https://gratia-pay-test.obs.cn-east-3.myhuaweicloud.com',
userInfo: "",
openId: '',
h5code: '',
@ -38,16 +38,10 @@
//
storeAddress: ''
},
onLaunch: function() {
uni.getPushClientId({
success: res => {
console.log('=========='+res.cid)
},
fail(err) {
console.log(err)
}
})
onLaunch: function() {
// uni.onPushMessage((res) => {
// console.log("", res) //
// })
let that = this;
uni.getStorage({
key: 'payuser',
@ -62,6 +56,8 @@
}
});
},
onShow: function() {},
onHide: function() {}

@ -270,8 +270,19 @@ export const configRosterRate = params => {
export const reconsider = params => {
return POST('POST', `${base}/mer/reconsider`, params).then(res => res.data);
}
//根据商户查询结算
export const getSettleAcctByMer = params => {
return POST('GET', `${base}/merSettleAcct/getSettleAcctByMer`, params).then(res => res.data);
}
//上传cid
export const uniPush = params => {
return POST('GET', `${base}/test/uniPush`, params).then(res => res.data);
}
//绑定门店关系
export const connectStoreCid = params => {
return POST('POST', `${base}/storeCid/connectStoreCid`, params).then(res => res.data);
}
//结束播报语音
export const voiceSucceed = params => {
return POST('GET', `${base}/storeCid/voiceSucceed`, params).then(res => res.data);
}

@ -43,16 +43,18 @@
]
},
/* ios */
"ios" : {},
"ios" : {
"dSYMs" : false
},
/* SDK */
"sdkConfigs" : {
"push" : {
"unipush" : {
"version" : "2",
"offline" : true,
"oppo" : {}
"offline" : false,
"hms" : {}
}
}
},
"ad" : {}
},
"icons" : {
"android" : {

@ -11,7 +11,7 @@
"path": "pages/login/login",
"style": {
"navigationBarTitleText": "登录",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee",
@ -23,7 +23,7 @@
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "设备申请列表",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -34,7 +34,7 @@
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "订单详情",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -45,7 +45,7 @@
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "我的设备",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -56,7 +56,7 @@
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "首页",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -65,7 +65,7 @@
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "首页",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -75,7 +75,7 @@
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "个人中心",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -85,7 +85,7 @@
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "门店管理",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -96,7 +96,7 @@
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "商户详情",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -107,7 +107,7 @@
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "商户进件",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -120,7 +120,7 @@
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "消息中心",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -131,7 +131,7 @@
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "经营品类",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -142,7 +142,7 @@
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "商户管理",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -153,7 +153,7 @@
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "门店信息",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -163,7 +163,7 @@
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "添加门店",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -174,7 +174,7 @@
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "收费记录",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -185,7 +185,7 @@
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "商户类别",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -196,7 +196,7 @@
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "收款记录",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -207,7 +207,7 @@
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "门店管理",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -218,7 +218,7 @@
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "绑定设备",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -229,7 +229,7 @@
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "绑定设备",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -240,7 +240,7 @@
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "绑定二维码",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -251,7 +251,7 @@
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "二维码列表",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -261,7 +261,7 @@
"style": {
"navigationBarTitleText": "设备订单",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -272,7 +272,7 @@
"style": {
"navigationBarTitleText": "选择支行",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -283,7 +283,7 @@
"style": {
"navigationBarTitleText": "开通分账",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -294,7 +294,7 @@
"style": {
"navigationBarTitleText": "绑定接收方",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -305,7 +305,7 @@
"style": {
"navigationBarTitleText": "绑定分账接收方",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -316,7 +316,7 @@
"style": {
"navigationBarTitleText": "接收方列表",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -327,7 +327,7 @@
"style": {
"navigationBarTitleText": "选择地址",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -338,7 +338,7 @@
"style": {
"navigationBarTitleText": "修改结算信息",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -349,7 +349,7 @@
"style": {
"navigationBarTitleText": "结算信息",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -360,7 +360,7 @@
"style": {
"navigationBarTitleText": "结算详情",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -371,7 +371,7 @@
"style": {
"navigationBarTitleText": "分配桌码",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -382,7 +382,7 @@
"style": {
"navigationBarTitleText": "权益活动",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -393,7 +393,7 @@
"style": {
"navigationBarTitleText": "活动详情",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -404,7 +404,7 @@
"style": {
"navigationBarTitleText": "活动审核",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"
@ -415,7 +415,7 @@
"style": {
"navigationBarTitleText": "订单详情",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#6fbdee",
"backgroundColorTop": "#6fbdee"

@ -160,7 +160,6 @@
uni.hideLoading()
return false;
}
console.log('1111111111');
let a = new Date(this.startdate).getTime();
let b = new Date(this.enddate).getTime();
let startTime = a - 28800000;

@ -77,10 +77,13 @@
})
},
//
jumpaddservice() {
uni.navigateTo({
url: '../addService/addService'
jumpaddservice() {
uni.showToast({
title:'请前往微信小程序申请设备'
})
// uni.navigateTo({
// url: '../addService/addService'
// })
},
//
jumpdetails(item) {

@ -10,7 +10,7 @@
<wInput v-model="phoneData" type="text" placeholder="用户名/电话" :focus="isFocus"></wInput>
<wInput v-model="passData" type="password" placeholder="密码" isShowPass="true"></wInput>
</view>
<wButton class="wbutton" text="登 录" bgColor="#089bf5" :rotate="isRotate" @click="startLogin"></wButton>
<wButton class="wbutton" text="登 录" bgColor="#089bf5" :rotate="isRotate" @click="startLogin"></wButton>
</view>
</view>
</template>
@ -19,7 +19,8 @@
import wInput from '../../components/watch-login/watch-input.vue' //input
import wButton from '../../components/watch-login/watch-button.vue' //button
import {
userLogin
userLogin,
uniPush
} from '../../Utils/Api.js';
let app = getApp();
export default {
@ -37,10 +38,14 @@
},
mounted() {
this.isLogin();
},
onShow() {
},
methods: {
//
isLogin() {
isLogin() {
// uni.getStorage({
// key: 'payuser',
// success: (res) => {
@ -143,4 +148,4 @@
<style lang="scss">
@import url("../../components/watch-login/css/icon.css");
@import url("./css/main.css");
</style>
</style>

@ -69,11 +69,12 @@
<script>
import {
// getDiscountList,
moveHomeCount,
mermoveHomeCount,
storemoveHomeCount,
getDictionaries
getDictionaries,
connectStoreCid,
voiceSucceed
} from '../../../Utils/Api.js'
let app = getApp();
export default {
@ -81,11 +82,58 @@
return {
funcList: [],
userInfo: app.globalData.userInfo, //
auditnum: '' //
auditnum: '', //
//
playurl: "",
voicePlayer: null, //
watchProximity: null, //
sessionPlayMode: 0, // 0 1
wakeLock: null, // Android
audioManager: null, // Android
audioFocus: false, //
storeCid: '', //cid
taskNo: '' //
};
},
onLoad() {
uni.onPushMessage((res) => {
// console.log("", res.data.content) //
let conts = res.data.content.split('!@#PUSH#@!');
this.playurl = conts[0];
this.taskNo = conts[1];
if (this.playurl) {
this.starts();
this.voicePlayer.play();
}
})
//
plus.push.addEventListener('click', (msg) => {
uni.navigateTo({
url: '/pages/index/collectNotes/collectNotes'
})
}, false)
//
plus.push.addEventListener('receive', (msg) => {
//
let payload = msg
let contsplist = payload.content.split('!@#PUSH#@!');;
let messageContent = contsplist[2]
// this.playurl = contsplist[0];
// this.taskNo = contsplist[1];
// if (this.playurl) {
// this.starts();
// this.voicePlayer.play();
// }
plus.push.createMessage(messageContent, JSON.stringify(payload), {
title: '惠支付',
cover: false
})
}, false)
//
if (this.userInfo.secUser.objectType == 3) {
this.funcList = [{
@ -154,17 +202,18 @@
title: '结算审核',
url: '../../index/review-Settlement/review-Settlement',
img: '../../../static/img/home1.png'
}]
// , {
// title: '',
// url: '../../index/equity-activity-review/equity-activity-review',
// img: '../../../static/img/home5.png'
}]
// , {
// title: '',
// url: '../../index/equity-activity-review/equity-activity-review',
// img: '../../../static/img/home5.png'
// }
return;
}
},
onShow() {
if (this.userInfo.secUser.objectType == 3) {
this.moveHomeCount();
}
@ -173,21 +222,128 @@
}
if (this.userInfo.secUser.objectType == 5) {
this.storemoveHomeCount();
let status = 1;
let that = this;
uni.getPushClientId({
success: res => {
that.storeCid = res.cid;
uni.getStorage({
key: "clientId",
success: (res) => {
if (res.data && res.data != undefined && res.data != that
.storeCid) {
status = 2;
}
},
fail(err) {
status = 1;
uni.setStorage({
key: "clientId",
data: that.storeCid
})
}
})
},
fail(err) {
console.log(err);
}
})
setTimeout(function() {
if (status == 1 && that.storeCid) {
that.connectStoreCid(that.storeCid)
}
}, 1500);
}
this.getDictionaries();
},
methods: {
// getDiscountList() {
// let params = {
// pageNum: 1,
// pageSize: 10
// }
// getDiscountList(params).then(res => {
// if (res.return_code == '000000') {
//cid
connectStoreCid(item) {
let datas = {
"cid": item,
"storeId": this.userInfo.store.id
}
connectStoreCid(datas).then(res => {})
},
//
voiceSucceed(item) {
let datas = {
storeId: this.userInfo.store.id,
taskNo: this.taskNo
}
voiceSucceed(datas).then(res => {
});
},
//
starts() {
this.watchProximity = plus.proximity.watchProximity((distance) => {
/**
* iOS端接近为0远离为Infinity
* Android端接近为0远离为5
*/
if (this.playMode === 0) {
//
this.voicePlayer.pause();
if (distance !== 0) {
//
this.voicePlayer.setRoute(0);
} else {
//
this.voicePlayer.setRoute(1);
}
this.voicePlayer.resume();
}
});
this.voicePlayer = plus.audio.createPlayer({
src: this.playurl
});
this.voicePlayer.setRoute(this.playMode);
//
this.voicePlayer.addEventListener('ended', () => {
//
if (this.watchProximity) {
plus.proximity.clearWatch(this.watchProximity);
this.watchProximity = null;
}
//
if (this.wakeLock) {
this.wakeLock.release();
this.wakeLock = null;
}
this.voiceSucceed();
this.storemoveHomeCount();
});
//
this.voicePlayer.addEventListener('play', () => {
//
if (this.playState !== 2) {
// plus.audio.ROUTE_SPEAKER 0
// plus.audio.ROUTE_EARPIECE 1
this.voicePlayer.setRoute(this.playMode);
this.playState++;
}
});
//
this.voicePlayer.addEventListener('error', (err) => {
console.log('报错err', err);
//
if (this.wakeLock) {
this.wakeLock.release();
this.wakeLock = null;
}
//
if (this.watchProximity) {
plus.proximity.clearWatch(this.watchProximity);
this.watchProximity = null;
}
});
},
// }
// })
// },
//
getDictionaries() {
getDictionaries().then(res => {

@ -17,11 +17,9 @@
},
onLoad(options) {
let that = this;
// #ifdef APP-PLUS
uni.reLaunch({
url: '/pages/login/login'
})
// #endif
// #ifdef H5
// let arr1 = window.location.href;
// let arr2 = arr1.split('=');

Loading…
Cancel
Save