about.vue 7.5 KB

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