BaseInfo.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. <template>
  2. <view class="base-info-container">
  3. <view class="user-info">
  4. <Avatar
  5. margin="0 24upx 0 0"
  6. :src="$store.getters.userInfo.token ? common.seamingImgUrl($store.getters.userInfo.headImage) : require('../../../static/images/new-user/default-user-avatar.png')"
  7. @click="$store.getters.userInfo.token && go('/another-tf/another-serve/personalDetails/index')"
  8. ></Avatar>
  9. <view class="right-wrapper">
  10. <view v-if="!$store.getters.userInfo.token">
  11. <view class="logout-title">您好!</view>
  12. <view class="logout-tip">您目前暂未登录,请<text @click="go('/pages/login/login')">前往登录</text></view>
  13. </view>
  14. <view v-else class="user-info-detail" @click="go('/another-tf/another-serve/personalDetails/index')">
  15. <view style="display: flex;align-items: center;">
  16. <!-- <view style="padding: 6upx 8upx;margin-right: 12upx;font-size: 34upx;background-color: #e7e3e0;">
  17. {{ $store.getters.userInfo.memberLevelName }}
  18. </view> -->
  19. <view class="user-nack-name">
  20. {{ $store.getters.userInfo.name || $store.getters.userInfo.wechatName || '--' }}
  21. </view>
  22. </view>
  23. <view class="tags">
  24. <!-- <view>成长值</view> -->
  25. <view class="tag">
  26. <tui-icon name="star-fill" :size="22" unit="upx" color="#eaa349" margin="0 4upx 0 0"></tui-icon>
  27. No.{{ $store.getters.userInfo.buyerUserId }}
  28. <!-- {{ $store.getters.userInfo.growth || 0 }} / {{ $store.getters.userInfo.nextLevelGrowth || 0 }} -->
  29. </view>
  30. <view style="display: flex;justify-content: center;align-items: flex-end;">
  31. <image
  32. v-if="[1, 2].includes($store.getters.levelType)" style="width: 68rpx;height: 68rpx;margin: 0 5rpx;"
  33. src="../../../static/images/user/displayBadges/huiyuan.png" @click.stop="(frameType = 'relationship') && (isShowGloryFrame = true)"
  34. ></image>
  35. <image
  36. v-if="[3, 4].includes($store.getters.levelType)" style="width: 68rpx;height: 68rpx;margin: 0 5rpx;"
  37. src="../../../static/images/user/displayBadges/tuanzhang.png" @click.stop="(frameType = 'relationship') && (isShowGloryFrame = true)"
  38. >
  39. </image>
  40. <image
  41. v-if="[ 5 ].includes($store.getters.levelType)" style="width: 68rpx;height: 68rpx;margin: 0 5rpx;"
  42. src="../../../static/images/user/displayBadges/hehuoren.png" @click.stop="(frameType = 'relationship') && (isShowGloryFrame = true)"
  43. >
  44. </image>
  45. <view @click.stop="(frameType = 'shop') && (isShowGloryFrame = true)">
  46. <tui-icon
  47. v-if="$store.state.auth.identityInfo.type.includes(9)" name="shop-fill" :size="48" unit="upx"
  48. color="#ff973f" margin="0 5upx 0 0"
  49. ></tui-icon>
  50. </view>
  51. <view @click.stop="(frameType = 'merchantStaff') && (isShowGloryFrame = true)">
  52. <tui-icon
  53. v-if="$store.state.auth.identityInfo.type.includes(8)" name="shop" :size="48" unit="upx"
  54. color="#ff973f" margin="0 5upx 0 0"
  55. ></tui-icon>
  56. </view>
  57. <view @click.stop="(frameType = 'franchisee') && (isShowGloryFrame = true)">
  58. <tui-icon
  59. v-if="$store.state.auth.identityInfo.type.includes(1)" name="friendadd-fill" :size="48" unit="upx"
  60. color="#e19220" margin="0 5upx 0 0"
  61. ></tui-icon>
  62. </view>
  63. <view @click.stop="(frameType = 'agent') && (isShowGloryFrame = true)">
  64. <tui-icon
  65. v-if="$store.state.auth.identityInfo.type.includes(2)" name="wealth-fill" :size="48" unit="upx"
  66. color="#e19220" margin="0 5upx 0 0"
  67. ></tui-icon>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. <view class="op-container">
  73. <view class="wrapper" @click="go('/another-tf/another-serve/messageCenter/index')">
  74. <image src="../../../static/images/new-user/user-chat.png" mode="" />
  75. </view>
  76. <view class="wrapper" @click="go('/another-tf/another-serve/personalDetails/index')">
  77. <image src="../../../static/images/new-user/user-setting.png" mode="" />
  78. </view>
  79. </view>
  80. </view>
  81. <!-- 团长或合伙人才有 -->
  82. <!-- <view
  83. v-if="$store.getters.userInfo.token"
  84. style="text-align: center;" @click="$refs.codeCreateRef.getCode('teamMembersInvitation')"
  85. >
  86. <tui-icon name="qrcode" :size="24" color="#222229"></tui-icon>
  87. <view style="font-size: 24upx;color: #8f8d85;">
  88. <text>入驻码</text>
  89. </view>
  90. </view> -->
  91. </view>
  92. <view class="account-container">
  93. <view class="account-item" @click="go('/another-tf/another-user/platform-recharge/index')">
  94. <view class="account-number"> {{ $store.getters.pricePlatformInfo.totalPrice || 0 }} </view>
  95. <view class="account-title">钱包</view>
  96. </view>
  97. <!-- <view class="account-item" @click="go('/another-tf/another-serve/integral/index')">
  98. <view class="account-number">
  99. {{ $store.getters.userInfo.credit || 0 }}
  100. </view>
  101. <view class="account-title">积分</view>
  102. </view> -->
  103. <view class="account-item" @click="go('/another-tf/another-user/voucher/voucher')">
  104. <view class="account-number">
  105. {{ $store.getters.pricePlatformInfo.voucherPrice || 0 }}
  106. </view>
  107. <view class="account-title">代金劵</view>
  108. </view>
  109. </view>
  110. <tui-modal
  111. :show="$data._isShowTuiModel" title="提示" content="您还未登录,是否先去登录?"
  112. @click="_handleClickTuiModel($event, 'login', '/pages/user/user')"
  113. ></tui-modal>
  114. <tui-modal :show="isShow" title="提示" content="您已开通家庭小卫士" @click="handleToVip"></tui-modal>
  115. <CodeCreatePopup ref="codeCreateRef"></CodeCreatePopup>
  116. <tui-landscape
  117. :show="isShowGloryFrame" :position="1" mask mask-closable
  118. :icon-size="28" icon-color="#FFFFFF"
  119. @close="isShowGloryFrame = false"
  120. >
  121. <view style="position: relative;">
  122. <view v-if="(frameType === 'relationship') && [3, 4, 5].includes($store.getters.levelType)" class="rotation-box"></view>
  123. <view style="position: relative;max-height: 75vh;overflow-y: auto;">
  124. <image
  125. style="position: absolute;top: 180upx;left: 50%;transform: translateX(-50%);width: 174upx;height: 174upx;border-radius: 40upx;"
  126. :src="common.seamingImgUrl($store.getters.userInfo.headImage) || require('../../../static/images/new-user/default-user-avatar.png')"
  127. >
  128. </image>
  129. <image src="../../../static/images/user/displayBadges/glory-frame.png" mode="widthFix" style="width: 500upx;" />
  130. <view
  131. style="width: 304upx;margin: 4upx auto 0;padding: 18upx;color: #fff;font-weight: bold;text-align: center;vertical-align: bottom;background: linear-gradient(180deg, #feb623 0%, #e8120c 100%);border: 2upx solid #FFDBAB;border-radius: 50upx;"
  132. >
  133. <template v-if="frameType === 'relationship'">
  134. <text v-if="[1, 2].includes($store.getters.levelType)">您是普通会员</text>
  135. <text v-if="[3, 4].includes($store.getters.levelType)">恭喜你成为团长</text>
  136. <text v-if="[ 5 ].includes($store.getters.levelType)">恭喜你成为合伙人</text>
  137. </template>
  138. <template v-else-if="frameType === 'shop'">
  139. <text>您是商家</text>
  140. </template>
  141. <template v-else-if="frameType === 'merchantStaff'">
  142. <text>您是商家员工</text>
  143. </template>
  144. <template v-else-if="frameType === 'franchisee'">
  145. <text>您是加盟商</text>
  146. </template>
  147. <template v-else-if="frameType === 'agent'">
  148. <text>您是代理商</text>
  149. </template>
  150. </view>
  151. </view>
  152. </view>
  153. </tui-landscape>
  154. </view>
  155. </template>
  156. <script>
  157. import showModalMixin from 'mixin/showModal'
  158. import { convertToDecimal } from '../../../utils'
  159. export default {
  160. name: 'BaseInfo',
  161. data() {
  162. return {
  163. isShow: false,
  164. isShowGloryFrame: false,
  165. frameType: ''
  166. }
  167. },
  168. mixins: [ showModalMixin() ],
  169. mounted() {
  170. console.log(this.$store.getters.userInfo)
  171. },
  172. methods: {
  173. convertToDecimal,
  174. handleToVip(e) {
  175. if (e.index) {
  176. uni.navigateTo({ url: '/user/sever/goldButler/gold-butler' })
  177. }
  178. this.isShow = false
  179. }
  180. }
  181. }
  182. </script>
  183. <style lang="scss" scoped>
  184. .rotation-box {
  185. position: absolute;
  186. top: -45vh;
  187. left: 50%;
  188. margin-left: -60vh;
  189. display: block;
  190. width: 120vh;
  191. height: 120vh;
  192. opacity: 0.4;
  193. background: repeating-conic-gradient(from 0deg, white 0deg 19deg, transparent 15deg 53deg);
  194. mask-image: radial-gradient(rgb(0, 0, 0), rgb(0, 0, 0) 50%);
  195. animation: rotate 20s linear infinite;
  196. }
  197. @keyframes rotate {
  198. to {
  199. transform: rotate(1turn)
  200. }
  201. }
  202. .base-info-container {
  203. position: relative;
  204. // height: 400upx;
  205. background: url('../../../static/images/new-user/info-bg.png') no-repeat;
  206. background-size: cover;
  207. padding: 80upx 32upx 0upx;
  208. box-sizing: border-box;
  209. .user-info {
  210. flex: 1;
  211. display: flex;
  212. align-items: center;
  213. justify-content: space-between;
  214. .right-wrapper {
  215. flex: 1;
  216. display: flex;
  217. align-items: center;
  218. justify-content: space-between;
  219. .logout-title {
  220. font-size: 28upx;
  221. font-weight: bold;
  222. line-height: 42upx;
  223. }
  224. .logout-tip {
  225. font-size: 24upx;
  226. line-height: 36upx;
  227. margin-top: 6upx;
  228. text {
  229. color: #ffc117;
  230. }
  231. }
  232. .op-container {
  233. display: flex;
  234. align-items: center;
  235. position: absolute;
  236. top: 32upx;
  237. right: 32upx;
  238. .wrapper {
  239. display: flex;
  240. align-items: center;
  241. justify-content: center;
  242. width: 80upx;
  243. height: 80upx;
  244. border-radius: 50%;
  245. background: rgba(255, 255, 255, 0.4);
  246. box-sizing: border-box;
  247. border: 2upx solid #f1f1f0;
  248. &:nth-child(1) {
  249. margin-right: 24upx;
  250. }
  251. image {
  252. width: 48upx;
  253. height: 48upx;
  254. }
  255. }
  256. }
  257. }
  258. }
  259. .account-container {
  260. width: 100%;
  261. height: 144upx;
  262. display: flex;
  263. align-items: center;
  264. justify-content: space-between;
  265. background-color: #fff;
  266. margin-top: 48upx;
  267. border-radius: 24upx;
  268. .account-item {
  269. flex: 1;
  270. display: flex;
  271. align-items: center;
  272. justify-content: center;
  273. flex-direction: column;
  274. .account-number {
  275. font-size: 42upx;
  276. line-height: 64upx;
  277. font-weight: bold;
  278. }
  279. .account-title {
  280. color: #8f8d85;
  281. font-size: 24upx;
  282. line-height: 36upx;
  283. }
  284. }
  285. }
  286. .goldman {
  287. padding: 0 22upx;
  288. box-sizing: border-box;
  289. margin-top: 20upx;
  290. width: 100%;
  291. height: 144upx;
  292. border-radius: 24upx;
  293. background: linear-gradient(262deg, #fcd188 -4%, #ecb14c -4%, #ecb24d -4%, #fcd188 56%);
  294. display: flex;
  295. align-items: center;
  296. image {
  297. width: 56upx;
  298. height: 56upx;
  299. }
  300. .text-list {
  301. flex: 1;
  302. padding-left: 22upx;
  303. .first {
  304. font-size: 36upx;
  305. font-weight: 500;
  306. line-height: 54upx;
  307. color: #333333;
  308. }
  309. .second {
  310. font-size: 24upx;
  311. line-height: 32upx;
  312. color: #333333;
  313. }
  314. }
  315. .open {
  316. width: 152upx;
  317. height: 64upx;
  318. border-radius: 50upx;
  319. background: #402d0d;
  320. font-size: 24upx;
  321. font-weight: 500;
  322. color: #ffffff;
  323. display: flex;
  324. justify-content: center;
  325. align-items: center;
  326. }
  327. }
  328. .user-info-detail {
  329. .user-nack-name {
  330. font-size: 32upx;
  331. font-weight: bold;
  332. color: #141000;
  333. }
  334. .tags {
  335. display: flex;
  336. align-items: center;
  337. align-items: center;
  338. box-sizing: border-box;
  339. margin-top: 12upx;
  340. flex-wrap: wrap;
  341. .tag {
  342. margin-left: 12upx;
  343. box-sizing: border-box;
  344. padding: 4rpx 6rpx;
  345. display: flex;
  346. align-items: center;
  347. font-size: 24upx;
  348. color: #c4542f;
  349. height: 36upx;
  350. background: #f7d1c2;
  351. margin-right: 15rpx;
  352. border-radius: 8rpx;
  353. opacity: 1;
  354. background: linear-gradient(90deg, #ffffff 0%, #f9d090 100%);
  355. border: 1px solid #b4560a;
  356. }
  357. }
  358. }
  359. }
  360. /deep/ .avatar-container {
  361. image {
  362. border: 2upx solid #f1f1f0;
  363. background-color: #fff;
  364. box-sizing: border-box;
  365. }
  366. }
  367. </style>