user.vue 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201
  1. <template>
  2. <view class="container user clearfix">
  3. <cm-custom :navbar-data="nvabarData" v-if="isCmcustom"></cm-custom>
  4. <view class="user-section">
  5. <view
  6. class="header"
  7. :style="{
  8. height: CustomBar + 120 - StatusBar + 'px',
  9. paddingTop: CustomBar + 'px',
  10. background: 'url(https://static.caimei365.com/app/img/bg/home_cumres@2x.png)',
  11. backgroundSize: 'cover'
  12. }"
  13. >
  14. <view class="header-main" v-if="hasLogin">
  15. <view class="header-icon">
  16. <image
  17. :src="headpic ? headpic : 'https://static.caimei365.com/app/img/icon/icon-club@3x.png'"
  18. mode=""
  19. ></image>
  20. </view>
  21. <view class="header-text">
  22. <view class="user-item"
  23. ><text class="u-h1">{{ name }}</text></view
  24. >
  25. <view class="user-item">
  26. <view class="user-item-tips vip" v-if="userIdentity == 2">
  27. <image class="tips-icon" :src="userVipIcon" mode=""></image> {{ userType }}
  28. </view>
  29. <view
  30. class="user-item-tips"
  31. v-if="userIdentity == 4"
  32. :class="userVip.vipFlag == 0 ? 'none' : ''"
  33. >
  34. <image class="tips-icon" v-if="userVip.vipFlag == 1" :src="userVipIcon" mode=""></image>
  35. {{ userType }}
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="header-main-none" v-else>
  41. <view class="header-icon" @click="navigator('/pages/login/login')">
  42. <image src="https://static.caimei365.com/app/img/icon/icon-club@3x.png" mode=""></image>
  43. </view>
  44. <view class="header-text">
  45. <view class="user-item">
  46. <text class="u-h1" @click="navigatorRegirst('/pages/login/login')">账号登录/注册></text>
  47. </view>
  48. <view class="user-item">
  49. <text class="u-p" @click="navigator('/pages/login/login')"
  50. >登录采美商城更多惊喜等着您~</text
  51. >
  52. </view>
  53. <view class="user-code" @click="navigatorLoginCode('/pages/login/logincode')">邀请码登录></view>
  54. </view>
  55. </view>
  56. <!-- 我的资产 -->
  57. <view class="header-main-account">
  58. <view class="main-member">
  59. <view class="main-member-none" v-if="!hasLogin" @click.stop="navigatorMember('/pages/login/login')">
  60. <view class="main-member-none-text">开通采美·超级会员,享专属特权</view>
  61. <view class="main-member-none-btn" @click.stop="navigatorMember('/pages/login/login')">立即开通</view>
  62. </view>
  63. <template v-else>
  64. <view
  65. class="main-member-svip"
  66. v-if="userVip.vipFlag == 1"
  67. @click="navigator('/pages/user/member/member')"
  68. >
  69. <view class="main-member-svip-h1">已开通采美·超级会员</view>
  70. <view class="main-member-svip-p">有效期至:{{ userVip.time }}</view>
  71. <view class="main-member-svip-icon"> <text class="iconfont icon-xiayibu"></text> </view>
  72. </view>
  73. <view
  74. class="main-member-svip"
  75. v-if="userVip.vipFlag == -1"
  76. @click="navigator('/pages/user/member/member')"
  77. >
  78. <view class="main-member-svip-h1 red">采美·超级会员已过期</view>
  79. <view class="main-member-svip-p">有效期至:{{ userVip.time }}</view>
  80. <view class="main-member-svip-icon"> <text class="iconfont icon-xiayibu"></text> </view>
  81. </view>
  82. <view
  83. class="main-member-none"
  84. v-if="userVip.vipFlag == 0"
  85. @click="navigatorUserMember('/pages/user/member/member')"
  86. >
  87. <view class="main-member-none-text">开通采美·超级会员,享专属特权</view>
  88. <view class="main-member-none-btn">立即开通</view>
  89. </view>
  90. </template>
  91. </view>
  92. <view class="main-account">
  93. <view class="main-cell">
  94. <view
  95. class="main-account-ri-view account"
  96. @click="navigator('/pages/user/account/account')"
  97. >
  98. <view class="main-account-icon" v-if="hasLogin">{{ userMoney }}</view>
  99. <view class="main-account-icon none" v-else>-</view>
  100. <view class="main-account-text">账户余额</view>
  101. </view>
  102. <view
  103. class="main-account-ri-view beans"
  104. @click="navigator('/pages/user/account/account-bean')"
  105. >
  106. <view class="main-account-icon" v-if="hasLogin">{{
  107. userBeans ? userBeans : 0
  108. }}</view>
  109. <view class="main-account-icon none" v-else>-</view>
  110. <view class="main-account-text">采美豆</view>
  111. </view>
  112. <view
  113. class="main-account-ri-view coupon"
  114. @click="navigator('/pages/user/coupon/coupon')"
  115. >
  116. <view class="main-account-icon" v-if="hasLogin">{{
  117. couponNum ? couponNum : 0
  118. }}</view>
  119. <view class="main-account-icon none" v-else>-</view>
  120. <view class="main-account-text">优惠券</view>
  121. </view>
  122. <view
  123. class="main-account-ri-view coupon"
  124. @click="navigator('/pages/user/coupon/coupon')"
  125. >
  126. <view class="main-account-icon" v-if="hasLogin">{{
  127. couponNum ? couponNum : 0
  128. }}</view>
  129. <view class="main-account-icon none" v-else>-</view>
  130. <view class="main-account-text">银行卡</view>
  131. </view>
  132. </view>
  133. </view>
  134. </view>
  135. <!-- 订单 -->
  136. <view class="header-main-order" :style="{ marginTop: hasLogin ? '0rpx' : '0rpx' }">
  137. <view class="user-order">
  138. <view class="tab-title" @click="navigator('/pages/user/order/order-list?state=0')">
  139. <text class="cell-tit">我的订单</text> <text class="cell-more">全部订单</text>
  140. <text class="iconfont icon-xiayibu"></text>
  141. </view>
  142. <view class="order-section">
  143. <view
  144. class="order-item"
  145. @click="navigator('/pages/user/order/order-list?state=1')"
  146. hover-class="common-hover"
  147. :hover-stay-time="50"
  148. >
  149. <view class="order-icon">
  150. <image
  151. src="https://static.caimei365.com/app/img/icon/order5@3x.png"
  152. mode=""
  153. ></image>
  154. <text
  155. v-if="confirmedCount > 0 && hasLogin"
  156. class="uni-badge uni-badge-error uni-small uni-badge--small icon-num"
  157. :class="[confirmedCount < 10 ? 'goleft' : '']"
  158. >
  159. {{ confirmedCount >= 99 ? '99+' : confirmedCount }}
  160. </text>
  161. </view>
  162. <text class="order-t">待确认</text>
  163. </view>
  164. <view
  165. class="order-item"
  166. @click="navigator('/pages/user/order/order-list?state=2')"
  167. hover-class="common-hover"
  168. :hover-stay-time="50"
  169. >
  170. <view class="order-icon">
  171. <image
  172. src="https://static.caimei365.com/app/img/icon/order1@3x.png"
  173. mode=""
  174. ></image>
  175. <text
  176. v-if="paymentCount > 0 && hasLogin"
  177. class="uni-badge uni-badge-error uni-small uni-badge--small icon-num "
  178. :class="[paymentCount < 10 ? 'goleft' : '']"
  179. >
  180. {{ paymentCount >= 99 ? '99+' : paymentCount }}
  181. </text>
  182. </view>
  183. <text class="order-t">待付款</text>
  184. </view>
  185. <view
  186. class="order-item"
  187. @click="navigator('/pages/user/order/order-list?state=3')"
  188. hover-class="common-hover"
  189. :hover-stay-time="50"
  190. >
  191. <view class="order-icon">
  192. <image
  193. src="https://static.caimei365.com/app/img/icon/order2@3x.png"
  194. mode=""
  195. ></image>
  196. <text
  197. v-if="waitShipmentsCount > 0 && hasLogin"
  198. class="uni-badge uni-badge-error uni-small uni-badge--small icon-num"
  199. :class="[waitShipmentsCount < 10 ? 'goleft' : '']"
  200. >
  201. {{ waitShipmentsCount >= 99 ? '99+' : waitShipmentsCount }}
  202. </text>
  203. </view>
  204. <text class="order-t">待发货</text>
  205. </view>
  206. <view
  207. class="order-item"
  208. @click="navigator('/pages/user/order/order-list?state=4')"
  209. hover-class="common-hover"
  210. :hover-stay-time="50"
  211. >
  212. <view class="order-icon">
  213. <image
  214. src="https://static.caimei365.com/app/img/icon/order3@3x.png"
  215. mode=""
  216. ></image>
  217. <text
  218. v-if="shipmentsCount > 0 && hasLogin"
  219. class="uni-badge uni-badge-error uni-small uni-badge--small icon-num"
  220. :class="[shipmentsCount < 10 ? 'goleft' : '']"
  221. >
  222. {{ shipmentsCount >= 99 ? '99+' : shipmentsCount }}
  223. </text>
  224. </view>
  225. <text class="order-t">已发货</text>
  226. </view>
  227. <view
  228. class="order-item"
  229. @click="navigator('/pages/user/order/order-list?state=5')"
  230. hover-class="common-hover"
  231. :hover-stay-time="50"
  232. >
  233. <view class="order-icon">
  234. <image
  235. src="https://static.caimei365.com/app/img/icon/order4@3x.png"
  236. mode=""
  237. ></image>
  238. <text
  239. v-if="salesReturnCount > 0 && hasLogin"
  240. class="uni-badge uni-badge-error uni-small uni-badge--small icon-num"
  241. :class="[salesReturnCount < 10 ? 'goleft' : '']"
  242. >
  243. {{ salesReturnCount >= 99 ? '99+' : salesReturnCount }}
  244. </text>
  245. </view>
  246. <text class="order-t">退货/款</text>
  247. </view>
  248. </view>
  249. </view>
  250. </view>
  251. <!-- 底部跳转 -->
  252. <view class="header-main-listcell">
  253. <view class="list-cell-item" v-show="hasLogin">
  254. <view
  255. class="list-cell"
  256. v-show="userIdentity == 4"
  257. @click="navigatorClubUpgrade(`/pages/login/apply?clubStatus=${clubStatus}`)"
  258. hover-class="cell-hover"
  259. :hover-stay-time="50"
  260. >
  261. <view class="cell-icon">
  262. <image
  263. class="cell-icon-image"
  264. src="https://static.caimei365.com/app/img/icon/icon_club_8@2x.png"
  265. mode=""
  266. ></image>
  267. </view>
  268. <text class="cell-tit"> 升级资质机构 <text class="cell-tips">采美豆</text> </text>
  269. <text class="cell-more">
  270. <text class="txt">{{ clubStatusText(clubStatus) }}</text>
  271. <text class="iconfont icon-xiayibu"></text>
  272. </text>
  273. </view>
  274. <view
  275. class="list-cell"
  276. @click="navigator('/pages/user/regularPurchase/regularPurchase')"
  277. hover-class="cell-hover"
  278. :hover-stay-time="50"
  279. >
  280. <view class="cell-icon">
  281. <image
  282. class="cell-icon-image"
  283. src="https://static.caimei365.com/app/img/icon/icon_club_9@2x.png"
  284. mode=""
  285. ></image>
  286. </view>
  287. <text class="cell-tit">再次购买</text> <text class="cell-more iconfont icon-xiayibu"></text>
  288. </view>
  289. <view
  290. class="list-cell"
  291. @click="navigator('/pages/user/collection/collection')"
  292. hover-class="cell-hover"
  293. :hover-stay-time="50"
  294. >
  295. <view class="cell-icon">
  296. <image
  297. class="cell-icon-image"
  298. src="https://static.caimei365.com/app/img/icon/icon_club_13@2x.png"
  299. mode=""
  300. ></image>
  301. </view>
  302. <text class="cell-tit">收藏商品</text> <text class="cell-more iconfont icon-xiayibu"></text>
  303. </view>
  304. </view>
  305. <view class="list-cell-item">
  306. <view
  307. class="list-cell"
  308. v-for="(item, index) in firstList"
  309. :key="index"
  310. @click="navigator(item.path)"
  311. hover-class="cell-hover"
  312. :hover-stay-time="50"
  313. >
  314. <view class="cell-icon">
  315. <image class="cell-icon-image" :src="item.icon" mode=""></image>
  316. </view>
  317. <text class="cell-tit">
  318. {{ item.name }} <text class="cell-tips" v-if="index == 2 && isModify">采美豆</text>
  319. </text>
  320. <text class="cell-more iconfont icon-xiayibu"></text>
  321. </view>
  322. </view>
  323. <view class="list-cell-item">
  324. <view class="list-cell" hover-class="cell-hover" :hover-stay-time="50">
  325. <view class="cell-icon">
  326. <image
  327. class="cell-icon-image"
  328. src="https://static.caimei365.com/app/img/icon/icon_club_5@2x.png"
  329. mode=""
  330. ></image>
  331. </view>
  332. <text class="cell-tit cont">联系我们</text>
  333. <text class="cell-more cont" @click="toPhone">{{ contactNumber }}</text>
  334. </view>
  335. <view
  336. class="list-cell"
  337. @click="this.$api.navigateTo('/pages/user/about/about')"
  338. hover-class="cell-hover"
  339. :hover-stay-time="50"
  340. >
  341. <view class="cell-icon">
  342. <image
  343. class="cell-icon-image"
  344. src="https://static.caimei365.com/app/img/icon/icon_club_6@2x.png"
  345. mode=""
  346. ></image>
  347. </view>
  348. <text class="cell-tit">关于我们</text> <text class="cell-more iconfont icon-xiayibu"></text>
  349. </view>
  350. <view
  351. class="list-cell last"
  352. @click="this.$api.navigateTo('/pages/h5/article/page?linkType=99')"
  353. hover-class="cell-hover"
  354. :hover-stay-time="50"
  355. >
  356. <view class="cell-icon">
  357. <image
  358. class="cell-icon-image"
  359. src="https://static.caimei365.com/app/img/icon/icon_club_7@2x.png"
  360. mode=""
  361. ></image>
  362. </view>
  363. <text class="cell-tit">帮助中心</text> <text class="cell-more iconfont icon-xiayibu"></text>
  364. </view>
  365. </view>
  366. </view>
  367. <view class="header-main-last"></view>
  368. </view>
  369. </view>
  370. <!-- 采美豆提示弹窗 -->
  371. <activityBean
  372. v-if="isActivityBean"
  373. :show="isActivityBean"
  374. :beansType="beansType"
  375. :beanNumber="beanNumber"
  376. @cancel="handleBeanlClick"
  377. ></activityBean>
  378. </view>
  379. </template>
  380. <script>
  381. import activityBean from '@/components/cm-module/activity/activityBean.vue'
  382. import authorize from '@/common/config/authorize.js'
  383. import { mapState, mapMutations } from 'vuex'
  384. export default {
  385. components: {
  386. activityBean
  387. },
  388. data() {
  389. return {
  390. nvabarData: {
  391. // 顶部自定义导航
  392. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示,
  393. showSearch: 0,
  394. title: '个人中心', // 导航栏中间的标题
  395. haveBack: false,
  396. textLeft: this.$store.state.isIphone,
  397. textColor: '#333333',
  398. bgColor: ''
  399. },
  400. CustomBar: this.CustomBar, // 顶部导航栏高度
  401. StatusBar: this.StatusBar,
  402. StaticUrl: this.$Static,
  403. userId: 0,
  404. beanNumber: 50,
  405. beansType: 0,
  406. isModify: false,
  407. isActivityBean: false,
  408. isCmcustom: false,
  409. userVipIcon: '',
  410. name: '',
  411. userType: '',
  412. headpic: '',
  413. userVip: {}, // 超级会员信息
  414. userBeans: 0,
  415. userMoney: '0.00',
  416. couponNum: 0,
  417. contactNumber: '',
  418. openid: '',
  419. aboutHtml: '',
  420. telPhone: '',
  421. bindMobile: '',
  422. isSvip: false,
  423. isSvipType: 2,
  424. clubStatus: '', // 机构升级资质机构审核状态1:待审核 91:审核失败
  425. userIdentity: '', // 机构等级
  426. confirmedCount: 0, // 待确认
  427. paymentCount: 0, // 待付款角标
  428. waitShipmentsCount: 0, // 待收货角标
  429. shipmentsCount: 0, // 已发货角标
  430. salesReturnCount: '', // 退货/款角标
  431. firstList: [
  432. {
  433. name: '运营人员管理',
  434. path: '/pages/user/operator/list',
  435. icon: 'https://static.caimei365.com/app/img/icon/icon_club_1@2x.png'
  436. },
  437. {
  438. name: '收货地址管理',
  439. path: '/pages/user/address/address',
  440. icon: 'https://static.caimei365.com/app/img/icon/icon_club_2@2x.png'
  441. },
  442. {
  443. name: '机构资料',
  444. path: '/pages/login/information',
  445. icon: 'https://static.caimei365.com/app/img/icon/icon_club_3@2x.png'
  446. },
  447. {
  448. name: '账户设置',
  449. path: '/pages/user/setting/setting',
  450. icon: 'https://static.caimei365.com/app/img/icon/icon_club_4@2x.png'
  451. }
  452. ]
  453. }
  454. },
  455. onLoad(option) {},
  456. computed: {
  457. ...mapState(['hasLogin', 'userInfo', 'isWxAuthorize'])
  458. },
  459. methods: {
  460. ...mapMutations(['updateNoticeNum']),
  461. getClubObtainCenter() {
  462. // 获取个人中心数据
  463. this.UserService.GetClubObtainCenter({ userId: this.userId })
  464. .then(response => {
  465. let data = response.data
  466. this.userMoney = this.filtersMoney(data.user.ableUserMoney)
  467. this.userIdentity = data.user.userIdentity //机构等级
  468. if (this.userIdentity == 2) {
  469. this.name = data.club.name //资质机构名称
  470. this.userType = '资质机构'
  471. } else {
  472. this.name = data.user.userName //个人机构名称
  473. this.userType = '个人机构'
  474. }
  475. this.userVip = data.vip // 超级会员信息
  476. if (this.userVip.vipFlag == 1) {
  477. this.userVipIcon = this.StaticUrl + '/icon/icon-member-svip@2x.png'
  478. } else {
  479. this.userVipIcon = this.StaticUrl + '/icon/icon-member-vip@2x.png'
  480. }
  481. this.userBeans = data.user.userBeans // 采美豆数量
  482. this.headpic = data.user.image // 会所头像
  483. this.bindMobile = data.user.bindMobile // 登录手机号
  484. this.clubStatus = data.user.clubStatus // 机构审核状态
  485. this.couponNum = data.couponNum // 优惠券数量
  486. this.isModify = data.isModify // 是否显示采美豆
  487. this.contactNumber = data.contactNumber // 联系电话
  488. let clubInfo = { name: this.name, image: this.headpic, userId: data.user.userId }
  489. uni.setStorage({ key: 'clubInfo', data: clubInfo })
  490. })
  491. .catch(error => {
  492. this.$util.msg(error.msg, 2000)
  493. })
  494. },
  495. UserClubOrderCount(){
  496. //获取订单状态数量
  497. this.OrderService.UserClubOrderCount({ userId: this.userId })
  498. .then(response => {
  499. let data = response.data
  500. this.confirmedCount = this.showBadge(data.confirmedCount) //待确认
  501. this.paymentCount = this.showBadge(data.paymentCount) //待付款
  502. this.waitShipmentsCount = this.showBadge(data.waitShipmentsCount) //待收货
  503. this.shipmentsCount = this.showBadge(data.shipmentsCount) //已发货
  504. this.salesReturnCount = this.showBadge(data.salesReturnCount) //退货/款
  505. })
  506. .catch(error => {
  507. console.log('获取订单状态数量异常~')
  508. })
  509. },
  510. GetInitBeansInfo() {
  511. //初始化采美豆信息
  512. this.UserService.GetHomeObtainBeans({ userId: this.userId })
  513. .then(response => {
  514. this.beansType = response.data.beansType
  515. this.beanNumber = response.data.num
  516. this.isActivityBean = true
  517. })
  518. .catch(error => {
  519. console.log('用户暂无采美豆推送~')
  520. })
  521. },
  522. getPhone() {
  523. // 获取联系我们电话
  524. this.CommonService.QueryAfterSale()
  525. .then(response => {
  526. this.contactNumber = response.data.contactNumber
  527. })
  528. .catch(error => {
  529. this.$util.msg(error.msg, 2000)
  530. })
  531. },
  532. toPhone() {
  533. // 拨号
  534. uni.makePhoneCall({
  535. phoneNumber: this.contactNumber //仅为示例
  536. })
  537. },
  538. filtersMoney(param) {
  539. let moneyText
  540. if (param == 0) {
  541. moneyText = '0.00'
  542. } else {
  543. let i = param.toString().lastIndexOf('.')
  544. let money
  545. if (i == -1) {
  546. money = this.$api.FormatMoney(param) //会所剩余余额
  547. moneyText = money + '.00'
  548. } else {
  549. money = this.$api.FormatMoney(param) //会所剩余余额
  550. moneyText = money
  551. }
  552. }
  553. console.log('moneyText', moneyText)
  554. return moneyText
  555. },
  556. handleBeanlClick() {
  557. //关闭采美豆弹窗
  558. this.isActivityBean = false
  559. },
  560. navigator(url) {
  561. if (this.hasLogin) {
  562. this.$api.navigateTo(url)
  563. } else {
  564. this.$api.navigateTo('/pages/login/login?type=0')
  565. }
  566. },
  567. navigatorRegirst(url) {
  568. if (!this.hasLogin) {
  569. // 友盟埋点注册入口点击事件
  570. if (process.env.NODE_ENV != 'development') {
  571. this.$uma.trackEvent('Um_Event_totalLoginAndRegister', {
  572. Um_Key_PageName: '登录注册统一入口',
  573. Um_Key_SourcePage: '个人中心'
  574. })
  575. }
  576. this.$api.navigateTo(url)
  577. }
  578. },
  579. navigatorClubUpgrade(url) {
  580. // 友盟埋点个人机构升级点击事件
  581. if (process.env.NODE_ENV != 'development') {
  582. this.$uma.trackEvent('Um_Event_ClubUpgrade', {
  583. Um_Key_ClubName: `${this.name}`,
  584. Um_Key_PageName: '个人机构升级入口',
  585. Um_Key_SourcePage: '个人中心'
  586. })
  587. }
  588. this.$api.navigateTo(url)
  589. },
  590. navigatorLoginCode(url) {
  591. // 友盟埋点个人机构升级点击事件
  592. if (process.env.NODE_ENV != 'development') {
  593. this.$uma.trackEvent('Um_Event_LoginCodeBtn', {
  594. Um_Key_ClubName: this.getNowTime(),
  595. Um_Key_PageName: '邀请码登录',
  596. Um_Key_SourcePage: '个人中心'
  597. })
  598. }
  599. this.$api.navigateTo(url)
  600. },
  601. navigatorMember(url) {
  602. // 友盟埋点游客立即开通点击事件
  603. if (process.env.NODE_ENV != 'development') {
  604. this.$uma.trackEvent('Um_Event_userVisitorMember', {
  605. Um_Key_Time: this.getNowTime(),
  606. Um_Key_PageName: '游客立即开通',
  607. Um_Key_SourcePage: '个人中心'
  608. })
  609. }
  610. this.$api.navigateTo(url)
  611. },
  612. navigatorUserMember(url) {
  613. // 友盟埋点机构立即开通点击事件
  614. if (process.env.NODE_ENV != 'development') {
  615. this.$uma.trackEvent('Um_Event_userClubMember', {
  616. Um_Key_Time: `${this.name}`,
  617. Um_Key_PageName: '机构立即开通',
  618. Um_Key_SourcePage: '个人中心'
  619. })
  620. }
  621. this.$api.navigateTo(url)
  622. },
  623. getNowTime () {
  624. let dateTime
  625. let yy = new Date().getFullYear()
  626. let mm = new Date().getMonth() + 1
  627. let dd = new Date().getDate()
  628. let hh = new Date().getHours()
  629. let mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes()
  630. :
  631. new Date().getMinutes()
  632. let ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds()
  633. :
  634. new Date().getSeconds()
  635. dateTime = yy + '-' + mm + '-' + dd + ' ' + hh + ':' + mf + ':' + ss
  636. console.log(dateTime)
  637. return dateTime
  638. },
  639. navigatorNex(url) {
  640. if (!this.hasLogin) {
  641. this.$api.navigateTo(url)
  642. }
  643. },
  644. showBadge(n) {
  645. let num = ''
  646. if (n > 100) {
  647. num = 99
  648. } else {
  649. num = n
  650. }
  651. return num
  652. },
  653. clubStatusText(state) {
  654. let stateText
  655. switch (state) {
  656. case 90:
  657. stateText = ''
  658. break
  659. case 1:
  660. stateText = '正在审核中'
  661. break
  662. case 92:
  663. stateText = '审核不通过'
  664. break
  665. }
  666. return stateText
  667. },
  668. async initUserData(){
  669. const userInfo = await this.$api.getComStorage('userInfo')
  670. this.userId = userInfo.userId ? userInfo.userId : 0
  671. this.getClubObtainCenter()
  672. this.UserClubOrderCount()
  673. this.GetInitBeansInfo()
  674. this.updateNoticeNum()
  675. }
  676. },
  677. onPageScroll(e) {
  678. //实时获取到滚动的值
  679. if (e.scrollTop > 20) {
  680. this.isCmcustom = true
  681. this.nvabarData.bgColor = '#FFFFFF'
  682. this.nvabarData.textColor = '#333333'
  683. } else {
  684. this.isCmcustom = false
  685. this.nvabarData.bgColor = ''
  686. this.nvabarData.textColor = '#FFFFFF'
  687. }
  688. },
  689. onPullDownRefresh() {
  690. //下拉刷新
  691. if (this.hasLogin) {
  692. this.getClubObtainCenter()
  693. this.UserClubOrderCount()
  694. uni.stopPullDownRefresh()
  695. } else {
  696. uni.stopPullDownRefresh()
  697. }
  698. },
  699. onShow() {
  700. if (this.hasLogin) {
  701. this.initUserData()
  702. } else {
  703. this.getPhone()
  704. this.$store.commit('updateAllNum', 0)
  705. }
  706. }
  707. }
  708. </script>
  709. <style lang="scss">
  710. @import '@/uni.scss';
  711. page {
  712. background-color: #f7f7f7;
  713. }
  714. .user {
  715. width: 100%;
  716. height: 100%;
  717. position: relative;
  718. background: rgba(247, 247, 247, 1);
  719. }
  720. .header {
  721. width: 100%;
  722. position: relative;
  723. background-size: cover;
  724. }
  725. .header-main {
  726. width: 702rpx;
  727. height: 130rpx;
  728. padding: 12rpx 24rpx;
  729. display: flex;
  730. .header-text {
  731. flex: 8;
  732. display: flex;
  733. flex-direction: column;
  734. box-sizing: border-box;
  735. padding: 10rpx 0 0 20rpx;
  736. .user-item {
  737. flex: 1;
  738. height: 64rpx;
  739. line-height: 64rpx;
  740. .user-item-tips {
  741. display: inline-block;
  742. float: left;
  743. width: 140rpx;
  744. height: 34rpx;
  745. background: #e7eaef;
  746. border-radius: 20rpx;
  747. line-height: 34rpx;
  748. font-size: $font-size-22;
  749. text-align: center;
  750. color: #627386;
  751. box-sizing: border-box;
  752. padding: 0 11rpx 0 41rpx;
  753. position: relative;
  754. &.none {
  755. width: 120rpx;
  756. padding: 0 11rpx 0 11rpx;
  757. }
  758. &.vip {
  759. background: #fff2d5;
  760. color: #e4aa43;
  761. }
  762. .tips-icon {
  763. width: 34rpx;
  764. height: 34rpx;
  765. display: block;
  766. position: absolute;
  767. left: 0;
  768. top: 0;
  769. }
  770. }
  771. .u-h1 {
  772. width: 400rpx;
  773. float: left;
  774. font-size: $font-size-30;
  775. color: #ffffff;
  776. text-align: left;
  777. -o-text-overflow: ellipsis;
  778. text-overflow: ellipsis;
  779. display: -webkit-box;
  780. word-break: break-all;
  781. -webkit-box-orient: vertical;
  782. -webkit-line-clamp: 1;
  783. overflow: hidden;
  784. }
  785. .u-p {
  786. font-size: $font-size-24;
  787. line-height: 30rpx;
  788. color: #ffffff;
  789. text-align: left;
  790. }
  791. }
  792. }
  793. .header-icon {
  794. flex: 2;
  795. image {
  796. float: right;
  797. width: 128rpx;
  798. height: 128rpx;
  799. border-radius: 100%;
  800. border: 2rpx solid #ffffff;
  801. }
  802. }
  803. }
  804. .header-main-none {
  805. width: 702rpx;
  806. height: 152rpx;
  807. padding: 0 24rpx;
  808. display: flex;
  809. .header-text {
  810. flex: 8;
  811. display: flex;
  812. flex-direction: column;
  813. position: relative;
  814. box-sizing: border-box;
  815. padding: 20rpx 0;
  816. .user-code {
  817. width: 193rpx;
  818. height: 56rpx;
  819. background: rgba(255, 255, 255, 0.2);
  820. color: #ffffff;
  821. line-height: 56rpx;
  822. font-size: $font-size-26;
  823. padding: 0 20rpx 0 23rpx;
  824. box-sizing: border-box;
  825. border-radius: 28rpx 0 0 28rpx;
  826. position: absolute;
  827. right: -24rpx;
  828. top: 46rpx;
  829. }
  830. .user-item {
  831. flex: 1;
  832. height: 50rpx;
  833. line-height: 50rpx;
  834. .line {
  835. margin: 0 10rpx;
  836. }
  837. .u-h1 {
  838. float: left;
  839. font-size: $font-size-28;
  840. color: #ffffff;
  841. text-align: left;
  842. -o-text-overflow: ellipsis;
  843. text-overflow: ellipsis;
  844. display: -webkit-box;
  845. word-break: break-all;
  846. -webkit-box-orient: vertical;
  847. -webkit-line-clamp: 1;
  848. overflow: hidden;
  849. }
  850. .u-p {
  851. font-size: $font-size-24;
  852. line-height: 50rpx;
  853. color: #ffffff;
  854. text-align: left;
  855. }
  856. }
  857. }
  858. .header-icon {
  859. flex: 2;
  860. display: flex;
  861. margin-right: 20rpx;
  862. align-items: center;
  863. justify-content: center;
  864. image {
  865. float: right;
  866. width: 128rpx;
  867. height: 128rpx;
  868. border-radius: 100%;
  869. border: 2rpx solid #ffffff;
  870. }
  871. }
  872. }
  873. .header-main-account {
  874. width: 100%;
  875. height: 310rpx;
  876. box-sizing: border-box;
  877. padding: 24rpx 44.5rpx;
  878. position: relative;
  879. .main-member {
  880. width: 100%;
  881. height: 168rpx;
  882. background: url(https://static.caimei365.com/app/img/icon/icon-member-user@2x.png) no-repeat;
  883. background-size: cover;
  884. border-radius: 20rpx;
  885. box-sizing: border-box;
  886. padding: 5rpx 24rpx 75rpx 104rpx;
  887. .main-member-none {
  888. width: 100%;
  889. height: 88rpx;
  890. box-sizing: border-box;
  891. padding: 28rpx 0 20rpx 0;
  892. line-height: 40rpx;
  893. .main-member-none-text {
  894. font-size: $font-size-26;
  895. color: #f0cb72;
  896. float: left;
  897. }
  898. .main-member-none-btn {
  899. width: 128rpx;
  900. height: 40rpx;
  901. background: linear-gradient(270deg, #fee9ba 0%, #f0cb72 100%);
  902. border-radius: 24rpx;
  903. line-height: 40rpx;
  904. text-align: center;
  905. font-size: $font-size-24;
  906. color: #333333;
  907. float: right;
  908. }
  909. }
  910. .main-member-svip {
  911. width: 100%;
  912. height: 88rpx;
  913. box-sizing: border-box;
  914. padding: 12rpx 0 9rpx 0;
  915. position: relative;
  916. .main-member-svip-h1 {
  917. width: 100%;
  918. height: 37rpx;
  919. line-height: 37rpx;
  920. color: #f0cb72;
  921. text-align: left;
  922. font-size: $font-size-26;
  923. &.red {
  924. color: #ff2a2a;
  925. }
  926. }
  927. .main-member-svip-p {
  928. width: 100%;
  929. height: 28rpx;
  930. line-height: 28rpx;
  931. color: #bcbcbc;
  932. text-align: left;
  933. font-size: $font-size-20;
  934. }
  935. .main-member-svip-icon {
  936. width: 88rpx;
  937. height: 88rpx;
  938. position: absolute;
  939. right: 0;
  940. top: 0;
  941. line-height: 88rpx;
  942. text-align: right;
  943. .iconfont {
  944. font-size: 30rpx;
  945. color: #f0cb72;
  946. }
  947. }
  948. }
  949. }
  950. .main-account {
  951. width: 100%;
  952. height: 168rpx;
  953. position: absolute;
  954. top: 118rpx;
  955. left: 0;
  956. box-sizing: border-box;
  957. padding: 0 24rpx;
  958. .main-cell {
  959. width: 100%;
  960. height: 168rpx;
  961. background-color: $bg-color;
  962. border-radius: 20rpx;
  963. box-sizing: border-box;
  964. padding: 24rpx 0;
  965. .main-account-ri-view {
  966. height: 100%;
  967. width: 25%;
  968. float: left;
  969. .main-account-icon {
  970. width: 100%;
  971. height: 74rpx;
  972. line-height: 74rpx;
  973. text-align: center;
  974. font-size: $font-size-30;
  975. color: #f94b4b;
  976. &.none {
  977. color: #333333;
  978. font: $font-size-36;
  979. font-weight: normal;
  980. }
  981. }
  982. .main-account-text {
  983. width: 100%;
  984. height: 44rpx;
  985. line-height: 44rpx;
  986. font-size: $font-size-28;
  987. text-align: center;
  988. color: #333333;
  989. }
  990. }
  991. }
  992. }
  993. }
  994. .header-main-order {
  995. width: 100%;
  996. height: auto;
  997. box-sizing: border-box;
  998. padding: 0 24rpx;
  999. margin-top: 26rpx;
  1000. .user-order {
  1001. width: 100%;
  1002. height: auto;
  1003. background-color: $bg-color;
  1004. margin-bottom: 24rpx;
  1005. border-radius: 20rpx;
  1006. box-sizing: border-box;
  1007. padding: 0 24rpx;
  1008. }
  1009. }
  1010. .tab-title {
  1011. font-size: $font-size-28;
  1012. line-height: 80rpx;
  1013. color: #333333;
  1014. text-align: left;
  1015. border-bottom: 1px solid #f8f8f8;
  1016. position: relative;
  1017. .cell-tit {
  1018. font-size: $font-size-28;
  1019. color: $text-color;
  1020. }
  1021. .cell-more {
  1022. float: right;
  1023. line-height: 80rpx;
  1024. font-size: $font-size-24;
  1025. color: $text-color;
  1026. padding-right: 30rpx;
  1027. }
  1028. .iconfont {
  1029. width: 30rpx;
  1030. height: 80rpx;
  1031. line-height: 80rpx;
  1032. text-align: center;
  1033. position: absolute;
  1034. right: 0;
  1035. top: 0;
  1036. display: block;
  1037. font-size: $font-size-28;
  1038. }
  1039. }
  1040. .order-section {
  1041. display: flex;
  1042. justify-content: space-around;
  1043. align-items: center;
  1044. flex-wrap: wrap;
  1045. height: 99rpx;
  1046. padding: 24rpx 0;
  1047. }
  1048. .order-item {
  1049. flex: 1;
  1050. display: flex;
  1051. flex-direction: column;
  1052. align-items: center;
  1053. position: relative;
  1054. &:last-child {
  1055. margin-right: 0;
  1056. }
  1057. .order-icon {
  1058. width: 52rpx;
  1059. height: 52rpx;
  1060. position: relative;
  1061. image {
  1062. width: 52rpx;
  1063. height: 52rpx;
  1064. }
  1065. .icon-num {
  1066. position: absolute;
  1067. right: -24rpx;
  1068. top: -9rpx;
  1069. }
  1070. .icon-num.goleft {
  1071. right: -12rpx;
  1072. }
  1073. }
  1074. .order-t {
  1075. line-height: 50rpx;
  1076. font-size: $font-size-24;
  1077. color: $text-color;
  1078. }
  1079. }
  1080. .header-main-last {
  1081. width: 100%;
  1082. height: 20rpx;
  1083. float: left;
  1084. box-sizing: border-box;
  1085. }
  1086. .header-main-listcell {
  1087. width: 100%;
  1088. height: auto;
  1089. box-sizing: border-box;
  1090. padding: 0 24rpx;
  1091. margin-bottom: 60rpx;
  1092. }
  1093. .list-cell-item {
  1094. width: 654rpx;
  1095. height: auto;
  1096. margin-bottom: 24rpx;
  1097. padding: 0 24rpx;
  1098. background: $bg-color;
  1099. border-radius: 20rpx;
  1100. }
  1101. .list-cell {
  1102. width: 100%;
  1103. line-height: 100rpx;
  1104. position: relative;
  1105. background: $bg-color;
  1106. border-bottom: 1px solid #ebebeb;
  1107. height: 100rpx;
  1108. &:last-child {
  1109. border-bottom: none;
  1110. }
  1111. &.cell-hover {
  1112. background: #fafafa;
  1113. }
  1114. .cell-icon {
  1115. width: 60rpx;
  1116. height: 100rpx;
  1117. text-align: center;
  1118. box-sizing: border-box;
  1119. padding: 32rpx 12rpx;
  1120. float: left;
  1121. .cell-icon-image {
  1122. width: 36rpx;
  1123. height: 36rpx;
  1124. display: block;
  1125. }
  1126. }
  1127. .cell-more {
  1128. height: 100rpx;
  1129. line-height: 100rpx;
  1130. text-align: right;
  1131. position: absolute;
  1132. right: 0;
  1133. top: 0;
  1134. font-size: $font-size-28;
  1135. color: #666666;
  1136. &.cont {
  1137. width: 250rpx;
  1138. }
  1139. .txt {
  1140. color: #fb4343;
  1141. padding-right: 10rpx;
  1142. }
  1143. }
  1144. .cell-tit {
  1145. width: 465rpx;
  1146. display: block;
  1147. float: left;
  1148. font-size: $font-size-28;
  1149. color: #666666;
  1150. margin-right: 10rpx;
  1151. &.cont {
  1152. width: 300rpx;
  1153. }
  1154. .cell-tips {
  1155. width: 74rpx;
  1156. height: 32rpx;
  1157. line-height: 32rpx;
  1158. padding: 0 7rpx;
  1159. border-radius: 16rpx;
  1160. background-color: #ffe6dc;
  1161. color: $color-system;
  1162. text-align: center;
  1163. font-size: $font-size-20;
  1164. margin-left: 8rpx;
  1165. }
  1166. }
  1167. .cell-tip {
  1168. font-size: $font-size-28;
  1169. color: $text-color;
  1170. }
  1171. }
  1172. .list-cell.last {
  1173. border-bottom: none;
  1174. }
  1175. .uni-badge--small {
  1176. -webkit-transform: scale(0.8);
  1177. -ms-transform: scale(0.8);
  1178. transform: scale(0.8);
  1179. -webkit-transform-origin: center center;
  1180. -ms-transform-origin: center center;
  1181. transform-origin: center center;
  1182. }
  1183. .uni-badge {
  1184. font-family: 'Helvetica Neue', Helvetica, sans-serif;
  1185. -webkit-box-sizing: border-box;
  1186. box-sizing: border-box;
  1187. font-size: 12px;
  1188. line-height: 1;
  1189. display: inline-block;
  1190. padding: 3px 6px;
  1191. color: #333;
  1192. border-radius: 100px;
  1193. background-color: #f1f1f1;
  1194. }
  1195. .uni-badge-error {
  1196. color: #fff;
  1197. background-color: #dd524d;
  1198. }
  1199. </style>