user.vue 42 KB

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