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

389 lines
7.7 KiB

1 month ago
1 month ago
1 month ago
1 month ago
1 week ago
1 week ago
1 month ago
1 month ago
1 week 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 week 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. <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.intentionCode }}</text>
  16. </view>
  17. <view v-if="role" style="display: inline-block; width: 172rpx; height: 63rpx; vertical-align: top; margin-top: -6rpx;">
  18. <image src="@/pages_order/static/center/agent-icon.png"></image>
  19. </view>
  20. <!-- <view v-else class="tag" >
  21. 代理商:{{userInfo.endTime}} 到期
  22. </view> -->
  23. <view v-else class="tag" v-else>
  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="@/pages_order/static/center/tools-bg.png"></image>
  34. <view class="flex activate">
  35. <template v-if="role">
  36. <view class="activate-tips" style="padding-left: 27rpx;">
  37. <view>代理商权益</view>
  38. <view>
  39. 将于<text class="activate-highlight">{{userInfo.endTime}}</text>到期
  40. </view>
  41. </view>
  42. <view class="btn-activate" @click="onActivate">
  43. <image src="@/pages_order/static/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="@/pages_order/static/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="@/pages_order/static/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="@/pages_order/static/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="@/pages_order/static/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="@/pages_order/static/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" v-if="notice">
  84. <view class="notice-icon">
  85. <image src="@/pages_order/static/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 list"
  110. :key="item.id"
  111. @click="goToNewsDetail(item.id)"
  112. >
  113. <view class="updates-item-img">
  114. <image :src="item.image"></image>
  115. </view>
  116. <view class="updates-item-info">
  117. <view class="updates-item-title">{{ item.title || '' }}</view>
  118. <view class="updates-item-desc text-ellipsis">{{ getDesc(item.details) }}</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="@/pages_order/static/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 { mapState } from 'vuex'
  134. import mixinsList from '@/mixins/list.js'
  135. import popupActivate from '@/components/center/popupActivate.vue'
  136. import tabber from '@/components/base/tabbar.vue'
  137. export default {
  138. mixins : [mixinsList],
  139. components: {
  140. tabber,
  141. popupActivate,
  142. },
  143. data() {
  144. return {
  145. notice: '',
  146. mixinsListApi : 'getNews',
  147. }
  148. },
  149. computed: {
  150. ...mapState(['userInfo', 'userInfoVip']),
  151. role() {
  152. return this.userInfo.isPay
  153. }
  154. },
  155. onShow() {
  156. this.fetchNotice()
  157. this.$store.commit('getUserInfo')
  158. this.$store.commit('getUserInfoVip')
  159. },
  160. methods: {
  161. async fetchNotice() {
  162. try {
  163. // todo: check
  164. this.notice = (await this.$fetch('getNotice'))?.[0]?.title
  165. } catch (err) {
  166. }
  167. },
  168. onActivate() {
  169. this.$refs.popupActivate.open(this.role)
  170. },
  171. getDesc(str) {
  172. if (!str) {
  173. return ''
  174. }
  175. return str.replace(/<.*?>/g, '')
  176. },
  177. goToNewsDetail(id) {
  178. uni.navigateTo({
  179. url: `/pages_order/mine/news?id=${id}`
  180. })
  181. },
  182. }
  183. }
  184. </script>
  185. <style scoped lang="scss">
  186. .page {
  187. background-color: #001B3C;
  188. min-height: 100vh;
  189. }
  190. image {
  191. width: 100%;
  192. height: 100%;
  193. }
  194. .head {
  195. display: flex;
  196. padding: 20rpx 26rpx 18rpx 40rpx;
  197. align-items: center;
  198. position: relative;
  199. .headImage {
  200. width: 143rpx;
  201. height: 143rpx;
  202. overflow: hidden;
  203. border-radius: 50%;
  204. margin-right: 40rpx;
  205. }
  206. .info {
  207. .name {
  208. color: #FFFFFF;
  209. font-size: 38rpx;
  210. margin-bottom: 12rpx;
  211. }
  212. .tags {
  213. }
  214. }
  215. .setting {
  216. position: absolute;
  217. right: 26rpx;
  218. top: 37rpx;
  219. }
  220. }
  221. .tag {
  222. display: inline-block;
  223. padding: 6rpx 21rpx;
  224. border: 1rpx solid #999999;
  225. color: #FFFFFF;
  226. font-size: 24rpx;
  227. border-radius: 23rpx;
  228. margin-right: 20rpx;
  229. vertical-align: top;
  230. &-label {
  231. color: #999999;
  232. }
  233. }
  234. .tools {
  235. &-box {
  236. width: 100vw;
  237. height: 406rpx;
  238. padding: 0 5rpx;
  239. box-sizing: border-box;
  240. position: relative;
  241. }
  242. position: absolute;
  243. width: calc(100vw - 69rpx*2);
  244. left: 69rpx;
  245. bottom: 64rpx;
  246. justify-content: space-between;
  247. }
  248. .activate {
  249. position: absolute;
  250. width: calc(100% - 199rpx);
  251. height: 80rpx;
  252. top: 31rpx;
  253. right: 37rpx;
  254. &-tips {
  255. flex: 1;
  256. color: #976224;
  257. font-size: 28rpx;
  258. }
  259. &-highlight {
  260. color: #FF6868;
  261. }
  262. .btn-activate {
  263. width: 172rpx;
  264. height: 80rpx;
  265. }
  266. }
  267. .tool {
  268. display: flex;
  269. flex-direction: column;
  270. justify-content: center;
  271. align-items: center;
  272. color: #57595B;
  273. font-size: 28rpx;
  274. &-icon {
  275. width: 88rpx;
  276. height: 88rpx;
  277. margin-bottom: 10rpx;
  278. }
  279. }
  280. .content {
  281. padding: 0 20rpx 20rpx 20rpx;
  282. }
  283. .notice {
  284. padding: 22rpx 21rpx;
  285. display: flex;
  286. &-icon {
  287. width: 49rpx;
  288. height: 49rpx;
  289. margin-right: 20rpx;
  290. }
  291. }
  292. .updates {
  293. margin-top: 20rpx;
  294. padding: 20rpx;
  295. &-header {
  296. position: relative;
  297. &-bg {
  298. height: 51rpx;
  299. width: 58rpx;
  300. margin-left: 40rpx;
  301. }
  302. &-content {
  303. color: #262626;
  304. font-size: 38rpx;
  305. font-weight: 900;
  306. position: absolute;
  307. top: 0;
  308. }
  309. }
  310. &-item {
  311. padding: 0;
  312. border-radius: 16rpx;
  313. box-shadow: 0 0 32rpx 0 rgba($color: #808080, $alpha: 0.16);
  314. margin-top: 20rpx;
  315. &-img {
  316. width: 100%;
  317. height: 252rpx;
  318. }
  319. &-info {
  320. padding: 15rpx 18rpx 8rpx 18rpx;
  321. }
  322. &-title {
  323. color: #474747;
  324. font-size: 32rpx;
  325. }
  326. &-desc {
  327. color: #CCCCCC;
  328. font-size: 20rpx;
  329. }
  330. }
  331. }
  332. .service {
  333. position: fixed;
  334. right: 29rpx;
  335. bottom: 312rpx;
  336. width: 149rpx;
  337. height: 158rpx;
  338. }
  339. </style>