index.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <view class="page_container">
  3. <custom-nav-bar title="关于我们" />
  4. <view class="logo_area">
  5. <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/about_logo.png" mode=""></image>
  6. <view>{{ v }}</view>
  7. <!-- <info-item
  8. v-if="$u.os() === 'android'"
  9. class="check"
  10. title="检查新版本"
  11. content=""
  12. /> -->
  13. <info-item
  14. @click="show = true"
  15. class="check"
  16. title="上传调试日志"
  17. content=""
  18. />
  19. <u-modal showCancelButton :show="show" title="上传日志" @confirm="uploadLog" @cancel="show = false" >
  20. <view class="slot-content">
  21. <u--input
  22. placeholder="日志数量"
  23. border="surround"
  24. v-model="line"
  25. ></u--input>
  26. </view>
  27. </u-modal>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. import CustomNavBar from "../../../components/CustomNavBar/index.vue";
  33. import { PageEvents } from "../../../constant";
  34. import InfoItem from "../selfInfo/InfoItem.vue";
  35. import { version } from "../../../common/config";
  36. import IMSDK from "openim-uniapp-polyfill";
  37. export default {
  38. components: {
  39. CustomNavBar,
  40. InfoItem,
  41. },
  42. data() {
  43. return {
  44. show: false,
  45. line: 10000,
  46. appVersion: "",
  47. loading: false,
  48. };
  49. },
  50. computed: {
  51. v(){
  52. return version
  53. }
  54. },
  55. onLoad() {
  56. this.getAppVersion();
  57. uni.$on(PageEvents.CheckForUpdateResp, this.checkRespHandler);
  58. },
  59. onUnload() {
  60. uni.$off(PageEvents.CheckForUpdateResp, this.checkRespHandler);
  61. },
  62. mounted() {
  63. IMSDK.subscribe(IMSDK.IMEvents.UploadLogsProgress, this.uploadHandler);
  64. },
  65. beforeDestroy() {
  66. IMSDK.unsubscribe(IMSDK.IMEvents.UploadLogsProgress, this.uploadHandler);
  67. },
  68. methods: {
  69. uploadLog() {
  70. this.show = false
  71. IMSDK.asyncApi(
  72. 'uploadLogs',
  73. IMSDK.uuid(),
  74. {
  75. line: this.line,
  76. ex: ""
  77. }
  78. )
  79. uni.showLoading({
  80. title: '上传中',
  81. mask: true,
  82. });
  83. },
  84. uploadHandler({
  85. data: { current, size },
  86. }) {
  87. console.log('uploadHandler',current,size)
  88. if (current >= size) {
  89. uni.hideLoading();
  90. uni.showToast({
  91. title: "上传成功",
  92. icon: "none",
  93. });
  94. return;
  95. }
  96. },
  97. getAppVersion() {
  98. plus.runtime.getProperty(
  99. plus.runtime.appid,
  100. ({ version }) => (this.appVersion = version),
  101. );
  102. },
  103. updateCheck() {
  104. this.loading = true;
  105. uni.$emit(PageEvents.CheckForUpdate, true);
  106. },
  107. checkRespHandler() {
  108. this.loading = false;
  109. },
  110. },
  111. };
  112. </script>
  113. <style lang="scss">
  114. .page_container {
  115. background-color: #f8f8f8;
  116. .logo_area {
  117. display: flex;
  118. flex-direction: column;
  119. align-items: center;
  120. margin: 24rpx 24rpx 0 24rpx;
  121. background: #fff;
  122. border-radius: 6px;
  123. padding: 48rpx 0 16rpx 0;
  124. color: $uni-text-color;
  125. image {
  126. width: 72px;
  127. height: 72px;
  128. margin-bottom: 24rpx;
  129. }
  130. }
  131. .check {
  132. margin-top: 26rpx;
  133. border-top: 1px #e8eaef solid;
  134. padding: 20rpx;
  135. width: 90%;
  136. }
  137. .btn_row {
  138. padding: 0 44rpx;
  139. }
  140. }
  141. </style>