| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- <script>
- // #ifdef APP-PLUS
- import APPUpdate, {
- getCurrentNo
- } from '@/uni_modules/zhouWei-APPUpdate/js_sdk/appUpdate';
- import {
- callErrorCode
- } from "@/utils/commonDicts.js";
- // #endif
- import {
- simpleDebounce
- } from "@/utils/util.js";
- export default {
- data() {
- return {
- g_wakelock: null,
- }
- },
- onLaunch: function() {
- //#ifdef APP-PLUS
- APPUpdate();
- getCurrentNo((data) => {
- this.$store.commit("app/SET_CURRENTVERSION", data.versionName);
- });
- plus.globalEvent.addEventListener('plusMessage', (msg) => {
- if (msg.data.args.data.name == 'postMessage') {
- const {
- type,
- data,
- action
- } = msg.data.args.data.arg;
- if (action === "message") {
- uni.$u.toast("e:" + data);
- } else if (action == "singInState") {
- this.$store.commit("app/SET_SIGNINSTATE", data)
- } else if (action == "registerInfo") {
- this.$store.commit("app/SET_REDIS_INFO", data)
- } else if (action == "disconnected") {
- // 重连不上 重新创建
- this.$store.dispatch("app/createWv");
- } else if (action === "phoneStatus") {
- this.$store.commit("app/SET_DIALING", data)
- } else if (action == "outbound") {
- data.action = "outbound";
- this.$store.dispatch("app/saveUnionAppCall", data)
- } else if (action == "incoming") {
- data.action = "incoming";
- // this.$store.commit("app/SET_ISREJECT", false);
- this.$store.dispatch("app/saveUnionAppCall", data).then(res => {
- uni.navigateTo({
- url: `/pages/callweb/callweb?phone=${data.phone}`
- })
- })
- }
- }
- });
- // this.addFlags();
- // #endif
- },
- onShow: function() {
- this.$store.dispatch("app/register");
- },
- methods: {
- wakeLock() {
- //Android
- var main = plus.android.runtimeMainActivity();
- var Context = plus.android.importClass("android.content.Context");
- var PowerManager = plus.android.importClass("android.os.PowerManager");
- var pm = main.getSystemService(Context.POWER_SERVICE);
- this.g_wakelock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "ANY_NAME");
- this.g_wakelock.acquire();
- },
- // 禁止截屏
- addFlags() {
- // #ifdef APP-PLUS
- let osname = plus.os.name
- if (osname == "Android") {
- var activity = plus.android.runtimeMainActivity()
- plus.android.invoke(plus.android.invoke(activity, "getWindow"), "addFlags", 0x00002000)
- }
- // #endif
- },
- clearFlags() {
- // #ifdef APP-PLUS
- let osname = plus.os.name
- if (osname == "Android") {
- var activity = plus.android.runtimeMainActivity()
- plus.android.invoke(plus.android.invoke(activity, "getWindow"), "clearFlags", 0x00002000)
- }
- // #endif
- },
- },
- }
- </script>
- <style lang="scss">
- .card_wrap {
- margin: 0 20px;
- background-color: #fff;
- border-radius: 20rpx;
- overflow: hidden;
- margin-bottom: 20px;
-
- .header_wrap {
- display: flex;
- justify-content: space-between;
- padding: 10px;
- border-bottom: 1px solid #ddd;
- background-color: #fff;
-
- .header_left {
- font-size: 30rpx;
- }
-
- .haeder_right {
- display: flex;
- align-items: center;
-
- text {
- font-size: 28rpx;
- color: #b8b8b8;
- margin-right: 20rpx;
- }
-
- ::v-deep .u-icon__icon {
- font-size: 24rpx !important;
- }
- }
- }
- }
- /*#ifndef APP-NVUE*/
- .required {
- &::after {
- content: "*";
- color: red;
- margin-left: 6rpx;
- }
- }
- .form_required {
- position: relative;
- &::after {
- position: absolute;
- left: 12rpx;
- top: 50%;
- transform: translate(0%, -50%);
- content: "*";
- color: red;
- margin-left: 6rpx;
- }
- }
- /*#endif*/
- .u-cell__value {
- color: #999999 !important;
- }
- /*#ifndef APP-NVUE*/
- page {
- background-color: $uni-bg-color;
- }
- /*#endif*/
- .u-nav-slot {
- color: #108cff;
- }
- // 时间选择器不要高
- /*#ifndef APP-NVUE*/
- ::v-deep .uni-date__x-input {
- height: auto !important;
- font-size: 28rpx !important;
- }
- /*#endif*/
- .u-navbar__content__title {
- font-weight: bold;
- }
- @import "@/uni_modules/uview-ui/index.scss";
- /*每个页面公共css */
- </style>
|