collection.vue 26 KB

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