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

369 lines
8.6 KiB

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
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
  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">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/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="toLogin" />
  102. <view class="nologin-text" @click="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="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. }
  126. },
  127. onLoad() {
  128. if(this.isLogin){
  129. this.$store.commit('getUserInfo')
  130. }
  131. },
  132. methods: {
  133. }
  134. }
  135. </script>
  136. <style scoped lang="scss">
  137. .page {
  138. padding-bottom: 200rpx;
  139. background-color: #f5f5f5;
  140. }
  141. .user {
  142. padding: 20rpx 30rpx;
  143. .user-info {
  144. height: 270rpx;
  145. display: flex;
  146. align-items: center;
  147. padding: 30rpx 20rpx;
  148. background: linear-gradient(135deg, #e8e6fa 0%, #fbeff3 100%);
  149. border-radius: 20rpx;
  150. margin-bottom: 20rpx;
  151. .avatar {
  152. width: 120rpx;
  153. height: 120rpx;
  154. border-radius: 50%;
  155. margin-right: 20rpx;
  156. }
  157. .info {
  158. flex: 1;
  159. .name {
  160. font-size: 32rpx;
  161. font-weight: bold;
  162. margin-bottom: 10rpx;
  163. .id {
  164. font-size: 24rpx;
  165. font-weight: normal;
  166. color: #999;
  167. }
  168. }
  169. .desc {
  170. font-size: 26rpx;
  171. color: #666;
  172. margin-bottom: 10rpx;
  173. }
  174. .phone {
  175. font-size: 26rpx;
  176. color: #666;
  177. }
  178. }
  179. .more {
  180. padding: 10rpx;
  181. }
  182. }
  183. .section {
  184. margin-bottom: 20rpx;
  185. .section-title {
  186. font-size: 28rpx;
  187. color: #999;
  188. padding: 20rpx 10rpx 10rpx;
  189. }
  190. .section-list {
  191. background-color: #fff;
  192. border-radius: 20rpx;
  193. overflow: hidden;
  194. .section-item {
  195. display: flex;
  196. align-items: center;
  197. justify-content: space-between;
  198. padding: 30rpx 20rpx;
  199. border-bottom: 1px solid #f5f5f5;
  200. &:last-child {
  201. border-bottom: none;
  202. }
  203. .section-item-left {
  204. display: flex;
  205. align-items: center;
  206. text {
  207. margin-left: 20rpx;
  208. font-size: 28rpx;
  209. }
  210. }
  211. .badge {
  212. background-color: #FA5A0A;
  213. color: #fff;
  214. font-size: 22rpx;
  215. padding: 2rpx 12rpx;
  216. border-radius: 20rpx;
  217. margin-right: 10rpx;
  218. }
  219. }
  220. }
  221. }
  222. }
  223. .nologin-page {
  224. min-height: 100vh;
  225. background: #fff;
  226. display: flex;
  227. flex-direction: column;
  228. justify-content: flex-start;
  229. position: relative;
  230. }
  231. .nologin-top-bg {
  232. width: 100vw;
  233. height: 220rpx;
  234. background: linear-gradient(180deg, #f3eafe 0%, #fff 100%);
  235. position: relative;
  236. display: flex;
  237. flex-direction: row;
  238. align-items: flex-start;
  239. justify-content: flex-start;
  240. }
  241. .nologin-header {
  242. display: flex;
  243. flex-direction: row;
  244. align-items: center;
  245. margin-left: 36rpx;
  246. margin-top: 218rpx;
  247. }
  248. .nologin-avatar {
  249. width: 80rpx;
  250. height: 80rpx;
  251. border-radius: 50%;
  252. background: #eee;
  253. margin-right: 18rpx;
  254. }
  255. .nologin-text {
  256. font-size: 28rpx;
  257. color: #333;
  258. }
  259. .nologin-header-right {
  260. position: absolute;
  261. right: 36rpx;
  262. top: 48rpx;
  263. }
  264. .nologin-content-center {
  265. position: absolute;
  266. top: 50%;
  267. left: 0;
  268. width: 100vw;
  269. display: flex;
  270. flex-direction: column;
  271. align-items: center;
  272. transform: translateY(-50%);
  273. z-index: 2;
  274. }
  275. .nologin-btn {
  276. width: 320rpx;
  277. height: 64rpx;
  278. background: #132a57;
  279. color: #fff;
  280. font-size: 28rpx;
  281. border-radius: 32rpx;
  282. margin-bottom: 18rpx;
  283. font-weight: bold;
  284. display: flex;
  285. align-items: center;
  286. justify-content: center;
  287. }
  288. .nologin-tip {
  289. color: #bcbcbc;
  290. font-size: 24rpx;
  291. margin-top: 10rpx;
  292. }
  293. .modal-mask {
  294. position: fixed;
  295. left: 0; top: 0; right: 0; bottom: 0;
  296. background: rgba(0,0,0,0.5);
  297. z-index: 9999;
  298. display: flex;
  299. align-items: center;
  300. justify-content: center;
  301. }
  302. .modal-box {
  303. background: #fff;
  304. border-radius: 20rpx;
  305. width: 80vw;
  306. padding: 40rpx 0 0 0;
  307. text-align: center;
  308. }
  309. .modal-title {
  310. font-size: 32rpx;
  311. font-weight: bold;
  312. margin-bottom: 20rpx;
  313. }
  314. .modal-content {
  315. font-size: 28rpx;
  316. color: #333;
  317. margin-bottom: 30rpx;
  318. }
  319. .modal-actions {
  320. display: flex;
  321. border-top: 1px solid #eee;
  322. height: 90rpx;
  323. }
  324. .modal-btn {
  325. flex: 1;
  326. line-height: 90rpx;
  327. font-size: 30rpx;
  328. color: #333;
  329. border-right: 1px solid #eee;
  330. }
  331. .modal-btn:last-child {
  332. border-right: none;
  333. color: #2a5ed6;
  334. }
  335. .modal-btn.confirm {
  336. color: #2a5ed6;
  337. }
  338. </style>