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

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