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

2729 lines
78 KiB

2 months ago
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
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
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
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
2 months ago
2 months ago
2 months ago
2 months ago
1 month ago
1 month ago
2 months ago
1 month ago
2 months ago
2 months ago
1 month ago
1 month ago
2 months ago
2 months ago
1 month ago
2 months ago
3 weeks 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
3 weeks ago
3 weeks ago
2 months ago
2 months ago
2 months ago
2 months ago
1 month 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
1 month ago
1 month 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
1 month ago
2 months ago
1 month ago
1 month ago
1 month 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
1 month ago
1 month 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
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
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
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
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
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
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
2 months 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: 320rpx;"
  12. >
  13. <swiper-item v-for="(item, index) in bannerList" :key="item.id || index">
  14. <view v-if="item.type == 1" class="video-container">
  15. <!-- 预览状态显示封面图 -->
  16. <image
  17. v-if="!videoPlayingStates[index]"
  18. :src="item.image || ''"
  19. mode="aspectFill"
  20. style="width: 100%; height: 100%;"
  21. class="video-poster"
  22. @click="playVideoFullscreen(item, index)"
  23. />
  24. <!-- 播放状态显示视频 -->
  25. <video
  26. v-else
  27. :id="`recycle-video-${index}`"
  28. :src="item.voUrl"
  29. :autoplay="true"
  30. :muted="false"
  31. :loop="false"
  32. :controls="true"
  33. :show-play-btn="true"
  34. :show-center-play-btn="false"
  35. :show-fullscreen-btn="true"
  36. :show-progress="true"
  37. :show-mute-btn="true"
  38. :enable-progress-gesture="true"
  39. :enable-play-gesture="true"
  40. object-fit="cover"
  41. style="width: 100%; height: 100%;"
  42. @fullscreenchange="onFullscreenChange"
  43. @play="onVideoPlay(index)"
  44. @pause="onVideoPause(index)"
  45. @ended="onVideoEnded(index)"
  46. ></video>
  47. <!-- 播放按钮覆盖层 -->
  48. <view v-if="!videoPlayingStates[index]" class="video-overlay" @click="playVideoFullscreen(item, index)">
  49. <view class="play-button-large">
  50. <view class="play-triangle"></view>
  51. </view>
  52. </view>
  53. </view>
  54. <image v-else :src="item.image" mode="aspectFill" style="width: 100%; height: 100%;" />
  55. </swiper-item>
  56. </swiper>
  57. <!-- 备用静态图片当没有轮播图数据时显示 -->
  58. <image v-if="!bannerList || bannerList.length === 0" :src="recycle_banner" mode="aspectFill" style="width: 100%; height: 100%;" />
  59. </view>
  60. <!-- 商品列表 -->
  61. <view class="goods-list">
  62. <!-- 左侧分类导航 -->
  63. <view class="category-nav">
  64. <view
  65. v-for="(category, index) in categories"
  66. :key="category.id || index"
  67. class="category-item"
  68. :class="{ active: currentCategory === index }"
  69. @click="switchCategory(index)"
  70. >
  71. <view class="category-dot" v-if="getCategoryItemCount(index) > 0">{{ getCategoryItemCount(index) }}</view>
  72. {{ category.title }}
  73. </view>
  74. </view>
  75. <!-- 右侧商品列表 -->
  76. <scroll-view class="goods-content" scroll-y @scrolltolower="loadMoreGoods">
  77. <view class="goods-section">
  78. <view class="goods-item" v-for="(item, index) in recycleList" :key="index">
  79. <image v-if="item.image" :src="item.image" class="goods-item-img" mode="aspectFit" />
  80. <view class="goods-info-wrap">
  81. <view class="goods-header">
  82. <text class="goods-name">{{item.name}}</text>
  83. </view>
  84. <text class="goods-desc">{{item.service}}</text>
  85. <view class="rules-brand-row">
  86. <view class="rules-link" @click="showRules(item)">
  87. <view class="rules">
  88. <text>回收规则</text>
  89. <uni-icons type="right" size="14" color="#999"></uni-icons>
  90. </view>
  91. </view>
  92. <view class="brand-check-placeholder" v-if="item.isPin === 'Y'">
  93. <view class="brand-check" @click="checkBrand(index)">
  94. <text>查看品牌</text>
  95. <uni-icons type="right" size="12" color="#ff7a0e"></uni-icons>
  96. </view>
  97. </view>
  98. </view>
  99. <view class="goods-info">
  100. <view class="price-info">
  101. <text class="price-symbol">¥</text>
  102. <text class="price-value" v-if="!item.maxPrice || item.maxPrice == item.price">{{item.price}}</text>
  103. <text class="price-value" v-else>{{item.price}}-{{item.maxPrice}}</text>
  104. <text class="price-unit">/{{ item.unit || '件' }}</text>
  105. </view>
  106. <view class="quantity-control">
  107. <button class="btn-minus" @click="updateQuantity(index, -1)">-</button>
  108. <text class="quantity">{{getItemTotalQuantity(item)}}</text>
  109. <button class="btn-plus" @click="updateQuantity(index, 1)">+</button>
  110. </view>
  111. </view>
  112. </view>
  113. </view>
  114. </view>
  115. <!-- 不可回收商品 -->
  116. <view class="other-unrecycle-card">
  117. <!-- 使用商品分类数据中的icon -->
  118. <image class="other-unrecycle-img" :src="categories[currentCategory]?.icon" mode="aspectFit" />
  119. <view class="other-unrecycle-info">
  120. <!-- 主标题和副标题用接口返回的otherTitle和otherSubTitle -->
  121. <view class="other-unrecycle-title">{{ categories[currentCategory]?.otherTitle }}</view>
  122. <view class="other-unrecycle-desc">{{ categories[currentCategory]?.otherSubTitle }}</view>
  123. <view class="other-unrecycle-price-row">
  124. <text class="other-unrecycle-price">¥ /{{ categories[currentCategory]?.unit || '件' }}</text>
  125. </view>
  126. </view>
  127. <button class="other-unrecycle-btn" open-type="contact">+</button>
  128. </view>
  129. <view v-if="loadingMore" class="loading-more">加载中...</view>
  130. <view v-else-if="finished" class="loading-more">没有更多了</view>
  131. </scroll-view>
  132. </view>
  133. <!-- 固定底部区域 -->
  134. <view class="fixed-bottom-wrap" v-if="!showDetailPanel" >
  135. <view class="green-tip-bar">
  136. 回收范围仅支持回收以上品类按件回收预计比称重回收多
  137. <text class="tip-highlight"> {{extraRecycleAmount.display}}</text>
  138. </view>
  139. <view class="bottom-bar">
  140. <view class="bottom-left">
  141. <view class="summary-row">
  142. <text class="summary-label">已选 <text class="summary-count">{{totalCount}}</text> {{ totalUnitText }} 预计回收可得</text>
  143. <uni-icons type="help" size="18" color="#b2b2b2" style="margin: 0 8rpx;" @tap="showPriceInfoPopups" />
  144. </view>
  145. <view class="amount-row">
  146. <uni-icons :type="showDetailPanel ? 'up' : 'down'" size="18" color="#5e5e5e" style="margin-right: 8rpx;vertical-align: middle;" @click="toggleDetailPanel" />
  147. <text class="amount" v-if="priceRange.min === priceRange.max">¥{{priceRange.min}}</text>
  148. <text class="amount" v-else>¥{{priceRange.min}}-{{priceRange.max}}</text>
  149. </view>
  150. </view>
  151. <button class="submit-btn" @click="submitOrder">预约上门取件</button>
  152. </view>
  153. <view class="bottom-bar-divider"></view>
  154. </view>
  155. <!-- 明细弹窗遮罩和弹窗 -->
  156. <view v-if="showDetailPanel" class="detail-popup-mask" @click.self="toggleDetailPanel">
  157. <view class="detail-popup" @click.stop>
  158. <view class="detail-popup-close" @click="toggleDetailPanel">×</view>
  159. <view class="green-tip-bar popup-green-tip">
  160. 回收范围仅支持回收以上品类按件回收预计比称重回收多
  161. <text class="tip-highlight"> {{extraRecycleAmount.display}}</text>
  162. </view>
  163. <view class="panel-header">
  164. <text class="panel-title">已选商品明细</text>
  165. </view>
  166. <scroll-view class="panel-list popup-panel-list" scroll-y>
  167. <view v-for="(item, idx) in selectedProducts" :key="item.uniqueKey || idx" class="panel-item">
  168. <image v-if="item.image" :src="item.image" class="panel-item-img" mode="aspectFit" />
  169. <view class="panel-item-info">
  170. <text class="panel-item-name">{{item.name}}</text>
  171. <text class="panel-item-desc" v-if="item.brandName">品牌{{item.brandName}}</text>
  172. <text class="panel-item-desc" v-else>{{item.service}}</text>
  173. <text class="panel-item-price" v-if="!item.maxPrice || item.maxPrice == item.price">¥{{item.price}}/{{ item.unit || '' }}</text>
  174. <text class="panel-item-price" v-else>¥{{item.price}}-{{item.maxPrice}}/{{ item.unit || '' }}</text>
  175. </view>
  176. <view class="panel-quantity-control">
  177. <button class="btn-minus" @click="updateQuantityByProduct(item, -1)">-</button>
  178. <text class="quantity">{{item.quantity}}</text>
  179. <button class="btn-plus" @click="updateQuantityByProduct(item, 1)">+</button>
  180. </view>
  181. </view>
  182. </scroll-view>
  183. <view class="popup-bottom-bar">
  184. <view class="bottom-left">
  185. <view class="summary-row">
  186. <text class="summary-label">已选 <text class="summary-count">{{totalCount}}</text> {{ totalUnitText }} 预计回收可得</text>
  187. <uni-icons type="help" size="18" color="#b2b2b2" style="margin: 0 8rpx;" @tap="showPriceInfoPopups" />
  188. </view>
  189. <view class="amount-row">
  190. <uni-icons :type="showDetailPanel ? 'up' : 'down'" size="18" color="#5e5e5e" style="margin-right: 8rpx;vertical-align: middle;" @click="toggleDetailPanel" />
  191. <text class="amount" v-if="priceRange.min === priceRange.max">¥{{priceRange.min}}</text>
  192. <text class="amount" v-else>¥{{priceRange.min}}-{{priceRange.max}}</text>
  193. </view>
  194. </view>
  195. <button class="submit-btn" @click="submitOrder">预约上门取件</button>
  196. </view>
  197. </view>
  198. </view>
  199. <!-- 价格说明弹窗 -->
  200. <view v-if="showPriceInfoPopup" class="price-info-popup-mask" @click.self="closePriceInfoPopup">
  201. <view class="price-info-popup">
  202. <view class="price-info-popup-title">回收规则</view>
  203. <scroll-view class="price-info-popup-content" scroll-y>
  204. <!-- <view class="price-info-section">
  205. <view class="price-info-heading">关于旧衣质检</view>
  206. <view class="price-info-text">请确认本次回收旧衣是可以进行二次穿着的程度如回收旧衣有破损磨损开线变形起球发黄染色污渍配饰脱落或款式老旧等问题无法通过质检</view>
  207. </view>
  208. <view class="price-info-section">
  209. <view class="price-info-heading">质检报告</view>
  210. <view class="price-info-text">回收商收到衣后1-3个工作日内完成衣质检报告</view>
  211. </view>
  212. <view class="price-info-section">
  213. <view class="price-info-heading">质检结果与回收价格</view>
  214. <view class="price-info-text">若回收旧衣质检通过质检价格与用户提交订单时的预估价格一致回收商将按照预估价打款至您的小程序账户余额</view>
  215. </view> -->
  216. <uv-parse :content="huodong_text"></uv-parse>
  217. </scroll-view>
  218. <button class="price-info-popup-btn" @click="closePriceInfoPopup">我知道了</button>
  219. </view>
  220. </view>
  221. <!-- 根据角色显示不同的导航栏 -->
  222. <uv-tabbar
  223. v-if="ishow"
  224. :value="value"
  225. :fixed="true"
  226. @change="changeTo"
  227. class="uv-tabbar"
  228. >
  229. <uv-tabbar-item text="首页" >
  230. <template v-slot:active-icon>
  231. <image class="icon" src="/static/home/首页-点击.png"></image>
  232. </template>
  233. <template v-slot:inactive-icon>
  234. <image class="icon" src="/static/home/首页-未点击.png"></image>
  235. </template>
  236. </uv-tabbar-item>
  237. <uv-tabbar-item text="回收" >
  238. <template v-slot:active-icon>
  239. <image class="icon" src="/static/home/回收-点击.png"></image>
  240. </template>
  241. <template v-slot:inactive-icon>
  242. <image class="icon" src="/static/home/回收-未点击.png"></image>
  243. </template>
  244. </uv-tabbar-item>
  245. <uv-tabbar-item text="我的" >
  246. <template v-slot:active-icon>
  247. <image class="icon" src="/static/home/我的-点击.png"></image>
  248. </template>
  249. <template v-slot:inactive-icon>
  250. <image class="icon" src="/static/home/我的-未点击.png"></image>
  251. </template>
  252. </uv-tabbar-item>
  253. </uv-tabbar>
  254. <!-- 品牌索引弹窗 -->
  255. <view v-if="showBrandPopup" class="brand-popup-mask">
  256. <view class="brand-popup">
  257. <view class="brand-popup-header">
  258. <text class="brand-popup-close" @click="closeBrandPopup">关闭</text>
  259. <text class="brand-popup-title">可回收的品牌</text>
  260. </view>
  261. <view class="brand-popup-search">
  262. <input class="brand-search-input" v-model="brandSearch" placeholder="请输入要查询的内容" @input="onBrandSearchInput" />
  263. </view>
  264. <scroll-view class="brand-popup-list" scroll-y :scroll-into-view="scrollToView">
  265. <view v-for="letter in brandIndexList" :key="letter" :id="'brand-letter-' + letter">
  266. <view class="brand-letter">{{letter}}</view>
  267. <view v-for="brand in filteredBrandList.filter(b => b.letter === letter)" :key="brand.name" class="brand-item" @click="openBrandConfirm(brand)">
  268. <image :src="brand.logo" class="brand-logo" mode="aspectFit" />
  269. <text class="brand-name">{{brand.name}}</text>
  270. </view>
  271. </view>
  272. </scroll-view>
  273. <view class="brand-index-bar">
  274. <text v-for="letter in brandIndexList" :key="letter" :class="{active: currentLetter === letter}" @click="scrollToLetter(letter)">{{letter}}</text>
  275. </view>
  276. </view>
  277. </view>
  278. <!-- 回收规则弹窗 -->
  279. <view v-if="showRulePopup" class="rule-popup-mask" @click.self="handleRulePopupMaskClick">
  280. <view class="rule-popup">
  281. <view class="rule-popup-title">回收规则</view>
  282. <scroll-view class="rule-popup-content" scroll-y @scroll="onRuleContentScroll" @scrolltolower="onRuleScrollToLower">
  283. <uv-parse :content="ruleHtml" @ready="onRuleContentReady"></uv-parse>
  284. <view class="rule-content-bottom-indicator"></view>
  285. </scroll-view>
  286. <view v-if="!hasScrolledToBottom" class="scroll-tip">请滚动到底部阅读完整内容</view>
  287. <button class="rule-popup-btn" :class="{ disabled: !hasScrolledToBottom }" :disabled="!hasScrolledToBottom" @click.stop="closeRulePopup">我知道了</button>
  288. </view>
  289. </view>
  290. <!-- 预约上门取件弹窗 -->
  291. <view v-if="showPickupConfirm" class="pickup-confirm-mask">
  292. <view class="pickup-confirm-popup">
  293. <view class="pickup-confirm-title">温馨提示</view>
  294. <view class="pickup-confirm-content">
  295. <uv-parse :content="recycle_toast"></uv-parse>
  296. <!-- <view class="confirm-item confirm-item-red">1.当前回收快递免费上门由于快递成本较高为避免不必要的成本及资源二次浪费不属于可回收品类或不符合回收标准的物品请勿寄出</view>
  297. <view class="confirm-item">2.已通过的回收物品将正常结算不符合回收要求的物品可选择快递取回运费自付请在订单结算后48小时内联系在线客服安排取回逾期未联系将默认捐赠无法再次取回</view>
  298. <view class="confirm-item">3.若用户寄出大量不可回收的物品平台有权限制下次回收权限或取消下次包邮服务</view>
  299. <view class="confirm-item">4.对于合格率高的回收订单平台将根据实际情况给予额外回收奖励</view> -->
  300. </view>
  301. <view class="pickup-confirm-btn-row">
  302. <button class="pickup-confirm-btn" @click="handlePickupCancel">取消回收</button>
  303. <button class="pickup-confirm-btn agree" @click="handlePickupAgree">我同意</button>
  304. </view>
  305. </view>
  306. </view>
  307. <!-- 品牌确认弹窗 -->
  308. <view v-if="showBrandConfirm" class="brand-confirm-mask" @click.self="closeBrandConfirm">
  309. <view class="brand-confirm-popup">
  310. <view class="brand-confirm-title">品牌确认提示</view>
  311. <view class="brand-confirm-logo-wrap">
  312. <image :src="brandConfirmInfo.logo" class="brand-confirm-logo" mode="aspectFit" />
  313. </view>
  314. <view class="brand-confirm-name">{{ brandConfirmInfo.name }}</view>
  315. <view class="brand-confirm-desc">请确认所选品牌是否与实物品牌信息一致否则将无法进行回收</view>
  316. <view class="brand-confirm-btn-row">
  317. <button class="brand-confirm-btn retry" @click="closeBrandConfirm">重新选择</button>
  318. <button class="brand-confirm-btn confirm" @click="confirmBrand">确认一致</button>
  319. </view>
  320. </view>
  321. </view>
  322. <!-- 减少数量时的品牌选择弹窗 -->
  323. <view v-if="showBrandReducePopup" class="brand-reduce-popup-mask" @click.self="closeBrandReducePopup">
  324. <view class="brand-reduce-popup">
  325. <view class="brand-reduce-popup-header">
  326. <text class="brand-reduce-popup-close" @click="closeBrandReducePopup">关闭</text>
  327. <text class="brand-reduce-popup-title">选择要减少的品牌</text>
  328. </view>
  329. <scroll-view class="brand-reduce-popup-list" scroll-y>
  330. <view v-for="brand in reduceBrandList" :key="brand.brandId" class="brand-item" @click="selectReduceBrand(brand)">
  331. <image :src="brand.logo" class="brand-logo" mode="aspectFit" />
  332. <text class="brand-name">{{brand.name}}</text>
  333. </view>
  334. </scroll-view>
  335. </view>
  336. </view>
  337. </view>
  338. </template>
  339. <script>
  340. import tabBarMixin from '../mixins/tabBarMixin.js'
  341. import { pinyin } from '../../utils/pinyin.js'
  342. export default {
  343. mixins: [tabBarMixin],
  344. data() {
  345. return {
  346. value:1,
  347. ishow:true,
  348. // 动态数据
  349. allProducts: {}, // { [categoryId]: [商品数组] }
  350. allProductsPage: {}, // { [categoryId]: 当前已加载页码 }
  351. allProductsTotal: {}, // { [categoryId]: 总数 }
  352. pageSize: 10,
  353. currentCategory: 0,
  354. tabbarHeight: 0,
  355. videoPlayingStates: {}, // 记录每个视频的播放状态
  356. showDetailPanel: false,
  357. showBrandPopup: false,
  358. showRulePopup: false,
  359. ruleImgUrl: '/static/回收/回收规则.png',
  360. showPickupConfirm: false,
  361. showBrandConfirm: false,
  362. brandConfirmInfo: {
  363. logo: '',
  364. name: ''
  365. },
  366. brandList: [],
  367. brandCache: {}, // 为每个商品缓存品牌信息 { productId: [brandList] }
  368. currentLetter: 'A',
  369. scrollToView: '',
  370. brandSearch: '',
  371. ruleHtml: '', // 回收规则富文本内容
  372. loadingMore: false,
  373. finished: false,
  374. pendingBrandIndex: null, // 记录待加一的品牌商品index
  375. showPriceInfoPopup: false,
  376. isWaitingForBrandSelection: false, // 等待品牌选择的标志
  377. showBrandReducePopup: false, // 显示减少数量时的品牌选择弹窗
  378. reduceItem: null, // 待减少数量的商品
  379. reduceBrandList: [], // 可减少的品牌列表
  380. viewedRuleItems: new Set(), // 已查看过规则的商品ID集合
  381. loadOptions: null, // 保存options参数
  382. userInfo: null, // 用户信息
  383. isUserBlacklisted: false, // 用户是否被拉黑
  384. currentProductId: null, // 当前查看品牌的商品ID
  385. searchTimer: null, // 搜索防抖定时器
  386. hasScrolledToBottom: false, // 是否已滚动到底部
  387. }
  388. },
  389. computed: {
  390. recycle_banner() {
  391. const item = getApp().globalData.configData.find(i => i.keyName === 'recycle_banner')
  392. return item ? item.keyContent : ''
  393. },
  394. re_key_numer() {
  395. const item = getApp().globalData.configData.find(i => i.keyName === 're_key_numer')
  396. return item ? parseFloat(item.keyContent) : 0.066
  397. },
  398. recycle_toast() {
  399. const item = getApp().globalData.configData.find(i => i.keyName === 'recycle_toast')
  400. return item ? item.keyContent : ''
  401. },
  402. huodong_text() {
  403. const item = getApp().globalData.configData.find(i => i.keyName === 'huodong_text')
  404. return item ? item.keyContent : ''
  405. },
  406. // 当前分类的商品列表
  407. recycleList() {
  408. const currentCategoryId = this.categories[this.currentCategory]?.id
  409. return this.allProducts[currentCategoryId] || []
  410. },
  411. // 计算总数量
  412. totalCount() {
  413. return Object.values(this.allProducts).reduce((total, categoryItems) => {
  414. return total + categoryItems.reduce((sum, item) => {
  415. // 如果商品有品牌数量,汇总所有品牌的数量
  416. if (item.brandQuantities && Object.keys(item.brandQuantities).length > 0) {
  417. return sum + Object.values(item.brandQuantities).reduce((brandSum, qty) => brandSum + qty, 0)
  418. }
  419. // 否则使用原来的quantity字段
  420. return sum + (item.quantity || 0)
  421. }, 0)
  422. }, 0)
  423. },
  424. // 计算总单位文本
  425. totalUnitText() {
  426. // 获取所有已选商品的单位
  427. const units = new Set()
  428. Object.values(this.allProducts).forEach(categoryItems => {
  429. categoryItems.forEach(item => {
  430. let hasQuantity = false
  431. if (item.brandQuantities && Object.keys(item.brandQuantities).length > 0) {
  432. hasQuantity = Object.values(item.brandQuantities).some(qty => qty > 0)
  433. } else {
  434. hasQuantity = (item.quantity || 0) > 0
  435. }
  436. if (hasQuantity) {
  437. units.add(item.unit || '件')
  438. }
  439. })
  440. })
  441. // 如果只有一种单位,显示单位;如果混合多种单位,显示"项"
  442. if (units.size === 0) return '件'
  443. if (units.size === 1) return Array.from(units)[0]
  444. return '项'
  445. },
  446. // 计算总价格范围
  447. totalPriceRange() {
  448. const result = Object.values(this.allProducts).reduce((categoryTotal, categoryItems) => {
  449. return categoryItems.reduce((sum, item) => {
  450. let itemQuantity = 0
  451. // 如果商品有品牌数量,汇总所有品牌的数量
  452. if (item.brandQuantities && Object.keys(item.brandQuantities).length > 0) {
  453. itemQuantity = Object.values(item.brandQuantities).reduce((brandSum, qty) => brandSum + qty, 0)
  454. } else {
  455. itemQuantity = item.quantity || 0
  456. }
  457. if (itemQuantity > 0) {
  458. const minPrice = Number(item.price) || 0
  459. const maxPrice = Number(item.maxPrice) || Number(item.price) || 0
  460. sum.min += itemQuantity * minPrice
  461. sum.max += itemQuantity * maxPrice
  462. }
  463. return sum
  464. }, categoryTotal)
  465. }, { min: 0, max: 0 })
  466. return {
  467. min: result.min.toFixed(1),
  468. max: result.max.toFixed(1)
  469. }
  470. },
  471. // 计算总价格 (保持兼容性,使用最低价格)
  472. totalPrice() {
  473. return this.totalPriceRange.min
  474. },
  475. // 计算价格范围
  476. priceRange() {
  477. if (this.totalCount === 0) {
  478. return {
  479. min: '0.0',
  480. max: '0.0'
  481. }
  482. }
  483. return this.totalPriceRange
  484. },
  485. selectedProducts() {
  486. // 返回所有分类下所有已选商品,按品牌分组
  487. const products = []
  488. Object.values(this.allProducts).flat().forEach(item => {
  489. if (item.brandQuantities && Object.keys(item.brandQuantities).length > 0) {
  490. // 按品牌分别添加
  491. Object.entries(item.brandQuantities).forEach(([brandId, quantity]) => {
  492. if (quantity > 0) {
  493. const brandInfo = this.getBrandInfo(brandId)
  494. products.push({
  495. ...item,
  496. quantity: quantity,
  497. brandId: brandId,
  498. brandName: brandInfo ? brandInfo.name : '未知品牌',
  499. brandImage: brandInfo ? brandInfo.logo : '',
  500. uniqueKey: `${item.id}_${brandId}` // 用于区分同商品不同品牌
  501. })
  502. }
  503. })
  504. } else if (item.quantity > 0) {
  505. // 没有品牌的商品
  506. products.push({
  507. ...item,
  508. uniqueKey: item.id
  509. })
  510. }
  511. })
  512. return products
  513. },
  514. filteredBrandList() {
  515. return this.brandList
  516. },
  517. bannerList() {
  518. return getApp().globalData.bannerList || []
  519. },
  520. categories() {
  521. const list = getApp().globalData.pricePreviewList || []
  522. return list.filter(item => item.pid === '0').sort((a, b) => a.sort - b.sort)
  523. },
  524. minMoney() {
  525. const config = getApp().globalData.configData || [];
  526. const item = config.find(i => i.keyName === 'min_money');
  527. return item ? parseFloat(item.keyContent) : 0;
  528. },
  529. // 计算比预计回收多的金额(商品回收价格 - (商品回收价格 * 0.066))
  530. extraRecycleAmount() {
  531. const minPrice = parseFloat(this.priceRange.min) || 0;
  532. const maxPrice = parseFloat(this.priceRange.max) || 0;
  533. if (minPrice === 0 && maxPrice === 0) {
  534. return {
  535. min: '0.00',
  536. max: '0.00',
  537. display: '0.00元'
  538. };
  539. }
  540. let re_key_numer = this.re_key_numer || 0.066
  541. // 计算减去6.6%后的金额
  542. const minExtra = minPrice - (minPrice * re_key_numer);
  543. const maxExtra = maxPrice - (maxPrice * re_key_numer);
  544. // 如果最小值和最大值相等,显示单个值
  545. if (minPrice === maxPrice) {
  546. return {
  547. min: minExtra.toFixed(2),
  548. max: maxExtra.toFixed(2),
  549. display: `${minExtra.toFixed(2)}`
  550. };
  551. }
  552. // 显示区间
  553. return {
  554. min: minExtra.toFixed(2),
  555. max: maxExtra.toFixed(2),
  556. display: `${minExtra.toFixed(2)}-${maxExtra.toFixed(2)}`
  557. };
  558. },
  559. // 动态生成品牌字母索引,只显示有品牌的字母
  560. brandIndexList() {
  561. const letters = new Set()
  562. let hasSharp = false
  563. this.brandList.forEach(b => {
  564. if (b.letter && /^[A-Z]$/.test(b.letter)) {
  565. letters.add(b.letter)
  566. } else {
  567. letters.add('#')
  568. hasSharp = true
  569. }
  570. })
  571. const arr = Array.from(letters).filter(l => l !== '#').sort()
  572. if (hasSharp) arr.push('#')
  573. return arr
  574. },
  575. },
  576. methods: {
  577. showPriceInfoPopups() {
  578. console.log('showPriceInfoPopup called');
  579. this.showPriceInfoPopup = true
  580. },
  581. closePriceInfoPopup() {
  582. console.log('closePriceInfoPopup called');
  583. this.showPriceInfoPopup = false
  584. },
  585. changeTo(e){
  586. this.value = e
  587. if(e==2){
  588. uni.reLaunch({
  589. url: '/pages/component/my'
  590. });
  591. }else if(e==0){
  592. console.log(e,'111')
  593. uni.reLaunch({
  594. url: '/pages/component/home'
  595. });
  596. }
  597. },
  598. fetchGoodsList(categoryId, page = 1, callback) {
  599. this.$api('getClassGoodsList', {
  600. classId: categoryId,
  601. pageNo: page,
  602. pageSize: this.pageSize
  603. }, res => {
  604. if (res.code === 200 && res.result && Array.isArray(res.result.records)) {
  605. const oldList = this.allProducts[categoryId] || []
  606. const newList = page === 1 ? res.result.records : oldList.concat(res.result.records)
  607. this.$set(this.allProducts, categoryId, newList)
  608. this.$set(this.allProductsPage, categoryId, page)
  609. this.$set(this.allProductsTotal, categoryId, res.result.total)
  610. }
  611. if (callback) callback()
  612. })
  613. },
  614. // 获取分类商品总数
  615. getCategoryItemCount(index) {
  616. const categoryId = this.categories[index]?.id
  617. const categoryItems = this.allProducts[categoryId] || []
  618. return categoryItems.reduce((sum, item) => {
  619. if (item.brandQuantities && Object.keys(item.brandQuantities).length > 0) {
  620. return sum + Object.values(item.brandQuantities).reduce((brandSum, qty) => brandSum + qty, 0)
  621. }
  622. return sum + (item.quantity || 0)
  623. }, 0)
  624. },
  625. // 切换分类
  626. switchCategory(index) {
  627. this.currentCategory = index
  628. this.loadingMore = false
  629. this.finished = false
  630. const categoryId = this.categories[index]?.id
  631. // console.log(categoryId,'switchCategory')
  632. if (!this.allProducts[categoryId]) {
  633. this.fetchGoodsList(categoryId, 1)
  634. }
  635. },
  636. // 更新商品数量
  637. updateQuantity(index, delta) {
  638. const categoryId = this.categories[this.currentCategory]?.id
  639. const item = this.allProducts[categoryId]?.[index]
  640. if (!item) return
  641. // 如果是减少数量且delta为负数
  642. if (delta < 0) {
  643. // 检查是否有多个品牌
  644. if (item.brandQuantities && Object.keys(item.brandQuantities).length > 1) {
  645. // 有多个品牌,显示选择弹窗
  646. this.reduceItem = { item, index, delta }
  647. this.reduceBrandList = Object.entries(item.brandQuantities)
  648. .filter(([brandId, quantity]) => quantity > 0)
  649. .map(([brandId, quantity]) => {
  650. const brandInfo = this.getBrandInfo(brandId)
  651. return {
  652. brandId,
  653. quantity,
  654. name: brandInfo ? brandInfo.name : '未知品牌',
  655. logo: brandInfo ? brandInfo.logo : ''
  656. }
  657. })
  658. this.showBrandReducePopup = true
  659. return
  660. } else if (item.brandQuantities && Object.keys(item.brandQuantities).length === 1) {
  661. // 只有一个品牌,直接减少
  662. const brandId = Object.keys(item.brandQuantities)[0]
  663. const currentQty = item.brandQuantities[brandId] || 0
  664. const newQty = Math.max(0, currentQty + delta)
  665. this.$set(item.brandQuantities, brandId, newQty)
  666. // 如果数量为0,删除该品牌
  667. if (newQty === 0) {
  668. delete item.brandQuantities[brandId]
  669. }
  670. return
  671. } else {
  672. // 没有品牌数量,使用原来的逻辑
  673. let newQuantity = (item.quantity || 0) + delta
  674. if (newQuantity < 0) newQuantity = 0
  675. this.$set(item, 'quantity', newQuantity)
  676. return
  677. }
  678. }
  679. // 品牌商品且数量为0且加一时
  680. if (item.isPin === 'Y' && (item.quantity || 0) === 0 && delta > 0) {
  681. this.pendingBrandIndex = index
  682. this.isWaitingForBrandSelection = true;
  683. this.showRules(item); // 先显示回收规则
  684. return
  685. }
  686. // 无品牌商品,数量为0且加一时,也弹规则,确认后再加数量
  687. if (item.isPin !== 'Y' && (item.quantity || 0) === 0 && delta > 0) {
  688. this.pendingBrandIndex = index
  689. this.isWaitingForBrandSelection = false; // 标记为无品牌
  690. this.showRules(item)
  691. return
  692. }
  693. // 其它情况直接加数量
  694. let newQuantity = (item.quantity || 0) + delta
  695. if (newQuantity < 0) newQuantity = 0
  696. this.$set(item, 'quantity', newQuantity)
  697. },
  698. // 选择要减少的品牌
  699. selectReduceBrand(brandInfo) {
  700. const { item, index, delta } = this.reduceItem
  701. const currentQty = item.brandQuantities[brandInfo.brandId] || 0
  702. const newQty = Math.max(0, currentQty + delta)
  703. this.$set(item.brandQuantities, brandInfo.brandId, newQty)
  704. // 如果数量为0,删除该品牌
  705. if (newQty === 0) {
  706. delete item.brandQuantities[brandInfo.brandId]
  707. }
  708. this.closeBrandReducePopup()
  709. },
  710. // 关闭减少品牌选择弹窗
  711. closeBrandReducePopup() {
  712. this.showBrandReducePopup = false
  713. this.reduceItem = null
  714. this.reduceBrandList = []
  715. },
  716. // 获取品牌信息
  717. getBrandInfo(brandId) {
  718. // 从所有商品的品牌缓存中查找品牌信息
  719. for (const productId in this.brandCache) {
  720. const brandInfo = this.brandCache[productId].find(brand => brand.id === brandId)
  721. if (brandInfo) {
  722. return brandInfo
  723. }
  724. }
  725. // 如果缓存中没有找到,也从当前brandList中查找(兼容性)
  726. return this.brandList.find(brand => brand.id === brandId)
  727. },
  728. // 获取商品的总数量(所有品牌)
  729. getItemTotalQuantity(item) {
  730. if (item.brandQuantities && Object.keys(item.brandQuantities).length > 0) {
  731. return Object.values(item.brandQuantities).reduce((sum, qty) => sum + qty, 0)
  732. }
  733. return item.quantity || 0
  734. },
  735. // 显示回收规则
  736. showRules(item) {
  737. // isPin=Y: 弹规则,读到底部后自动弹品牌;isPin=N: 只弹规则
  738. if (item.isPin === 'Y') {
  739. // 检查该商品是否已经查看过规则
  740. if (this.viewedRuleItems.has(item.id)) {
  741. // 如果已经查看过,直接跳过规则弹窗,进入品牌选择
  742. this.isWaitingForBrandSelection = false;
  743. this.getGoodsBrandList(item.id);
  744. this.showBrandPopup = true;
  745. return;
  746. }
  747. // 重置滚动状态
  748. this.hasScrolledToBottom = false;
  749. // 获取回收规则富文本
  750. this.$api('getGoodsRecycleRule', { goodsId: item.id }, res => {
  751. if (res.code === 200 && res.result) {
  752. this.ruleHtml = res.result
  753. } else {
  754. this.ruleHtml = '<p>暂无回收规则</p>'
  755. }
  756. this.showRulePopup = true
  757. // 规则弹窗关闭后自动弹品牌弹窗逻辑在closeRulePopup已实现
  758. })
  759. } else {
  760. // isPin=N 只弹规则
  761. this.hasScrolledToBottom = false;
  762. this.$api('getGoodsRecycleRule', { goodsId: item.id }, res => {
  763. if (res.code === 200 && res.result) {
  764. this.ruleHtml = res.result
  765. } else {
  766. this.ruleHtml = '<p>暂无回收规则</p>'
  767. }
  768. this.showRulePopup = true
  769. // 不弹品牌弹窗
  770. this.isWaitingForBrandSelection = false;
  771. })
  772. }
  773. },
  774. showMore() {
  775. uni.showToast({
  776. title: '更多规则请咨询客服',
  777. icon: 'none'
  778. })
  779. },
  780. submitOrder() {
  781. // 检查用户是否被拉入黑名单
  782. if (this.isUserBlacklisted) {
  783. uni.showModal({
  784. title: '提示',
  785. content: '您的账户已被限制使用回收服务,如有疑问请联系客服。',
  786. showCancel: false,
  787. confirmText: '我知道了'
  788. })
  789. return
  790. }
  791. if (this.totalCount < 3 || Number(this.totalPrice) < this.minMoney) {
  792. uni.showToast({
  793. title: `各品类混合需要满3${this.totalUnitText}并且各品类混合需要满${this.minMoney}元才能回收哦`,
  794. icon: 'none'
  795. })
  796. return
  797. }
  798. this.showPickupConfirm = true;
  799. },
  800. handlePickupCancel() {
  801. this.showPickupConfirm = false;
  802. },
  803. handlePickupAgree() {
  804. this.showPickupConfirm = false;
  805. uni.showLoading({
  806. title: '提交中...'
  807. })
  808. setTimeout(() => {
  809. uni.hideLoading()
  810. uni.showToast({
  811. title: '预约成功',
  812. icon: 'success'
  813. })
  814. this.goToPickup()
  815. }, 1500)
  816. },
  817. goToPickup() {
  818. // 获取所有选中的衣物(所有分类)
  819. const selectedItems = this.selectedProducts.map(item => {
  820. const baseItem = {
  821. id: item.id,
  822. name: item.name,
  823. icon: item.image,
  824. quantity: item.quantity,
  825. unitPrice: item.price,
  826. maxPrice: item.maxPrice,
  827. desc: item.brandName ? `品牌:${item.brandName}` : '允许脏破烂,160码以上'
  828. }
  829. // 如果有品牌信息,添加品牌相关字段
  830. if (item.brandId) {
  831. baseItem.brandId = item.brandId
  832. baseItem.brandName = item.brandName
  833. baseItem.brandImage = item.brandImage
  834. }
  835. return baseItem
  836. })
  837. const itemsStr = encodeURIComponent(JSON.stringify(selectedItems))
  838. uni.navigateTo({
  839. url: `/pages/subcomponent/pickup?fromRecycle=true&items=${itemsStr}`
  840. })
  841. },
  842. checkBrand(index) {
  843. const categoryId = this.categories[this.currentCategory]?.id
  844. const item = this.allProducts[categoryId]?.[index]
  845. if (item?.id) {
  846. this.pendingBrandIndex = index
  847. this.getGoodsBrandList(item.id)
  848. this.showBrandPopup = true
  849. }
  850. },
  851. closeBrandPopup() {
  852. this.showBrandPopup = false
  853. // 如果用户取消品牌选择,重置状态
  854. this.pendingBrandIndex = null;
  855. this.isWaitingForBrandSelection = false;
  856. // 清理搜索状态
  857. this.brandSearch = ''
  858. this.currentProductId = null
  859. if (this.searchTimer) {
  860. clearTimeout(this.searchTimer)
  861. this.searchTimer = null
  862. }
  863. },
  864. scrollToLetter(letter) {
  865. this.currentLetter = letter
  866. this.scrollToView = 'brand-letter-' + letter
  867. },
  868. // 添加下拉刷新方法
  869. async refreshData() {
  870. try {
  871. // 这里可以添加刷新数据的逻辑,比如重新获取商品列表等
  872. // 示例:重新初始化数据
  873. this.currentCategory = 0
  874. Object.values(this.allProducts).forEach(categoryItems => {
  875. categoryItems.forEach(item => {
  876. item.quantity = 0
  877. if (item.brandQuantities) {
  878. item.brandQuantities = {}
  879. }
  880. })
  881. })
  882. // 清空已查看规则的记录
  883. this.viewedRuleItems.clear()
  884. // 清空品牌缓存
  885. this.brandCache = {}
  886. // 模拟网络请求延迟
  887. await new Promise(resolve => setTimeout(resolve, 1000))
  888. uni.showToast({
  889. title: '刷新成功',
  890. icon: 'success'
  891. })
  892. } catch (error) {
  893. uni.showToast({
  894. title: '刷新失败',
  895. icon: 'none'
  896. })
  897. } finally {
  898. // 停止下拉刷新动画
  899. uni.stopPullDownRefresh()
  900. }
  901. },
  902. toggleDetailPanel() {
  903. this.showDetailPanel = !this.showDetailPanel
  904. },
  905. fetchUserInfo() {
  906. if(uni.getStorageSync('token')){
  907. this.login_status = getApp().globalData.login_status;
  908. this.$api("getUserByToken",{},(res)=>{
  909. if(res.code == 200){
  910. this.userInfo = res.result
  911. // 检查用户是否被拉入黑名单
  912. this.isUserBlacklisted = res.result.isBlack === 'Y'
  913. // isTuiType 为0用户,1推广达人,2推广大使
  914. }
  915. })
  916. } else {
  917. this.login_status = false;
  918. }
  919. },
  920. updateQuantityByProduct(item, delta) {
  921. // 在明细弹窗中更新数量
  922. if (item.brandId) {
  923. // 有品牌ID的商品
  924. const originalItem = this.findOriginalItem(item.id)
  925. if (originalItem && originalItem.brandQuantities) {
  926. const currentQty = originalItem.brandQuantities[item.brandId] || 0
  927. const newQty = Math.max(0, currentQty + delta)
  928. this.$set(originalItem.brandQuantities, item.brandId, newQty)
  929. // 如果数量为0,删除该品牌
  930. if (newQty === 0) {
  931. delete originalItem.brandQuantities[item.brandId]
  932. }
  933. // 同步更新显示的数量
  934. item.quantity = newQty
  935. }
  936. } else {
  937. // 没有品牌的商品
  938. if (!item.quantity) item.quantity = 0
  939. item.quantity += delta
  940. if (item.quantity < 0) item.quantity = 0
  941. // 同步到原商品
  942. const originalItem = this.findOriginalItem(item.id)
  943. if (originalItem) {
  944. this.$set(originalItem, 'quantity', item.quantity)
  945. }
  946. }
  947. },
  948. // 查找原始商品对象
  949. findOriginalItem(itemId) {
  950. for (const categoryItems of Object.values(this.allProducts)) {
  951. const item = categoryItems.find(i => i.id === itemId)
  952. if (item) return item
  953. }
  954. return null
  955. },
  956. openRulePopup() {
  957. this.showRulePopup = true
  958. // 弹窗显示后主动判断内容是否需要滚动
  959. this.$nextTick(() => {
  960. const query = uni.createSelectorQuery().in(this)
  961. query.select('.rule-popup-content').boundingClientRect(rect => {
  962. if (rect && rect.height && rect.scrollHeight && rect.scrollHeight <= rect.height + 10) {
  963. this.hasScrolledToBottom = true
  964. }
  965. }).exec()
  966. })
  967. },
  968. closeRulePopup() {
  969. if (!this.hasScrolledToBottom) {
  970. uni.showToast({
  971. title: '请阅读完整回收规则',
  972. icon: 'none'
  973. })
  974. return
  975. }
  976. this.showRulePopup = false;
  977. this.hasScrolledToBottom = false; // 重置滚动状态
  978. // 如果是在等待品牌选择的状态下关闭规则弹窗,则接着打开品牌选择
  979. if (this.isWaitingForBrandSelection) {
  980. this.isWaitingForBrandSelection = false; // 清除等待状态
  981. const categoryId = this.categories[this.currentCategory]?.id;
  982. const item = this.allProducts[categoryId]?.[this.pendingBrandIndex];
  983. // 记录该商品的规则已被查看
  984. this.viewedRuleItems.add(item.id);
  985. this.getGoodsBrandList(item.id);
  986. this.showBrandPopup = true; // 打开品牌索引弹窗
  987. } else if (this.pendingBrandIndex !== null) {
  988. // 无品牌商品,规则弹窗关闭后加数量
  989. const categoryId = this.categories[this.currentCategory]?.id;
  990. const item = this.allProducts[categoryId]?.[this.pendingBrandIndex];
  991. if (item) {
  992. let newQuantity = (item.quantity || 0) + 1
  993. this.$set(item, 'quantity', newQuantity)
  994. }
  995. this.pendingBrandIndex = null
  996. }
  997. },
  998. // 处理规则弹窗遮罩点击
  999. handleRulePopupMaskClick() {
  1000. if (!this.hasScrolledToBottom) {
  1001. uni.showToast({
  1002. title: '请阅读完整回收规则',
  1003. icon: 'none'
  1004. })
  1005. return
  1006. }
  1007. this.closeRulePopup()
  1008. },
  1009. // 监听规则内容滚动
  1010. onRuleContentScroll(e) {
  1011. const { scrollTop, scrollHeight, clientHeight, height } = e.detail
  1012. const h = clientHeight || height
  1013. // 内容高度不够,无需滚动,直接允许
  1014. if (scrollHeight <= h + 10) {
  1015. this.hasScrolledToBottom = true
  1016. return
  1017. }
  1018. if (scrollTop + h >= scrollHeight - 20) {
  1019. this.hasScrolledToBottom = true
  1020. }
  1021. },
  1022. loadMoreGoods() {
  1023. const categoryId = this.categories[this.currentCategory]?.id
  1024. const page = (this.allProductsPage[categoryId] || 1) + 1
  1025. const total = this.allProductsTotal[categoryId] || 0
  1026. const loaded = (this.allProducts[categoryId] || []).length
  1027. if (this.loadingMore || this.finished) return
  1028. if (loaded < total) {
  1029. this.loadingMore = true
  1030. this.fetchGoodsList(categoryId, page, () => {
  1031. this.loadingMore = false
  1032. // 判断是否加载完
  1033. const newLoaded = (this.allProducts[categoryId] || []).length
  1034. this.finished = newLoaded >= (this.allProductsTotal[categoryId] || 0)
  1035. })
  1036. } else {
  1037. this.finished = true
  1038. }
  1039. },
  1040. openBrandConfirm(brand) {
  1041. this.brandConfirmInfo = {
  1042. id: brand.id,
  1043. logo: brand.logo,
  1044. name: brand.name
  1045. }
  1046. this.showBrandConfirm = true
  1047. },
  1048. closeBrandConfirm() {
  1049. this.showBrandConfirm = false
  1050. },
  1051. confirmBrand() {
  1052. this.showBrandConfirm = false
  1053. this.showBrandPopup = false
  1054. // 确认后将待加一的商品数量+1,并记录品牌ID
  1055. if (this.pendingBrandIndex !== null) {
  1056. const categoryId = this.categories[this.currentCategory]?.id
  1057. const item = this.allProducts[categoryId]?.[this.pendingBrandIndex]
  1058. if (item) {
  1059. // 初始化品牌数量对象
  1060. if (!item.brandQuantities) {
  1061. this.$set(item, 'brandQuantities', {})
  1062. }
  1063. // 增加该品牌的数量
  1064. const currentQty = item.brandQuantities[this.brandConfirmInfo.id] || 0
  1065. this.$set(item.brandQuantities, this.brandConfirmInfo.id, currentQty + 1)
  1066. // 清除原来的quantity(如果存在)
  1067. if (item.quantity) {
  1068. this.$set(item, 'quantity', 0)
  1069. }
  1070. }
  1071. this.pendingBrandIndex = null
  1072. }
  1073. },
  1074. getGoodsBrandList(productId, searchName = '') {
  1075. this.currentProductId = productId
  1076. const params = { productId }
  1077. if (searchName.trim()) {
  1078. params.name = searchName.trim()
  1079. }
  1080. this.$api('getGoodsBrandList', params, res => {
  1081. // console.log(res,'res')
  1082. if (res && res.success && res.result && res.result.records) {
  1083. const brandList = res.result.records.map(item => {
  1084. // 获取品牌名称的拼音首字母
  1085. const firstChar = this.getPinyinFirstLetter(item.name)
  1086. return {
  1087. id: item.id,
  1088. logo: item.image || '/static/brand/alexander.png',
  1089. name: item.name,
  1090. letter: firstChar,
  1091. isPin: item.isPin
  1092. }
  1093. })
  1094. // 缓存到对应商品的品牌列表中
  1095. this.$set(this.brandCache, productId, brandList)
  1096. // 同时更新当前显示的brandList(用于弹窗显示)
  1097. this.brandList = [...brandList]
  1098. }
  1099. })
  1100. },
  1101. // 获取中文拼音首字母
  1102. getPinyinFirstLetter(str) {
  1103. if (!str) return '#'
  1104. const firstChar = str.charAt(0)
  1105. // 遍历pinyin对象,查找包含该汉字的拼音
  1106. for (let key in pinyin) {
  1107. const chars = pinyin[key]
  1108. if (chars && chars.indexOf(firstChar) !== -1) {
  1109. return key.charAt(0).toUpperCase()
  1110. }
  1111. }
  1112. // 英文首字母
  1113. if (/^[A-Za-z]$/.test(firstChar)) {
  1114. return firstChar.toUpperCase()
  1115. }
  1116. return '#'
  1117. },
  1118. // 品牌搜索输入事件处理
  1119. onBrandSearchInput(e) {
  1120. const searchValue = e.detail.value
  1121. // 清除之前的定时器
  1122. if (this.searchTimer) {
  1123. clearTimeout(this.searchTimer)
  1124. }
  1125. // 设置防抖,500ms后执行搜索
  1126. this.searchTimer = setTimeout(() => {
  1127. if (this.currentProductId) {
  1128. this.getGoodsBrandList(this.currentProductId, searchValue)
  1129. }
  1130. }, 500)
  1131. },
  1132. // 视频相关方法
  1133. playVideoFullscreen(item, index) {
  1134. if (!this.videoPlayingStates[index]) {
  1135. // 第一次点击:显示视频并开始播放
  1136. this.$set(this.videoPlayingStates, index, true);
  1137. // 等待视频元素渲染后再进行操作
  1138. this.$nextTick(() => {
  1139. setTimeout(() => {
  1140. const videoContext = uni.createVideoContext(`recycle-video-${index}`, this);
  1141. if (videoContext) {
  1142. // 直接进入全屏播放
  1143. videoContext.requestFullScreen({
  1144. direction: -1 // 自动选择方向
  1145. });
  1146. }
  1147. }, 200);
  1148. });
  1149. }
  1150. },
  1151. onVideoPlay(index) {
  1152. this.$set(this.videoPlayingStates, index, true);
  1153. },
  1154. onVideoPause(index) {
  1155. this.$set(this.videoPlayingStates, index, false);
  1156. },
  1157. onVideoEnded(index) {
  1158. // 视频播放结束,回到预览状态
  1159. this.$set(this.videoPlayingStates, index, false);
  1160. },
  1161. onFullscreenChange(e) {
  1162. console.log('全屏状态改变:', e.detail);
  1163. const videoIndex = e.target.id.replace('recycle-video-', '');
  1164. if (e.detail.fullScreen) {
  1165. // 进入全屏时,不做任何操作
  1166. console.log('进入全屏模式,方向:', e.detail.direction);
  1167. } else {
  1168. // 退出全屏时,回到预览状态
  1169. console.log('退出全屏模式,回到预览状态');
  1170. this.$set(this.videoPlayingStates, videoIndex, false);
  1171. }
  1172. },
  1173. // 初始化页面数据的方法
  1174. initializePageData() {
  1175. const options = this.loadOptions || {}
  1176. if (options && options.categoryId) {
  1177. const idx = this.categories.findIndex(c => c.id == options.categoryId)
  1178. if (idx !== -1) this.currentCategory = idx
  1179. }
  1180. if (this.categories.length > 0) {
  1181. this.fetchGoodsList(this.categories[this.currentCategory].id, 1)
  1182. }
  1183. uni.$on('bannerListUpdated', () => {
  1184. this.$forceUpdate && this.$forceUpdate()
  1185. })
  1186. if (getApp().globalData.bannerList && getApp().globalData.bannerList.length > 0) {
  1187. this.$forceUpdate && this.$forceUpdate()
  1188. }
  1189. // 检查全局清空标志(兼容 reLaunch)
  1190. if (getApp().globalData.shouldClearRecycle) {
  1191. Object.values(this.allProducts).forEach(categoryItems => {
  1192. categoryItems.forEach(item => {
  1193. this.$set(item, 'quantity', 0)
  1194. if (item.brandQuantities) {
  1195. this.$set(item, 'brandQuantities', {})
  1196. }
  1197. })
  1198. })
  1199. // 清空已查看规则的记录
  1200. this.viewedRuleItems.clear()
  1201. this.showDetailPanel = false
  1202. this.brandCache = {} // 清空品牌缓存
  1203. this.$forceUpdate()
  1204. getApp().globalData.shouldClearRecycle = false
  1205. }
  1206. },
  1207. onRuleContentReady() {
  1208. this.$nextTick(() => {
  1209. const query = uni.createSelectorQuery().in(this)
  1210. query.select('.rule-popup-content').boundingClientRect(rect => {
  1211. query.select('.rule-popup-content').scrollOffset(scroll => {
  1212. // 只有内容高度小于等于可视高度时才点亮
  1213. if (scroll.scrollHeight <= rect.height + 1) {
  1214. this.hasScrolledToBottom = true
  1215. }
  1216. })
  1217. }).exec()
  1218. })
  1219. },
  1220. onRuleScrollToLower() {
  1221. this.hasScrolledToBottom = true
  1222. },
  1223. },
  1224. created() {
  1225. this.currentCategory = 0
  1226. this.$nextTick(() => {
  1227. if (this.categories.length > 0) {
  1228. const firstCategoryId = this.categories[0]?.id
  1229. if (firstCategoryId) {
  1230. this.fetchGoodsList(firstCategoryId, 1)
  1231. }
  1232. }
  1233. })
  1234. },
  1235. mounted() {
  1236. this.$nextTick(() => {
  1237. const query = uni.createSelectorQuery().in(this)
  1238. query.select('.uv-tabbar').boundingClientRect(rect => {
  1239. if (rect && rect.height) {
  1240. this.tabbarHeight = rect.height
  1241. } else {
  1242. this.tabbarHeight = uni.upx2px ? uni.upx2px(95) : 45
  1243. }
  1244. // console.log(this.tabbarHeight,'tabbarHeight')
  1245. }).exec()
  1246. })
  1247. },
  1248. onLoad(options) {
  1249. // 保存options参数
  1250. this.loadOptions = options
  1251. // 检查App数据是否已经准备好
  1252. if (!getApp().globalData.isAppDataReady) {
  1253. // 显示加载状态
  1254. uni.showLoading({
  1255. title: '加载中...',
  1256. mask: true
  1257. })
  1258. // 监听App数据准备完成事件
  1259. uni.$on('appDataReady', () => {
  1260. uni.hideLoading()
  1261. this.initializePageData()
  1262. })
  1263. } else {
  1264. // App数据已经准备好,直接初始化页面数据
  1265. this.initializePageData()
  1266. }
  1267. },
  1268. onUnload() {
  1269. uni.$off('bannerListUpdated')
  1270. // 移除事件监听
  1271. uni.$off('clearRecycleOrderData')
  1272. },
  1273. onShow() {
  1274. // 获取用户信息,检查黑名单状态
  1275. this.fetchUserInfo()
  1276. const id = getApp().globalData.targetRecycleCategoryId
  1277. if (id) {
  1278. const trySwitch = () => {
  1279. if (this.categories.length > 0) {
  1280. const idx = this.categories.findIndex(c => String(c.id) === String(id))
  1281. if (idx !== -1) {
  1282. this.currentCategory = idx
  1283. const categoryId = this.categories[idx]?.id
  1284. if (categoryId && !this.allProducts[categoryId]) {
  1285. this.loadingMore = false
  1286. this.finished = false
  1287. this.fetchGoodsList(categoryId, 1)
  1288. }
  1289. }
  1290. getApp().globalData.targetRecycleCategoryId = null
  1291. } else {
  1292. setTimeout(trySwitch, 100)
  1293. }
  1294. }
  1295. trySwitch()
  1296. }
  1297. // 检查全局清空标志
  1298. if (getApp().globalData.shouldClearRecycle) {
  1299. Object.values(this.allProducts).forEach(categoryItems => {
  1300. categoryItems.forEach(item => {
  1301. this.$set(item, 'quantity', 0)
  1302. if (item.brandQuantities) {
  1303. this.$set(item, 'brandQuantities', {})
  1304. }
  1305. })
  1306. })
  1307. // 清空已查看规则的记录
  1308. this.viewedRuleItems.clear()
  1309. this.showDetailPanel = false
  1310. this.brandCache = {} // 清空品牌缓存
  1311. this.$forceUpdate()
  1312. getApp().globalData.shouldClearRecycle = false
  1313. }
  1314. // 监听清除订单数据的事件
  1315. uni.$on('clearRecycleOrderData', () => {
  1316. // 清除所有商品的选中数量,保证响应式
  1317. Object.values(this.allProducts).forEach(categoryItems => {
  1318. categoryItems.forEach(item => {
  1319. this.$set(item, 'quantity', 0)
  1320. if (item.brandQuantities) {
  1321. this.$set(item, 'brandQuantities', {})
  1322. }
  1323. })
  1324. })
  1325. // 清空已查看规则的记录
  1326. this.viewedRuleItems.clear()
  1327. // 清空品牌缓存
  1328. this.brandCache = {}
  1329. // 重置其他相关数据
  1330. this.showDetailPanel = false
  1331. this.$forceUpdate()
  1332. })
  1333. },
  1334. watch: {
  1335. categories(newVal) {
  1336. const id = getApp().globalData.targetRecycleCategoryId
  1337. const idx = newVal.findIndex(c => String(c.id) === String(id))
  1338. if (id && newVal.length > 0 && idx !== -1) {
  1339. this.currentCategory = idx
  1340. getApp().globalData.targetRecycleCategoryId = null
  1341. // 自动加载右侧商品
  1342. const categoryId = newVal[idx]?.id
  1343. if (categoryId && !this.allProducts[categoryId]) {
  1344. this.loadingMore = false
  1345. this.finished = false
  1346. this.fetchGoodsList(categoryId, 1)
  1347. }
  1348. }
  1349. }
  1350. },
  1351. }
  1352. </script>
  1353. <style lang="scss" scoped>
  1354. .container {
  1355. display: flex;
  1356. flex-direction: column;
  1357. height: 100vh;
  1358. background-color: #f5f5f5;
  1359. overflow: hidden;
  1360. }
  1361. .banner {
  1362. background: linear-gradient(135deg, #ff9500,#ff5e00);
  1363. position: relative;
  1364. height: 350rpx;
  1365. z-index: 1;
  1366. image {
  1367. width: 100%;
  1368. height: 90%;
  1369. }
  1370. .video-container {
  1371. position: relative;
  1372. width: 100%;
  1373. height: 100%;
  1374. .video-poster {
  1375. cursor: pointer;
  1376. transition: transform 0.2s ease;
  1377. &:active {
  1378. transform: scale(0.98);
  1379. }
  1380. }
  1381. .video-overlay {
  1382. position: absolute;
  1383. top: 0;
  1384. left: 0;
  1385. right: 0;
  1386. bottom: 0;
  1387. background: rgba(0, 0, 0, 0.4);
  1388. z-index: 10;
  1389. cursor: pointer;
  1390. display: flex;
  1391. justify-content: center;
  1392. align-items: center;
  1393. .play-button-large {
  1394. width: 120rpx;
  1395. height: 120rpx;
  1396. background: transparent;
  1397. border-radius: 50%;
  1398. display: flex;
  1399. justify-content: center;
  1400. align-items: center;
  1401. backdrop-filter: blur(10rpx);
  1402. transition: all 0.3s ease;
  1403. box-shadow: 0 8rpx 30rpx rgba(0, 0, 0, 0.3);
  1404. &:active {
  1405. transform: scale(0.9);
  1406. background: rgba(255, 255, 255, 0.1);
  1407. }
  1408. .play-triangle {
  1409. width: 0;
  1410. height: 0;
  1411. border-left: 24rpx solid #fff;
  1412. border-top: 18rpx solid transparent;
  1413. border-bottom: 18rpx solid transparent;
  1414. margin-left: 8rpx;
  1415. transition: all 0.3s ease;
  1416. filter: drop-shadow(0 2rpx 4rpx rgba(0, 0, 0, 0.3));
  1417. }
  1418. }
  1419. &:hover .play-button-large {
  1420. transform: scale(1.1);
  1421. box-shadow: 0 12rpx 40rpx rgba(0, 0, 0, 0.4);
  1422. .play-triangle {
  1423. border-left-color: #ff8917;
  1424. }
  1425. }
  1426. }
  1427. }
  1428. }
  1429. .goods-list {
  1430. // flex: 1;
  1431. display: flex;
  1432. position: relative;
  1433. height: calc(110vh - 320rpx - 160rpx - env(safe-area-inset-bottom)); /* 减去banner、底部栏和绿色提示条的高度 */
  1434. margin-top: -10rpx;
  1435. z-index: 2;
  1436. border-radius: 20rpx 20rpx 0 0;
  1437. overflow: hidden;
  1438. padding: 30rpx;
  1439. box-shadow: 0 -4rpx 8rpx rgba(0, 0, 0, 0.05);
  1440. background: linear-gradient(to bottom, #fff7e8, 20%,#ffffff);
  1441. .category-nav {
  1442. width: 20%;
  1443. background: #ffffff;
  1444. height: 100%;
  1445. border-right: 1rpx solid rgba(255, 126, 14, 0.1);
  1446. margin: 1rpx;
  1447. border-radius: 20rpx 0 0 0;
  1448. margin-right: 20rpx;
  1449. overflow-y: auto;
  1450. scrollbar-width: none; /* Firefox */
  1451. -ms-overflow-style: none; /* IE and Edge */
  1452. &::-webkit-scrollbar {
  1453. width: 0 !important;
  1454. display: none; /* Chrome, Safari, Opera */
  1455. }
  1456. .category-item {
  1457. position: relative;
  1458. padding: 28rpx 20rpx;
  1459. text-align: center;
  1460. font-family: PingFang SC;
  1461. font-weight: 600;
  1462. font-size: 15px;
  1463. line-height: 100%;
  1464. letter-spacing: 0px;
  1465. color: #666;
  1466. .category-dot {
  1467. position: absolute;
  1468. top: 15rpx;
  1469. right: 15rpx;
  1470. min-width: 32rpx;
  1471. height: 32rpx;
  1472. padding: 0 6rpx;
  1473. background: #ff7a0e;
  1474. border-radius: 16rpx;
  1475. color: #fff;
  1476. font-size: 20rpx;
  1477. text-align: center;
  1478. line-height: 32rpx;
  1479. box-sizing: border-box;
  1480. }
  1481. &.active {
  1482. color: #ff7a0e;
  1483. font-weight: bold;
  1484. background: #fff7e8;
  1485. position: relative;
  1486. &::before {
  1487. content: '';
  1488. position: absolute;
  1489. left: 0;
  1490. top: 50%;
  1491. transform: translateY(-50%);
  1492. width: 6rpx;
  1493. height: 36rpx;
  1494. background: #ff7a0e;
  1495. border-radius: 3rpx;
  1496. }
  1497. }
  1498. }
  1499. }
  1500. .goods-content {
  1501. flex: 1;
  1502. height: 100%;
  1503. padding: 0 30rpx 180rpx 30rpx; /* 添加底部padding,为固定底部栏预留空间 */
  1504. background: #ffffff;
  1505. width: 70%;
  1506. margin: 1rpx;
  1507. margin-left: 0;
  1508. border-radius: 0 20rpx 0 0;
  1509. overflow-y: auto;
  1510. box-sizing: border-box;
  1511. scrollbar-width: none; /* Firefox */
  1512. -ms-overflow-style: none; /* IE and Edge */
  1513. &::-webkit-scrollbar {
  1514. width: 0 !important;
  1515. display: none; /* Chrome, Safari, Opera */
  1516. }
  1517. }
  1518. }
  1519. .goods-item {
  1520. display: flex;
  1521. align-items: flex-start;
  1522. padding: 30rpx 0;
  1523. border-bottom: 1rpx solid #f5f5f5;
  1524. .goods-item-img {
  1525. width: 180rpx;
  1526. height: 180rpx;
  1527. border-radius: 24rpx;
  1528. background: #f8f8f8;
  1529. margin-right: 28rpx;
  1530. object-fit: contain;
  1531. flex-shrink: 0;
  1532. }
  1533. .goods-info-wrap {
  1534. flex: 1;
  1535. display: flex;
  1536. flex-direction: column;
  1537. justify-content: center;
  1538. min-width: 0;
  1539. }
  1540. .goods-header {
  1541. display: flex;
  1542. justify-content: space-between;
  1543. align-items: center;
  1544. margin-bottom: 10rpx;
  1545. }
  1546. .goods-name {
  1547. font-family: PingFang SC;
  1548. font-weight: 500;
  1549. font-size: 14px;
  1550. line-height: 140%;
  1551. letter-spacing: 0%;
  1552. vertical-align: middle;
  1553. color: #333;
  1554. font-weight: bold;
  1555. flex-shrink: 1;
  1556. flex-grow: 1;
  1557. }
  1558. .brand-check-placeholder {
  1559. flex-shrink: 0;
  1560. margin-left: 10rpx;
  1561. }
  1562. .brand-check {
  1563. display: flex;
  1564. flex-direction: row;
  1565. align-items: center;
  1566. justify-content: center;
  1567. border: 1px solid #f8a01d;
  1568. border-radius: 8rpx;
  1569. color: #ff7a0e;
  1570. font-family: PingFang SC;
  1571. font-weight: 400;
  1572. font-size: 12px;
  1573. padding: 4rpx 10rpx;
  1574. line-height: 1;
  1575. white-space: nowrap;
  1576. text {
  1577. margin-right: 4rpx;
  1578. }
  1579. }
  1580. .goods-desc {
  1581. font-size: 20rpx;
  1582. color: #999;
  1583. display: block;
  1584. // margin-bottom: 20rpx;
  1585. white-space: nowrap;
  1586. overflow: hidden;
  1587. text-overflow: ellipsis;
  1588. }
  1589. .goods-info {
  1590. display: flex;
  1591. justify-content: space-between;
  1592. align-items: center;
  1593. flex-wrap: nowrap;
  1594. gap: 10rpx;
  1595. }
  1596. .price-info {
  1597. display: flex;
  1598. align-items: baseline;
  1599. white-space: nowrap;
  1600. flex-shrink: 0;
  1601. .price-symbol {
  1602. font-size: 24rpx;
  1603. color: #ff7a0e;
  1604. }
  1605. .price-value {
  1606. font-size: 36rpx;
  1607. color: #ff7a0e;
  1608. font-weight: bold;
  1609. margin: 0 4rpx;
  1610. white-space: nowrap;
  1611. }
  1612. .price-unit {
  1613. font-size: 24rpx;
  1614. color: #999;
  1615. white-space: nowrap;
  1616. }
  1617. }
  1618. .quantity-control {
  1619. display: flex;
  1620. align-items: center;
  1621. flex-shrink: 0;
  1622. white-space: nowrap;
  1623. button {
  1624. width: 60rpx;
  1625. height: 60rpx;
  1626. padding: 0;
  1627. margin: 0;
  1628. display: flex;
  1629. align-items: center;
  1630. justify-content: center;
  1631. font-size: 28rpx;
  1632. color: #666;
  1633. background: #ffffff;
  1634. border: none;
  1635. border-radius: 50%;
  1636. &::after {
  1637. border: none;
  1638. }
  1639. &:active {
  1640. opacity: 0.8;
  1641. }
  1642. }
  1643. .quantity {
  1644. width: 50rpx;
  1645. text-align: center;
  1646. font-size: 32rpx;
  1647. color: #333;
  1648. }
  1649. }
  1650. .rules-brand-row {
  1651. display: flex;
  1652. align-items: center;
  1653. margin-top: 20rpx;
  1654. gap: 16rpx;
  1655. .rules-link {
  1656. margin-top: 0;
  1657. .rules {
  1658. display: inline-flex;
  1659. align-items: center;
  1660. font-family: PingFang SC;
  1661. font-weight: 400;
  1662. font-size: 12px;
  1663. color: #666;
  1664. white-space: nowrap;
  1665. }
  1666. }
  1667. .brand-check-placeholder {
  1668. margin-left: 12rpx;
  1669. }
  1670. }
  1671. }
  1672. .other-unrecycle-card {
  1673. display: flex;
  1674. align-items: center;
  1675. background: #fff;
  1676. border-radius: 24rpx;
  1677. box-shadow: 0 4rpx 24rpx rgba(0,0,0,0.06);
  1678. padding: 30rpx 30rpx 30rpx 30rpx;
  1679. margin: 30rpx 0 0 0;
  1680. }
  1681. .other-unrecycle-img {
  1682. width: 120rpx;
  1683. height: 120rpx;
  1684. border-radius: 24rpx;
  1685. background: #f8f8f8;
  1686. margin-right: 28rpx;
  1687. object-fit: contain;
  1688. flex-shrink: 0;
  1689. }
  1690. .other-unrecycle-info {
  1691. flex: 1;
  1692. display: flex;
  1693. flex-direction: column;
  1694. justify-content: center;
  1695. min-width: 0;
  1696. overflow: hidden;
  1697. }
  1698. .other-unrecycle-title {
  1699. font-size: 30rpx;
  1700. color: #222;
  1701. font-weight: bold;
  1702. margin-bottom: 8rpx;
  1703. white-space: nowrap;
  1704. overflow: hidden;
  1705. text-overflow: ellipsis;
  1706. }
  1707. .other-unrecycle-desc {
  1708. font-size: 24rpx;
  1709. color: #999;
  1710. margin-bottom: 12rpx;
  1711. text-overflow: ellipsis;
  1712. overflow: hidden;
  1713. white-space: nowrap;
  1714. }
  1715. .other-unrecycle-price-row {
  1716. display: flex;
  1717. align-items: center;
  1718. white-space: nowrap;
  1719. }
  1720. .other-unrecycle-price {
  1721. font-size: 28rpx;
  1722. color: #ff9c00;
  1723. font-weight: bold;
  1724. white-space: nowrap;
  1725. }
  1726. .other-unrecycle-btn {
  1727. width: 60rpx;
  1728. height: 60rpx;
  1729. margin-left: 24rpx;
  1730. border-radius: 50%;
  1731. background: #fff;
  1732. color: #666;
  1733. font-size: 36rpx;
  1734. border: none;
  1735. display: flex;
  1736. align-items: center;
  1737. justify-content: center;
  1738. }
  1739. .fixed-bottom-wrap {
  1740. position: fixed;
  1741. left: 0;
  1742. right: 0;
  1743. bottom: calc(v-bind('tabbarHeight + "px"') + env(safe-area-inset-bottom));
  1744. width: 100vw;
  1745. z-index: 100;
  1746. background: transparent;
  1747. box-sizing: border-box;
  1748. pointer-events: auto;
  1749. }
  1750. .bottom-bar-divider {
  1751. width: 100%;
  1752. height: 1px;
  1753. background: #f0f0f0;
  1754. position: absolute;
  1755. left: 0;
  1756. bottom: 0;
  1757. z-index: 1;
  1758. }
  1759. .green-tip-bar {
  1760. width: 100%;
  1761. background: #eaffea;
  1762. color: #13ac47;
  1763. font-size: 20rpx;
  1764. padding: 8rpx 30rpx;
  1765. box-sizing: border-box;
  1766. text-align: center;
  1767. display: flex;
  1768. align-items: center;
  1769. justify-content: center;
  1770. line-height: 1.4;
  1771. min-height: 40rpx;
  1772. .tip-highlight {
  1773. color: #ff9c00;
  1774. font-weight: bold;
  1775. font-size: 20rpx;
  1776. }
  1777. }
  1778. .bottom-bar {
  1779. width: 100%;
  1780. background-color: #fff;
  1781. display: flex;
  1782. align-items: center;
  1783. justify-content: space-between;
  1784. padding: 0 30rpx;
  1785. box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
  1786. height: 120rpx;
  1787. border-top-left-radius: 0;
  1788. border-top-right-radius: 0;
  1789. border-bottom-left-radius: env(safe-area-inset-bottom);
  1790. border-bottom-right-radius: env(safe-area-inset-bottom);
  1791. .bottom-left {
  1792. // flex: 1;
  1793. display: flex;
  1794. flex-direction: column;
  1795. justify-content: center;
  1796. .summary-row {
  1797. display: flex;
  1798. align-items: center;
  1799. font-size: 26rpx;
  1800. color: #333;
  1801. .summary-label {
  1802. color: #333;
  1803. }
  1804. .summary-count {
  1805. color: #ff9c00;
  1806. font-weight: bold;
  1807. font-size: 28rpx;
  1808. }
  1809. }
  1810. .amount-row {
  1811. display: flex;
  1812. align-items: center;
  1813. margin-top: 4rpx;
  1814. .amount {
  1815. color: #ff9c00;
  1816. font-size: 44rpx;
  1817. font-weight: bold;
  1818. vertical-align: middle;
  1819. }
  1820. }
  1821. }
  1822. .submit-btn {
  1823. width: 300rpx;
  1824. height: 88rpx;
  1825. background: linear-gradient(to right, #ffd01e, #ff8917);
  1826. border-radius: 44rpx;
  1827. color: #fff;
  1828. font-size: 32rpx;
  1829. font-weight: bold;
  1830. display: flex;
  1831. align-items: center;
  1832. justify-content: center;
  1833. border: none;
  1834. // margin-left: 0rpx;
  1835. box-shadow: 0 4rpx 16rpx rgba(255, 156, 0, 0.08);
  1836. &::after {
  1837. border: none;
  1838. }
  1839. &:active {
  1840. opacity: 0.9;
  1841. }
  1842. }
  1843. }
  1844. .detail-popup-mask {
  1845. position: fixed;
  1846. left: 0;
  1847. right: 0;
  1848. top: 0;
  1849. bottom: calc(90rpx + env(safe-area-inset-bottom)); /* tabbar高度+安全区 */
  1850. background: rgba(0,0,0,0.35);
  1851. z-index: 8;
  1852. display: flex;
  1853. align-items: flex-end;
  1854. justify-content: center;
  1855. }
  1856. .detail-popup {
  1857. width: 100vw;
  1858. max-width: none;
  1859. background: #fff;
  1860. border-radius: 48rpx 48rpx 0 0;
  1861. box-shadow: 0 8rpx 48rpx rgba(0,0,0,0.18);
  1862. display: flex;
  1863. flex-direction: column;
  1864. align-items: stretch;
  1865. position: relative;
  1866. padding: 0;
  1867. overflow: hidden;
  1868. min-height: 520rpx;
  1869. max-height: 80vh;
  1870. bottom: 0;
  1871. }
  1872. .detail-popup-close {
  1873. position: absolute;
  1874. right: 36rpx;
  1875. top: 36rpx;
  1876. font-size: 36rpx;
  1877. color: #bbb;
  1878. z-index: 2;
  1879. }
  1880. .popup-green-tip {
  1881. border-radius: 48rpx 48rpx 0 0;
  1882. font-size: 20rpx;
  1883. padding: 24rpx 30rpx 0 30rpx;
  1884. background: #eaffea;
  1885. color: #13ac47;
  1886. text-align: left;
  1887. }
  1888. .panel-header {
  1889. display: flex;
  1890. align-items: center;
  1891. justify-content: center;
  1892. font-size: 32rpx;
  1893. font-weight: bold;
  1894. padding: 40rpx 36rpx 0 36rpx;
  1895. background: #fff;
  1896. position: relative;
  1897. }
  1898. .panel-title {
  1899. font-size: 32rpx;
  1900. color: #222;
  1901. font-weight: bold;
  1902. text-align: center;
  1903. flex: 1;
  1904. }
  1905. .popup-panel-list {
  1906. flex: 1;
  1907. overflow-y: auto;
  1908. max-height: 36vh;
  1909. padding: 0 24rpx;
  1910. scrollbar-width: none; /* Firefox */
  1911. -ms-overflow-style: none; /* IE and Edge */
  1912. &::-webkit-scrollbar {
  1913. width: 0 !important;
  1914. display: none; /* Chrome, Safari, Opera */
  1915. }
  1916. }
  1917. .panel-item {
  1918. display: flex;
  1919. align-items: center;
  1920. justify-content: flex-start;
  1921. padding: 24rpx 0;
  1922. border-bottom: 1px solid #f0f0f0;
  1923. }
  1924. .panel-item-img {
  1925. width: 100rpx;
  1926. height: 100rpx;
  1927. margin-right: 20rpx;
  1928. border-radius: 16rpx;
  1929. background: #f8f8f8;
  1930. }
  1931. .panel-item-info {
  1932. flex: 1;
  1933. display: flex;
  1934. flex-direction: column;
  1935. justify-content: center;
  1936. min-width: 0;
  1937. }
  1938. .panel-item-name {
  1939. font-size: 30rpx;
  1940. color: #222;
  1941. font-weight: bold;
  1942. margin-bottom: 4rpx;
  1943. text-overflow: ellipsis;
  1944. overflow: hidden;
  1945. white-space: nowrap;
  1946. }
  1947. .panel-item-desc {
  1948. font-size: 24rpx;
  1949. color: #999;
  1950. margin-bottom: 4rpx;
  1951. text-overflow: ellipsis;
  1952. overflow: hidden;
  1953. white-space: nowrap;
  1954. }
  1955. .panel-item-price {
  1956. font-size: 26rpx;
  1957. color: #ff9c00;
  1958. margin-top: 2rpx;
  1959. }
  1960. .panel-quantity-control {
  1961. display: flex;
  1962. align-items: center;
  1963. margin-left: 20rpx;
  1964. margin-right: 30rpx;
  1965. flex-shrink: 0;
  1966. }
  1967. .panel-quantity-control button {
  1968. width: 48rpx;
  1969. height: 48rpx;
  1970. padding: 0;
  1971. margin: 0 8rpx;
  1972. display: flex;
  1973. align-items: center;
  1974. justify-content: center;
  1975. font-size: 32rpx;
  1976. color: #666;
  1977. background: #ffffff;
  1978. border: none;
  1979. border-radius: 50%;
  1980. &::after {
  1981. border: none;
  1982. }
  1983. &:active {
  1984. opacity: 0.8;
  1985. }
  1986. }
  1987. .panel-quantity-control .quantity {
  1988. width: 30rpx;
  1989. text-align: center;
  1990. font-size: 28rpx;
  1991. color: #333;
  1992. }
  1993. .popup-bottom-bar {
  1994. width: 100%;
  1995. background-color: #fff;
  1996. display: flex;
  1997. align-items: center;
  1998. justify-content: space-between;
  1999. padding: 0 30rpx;
  2000. box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
  2001. height: 120rpx;
  2002. border-top: 1px solid #f0f0f0;
  2003. border-bottom-left-radius: 48rpx;
  2004. border-bottom-right-radius: 48rpx;
  2005. // padding-bottom: env(safe-area-inset-bottom);
  2006. .bottom-left {
  2007. display: flex;
  2008. flex-direction: column;
  2009. justify-content: center;
  2010. .summary-row {
  2011. display: flex;
  2012. align-items: center;
  2013. font-size: 26rpx;
  2014. color: #333;
  2015. .summary-label {
  2016. color: #333;
  2017. }
  2018. .summary-count {
  2019. color: #ff9c00;
  2020. font-weight: bold;
  2021. font-size: 28rpx;
  2022. }
  2023. }
  2024. .amount-row {
  2025. display: flex;
  2026. align-items: center;
  2027. margin-top: 4rpx;
  2028. .amount {
  2029. color: #ff9c00;
  2030. font-size: 44rpx;
  2031. font-weight: bold;
  2032. vertical-align: middle;
  2033. }
  2034. }
  2035. }
  2036. .submit-btn {
  2037. width: 300rpx;
  2038. height: 88rpx;
  2039. background: linear-gradient(to right, #ffd01e, #ff8917);
  2040. border-radius: 44rpx;
  2041. color: #fff;
  2042. font-size: 32rpx;
  2043. font-weight: bold;
  2044. display: flex;
  2045. align-items: center;
  2046. justify-content: center;
  2047. border: none;
  2048. box-shadow: 0 4rpx 16rpx rgba(255, 156, 0, 0.08);
  2049. &::after {
  2050. border: none;
  2051. }
  2052. &:active {
  2053. opacity: 0.9;
  2054. }
  2055. }
  2056. }
  2057. .brand-popup-mask {
  2058. position: fixed;
  2059. left: 0;
  2060. right: 0;
  2061. top: 0;
  2062. bottom: 0;
  2063. background: rgba(0,0,0,0.35);
  2064. z-index: 3000;
  2065. display: flex;
  2066. align-items: flex-end;
  2067. justify-content: center;
  2068. }
  2069. .brand-popup {
  2070. position: relative;
  2071. width: 100%;
  2072. max-width: 750px;
  2073. background: #fff;
  2074. border-radius: 32rpx 32rpx 0 0;
  2075. box-shadow: 0 -4rpx 24rpx rgba(0,0,0,0.08);
  2076. padding-bottom: 40rpx;
  2077. max-height: 90vh;
  2078. display: flex;
  2079. flex-direction: column;
  2080. overflow: hidden;
  2081. }
  2082. .brand-popup-header {
  2083. display: flex;
  2084. align-items: center;
  2085. justify-content: center;
  2086. padding: 32rpx 24rpx 0 24rpx;
  2087. font-size: 32rpx;
  2088. font-weight: bold;
  2089. position: relative;
  2090. }
  2091. .brand-popup-close {
  2092. position: absolute;
  2093. left: 24rpx;
  2094. font-size: 28rpx;
  2095. color: #888;
  2096. }
  2097. .brand-popup-title {
  2098. font-size: 32rpx;
  2099. color: #222;
  2100. font-weight: bold;
  2101. }
  2102. .brand-popup-search {
  2103. padding: 20rpx 24rpx 0 24rpx;
  2104. }
  2105. .brand-search-input {
  2106. width: 100%;
  2107. height: 60rpx;
  2108. border-radius: 30rpx;
  2109. background: #f5f5f5;
  2110. border: none;
  2111. padding-left: 40rpx;
  2112. font-size: 28rpx;
  2113. color: #888;
  2114. }
  2115. .brand-popup-list {
  2116. flex: 1;
  2117. overflow-y: auto;
  2118. max-height: 60vh;
  2119. padding: 0 24rpx;
  2120. scrollbar-width: none; /* Firefox */
  2121. -ms-overflow-style: none; /* IE and Edge */
  2122. &::-webkit-scrollbar {
  2123. width: 0 !important;
  2124. display: none; /* Chrome, Safari, Opera */
  2125. }
  2126. }
  2127. .brand-letter {
  2128. font-size: 28rpx;
  2129. color: #888;
  2130. margin: 24rpx 0 8rpx 0;
  2131. font-weight: bold;
  2132. }
  2133. .brand-item {
  2134. display: flex;
  2135. align-items: center;
  2136. padding: 16rpx 0;
  2137. border-bottom: 1px solid #f0f0f0;
  2138. }
  2139. .brand-logo {
  2140. width: 60rpx;
  2141. height: 60rpx;
  2142. margin-right: 20rpx;
  2143. border-radius: 8rpx;
  2144. background: #f8f8f8;
  2145. }
  2146. .brand-name {
  2147. font-size: 28rpx;
  2148. color: #222;
  2149. }
  2150. .brand-index-bar {
  2151. position: absolute;
  2152. right: 12rpx;
  2153. top: 120rpx;
  2154. width: 32rpx;
  2155. display: flex;
  2156. flex-direction: column;
  2157. align-items: center;
  2158. z-index: 10;
  2159. }
  2160. .brand-index-bar text {
  2161. font-size: 22rpx;
  2162. color: #bbb;
  2163. margin: 4rpx 0;
  2164. font-weight: bold;
  2165. &.active {
  2166. color: #ff9c00;
  2167. }
  2168. }
  2169. .rule-popup-mask {
  2170. position: fixed;
  2171. left: 0;
  2172. right: 0;
  2173. top: 0;
  2174. bottom: 0;
  2175. background: rgba(0,0,0,0.35);
  2176. z-index: 4000;
  2177. display: flex;
  2178. align-items: center;
  2179. justify-content: center;
  2180. }
  2181. .rule-popup {
  2182. width: 95vw;
  2183. max-width: 750rpx;
  2184. max-height: 85vh;
  2185. background: #fff;
  2186. border-radius: 48rpx;
  2187. box-shadow: 0 8rpx 32rpx rgba(0,0,0,0.12);
  2188. display: flex;
  2189. flex-direction: column;
  2190. align-items: center;
  2191. position: relative;
  2192. padding-bottom: 40rpx;
  2193. }
  2194. .rule-popup-title {
  2195. font-size: 36rpx;
  2196. color: #222;
  2197. font-weight: bold;
  2198. text-align: center;
  2199. margin-top: 48rpx;
  2200. margin-bottom: 16rpx;
  2201. }
  2202. .rule-popup-content {
  2203. width: 100%;
  2204. max-height: 60vh;
  2205. min-height: 400rpx;
  2206. padding: 0 40rpx;
  2207. box-sizing: border-box;
  2208. overflow-y: auto;
  2209. scrollbar-width: none; /* Firefox */
  2210. -ms-overflow-style: none; /* IE and Edge */
  2211. &::-webkit-scrollbar {
  2212. width: 0 !important;
  2213. display: none; /* Chrome, Safari, Opera */
  2214. }
  2215. }
  2216. .rule-content-bottom-indicator {
  2217. height: 20rpx;
  2218. width: 100%;
  2219. }
  2220. .scroll-tip {
  2221. font-size: 24rpx;
  2222. color: #ff6b35;
  2223. text-align: center;
  2224. margin: 16rpx 0 8rpx 0;
  2225. animation: tipPulse 2s infinite;
  2226. }
  2227. @keyframes tipPulse {
  2228. 0%, 100% { opacity: 1; }
  2229. 50% { opacity: 0.6; }
  2230. }
  2231. .rule-popup-desc {
  2232. font-size: 26rpx;
  2233. color: #888;
  2234. text-align: center;
  2235. margin-bottom: 24rpx;
  2236. margin-top: 0;
  2237. }
  2238. .rule-popup-warning {
  2239. width: 100%;
  2240. border: 2rpx solid #ffb800;
  2241. color: #ffb800;
  2242. background: #fffbe6;
  2243. border-radius: 32rpx;
  2244. font-size: 28rpx;
  2245. text-align: center;
  2246. padding: 16rpx 0;
  2247. margin-bottom: 24rpx;
  2248. font-weight: bold;
  2249. }
  2250. .rule-popup-img {
  2251. display: block;
  2252. margin: 0 auto 24rpx auto;
  2253. max-width: 80%;
  2254. max-height: 300rpx;
  2255. border-radius: 16rpx;
  2256. object-fit: contain;
  2257. }
  2258. .rule-popup-btn {
  2259. width: 80%;
  2260. height: 88rpx;
  2261. background: linear-gradient(to right, #ffd01e, #ff8917);
  2262. border-radius: 44rpx;
  2263. color: #fff;
  2264. font-size: 32rpx;
  2265. font-weight: bold;
  2266. display: flex;
  2267. align-items: center;
  2268. justify-content: center;
  2269. border: none;
  2270. margin: 0 auto;
  2271. margin-top: 16rpx;
  2272. box-shadow: 0 4rpx 16rpx rgba(255, 156, 0, 0.08);
  2273. transition: all 0.3s ease;
  2274. &::after {
  2275. border: none;
  2276. }
  2277. &:active {
  2278. opacity: 0.9;
  2279. }
  2280. &.disabled {
  2281. background: #ccc;
  2282. color: #999;
  2283. box-shadow: none;
  2284. opacity: 0.6;
  2285. }
  2286. }
  2287. .rule-popup-close {
  2288. position: absolute;
  2289. right: 32rpx;
  2290. bottom: 32rpx;
  2291. width: 72rpx;
  2292. height: 72rpx;
  2293. background: #ff5a5f;
  2294. border-radius: 50%;
  2295. display: flex;
  2296. align-items: center;
  2297. justify-content: center;
  2298. z-index: 10;
  2299. box-shadow: 0 2rpx 8rpx rgba(255,90,95,0.12);
  2300. }
  2301. /* 预约上门取件弹窗样式 */
  2302. .pickup-confirm-mask {
  2303. position: fixed;
  2304. left: 0;
  2305. right: 0;
  2306. top: 0;
  2307. bottom: 0;
  2308. background: rgba(0,0,0,0.35);
  2309. z-index: 5000;
  2310. display: flex;
  2311. align-items: center;
  2312. justify-content: center;
  2313. }
  2314. .pickup-confirm-popup {
  2315. width: 90vw;
  2316. max-width: 600rpx;
  2317. background: #fff;
  2318. border-radius: 48rpx;
  2319. box-shadow: 0 8rpx 32rpx rgba(0,0,0,0.12);
  2320. display: flex;
  2321. flex-direction: column;
  2322. align-items: center;
  2323. position: relative;
  2324. padding: 48rpx 36rpx 40rpx 36rpx;
  2325. }
  2326. .pickup-confirm-title {
  2327. font-size: 36rpx;
  2328. color: #222;
  2329. font-weight: bold;
  2330. text-align: center;
  2331. margin-bottom: 24rpx;
  2332. }
  2333. .pickup-confirm-content {
  2334. width: 100%;
  2335. font-size: 26rpx;
  2336. color: #333;
  2337. text-align: left;
  2338. line-height: 1.7;
  2339. margin-bottom: 36rpx;
  2340. .confirm-item {
  2341. margin-bottom: 24rpx;
  2342. &:last-child {
  2343. margin-bottom: 0;
  2344. }
  2345. }
  2346. .confirm-item-red {
  2347. color: red;
  2348. }
  2349. }
  2350. .pickup-confirm-btn-row {
  2351. width: 100%;
  2352. display: flex;
  2353. justify-content: space-between;
  2354. gap: 32rpx;
  2355. }
  2356. .pickup-confirm-btn {
  2357. flex: 1;
  2358. height: 88rpx;
  2359. border-radius: 44rpx;
  2360. font-size: 32rpx;
  2361. font-weight: bold;
  2362. display: flex;
  2363. align-items: center;
  2364. justify-content: center;
  2365. border: 2rpx solid #ffd01e;
  2366. background: #fff;
  2367. color: #ff9c00;
  2368. box-shadow: 0 4rpx 16rpx rgba(255, 156, 0, 0.08);
  2369. }
  2370. .pickup-confirm-btn:not(.agree) {
  2371. background: #fff0d2;
  2372. }
  2373. .pickup-confirm-btn.agree {
  2374. background: linear-gradient(to right, #ffd01e, #ff8917);
  2375. color: #fff;
  2376. border: none;
  2377. }
  2378. .uv-tabbar {
  2379. z-index: 1000;
  2380. }
  2381. .loading-more {
  2382. text-align: center;
  2383. color: #999;
  2384. padding: 20rpx 0;
  2385. font-size: 26rpx;
  2386. }
  2387. .brand-confirm-mask {
  2388. position: fixed;
  2389. left: 0;
  2390. right: 0;
  2391. top: 0;
  2392. bottom: 0;
  2393. background: rgba(0,0,0,0.25);
  2394. z-index: 5001;
  2395. display: flex;
  2396. align-items: center;
  2397. justify-content: center;
  2398. }
  2399. .brand-confirm-popup {
  2400. width: 70vw;
  2401. max-width: 270px;
  2402. background: #fff;
  2403. border-radius: 32rpx;
  2404. box-shadow: 0 8rpx 32rpx rgba(0,0,0,0.12);
  2405. display: flex;
  2406. flex-direction: column;
  2407. align-items: center;
  2408. padding: 48rpx 20rpx 36rpx 20rpx;
  2409. position: relative;
  2410. }
  2411. .brand-confirm-title {
  2412. font-size: 36rpx;
  2413. color: #222;
  2414. font-weight: bold;
  2415. text-align: center;
  2416. margin-bottom: 24rpx;
  2417. }
  2418. .brand-confirm-logo-wrap {
  2419. width: 120rpx;
  2420. height: 120rpx;
  2421. background: #f8f8f8;
  2422. border-radius: 50%;
  2423. display: flex;
  2424. align-items: center;
  2425. justify-content: center;
  2426. margin-bottom: 18rpx;
  2427. }
  2428. .brand-confirm-logo {
  2429. width: 80rpx;
  2430. height: 80rpx;
  2431. border-radius: 50%;
  2432. }
  2433. .brand-confirm-name {
  2434. font-size: 28rpx;
  2435. color: #222;
  2436. font-weight: bold;
  2437. text-align: center;
  2438. margin-bottom: 16rpx;
  2439. }
  2440. .brand-confirm-desc {
  2441. font-size: 24rpx;
  2442. color: #999;
  2443. text-align: center;
  2444. margin-bottom: 32rpx;
  2445. line-height: 1.6;
  2446. }
  2447. .brand-confirm-btn-row {
  2448. width: 100%;
  2449. display: flex;
  2450. justify-content: space-between;
  2451. gap: 24rpx;
  2452. }
  2453. .brand-confirm-btn {
  2454. flex: 1;
  2455. height: 72rpx;
  2456. border-radius: 36rpx;
  2457. font-size: 28rpx;
  2458. font-weight: bold;
  2459. display: flex;
  2460. align-items: center;
  2461. justify-content: center;
  2462. border: none;
  2463. margin: 0 0;
  2464. }
  2465. .brand-confirm-btn.retry {
  2466. background: #fff;
  2467. color: #ff9c00;
  2468. border: 2rpx solid #ff9c00;
  2469. }
  2470. .brand-confirm-btn.confirm {
  2471. background: linear-gradient(to right, #ffd01e, #ff8917);
  2472. color: #fff;
  2473. border: none;
  2474. }
  2475. .price-info-popup-mask {
  2476. position: fixed;
  2477. left: 0;
  2478. right: 0;
  2479. top: 0;
  2480. bottom: 0;
  2481. background: rgba(0,0,0,0.4);
  2482. z-index: 6000;
  2483. display: flex;
  2484. align-items: center;
  2485. justify-content: center;
  2486. }
  2487. .price-info-popup {
  2488. width: 85vw;
  2489. max-width: 600rpx;
  2490. background: #fff;
  2491. border-radius: 24rpx;
  2492. box-shadow: 0 8rpx 32rpx rgba(0,0,0,0.12);
  2493. display: flex;
  2494. flex-direction: column;
  2495. align-items: center;
  2496. position: relative;
  2497. padding: 40rpx 40rpx;
  2498. .price-info-popup-title {
  2499. font-size: 34rpx;
  2500. color: #333;
  2501. font-weight: bold;
  2502. text-align: center;
  2503. margin-bottom: 30rpx;
  2504. }
  2505. .price-info-popup-content {
  2506. width: 100%;
  2507. max-height: 50vh;
  2508. .price-info-section {
  2509. margin-bottom: 30rpx;
  2510. &:last-child {
  2511. margin-bottom: 0;
  2512. }
  2513. .price-info-heading {
  2514. font-size: 28rpx;
  2515. color: #333;
  2516. font-weight: 500;
  2517. margin-bottom: 15rpx;
  2518. }
  2519. .price-info-text {
  2520. font-size: 26rpx;
  2521. color: #666;
  2522. line-height: 1.6;
  2523. }
  2524. }
  2525. }
  2526. .price-info-popup-btn {
  2527. width: 100%;
  2528. height: 88rpx;
  2529. background: linear-gradient(to right, #ffd01e, #ff8917);
  2530. border-radius: 44rpx;
  2531. color: #fff;
  2532. font-size: 32rpx;
  2533. font-weight: bold;
  2534. display: flex;
  2535. align-items: center;
  2536. justify-content: center;
  2537. border: none;
  2538. margin-top: 40rpx;
  2539. box-shadow: 0 4rpx 16rpx rgba(255, 156, 0, 0.08);
  2540. &::after {
  2541. border: none;
  2542. }
  2543. &:active {
  2544. opacity: 0.9;
  2545. }
  2546. }
  2547. }
  2548. /* 减少数量时的品牌选择弹窗 */
  2549. .brand-reduce-popup-mask {
  2550. position: fixed;
  2551. left: 0;
  2552. right: 0;
  2553. top: 0;
  2554. bottom: 0;
  2555. background: rgba(0,0,0,0.35);
  2556. z-index: 5001;
  2557. display: flex;
  2558. align-items: center;
  2559. justify-content: center;
  2560. }
  2561. .brand-reduce-popup {
  2562. width: 70vw;
  2563. max-width: 270px;
  2564. background: #fff;
  2565. border-radius: 32rpx;
  2566. box-shadow: 0 8rpx 32rpx rgba(0,0,0,0.12);
  2567. display: flex;
  2568. flex-direction: column;
  2569. align-items: center;
  2570. padding: 48rpx 20rpx 36rpx 20rpx;
  2571. position: relative;
  2572. }
  2573. .brand-reduce-popup-header {
  2574. display: flex;
  2575. align-items: center;
  2576. justify-content: center;
  2577. padding: 32rpx 24rpx 0 24rpx;
  2578. font-size: 32rpx;
  2579. font-weight: bold;
  2580. position: relative;
  2581. }
  2582. .brand-reduce-popup-close {
  2583. position: absolute;
  2584. left: 24rpx;
  2585. font-size: 28rpx;
  2586. color: #888;
  2587. }
  2588. .brand-reduce-popup-title {
  2589. font-size: 32rpx;
  2590. color: #222;
  2591. font-weight: bold;
  2592. }
  2593. .brand-reduce-popup-list {
  2594. flex: 1;
  2595. overflow-y: auto;
  2596. max-height: 60vh;
  2597. padding: 0 24rpx;
  2598. scrollbar-width: none; /* Firefox */
  2599. -ms-overflow-style: none; /* IE and Edge */
  2600. &::-webkit-scrollbar {
  2601. width: 0 !important;
  2602. display: none; /* Chrome, Safari, Opera */
  2603. }
  2604. }
  2605. .brand-item {
  2606. display: flex;
  2607. align-items: center;
  2608. padding: 16rpx 0;
  2609. border-bottom: 1px solid #f0f0f0;
  2610. }
  2611. .brand-logo {
  2612. width: 60rpx;
  2613. height: 60rpx;
  2614. margin-right: 20rpx;
  2615. border-radius: 8rpx;
  2616. background: #f8f8f8;
  2617. }
  2618. .brand-name {
  2619. font-size: 28rpx;
  2620. color: #222;
  2621. }
  2622. </style>