BaseInfo.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. <template>
  2. <view class="base-info-container">
  3. <!-- <view style="font-size: 36upx;font-weight: bold;color: #2A2B23;">个人中心</view> -->
  4. <view class="op-container">
  5. <view class="wrapper" @click="go('/another-tf/another-serve/messageCenter/index')">
  6. <tui-icon name="message" :size="60" unit="upx" color="##222229" margin="0"></tui-icon>
  7. <tui-badge
  8. v-show="$store.getters.userInfo.notRead" type="danger" right="-6rpx" absolute
  9. :scale-ratio="0.8"
  10. translate-x="38%" top="-6rpx"
  11. >
  12. {{ $store.getters.userInfo.notRead > 99 ? '99+' : $store.getters.userInfo.notRead }}
  13. </tui-badge>
  14. </view>
  15. <view class="wrapper" @click="go('/another-tf/another-serve/personalDetails/index')">
  16. <tui-icon name="setup" :size="60" unit="upx" color="##222229" margin="0"></tui-icon>
  17. </view>
  18. </view>
  19. <view class="user-info">
  20. <Avatar
  21. margin="0 12upx 0 0" :size="49"
  22. :src="$store.getters.userInfo.token ? common.seamingImgUrl($store.getters.userInfo.headImage) : require('../../../static/images/new-user/default-user-avatar.png')"
  23. @click="$store.getters.userInfo.token && go('/another-tf/another-serve/personalDetails/index')"
  24. ></Avatar>
  25. <view class="right-wrapper">
  26. <view v-if="!$store.getters.userInfo.token">
  27. <view class="logout-title">您好!</view>
  28. <view class="logout-tip">您目前暂未登录,请<text @click="go('/pages/login/login')">前往登录</text></view>
  29. </view>
  30. <view v-else style="display: flex;justify-content: space-between;align-items: center;">
  31. <view style="color: #222229;" @click="go('/another-tf/another-serve/personalDetails/index')">
  32. <view
  33. style="display: flex;align-items: center;align-items: center;box-sizing: border-box;margin-top: 12upx;flex-wrap: wrap;font-size: 20upx;"
  34. >
  35. <!-- <view>成长值</view> -->
  36. <!-- {{ $store.getters.userInfo.growth || 0 }} / {{ $store.getters.userInfo.nextLevelGrowth || 0 }} -->
  37. <view style="padding: 6upx 20upx;margin-right: 16upx;background-color: #ffffff;border-radius: 18upx;">
  38. ID:{{ $store.getters.userInfo.buyerUserId }}
  39. </view>
  40. <view
  41. style="padding: 6upx 20upx;background-color: #ffffff;border-radius: 18upx;"
  42. @click.stop="go('/another-tf/another-user/user-upgrade/user-upgrade-application')"
  43. >
  44. <text>当前等级:</text>
  45. <text v-if="[1, 2].includes($store.getters.levelType)">普通会员</text>
  46. <text v-if="[3, 4].includes($store.getters.levelType)">团长</text>
  47. <text v-if="[ 5 ].includes($store.getters.levelType)">合伙人</text>
  48. <text style="margin-left: 4upx;">></text>
  49. </view>
  50. </view>
  51. </view>
  52. <view style="flex: 1;text-align: right;">
  53. <tui-button
  54. type="warning" width="128rpx" height="64upx" margin="0"
  55. shape="circle" :size="24"
  56. style="display: inline-block;background: linear-gradient(270deg, #FE4013 0%, #F86D3A 100%)!important;box-shadow: 0px 2px 2px 0px #FA6842,0px 5px 20px 0px rgba(250, 104, 66, 0.8);"
  57. @click="go('/another-tf/another-user/user-upgrade/user-upgrade-application')"
  58. >
  59. 升级
  60. </tui-button>
  61. </view>
  62. </view>
  63. </view>
  64. <!-- 团长或合伙人才有 -->
  65. <!-- <view
  66. v-if="$store.getters.userInfo.token"
  67. style="text-align: center;" @click="$refs.codeCreateRef.getCode('teamMembersInvitation')"
  68. >
  69. <tui-icon name="qrcode" :size="24" color="#222229"></tui-icon>
  70. <view style="font-size: 24upx;color: #8f8d85;">
  71. <text>入驻码</text>
  72. </view>
  73. </view> -->
  74. </view>
  75. <view class="account-container">
  76. <view class="account-item" @click="go('/another-tf/another-user/platform-recharge/index')">
  77. <view class="account-number"> {{ $store.getters.pricePlatformInfo.totalPrice || 0 }} </view>
  78. <view class="account-title">余额</view>
  79. </view>
  80. <view class="account-item" @click="go('/user/sever/goldButler/gold-butler')">
  81. <view class="account-number">
  82. {{ isBuy ? 1 : 0 }}
  83. </view>
  84. <view class="account-title">家庭小卫士</view>
  85. </view>
  86. <!-- <view class="account-item" @click="go('/another-tf/another-serve/integral/index')">
  87. <view class="account-number">
  88. {{ $store.getters.userInfo.credit || 0 }}
  89. </view>
  90. <view class="account-title">积分</view>
  91. </view> -->
  92. <view class="account-item" @click="go('/another-tf/another-user/voucher/voucher')">
  93. <view class="account-number">
  94. {{ $store.getters.pricePlatformInfo.voucherPrice || 0 }}
  95. </view>
  96. <view class="account-title">代金劵</view>
  97. </view>
  98. </view>
  99. <tui-modal
  100. :show="$data._isShowTuiModel" title="提示" content="您还未登录,是否先去登录?"
  101. @click="_handleClickTuiModel($event, 'login', '/pages/user/user')"
  102. ></tui-modal>
  103. <tui-modal :show="isShow" title="提示" content="您已开通家庭小卫士" @click="handleToVip"></tui-modal>
  104. </view>
  105. </template>
  106. <script>
  107. import { userIsPurchaseApi } from '../../../api/user'
  108. import { USER_ID } from '../../../constant'
  109. import showModalMixin from 'mixin/showModal'
  110. import { convertToDecimal } from '../../../utils'
  111. export default {
  112. name: 'BaseInfo',
  113. data() {
  114. return {
  115. isBuy: false,
  116. isShow: false,
  117. isShowGloryFrame: false,
  118. frameType: ''
  119. }
  120. },
  121. mixins: [ showModalMixin() ],
  122. mounted() {
  123. console.log(this.$store.getters.userInfo)
  124. this.userIsPurchase()
  125. },
  126. methods: {
  127. convertToDecimal,
  128. handleToVip(e) {
  129. if (e.index) {
  130. uni.navigateTo({ url: '/user/sever/goldButler/gold-butler' })
  131. }
  132. this.isShow = false
  133. },
  134. // 查询用户是否购买过家庭小卫士套餐
  135. async userIsPurchase() {
  136. try {
  137. const userId = uni.getStorageSync(USER_ID)
  138. const res = await userIsPurchaseApi({
  139. userId,
  140. price: 399
  141. })
  142. if (res.statusCode === 20000) {
  143. if (res.data && Array.isArray(res.data) && res.data.length) {
  144. this.isBuy = true
  145. }
  146. } else {
  147. this.isBuy = false
  148. }
  149. } catch (error) {
  150. this.isBuy = false
  151. }
  152. }
  153. }
  154. }
  155. </script>
  156. <style lang="scss" scoped>
  157. .rotation-box {
  158. position: absolute;
  159. top: -45vh;
  160. left: 50%;
  161. margin-left: -60vh;
  162. display: block;
  163. width: 120vh;
  164. height: 120vh;
  165. opacity: 0.4;
  166. background: repeating-conic-gradient(from 0deg, white 0deg 19deg, transparent 15deg 53deg);
  167. mask-image: radial-gradient(rgb(0, 0, 0), rgb(0, 0, 0) 50%);
  168. animation: rotate 20s linear infinite;
  169. }
  170. @keyframes rotate {
  171. to {
  172. transform: rotate(1turn)
  173. }
  174. }
  175. .base-info-container {
  176. position: relative;
  177. background: linear-gradient(138deg, #FFFCE7 13%, #F7EBDF 54%);
  178. background-size: cover;
  179. padding: 48upx 32upx 0upx;
  180. box-sizing: border-box;
  181. .op-container {
  182. display: flex;
  183. align-items: center;
  184. justify-content: flex-end;
  185. padding-top: 20upx;
  186. .wrapper {
  187. position: relative;
  188. &:nth-child(1) {
  189. margin-right: 24upx;
  190. }
  191. }
  192. }
  193. .user-info {
  194. display: flex;
  195. align-items: center;
  196. justify-content: space-between;
  197. margin-top: 38upx;
  198. /deep/ .avatar-container {
  199. image {
  200. border: 2upx solid #f1f1f0;
  201. background-color: #fff;
  202. box-sizing: border-box;
  203. }
  204. }
  205. .right-wrapper {
  206. flex: 1;
  207. .logout-title {
  208. font-size: 28upx;
  209. font-weight: bold;
  210. line-height: 42upx;
  211. }
  212. .logout-tip {
  213. font-size: 24upx;
  214. line-height: 36upx;
  215. margin-top: 6upx;
  216. text {
  217. color: #ffc117;
  218. }
  219. }
  220. }
  221. }
  222. .account-container {
  223. width: 100%;
  224. display: flex;
  225. align-items: center;
  226. justify-content: space-between;
  227. margin-top: 32upx;
  228. color: #222229;
  229. .account-item {
  230. flex: 1;
  231. display: flex;
  232. align-items: center;
  233. justify-content: center;
  234. flex-direction: column;
  235. .account-number {
  236. font-size: 42upx;
  237. font-weight: bold;
  238. }
  239. .account-title {
  240. margin-top: 10upx;
  241. font-size: 24upx;
  242. }
  243. }
  244. }
  245. }
  246. </style>