goods-supporting.vue 30 KB

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