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

338 lines
8.4 KiB

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