collection.vue 27 KB

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