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

1919 lines
52 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
2 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
2 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 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.image"
  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.shopCion">
  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.logo" 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.logo" 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. logo: '',
  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. logo: brand.logo,
  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. return '#'
  662. },
  663. },
  664. created() {
  665. this.currentCategory = 0
  666. this.$nextTick(() => {
  667. if (this.categories.length > 0) {
  668. const firstCategoryId = this.categories[0]?.id
  669. if (firstCategoryId) {
  670. this.fetchGoodsList(firstCategoryId, 1)
  671. }
  672. }
  673. })
  674. },
  675. mounted() {
  676. this.$nextTick(() => {
  677. const query = uni.createSelectorQuery().in(this)
  678. query.select('.uv-tabbar').boundingClientRect(rect => {
  679. if (rect && rect.height) {
  680. this.tabbarHeight = rect.height
  681. } else {
  682. this.tabbarHeight = uni.upx2px ? uni.upx2px(95) : 45
  683. }
  684. // console.log(this.tabbarHeight,'tabbarHeight')
  685. }).exec()
  686. })
  687. },
  688. onLoad(options) {
  689. if (options && options.categoryId) {
  690. const idx = this.categories.findIndex(c => c.id == options.categoryId)
  691. if (idx !== -1) this.currentCategory = idx
  692. }
  693. this.fetchGoodsList(this.categories[this.currentCategory].id, 1)
  694. uni.$on('bannerListUpdated', () => {
  695. this.$forceUpdate && this.$forceUpdate()
  696. })
  697. if (getApp().globalData.bannerList && getApp().globalData.bannerList.length > 0) {
  698. this.$forceUpdate && this.$forceUpdate()
  699. }
  700. // 检查全局清空标志(兼容 reLaunch)
  701. if (getApp().globalData.shouldClearRecycle) {
  702. Object.values(this.allProducts).forEach(categoryItems => {
  703. categoryItems.forEach(item => {
  704. this.$set(item, 'quantity', 0)
  705. })
  706. })
  707. this.showDetailPanel = false
  708. this.$forceUpdate()
  709. getApp().globalData.shouldClearRecycle = false
  710. }
  711. },
  712. onUnload() {
  713. uni.$off('bannerListUpdated')
  714. // 移除事件监听
  715. uni.$off('clearRecycleOrderData')
  716. },
  717. onShow() {
  718. const id = getApp().globalData.targetRecycleCategoryId
  719. if (id) {
  720. const trySwitch = () => {
  721. if (this.categories.length > 0) {
  722. const idx = this.categories.findIndex(c => String(c.id) === String(id))
  723. if (idx !== -1) {
  724. this.currentCategory = idx
  725. const categoryId = this.categories[idx]?.id
  726. if (categoryId && !this.allProducts[categoryId]) {
  727. this.loadingMore = false
  728. this.finished = false
  729. this.fetchGoodsList(categoryId, 1)
  730. }
  731. }
  732. getApp().globalData.targetRecycleCategoryId = null
  733. } else {
  734. setTimeout(trySwitch, 100)
  735. }
  736. }
  737. trySwitch()
  738. }
  739. // 检查全局清空标志
  740. if (getApp().globalData.shouldClearRecycle) {
  741. Object.values(this.allProducts).forEach(categoryItems => {
  742. categoryItems.forEach(item => {
  743. this.$set(item, 'quantity', 0)
  744. })
  745. })
  746. this.showDetailPanel = false
  747. this.$forceUpdate()
  748. getApp().globalData.shouldClearRecycle = false
  749. }
  750. // 监听清除订单数据的事件
  751. uni.$on('clearRecycleOrderData', () => {
  752. // 清除所有商品的选中数量,保证响应式
  753. Object.values(this.allProducts).forEach(categoryItems => {
  754. categoryItems.forEach(item => {
  755. this.$set(item, 'quantity', 0)
  756. })
  757. })
  758. // 重置其他相关数据
  759. this.showDetailPanel = false
  760. this.$forceUpdate()
  761. })
  762. },
  763. watch: {
  764. categories(newVal) {
  765. const id = getApp().globalData.targetRecycleCategoryId
  766. const idx = newVal.findIndex(c => String(c.id) === String(id))
  767. if (id && newVal.length > 0 && idx !== -1) {
  768. this.currentCategory = idx
  769. getApp().globalData.targetRecycleCategoryId = null
  770. // 自动加载右侧商品
  771. const categoryId = newVal[idx]?.id
  772. if (categoryId && !this.allProducts[categoryId]) {
  773. this.loadingMore = false
  774. this.finished = false
  775. this.fetchGoodsList(categoryId, 1)
  776. }
  777. }
  778. }
  779. },
  780. }
  781. </script>
  782. <style lang="scss" scoped>
  783. .container {
  784. display: flex;
  785. flex-direction: column;
  786. height: 100vh;
  787. background-color: #f5f5f5;
  788. overflow: hidden;
  789. }
  790. .banner {
  791. background: linear-gradient(135deg, #ff9500,#ff5e00);
  792. position: relative;
  793. height: 350rpx;
  794. z-index: 1;
  795. image {
  796. width: 100%;
  797. height: 90%;
  798. }
  799. }
  800. .goods-list {
  801. // flex: 1;
  802. display: flex;
  803. position: relative;
  804. height: calc(100vh - 400rpx - 120rpx - env(safe-area-inset-bottom)); /* 减去banner和底部栏的高度 */
  805. margin-top: -10rpx;
  806. z-index: 2;
  807. border-radius: 20rpx 20rpx 0 0;
  808. overflow: hidden;
  809. padding: 30rpx;
  810. box-shadow: 0 -4rpx 8rpx rgba(0, 0, 0, 0.05);
  811. background: linear-gradient(to bottom, #fff7e8, 20%,#ffffff);
  812. .category-nav {
  813. width: 20%;
  814. background: #ffffff;
  815. height: 100%;
  816. border-right: 1rpx solid rgba(255, 126, 14, 0.1);
  817. margin: 1rpx;
  818. border-radius: 20rpx 0 0 0;
  819. margin-right: 20rpx;
  820. overflow-y: auto;
  821. scrollbar-width: none; /* Firefox */
  822. -ms-overflow-style: none; /* IE and Edge */
  823. &::-webkit-scrollbar {
  824. width: 0 !important;
  825. display: none; /* Chrome, Safari, Opera */
  826. }
  827. .category-item {
  828. position: relative;
  829. padding: 28rpx 20rpx;
  830. text-align: center;
  831. font-family: PingFang SC;
  832. font-weight: 600;
  833. font-size: 15px;
  834. line-height: 100%;
  835. letter-spacing: 0px;
  836. color: #666;
  837. .category-dot {
  838. position: absolute;
  839. top: 15rpx;
  840. right: 15rpx;
  841. min-width: 32rpx;
  842. height: 32rpx;
  843. padding: 0 6rpx;
  844. background: #ff7a0e;
  845. border-radius: 16rpx;
  846. color: #fff;
  847. font-size: 20rpx;
  848. text-align: center;
  849. line-height: 32rpx;
  850. box-sizing: border-box;
  851. }
  852. &.active {
  853. color: #ff7a0e;
  854. font-weight: bold;
  855. background: #fff7e8;
  856. position: relative;
  857. &::before {
  858. content: '';
  859. position: absolute;
  860. left: 0;
  861. top: 50%;
  862. transform: translateY(-50%);
  863. width: 6rpx;
  864. height: 36rpx;
  865. background: #ff7a0e;
  866. border-radius: 3rpx;
  867. }
  868. }
  869. }
  870. }
  871. .goods-content {
  872. flex: 1;
  873. height: 100%;
  874. padding: 0 30rpx;
  875. background: #ffffff;
  876. width: 70%;
  877. margin: 1rpx;
  878. margin-left: 0;
  879. border-radius: 0 20rpx 0 0;
  880. overflow-y: auto;
  881. scrollbar-width: none; /* Firefox */
  882. -ms-overflow-style: none; /* IE and Edge */
  883. &::-webkit-scrollbar {
  884. width: 0 !important;
  885. display: none; /* Chrome, Safari, Opera */
  886. }
  887. }
  888. }
  889. .goods-item {
  890. display: flex;
  891. align-items: flex-start;
  892. padding: 30rpx 0;
  893. border-bottom: 1rpx solid #f5f5f5;
  894. .goods-item-img {
  895. width: 120rpx;
  896. height: 120rpx;
  897. border-radius: 24rpx;
  898. background: #f8f8f8;
  899. margin-right: 28rpx;
  900. object-fit: contain;
  901. flex-shrink: 0;
  902. }
  903. .goods-info-wrap {
  904. flex: 1;
  905. display: flex;
  906. flex-direction: column;
  907. justify-content: center;
  908. min-width: 0;
  909. }
  910. .goods-header {
  911. display: flex;
  912. justify-content: space-between;
  913. align-items: center;
  914. margin-bottom: 10rpx;
  915. }
  916. .goods-name {
  917. font-family: PingFang SC;
  918. font-weight: 500;
  919. font-size: 14px;
  920. line-height: 140%;
  921. letter-spacing: 0%;
  922. vertical-align: middle;
  923. color: #333;
  924. font-weight: bold;
  925. flex-shrink: 1;
  926. flex-grow: 1;
  927. }
  928. .brand-check-placeholder {
  929. flex-shrink: 0;
  930. margin-left: 10rpx;
  931. }
  932. .brand-check {
  933. display: flex;
  934. flex-direction: row;
  935. align-items: center;
  936. justify-content: center;
  937. border: 1px solid #f8a01d;
  938. border-radius: 8rpx;
  939. color: #ff7a0e;
  940. font-family: PingFang SC;
  941. font-weight: 400;
  942. font-size: 12px;
  943. padding: 4rpx 10rpx;
  944. line-height: 1;
  945. white-space: nowrap;
  946. text {
  947. margin-right: 4rpx;
  948. }
  949. }
  950. .goods-desc {
  951. font-size: 20rpx;
  952. color: #999;
  953. display: block;
  954. margin-bottom: 20rpx;
  955. white-space: nowrap;
  956. overflow: hidden;
  957. text-overflow: ellipsis;
  958. }
  959. .goods-info {
  960. display: flex;
  961. justify-content: space-between;
  962. align-items: center;
  963. }
  964. .price-info {
  965. display: flex;
  966. align-items: baseline;
  967. .price-symbol {
  968. font-size: 24rpx;
  969. color: #ff7a0e;
  970. }
  971. .price-value {
  972. font-size: 36rpx;
  973. color: #ff7a0e;
  974. font-weight: bold;
  975. margin: 0 4rpx;
  976. }
  977. .price-unit {
  978. font-size: 24rpx;
  979. color: #999;
  980. }
  981. }
  982. .quantity-control {
  983. display: flex;
  984. align-items: center;
  985. button {
  986. width: 60rpx;
  987. height: 60rpx;
  988. padding: 0;
  989. margin: 0;
  990. display: flex;
  991. align-items: center;
  992. justify-content: center;
  993. font-size: 28rpx;
  994. color: #666;
  995. background: #ffffff;
  996. border: none;
  997. border-radius: 50%;
  998. &::after {
  999. border: none;
  1000. }
  1001. &:active {
  1002. opacity: 0.8;
  1003. }
  1004. }
  1005. .quantity {
  1006. width: 80rpx;
  1007. text-align: center;
  1008. font-size: 32rpx;
  1009. color: #333;
  1010. }
  1011. }
  1012. .rules-link {
  1013. margin-top: 20rpx;
  1014. }
  1015. .rules-link .rules {
  1016. display: flex;
  1017. align-items: center;
  1018. font-family: PingFang SC;
  1019. font-weight: 400;
  1020. font-size: 12px;
  1021. line-height: 140%;
  1022. letter-spacing: 0%;
  1023. color: #666;
  1024. }
  1025. }
  1026. .other-unrecycle-card {
  1027. display: flex;
  1028. align-items: center;
  1029. background: #fff;
  1030. border-radius: 24rpx;
  1031. box-shadow: 0 4rpx 24rpx rgba(0,0,0,0.06);
  1032. padding: 30rpx 30rpx 30rpx 30rpx;
  1033. margin: 30rpx 0 0 0;
  1034. }
  1035. .other-unrecycle-img {
  1036. width: 120rpx;
  1037. height: 120rpx;
  1038. border-radius: 24rpx;
  1039. background: #f8f8f8;
  1040. margin-right: 28rpx;
  1041. object-fit: contain;
  1042. flex-shrink: 0;
  1043. }
  1044. .other-unrecycle-info {
  1045. flex: 1;
  1046. display: flex;
  1047. flex-direction: column;
  1048. justify-content: center;
  1049. min-width: 0;
  1050. }
  1051. .other-unrecycle-title {
  1052. font-size: 30rpx;
  1053. color: #222;
  1054. font-weight: bold;
  1055. margin-bottom: 8rpx;
  1056. word-break: break-all;
  1057. white-space: normal;
  1058. overflow: visible;
  1059. }
  1060. .other-unrecycle-desc {
  1061. font-size: 24rpx;
  1062. color: #999;
  1063. margin-bottom: 12rpx;
  1064. text-overflow: ellipsis;
  1065. overflow: hidden;
  1066. white-space: nowrap;
  1067. }
  1068. .other-unrecycle-price-row {
  1069. display: flex;
  1070. align-items: center;
  1071. }
  1072. .other-unrecycle-price {
  1073. font-size: 28rpx;
  1074. color: #ff9c00;
  1075. font-weight: bold;
  1076. }
  1077. .other-unrecycle-btn {
  1078. width: 60rpx;
  1079. height: 60rpx;
  1080. margin-left: 24rpx;
  1081. border-radius: 50%;
  1082. background: #fff;
  1083. color: #666;
  1084. font-size: 36rpx;
  1085. border: none;
  1086. display: flex;
  1087. align-items: center;
  1088. justify-content: center;
  1089. }
  1090. .fixed-bottom-wrap {
  1091. position: fixed;
  1092. left: 0;
  1093. right: 0;
  1094. bottom: calc(v-bind('tabbarHeight + "px"') + env(safe-area-inset-bottom));
  1095. width: 100vw;
  1096. z-index: 1001;
  1097. background: transparent;
  1098. box-sizing: border-box;
  1099. pointer-events: auto;
  1100. }
  1101. .bottom-bar-divider {
  1102. width: 100%;
  1103. height: 1px;
  1104. background: #f0f0f0;
  1105. position: absolute;
  1106. left: 0;
  1107. bottom: 0;
  1108. z-index: 1;
  1109. }
  1110. .green-tip-bar {
  1111. width: 100%;
  1112. background: #eaffea;
  1113. color: #13ac47;
  1114. font-size: 20rpx;
  1115. // padding: 16rpx 30rpx 0 30rpx;
  1116. box-sizing: border-box;
  1117. text-align: left;
  1118. display: flex;
  1119. align-items: center;
  1120. justify-content: center;
  1121. // flex-direction: r;
  1122. .tip-highlight {
  1123. color: #ff9c00;
  1124. font-weight: bold;
  1125. font-size: 20rpx;
  1126. }
  1127. }
  1128. .bottom-bar {
  1129. width: 100%;
  1130. background-color: #fff;
  1131. display: flex;
  1132. align-items: center;
  1133. justify-content: space-between;
  1134. padding: 0 30rpx;
  1135. box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
  1136. height: 120rpx;
  1137. border-top-left-radius: 0;
  1138. border-top-right-radius: 0;
  1139. border-bottom-left-radius: env(safe-area-inset-bottom);
  1140. border-bottom-right-radius: env(safe-area-inset-bottom);
  1141. .bottom-left {
  1142. // flex: 1;
  1143. display: flex;
  1144. flex-direction: column;
  1145. justify-content: center;
  1146. .summary-row {
  1147. display: flex;
  1148. align-items: center;
  1149. font-size: 26rpx;
  1150. color: #333;
  1151. .summary-label {
  1152. color: #333;
  1153. }
  1154. .summary-count {
  1155. color: #ff9c00;
  1156. font-weight: bold;
  1157. font-size: 28rpx;
  1158. }
  1159. }
  1160. .amount-row {
  1161. display: flex;
  1162. align-items: center;
  1163. margin-top: 4rpx;
  1164. .amount {
  1165. color: #ff9c00;
  1166. font-size: 44rpx;
  1167. font-weight: bold;
  1168. vertical-align: middle;
  1169. }
  1170. }
  1171. }
  1172. .submit-btn {
  1173. width: 300rpx;
  1174. height: 88rpx;
  1175. background: linear-gradient(to right, #ffd01e, #ff8917);
  1176. border-radius: 44rpx;
  1177. color: #fff;
  1178. font-size: 32rpx;
  1179. font-weight: bold;
  1180. display: flex;
  1181. align-items: center;
  1182. justify-content: center;
  1183. border: none;
  1184. // margin-left: 0rpx;
  1185. box-shadow: 0 4rpx 16rpx rgba(255, 156, 0, 0.08);
  1186. &::after {
  1187. border: none;
  1188. }
  1189. &:active {
  1190. opacity: 0.9;
  1191. }
  1192. }
  1193. }
  1194. .detail-popup-mask {
  1195. position: fixed;
  1196. left: 0;
  1197. right: 0;
  1198. top: 0;
  1199. bottom: calc(90rpx + env(safe-area-inset-bottom)); /* tabbar高度+安全区 */
  1200. background: rgba(0,0,0,0.35);
  1201. z-index: 8;
  1202. display: flex;
  1203. align-items: flex-end;
  1204. justify-content: center;
  1205. }
  1206. .detail-popup {
  1207. width: 100vw;
  1208. max-width: none;
  1209. background: #fff;
  1210. border-radius: 48rpx 48rpx 0 0;
  1211. box-shadow: 0 8rpx 48rpx rgba(0,0,0,0.18);
  1212. display: flex;
  1213. flex-direction: column;
  1214. align-items: stretch;
  1215. position: relative;
  1216. padding: 0;
  1217. overflow: hidden;
  1218. min-height: 520rpx;
  1219. max-height: 80vh;
  1220. bottom: 0;
  1221. }
  1222. .detail-popup-close {
  1223. position: absolute;
  1224. right: 36rpx;
  1225. top: 36rpx;
  1226. font-size: 36rpx;
  1227. color: #bbb;
  1228. z-index: 2;
  1229. }
  1230. .popup-green-tip {
  1231. border-radius: 48rpx 48rpx 0 0;
  1232. font-size: 20rpx;
  1233. padding: 24rpx 30rpx 0 30rpx;
  1234. background: #eaffea;
  1235. color: #13ac47;
  1236. text-align: left;
  1237. }
  1238. .panel-header {
  1239. display: flex;
  1240. align-items: center;
  1241. justify-content: center;
  1242. font-size: 32rpx;
  1243. font-weight: bold;
  1244. padding: 40rpx 36rpx 0 36rpx;
  1245. background: #fff;
  1246. position: relative;
  1247. }
  1248. .panel-title {
  1249. font-size: 32rpx;
  1250. color: #222;
  1251. font-weight: bold;
  1252. text-align: center;
  1253. flex: 1;
  1254. }
  1255. .popup-panel-list {
  1256. flex: 1;
  1257. overflow-y: auto;
  1258. max-height: 36vh;
  1259. padding: 0 24rpx;
  1260. scrollbar-width: none; /* Firefox */
  1261. -ms-overflow-style: none; /* IE and Edge */
  1262. &::-webkit-scrollbar {
  1263. width: 0 !important;
  1264. display: none; /* Chrome, Safari, Opera */
  1265. }
  1266. }
  1267. .panel-item {
  1268. display: flex;
  1269. align-items: center;
  1270. justify-content: flex-start;
  1271. padding: 24rpx 0;
  1272. border-bottom: 1px solid #f0f0f0;
  1273. }
  1274. .panel-item-img {
  1275. width: 100rpx;
  1276. height: 100rpx;
  1277. margin-right: 20rpx;
  1278. border-radius: 16rpx;
  1279. background: #f8f8f8;
  1280. }
  1281. .panel-item-info {
  1282. flex: 1;
  1283. display: flex;
  1284. flex-direction: column;
  1285. justify-content: center;
  1286. min-width: 0;
  1287. }
  1288. .panel-item-name {
  1289. font-size: 30rpx;
  1290. color: #222;
  1291. font-weight: bold;
  1292. margin-bottom: 4rpx;
  1293. text-overflow: ellipsis;
  1294. overflow: hidden;
  1295. white-space: nowrap;
  1296. }
  1297. .panel-item-desc {
  1298. font-size: 24rpx;
  1299. color: #999;
  1300. margin-bottom: 4rpx;
  1301. text-overflow: ellipsis;
  1302. overflow: hidden;
  1303. white-space: nowrap;
  1304. }
  1305. .panel-item-price {
  1306. font-size: 26rpx;
  1307. color: #ff9c00;
  1308. margin-top: 2rpx;
  1309. }
  1310. .panel-quantity-control {
  1311. display: flex;
  1312. align-items: center;
  1313. margin-left: 20rpx;
  1314. }
  1315. .panel-quantity-control button {
  1316. width: 48rpx;
  1317. height: 48rpx;
  1318. padding: 0;
  1319. margin: 0 8rpx;
  1320. display: flex;
  1321. align-items: center;
  1322. justify-content: center;
  1323. font-size: 32rpx;
  1324. color: #666;
  1325. background: #ffffff;
  1326. border: none;
  1327. border-radius: 50%;
  1328. &::after {
  1329. border: none;
  1330. }
  1331. &:active {
  1332. opacity: 0.8;
  1333. }
  1334. }
  1335. .panel-quantity-control .quantity {
  1336. width: 40rpx;
  1337. text-align: center;
  1338. font-size: 28rpx;
  1339. color: #333;
  1340. }
  1341. .popup-bottom-bar {
  1342. width: 100%;
  1343. background-color: #fff;
  1344. display: flex;
  1345. align-items: center;
  1346. justify-content: space-between;
  1347. padding: 0 30rpx;
  1348. box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
  1349. height: 120rpx;
  1350. border-top: 1px solid #f0f0f0;
  1351. border-bottom-left-radius: 48rpx;
  1352. border-bottom-right-radius: 48rpx;
  1353. // padding-bottom: env(safe-area-inset-bottom);
  1354. .bottom-left {
  1355. display: flex;
  1356. flex-direction: column;
  1357. justify-content: center;
  1358. .summary-row {
  1359. display: flex;
  1360. align-items: center;
  1361. font-size: 26rpx;
  1362. color: #333;
  1363. .summary-label {
  1364. color: #333;
  1365. }
  1366. .summary-count {
  1367. color: #ff9c00;
  1368. font-weight: bold;
  1369. font-size: 28rpx;
  1370. }
  1371. }
  1372. .amount-row {
  1373. display: flex;
  1374. align-items: center;
  1375. margin-top: 4rpx;
  1376. .amount {
  1377. color: #ff9c00;
  1378. font-size: 44rpx;
  1379. font-weight: bold;
  1380. vertical-align: middle;
  1381. }
  1382. }
  1383. }
  1384. .submit-btn {
  1385. width: 300rpx;
  1386. height: 88rpx;
  1387. background: linear-gradient(to right, #ffd01e, #ff8917);
  1388. border-radius: 44rpx;
  1389. color: #fff;
  1390. font-size: 32rpx;
  1391. font-weight: bold;
  1392. display: flex;
  1393. align-items: center;
  1394. justify-content: center;
  1395. border: none;
  1396. box-shadow: 0 4rpx 16rpx rgba(255, 156, 0, 0.08);
  1397. &::after {
  1398. border: none;
  1399. }
  1400. &:active {
  1401. opacity: 0.9;
  1402. }
  1403. }
  1404. }
  1405. .brand-popup-mask {
  1406. position: fixed;
  1407. left: 0;
  1408. right: 0;
  1409. top: 0;
  1410. bottom: 0;
  1411. background: rgba(0,0,0,0.35);
  1412. z-index: 3000;
  1413. display: flex;
  1414. align-items: flex-end;
  1415. justify-content: center;
  1416. }
  1417. .brand-popup {
  1418. position: relative;
  1419. width: 100%;
  1420. max-width: 750px;
  1421. background: #fff;
  1422. border-radius: 32rpx 32rpx 0 0;
  1423. box-shadow: 0 -4rpx 24rpx rgba(0,0,0,0.08);
  1424. padding-bottom: 40rpx;
  1425. max-height: 90vh;
  1426. display: flex;
  1427. flex-direction: column;
  1428. overflow: hidden;
  1429. }
  1430. .brand-popup-header {
  1431. display: flex;
  1432. align-items: center;
  1433. justify-content: center;
  1434. padding: 32rpx 24rpx 0 24rpx;
  1435. font-size: 32rpx;
  1436. font-weight: bold;
  1437. position: relative;
  1438. }
  1439. .brand-popup-close {
  1440. position: absolute;
  1441. left: 24rpx;
  1442. font-size: 28rpx;
  1443. color: #888;
  1444. }
  1445. .brand-popup-title {
  1446. font-size: 32rpx;
  1447. color: #222;
  1448. font-weight: bold;
  1449. }
  1450. .brand-popup-search {
  1451. padding: 20rpx 24rpx 0 24rpx;
  1452. }
  1453. .brand-search-input {
  1454. width: 100%;
  1455. height: 60rpx;
  1456. border-radius: 30rpx;
  1457. background: #f5f5f5;
  1458. border: none;
  1459. padding-left: 40rpx;
  1460. font-size: 28rpx;
  1461. color: #888;
  1462. }
  1463. .brand-popup-list {
  1464. flex: 1;
  1465. overflow-y: auto;
  1466. max-height: 60vh;
  1467. padding: 0 24rpx;
  1468. scrollbar-width: none; /* Firefox */
  1469. -ms-overflow-style: none; /* IE and Edge */
  1470. &::-webkit-scrollbar {
  1471. width: 0 !important;
  1472. display: none; /* Chrome, Safari, Opera */
  1473. }
  1474. }
  1475. .brand-letter {
  1476. font-size: 28rpx;
  1477. color: #888;
  1478. margin: 24rpx 0 8rpx 0;
  1479. font-weight: bold;
  1480. }
  1481. .brand-item {
  1482. display: flex;
  1483. align-items: center;
  1484. padding: 16rpx 0;
  1485. border-bottom: 1px solid #f0f0f0;
  1486. }
  1487. .brand-logo {
  1488. width: 60rpx;
  1489. height: 60rpx;
  1490. margin-right: 20rpx;
  1491. border-radius: 8rpx;
  1492. background: #f8f8f8;
  1493. }
  1494. .brand-name {
  1495. font-size: 28rpx;
  1496. color: #222;
  1497. }
  1498. .brand-index-bar {
  1499. position: absolute;
  1500. right: 12rpx;
  1501. top: 120rpx;
  1502. width: 32rpx;
  1503. display: flex;
  1504. flex-direction: column;
  1505. align-items: center;
  1506. z-index: 10;
  1507. }
  1508. .brand-index-bar text {
  1509. font-size: 22rpx;
  1510. color: #bbb;
  1511. margin: 4rpx 0;
  1512. font-weight: bold;
  1513. &.active {
  1514. color: #ff9c00;
  1515. }
  1516. }
  1517. .rule-popup-mask {
  1518. position: fixed;
  1519. left: 0;
  1520. right: 0;
  1521. top: 0;
  1522. bottom: 0;
  1523. background: rgba(0,0,0,0.35);
  1524. z-index: 4000;
  1525. display: flex;
  1526. align-items: center;
  1527. justify-content: center;
  1528. }
  1529. .rule-popup {
  1530. width: 90vw;
  1531. max-width: 600rpx;
  1532. background: #fff;
  1533. border-radius: 48rpx;
  1534. box-shadow: 0 8rpx 32rpx rgba(0,0,0,0.12);
  1535. display: flex;
  1536. flex-direction: column;
  1537. align-items: center;
  1538. position: relative;
  1539. padding-bottom: 40rpx;
  1540. }
  1541. .rule-popup-title {
  1542. font-size: 36rpx;
  1543. color: #222;
  1544. font-weight: bold;
  1545. text-align: center;
  1546. margin-top: 48rpx;
  1547. margin-bottom: 16rpx;
  1548. }
  1549. .rule-popup-content {
  1550. width: 100%;
  1551. max-height: 420rpx;
  1552. padding: 0 40rpx;
  1553. box-sizing: border-box;
  1554. overflow-y: auto;
  1555. scrollbar-width: none; /* Firefox */
  1556. -ms-overflow-style: none; /* IE and Edge */
  1557. &::-webkit-scrollbar {
  1558. width: 0 !important;
  1559. display: none; /* Chrome, Safari, Opera */
  1560. }
  1561. }
  1562. .rule-popup-desc {
  1563. font-size: 26rpx;
  1564. color: #888;
  1565. text-align: center;
  1566. margin-bottom: 24rpx;
  1567. margin-top: 0;
  1568. }
  1569. .rule-popup-warning {
  1570. width: 100%;
  1571. border: 2rpx solid #ffb800;
  1572. color: #ffb800;
  1573. background: #fffbe6;
  1574. border-radius: 32rpx;
  1575. font-size: 28rpx;
  1576. text-align: center;
  1577. padding: 16rpx 0;
  1578. margin-bottom: 24rpx;
  1579. font-weight: bold;
  1580. }
  1581. .rule-popup-img {
  1582. display: block;
  1583. margin: 0 auto 24rpx auto;
  1584. max-width: 80%;
  1585. max-height: 300rpx;
  1586. border-radius: 16rpx;
  1587. object-fit: contain;
  1588. }
  1589. .rule-popup-btn {
  1590. width: 80%;
  1591. height: 88rpx;
  1592. background: linear-gradient(to right, #ffd01e, #ff8917);
  1593. border-radius: 44rpx;
  1594. color: #fff;
  1595. font-size: 32rpx;
  1596. font-weight: bold;
  1597. display: flex;
  1598. align-items: center;
  1599. justify-content: center;
  1600. border: none;
  1601. margin: 0 auto;
  1602. margin-top: 16rpx;
  1603. box-shadow: 0 4rpx 16rpx rgba(255, 156, 0, 0.08);
  1604. &::after {
  1605. border: none;
  1606. }
  1607. &:active {
  1608. opacity: 0.9;
  1609. }
  1610. }
  1611. .rule-popup-close {
  1612. position: absolute;
  1613. right: 32rpx;
  1614. bottom: 32rpx;
  1615. width: 72rpx;
  1616. height: 72rpx;
  1617. background: #ff5a5f;
  1618. border-radius: 50%;
  1619. display: flex;
  1620. align-items: center;
  1621. justify-content: center;
  1622. z-index: 10;
  1623. box-shadow: 0 2rpx 8rpx rgba(255,90,95,0.12);
  1624. }
  1625. /* 预约上门取件弹窗样式 */
  1626. .pickup-confirm-mask {
  1627. position: fixed;
  1628. left: 0;
  1629. right: 0;
  1630. top: 0;
  1631. bottom: 0;
  1632. background: rgba(0,0,0,0.35);
  1633. z-index: 5000;
  1634. display: flex;
  1635. align-items: center;
  1636. justify-content: center;
  1637. }
  1638. .pickup-confirm-popup {
  1639. width: 90vw;
  1640. max-width: 600rpx;
  1641. background: #fff;
  1642. border-radius: 48rpx;
  1643. box-shadow: 0 8rpx 32rpx rgba(0,0,0,0.12);
  1644. display: flex;
  1645. flex-direction: column;
  1646. align-items: center;
  1647. position: relative;
  1648. padding: 48rpx 36rpx 40rpx 36rpx;
  1649. }
  1650. .pickup-confirm-title {
  1651. font-size: 36rpx;
  1652. color: #222;
  1653. font-weight: bold;
  1654. text-align: center;
  1655. margin-bottom: 24rpx;
  1656. }
  1657. .pickup-confirm-content {
  1658. width: 100%;
  1659. font-size: 26rpx;
  1660. color: #333;
  1661. text-align: left;
  1662. line-height: 1.7;
  1663. margin-bottom: 36rpx;
  1664. .confirm-item {
  1665. margin-bottom: 24rpx;
  1666. &:last-child {
  1667. margin-bottom: 0;
  1668. }
  1669. }
  1670. .confirm-item-red {
  1671. color: red;
  1672. }
  1673. }
  1674. .pickup-confirm-btn-row {
  1675. width: 100%;
  1676. display: flex;
  1677. justify-content: space-between;
  1678. gap: 32rpx;
  1679. }
  1680. .pickup-confirm-btn {
  1681. flex: 1;
  1682. height: 88rpx;
  1683. border-radius: 44rpx;
  1684. font-size: 32rpx;
  1685. font-weight: bold;
  1686. display: flex;
  1687. align-items: center;
  1688. justify-content: center;
  1689. border: 2rpx solid #ffd01e;
  1690. background: #fff;
  1691. color: #ff9c00;
  1692. box-shadow: 0 4rpx 16rpx rgba(255, 156, 0, 0.08);
  1693. }
  1694. .pickup-confirm-btn:not(.agree) {
  1695. background: #fff0d2;
  1696. }
  1697. .pickup-confirm-btn.agree {
  1698. background: linear-gradient(to right, #ffd01e, #ff8917);
  1699. color: #fff;
  1700. border: none;
  1701. }
  1702. .uv-tabbar {
  1703. z-index: 1000;
  1704. }
  1705. .loading-more {
  1706. text-align: center;
  1707. color: #999;
  1708. padding: 20rpx 0;
  1709. font-size: 26rpx;
  1710. }
  1711. .brand-confirm-mask {
  1712. position: fixed;
  1713. left: 0;
  1714. right: 0;
  1715. top: 0;
  1716. bottom: 0;
  1717. background: rgba(0,0,0,0.25);
  1718. z-index: 5001;
  1719. display: flex;
  1720. align-items: center;
  1721. justify-content: center;
  1722. }
  1723. .brand-confirm-popup {
  1724. width: 70vw;
  1725. max-width: 270px;
  1726. background: #fff;
  1727. border-radius: 32rpx;
  1728. box-shadow: 0 8rpx 32rpx rgba(0,0,0,0.12);
  1729. display: flex;
  1730. flex-direction: column;
  1731. align-items: center;
  1732. padding: 48rpx 20rpx 36rpx 20rpx;
  1733. position: relative;
  1734. }
  1735. .brand-confirm-title {
  1736. font-size: 36rpx;
  1737. color: #222;
  1738. font-weight: bold;
  1739. text-align: center;
  1740. margin-bottom: 24rpx;
  1741. }
  1742. .brand-confirm-logo-wrap {
  1743. width: 120rpx;
  1744. height: 120rpx;
  1745. background: #f8f8f8;
  1746. border-radius: 50%;
  1747. display: flex;
  1748. align-items: center;
  1749. justify-content: center;
  1750. margin-bottom: 18rpx;
  1751. }
  1752. .brand-confirm-logo {
  1753. width: 80rpx;
  1754. height: 80rpx;
  1755. border-radius: 50%;
  1756. }
  1757. .brand-confirm-name {
  1758. font-size: 28rpx;
  1759. color: #222;
  1760. font-weight: bold;
  1761. text-align: center;
  1762. margin-bottom: 16rpx;
  1763. }
  1764. .brand-confirm-desc {
  1765. font-size: 24rpx;
  1766. color: #999;
  1767. text-align: center;
  1768. margin-bottom: 32rpx;
  1769. line-height: 1.6;
  1770. }
  1771. .brand-confirm-btn-row {
  1772. width: 100%;
  1773. display: flex;
  1774. justify-content: space-between;
  1775. gap: 24rpx;
  1776. }
  1777. .brand-confirm-btn {
  1778. flex: 1;
  1779. height: 72rpx;
  1780. border-radius: 36rpx;
  1781. font-size: 28rpx;
  1782. font-weight: bold;
  1783. display: flex;
  1784. align-items: center;
  1785. justify-content: center;
  1786. border: none;
  1787. margin: 0 0;
  1788. }
  1789. .brand-confirm-btn.retry {
  1790. background: #fff;
  1791. color: #ff9c00;
  1792. border: 2rpx solid #ff9c00;
  1793. }
  1794. .brand-confirm-btn.confirm {
  1795. background: linear-gradient(to right, #ffd01e, #ff8917);
  1796. color: #fff;
  1797. border: none;
  1798. }
  1799. .price-info-popup-mask {
  1800. position: fixed;
  1801. left: 0;
  1802. right: 0;
  1803. top: 0;
  1804. bottom: 0;
  1805. background: rgba(0,0,0,0.4);
  1806. z-index: 6000;
  1807. display: flex;
  1808. align-items: center;
  1809. justify-content: center;
  1810. }
  1811. .price-info-popup {
  1812. width: 85vw;
  1813. max-width: 600rpx;
  1814. background: #fff;
  1815. border-radius: 24rpx;
  1816. box-shadow: 0 8rpx 32rpx rgba(0,0,0,0.12);
  1817. display: flex;
  1818. flex-direction: column;
  1819. align-items: center;
  1820. position: relative;
  1821. padding: 40rpx 40rpx;
  1822. .price-info-popup-title {
  1823. font-size: 34rpx;
  1824. color: #333;
  1825. font-weight: bold;
  1826. text-align: center;
  1827. margin-bottom: 30rpx;
  1828. }
  1829. .price-info-popup-content {
  1830. width: 100%;
  1831. max-height: 50vh;
  1832. .price-info-section {
  1833. margin-bottom: 30rpx;
  1834. &:last-child {
  1835. margin-bottom: 0;
  1836. }
  1837. .price-info-heading {
  1838. font-size: 28rpx;
  1839. color: #333;
  1840. font-weight: 500;
  1841. margin-bottom: 15rpx;
  1842. }
  1843. .price-info-text {
  1844. font-size: 26rpx;
  1845. color: #666;
  1846. line-height: 1.6;
  1847. }
  1848. }
  1849. }
  1850. .price-info-popup-btn {
  1851. width: 100%;
  1852. height: 88rpx;
  1853. background: linear-gradient(to right, #ffd01e, #ff8917);
  1854. border-radius: 44rpx;
  1855. color: #fff;
  1856. font-size: 32rpx;
  1857. font-weight: bold;
  1858. display: flex;
  1859. align-items: center;
  1860. justify-content: center;
  1861. border: none;
  1862. margin-top: 40rpx;
  1863. box-shadow: 0 4rpx 16rpx rgba(255, 156, 0, 0.08);
  1864. &::after {
  1865. border: none;
  1866. }
  1867. &:active {
  1868. opacity: 0.9;
  1869. }
  1870. }
  1871. }
  1872. </style>