mine.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. <template>
  2. <view class="mine-container">
  3. <view class="flex1">
  4. <uni-nav-bar background-color='transparent' statusBar='true' :border='border'>
  5. <block slot="right" v-if="checkPermi(['system:notice:list'])">
  6. <view class="min_top" @click="getMessage">
  7. <image :src="noticimg"></image>
  8. <view v-if="noticenum">
  9. <block v-if="noticenum>99">99+</block>
  10. <block v-else>{{noticenum}}</block>
  11. </view>
  12. </view>
  13. </block>
  14. </uni-nav-bar>
  15. <!--顶部个人信息栏-->
  16. <view class="min-topa" @click="handleToInfo">
  17. <view class="min-topat fw f22 cof mb12">{{name}}</view>
  18. <view class="f15 cof5">查看账号信息/退出登录</view>
  19. </view>
  20. <view >
  21. <view class="flexc mine_list" @click="handleTozf" v-if="checkPermi(['fgw:xmsb:list'])">
  22. <image :src="listimga" class="limg"></image>
  23. <view class="f17 c34 flex1">政府项目</view>
  24. <image :src="rimg" class="rimg"></image>
  25. </view>
  26. <view class="flexc mine_list" @click="handleToZsFn" v-if="checkPermi(['projectV2:sbbzb:list'])">
  27. <image :src="listimgb" class="limg"></image>
  28. <view class="f17 c34 flex1">招商项目</view>
  29. <image :src="rimg" class="rimg"></image>
  30. </view>
  31. <view class="flexc mine_list" @click="handleToWtFn" v-if="checkPermi(['fgw:xmsb:list'])">
  32. <image :src="listimgc" class="limg"></image>
  33. <view class="f17 c34 flex1">问题项目</view>
  34. <image :src="rimg" class="rimg"></image>
  35. </view>
  36. <!-- <view class="flexc mine_list">
  37. <image :src="listimgd" class="limg"></image>
  38. <view class="f17 c34 flex1">项目预警</view>
  39. <image :src="rimg" class="rimg"></image>
  40. </view> -->
  41. <view class="flexc mine_list" @click="handleTold" v-if="checkPermi(['fgw:xmsb:ldps:list'])">
  42. <image :src="listimge" class="limg"></image>
  43. <view class="f17 c34 flex1">领导批示</view>
  44. <image :src="rimg" class="rimg"></image>
  45. </view>
  46. <view class="flexc mine_list" @click="handleToPwd">
  47. <image :src="listimgf" class="limg"></image>
  48. <view class="f17 c34 flex1">修改密码</view>
  49. <image :src="rimg" class="rimg"></image>
  50. </view>
  51. <!-- #ifdef APP -->
  52. <view class="flexc mine_list" @click="onlineWgt">
  53. <image :src="nlistimgh" class="limg"></image>
  54. <view class="f17 c34 flex1">版本更新</view>
  55. <view class="f15 c34 mlr8">{{wgtcode}}</view>
  56. <image :src="rimg" class="rimg"></image>
  57. </view>
  58. <!-- #endif -->
  59. </view>
  60. </view>
  61. <view class="ztit">安徽中新云计算有限公司提供支持</view>
  62. <view class="flex0">
  63. <footers v-if="isfootflag" :footlist="footlist" :footerindex="footerindex" :color_checked="color_checked" :color_nochecked="color_nochecked" :isHomeIndex="false"></footers>
  64. </view>
  65. </view>
  66. </template>
  67. <script>
  68. import storage from '@/utils/storage'
  69. import footers from '@/components/footer/footer.vue'
  70. import {getNoticenumber} from "@/api/work/index.js"
  71. import {updateUserProfile,findVersion} from "@/api/system/user.js"
  72. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  73. import config from '@/config'
  74. const baseUrl = config.baseUrl
  75. export default {
  76. data() {
  77. return {
  78. noticimg:require("@/static/images/mine/notice.png") ,
  79. listimga:require('@/static/images/new/index/minea.png'),
  80. listimgb:require('@/static/images/new/index/mineb.png'),
  81. listimgc:require('@/static/images/new/index/minec.png'),
  82. listimgd:require('@/static/images/new/index/mined.png'),
  83. listimge:require('@/static/images/new/index/minee.png'),
  84. listimgf:require('@/static/images/new/index/minef.png'),
  85. nlistimgh:require('@/static/images/mine/nmineh.png'),
  86. rimg:require("@/static/images/mine/rimg.png"),
  87. border:false,
  88. name: this.$store.state.user.name,
  89. version: getApp().globalData.config.appInfo.version,
  90. footlist:[
  91. {module:'zdhome',title:'首页',icon_checked:require('@/static/images/new/tabbar/home_.png'),icon_nochecked:require('@/static/images/new/tabbar/home.png')},
  92. {module:'zdcount',title:'统计分析',icon_checked:require('@/static/images/new/tabbar/tong_.png'),icon_nochecked:require('@/static/images/new/tabbar/tong.png')},
  93. {module:'zdmine',title:'我的',icon_checked:require('@/static/images/new/tabbar/mine_.png'),icon_nochecked:require('@/static/images/new/tabbar/mine.png')},
  94. ],
  95. footerindex:'zdmine',
  96. showfooter: 0,
  97. isfootflag:true,
  98. color_checked :'FA5F03',
  99. color_nochecked :'666666',
  100. noticenum:0,
  101. deptId:this.$store.state.user.deptId,
  102. wgtcode:this.$store.state.user.wgtcode,
  103. platform:'Android'
  104. }
  105. },
  106. components:{footers},
  107. computed: {
  108. avatar() {
  109. return this.$store.state.user.avatar
  110. },
  111. windowHeight() {
  112. return uni.getSystemInfoSync().windowHeight - 50
  113. }
  114. },
  115. onLoad() {
  116. if(checkPermi(['system:notice:number'])){
  117. this.getNoticenumber()
  118. }
  119. },
  120. methods: {
  121. checkPermi, checkRole,
  122. getNoticenumber(){
  123. var params={
  124. deptId:this.deptId
  125. }
  126. getNoticenumber(params).then(res=>{
  127. if(res.code==200){
  128. this.noticenum=Number(res.data)
  129. }else{
  130. this.$toast(res.msg)
  131. }
  132. })
  133. },
  134. onlineWgt() {
  135. let that = this;
  136. plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
  137. that.$store.dispatch('SetwgtFn',widgetInfo.version).then(()=>{
  138. })
  139. that.comparisonVersionNo(widgetInfo.versionCode);
  140. });
  141. // that.comparisonVersionNo()
  142. },
  143. comparisonVersionNo(versionCode) {
  144. let that = this;
  145. // console.log("aaaaaaa===versionCode", versionCode);
  146. const parmas = {
  147. model: that.platform
  148. }
  149. findVersion(parmas).then(res => {
  150. if (res.code == "200") {
  151. let versionNos = res.data.code;
  152. console.log(versionNos,'versionNos')
  153. // console.log(res.data.path);
  154. let filePath = res.data.path;
  155. if (versionNos != versionCode) { //服务器返回1更新,0则不更新
  156. uni.showModal({
  157. title: '提示',
  158. content: '发现新版本,是否升级',
  159. success: function(res) {
  160. // console.log(widgetInfo.version);
  161. if (res.confirm) {
  162. console.log('用户点击确定');
  163. that.getProperty(filePath);
  164. } else if (res.cancel) {
  165. console.log('用户点击取消');
  166. }
  167. }
  168. });
  169. }else{
  170. this.$toast('该版本已是最新版')
  171. }
  172. }
  173. }).catch(error=>{
  174. uni.hideLoading()
  175. console.log(error)
  176. })
  177. },
  178. getProperty(getProperty) {
  179. // console.log("bbbbbbbbb----------->", getProperty)
  180. let that = this;
  181. // 在线升级app/热更新
  182. that.showwri = true;
  183. const downloadTask = uni.downloadFile({ //下载文件
  184. url: baseUrl + getProperty,
  185. success: (downloadResult) => {
  186. // console.log(downloadResult);
  187. if (downloadResult.statusCode == 200) {
  188. // 更新升级
  189. plus.runtime.install(downloadResult.tempFilePath, {
  190. force: true
  191. }, function() {
  192. // console.log('install success...');
  193. that.showwri = false;
  194. plus.nativeUI.alert("应用资源更新完成!", function() {
  195. plus.runtime.restart();
  196. });
  197. }, function(e) {
  198. that.showwri = false;
  199. plus.nativeUI.alert("更新失败,请稍后再试");
  200. });
  201. }
  202. }
  203. });
  204. downloadTask.onProgressUpdate((res) => { //下载文件的进度
  205. that.totalBytesWritten = res.totalBytesWritten; //当前下载大小
  206. that.progress = res.progress; //当前下载比例
  207. that.totalBytesExpectedToWrite = res.totalBytesExpectedToWrite; //
  208. });
  209. },
  210. // 项目进展
  211. handleToAdd(){
  212. this.$tab.navigateTo('/pages/work/addclues')
  213. // this.$tab.navigateTo('/pages/work/addcluelist')
  214. },
  215. // 账号信息
  216. handleToInfo() {
  217. this.$tab.navigateTo('/pages/mine/info/index')
  218. },
  219. // 修改密码
  220. handleToPwd(){
  221. this.$tab.navigateTo('/pages/mine/pwd/index')
  222. },
  223. //消息
  224. getMessage(){
  225. if(checkPermi(['system:notice:list'])){
  226. this.$tab.navigateTo('/pages/work/message')
  227. }
  228. },
  229. //审核进度pages/work/shprogres
  230. // 政府项目
  231. handleTozf(){
  232. this.$tab.navigateTo('/pages/zdpages/work/zfitems?idx=0')
  233. },
  234. // 招商项目
  235. handleToZsFn(){
  236. this.$tab.navigateTo('/pages/work/allitems?idx=0')
  237. },
  238. //问题项目
  239. handleToWtFn(){
  240. this.$tab.navigateTo('/pages/zdpages/work/wtitems')
  241. },
  242. handleTold(){
  243. this.$tab.navigateTo('/pages/zdpages/work/lditems')
  244. },
  245. // handleToSetting() {
  246. // this.$tab.navigateTo('/pages/mine/setting/index')
  247. // },
  248. handleToLogin() {
  249. this.$tab.reLaunch('/pages/login')
  250. },
  251. handleToAvatar() {
  252. this.$tab.navigateTo('/pages/mine/avatar/index')
  253. },
  254. handleLogout() {
  255. this.$modal.confirm('确定注销并退出系统吗?').then(() => {
  256. this.$store.dispatch('LogOut').then(() => {
  257. this.$tab.reLaunch('/pages/index')
  258. })
  259. })
  260. },
  261. handleHelp() {
  262. this.$tab.navigateTo('/pages/mine/help/index')
  263. },
  264. handleAbout() {
  265. this.$tab.navigateTo('/pages/mine/about/index')
  266. },
  267. handleJiaoLiuQun() {
  268. this.$toast('QQ群:133713780')
  269. },
  270. handleBuilding() {
  271. this.$toast('模块建设中~')
  272. }
  273. }
  274. }
  275. </script>
  276. <style lang="scss">
  277. page {
  278. background-color: #FFFFFF;
  279. }
  280. .min_top{position: relative;width: 44rpx;height: 44rpx;display: flex;align-items: center;justify-content: center;margin-right: 32rpx;
  281. image{width: 38rpx;height: 40rpx;}
  282. view{position: absolute;background: #ffffff;box-shadow: 0px 2rpx 6rpx 0px rgba(198,78,0,0.49);border-radius: 10rpx;color: #FF0000;font-size: 18rpx;right: -50%;top: -12rpx;border-radius: 50%;min-width: 40rpx;height: 40rpx;text-align: center;padding: 0 4rpx;box-sizing: border-box;line-height: 40rpx;}
  283. }
  284. .min-topa{padding: 64rpx 48rpx 108rpx;}
  285. .min-topat{font-weight: bold;color: #FFFFFF;}
  286. .mine_list{padding: 30rpx 48rpx;}
  287. .limg{width: 56rpx;height: 56rpx;margin-right: 30rpx;flex: 0 0 auto;}
  288. .rimg{width: 14rpx;height: 28rpx;flex: 0 0 auto;}
  289. .ztit{font-size: 24rpx;color:#c6c6c9;text-align: center;flex:0 0 auto;margin-bottom: 28rpx;margin-top: 40rpx;}
  290. .mine-container {
  291. width: 100%;
  292. height: 100vh;
  293. display: flex;flex-direction: column;
  294. background: url('~@/static/images/mine/minebg.png') top center no-repeat;background-size: 100% 360rpx;
  295. .header-section {
  296. padding: 15px 15px 45px 15px;
  297. background-color: #3c96f3;
  298. color: white;
  299. .login-tip {
  300. font-size: 18px;
  301. margin-left: 10px;
  302. }
  303. .cu-avatar {
  304. border: 2px solid #eaeaea;
  305. .icon {
  306. font-size: 40px;
  307. }
  308. }
  309. .user-info {
  310. margin-left: 15px;
  311. .u_title {
  312. font-size: 18px;
  313. line-height: 30px;
  314. }
  315. }
  316. }
  317. .content-section {
  318. position: relative;
  319. top: -50px;
  320. .mine-actions {
  321. margin: 15px 15px;
  322. padding: 20px 0px;
  323. border-radius: 8px;
  324. background-color: white;
  325. .action-item {
  326. .icon {
  327. font-size: 28px;
  328. }
  329. .text {
  330. display: block;
  331. font-size: 13px;
  332. margin: 8px 0px;
  333. }
  334. }
  335. }
  336. }
  337. }
  338. </style>