user.vue 32 KB

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