about.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <template>
  2. <view class="content">
  3. <view class="logo">
  4. <image src="/static/logo.png" style="border-radius: 50%;"></image>
  5. <p>{{$qconfig.appName}}</p>
  6. </view>
  7. <view class="set-box" >
  8. <view class="item" @click="callPhone()">
  9. <view class="left">
  10. <text class="text">联系我们</text>
  11. </view>
  12. <image class="right" src="/static/image/right_arrow.png" mode="aspectFill"></image>
  13. </view>
  14. <view class="line"></view>
  15. <view class="item" @tap="loginNavTo('./msgSetting')">
  16. <view class="left">
  17. <text class="text">消息设置</text>
  18. </view>
  19. <image class="right" src="/static/image/right_arrow.png" mode="aspectFill"></image>
  20. <button class='contact-btn' open-type="contact"></button>
  21. </view>
  22. <view class="line"></view>
  23. <view class="item" @tap="checkUpdateApp()">
  24. <view class="left">
  25. <text class="text">版本号</text>
  26. </view>
  27. <view class="right-text">
  28. <text class="text">v{{version}}</text>
  29. </view>
  30. </view>
  31. <view class="line"></view>
  32. </view>
  33. <view class="bottom-box y-f">
  34. <view class="es-c-66 es-fs-28">蜀ICP备2023036719号-7A</view>
  35. <view class="es-mt-20 es-fs-28 es-c"> <text @click="goToWeb(0)">《用户协议》</text> <text @click="goToWeb(1)">《隐私政策》</text> </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import { premissionCheck } from "@/js_sdk/wa-permission/permission.js"
  41. import { getAppVersion } from '@/api/common'
  42. import {appCheckUdate,openDownload } from '@/utils/APPUpdate.js'
  43. import { qconfig } from '@/utils/config';
  44. export default {
  45. data() {
  46. return {
  47. tel:undefined,
  48. version:"1.2.5",
  49. clickTime:1,
  50. }
  51. },
  52. onLoad() {
  53. this.getAppVersion1();
  54. // 修改顶部导航背景色
  55. // uni.setNavigationBarColor({
  56. // frontColor: '#ffffff',
  57. // backgroundColor: '#FF5C03',
  58. // animation: {
  59. // duration: 200,
  60. // timingFunc: 'easeIn'
  61. // }
  62. // });
  63. },
  64. methods: {
  65. async callPhone(){
  66. let result = await premissionCheck("CALL_PHONE");
  67. if(result==1){
  68. uni.makePhoneCall({
  69. phoneNumber: "4000717770"
  70. })
  71. }
  72. },
  73. goToWeb(index){
  74. uni.setStorageSync('url',index==0?"https://userapp.his.cdwjyyh.com/web/userAgreement":"https://userapp.his.cdwjyyh.com/web/privacyPolicy");
  75. uni.navigateTo({
  76. url:"/pages/index/h5"
  77. })
  78. },
  79. getAppVersion1(){
  80. // #ifdef APP-PLUS
  81. let that=this;
  82. if(plus.runtime.isAgreePrivacy()) {
  83. plus.runtime.getProperty(plus.runtime.appid, function(widgetinfo) {
  84. // 可以根据manifest.json里的应用名称来进行针对性的APP升级
  85. let platform = uni.getSystemInfoSync().platform;
  86. that.version=widgetinfo.version+"("+widgetinfo.versionCode+")";
  87. });
  88. }
  89. // #endif
  90. },
  91. loginNavTo(url){
  92. if(!this.$isLogin()){
  93. this.$showLoginPage();
  94. return;
  95. }
  96. uni.navigateTo({
  97. url: url
  98. });
  99. },
  100. /* 检查更新 在线更新 */
  101. checkUpdateApp(){
  102. let that=this;
  103. console.log("qxj checkUpdateApp");
  104. if(this.clickTime<5){
  105. this.clickTime++;
  106. return;
  107. }
  108. plus.runtime.getProperty(plus.runtime.appid, function(widgetinfo) {
  109. //console.log("qxj widgetinfo:"+JSON.stringify(widgetinfo));
  110. if (widgetinfo.name == qconfig.appName) { //APP名称
  111. // 获取manifest.json里的版本号
  112. let platform = uni.getSystemInfoSync().platform;
  113. let isAndroid=platform=="android";
  114. let type=isAndroid?1:2;
  115. getAppVersion(type).then(srcData => {
  116. // console.log("qxj getAppVersion srcData:"+JSON.stringify(srcData)+" isAppStore:"+that.$qconfig.isAppStore);
  117. if(srcData.code==200){
  118. let data = srcData.data;
  119. let version = widgetinfo.versionCode,//用户当前版本
  120. appVersion = data.versionCode,//升级包版本
  121. appName = widgetinfo.name, //app名称
  122. isForce = data.isForce,//是否强制热更新
  123. updateConfig=JSON.parse(data.updateConfig),
  124. appurl = data.url,//升级包地址
  125. intro = data.note;//升级包提示
  126. //如果用户版本号小于升级包版本号,先升级
  127. let afterVer=false;
  128. if(plus.runtime.channel=="baidu"){
  129. afterVer=that.$qconfig.isAppStore?updateConfig.baidu:false;
  130. }
  131. else if(plus.runtime.channel=="huawei"){
  132. afterVer=that.$qconfig.isAppStore?updateConfig.huawei:false;
  133. }
  134. else if(plus.runtime.channel=="xiaomi"){
  135. afterVer=that.$qconfig.isAppStore?updateConfig.xiaomi:false;
  136. }
  137. else if(plus.runtime.channel=="yyb"){
  138. afterVer=that.$qconfig.isAppStore?updateConfig.yyb:false;
  139. }
  140. else{
  141. afterVer=that.$qconfig.isAppStore?isForce:true;
  142. }
  143. if(data && (version < appVersion) && afterVer){
  144. uni.showModal({
  145. title:"更新提示",
  146. confirmText:"立即升级",
  147. content:intro,
  148. cancelText:'确定',
  149. confirmText:'取消',
  150. success: (res) => {
  151. if (res.cancel) {
  152. openDownload(srcData.data);
  153. } else if (res.confirm) {
  154. if(isForce==1){
  155. uni.showToast({title:"请先升级APP版本",icon:"none",duration:2000});
  156. //退出app
  157. setTimeout(function(){
  158. plus.runtime.quit();
  159. },2000)
  160. }
  161. }
  162. },
  163. fail: () => {
  164. uni.hideLoading();
  165. }
  166. })
  167. }
  168. }
  169. },
  170. rej => {}
  171. ).catch(()=>{
  172. //联网失败, 结束加载
  173. this.mescroll.endErr();
  174. });
  175. }
  176. });
  177. }
  178. }
  179. }
  180. </script>
  181. <style scoped lang="scss">
  182. page{
  183. height: 100%;
  184. }
  185. .content{
  186. height: 100%;
  187. background-color: #fff;
  188. }
  189. .line{
  190. height: 1px;background-color: #F7F7F7;
  191. }
  192. .logo{
  193. padding-top: 15%;
  194. text-align: center;
  195. image{
  196. width: 120rpx;
  197. height: 120rpx;
  198. border-radius: 10rpx;
  199. box-shadow:0px 0px 20rpx rgba(0,0,0,0.2);
  200. }
  201. p{
  202. margin: 10px 0px;
  203. font-size: 14px;
  204. }
  205. }
  206. .set-box{
  207. margin-top: 30upx;
  208. background: #fff;
  209. padding: 0 40upx;
  210. .item{
  211. position: relative;
  212. display: flex;
  213. align-items: center;
  214. justify-content: space-between;
  215. padding: 25upx 0;
  216. .left{
  217. display: flex;
  218. align-items: center;
  219. .text{
  220. font-size: 30upx;
  221. color: #666;
  222. }
  223. }
  224. .right{
  225. width: 10upx;
  226. height: 20upx;
  227. }
  228. .right-text{
  229. }
  230. }
  231. }
  232. .contact-btn {
  233. position: absolute;
  234. width: 100%;
  235. display: flex;
  236. opacity: 0;
  237. }
  238. .bottom-box{
  239. position: absolute;
  240. bottom: 50rpx;
  241. width: 100%;
  242. }
  243. </style>