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

501 lines
10 KiB

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