collection.vue 28 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112
  1. <template>
  2. <view class="container product clearfix">
  3. <view class="superv-header" v-if="!isEmpty">
  4. <view class="superv-header-click">
  5. <view class="oltext"
  6. >共<text class="red">{{ totalRecord }}</text
  7. >件商品</view
  8. >
  9. <view class="ortext" @click="showPopup(0)" v-if="!popupShow">编辑</view>
  10. <view class="ortext" @click="hidePopup(0)" v-else>完成</view>
  11. </view>
  12. </view>
  13. <view class="product-content" :style="{ paddingBottom: popupShow ? '68rpx' : '0' }">
  14. <view :class="{ 'tui-order-list': scrollTop >= 0 }" class="clearfix">
  15. <!-- 空白页 -->
  16. <view class="empty-container" v-if="isEmpty">
  17. <image
  18. class="empty-container-image"
  19. :src="StaticUrl + '/icon/icon-collection-empty@2x.png'"
  20. ></image>
  21. <text class="error-text">暂无收藏商品~</text>
  22. </view>
  23. <!-- 列表 -->
  24. <view class="tui-cart-cell tui-mtop" v-for="(pros, index) in productList" :key="index">
  25. <view class="tui-goods-item">
  26. <view class="tui-goods-main">
  27. <view class="tui-goods-checkBox" v-if="popupShow">
  28. <view
  29. class="checkbox iconfont"
  30. :class="[pros.isChecked ? 'icon-yixuanze' : 'icon-weixuanze']"
  31. @click="checkedSoperv(pros)"
  32. >
  33. </view>
  34. </view>
  35. <view class="tui-goods-image" @click.stop="navToDetailPage(pros.productId)"
  36. >
  37. <image :src="pros.image" class="tui-goods-img" />
  38. <view class="tui-goods-type" v-if="pros.productType == 2">医疗器械</view>
  39. </view>
  40. <view
  41. class="tui-goods-info"
  42. :style="{ width: popupShow ? '420rpx' : '528rpx' }"
  43. @click.stop="navToDetailPage(pros.productId)"
  44. >
  45. <text class="list-details-title">{{ pros.name }}</text>
  46. <text class="list-details-specs">规格:{{ pros.unit != null ? pros.unit : '' }}</text>
  47. <template v-if="userIdentity == 4 && vipFlag != 1">
  48. <view class="list-details-price" v-if="pros.priceFlag == 1">
  49. <view class="list-none"><view class="price-small">¥未公开价格</view></view>
  50. </view>
  51. <view class="list-details-price" v-else-if="pros.priceFlag == 2">
  52. <view class="list-none"><view class="price-small">¥价格仅会员可见</view></view>
  53. </view>
  54. <view class="list-details-price" v-else-if="pros.priceFlag == 3">
  55. <view class="list-none"><view class="price-small">¥仅医美机构可见</view></view>
  56. </view>
  57. <template v-else>
  58. <view class="list-details-price">
  59. <view class="list-price">
  60. <text
  61. class="price-larger"
  62. :class="PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1 ? 'none' : ''"
  63. >
  64. ¥{{
  65. (PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1
  66. ? pros.originalPrice
  67. : pros.price) | NumFormat
  68. }}
  69. </text>
  70. </view>
  71. <view class="add-cart-btn" v-if="!popupShow" @click.stop="showPopup(1, pros)"
  72. >数量</view
  73. >
  74. </view>
  75. <view class="list-details-price none">
  76. <view class="floor-item-act">
  77. <view class="coupon-tags" v-if="item.product.couponsLogo">优惠券</view>
  78. <template v-if="pros.actStatus == 1">
  79. <view
  80. class="floor-tags"
  81. v-if="pros.actStatus == 1 && PromotionsFormat(pros.promotions)"
  82. >
  83. {{ pros.promotions.name }}
  84. <text v-if="hasLogin && userIdentity == 2 && pros.priceFlag != 1"
  85. >:¥{{ pros.price | NumFormat }}</text
  86. >
  87. </view>
  88. <view class="floor-tags" v-else>{{ pros.promotions.name }}</view>
  89. </template>
  90. <template v-if="pros.svipProductFlag == 1">
  91. <view class="svip-tags">
  92. <view class="tags" :class="{ none: vipFlag == 0 }">SVIP</view>
  93. <view class="price" v-if="isShowVipFlag(pros)">{{
  94. pros.svipPriceTag
  95. }}</view>
  96. </view>
  97. </template>
  98. </view>
  99. </view>
  100. </template>
  101. </template>
  102. <template v-else>
  103. <view class="list-details-price" v-if="pros.priceFlag == 1">
  104. <view class="list-none"><view class="price-small">¥未公开价格</view></view>
  105. </view>
  106. <view class="list-details-price" v-else-if="pros.priceFlag == 3 && (firstClubType!=1)">
  107. <view class="list-none"><view class="price-small">¥仅医美机构可见</view></view>
  108. </view>
  109. <template v-else>
  110. <view class="list-details-price">
  111. <view class="list-price">
  112. <text
  113. class="price-larger"
  114. :class="PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1 ? 'none' : ''"
  115. >
  116. ¥{{
  117. (PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1
  118. ? pros.originalPrice
  119. : pros.price) | NumFormat
  120. }}
  121. </text>
  122. </view>
  123. <view class="add-cart-btn" v-if="!popupShow" @click.stop="showPopup(1, pros)"
  124. >数量</view
  125. >
  126. </view>
  127. <view class="list-details-price none">
  128. <view class="floor-item-act">
  129. <template v-if="pros.actStatus == 1">
  130. <view
  131. class="floor-tags"
  132. v-if="pros.actStatus == 1 && PromotionsFormat(pros.promotions)"
  133. >
  134. {{ pros.promotions.name }}
  135. <text v-if="hasLogin && userIdentity == 2 && pros.priceFlag != 1"
  136. >:¥{{ pros.price | NumFormat }}</text
  137. >
  138. </view>
  139. <view class="floor-tags" v-else>{{ pros.promotions.name }}</view>
  140. </template>
  141. <template v-if="pros.svipProductFlag == 1">
  142. <view class="svip-tags">
  143. <view class="tags" :class="{ none: !isShowVipFlag(pros) }">SVIP</view>
  144. <view class="price" v-if="isShowVipFlag(pros)">{{
  145. pros.svipPriceTag
  146. }}</view>
  147. </view>
  148. </template>
  149. </view>
  150. </view>
  151. </template>
  152. </template>
  153. </view>
  154. </view>
  155. </view>
  156. </view>
  157. <!--加载loadding-->
  158. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  159. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#ffffff'" :text="nomoreText"></tui-nomore>
  160. <!--加载loadding-->
  161. </view>
  162. </view>
  163. <!-- 取消收藏操作 -->
  164. <tui-bottom-popup :radius="false" :mask="false" :show="popupShow">
  165. <view class="tui-popup-box clearfix">
  166. <view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom: isIphoneX ? '68rpx' : '0rpx' }">
  167. <view class="tui-flex-1">
  168. <view class="superv-header-checked">
  169. <view class="oltext" @click="isCheckedAll">
  170. <view
  171. class="checkbox iconfont"
  172. :class="[isAllChecked ? 'icon-yixuanze' : 'icon-weixuanze']"
  173. ></view>
  174. <view class="text">全选</view>
  175. </view>
  176. </view>
  177. <view class="tui-button" :class="isProductChecked ? 'active' : ''" @click="handleAllUnder"
  178. >取消收藏</view
  179. >
  180. </view>
  181. </view>
  182. </view>
  183. </tui-bottom-popup>
  184. <!-- 购买弹窗 -->
  185. <tui-bottom-popup :radius="true" :show="popupShow1" @close="hidePopup(1)">
  186. <view class="tui-popup-box clearfix">
  187. <view class="tui-popup-content">
  188. <view class="layer-smimg"> <image :src="handleData.image" mode=""></image> </view>
  189. <view class="layer-nunbox">
  190. <view class="layer-nunbox-t">
  191. <view class="layer-nunbox-text">数量:</view>
  192. <view class="number-box">
  193. <view
  194. class="iconfont icon-jianhao"
  195. :class="[isQuantity == true ? 'disabled' : '']"
  196. @click="changeCountSub()"
  197. ></view>
  198. <input
  199. class="btn-input"
  200. type="number"
  201. v-model="number"
  202. maxlength="4"
  203. @blur="changeNumber($event)"
  204. />
  205. <view
  206. class="iconfont icon-jiahao"
  207. :class="[isStock == true ? 'disabled' : '']"
  208. @click="changeCountAdd()"
  209. ></view>
  210. </view>
  211. </view>
  212. <view class="layer-nunbox-b">
  213. <view class="text"
  214. >单价: <text class="p sm">¥</text>
  215. <text class="p bg">{{ buyRetailPrice.toFixed(2) }}</text>
  216. </view>
  217. </view>
  218. </view>
  219. </view>
  220. <view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom: isIphoneX ? '68rpx' : '0rpx' }">
  221. <view class="tui-flex-btn">
  222. <view class="button add" @click="getAddProductCart">加入购物车</view>
  223. <view class="button buy" @click="toConfirmation">立即购买</view>
  224. </view>
  225. </view>
  226. </view>
  227. </tui-bottom-popup>
  228. <!-- 弹窗提示 -->
  229. <tui-modal
  230. :show="modal"
  231. @click="handleClick"
  232. @cancel="hideMobel"
  233. :content="contentModalText"
  234. :button="modalButton"
  235. color="#333"
  236. :size="32"
  237. shape="circle"
  238. :maskClosable="false"
  239. >
  240. </tui-modal>
  241. <!-- 可拖动悬浮按钮 -->
  242. <cm-drag
  243. :cartNum="cartQuantity"
  244. :isDock="true"
  245. :existTabBar="true"
  246. @btnClick="btnClick"
  247. @btnTouchstart="btnTouchstart"
  248. @btnTouchend="btnTouchend"
  249. >
  250. </cm-drag>
  251. </view>
  252. </template>
  253. <script>
  254. import tuiLoadmore from '@/components/tui-components/loadmore/loadmore'
  255. import tuiNomore from '@/components/tui-components/nomore/nomore'
  256. import cmDrag from '@/components/cm-custom/cm-drag.vue'
  257. import { mapState, mapMutations } from 'vuex'
  258. const defaultListQuery = {
  259. userId: 0,
  260. pageNum: 1,
  261. pageSize: 10
  262. }
  263. export default {
  264. components: {
  265. tuiLoadmore,
  266. tuiNomore,
  267. cmDrag
  268. },
  269. data() {
  270. return {
  271. StaticUrl: this.$Static,
  272. isIphoneX: this.$store.state.isIphoneX,
  273. modalButton: [
  274. {
  275. text: '取消',
  276. type: 'gray',
  277. plain: true //是否空心
  278. },
  279. {
  280. text: '确认',
  281. customStyle: {
  282. color: '#fff',
  283. bgColor: 'linear-gradient(90deg, #F28F31 0%, #E15616 100%)'
  284. },
  285. plain: false
  286. }
  287. ],
  288. totalRecord: 0,
  289. cartQuantity: 0,
  290. popupShow: false,
  291. popupShow1: false,
  292. isProductChecked: false,
  293. listQuery: Object.assign({}, defaultListQuery),
  294. productList: [],
  295. handleData: {},
  296. number: 0,
  297. buyRetailPrice: 0,
  298. buyRetailPriceStep: 1,
  299. isQuantity: false,
  300. scrollTop: 0,
  301. isEmpty: false,
  302. isAllChecked: false,
  303. loadding: false,
  304. pullUpOn: true,
  305. pullFlag: true,
  306. hasNextPage: false,
  307. navbarHeight: '',
  308. nomoreText: '上拉显示更多',
  309. contentModalText: '', //操作文字提示语句
  310. modal: false,
  311. vipFlag:0,
  312. userIdentity:0,
  313. firstClubType:0
  314. }
  315. },
  316. onLoad() {
  317. this.initGetStotage()
  318. },
  319. filters: {
  320. NumFormat: function(value) {
  321. //处理金额
  322. if (!value) return '0.00'
  323. let number = Number(value).toFixed(2)
  324. return number
  325. }
  326. },
  327. computed: {
  328. ...mapState(['hasLogin', 'userInfo','clubType'])
  329. },
  330. methods: {
  331. ...mapMutations(['login', 'logout']),
  332. async initGetStotage() {
  333. const userInfo = await this.$api.getStorage()
  334. this.listQuery.userId = userInfo.userId ? userInfo.userId : 0
  335. this.vipFlag = userInfo.vipFlag ? userInfo.vipFlag : 0
  336. this.userIdentity = userInfo.userIdentity ? userInfo.userIdentity : 0
  337. this.firstClubType = this.clubType
  338. this.GetProductListInfo()
  339. this.ProductCartNumber()
  340. },
  341. GetProductListInfo() {
  342. this.productList = []
  343. this.listQuery.pageNum = 1
  344. this.ProductService.getProductUserLikeList(this.listQuery)
  345. .then(response => {
  346. let data = response.data
  347. if (data.results && data.results.length > 0) {
  348. this.isEmpty = false
  349. this.hasNextPage = data.hasNextPage
  350. this.totalRecord = data.totalRecord
  351. this.productList = data.results
  352. this.pullFlag = false
  353. setTimeout(() => {
  354. this.pullFlag = true
  355. }, 500)
  356. if (this.hasNextPage) {
  357. this.pullUpOn = false
  358. this.nomoreText = '上拉显示更多'
  359. } else {
  360. if (this.productList.length < 8) {
  361. this.pullUpOn = true
  362. } else {
  363. this.pullUpOn = false
  364. this.loadding = false
  365. this.nomoreText = '已至底部'
  366. }
  367. }
  368. } else {
  369. this.isEmpty = true
  370. }
  371. this.isRequest = true
  372. })
  373. .catch(error => {
  374. this.$util.msg(error.msg, 2000)
  375. })
  376. },
  377. GetOnReachBottomData(index) {
  378. //上拉加载
  379. this.listQuery.pageNum += 1
  380. this.ProductService.getProductUserLikeList(this.listQuery)
  381. .then(response => {
  382. let data = response.data
  383. if (data.results && data.results.length > 0) {
  384. this.hasNextPage = data.hasNextPage
  385. this.productList = this.productList.concat(data.results)
  386. this.pullFlag = false // 防上拉暴滑
  387. setTimeout(() => {
  388. this.pullFlag = true
  389. }, 500)
  390. if (this.hasNextPage) {
  391. this.pullUpOn = false
  392. this.nomoreText = '上拉显示更多'
  393. } else {
  394. this.pullUpOn = false
  395. this.loadding = false
  396. this.nomoreText = '已至底部'
  397. }
  398. }
  399. })
  400. .catch(error => {
  401. this.$util.msg(error.msg, 2000)
  402. })
  403. },
  404. ProductCartNumber() {
  405. // 获取用户购物车储量
  406. this.ProductService.ProductCartNumber({
  407. userId: this.listQuery.userId
  408. })
  409. .then(response => {
  410. this.cartQuantity = response.data
  411. })
  412. .catch(error => {
  413. console.log('获取购物车数量失败')
  414. })
  415. },
  416. handleAllUnder() {
  417. //批量下架操作
  418. let checkedArray = []
  419. this.productIds = ''
  420. if (this.isProductChecked) {
  421. this.productList.forEach(el => {
  422. if (el.isChecked) {
  423. checkedArray.push(el)
  424. }
  425. })
  426. checkedArray.forEach(el => {
  427. this.productIds += el.productId + ','
  428. })
  429. this.modal = true
  430. this.contentModalText = '确定要取消收藏吗?'
  431. }
  432. },
  433. handleClick(e) {
  434. //取消收藏
  435. if (e.index == 1) {
  436. this.handleDeleteUserLike()
  437. }
  438. this.modal = false
  439. },
  440. handleDeleteUserLike() {
  441. //操作取消收藏
  442. this.ProductService.getDeleteUserLike({
  443. productIds: this.productIds,
  444. userId: this.listQuery.userId
  445. })
  446. .then(response => {
  447. this.$util.msg('取消收藏成功', 2000, true, 'success')
  448. setTimeout(() => {
  449. this.GetProductListInfo()
  450. }, 2000)
  451. })
  452. .catch(error => {
  453. this.$util.msg(error.msg, 2000)
  454. })
  455. },
  456. hideMobel() {
  457. this.modal = false
  458. },
  459. updateCheckAllBtn() {
  460. //勾选单个判断全选
  461. let goodsCheckedLength = 0
  462. this.productList.forEach(item => {
  463. if (item.isChecked) {
  464. goodsCheckedLength++
  465. }
  466. })
  467. this.isAllChecked = goodsCheckedLength === this.productList.length
  468. if (goodsCheckedLength > 0) {
  469. this.isProductChecked = true
  470. } else {
  471. this.isProductChecked = false
  472. }
  473. },
  474. updateBothCheckBtn() {
  475. //全选勾选判断
  476. this.productList.forEach(item => {
  477. item.isChecked = this.isAllChecked
  478. })
  479. },
  480. isCheckedAll() {
  481. //全选
  482. this.isAllChecked = !this.isAllChecked
  483. if (this.isAllChecked) {
  484. this.isProductChecked = true
  485. } else {
  486. this.isProductChecked = false
  487. }
  488. this.updateBothCheckBtn()
  489. },
  490. checkedSoperv(item) {
  491. //选择
  492. item.isChecked = !item.isChecked
  493. console.log(item)
  494. this.updateCheckAllBtn()
  495. },
  496. PromotionsFormat(promo) {
  497. //促销活动类型数据处理
  498. if (promo != null) {
  499. if (promo.type == 1 && promo.mode == 1) {
  500. return true
  501. } else {
  502. return false
  503. }
  504. }
  505. return false
  506. },
  507. changeCountAdd() {
  508. //popup弹窗数量增加按钮
  509. if (this.buyRetailPriceStep == 2) {
  510. this.number += this.handleData.minBuyNumber
  511. } else {
  512. this.number++
  513. }
  514. this.calculatPerice()
  515. },
  516. changeCountSub() {
  517. //popup弹窗数量减按钮
  518. if (this.number <= this.handleData.minBuyNumber) {
  519. this.number = this.handleData.minBuyNumber
  520. this.isQuantity = true
  521. this.$util.msg(`该商品最小起订量为${this.handleData.minBuyNumber}`, 2000)
  522. return
  523. } else {
  524. if (this.buyRetailPriceStep == 2) {
  525. this.number -= this.handleData.minBuyNumber
  526. } else {
  527. this.number--
  528. }
  529. this.calculatPerice()
  530. this.isQuantity = false
  531. }
  532. },
  533. changeNumber(e) {
  534. let _value = e.detail.value
  535. if (!this.$api.isNumber(_value)) {
  536. this.number = this.handleData.minBuyNumber
  537. } else if (_value < this.handleData.minBuyNumber) {
  538. this.$util.msg(`该商品最小起订量为${this.handleData.minBuyNumber}`, 2000)
  539. this.number = this.handleData.minBuyNumber
  540. } else if (_value % this.handleData.minBuyNumber != 0) {
  541. this.$util.msg('购买量必须为起订量的整数倍', 2000)
  542. this.number = this.handleData.minBuyNumber
  543. } else {
  544. this.number = e.detail.value
  545. this.calculatPerice()
  546. }
  547. },
  548. calculatPerice() {
  549. //判断是否为阶梯价然后做计算价格处理
  550. if (this.handleData.ladderPriceFlag == 1) {
  551. this.handleData.ladderPrices.forEach((item, index) => {
  552. if (this.number >= item.buyNum) {
  553. this.buyRetailPrice = item.buyPrice
  554. }
  555. })
  556. }
  557. },
  558. toConfirmation() {
  559. //跳转确认订单页面
  560. this.popupShow1 = false
  561. let productStp = {
  562. productIds: this.handleData.productId,
  563. productCount: this.number
  564. }
  565. console.log('productStp',productStp)
  566. this.$api.navigateTo(
  567. `/pages/user/order/create-order?type=1&data=${JSON.stringify({ data: productStp })}`
  568. )
  569. },
  570. getAddProductCart() {
  571. //增加购物车成功和toast弹窗提示成功
  572. this.ProductService.shoppingAddCart({
  573. productId: this.handleData.productId,
  574. userId: this.listQuery.userId,
  575. productCount: this.number
  576. })
  577. .then(response => {
  578. this.popupShow1 = false
  579. this.$util.msg('加入购物车成功', 1500, true, 'success')
  580. this.ProductCartNumber()
  581. })
  582. .catch(error => {
  583. this.$util.msg(error.msg, 2000)
  584. })
  585. },
  586. showPopup(index, pros) {
  587. // 弹窗显示
  588. switch (index) {
  589. case 0:
  590. this.popupShow = true
  591. break
  592. case 1:
  593. this.popupShow1 = true
  594. this.handleData = pros
  595. console.log(this.handleData)
  596. this.buyRetailPrice = this.handleData.price
  597. this.buyRetailPriceStep = this.handleData.step
  598. if (this.handleData.ladderPriceFlag == 1) {
  599. this.number = this.handleData.maxBuyNumber ? this.handleData.maxBuyNumber : 1
  600. } else {
  601. this.number = this.handleData.minBuyNumber
  602. }
  603. break
  604. }
  605. },
  606. hidePopup(index) {
  607. // 弹窗隐藏
  608. switch (index) {
  609. case 0:
  610. this.popupShow = false
  611. break
  612. case 1:
  613. this.popupShow1 = false
  614. break
  615. }
  616. },
  617. isShowVipFlag(pros) {
  618. /**
  619. *显示SVIP和超级会员价格:
  620. * 个人机构(不是超级会员,但价格所有机构可见),
  621. * 资质机构(不是超级会员,但价格所有机构可见或仅会员可见),
  622. * 超级会员(价格所有机构可见或仅会员可见),超级会员(是医美机构,价格仅医美可见)
  623. *商品价格是否可见:priceFlag 0:所有机构可见 1:未公开价格 2:仅会员可见 3:仅医美机构可见
  624. * 普通机构
  625. * 超级会员 && priceFlag === 0
  626. * 资质机构
  627. * priceFlag !== 1 ||
  628. * 超级会员
  629. * 商品priceFlag === 3 && 是否是医美机构
  630. */
  631. // 未登录 || 非会员
  632. if(!this.hasLogin || !this.vipFlag === 1) return false
  633. // 商品所有机构可见
  634. if(pros.priceFlag === 0 ) return true
  635. // 商品价格仅资质机构可见
  636. if(pros.priceFlag === 2 && this.userIdentity === 2) return true
  637. // 商品价格仅医美机构可见
  638. if(pros.priceFlag === 3 && this.userIdentity === 2 && this.firstClubType == 1) return true
  639. // 其它
  640. return false
  641. },
  642. navToDetailPage(id) {
  643. this.isModallayer = true
  644. this.$api.navigateTo(`/pages/goods/product?id=${id}`)
  645. this.isModallayer = false
  646. },
  647. btnClick() {
  648. this.$api.switchTabTo('/pages/tabBar/cart/index')
  649. },
  650. btnTouchstart() {
  651. // console.log('btnTouchstart');
  652. },
  653. btnTouchend() {
  654. // console.log('btnTouchend');
  655. }
  656. },
  657. onPageScroll(e) {
  658. //实时获取到滚动的值
  659. },
  660. onReachBottom() {
  661. if (this.hasNextPage) {
  662. this.loadding = true
  663. this.pullUpOn = true
  664. this.GetOnReachBottomData()
  665. }
  666. },
  667. onPullDownRefresh() {
  668. setTimeout(() => {
  669. this.listQuery.pageNum = 1
  670. uni.stopPullDownRefresh()
  671. }, 200)
  672. },
  673. onShow() {}
  674. }
  675. </script>
  676. <style lang="scss">
  677. @import '@/uni.scss';
  678. page {
  679. background: #fff;
  680. }
  681. .empty-container {
  682. z-index: 9999;
  683. }
  684. .superv-header {
  685. width: 100%;
  686. height: 80rpx;
  687. background-color: #f7f7f7;
  688. line-height: 80rpx;
  689. position: fixed;
  690. top: 0;
  691. left: 0;
  692. box-sizing: border-box;
  693. padding: 0 24rpx;
  694. z-index: 99;
  695. .superv-header-click {
  696. width: 100%;
  697. height: 80rpx;
  698. font-size: $font-size-30;
  699. .oltext {
  700. float: left;
  701. color: #666666;
  702. .red {
  703. color: $color-system;
  704. }
  705. }
  706. .ortext {
  707. float: right;
  708. color: #333333;
  709. text-align: right;
  710. }
  711. }
  712. }
  713. .tui-header {
  714. width: 100%;
  715. font-size: 16px;
  716. font-weight: 500;
  717. height: 32px;
  718. display: flex;
  719. align-items: center;
  720. justify-content: center;
  721. position: relative;
  722. padding: 0 40rpx;
  723. }
  724. .header-sit {
  725. width: 100%;
  726. box-sizing: border-box;
  727. height: 80rpx;
  728. line-height: 80rpx;
  729. box-sizing: border-box;
  730. padding: 0 40rpx;
  731. text-align: left;
  732. font-size: $font-size-40;
  733. color: #ffffff;
  734. font-weight: 600;
  735. font-family: '正楷';
  736. margin-top: 30rpx;
  737. .iconfont {
  738. font-size: 42rpx;
  739. margin-left: 30rpx;
  740. }
  741. }
  742. .mine {
  743. width: 100%;
  744. height: 100%;
  745. position: relative;
  746. }
  747. .product-content {
  748. width: 100%;
  749. height: auto;
  750. position: relative;
  751. padding: 0;
  752. padding-top: 80rpx;
  753. box-sizing: border-box;
  754. .empty-container-image {
  755. width: 260rpx;
  756. height: 260rpx;
  757. margin-top: -300rpx;
  758. }
  759. }
  760. .tui-goods-item {
  761. padding: 30rpx 20rpx 0 20rpx;
  762. box-sizing: border-box;
  763. position: relative;
  764. .tui-goods-main {
  765. display: flex;
  766. width: 100%;
  767. height: 100%;
  768. border-bottom: 1px solid #ebebeb;
  769. padding-bottom: 24rpx;
  770. }
  771. }
  772. .tui-goods-checkBox {
  773. display: flex;
  774. align-items: center;
  775. margin: 0 15rpx;
  776. .checkbox {
  777. display: flex;
  778. margin: 0;
  779. padding: 0;
  780. display: flex;
  781. flex-direction: column;
  782. align-items: center;
  783. box-sizing: border-box;
  784. text-align: center;
  785. text-decoration: none;
  786. border-radius: 0;
  787. -webkit-tap-highlight-color: transparent;
  788. overflow: hidden;
  789. background-color: #ffffff;
  790. font-size: 36rpx;
  791. color: $color-system;
  792. }
  793. .text {
  794. font-size: $font-size-24;
  795. margin-left: 10rpx;
  796. }
  797. }
  798. .tui-goods-image {
  799. width: 180rpx;
  800. height: 180rpx !important;
  801. border: 2rpx solid #f3f3f3;
  802. border-radius: 12rpx;
  803. position: relative;
  804. border: 2rpx solid #f3f3f3;
  805. .tui-goods-img {
  806. width: 180rpx;
  807. height: 180rpx !important;
  808. border-radius: 12rpx;
  809. flex-shrink: 0;
  810. display: block;
  811. }
  812. .tui-goods-type{
  813. width: 64rpx;
  814. height: 64rpx;
  815. text-align: justify;
  816. box-sizing: border-box;
  817. padding: 10rpx;
  818. border-radius: 0 0 8rpx 8rpx;
  819. background-color: #33CCBF;
  820. font-size: $font-size-22;
  821. color: #FFFFFF;
  822. line-height: 25rpx;
  823. position: absolute;
  824. top: 0;
  825. right: 10rpx;
  826. }
  827. }
  828. .tui-goods-info {
  829. padding-left: 20rpx;
  830. box-sizing: border-box;
  831. position: relative;
  832. .list-details-title {
  833. line-height: 38rpx;
  834. text-overflow: ellipsis;
  835. overflow: hidden;
  836. display: -webkit-box;
  837. -webkit-line-clamp: 2;
  838. line-clamp: 2;
  839. -webkit-box-orient: vertical;
  840. font-size: 26rpx;
  841. color: #333333;
  842. }
  843. .list-details-specs {
  844. width: 100%;
  845. display: inline-block;
  846. margin-top: 8rpx;
  847. color: #999999;
  848. font-size: 24rpx;
  849. }
  850. .list-details-price {
  851. width: 100%;
  852. line-height: 54rpx;
  853. float: left;
  854. &.none {
  855. height: 32rpx;
  856. line-height: 32rpx;
  857. }
  858. .floor-item-act {
  859. height: 54rpx;
  860. text-align: center;
  861. box-sizing: border-box;
  862. float: left;
  863. }
  864. .price-icon {
  865. width: 22rpx;
  866. height: 28rpx;
  867. vertical-align: middle;
  868. margin-right: 10rpx;
  869. }
  870. .price-icon + text {
  871. font-size: 25rpx;
  872. vertical-align: middle;
  873. }
  874. .list-login-now {
  875. width: 375rpx;
  876. color: #f8c499;
  877. position: absolute;
  878. bottom: 0;
  879. .p-no {
  880. float: left;
  881. font-size: $font-size-24;
  882. color: $color-system;
  883. margin-right: 10rpx;
  884. }
  885. }
  886. .login-now {
  887. padding: 10rpx 10rpx 10rpx 0;
  888. }
  889. .list-none {
  890. margin-top: 20rpx;
  891. .price-small {
  892. font-size: $font-size-26;
  893. line-height: 40rpx;
  894. color: #ff2a2a;
  895. }
  896. }
  897. .list-price {
  898. color: #ff2a2a;
  899. float: left;
  900. line-height: 54rpx;
  901. align-items: center;
  902. justify-content: center;
  903. .price-larger {
  904. font-size: $font-size-30;
  905. display: inline-block;
  906. &.none {
  907. text-decoration: line-through;
  908. color: #999999;
  909. }
  910. }
  911. }
  912. .add-cart-btn {
  913. float: right;
  914. width: 140rpx;
  915. height: 54rpx;
  916. line-height: 54rpx;
  917. border-radius: 30rpx;
  918. color: #fff;
  919. font-size: 24rpx;
  920. margin-right: 0;
  921. background: #ffffff;
  922. border: 1px solid #c9c9c9;
  923. color: $text-color;
  924. text-align: center;
  925. }
  926. }
  927. }
  928. .tui-popup-box {
  929. position: relative;
  930. box-sizing: border-box;
  931. min-height: 168rpx;
  932. padding: 6rpx 24rpx;
  933. .tui-popup-content {
  934. padding-top: 30rpx;
  935. }
  936. }
  937. .layer-smimg {
  938. width: 114rpx;
  939. height: 114rpx;
  940. float: left;
  941. border-radius: 10rpx;
  942. margin-right: 24rpx;
  943. image {
  944. width: 114rpx;
  945. height: 114rpx;
  946. border-radius: 10rpx;
  947. }
  948. }
  949. .layer-nunbox {
  950. justify-content: space-between;
  951. align-items: center;
  952. width: 536rpx;
  953. height: 88rpx;
  954. padding: 13rpx 0 0 0;
  955. float: left;
  956. .layer-nunbox-t {
  957. width: 100%;
  958. height: 44rpx;
  959. position: relative;
  960. display: flex;
  961. .layer-nunbox-text {
  962. line-height: 44rpx;
  963. font-size: $font-size-28;
  964. }
  965. .number-box {
  966. display: flex;
  967. justify-content: center;
  968. align-items: center;
  969. border: 2rpx solid #ffe6dc;
  970. border-radius: 30rpx;
  971. height: 48rpx;
  972. margin-left: 20rpx;
  973. .iconfont {
  974. font-size: $font-size-24;
  975. padding: 0 18rpx;
  976. color: #999999;
  977. text-align: center;
  978. line-height: 48rpx;
  979. font-weight: bold;
  980. background: #fef6f3;
  981. &.icon-jianhao {
  982. border-radius: 30rpx 0 0 30rpx;
  983. }
  984. &.icon-jiahao {
  985. border-radius: 0 30rpx 30rpx 0;
  986. }
  987. }
  988. .btn-input {
  989. width: 62rpx;
  990. height: 48rpx;
  991. line-height: 48rpx;
  992. background: #ffffff;
  993. border-radius: 4rpx;
  994. text-align: center;
  995. font-size: $font-size-28;
  996. }
  997. }
  998. .product-step {
  999. position: absolute;
  1000. left: 45rpx;
  1001. bottom: 0;
  1002. height: 44rpx;
  1003. background: #ffffff;
  1004. }
  1005. }
  1006. .layer-nunbox-b {
  1007. width: 100%;
  1008. height: 44rpx;
  1009. margin-top: 13rpx;
  1010. }
  1011. .text {
  1012. line-height: 44rpx;
  1013. font-size: $font-size-28;
  1014. .p {
  1015. color: #ff2a2a;
  1016. }
  1017. .p:first-child {
  1018. margin-left: 30rpx;
  1019. }
  1020. .p.sm {
  1021. font-size: $font-size-24;
  1022. }
  1023. }
  1024. }
  1025. .tui-popup-btn {
  1026. width: 100%;
  1027. height: auto;
  1028. float: left;
  1029. box-sizing: border-box;
  1030. margin-top: 30rpx;
  1031. .superv-header-checked {
  1032. float: left;
  1033. font-size: $font-size-30;
  1034. .oltext {
  1035. width: 120rpx;
  1036. float: left;
  1037. color: #666666;
  1038. display: flex;
  1039. margin-left: 10rpx;
  1040. .checkbox {
  1041. display: flex;
  1042. margin: 0;
  1043. padding: 0;
  1044. display: flex;
  1045. flex-direction: column;
  1046. align-items: center;
  1047. box-sizing: border-box;
  1048. text-align: center;
  1049. text-decoration: none;
  1050. border-radius: 0;
  1051. -webkit-tap-highlight-color: transparent;
  1052. overflow: hidden;
  1053. font-size: 34rpx;
  1054. color: $color-system;
  1055. line-height: 80rpx;
  1056. }
  1057. .text {
  1058. float: left;
  1059. line-height: 80rpx;
  1060. margin-left: 15rpx;
  1061. }
  1062. }
  1063. .ortext {
  1064. width: 120rpx;
  1065. float: right;
  1066. color: $color-system;
  1067. text-align: right;
  1068. }
  1069. }
  1070. .tui-button {
  1071. width: 210rpx;
  1072. height: 88rpx;
  1073. float: right;
  1074. background: #e1e1e1;
  1075. line-height: 88rpx;
  1076. text-align: center;
  1077. color: #ffffff;
  1078. font-size: $font-size-28;
  1079. border-radius: 44rpx;
  1080. &.active {
  1081. background: $btn-confirm;
  1082. }
  1083. }
  1084. .tui-flex-btn {
  1085. width: 100%;
  1086. height: 88rpx;
  1087. display: flex;
  1088. box-sizing: border-box;
  1089. padding: 0 34rpx;
  1090. .button {
  1091. width: 280rpx;
  1092. height: 88rpx;
  1093. color: #fff;
  1094. display: flex;
  1095. align-items: center;
  1096. justify-content: center;
  1097. font-size: $font-size-28;
  1098. border-radius: 44rpx;
  1099. &.buy {
  1100. background: $btn-confirm;
  1101. margin-left: 78rpx;
  1102. }
  1103. &.add {
  1104. background: #ffe6dc;
  1105. color: #e15616;
  1106. }
  1107. }
  1108. }
  1109. }
  1110. </style>