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