index.vue 29 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187
  1. <template>
  2. <view :data-theme="theme">
  3. <tui-skeleton v-if="showSkeleton"></tui-skeleton>
  4. <view class='productSort' :style="{visibility: showSkeleton ? 'hidden' : 'visible', height: winHeight+ 'px' }">
  5. <!-- 头部 -->
  6. <view class="box-top" :style="{ 'marginTop': sysHeight*2 + 90 + 'rpx'}">
  7. <view class="box-top1">
  8. <text class="box-txt">{{merchanInfo.name}}</text>
  9. <!-- 收藏图片 -->
  10. <view>
  11. <!-- 未收藏icon -->
  12. <image class='icon-img' src="../../static/img/收藏-灰.png"
  13. @click='getMerCollectAddApi' v-if="!merchanInfo.isCollect"/>
  14. <!-- 已经收藏 -->
  15. <image class='icon-img' src="../../static/img/收藏-亮.png"
  16. @click='getMerCollectCancelApi' v-else />
  17. </view>
  18. </view>
  19. <!-- 月销 -->
  20. <view class="box-pin">
  21. <text class="box-txt2">{{ merchanInfo.starLevel }}分</text>
  22. <text class="box-txt3">销量 {{merchanInfo.sales || 0 }}</text>
  23. </view>
  24. <!-- 商家地址 -->
  25. <view class="box-shopp">商家地址:{{merchanInfo.addressDetail}}</view>
  26. <!-- 新品上新的 -->
  27. <view class="box-newtxt">
  28. <swiper style="height: 40rpx; width:100%;" :indicator-dots="false" :autoplay="true" interval="2500" :duration="500" vertical="true" circular="true">
  29. <block v-for="(item,index) in merchanInfo.headline" :key='index'>
  30. <swiper-item catchtouchmove='catchTouchMove'>
  31. <view class='text acea-row row-between-wrapper'>
  32. <view class='newsTitle'>
  33. <text class='iconfont icon-laba ' style="font-size: 24rpx;margin-right: 10rpx;"></text>
  34. <text>{{item.title}}</text>
  35. </view>
  36. </view>
  37. </swiper-item>
  38. </block>
  39. </swiper>
  40. </view>
  41. </view>
  42. <!-- #ifdef APP -->
  43. <view class='header acea-row row-center-wrapper' >
  44. <!-- #endif -->
  45. <!-- #ifndef APP -->
  46. <view class='header acea-row row-center-wrapper header-box boxcolor'
  47. >
  48. <view class="back-button-1" @tap="handBack()"></view>
  49. <!-- #endif -->
  50. <!-- #ifdef MP -->
  51. <!-- 导航栏 -->
  52. <view :style="{ height: `${navigationBarHeight*2+90}rpx`,lineHeight: `${navigationBarHeight*2+110}rpx`}" class="order-nav">
  53. <text class="box-color-txt">{{merchanInfo.name}}</text>
  54. </view>
  55. <!-- #endif -->
  56. </view>
  57. <!-- #ifdef APP -->
  58. <view class="con-box">
  59. <!-- #endif -->
  60. <!-- #ifndef APP -->
  61. <!--切换点餐还是评价 -->
  62. <view class="let-box">
  63. <view @click="Tabnex(0)" class="let-box1">
  64. <text :class="{ 'actave1': tabindex == 0 }" class="let-txt">点菜</text>
  65. <view :class="{ 'actave': tabindex == 0 }" class="let-line"></view>
  66. </view>
  67. <view @click="Tabnex(1)" class="let-box1">
  68. <text :class="{ 'actave1': tabindex == 1 }" class="let-txt">评价</text>
  69. <view :class="{ 'actave': tabindex == 1 }" class="let-line"></view>
  70. </view>
  71. </view>
  72. <!-- 点餐页面 0是点餐 1是评价-->
  73. <view class="con-box" v-if="tabindex==0">
  74. <!-- #endif -->
  75. <view class='aside'>
  76. <!-- 左侧数据 -->
  77. <scroll-view scroll-y="true" style="height: 100%; overflow: hidden;" scroll-with-animation='true' :scroll-into-view="intoindex">
  78. <view v-for="(item,index) in productList" :key="item.id">
  79. <view class='item acea-row row-center-wrapper' :class='index==navActive?"on":""'
  80. :key="item.id" @click='tap(index,"b"+item.id)' :id='"sort"+index'><text class="item_text skeleton-rect">
  81. {{item.name}}
  82. </text>
  83. </view>
  84. </view>
  85. </scroll-view>
  86. </view>
  87. <!-- 右侧数据 -->
  88. <view class='conter'>
  89. <scroll-view scroll-y="true" :scroll-into-view="toView" style="height: 100%; overflow: hidden;" @scroll="scroll" scroll-with-animation='true'>
  90. <view v-for="(p,i) in productList" :key="p.id" class="nexbox">
  91. <view @click="getOrderdetils(item)" class='listw' :id="'b'+p.id+index" v-for="(item,index) in p.childList" :key="item.id">
  92. <view class='list acea-row'>
  93. <!-- 粘性定位的大类标题 -->
  94. <view v-if="index==0" class="nexbox-txt">{{p.name}}</view>
  95. <block>
  96. <view class='xbox1 row-middle item'
  97. >
  98. <view class='picture skeleton-rect'>
  99. <image class="neximg" mode='aspectFill' :src="item.icon"/>
  100. </view>
  101. <view class='nexbox1'>
  102. <text class="nexbox1-txt">{{item.name}}</text>
  103. <view class="nexbox2">
  104. <text>销量 {{item.sales}}</text>
  105. <text>好评率 {{ item.replyChance*100}}%</text>
  106. </view>
  107. <!-- 价格 加 -->
  108. <view class="nexbox3">
  109. <text class="nexbox-txt3">¥ {{item.price}}</text>
  110. <view class="nexbox4">
  111. <!-- 减 -->
  112. <view v-if="item.sum>0" @click.stop="letloke(item)" class="neximg1">-</view>
  113. <text>{{item.sum}}</text>
  114. <!-- 加 -->
  115. <image @click.stop="Addsum(item)"
  116. class="nexbox-img3"
  117. referrerpolicy="no-referrer"
  118. src="https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/2eb30a58d13a4d218392389a0a61bee4_mergeImage.png"
  119. />
  120. </view>
  121. </view>
  122. </view>
  123. </view>
  124. </block>
  125. </view>
  126. </view>
  127. </view>
  128. <view :style='"height:"+(bottomheight-600)+"rpx;"'></view>
  129. </scroll-view>
  130. </view>
  131. </view>
  132. </view>
  133. <!-- 打开的购物车 -->
  134. <view class="mode" v-if="lockcatble">
  135. <view class="mode-1">
  136. <!-- 判断数量大于0显示 -->
  137. <view class="mode-clear" v-if="getCartGoodsNumber>0">
  138. <text class="mode-txt">数量:<text style="color: #FD6716 ;">({{getCartGoodsNumber}})</text></text>
  139. <text @click="Clery" class="mode-txt1">清空</text>
  140. </view>
  141. <view class="mode-box">
  142. <view class="mode-2" v-for="(item,index) in cart" :key="index">
  143. <image class="mode-img" mode='aspectFill' :src="item.icon"/>
  144. <view class='nexbox1'>
  145. <text class="nexbox1-txt">{{item.name}}</text>
  146. <view class="nexbox2">
  147. <text>销量 {{item.sales}}</text>
  148. <text>好评率 {{ item.replyChance*100}}%</text>
  149. </view>
  150. <!-- 价格 加 -->
  151. <view class="nexbox3">
  152. <text class="nexbox-txt3">¥ {{item.price}}</text>
  153. <view class="nexbox4">
  154. <!-- 减 -->
  155. <view v-if="item.sum>0" @click="letloke(item)" class="neximg1">-</view>
  156. <text>{{item.sum}}</text>
  157. <!-- 加 -->
  158. <image @click="Addsum(item)"
  159. class="nexbox-img3"
  160. referrerpolicy="no-referrer"
  161. src="https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/2eb30a58d13a4d218392389a0a61bee4_mergeImage.png"
  162. />
  163. </view>
  164. </view>
  165. </view>
  166. </view>
  167. <view style="height: 200rpx;">
  168. </view>
  169. </view>
  170. </view>
  171. </view>
  172. <!-- 购物车栏 begin -->
  173. <view v-if="tabindex==0" class="cart-box" style="bottom: 77rpx">
  174. <view class="mark" @click="lockcatble=!lockcatble">
  175. <image src="/static/img/ic-security-settings.png" class="cart-img" @tap=""></image>
  176. <view class="tag" v-if="cart.length > 0">{{ getCartGoodsNumber }}</view>
  177. </view>
  178. <view style="font-weight: 500;font-size: 27rpx;color: #999999;" class="price" v-if="cart.length === 0">配送费2元</view>
  179. <view style="font-weight: 600;font-size: 27rpx;color: #FFFFFF;" class="price" v-else>¥{{ getCartGoodsPrice || 0 }}</view>
  180. <button :style="{backgroundColor: disabledPay ? '#000' : ''}" type="primary" class="pay-btn bg-color" @tap="toPay"
  181. :disabled="disabledPay">
  182. {{ disabledPay ? `差${spread}元起送` : '去结算' }}
  183. </button>
  184. </view>
  185. </view>
  186. </template>
  187. <script>
  188. let app = getApp();
  189. import { getCategoryList } from '@/api/product.js';
  190. import easyLoadimage from '@/components/base/easy-loadimage.vue';
  191. import { mapGetters } from "vuex";
  192. import tuiSkeleton from '@/components/base/tui-skeleton.vue';
  193. import pageFooter from "@/components/pageFooter/index.vue";
  194. import animationType from '@/utils/animationType.js'
  195. // #ifdef MP
  196. import {
  197. getCategoryCacheTree,
  198. getMerchantInfo
  199. } from '../../api/merchant.js'
  200. import {
  201. getMerCollectAddApi,
  202. getMerCollectCancelApi
  203. } from '@/api/merchant.js';
  204. // #endif
  205. let sysHeight = uni.getSystemInfoSync().statusBarHeight;
  206. export default {
  207. components: {
  208. easyLoadimage,
  209. tuiSkeleton,
  210. pageFooter,
  211. // #ifdef MP
  212. // #endif
  213. },
  214. computed:{
  215. getCartGoodsNumber() { //计算购物车总数
  216. return this.cart.reduce((acc, cur) => acc + cur.sum, 0)
  217. },
  218. getCartGoodsPrice() { //计算购物车总价
  219. return this.cart.reduce((acc, cur) => acc + cur.sum * cur.price, 0).toFixed(2)
  220. },
  221. disabledPay() { //是否达到起送价
  222. return this.orderType == 'takeout' && (this.getCartGoodsPrice < this.store.min_price) ? true : false
  223. },
  224. spread() { //差多少元起送
  225. if (this.orderType != 'takeout') return
  226. return parseFloat((this.store.min_price - this.getCartGoodsPrice).toFixed(2))
  227. }
  228. },
  229. data() {
  230. let active = 0;
  231. // #ifdef H5
  232. active = location.hash.substr(1);
  233. // #endif
  234. return {
  235. theme:app.globalData.theme,
  236. showSkeleton: true, //骨架屏显示隐藏
  237. navlist: [],
  238. hotList: [], //推荐分类
  239. sysHeight:sysHeight,
  240. productList: [ //菜品数据
  241. ],
  242. navActive: 0,
  243. activceCate: active,
  244. number: "",
  245. bottomheight: 0,
  246. hightArr: [],
  247. toView: "",
  248. winHeight: 0,
  249. pidIndex: 0,
  250. intoindex: "",
  251. pid: '',
  252. newData: {},
  253. activeRouter: '',
  254. page:1,//当前页
  255. limit:9999,//每页条
  256. Item:'',//跳转这一项数据
  257. merchanInfo:'',//商家信息
  258. navigationBarHeight: '',//导航栏高度
  259. cart: [], //购物车
  260. store: { //起送
  261. min_price: 0.01
  262. },
  263. orderType: 'takeout',
  264. lockcatble:false,//打开的购物车弹窗
  265. navigateUrl:'',//跳转详情路径
  266. tabindex:0,//点菜评价切换
  267. }
  268. },
  269. onLoad(options) {
  270. console.log('options',options)
  271. // 获取设备信息
  272. const systemInfo = uni.getSystemInfoSync();
  273. console.log('设备信息',systemInfo)
  274. // 设置导航栏高度
  275. this.navigationBarHeight = systemInfo.safeArea.top;
  276. let that = this
  277. that.Item=JSON.parse(options.item)
  278. console.log('数据',that.Item)
  279. that.getMerchantInfo()//商家信息
  280. that.getCategoryCacheTree()// // 商家页面-点菜分类
  281. uni.getSystemInfo({
  282. success: function(res) {
  283. that.winHeight = res.windowHeight
  284. },
  285. });
  286. // #ifdef H5
  287. document.body.addEventListener('touchmove', function(event) {
  288. if (that.$route.path == '/pages/goods_cate/goods_cate') {
  289. event.preventDefault();
  290. }
  291. }, {
  292. passive: false
  293. });
  294. // #endif
  295. },
  296. onShow() {
  297. let that = this
  298. let routes = getCurrentPages();
  299. let curRoute = routes[routes.length - 1].route;
  300. this.activeRouter = '/' + curRoute;
  301. if(uni.getStorageSync('cateNavActive')){
  302. this.navActive = uni.getStorageSync('cateNavActive')-1;
  303. uni.removeStorageSync('cateNavActive');
  304. }
  305. if(uni.getStorageSync('categoryId')){
  306. this.pid= uni.getStorageSync('categoryId');
  307. uni.removeStorageSync('categoryId');
  308. }
  309. this.pid && this.navActive && setTimeout(()=>this.tap(this.navActive, 'b' + this.pid), 200);
  310. setTimeout(() => {
  311. uni.removeStorageSync('categoryId');
  312. uni.removeStorageSync('cateNavActive');
  313. }, 300);
  314. },
  315. methods: {
  316. // 收藏接口
  317. getMerCollectAddApi(){
  318. getMerCollectAddApi(this.merchanInfo.id).then(res=>{
  319. console.log('收藏',res)
  320. if(res.code==200){
  321. this.$util.Tips({
  322. title: "收藏成功",
  323. });
  324. this.getMerchantInfo()//商家信息
  325. }
  326. })
  327. },
  328. // 取消收藏
  329. getMerCollectCancelApi(){
  330. getMerCollectCancelApi(this.merchanInfo.id).then(res=>{
  331. console.log()
  332. if(res.code==200){
  333. this.$util.Tips({
  334. title: "取消收藏",
  335. });
  336. this.getMerchantInfo()//商家信息
  337. }
  338. })
  339. },
  340. // 点菜评价切换
  341. Tabnex(index){
  342. this.tabindex=index
  343. },
  344. // 跳转详情
  345. getOrderdetils(item){
  346. console.log(item)
  347. },
  348. // 去结算
  349. toPay() {
  350. uni.showLoading({
  351. title: '加载中'
  352. })
  353. let cartList=JSON.stringify(this.cart)
  354. uni.setStorageSync('cart', JSON.parse(JSON.stringify(this.cart)))
  355. uni.navigateTo({
  356. url: `/pages/goods/order_confirm/index?cartList=${cartList}`
  357. })
  358. uni.hideLoading()
  359. },
  360. // 购物车清空
  361. Clery(){
  362. this.cart=[] //清空购物车数组
  363. // 重新获取
  364. this.getCategoryCacheTree()// // 商家页面-点菜分类
  365. },
  366. // 减少
  367. letloke(item){
  368. console.log('购物车', item);
  369. // 查找 cart 中是否已经有该 item,根据 id 判断
  370. const existingItem = this.cart.find(cartItem => cartItem.id === item.id);
  371. if (existingItem) {
  372. // 如果找到相同 id 的 item,减少数量
  373. if (existingItem.sum > 1) {
  374. existingItem.sum -= 1; // 减少数量
  375. } else {
  376. // 如果数量为 1,则移除该项
  377. existingItem.sum = 0 //赋值0;
  378. const index = this.cart.indexOf(existingItem);
  379. this.cart.splice(index, 1);
  380. }
  381. }
  382. console.log('购物车', this.cart);
  383. },
  384. //商品数量加入购物车
  385. Addsum(item){
  386. // 查找 cart 中是否已经有该 item,根据 id 判断
  387. const existingItem = this.cart.find(cartItem => cartItem.id === item.id);
  388. console.log('这一项',existingItem)
  389. if (existingItem) {
  390. // 如果找到相同 id 的 item,增加数量
  391. existingItem.sum += 1;
  392. } else {
  393. // 如果没有找到该 item,添加到 cart 数组
  394. item.sum = 1; // 初始化数量为 1
  395. this.cart.push(item);
  396. }
  397. console.log('购物车',this.cart)
  398. },
  399. // 减
  400. // 返回
  401. handBack() {
  402. uni.navigateBack({
  403. delta: 1
  404. })
  405. },
  406. // 获取高度
  407. infoScroll: function() {
  408. let that = this;
  409. //设置商品列表高度
  410. uni.getSystemInfo({
  411. success: function(res) {
  412. that.bottomheight = (res.windowHeight) * (750 / res.windowWidth) - 98;
  413. },
  414. });
  415. let hightArr = [];
  416. for (let i = 0; i < that.productList.length; i++) {
  417. let item = that.productList[i]
  418. if(!that.productList[i].childList){
  419. continue;
  420. }
  421. for (let j = 0; j < that.productList[i].childList.length; j++) {
  422. //获取元素所在位置
  423. let query = uni.createSelectorQuery().in(this);
  424. let idView = "#b" + item.id + j;
  425. query.select(idView).boundingClientRect();
  426. query.exec(function(res) {
  427. if(res[0]){
  428. let top = res[0].top;
  429. hightArr.push({top,i});
  430. }
  431. });
  432. };
  433. };
  434. that.hightArr = hightArr;
  435. },
  436. // 左侧点击
  437. tap: function(index, id) {
  438. this.toView = ''+id+0;
  439. this.navActive = index;
  440. setTimeout(()=>{
  441. uni.$emit('scroll');
  442. }, 300);
  443. },
  444. // 获取商家信息
  445. getMerchantInfo(){
  446. getMerchantInfo(this.Item.id).then(res => {
  447. console.log('商家信息',res)
  448. this.merchanInfo = res.data
  449. });
  450. },
  451. // 商家页面-点菜分类
  452. getCategoryCacheTree(){
  453. getCategoryCacheTree(this.Item.id).then(res => {
  454. // console.log('点菜分类数据',res.data)
  455. // 遍历 data 数组
  456. let data=res.data
  457. data.forEach(category => {
  458. if (category.childList && Array.isArray(category.childList)) {
  459. // 给 childList 数组中的每个元素加上 sum 字段
  460. category.childList.forEach(item => {
  461. item.sum = 0; // 你可以根据需要设置sum的初始值
  462. });
  463. }
  464. });
  465. this.productList =data
  466. console.log('处理的数据',this.productList )
  467. //调取滚动
  468. this.$nextTick(function(){
  469. this.infoScroll();
  470. })
  471. this.showSkeleton = false
  472. })
  473. },
  474. // 滚动
  475. scroll: function(e) {
  476. uni.$emit('scroll');
  477. let scrollTop = e.detail.scrollTop + 10;
  478. let scrollArr = this.hightArr;
  479. for (let i = 0; i < scrollArr.length; i++) {
  480. if (scrollTop >= 0 && scrollTop < scrollArr[1].top - scrollArr[0].top) {
  481. this.navActive = 0
  482. } else if (scrollTop >= scrollArr[i].top - scrollArr[0].top && scrollTop < (scrollArr[i + 1] ? scrollArr[i + 1].top : 0) - scrollArr[0].top) {
  483. this.navActive = scrollArr[i].i
  484. } else if (scrollTop >= scrollArr[scrollArr.length - 1].top - scrollArr[0].top) {
  485. this.navActive = scrollArr[scrollArr.length - 1].i
  486. }
  487. }
  488. },
  489. }
  490. }
  491. </script>
  492. <style scoped lang="scss">
  493. /deep/.origin-img{
  494. border-radius: 50%;
  495. }
  496. .productSort {
  497. display: flex;
  498. flex-direction: column;
  499. width: 100%;
  500. .con-box {
  501. flex: 1;
  502. display: flex;
  503. overflow: hidden;
  504. }
  505. }
  506. .productSort .header {
  507. width: 100%;
  508. /* #ifndef MP */
  509. height: 96rpx;
  510. /* #endif */
  511. // background-color: #fff;
  512. border-bottom: 1rpx solid #f5f5f5;
  513. }
  514. .productSort .header .input {
  515. width: 700rpx;
  516. height: 60rpx;
  517. background-color: #f5f5f5;
  518. border-radius: 50rpx;
  519. box-sizing: border-box;
  520. padding: 0 25rpx;
  521. }
  522. .productSort .header .input .iconfont {
  523. font-size: 28rpx;
  524. color: #555;
  525. }
  526. .productSort .header .input .placeholder {
  527. color: #999;
  528. }
  529. .productSort .header .input input {
  530. font-size: 28rpx;
  531. height: 100%;
  532. width: 597rpx;
  533. }
  534. .productSort .header .input .input-box {
  535. display: flex;
  536. align-items: center;
  537. font-size: 28rpx;
  538. height: 100%;
  539. width: 597rpx;
  540. color: #999999;
  541. }
  542. .productSort .aside {
  543. background-color: #fff;
  544. overflow-y: auto;
  545. overflow-x: hidden;
  546. width: 200rpx;
  547. height: 100%;
  548. overflow: hidden;
  549. }
  550. .productSort .aside .item {
  551. height: 100rpx;
  552. width: 100%;
  553. font-size: 26rpx;
  554. color: #424242;
  555. }
  556. .productSort .aside .item_text {
  557. padding-left: 20rpx;
  558. overflow: hidden;
  559. text-overflow: ellipsis;
  560. display: -webkit-box;
  561. -webkit-line-clamp: 2;
  562. -webkit-box-orient: vertical;
  563. }
  564. .productSort .aside .item.on {
  565. background-color: #f7f7f7;
  566. color: #333;
  567. border-left: 4rpx solid var(--view-theme);
  568. width: 100%;
  569. text-align: center;
  570. @include main_color(theme);
  571. font-weight: bold;
  572. }
  573. .productSort .conter {
  574. flex: 1;
  575. height: 100%;
  576. padding: 0 14rpx;
  577. background-color: #f7f7f7;
  578. }
  579. .productSort .conter .listw .title {
  580. height: 100rpx;
  581. align-items: center;
  582. }
  583. .productSort .conter .listw .title .line {
  584. width: 100rpx;
  585. height: 2rpx;
  586. background-color: #f0f0f0;
  587. }
  588. .productSort .conter .listw .title .name {
  589. font-size: 28rpx;
  590. color: #333;
  591. margin: 0 30rpx;
  592. font-weight: bold;
  593. }
  594. .productSort .conter .listw .title .list_title,
  595. .productSort .conter .listw .title uni-image,
  596. .productSort .conter .listw .title image{
  597. width: 110rpx;
  598. height: 26rpx;
  599. border-radius: 0;
  600. }
  601. .productSort .conter .list {
  602. flex-wrap: wrap;
  603. background: #fff;
  604. border-radius: 16rpx;
  605. padding-bottom: 26rpx;
  606. }
  607. .productSort .conter .list .item {
  608. // width: 174rpx;
  609. margin-top: 26rpx;
  610. display: flex;
  611. align-items: center;
  612. }
  613. .productSort .conter .list .item .picture,
  614. .productSort .conter uni-image,
  615. .productSort .conter .list .item image,
  616. /deep/.easy-loadimage{
  617. width: 110rpx;
  618. height: 110rpx;
  619. }
  620. .productSort .conter .list .item .name {
  621. font-size: 24rpx;
  622. color: #333;
  623. height: 56rpx;
  624. line-height: 56rpx;
  625. width: 120rpx;
  626. text-align: center;
  627. }
  628. .header-box{
  629. position: fixed;
  630. z-index: 9999;
  631. }
  632. // 新的功能板块
  633. .box-top{
  634. padding: 20rpx;
  635. box-sizing: border-box;
  636. display: flex;
  637. flex-direction: column;
  638. gap: 20rpx;
  639. background-color: #fff;
  640. border-top-left-radius:30rpx ;
  641. border-top-right-radius: 30rpx;
  642. }
  643. .box-top1{
  644. display: flex;
  645. align-items: center;
  646. justify-content: space-between;
  647. }
  648. .box-txt{
  649. overflow-wrap: break-word;
  650. color: rgba(20, 20, 20, 1);
  651. font-size: 36rpx;
  652. font-family: PingFangSC-Semibold;
  653. font-weight: 600;
  654. text-align: left;
  655. white-space: nowrap;
  656. line-height: 50rpx;
  657. }
  658. .box-pin{
  659. display: flex;
  660. align-items: center;
  661. gap: 10rpx;
  662. }
  663. .box-txt2{
  664. overflow-wrap: break-word;
  665. color: rgba(253, 103, 22, 1);
  666. font-size: 28rpx;
  667. font-family: PingFangSC-Semibold;
  668. font-weight: 600;
  669. text-align: left;
  670. white-space: nowrap;
  671. line-height: 40rpx;
  672. }
  673. .box-txt3{
  674. overflow-wrap: break-word;
  675. color: rgba(153, 153, 153, 1);
  676. font-size: 22rpx;
  677. font-family: PingFangSC-Medium;
  678. font-weight: 500;
  679. text-align: left;
  680. white-space: nowrap;
  681. line-height: 32rpx;
  682. margin-top: 6rpx;
  683. }
  684. .box-shopp{
  685. overflow-wrap: break-word;
  686. color: rgba(20, 20, 20, 1);
  687. font-size: 24rpx;
  688. font-family: PingFangSC-Regular;
  689. font-weight: normal;
  690. text-align: left;
  691. white-space: nowrap;
  692. line-height: 34rpx;
  693. }
  694. .box-newtxt{
  695. background: #F8F9FB ;
  696. padding: 10rpx;
  697. box-sizing: border-box;
  698. overflow-wrap: break-word;
  699. color: rgba(133, 134, 135, 1);
  700. font-size: 22rpx;
  701. font-family: PingFangSC-Regular;
  702. font-weight: normal;
  703. text-align: left;
  704. white-space: nowrap;
  705. line-height: 32rpx;
  706. display: flex;
  707. align-items: center;
  708. gap: 6rpx;
  709. height: 60rpx;
  710. position: relative;
  711. }
  712. .boxcolor{
  713. background-color: #FF6702;
  714. }
  715. .box-color-txt{
  716. overflow-wrap: break-word;
  717. color: rgba(255, 255, 255, 1);
  718. font-size: 36rpx;
  719. font-family: PingFangSC-Medium;
  720. font-weight: 500;
  721. text-align: center;
  722. white-space: nowrap;
  723. }
  724. .back-button-1 {
  725. position: absolute;
  726. left: 20rpx;
  727. font-size: 30px; /* 设置箭头的大小 */
  728. color: #000; /* 设置箭头颜色 */
  729. width: 40px; /* 按钮的宽度 */
  730. height: 40px; /* 按钮的高度 */
  731. background-color: transparent; /* 背景透明 */
  732. border-radius: 50%; /* 圆形按钮 */
  733. cursor: pointer; /* 鼠标悬停时显示手指 */
  734. }
  735. .back-button-1::before {
  736. content: '<'; /* 设置按钮的内容为 "<" */
  737. font-size: 30px; /* 设置箭头符号的大小 */
  738. color: #000; /* 设置箭头颜色 */
  739. }
  740. .nexbox{
  741. background: #FFF;
  742. box-sizing: border-box;
  743. display: flex;
  744. flex-direction: column;
  745. gap: 10rpx;
  746. }
  747. .nexbox-txt{
  748. width: 100%;
  749. position: sticky;
  750. top: -2rpx;
  751. z-index: 99;
  752. background: #fff;
  753. box-sizing: border-box;
  754. height: 50rpx;
  755. display: flex;
  756. align-items: center;
  757. padding-left: 20rpx;
  758. color: #fd6716;
  759. }
  760. .row-middle{
  761. width: 100%;
  762. display: flex;
  763. justify-content: space-between;
  764. }
  765. .nexbox1{
  766. display: flex;
  767. flex-direction: column;
  768. gap: 15rpx;
  769. width: 70%;
  770. }
  771. .neximg{
  772. width: 25%;
  773. height: 100%;
  774. flex-shrink: 0;
  775. object-fit: contain; /* 保持图片等比例缩放,并且不会裁切 */
  776. }
  777. .nexbox1-txt{
  778. overflow-wrap: break-word;
  779. color: rgba(20, 20, 20, 1);
  780. font-size: 32rpx;
  781. font-family: PingFangSC-Semibold;
  782. font-weight: 600;
  783. white-space: nowrap;
  784. line-height: 44rpx;
  785. }
  786. .nexbox2{
  787. display: flex;
  788. align-items: center;
  789. gap: 20rpx;
  790. overflow-wrap: break-word;
  791. color: rgba(100, 100, 100, 1);
  792. font-size: 22rpx;
  793. font-family: PingFangSC-Regular;
  794. font-weight: normal;
  795. text-align: left;
  796. white-space: nowrap;
  797. line-height: 32rpx;
  798. }
  799. .nexbox3{
  800. display: flex;
  801. align-items: center;
  802. justify-content: space-between;
  803. }
  804. .nexbox-txt3{
  805. overflow-wrap: break-word;
  806. color: rgba(255, 152, 5, 1);
  807. font-size: 28rpx;
  808. font-family: PingFangSC-Semibold;
  809. font-weight: 600;
  810. white-space: nowrap;
  811. line-height: 40rpx;
  812. }
  813. .nexbox-img3{
  814. width: 36rpx !important;
  815. height: 36rpx !important;
  816. }
  817. .nexbox4{
  818. display: flex;
  819. align-items: center;
  820. gap: 20rpx;
  821. line-height: 18rpx;
  822. }
  823. .neximg1{
  824. width: 36rpx;
  825. height: 36rpx;
  826. background: #FFFFFF;
  827. border: 1px solid #FF6702;
  828. color: #FF6702;
  829. border-radius: 60%;
  830. display: flex;
  831. align-items: center;
  832. justify-content: center;
  833. }
  834. // 购物车
  835. .cart-box {
  836. position: absolute;
  837. // bottom: 30rpx;
  838. left: 30rpx;
  839. right: 30rpx;
  840. height: 96rpx;
  841. border-radius: 48rpx;
  842. box-shadow: 0 0 20rpx rgba(0, 0, 0, 0.2);
  843. background-color: #000;
  844. display: flex;
  845. align-items: center;
  846. justify-content: space-between;
  847. z-index: 9999;
  848. .cart-img {
  849. width: 50rpx;
  850. height: 47rpx;
  851. position: relative;
  852. // margin-top: -48rpx;
  853. }
  854. .pay-btn {
  855. height: 100%;
  856. padding: 0 30rpx;
  857. color: #FFFFFF;
  858. border-radius: 0 50rpx 50rpx 0;
  859. display: flex;
  860. align-items: center;
  861. font-size: $font-size-base;
  862. }
  863. .mark {
  864. padding-left: 46rpx;
  865. margin-right: 30rpx;
  866. position: relative;
  867. .tag {
  868. background-color: $color-warning;
  869. color: $text-color-white;
  870. display: flex;
  871. justify-content: center;
  872. align-items: center;
  873. font-size: $font-size-sm;
  874. position: absolute;
  875. right: -13rpx;
  876. top: -20rpx;
  877. border-radius: 100%;
  878. padding: 4rpx;
  879. width: 27rpx;
  880. height: 27rpx;
  881. opacity: .9;
  882. }
  883. }
  884. .price {
  885. flex: 1;
  886. color: $text-color-base;
  887. }
  888. }
  889. .cart-popup {
  890. .top {
  891. background-color: $bg-color-primary;
  892. color: $color-primary;
  893. padding: 10rpx 30rpx;
  894. font-size: 24rpx;
  895. text-align: right;
  896. }
  897. .cart-list {
  898. background-color: #FFFFFF;
  899. width: 100%;
  900. overflow: hidden;
  901. min-height: 1vh;
  902. max-height: 60vh;
  903. .wrapper {
  904. height: 100%;
  905. display: flex;
  906. flex-direction: column;
  907. padding: 0 30rpx;
  908. margin-bottom: 156rpx;
  909. .item {
  910. display: flex;
  911. justify-content: space-between;
  912. align-items: center;
  913. padding: 30rpx 0;
  914. position: relative;
  915. &::after {
  916. content: ' ';
  917. position: absolute;
  918. bottom: 0;
  919. left: 0;
  920. width: 100%;
  921. background-color: $border-color;
  922. height: 2rpx;
  923. transform: scaleY(.6);
  924. }
  925. .left {
  926. flex: 1;
  927. display: flex;
  928. flex-direction: column;
  929. overflow: hidden;
  930. margin-right: 30rpx;
  931. .name {
  932. font-size: $font-size-sm;
  933. color: $text-color-base;
  934. }
  935. .props {
  936. color: $text-color-assist;
  937. font-size: 24rpx;
  938. overflow: hidden;
  939. text-overflow: ellipsis;
  940. white-space: nowrap;
  941. }
  942. }
  943. .center {
  944. margin-right: 120rpx;
  945. font-size: $font-size-base;
  946. }
  947. .right {
  948. display: flex;
  949. align-items: center;
  950. justify-content: space-between;
  951. .btn {
  952. width: 46rpx;
  953. height: 46rpx;
  954. border-radius: 100%;
  955. padding: 0;
  956. text-align: center;
  957. line-height: 46rpx;
  958. }
  959. .number {
  960. font-size: $font-size-base;
  961. width: 46rpx;
  962. height: 46rpx;
  963. text-align: center;
  964. line-height: 46rpx;
  965. }
  966. }
  967. }
  968. }
  969. }
  970. }
  971. .back-button {
  972. width: 30rpx;
  973. height: 30rpx;
  974. border-right: 4rpx solid #fff;
  975. border-bottom: 4rpx solid #fff;
  976. transform: rotate(135deg);
  977. margin-left: 10rpx;
  978. display: inline-block;
  979. position: relative;
  980. }
  981. .newsTitle {
  982. display: flex;
  983. align-items: center;
  984. }
  985. // 购物车弹窗
  986. .mode{
  987. position: fixed;
  988. width: 100%;
  989. height: 100%;
  990. left: 0;
  991. top: 0;
  992. background: rgba(33, 33, 33, 0.8);
  993. z-index: 999;
  994. display: flex;
  995. align-items: flex-end;
  996. }
  997. .mode-1{
  998. width: 100%;
  999. height: 840rpx;
  1000. background: #FFF;
  1001. display: flex;
  1002. flex-direction: column;
  1003. gap: 20rpx;
  1004. // padding: 30rpx;
  1005. box-sizing: border-box;
  1006. overflow: auto; /* 添加这个属性使容器可以滚动 */
  1007. }
  1008. .mode-box{
  1009. width: 100%;
  1010. display: flex;
  1011. flex-direction: column;
  1012. gap: 20rpx;
  1013. padding: 30rpx;
  1014. box-sizing: border-box;
  1015. }
  1016. .mode-2{
  1017. width: 100%;
  1018. height: 200rpx;
  1019. display: flex;
  1020. align-items: center;
  1021. justify-content: space-between;
  1022. }
  1023. .mode-img{
  1024. border-radius: 5%;
  1025. width: 25%;
  1026. height: 150rpx;
  1027. flex-shrink: 0;
  1028. object-fit: contain; /* 保持图片等比例缩放,并且不会裁切 */
  1029. }
  1030. .mode-clear{
  1031. padding: 30rpx;
  1032. box-sizing: border-box;
  1033. position: sticky;
  1034. z-index: 99;
  1035. top: 0;
  1036. display: flex;
  1037. justify-content: space-between;
  1038. align-items: center;
  1039. background: #FFF;
  1040. border-bottom: 1px solid burlywood;
  1041. }
  1042. .mode-txt{
  1043. display: flex;
  1044. align-items: center;
  1045. gap: 8rpx;
  1046. }
  1047. .mode-txt1{
  1048. font-weight: 500;
  1049. font-size: 32rpx;
  1050. }
  1051. // 盒子
  1052. .xbox1{
  1053. margin-top: 26rpx;
  1054. display: flex;
  1055. align-items: center;
  1056. width: 100%;
  1057. justify-content: space-between;
  1058. }
  1059. // 点菜评价切换
  1060. .let-box{
  1061. display: flex;
  1062. align-items: center;
  1063. gap: 60rpx;
  1064. padding: 20rpx;
  1065. box-sizing: border-box;
  1066. }
  1067. .let-box1{
  1068. display: flex;
  1069. flex-direction: column;
  1070. align-items: center;
  1071. justify-content: center;
  1072. gap: 10rpx;
  1073. }
  1074. .let-line{
  1075. border-radius: 6rpx;
  1076. width: 40rpx;
  1077. height: 10rpx;
  1078. }
  1079. .let-txt{
  1080. overflow-wrap: break-word;
  1081. color: rgba(20, 20, 20, 1);
  1082. font-size: 28rpx;
  1083. font-weight: normal;
  1084. text-align: left;
  1085. white-space: nowrap;
  1086. line-height: 40rpx;
  1087. }
  1088. .actave{
  1089. background-color: rgba(255, 103, 2, 1);
  1090. }
  1091. .actave1{
  1092. color: rgba(255, 103, 2, 1);
  1093. }
  1094. .icon-img{
  1095. width: 40rpx;
  1096. height: 40rpx;
  1097. flex-shrink: 0;
  1098. }
  1099. </style>