user.vue 47 KB

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