user.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. <template>
  2. <view class="content">
  3. <view class="top">
  4. <view class="avater">
  5. <image :src="userInfo.avatar" class="avater-img" mode=""></image>
  6. </view>
  7. <view class="name-box">
  8. <view class="name-top">
  9. {{userInfo.nickname}}
  10. </view>
  11. <!-- <view class="name-footbox">
  12. <text class="name-foot">
  13. 小天使
  14. </text>
  15. </view> -->
  16. </view>
  17. </view>
  18. <!-- <view class="center-box">
  19. <view class="center-top">
  20. <view class="top-left">
  21. 正在参与
  22. </view>
  23. <view class="top-right">
  24. 小天使在行动·关爱自症儿童
  25. </view>
  26. </view>
  27. <view class="center-foot">
  28. <view class="foot-list">
  29. <view class="list-top">
  30. 88
  31. </view>
  32. <view class="list-foot">
  33. 捐款人数
  34. </view>
  35. </view>
  36. <view class="foot-list">
  37. <view class="list-top">
  38. 8888.88
  39. </view>
  40. <view class="list-foot">
  41. 募集善款
  42. </view>
  43. </view>
  44. <view class="foot-list">
  45. <view class="list-top">
  46. 88
  47. </view>
  48. <view class="list-foot">
  49. 排名
  50. </view>
  51. </view>
  52. </view>
  53. </view> -->
  54. <view class="tt">
  55. <view class="tt-box border-b" @click="tohelp">
  56. <image src="../../static/icon/icon-04.png" class="tt-icon1" mode=""></image>
  57. <view class="tt-txt">
  58. 求救记录
  59. </view>
  60. <image src="../../static/icon/next.png" class="next-icon" mode=""></image>
  61. </view>
  62. <view class="tt-box" @click="torreco">
  63. <image src="../../static/icon/icon-05.png" class="tt-icon1" mode=""></image>
  64. <view class="tt-txt">
  65. 救援记录
  66. </view>
  67. <image src="../../static/icon/next.png" class="next-icon" mode=""></image>
  68. </view>
  69. </view>
  70. </view>
  71. </template>
  72. <script>
  73. import { mapState, mapMutations } from 'vuex';
  74. import {
  75. saveUrl,
  76. interceptor
  77. } from '@/utils/loginUtils.js';
  78. import {
  79. userinfo
  80. } from '@/api/user.js';
  81. // #ifdef H5
  82. import { weixindata } from '@/utils/wxAuthorized';
  83. // #endif
  84. export default{
  85. data(){
  86. return{
  87. }
  88. },
  89. onShow() {
  90. console.log(this);
  91. // 判断是否已经登录
  92. if (this.hasLogin) {
  93. this.loadBaseData();
  94. } else {
  95. saveUrl();
  96. uni.showModal({
  97. title: '登录',
  98. content: '您未登录,是否马上登陆?',
  99. success: e => {
  100. if (e.confirm) {
  101. interceptor();
  102. }
  103. },
  104. fail: e => {
  105. console.log(e);
  106. }
  107. });
  108. }
  109. this.type = this.userInfo.type;
  110. // 保存当前页面
  111. },
  112. computed: {
  113. ...mapState('user',['hasLogin', 'userInfo'])
  114. },
  115. methods:{
  116. ...mapMutations('user', ['setUserInfo']),
  117. loadBaseData() {
  118. userinfo({}).then(({ data }) => {
  119. this.setUserInfo(data);
  120. });
  121. // #ifdef H5
  122. weixindata();
  123. // #endif
  124. },
  125. torreco(){
  126. uni.navigateTo({
  127. url:'/pages/applic/rescuerecords'
  128. })
  129. },
  130. tohelp(){
  131. uni.navigateTo({
  132. url:'/pages/applic/helprecords'
  133. })
  134. }
  135. }
  136. }
  137. </script>
  138. <style lang="scss">
  139. .content{
  140. line-height: 1;
  141. .top{
  142. width: 750rpx;
  143. height: 370rpx;
  144. // background-color: #CB131B;
  145. background: url(../../static/images/bgi2.png)no-repeat top left;
  146. background-size:750rpx 370rpx;
  147. display: flex;
  148. align-items: center;
  149. padding-left: 55rpx;
  150. .avater{
  151. width: 150rpx;
  152. height: 150rpx;
  153. margin-right: 28rpx;
  154. .avater-img{
  155. width: 100%;
  156. height: 100%;
  157. border-radius: 50%;
  158. }
  159. }
  160. .name-box{
  161. // flex: 1;
  162. .name-top{
  163. font-size: 42rpx;
  164. font-weight: 400;
  165. color: #FFFFFF;
  166. margin-bottom: 15rpx;
  167. }
  168. .name-footbox{
  169. .name-foot{
  170. text-align: center;
  171. font-size: 22rpx;
  172. font-weight: 400;
  173. color: #FFFFFF;
  174. background: rgba(255, 255, 255, 0.2);
  175. border: 1px solid #FFFFFF;
  176. border-radius: 20rpx;
  177. padding: 3rpx 13rpx;
  178. }
  179. }
  180. }
  181. }
  182. .center-box{
  183. width: 687rpx;
  184. // height: 235px;
  185. background: #FFE8E8;
  186. border-radius: 16rpx;
  187. margin: -90rpx auto 0;
  188. .center-top{
  189. width: 687rpx;
  190. height: 80rpx;
  191. background: #FFFFFF;
  192. border-radius: 16rpx 16rpx 0 0;
  193. display: flex;
  194. align-items: center;
  195. padding-left: 30rpx;
  196. .top-left{
  197. width: 126rpx;
  198. line-height: 32rpx;
  199. text-align: center;
  200. background: linear-gradient(0deg, #C90F1B, #F14D33);
  201. font-size: 22rpx;
  202. font-weight: 400;
  203. color: #FFFFFF;
  204. border-radius: 20rpx;
  205. margin-right: 10rpx;
  206. }
  207. .top-right{
  208. font-size: 22rpx;
  209. font-weight: 400;
  210. color: #CB151D;
  211. }
  212. }
  213. .center-foot{
  214. height: 155rpx;
  215. display: flex;
  216. .foot-list{
  217. flex: 1;
  218. text-align: center;
  219. padding-top: 20rpx;
  220. .list-top{
  221. font-size: 39rpx;
  222. font-weight: 400;
  223. color: #CB141D;
  224. line-height: 58rpx;
  225. }
  226. .list-foot{
  227. font-size: 39rpx;
  228. font-weight: 400;
  229. color: #666666;
  230. line-height: 58rpx;
  231. }
  232. }
  233. }
  234. }
  235. .tt{
  236. margin: 20rpx auto 0;
  237. width: 700rpx;
  238. box-shadow: 0px 0px 20rpx 0px rgba(49, 49, 52, 0.06);
  239. border-radius: 10rpx;
  240. background-color: #ffffff;
  241. .tt-box{
  242. width: 700rpx;
  243. height: 100rpx;
  244. padding:0 30rpx;
  245. // margin-top: 37rpx;
  246. display: flex;
  247. align-items: center;
  248. .tt-icon{
  249. width: 40rpx;
  250. height: 40rpx;
  251. }
  252. .tt-icon1{
  253. width: 40rpx;
  254. height: 36rpx;
  255. }
  256. .tt-txt{
  257. margin-left: 20rpx;
  258. font-size: 28rpx;
  259. font-weight: 300;
  260. color: #000000;
  261. flex: 1;
  262. }
  263. .next-icon{
  264. width: 30rpx;
  265. height: 38rpx;
  266. }
  267. }
  268. .border-b{
  269. border-bottom: 1px solid #F1F1F1;
  270. }
  271. }
  272. }
  273. </style>