my.vue 10 KB

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