user.vue 32 KB

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