瑶都万能墙
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

528 lines
11 KiB

1 year ago
11 months ago
3 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
11 months ago
1 year ago
1 year ago
1 year ago
11 months ago
11 months ago
11 months ago
1 year ago
11 months ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
11 months ago
1 year ago
1 year ago
11 months ago
1 year ago
1 year ago
1 year ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
11 months ago
1 year ago
1 year ago
11 months ago
11 months ago
11 months ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
3 months ago
3 months ago
3 months ago
1 year ago
1 year ago
11 months ago
11 months ago
1 year ago
1 year ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <view class="page">
  3. <view class="beijin">
  4. <view class="profile">
  5. <!-- 未登录状态 -->
  6. <view v-if="!isLogin" class="login-section">
  7. <view class="avatar-placeholder">
  8. <uv-icon name="account" size="80rpx" color="#ccc"></uv-icon>
  9. </view>
  10. <view class="login-info">
  11. <view class="welcome-text">欢迎来到墙友社区</view>
  12. <view class="login-desc">登录后享受更多功能</view>
  13. <button class="login-btn" @click="$utils.toLogin">立即登录</button>
  14. </view>
  15. </view>
  16. <!-- 已登录状态 -->
  17. <view v-else>
  18. <view class="o">
  19. <view class="headImage" @click="goToMyProfile">
  20. <image
  21. :src="userInfo.headImage"
  22. mode="aspectFill"></image>
  23. <view class="vip_info"
  24. v-if="userInfo.isPay">
  25. <view class="title">
  26. {{ headInfo[vipList[userInfo.isPay - 1]].keyName }}
  27. </view>
  28. <!-- <view class="time">
  29. 2024-6-6到期
  30. </view> -->
  31. </view>
  32. </view>
  33. <!-- <view class="vip_info">
  34. <view class="title">
  35. 普通会员
  36. </view>
  37. <view class="time">
  38. 2024-6-6到期
  39. </view>
  40. </view> -->
  41. <view class="setUp"
  42. @click="$utils.navigateTo('/pages_order/mine/setting')">
  43. 设置
  44. </view>
  45. </view>
  46. <view class="account">
  47. <view class="number">
  48. {{ userInfo.nickName || '墙友1712378974678376' }}
  49. </view>
  50. <view class="gender">
  51. <uv-icon
  52. :name="sex[userInfo.sex].name"
  53. size="34rpx"
  54. :color="sex[userInfo.sex].color"></uv-icon>
  55. </view>
  56. <view class="authentication">
  57. {{ auth[userInfo.idCardOpen] || '未认证' }}
  58. </view>
  59. </view>
  60. <view class="Days">
  61. <!-- 你已经成为狐友133天啦~ -->
  62. </view>
  63. <view class="box">
  64. <view class="fenst"
  65. @click="$utils.navigateTo('/pages_order/mine/promotion')">
  66. <view class="digit">
  67. <uv-icon
  68. size="40rpx"
  69. color="#black"
  70. name="grid"></uv-icon>
  71. </view>
  72. <view class="fans">
  73. 二维码
  74. </view>
  75. </view>
  76. <view class="shut">
  77. |
  78. </view>
  79. <view class="fenst"
  80. @click="$utils.navigateTo('/pages_order/mine/fans')">
  81. <view class="digit">
  82. {{ userInfo.intentionNum }}
  83. </view>
  84. <view class="fans">
  85. 粉丝
  86. </view>
  87. </view>
  88. <view class="shut">
  89. |
  90. </view>
  91. <view class="fenst"
  92. @click="$utils.navigateTo('/pages_order/mine/runningWater?status=0')">
  93. <view class="digit">
  94. {{ userInfo.price }}
  95. </view>
  96. <view class="fans">
  97. 余额
  98. </view>
  99. </view>
  100. <view class="shut">
  101. |
  102. </view>
  103. <view class="fenst"
  104. @click="$utils.navigateTo('/pages_order/mine/runningWater?status=1')">
  105. <view class="digit">
  106. {{ userInfo.integerPrice }}
  107. </view>
  108. <view class="fans">
  109. 积分
  110. </view>
  111. </view>
  112. </view>
  113. </view>
  114. </view>
  115. </view>
  116. <!-- 只有登录后才显示内容标签页 -->
  117. <view v-if="isLogin" class="Content">
  118. <uv-tabs :list="tabs" @click="click"
  119. :activeStyle="{color : '#000', fontWeight : 900}"
  120. lineColor="#5baaff"
  121. lineHeight="8rpx"
  122. lineWidth="50rpx"></uv-tabs>
  123. </view>
  124. <!-- 我的帖子 -->
  125. <view v-if="isLogin && type == 0">
  126. <dynamicItemEdit
  127. :key="index"
  128. @click="$utils.navigateTo('/pages_order/post/addPost?id=' + item.id)"
  129. v-for="(item, index) in list"
  130. :item="item"
  131. del
  132. @del="delDynamic(item.id)"
  133. />
  134. </view>
  135. <!-- 我的租房 -->
  136. <view v-if="isLogin && type == 1">
  137. <rentingItem :key="index" v-for="(item, index) in list" :item="item"
  138. @click="$utils.navigateTo('/pages_order/renting/addRenting?id=' + item.id)" />
  139. </view>
  140. <!-- 我的招聘 -->
  141. <view v-if="isLogin && type == 2">
  142. <workItem :key="index" v-for="(item, index) in list" :item="item"
  143. @click="$utils.navigateTo('/pages_order/work/addWork?id=' + item.id)" />
  144. </view>
  145. <!-- 我的店铺 -->
  146. <view v-if="isLogin && type == 3">
  147. <gourmetItem :key="index" v-for="(item, index) in list" :item="item"
  148. @click="$utils.navigateTo('/pages_order/gourmet/gourmetDetail?id=' + item.id)" />
  149. </view>
  150. <!-- 我的同城群 -->
  151. <view v-if="isLogin && type == 4">
  152. <groupItem :key="index" v-for="(item, index) in list" :item="item" :edit="true"
  153. @refresh="getData" />
  154. </view>
  155. <!-- 未登录提示 -->
  156. <view v-if="!isLogin" class="login-prompt">
  157. <uv-empty
  158. text="请先登录查看更多内容"
  159. textSize="30rpx"
  160. iconSize="200rpx"
  161. icon="account">
  162. </uv-empty>
  163. </view>
  164. <view class="no-data"
  165. v-if="isLogin && !tabs[type].show">
  166. 暂未开放
  167. </view>
  168. <uv-empty
  169. v-else-if="isLogin && list.length == 0"
  170. text="空空如也"
  171. textSize="30rpx"
  172. iconSize="200rpx"
  173. icon="list"></uv-empty>
  174. <tabber select="3" />
  175. </view>
  176. </template>
  177. <script>
  178. import tabber from '@/components/base/tabbar.vue'
  179. import dynamicItemEdit from '@/components/list/dynamic/dynamicItemEdit.vue'
  180. import gourmetItem from '@/components/list/gourmet/gourmetItem.vue'
  181. import rentingItem from '@/components/list/renting/rentingItem.vue'
  182. import workItem from '@/components/list/work/workItem.vue'
  183. import groupItem from '@/components/list/group/groupItem.vue'
  184. import mixinsList from '@/mixins/list.js'
  185. import mixinsSex from '@/mixins/sex.js'
  186. import { mapState } from 'vuex'
  187. export default {
  188. mixins: [mixinsList, mixinsSex],
  189. components: {
  190. tabber,
  191. gourmetItem,
  192. rentingItem,
  193. workItem,
  194. groupItem,
  195. dynamicItemEdit,
  196. },
  197. computed: {
  198. ...mapState(['userInfo', 'headInfo']),
  199. },
  200. data() {
  201. return {
  202. tabs: [
  203. {
  204. name: '帖子',
  205. show : true,
  206. },
  207. {
  208. name: '租房',
  209. show : true,
  210. },
  211. {
  212. name: '招聘',
  213. show : true,
  214. },
  215. {
  216. name: '店铺',
  217. show : true,
  218. },
  219. {
  220. name: '同城群',
  221. show : true,
  222. },
  223. ],
  224. vipList : ['vip', 'vipBig'],
  225. mixinsListApi : '',
  226. apiList : [
  227. 'getMyPostPage',//查询我的帖子
  228. 'getMyRent',
  229. 'getMyJob',
  230. 'myShop',//查询我的店铺
  231. 'getMyPublishedList',//查询我发布的同城群
  232. ],
  233. auth : ['审核中', '个人认证', '店铺认证'],
  234. type : 0,
  235. isLogin: false,
  236. }
  237. },
  238. onShow() {
  239. this.checkLoginStatus()
  240. },
  241. methods: {
  242. // 检查登录状态
  243. checkLoginStatus() {
  244. // 检查是否有用户信息或token来判断登录状态
  245. const token = uni.getStorageSync('token')
  246. if (token) {
  247. this.mixinsListApi = this.apiList[this.type]
  248. this.isLogin = true
  249. this.$store.commit('getUserInfo')
  250. this.getData()
  251. } else {
  252. this.isLogin = false
  253. }
  254. },
  255. click({index}) {
  256. if (!this.isLogin) {
  257. this.showLoginTip()
  258. return
  259. }
  260. this.type = index
  261. this.mixinsListApi = this.apiList[index]
  262. this.list = []
  263. this.getData()
  264. },
  265. // 显示登录提示
  266. showLoginTip() {
  267. uni.showToast({
  268. title: '请先登录',
  269. icon: 'none'
  270. })
  271. },
  272. // 删除帖子
  273. delDynamic(postId){
  274. let self = this
  275. uni.showModal({
  276. title: '确认要删除吗?',
  277. success(e) {
  278. if(e.confirm){
  279. self.$api('deletePost', {
  280. postId
  281. }, res => {
  282. if(res.code == 200){
  283. self.getData()
  284. }
  285. })
  286. }
  287. }
  288. })
  289. },
  290. // 跳转到我的个人主页
  291. goToMyProfile() {
  292. if (!this.isLogin) {
  293. this.showLoginTip()
  294. return
  295. }
  296. uni.navigateTo({
  297. url: '/pages_order/auth/wxUserInfo?back=1'
  298. })
  299. // uni.navigateTo({
  300. // url: `/pages_order/profile/userProfile?userId=${this.userInfo.id}`
  301. // })
  302. },
  303. }
  304. }
  305. </script>
  306. <style scoped lang="scss">
  307. .page {
  308. .beijin {
  309. // background: linear-gradient(to bottom, rgb(85, 94, 123), rgb(45, 51, 73));
  310. background: linear-gradient($uni-color, #fff);
  311. background-color: black;
  312. color: black;
  313. .profile {
  314. padding: 40rpx;
  315. padding-top: 160rpx;
  316. // 未登录状态样式
  317. .login-section {
  318. display: flex;
  319. flex-direction: column;
  320. align-items: center;
  321. padding: 40rpx 0;
  322. .avatar-placeholder {
  323. width: 100px;
  324. height: 100px;
  325. border-radius: 50%;
  326. background: #f5f5f5;
  327. display: flex;
  328. align-items: center;
  329. justify-content: center;
  330. margin-bottom: 30rpx;
  331. }
  332. .login-info {
  333. text-align: center;
  334. .welcome-text {
  335. font-size: 32rpx;
  336. font-weight: bold;
  337. margin-bottom: 10rpx;
  338. }
  339. .login-desc {
  340. font-size: 24rpx;
  341. color: #666;
  342. margin-bottom: 40rpx;
  343. }
  344. .login-btn {
  345. background: linear-gradient(45deg, #5baaff, #4a90e2);
  346. color: white;
  347. border: none;
  348. border-radius: 50rpx;
  349. padding: 20rpx 60rpx;
  350. font-size: 28rpx;
  351. font-weight: bold;
  352. }
  353. }
  354. }
  355. .box {
  356. padding: 0rpx 10rpx;
  357. display: flex;
  358. align-items: center;
  359. text-align: center;
  360. .followWithnterest {
  361. .digit {
  362. padding: 20rpx;
  363. }
  364. .close {
  365. }
  366. }
  367. .shut{
  368. margin: 0rpx 20rpx;
  369. }
  370. .fenst {
  371. .digit {
  372. padding: 20rpx;
  373. }
  374. .fans {
  375. }
  376. }
  377. }
  378. .account {
  379. display: flex;
  380. align-items: center;
  381. .number {
  382. letter-spacing: 2rpx;
  383. margin-top: 10rpx;
  384. }
  385. .gender {
  386. margin: 20rpx 10rpx;
  387. }
  388. .authentication {
  389. font-size: 20rpx;
  390. }
  391. }
  392. .Days {
  393. margin-top: 15rpx;
  394. font-size: 22rpx;
  395. letter-spacing: 2rpx;
  396. }
  397. .o {
  398. display: flex;
  399. align-items: center;
  400. justify-content: space-between;
  401. margin-bottom: 60rpx;
  402. .headImage {
  403. position: relative;
  404. height: 100px;
  405. width: 100px;
  406. border-radius: 50%;
  407. image {
  408. height: 100%;
  409. width: 100%;
  410. border-radius: 50%;
  411. }
  412. .vip_info{
  413. --lg1Color : #ffb700;
  414. --lg2Color : #ff3300;
  415. display: flex;
  416. justify-content: center;
  417. background: linear-gradient(var(--lg1Color), var(--lg2Color));
  418. color: #fff;
  419. font-size: 20rpx;
  420. padding: 15rpx 0;
  421. border-radius: 20rpx;
  422. margin-top: auto;
  423. margin-right: auto;
  424. position: absolute;
  425. bottom: -30rpx;
  426. left: 50%;
  427. width: 160rpx;
  428. transform: translate(-50%);
  429. }
  430. }
  431. // .vip_info{
  432. // // display: flex;
  433. // // justify-content: center;
  434. // background-color: #2800ee;
  435. // color: #fff;
  436. // font-size: 20rpx;
  437. // padding: 15rpx 30rpx;
  438. // line-height: 50rpx;
  439. // border-radius: 20rpx;
  440. // margin-right: auto;
  441. // margin-left: 20rpx;
  442. // .title{
  443. // font-size: 26rpx;
  444. // }
  445. // .time{
  446. // // margin-left: 20rpx;
  447. // }
  448. // }
  449. .setUp {
  450. }
  451. }
  452. }
  453. }
  454. .Content {}
  455. .login-prompt {
  456. padding: 100rpx 0;
  457. }
  458. .no-data{
  459. display: flex;
  460. justify-content: center;
  461. align-content: center;
  462. padding: 100rpx 0;
  463. color: #777;
  464. }
  465. }
  466. </style>