user.vue 30 KB

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