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

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