mine.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  1. <template>
  2. <view>
  3. <!-- 个人信息 -->
  4. <view class="person-infos">
  5. <view class="main">
  6. <view class="photo">
  7. <img v-if="userInfo.headImg" :src="userInfo.headImg" alt="">
  8. <u-avatar v-else size="120" ></u-avatar>
  9. </view>
  10. <view class="infos">
  11. <view class="name">
  12. {{userInfo.name}}
  13. </view>
  14. <view class="department-position">
  15. <view class="department" v-if="userInfo.orgName">
  16. <view class="icon">
  17. <img src="../../assets/img/department.png" alt="">
  18. </view>
  19. <view class="text">
  20. {{userInfo.orgName}}
  21. </view>
  22. </view>
  23. <view class="position">
  24. <text class="icon">
  25. <img src="../../assets/img/position.png" alt="">
  26. </text>
  27. <text class="text">
  28. 员工
  29. </text>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="to-homepage" >
  34. <text class="text" @click="gotoUrl('pages/mine/personalPage')" >个人主页</text><text>
  35. <u-icon size="32" name="arrow-right"></u-icon>
  36. </text>
  37. </view>
  38. </view>
  39. <view class="grid" >
  40. <view class="item" @click="gotoUrl('pages/mine/personalPage')" >
  41. <view class="amout">
  42. {{plusInfo.userShare}}
  43. </view>
  44. <view class="text">
  45. <u>发布</u>
  46. </view>
  47. </view>
  48. <view class="item" @click="gotoUrl('pages/mine/myLike')" >
  49. <view class="amout">
  50. {{plusInfo.userNewsLike}}
  51. </view>
  52. <view class="text">
  53. <u>点赞</u>
  54. </view>
  55. </view>
  56. <view class="item" @click="gotoUrl('pages/mine/myComment')" >
  57. <view class="amout">
  58. {{plusInfo.userNewsComment}}
  59. </view>
  60. <view class="text">
  61. <u>评论</u>
  62. </view>
  63. </view>
  64. <view class="item" >
  65. <!-- // -->
  66. <view class="amout" @click="gotoUrl('pages/mine/points/points')" >
  67. {{plusInfo.userPoints}}
  68. </view>
  69. <view class="text">
  70. <u>积分</u>
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. <!-- 饭票卡片信息 -->
  76. <view class="meal-ticket">
  77. <view class="head">
  78. <view class="balance">
  79. 饭卡余额(元)
  80. </view>
  81. <view class="check" @click="gotoUrl('pages/mine/myMealCard')">
  82. <text><img src="../../assets/img/riLine-eye-line@1x.png" alt=""></text>查看消费记录
  83. </view>
  84. </view>
  85. <view class="content">
  86. <view class="number-time">
  87. <view class="number">
  88. 330
  89. </view>
  90. <view class="time">
  91. <text class="icon"><img src="../../assets/img/riLine-information-line@1x.png" alt=""></text>
  92. <text>下次清零 2023月6月1日 0点</text>
  93. </view>
  94. </view>
  95. <view class="payment-code" @click="gotoUrl('pages/mine/paymentCode')">
  96. <view class="code">
  97. <img src="../../assets/img/iconPark-pay-code-one@1x.png" alt="">
  98. </view>
  99. <view class="text">
  100. 付款码
  101. </view>
  102. </view>
  103. </view>
  104. </view>
  105. <!-- 功能 -->
  106. <view class="function-group group1" @click="gotoUrl('pages/mine/myWinningRecord')" >
  107. <view class="item">
  108. <view class="title">
  109. <view class="icon">
  110. <img src="../../assets/img/riLine-gift-2-line@2x.png" alt="">
  111. </view>
  112. <view class="text">
  113. 我的获奖记录
  114. </view>
  115. </view>
  116. <view class="right">
  117. <u-icon name="arrow-right" size="32" color="#cccccc"></u-icon>
  118. </view>
  119. </view>
  120. <view class="item" v-if="false" >
  121. <view class="title">
  122. <view class="icon">
  123. <img src="../../assets/img/riLine-coin-line@2x.png" alt="">
  124. </view>
  125. <view class="text">
  126. 积分兑换
  127. </view>
  128. </view>
  129. <view class="right">
  130. <u-icon name="arrow-right" size="32" color="#cccccc"></u-icon>
  131. </view>
  132. </view>
  133. </view>
  134. <view class="function-group ">
  135. <view class="item" @click="gotoUrl('pages/mine/data')">
  136. <view class="title">
  137. <view class="icon">
  138. <img src="../../assets/img/riLine-account-box-line@2x.png" alt="">
  139. </view>
  140. <view class="text">
  141. 个人资料
  142. </view>
  143. </view>
  144. <view class="right">
  145. <u-icon name="arrow-right" size="32" color="#cccccc"></u-icon>
  146. </view>
  147. </view>
  148. <view class="item" @click="gotoUrl('pages/mine/phone')" >
  149. <view class="title">
  150. <view class="icon">
  151. <img src="../../assets/img/riLine-smartphone-line@2x.png" alt="">
  152. </view>
  153. <view class="text">
  154. 绑定手机
  155. </view>
  156. </view>
  157. <view class="right">
  158. <text class="value">{{userPhone}}</text>
  159. <u-icon name="arrow-right" size="32" color="#cccccc"></u-icon>
  160. </view>
  161. </view>
  162. <view class="item" @click="gotoUrl('pages/mine/feedback')" >
  163. <view class="title">
  164. <view class="icon">
  165. <img src="../../assets/img/riLine-file-edit-line@2x.png" alt="">
  166. </view>
  167. <view class="text">
  168. 意见反馈
  169. </view>
  170. </view>
  171. <view class="right">
  172. <u-icon name="arrow-right" size="32" color="#cccccc"></u-icon>
  173. </view>
  174. </view>
  175. <view class="item" v-if="false">
  176. <view class="title">
  177. <view class="icon">
  178. <img src="../../assets/img/riLine-customer-service-2-line@2x.png" alt="">
  179. </view>
  180. <view class="text">
  181. 联系我们
  182. </view>
  183. </view>
  184. <view class="right">
  185. <text class="value">0716-8888888</text>
  186. <u-icon name="arrow-right" size="32" color="#cccccc"></u-icon>
  187. </view>
  188. </view>
  189. <view class="item" @click="logout" >
  190. <view class="title">
  191. <view class="icon">
  192. <img src="../../assets/img/riLine-logout-box-r-line@2x.png" alt="">
  193. </view>
  194. <view class="text">
  195. 退出账号
  196. </view>
  197. </view>
  198. <view class="right">
  199. <u-icon name="arrow-right" size="32" color="#cccccc"></u-icon>
  200. </view>
  201. </view>
  202. </view>
  203. <tabbar current="2"></tabbar>
  204. </view>
  205. </template>
  206. <script>
  207. import * as API from '@/apis/pagejs/user.js'
  208. import tabbar from "../../components/Tabbar.vue"
  209. export default {
  210. components: {
  211. tabbar
  212. },
  213. data() {
  214. return {
  215. plusInfo:{},
  216. userInfo:{},
  217. userPhone:"",
  218. }
  219. },
  220. onLoad() {
  221. this.init()
  222. },
  223. onShow(){
  224. this.findByOpenId()
  225. },
  226. methods: {
  227. init(){
  228. this.plusInfo=this.carhelp.getPersonInfoPlus();
  229. this.userInfo=this.carhelp.getPersonInfo();
  230. if(this.userInfo&&this.userInfo.phone){
  231. var phone = this.userInfo.phone;
  232. var phone1 = phone.slice(0,3);
  233. var phone2 = phone.slice(-4);
  234. this.userPhone = phone1 + '****' + phone2;
  235. }
  236. },
  237. findByOpenId(){
  238. API.findByOpenId({
  239. noerror:true,
  240. openId: this.carhelp.getOpenId(),
  241. }).then((response) => {
  242. this.carhelp.setPersonInfo(response.data.regUser);
  243. this.carhelp.setPersonInfoPlus(response.data)
  244. this.init();
  245. }).catch(error => {
  246. uni.hideLoading();
  247. })
  248. },
  249. logoutApi(){
  250. uni.showLoading({
  251. title: "加载中",
  252. mask: true,
  253. })
  254. var data = {
  255. };
  256. API.logout(data).then((res) => {
  257. this.carhelp.logoff();
  258. uni.reLaunch({
  259. url:"/"
  260. })
  261. }).catch(error => {
  262. uni.showToast({
  263. title: error
  264. })
  265. })
  266. },
  267. phone(){
  268. uni.makePhoneCall({
  269. phoneNumber:this.tel //仅为示例
  270. });
  271. },
  272. logout(){
  273. uni.showModal({
  274. title: '提示',
  275. content: '确认是否退出?',
  276. success: res=> {
  277. if (res.confirm) {
  278. //付钱 改为组件
  279. this.logoutApi();
  280. } else if (res.cancel) {
  281. console.log('用户点击取消');
  282. }
  283. }
  284. });
  285. },
  286. }
  287. }
  288. </script>
  289. <style lang="scss" scoped>
  290. page{
  291. font-family: 'Regular';
  292. }
  293. // 个人信息
  294. .person-infos {
  295. background: linear-gradient(45.45deg, rgba(6, 50, 130, 1) -0.45%, rgba(0, 88, 209, 1) 23.41%, rgba(0, 53, 153, 1) 52.12%, rgba(0, 66, 178, 1) 77.4%, rgba(0, 20, 130, 1) 100.65%);
  296. color: rgba(255, 255, 255, 1);
  297. padding: 40rpx 32rpx 260rpx 32rpx;
  298. .main {
  299. display: flex;
  300. align-items: center;
  301. .photo {
  302. img {
  303. width: 120rpx;
  304. height: 120rpx;
  305. border-radius: 50px;
  306. }
  307. }
  308. .infos {
  309. margin-left: 24rpx;
  310. .name {
  311. line-height: 28px;
  312. font-size: 20px;
  313. font-family: 'Medium';
  314. }
  315. .department-position {
  316. display: flex;
  317. align-items: center;
  318. margin-top: 16rpx;
  319. .icon {
  320. margin-right: 8rpx;
  321. img {
  322. width: 28rpx;
  323. height: 28rpx;
  324. }
  325. }
  326. .department {
  327. display: flex;
  328. .text{
  329. line-height: 16px;
  330. }
  331. }
  332. .position {
  333. display: flex;
  334. margin-left: 24rpx;
  335. .text{
  336. line-height: 16px;
  337. }
  338. }
  339. }
  340. }
  341. .to-homepage {
  342. margin-left: auto;
  343. .text {
  344. font-size: 16px;
  345. margin-right: 8rpx;
  346. }
  347. }
  348. }
  349. .grid {
  350. width: 100%;
  351. display: flex;
  352. flex-direction: row;
  353. flex-wrap: wrap;
  354. align-items: center;
  355. margin-top: 24rpx;
  356. .item {
  357. width: 25%;
  358. text-align: center;
  359. .amout {
  360. font-size: 48rpx;
  361. line-height: 64rpx;
  362. }
  363. .text {
  364. font-size: 32rpx;
  365. line-height: 44rpx;
  366. }
  367. }
  368. }
  369. }
  370. // 饭票信息
  371. .meal-ticket{
  372. border-radius: 8px 8px 0px 0px;
  373. background: linear-gradient(87.06deg, rgba(240,225,198,1) 5.57%,rgba(236,193,148,1) 96.45%);
  374. margin: -224rpx 32rpx 0;
  375. height: 224rpx;
  376. padding: 32rpx;
  377. .head{
  378. display: flex;
  379. justify-content: space-between;
  380. color: rgba(49, 54, 66, 1);
  381. font-weight: bold;
  382. .check{
  383. text{
  384. vertical-align: middle;
  385. margin-right: 8rpx;
  386. }
  387. }
  388. }
  389. .content{
  390. display: flex;
  391. justify-content: space-between;
  392. align-items:flex-end;
  393. .number-time{
  394. .number{
  395. color: rgba(16, 16, 16, 1);
  396. font-size: 72rpx;
  397. font-weight: bold;
  398. }
  399. .time{
  400. opacity: 0.7;
  401. color: rgba(49, 54, 66, 1);
  402. font-size: 24rpx;
  403. .icon{
  404. vertical-align: middle;
  405. margin-right: 4rpx;
  406. }
  407. }
  408. }
  409. .payment-code{
  410. width: 96rpx;
  411. height: 96rpx;
  412. border-radius: 4px;
  413. background-color: #F0CFAD;
  414. text-align: center;
  415. font-size: 20rpx;
  416. color: rgba(49, 54, 66, 1);
  417. padding: 8rpx 0;
  418. }
  419. }
  420. }
  421. // 功能
  422. .group1 {
  423. // margin-top: -72rpx !important;
  424. }
  425. .function-group {
  426. border-radius: 8px 8px 0px 0px;
  427. background-color: rgba(255, 255, 255, 1);
  428. padding: 0 0 0 24rpx;
  429. margin: 0 32rpx;
  430. margin-top: 24rpx;
  431. .item {
  432. display: flex;
  433. justify-content: space-between;
  434. align-items: center;
  435. height: 96rpx;
  436. border-bottom: 1px solid #E6E6E6;
  437. .title {
  438. display: flex;
  439. align-items: center;
  440. .icon {
  441. margin-right: 24rpx;
  442. img {
  443. width: 40rpx;
  444. height: 40rpx;
  445. vertical-align: middle;
  446. }
  447. }
  448. .text {
  449. color: rgba(51, 51, 51, 1);
  450. font-weight: bold;
  451. }
  452. }
  453. .right {
  454. margin-right: 16rpx;
  455. margin-left: 8rpx;
  456. display: flex;
  457. }
  458. }
  459. }
  460. </style>