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

512 lines
11 KiB

9 months ago
8 months ago
2 weeks ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
7 months ago
9 months ago
9 months ago
9 months ago
7 months ago
7 months ago
7 months ago
9 months ago
7 months ago
7 months ago
9 months ago
8 months ago
9 months ago
9 months ago
7 months ago
9 months ago
9 months ago
9 months ago
9 months ago
7 months ago
9 months ago
9 months ago
8 months ago
9 months ago
9 months ago
9 months ago
7 months ago
9 months ago
9 months ago
9 months ago
9 months ago
7 months ago
9 months ago
8 months ago
7 months ago
7 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
7 months ago
9 months ago
7 months ago
9 months ago
2 weeks ago
9 months ago
9 months ago
8 months ago
8 months ago
9 months ago
9 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months 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" class="login-prompt">
  152. <uv-empty
  153. text="请先登录查看更多内容"
  154. textSize="30rpx"
  155. iconSize="200rpx"
  156. icon="account">
  157. </uv-empty>
  158. </view>
  159. <view class="no-data"
  160. v-if="isLogin && !tabs[type].show">
  161. 暂未开放
  162. </view>
  163. <uv-empty
  164. v-else-if="isLogin && list.length == 0"
  165. text="空空如也"
  166. textSize="30rpx"
  167. iconSize="200rpx"
  168. icon="list"></uv-empty>
  169. <tabber select="3" />
  170. </view>
  171. </template>
  172. <script>
  173. import tabber from '@/components/base/tabbar.vue'
  174. import dynamicItemEdit from '@/components/list/dynamic/dynamicItemEdit.vue'
  175. import gourmetItem from '@/components/list/gourmet/gourmetItem.vue'
  176. import rentingItem from '@/components/list/renting/rentingItem.vue'
  177. import workItem from '@/components/list/work/workItem.vue'
  178. import mixinsList from '@/mixins/list.js'
  179. import mixinsSex from '@/mixins/sex.js'
  180. import { mapState } from 'vuex'
  181. export default {
  182. mixins: [mixinsList, mixinsSex],
  183. components: {
  184. tabber,
  185. gourmetItem,
  186. rentingItem,
  187. workItem,
  188. dynamicItemEdit,
  189. },
  190. computed: {
  191. ...mapState(['userInfo', 'headInfo']),
  192. },
  193. data() {
  194. return {
  195. tabs: [
  196. {
  197. name: '帖子',
  198. show : true,
  199. },
  200. {
  201. name: '租房',
  202. show : true,
  203. },
  204. {
  205. name: '招聘',
  206. show : true,
  207. },
  208. {
  209. name: '店铺',
  210. show : true,
  211. },
  212. ],
  213. vipList : ['vip', 'vipBig'],
  214. mixinsListApi : '',
  215. apiList : [
  216. 'getMyPostPage',//查询我的帖子
  217. 'getMyRent',
  218. 'getMyJob',
  219. 'myShop',//查询我的店铺
  220. ],
  221. auth : ['审核中', '个人认证', '店铺认证'],
  222. type : 0,
  223. isLogin: false,
  224. }
  225. },
  226. onShow() {
  227. this.checkLoginStatus()
  228. },
  229. methods: {
  230. // 检查登录状态
  231. checkLoginStatus() {
  232. // 检查是否有用户信息或token来判断登录状态
  233. const token = uni.getStorageSync('token')
  234. if (token) {
  235. this.mixinsListApi = this.apiList[this.type]
  236. this.isLogin = true
  237. this.$store.commit('getUserInfo')
  238. this.getData()
  239. } else {
  240. this.isLogin = false
  241. }
  242. },
  243. click({index}) {
  244. if (!this.isLogin) {
  245. this.showLoginTip()
  246. return
  247. }
  248. this.type = index
  249. this.mixinsListApi = this.apiList[index]
  250. this.list = []
  251. this.getData()
  252. },
  253. // 显示登录提示
  254. showLoginTip() {
  255. uni.showToast({
  256. title: '请先登录',
  257. icon: 'none'
  258. })
  259. },
  260. // 删除帖子
  261. delDynamic(postId){
  262. let self = this
  263. uni.showModal({
  264. title: '确认要删除吗?',
  265. success(e) {
  266. if(e.confirm){
  267. self.$api('deletePost', {
  268. postId
  269. }, res => {
  270. if(res.code == 200){
  271. self.getData()
  272. }
  273. })
  274. }
  275. }
  276. })
  277. },
  278. // 跳转到我的个人主页
  279. goToMyProfile() {
  280. if (!this.isLogin) {
  281. this.showLoginTip()
  282. return
  283. }
  284. uni.navigateTo({
  285. url: `/pages_order/profile/userProfile?userId=${this.userInfo.id}`
  286. })
  287. },
  288. }
  289. }
  290. </script>
  291. <style scoped lang="scss">
  292. .page {
  293. .beijin {
  294. // background: linear-gradient(to bottom, rgb(85, 94, 123), rgb(45, 51, 73));
  295. background: linear-gradient($uni-color, #fff);
  296. background-color: black;
  297. color: black;
  298. .profile {
  299. padding: 40rpx;
  300. padding-top: 160rpx;
  301. // 未登录状态样式
  302. .login-section {
  303. display: flex;
  304. flex-direction: column;
  305. align-items: center;
  306. padding: 40rpx 0;
  307. .avatar-placeholder {
  308. width: 100px;
  309. height: 100px;
  310. border-radius: 50%;
  311. background: #f5f5f5;
  312. display: flex;
  313. align-items: center;
  314. justify-content: center;
  315. margin-bottom: 30rpx;
  316. }
  317. .login-info {
  318. text-align: center;
  319. .welcome-text {
  320. font-size: 32rpx;
  321. font-weight: bold;
  322. margin-bottom: 10rpx;
  323. }
  324. .login-desc {
  325. font-size: 24rpx;
  326. color: #666;
  327. margin-bottom: 40rpx;
  328. }
  329. .login-btn {
  330. background: linear-gradient(45deg, #5baaff, #4a90e2);
  331. color: white;
  332. border: none;
  333. border-radius: 50rpx;
  334. padding: 20rpx 60rpx;
  335. font-size: 28rpx;
  336. font-weight: bold;
  337. }
  338. }
  339. }
  340. .box {
  341. padding: 0rpx 10rpx;
  342. display: flex;
  343. align-items: center;
  344. text-align: center;
  345. .followWithnterest {
  346. .digit {
  347. padding: 20rpx;
  348. }
  349. .close {
  350. }
  351. }
  352. .shut{
  353. margin: 0rpx 20rpx;
  354. }
  355. .fenst {
  356. .digit {
  357. padding: 20rpx;
  358. }
  359. .fans {
  360. }
  361. }
  362. }
  363. .account {
  364. display: flex;
  365. align-items: center;
  366. .number {
  367. letter-spacing: 2rpx;
  368. margin-top: 10rpx;
  369. }
  370. .gender {
  371. margin: 20rpx 10rpx;
  372. }
  373. .authentication {
  374. font-size: 20rpx;
  375. }
  376. }
  377. .Days {
  378. margin-top: 15rpx;
  379. font-size: 22rpx;
  380. letter-spacing: 2rpx;
  381. }
  382. .o {
  383. display: flex;
  384. align-items: center;
  385. justify-content: space-between;
  386. margin-bottom: 60rpx;
  387. .headImage {
  388. position: relative;
  389. height: 100px;
  390. width: 100px;
  391. border-radius: 50%;
  392. image {
  393. height: 100%;
  394. width: 100%;
  395. border-radius: 50%;
  396. }
  397. .vip_info{
  398. --lg1Color : #ffb700;
  399. --lg2Color : #ff3300;
  400. display: flex;
  401. justify-content: center;
  402. background: linear-gradient(var(--lg1Color), var(--lg2Color));
  403. color: #fff;
  404. font-size: 20rpx;
  405. padding: 15rpx 0;
  406. border-radius: 20rpx;
  407. margin-top: auto;
  408. margin-right: auto;
  409. position: absolute;
  410. bottom: -30rpx;
  411. left: 50%;
  412. width: 160rpx;
  413. transform: translate(-50%);
  414. }
  415. }
  416. // .vip_info{
  417. // // display: flex;
  418. // // justify-content: center;
  419. // background-color: #2800ee;
  420. // color: #fff;
  421. // font-size: 20rpx;
  422. // padding: 15rpx 30rpx;
  423. // line-height: 50rpx;
  424. // border-radius: 20rpx;
  425. // margin-right: auto;
  426. // margin-left: 20rpx;
  427. // .title{
  428. // font-size: 26rpx;
  429. // }
  430. // .time{
  431. // // margin-left: 20rpx;
  432. // }
  433. // }
  434. .setUp {
  435. }
  436. }
  437. }
  438. }
  439. .Content {}
  440. .login-prompt {
  441. padding: 100rpx 0;
  442. }
  443. .no-data{
  444. display: flex;
  445. justify-content: center;
  446. align-content: center;
  447. padding: 100rpx 0;
  448. color: #777;
  449. }
  450. }
  451. </style>