about.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. <template>
  2. <view>
  3. <view class="line"></view>
  4. <view class="logo-box">
  5. <image :src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/c9b4eb88c03b2f7460e8479e80f40fc.png'" mode="widthFix" v-if="$isneutral"></image>
  6. <view class="version">
  7. <view v-if="$isneutral">
  8. 云飞物联网
  9. </view>
  10. <view>
  11. 当前版本号
  12. </view>
  13. <view>
  14. V{{id}}
  15. </view>
  16. </view>
  17. </view>
  18. <view class="line"></view>
  19. <view class="part" v-if="$isneutral">
  20. <view class="info-item">
  21. <text class="tit">技术支持</text>
  22. <text class="val">河南云飞科技发展有限公司</text>
  23. </view>
  24. <view class="divide"></view>
  25. <view class="info-item">
  26. <text class="tit">关注微信</text>
  27. <text class="val">河南云飞科技发展有限公司</text>
  28. </view>
  29. </view>
  30. <view class="line" v-if="$isneutral"></view>
  31. <view class="part" v-if="$isneutral">
  32. <view class="info-item">
  33. <text class="tit">公司官网</text>
  34. <text class="val">www.hnyfkj.cn</text>
  35. </view>
  36. <view class="divide"></view>
  37. <view class="info-item">
  38. <text class="tit">业务合作</text>
  39. <text class="val">400-690-7990</text>
  40. </view>
  41. <view class="divide"></view>
  42. <view class="info-item">
  43. <text class="tit">公司邮箱</text>
  44. <text class="val">hnyf826@163.com</text>
  45. </view>
  46. </view>
  47. <view class="line"></view>
  48. <view class="part">
  49. <view class="info-item" @click="renewal">
  50. <text class="tit" >版本更新</text>
  51. <p class="update" v-if="updateTF">NEW</p>
  52. <u-icon name="arrow-right"></u-icon>
  53. </view>
  54. </view>
  55. <view class="line" v-if="$isneutral"></view>
  56. <view class="record">
  57. <view class="info-item" @click="record">
  58. <text class="tit">更新记录</text>
  59. <u-icon name="arrow-right"></u-icon>
  60. </view>
  61. </view>
  62. <view class="nego">
  63. <view class="tipTextBtn" @click="openExternalLink('http://8.136.98.49:8002/service_negotiate/')">《服务协议》</view>
  64. <view class="tipTextBtn" @click="openExternalLink('http://8.136.98.49:8002/safe_negotiate/')">《隐私政策》</view>
  65. <view class="" @click="openExternalLink('https://beian.miit.gov.cn/')">
  66. ICP备案号:豫ICP备13013965号-42A >
  67. </view>
  68. </view>
  69. <view class="bottom" v-if="$isneutral">
  70. ©河南云飞科技发展有限公司
  71. </view>
  72. <u-modal title="升级中请勿随意操作" :show-confirm-button="false" v-model="showA" :content="contentA">
  73. <view class="upgradeBox">
  74. <u-line-progress v-show="isShow" active-color="#19be6b" :striped="true" :percent="percentNum" :striped-active="true"></u-line-progress>
  75. </view>
  76. </u-modal>
  77. </view>
  78. </template>
  79. <script>
  80. export default {
  81. data() {
  82. return {
  83. id: '',
  84. versions: '',
  85. showA: false, //
  86. contentA: '',
  87. isShow: false, //进度条
  88. percentNum: 0, //在线下载进度,
  89. value: "",
  90. updateTF:false
  91. }
  92. },
  93. methods: {
  94. openExternalLink(url) {
  95. plus.runtime.openURL(url);
  96. },
  97. async getEquipList() {
  98. const res = await this.$myRequest({
  99. url: '/api/api_gateway?method=home.homes.app_version_record',
  100. data: {
  101. ret: "first"
  102. }
  103. })
  104. console.log(res)
  105. // this.appName = res[0].app_name
  106. this.versions = Number(res[0].app_num.match(/\d+/g).join(""))
  107. var ids = Number(plus.runtime.version.match(/\d+/g).join(""))
  108. if (this.versions > ids) {
  109. this.updateTF = true
  110. } else {
  111. this.updateTF = false
  112. }
  113. },
  114. renewal() {
  115. // this.getEquipList()
  116. var ids = Number(plus.runtime.version.match(/\d+/g).join(""))
  117. if (this.percentNum > 0) {
  118. console.log("更新中")
  119. } else {
  120. if (this.versions > ids) {
  121. this.updateTF = true
  122. uni.showModal({
  123. title: '检测到有新版本,是否更新?',
  124. content: '建议更新,不更新可能会出现部分数据无法获取!',
  125. confirmText: "更新",
  126. cancelText: "不更新",
  127. success: (res) => {
  128. if (res.confirm) {
  129. console.log('用户点击确定');
  130. this.showA = true
  131. this.isShow = true
  132. this.upgrade()
  133. } else if (res.cancel) {
  134. // plus.runtime.quit();
  135. console.log('用户点击取消');
  136. }
  137. }
  138. })
  139. } else {
  140. this.updateTF = false
  141. uni.showToast({
  142. title: "当前版本已是最新版本",
  143. icon: "none"
  144. })
  145. }
  146. }
  147. },
  148. upgrade() {
  149. uni.getStorage({
  150. key: 'http',
  151. success: (res) => {
  152. this.value = res.data
  153. }
  154. })
  155. // console.log(this.appName)
  156. // ---------------------------------------------------------------------------------------------------------------------------
  157. if(this.$isneutral){
  158. this.appName = "big_data"//标准版
  159. }else{
  160. this.appName = "big_data2"//中性版
  161. }
  162. // this.appName = "big_data"
  163. var url = "http://hnyfwlw.com/app/" + this.appName + ".apk"
  164. console.log(url)
  165. const downloadTask = uni.downloadFile({
  166. url: url, //仅为示例,并非真实的资源
  167. success: (res) => {
  168. console.log(res)
  169. if (res.statusCode === 200) {
  170. console.log('下载成功');
  171. console.log('安装包下载成功,即将安装:' + JSON.stringify(res, null, 4));
  172. plus.runtime.openFile(res.tempFilePath);
  173. this.showA = false
  174. this.isShow = false
  175. }
  176. },
  177. fail: (err) => {
  178. console.log(err)
  179. },
  180. complete: (com) => {
  181. console.log(com)
  182. }
  183. });
  184. downloadTask.onProgressUpdate((res) => {
  185. this.percentNum = res.progress
  186. if (res.progress == 100) {
  187. console.log('下载完成了')
  188. plus.runtime.quit();
  189. }
  190. });
  191. },
  192. record() {
  193. uni.navigateTo({
  194. url: "../record/record"
  195. })
  196. }
  197. },
  198. onShow() {
  199. this.id = plus.runtime.version
  200. this.getEquipList()
  201. },
  202. onBackPress(option) {
  203. uni.redirectTo({
  204. url: "../index/index"
  205. })
  206. }
  207. }
  208. </script>
  209. <style lang="scss">
  210. page {
  211. background: $uni-bg-color-grey;
  212. }
  213. .nego{
  214. text-align: center;
  215. margin-top: 10px;
  216. }
  217. .tipTextBtn{
  218. display: inline-block;
  219. color: #2979ff;
  220. text-decoration: underline; /* 添加下划线 */
  221. }
  222. .line {
  223. height: 16rpx;
  224. width: 100%;
  225. background: $uni-bg-color-grey;
  226. }
  227. .bottom {
  228. height: 190rpx;
  229. line-height: 190rpx;
  230. font-size: 8px;
  231. text-align: center;
  232. }
  233. .logo-box {
  234. background: #fff;
  235. text-align: center;
  236. padding: 80rpx 0;
  237. image {
  238. width: 150rpx;
  239. }
  240. .version {
  241. font-size: 24rpx;
  242. margin-top: 20rpx;
  243. }
  244. }
  245. .part {
  246. background: #fff;
  247. padding: 0 40rpx;
  248. .divide {
  249. width: 100%;
  250. height: 1px;
  251. background: $uni-bg-color-grey;
  252. }
  253. .info-item {
  254. display: flex;
  255. justify-content: space-between;
  256. line-height: 100rpx;
  257. position: relative;
  258. .tit {
  259. font-size: 14px
  260. }
  261. .val {
  262. font-size: 12px;
  263. color: #666;
  264. }
  265. .update{
  266. position: absolute;
  267. top: 34rpx;
  268. right: 32rpx;
  269. font-size: 16rpx !important;
  270. background-color: #f00;
  271. border-radius: 25rpx;
  272. height: 30rpx;
  273. padding: 2rpx 16rpx;
  274. line-height: 30rpx;
  275. color: #fff;
  276. }
  277. }
  278. }
  279. .record {
  280. background: #fff;
  281. padding: 0 40rpx;
  282. .info-item {
  283. display: flex;
  284. justify-content: space-between;
  285. line-height: 100rpx;
  286. .tit {
  287. font-size: 14px
  288. }
  289. }
  290. }
  291. .upgradeBox {
  292. padding: 15rpx;
  293. }
  294. </style>