user.vue 30 KB

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