member.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089
  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. console.log('coupon', coupon)
  470. switch (coupon.couponType) {
  471. case 0: // 活动券:跳转到商城首页 / 或者活动页(看是否指定了商品)
  472. if (coupon.productType == 1) {
  473. // 1 全商城通用 2 指定商品
  474. this.$api.switchTabTo('/pages/tabBar/home/index')
  475. } else {
  476. this.$api.navigateTo('/pages/user/coupon/coupon-product?couponId=' + coupon.couponId)
  477. }
  478. break
  479. case 1: // 品类券:跳转到产品 287 / 仪器页 286
  480. let categoryId = 0
  481. if (coupon.categoryType == 1) {
  482. categoryId = 287
  483. } else {
  484. categoryId = 286
  485. }
  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. }
  801. }
  802. }
  803. .cm-member-coupon {
  804. width: 100%;
  805. margin: 24rpx 0 0 0;
  806. .coupon-list {
  807. width: 338rpx;
  808. height: 148rpx;
  809. border-radius: 8rpx;
  810. margin-bottom: 24rpx;
  811. box-sizing: border-box;
  812. background: url(https://static.caimei365.com/app/img/icon/icon-member-coupon@2x.png);
  813. background-size: cover;
  814. margin-right: 24rpx;
  815. float: left;
  816. position: relative;
  817. &:nth-child(2n) {
  818. margin-right: 0;
  819. }
  820. &.none {
  821. background: url(https://static.caimei365.com/app/img/icon/icon-member-coupon-none@2x.png);
  822. background-size: cover;
  823. }
  824. .list-cell-tags {
  825. display: inline-block;
  826. padding: 0 10rpx;
  827. height: 27rpx;
  828. line-height: 27rpx;
  829. background-color: #e4aa43;
  830. color: #55331d;
  831. font-size: $font-size-20;
  832. border-radius: 8rpx 0 8rpx 0;
  833. text-align: center;
  834. position: absolute;
  835. top: 0;
  836. left: 0;
  837. }
  838. .list-cell-le {
  839. width: 258rpx;
  840. height: 100%;
  841. box-sizing: border-box;
  842. padding: 27rpx 24rpx 0 26rpx;
  843. float: left;
  844. .coupon-maxMoney {
  845. width: 100%;
  846. height: 50rpx;
  847. line-height: 50rpx;
  848. font-size: 40rpx;
  849. color: #55331d;
  850. text-align: left;
  851. .small {
  852. font-size: $font-size-24;
  853. }
  854. }
  855. .coupon-minMoney {
  856. width: 100%;
  857. height: 30rpx;
  858. line-height: 30rpx;
  859. font-size: $font-size-24;
  860. color: #55331d;
  861. text-align: left;
  862. }
  863. .coupon-texts {
  864. width: 100%;
  865. height: 30rpx;
  866. line-height: 30rpx;
  867. font-size: $font-size-24;
  868. color: #55331d;
  869. text-align: left;
  870. -o-text-overflow: ellipsis;
  871. text-overflow: ellipsis;
  872. display: -webkit-box;
  873. word-break: break-all;
  874. -webkit-box-orient: vertical;
  875. -webkit-line-clamp: 1;
  876. overflow: hidden;
  877. }
  878. }
  879. .list-cell-ri {
  880. width: 80rpx;
  881. height: 100%;
  882. float: right;
  883. .icon-used-btn {
  884. width: 100%;
  885. height: 100%;
  886. box-sizing: border-box;
  887. font-size: $font-size-22;
  888. text-align: center;
  889. &.receive {
  890. color: #55331d;
  891. padding: 15rpx 28rpx;
  892. }
  893. &.make {
  894. padding: 30rpx 28rpx;
  895. color: #55331d;
  896. }
  897. }
  898. }
  899. }
  900. }
  901. .cm-member-product {
  902. width: 100%;
  903. margin-top: 16rpx;
  904. .product-list {
  905. width: 339rpx;
  906. height: 516rpx;
  907. border-radius: 16rpx;
  908. float: left;
  909. margin-right: 24rpx;
  910. margin-bottom: 24rpx;
  911. background-color: #ffffff;
  912. &:nth-child(2n) {
  913. margin-right: 0;
  914. }
  915. .product-image {
  916. width: 339rpx;
  917. height: 339rpx;
  918. image {
  919. width: 339rpx;
  920. height: 339rpx;
  921. display: block;
  922. border-radius: 16rpx 16rpx 0 0;
  923. }
  924. }
  925. .product-mains {
  926. width: 100%;
  927. height: auto;
  928. box-sizing: border-box;
  929. padding: 0 24rpx;
  930. margin-top: 8rpx;
  931. .product-name {
  932. height: 72rpx;
  933. line-height: 36rpx;
  934. text-overflow: ellipsis;
  935. overflow: hidden;
  936. display: -webkit-box;
  937. -webkit-line-clamp: 2;
  938. line-clamp: 2;
  939. -webkit-box-orient: vertical;
  940. font-size: $font-size-26;
  941. color: #333333;
  942. text-align: justify;
  943. }
  944. .product-tags {
  945. width: 100%;
  946. height: 32rpx;
  947. margin-top: 6rpx;
  948. .floor-item-act {
  949. width: 100%;
  950. height: 32rpx;
  951. text-align: center;
  952. box-sizing: border-box;
  953. float: left;
  954. }
  955. }
  956. .product-price {
  957. width: 100%;
  958. line-height: 37rpx;
  959. font-size: $font-size-26;
  960. color: #f94b4b;
  961. margin-top: 8rpx;
  962. .list-none-price {
  963. text-decoration: line-through;
  964. color: #999999;
  965. }
  966. }
  967. }
  968. }
  969. }
  970. }
  971. .cm-model-alert {
  972. width: 100%;
  973. height: 100%;
  974. background: rgba(0, 0, 0, 0.5);
  975. position: fixed;
  976. top: 0;
  977. left: 0;
  978. z-index: 8888;
  979. transition: all 0.4s;
  980. .content {
  981. width: 580rpx;
  982. height: 390rpx;
  983. position: absolute;
  984. background: $bg-color;
  985. left: 0;
  986. right: 0;
  987. bottom: 0;
  988. top: 0;
  989. margin: auto;
  990. padding: 20rpx 32rpx;
  991. border-radius: 12rpx;
  992. .title {
  993. width: 100%;
  994. height: 68rpx;
  995. line-height: 68rpx;
  996. font-size: $font-size-28;
  997. color: $text-color;
  998. text-align: center;
  999. position: relative;
  1000. .icon-iconfontguanbi {
  1001. width: 68rpx;
  1002. height: 68rpx;
  1003. text-align: center;
  1004. line-height: 68rpx;
  1005. position: absolute;
  1006. right: 0;
  1007. top: 0;
  1008. font-size: $font-size-36;
  1009. color: #999999;
  1010. }
  1011. }
  1012. .text-content {
  1013. width: 100%;
  1014. height: auto;
  1015. margin-top: 20px;
  1016. .text {
  1017. padding: 20rpx 0 0 0;
  1018. line-height: 44rpx;
  1019. font-size: $font-size-26;
  1020. color: #666666;
  1021. text-align: justify;
  1022. .text-p {
  1023. color: #e15616;
  1024. }
  1025. }
  1026. }
  1027. .text-button {
  1028. width: 100%;
  1029. height: 72rpx;
  1030. display: flex;
  1031. box-sizing: border-box;
  1032. padding: 0 50rpx;
  1033. margin-top: 30px;
  1034. .btn {
  1035. width: 200rpx;
  1036. height: 72rpx;
  1037. line-height: 72rpx;
  1038. color: #fff;
  1039. display: flex;
  1040. align-items: center;
  1041. justify-content: center;
  1042. font-size: $font-size-26;
  1043. border-radius: 44rpx;
  1044. box-sizing: border-box;
  1045. &.btn-confirm {
  1046. background: $btn-confirm;
  1047. margin-left: 78rpx;
  1048. }
  1049. &.btn-cancel {
  1050. border: 1px solid #b2b2b2;
  1051. color: #333333;
  1052. }
  1053. }
  1054. }
  1055. }
  1056. }
  1057. .tui-popup-box {
  1058. position: relative;
  1059. box-sizing: border-box;
  1060. min-height: 168rpx;
  1061. padding: 6rpx 24rpx;
  1062. .cm-member-button {
  1063. width: 100%;
  1064. box-sizing: border-box;
  1065. padding: 24rpx 51rpx;
  1066. .pay-btn {
  1067. width: 100%;
  1068. height: 90rpx;
  1069. line-height: 90rpx;
  1070. border-radius: 50rpx;
  1071. text-align: center;
  1072. font-size: $font-size-30;
  1073. color: #55331d;
  1074. box-sizing: border-box;
  1075. margin-bottom: $font-size-24;
  1076. &.pay {
  1077. background: linear-gradient(90deg, #fee9ba 0%, #f0cb72 100%);
  1078. font-weight: bold;
  1079. }
  1080. &.none {
  1081. border: 1px solid #f0cb72;
  1082. margin-bottom: 0;
  1083. }
  1084. }
  1085. }
  1086. }
  1087. </style>