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

425 lines
8.8 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="$utils.navigateTo('/pages_order/mine/setting')">
  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. onActivate() {
  213. this.$refs.popupActivate.open(this.isAgent)
  214. },
  215. goToSharingDetail(id, state) {
  216. uni.navigateTo({
  217. url: `${URL_MAPPING[state]}?id=${id}`
  218. })
  219. },
  220. }
  221. }
  222. </script>
  223. <style scoped lang="scss">
  224. .page {
  225. background-color: #001B3C;
  226. min-height: 100vh;
  227. }
  228. image {
  229. width: 100%;
  230. height: 100%;
  231. }
  232. .head {
  233. display: flex;
  234. padding: 20rpx 26rpx 18rpx 40rpx;
  235. align-items: center;
  236. position: relative;
  237. .headImage {
  238. width: 143rpx;
  239. height: 143rpx;
  240. overflow: hidden;
  241. border-radius: 50%;
  242. margin-right: 40rpx;
  243. }
  244. .info {
  245. .name {
  246. color: #FFFFFF;
  247. font-size: 38rpx;
  248. margin-bottom: 12rpx;
  249. }
  250. .tags {
  251. }
  252. }
  253. .setting {
  254. position: absolute;
  255. right: 26rpx;
  256. top: 37rpx;
  257. }
  258. }
  259. .tag {
  260. display: inline-block;
  261. padding: 6rpx 21rpx;
  262. border: 1rpx solid #999999;
  263. color: #FFFFFF;
  264. font-size: 24rpx;
  265. border-radius: 23rpx;
  266. margin-right: 20rpx;
  267. vertical-align: top;
  268. &-label {
  269. color: #999999;
  270. }
  271. }
  272. .tools {
  273. &-box {
  274. width: 100vw;
  275. height: 406rpx;
  276. padding: 0 5rpx;
  277. box-sizing: border-box;
  278. position: relative;
  279. }
  280. position: absolute;
  281. width: calc(100vw - 69rpx*2);
  282. left: 69rpx;
  283. bottom: 64rpx;
  284. justify-content: space-between;
  285. }
  286. .activate {
  287. position: absolute;
  288. width: calc(100% - 199rpx);
  289. height: 80rpx;
  290. top: 31rpx;
  291. right: 37rpx;
  292. &-tips {
  293. flex: 1;
  294. color: #976224;
  295. font-size: 28rpx;
  296. }
  297. &-highlight {
  298. color: #FF6868;
  299. }
  300. .btn-activate {
  301. width: 172rpx;
  302. height: 80rpx;
  303. }
  304. }
  305. .tool {
  306. display: flex;
  307. flex-direction: column;
  308. justify-content: center;
  309. align-items: center;
  310. color: #57595B;
  311. font-size: 28rpx;
  312. &-icon {
  313. width: 88rpx;
  314. height: 88rpx;
  315. margin-bottom: 10rpx;
  316. }
  317. }
  318. .content {
  319. padding: 0 20rpx 20rpx 20rpx;
  320. }
  321. .notice {
  322. padding: 22rpx 21rpx;
  323. display: flex;
  324. &-icon {
  325. width: 49rpx;
  326. height: 49rpx;
  327. margin-right: 20rpx;
  328. }
  329. }
  330. .updates {
  331. margin-top: 20rpx;
  332. padding: 20rpx;
  333. &-header {
  334. position: relative;
  335. &-bg {
  336. height: 51rpx;
  337. width: 58rpx;
  338. margin-left: 40rpx;
  339. }
  340. &-content {
  341. color: #262626;
  342. font-size: 38rpx;
  343. font-weight: 900;
  344. position: absolute;
  345. top: 0;
  346. }
  347. }
  348. &-item {
  349. padding: 0;
  350. border-radius: 16rpx;
  351. box-shadow: 0 0 32rpx 0 rgba($color: #808080, $alpha: 0.16);
  352. margin-top: 20rpx;
  353. &-img {
  354. width: 100%;
  355. height: 252rpx;
  356. }
  357. &-info {
  358. padding: 15rpx 18rpx 8rpx 18rpx;
  359. }
  360. &-title {
  361. color: #474747;
  362. font-size: 32rpx;
  363. }
  364. &-desc {
  365. color: #CCCCCC;
  366. font-size: 20rpx;
  367. }
  368. }
  369. }
  370. .service {
  371. position: fixed;
  372. right: 29rpx;
  373. bottom: 312rpx;
  374. width: 149rpx;
  375. height: 158rpx;
  376. }
  377. </style>