user.vue 47 KB

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