爱简收旧衣按件回收前端代码仓库
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.

1890 lines
51 KiB

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