member.vue 29 KB

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