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

2809 lines
80 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: 0 // 竖屏方向,0代表竖屏,1代表横屏,-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 0 180rpx 0; /* 添加底部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. margin-top: 10rpx;
  1596. }
  1597. .price-info {
  1598. display: flex;
  1599. align-items: baseline;
  1600. white-space: nowrap;
  1601. flex-shrink: 0;
  1602. .price-symbol {
  1603. font-size: 24rpx;
  1604. color: #ff7a0e;
  1605. }
  1606. .price-value {
  1607. font-size: 36rpx;
  1608. color: #ff7a0e;
  1609. font-weight: bold;
  1610. margin: 0 4rpx;
  1611. white-space: nowrap;
  1612. }
  1613. .price-unit {
  1614. font-size: 24rpx;
  1615. color: #999;
  1616. white-space: nowrap;
  1617. }
  1618. }
  1619. .quantity-control {
  1620. display: flex;
  1621. align-items: center;
  1622. flex-shrink: 0;
  1623. white-space: nowrap;
  1624. button {
  1625. width: 60rpx;
  1626. height: 60rpx;
  1627. padding: 0;
  1628. margin: 0;
  1629. display: flex;
  1630. align-items: center;
  1631. justify-content: center;
  1632. font-size: 28rpx;
  1633. color: #666;
  1634. background: #ffffff;
  1635. border: none;
  1636. border-radius: 50%;
  1637. &::after {
  1638. border: none;
  1639. }
  1640. &:active {
  1641. opacity: 0.8;
  1642. }
  1643. }
  1644. .quantity {
  1645. width: 50rpx;
  1646. text-align: center;
  1647. font-size: 32rpx;
  1648. color: #333;
  1649. }
  1650. }
  1651. .rules-brand-row {
  1652. display: flex;
  1653. align-items: center;
  1654. margin-top: 20rpx;
  1655. gap: 16rpx;
  1656. .rules-link {
  1657. margin-top: 0;
  1658. .rules {
  1659. display: inline-flex;
  1660. align-items: center;
  1661. font-family: PingFang SC;
  1662. font-weight: 400;
  1663. font-size: 12px;
  1664. color: #666;
  1665. white-space: nowrap;
  1666. }
  1667. }
  1668. .brand-check-placeholder {
  1669. margin-left: 12rpx;
  1670. }
  1671. }
  1672. }
  1673. .other-unrecycle-card {
  1674. display: flex;
  1675. align-items: center;
  1676. background: #fff;
  1677. border-radius: 24rpx;
  1678. box-shadow: 0 4rpx 24rpx rgba(0,0,0,0.06);
  1679. padding: 30rpx 30rpx 30rpx 30rpx;
  1680. margin: 30rpx 0 0 0;
  1681. }
  1682. .other-unrecycle-img {
  1683. width: 120rpx;
  1684. height: 120rpx;
  1685. border-radius: 24rpx;
  1686. background: #f8f8f8;
  1687. margin-right: 28rpx;
  1688. object-fit: contain;
  1689. flex-shrink: 0;
  1690. }
  1691. .other-unrecycle-info {
  1692. flex: 1;
  1693. display: flex;
  1694. flex-direction: column;
  1695. justify-content: center;
  1696. min-width: 0;
  1697. overflow: hidden;
  1698. }
  1699. .other-unrecycle-title {
  1700. font-size: 30rpx;
  1701. color: #222;
  1702. font-weight: bold;
  1703. margin-bottom: 8rpx;
  1704. white-space: nowrap;
  1705. overflow: hidden;
  1706. text-overflow: ellipsis;
  1707. }
  1708. .other-unrecycle-desc {
  1709. font-size: 24rpx;
  1710. color: #999;
  1711. margin-bottom: 12rpx;
  1712. text-overflow: ellipsis;
  1713. overflow: hidden;
  1714. white-space: nowrap;
  1715. }
  1716. .other-unrecycle-price-row {
  1717. display: flex;
  1718. align-items: center;
  1719. white-space: nowrap;
  1720. }
  1721. .other-unrecycle-price {
  1722. font-size: 28rpx;
  1723. color: #ff9c00;
  1724. font-weight: bold;
  1725. white-space: nowrap;
  1726. }
  1727. .other-unrecycle-btn {
  1728. width: 60rpx;
  1729. height: 60rpx;
  1730. margin-left: 24rpx;
  1731. border-radius: 50%;
  1732. background: #fff;
  1733. color: #666;
  1734. font-size: 36rpx;
  1735. border: none;
  1736. display: flex;
  1737. align-items: center;
  1738. justify-content: center;
  1739. }
  1740. .fixed-bottom-wrap {
  1741. position: fixed;
  1742. left: 0;
  1743. right: 0;
  1744. bottom: calc(v-bind('tabbarHeight + "px"') + env(safe-area-inset-bottom));
  1745. width: 100vw;
  1746. z-index: 100;
  1747. background: transparent;
  1748. box-sizing: border-box;
  1749. pointer-events: auto;
  1750. }
  1751. .bottom-bar-divider {
  1752. width: 100%;
  1753. height: 1px;
  1754. background: #f0f0f0;
  1755. position: absolute;
  1756. left: 0;
  1757. bottom: 0;
  1758. z-index: 1;
  1759. }
  1760. .green-tip-bar {
  1761. width: 100%;
  1762. background: #eaffea;
  1763. color: #13ac47;
  1764. font-size: 20rpx;
  1765. padding: 8rpx 30rpx;
  1766. box-sizing: border-box;
  1767. text-align: center;
  1768. display: flex;
  1769. align-items: center;
  1770. justify-content: center;
  1771. line-height: 1.4;
  1772. min-height: 40rpx;
  1773. .tip-highlight {
  1774. color: #ff9c00;
  1775. font-weight: bold;
  1776. font-size: 20rpx;
  1777. }
  1778. }
  1779. .bottom-bar {
  1780. width: 100%;
  1781. background-color: #fff;
  1782. display: flex;
  1783. align-items: center;
  1784. justify-content: space-between;
  1785. padding: 0 30rpx;
  1786. box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
  1787. height: 120rpx;
  1788. border-top-left-radius: 0;
  1789. border-top-right-radius: 0;
  1790. border-bottom-left-radius: env(safe-area-inset-bottom);
  1791. border-bottom-right-radius: env(safe-area-inset-bottom);
  1792. .bottom-left {
  1793. // flex: 1;
  1794. display: flex;
  1795. flex-direction: column;
  1796. justify-content: center;
  1797. .summary-row {
  1798. display: flex;
  1799. align-items: center;
  1800. font-size: 26rpx;
  1801. color: #333;
  1802. .summary-label {
  1803. color: #333;
  1804. }
  1805. .summary-count {
  1806. color: #ff9c00;
  1807. font-weight: bold;
  1808. font-size: 28rpx;
  1809. }
  1810. }
  1811. .amount-row {
  1812. display: flex;
  1813. align-items: center;
  1814. margin-top: 4rpx;
  1815. .amount {
  1816. color: #ff9c00;
  1817. font-size: 44rpx;
  1818. font-weight: bold;
  1819. vertical-align: middle;
  1820. }
  1821. }
  1822. }
  1823. .submit-btn {
  1824. width: 300rpx;
  1825. height: 88rpx;
  1826. background: linear-gradient(to right, #ffd01e, #ff8917);
  1827. border-radius: 44rpx;
  1828. color: #fff;
  1829. font-size: 32rpx;
  1830. font-weight: bold;
  1831. display: flex;
  1832. align-items: center;
  1833. justify-content: center;
  1834. border: none;
  1835. // margin-left: 0rpx;
  1836. box-shadow: 0 4rpx 16rpx rgba(255, 156, 0, 0.08);
  1837. &::after {
  1838. border: none;
  1839. }
  1840. &:active {
  1841. opacity: 0.9;
  1842. }
  1843. }
  1844. }
  1845. .detail-popup-mask {
  1846. position: fixed;
  1847. left: 0;
  1848. right: 0;
  1849. top: 0;
  1850. bottom: calc(90rpx + env(safe-area-inset-bottom)); /* tabbar高度+安全区 */
  1851. background: rgba(0,0,0,0.35);
  1852. z-index: 8;
  1853. display: flex;
  1854. align-items: flex-end;
  1855. justify-content: center;
  1856. }
  1857. .detail-popup {
  1858. width: 100vw;
  1859. max-width: none;
  1860. background: #fff;
  1861. border-radius: 48rpx 48rpx 0 0;
  1862. box-shadow: 0 8rpx 48rpx rgba(0,0,0,0.18);
  1863. display: flex;
  1864. flex-direction: column;
  1865. align-items: stretch;
  1866. position: relative;
  1867. padding: 0;
  1868. overflow: hidden;
  1869. min-height: 520rpx;
  1870. max-height: 80vh;
  1871. bottom: 0;
  1872. }
  1873. .detail-popup-close {
  1874. position: absolute;
  1875. right: 36rpx;
  1876. top: 36rpx;
  1877. font-size: 36rpx;
  1878. color: #bbb;
  1879. z-index: 2;
  1880. }
  1881. .popup-green-tip {
  1882. border-radius: 48rpx 48rpx 0 0;
  1883. font-size: 20rpx;
  1884. padding: 24rpx 30rpx 0 30rpx;
  1885. background: #eaffea;
  1886. color: #13ac47;
  1887. text-align: left;
  1888. }
  1889. .panel-header {
  1890. display: flex;
  1891. align-items: center;
  1892. justify-content: center;
  1893. font-size: 32rpx;
  1894. font-weight: bold;
  1895. padding: 40rpx 36rpx 0 36rpx;
  1896. background: #fff;
  1897. position: relative;
  1898. }
  1899. .panel-title {
  1900. font-size: 32rpx;
  1901. color: #222;
  1902. font-weight: bold;
  1903. text-align: center;
  1904. flex: 1;
  1905. }
  1906. .popup-panel-list {
  1907. flex: 1;
  1908. overflow-y: auto;
  1909. max-height: 36vh;
  1910. padding: 0 24rpx;
  1911. scrollbar-width: none; /* Firefox */
  1912. -ms-overflow-style: none; /* IE and Edge */
  1913. &::-webkit-scrollbar {
  1914. width: 0 !important;
  1915. display: none; /* Chrome, Safari, Opera */
  1916. }
  1917. }
  1918. .panel-item {
  1919. display: flex;
  1920. align-items: center;
  1921. justify-content: flex-start;
  1922. padding: 24rpx 0;
  1923. border-bottom: 1px solid #f0f0f0;
  1924. }
  1925. .panel-item-img {
  1926. width: 100rpx;
  1927. height: 100rpx;
  1928. margin-right: 20rpx;
  1929. border-radius: 16rpx;
  1930. background: #f8f8f8;
  1931. }
  1932. .panel-item-info {
  1933. flex: 1;
  1934. display: flex;
  1935. flex-direction: column;
  1936. justify-content: center;
  1937. min-width: 0;
  1938. }
  1939. .panel-item-name {
  1940. font-size: 30rpx;
  1941. color: #222;
  1942. font-weight: bold;
  1943. margin-bottom: 4rpx;
  1944. text-overflow: ellipsis;
  1945. overflow: hidden;
  1946. white-space: nowrap;
  1947. }
  1948. .panel-item-desc {
  1949. font-size: 24rpx;
  1950. color: #999;
  1951. margin-bottom: 4rpx;
  1952. text-overflow: ellipsis;
  1953. overflow: hidden;
  1954. white-space: nowrap;
  1955. }
  1956. .panel-item-price {
  1957. font-size: 26rpx;
  1958. color: #ff9c00;
  1959. margin-top: 2rpx;
  1960. }
  1961. .panel-quantity-control {
  1962. display: flex;
  1963. align-items: center;
  1964. margin-left: 20rpx;
  1965. margin-right: 30rpx;
  1966. flex-shrink: 0;
  1967. }
  1968. .panel-quantity-control button {
  1969. width: 48rpx;
  1970. height: 48rpx;
  1971. padding: 0;
  1972. margin: 0 8rpx;
  1973. display: flex;
  1974. align-items: center;
  1975. justify-content: center;
  1976. font-size: 32rpx;
  1977. color: #666;
  1978. background: #ffffff;
  1979. border: none;
  1980. border-radius: 50%;
  1981. &::after {
  1982. border: none;
  1983. }
  1984. &:active {
  1985. opacity: 0.8;
  1986. }
  1987. }
  1988. .panel-quantity-control .quantity {
  1989. width: 30rpx;
  1990. text-align: center;
  1991. font-size: 28rpx;
  1992. color: #333;
  1993. }
  1994. .popup-bottom-bar {
  1995. width: 100%;
  1996. background-color: #fff;
  1997. display: flex;
  1998. align-items: center;
  1999. justify-content: space-between;
  2000. padding: 0 30rpx;
  2001. box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
  2002. height: 120rpx;
  2003. border-top: 1px solid #f0f0f0;
  2004. border-bottom-left-radius: 48rpx;
  2005. border-bottom-right-radius: 48rpx;
  2006. // padding-bottom: env(safe-area-inset-bottom);
  2007. .bottom-left {
  2008. display: flex;
  2009. flex-direction: column;
  2010. justify-content: center;
  2011. .summary-row {
  2012. display: flex;
  2013. align-items: center;
  2014. font-size: 26rpx;
  2015. color: #333;
  2016. .summary-label {
  2017. color: #333;
  2018. }
  2019. .summary-count {
  2020. color: #ff9c00;
  2021. font-weight: bold;
  2022. font-size: 28rpx;
  2023. }
  2024. }
  2025. .amount-row {
  2026. display: flex;
  2027. align-items: center;
  2028. margin-top: 4rpx;
  2029. .amount {
  2030. color: #ff9c00;
  2031. font-size: 44rpx;
  2032. font-weight: bold;
  2033. vertical-align: middle;
  2034. }
  2035. }
  2036. }
  2037. .submit-btn {
  2038. width: 300rpx;
  2039. height: 88rpx;
  2040. background: linear-gradient(to right, #ffd01e, #ff8917);
  2041. border-radius: 44rpx;
  2042. color: #fff;
  2043. font-size: 32rpx;
  2044. font-weight: bold;
  2045. display: flex;
  2046. align-items: center;
  2047. justify-content: center;
  2048. border: none;
  2049. box-shadow: 0 4rpx 16rpx rgba(255, 156, 0, 0.08);
  2050. &::after {
  2051. border: none;
  2052. }
  2053. &:active {
  2054. opacity: 0.9;
  2055. }
  2056. }
  2057. }
  2058. .brand-popup-mask {
  2059. position: fixed;
  2060. left: 0;
  2061. right: 0;
  2062. top: 0;
  2063. bottom: 0;
  2064. background: rgba(0,0,0,0.35);
  2065. z-index: 3000;
  2066. display: flex;
  2067. align-items: flex-end;
  2068. justify-content: center;
  2069. }
  2070. .brand-popup {
  2071. position: relative;
  2072. width: 100%;
  2073. max-width: 750px;
  2074. background: #fff;
  2075. border-radius: 32rpx 32rpx 0 0;
  2076. box-shadow: 0 -4rpx 24rpx rgba(0,0,0,0.08);
  2077. padding-bottom: 40rpx;
  2078. max-height: 90vh;
  2079. display: flex;
  2080. flex-direction: column;
  2081. overflow: hidden;
  2082. }
  2083. .brand-popup-header {
  2084. display: flex;
  2085. align-items: center;
  2086. justify-content: center;
  2087. padding: 32rpx 24rpx 0 24rpx;
  2088. font-size: 32rpx;
  2089. font-weight: bold;
  2090. position: relative;
  2091. }
  2092. .brand-popup-close {
  2093. position: absolute;
  2094. left: 24rpx;
  2095. font-size: 28rpx;
  2096. color: #888;
  2097. }
  2098. .brand-popup-title {
  2099. font-size: 32rpx;
  2100. color: #222;
  2101. font-weight: bold;
  2102. }
  2103. .brand-popup-search {
  2104. padding: 20rpx 24rpx 0 24rpx;
  2105. }
  2106. .brand-search-input {
  2107. width: 100%;
  2108. height: 60rpx;
  2109. border-radius: 30rpx;
  2110. background: #f5f5f5;
  2111. border: none;
  2112. padding-left: 40rpx;
  2113. font-size: 28rpx;
  2114. color: #888;
  2115. }
  2116. .brand-popup-list {
  2117. flex: 1;
  2118. overflow-y: auto;
  2119. max-height: 60vh;
  2120. padding: 0 24rpx;
  2121. scrollbar-width: none; /* Firefox */
  2122. -ms-overflow-style: none; /* IE and Edge */
  2123. &::-webkit-scrollbar {
  2124. width: 0 !important;
  2125. display: none; /* Chrome, Safari, Opera */
  2126. }
  2127. }
  2128. .brand-letter {
  2129. font-size: 28rpx;
  2130. color: #888;
  2131. margin: 24rpx 0 8rpx 0;
  2132. font-weight: bold;
  2133. }
  2134. .brand-item {
  2135. display: flex;
  2136. align-items: center;
  2137. padding: 16rpx 0;
  2138. border-bottom: 1px solid #f0f0f0;
  2139. }
  2140. .brand-logo {
  2141. width: 60rpx;
  2142. height: 60rpx;
  2143. margin-right: 20rpx;
  2144. border-radius: 8rpx;
  2145. background: #f8f8f8;
  2146. }
  2147. .brand-name {
  2148. font-size: 28rpx;
  2149. color: #222;
  2150. }
  2151. .brand-index-bar {
  2152. position: absolute;
  2153. right: 12rpx;
  2154. top: 120rpx;
  2155. width: 32rpx;
  2156. display: flex;
  2157. flex-direction: column;
  2158. align-items: center;
  2159. z-index: 10;
  2160. }
  2161. .brand-index-bar text {
  2162. font-size: 22rpx;
  2163. color: #bbb;
  2164. margin: 4rpx 0;
  2165. font-weight: bold;
  2166. &.active {
  2167. color: #ff9c00;
  2168. }
  2169. }
  2170. .rule-popup-mask {
  2171. position: fixed;
  2172. left: 0;
  2173. right: 0;
  2174. top: 0;
  2175. bottom: 0;
  2176. background: rgba(0,0,0,0.35);
  2177. z-index: 4000;
  2178. display: flex;
  2179. align-items: center;
  2180. justify-content: center;
  2181. }
  2182. .rule-popup {
  2183. width: 95vw;
  2184. max-width: 750rpx;
  2185. max-height: 85vh;
  2186. background: #fff;
  2187. border-radius: 48rpx;
  2188. box-shadow: 0 8rpx 32rpx rgba(0,0,0,0.12);
  2189. display: flex;
  2190. flex-direction: column;
  2191. align-items: center;
  2192. position: relative;
  2193. padding-bottom: 40rpx;
  2194. }
  2195. .rule-popup-title {
  2196. font-size: 36rpx;
  2197. color: #222;
  2198. font-weight: bold;
  2199. text-align: center;
  2200. margin-top: 48rpx;
  2201. margin-bottom: 16rpx;
  2202. }
  2203. .rule-popup-content {
  2204. width: 100%;
  2205. max-height: 60vh;
  2206. min-height: 400rpx;
  2207. padding: 0 40rpx;
  2208. box-sizing: border-box;
  2209. overflow-y: auto;
  2210. scrollbar-width: none; /* Firefox */
  2211. -ms-overflow-style: none; /* IE and Edge */
  2212. &::-webkit-scrollbar {
  2213. width: 0 !important;
  2214. display: none; /* Chrome, Safari, Opera */
  2215. }
  2216. }
  2217. .rule-content-bottom-indicator {
  2218. height: 20rpx;
  2219. width: 100%;
  2220. }
  2221. .scroll-tip {
  2222. font-size: 24rpx;
  2223. color: #ff6b35;
  2224. text-align: center;
  2225. margin: 16rpx 0 8rpx 0;
  2226. animation: tipPulse 2s infinite;
  2227. }
  2228. @keyframes tipPulse {
  2229. 0%, 100% { opacity: 1; }
  2230. 50% { opacity: 0.6; }
  2231. }
  2232. .rule-popup-desc {
  2233. font-size: 26rpx;
  2234. color: #888;
  2235. text-align: center;
  2236. margin-bottom: 24rpx;
  2237. margin-top: 0;
  2238. }
  2239. .rule-popup-warning {
  2240. width: 100%;
  2241. border: 2rpx solid #ffb800;
  2242. color: #ffb800;
  2243. background: #fffbe6;
  2244. border-radius: 32rpx;
  2245. font-size: 28rpx;
  2246. text-align: center;
  2247. padding: 16rpx 0;
  2248. margin-bottom: 24rpx;
  2249. font-weight: bold;
  2250. }
  2251. .rule-popup-img {
  2252. display: block;
  2253. margin: 0 auto 24rpx auto;
  2254. max-width: 80%;
  2255. max-height: 300rpx;
  2256. border-radius: 16rpx;
  2257. object-fit: contain;
  2258. }
  2259. .rule-popup-btn {
  2260. width: 80%;
  2261. height: 88rpx;
  2262. background: linear-gradient(to right, #ffd01e, #ff8917);
  2263. border-radius: 44rpx;
  2264. color: #fff;
  2265. font-size: 32rpx;
  2266. font-weight: bold;
  2267. display: flex;
  2268. align-items: center;
  2269. justify-content: center;
  2270. border: none;
  2271. margin: 0 auto;
  2272. margin-top: 16rpx;
  2273. box-shadow: 0 4rpx 16rpx rgba(255, 156, 0, 0.08);
  2274. transition: all 0.3s ease;
  2275. &::after {
  2276. border: none;
  2277. }
  2278. &:active {
  2279. opacity: 0.9;
  2280. }
  2281. &.disabled {
  2282. background: #ccc;
  2283. color: #999;
  2284. box-shadow: none;
  2285. opacity: 0.6;
  2286. }
  2287. }
  2288. .rule-popup-close {
  2289. position: absolute;
  2290. right: 32rpx;
  2291. bottom: 32rpx;
  2292. width: 72rpx;
  2293. height: 72rpx;
  2294. background: #ff5a5f;
  2295. border-radius: 50%;
  2296. display: flex;
  2297. align-items: center;
  2298. justify-content: center;
  2299. z-index: 10;
  2300. box-shadow: 0 2rpx 8rpx rgba(255,90,95,0.12);
  2301. }
  2302. /* 预约上门取件弹窗样式 */
  2303. .pickup-confirm-mask {
  2304. position: fixed;
  2305. left: 0;
  2306. right: 0;
  2307. top: 0;
  2308. bottom: 0;
  2309. background: rgba(0,0,0,0.35);
  2310. z-index: 5000;
  2311. display: flex;
  2312. align-items: center;
  2313. justify-content: center;
  2314. }
  2315. .pickup-confirm-popup {
  2316. width: 90vw;
  2317. max-width: 600rpx;
  2318. background: #fff;
  2319. border-radius: 48rpx;
  2320. box-shadow: 0 8rpx 32rpx rgba(0,0,0,0.12);
  2321. display: flex;
  2322. flex-direction: column;
  2323. align-items: center;
  2324. position: relative;
  2325. padding: 48rpx 36rpx 40rpx 36rpx;
  2326. }
  2327. .pickup-confirm-title {
  2328. font-size: 36rpx;
  2329. color: #222;
  2330. font-weight: bold;
  2331. text-align: center;
  2332. margin-bottom: 24rpx;
  2333. }
  2334. .pickup-confirm-content {
  2335. width: 100%;
  2336. font-size: 26rpx;
  2337. color: #333;
  2338. text-align: left;
  2339. line-height: 1.7;
  2340. margin-bottom: 36rpx;
  2341. .confirm-item {
  2342. margin-bottom: 24rpx;
  2343. &:last-child {
  2344. margin-bottom: 0;
  2345. }
  2346. }
  2347. .confirm-item-red {
  2348. color: red;
  2349. }
  2350. }
  2351. .pickup-confirm-btn-row {
  2352. width: 100%;
  2353. display: flex;
  2354. justify-content: space-between;
  2355. gap: 32rpx;
  2356. }
  2357. .pickup-confirm-btn {
  2358. flex: 1;
  2359. height: 88rpx;
  2360. border-radius: 44rpx;
  2361. font-size: 32rpx;
  2362. font-weight: bold;
  2363. display: flex;
  2364. align-items: center;
  2365. justify-content: center;
  2366. border: 2rpx solid #ffd01e;
  2367. background: #fff;
  2368. color: #ff9c00;
  2369. box-shadow: 0 4rpx 16rpx rgba(255, 156, 0, 0.08);
  2370. }
  2371. .pickup-confirm-btn:not(.agree) {
  2372. background: #fff0d2;
  2373. }
  2374. .pickup-confirm-btn.agree {
  2375. background: linear-gradient(to right, #ffd01e, #ff8917);
  2376. color: #fff;
  2377. border: none;
  2378. }
  2379. .uv-tabbar {
  2380. z-index: 1000;
  2381. }
  2382. .loading-more {
  2383. text-align: center;
  2384. color: #999;
  2385. padding: 20rpx 0;
  2386. font-size: 26rpx;
  2387. }
  2388. .brand-confirm-mask {
  2389. position: fixed;
  2390. left: 0;
  2391. right: 0;
  2392. top: 0;
  2393. bottom: 0;
  2394. background: rgba(0,0,0,0.25);
  2395. z-index: 5001;
  2396. display: flex;
  2397. align-items: center;
  2398. justify-content: center;
  2399. }
  2400. .brand-confirm-popup {
  2401. width: 70vw;
  2402. max-width: 270px;
  2403. background: #fff;
  2404. border-radius: 32rpx;
  2405. box-shadow: 0 8rpx 32rpx rgba(0,0,0,0.12);
  2406. display: flex;
  2407. flex-direction: column;
  2408. align-items: center;
  2409. padding: 48rpx 20rpx 36rpx 20rpx;
  2410. position: relative;
  2411. }
  2412. .brand-confirm-title {
  2413. font-size: 36rpx;
  2414. color: #222;
  2415. font-weight: bold;
  2416. text-align: center;
  2417. margin-bottom: 24rpx;
  2418. }
  2419. .brand-confirm-logo-wrap {
  2420. width: 120rpx;
  2421. height: 120rpx;
  2422. background: #f8f8f8;
  2423. border-radius: 50%;
  2424. display: flex;
  2425. align-items: center;
  2426. justify-content: center;
  2427. margin-bottom: 18rpx;
  2428. }
  2429. .brand-confirm-logo {
  2430. width: 80rpx;
  2431. height: 80rpx;
  2432. border-radius: 50%;
  2433. }
  2434. .brand-confirm-name {
  2435. font-size: 28rpx;
  2436. color: #222;
  2437. font-weight: bold;
  2438. text-align: center;
  2439. margin-bottom: 16rpx;
  2440. }
  2441. .brand-confirm-desc {
  2442. font-size: 24rpx;
  2443. color: #999;
  2444. text-align: center;
  2445. margin-bottom: 32rpx;
  2446. line-height: 1.6;
  2447. }
  2448. .brand-confirm-btn-row {
  2449. width: 100%;
  2450. display: flex;
  2451. justify-content: space-between;
  2452. gap: 24rpx;
  2453. }
  2454. .brand-confirm-btn {
  2455. flex: 1;
  2456. height: 72rpx;
  2457. border-radius: 36rpx;
  2458. font-size: 28rpx;
  2459. font-weight: bold;
  2460. display: flex;
  2461. align-items: center;
  2462. justify-content: center;
  2463. border: none;
  2464. margin: 0 0;
  2465. }
  2466. .brand-confirm-btn.retry {
  2467. background: #fff;
  2468. color: #ff9c00;
  2469. border: 2rpx solid #ff9c00;
  2470. }
  2471. .brand-confirm-btn.confirm {
  2472. background: linear-gradient(to right, #ffd01e, #ff8917);
  2473. color: #fff;
  2474. border: none;
  2475. }
  2476. .price-info-popup-mask {
  2477. position: fixed;
  2478. left: 0;
  2479. right: 0;
  2480. top: 0;
  2481. bottom: 0;
  2482. background: rgba(0,0,0,0.4);
  2483. z-index: 6000;
  2484. display: flex;
  2485. align-items: center;
  2486. justify-content: center;
  2487. }
  2488. .price-info-popup {
  2489. width: 85vw;
  2490. max-width: 600rpx;
  2491. background: #fff;
  2492. border-radius: 24rpx;
  2493. box-shadow: 0 8rpx 32rpx rgba(0,0,0,0.12);
  2494. display: flex;
  2495. flex-direction: column;
  2496. align-items: center;
  2497. position: relative;
  2498. padding: 40rpx 40rpx;
  2499. .price-info-popup-title {
  2500. font-size: 34rpx;
  2501. color: #333;
  2502. font-weight: bold;
  2503. text-align: center;
  2504. margin-bottom: 30rpx;
  2505. }
  2506. .price-info-popup-content {
  2507. width: 100%;
  2508. max-height: 50vh;
  2509. .price-info-section {
  2510. margin-bottom: 30rpx;
  2511. &:last-child {
  2512. margin-bottom: 0;
  2513. }
  2514. .price-info-heading {
  2515. font-size: 28rpx;
  2516. color: #333;
  2517. font-weight: 500;
  2518. margin-bottom: 15rpx;
  2519. }
  2520. .price-info-text {
  2521. font-size: 26rpx;
  2522. color: #666;
  2523. line-height: 1.6;
  2524. }
  2525. }
  2526. }
  2527. .price-info-popup-btn {
  2528. width: 100%;
  2529. height: 88rpx;
  2530. background: linear-gradient(to right, #ffd01e, #ff8917);
  2531. border-radius: 44rpx;
  2532. color: #fff;
  2533. font-size: 32rpx;
  2534. font-weight: bold;
  2535. display: flex;
  2536. align-items: center;
  2537. justify-content: center;
  2538. border: none;
  2539. margin-top: 40rpx;
  2540. box-shadow: 0 4rpx 16rpx rgba(255, 156, 0, 0.08);
  2541. &::after {
  2542. border: none;
  2543. }
  2544. &:active {
  2545. opacity: 0.9;
  2546. }
  2547. }
  2548. }
  2549. /* 减少数量时的品牌选择弹窗 */
  2550. .brand-reduce-popup-mask {
  2551. position: fixed;
  2552. left: 0;
  2553. right: 0;
  2554. top: 0;
  2555. bottom: 0;
  2556. background: rgba(0,0,0,0.35);
  2557. z-index: 5001;
  2558. display: flex;
  2559. align-items: center;
  2560. justify-content: center;
  2561. }
  2562. .brand-reduce-popup {
  2563. width: 70vw;
  2564. max-width: 270px;
  2565. background: #fff;
  2566. border-radius: 32rpx;
  2567. box-shadow: 0 8rpx 32rpx rgba(0,0,0,0.12);
  2568. display: flex;
  2569. flex-direction: column;
  2570. align-items: center;
  2571. padding: 48rpx 20rpx 36rpx 20rpx;
  2572. position: relative;
  2573. }
  2574. .brand-reduce-popup-header {
  2575. display: flex;
  2576. align-items: center;
  2577. justify-content: center;
  2578. padding: 32rpx 24rpx 0 24rpx;
  2579. font-size: 32rpx;
  2580. font-weight: bold;
  2581. position: relative;
  2582. }
  2583. .brand-reduce-popup-close {
  2584. position: absolute;
  2585. left: 24rpx;
  2586. font-size: 28rpx;
  2587. color: #888;
  2588. }
  2589. .brand-reduce-popup-title {
  2590. font-size: 32rpx;
  2591. color: #222;
  2592. font-weight: bold;
  2593. }
  2594. .brand-reduce-popup-list {
  2595. flex: 1;
  2596. overflow-y: auto;
  2597. max-height: 60vh;
  2598. padding: 0 24rpx;
  2599. scrollbar-width: none; /* Firefox */
  2600. -ms-overflow-style: none; /* IE and Edge */
  2601. &::-webkit-scrollbar {
  2602. width: 0 !important;
  2603. display: none; /* Chrome, Safari, Opera */
  2604. }
  2605. }
  2606. .brand-item {
  2607. display: flex;
  2608. align-items: center;
  2609. padding: 16rpx 0;
  2610. border-bottom: 1px solid #f0f0f0;
  2611. }
  2612. .brand-logo {
  2613. width: 60rpx;
  2614. height: 60rpx;
  2615. margin-right: 20rpx;
  2616. border-radius: 8rpx;
  2617. background: #f8f8f8;
  2618. }
  2619. .brand-name {
  2620. font-size: 28rpx;
  2621. color: #222;
  2622. }
  2623. .rules-link {
  2624. min-width: 90rpx;
  2625. padding: 0 12rpx;
  2626. .rules {
  2627. font-size: 15px;
  2628. white-space: normal;
  2629. overflow: visible;
  2630. }
  2631. }
  2632. // ... existing code ...
  2633. .rules-brand-row {
  2634. display: flex;
  2635. align-items: center;
  2636. margin-top: 20rpx;
  2637. gap: 24rpx; // 增大间距
  2638. .rules-link {
  2639. margin-top: 0;
  2640. }
  2641. .brand-check-placeholder {
  2642. margin-left: 16rpx;
  2643. }
  2644. }
  2645. // ... existing code ...
  2646. .price-info {
  2647. display: flex;
  2648. align-items: baseline;
  2649. white-space: nowrap;
  2650. flex-shrink: 0;
  2651. gap: 12rpx; // 增大间距
  2652. .price-symbol {
  2653. font-size: 32rpx; // 增大符号
  2654. color: #ff7a0e;
  2655. }
  2656. .price-value {
  2657. font-size: 44rpx; // 增大数字
  2658. color: #ff7a0e;
  2659. font-weight: bold;
  2660. margin: 0 6rpx;
  2661. white-space: nowrap;
  2662. }
  2663. .price-unit {
  2664. font-size: 28rpx;
  2665. color: #999;
  2666. white-space: nowrap;
  2667. }
  2668. }
  2669. .quantity-control {
  2670. display: flex;
  2671. align-items: center;
  2672. flex-shrink: 0;
  2673. white-space: nowrap;
  2674. gap: 16rpx; // 增大间距
  2675. button {
  2676. width: 72rpx; // 增大按钮
  2677. height: 72rpx;
  2678. padding: 0;
  2679. margin: 0;
  2680. display: flex;
  2681. align-items: center;
  2682. justify-content: center;
  2683. font-size: 36rpx; // 增大符号
  2684. color: #666;
  2685. background: #ffffff;
  2686. border: none;
  2687. border-radius: 50%;
  2688. &::after {
  2689. border: none;
  2690. }
  2691. &:active {
  2692. opacity: 0.8;
  2693. }
  2694. }
  2695. .quantity {
  2696. width: 60rpx;
  2697. text-align: center;
  2698. font-size: 36rpx; // 增大数字
  2699. color: #333;
  2700. }
  2701. }
  2702. </style>