瑶都万能墙
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.

525 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
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
10 months ago
11 months ago
1 year ago
1 year ago
10 months ago
10 months ago
10 months ago
1 year ago
10 months ago
10 months ago
1 year ago
11 months ago
1 year ago
11 months ago
10 months ago
1 year ago
1 year ago
1 year ago
1 year ago
10 months ago
11 months ago
1 year ago
11 months ago
1 year ago
1 year ago
1 year ago
10 months ago
1 year ago
1 year ago
1 year ago
1 year ago
10 months ago
1 year ago
1 year ago
11 months ago
10 months ago
10 months ago
10 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
10 months ago
1 year ago
10 months ago
1 year 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/profile/userProfile?userId=${this.userInfo.id}`
  298. })
  299. },
  300. }
  301. }
  302. </script>
  303. <style scoped lang="scss">
  304. .page {
  305. .beijin {
  306. // background: linear-gradient(to bottom, rgb(85, 94, 123), rgb(45, 51, 73));
  307. background: linear-gradient($uni-color, #fff);
  308. background-color: black;
  309. color: black;
  310. .profile {
  311. padding: 40rpx;
  312. padding-top: 160rpx;
  313. // 未登录状态样式
  314. .login-section {
  315. display: flex;
  316. flex-direction: column;
  317. align-items: center;
  318. padding: 40rpx 0;
  319. .avatar-placeholder {
  320. width: 100px;
  321. height: 100px;
  322. border-radius: 50%;
  323. background: #f5f5f5;
  324. display: flex;
  325. align-items: center;
  326. justify-content: center;
  327. margin-bottom: 30rpx;
  328. }
  329. .login-info {
  330. text-align: center;
  331. .welcome-text {
  332. font-size: 32rpx;
  333. font-weight: bold;
  334. margin-bottom: 10rpx;
  335. }
  336. .login-desc {
  337. font-size: 24rpx;
  338. color: #666;
  339. margin-bottom: 40rpx;
  340. }
  341. .login-btn {
  342. background: linear-gradient(45deg, #5baaff, #4a90e2);
  343. color: white;
  344. border: none;
  345. border-radius: 50rpx;
  346. padding: 20rpx 60rpx;
  347. font-size: 28rpx;
  348. font-weight: bold;
  349. }
  350. }
  351. }
  352. .box {
  353. padding: 0rpx 10rpx;
  354. display: flex;
  355. align-items: center;
  356. text-align: center;
  357. .followWithnterest {
  358. .digit {
  359. padding: 20rpx;
  360. }
  361. .close {
  362. }
  363. }
  364. .shut{
  365. margin: 0rpx 20rpx;
  366. }
  367. .fenst {
  368. .digit {
  369. padding: 20rpx;
  370. }
  371. .fans {
  372. }
  373. }
  374. }
  375. .account {
  376. display: flex;
  377. align-items: center;
  378. .number {
  379. letter-spacing: 2rpx;
  380. margin-top: 10rpx;
  381. }
  382. .gender {
  383. margin: 20rpx 10rpx;
  384. }
  385. .authentication {
  386. font-size: 20rpx;
  387. }
  388. }
  389. .Days {
  390. margin-top: 15rpx;
  391. font-size: 22rpx;
  392. letter-spacing: 2rpx;
  393. }
  394. .o {
  395. display: flex;
  396. align-items: center;
  397. justify-content: space-between;
  398. margin-bottom: 60rpx;
  399. .headImage {
  400. position: relative;
  401. height: 100px;
  402. width: 100px;
  403. border-radius: 50%;
  404. image {
  405. height: 100%;
  406. width: 100%;
  407. border-radius: 50%;
  408. }
  409. .vip_info{
  410. --lg1Color : #ffb700;
  411. --lg2Color : #ff3300;
  412. display: flex;
  413. justify-content: center;
  414. background: linear-gradient(var(--lg1Color), var(--lg2Color));
  415. color: #fff;
  416. font-size: 20rpx;
  417. padding: 15rpx 0;
  418. border-radius: 20rpx;
  419. margin-top: auto;
  420. margin-right: auto;
  421. position: absolute;
  422. bottom: -30rpx;
  423. left: 50%;
  424. width: 160rpx;
  425. transform: translate(-50%);
  426. }
  427. }
  428. // .vip_info{
  429. // // display: flex;
  430. // // justify-content: center;
  431. // background-color: #2800ee;
  432. // color: #fff;
  433. // font-size: 20rpx;
  434. // padding: 15rpx 30rpx;
  435. // line-height: 50rpx;
  436. // border-radius: 20rpx;
  437. // margin-right: auto;
  438. // margin-left: 20rpx;
  439. // .title{
  440. // font-size: 26rpx;
  441. // }
  442. // .time{
  443. // // margin-left: 20rpx;
  444. // }
  445. // }
  446. .setUp {
  447. }
  448. }
  449. }
  450. }
  451. .Content {}
  452. .login-prompt {
  453. padding: 100rpx 0;
  454. }
  455. .no-data{
  456. display: flex;
  457. justify-content: center;
  458. align-content: center;
  459. padding: 100rpx 0;
  460. color: #777;
  461. }
  462. }
  463. </style>