user.vue 43 KB

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