index.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <template>
  2. <view class="mine-container" :style="{height: `${windowHeight}px`}">
  3. <uni-nav-bar ref="refTitle" dark :fixed="true" shadow background-color="#007AFF" status-bar :title="title" />
  4. <!--顶部个人信息栏-->
  5. <view class="header-section">
  6. <view class="flex padding justify-between">
  7. <view class="flex align-center">
  8. <image v-if="avatar" @click="handleToAvatar" :src="avatar" class="cu-avatar xl round" mode="widthFix"></image>
  9. <view @click="handleToInfo" class="user-info">
  10. <view class="u_title">
  11. 用户名:{{ name }}
  12. </view>
  13. </view>
  14. </view>
  15. <view @click="handleToInfo" class="flex align-center">
  16. <text>个人信息</text>
  17. <view class="iconfont icon-right"></view>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="content-section">
  22. <!-- <view class="mine-actions grid col-4 text-center">
  23. <view class="action-item" @click="handleJiaoLiuQun">
  24. <view class="iconfont icon-friendfill text-pink icon"></view>
  25. <text class="text">交流群</text>
  26. </view>
  27. <view class="action-item" @click="handleBuilding">
  28. <view class="iconfont icon-service text-blue icon"></view>
  29. <text class="text">在线客服</text>
  30. </view>
  31. <view class="action-item" @click="handleBuilding">
  32. <view class="iconfont icon-community text-mauve icon"></view>
  33. <text class="text">反馈社区</text>
  34. </view>
  35. <view class="action-item" @click="handleBuilding">
  36. <view class="iconfont icon-dianzan text-green icon"></view>
  37. <text class="text">点赞我们</text>
  38. </view>
  39. </view> -->
  40. <view class="menu-list">
  41. <view class="list-cell list-cell-arrow" @click="handleToEditInfo">
  42. <view class="menu-item-box">
  43. <view class="iconfont icon-user menu-icon"></view>
  44. <view>编辑资料</view>
  45. </view>
  46. </view>
  47. <view class="list-cell list-cell-arrow" @click="handleAbout">
  48. <view class="menu-item-box">
  49. <view class="iconfont icon-aixin menu-icon"></view>
  50. <view>关于我们</view>
  51. </view>
  52. </view>
  53. <!-- <view class="list-cell list-cell-arrow" @click="handleToSetting">
  54. <view class="menu-item-box">
  55. <view class="iconfont icon-setting menu-icon"></view>
  56. <view>应用设置</view>
  57. </view>
  58. </view> -->
  59. <view class="list-cell list-cell-arrow" @click="version">
  60. <view class="menu-item-box">
  61. <view class="iconfont icon-version menu-icon"></view>
  62. <view>检查更新</view>
  63. </view>
  64. </view>
  65. <view class="list-cell list-cell-arrow" @click="moveReviewe">
  66. <view class="menu-item-box">
  67. <view class="iconfont icon-service menu-icon"></view>
  68. <view>移位单审核人</view>
  69. </view>
  70. </view>
  71. <view class="list-cell list-cell-arrow" @click="handleLogout">
  72. <view class="menu-item-box">
  73. <view class="iconfont icon-logout menu-icon"></view>
  74. <view>退出</view>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. </template>
  81. <script>
  82. import storage from '@/utils/storage'
  83. import silenceUpdate from '@/uni_modules/rt-uni-update/js_sdk/silence-update.js' //引入静默更新
  84. import {
  85. latestEdition,
  86. download
  87. } from '@/api/wms/report.js'
  88. import request from '@/utils/request'
  89. export default {
  90. data() {
  91. return {
  92. name: this.$store.state.user.name,
  93. title: "设置",
  94. }
  95. },
  96. computed: {
  97. avatar() {
  98. return this.$store.state.user.avatar
  99. },
  100. windowHeight() {
  101. return uni.getSystemInfoSync().windowHeight - 50
  102. }
  103. },
  104. methods: {
  105. handleToInfo() {
  106. this.$tab.navigateTo('/pages/mine/info/index')
  107. },
  108. handleToEditInfo() {
  109. this.$tab.navigateTo('/pages/mine/info/edit')
  110. },
  111. handleToSetting() {
  112. this.$tab.navigateTo('/pages/mine/setting/index')
  113. },
  114. handleToLogin() {
  115. this.$tab.reLaunch('/pages/login')
  116. },
  117. handleToAvatar() {
  118. this.$tab.navigateTo('/pages/mine/avatar/index')
  119. },
  120. version() {
  121. //获取版本号,必须为数字
  122. let edition_number = ""
  123. try {
  124. plus.runtime.getProperty(plus.runtime.appid, (inf) => {
  125. edition_number = inf.versionCode
  126. //获取版本号,如果没有缓存的版本号再取app的版本号
  127. //传参
  128. let params = {
  129. edition_number: edition_number
  130. }
  131. //查询新版本接口
  132. latestEdition(params).then(res => {
  133. if (res.code === 200 && res.data) {
  134. let baseUrl = uni.getStorageSync("baseUrl");
  135. res.data.edition_url = res.data.edition_url.replace("${baseUrl}", baseUrl);
  136. if (res.data.package_type == 1 && res.data.edition_silence == 1) {
  137. //调用静默更新方法 传入下载地址
  138. silenceUpdate(res.data)
  139. } else {
  140. //跳转更新页面 (注意!!!如果pages.json第一页的代码里有一打开就跳转其他页面的操作,下面这行代码最好写在setTimeout里面设置延时3到5秒再执行)
  141. uni.navigateTo({
  142. url: '/uni_modules/rt-uni-update/components/rt-uni-update/rt-uni-update?obj=' +
  143. JSON.stringify(res.data)
  144. });
  145. }
  146. } else {
  147. uni.showToast({
  148. title: '已是最新版本',
  149. icon: 'none'
  150. })
  151. }
  152. });
  153. })
  154. } catch (e) {}
  155. },
  156. moveReviewe() {
  157. uni.navigateTo({
  158. url: "/pages/menu/stockMove/reviewerEdit"
  159. });
  160. },
  161. handleLogout() {
  162. this.$modal.confirm('确定注销并退出系统吗?').then(() => {
  163. this.$store.dispatch('LogOut').then(() => {
  164. this.$tab.reLaunch('/pages/index')
  165. })
  166. })
  167. },
  168. handleHelp() {
  169. this.$tab.navigateTo('/pages/mine/help/index')
  170. },
  171. handleAbout() {
  172. this.$tab.navigateTo('/pages/mine/about/index')
  173. },
  174. handleJiaoLiuQun() {
  175. this.$modal.showToast('QQ群:①133713780、②146013835')
  176. },
  177. handleBuilding() {
  178. this.$modal.showToast('模块建设中~')
  179. }
  180. }
  181. }
  182. </script>
  183. <style lang="scss">
  184. page {
  185. background-color: #f5f6f7;
  186. }
  187. .mine-container {
  188. width: 100%;
  189. height: 100%;
  190. .header-section {
  191. padding: 15px 15px 45px 15px;
  192. background-color: #3c96f3;
  193. color: white;
  194. .login-tip {
  195. font-size: 18px;
  196. margin-left: 10px;
  197. }
  198. .cu-avatar {
  199. border: 2px solid #eaeaea;
  200. .icon {
  201. font-size: 40px;
  202. }
  203. }
  204. .user-info {
  205. margin-left: 15px;
  206. .u_title {
  207. font-size: 18px;
  208. line-height: 30px;
  209. }
  210. }
  211. }
  212. .content-section {
  213. position: relative;
  214. top: -50px;
  215. .mine-actions {
  216. margin: 15px 15px;
  217. padding: 20px 0px;
  218. border-radius: 8px;
  219. background-color: white;
  220. .action-item {
  221. .icon {
  222. font-size: 28px;
  223. }
  224. .text {
  225. display: block;
  226. font-size: 13px;
  227. margin: 8px 0px;
  228. }
  229. }
  230. }
  231. }
  232. }
  233. </style>