| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- <template>
- <view class="page_container">
- <custom-nav-bar title="关于我们" />
- <view class="logo_area">
- <image src="../../../static/images/about_logo.png" mode=""></image>
- <view>{{ v }}</view>
- <info-item @click="show = true" class="check" title="上传日志" content="" />
- <u-modal showCancelButton :show="show" title="上传日志" @confirm="uploadLog" @cancel="show = false">
- <view class="slot-content">
- <u--input placeholder="日志数量" border="surround" v-model="line"></u--input>
- </view>
- </u-modal>
- </view>
- <view v-if="$u.os() === 'android'" style="font-size: 16px; margin: 20rpx; margin-left: 20px">
- {{ title }}
- </view>
- </view>
- </template>
- <script>
- import CustomNavBar from '../../../components/CustomNavBar/index.vue';
- import { PageEvents } from '../../../constant';
- import InfoItem from '../selfInfo/InfoItem.vue';
- import { version } from '../../../common/config';
- import IMSDK from 'openim-uniapp-polyfill';
- export default {
- components: {
- CustomNavBar,
- InfoItem
- },
- data() {
- return {
- show: false,
- line: 10000,
- appVersion: '',
- loading: false,
- title: ''
- };
- },
- computed: {
- v() {
- return version;
- }
- },
- onLoad() {
- this.getAppVersion();
- let uid, nickName;
- if (this.$companyUserIsLogin()) {
- var user = JSON.parse(uni.getStorageSync('companyUser'));
- //console.log("qxj openImLogin companyUser",user);
- uid = 'C' + user.userId;
- nickName = user.imNickName || user.nickName;
- } else {
- var user = JSON.parse(uni.getStorageSync('userInfo'));
- uid = 'U' + user.userId;
- nickName = user.nickName;
- }
- this.title = '当前登录用户:' + nickName + ' 用户id:' + uid;
- uni.$on(PageEvents.CheckForUpdateResp, this.checkRespHandler);
- },
- onUnload() {
- uni.$off(PageEvents.CheckForUpdateResp, this.checkRespHandler);
- },
- mounted() {
- IMSDK.subscribe("uploadLogsProgress", this.uploadHandler);
- },
- beforeDestroy() {
- IMSDK.unsubscribe("uploadLogsProgress", this.uploadHandler);
- },
- methods: {
- uploadLog() {
- this.show = false;
- IMSDK.asyncApi('uploadLogs', IMSDK.uuid(), {
- line: this.line,
- ex: ''
- });
- uni.showLoading({
- title: '上传中',
- mask: true
- });
- },
- uploadHandler({ data: { current, size } }) {
- if (current >= size) {
- uni.hideLoading();
- uni.showToast({
- title: '上传成功',
- icon: 'none'
- });
- return;
- }
- },
- getAppVersion() {
- plus.runtime.getProperty(plus.runtime.appid, ({ version }) => (this.appVersion = version));
- },
- updateCheck() {
- this.loading = true;
- uni.$emit(PageEvents.CheckForUpdate, true);
- },
- checkRespHandler() {
- this.loading = false;
- }
- }
- };
- </script>
- <style lang="scss">
- .page_container {
- background-color: #f8f8f8;
- .logo_area {
- display: flex;
- flex-direction: column;
- align-items: center;
- margin: 24rpx 24rpx 0 24rpx;
- background: #fff;
- border-radius: 6px;
- padding: 48rpx 0 16rpx 0;
- color: $uni-text-color;
- image {
- width: 72px;
- height: 72px;
- margin-bottom: 24rpx;
- }
- }
- .check {
- margin-top: 26rpx;
- border-top: 1px #e8eaef solid;
- padding: 20rpx;
- width: 90%;
- }
- .btn_row {
- padding: 0 44rpx;
- }
- }
- </style>
|