goods-supporting.vue 29 KB

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