goods-supporting.vue 28 KB

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