goods-supporting.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188
  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' : '#F3B574' }"
  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"></tui-loadmore>
  269. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#ffffff'" :text="nomoreText"></tui-nomore>
  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. ></cm-unit-suppor-popup>
  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 tuiLoadmore from '@/components/tui-components/loadmore/loadmore'
  303. import tuiNomore from '@/components/tui-components/nomore/nomore'
  304. import uniGrader from '@/components/uni-grade/uni-grade.vue'
  305. import cmUnitSupporPopup from './components/cm-unit-suppor-popup.vue'
  306. import { mapState, mapMutations } from 'vuex'
  307. export default {
  308. components: {
  309. tuiLoadmore,
  310. tuiNomore,
  311. uniGrader,
  312. cmUnitSupporPopup
  313. },
  314. data() {
  315. return {
  316. StaticUrl: this.$Static,
  317. isIphoneX: this.$store.state.isIphoneX,
  318. totalRecord: 0,
  319. cartQuantity: 0,
  320. popupShow: true,
  321. popupShow1:false,
  322. listQuery: {
  323. userId: 0,
  324. productId: 0,
  325. source: 2,
  326. pageNum: 1,
  327. pageSize: 50
  328. },
  329. productList: [],
  330. handleData: {},
  331. number: 0,
  332. buyRetailPrice: 0,
  333. buyRetailPriceStep: 1,
  334. isQuantity: false,
  335. scrollTop: 0,
  336. isEmpty: false,
  337. isAllChecked: false,
  338. navbarHeight: '',
  339. loadding: false,
  340. pullUpOn: true,
  341. pullFlag: true,
  342. hasNextPage: false,
  343. nomoreText: '上拉显示更多',
  344. vipFlag: 0,
  345. userIdentity: 0,
  346. firstClubType: 0,
  347. isStock: false,
  348. handlePros:{}//
  349. }
  350. },
  351. onLoad(option) {
  352. this.listQuery.productId = option.productId
  353. this.initGetStotage()
  354. },
  355. filters: {
  356. NumFormat: function(value) {
  357. //处理金额
  358. if (!value) return '0.00'
  359. let number = Number(value).toFixed(2)
  360. return number
  361. }
  362. },
  363. computed: {
  364. ...mapState(['hasLogin', 'userInfo', 'clubType'])
  365. },
  366. methods: {
  367. ...mapMutations(['login', 'logout']),
  368. async initGetStotage() {
  369. const userInfo = await this.$api.getStorage()
  370. this.listQuery.userId = userInfo.userId ? userInfo.userId : 0
  371. this.vipFlag = userInfo.vipFlag ? userInfo.vipFlag : 0
  372. this.userIdentity = userInfo.userIdentity ? userInfo.userIdentity : 0
  373. this.firstClubType = this.clubType
  374. this.getCommodityCombinationList()
  375. },
  376. getCommodityCombinationList() {
  377. // 初始化商品详情配套商品
  378. this.ProductService.getCommodityCombinationList(this.listQuery)
  379. .then(response => {
  380. let data = response.data
  381. this.hasNextPage = data.hasNextPage
  382. this.productList = data.results.map((pros, index) => {
  383. pros.isChecked = false
  384. pros.number = pros.minBuyNumber
  385. return pros
  386. })
  387. this.pullFlag = false
  388. setTimeout(() => {
  389. this.pullFlag = true
  390. }, 500)
  391. if (this.hasNextPage) {
  392. this.pullUpOn = false
  393. this.nomoreText = '上拉显示更多'
  394. } else {
  395. if (this.productList.length < 8) {
  396. this.pullUpOn = true
  397. } else {
  398. this.pullUpOn = false
  399. this.loadding = false
  400. this.nomoreText = '已至底部'
  401. }
  402. }
  403. })
  404. .catch(error => {
  405. console.log('获取组合商品列表失败')
  406. })
  407. },
  408. GetOnReachBottomData() {
  409. //上拉加载
  410. this.listQuery.pageNum += 1
  411. this.ProductService.getCommodityCombinationList(this.listQuery)
  412. .then(response => {
  413. let data = response.data
  414. if (data.results && data.results.length > 0) {
  415. this.hasNextPage = data.hasNextPage
  416. let list = data.results.map((pros, index) => {
  417. if (this.isAllChecked && !this.disabledChecked(pros)) {
  418. pros.isChecked = true
  419. } else {
  420. pros.isChecked = false
  421. }
  422. pros.number = pros.minBuyNumber
  423. return pros
  424. })
  425. this.productList = this.productList.concat(list)
  426. this.pullFlag = false // 防上拉暴滑
  427. setTimeout(() => {
  428. this.pullFlag = true
  429. }, 500)
  430. if (this.hasNextPage) {
  431. this.pullUpOn = false
  432. this.nomoreText = '上拉显示更多'
  433. } else {
  434. this.pullUpOn = false
  435. this.loadding = false
  436. this.nomoreText = '已至底部'
  437. }
  438. }
  439. })
  440. .catch(error => {
  441. this.$util.msg(error.msg, 2000)
  442. })
  443. },
  444. handleSupportingSubmit(type) {
  445. if (this.hasLogin) {
  446. switch (type) {
  447. case 'buy':
  448. this.handleToConfirm()
  449. break
  450. case 'add':
  451. this.handleAddClubCart()
  452. break
  453. }
  454. } else {
  455. this.$api.navigateTo('/pages/login/login')
  456. }
  457. },
  458. handleAddClubCart() {
  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 ,skuId:el.skuId })
  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. handleToConfirm() {
  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 ,skuId:el.skuId })
  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. // 非会员
  521. if (!this.vipFlag === 1) return true
  522. // 商品已下架 || 库存为0
  523. if (pros.validFlag === 3) return true
  524. // 商品价格不公开
  525. if (pros.priceFlag === 1) return true
  526. // 商品价格仅资质机构可见 && 机构为普通机构
  527. if (pros.priceFlag === 2 && this.userIdentity === 4 && this.vipFlag != 1) return true
  528. // 商品价格仅医美机构可见 && 机构为普通机构
  529. if (pros.priceFlag === 3 && this.userIdentity === 4 ) return true
  530. // 商品价格仅医美机构可见 && 机构为资质机构 && 不是医美机构
  531. if (pros.priceFlag === 3 && this.userIdentity === 2 && this.firstClubType != 1) return true
  532. //其他
  533. return false
  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.skuId = sku.skuId
  643. this.handlePros.unit = data.unit
  644. this.handlePros.number = data.number
  645. console.log('handlePros',this.handlePros)
  646. },
  647. handleSkuClick(sku){
  648. this.handlePros.skuId = sku.skuId
  649. this.handlePros.unit = sku.unit
  650. this.handlePros.number = sku.minBuyNumber
  651. this.handlePros.price = sku.price
  652. this.handlePros.originalPrice = sku.originalPrice
  653. },
  654. handlerUnit(pros){
  655. this.popupShow1 = true
  656. this.handlePros = pros
  657. },
  658. navToDetailPage(id) {
  659. this.isModallayer = true
  660. this.$api.navigateTo(`/pages/goods/product?id=${id}`)
  661. this.isModallayer = false
  662. }
  663. },
  664. onPageScroll(e) {
  665. //实时获取到滚动的值
  666. },
  667. onReachBottom() {
  668. if (this.hasNextPage) {
  669. this.loadding = true
  670. this.pullUpOn = true
  671. this.GetOnReachBottomData()
  672. }
  673. },
  674. onPullDownRefresh() {
  675. setTimeout(() => {
  676. this.getCommodityCombinationList()
  677. uni.stopPullDownRefresh()
  678. }, 200)
  679. },
  680. onShow() {}
  681. }
  682. </script>
  683. <style lang="scss">
  684. @import '@/uni.scss';
  685. page {
  686. background: #fff;
  687. }
  688. .empty-container {
  689. z-index: 9999;
  690. }
  691. .tui-header {
  692. width: 100%;
  693. font-size: 16px;
  694. font-weight: 500;
  695. height: 32px;
  696. display: flex;
  697. align-items: center;
  698. justify-content: center;
  699. position: relative;
  700. padding: 0 40rpx;
  701. }
  702. .header-sit {
  703. width: 100%;
  704. box-sizing: border-box;
  705. height: 80rpx;
  706. line-height: 80rpx;
  707. box-sizing: border-box;
  708. padding: 0 40rpx;
  709. text-align: left;
  710. font-size: $font-size-40;
  711. color: #ffffff;
  712. font-weight: 600;
  713. font-family: '正楷';
  714. margin-top: 30rpx;
  715. .iconfont {
  716. font-size: 42rpx;
  717. margin-left: 30rpx;
  718. }
  719. }
  720. .mine {
  721. width: 100%;
  722. height: 100%;
  723. position: relative;
  724. }
  725. .product-content {
  726. width: 100%;
  727. height: auto;
  728. position: relative;
  729. padding: 0;
  730. box-sizing: border-box;
  731. .empty-container-image {
  732. width: 260rpx;
  733. height: 260rpx;
  734. margin-top: -300rpx;
  735. }
  736. }
  737. .tui-goods-item {
  738. padding: 30rpx 20rpx 0 20rpx;
  739. box-sizing: border-box;
  740. position: relative;
  741. .tui-goods-main {
  742. display: flex;
  743. width: 100%;
  744. height: 100%;
  745. border-bottom: 1px solid #ebebeb;
  746. padding-bottom: 24rpx;
  747. &.none {
  748. border-bottom: none;
  749. }
  750. }
  751. }
  752. .tui-goods-checkBox {
  753. display: flex;
  754. align-items: center;
  755. margin: 0 15rpx;
  756. .checkbox {
  757. display: flex;
  758. margin: 0;
  759. padding: 0;
  760. display: flex;
  761. flex-direction: column;
  762. align-items: center;
  763. box-sizing: border-box;
  764. text-align: center;
  765. text-decoration: none;
  766. border-radius: 0;
  767. -webkit-tap-highlight-color: transparent;
  768. overflow: hidden;
  769. background-color: #ffffff;
  770. font-size: 36rpx;
  771. color: $color-system;
  772. }
  773. .text {
  774. font-size: $font-size-24;
  775. margin-left: 10rpx;
  776. }
  777. }
  778. .tui-goods-image {
  779. width: 180rpx;
  780. height: 180rpx !important;
  781. border-radius: 12rpx;
  782. position: relative;
  783. border: 2rpx solid #f3f3f3;
  784. .tui-goods-img {
  785. width: 180rpx;
  786. height: 180rpx !important;
  787. border-radius: 12rpx;
  788. flex-shrink: 0;
  789. display: block;
  790. }
  791. .tui-goods-type {
  792. width: 64rpx;
  793. height: 64rpx;
  794. text-align: justify;
  795. box-sizing: border-box;
  796. padding: 10rpx;
  797. border-radius: 0 0 8rpx 8rpx;
  798. background-color: #33ccbf;
  799. font-size: $font-size-22;
  800. color: #ffffff;
  801. line-height: 25rpx;
  802. position: absolute;
  803. top: 0;
  804. right: 10rpx;
  805. }
  806. }
  807. .tui-goods-info {
  808. width: 460rpx;
  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. .list-unit-tt{
  828. color: #999999;
  829. font-size: 24rpx;
  830. line-height: 40rpx;
  831. float: left;
  832. }
  833. .list-unit{
  834. width: 136rpx;
  835. line-height: 40rpx;
  836. display: inline-block;
  837. text-align: center;
  838. padding: 0 40rpx 0 16rpx;
  839. box-sizing: border-box;
  840. border: 1px solid #CCC;
  841. color: #999999;
  842. position: relative;
  843. border-radius: 6rpx;
  844. float: left;
  845. .list-unit-text{
  846. width: 80rpx;
  847. line-height: 40rpx;
  848. display: inline-block;
  849. text-align: left;
  850. font-size: 22rpx;
  851. text-overflow: ellipsis;
  852. overflow: hidden;
  853. display: -webkit-box;
  854. -webkit-line-clamp:1;
  855. line-clamp: 1;
  856. -webkit-box-orient: vertical;
  857. }
  858. .icon-xiangxiajiantou{
  859. display: block;
  860. width: 40rpx;
  861. height: 40rpx;
  862. line-height: 40rpx;
  863. color: #999999;
  864. position: absolute;
  865. right: 0;
  866. top: 0;
  867. font-size: 28rpx;
  868. }
  869. }
  870. }
  871. .list-details-price {
  872. width: 100%;
  873. line-height: 54rpx;
  874. float: left;
  875. .p-stars {
  876. float: left;
  877. .p-no {
  878. font-size: $font-size-28;
  879. color: $text-color;
  880. display: block;
  881. float: left;
  882. }
  883. }
  884. &.none {
  885. height: 32rpx;
  886. line-height: 32rpx;
  887. }
  888. .floor-item-act {
  889. height: 54rpx;
  890. text-align: center;
  891. box-sizing: border-box;
  892. float: left;
  893. }
  894. .price-icon {
  895. width: 22rpx;
  896. height: 28rpx;
  897. vertical-align: middle;
  898. margin-right: 10rpx;
  899. }
  900. .price-icon + text {
  901. font-size: 25rpx;
  902. vertical-align: middle;
  903. }
  904. .list-login-now {
  905. width: 375rpx;
  906. color: #f8c499;
  907. position: absolute;
  908. bottom: 0;
  909. .p-no {
  910. float: left;
  911. font-size: $font-size-24;
  912. color: $color-system;
  913. margin-right: 10rpx;
  914. }
  915. }
  916. .login-now {
  917. padding: 10rpx 10rpx 10rpx 0;
  918. }
  919. .list-none {
  920. margin-top: 20rpx;
  921. .price-small {
  922. font-size: $font-size-26;
  923. line-height: 40rpx;
  924. color: #ff2a2a;
  925. }
  926. }
  927. .list-price {
  928. color: #ff2a2a;
  929. float: left;
  930. line-height: 54rpx;
  931. align-items: center;
  932. justify-content: center;
  933. .price-larger {
  934. font-size: $font-size-30;
  935. display: inline-block;
  936. &.none {
  937. text-decoration: line-through;
  938. color: #999999;
  939. }
  940. }
  941. }
  942. .add-cart-btn {
  943. float: right;
  944. width: 186rpx;
  945. height: 54rpx;
  946. line-height: 54rpx;
  947. border-radius: 30rpx;
  948. color: #fff;
  949. font-size: 24rpx;
  950. margin-right: 0;
  951. background: #ffffff;
  952. color: $text-color;
  953. text-align: center;
  954. .number-box {
  955. display: flex;
  956. justify-content: center;
  957. align-items: center;
  958. border: 2rpx solid #ffe6dc;
  959. border-radius: 30rpx;
  960. .iconfont {
  961. font-size: $font-size-24;
  962. padding: 0 18rpx;
  963. color: #999999;
  964. text-align: center;
  965. line-height: 48rpx;
  966. font-weight: bold;
  967. background: #fef6f3;
  968. &.icon-jianhao {
  969. border-radius: 30rpx 0 0 30rpx;
  970. }
  971. &.icon-jiahao {
  972. border-radius: 0 30rpx 30rpx 0;
  973. }
  974. }
  975. .btn-input {
  976. width: 62rpx;
  977. height: 48rpx;
  978. line-height: 48rpx;
  979. background: #fff;
  980. border-radius: 4rpx;
  981. text-align: center;
  982. font-size: $font-size-24;
  983. }
  984. }
  985. }
  986. }
  987. }
  988. .tui-popup-box {
  989. position: relative;
  990. box-sizing: border-box;
  991. min-height: 168rpx;
  992. padding: 6rpx 24rpx;
  993. .tui-popup-content {
  994. padding-top: 30rpx;
  995. }
  996. }
  997. .layer-smimg {
  998. width: 114rpx;
  999. height: 114rpx;
  1000. float: left;
  1001. border-radius: 10rpx;
  1002. margin-right: 24rpx;
  1003. image {
  1004. width: 114rpx;
  1005. height: 114rpx;
  1006. border-radius: 10rpx;
  1007. }
  1008. }
  1009. .layer-nunbox {
  1010. justify-content: space-between;
  1011. align-items: center;
  1012. width: 536rpx;
  1013. height: 88rpx;
  1014. padding: 13rpx 0 0 0;
  1015. float: left;
  1016. .layer-nunbox-t {
  1017. width: 100%;
  1018. height: 44rpx;
  1019. position: relative;
  1020. display: flex;
  1021. .layer-nunbox-text {
  1022. line-height: 44rpx;
  1023. font-size: $font-size-28;
  1024. }
  1025. .number-box {
  1026. display: flex;
  1027. justify-content: center;
  1028. align-items: center;
  1029. border: 2rpx solid #ffe6dc;
  1030. border-radius: 30rpx;
  1031. height: 48rpx;
  1032. margin-left: 20rpx;
  1033. .iconfont {
  1034. font-size: $font-size-24;
  1035. padding: 0 18rpx;
  1036. color: #999999;
  1037. text-align: center;
  1038. line-height: 48rpx;
  1039. font-weight: bold;
  1040. background: #fef6f3;
  1041. &.icon-jianhao {
  1042. border-radius: 30rpx 0 0 30rpx;
  1043. }
  1044. &.icon-jiahao {
  1045. border-radius: 0 30rpx 30rpx 0;
  1046. }
  1047. }
  1048. .btn-input {
  1049. width: 62rpx;
  1050. height: 48rpx;
  1051. line-height: 48rpx;
  1052. background: #ffffff;
  1053. border-radius: 4rpx;
  1054. text-align: center;
  1055. font-size: $font-size-28;
  1056. }
  1057. }
  1058. .product-step {
  1059. position: absolute;
  1060. left: 45rpx;
  1061. bottom: 0;
  1062. height: 44rpx;
  1063. background: #ffffff;
  1064. }
  1065. }
  1066. .layer-nunbox-b {
  1067. width: 100%;
  1068. height: 44rpx;
  1069. margin-top: 13rpx;
  1070. }
  1071. .text {
  1072. line-height: 44rpx;
  1073. font-size: $font-size-28;
  1074. .p {
  1075. color: #ff2a2a;
  1076. }
  1077. .p:first-child {
  1078. margin-left: 30rpx;
  1079. }
  1080. .p.sm {
  1081. font-size: $font-size-24;
  1082. }
  1083. }
  1084. }
  1085. .fiexd-popup-box{
  1086. width: 100%;
  1087. min-height: 168rpx;
  1088. padding: 6rpx 24rpx;
  1089. position: fixed;
  1090. bottom: 0;
  1091. left: 0;
  1092. z-index: 99;
  1093. box-sizing: border-box;
  1094. background: #FFFFFF;
  1095. }
  1096. .tui-popup-btn {
  1097. width: 100%;
  1098. height: auto;
  1099. float: left;
  1100. box-sizing: border-box;
  1101. margin-top: 30rpx;
  1102. .superv-header-checked {
  1103. float: left;
  1104. font-size: $font-size-30;
  1105. .oltext {
  1106. width: 120rpx;
  1107. float: left;
  1108. color: #666666;
  1109. display: flex;
  1110. margin-left: 10rpx;
  1111. .checkbox {
  1112. display: flex;
  1113. margin: 0;
  1114. padding: 0;
  1115. display: flex;
  1116. flex-direction: column;
  1117. align-items: center;
  1118. box-sizing: border-box;
  1119. text-align: center;
  1120. text-decoration: none;
  1121. border-radius: 0;
  1122. -webkit-tap-highlight-color: transparent;
  1123. overflow: hidden;
  1124. font-size: 34rpx;
  1125. color: $color-system;
  1126. line-height: 80rpx;
  1127. }
  1128. .text {
  1129. float: left;
  1130. line-height: 80rpx;
  1131. margin-left: 15rpx;
  1132. }
  1133. }
  1134. .ortext {
  1135. width: 120rpx;
  1136. float: right;
  1137. color: $color-system;
  1138. text-align: right;
  1139. }
  1140. }
  1141. .tui-button {
  1142. width: 210rpx;
  1143. height: 88rpx;
  1144. float: right;
  1145. background: #e1e1e1;
  1146. line-height: 88rpx;
  1147. text-align: center;
  1148. color: #ffffff;
  1149. font-size: $font-size-28;
  1150. border-radius: 44rpx;
  1151. margin-left: 32rpx;
  1152. &.add {
  1153. background: #ffe6dc;
  1154. color: #F3B574;
  1155. }
  1156. &.buy {
  1157. background: $btn-confirm;
  1158. }
  1159. }
  1160. .tui-flex-btn {
  1161. width: 100%;
  1162. height: 88rpx;
  1163. display: flex;
  1164. box-sizing: border-box;
  1165. padding: 0 34rpx;
  1166. .button {
  1167. width: 280rpx;
  1168. height: 88rpx;
  1169. color: #fff;
  1170. display: flex;
  1171. align-items: center;
  1172. justify-content: center;
  1173. font-size: $font-size-28;
  1174. border-radius: 44rpx;
  1175. &.buy {
  1176. background: $btn-confirm;
  1177. margin-left: 78rpx;
  1178. }
  1179. &.add {
  1180. background: #ffe6dc;
  1181. color: #F3B574;
  1182. }
  1183. }
  1184. }
  1185. }
  1186. </style>