user.vue 31 KB

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