user.vue 32 KB

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