member.vue 28 KB

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