user.vue 43 KB

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