member.vue 28 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091
  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. icon: 'https://static.caimei365.com/app/img/icon/icon-member-prer8@2x.png',
  282. privText: '分期付',
  283. privName: '热门商品分期付(年卡专享)'
  284. }
  285. ],
  286. listQuery: {
  287. userId: 0,
  288. source: 1,
  289. pageNum: 1,
  290. pageSize: 4
  291. },
  292. productCouponList: [],
  293. productList: [],
  294. isReceiveLoading: false
  295. }
  296. },
  297. onLoad() {
  298. wxLogin.wxLoginAuthorize()
  299. this.getUserSuperPackage()
  300. },
  301. filters: {
  302. TypeFormat(value) {
  303. switch (value) {
  304. case 0:
  305. return '活动券'
  306. break
  307. case 1:
  308. return '品类券'
  309. break
  310. case 2:
  311. return '用户专享券'
  312. break
  313. case 3:
  314. return '店铺券'
  315. break
  316. case 4:
  317. return '新用户券'
  318. break
  319. }
  320. },
  321. NumFormat(value) {
  322. //处理金额
  323. return Number(value).toFixed(2)
  324. }
  325. },
  326. computed: {
  327. ...mapState(['hasLogin','clubType'])
  328. },
  329. methods: {
  330. async initGetStotage() {
  331. const userInfo = await this.$api.getStorage()
  332. this.payParam.userId = this.listQuery.userId = userInfo.userId ? userInfo.userId : 0
  333. this.userIdentity = userInfo.userIdentity ? userInfo.userIdentity : 0
  334. this.firstClubType = this.clubType
  335. this.getUserSuperCenter()
  336. this.getSvipProductPage()
  337. },
  338. getUserSuperCenter() {
  339. // 获取会员中心数据
  340. this.UserService.getUserSuperCenter({ userId: this.payParam.userId })
  341. .then(response => {
  342. let data = response.data
  343. this.userVip = data.vip
  344. this.productCouponList = data.coupon
  345. console.log('this.productCouponList', this.productCouponList)
  346. this.isRequest = true
  347. })
  348. .catch(error => {
  349. this.$util.msg(error.msg, 2000)
  350. })
  351. },
  352. getSvipProductPage() {
  353. // 获取会员中心商品数据
  354. this.ProductService.getSvipProductPage(this.listQuery)
  355. .then(response => {
  356. let data = response.data.svipProductPage
  357. this.productList = data.results
  358. })
  359. .catch(error => {
  360. this.$util.msg(error.msg, 2000)
  361. })
  362. },
  363. getUserSuperPackage() {
  364. //获取会员中心套餐
  365. this.UserService.getUserSuperPackage()
  366. .then(response => {
  367. let data = response.data
  368. data.forEach(el => {
  369. el.beans = el.price * el.proportion
  370. el.packageId = el.id
  371. })
  372. this.payList = data
  373. this.handelPayMsg = data[0]
  374. this.payParam.packageId = data[0].packageId
  375. })
  376. .catch(error => {
  377. console.log('获取会员套餐异常~')
  378. })
  379. },
  380. receiveCoupon(coupon) {
  381. // 点击优惠券领取按钮
  382. if (this.isReceiveLoading) {
  383. return
  384. }
  385. if (this.userVip.vipFlag != 1) {
  386. this.$util.msg('您还未开通超级会员,不能领取', 2000)
  387. return
  388. }
  389. this.ProductService.ReceiveCoupon({
  390. userId: this.payParam.userId,
  391. couponId: coupon.couponId,
  392. source: 2
  393. })
  394. .then(response => {
  395. this.isReceiveLoading = true
  396. this.$util.msg('领取成功', 1500, true, 'success')
  397. setTimeout(() => {
  398. coupon.getFlag = 1
  399. this.isReceiveLoading = false
  400. }, 1500)
  401. })
  402. .catch(error => {
  403. this.$util.msg(error.msg, 2000)
  404. this.isReceiveLoading = false
  405. })
  406. },
  407. hanldeShowBeans() {
  408. // 显示采美豆抵扣开通超级会员弹窗
  409. if (process.env.NODE_ENV != 'development') {
  410. // 友盟埋点收集采美豆抵扣会员
  411. this.$uma.trackEvent('Um_Event_userClubMemberBeansConfirm', {
  412. Um_Key_Month: `${this.handelPayMsg.duration}个月`,
  413. Um_Key_SourcePage: '会员中心'
  414. })
  415. }
  416. this.isShowBeansModal = true
  417. },
  418. handelCanelBeans() {
  419. // 取消采美豆抵扣超级会员
  420. if (process.env.NODE_ENV != 'development') {
  421. // 友盟埋点收集取消采抵扣会员
  422. this.$uma.trackEvent('Um_Event_userClubMemberBeansCancel', {
  423. Um_Key_Month: `${this.handelPayMsg.duration}个月`,
  424. Um_Key_SourcePage: '会员中心'
  425. })
  426. }
  427. this.isShowBeansModal = false
  428. },
  429. handelConfirmBeans() {
  430. // 确认采美豆抵扣开通超级会员
  431. if (process.env.NODE_ENV != 'development') {
  432. // 友盟埋点收集确定采抵扣会员
  433. this.$uma.trackEvent('Um_Event_userClubMemberBeansConfirms', {
  434. Um_Key_Month: `${this.handelPayMsg.duration}个月`,
  435. Um_Key_SourcePage: '会员中心'
  436. })
  437. }
  438. this.PayService.getUserRegisterSuperBeans(this.payParam)
  439. .then(response => {
  440. this.isShowBeansModal = false
  441. this.$util.msg('开通成功', 2000, true, 'success')
  442. setTimeout(() => {
  443. this.getUserSuperCenter()
  444. }, 2000)
  445. })
  446. .catch(error => {
  447. this.$util.msg(error.msg, 2000)
  448. })
  449. },
  450. hanldWechatPay() {
  451. // 跳转微信只开通超级会员
  452. if (process.env.NODE_ENV != 'development') {
  453. // 友盟埋点收集线上微信支付
  454. this.$uma.trackEvent('Um_Event_userClubMemberConfirm', {
  455. Um_Key_Month: `${this.handelPayMsg.duration}个月`,
  456. Um_Key_SourcePage: '会员中心'
  457. })
  458. }
  459. this.PayService.getUserRegisterSuperPay(this.payParam)
  460. .then(response => {
  461. this.handelPayMsg.vipRecordId = response.data
  462. this.$api.navigateTo(`/pages/user/member/member-pay?data=${JSON.stringify(this.handelPayMsg)}`)
  463. })
  464. .catch(error => {
  465. this.$util.msg(error.msg, 2000)
  466. })
  467. },
  468. handleCheckedPay(index, pay) {
  469. // 选择会员
  470. this.tabCurrent = index
  471. this.payParam.packageId = pay.packageId
  472. this.handelPayMsg = pay
  473. },
  474. toUseCoupon(coupon) {
  475. // 去使用跳转路径
  476. switch (coupon.couponType) {
  477. case 0: // 活动券:跳转到商城首页 / 或者活动页(看是否指定了商品)
  478. if (coupon.productType == 1) {
  479. // 1 全商城通用 2 指定商品
  480. this.$api.switchTabTo('/pages/tabBar/home/index')
  481. } else {
  482. this.$api.navigateTo('/pages/user/coupon/coupon-product?couponId=' + coupon.couponId)
  483. }
  484. break
  485. case 1: // 品类券:跳转到产品 287 / 仪器页 286
  486. this.$api.navigateTo(`/pages/goods/good-floor?linkId=${coupon.categoryType == 1 ? 287 : 286}`)
  487. break
  488. case 2: // 用户专享券:跳转到商城首页
  489. this.$api.switchTabTo('/pages/tabBar/home/index')
  490. break
  491. case 3: // 店铺券:跳转到店铺首页
  492. this.$api.navigateTo('/pages/supplier/user/my-shop?shopId=' + coupon.shopId)
  493. break
  494. case 4: // 新用户券:跳转到商城首页
  495. this.$api.switchTabTo('/pages/tabBar/home/index')
  496. break
  497. }
  498. },
  499. hanldRenewPayUrl(url) {
  500. // 监听续费跳转并做友盟埋点
  501. if (process.env.NODE_ENV != 'development') {
  502. // 友盟埋点收集续费按钮点击事件
  503. this.$uma.trackEvent('Um_Event_userClubRenewMember', {
  504. Um_Key_Time: this.getNowTime(),
  505. Um_Key_SourcePage: '会员中心'
  506. })
  507. }
  508. this.$api.navigateTo(url)
  509. },
  510. hanldPayUrl(url) {
  511. // 跳转
  512. this.$api.navigateTo(url)
  513. },
  514. PromotionsFormat(promo) {
  515. //促销活动类型数据处理
  516. if (promo != null) {
  517. if (promo.type == 1 && promo.mode == 1) {
  518. return true
  519. } else {
  520. return false
  521. }
  522. }
  523. return false
  524. },
  525. productDetail(productId) {
  526. // 跳转商品详情
  527. this.isModallayer = true
  528. this.$api.navigateTo(`/pages/goods/product?id=${productId}`)
  529. this.isModallayer = false
  530. },
  531. isShowVipFlag(pros) {
  532. /**
  533. *显示SVIP和超级会员价格:
  534. * 个人机构(不是超级会员,但价格所有机构可见),
  535. * 资质机构(不是超级会员,但价格所有机构可见或仅会员可见),
  536. * 超级会员(价格所有机构可见或仅会员可见),超级会员(是医美机构,价格仅医美可见)
  537. *商品价格是否可见:priceFlag 0:所有机构可见 1:未公开价格 2:仅会员可见 3:仅医美机构可见
  538. * 普通机构
  539. * 超级会员 && priceFlag === 0
  540. * 资质机构
  541. * priceFlag !== 1 ||
  542. * 超级会员
  543. * 商品priceFlag === 3 && 是否是医美机构
  544. */
  545. // 未登录 || 非会员
  546. if(!this.hasLogin || !this.vipFlag === 1) return false
  547. // 商品所有机构可见
  548. if(pros.priceFlag === 0 ) return true
  549. // 商品价格仅资质机构可见
  550. if(pros.priceFlag === 2 && this.userIdentity === 2) return true
  551. // 商品价格仅医美机构可见
  552. if(pros.priceFlag === 3 && this.userIdentity === 2 && this.firstClubType == 1) return true
  553. // 其它
  554. return false
  555. },
  556. getNowTime() {
  557. let dateTime
  558. let yy = new Date().getFullYear()
  559. let mm = new Date().getMonth() + 1
  560. let dd = new Date().getDate()
  561. let hh = new Date().getHours()
  562. let mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes()
  563. let ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds()
  564. dateTime = yy + '-' + mm + '-' + dd + ' ' + hh + ':' + mf + ':' + ss
  565. console.log(dateTime)
  566. return dateTime
  567. }
  568. },
  569. onPageScroll(e) {
  570. //实时获取到滚动的值
  571. if (this.userVip.vipFlag == 0) {
  572. if (e.scrollTop > 400) {
  573. this.popupShow = true
  574. } else {
  575. this.popupShow = false
  576. }
  577. }
  578. },
  579. onPullDownRefresh() {
  580. setTimeout(() => {
  581. uni.stopPullDownRefresh()
  582. }, 200)
  583. },
  584. onShow() {
  585. this.initGetStotage()
  586. }
  587. }
  588. </script>
  589. <style lang="scss">
  590. page {
  591. background-color: #f7f7f7;
  592. }
  593. .container {
  594. width: 100%;
  595. height: auto;
  596. }
  597. .cm-member-top {
  598. width: 100%;
  599. height: 242rpx;
  600. box-sizing: border-box;
  601. padding: 0 24rpx;
  602. background: url(https://static.caimei365.com/app/img/icon/icon-member-bg01@2x.png) no-repeat;
  603. background-size: cover;
  604. position: relative;
  605. .cm-member-cel {
  606. float: right;
  607. line-height: 40rpx;
  608. font-size: $font-size-26;
  609. margin-top: 40rpx;
  610. color: #f0cb72;
  611. text-align: right;
  612. }
  613. .cm-member-head {
  614. width: 702rpx;
  615. height: 132rpx;
  616. box-sizing: border-box;
  617. padding: 30rpx 32rpx 0 109rpx;
  618. background: url(https://static.caimei365.com/app/img/icon/icon-member-bg02@2x.png) no-repeat;
  619. background-size: cover;
  620. position: absolute;
  621. bottom: 0;
  622. left: 24rpx;
  623. border-radius: 16rpx 16rpx 0 0;
  624. .cm-member-text {
  625. float: left;
  626. .cm-member-h1 {
  627. line-height: 42rpx;
  628. font-size: $font-size-30;
  629. color: #55331d;
  630. text-align: left;
  631. margin-bottom: 12rpx;
  632. font-weight: bold;
  633. }
  634. .cm-member-p {
  635. line-height: 30rpx;
  636. font-size: $font-size-22;
  637. color: #55331d;
  638. text-align: left;
  639. }
  640. }
  641. .cm-member-btn {
  642. float: right;
  643. padding-top: 12rpx;
  644. .btn {
  645. width: 118rpx;
  646. height: 48rpx;
  647. background: linear-gradient(270deg, #585658 0%, #323031 100%);
  648. border-radius: 24rpx;
  649. line-height: 48rpx;
  650. text-align: center;
  651. font-size: $font-size-24;
  652. color: #f0cb72;
  653. }
  654. }
  655. }
  656. }
  657. .cm-member-main {
  658. width: 100%;
  659. box-sizing: border-box;
  660. padding: 40rpx 24rpx;
  661. background-color: #ffffff;
  662. margin-bottom: 20rpx;
  663. &.none {
  664. background-color: #f7f7f7;
  665. padding: 20rpx 24rpx 0 24rpx;
  666. }
  667. .title {
  668. font-size: $font-size-32;
  669. line-height: 45rpx;
  670. text-align: left;
  671. color: #55331d;
  672. font-weight: bold;
  673. .small {
  674. font-size: $font-size-24;
  675. color: #e4aa43;
  676. font-weight: normal;
  677. margin-left: 15rpx;
  678. }
  679. .more {
  680. float: right;
  681. font-weight: normal;
  682. line-height: 45rpx;
  683. font-size: $font-size-26;
  684. color: #999999;
  685. .iconfont {
  686. margin-left: 10rpx;
  687. }
  688. }
  689. }
  690. .cm-member-pay {
  691. width: 100%;
  692. height: 236rpx;
  693. margin: 40rpx 0;
  694. .pay-item {
  695. width: 218rpx;
  696. height: 100%;
  697. float: left;
  698. margin-right: 24rpx;
  699. border: 1px solid #f0f0f0;
  700. border-radius: 16rpx;
  701. box-sizing: border-box;
  702. text-align: center;
  703. padding: 40rpx 0;
  704. position: relative;
  705. .hot {
  706. width: 80rpx;
  707. height: 36rpx;
  708. text-align: center;
  709. line-height: 36rpx;
  710. font-size: $font-size-24;
  711. color: #ffffff;
  712. background-color: #ff2a2a;
  713. border-radius: 0 8rpx 8rpx 8rpx;
  714. position: absolute;
  715. left: 0;
  716. top: -10rpx;
  717. }
  718. &.current {
  719. background-color: #fdf8ee;
  720. border: 1px solid #f0cc8c;
  721. }
  722. &:last-child {
  723. margin-right: 0;
  724. }
  725. .text-1 {
  726. line-height: 40rpx;
  727. font-size: $font-size-28;
  728. margin-bottom: 10rpx;
  729. color: #55331d;
  730. }
  731. .text-2 {
  732. line-height: 59rpx;
  733. font-size: $font-size-40;
  734. margin-bottom: 10rpx;
  735. color: #ff2a2a;
  736. font-weight: bold;
  737. text {
  738. font-size: $font-size-26;
  739. }
  740. }
  741. .text-3 {
  742. line-height: 33rpx;
  743. font-size: $font-size-24;
  744. color: #666666;
  745. }
  746. }
  747. }
  748. .cm-member-button {
  749. width: 100%;
  750. box-sizing: border-box;
  751. padding: 0 51rpx;
  752. .pay-btn {
  753. width: 100%;
  754. height: 90rpx;
  755. line-height: 90rpx;
  756. border-radius: 50rpx;
  757. text-align: center;
  758. font-size: $font-size-30;
  759. color: #55331d;
  760. box-sizing: border-box;
  761. margin-bottom: $font-size-24;
  762. &.pay {
  763. background: linear-gradient(90deg, #fee9ba 0%, #f0cb72 100%);
  764. font-weight: bold;
  765. }
  766. &.none {
  767. border: 1px solid #f0cb72;
  768. margin-bottom: 0;
  769. }
  770. }
  771. }
  772. .cm-member-privilege {
  773. width: 100%;
  774. margin: 24rpx 0 16rpx 0;
  775. background-color: #ffffff;
  776. .privilege-item {
  777. width: 25%;
  778. height: 196rpx;
  779. margin: 16rpx 0;
  780. float: left;
  781. display: flex;
  782. flex-direction: column;
  783. align-items: center;
  784. .image {
  785. width: 90rpx;
  786. height: 90rpx;
  787. display: block;
  788. }
  789. .text-2 {
  790. font-size: $font-size-26;
  791. color: #333333;
  792. line-height: 36rpx;
  793. margin-top: 12rpx;
  794. }
  795. .text-3 {
  796. font-size: $font-size-22;
  797. color: #999999;
  798. line-height: 30rpx;
  799. margin-top: 6rpx;
  800. text-align: center;
  801. }
  802. }
  803. }
  804. .cm-member-coupon {
  805. width: 100%;
  806. margin: 24rpx 0 0 0;
  807. .coupon-list {
  808. width: 338rpx;
  809. height: 148rpx;
  810. border-radius: 8rpx;
  811. margin-bottom: 24rpx;
  812. box-sizing: border-box;
  813. background: url(https://static.caimei365.com/app/img/icon/icon-member-coupon@2x.png);
  814. background-size: cover;
  815. margin-right: 24rpx;
  816. float: left;
  817. position: relative;
  818. &:nth-child(2n) {
  819. margin-right: 0;
  820. }
  821. &.none {
  822. background: url(https://static.caimei365.com/app/img/icon/icon-member-coupon-none@2x.png);
  823. background-size: cover;
  824. }
  825. .list-cell-tags {
  826. display: inline-block;
  827. padding: 0 10rpx;
  828. height: 27rpx;
  829. line-height: 27rpx;
  830. background-color: #e4aa43;
  831. color: #55331d;
  832. font-size: $font-size-20;
  833. border-radius: 8rpx 0 8rpx 0;
  834. text-align: center;
  835. position: absolute;
  836. top: 0;
  837. left: 0;
  838. }
  839. .list-cell-le {
  840. width: 258rpx;
  841. height: 100%;
  842. box-sizing: border-box;
  843. padding: 27rpx 24rpx 0 26rpx;
  844. float: left;
  845. .coupon-maxMoney {
  846. width: 100%;
  847. height: 50rpx;
  848. line-height: 50rpx;
  849. font-size: 40rpx;
  850. color: #55331d;
  851. text-align: left;
  852. .small {
  853. font-size: $font-size-24;
  854. }
  855. }
  856. .coupon-minMoney {
  857. width: 100%;
  858. height: 30rpx;
  859. line-height: 30rpx;
  860. font-size: $font-size-24;
  861. color: #55331d;
  862. text-align: left;
  863. }
  864. .coupon-texts {
  865. width: 100%;
  866. height: 30rpx;
  867. line-height: 30rpx;
  868. font-size: $font-size-24;
  869. color: #55331d;
  870. text-align: left;
  871. -o-text-overflow: ellipsis;
  872. text-overflow: ellipsis;
  873. display: -webkit-box;
  874. word-break: break-all;
  875. -webkit-box-orient: vertical;
  876. -webkit-line-clamp: 1;
  877. overflow: hidden;
  878. }
  879. }
  880. .list-cell-ri {
  881. width: 80rpx;
  882. height: 100%;
  883. float: right;
  884. .icon-used-btn {
  885. width: 100%;
  886. height: 100%;
  887. box-sizing: border-box;
  888. font-size: $font-size-22;
  889. text-align: center;
  890. &.receive {
  891. color: #55331d;
  892. padding: 15rpx 28rpx;
  893. }
  894. &.make {
  895. padding: 30rpx 28rpx;
  896. color: #55331d;
  897. }
  898. }
  899. }
  900. }
  901. }
  902. .cm-member-product {
  903. width: 100%;
  904. margin-top: 16rpx;
  905. .product-list {
  906. width: 339rpx;
  907. height: 516rpx;
  908. border-radius: 16rpx;
  909. float: left;
  910. margin-right: 24rpx;
  911. margin-bottom: 24rpx;
  912. background-color: #ffffff;
  913. &:nth-child(2n) {
  914. margin-right: 0;
  915. }
  916. .product-image {
  917. width: 339rpx;
  918. height: 339rpx;
  919. image {
  920. width: 339rpx;
  921. height: 339rpx;
  922. display: block;
  923. border-radius: 16rpx 16rpx 0 0;
  924. }
  925. }
  926. .product-mains {
  927. width: 100%;
  928. height: auto;
  929. box-sizing: border-box;
  930. padding: 0 24rpx;
  931. margin-top: 8rpx;
  932. .product-name {
  933. height: 72rpx;
  934. line-height: 36rpx;
  935. text-overflow: ellipsis;
  936. overflow: hidden;
  937. display: -webkit-box;
  938. -webkit-line-clamp: 2;
  939. line-clamp: 2;
  940. -webkit-box-orient: vertical;
  941. font-size: $font-size-26;
  942. color: #333333;
  943. text-align: justify;
  944. }
  945. .product-tags {
  946. width: 100%;
  947. height: 32rpx;
  948. margin-top: 6rpx;
  949. .floor-item-act {
  950. width: 100%;
  951. height: 32rpx;
  952. text-align: center;
  953. box-sizing: border-box;
  954. float: left;
  955. }
  956. }
  957. .product-price {
  958. width: 100%;
  959. line-height: 37rpx;
  960. font-size: $font-size-26;
  961. color: #f94b4b;
  962. margin-top: 8rpx;
  963. .list-none-price {
  964. text-decoration: line-through;
  965. color: #999999;
  966. }
  967. }
  968. }
  969. }
  970. }
  971. }
  972. .cm-model-alert {
  973. width: 100%;
  974. height: 100%;
  975. background: rgba(0, 0, 0, 0.5);
  976. position: fixed;
  977. top: 0;
  978. left: 0;
  979. z-index: 8888;
  980. transition: all 0.4s;
  981. .content {
  982. width: 580rpx;
  983. height: 390rpx;
  984. position: absolute;
  985. background: $bg-color;
  986. left: 0;
  987. right: 0;
  988. bottom: 0;
  989. top: 0;
  990. margin: auto;
  991. padding: 20rpx 32rpx;
  992. border-radius: 12rpx;
  993. .title {
  994. width: 100%;
  995. height: 68rpx;
  996. line-height: 68rpx;
  997. font-size: $font-size-28;
  998. color: $text-color;
  999. text-align: center;
  1000. position: relative;
  1001. .icon-iconfontguanbi {
  1002. width: 68rpx;
  1003. height: 68rpx;
  1004. text-align: center;
  1005. line-height: 68rpx;
  1006. position: absolute;
  1007. right: 0;
  1008. top: 0;
  1009. font-size: $font-size-36;
  1010. color: #999999;
  1011. }
  1012. }
  1013. .text-content {
  1014. width: 100%;
  1015. height: auto;
  1016. margin-top: 20px;
  1017. .text {
  1018. padding: 20rpx 0 0 0;
  1019. line-height: 44rpx;
  1020. font-size: $font-size-26;
  1021. color: #666666;
  1022. text-align: justify;
  1023. .text-p {
  1024. color: #e15616;
  1025. }
  1026. }
  1027. }
  1028. .text-button {
  1029. width: 100%;
  1030. height: 72rpx;
  1031. display: flex;
  1032. box-sizing: border-box;
  1033. padding: 0 50rpx;
  1034. margin-top: 30px;
  1035. .btn {
  1036. width: 200rpx;
  1037. height: 72rpx;
  1038. line-height: 72rpx;
  1039. color: #fff;
  1040. display: flex;
  1041. align-items: center;
  1042. justify-content: center;
  1043. font-size: $font-size-26;
  1044. border-radius: 44rpx;
  1045. box-sizing: border-box;
  1046. &.btn-confirm {
  1047. background: $btn-confirm;
  1048. margin-left: 78rpx;
  1049. }
  1050. &.btn-cancel {
  1051. border: 1px solid #b2b2b2;
  1052. color: #333333;
  1053. }
  1054. }
  1055. }
  1056. }
  1057. }
  1058. .tui-popup-box {
  1059. position: relative;
  1060. box-sizing: border-box;
  1061. min-height: 168rpx;
  1062. padding: 6rpx 24rpx;
  1063. .cm-member-button {
  1064. width: 100%;
  1065. box-sizing: border-box;
  1066. padding: 24rpx 51rpx;
  1067. .pay-btn {
  1068. width: 100%;
  1069. height: 90rpx;
  1070. line-height: 90rpx;
  1071. border-radius: 50rpx;
  1072. text-align: center;
  1073. font-size: $font-size-30;
  1074. color: #55331d;
  1075. box-sizing: border-box;
  1076. margin-bottom: $font-size-24;
  1077. &.pay {
  1078. background: linear-gradient(90deg, #fee9ba 0%, #f0cb72 100%);
  1079. font-weight: bold;
  1080. }
  1081. &.none {
  1082. border: 1px solid #f0cb72;
  1083. margin-bottom: 0;
  1084. }
  1085. }
  1086. }
  1087. }
  1088. </style>