member.vue 29 KB

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