user.vue 9.2 KB

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