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

1926 lines
52 KiB

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