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

2811 lines
80 KiB

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