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

396 lines
7.8 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
  1. <template>
  2. <view class="page">
  3. <navbar title="个人中心" bgColor="#001B3C" color="#FFFFFF" />
  4. <view class="head">
  5. <view class="headImage">
  6. <image :src="userInfo.headImage" mode=""></image>
  7. </view>
  8. <view class="info">
  9. <view class="name">
  10. {{ userInfo.nickName }}
  11. </view>
  12. <view class="tags">
  13. <view class="tag">
  14. <text class="tag-label">ID:</text>
  15. <text>{{ userInfo.id }}</text>
  16. </view>
  17. <!-- todo -->
  18. <view v-if="isAgent" style="display: inline-block; width: 172rpx; height: 63rpx; vertical-align: top; margin-top: -6rpx;">
  19. <image src="@/pages_order/static/center/agent-icon.png"></image>
  20. </view>
  21. <view v-else class="tag">
  22. 普通会员
  23. </view>
  24. </view>
  25. </view>
  26. <view class="setting" @click="$utils.navigateTo('/pages_order/mine/setting')">
  27. <uv-icon name="setting" color="#FFFFFF" size="48rpx"></uv-icon>
  28. </view>
  29. </view>
  30. <view class="tools-box">
  31. <image class="tools-bg" src="@/pages_order/static/center/tools-bg.png"></image>
  32. <view class="flex activate">
  33. <template v-if="isAgent">
  34. <view class="activate-tips" style="padding-left: 27rpx;">
  35. <view>代理商权益</view>
  36. <view>
  37. 将于<text class="activate-highlight">{{ agentDeadline }}</text>到期
  38. </view>
  39. </view>
  40. <view class="btn-activate" @click="onActivate">
  41. <image src="@/pages_order/static/center/btn-activate-again.png"></image>
  42. </view>
  43. </template>
  44. <template v-else>
  45. <view class="activate-tips">
  46. 升级成为代理商享受更多权益
  47. </view>
  48. <view class="btn-activate" @click="onActivate">
  49. <image src="@/pages_order/static/center/btn-activate.png"></image>
  50. </view>
  51. </template>
  52. </view>
  53. <view class="tools flex">
  54. <!-- todo -->
  55. <view class="tool" @click="$utils.navigateTo('/pages_order/mine/sharing')">
  56. <view class="tool-icon">
  57. <image src="@/pages_order/static/center/tool-share.png"></image>
  58. </view>
  59. <text>分享好友</text>
  60. </view>
  61. <!-- todo -->
  62. <view class="tool" @click="onActivate">
  63. <view class="tool-icon">
  64. <image src="@/pages_order/static/center/tool-activate.png"></image>
  65. </view>
  66. <text>激活码</text>
  67. </view>
  68. <!-- todo -->
  69. <view class="tool" @click="$utils.navigateTo('/pages_order/mine/wallet')">
  70. <view class="tool-icon">
  71. <image src="@/pages_order/static/center/tool-wallet.png"></image>
  72. </view>
  73. <text>我的钱包</text>
  74. </view>
  75. <!-- todo -->
  76. <view class="tool" @click="$utils.navigateTo('/pages_order/mine/team')">
  77. <view class="tool-icon">
  78. <image src="@/pages_order/static/center/tool-team.png"></image>
  79. </view>
  80. <text>我的团队</text>
  81. </view>
  82. </view>
  83. </view>
  84. <view class="content">
  85. <view class="card notice" v-if="notice">
  86. <view class="notice-icon">
  87. <image src="@/pages_order/static/center/notice.png"></image>
  88. </view>
  89. <uv-notice-bar
  90. :text="notice"
  91. bgColor="transparent"
  92. color="#001B3C"
  93. :icon="false"
  94. fontSize="28rpx"
  95. :customStyle="{
  96. padding: '6rpx 0',
  97. }"
  98. ></uv-notice-bar>
  99. </view>
  100. <view class="card updates">
  101. <view class="updates-header">
  102. <view class="updates-header-bg">
  103. <image src="@/static/image/center/title-bg.png"></image>
  104. </view>
  105. <view class="updates-header-content">
  106. 动态更新
  107. </view>
  108. </view>
  109. <view class="updates-content">
  110. <view class="card updates-item"
  111. v-for="(item, index) in list"
  112. :key="item.id"
  113. @click="goToNewsDetail(item.id, index)"
  114. >
  115. <view class="updates-item-img">
  116. <image :src="item.image"></image>
  117. </view>
  118. <view class="updates-item-info">
  119. <view class="updates-item-title">{{ item.title || '' }}</view>
  120. <view class="updates-item-desc text-ellipsis">{{ getDesc(item.details) }}</view>
  121. </view>
  122. </view>
  123. </view>
  124. </view>
  125. </view>
  126. <view class="service" @click="$utils.navigateTo('/pages_order/mine/service')">
  127. <image src="@/pages_order/static/center/service.png" mode=""></image>
  128. </view>
  129. <popupActivate ref="popupActivate"></popupActivate>
  130. <popupSharing ref="popupSharing"></popupSharing>
  131. <tabber select="center" />
  132. </view>
  133. </template>
  134. <script>
  135. import { mapState } from 'vuex'
  136. import mixinsList from '@/mixins/list.js'
  137. import popupActivate from '@/components/center/popupActivate.vue'
  138. import tabber from '@/components/base/tabbar.vue'
  139. export default {
  140. mixins : [mixinsList],
  141. components: {
  142. tabber,
  143. popupActivate,
  144. },
  145. computed: {
  146. ...mapState(['userInfo']),
  147. },
  148. data() {
  149. return {
  150. // todo: agent => role
  151. isAgent: false,
  152. agentDeadline: '2025年12月31日',
  153. notice: '',
  154. mixinsListApi : 'getNews',
  155. }
  156. },
  157. onShow() {
  158. this.fetchNotice()
  159. this.getData()
  160. },
  161. onLoad() {
  162. if (uni.getStorageSync('token') && !this.userInfo?.id) {
  163. this.$store.commit('getUserInfo')
  164. }
  165. },
  166. methods: {
  167. async fetchNotice() {
  168. try {
  169. this.notice = await this.$fetch('getNotice', { id })
  170. } catch (err) {
  171. }
  172. },
  173. onActivate() {
  174. this.$refs.popupActivate.open(this.isAgent)
  175. },
  176. getDesc(str) {
  177. if (!str) {
  178. return ''
  179. }
  180. return str.replace(/<.*?>/g, '')
  181. },
  182. goToNewsDetail(id, index) {
  183. // todo: check
  184. uni.navigateTo({
  185. url: `/pages_order/mine/news?id=${id}&index=${index}`
  186. })
  187. },
  188. }
  189. }
  190. </script>
  191. <style scoped lang="scss">
  192. .page {
  193. background-color: #001B3C;
  194. min-height: 100vh;
  195. }
  196. image {
  197. width: 100%;
  198. height: 100%;
  199. }
  200. .head {
  201. display: flex;
  202. padding: 20rpx 26rpx 18rpx 40rpx;
  203. align-items: center;
  204. position: relative;
  205. .headImage {
  206. width: 143rpx;
  207. height: 143rpx;
  208. overflow: hidden;
  209. border-radius: 50%;
  210. margin-right: 40rpx;
  211. }
  212. .info {
  213. .name {
  214. color: #FFFFFF;
  215. font-size: 38rpx;
  216. margin-bottom: 12rpx;
  217. }
  218. .tags {
  219. }
  220. }
  221. .setting {
  222. position: absolute;
  223. right: 26rpx;
  224. top: 37rpx;
  225. }
  226. }
  227. .tag {
  228. display: inline-block;
  229. padding: 6rpx 21rpx;
  230. border: 1rpx solid #999999;
  231. color: #FFFFFF;
  232. font-size: 24rpx;
  233. border-radius: 23rpx;
  234. margin-right: 20rpx;
  235. vertical-align: top;
  236. &-label {
  237. color: #999999;
  238. }
  239. }
  240. .tools {
  241. &-box {
  242. width: 100vw;
  243. height: 406rpx;
  244. padding: 0 5rpx;
  245. box-sizing: border-box;
  246. position: relative;
  247. }
  248. position: absolute;
  249. width: calc(100vw - 69rpx*2);
  250. left: 69rpx;
  251. bottom: 64rpx;
  252. justify-content: space-between;
  253. }
  254. .activate {
  255. position: absolute;
  256. width: calc(100% - 199rpx);
  257. height: 80rpx;
  258. top: 31rpx;
  259. right: 37rpx;
  260. &-tips {
  261. flex: 1;
  262. color: #976224;
  263. font-size: 28rpx;
  264. }
  265. &-highlight {
  266. color: #FF6868;
  267. }
  268. .btn-activate {
  269. width: 172rpx;
  270. height: 80rpx;
  271. }
  272. }
  273. .tool {
  274. display: flex;
  275. flex-direction: column;
  276. justify-content: center;
  277. align-items: center;
  278. color: #57595B;
  279. font-size: 28rpx;
  280. &-icon {
  281. width: 88rpx;
  282. height: 88rpx;
  283. margin-bottom: 10rpx;
  284. }
  285. }
  286. .content {
  287. padding: 0 20rpx 20rpx 20rpx;
  288. }
  289. .notice {
  290. padding: 22rpx 21rpx;
  291. display: flex;
  292. &-icon {
  293. width: 49rpx;
  294. height: 49rpx;
  295. margin-right: 20rpx;
  296. }
  297. }
  298. .updates {
  299. margin-top: 20rpx;
  300. padding: 20rpx;
  301. &-header {
  302. position: relative;
  303. &-bg {
  304. height: 51rpx;
  305. width: 58rpx;
  306. margin-left: 40rpx;
  307. }
  308. &-content {
  309. color: #262626;
  310. font-size: 38rpx;
  311. font-weight: 900;
  312. position: absolute;
  313. top: 0;
  314. }
  315. }
  316. &-item {
  317. padding: 0;
  318. border-radius: 16rpx;
  319. box-shadow: 0 0 32rpx 0 rgba($color: #808080, $alpha: 0.16);
  320. margin-top: 20rpx;
  321. &-img {
  322. width: 100%;
  323. height: 252rpx;
  324. }
  325. &-info {
  326. padding: 15rpx 18rpx 8rpx 18rpx;
  327. }
  328. &-title {
  329. color: #474747;
  330. font-size: 32rpx;
  331. }
  332. &-desc {
  333. color: #CCCCCC;
  334. font-size: 20rpx;
  335. }
  336. }
  337. }
  338. .service {
  339. position: fixed;
  340. right: 29rpx;
  341. bottom: 312rpx;
  342. width: 149rpx;
  343. height: 158rpx;
  344. }
  345. </style>