my.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  1. <template>
  2. <view class="mainview">
  3. <view class="topnames" >
  4. 我的
  5. </view>
  6. <view class="topimg">
  7. <view class="touxiang">
  8. <image :src="src" mode="widthFix" shape="circle"
  9. style="width: 150rpx;height: 150rpx;"></image>
  10. <!-- <u-upload :fileList="fileList" @afterRead="afterRead" name="6" :multiple='false' :maxCount="1"
  11. imageMode="true" width="150" height="150">
  12. <image :src="src" mode="widthFix" shape="circle"
  13. style="width: 150rpx;height: 150rpx;"></image>
  14. </u-upload> -->
  15. </view>
  16. <view class="Username">
  17. <view class="Username1">{{getuserInfo.realName}} <span>您好</span> </view>
  18. <view class="Username2">
  19. <view class="">
  20. 您上次更新个人信息时间:
  21. </view>
  22. <view class="">
  23. {{getuserInfo.updateDate}}
  24. </view>
  25. </view>
  26. </view>
  27. <!-- <view class="changemm">
  28. <view class="message">
  29. <view class="wdmessage">已读信息:</view>
  30. <view class="messagenumber">
  31. <u-badge type="success" max="99" :value="information1"></u-badge>
  32. </view>
  33. </view>
  34. <view class="message">
  35. <view class="wdmessage">未读信息:</view>
  36. <view class="messagenumber">
  37. <u-badge type="warning" max="99" :value="information2"></u-badge>
  38. </view>
  39. </view>
  40. </view> -->
  41. </view>
  42. <!-- 头部结束 -->
  43. <view class="minndle" v-if="$has('app:PersonalInformation')||$has('app:MyOrder')
  44. ||$has('app:MyTask')||$has('app:CommentsSuggestions')">
  45. <!-- <u-grid :border="false" col="4" @click="navigations">
  46. <u-grid-item v-for="(listItem,listIndex) in list" :key="listIndex">
  47. <u-icon :customStyle="{paddingTop:20+'rpx'}" :name="listItem.name" :color="listItem.color"
  48. :size="55"></u-icon>
  49. <text class="grid-text" style="padding-top: 8px;">{{listItem.title}}</text>
  50. </u-grid-item>
  51. </u-grid> -->
  52. <view class="information" @click="navigations1" v-if="$has('app:PersonalInformation')">
  53. <view class="icon1">
  54. <u-icon name="account" size="55" color="#30D3A2" class=""></u-icon>
  55. </view>
  56. <view style="padding-top: 8px;">
  57. 个人信息
  58. </view>
  59. </view>
  60. <view class="distribute" @click="navigations2" v-if="$has('app:MyOrder')">
  61. <view class="icon2">
  62. <u-icon name="list" size="55" color="#09C700"></u-icon>
  63. </view>
  64. <view style="padding-top: 8px;">
  65. 我的订单
  66. </view>
  67. </view>
  68. <view class="task" @click="navigations3" v-if="$has('app:MyTask')">
  69. <view class="icon3">
  70. <u-icon name="order" size="55" color="#FF9C27"></u-icon>
  71. </view>
  72. <view style="padding-top: 8px;">我的任务</view>
  73. </view>
  74. <view class="opinions" @click="navigations4" v-if="$has('app:CommentsSuggestions')">
  75. <view class="icon4">
  76. <u-icon name="more-circle" size="55" color="#F7B717"></u-icon>
  77. </view>
  78. <view style="padding-top: 8px;">意见建议</view>
  79. </view>
  80. </view>
  81. <!-- 导航栏结束 -->
  82. <view class="middleimgs">
  83. <!-- <img src="@/static/my/xinxi.png" alt=""> -->
  84. <u--image mode="widthFix" :src="srcxinxi" width="750rpx" height="300rpx"></u--image>
  85. </view>
  86. <!-- 中间图片结束 -->
  87. <view class="appcell">
  88. <u-cell-group>
  89. <u-cell title="修改密码" :isLink="true" @click="changepass">
  90. <u-icon slot="icon" size="35" name="setting"></u-icon>
  91. </u-cell>
  92. <u-cell title="一键退出" :isLink="true" @click="tuichu">
  93. <u-icon slot="icon" size="35" name="close-circle"></u-icon>
  94. </u-cell>
  95. </u-cell-group>
  96. </view>
  97. <u-modal :show="showtc" content='请问您是否确定一键退出?' :showConfirmButton='true' :showCancelButton='true'
  98. @confirm="confirmtc" @cancel='canceltc'></u-modal>
  99. <!-- <u-tabbar
  100. :value="value1"
  101. :fixed="true"
  102. :placeholder="true"
  103. @change="name => value1 = name"
  104. activeColor="#2E69EB"
  105. :safeAreaInsetBottom="true"
  106. >
  107. <u-tabbar-item text="首页" icon="home" @click="click1" ></u-tabbar-item>
  108. <u-tabbar-item v-if="$has('app:worktable')" text="工作台" icon="list" @click="click2" ></u-tabbar-item>
  109. <u-tabbar-item text="我的" icon="account" @click="click3" ></u-tabbar-item>
  110. </u-tabbar> -->
  111. <u-tabbar class="tabberall" :value="value1" :fixed="true" :placeholder="true" @change="name => value1 = name"
  112. :safeAreaInsetBottom="true">
  113. <u-tabbar-item text="首页" @click="click1">
  114. <image class="u-page__item__slot-icon" slot="active-icon" :src="tabimg1"></image>
  115. <image class="u-page__item__slot-icon" slot="inactive-icon" :src="tabimg2"></image>
  116. </u-tabbar-item>
  117. <u-tabbar-item v-if="$has('app:worktable')" text="工作台" @click="click2">
  118. <image class="u-page__item__slot-icon" slot="active-icon" :src="tabimg3"></image>
  119. <image class="u-page__item__slot-icon" slot="inactive-icon" :src="tabimg4"></image>
  120. </u-tabbar-item>
  121. <u-tabbar-item text="我的" @click="click3">
  122. <image class="u-page__item__slot-icon" slot="active-icon" :src="tabimg5"></image>
  123. <image class="u-page__item__slot-icon" slot="inactive-icon" :src="tabimg6"></image>
  124. </u-tabbar-item>
  125. </u-tabbar>
  126. </view>
  127. </template>
  128. <script>
  129. import {
  130. Static
  131. } from "vue"
  132. export default {
  133. data() {
  134. return {
  135. tabimg1: require('@/static/tab/h2.png'),
  136. tabimg2: require('@/static/tab/h1.png'),
  137. tabimg3: require('@/static/tab/w2.png'),
  138. tabimg4: require('@/static/tab/w1.png'),
  139. tabimg5: require('@/static/tab/y2.png'),
  140. tabimg6: require('@/static/tab/y1.png'),
  141. value1: 2,
  142. fileList: [],
  143. showtc: false,
  144. src: require('@/static/my/tx.png'),
  145. srcxinxi: require('@/static/my/xinxi.png'),
  146. information1: 34,
  147. information2: 100,
  148. getuserInfo:{},
  149. }
  150. },
  151. //监听页面加载,其参数为上个页面传递的数据,参数类型为 Object(用于页面传参
  152. onLoad() {
  153. this.getuserInfo = uni.getStorageSync('getuserInfo');
  154. //console.log('111111111111111111', this.getuserInfo)
  155. },
  156. //监听页面初次渲染完成。注意如果渲染速度快,会在页面进入动画完成前触发
  157. onReady() {},
  158. //监听页面隐藏
  159. onHide() {},
  160. //监听窗口尺寸变化
  161. onResize() {},
  162. //监听页面卸载
  163. onUnload() {},
  164. //监听用户下拉动作,一般用于下拉刷新
  165. onPullDownRefresh() {},
  166. methods: {
  167. click1(){
  168. uni.navigateTo({
  169. url: '/pages/index/index'
  170. })
  171. },
  172. click2(){
  173. uni.navigateTo({
  174. url: '/pages/Workorder/Workorder'
  175. })
  176. },
  177. click3(){
  178. uni.navigateTo({
  179. url: '/pages/my/my'
  180. })
  181. },
  182. // 新增图片
  183. async afterRead(event) {
  184. // 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
  185. let lists = [].concat(event.file)
  186. console.log('111111111111111111', lists)
  187. let fileListLen = this.fileList.length
  188. lists.map((item) => {
  189. this.fileList.push({
  190. ...item,
  191. status: 'uploading',
  192. message: '上传中'
  193. })
  194. })
  195. for (let i = 0; i < lists.length; i++) {
  196. const result = await this.uploadFilePromise(lists[i].url)
  197. let item = this.fileList[fileListLen]
  198. this.fileList.splice(fileListLen, 1, Object.assign(item, {
  199. status: 'success',
  200. message: '',
  201. url: result
  202. }))
  203. fileListLen++
  204. }
  205. },
  206. uploadFilePromise(url) {
  207. return new Promise((resolve, reject) => {
  208. let a = uni.uploadFile({
  209. url: 'http://192.168.2.21:7001/upload', // 仅为示例,非真实的接口地址
  210. filePath: url,
  211. name: 'file',
  212. formData: {
  213. user: 'test'
  214. },
  215. success: (res) => {
  216. setTimeout(() => {
  217. resolve(res.data.data)
  218. }, 1000)
  219. }
  220. });
  221. })
  222. },
  223. navigations1(){
  224. uni.navigateTo({
  225. url: '/pages/my/Personalinformation/Personalinformation'
  226. })
  227. },
  228. navigations2(){
  229. // uni.navigateTo({
  230. // url: '/pages/my/Mydistribution/Mydistribution'
  231. // })
  232. uni.navigateTo({
  233. url: '/pages/my/Myorder/Myorder'
  234. })
  235. },
  236. navigations3(){
  237. uni.navigateTo({
  238. url: '/pages/my/Mytask/Mytask'
  239. })
  240. },
  241. navigations4(){
  242. uni.navigateTo({
  243. url: '/pages/my/Commentssuggestions/Commentssuggestions'
  244. })
  245. },
  246. changepass(){
  247. uni.navigateTo({
  248. url: '/pages/my/Changepassword/Changepassword'
  249. })
  250. },
  251. tuichu() {
  252. this.showtc = true;
  253. },
  254. confirmtc() {
  255. this.showtc = false;
  256. switch (uni.getSystemInfoSync().platform) {
  257. case 'android':
  258. plus.runtime.quit();
  259. break;
  260. case 'ios':
  261. plus.ios.import('UIApplication').sharedApplication().performSelector('exit');
  262. break;
  263. }
  264. //清除缓存
  265. uni.clearStorageSync();
  266. },
  267. canceltc() {
  268. this.showtc = false;
  269. },
  270. }
  271. }
  272. </script>
  273. <style lang="scss">
  274. .u-page__item__slot-icon {
  275. width: 40rpx;
  276. height: 40rpx;
  277. }
  278. .minndle {
  279. width: 750rpx;
  280. height: 150rpx;
  281. margin: 25rpx 0;
  282. display: flex;
  283. align-items: center;
  284. justify-content: space-around;
  285. text-align: center;
  286. }
  287. .icon1{
  288. display: flex;
  289. align-items: center;
  290. justify-content: center;
  291. }
  292. .icon2{
  293. display: flex;
  294. align-items: center;
  295. justify-content: center;
  296. }
  297. .icon3{
  298. display: flex;
  299. align-items: center;
  300. justify-content: center;
  301. }
  302. .icon4{
  303. display: flex;
  304. align-items: center;
  305. justify-content: center;
  306. }
  307. .middleimgs {
  308. width: 750rpx;
  309. height: 300rpx;
  310. }
  311. .mainview {
  312. width: 750rpx;
  313. display: flex;
  314. flex-direction: column;
  315. }
  316. .topimg {
  317. width: 750rpx;
  318. height: 350rpx;
  319. display: flex;
  320. align-items: center;
  321. // background: linear-gradient(to right, #96C2FF, #5C8FFF);
  322. background: url("@/static/my/my.png");
  323. background-size: 100% 100%;
  324. }
  325. .touxiang {
  326. width: 180rpx;
  327. height: 180rpx;
  328. display: flex;
  329. align-items: center;
  330. justify-content: center;
  331. img {
  332. width: 120rpx;
  333. height: 120rpx;
  334. cursor: pointer;
  335. }
  336. }
  337. .Username {
  338. flex-grow: 1;
  339. height:350rpx;
  340. // line-height: 150rpx;
  341. // font-size: 40rpx;
  342. // color: #fff;
  343. // font-weight: bold;
  344. display: flex;
  345. justify-content:center;
  346. flex-direction: column;
  347. }
  348. .Username1{
  349. line-height: 100rpx;
  350. height: 100rpx;
  351. font-size: 40rpx;
  352. color: #fff;
  353. font-weight: bold;
  354. span{
  355. padding-left: 15rpx;
  356. font-size: 30rpx;
  357. color: #fff;
  358. }
  359. }
  360. .Username2{
  361. font-size: 20rpx;
  362. color: #333333;
  363. }
  364. .changemm {
  365. height: 250rpx;
  366. width: 250rpx;
  367. display: flex;
  368. justify-content: center;
  369. flex-direction: column;
  370. align-items: flex-end;
  371. }
  372. .message {
  373. display: flex;
  374. justify-content: flex-end;
  375. padding-right: 30rpx;
  376. }
  377. .wdmessage {
  378. font-size: 30rpx;
  379. color: #fff;
  380. padding-right: 10rpx;
  381. }
  382. .messagenumber {
  383. padding-top: 6rpx;
  384. width: 70rpx;
  385. }
  386. .setdata {
  387. padding-top: 15rpx;
  388. img {
  389. width: 50rpx;
  390. height: 50rpx;
  391. }
  392. }
  393. </style>