小说小程序前端代码仓库(小程序)
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.

375 lines
8.8 KiB

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
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
1 year ago
  1. <template>
  2. <view>
  3. <view class="page" v-if="isLogin && !showLogoutModal">
  4. <view class="user">
  5. <view class=""
  6. style="height: 120rpx;padding-top: calc(var(--status-bar-height) + 20rpx);">
  7. </view>
  8. <!-- 用户信息区域 -->
  9. <view class="user-info">
  10. <image class="avatar" :src="userInfo.headImage" mode="aspectFill"></image>
  11. <view class="info">
  12. <view class="name">{{ userInfo.nickName }} <text class="id"> (ID: {{ userInfo.id }})</text></view>
  13. <view class="desc">世界达人小说控</view>
  14. <view class="phone">手机号{{ userInfo.phone }}</view>
  15. </view>
  16. <view class="more">
  17. <uv-icon name="more-dot-fill" size="46rpx" color="#999"></uv-icon>
  18. </view>
  19. </view>
  20. <!-- 图片区域 -->
  21. <view class="section">
  22. <view class="section-title">账户</view>
  23. <view class="section-list">
  24. <view class="section-item" @click="$utils.navigateTo('/pages_order/novel/Walletflow')">
  25. <view class="section-item-left">
  26. <uv-icon name="photo" size="40rpx" color="#333"></uv-icon>
  27. <text>钱包流水</text>
  28. </view>
  29. <uv-icon name="arrow-right" size="36rpx" color="#999"></uv-icon>
  30. </view>
  31. <view class="section-item" @click="$utils.navigateTo('/pages_order/novel/Giftbox')">
  32. <view class="section-item-left">
  33. <uv-icon name="gift" size="40rpx" color="#333"></uv-icon>
  34. <text>礼物盒</text>
  35. </view>
  36. <uv-icon name="arrow-right" size="36rpx" color="#999"></uv-icon>
  37. </view>
  38. </view>
  39. </view>
  40. <!-- 日常区域 -->
  41. <view class="section">
  42. <view class="section-title">日常</view>
  43. <view class="section-list">
  44. <view class="section-item" @click="$utils.navigateTo('/pages_order/comment/myComment')">
  45. <view class="section-item-left">
  46. <uv-icon name="chat" size="40rpx" color="#333"></uv-icon>
  47. <text>我的评论</text>
  48. </view>
  49. <view class="badge" v-if="commentNum">{{ commentNum }}</view>
  50. <uv-icon name="arrow-right" size="36rpx" color="#999"></uv-icon>
  51. </view>
  52. <view class="section-item" @click="$utils.navigateTo('/pages_order/novel/Translation')">
  53. <view class="section-item-left">
  54. <uv-icon name="list" size="40rpx" color="#333"></uv-icon>
  55. <text>任务中心</text>
  56. </view>
  57. <!-- <view class="badge">5</view> -->
  58. <uv-icon name="arrow-right" size="36rpx" color="#999"></uv-icon>
  59. </view>
  60. </view>
  61. </view>
  62. <!-- 设置区域 -->
  63. <view class="section">
  64. <view class="section-title">设置</view>
  65. <view class="section-list">
  66. <view class="section-item" @click="$utils.navigateTo('/pages_order/author/creator')">
  67. <view class="section-item-left">
  68. <uv-icon name="star" size="40rpx" color="#333"></uv-icon>
  69. <text>申请成为作者</text>
  70. </view>
  71. <uv-icon name="arrow-right" size="36rpx" color="#999"></uv-icon>
  72. </view>
  73. <view class="section-item" @click="$utils.navigateTo('/pages/customer-service')">
  74. <view class="section-item-left">
  75. <uv-icon name="star" size="40rpx" color="#333"></uv-icon>
  76. <text>联系客服</text>
  77. </view>
  78. <uv-icon name="arrow-right" size="36rpx" color="#999"></uv-icon>
  79. </view>
  80. <view class="section-item" @click="$utils.navigateTo('/pages_order/auth/Modifyinformation')">
  81. <view class="section-item-left">
  82. <uv-icon name="edit-pen" size="40rpx" color="#333"></uv-icon>
  83. <text>修改信息</text>
  84. </view>
  85. <uv-icon name="arrow-right" size="36rpx" color="#999"></uv-icon>
  86. </view>
  87. <view class="section-item" @click="$store.commit('logout')">
  88. <view class="section-item-left">
  89. <uv-icon name="star" size="40rpx" color="#333"></uv-icon>
  90. <text>退出登录</text>
  91. </view>
  92. <uv-icon name="arrow-right" size="36rpx" color="#999"></uv-icon>
  93. </view>
  94. </view>
  95. </view>
  96. </view>
  97. </view>
  98. <view v-else-if="!isLogin" class="nologin-page">
  99. <view class="nologin-top-bg">
  100. <view class="nologin-header">
  101. <image class="nologin-avatar" mode="aspectFill" @click="$utils.toLogin" />
  102. <view class="nologin-text" @click="$utils.toLogin">点击登录</view>
  103. </view>
  104. <view class="nologin-header-right">
  105. <uv-icon name="more-dot-fill" size="40rpx" color="#bbb"></uv-icon>
  106. </view>
  107. </view>
  108. <view class="nologin-content-center">
  109. <button class="nologin-btn" @click="$utils.toLogin">立即登录</button>
  110. </view>
  111. </view>
  112. <tabber select="center" />
  113. </view>
  114. </template>
  115. <script>
  116. import tabber from '@/components/base/tabbar.vue'
  117. import uvIcon from '@/uni_modules/uv-icon/components/uv-icon/uv-icon.vue'
  118. export default {
  119. components: {
  120. tabber,
  121. uvIcon,
  122. },
  123. data() {
  124. return {
  125. commentNum : 0,
  126. }
  127. },
  128. onShow() {
  129. if(this.isLogin){
  130. this.$store.commit('getUserInfo')
  131. this.getMyCommentNum()
  132. }
  133. },
  134. methods: {
  135. async getMyCommentNum(){
  136. this.commentNum = await this.$fetch('getMyCommentNum')
  137. },
  138. }
  139. }
  140. </script>
  141. <style scoped lang="scss">
  142. .page {
  143. padding-bottom: 200rpx;
  144. background-color: #f5f5f5;
  145. }
  146. .user {
  147. padding: 20rpx 30rpx;
  148. .user-info {
  149. height: 270rpx;
  150. display: flex;
  151. align-items: center;
  152. padding: 30rpx 20rpx;
  153. background: linear-gradient(135deg, #e8e6fa 0%, #fbeff3 100%);
  154. border-radius: 20rpx;
  155. margin-bottom: 20rpx;
  156. .avatar {
  157. width: 120rpx;
  158. height: 120rpx;
  159. border-radius: 50%;
  160. margin-right: 20rpx;
  161. }
  162. .info {
  163. flex: 1;
  164. .name {
  165. font-size: 32rpx;
  166. font-weight: bold;
  167. margin-bottom: 10rpx;
  168. .id {
  169. font-size: 24rpx;
  170. font-weight: normal;
  171. color: #999;
  172. }
  173. }
  174. .desc {
  175. font-size: 26rpx;
  176. color: #666;
  177. margin-bottom: 10rpx;
  178. }
  179. .phone {
  180. font-size: 26rpx;
  181. color: #666;
  182. }
  183. }
  184. .more {
  185. padding: 10rpx;
  186. }
  187. }
  188. .section {
  189. margin-bottom: 20rpx;
  190. .section-title {
  191. font-size: 28rpx;
  192. color: #999;
  193. padding: 20rpx 10rpx 10rpx;
  194. }
  195. .section-list {
  196. background-color: #fff;
  197. border-radius: 20rpx;
  198. overflow: hidden;
  199. .section-item {
  200. display: flex;
  201. align-items: center;
  202. justify-content: space-between;
  203. padding: 30rpx 20rpx;
  204. border-bottom: 1px solid #f5f5f5;
  205. &:last-child {
  206. border-bottom: none;
  207. }
  208. .section-item-left {
  209. display: flex;
  210. align-items: center;
  211. text {
  212. margin-left: 20rpx;
  213. font-size: 28rpx;
  214. }
  215. }
  216. .badge {
  217. background-color: #FA5A0A;
  218. color: #fff;
  219. font-size: 22rpx;
  220. padding: 2rpx 12rpx;
  221. border-radius: 20rpx;
  222. margin-right: auto;
  223. margin-left: 20rpx;
  224. }
  225. }
  226. }
  227. }
  228. }
  229. .nologin-page {
  230. min-height: 100vh;
  231. background: #fff;
  232. display: flex;
  233. flex-direction: column;
  234. justify-content: flex-start;
  235. position: relative;
  236. }
  237. .nologin-top-bg {
  238. width: 100vw;
  239. height: 220rpx;
  240. background: linear-gradient(180deg, #f3eafe 0%, #fff 100%);
  241. position: relative;
  242. display: flex;
  243. flex-direction: row;
  244. align-items: flex-start;
  245. justify-content: flex-start;
  246. }
  247. .nologin-header {
  248. display: flex;
  249. flex-direction: row;
  250. align-items: center;
  251. margin-left: 36rpx;
  252. margin-top: 218rpx;
  253. }
  254. .nologin-avatar {
  255. width: 80rpx;
  256. height: 80rpx;
  257. border-radius: 50%;
  258. background: #eee;
  259. margin-right: 18rpx;
  260. }
  261. .nologin-text {
  262. font-size: 28rpx;
  263. color: #333;
  264. }
  265. .nologin-header-right {
  266. position: absolute;
  267. right: 36rpx;
  268. top: 48rpx;
  269. }
  270. .nologin-content-center {
  271. position: absolute;
  272. top: 50%;
  273. left: 0;
  274. width: 100vw;
  275. display: flex;
  276. flex-direction: column;
  277. align-items: center;
  278. transform: translateY(-50%);
  279. z-index: 2;
  280. }
  281. .nologin-btn {
  282. width: 320rpx;
  283. height: 64rpx;
  284. background: #132a57;
  285. color: #fff;
  286. font-size: 28rpx;
  287. border-radius: 32rpx;
  288. margin-bottom: 18rpx;
  289. font-weight: bold;
  290. display: flex;
  291. align-items: center;
  292. justify-content: center;
  293. }
  294. .nologin-tip {
  295. color: #bcbcbc;
  296. font-size: 24rpx;
  297. margin-top: 10rpx;
  298. }
  299. .modal-mask {
  300. position: fixed;
  301. left: 0; top: 0; right: 0; bottom: 0;
  302. background: rgba(0,0,0,0.5);
  303. z-index: 9999;
  304. display: flex;
  305. align-items: center;
  306. justify-content: center;
  307. }
  308. .modal-box {
  309. background: #fff;
  310. border-radius: 20rpx;
  311. width: 80vw;
  312. padding: 40rpx 0 0 0;
  313. text-align: center;
  314. }
  315. .modal-title {
  316. font-size: 32rpx;
  317. font-weight: bold;
  318. margin-bottom: 20rpx;
  319. }
  320. .modal-content {
  321. font-size: 28rpx;
  322. color: #333;
  323. margin-bottom: 30rpx;
  324. }
  325. .modal-actions {
  326. display: flex;
  327. border-top: 1px solid #eee;
  328. height: 90rpx;
  329. }
  330. .modal-btn {
  331. flex: 1;
  332. line-height: 90rpx;
  333. font-size: 30rpx;
  334. color: #333;
  335. border-right: 1px solid #eee;
  336. }
  337. .modal-btn:last-child {
  338. border-right: none;
  339. color: #2a5ed6;
  340. }
  341. .modal-btn.confirm {
  342. color: #2a5ed6;
  343. }
  344. </style>