user.vue 32 KB

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