member.vue 28 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085
  1. <template>
  2. <view class="container clearfix">
  3. <view class="cm-member-top">
  4. <view
  5. class="cm-member-cel"
  6. v-if="userVip.vipFlag == 1 || userVip.vipFlag == -1"
  7. @click="hanldPayUrl('/pages/user/member/member-record')"
  8. >购买记录</view
  9. >
  10. <view class="cm-member-head">
  11. <view class="cm-member-text" v-if="isRequest">
  12. <view class="cm-member-h1">
  13. <text v-if="userVip.vipFlag == 0">采美·超级会员</text>
  14. <text v-if="userVip.vipFlag == 1">已开通采美·超级会员</text>
  15. <text v-if="userVip.vipFlag == -1">采美·超级会员已过期</text>
  16. </view>
  17. <view class="cm-member-p">
  18. <text v-if="userVip.vipFlag == 0">享专属特权</text>
  19. <text v-else>有效期至:{{ userVip.time }}</text>
  20. </view>
  21. </view>
  22. <view class="cm-member-btn" v-if="userVip.vipFlag == 1 || userVip.vipFlag == -1">
  23. <view class="btn" @click="hanldPayUrl('/pages/user/member/member-renew')">续费</view>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="cm-member-main" v-if="userVip.vipFlag == 0 || userVip.vipFlag == -1">
  28. <view class="title">超级会员套餐</view>
  29. <view class="cm-member-pay">
  30. <view
  31. class="pay-item"
  32. v-for="(pay, index) in payList"
  33. :key="index"
  34. :class="{ current: tabCurrent === index }"
  35. @click="handleCheckedPay(index, pay)"
  36. >
  37. <view class="hot" v-if="index == 0">推荐</view> <view class="text-1">{{ pay.duration }}个月</view>
  38. <view class="text-2"> <text>¥</text>{{ pay.price }}</view>
  39. <view class="text-3" v-if="index == 0 || index == 1">{{ pay.price / pay.duration }}元/月</view>
  40. </view>
  41. </view>
  42. <view class="cm-member-button" v-if="!popupShow">
  43. <view class="pay-btn pay" @click="hanldWechatPay">立即支付{{ handelPayMsg.price }}元开通</view>
  44. <view class="pay-btn none" @click="hanldeShowBeans">或抵扣{{ handelPayMsg.beans }}个采美豆开通</view>
  45. </view>
  46. </view>
  47. <view class="cm-member-main">
  48. <view class="title">专属特权</view>
  49. <view class="cm-member-privilege clearfix">
  50. <view class="privilege-item" v-for="(priv, index) in privilegeList" :key="index">
  51. <image class="image" :src="priv.icon" mode=""></image>
  52. <view class="text-2">{{ priv.privText }}</view> <view class="text-3">{{ priv.privName }}</view>
  53. </view>
  54. </view>
  55. </view>
  56. <view class="cm-member-main" v-if="productCouponList.length > 0">
  57. <view class="title">专属优惠券<text class="small">每月可领4个</text></view>
  58. <view class="cm-member-coupon clearfix">
  59. <view
  60. v-for="(coupon, index) in productCouponList"
  61. :key="index"
  62. :id="coupon.couponId"
  63. class="coupon-list"
  64. :class="coupon.useStatus == 2 ? 'none' : ''"
  65. >
  66. <view class="list-cell-tags">{{ coupon.couponType | TypeFormat }}</view>
  67. <view class="list-cell-le">
  68. <view class="coupon-maxMoney"><text class="small">¥</text>{{ coupon.couponAmount }}</view>
  69. <view class="coupon-minMoney">满{{ coupon.touchPrice }}可用</view>
  70. <view class="coupon-texts">
  71. <text v-if="coupon.couponType == 0">
  72. {{
  73. coupon.productType && coupon.productType == 1
  74. ? '全商城商品通用'
  75. : '仅可购买指定商品'
  76. }}
  77. </text>
  78. <text v-if="coupon.couponType == 1">
  79. {{ coupon.categoryType == 1 ? '仅限购买产品类商品' : '仅限购买仪器类商品' }}
  80. </text>
  81. <text v-if="coupon.couponType == 3">仅限购买店铺【...】</text>
  82. <text v-if="coupon.couponType == 4 || coupon.couponType == 2">全商城商品通用</text>
  83. </view>
  84. </view>
  85. <view class="list-cell-ri">
  86. <template v-if="coupon.useStatus == 2">
  87. <view class="icon-used-btn make">已使用</view>
  88. </template>
  89. <template v-else>
  90. <view
  91. class="icon-used-btn receive"
  92. v-if="coupon.getFlag == 0"
  93. @click="receiveCoupon(coupon)"
  94. >立即领取</view
  95. >
  96. <view class="icon-used-btn make" v-if="coupon.getFlag == 1" @click="toUseCoupon(coupon)">
  97. 去使用</view
  98. >
  99. </template>
  100. </view>
  101. </view>
  102. </view>
  103. </view>
  104. <view class="cm-member-main none" :style="{ paddingBottom: popupShow ? '260rpx' : '0rpx' }">
  105. <view class="title">
  106. 优惠商品
  107. <view class="more" @click="hanldPayUrl('/pages/user/member/member-product')"
  108. >更多<text class="iconfont icon-xiayibu"></text
  109. ></view>
  110. </view>
  111. <view class="cm-member-product clearfix">
  112. <view
  113. v-for="(pro, index) in productList"
  114. :key="index"
  115. :id="pro.productId"
  116. class="product-list"
  117. @click="productDetail(pro.productId)"
  118. >
  119. <view class="product-image"> <image :src="pro.image" mode=""></image> </view>
  120. <view class="product-mains">
  121. <view class="product-name"> {{ pro.name }} </view>
  122. <view class="product-tags">
  123. <view class="floor-item-act">
  124. <view class="coupon-tags" v-if="pro.couponsLogo">优惠券</view>
  125. <template v-if="pro.actStatus == 1">
  126. <view class="floor-tags" v-if="PromotionsFormat(pro.promotions)">
  127. {{ pro.promotions.name }}
  128. <text v-if="pro.priceFlag != 1">:¥{{ pro.price | NumFormat }}</text>
  129. </view>
  130. <view class="floor-tags" v-else>{{ pro.promotions.name }}</view>
  131. </template>
  132. <template v-if="pro.svipProductFlag == 1">
  133. <view class="svip-tags">
  134. <view class="tags" :class="{ none: !isShowVipFlag }">SVIP</view>
  135. <view class="price" v-if="isShowVipFlag(pro)">{{ pro.svipPriceTag }}</view>
  136. </view>
  137. </template>
  138. </view>
  139. </view>
  140. <view class="product-price">
  141. <!-- 价格未公开 -->
  142. <view class="list-none" v-if="pro.priceFlag == 1">¥未公开价格</view>
  143. <!-- 价格公开 -->
  144. <template v-else>
  145. <!-- 个人机构且不是超级会员 -->
  146. <template v-if="userIdentity == 4 && userVip.vipFlag != 1">
  147. <!-- 价格仅会员可见 -->
  148. <view class="list-none" v-if="pro.priceFlag == 2"
  149. >¥价格仅会员可见</view
  150. >
  151. <!-- 价格仅医美机构可见 -->
  152. <view class="list-none" v-else-if="pro.priceFlag == 3"
  153. >¥仅医美机构可见</view
  154. >
  155. <view class="list-none-price" v-else>¥{{ pro.originalPrice | NumFormat }}</view>
  156. </template>
  157. <!-- 资质机构 || 个人机构且是超级会员 -->
  158. <template v-else>
  159. <!-- 价格仅医美机构可见 -->
  160. <view class="list-none" v-if="pro.priceFlag == 3 && firstClubType!=1"
  161. >¥仅医美机构可见</view
  162. >
  163. <view class="list-none-price" v-else>¥{{ pro.originalPrice | NumFormat }}</view>
  164. </template>
  165. </template>
  166. </view>
  167. </view>
  168. </view>
  169. </view>
  170. </view>
  171. <!-- 透明模态层 -->
  172. <modal-layer v-if="isModallayer"></modal-layer>
  173. <!-- 弹窗 -->
  174. <template>
  175. <view class="cm-model-alert" v-if="isShowBeansModal">
  176. <view class="content">
  177. <view class="title">
  178. <text>购买超级会员</text>
  179. <text class="iconfont icon-iconfontguanbi" @click.stop="handelCanelBeans"></text>
  180. </view>
  181. <view class="text-content">
  182. <view class="text"
  183. >确定使用<text class="text-p">{{ handelPayMsg.beans }}</text
  184. >个采美豆抵扣{{ handelPayMsg.duration }}个月的采美超级会员吗?</view
  185. >
  186. </view>
  187. <view class="text-button">
  188. <view class="btn btn-cancel" @click="handelCanelBeans">取消</view>
  189. <view class="btn btn-confirm" @click="handelConfirmBeans">确定</view>
  190. </view>
  191. </view>
  192. </view>
  193. </template>
  194. <!-- 悬浮按钮 -->
  195. <tui-bottom-popup :radius="false" :mask="false" :show="popupShow">
  196. <view class="tui-popup-box clearfix" :style="{ paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">
  197. <view class="cm-member-button">
  198. <view class="pay-btn pay" @click="hanldWechatPay">立即支付{{ handelPayMsg.price }}元开通</view>
  199. <view class="pay-btn none" @click="hanldeShowBeans"
  200. >或抵扣{{ handelPayMsg.beans }}个采美豆开通</view
  201. >
  202. </view>
  203. </view>
  204. </tui-bottom-popup>
  205. </view>
  206. </template>
  207. <script>
  208. import { mapState, mapMutations } from 'vuex'
  209. import modalLayer from '@/components/modal-layer'
  210. import wxLogin from '@/common/config/wxLogin.js'
  211. export default {
  212. components: {
  213. modalLayer
  214. },
  215. data() {
  216. return {
  217. StaticUrl: this.$Static,
  218. isIphoneX: this.$store.state.isIphoneX,
  219. isRequest: false,
  220. isModallayer: false,
  221. isShowBeansModal: false,
  222. popupShow: false,
  223. memberType: 0,
  224. tabCurrent: 0,
  225. userIdentity: 0,
  226. firstClubType:0,
  227. userVip: {},
  228. handelPayMsg: {
  229. beans: 0,
  230. price: 0,
  231. month: '',
  232. packageId: 0
  233. },
  234. payParam: {
  235. userId: 0,
  236. packageId: 0
  237. },
  238. payList: [],
  239. privilegeList: [
  240. {
  241. icon: 'https://static.caimei365.com/app/img/icon/icon-member-prer1@2x.png',
  242. privText: '优惠商品',
  243. privName: '超级会员专享'
  244. },
  245. {
  246. icon: 'https://static.caimei365.com/app/img/icon/icon-member-prer2@2x.png',
  247. privText: '专属优惠券',
  248. privName: '超级会员专享'
  249. },
  250. {
  251. icon: 'https://static.caimei365.com/app/img/icon/icon-member-prer8@2x.png',
  252. privText: '免运费',
  253. privName: '下单全包邮'
  254. },
  255. {
  256. icon: 'https://static.caimei365.com/app/img/icon/icon-member-prer3@2x.png',
  257. privText: '采美豆翻倍',
  258. privName: '下单返采美豆'
  259. },
  260. {
  261. icon: 'https://static.caimei365.com/app/img/icon/icon-member-prer4@2x.png',
  262. privText: '专属客服',
  263. privName: '一对一'
  264. },
  265. {
  266. icon: 'https://static.caimei365.com/app/img/icon/icon-member-prer5@2x.png',
  267. privText: '专属销售顾问',
  268. privName: '一对一'
  269. },
  270. {
  271. icon: 'https://static.caimei365.com/app/img/icon/icon-member-prer6@2x.png',
  272. privText: '快速发货',
  273. privName: '会员加速'
  274. },
  275. {
  276. icon: 'https://static.caimei365.com/app/img/icon/icon-member-prer7@2x.png',
  277. privText: '售后服务',
  278. privName: '会员加速'
  279. }
  280. ],
  281. listQuery: {
  282. userId: 0,
  283. source: 1,
  284. pageNum: 1,
  285. pageSize: 4
  286. },
  287. productCouponList: [],
  288. productList: [],
  289. isReceiveLoading: false
  290. }
  291. },
  292. onLoad() {
  293. wxLogin.wxLoginAuthorize()
  294. this.getUserSuperPackage()
  295. },
  296. filters: {
  297. TypeFormat(value) {
  298. switch (value) {
  299. case 0:
  300. return '活动券'
  301. break
  302. case 1:
  303. return '品类券'
  304. break
  305. case 2:
  306. return '用户专享券'
  307. break
  308. case 3:
  309. return '店铺券'
  310. break
  311. case 4:
  312. return '新用户券'
  313. break
  314. }
  315. },
  316. NumFormat(value) {
  317. //处理金额
  318. return Number(value).toFixed(2)
  319. }
  320. },
  321. computed: {
  322. ...mapState(['hasLogin','clubType'])
  323. },
  324. methods: {
  325. async initGetStotage() {
  326. const userInfo = await this.$api.getStorage()
  327. this.payParam.userId = this.listQuery.userId = userInfo.userId ? userInfo.userId : 0
  328. this.userIdentity = userInfo.userIdentity ? userInfo.userIdentity : 0
  329. this.firstClubType = this.clubType
  330. this.getUserSuperCenter()
  331. this.getSvipProductPage()
  332. },
  333. getUserSuperCenter() {
  334. // 获取会员中心数据
  335. this.UserService.getUserSuperCenter({ userId: this.payParam.userId })
  336. .then(response => {
  337. let data = response.data
  338. this.userVip = data.vip
  339. this.productCouponList = data.coupon
  340. console.log('this.productCouponList', this.productCouponList)
  341. this.isRequest = true
  342. })
  343. .catch(error => {
  344. this.$util.msg(error.msg, 2000)
  345. })
  346. },
  347. getSvipProductPage() {
  348. // 获取会员中心商品数据
  349. this.ProductService.getSvipProductPage(this.listQuery)
  350. .then(response => {
  351. let data = response.data.svipProductPage
  352. this.productList = data.results
  353. })
  354. .catch(error => {
  355. this.$util.msg(error.msg, 2000)
  356. })
  357. },
  358. getUserSuperPackage() {
  359. //获取会员中心套餐
  360. this.UserService.getUserSuperPackage()
  361. .then(response => {
  362. let data = response.data
  363. data.forEach(el => {
  364. el.beans = el.price * el.proportion
  365. el.packageId = el.id
  366. })
  367. this.payList = data
  368. this.handelPayMsg = data[0]
  369. this.payParam.packageId = data[0].packageId
  370. })
  371. .catch(error => {
  372. console.log('获取会员套餐异常~')
  373. })
  374. },
  375. receiveCoupon(coupon) {
  376. // 点击优惠券领取按钮
  377. if (this.isReceiveLoading) {
  378. return
  379. }
  380. if (this.userVip.vipFlag != 1) {
  381. this.$util.msg('您还未开通超级会员,不能领取', 2000)
  382. return
  383. }
  384. this.ProductService.ReceiveCoupon({
  385. userId: this.payParam.userId,
  386. couponId: coupon.couponId,
  387. source: 2
  388. })
  389. .then(response => {
  390. this.isReceiveLoading = true
  391. this.$util.msg('领取成功', 1500, true, 'success')
  392. setTimeout(() => {
  393. coupon.getFlag = 1
  394. this.isReceiveLoading = false
  395. }, 1500)
  396. })
  397. .catch(error => {
  398. this.$util.msg(error.msg, 2000)
  399. this.isReceiveLoading = false
  400. })
  401. },
  402. hanldeShowBeans() {
  403. // 显示采美豆抵扣开通超级会员弹窗
  404. if (process.env.NODE_ENV != 'development') {
  405. // 友盟埋点收集采美豆抵扣会员
  406. this.$uma.trackEvent('Um_Event_userClubMemberBeansConfirm', {
  407. Um_Key_Month: `${this.handelPayMsg.duration}个月`,
  408. Um_Key_SourcePage: '会员中心'
  409. })
  410. }
  411. this.isShowBeansModal = true
  412. },
  413. handelCanelBeans() {
  414. // 取消采美豆抵扣超级会员
  415. if (process.env.NODE_ENV != 'development') {
  416. // 友盟埋点收集取消采抵扣会员
  417. this.$uma.trackEvent('Um_Event_userClubMemberBeansCancel', {
  418. Um_Key_Month: `${this.handelPayMsg.duration}个月`,
  419. Um_Key_SourcePage: '会员中心'
  420. })
  421. }
  422. this.isShowBeansModal = false
  423. },
  424. handelConfirmBeans() {
  425. // 确认采美豆抵扣开通超级会员
  426. if (process.env.NODE_ENV != 'development') {
  427. // 友盟埋点收集确定采抵扣会员
  428. this.$uma.trackEvent('Um_Event_userClubMemberBeansConfirms', {
  429. Um_Key_Month: `${this.handelPayMsg.duration}个月`,
  430. Um_Key_SourcePage: '会员中心'
  431. })
  432. }
  433. this.PayService.getUserRegisterSuperBeans(this.payParam)
  434. .then(response => {
  435. this.isShowBeansModal = false
  436. this.$util.msg('开通成功', 2000, true, 'success')
  437. setTimeout(() => {
  438. this.getUserSuperCenter()
  439. }, 2000)
  440. })
  441. .catch(error => {
  442. this.$util.msg(error.msg, 2000)
  443. })
  444. },
  445. hanldWechatPay() {
  446. // 跳转微信只开通超级会员
  447. if (process.env.NODE_ENV != 'development') {
  448. // 友盟埋点收集线上微信支付
  449. this.$uma.trackEvent('Um_Event_userClubMemberConfirm', {
  450. Um_Key_Month: `${this.handelPayMsg.duration}个月`,
  451. Um_Key_SourcePage: '会员中心'
  452. })
  453. }
  454. this.PayService.getUserRegisterSuperPay(this.payParam)
  455. .then(response => {
  456. this.handelPayMsg.vipRecordId = response.data
  457. this.$api.navigateTo(`/pages/user/member/member-pay?data=${JSON.stringify(this.handelPayMsg)}`)
  458. })
  459. .catch(error => {
  460. this.$util.msg(error.msg, 2000)
  461. })
  462. },
  463. handleCheckedPay(index, pay) {
  464. // 选择会员
  465. this.tabCurrent = index
  466. this.payParam.packageId = pay.packageId
  467. this.handelPayMsg = pay
  468. },
  469. toUseCoupon(coupon) {
  470. // 去使用跳转路径
  471. switch (coupon.couponType) {
  472. case 0: // 活动券:跳转到商城首页 / 或者活动页(看是否指定了商品)
  473. if (coupon.productType == 1) {
  474. // 1 全商城通用 2 指定商品
  475. this.$api.switchTabTo('/pages/tabBar/home/index')
  476. } else {
  477. this.$api.navigateTo('/pages/user/coupon/coupon-product?couponId=' + coupon.couponId)
  478. }
  479. break
  480. case 1: // 品类券:跳转到产品 287 / 仪器页 286
  481. this.$api.navigateTo(`/pages/goods/good-floor?linkId=${coupon.categoryType == 1 ? 287 : 286}`)
  482. break
  483. case 2: // 用户专享券:跳转到商城首页
  484. this.$api.switchTabTo('/pages/tabBar/home/index')
  485. break
  486. case 3: // 店铺券:跳转到店铺首页
  487. this.$api.navigateTo('/pages/supplier/user/my-shop?shopId=' + coupon.shopId)
  488. break
  489. case 4: // 新用户券:跳转到商城首页
  490. this.$api.switchTabTo('/pages/tabBar/home/index')
  491. break
  492. }
  493. },
  494. hanldRenewPayUrl(url) {
  495. // 监听续费跳转并做友盟埋点
  496. if (process.env.NODE_ENV != 'development') {
  497. // 友盟埋点收集续费按钮点击事件
  498. this.$uma.trackEvent('Um_Event_userClubRenewMember', {
  499. Um_Key_Time: this.getNowTime(),
  500. Um_Key_SourcePage: '会员中心'
  501. })
  502. }
  503. this.$api.navigateTo(url)
  504. },
  505. hanldPayUrl(url) {
  506. // 跳转
  507. this.$api.navigateTo(url)
  508. },
  509. PromotionsFormat(promo) {
  510. //促销活动类型数据处理
  511. if (promo != null) {
  512. if (promo.type == 1 && promo.mode == 1) {
  513. return true
  514. } else {
  515. return false
  516. }
  517. }
  518. return false
  519. },
  520. productDetail(productId) {
  521. // 跳转商品详情
  522. this.isModallayer = true
  523. this.$api.navigateTo(`/pages/goods/product?id=${productId}`)
  524. this.isModallayer = false
  525. },
  526. isShowVipFlag(pros) {
  527. /**
  528. *显示SVIP和超级会员价格:
  529. * 个人机构(不是超级会员,但价格所有机构可见),
  530. * 资质机构(不是超级会员,但价格所有机构可见或仅会员可见),
  531. * 超级会员(价格所有机构可见或仅会员可见),超级会员(是医美机构,价格仅医美可见)
  532. *商品价格是否可见:priceFlag 0:所有机构可见 1:未公开价格 2:仅会员可见 3:仅医美机构可见
  533. * 普通机构
  534. * 超级会员 && priceFlag === 0
  535. * 资质机构
  536. * priceFlag !== 1 ||
  537. * 超级会员
  538. * 商品priceFlag === 3 && 是否是医美机构
  539. */
  540. // 未登录 || 非会员
  541. if(!this.hasLogin || !this.vipFlag === 1) return false
  542. // 商品所有机构可见
  543. if(pros.priceFlag === 0 ) return true
  544. // 商品价格仅资质机构可见
  545. if(pros.priceFlag === 2 && this.userIdentity === 2) return true
  546. // 商品价格仅医美机构可见
  547. if(pros.priceFlag === 3 && this.userIdentity === 2 && this.firstClubType == 1) return true
  548. // 其它
  549. return false
  550. },
  551. getNowTime() {
  552. let dateTime
  553. let yy = new Date().getFullYear()
  554. let mm = new Date().getMonth() + 1
  555. let dd = new Date().getDate()
  556. let hh = new Date().getHours()
  557. let mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes()
  558. let ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds()
  559. dateTime = yy + '-' + mm + '-' + dd + ' ' + hh + ':' + mf + ':' + ss
  560. console.log(dateTime)
  561. return dateTime
  562. }
  563. },
  564. onPageScroll(e) {
  565. //实时获取到滚动的值
  566. if (this.userVip.vipFlag == 0) {
  567. if (e.scrollTop > 400) {
  568. this.popupShow = true
  569. } else {
  570. this.popupShow = false
  571. }
  572. }
  573. },
  574. onPullDownRefresh() {
  575. setTimeout(() => {
  576. uni.stopPullDownRefresh()
  577. }, 200)
  578. },
  579. onShow() {
  580. this.initGetStotage()
  581. }
  582. }
  583. </script>
  584. <style lang="scss">
  585. page {
  586. background-color: #f7f7f7;
  587. }
  588. .container {
  589. width: 100%;
  590. height: auto;
  591. }
  592. .cm-member-top {
  593. width: 100%;
  594. height: 242rpx;
  595. box-sizing: border-box;
  596. padding: 0 24rpx;
  597. background: url(https://static.caimei365.com/app/img/icon/icon-member-bg01@2x.png) no-repeat;
  598. background-size: cover;
  599. position: relative;
  600. .cm-member-cel {
  601. float: right;
  602. line-height: 40rpx;
  603. font-size: $font-size-26;
  604. margin-top: 40rpx;
  605. color: #f0cb72;
  606. text-align: right;
  607. }
  608. .cm-member-head {
  609. width: 702rpx;
  610. height: 132rpx;
  611. box-sizing: border-box;
  612. padding: 30rpx 32rpx 0 109rpx;
  613. background: url(https://static.caimei365.com/app/img/icon/icon-member-bg02@2x.png) no-repeat;
  614. background-size: cover;
  615. position: absolute;
  616. bottom: 0;
  617. left: 24rpx;
  618. border-radius: 16rpx 16rpx 0 0;
  619. .cm-member-text {
  620. float: left;
  621. .cm-member-h1 {
  622. line-height: 42rpx;
  623. font-size: $font-size-30;
  624. color: #55331d;
  625. text-align: left;
  626. margin-bottom: 12rpx;
  627. font-weight: bold;
  628. }
  629. .cm-member-p {
  630. line-height: 30rpx;
  631. font-size: $font-size-22;
  632. color: #55331d;
  633. text-align: left;
  634. }
  635. }
  636. .cm-member-btn {
  637. float: right;
  638. padding-top: 12rpx;
  639. .btn {
  640. width: 118rpx;
  641. height: 48rpx;
  642. background: linear-gradient(270deg, #585658 0%, #323031 100%);
  643. border-radius: 24rpx;
  644. line-height: 48rpx;
  645. text-align: center;
  646. font-size: $font-size-24;
  647. color: #f0cb72;
  648. }
  649. }
  650. }
  651. }
  652. .cm-member-main {
  653. width: 100%;
  654. box-sizing: border-box;
  655. padding: 40rpx 24rpx;
  656. background-color: #ffffff;
  657. margin-bottom: 20rpx;
  658. &.none {
  659. background-color: #f7f7f7;
  660. padding: 20rpx 24rpx 0 24rpx;
  661. }
  662. .title {
  663. font-size: $font-size-32;
  664. line-height: 45rpx;
  665. text-align: left;
  666. color: #55331d;
  667. font-weight: bold;
  668. .small {
  669. font-size: $font-size-24;
  670. color: #e4aa43;
  671. font-weight: normal;
  672. margin-left: 15rpx;
  673. }
  674. .more {
  675. float: right;
  676. font-weight: normal;
  677. line-height: 45rpx;
  678. font-size: $font-size-26;
  679. color: #999999;
  680. .iconfont {
  681. margin-left: 10rpx;
  682. }
  683. }
  684. }
  685. .cm-member-pay {
  686. width: 100%;
  687. height: 236rpx;
  688. margin: 40rpx 0;
  689. .pay-item {
  690. width: 218rpx;
  691. height: 100%;
  692. float: left;
  693. margin-right: 24rpx;
  694. border: 1px solid #f0f0f0;
  695. border-radius: 16rpx;
  696. box-sizing: border-box;
  697. text-align: center;
  698. padding: 40rpx 0;
  699. position: relative;
  700. .hot {
  701. width: 80rpx;
  702. height: 36rpx;
  703. text-align: center;
  704. line-height: 36rpx;
  705. font-size: $font-size-24;
  706. color: #ffffff;
  707. background-color: #ff2a2a;
  708. border-radius: 0 8rpx 8rpx 8rpx;
  709. position: absolute;
  710. left: 0;
  711. top: -10rpx;
  712. }
  713. &.current {
  714. background-color: #fdf8ee;
  715. border: 1px solid #f0cc8c;
  716. }
  717. &:last-child {
  718. margin-right: 0;
  719. }
  720. .text-1 {
  721. line-height: 40rpx;
  722. font-size: $font-size-28;
  723. margin-bottom: 10rpx;
  724. color: #55331d;
  725. }
  726. .text-2 {
  727. line-height: 59rpx;
  728. font-size: $font-size-40;
  729. margin-bottom: 10rpx;
  730. color: #ff2a2a;
  731. font-weight: bold;
  732. text {
  733. font-size: $font-size-26;
  734. }
  735. }
  736. .text-3 {
  737. line-height: 33rpx;
  738. font-size: $font-size-24;
  739. color: #666666;
  740. }
  741. }
  742. }
  743. .cm-member-button {
  744. width: 100%;
  745. box-sizing: border-box;
  746. padding: 0 51rpx;
  747. .pay-btn {
  748. width: 100%;
  749. height: 90rpx;
  750. line-height: 90rpx;
  751. border-radius: 50rpx;
  752. text-align: center;
  753. font-size: $font-size-30;
  754. color: #55331d;
  755. box-sizing: border-box;
  756. margin-bottom: $font-size-24;
  757. &.pay {
  758. background: linear-gradient(90deg, #fee9ba 0%, #f0cb72 100%);
  759. font-weight: bold;
  760. }
  761. &.none {
  762. border: 1px solid #f0cb72;
  763. margin-bottom: 0;
  764. }
  765. }
  766. }
  767. .cm-member-privilege {
  768. width: 100%;
  769. margin: 24rpx 0 16rpx 0;
  770. background-color: #ffffff;
  771. .privilege-item {
  772. width: 25%;
  773. height: 196rpx;
  774. margin: 16rpx 0;
  775. float: left;
  776. display: flex;
  777. flex-direction: column;
  778. align-items: center;
  779. .image {
  780. width: 90rpx;
  781. height: 90rpx;
  782. display: block;
  783. }
  784. .text-2 {
  785. font-size: $font-size-26;
  786. color: #333333;
  787. line-height: 36rpx;
  788. margin-top: 12rpx;
  789. }
  790. .text-3 {
  791. font-size: $font-size-22;
  792. color: #999999;
  793. line-height: 30rpx;
  794. margin-top: 6rpx;
  795. }
  796. }
  797. }
  798. .cm-member-coupon {
  799. width: 100%;
  800. margin: 24rpx 0 0 0;
  801. .coupon-list {
  802. width: 338rpx;
  803. height: 148rpx;
  804. border-radius: 8rpx;
  805. margin-bottom: 24rpx;
  806. box-sizing: border-box;
  807. background: url(https://static.caimei365.com/app/img/icon/icon-member-coupon@2x.png);
  808. background-size: cover;
  809. margin-right: 24rpx;
  810. float: left;
  811. position: relative;
  812. &:nth-child(2n) {
  813. margin-right: 0;
  814. }
  815. &.none {
  816. background: url(https://static.caimei365.com/app/img/icon/icon-member-coupon-none@2x.png);
  817. background-size: cover;
  818. }
  819. .list-cell-tags {
  820. display: inline-block;
  821. padding: 0 10rpx;
  822. height: 27rpx;
  823. line-height: 27rpx;
  824. background-color: #e4aa43;
  825. color: #55331d;
  826. font-size: $font-size-20;
  827. border-radius: 8rpx 0 8rpx 0;
  828. text-align: center;
  829. position: absolute;
  830. top: 0;
  831. left: 0;
  832. }
  833. .list-cell-le {
  834. width: 258rpx;
  835. height: 100%;
  836. box-sizing: border-box;
  837. padding: 27rpx 24rpx 0 26rpx;
  838. float: left;
  839. .coupon-maxMoney {
  840. width: 100%;
  841. height: 50rpx;
  842. line-height: 50rpx;
  843. font-size: 40rpx;
  844. color: #55331d;
  845. text-align: left;
  846. .small {
  847. font-size: $font-size-24;
  848. }
  849. }
  850. .coupon-minMoney {
  851. width: 100%;
  852. height: 30rpx;
  853. line-height: 30rpx;
  854. font-size: $font-size-24;
  855. color: #55331d;
  856. text-align: left;
  857. }
  858. .coupon-texts {
  859. width: 100%;
  860. height: 30rpx;
  861. line-height: 30rpx;
  862. font-size: $font-size-24;
  863. color: #55331d;
  864. text-align: left;
  865. -o-text-overflow: ellipsis;
  866. text-overflow: ellipsis;
  867. display: -webkit-box;
  868. word-break: break-all;
  869. -webkit-box-orient: vertical;
  870. -webkit-line-clamp: 1;
  871. overflow: hidden;
  872. }
  873. }
  874. .list-cell-ri {
  875. width: 80rpx;
  876. height: 100%;
  877. float: right;
  878. .icon-used-btn {
  879. width: 100%;
  880. height: 100%;
  881. box-sizing: border-box;
  882. font-size: $font-size-22;
  883. text-align: center;
  884. &.receive {
  885. color: #55331d;
  886. padding: 15rpx 28rpx;
  887. }
  888. &.make {
  889. padding: 30rpx 28rpx;
  890. color: #55331d;
  891. }
  892. }
  893. }
  894. }
  895. }
  896. .cm-member-product {
  897. width: 100%;
  898. margin-top: 16rpx;
  899. .product-list {
  900. width: 339rpx;
  901. height: 516rpx;
  902. border-radius: 16rpx;
  903. float: left;
  904. margin-right: 24rpx;
  905. margin-bottom: 24rpx;
  906. background-color: #ffffff;
  907. &:nth-child(2n) {
  908. margin-right: 0;
  909. }
  910. .product-image {
  911. width: 339rpx;
  912. height: 339rpx;
  913. image {
  914. width: 339rpx;
  915. height: 339rpx;
  916. display: block;
  917. border-radius: 16rpx 16rpx 0 0;
  918. }
  919. }
  920. .product-mains {
  921. width: 100%;
  922. height: auto;
  923. box-sizing: border-box;
  924. padding: 0 24rpx;
  925. margin-top: 8rpx;
  926. .product-name {
  927. height: 72rpx;
  928. line-height: 36rpx;
  929. text-overflow: ellipsis;
  930. overflow: hidden;
  931. display: -webkit-box;
  932. -webkit-line-clamp: 2;
  933. line-clamp: 2;
  934. -webkit-box-orient: vertical;
  935. font-size: $font-size-26;
  936. color: #333333;
  937. text-align: justify;
  938. }
  939. .product-tags {
  940. width: 100%;
  941. height: 32rpx;
  942. margin-top: 6rpx;
  943. .floor-item-act {
  944. width: 100%;
  945. height: 32rpx;
  946. text-align: center;
  947. box-sizing: border-box;
  948. float: left;
  949. }
  950. }
  951. .product-price {
  952. width: 100%;
  953. line-height: 37rpx;
  954. font-size: $font-size-26;
  955. color: #f94b4b;
  956. margin-top: 8rpx;
  957. .list-none-price {
  958. text-decoration: line-through;
  959. color: #999999;
  960. }
  961. }
  962. }
  963. }
  964. }
  965. }
  966. .cm-model-alert {
  967. width: 100%;
  968. height: 100%;
  969. background: rgba(0, 0, 0, 0.5);
  970. position: fixed;
  971. top: 0;
  972. left: 0;
  973. z-index: 8888;
  974. transition: all 0.4s;
  975. .content {
  976. width: 580rpx;
  977. height: 390rpx;
  978. position: absolute;
  979. background: $bg-color;
  980. left: 0;
  981. right: 0;
  982. bottom: 0;
  983. top: 0;
  984. margin: auto;
  985. padding: 20rpx 32rpx;
  986. border-radius: 12rpx;
  987. .title {
  988. width: 100%;
  989. height: 68rpx;
  990. line-height: 68rpx;
  991. font-size: $font-size-28;
  992. color: $text-color;
  993. text-align: center;
  994. position: relative;
  995. .icon-iconfontguanbi {
  996. width: 68rpx;
  997. height: 68rpx;
  998. text-align: center;
  999. line-height: 68rpx;
  1000. position: absolute;
  1001. right: 0;
  1002. top: 0;
  1003. font-size: $font-size-36;
  1004. color: #999999;
  1005. }
  1006. }
  1007. .text-content {
  1008. width: 100%;
  1009. height: auto;
  1010. margin-top: 20px;
  1011. .text {
  1012. padding: 20rpx 0 0 0;
  1013. line-height: 44rpx;
  1014. font-size: $font-size-26;
  1015. color: #666666;
  1016. text-align: justify;
  1017. .text-p {
  1018. color: #e15616;
  1019. }
  1020. }
  1021. }
  1022. .text-button {
  1023. width: 100%;
  1024. height: 72rpx;
  1025. display: flex;
  1026. box-sizing: border-box;
  1027. padding: 0 50rpx;
  1028. margin-top: 30px;
  1029. .btn {
  1030. width: 200rpx;
  1031. height: 72rpx;
  1032. line-height: 72rpx;
  1033. color: #fff;
  1034. display: flex;
  1035. align-items: center;
  1036. justify-content: center;
  1037. font-size: $font-size-26;
  1038. border-radius: 44rpx;
  1039. box-sizing: border-box;
  1040. &.btn-confirm {
  1041. background: $btn-confirm;
  1042. margin-left: 78rpx;
  1043. }
  1044. &.btn-cancel {
  1045. border: 1px solid #b2b2b2;
  1046. color: #333333;
  1047. }
  1048. }
  1049. }
  1050. }
  1051. }
  1052. .tui-popup-box {
  1053. position: relative;
  1054. box-sizing: border-box;
  1055. min-height: 168rpx;
  1056. padding: 6rpx 24rpx;
  1057. .cm-member-button {
  1058. width: 100%;
  1059. box-sizing: border-box;
  1060. padding: 24rpx 51rpx;
  1061. .pay-btn {
  1062. width: 100%;
  1063. height: 90rpx;
  1064. line-height: 90rpx;
  1065. border-radius: 50rpx;
  1066. text-align: center;
  1067. font-size: $font-size-30;
  1068. color: #55331d;
  1069. box-sizing: border-box;
  1070. margin-bottom: $font-size-24;
  1071. &.pay {
  1072. background: linear-gradient(90deg, #fee9ba 0%, #f0cb72 100%);
  1073. font-weight: bold;
  1074. }
  1075. &.none {
  1076. border: 1px solid #f0cb72;
  1077. margin-bottom: 0;
  1078. }
  1079. }
  1080. }
  1081. }
  1082. </style>