user.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425
  1. <template>
  2. <view class="content">
  3. <view class="top">
  4. <view class="avater">
  5. <image :src="userInfo.avatar" class="avater-img" mode="" v-if="userInfo.avatar"></image>
  6. <image src="../../static/img/002.png" mode="" v-else class="avater-img"></image>
  7. </view>
  8. <view class="name-box">
  9. <view class="name-top">
  10. {{userInfo.nickname}}
  11. </view>
  12. </view>
  13. </view>
  14. <view class="nav-wrapper">
  15. <view class="nav-item flex" @click="tohelp">
  16. <view class="item-left flex">
  17. <image src="../../static/icon/i6.png" mode="" class="img1"></image>
  18. <view class="title">求救记录</view>
  19. </view>
  20. <view class="item-right">
  21. >
  22. </view>
  23. </view>
  24. <view class="nav-item flex" @click="torreco">
  25. <view class="item-left flex">
  26. <image src="../../static/icon/i7.png" mode="" class="img2"></image>
  27. <view class="title">救援记录</view>
  28. </view>
  29. <view class="item-right">
  30. >
  31. </view>
  32. </view>
  33. <view class="nav-item flex" @click="commonaddress">
  34. <view class="item-left flex">
  35. <image src="../../static/icon/i8.png" mode="" class="img3"></image>
  36. <view class="title">常用地址</view>
  37. </view>
  38. <view class="item-right">
  39. >
  40. </view>
  41. </view>
  42. <view class="nav-item flex" @click="tocertificates" >
  43. <view class="item-left flex">
  44. <image src="../../static/icon/i9.png" mode="" class="img4"></image>
  45. <view class="title">我的证书</view>
  46. </view>
  47. <view class="item-right">
  48. >
  49. </view>
  50. </view>
  51. </view>
  52. <!-- <view class="tt">
  53. <view class="tt-box " @click="tohelp" style="background-color:#FEFAF2;">
  54. <image src="../../static/icon/icon-04.png" class="tt-icon1" mode="" style="width: 52rpx; height: 62rpx;"></image>
  55. <view class="tt-txt">
  56. 求救记录
  57. </view>
  58. </view>
  59. <view class="tt-box " @click="torreco" style="background-color:#FDF4F4;">
  60. <image src="../../static/icon/icon-05.png" class="tt-icon1" mode=""></image>
  61. <view class="tt-txt">
  62. 救援记录
  63. </view>
  64. </view>
  65. <view class="tt-box " @click="commonaddress" style="background-color:#F2F6FE;margin-right: 0">
  66. <image src="../../static/icon/icon-06.png" class="tt-icon1" mode=""></image>
  67. <view class="tt-txt">
  68. 常用地址
  69. </view>
  70. </view>
  71. pages/form/certificates
  72. <view class="tt-box" @click="tocertificates" style="background-color:#EEFFFC;">
  73. <image src="../../static/icon/icon-07.png" class="tt-icon1" mode=""></image>
  74. <view class="tt-txt">
  75. 我的证书
  76. </view>
  77. </view>
  78. </view> -->
  79. </view>
  80. </template>
  81. <script>
  82. import {
  83. mapState,
  84. mapMutations
  85. } from 'vuex';
  86. import {
  87. saveUrl,
  88. interceptor
  89. } from '@/utils/loginUtils.js';
  90. import { detail_training } from '@/api/train.js';
  91. import {
  92. userinfo
  93. } from '@/api/user.js';
  94. // #ifdef H5
  95. import {
  96. weixindata
  97. } from '@/utils/wxAuthorized';
  98. // #endif
  99. export default {
  100. data() {
  101. return {
  102. common_address:'',
  103. name:'',
  104. signDate:'',
  105. id:0,
  106. is_over:0
  107. }
  108. },
  109. onShow() {
  110. console.log(this);
  111. // 判断是否已经登录
  112. if (this.hasLogin) {
  113. this.loadBaseData();
  114. } else {
  115. saveUrl();
  116. uni.showModal({
  117. title: '登录',
  118. content: '您未登录,是否马上登陆?',
  119. success: e => {
  120. if (e.confirm) {
  121. interceptor();
  122. }
  123. },
  124. fail: e => {
  125. console.log(e);
  126. }
  127. });
  128. }
  129. this.type = this.userInfo.type;
  130. this.common_address = this.userInfo.common_address
  131. console.log('点前保存的地址',this.common_address)
  132. // 保存当前页面
  133. },
  134. onReady() {
  135. console.log(99999)
  136. // detail_training({
  137. // id:this.id,
  138. // }).then(({data}) => {
  139. // console.log(999,data)
  140. // this.name = data.name
  141. // this.signDate = data.add_time
  142. // this.is_over = data.is_over
  143. // })
  144. },
  145. computed: {
  146. ...mapState('user', ['hasLogin', 'userInfo'])
  147. },
  148. methods: {
  149. ...mapMutations('user', ['setUserInfo']),
  150. loadBaseData() {
  151. userinfo({}).then(({
  152. data
  153. }) => {
  154. this.setUserInfo(data);
  155. });
  156. // #ifdef H5
  157. weixindata();
  158. // #endif
  159. // detail_training({
  160. // id:this.id,
  161. // }).then(({data}) => {
  162. // console.log(9,data)
  163. // this.name = data.name
  164. // this.signDate = data.add_time
  165. // this.is_over = data.is_over
  166. // })
  167. },
  168. toMyfu() {
  169. uni.navigateTo({
  170. url: '/pages/user/myFu'
  171. })
  172. },
  173. torreco() {
  174. uni.navigateTo({
  175. url: '/pages/applic/rescuerecords'
  176. })
  177. },
  178. tohelp() {
  179. uni.navigateTo({
  180. url: '/pages/applic/helprecords'
  181. })
  182. },
  183. commonaddress() {
  184. uni.navigateTo({
  185. url: '/pages/applic/commonaddress?add=' + this.common_address
  186. })
  187. },
  188. tocertificates() {
  189. uni.navigateTo({
  190. // pages/form/certificatesList
  191. // url: '/pages/form/certificates?name=' + this.name + '&signDate=' + this.signDate
  192. url: '/pages/form/certificatesList'
  193. })
  194. },
  195. navTo(url) {
  196. uni.navigateTo({
  197. url: url
  198. })
  199. }
  200. }
  201. }
  202. </script>
  203. <style lang="scss">
  204. page {
  205. height: 100%;
  206. background: #fff;
  207. }
  208. .content {
  209. line-height: 1;
  210. background-color: #fff;
  211. .top {
  212. width: 750rpx;
  213. height: 312rpx;
  214. // background-color: #fa7e67;
  215. display: flex;
  216. flex-direction: column;
  217. align-items: center;
  218. padding-left: 55rpx;
  219. align-items: center;
  220. justify-content: center;
  221. background-image: url(../../static/img/userbg.png);
  222. background-size: 100% 100%;
  223. .avater {
  224. width: 150rpx;
  225. height: 150rpx;
  226. margin-right: 28rpx;
  227. .avater-img {
  228. width: 100%;
  229. height: 100%;
  230. border-radius: 50%;
  231. }
  232. }
  233. .name-box {
  234. // flex: 1;
  235. padding-top: 25rpx;
  236. .name-top {
  237. font-size: 42rpx;
  238. font-weight: 400;
  239. margin-bottom: 15rpx;
  240. font-size: 32rpx;
  241. font-family: PingFang SC;
  242. font-weight: 500;
  243. color: #FFFFFF;
  244. }
  245. .name-bottom{
  246. margin-top: 16rpx;
  247. display: flex;
  248. align-items: center;
  249. // justify-content: center;
  250. .nameInfo{
  251. color: #FFFFFF;
  252. padding: 6rpx 16rpx;
  253. border: 1rpx solid #FFFFFF;
  254. border-radius: 12rpx;
  255. // background-color: pink;
  256. }
  257. }
  258. .name-footbox {
  259. .name-foot {
  260. text-align: center;
  261. font-size: 22rpx;
  262. font-weight: 400;
  263. color: #FFFFFF;
  264. background: rgba(255, 255, 255, 0.2);
  265. border: 1px solid #FFFFFF;
  266. border-radius: 20rpx;
  267. padding: 3rpx 13rpx;
  268. }
  269. }
  270. }
  271. }
  272. .center-box {
  273. width: 687rpx;
  274. // height: 235px;
  275. background: #FFE8E8;
  276. border-radius: 16rpx;
  277. margin: -90rpx auto 0;
  278. .center-top {
  279. width: 687rpx;
  280. height: 80rpx;
  281. background: #FFFFFF;
  282. border-radius: 16rpx 16rpx 0 0;
  283. display: flex;
  284. align-items: center;
  285. padding-left: 30rpx;
  286. .top-left {
  287. width: 126rpx;
  288. line-height: 32rpx;
  289. text-align: center;
  290. background: linear-gradient(0deg, #C90F1B, #F14D33);
  291. font-size: 22rpx;
  292. font-weight: 400;
  293. color: #FFFFFF;
  294. border-radius: 20rpx;
  295. margin-right: 10rpx;
  296. }
  297. .top-right {
  298. font-size: 22rpx;
  299. font-weight: 400;
  300. color: #CB151D;
  301. }
  302. }
  303. .center-foot {
  304. height: 155rpx;
  305. display: flex;
  306. .foot-list {
  307. flex: 1;
  308. text-align: center;
  309. padding-top: 20rpx;
  310. .list-top {
  311. font-size: 39rpx;
  312. font-weight: 400;
  313. color: #CB141D;
  314. line-height: 58rpx;
  315. }
  316. .list-foot {
  317. font-size: 39rpx;
  318. font-weight: 400;
  319. color: #666666;
  320. line-height: 58rpx;
  321. }
  322. }
  323. }
  324. }
  325. .tt {
  326. display: flex;
  327. flex-wrap: wrap;
  328. padding-left:32rpx;
  329. .tt-box {
  330. width: 206rpx;
  331. height: 206rpx;
  332. border-radius: 10rpx;
  333. display: flex;
  334. flex-direction: column;
  335. align-items: center;
  336. justify-content: center;
  337. margin-right: 35rpx;
  338. margin-bottom: 30rpx;
  339. image {
  340. width: 64rpx;
  341. height: 64rpx;
  342. }
  343. .tt-txt {
  344. font-size: 24rpx;
  345. font-family: PingFang SC;
  346. font-weight: bold;
  347. color: #5A5A74;
  348. padding-top: 35rpx;
  349. }
  350. }
  351. }
  352. }
  353. .nav-wrapper {
  354. width: 678rpx;
  355. // height: 560rpx;
  356. background: #FFFFFF;
  357. box-shadow: 0px 2rpx 24rpx 0rpx rgba(0, 0, 0, 0.06);
  358. border-radius: 20rpx;
  359. margin: 32rpx auto 0;
  360. color: #555555;
  361. .nav-item {
  362. height: 115rpx;
  363. border-bottom: 1rpx #F6F6F6 solid;
  364. &:last-of-type {
  365. border-bottom: none;
  366. }
  367. justify-content: space-between;
  368. align-items: center;
  369. padding: 0 36rpx 0 40rpx;
  370. .item-left {
  371. align-items: center;
  372. image {
  373. // background-color: red;
  374. }
  375. .img1 {
  376. width: 34rpx;
  377. height: 34rpx;
  378. margin-right: 21rpx;
  379. }
  380. .img2 {
  381. width: 36rpx;
  382. height: 32rpx;
  383. margin-right: 19rpx;
  384. }
  385. .img3 {
  386. width: 28rpx;
  387. height: 36rpx;
  388. margin-right: 25rpx;
  389. }
  390. .img4 {
  391. width: 36rpx;
  392. height: 28rpx;
  393. margin-right: 19rpx;
  394. }
  395. .title {
  396. font-size: 32rpx;
  397. font-family: PingFang SC;
  398. font-weight: 500;
  399. color: #555555;
  400. }
  401. }
  402. .item-right {
  403. line-height: 115rpx;
  404. }
  405. }
  406. }
  407. </style>