index.vue 13 KB

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