裂变星小程序-25.03.04
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.

386 lines
7.7 KiB

1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
  1. <template>
  2. <view class="page">
  3. <navbar title="个人中心" bgColor="#001B3C" color="#FFFFFF" />
  4. <view class="head">
  5. <view class="headImage">
  6. <image :src="userInfo.headImage" mode=""></image>
  7. </view>
  8. <view class="info">
  9. <view class="name">
  10. {{ userInfo.nickName }}
  11. </view>
  12. <view class="tags">
  13. <view class="tag">
  14. <text class="tag-label">ID:</text>
  15. <text>{{ userInfo.id }}</text>
  16. </view>
  17. <view v-if="role" style="display: inline-block; width: 172rpx; height: 63rpx; vertical-align: top; margin-top: -6rpx;">
  18. <image src="@/pages_order/static/center/agent-icon.png"></image>
  19. </view>
  20. <view v-else class="tag">
  21. 普通会员
  22. </view>
  23. </view>
  24. </view>
  25. <view class="setting" @click="$utils.navigateTo('/pages_order/mine/setting')">
  26. <uv-icon name="setting" color="#FFFFFF" size="48rpx"></uv-icon>
  27. </view>
  28. </view>
  29. <view class="tools-box">
  30. <image class="tools-bg" src="@/pages_order/static/center/tools-bg.png"></image>
  31. <view class="flex activate">
  32. <template v-if="role">
  33. <view class="activate-tips" style="padding-left: 27rpx;">
  34. <view>代理商权益</view>
  35. <view>
  36. 将于<text class="activate-highlight">{{ $dayjs(userInfoVip.vip_time).format('YYYY年M月D日') () }}</text>到期
  37. </view>
  38. </view>
  39. <view class="btn-activate" @click="onActivate">
  40. <image src="@/pages_order/static/center/btn-activate-again.png"></image>
  41. </view>
  42. </template>
  43. <template v-else>
  44. <view class="activate-tips">
  45. 升级成为代理商享受更多权益
  46. </view>
  47. <view class="btn-activate" @click="onActivate">
  48. <image src="@/pages_order/static/center/btn-activate.png"></image>
  49. </view>
  50. </template>
  51. </view>
  52. <view class="tools flex">
  53. <view class="tool" @click="$utils.navigateTo('/pages_order/mine/sharing')">
  54. <view class="tool-icon">
  55. <image src="@/pages_order/static/center/tool-share.png"></image>
  56. </view>
  57. <text>分享好友</text>
  58. </view>
  59. <view class="tool" @click="onActivate">
  60. <view class="tool-icon">
  61. <image src="@/pages_order/static/center/tool-activate.png"></image>
  62. </view>
  63. <text>激活码</text>
  64. </view>
  65. <view class="tool" @click="$utils.navigateTo('/pages_order/mine/wallet')">
  66. <view class="tool-icon">
  67. <image src="@/pages_order/static/center/tool-wallet.png"></image>
  68. </view>
  69. <text>我的钱包</text>
  70. </view>
  71. <view class="tool" @click="$utils.navigateTo('/pages_order/mine/team')">
  72. <view class="tool-icon">
  73. <image src="@/pages_order/static/center/tool-team.png"></image>
  74. </view>
  75. <text>我的团队</text>
  76. </view>
  77. </view>
  78. </view>
  79. <view class="content">
  80. <view class="card notice" v-if="notice">
  81. <view class="notice-icon">
  82. <image src="@/pages_order/static/center/notice.png"></image>
  83. </view>
  84. <uv-notice-bar
  85. :text="notice"
  86. bgColor="transparent"
  87. color="#001B3C"
  88. :icon="false"
  89. fontSize="28rpx"
  90. :customStyle="{
  91. padding: '6rpx 0',
  92. }"
  93. ></uv-notice-bar>
  94. </view>
  95. <view class="card updates">
  96. <view class="updates-header">
  97. <view class="updates-header-bg">
  98. <image src="@/static/image/center/title-bg.png"></image>
  99. </view>
  100. <view class="updates-header-content">
  101. 动态更新
  102. </view>
  103. </view>
  104. <view class="updates-content">
  105. <view class="card updates-item"
  106. v-for="item in list"
  107. :key="item.id"
  108. @click="goToNewsDetail(item.id)"
  109. >
  110. <view class="updates-item-img">
  111. <image :src="item.image"></image>
  112. </view>
  113. <view class="updates-item-info">
  114. <view class="updates-item-title">{{ item.title || '' }}</view>
  115. <view class="updates-item-desc text-ellipsis">{{ getDesc(item.details) }}</view>
  116. </view>
  117. </view>
  118. </view>
  119. </view>
  120. </view>
  121. <view class="service" @click="$utils.navigateTo('/pages_order/mine/service')">
  122. <image src="@/pages_order/static/center/service.png" mode=""></image>
  123. </view>
  124. <popupActivate ref="popupActivate"></popupActivate>
  125. <popupSharing ref="popupSharing"></popupSharing>
  126. <tabber select="center" />
  127. </view>
  128. </template>
  129. <script>
  130. import { mapState } from 'vuex'
  131. import mixinsList from '@/mixins/list.js'
  132. import popupActivate from '@/components/center/popupActivate.vue'
  133. import tabber from '@/components/base/tabbar.vue'
  134. export default {
  135. mixins : [mixinsList],
  136. components: {
  137. tabber,
  138. popupActivate,
  139. },
  140. data() {
  141. return {
  142. notice: '',
  143. mixinsListApi : 'getNews',
  144. }
  145. },
  146. computed: {
  147. ...mapState(['userInfo', 'userInfoVip']),
  148. role() {
  149. return this.userInfo.role
  150. }
  151. },
  152. onShow() {
  153. this.fetchNotice()
  154. this.$store.commit('getUserInfo')
  155. this.$store.commit('getUserInfoVip')
  156. },
  157. methods: {
  158. async fetchNotice() {
  159. try {
  160. // todo: check
  161. this.notice = (await this.$fetch('getNotice'))?.[0]?.title
  162. } catch (err) {
  163. }
  164. },
  165. onActivate() {
  166. this.$refs.popupActivate.open(this.role)
  167. },
  168. getDesc(str) {
  169. if (!str) {
  170. return ''
  171. }
  172. return str.replace(/<.*?>/g, '')
  173. },
  174. goToNewsDetail(id) {
  175. uni.navigateTo({
  176. url: `/pages_order/mine/news?id=${id}`
  177. })
  178. },
  179. }
  180. }
  181. </script>
  182. <style scoped lang="scss">
  183. .page {
  184. background-color: #001B3C;
  185. min-height: 100vh;
  186. }
  187. image {
  188. width: 100%;
  189. height: 100%;
  190. }
  191. .head {
  192. display: flex;
  193. padding: 20rpx 26rpx 18rpx 40rpx;
  194. align-items: center;
  195. position: relative;
  196. .headImage {
  197. width: 143rpx;
  198. height: 143rpx;
  199. overflow: hidden;
  200. border-radius: 50%;
  201. margin-right: 40rpx;
  202. }
  203. .info {
  204. .name {
  205. color: #FFFFFF;
  206. font-size: 38rpx;
  207. margin-bottom: 12rpx;
  208. }
  209. .tags {
  210. }
  211. }
  212. .setting {
  213. position: absolute;
  214. right: 26rpx;
  215. top: 37rpx;
  216. }
  217. }
  218. .tag {
  219. display: inline-block;
  220. padding: 6rpx 21rpx;
  221. border: 1rpx solid #999999;
  222. color: #FFFFFF;
  223. font-size: 24rpx;
  224. border-radius: 23rpx;
  225. margin-right: 20rpx;
  226. vertical-align: top;
  227. &-label {
  228. color: #999999;
  229. }
  230. }
  231. .tools {
  232. &-box {
  233. width: 100vw;
  234. height: 406rpx;
  235. padding: 0 5rpx;
  236. box-sizing: border-box;
  237. position: relative;
  238. }
  239. position: absolute;
  240. width: calc(100vw - 69rpx*2);
  241. left: 69rpx;
  242. bottom: 64rpx;
  243. justify-content: space-between;
  244. }
  245. .activate {
  246. position: absolute;
  247. width: calc(100% - 199rpx);
  248. height: 80rpx;
  249. top: 31rpx;
  250. right: 37rpx;
  251. &-tips {
  252. flex: 1;
  253. color: #976224;
  254. font-size: 28rpx;
  255. }
  256. &-highlight {
  257. color: #FF6868;
  258. }
  259. .btn-activate {
  260. width: 172rpx;
  261. height: 80rpx;
  262. }
  263. }
  264. .tool {
  265. display: flex;
  266. flex-direction: column;
  267. justify-content: center;
  268. align-items: center;
  269. color: #57595B;
  270. font-size: 28rpx;
  271. &-icon {
  272. width: 88rpx;
  273. height: 88rpx;
  274. margin-bottom: 10rpx;
  275. }
  276. }
  277. .content {
  278. padding: 0 20rpx 20rpx 20rpx;
  279. }
  280. .notice {
  281. padding: 22rpx 21rpx;
  282. display: flex;
  283. &-icon {
  284. width: 49rpx;
  285. height: 49rpx;
  286. margin-right: 20rpx;
  287. }
  288. }
  289. .updates {
  290. margin-top: 20rpx;
  291. padding: 20rpx;
  292. &-header {
  293. position: relative;
  294. &-bg {
  295. height: 51rpx;
  296. width: 58rpx;
  297. margin-left: 40rpx;
  298. }
  299. &-content {
  300. color: #262626;
  301. font-size: 38rpx;
  302. font-weight: 900;
  303. position: absolute;
  304. top: 0;
  305. }
  306. }
  307. &-item {
  308. padding: 0;
  309. border-radius: 16rpx;
  310. box-shadow: 0 0 32rpx 0 rgba($color: #808080, $alpha: 0.16);
  311. margin-top: 20rpx;
  312. &-img {
  313. width: 100%;
  314. height: 252rpx;
  315. }
  316. &-info {
  317. padding: 15rpx 18rpx 8rpx 18rpx;
  318. }
  319. &-title {
  320. color: #474747;
  321. font-size: 32rpx;
  322. }
  323. &-desc {
  324. color: #CCCCCC;
  325. font-size: 20rpx;
  326. }
  327. }
  328. }
  329. .service {
  330. position: fixed;
  331. right: 29rpx;
  332. bottom: 312rpx;
  333. width: 149rpx;
  334. height: 158rpx;
  335. }
  336. </style>