xq-csg-weapp_uni-ts
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

618 wiersze
16KB

  1. <template>
  2. <view>
  3. <!-- <custom-nav-bar left-text="我的" /> -->
  4. <view class="banner">
  5. <image class="banner-bg" :src="recursionOneObj.icon"></image>
  6. <view class="flex content-top flex-center">
  7. <view class="top-left">
  8. <image class="top-left-img" data-msg="头像" :src="userInfo.avatar || '/static/images/default-avatar.png'">
  9. </image>
  10. <image class="crown-img" data-msg="皇冠" v-if="userInfo.realNameAuthFlag === 1"
  11. src="https://zongzhi.xuqidata.com:5009/xq-ssg/bcf303f044229aa6cc528b822fdc75f7f897d4f0fb92c27f8332f9367fafe85d.png">
  12. </image>
  13. </view>
  14. <view class="top-content flex1">
  15. <view class="name" v-if="isLogin">{{ userInfo.nickname }}</view>
  16. <view class="name" @tap="login" v-else>请登录</view>
  17. <!-- <view class="role" wx:if="{{role}}">{{role}}</view> -->
  18. </view>
  19. <image class="top-right" @click="toSetup"
  20. src="https://zongzhi.xuqidata.com:5009/xq-ssg/bc0a28c4073688213c2dbf320d21d24048fab2f9a36d2afec51e831591e58188.png">
  21. </image>
  22. </view>
  23. <view class="flex integral-content flex-v-center flex-around">
  24. <view class="integral-left">
  25. <view class="money">
  26. {{ myInfo.integral || 0 }}
  27. </view>
  28. </view>
  29. <view class="integral-right" @tap="toIntegral">我的积分</view>
  30. </view>
  31. </view>
  32. <view class="flex my-mune">
  33. <view class="flex flex-col mune-item flex-center" v-for="(itemName, idx) in recursionOneList" :key="idx">
  34. <navigator class="line-navigator" v-if="itemName.clickUrl" :url="updateQuery(itemName.clickUrl, itemName)"
  35. hover-class="none"></navigator>
  36. <text class="name">{{ itemName.name }}</text>
  37. <text class="price">
  38. {{
  39. itemName.name === '我的点单'
  40. ? myInfo.orderCount
  41. : itemName.name === '我的家庭医生'
  42. ? myInfo.familyDoctorCount
  43. : itemName.name === '我的收藏'
  44. ? myInfo.collectionCount
  45. : itemName.name === '我的调解'
  46. ? myInfo.caseCount
  47. : 0
  48. }}
  49. </text>
  50. </view>
  51. </view>
  52. <view class="my-line"></view>
  53. <view class="page-content">
  54. <view class="cell" v-for="(itemName, idx) in recursionList" :key="idx">
  55. <view class="cell-left">
  56. <view class="icon">
  57. <image :src="itemName.icon"></image>
  58. </view>
  59. <view class="title">
  60. {{ itemName.name }}
  61. </view>
  62. </view>
  63. <navigator :url="itemName.clickUrl + userInfo.id + '&partyMemberFlag=' + myInfo.partyMemberFlag"
  64. class="cell-right" hover-class="none">
  65. <view class="cell-right-number"
  66. v-if="itemName.name === '党员接单' || itemName.name =='党员认证' || itemName.name === '党组织认证'">
  67. <!-- {{myInfo.partyMemberFlag===0?'未认证':'已认证'}} -->
  68. </view>
  69. <view class="cell-right-number" v-else>
  70. {{
  71. itemName.name === '我的诉求'
  72. ? myInfo.appealCount
  73. : itemName.name === '我的收藏'
  74. ? myInfo.collectionCount
  75. : itemName.name === '我的调解'
  76. ? myInfo.caseCount
  77. : 0
  78. }}
  79. </view>
  80. <view class="arrow">
  81. <van-icon name="arrow" size="18px" />
  82. </view>
  83. </navigator>
  84. </view>
  85. <!-- <view class="cell">
  86. <view class="cell-left">
  87. <view class="icon">
  88. <image src="https://zongzhi.xuqidata.com:5009/xq-ssg/0385e8fade03e61e8ed9481964aac89edaf47101de08a4b068ff2e3718d724e4.png"></image>
  89. </view>
  90. <view class="title">
  91. 身份认证
  92. </view>
  93. </view>
  94. <view class="cell-right" wx:if="{{myInfo.realNameAuthFlag !== 1}}">
  95. <view class="cell-right-number">
  96. <text wx:if="{{myInfo === ''}}" bindtap="toAppealssss">未实名</text>
  97. <text wx:if="{{myInfo.realNameAuthFlag === 0}}" bindtap="toAppealssss">未实名</text>
  98. <text wx:if="{{myInfo.realNameAuthFlag === 2}}" bindtap="toAppealssss">未通过</text>
  99. <text wx:if="{{myInfo.realNameAuthFlag === 3}}">审核中</text>
  100. </view>
  101. <view class="arrow">
  102. <van-icon name="arrow" size="18px" />
  103. </view>
  104. </view>
  105. <view class="cell-right" wx:else>
  106. <view class="cell-right-number">已实名</view>
  107. </view>
  108. </view> -->
  109. </view>
  110. </view>
  111. </template>
  112. <script>
  113. import * as publicApi from '@/api/publicApi.js'; // 公共 API
  114. import * as myApi from '@/api/myApi'; // 我的
  115. import utils from '@/utils/util.map'
  116. export default {
  117. components: {},
  118. data() {
  119. return {
  120. code: '',
  121. isLogin: uni.getStorageSync('isLogin'),
  122. userInfo: uni.getStorageSync('userInfoData'),
  123. role: uni.getStorageSync('userRoles'),
  124. myInfo: uni.getStorageSync('userInfoCount'),
  125. recursionOneList: [],
  126. recursionList: [],
  127. recursionOneObj: {
  128. icon: ''
  129. }
  130. };
  131. },
  132. async onLoad() {
  133. this.recursionApi();
  134. },
  135. onShow() {
  136. // 设置判断,限制不同权限渲染不同数据
  137. this.setMune();
  138. this.getInitData();
  139. this.getUserInfoApi();
  140. this.getUserInfo();
  141. },
  142. methods: {
  143. updateQuery(url, item) {
  144. return utils.updateQuery(url, item)
  145. },
  146. async getUserInfoApi() {
  147. const res = await myApi.getUserInfoApi();
  148. if (res.data) {
  149. this.myInfo = res.data
  150. uni.setStorageSync('userInfoCount', res.data);
  151. }
  152. },
  153. getInitData() {
  154. this.role = uni.getStorageSync('userRoles')
  155. this.isLogin = uni.getStorageSync('isLogin')
  156. this.userInfo = uni.getStorageSync('userInfoData')
  157. this.myInfo = uni.getStorageSync('userInfoCount')
  158. },
  159. // 菜单权限处理函数
  160. setMune() {
  161. // 根据不同权限,渲染不同数据
  162. const recursionOneList = [{
  163. id: 97,
  164. name: '我的点单',
  165. userId: this.userInfo.userId,
  166. clickUrl: '/packages/people/pages/masses/masses?userId=[userId]'
  167. },
  168. {
  169. id: 98,
  170. name: '我的家庭医生',
  171. userId: this.userInfo.userId,
  172. clickUrl: ''
  173. },
  174. {
  175. id: 99,
  176. name: '我的收藏',
  177. userId: this.userInfo.userId,
  178. clickUrl: '/packages/my/pages/collection/collection?id='
  179. },
  180. {
  181. id: 100,
  182. name: '我的调解',
  183. userId: this.userInfo.userId,
  184. clickUrl: '/packages/people/pages/mediate-my-list/mediate-my-list?id='
  185. }
  186. ];
  187. const recursionList = [{
  188. bannerType: 4,
  189. clickUrl: '/packages/people/pages/party-branch/create?userid=',
  190. cssStyle: wx.getStorageSync('userRoles') === '党组织' ? '' : 'display:none',
  191. icon: '/static/images/tissue.png',
  192. id: 125,
  193. name: '党组织认证',
  194. parentId: 96,
  195. remark: '党组织认证',
  196. sort: 1,
  197. },
  198. {
  199. bannerType: 4,
  200. clickUrl: '/packages/people/pages/party-newspaper/create?userid=',
  201. cssStyle: null,
  202. icon: '/static/images/member.png',
  203. id: 123,
  204. name: '党员认证',
  205. parentId: 96,
  206. remark: '党员认证',
  207. sort: 1,
  208. },
  209. {
  210. bannerType: 4,
  211. clickUrl: '/packages/my/pages/my-masses/my-masses?id=',
  212. cssStyle: null,
  213. icon: '/static/images/icon3.png',
  214. id: 121,
  215. name: '党员接单',
  216. parentId: 96,
  217. remark: '党员接单',
  218. sort: 0
  219. },
  220. {
  221. bannerType: 4,
  222. clickUrl: '/packages/enterprise/pages/my-appeal/my-appeal?id=',
  223. cssStyle: '',
  224. icon: '/static/images/icon1.png',
  225. id: 87,
  226. name: '我的诉求',
  227. parentId: 96,
  228. remark: '我的诉求',
  229. sort: 1
  230. },
  231. {
  232. bannerType: 4,
  233. clickUrl: '/packages/my/pages/collection/collection?id=',
  234. cssStyle: null,
  235. icon: '/static/images/icon5.png',
  236. id: 88,
  237. name: '我的收藏',
  238. parentId: 96,
  239. remark: '我的收藏',
  240. sort: 1
  241. },
  242. {
  243. bannerType: 4,
  244. clickUrl: '/packages/people/pages/mediate-my-list/mediate-my-list?id=',
  245. cssStyle: null,
  246. icon: '/static/images/icon2.png',
  247. id: 89,
  248. name: '我的调解',
  249. parentId: 96,
  250. remark: '我的调解',
  251. sort: 1
  252. },
  253. {
  254. bannerType: 4,
  255. clickUrl: null,
  256. cssStyle: null,
  257. icon: '/static/images/icon4.png',
  258. id: 90,
  259. name: '我的账号',
  260. parentId: 96,
  261. remark: '我的账号',
  262. sort: 1
  263. }
  264. ];
  265. this.recursionOneList = recursionOneList
  266. this.recursionList = recursionList
  267. },
  268. toSetup() {
  269. if (this.isLogin) {
  270. uni.navigateTo({
  271. url: '/packages/my/pages/setup/setup'
  272. });
  273. } else {
  274. this.login();
  275. }
  276. },
  277. // myDataRende(id) {
  278. // const { appealCount, caseCount, collectionCount, userName } =
  279. // this.data.myInfo;
  280. // const data = {
  281. // 87: appealCount, // 我的诉求
  282. // 88: collectionCount, // 我的收藏
  283. // 89: caseCount, // 我的调解
  284. // 90: userName, // 我的账号
  285. // 97: 0, // 我的点单
  286. // 98: 0, // 我的家庭医生
  287. // 99: collectionCount, // 我的收藏
  288. // 100: caseCount, // 我的调解
  289. // };
  290. // return data[id];
  291. // },
  292. toIntegral() {
  293. // 我的积分
  294. uni.navigateTo({
  295. url: '/packages/my/pages/integral/integral'
  296. });
  297. },
  298. toAppealssss() {
  299. uni.navigateTo({
  300. url: '/packages/my/pages/certification/certification'
  301. });
  302. },
  303. /**
  304. * 接口
  305. */
  306. async login() {
  307. uni.navigateTo({
  308. url: '/pages/phone/index'
  309. });
  310. // 我的诉求
  311. // const res = await app.globalData.register({
  312. // code: this.code
  313. // });
  314. // if (res) {
  315. // uni.showToast({
  316. // title: '登录成功',
  317. // icon: 'none'
  318. // });
  319. // this.getInitData();
  320. // } else {
  321. // }
  322. },
  323. // 获取我的信息
  324. async getUserInfo() {
  325. const res = await myApi.getProfileUserInfoApi();
  326. if (res.data) {
  327. this.userInfo = res.data
  328. this.userInfo.userId = res.data.id
  329. uni.setStorageSync("userInfoData", this.userInfo);
  330. }
  331. },
  332. async recursionApi() {
  333. const {
  334. data = []
  335. } = await publicApi.recursionApi({
  336. bannerType: 4,
  337. parentId: 95
  338. });
  339. if (data.length) {
  340. this.recursionOneObj = data.slice(0, 1)[0]
  341. }
  342. }
  343. }
  344. };
  345. </script>
  346. <style lang="less">
  347. /* pages/people/people.wxss */
  348. page {
  349. --nav-bar-background-color: transparent;
  350. --nav-bar-text-color: #ffffff; // 导航栏左侧文案样式
  351. }
  352. .banner {
  353. width: 100%;
  354. height: 420rpx;
  355. position: relative;
  356. .banner-bg {
  357. position: absolute;
  358. z-index: 0;
  359. left: 0;
  360. top: 0;
  361. width: 100%;
  362. height: 420rpx;
  363. }
  364. .content-top {
  365. height: 88rpx;
  366. width: 100%;
  367. position: absolute;
  368. top: 159rpx;
  369. padding-left: 50rpx;
  370. padding-right: 50rpx;
  371. line-height: 88rpx;
  372. .top-left {
  373. height: 88rpx;
  374. width: 88rpx;
  375. border-radius: 50%;
  376. border: 2rpx solid #ffdc00;
  377. position: relative;
  378. .top-left-img {
  379. width: 100%;
  380. height: 100%;
  381. border-radius: 50%;
  382. }
  383. .crown-img {
  384. position: absolute;
  385. height: 70rpx;
  386. width: 70rpx;
  387. z-index: 1;
  388. top: -41rpx;
  389. right: -15rpx;
  390. }
  391. }
  392. .top-content {
  393. margin-left: 40rpx;
  394. .name {
  395. height: 40rpx;
  396. font-size: 40rpx;
  397. font-weight: 400;
  398. color: #ffffff;
  399. line-height: 40rpx;
  400. }
  401. .role {
  402. padding-left: 10rpx;
  403. padding-right: 10rpx;
  404. height: 40rpx;
  405. background: #df7500;
  406. border-radius: 20rpx;
  407. border: 1px solid #e8d89c;
  408. margin-top: 13rpx;
  409. font-size: 22rpx;
  410. font-weight: 400;
  411. color: #fff600;
  412. display: flex;
  413. justify-content: center;
  414. align-items: center;
  415. }
  416. }
  417. .top-right {
  418. width: 52rpx;
  419. height: 52rpx;
  420. }
  421. }
  422. .integral-outline {
  423. width: 100%;
  424. height: 120rpx;
  425. display: flex;
  426. justify-content: center;
  427. margin-top: -50rpx;
  428. z-index: 999;
  429. }
  430. .integral-content {
  431. width: 100%;
  432. position: absolute;
  433. top: 309rpx;
  434. left: 0;
  435. z-index: 2;
  436. .integral-left {
  437. display: flex;
  438. .yuanbao-content {
  439. height: 39rpx;
  440. width: 52rpx;
  441. margin-right: 10px;
  442. }
  443. .money {
  444. font-size: 52rpx;
  445. font-family: PingFangSC-Medium, PingFang SC;
  446. font-weight: 500;
  447. color: #fe3b53;
  448. line-height: 52rpx;
  449. }
  450. }
  451. .integral-right {
  452. font-size: 24rpx;
  453. font-weight: 400;
  454. color: #b36104;
  455. line-height: 24rpx;
  456. }
  457. }
  458. }
  459. .my-mune {
  460. width: 100%;
  461. // height: 100%;
  462. padding: 0 75rpx;
  463. background-color: #ffffff;
  464. position: relative;
  465. z-index: 1;
  466. flex-wrap: wrap;
  467. &::after {
  468. content: '';
  469. position: absolute;
  470. left: 50%;
  471. top: 0;
  472. transform: translateX(-50%);
  473. z-index: 2;
  474. width: 1px;
  475. height: 100%;
  476. background-color: #efefef;
  477. }
  478. &::before {
  479. content: '';
  480. position: absolute;
  481. left: 0;
  482. top: 50%;
  483. transform: translateY(-50%);
  484. z-index: 2;
  485. width: 100%;
  486. height: 1px;
  487. background-color: #efefef;
  488. }
  489. .mune-item {
  490. width: 50%;
  491. height: 122rpx;
  492. position: relative;
  493. z-index: 1;
  494. .line-navigator {
  495. width: 100%;
  496. height: 100%;
  497. position: absolute;
  498. z-index: 10;
  499. top: 0;
  500. left: 0;
  501. }
  502. .name {
  503. font-size: 28rpx;
  504. font-weight: 400;
  505. color: #666666;
  506. line-height: 28rpx;
  507. }
  508. .price {
  509. margin-top: 16rpx;
  510. font-size: 32rpx;
  511. font-weight: 400;
  512. color: #fe3b53;
  513. line-height: 32rpx;
  514. }
  515. }
  516. }
  517. .my-line {
  518. width: 100%;
  519. height: 20rpx;
  520. background: #f9f9f9;
  521. }
  522. .page-content {
  523. margin-top: 12rpx;
  524. padding-left: 36rpx;
  525. padding-right: 36rpx;
  526. .cell {
  527. width: 100%;
  528. height: 120rpx;
  529. background: #ffffff;
  530. border-bottom: 1rpx solid #efefef;
  531. display: flex;
  532. justify-content: space-between;
  533. .cell-left {
  534. height: 100%;
  535. display: flex;
  536. align-items: center;
  537. .icon {
  538. height: 40rpx;
  539. width: 40rpx;
  540. margin-right: 32rpx;
  541. image {
  542. height: 100%;
  543. width: 100%;
  544. }
  545. }
  546. .title {
  547. font-size: 32rpx;
  548. font-weight: 400;
  549. color: #333333;
  550. line-height: 32rpx;
  551. }
  552. }
  553. .cell-right {
  554. height: 100%;
  555. width: 400rpx;
  556. display: flex;
  557. align-items: center;
  558. justify-content: flex-end;
  559. .cell-right-number {
  560. font-size: 32rpx;
  561. font-weight: 400;
  562. color: #999999;
  563. margin-right: 28rpx;
  564. }
  565. }
  566. }
  567. }
  568. </style>