shezhi.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. <template>
  2. <view>
  3. <customNav :shownav="true" :title="$t('index.setting')" titledetl=""></customNav>
  4. <view class="contentV" style="margin-top: 30rpx;">
  5. <view class="itemView" @click="shezhixuanze(1)">
  6. <text class="textstye">{{$t('user.tuichudl')}}</text>
  7. </view>
  8. <view class="itemView" @click="shezhixuanze(2)">
  9. <text class="textstye">{{$t('user.zhuxiaozhh')}}</text>
  10. </view>
  11. <view class="itemView" @click="shezhixuanze(3)">
  12. <text class="textstye">{{$t('user.yinsizhc')}}</text>
  13. </view>
  14. </view>
  15. <view class="versionV">
  16. <view class="versionitem">
  17. <text class="appname">CTE</text>
  18. <text v-if="isnewV" class="zuixinbb">{{$t('user.yishizxbb')}}: v{{versionMSG.versionName}}</text>
  19. <text v-if="!isnewV" class="dangqbb">{{$t('user.dangqianbb')}}: v{{appversionN}}</text>
  20. <text v-if="!isnewV" class="huoqubb" @click="checkgengxin">{{$t('user.huoquzxbb')}}: v{{versionMSG.versionName}}</text>
  21. </view>
  22. </view>
  23. <popViewGG :tips="$t('user.xiazaijindu')" :show="show" :maskClosable="false" :isCancel="false">
  24. <view class="words">
  25. <text>{{$t('user.xiazaizhong')}} {{percentVal}}%</text>
  26. </view>
  27. </popViewGG>
  28. </view>
  29. </template>
  30. <!-- https://backend.cityexpress168.com.vn/ynszc.html -->
  31. <script>
  32. import api from "@/pages/api/api.js"
  33. export default {
  34. data() {
  35. return {
  36. index:0,
  37. versionMSG:[],
  38. appversionN:'',
  39. appVersionCode:0,
  40. isnewV:true,
  41. updateUrl:'',
  42. show:false,
  43. percentVal:''
  44. }
  45. },
  46. onShow() {
  47. var info = uni.getSystemInfoSync();
  48. //console.log(info);
  49. this.appVersionCode=info.appVersionCode;
  50. this.appversionN=info.appVersion;
  51. this.getversion();
  52. },
  53. methods: {
  54. shezhixuanze(index){
  55. switch(index){
  56. case 0:
  57. break;
  58. case 1:
  59. this.tuichudengl();
  60. break;
  61. case 2://注销账号
  62. this.zhuxiaozhangh();
  63. break;
  64. case 3://隐私政策
  65. uni.navigateTo({
  66. url:'/pages/index/mindex/yinszhengc'
  67. })
  68. break;
  69. case 4:
  70. break;
  71. case 5:
  72. break;
  73. }
  74. },
  75. tuichudengl(){
  76. var that = this;
  77. uni.showModal({
  78. title: that.$t('api.message'),
  79. content: that.$t('user.querentcdq'),
  80. cancelText:that.$t('order.quxiao'),
  81. confirmText:that.$t('comp.queren'),
  82. success: function (res) {
  83. if (res.confirm) { //这里是点击了确定以后
  84. uni.setStorageSync('userInfo','');
  85. uni.setStorageSync('token','');
  86. getApp().globalData.token='';
  87. that.disconectGoeasy();
  88. setTimeout(function() {
  89. uni.navigateBack();
  90. }, 1000);
  91. } else { //这里是点击了取消以后
  92. console.log('用户点击取消')
  93. }
  94. }
  95. })
  96. },
  97. zhuxiaozhangh(){
  98. var that = this;
  99. uni.showModal({
  100. title: that.$t('user.zhuxiaozhh'),
  101. content: that.$t('user.zhuxiaodqzh'),
  102. cancelText:that.$t('order.quxiao'),
  103. confirmText:that.$t('comp.queren'),
  104. success: function (res) {
  105. if (res.confirm) { //这里是点击了确定以后
  106. this.updatazuxiao();
  107. } else { //这里是点击了取消以后
  108. console.log('用户点击取消')
  109. }
  110. }
  111. })
  112. },
  113. updatazuxiao(){
  114. var that = this;
  115. api('deleuser',{
  116. },res=>{
  117. console.log(res)
  118. uni.setStorageSync('userInfo','');
  119. uni.setStorageSync('token','');
  120. that.disconectGoeasy();
  121. setTimeout(function() {
  122. uni.navigateBack();
  123. }, 1000);
  124. },failc=>{
  125. //console.log('getadvertis----',failc)
  126. })
  127. },
  128. checkgengxin(){
  129. return;
  130. },
  131. disconectGoeasy(){
  132. this.goEasy.disconnect({
  133. onSuccess: function(){
  134. console.log("GoEasy disconnect successfully.")
  135. getApp().globalData.goEasycnt=false;
  136. },
  137. onFailed: function(error){
  138. console.log("Failed to disconnect GoEasy, code:"+error.code+ ",error:"+error.content);
  139. }
  140. });
  141. },
  142. // var that = this;
  143. // uni.showModal({
  144. // title: that.$t('api.message'),
  145. // content: that.$t('user.shifougengxin'),
  146. // cancelText:that.$t('order.quxiao'),
  147. // confirmText:that.$t('comp.queren'),
  148. // success: function (res) {
  149. // if (res.confirm) { //这里是点击了确定以后
  150. // that.gengxinApp();
  151. // } else { //这里是点击了取消以后
  152. // console.log('用户点击取消')
  153. // }
  154. // }
  155. // })
  156. // },
  157. // gengxinApp(){
  158. // var that = this;
  159. // var dtask = plus.downloader.createDownload(
  160. // this.updateUrl,
  161. // {
  162. // method: "GET"
  163. // }, (d, status) => {
  164. // console.log(d);
  165. // if (status == 200) {
  166. // plus.runtime.install(d.filename)
  167. // } else {
  168. // plus.nativeUI.alert(that.$t('user.anzhuangsbcs') + status)
  169. // }
  170. // });
  171. // dtask.start();
  172. // var prg = 0;//进度数字化
  173. // that.show = true;
  174. // var show= plus.nativeUI.showWaiting("Loading...");
  175. // dtask.addEventListener('statechanged',function(task,status){
  176. // switch(task.state){//根据下载状态调整其显示内容
  177. // case 1:
  178. // that.percentVal = "Loading……";
  179. // //showLoading.setTitle("正在下载……");
  180. // break;
  181. // case 2:
  182. // that.percentVal = "Connected";
  183. // //showLoading.setTitle("连接到服务器");
  184. // break;
  185. // case 3:
  186. // that.percentVal = parseInt((parseFloat(task.downloadedSize) / parseFloat(task.totalSize)) * 100);
  187. // //showLoading.setTitle("正在下载:" + this.percentVal + "%");
  188. // break;
  189. // case 4:
  190. // plus.nativeUI.closeWaiting();
  191. // that.show = false;
  192. // break;
  193. // }
  194. // });
  195. // },
  196. getversion(){//消息推送
  197. var that = this;
  198. api('getversion',{
  199. platform:'0',
  200. name:'跑腿王'
  201. },res=>{
  202. console.log(res.data)
  203. this.versionMSG=res.data.data;
  204. if(this.appVersionCode<this.versionMSG.version){
  205. this.isnewV = false;
  206. this.updateUrl=that.$baseImagurl+this.versionMSG.downloadUrl;
  207. }
  208. },failc=>{
  209. //console.log('getadvertis----',failc)
  210. })
  211. },
  212. },
  213. }
  214. </script>
  215. <style>
  216. page{
  217. background-color: #F2F3F7;
  218. }
  219. .contentV{
  220. display:flex;
  221. flex-direction: column;
  222. justify-content: center;
  223. align-items: center;
  224. }
  225. .itemView{
  226. display:flex;
  227. justify-content: flex-start;
  228. margin-top: 20rpx;
  229. height: 100rpx;
  230. width: 90%;
  231. border: 2rpx dotted darkgray;
  232. background-color: aliceblue;
  233. }
  234. .textstye{
  235. font-size: 30rpx;
  236. margin-left: 30rpx;
  237. height: 80rpx;
  238. line-height:80rpx;
  239. }
  240. .versionV{
  241. position:fixed;
  242. bottom: 40rpx;
  243. width: 100%;
  244. }
  245. .versionitem{
  246. display:flex;
  247. flex-direction: column;
  248. justify-content: center;
  249. align-items: center;
  250. width: 90%;
  251. }
  252. .appname{
  253. font-size: 30rpx;
  254. }
  255. .zuixinbb{
  256. padding-top: 10rpx;
  257. font-size: 28rpx;
  258. }
  259. .dangqbb{
  260. padding-top: 10rpx;
  261. font-size: 28rpx;
  262. }
  263. .huoqubb{
  264. padding-top: 10rpx;
  265. font-size: 28rpx;
  266. color: blue;
  267. text-decoration:underline;
  268. }
  269. .words{
  270. width: 100%;
  271. text-align: center;
  272. font-size: 30rpx;
  273. height: 80rpx;
  274. line-height: 80rpx;
  275. }
  276. </style>