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

450 lines
9.1 KiB

11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
  1. <template>
  2. <view class="page">
  3. <navbar title="个人中心" bgColor="#001B3C" color="#FFFFFF" />
  4. <view class="head">
  5. <view class="headImage">
  6. <!-- todo: 换回接口提供的 -->
  7. <image src="@/static/image/center/temp-avatar.png" mode=""></image>
  8. </view>
  9. <view class="info">
  10. <view class="name">
  11. <!-- todo: 换回接口提供的 -->
  12. 裂变星1号
  13. </view>
  14. <view class="tags">
  15. <!-- todo: 换回接口提供的 -->
  16. <view class="tag">
  17. <text class="tag-label">ID:</text>
  18. <text>12345678</text>
  19. </view>
  20. <view v-if="isAgent" style="display: inline-block; width: 172rpx; height: 63rpx; vertical-align: top; margin-top: -6rpx;">
  21. <image src="@/static/image/center/agent-icon.png"></image>
  22. </view>
  23. <view v-else class="tag">
  24. 普通会员
  25. </view>
  26. </view>
  27. </view>
  28. <view class="setting" @click="goSetting">
  29. <uv-icon name="setting" color="#FFFFFF" size="48rpx"></uv-icon>
  30. </view>
  31. </view>
  32. <view class="tools-box">
  33. <image class="tools-bg" src="@/static/image/center/tools-bg.png"></image>
  34. <view class="flex activate">
  35. <template v-if="isAgent">
  36. <view class="activate-tips" style="padding-left: 27rpx;">
  37. <view>代理商权益</view>
  38. <view>
  39. 将于<text class="activate-highlight">{{ agentDeadline }}</text>到期
  40. </view>
  41. </view>
  42. <view class="btn-activate" @click="onActivate">
  43. <image src="@/static/image/center/btn-activate-again.png"></image>
  44. </view>
  45. </template>
  46. <template v-else>
  47. <view class="activate-tips">
  48. 升级成为代理商享受更多权益
  49. </view>
  50. <view class="btn-activate" @click="onActivate">
  51. <image src="@/static/image/center/btn-activate.png"></image>
  52. </view>
  53. </template>
  54. </view>
  55. <view class="tools flex">
  56. <view class="tool" @click="onShare">
  57. <view class="tool-icon">
  58. <image src="@/static/image/center/tool-share.png"></image>
  59. </view>
  60. <text>分享好友</text>
  61. </view>
  62. <view class="tool" @click="onActivate">
  63. <view class="tool-icon">
  64. <image src="@/static/image/center/tool-activate.png"></image>
  65. </view>
  66. <text>激活码</text>
  67. </view>
  68. <view class="tool" @click="$utils.navigateTo('/pages_order/mine/wallet')">
  69. <view class="tool-icon">
  70. <image src="@/static/image/center/tool-wallet.png"></image>
  71. </view>
  72. <text>我的钱包</text>
  73. </view>
  74. <view class="tool" @click="$utils.navigateTo('/pages_order/mine/team')">
  75. <view class="tool-icon">
  76. <image src="@/static/image/center/tool-team.png"></image>
  77. </view>
  78. <text>我的团队</text>
  79. </view>
  80. </view>
  81. </view>
  82. <view class="content">
  83. <view class="card notice">
  84. <view class="notice-icon">
  85. <image src="@/static/image/center/notice.png"></image>
  86. </view>
  87. <uv-notice-bar
  88. :text="notice"
  89. bgColor="transparent"
  90. color="#001B3C"
  91. :icon="false"
  92. fontSize="28rpx"
  93. :customStyle="{
  94. padding: 0,
  95. }"
  96. ></uv-notice-bar>
  97. </view>
  98. <view class="card updates">
  99. <view class="updates-header">
  100. <view class="updates-header-bg">
  101. <image src="@/static/image/center/title-bg.png"></image>
  102. </view>
  103. <view class="updates-header-content">
  104. 动态更新
  105. </view>
  106. </view>
  107. <view class="updates-content">
  108. <view class="card updates-item"
  109. v-for="item in updateList"
  110. :key="item.id"
  111. @click="goToSharingDetail(item.id, item.state)"
  112. >
  113. <view class="updates-item-img">
  114. <image :src="item.imageUrl"></image>
  115. </view>
  116. <view class="updates-item-info">
  117. <view class="updates-item-title">{{ item.title }}</view>
  118. <view class="updates-item-desc">{{ item.description }}</view>
  119. </view>
  120. </view>
  121. </view>
  122. </view>
  123. </view>
  124. <view class="service" @click="$utils.navigateTo('/pages_order/mine/service')">>
  125. <image src="@/static/image/center/service.png" mode=""></image>
  126. </view>
  127. <popupActivate ref="popupActivate"></popupActivate>
  128. <tabber select="center" />
  129. </view>
  130. </template>
  131. <script>
  132. import tabber from '@/components/base/tabbar.vue'
  133. import {
  134. mapGetters
  135. } from 'vuex'
  136. import popupActivate from '@/components/center/popupActivate.vue'
  137. const URL_MAPPING = { // state -> url
  138. '-1': '/pages_order/sharing/personal',
  139. '0': '/pages_order/sharing/video',
  140. '1': '/pages_order/sharing/group',
  141. '2': '/pages_order/sharing/article',
  142. }
  143. export default {
  144. components: {
  145. tabber,
  146. popupActivate,
  147. },
  148. computed: {
  149. ...mapGetters(['userShop']),
  150. },
  151. data() {
  152. return {
  153. isAgent: false,
  154. agentDeadline: '2025年12月31日',
  155. notice: '如果您在使用中有任何问题或建议,请联系客服',
  156. updateList: [
  157. {
  158. id: '001',
  159. imageUrl: '../../static/image/center/temp.png',
  160. times: 10,
  161. qrCode: null,
  162. title: '裂变星轻松获客',
  163. description: '如此好用的赚钱项目,赶快加入吧!',
  164. auditStatus: 2,
  165. createTime: '2025年2月1日',
  166. state: -1,
  167. },
  168. {
  169. id: '002',
  170. imageUrl: '../../static/image/center/temp.png',
  171. times: 10,
  172. qrCode: null,
  173. title: '裂变星轻松获客',
  174. description: '如此好用的赚钱项目,赶快加入吧!',
  175. auditStatus: 2,
  176. createTime: '2025年2月1日',
  177. state: 0,
  178. },
  179. {
  180. id: '003',
  181. imageUrl: '../../static/image/center/temp.png',
  182. times: 10,
  183. qrCode: null,
  184. title: '裂变星轻松获客',
  185. description: '如此好用的赚钱项目,赶快加入吧!',
  186. auditStatus: 2,
  187. createTime: '2025年2月1日',
  188. state: 1,
  189. },
  190. {
  191. id: '004',
  192. imageUrl: '../../static/image/center/temp.png',
  193. times: 10,
  194. qrCode: null,
  195. title: '裂变星轻松获客',
  196. description: '如此好用的赚钱项目,赶快加入吧!',
  197. auditStatus: 2,
  198. createTime: '2025年2月1日',
  199. state: 2,
  200. },
  201. ]
  202. }
  203. },
  204. onShow() {
  205. // todo: 获取信息(用户信息、最新动态)
  206. },
  207. onReachBottom() {
  208. // todo: 获取更多动态?
  209. },
  210. methods: {
  211. headBtn() {
  212. let self = this
  213. uni.showModal({
  214. title: '演示切换角色之后的效果',
  215. success(res) {
  216. if (res.confirm) {
  217. self.$store.state.shop = !self.$store.state.shop
  218. }
  219. }
  220. })
  221. },
  222. goSetting() {
  223. // todo
  224. },
  225. onShare() {
  226. // todo
  227. },
  228. onActivate() {
  229. this.$refs.popupActivate.open(this.isAgent)
  230. },
  231. goToSharingDetail(id, state) {
  232. uni.navigateTo({
  233. url: `${URL_MAPPING[state]}?id=${id}`
  234. })
  235. },
  236. }
  237. }
  238. </script>
  239. <style scoped lang="scss">
  240. .page {
  241. background-color: #001B3C;
  242. min-height: 100vh;
  243. }
  244. image {
  245. width: 100%;
  246. height: 100%;
  247. }
  248. .head {
  249. display: flex;
  250. padding: 20rpx 26rpx 18rpx 40rpx;
  251. align-items: center;
  252. position: relative;
  253. .headImage {
  254. width: 143rpx;
  255. height: 143rpx;
  256. overflow: hidden;
  257. border-radius: 50%;
  258. margin-right: 40rpx;
  259. }
  260. .info {
  261. .name {
  262. color: #FFFFFF;
  263. font-size: 38rpx;
  264. margin-bottom: 12rpx;
  265. }
  266. .tags {
  267. }
  268. }
  269. .headBtn {
  270. margin-left: auto;
  271. padding: 15rpx 20rpx;
  272. background-color: $uni-color;
  273. color: #fff;
  274. border-radius: 20rpx;
  275. margin-top: 50rpx;
  276. }
  277. .setting {
  278. position: absolute;
  279. right: 26rpx;
  280. top: 37rpx;
  281. }
  282. }
  283. .tag {
  284. display: inline-block;
  285. padding: 6rpx 21rpx;
  286. border: 1rpx solid #999999;
  287. color: #FFFFFF;
  288. font-size: 24rpx;
  289. border-radius: 23rpx;
  290. margin-right: 20rpx;
  291. vertical-align: top;
  292. &-label {
  293. color: #999999;
  294. }
  295. }
  296. .tools {
  297. &-box {
  298. width: 100vw;
  299. height: 406rpx;
  300. padding: 0 5rpx;
  301. box-sizing: border-box;
  302. position: relative;
  303. }
  304. position: absolute;
  305. width: calc(100vw - 69rpx*2);
  306. left: 69rpx;
  307. bottom: 64rpx;
  308. justify-content: space-between;
  309. }
  310. .activate {
  311. position: absolute;
  312. width: calc(100% - 199rpx);
  313. height: 80rpx;
  314. top: 31rpx;
  315. right: 37rpx;
  316. &-tips {
  317. flex: 1;
  318. color: #976224;
  319. font-size: 28rpx;
  320. }
  321. &-highlight {
  322. color: #FF6868;
  323. }
  324. .btn-activate {
  325. width: 172rpx;
  326. height: 80rpx;
  327. }
  328. }
  329. .tool {
  330. display: flex;
  331. flex-direction: column;
  332. justify-content: center;
  333. align-items: center;
  334. color: #57595B;
  335. font-size: 28rpx;
  336. &-icon {
  337. width: 88rpx;
  338. height: 88rpx;
  339. margin-bottom: 10rpx;
  340. }
  341. }
  342. .content {
  343. padding: 0 20rpx 20rpx 20rpx;
  344. }
  345. .notice {
  346. padding: 22rpx 21rpx;
  347. display: flex;
  348. &-icon {
  349. width: 49rpx;
  350. height: 49rpx;
  351. margin-right: 20rpx;
  352. }
  353. }
  354. .updates {
  355. margin-top: 20rpx;
  356. padding: 20rpx;
  357. &-header {
  358. position: relative;
  359. &-bg {
  360. height: 51rpx;
  361. width: 58rpx;
  362. margin-left: 40rpx;
  363. }
  364. &-content {
  365. color: #262626;
  366. font-size: 38rpx;
  367. font-weight: 900;
  368. position: absolute;
  369. top: 0;
  370. }
  371. }
  372. &-item {
  373. padding: 0;
  374. border-radius: 16rpx;
  375. box-shadow: 0 0 32rpx 0 rgba($color: #808080, $alpha: 0.16);
  376. margin-top: 20rpx;
  377. &-img {
  378. width: 100%;
  379. height: 252rpx;
  380. }
  381. &-info {
  382. padding: 15rpx 18rpx 8rpx 18rpx;
  383. }
  384. &-title {
  385. color: #474747;
  386. font-size: 32rpx;
  387. }
  388. &-desc {
  389. color: #CCCCCC;
  390. font-size: 20rpx;
  391. }
  392. }
  393. }
  394. .service {
  395. position: fixed;
  396. right: 29rpx;
  397. bottom: 312rpx;
  398. width: 149rpx;
  399. height: 158rpx;
  400. }
  401. </style>