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

345 lines
8.7 KiB

4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 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 class="section-item" @click="$utils.navigateTo('/pages_order/mine/webview')">
  104. <view class="section-item-left">
  105. <uv-icon name="star" size="40rpx" color="#333"></uv-icon>
  106. <text>测试</text>
  107. </view>
  108. <uv-icon name="arrow-right" size="36rpx" color="#999"></uv-icon>
  109. </view> -->
  110. </view>
  111. </view>
  112. </view>
  113. </view>
  114. <view v-else-if="!isLogin" class="nologin-page">
  115. <view class="nologin-top-bg">
  116. <view class="nologin-header">
  117. <image class="nologin-avatar" src="/static/image/center/headImage.png" mode="aspectFill" @click="$utils.toLogin" />
  118. <view class="nologin-text" @click="$utils.toLogin">点击登录</view>
  119. </view>
  120. <view class="nologin-header-right">
  121. <uv-icon name="more-dot-fill" size="40rpx" color="#bbb"></uv-icon>
  122. </view>
  123. </view>
  124. <view class="nologin-content-center">
  125. <button class="nologin-btn" @click="$utils.toLogin">立即登录</button>
  126. <view style="font-size: 24rpx;color: #999;">暂未登录请先登录</view>
  127. </view>
  128. </view>
  129. <tabber select="center" />
  130. </view>
  131. </template>
  132. <script>
  133. import tabber from '@/components/base/tabbar.vue'
  134. import uvIcon from '@/uni_modules/uv-icon/components/uv-icon/uv-icon.vue'
  135. export default {
  136. components: {
  137. tabber,
  138. uvIcon,
  139. },
  140. data() {
  141. return {
  142. commentNum : 0,
  143. }
  144. },
  145. onShow() {
  146. if(this.isLogin){
  147. this.$store.commit('getUserInfo')
  148. this.getMyCommentNum()
  149. }
  150. },
  151. methods: {
  152. async getMyCommentNum(){
  153. this.commentNum = await this.$fetch('getMyCommentNum')
  154. },
  155. }
  156. }
  157. </script>
  158. <style scoped lang="scss">
  159. .page {
  160. background-color: #f5f5f5;
  161. }
  162. .user {
  163. padding: 20rpx 30rpx;
  164. position: relative;
  165. z-index: 2;
  166. .user-info {
  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: auto;
  240. margin-left: 20rpx;
  241. }
  242. }
  243. }
  244. }
  245. }
  246. .nologin-page {
  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: 580rpx;
  256. background: linear-gradient(180deg, #f3eafe 0%, #f5f5f5 100%);
  257. position: relative;
  258. z-index: 2;
  259. display: flex;
  260. flex-direction: row;
  261. align-items: flex-start;
  262. justify-content: flex-start;
  263. }
  264. .nologin-header {
  265. display: flex;
  266. flex-direction: row;
  267. align-items: center;
  268. margin-left: 36rpx;
  269. margin-top: 218rpx;
  270. }
  271. .nologin-avatar {
  272. width: 80rpx;
  273. height: 80rpx;
  274. border-radius: 50%;
  275. background: #eee;
  276. margin-right: 18rpx;
  277. }
  278. .nologin-text {
  279. font-size: 28rpx;
  280. color: #000;
  281. font-weight: 900;
  282. }
  283. .nologin-header-right {
  284. position: absolute;
  285. right: 36rpx;
  286. top: 48rpx;
  287. }
  288. .nologin-content-center {
  289. position: fixed;
  290. top: 50%;
  291. left: 0;
  292. width: 100vw;
  293. display: flex;
  294. flex-direction: column;
  295. align-items: center;
  296. transform: translateY(-50%);
  297. z-index: 2;
  298. }
  299. .nologin-btn {
  300. width: 380rpx;
  301. height: 74rpx;
  302. background: #132a57;
  303. color: #fff;
  304. font-size: 28rpx;
  305. border-radius: 38rpx;
  306. margin-bottom: 18rpx;
  307. font-weight: bold;
  308. display: flex;
  309. align-items: center;
  310. justify-content: center;
  311. }
  312. </style>