about.vue 6.8 KB

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