You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
apply-assistant-v3/App.vue

154 lines
3.6 KiB
Vue

5 months ago
<script lang="ts">
5 months ago
import RootStore from '@xkit-yx/im-store-v2'
import V2NIM, { V2NIMConst } from 'nim-web-sdk-ng/dist/v2/NIM_UNIAPP_SDK'
import { getMsgContentTipByType } from './pages/NEUIKit/utils/msg'
import { STORAGE_KEY } from './pages/NEUIKit/utils/constants'
import { isWxApp } from './pages/NEUIKit/utils'
import { V2NIMMessage, V2NIMMessagePushConfig } from 'nim-web-sdk-ng/dist/v2/NIM_UNIAPP_SDK/V2NIMMessageService'
import { unix } from 'dayjs'
6 months ago
export default {
5 months ago
globalData: {
timer: null, // 定时器变量
themeColor: '#00b666',
themeBackgroundColor: '#00b66621',
},
onShow: function (options) {
let that = this
console.log('show 项目init', options, decodeURIComponent(options.query.scene))
// 清除扫码获取的id信息
uni.removeStorageSync('scene')
uni.removeStorageSync('user_scene')
uni.removeStorageSync('user_options', options)
if (options.query.id) {
uni.setStorageSync('apply-jobdetail-id', options.query.id)
} else {
uni.setStorageSync('apply-jobdetail-id', 0)
}
if (options.query.scene) {
let str = decodeURIComponent(options.query.scene)
uni.setStorageSync(
'apply-invite-code',
JSON.stringify({
key: str.split('=')[0],
value: str.split('=')[1],
})
)
} else {
uni.setStorageSync('apply-invite-code', '')
}
if (uni.getStorageSync('apply-token')) {
this.G.checkToken()
}
if (!that.globalData.timer) {
if (uni.getStorageSync('apply-token')) {
that.checkNum()
}
that.globalData.timer = setInterval(() => {
console.log('inner++++++++++++++++++++ +++++++++++++++++++++++++++')
if (uni.getStorageSync('apply-token')) {
that.checkNum()
}
}, 1 * 30 * 1000)
}
uni.$on('isGlogin', function (data) {
console.log('app.vue 接收', data)
if (uni.getStorageSync('apply-uid')) {
4 months ago
// that.initWyyx()
5 months ago
}
})
if (uni.getStorageSync('apply-token')) {
console.log('app.vue 是否调用')
4 months ago
// that.initWyyx()
5 months ago
}
},
onHide: function () {},
methods: {
4 months ago
checkNum() {
5 months ago
let that = this
if (uni.getStorageSync('apply-token')) {
that.G.Get(that.api.bind_getApplyNum, {}, (res) => {
console.log('获取待处理数量:', res)
if (res.approvePassHasNotRed > 0) {
uni.setTabBarBadge({
index: 2,
text: String(res.approvePassHasNotRed),
})
} else {
uni.removeTabBarBadge({
index: 2,
})
}
})
}
},
},
}
6 months ago
</script>
<style lang="scss">
5 months ago
@import './static/css/iconfont.css';
@import './uni_modules/vk-uview-ui/index.scss';
@import './static/css/base.scss';
@import './static/font/iconfont-weapp-icon.css';
6 months ago
// #ifdef MP-WEIXIN
page {
5 months ago
width: 100vw;
height: 100vh;
6 months ago
}
// #endif
// #ifdef H5 || APP-PLUS || MP-TOUTIAO || MP-KUAISHOU
page {
5 months ago
width: 100vw;
height: calc(100% - 0px);
--color-ysd: #ff4400;
--color-hover: #ff4400cc;
--color-be: #ff4400;
--color-027: #ff4400;
--color-href: #576b95;
6 months ago
}
// #endif
// uview默认样式覆盖
.u-badge-mini {
5 months ago
top: 22rpx !important;
right: 102rpx !important;
color: transparent !important;
width: 10px !important;
height: 10px !important;
border-radius: 50% !important;
6 months ago
}
.u-radio {
5 months ago
&:last-child {
.u-radio__label {
margin-right: 0;
}
}
6 months ago
}
.g-apply-tab {
5 months ago
.u-tab-bar {
bottom: -2px !important;
}
6 months ago
}
5 months ago
.g_bg_f_5 {
background-color: #ededed !important;
5 months ago
}
5 months ago
.g_mt_30 {
margin-top: 30px;
5 months ago
}
5 months ago
.g_mt_84 {
margin-top: 84px;
5 months ago
}
5 months ago
.g_pt_90 {
padding-top: 90px;
5 months ago
}
6 months ago
</style>