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

1925 lines
52 KiB

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