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

437 lines
8.8 KiB

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 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">
  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/record/personalSharing',
  138. '1': '/pages_order/record/videoSharing',
  139. '2': '/pages_order/record/groupSharing',
  140. '3': '/pages_order/record/articleSharing',
  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. }
  191. },
  192. onShow() {
  193. // todo: 获取信息(用户信息、最新动态)
  194. },
  195. onReachBottom() {
  196. // todo: 获取更多动态?
  197. },
  198. methods: {
  199. headBtn() {
  200. let self = this
  201. uni.showModal({
  202. title: '演示切换角色之后的效果',
  203. success(res) {
  204. if (res.confirm) {
  205. self.$store.state.shop = !self.$store.state.shop
  206. }
  207. }
  208. })
  209. },
  210. goSetting() {
  211. // todo
  212. },
  213. onShare() {
  214. // todo
  215. },
  216. onActivate() {
  217. // todo
  218. },
  219. goToSharingDetail(id, state) {
  220. uni.navigateTo({
  221. url: `${URL_MAPPING[state]}?id=${id}`
  222. })
  223. }
  224. }
  225. }
  226. </script>
  227. <style scoped lang="scss">
  228. .page {
  229. background-color: #001B3C;
  230. min-height: 100vh;
  231. }
  232. image {
  233. width: 100%;
  234. height: 100%;
  235. }
  236. .head {
  237. display: flex;
  238. padding: 20rpx 26rpx 18rpx 40rpx;
  239. align-items: center;
  240. position: relative;
  241. .headImage {
  242. width: 143rpx;
  243. height: 143rpx;
  244. overflow: hidden;
  245. border-radius: 50%;
  246. margin-right: 40rpx;
  247. }
  248. .info {
  249. .name {
  250. color: #FFFFFF;
  251. font-size: 38rpx;
  252. margin-bottom: 12rpx;
  253. }
  254. .tags {
  255. }
  256. }
  257. .headBtn {
  258. margin-left: auto;
  259. padding: 15rpx 20rpx;
  260. background-color: $uni-color;
  261. color: #fff;
  262. border-radius: 20rpx;
  263. margin-top: 50rpx;
  264. }
  265. .setting {
  266. position: absolute;
  267. right: 26rpx;
  268. top: 37rpx;
  269. }
  270. }
  271. .tag {
  272. display: inline-block;
  273. padding: 6rpx 21rpx;
  274. border: 1rpx solid #999999;
  275. color: #FFFFFF;
  276. font-size: 24rpx;
  277. border-radius: 23rpx;
  278. margin-right: 20rpx;
  279. vertical-align: top;
  280. &-label {
  281. color: #999999;
  282. }
  283. }
  284. .tools {
  285. &-box {
  286. width: 100vw;
  287. height: 406rpx;
  288. padding: 0 5rpx;
  289. box-sizing: border-box;
  290. position: relative;
  291. }
  292. position: absolute;
  293. width: calc(100vw - 69rpx*2);
  294. left: 69rpx;
  295. bottom: 64rpx;
  296. justify-content: space-between;
  297. }
  298. .activate {
  299. position: absolute;
  300. width: calc(100% - 199rpx);
  301. height: 80rpx;
  302. top: 31rpx;
  303. right: 37rpx;
  304. &-tips {
  305. flex: 1;
  306. color: #976224;
  307. font-size: 28rpx;
  308. }
  309. &-highlight {
  310. color: #FF6868;
  311. }
  312. .btn-activate {
  313. width: 172rpx;
  314. height: 80rpx;
  315. }
  316. }
  317. .tool {
  318. display: flex;
  319. flex-direction: column;
  320. justify-content: center;
  321. align-items: center;
  322. color: #57595B;
  323. font-size: 28rpx;
  324. &-icon {
  325. width: 88rpx;
  326. height: 88rpx;
  327. margin-bottom: 10rpx;
  328. }
  329. }
  330. .content {
  331. padding: 0 20rpx 20rpx 20rpx;
  332. }
  333. .notice {
  334. padding: 22rpx 21rpx;
  335. display: flex;
  336. &-icon {
  337. width: 49rpx;
  338. height: 49rpx;
  339. margin-right: 20rpx;
  340. }
  341. }
  342. .updates {
  343. margin-top: 20rpx;
  344. padding: 20rpx;
  345. &-header {
  346. position: relative;
  347. &-bg {
  348. height: 51rpx;
  349. width: 58rpx;
  350. margin-left: 40rpx;
  351. }
  352. &-content {
  353. color: #262626;
  354. font-size: 38rpx;
  355. font-weight: 900;
  356. position: absolute;
  357. top: 0;
  358. }
  359. }
  360. &-item {
  361. padding: 0;
  362. border-radius: 16rpx;
  363. box-shadow: 0 0 32rpx 0 rgba($color: #808080, $alpha: 0.16);
  364. margin-top: 20rpx;
  365. &-img {
  366. width: 100%;
  367. height: 252rpx;
  368. }
  369. &-info {
  370. padding: 15rpx 18rpx 8rpx 18rpx;
  371. }
  372. &-title {
  373. color: #474747;
  374. font-size: 32rpx;
  375. }
  376. &-desc {
  377. color: #CCCCCC;
  378. font-size: 20rpx;
  379. }
  380. }
  381. }
  382. .service {
  383. position: fixed;
  384. right: 29rpx;
  385. bottom: 312rpx;
  386. width: 149rpx;
  387. height: 158rpx;
  388. }
  389. </style>