爱简收旧衣按件回收前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1678 lines
44 KiB

1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
  1. <template>
  2. <view class="container">
  3. <!-- 顶部banner -->
  4. <view class="banner">
  5. <swiper
  6. :indicator-dots="false"
  7. :autoplay="true"
  8. :interval="3000"
  9. :duration="500"
  10. circular
  11. style="width: 100%; height: 400rpx;"
  12. >
  13. <swiper-item v-for="(item, index) in bannerList" :key="item.id || index">
  14. <image :src="item.image" mode="aspectFill" style="width: 100%; height: 100%;" />
  15. </swiper-item>
  16. </swiper>
  17. </view>
  18. <!-- 商品列表 -->
  19. <view class="goods-list">
  20. <!-- 左侧分类导航 -->
  21. <scroll-view class="category-nav" scroll-y>
  22. <view
  23. v-for="(category, index) in categories"
  24. :key="category.id || index"
  25. class="category-item"
  26. :class="{ active: currentCategory === index }"
  27. @tap="switchCategory(index)"
  28. >
  29. <view class="category-dot" v-if="getCategoryItemCount(index) > 0"></view>
  30. {{ category.title }}
  31. </view>
  32. </scroll-view>
  33. <!-- 右侧商品列表 -->
  34. <scroll-view class="goods-content" scroll-y @scrolltolower="loadMoreGoods" style="height: 70vh">
  35. <view class="goods-section">
  36. <view class="goods-item" v-for="(item, index) in recycleList" :key="index">
  37. <image v-if="item.image" :src="item.image" class="goods-item-img" mode="aspectFit" />
  38. <view class="goods-info-wrap">
  39. <view class="goods-header">
  40. <text class="goods-name">{{item.name}}</text>
  41. <view class="rules-link" @tap="showRules(item)">
  42. <view class="rules">
  43. <text>回收规则</text>
  44. <uni-icons type="right" size="14" color="#999"></uni-icons>
  45. </view>
  46. </view>
  47. </view>
  48. <text class="goods-desc">{{item.desc}}</text>
  49. <view class="goods-info">
  50. <view class="price-info">
  51. <text class="price-symbol">¥</text>
  52. <text class="price-value">{{item.price}}</text>
  53. <text class="price-unit">/</text>
  54. </view>
  55. <view class="quantity-control">
  56. <button class="btn-minus" @tap="updateQuantity(index, -1)">-</button>
  57. <text class="quantity">{{item.quantity || 0}}</text>
  58. <button class="btn-plus" @tap="updateQuantity(index, 1)">+</button>
  59. </view>
  60. </view>
  61. <view class="brand-check" v-if="item.shopCion" @tap="showBrandPopup = true">
  62. <text>查看品牌</text>
  63. <uni-icons type="right" size="14" color="#ff7a0e"></uni-icons>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. <!-- 不可回收商品 -->
  69. <view class="other-unrecycle-card">
  70. <image class="other-unrecycle-img" src="/static/回收/衣物.png" mode="aspectFit" />
  71. <view class="other-unrecycle-info">
  72. <view class="other-unrecycle-title">其他上衣需咨询顾问暂不回收</view>
  73. <view class="other-unrecycle-desc">需连线回收顾问筛选</view>
  74. <view class="other-unrecycle-price-row">
  75. <text class="other-unrecycle-price">¥ /</text>
  76. </view>
  77. </view>
  78. <button class="other-unrecycle-btn" disabled>+</button>
  79. </view>
  80. <view v-if="loadingMore" class="loading-more">加载中...</view>
  81. <view v-else-if="finished" class="loading-more">没有更多了</view>
  82. </scroll-view>
  83. </view>
  84. <!-- 固定底部区域 -->
  85. <view class="fixed-bottom-wrap" v-if="!showDetailPanel" >
  86. <view class="green-tip-bar">
  87. 回收范围仅支持回收以上品类按件回收预计比称重回收多
  88. <text class="tip-highlight"> 3.76</text>
  89. </view>
  90. <view class="bottom-bar">
  91. <view class="bottom-left">
  92. <view class="summary-row">
  93. <text class="summary-label">已选 <text class="summary-count">{{totalCount}}</text> 预计回收可得</text>
  94. <uni-icons type="help" size="18" color="#b2b2b2" style="margin: 0 8rpx;" />
  95. </view>
  96. <view class="amount-row">
  97. <uni-icons :type="showDetailPanel ? 'up' : 'down'" size="18" color="#5e5e5e" style="margin-right: 8rpx;vertical-align: middle;" @tap="toggleDetailPanel" />
  98. <text class="amount">¥{{priceRange.min}}-{{priceRange.max}}</text>
  99. </view>
  100. </view>
  101. <button class="submit-btn" @tap="submitOrder">预约上门取件</button>
  102. </view>
  103. <view class="bottom-bar-divider"></view>
  104. </view>
  105. <!-- 明细弹窗遮罩和弹窗 -->
  106. <view v-if="showDetailPanel" class="detail-popup-mask" @tap.self="toggleDetailPanel">
  107. <view class="detail-popup" @tap.stop>
  108. <view class="detail-popup-close" @tap="toggleDetailPanel">×</view>
  109. <view class="green-tip-bar popup-green-tip">
  110. 回收范围仅支持回收以上品类按件回收预计比称重回收多
  111. <text class="tip-highlight"> 3.76</text>
  112. </view>
  113. <view class="panel-header">
  114. <text class="panel-title">已选商品明细</text>
  115. </view>
  116. <scroll-view class="panel-list popup-panel-list" scroll-y>
  117. <view v-for="(item, idx) in selectedProducts" :key="idx" class="panel-item">
  118. <image v-if="item.image" :src="item.image" class="panel-item-img" mode="aspectFit" />
  119. <view class="panel-item-info">
  120. <text class="panel-item-name">{{item.name}}</text>
  121. <text class="panel-item-desc">{{item.desc}}</text>
  122. <text class="panel-item-price">¥{{item.price}}/</text>
  123. </view>
  124. <view class="panel-quantity-control">
  125. <button class="btn-minus" @tap="updateQuantityByProduct(item, -1)">-</button>
  126. <text class="quantity">{{item.quantity}}</text>
  127. <button class="btn-plus" @tap="updateQuantityByProduct(item, 1)">+</button>
  128. </view>
  129. </view>
  130. </scroll-view>
  131. <view class="popup-bottom-bar">
  132. <view class="bottom-left">
  133. <view class="summary-row">
  134. <text class="summary-label">已选 <text class="summary-count">{{totalCount}}</text> 预计回收可得</text>
  135. <uni-icons type="help" size="18" color="#b2b2b2" style="margin: 0 8rpx;" />
  136. </view>
  137. <view class="amount-row">
  138. <uni-icons :type="showDetailPanel ? 'up' : 'down'" size="18" color="#5e5e5e" style="margin-right: 8rpx;vertical-align: middle;" @tap="toggleDetailPanel" />
  139. <text class="amount">¥{{priceRange.min}}-{{priceRange.max}}</text>
  140. </view>
  141. </view>
  142. <button class="submit-btn" @tap="submitOrder">预约上门取件</button>
  143. </view>
  144. </view>
  145. </view>
  146. <!-- 根据角色显示不同的导航栏 -->
  147. <uv-tabbar
  148. v-if="ishow"
  149. :value="value"
  150. :fixed="true"
  151. @change="changeTo"
  152. class="uv-tabbar"
  153. >
  154. <uv-tabbar-item text="首页" >
  155. <template v-slot:active-icon>
  156. <image class="icon" src="/static/home/首页-点击.png"></image>
  157. </template>
  158. <template v-slot:inactive-icon>
  159. <image class="icon" src="/static/home/首页-未点击.png"></image>
  160. </template>
  161. </uv-tabbar-item>
  162. <uv-tabbar-item text="回收" >
  163. <template v-slot:active-icon>
  164. <image class="icon" src="/static/home/回收-点击.png"></image>
  165. </template>
  166. <template v-slot:inactive-icon>
  167. <image class="icon" src="/static/home/回收-未点击.png"></image>
  168. </template>
  169. </uv-tabbar-item>
  170. <uv-tabbar-item text="我的" >
  171. <template v-slot:active-icon>
  172. <image class="icon" src="/static/home/我的-点击.png"></image>
  173. </template>
  174. <template v-slot:inactive-icon>
  175. <image class="icon" src="/static/home/我的-未点击.png"></image>
  176. </template>
  177. </uv-tabbar-item>
  178. </uv-tabbar>
  179. <!-- 品牌索引弹窗 -->
  180. <view v-if="showBrandPopup" class="brand-popup-mask" @tap.self="closeBrandPopup">
  181. <view class="brand-popup">
  182. <view class="brand-popup-header">
  183. <text class="brand-popup-close" @tap="closeBrandPopup">关闭</text>
  184. <text class="brand-popup-title">可回收的品牌</text>
  185. </view>
  186. <view class="brand-popup-search">
  187. <input class="brand-search-input" v-model="brandSearch" placeholder="请输入要查询的内容" />
  188. </view>
  189. <scroll-view class="brand-popup-list" scroll-y :scroll-into-view="scrollToView">
  190. <view v-for="letter in brandIndexList" :key="letter" :id="'brand-letter-' + letter">
  191. <view class="brand-letter">{{letter}}</view>
  192. <view v-for="brand in filteredBrandList.filter(b => b.letter === letter)" :key="brand.name" class="brand-item" @tap="openBrandConfirm(brand)">
  193. <image :src="brand.logo" class="brand-logo" mode="aspectFit" />
  194. <text class="brand-name">{{brand.name}}</text>
  195. </view>
  196. </view>
  197. </scroll-view>
  198. <view class="brand-index-bar">
  199. <text v-for="letter in brandIndexList" :key="letter" :class="{active: currentLetter === letter}" @tap="scrollToLetter(letter)">{{letter}}</text>
  200. </view>
  201. </view>
  202. </view>
  203. <!-- 回收规则弹窗 -->
  204. <view v-if="showRulePopup" class="rule-popup-mask" @tap.self="closeRulePopup">
  205. <view class="rule-popup">
  206. <view class="rule-popup-title">回收规则</view>
  207. <scroll-view class="rule-popup-content" scroll-y>
  208. <rich-text :nodes="ruleHtml" />
  209. </scroll-view>
  210. <button class="rule-popup-btn" @tap="closeRulePopup">我知道了</button>
  211. <!-- <view class="rule-popup-close" @tap="closeRulePopup">
  212. <uni-icons type="close" size="36" color="#fff" />
  213. </view> -->
  214. </view>
  215. </view>
  216. <!-- 预约上门取件弹窗 -->
  217. <view v-if="showPickupConfirm" class="pickup-confirm-mask">
  218. <view class="pickup-confirm-popup">
  219. <view class="pickup-confirm-title">温馨提示</view>
  220. <view class="pickup-confirm-content">
  221. 1.当前回收快递免费上门由于快递成本较高为避免不必要的成本及资源二次浪费不属于可回收品类或不符合回收标准的物品请勿寄出<br/><br/>
  222. 2.已通过的回收物品将正常结算不符合回收要求的物品可选择快递取回运费自付请在订单结算后48小时内联系在线客服安排取回逾期未联系将默认捐赠无法再次取回<br/><br/>
  223. 3.若用户寄出大量不可回收的物品平台有权限制下次回收权限或取消下次包邮服务<br/><br/>
  224. 4.对于合格率高的回收订单平台将根据实际情况给予额外回收奖励
  225. </view>
  226. <view class="pickup-confirm-btn-row">
  227. <button class="pickup-confirm-btn" @tap="handlePickupCancel">取消回收</button>
  228. <button class="pickup-confirm-btn agree" @tap="handlePickupAgree">我同意</button>
  229. </view>
  230. </view>
  231. </view>
  232. <!-- 品牌确认弹窗 -->
  233. <view v-if="showBrandConfirm" class="brand-confirm-mask" @tap.self="closeBrandConfirm">
  234. <view class="brand-confirm-popup">
  235. <view class="brand-confirm-title">品牌确认提示</view>
  236. <view class="brand-confirm-logo-wrap">
  237. <image :src="brandConfirmInfo.logo" class="brand-confirm-logo" mode="aspectFit" />
  238. </view>
  239. <view class="brand-confirm-name">{{ brandConfirmInfo.name }}</view>
  240. <view class="brand-confirm-desc">请确认所选品牌是否与实物品牌信息一致否则将无法进行回收</view>
  241. <view class="brand-confirm-btn-row">
  242. <button class="brand-confirm-btn retry" @tap="closeBrandConfirm">重新选择</button>
  243. <button class="brand-confirm-btn confirm" @tap="confirmBrand">确认一致</button>
  244. </view>
  245. </view>
  246. </view>
  247. </view>
  248. </template>
  249. <script>
  250. import tabBarMixin from '../mixins/tabBarMixin.js'
  251. export default {
  252. mixins: [tabBarMixin],
  253. data() {
  254. return {
  255. value:1,
  256. ishow:true,
  257. // 动态数据
  258. allProducts: {}, // { [categoryId]: [商品数组] }
  259. allProductsPage: {}, // { [categoryId]: 当前已加载页码 }
  260. allProductsTotal: {}, // { [categoryId]: 总数 }
  261. pageSize: 10,
  262. currentCategory: 0,
  263. tabbarHeight: 0,
  264. showDetailPanel: false,
  265. showBrandPopup: false,
  266. showRulePopup: false,
  267. ruleImgUrl: '/static/回收/回收规则.png',
  268. showPickupConfirm: false,
  269. showBrandConfirm: false,
  270. brandConfirmInfo: {
  271. logo: '',
  272. name: ''
  273. },
  274. brandList: [
  275. { logo: '/static/brand/alexander.png', name: 'Alexander McQueen/亚历山大麦昆', letter: 'A' },
  276. { logo: '/static/brand/alexander.png', name: 'Alexander McQueen/亚历山大麦昆', letter: 'A' },
  277. // ... 可补充更多品牌 ...
  278. ],
  279. brandIndexList: ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'],
  280. currentLetter: 'A',
  281. scrollToView: '',
  282. brandSearch: '',
  283. ruleHtml: '', // 回收规则富文本内容
  284. loadingMore: false,
  285. finished: false,
  286. pendingBrandIndex: null, // 记录待加一的品牌商品index
  287. }
  288. },
  289. computed: {
  290. // 当前分类的商品列表
  291. recycleList() {
  292. const currentCategoryId = this.categories[this.currentCategory]?.id
  293. return this.allProducts[currentCategoryId] || []
  294. },
  295. // 计算总数量
  296. totalCount() {
  297. return Object.values(this.allProducts).reduce((total, categoryItems) => {
  298. return total + categoryItems.reduce((sum, item) => sum + (item.quantity || 0), 0)
  299. }, 0)
  300. },
  301. // 计算总价格
  302. totalPrice() {
  303. const total = Object.values(this.allProducts).reduce((categoryTotal, categoryItems) => {
  304. return categoryTotal + categoryItems.reduce((sum, item) => sum + (item.quantity || 0) * Number(item.price), 0)
  305. }, 0)
  306. return total.toFixed(1)
  307. },
  308. // 计算价格范围
  309. priceRange() {
  310. if (this.totalCount === 0) {
  311. return {
  312. min: '0.0',
  313. max: '0.0'
  314. }
  315. }
  316. const total = Number(this.totalPrice)
  317. const min = Math.max(0, (total - 2.2)).toFixed(1)
  318. const max = (total + 2.2).toFixed(1)
  319. return { min, max }
  320. },
  321. selectedProducts() {
  322. // 返回所有已选商品
  323. return this.recycleList.filter(item => item.quantity > 0)
  324. },
  325. filteredBrandList() {
  326. if (!this.brandSearch) return this.brandList
  327. const keyword = this.brandSearch.trim().toLowerCase()
  328. return this.brandList.filter(b => b.name.toLowerCase().includes(keyword))
  329. },
  330. bannerList() {
  331. return getApp().globalData.bannerList || []
  332. },
  333. categories() {
  334. const list = getApp().globalData.pricePreviewList || []
  335. return list.filter(item => item.pid === '0').sort((a, b) => a.sort - b.sort)
  336. }
  337. },
  338. methods: {
  339. changeTo(e){
  340. this.value = e
  341. if(e==2){
  342. uni.reLaunch({
  343. url: '/pages/component/my'
  344. });
  345. }else if(e==0){
  346. console.log(e,'111')
  347. uni.reLaunch({
  348. url: '/pages/component/home'
  349. });
  350. }
  351. },
  352. fetchGoodsList(categoryId, page = 1, callback) {
  353. this.$api('getClassGoodsList', {
  354. classId: categoryId,
  355. pageNo: page,
  356. pageSize: this.pageSize
  357. }, res => {
  358. if (res.code === 200 && res.result && Array.isArray(res.result.records)) {
  359. const oldList = this.allProducts[categoryId] || []
  360. const newList = page === 1 ? res.result.records : oldList.concat(res.result.records)
  361. this.$set(this.allProducts, categoryId, newList)
  362. this.$set(this.allProductsPage, categoryId, page)
  363. this.$set(this.allProductsTotal, categoryId, res.result.total)
  364. }
  365. if (callback) callback()
  366. })
  367. },
  368. // 获取分类商品总数
  369. getCategoryItemCount(index) {
  370. const categoryId = this.categories[index]?.id
  371. const categoryItems = this.allProducts[categoryId] || []
  372. return categoryItems.reduce((sum, item) => sum + (item.quantity || 0), 0)
  373. },
  374. // 切换分类
  375. switchCategory(index) {
  376. this.currentCategory = index
  377. this.loadingMore = false
  378. this.finished = false
  379. const categoryId = this.categories[index]?.id
  380. console.log(categoryId,'switchCategory')
  381. if (!this.allProducts[categoryId]) {
  382. this.fetchGoodsList(categoryId, 1)
  383. }
  384. },
  385. // 更新商品数量
  386. updateQuantity(index, delta) {
  387. const categoryId = this.categories[this.currentCategory]?.id
  388. const item = this.allProducts[categoryId]?.[index]
  389. if (!item) return
  390. // 品牌商品且数量为0且加一时弹出品牌索引弹窗
  391. if (item.shopCion && (item.quantity || 0) === 0 && delta > 0) {
  392. this.pendingBrandIndex = index
  393. this.showBrandPopup = true // 打开品牌索引弹窗
  394. return
  395. }
  396. let newQuantity = (item.quantity || 0) + delta
  397. if (newQuantity < 0) newQuantity = 0
  398. this.$set(item, 'quantity', newQuantity)
  399. },
  400. // 显示回收规则
  401. showRules(item) {
  402. // 获取回收规则富文本
  403. this.$api('getGoodsRecycleRule', { goodsId: item.id }, res => {
  404. if (res.code === 200 && res.result) {
  405. this.ruleHtml = res.result
  406. } else {
  407. this.ruleHtml = '<p>暂无回收规则</p>'
  408. }
  409. this.showRulePopup = true
  410. })
  411. },
  412. showMore() {
  413. uni.showToast({
  414. title: '更多规则请咨询客服',
  415. icon: 'none'
  416. })
  417. },
  418. submitOrder() {
  419. if (this.totalCount === 0) {
  420. uni.showToast({
  421. title: '请选择要回收的物品',
  422. icon: 'none'
  423. })
  424. return
  425. }
  426. this.showPickupConfirm = true;
  427. },
  428. handlePickupCancel() {
  429. this.showPickupConfirm = false;
  430. },
  431. handlePickupAgree() {
  432. this.showPickupConfirm = false;
  433. uni.showLoading({
  434. title: '提交中...'
  435. })
  436. setTimeout(() => {
  437. uni.hideLoading()
  438. uni.showToast({
  439. title: '预约成功',
  440. icon: 'success'
  441. })
  442. this.goToPickup()
  443. }, 1500)
  444. },
  445. goToPickup() {
  446. // 获取所有选中的衣物
  447. const selectedItems = this.recycleList.filter(item => item.quantity > 0).map(item => ({
  448. name: item.name,
  449. icon: item.image,
  450. quantity: item.quantity,
  451. unitPrice: item.price,
  452. desc: '允许脏破烂,160码以上'
  453. }))
  454. // 将选中的衣物信息转换为字符串
  455. const itemsStr = encodeURIComponent(JSON.stringify(selectedItems))
  456. // 跳转到预约页面
  457. uni.navigateTo({
  458. url: `/pages/subcomponent/pickup?fromRecycle=true&items=${itemsStr}`
  459. })
  460. },
  461. checkBrand(index) {
  462. this.showBrandPopup = true
  463. },
  464. closeBrandPopup() {
  465. this.showBrandPopup = false
  466. },
  467. scrollToLetter(letter) {
  468. this.currentLetter = letter
  469. this.scrollToView = 'brand-letter-' + letter
  470. },
  471. // 添加下拉刷新方法
  472. async refreshData() {
  473. try {
  474. // 这里可以添加刷新数据的逻辑,比如重新获取商品列表等
  475. // 示例:重新初始化数据
  476. this.currentCategory = 0
  477. Object.values(this.allProducts).forEach(categoryItems => {
  478. categoryItems.forEach(item => {
  479. item.quantity = 0
  480. })
  481. })
  482. // 模拟网络请求延迟
  483. await new Promise(resolve => setTimeout(resolve, 1000))
  484. uni.showToast({
  485. title: '刷新成功',
  486. icon: 'success'
  487. })
  488. } catch (error) {
  489. uni.showToast({
  490. title: '刷新失败',
  491. icon: 'none'
  492. })
  493. } finally {
  494. // 停止下拉刷新动画
  495. uni.stopPullDownRefresh()
  496. }
  497. },
  498. toggleDetailPanel() {
  499. this.showDetailPanel = !this.showDetailPanel
  500. },
  501. updateQuantityByProduct(item, delta) {
  502. if (!item.quantity) item.quantity = 0
  503. item.quantity += delta
  504. if (item.quantity < 0) item.quantity = 0
  505. this.updateTotal()
  506. },
  507. openRulePopup() {
  508. this.showRulePopup = true
  509. },
  510. closeRulePopup() {
  511. this.showRulePopup = false
  512. },
  513. loadMoreGoods() {
  514. const categoryId = this.categories[this.currentCategory]?.id
  515. const page = (this.allProductsPage[categoryId] || 1) + 1
  516. const total = this.allProductsTotal[categoryId] || 0
  517. const loaded = (this.allProducts[categoryId] || []).length
  518. if (this.loadingMore || this.finished) return
  519. if (loaded < total) {
  520. this.loadingMore = true
  521. this.fetchGoodsList(categoryId, page, () => {
  522. this.loadingMore = false
  523. // 判断是否加载完
  524. const newLoaded = (this.allProducts[categoryId] || []).length
  525. this.finished = newLoaded >= (this.allProductsTotal[categoryId] || 0)
  526. })
  527. } else {
  528. this.finished = true
  529. }
  530. },
  531. openBrandConfirm(brand) {
  532. this.brandConfirmInfo = {
  533. logo: brand.logo,
  534. name: brand.name
  535. }
  536. this.showBrandConfirm = true
  537. },
  538. closeBrandConfirm() {
  539. this.showBrandConfirm = false
  540. },
  541. confirmBrand() {
  542. this.showBrandConfirm = false
  543. this.showBrandPopup = false
  544. // 确认后将待加一的商品数量+1
  545. if (this.pendingBrandIndex !== null) {
  546. const categoryId = this.categories[this.currentCategory]?.id
  547. const item = this.allProducts[categoryId]?.[this.pendingBrandIndex]
  548. if (item) {
  549. this.$set(item, 'quantity', 1)
  550. }
  551. this.pendingBrandIndex = null
  552. }
  553. },
  554. },
  555. created() {
  556. this.currentCategory = 0
  557. this.$nextTick(() => {
  558. if (this.categories.length > 0) {
  559. const firstCategoryId = this.categories[0]?.id
  560. if (firstCategoryId) {
  561. this.fetchGoodsList(firstCategoryId, 1)
  562. }
  563. }
  564. })
  565. },
  566. mounted() {
  567. this.$nextTick(() => {
  568. const query = uni.createSelectorQuery().in(this)
  569. query.select('.uv-tabbar').boundingClientRect(rect => {
  570. if (rect && rect.height) {
  571. this.tabbarHeight = rect.height
  572. } else {
  573. this.tabbarHeight = uni.upx2px ? uni.upx2px(95) : 45
  574. }
  575. console.log(this.tabbarHeight,'tabbarHeight')
  576. }).exec()
  577. })
  578. },
  579. onLoad(options) {
  580. if (options && options.categoryId) {
  581. const idx = this.categories.findIndex(c => c.id == options.categoryId)
  582. if (idx !== -1) this.currentCategory = idx
  583. }
  584. this.fetchGoodsList(this.categories[this.currentCategory].id, 1)
  585. uni.$on('bannerListUpdated', () => {
  586. this.$forceUpdate && this.$forceUpdate()
  587. })
  588. if (getApp().globalData.bannerList && getApp().globalData.bannerList.length > 0) {
  589. this.$forceUpdate && this.$forceUpdate()
  590. }
  591. },
  592. onUnload() {
  593. uni.$off('bannerListUpdated')
  594. },
  595. onShow() {
  596. const id = getApp().globalData.targetRecycleCategoryId
  597. if (id) {
  598. const trySwitch = () => {
  599. if (this.categories.length > 0) {
  600. const idx = this.categories.findIndex(c => String(c.id) === String(id))
  601. if (idx !== -1) {
  602. this.currentCategory = idx
  603. const categoryId = this.categories[idx]?.id
  604. if (categoryId && !this.allProducts[categoryId]) {
  605. this.loadingMore = false
  606. this.finished = false
  607. this.fetchGoodsList(categoryId, 1)
  608. }
  609. }
  610. getApp().globalData.targetRecycleCategoryId = null
  611. } else {
  612. setTimeout(trySwitch, 100)
  613. }
  614. }
  615. trySwitch()
  616. }
  617. },
  618. watch: {
  619. categories(newVal) {
  620. const id = getApp().globalData.targetRecycleCategoryId
  621. console.log('targetRecycleCategoryId', id)
  622. console.log('categories:', newVal.map(c => c.id))
  623. const idx = newVal.findIndex(c => String(c.id) === String(id))
  624. console.log('findIndex result:', idx)
  625. if (id && newVal.length > 0 && idx !== -1) {
  626. this.currentCategory = idx
  627. getApp().globalData.targetRecycleCategoryId = null
  628. // 自动加载右侧商品
  629. const categoryId = newVal[idx]?.id
  630. if (categoryId && !this.allProducts[categoryId]) {
  631. this.loadingMore = false
  632. this.finished = false
  633. this.fetchGoodsList(categoryId, 1)
  634. }
  635. }
  636. }
  637. },
  638. }
  639. </script>
  640. <style lang="scss" scoped>
  641. .container {
  642. display: flex;
  643. flex-direction: column;
  644. min-height: 100vh;
  645. padding-bottom: calc(100rpx + env(safe-area-inset-bottom)); /* 底部导航栏高度 + 安全区域 */
  646. background-color: #f5f5f5;
  647. }
  648. .banner {
  649. background: linear-gradient(135deg, #ff9500,#ff5e00);
  650. position: relative;
  651. height: 240rpx;
  652. z-index: 1;
  653. height: 400rpx;
  654. image {
  655. width: 100%;
  656. height: 100%;
  657. }
  658. }
  659. .goods-list {
  660. flex: 1;
  661. display: flex;
  662. position: relative;
  663. height: calc(100vh - 200rpx - 100rpx - env(safe-area-inset-bottom)); /* 减去banner和底部栏的高度 */
  664. margin-top: -10rpx;
  665. z-index: 2;
  666. border-radius: 20rpx 20rpx 0 0;
  667. overflow: hidden;
  668. padding: 30rpx;
  669. box-shadow: 0 -4rpx 8rpx rgba(0, 0, 0, 0.05);
  670. background: linear-gradient(to bottom, #fff7e8, 20%,#ffffff);
  671. .category-nav {
  672. width: 20%;
  673. background: #ffffff;
  674. height: calc(100vh - 240rpx - 120rpx);
  675. border-right: 1rpx solid rgba(255, 126, 14, 0.1);
  676. margin: 1rpx;
  677. border-radius: 20rpx 0 0 0;
  678. margin-right: 20rpx;
  679. scrollbar-width: none; /* Firefox */
  680. -ms-overflow-style: none; /* IE and Edge */
  681. &::-webkit-scrollbar {
  682. width: 0 !important;
  683. display: none; /* Chrome, Safari, Opera */
  684. }
  685. .category-item {
  686. position: relative;
  687. padding: 30rpx 20rpx;
  688. text-align: center;
  689. font-family: PingFang SC;
  690. font-weight: 600;
  691. font-size: 14px;
  692. line-height: 100%;
  693. letter-spacing: 0px;
  694. color: #666;
  695. .category-dot {
  696. position: absolute;
  697. top: 15rpx;
  698. right: 15rpx;
  699. width: 12rpx;
  700. height: 12rpx;
  701. background: #ff7a0e;
  702. border-radius: 50%;
  703. }
  704. &.active {
  705. color: #ff7a0e;
  706. font-weight: bold;
  707. background: #fff7e8;
  708. position: relative;
  709. &::before {
  710. content: '';
  711. position: absolute;
  712. left: 0;
  713. top: 50%;
  714. transform: translateY(-50%);
  715. width: 6rpx;
  716. height: 36rpx;
  717. background: #ff7a0e;
  718. border-radius: 3rpx;
  719. }
  720. }
  721. }
  722. }
  723. .goods-content {
  724. flex: 1;
  725. height: calc(100vh - 140rpx - 120rpx);
  726. padding: 0 30rpx;
  727. background: #ffffff;
  728. width: 70%;
  729. margin: 1rpx;
  730. margin-left: 0;
  731. border-radius: 0 20rpx 0 0;
  732. scrollbar-width: none; /* Firefox */
  733. -ms-overflow-style: none; /* IE and Edge */
  734. &::-webkit-scrollbar {
  735. width: 0 !important;
  736. display: none; /* Chrome, Safari, Opera */
  737. }
  738. }
  739. }
  740. .goods-item {
  741. display: flex;
  742. align-items: flex-start;
  743. padding: 30rpx 0;
  744. border-bottom: 1rpx solid #f5f5f5;
  745. .goods-item-img {
  746. width: 120rpx;
  747. height: 120rpx;
  748. border-radius: 24rpx;
  749. background: #f8f8f8;
  750. margin-right: 28rpx;
  751. object-fit: contain;
  752. flex-shrink: 0;
  753. }
  754. .goods-info-wrap {
  755. flex: 1;
  756. display: flex;
  757. flex-direction: column;
  758. justify-content: center;
  759. min-width: 0;
  760. }
  761. .goods-header {
  762. display: flex;
  763. justify-content: space-between;
  764. align-items: center;
  765. margin-bottom: 10rpx;
  766. }
  767. .goods-name {
  768. font-family: PingFang SC;
  769. font-weight: 500;
  770. font-size: 14px;
  771. line-height: 140%;
  772. letter-spacing: 0%;
  773. vertical-align: middle;
  774. color: #333;
  775. font-weight: bold;
  776. }
  777. .goods-desc {
  778. font-size: 24rpx;
  779. color: #999;
  780. display: block;
  781. margin-bottom: 20rpx;
  782. }
  783. .goods-info {
  784. display: flex;
  785. justify-content: space-between;
  786. align-items: center;
  787. }
  788. .price-info {
  789. display: flex;
  790. align-items: baseline;
  791. .price-symbol {
  792. font-size: 24rpx;
  793. color: #ff7a0e;
  794. }
  795. .price-value {
  796. font-size: 36rpx;
  797. color: #ff7a0e;
  798. font-weight: bold;
  799. margin: 0 4rpx;
  800. }
  801. .price-unit {
  802. font-size: 24rpx;
  803. color: #999;
  804. }
  805. }
  806. .quantity-control {
  807. display: flex;
  808. align-items: center;
  809. button {
  810. width: 60rpx;
  811. height: 60rpx;
  812. padding: 0;
  813. margin: 0;
  814. display: flex;
  815. align-items: center;
  816. justify-content: center;
  817. font-size: 28rpx;
  818. color: #666;
  819. background: #f8f8f8;
  820. border: none;
  821. border-radius: 50%;
  822. &::after {
  823. border: none;
  824. }
  825. &:active {
  826. opacity: 0.8;
  827. }
  828. }
  829. .quantity {
  830. width: 80rpx;
  831. text-align: center;
  832. font-size: 32rpx;
  833. color: #333;
  834. }
  835. }
  836. .brand-check {
  837. // margin-top: 20rpx;
  838. // margin:0 auto;
  839. display: flex;
  840. flex-direction: row;
  841. align-items: center;
  842. // justify-content: center;
  843. border: 1px solid #f8a01d;
  844. width: 40%;
  845. // background: #fff7f0;
  846. border-radius: 8rpx;
  847. color: #ff7a0e;
  848. font-family: PingFang SC;
  849. font-weight: 400;
  850. font-size: 12px;
  851. line-height: 140%;
  852. letter-spacing: 0%;
  853. text {
  854. // margin-right: 8rpx;
  855. }
  856. }
  857. }
  858. .rules-link{
  859. .rules{
  860. font-family: PingFang SC;
  861. font-weight: 400;
  862. font-size: 12px;
  863. line-height: 140%;
  864. letter-spacing: 0%;
  865. }
  866. }
  867. .other-unrecycle-card {
  868. display: flex;
  869. align-items: center;
  870. background: #fff;
  871. border-radius: 24rpx;
  872. box-shadow: 0 4rpx 24rpx rgba(0,0,0,0.06);
  873. padding: 30rpx 30rpx 30rpx 30rpx;
  874. margin: 30rpx 0 0 0;
  875. }
  876. .other-unrecycle-img {
  877. width: 120rpx;
  878. height: 120rpx;
  879. border-radius: 24rpx;
  880. background: #f8f8f8;
  881. margin-right: 28rpx;
  882. object-fit: contain;
  883. flex-shrink: 0;
  884. }
  885. .other-unrecycle-info {
  886. flex: 1;
  887. display: flex;
  888. flex-direction: column;
  889. justify-content: center;
  890. min-width: 0;
  891. }
  892. .other-unrecycle-title {
  893. font-size: 30rpx;
  894. color: #222;
  895. font-weight: bold;
  896. margin-bottom: 8rpx;
  897. word-break: break-all;
  898. white-space: normal;
  899. overflow: visible;
  900. }
  901. .other-unrecycle-desc {
  902. font-size: 24rpx;
  903. color: #999;
  904. margin-bottom: 12rpx;
  905. text-overflow: ellipsis;
  906. overflow: hidden;
  907. white-space: nowrap;
  908. }
  909. .other-unrecycle-price-row {
  910. display: flex;
  911. align-items: center;
  912. }
  913. .other-unrecycle-price {
  914. font-size: 28rpx;
  915. color: #ff9c00;
  916. font-weight: bold;
  917. }
  918. .other-unrecycle-btn {
  919. width: 60rpx;
  920. height: 60rpx;
  921. margin-left: 24rpx;
  922. border-radius: 50%;
  923. background: #f5f5f5;
  924. color: #ccc;
  925. font-size: 36rpx;
  926. border: none;
  927. display: flex;
  928. align-items: center;
  929. justify-content: center;
  930. pointer-events: none;
  931. }
  932. .fixed-bottom-wrap {
  933. position: fixed;
  934. left: 0;
  935. right: 0;
  936. bottom: calc(v-bind('tabbarHeight + "px"') + env(safe-area-inset-bottom));
  937. width: 100vw;
  938. z-index: 1001;
  939. background: transparent;
  940. box-sizing: border-box;
  941. pointer-events: auto;
  942. }
  943. .bottom-bar-divider {
  944. width: 100%;
  945. height: 1px;
  946. background: #f0f0f0;
  947. position: absolute;
  948. left: 0;
  949. bottom: 0;
  950. z-index: 1;
  951. }
  952. .green-tip-bar {
  953. width: 100%;
  954. background: #eaffea;
  955. color: #13ac47;
  956. font-size: 20rpx;
  957. // padding: 16rpx 30rpx 0 30rpx;
  958. box-sizing: border-box;
  959. text-align: left;
  960. display: flex;
  961. align-items: center;
  962. justify-content: center;
  963. // flex-direction: r;
  964. .tip-highlight {
  965. color: #ff9c00;
  966. font-weight: bold;
  967. font-size: 20rpx;
  968. }
  969. }
  970. .bottom-bar {
  971. width: 100%;
  972. background-color: #fff;
  973. display: flex;
  974. align-items: center;
  975. justify-content: space-between;
  976. padding: 0 30rpx;
  977. box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
  978. height: 120rpx;
  979. border-top-left-radius: 0;
  980. border-top-right-radius: 0;
  981. border-bottom-left-radius: env(safe-area-inset-bottom);
  982. border-bottom-right-radius: env(safe-area-inset-bottom);
  983. .bottom-left {
  984. // flex: 1;
  985. display: flex;
  986. flex-direction: column;
  987. justify-content: center;
  988. .summary-row {
  989. display: flex;
  990. align-items: center;
  991. font-size: 26rpx;
  992. color: #333;
  993. .summary-label {
  994. color: #333;
  995. }
  996. .summary-count {
  997. color: #ff9c00;
  998. font-weight: bold;
  999. font-size: 28rpx;
  1000. }
  1001. }
  1002. .amount-row {
  1003. display: flex;
  1004. align-items: center;
  1005. margin-top: 4rpx;
  1006. .amount {
  1007. color: #ff9c00;
  1008. font-size: 44rpx;
  1009. font-weight: bold;
  1010. vertical-align: middle;
  1011. }
  1012. }
  1013. }
  1014. .submit-btn {
  1015. width: 300rpx;
  1016. height: 88rpx;
  1017. background: linear-gradient(to right, #ffd01e, #ff8917);
  1018. border-radius: 44rpx;
  1019. color: #fff;
  1020. font-size: 32rpx;
  1021. font-weight: bold;
  1022. display: flex;
  1023. align-items: center;
  1024. justify-content: center;
  1025. border: none;
  1026. // margin-left: 0rpx;
  1027. box-shadow: 0 4rpx 16rpx rgba(255, 156, 0, 0.08);
  1028. &::after {
  1029. border: none;
  1030. }
  1031. &:active {
  1032. opacity: 0.9;
  1033. }
  1034. }
  1035. }
  1036. .detail-popup-mask {
  1037. position: fixed;
  1038. left: 0;
  1039. right: 0;
  1040. top: 0;
  1041. bottom: calc(90rpx + env(safe-area-inset-bottom)); /* tabbar高度+安全区 */
  1042. background: rgba(0,0,0,0.35);
  1043. z-index: 8;
  1044. display: flex;
  1045. align-items: flex-end;
  1046. justify-content: center;
  1047. }
  1048. .detail-popup {
  1049. width: 100vw;
  1050. max-width: none;
  1051. background: #fff;
  1052. border-radius: 48rpx 48rpx 0 0;
  1053. box-shadow: 0 8rpx 48rpx rgba(0,0,0,0.18);
  1054. display: flex;
  1055. flex-direction: column;
  1056. align-items: stretch;
  1057. position: relative;
  1058. padding: 0;
  1059. overflow: hidden;
  1060. min-height: 520rpx;
  1061. max-height: 80vh;
  1062. bottom: 0;
  1063. }
  1064. .detail-popup-close {
  1065. position: absolute;
  1066. right: 36rpx;
  1067. top: 36rpx;
  1068. font-size: 36rpx;
  1069. color: #bbb;
  1070. z-index: 2;
  1071. }
  1072. .popup-green-tip {
  1073. border-radius: 48rpx 48rpx 0 0;
  1074. font-size: 20rpx;
  1075. padding: 24rpx 30rpx 0 30rpx;
  1076. background: #eaffea;
  1077. color: #13ac47;
  1078. text-align: left;
  1079. }
  1080. .panel-header {
  1081. display: flex;
  1082. align-items: center;
  1083. justify-content: center;
  1084. font-size: 32rpx;
  1085. font-weight: bold;
  1086. padding: 40rpx 36rpx 0 36rpx;
  1087. background: #fff;
  1088. position: relative;
  1089. }
  1090. .panel-title {
  1091. font-size: 32rpx;
  1092. color: #222;
  1093. font-weight: bold;
  1094. text-align: center;
  1095. flex: 1;
  1096. }
  1097. .popup-panel-list {
  1098. flex: 1;
  1099. overflow-y: auto;
  1100. max-height: 36vh;
  1101. padding: 0 24rpx;
  1102. scrollbar-width: none; /* Firefox */
  1103. -ms-overflow-style: none; /* IE and Edge */
  1104. &::-webkit-scrollbar {
  1105. width: 0 !important;
  1106. display: none; /* Chrome, Safari, Opera */
  1107. }
  1108. }
  1109. .panel-item {
  1110. display: flex;
  1111. align-items: center;
  1112. justify-content: flex-start;
  1113. padding: 24rpx 0;
  1114. border-bottom: 1px solid #f0f0f0;
  1115. }
  1116. .panel-item-img {
  1117. width: 100rpx;
  1118. height: 100rpx;
  1119. margin-right: 20rpx;
  1120. border-radius: 16rpx;
  1121. background: #f8f8f8;
  1122. }
  1123. .panel-item-info {
  1124. flex: 1;
  1125. display: flex;
  1126. flex-direction: column;
  1127. justify-content: center;
  1128. min-width: 0;
  1129. }
  1130. .panel-item-name {
  1131. font-size: 30rpx;
  1132. color: #222;
  1133. font-weight: bold;
  1134. margin-bottom: 4rpx;
  1135. text-overflow: ellipsis;
  1136. overflow: hidden;
  1137. white-space: nowrap;
  1138. }
  1139. .panel-item-desc {
  1140. font-size: 24rpx;
  1141. color: #999;
  1142. margin-bottom: 4rpx;
  1143. text-overflow: ellipsis;
  1144. overflow: hidden;
  1145. white-space: nowrap;
  1146. }
  1147. .panel-item-price {
  1148. font-size: 26rpx;
  1149. color: #ff9c00;
  1150. margin-top: 2rpx;
  1151. }
  1152. .panel-quantity-control {
  1153. display: flex;
  1154. align-items: center;
  1155. margin-left: 20rpx;
  1156. }
  1157. .panel-quantity-control button {
  1158. width: 48rpx;
  1159. height: 48rpx;
  1160. padding: 0;
  1161. margin: 0 8rpx;
  1162. display: flex;
  1163. align-items: center;
  1164. justify-content: center;
  1165. font-size: 32rpx;
  1166. color: #666;
  1167. background: #f5f5f5;
  1168. border: none;
  1169. border-radius: 50%;
  1170. &::after {
  1171. border: none;
  1172. }
  1173. &:active {
  1174. opacity: 0.8;
  1175. }
  1176. }
  1177. .panel-quantity-control .quantity {
  1178. width: 40rpx;
  1179. text-align: center;
  1180. font-size: 28rpx;
  1181. color: #333;
  1182. }
  1183. .popup-bottom-bar {
  1184. width: 100%;
  1185. background-color: #fff;
  1186. display: flex;
  1187. align-items: center;
  1188. justify-content: space-between;
  1189. padding: 0 30rpx;
  1190. box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
  1191. height: 120rpx;
  1192. border-top: 1px solid #f0f0f0;
  1193. border-bottom-left-radius: 48rpx;
  1194. border-bottom-right-radius: 48rpx;
  1195. // padding-bottom: env(safe-area-inset-bottom);
  1196. .bottom-left {
  1197. display: flex;
  1198. flex-direction: column;
  1199. justify-content: center;
  1200. .summary-row {
  1201. display: flex;
  1202. align-items: center;
  1203. font-size: 26rpx;
  1204. color: #333;
  1205. .summary-label {
  1206. color: #333;
  1207. }
  1208. .summary-count {
  1209. color: #ff9c00;
  1210. font-weight: bold;
  1211. font-size: 28rpx;
  1212. }
  1213. }
  1214. .amount-row {
  1215. display: flex;
  1216. align-items: center;
  1217. margin-top: 4rpx;
  1218. .amount {
  1219. color: #ff9c00;
  1220. font-size: 44rpx;
  1221. font-weight: bold;
  1222. vertical-align: middle;
  1223. }
  1224. }
  1225. }
  1226. .submit-btn {
  1227. width: 300rpx;
  1228. height: 88rpx;
  1229. background: linear-gradient(to right, #ffd01e, #ff8917);
  1230. border-radius: 44rpx;
  1231. color: #fff;
  1232. font-size: 32rpx;
  1233. font-weight: bold;
  1234. display: flex;
  1235. align-items: center;
  1236. justify-content: center;
  1237. border: none;
  1238. box-shadow: 0 4rpx 16rpx rgba(255, 156, 0, 0.08);
  1239. &::after {
  1240. border: none;
  1241. }
  1242. &:active {
  1243. opacity: 0.9;
  1244. }
  1245. }
  1246. }
  1247. .brand-popup-mask {
  1248. position: fixed;
  1249. left: 0;
  1250. right: 0;
  1251. top: 0;
  1252. bottom: 0;
  1253. background: rgba(0,0,0,0.35);
  1254. z-index: 3000;
  1255. display: flex;
  1256. align-items: flex-end;
  1257. justify-content: center;
  1258. }
  1259. .brand-popup {
  1260. position: relative;
  1261. width: 100%;
  1262. max-width: 750px;
  1263. background: #fff;
  1264. border-radius: 32rpx 32rpx 0 0;
  1265. box-shadow: 0 -4rpx 24rpx rgba(0,0,0,0.08);
  1266. padding-bottom: 40rpx;
  1267. max-height: 90vh;
  1268. display: flex;
  1269. flex-direction: column;
  1270. overflow: hidden;
  1271. }
  1272. .brand-popup-header {
  1273. display: flex;
  1274. align-items: center;
  1275. justify-content: center;
  1276. padding: 32rpx 24rpx 0 24rpx;
  1277. font-size: 32rpx;
  1278. font-weight: bold;
  1279. position: relative;
  1280. }
  1281. .brand-popup-close {
  1282. position: absolute;
  1283. left: 24rpx;
  1284. font-size: 28rpx;
  1285. color: #888;
  1286. }
  1287. .brand-popup-title {
  1288. font-size: 32rpx;
  1289. color: #222;
  1290. font-weight: bold;
  1291. }
  1292. .brand-popup-search {
  1293. padding: 20rpx 24rpx 0 24rpx;
  1294. }
  1295. .brand-search-input {
  1296. width: 100%;
  1297. height: 60rpx;
  1298. border-radius: 30rpx;
  1299. background: #f5f5f5;
  1300. border: none;
  1301. padding-left: 40rpx;
  1302. font-size: 28rpx;
  1303. color: #888;
  1304. }
  1305. .brand-popup-list {
  1306. flex: 1;
  1307. overflow-y: auto;
  1308. max-height: 60vh;
  1309. padding: 0 24rpx;
  1310. scrollbar-width: none; /* Firefox */
  1311. -ms-overflow-style: none; /* IE and Edge */
  1312. &::-webkit-scrollbar {
  1313. width: 0 !important;
  1314. display: none; /* Chrome, Safari, Opera */
  1315. }
  1316. }
  1317. .brand-letter {
  1318. font-size: 28rpx;
  1319. color: #888;
  1320. margin: 24rpx 0 8rpx 0;
  1321. font-weight: bold;
  1322. }
  1323. .brand-item {
  1324. display: flex;
  1325. align-items: center;
  1326. padding: 16rpx 0;
  1327. border-bottom: 1px solid #f0f0f0;
  1328. }
  1329. .brand-logo {
  1330. width: 60rpx;
  1331. height: 60rpx;
  1332. margin-right: 20rpx;
  1333. border-radius: 8rpx;
  1334. background: #f8f8f8;
  1335. }
  1336. .brand-name {
  1337. font-size: 28rpx;
  1338. color: #222;
  1339. }
  1340. .brand-index-bar {
  1341. position: absolute;
  1342. right: 12rpx;
  1343. top: 120rpx;
  1344. width: 32rpx;
  1345. display: flex;
  1346. flex-direction: column;
  1347. align-items: center;
  1348. z-index: 10;
  1349. }
  1350. .brand-index-bar text {
  1351. font-size: 22rpx;
  1352. color: #bbb;
  1353. margin: 4rpx 0;
  1354. font-weight: bold;
  1355. &.active {
  1356. color: #ff9c00;
  1357. }
  1358. }
  1359. .rule-popup-mask {
  1360. position: fixed;
  1361. left: 0;
  1362. right: 0;
  1363. top: 0;
  1364. bottom: 0;
  1365. background: rgba(0,0,0,0.35);
  1366. z-index: 4000;
  1367. display: flex;
  1368. align-items: center;
  1369. justify-content: center;
  1370. }
  1371. .rule-popup {
  1372. width: 90vw;
  1373. max-width: 600rpx;
  1374. background: #fff;
  1375. border-radius: 48rpx;
  1376. box-shadow: 0 8rpx 32rpx rgba(0,0,0,0.12);
  1377. display: flex;
  1378. flex-direction: column;
  1379. align-items: center;
  1380. position: relative;
  1381. padding-bottom: 40rpx;
  1382. }
  1383. .rule-popup-title {
  1384. font-size: 36rpx;
  1385. color: #222;
  1386. font-weight: bold;
  1387. text-align: center;
  1388. margin-top: 48rpx;
  1389. margin-bottom: 16rpx;
  1390. }
  1391. .rule-popup-content {
  1392. width: 100%;
  1393. max-height: 420rpx;
  1394. padding: 0 40rpx;
  1395. box-sizing: border-box;
  1396. overflow-y: auto;
  1397. scrollbar-width: none; /* Firefox */
  1398. -ms-overflow-style: none; /* IE and Edge */
  1399. &::-webkit-scrollbar {
  1400. width: 0 !important;
  1401. display: none; /* Chrome, Safari, Opera */
  1402. }
  1403. }
  1404. .rule-popup-desc {
  1405. font-size: 26rpx;
  1406. color: #888;
  1407. text-align: center;
  1408. margin-bottom: 24rpx;
  1409. margin-top: 0;
  1410. }
  1411. .rule-popup-warning {
  1412. width: 100%;
  1413. border: 2rpx solid #ffb800;
  1414. color: #ffb800;
  1415. background: #fffbe6;
  1416. border-radius: 32rpx;
  1417. font-size: 28rpx;
  1418. text-align: center;
  1419. padding: 16rpx 0;
  1420. margin-bottom: 24rpx;
  1421. font-weight: bold;
  1422. }
  1423. .rule-popup-img {
  1424. display: block;
  1425. margin: 0 auto 24rpx auto;
  1426. max-width: 80%;
  1427. max-height: 300rpx;
  1428. border-radius: 16rpx;
  1429. object-fit: contain;
  1430. }
  1431. .rule-popup-btn {
  1432. width: 80%;
  1433. height: 88rpx;
  1434. background: linear-gradient(to right, #ffd01e, #ff8917);
  1435. border-radius: 44rpx;
  1436. color: #fff;
  1437. font-size: 32rpx;
  1438. font-weight: bold;
  1439. display: flex;
  1440. align-items: center;
  1441. justify-content: center;
  1442. border: none;
  1443. margin: 0 auto;
  1444. margin-top: 16rpx;
  1445. box-shadow: 0 4rpx 16rpx rgba(255, 156, 0, 0.08);
  1446. &::after {
  1447. border: none;
  1448. }
  1449. &:active {
  1450. opacity: 0.9;
  1451. }
  1452. }
  1453. .rule-popup-close {
  1454. position: absolute;
  1455. right: 32rpx;
  1456. bottom: 32rpx;
  1457. width: 72rpx;
  1458. height: 72rpx;
  1459. background: #ff5a5f;
  1460. border-radius: 50%;
  1461. display: flex;
  1462. align-items: center;
  1463. justify-content: center;
  1464. z-index: 10;
  1465. box-shadow: 0 2rpx 8rpx rgba(255,90,95,0.12);
  1466. }
  1467. /* 预约上门取件弹窗样式 */
  1468. .pickup-confirm-mask {
  1469. position: fixed;
  1470. left: 0;
  1471. right: 0;
  1472. top: 0;
  1473. bottom: 0;
  1474. background: rgba(0,0,0,0.35);
  1475. z-index: 5000;
  1476. display: flex;
  1477. align-items: center;
  1478. justify-content: center;
  1479. }
  1480. .pickup-confirm-popup {
  1481. width: 90vw;
  1482. max-width: 600rpx;
  1483. background: #fff;
  1484. border-radius: 48rpx;
  1485. box-shadow: 0 8rpx 32rpx rgba(0,0,0,0.12);
  1486. display: flex;
  1487. flex-direction: column;
  1488. align-items: center;
  1489. position: relative;
  1490. padding: 48rpx 36rpx 40rpx 36rpx;
  1491. }
  1492. .pickup-confirm-title {
  1493. font-size: 36rpx;
  1494. color: #222;
  1495. font-weight: bold;
  1496. text-align: center;
  1497. margin-bottom: 24rpx;
  1498. }
  1499. .pickup-confirm-content {
  1500. font-size: 26rpx;
  1501. color: #333;
  1502. text-align: left;
  1503. line-height: 1.7;
  1504. margin-bottom: 36rpx;
  1505. }
  1506. .pickup-confirm-btn-row {
  1507. width: 100%;
  1508. display: flex;
  1509. justify-content: space-between;
  1510. gap: 32rpx;
  1511. }
  1512. .pickup-confirm-btn {
  1513. flex: 1;
  1514. height: 88rpx;
  1515. border-radius: 44rpx;
  1516. font-size: 32rpx;
  1517. font-weight: bold;
  1518. display: flex;
  1519. align-items: center;
  1520. justify-content: center;
  1521. border: 2rpx solid #ffd01e;
  1522. background: #fff;
  1523. color: #ff9c00;
  1524. box-shadow: 0 4rpx 16rpx rgba(255, 156, 0, 0.08);
  1525. }
  1526. .pickup-confirm-btn:not(.agree) {
  1527. background: #fff0d2;
  1528. }
  1529. .pickup-confirm-btn.agree {
  1530. background: linear-gradient(to right, #ffd01e, #ff8917);
  1531. color: #fff;
  1532. border: none;
  1533. }
  1534. .uv-tabbar {
  1535. z-index: 1000;
  1536. }
  1537. .loading-more {
  1538. text-align: center;
  1539. color: #999;
  1540. padding: 20rpx 0;
  1541. font-size: 26rpx;
  1542. }
  1543. .brand-confirm-mask {
  1544. position: fixed;
  1545. left: 0;
  1546. right: 0;
  1547. top: 0;
  1548. bottom: 0;
  1549. background: rgba(0,0,0,0.25);
  1550. z-index: 5001;
  1551. display: flex;
  1552. align-items: center;
  1553. justify-content: center;
  1554. }
  1555. .brand-confirm-popup {
  1556. width: 70vw;
  1557. max-width: 270px;
  1558. background: #fff;
  1559. border-radius: 32rpx;
  1560. box-shadow: 0 8rpx 32rpx rgba(0,0,0,0.12);
  1561. display: flex;
  1562. flex-direction: column;
  1563. align-items: center;
  1564. padding: 48rpx 20rpx 36rpx 20rpx;
  1565. position: relative;
  1566. }
  1567. .brand-confirm-title {
  1568. font-size: 36rpx;
  1569. color: #222;
  1570. font-weight: bold;
  1571. text-align: center;
  1572. margin-bottom: 24rpx;
  1573. }
  1574. .brand-confirm-logo-wrap {
  1575. width: 120rpx;
  1576. height: 120rpx;
  1577. background: #f8f8f8;
  1578. border-radius: 50%;
  1579. display: flex;
  1580. align-items: center;
  1581. justify-content: center;
  1582. margin-bottom: 18rpx;
  1583. }
  1584. .brand-confirm-logo {
  1585. width: 80rpx;
  1586. height: 80rpx;
  1587. border-radius: 50%;
  1588. }
  1589. .brand-confirm-name {
  1590. font-size: 28rpx;
  1591. color: #222;
  1592. font-weight: bold;
  1593. text-align: center;
  1594. margin-bottom: 16rpx;
  1595. }
  1596. .brand-confirm-desc {
  1597. font-size: 24rpx;
  1598. color: #999;
  1599. text-align: center;
  1600. margin-bottom: 32rpx;
  1601. line-height: 1.6;
  1602. }
  1603. .brand-confirm-btn-row {
  1604. width: 100%;
  1605. display: flex;
  1606. justify-content: space-between;
  1607. gap: 24rpx;
  1608. }
  1609. .brand-confirm-btn {
  1610. flex: 1;
  1611. height: 72rpx;
  1612. border-radius: 36rpx;
  1613. font-size: 28rpx;
  1614. font-weight: bold;
  1615. display: flex;
  1616. align-items: center;
  1617. justify-content: center;
  1618. border: none;
  1619. margin: 0 0;
  1620. }
  1621. .brand-confirm-btn.retry {
  1622. background: #fff;
  1623. color: #ff9c00;
  1624. border: 2rpx solid #ff9c00;
  1625. }
  1626. .brand-confirm-btn.confirm {
  1627. background: linear-gradient(to right, #ffd01e, #ff8917);
  1628. color: #fff;
  1629. border: none;
  1630. }
  1631. </style>