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

448 lines
9.2 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. <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="$utils.navigateTo('/pages_order/mine/sharing')">
  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: '6rpx 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. <popupSharing ref="popupSharing"></popupSharing>
  129. <tabber select="center" />
  130. </view>
  131. </template>
  132. <script>
  133. import tabber from '@/components/base/tabbar.vue'
  134. import {
  135. mapGetters
  136. } from 'vuex'
  137. import popupActivate from '@/components/center/popupActivate.vue'
  138. const URL_MAPPING = { // state -> url
  139. '-1': '/pages_order/sharing/personal',
  140. '0': '/pages_order/sharing/video',
  141. '1': '/pages_order/sharing/group',
  142. '2': '/pages_order/sharing/article',
  143. }
  144. export default {
  145. components: {
  146. tabber,
  147. popupActivate,
  148. },
  149. computed: {
  150. ...mapGetters(['userShop']),
  151. },
  152. data() {
  153. return {
  154. isAgent: false,
  155. agentDeadline: '2025年12月31日',
  156. notice: '如果您在使用中有任何问题或建议,请联系客服',
  157. updateList: [
  158. {
  159. id: '001',
  160. imageUrl: '../../static/image/center/temp.png',
  161. times: 10,
  162. qrCode: null,
  163. title: '裂变星轻松获客',
  164. description: '如此好用的赚钱项目,赶快加入吧!',
  165. auditStatus: 2,
  166. createTime: '2025年2月1日',
  167. state: -1,
  168. },
  169. {
  170. id: '002',
  171. imageUrl: '../../static/image/center/temp.png',
  172. times: 10,
  173. qrCode: null,
  174. title: '裂变星轻松获客',
  175. description: '如此好用的赚钱项目,赶快加入吧!',
  176. auditStatus: 2,
  177. createTime: '2025年2月1日',
  178. state: 0,
  179. },
  180. {
  181. id: '003',
  182. imageUrl: '../../static/image/center/temp.png',
  183. times: 10,
  184. qrCode: null,
  185. title: '裂变星轻松获客',
  186. description: '如此好用的赚钱项目,赶快加入吧!',
  187. auditStatus: 2,
  188. createTime: '2025年2月1日',
  189. state: 1,
  190. },
  191. {
  192. id: '004',
  193. imageUrl: '../../static/image/center/temp.png',
  194. times: 10,
  195. qrCode: null,
  196. title: '裂变星轻松获客',
  197. description: '如此好用的赚钱项目,赶快加入吧!',
  198. auditStatus: 2,
  199. createTime: '2025年2月1日',
  200. state: 2,
  201. },
  202. ]
  203. }
  204. },
  205. onShow() {
  206. // todo: 获取信息(用户信息、最新动态)
  207. },
  208. onReachBottom() {
  209. // todo: 获取更多动态?
  210. },
  211. methods: {
  212. headBtn() {
  213. let self = this
  214. uni.showModal({
  215. title: '演示切换角色之后的效果',
  216. success(res) {
  217. if (res.confirm) {
  218. self.$store.state.shop = !self.$store.state.shop
  219. }
  220. }
  221. })
  222. },
  223. goSetting() {
  224. // todo
  225. },
  226. onActivate() {
  227. this.$refs.popupActivate.open(this.isAgent)
  228. },
  229. goToSharingDetail(id, state) {
  230. uni.navigateTo({
  231. url: `${URL_MAPPING[state]}?id=${id}`
  232. })
  233. },
  234. }
  235. }
  236. </script>
  237. <style scoped lang="scss">
  238. .page {
  239. background-color: #001B3C;
  240. min-height: 100vh;
  241. }
  242. image {
  243. width: 100%;
  244. height: 100%;
  245. }
  246. .head {
  247. display: flex;
  248. padding: 20rpx 26rpx 18rpx 40rpx;
  249. align-items: center;
  250. position: relative;
  251. .headImage {
  252. width: 143rpx;
  253. height: 143rpx;
  254. overflow: hidden;
  255. border-radius: 50%;
  256. margin-right: 40rpx;
  257. }
  258. .info {
  259. .name {
  260. color: #FFFFFF;
  261. font-size: 38rpx;
  262. margin-bottom: 12rpx;
  263. }
  264. .tags {
  265. }
  266. }
  267. .headBtn {
  268. margin-left: auto;
  269. padding: 15rpx 20rpx;
  270. background-color: $uni-color;
  271. color: #fff;
  272. border-radius: 20rpx;
  273. margin-top: 50rpx;
  274. }
  275. .setting {
  276. position: absolute;
  277. right: 26rpx;
  278. top: 37rpx;
  279. }
  280. }
  281. .tag {
  282. display: inline-block;
  283. padding: 6rpx 21rpx;
  284. border: 1rpx solid #999999;
  285. color: #FFFFFF;
  286. font-size: 24rpx;
  287. border-radius: 23rpx;
  288. margin-right: 20rpx;
  289. vertical-align: top;
  290. &-label {
  291. color: #999999;
  292. }
  293. }
  294. .tools {
  295. &-box {
  296. width: 100vw;
  297. height: 406rpx;
  298. padding: 0 5rpx;
  299. box-sizing: border-box;
  300. position: relative;
  301. }
  302. position: absolute;
  303. width: calc(100vw - 69rpx*2);
  304. left: 69rpx;
  305. bottom: 64rpx;
  306. justify-content: space-between;
  307. }
  308. .activate {
  309. position: absolute;
  310. width: calc(100% - 199rpx);
  311. height: 80rpx;
  312. top: 31rpx;
  313. right: 37rpx;
  314. &-tips {
  315. flex: 1;
  316. color: #976224;
  317. font-size: 28rpx;
  318. }
  319. &-highlight {
  320. color: #FF6868;
  321. }
  322. .btn-activate {
  323. width: 172rpx;
  324. height: 80rpx;
  325. }
  326. }
  327. .tool {
  328. display: flex;
  329. flex-direction: column;
  330. justify-content: center;
  331. align-items: center;
  332. color: #57595B;
  333. font-size: 28rpx;
  334. &-icon {
  335. width: 88rpx;
  336. height: 88rpx;
  337. margin-bottom: 10rpx;
  338. }
  339. }
  340. .content {
  341. padding: 0 20rpx 20rpx 20rpx;
  342. }
  343. .notice {
  344. padding: 22rpx 21rpx;
  345. display: flex;
  346. &-icon {
  347. width: 49rpx;
  348. height: 49rpx;
  349. margin-right: 20rpx;
  350. }
  351. }
  352. .updates {
  353. margin-top: 20rpx;
  354. padding: 20rpx;
  355. &-header {
  356. position: relative;
  357. &-bg {
  358. height: 51rpx;
  359. width: 58rpx;
  360. margin-left: 40rpx;
  361. }
  362. &-content {
  363. color: #262626;
  364. font-size: 38rpx;
  365. font-weight: 900;
  366. position: absolute;
  367. top: 0;
  368. }
  369. }
  370. &-item {
  371. padding: 0;
  372. border-radius: 16rpx;
  373. box-shadow: 0 0 32rpx 0 rgba($color: #808080, $alpha: 0.16);
  374. margin-top: 20rpx;
  375. &-img {
  376. width: 100%;
  377. height: 252rpx;
  378. }
  379. &-info {
  380. padding: 15rpx 18rpx 8rpx 18rpx;
  381. }
  382. &-title {
  383. color: #474747;
  384. font-size: 32rpx;
  385. }
  386. &-desc {
  387. color: #CCCCCC;
  388. font-size: 20rpx;
  389. }
  390. }
  391. }
  392. .service {
  393. position: fixed;
  394. right: 29rpx;
  395. bottom: 312rpx;
  396. width: 149rpx;
  397. height: 158rpx;
  398. }
  399. </style>