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

392 lines
9.3 KiB

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months 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="https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg" mode=""></image>
  11. <view class="info">
  12. <view class="name">战斗世界 <text class="id">(ID: 50523541)</text></view>
  13. <view class="desc">世界达人小说控</view>
  14. <view class="phone">手机号19898474531</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">294</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/novel/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/novel/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="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. <tabber select="center" />
  98. </view>
  99. <view v-else-if="!isLogin && !showLogoutModal" class="nologin-page">
  100. <view class="nologin-top-bg">
  101. <view class="nologin-header">
  102. <image class="nologin-avatar" src="https://cdn.uviewui.com/uview/album/1.jpg" mode="aspectFill" @click="toLogin" />
  103. <view class="nologin-text" @click="toLogin">点击登录</view>
  104. </view>
  105. <view class="nologin-header-right">
  106. <uv-icon name="more-dot-fill" size="40rpx" color="#bbb"></uv-icon>
  107. </view>
  108. </view>
  109. <view class="nologin-content-center">
  110. <button class="nologin-btn" @click="toLogin">立即登录</button>
  111. <view class="nologin-tip">暂未登录 请先登录</view>
  112. </view>
  113. <tabber select="center" />
  114. </view>
  115. <view v-if="showLogoutModal" class="modal-mask">
  116. <view class="modal-box">
  117. <view class="modal-title">退出登录</view>
  118. <view class="modal-content">确认要退出登录吗</view>
  119. <view class="modal-actions">
  120. <view class="modal-btn" @click="cancelLogout">取消</view>
  121. <view class="modal-btn confirm" @click="confirmLogout">确认</view>
  122. </view>
  123. </view>
  124. </view>
  125. </view>
  126. </template>
  127. <script>
  128. import tabber from '@/components/base/tabbar.vue'
  129. import uvIcon from '@/uni_modules/uv-icon/components/uv-icon/uv-icon.vue'
  130. export default {
  131. components: {
  132. tabber,
  133. uvIcon,
  134. },
  135. data() {
  136. return {
  137. showLogoutModal: false,
  138. isLogin: true,
  139. }
  140. },
  141. methods: {
  142. logout() {
  143. this.showLogoutModal = true;
  144. },
  145. cancelLogout() {
  146. this.showLogoutModal = false;
  147. },
  148. confirmLogout() {
  149. this.showLogoutModal = false;
  150. this.isLogin = false;
  151. },
  152. toLogin() {
  153. uni.showToast({ title: '跳转登录页', icon: 'none' })
  154. }
  155. }
  156. }
  157. </script>
  158. <style scoped lang="scss">
  159. .page {
  160. padding-bottom: 200rpx;
  161. background-color: #f5f5f5;
  162. }
  163. .user {
  164. padding: 20rpx 30rpx;
  165. .user-info {
  166. height: 270rpx;
  167. display: flex;
  168. align-items: center;
  169. padding: 30rpx 20rpx;
  170. background: linear-gradient(135deg, #e8e6fa 0%, #fbeff3 100%);
  171. border-radius: 20rpx;
  172. margin-bottom: 20rpx;
  173. .avatar {
  174. width: 120rpx;
  175. height: 120rpx;
  176. border-radius: 50%;
  177. margin-right: 20rpx;
  178. }
  179. .info {
  180. flex: 1;
  181. .name {
  182. font-size: 32rpx;
  183. font-weight: bold;
  184. margin-bottom: 10rpx;
  185. .id {
  186. font-size: 24rpx;
  187. font-weight: normal;
  188. color: #999;
  189. }
  190. }
  191. .desc {
  192. font-size: 26rpx;
  193. color: #666;
  194. margin-bottom: 10rpx;
  195. }
  196. .phone {
  197. font-size: 26rpx;
  198. color: #666;
  199. }
  200. }
  201. .more {
  202. padding: 10rpx;
  203. }
  204. }
  205. .section {
  206. margin-bottom: 20rpx;
  207. .section-title {
  208. font-size: 28rpx;
  209. color: #999;
  210. padding: 20rpx 10rpx 10rpx;
  211. }
  212. .section-list {
  213. background-color: #fff;
  214. border-radius: 20rpx;
  215. overflow: hidden;
  216. .section-item {
  217. display: flex;
  218. align-items: center;
  219. justify-content: space-between;
  220. padding: 30rpx 20rpx;
  221. border-bottom: 1px solid #f5f5f5;
  222. &:last-child {
  223. border-bottom: none;
  224. }
  225. .section-item-left {
  226. display: flex;
  227. align-items: center;
  228. text {
  229. margin-left: 20rpx;
  230. font-size: 28rpx;
  231. }
  232. }
  233. .badge {
  234. background-color: #FA5A0A;
  235. color: #fff;
  236. font-size: 22rpx;
  237. padding: 2rpx 12rpx;
  238. border-radius: 20rpx;
  239. margin-right: 10rpx;
  240. }
  241. }
  242. }
  243. }
  244. }
  245. .nologin-page {
  246. min-height: 100vh;
  247. background: #fff;
  248. display: flex;
  249. flex-direction: column;
  250. justify-content: flex-start;
  251. position: relative;
  252. }
  253. .nologin-top-bg {
  254. width: 100vw;
  255. height: 220rpx;
  256. background: linear-gradient(180deg, #f3eafe 0%, #fff 100%);
  257. position: relative;
  258. display: flex;
  259. flex-direction: row;
  260. align-items: flex-start;
  261. justify-content: flex-start;
  262. }
  263. .nologin-header {
  264. display: flex;
  265. flex-direction: row;
  266. align-items: center;
  267. margin-left: 36rpx;
  268. margin-top: 218rpx;
  269. }
  270. .nologin-avatar {
  271. width: 80rpx;
  272. height: 80rpx;
  273. border-radius: 50%;
  274. background: #eee;
  275. margin-right: 18rpx;
  276. }
  277. .nologin-text {
  278. font-size: 28rpx;
  279. color: #333;
  280. }
  281. .nologin-header-right {
  282. position: absolute;
  283. right: 36rpx;
  284. top: 48rpx;
  285. }
  286. .nologin-content-center {
  287. position: absolute;
  288. top: 50%;
  289. left: 0;
  290. width: 100vw;
  291. display: flex;
  292. flex-direction: column;
  293. align-items: center;
  294. transform: translateY(-50%);
  295. z-index: 2;
  296. }
  297. .nologin-btn {
  298. width: 320rpx;
  299. height: 64rpx;
  300. background: #132a57;
  301. color: #fff;
  302. font-size: 28rpx;
  303. border-radius: 32rpx;
  304. margin-bottom: 18rpx;
  305. font-weight: bold;
  306. display: flex;
  307. align-items: center;
  308. justify-content: center;
  309. }
  310. .nologin-tip {
  311. color: #bcbcbc;
  312. font-size: 24rpx;
  313. margin-top: 10rpx;
  314. }
  315. .modal-mask {
  316. position: fixed;
  317. left: 0; top: 0; right: 0; bottom: 0;
  318. background: rgba(0,0,0,0.5);
  319. z-index: 9999;
  320. display: flex;
  321. align-items: center;
  322. justify-content: center;
  323. }
  324. .modal-box {
  325. background: #fff;
  326. border-radius: 20rpx;
  327. width: 80vw;
  328. padding: 40rpx 0 0 0;
  329. text-align: center;
  330. }
  331. .modal-title {
  332. font-size: 32rpx;
  333. font-weight: bold;
  334. margin-bottom: 20rpx;
  335. }
  336. .modal-content {
  337. font-size: 28rpx;
  338. color: #333;
  339. margin-bottom: 30rpx;
  340. }
  341. .modal-actions {
  342. display: flex;
  343. border-top: 1px solid #eee;
  344. height: 90rpx;
  345. }
  346. .modal-btn {
  347. flex: 1;
  348. line-height: 90rpx;
  349. font-size: 30rpx;
  350. color: #333;
  351. border-right: 1px solid #eee;
  352. }
  353. .modal-btn:last-child {
  354. border-right: none;
  355. color: #2a5ed6;
  356. }
  357. .modal-btn.confirm {
  358. color: #2a5ed6;
  359. }
  360. </style>