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

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