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

394 lines
8.0 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 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" @click="goToEditUserInfo">
  6. <image :src="userInfo.headImage" mode=""></image>
  7. </view>
  8. <view class="info">
  9. <view class="name" @click="goToEditUserInfo">
  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">
  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 ? $dayjs(userInfo.endTime).format('YYYY年M月D日') : '-'}}</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. goToEditUserInfo() {
  183. uni.navigateTo({
  184. url: '/pages_order/auth/wxUserInfo?mode=edit'
  185. })
  186. },
  187. }
  188. }
  189. </script>
  190. <style scoped lang="scss">
  191. .page {
  192. background-color: #001B3C;
  193. min-height: 100vh;
  194. }
  195. image {
  196. width: 100%;
  197. height: 100%;
  198. }
  199. .head {
  200. display: flex;
  201. padding: 20rpx 26rpx 18rpx 40rpx;
  202. align-items: center;
  203. position: relative;
  204. .headImage {
  205. width: 143rpx;
  206. height: 143rpx;
  207. overflow: hidden;
  208. border-radius: 50%;
  209. margin-right: 40rpx;
  210. }
  211. .info {
  212. .name {
  213. color: #FFFFFF;
  214. font-size: 38rpx;
  215. margin-bottom: 12rpx;
  216. }
  217. .tags {
  218. }
  219. }
  220. .setting {
  221. position: absolute;
  222. right: 26rpx;
  223. top: 37rpx;
  224. }
  225. }
  226. .tag {
  227. display: inline-block;
  228. padding: 6rpx 21rpx;
  229. border: 1rpx solid #999999;
  230. color: #FFFFFF;
  231. font-size: 24rpx;
  232. border-radius: 23rpx;
  233. margin-right: 20rpx;
  234. vertical-align: top;
  235. &-label {
  236. color: #999999;
  237. }
  238. }
  239. .tools {
  240. &-box {
  241. width: 100vw;
  242. height: 406rpx;
  243. padding: 0 5rpx;
  244. box-sizing: border-box;
  245. position: relative;
  246. }
  247. position: absolute;
  248. width: calc(100vw - 69rpx*2);
  249. left: 69rpx;
  250. bottom: 64rpx;
  251. justify-content: space-between;
  252. }
  253. .activate {
  254. position: absolute;
  255. width: calc(100% - 199rpx);
  256. height: 80rpx;
  257. top: 31rpx;
  258. right: 37rpx;
  259. &-tips {
  260. flex: 1;
  261. color: #976224;
  262. font-size: 28rpx;
  263. }
  264. &-highlight {
  265. color: #FF6868;
  266. }
  267. .btn-activate {
  268. width: 172rpx;
  269. height: 80rpx;
  270. }
  271. }
  272. .tool {
  273. display: flex;
  274. flex-direction: column;
  275. justify-content: center;
  276. align-items: center;
  277. color: #57595B;
  278. font-size: 28rpx;
  279. &-icon {
  280. width: 88rpx;
  281. height: 88rpx;
  282. margin-bottom: 10rpx;
  283. }
  284. }
  285. .content {
  286. padding: 0 20rpx 20rpx 20rpx;
  287. }
  288. .notice {
  289. padding: 22rpx 21rpx;
  290. display: flex;
  291. &-icon {
  292. width: 49rpx;
  293. height: 49rpx;
  294. margin-right: 20rpx;
  295. }
  296. }
  297. .updates {
  298. margin-top: 20rpx;
  299. padding: 20rpx;
  300. &-header {
  301. position: relative;
  302. &-bg {
  303. height: 51rpx;
  304. width: 58rpx;
  305. margin-left: 40rpx;
  306. }
  307. &-content {
  308. color: #262626;
  309. font-size: 38rpx;
  310. font-weight: 900;
  311. position: absolute;
  312. top: 0;
  313. }
  314. }
  315. &-item {
  316. padding: 0;
  317. border-radius: 16rpx;
  318. box-shadow: 0 0 32rpx 0 rgba($color: #808080, $alpha: 0.16);
  319. margin-top: 20rpx;
  320. &-img {
  321. width: 100%;
  322. height: 252rpx;
  323. }
  324. &-info {
  325. padding: 15rpx 18rpx 8rpx 18rpx;
  326. }
  327. &-title {
  328. color: #474747;
  329. font-size: 32rpx;
  330. }
  331. &-desc {
  332. color: #CCCCCC;
  333. font-size: 20rpx;
  334. }
  335. }
  336. }
  337. .service {
  338. position: fixed;
  339. right: 29rpx;
  340. bottom: 312rpx;
  341. width: 149rpx;
  342. height: 158rpx;
  343. }
  344. </style>