index.vue 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480
  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. <!-- 温馨提示 -->
  73. <view class="cboxtxt">———— 温馨提示:适度选择,避免浪费 ———— </view>
  74. <!-- 点餐页面 0是点餐 1是评价-->
  75. <view class="con-box" v-if="tabindex==0">
  76. <!-- #endif -->
  77. <view class='aside'>
  78. <!-- 左侧数据 -->
  79. <scroll-view scroll-y="true" style="height: 100%; overflow: hidden;" scroll-with-animation='true' :scroll-into-view="intoindex">
  80. <view v-for="(item,index) in productList" :key="item.id">
  81. <view class='nbox item acea-row row-center-wrapper' :class='index==navActive?"on":""'
  82. :key="item.id" @click='tap(index,"b"+item.id)' :id='"sort"+index'><text class="item_text skeleton-rect">
  83. {{item.name}}
  84. </text>
  85. <text v-if="calculateSum(item.childList)>0" style="top:8rpx; " class="xun-txt">{{ calculateSum(item.childList) }}</text>
  86. </view>
  87. </view>
  88. </scroll-view>
  89. </view>
  90. <!-- 右侧数据 -->
  91. <view class='conter'>
  92. <scroll-view scroll-y="true" :scroll-into-view="toView" style="height: 100%; overflow: hidden;" @scroll="scroll" scroll-with-animation='true'>
  93. <view v-for="(p,i) in productList" :key="p.id" class="nexbox">
  94. <view @click="getOrderdetils(item)" class='listw' :id="'b'+p.id+index" v-for="(item,index) in p.childList" :key="item.id">
  95. <view class='list acea-row'>
  96. <!-- 粘性定位的大类标题 -->
  97. <view v-if="index==0" class="nexbox-txt">{{p.name}}</view>
  98. <block>
  99. <view class='xbox1 row-middle item'
  100. >
  101. <view class='picture skeleton-rect'>
  102. <image class="neximg" mode='aspectFill' :src="item.icon"/>
  103. </view>
  104. <view class='nexbox1'>
  105. <text class="nexbox1-txt">{{item.name}}</text>
  106. <view class="nexbox2">
  107. <text>销量 {{item.sales}}</text>
  108. <text>好评率 {{ item.replyChance*100}}%</text>
  109. </view>
  110. <!-- 价格 加 -->
  111. <view class="nexbox3">
  112. <text class="nexbox-txt3">¥ {{item.price}}</text>
  113. <!-- 选规格 -->
  114. <view @click.stop="Selectpox(item)" class="xu-btn">选规格
  115. <text v-if="item.sum>0" class="xun-txt">{{item.sum}}</text>
  116. </view>
  117. <!-- <view class="nexbox4"> -->
  118. <!-- 减 -->
  119. <!-- <view v-if="item.sum>0" @click.stop="letloke(item)" class="neximg1">-</view> -->
  120. <!-- <text>{{item.sum}}</text> -->
  121. <!-- 加 -->
  122. <!-- <image @click.stop="Addsum(item)"
  123. class="nexbox-img3"
  124. referrerpolicy="no-referrer"
  125. src="https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/2eb30a58d13a4d218392389a0a61bee4_mergeImage.png"
  126. /> -->
  127. <!-- </view> -->
  128. </view>
  129. </view>
  130. </view>
  131. </block>
  132. </view>
  133. </view>
  134. </view>
  135. <view :style='"height:"+(bottomheight-600)+"rpx;"'></view>
  136. </scroll-view>
  137. </view>
  138. </view>
  139. </view>
  140. <!-- 打开的购物车 -->
  141. <view class="mode" v-if="lockcatble">
  142. <view class="mode-1">
  143. <!-- 判断数量大于0显示 -->
  144. <view class="mode-clear" v-if="getCartGoodsNumber>0">
  145. <text class="mode-txt">数量:<text style="color: #FD6716 ;">({{getCartGoodsNumber}})</text></text>
  146. <text @click="Clery" class="mode-txt1">清空</text>
  147. </view>
  148. <view class="mode-box">
  149. <view class="mode-2" v-for="(item,index) in cart" :key="index">
  150. <image class="mode-img" mode='aspectFill' :src="item.icon"/>
  151. <view class='nexbox1'>
  152. <text class="nexbox1-txt">{{item.name}}</text>
  153. <view class="nexbox2">
  154. <text>销量 {{item.sales}}</text>
  155. <text>好评率 {{ item.replyChance*100}}%</text>
  156. </view>
  157. <!-- 价格 加 -->
  158. <view class="nexbox3">
  159. <text class="nexbox-txt3">¥ {{item.price}}</text>
  160. <view class="nexbox4">
  161. <!-- 减 -->
  162. <view v-if="item.sum>0" @click="letloke(item)" class="neximg1">-</view>
  163. <text>{{item.sum}}</text>
  164. <!-- 加 -->
  165. <image @click="Addsum(item)"
  166. class="nexbox-img3"
  167. referrerpolicy="no-referrer"
  168. src="https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/2eb30a58d13a4d218392389a0a61bee4_mergeImage.png"
  169. />
  170. </view>
  171. </view>
  172. </view>
  173. </view>
  174. <view style="height: 200rpx;">
  175. </view>
  176. </view>
  177. </view>
  178. </view>
  179. <!-- 购物车栏 begin -->
  180. <view v-if="tabindex==0&&!selectble" class="cart-box" style="bottom: 77rpx">
  181. <view class="mark" @click="lockcatble=!lockcatble">
  182. <image src="/static/img/ic-security-settings.png" class="cart-img" @tap=""></image>
  183. <view class="tag" v-if="cart.length > 0">{{ getCartGoodsNumber }}</view>
  184. </view>
  185. <view style="font-weight: 500;font-size: 27rpx;color: #999999;" class="price" v-if="cart.length === 0">配送费2元</view>
  186. <view style="font-weight: 600;font-size: 27rpx;color: #FFFFFF;" class="price" v-else>¥{{ getCartGoodsPrice || 0 }}</view>
  187. <button :style="{backgroundColor: disabledPay ? '#000' : ''}" type="primary" class="pay-btn bg-color" @tap="toPay"
  188. :disabled="disabledPay">
  189. {{ disabledPay ? `差${spread}元起送` : '去结算' }}
  190. </button>
  191. </view>
  192. <!-- 规格弹窗 -->
  193. <view class="mode" v-if="selectble">
  194. <view class="sel-mode-1">
  195. <view class="close" @click="Close">X</view>
  196. <view class="sel-2">
  197. <image class="neximg" :src="specifications.icon"/>
  198. <view class="nexbox1">
  199. <text>销量 {{specifications.sales}}</text>
  200. <text>好评率 {{ specifications.replyChance*100}}%</text>
  201. <text class="nexbox-txt3">¥ {{specifications.price}}</text>
  202. </view>
  203. </view>
  204. <!--规格数组 -->
  205. <view class="sel-3">
  206. <text>规格</text>
  207. <view class="sel-4">
  208. <view class="sel-5"
  209. @click="xubox(item.productId)"
  210. :style="{background: item.productId == productid ? '#ff9805' : ''}"
  211. v-for="(item,index) in productValue" :key="index">
  212. {{item.optionName}}
  213. </view>
  214. </view>
  215. </view>
  216. <!-- 数量 -->
  217. <view class="sel-6">
  218. <text>数量</text>
  219. <view class="nexbox4">
  220. <!-- 减 -->
  221. <view v-if="specifications.sum>0" @click="selectletloke()" class="neximg1">-</view>
  222. <text>{{specifications.sum}}</text>
  223. <!-- 加 -->
  224. <image @click="selectAddsum()"
  225. class="nexbox-img3"
  226. referrerpolicy="no-referrer"
  227. src="https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/2eb30a58d13a4d218392389a0a61bee4_mergeImage.png"
  228. />
  229. </view>
  230. </view>
  231. <!-- 加入购物车 -->
  232. <view class="sel-btn">
  233. <view @click="Addshoppcat" class="sel-btn1">加入购物车</view>
  234. </view>
  235. </view>
  236. </view>
  237. </view>
  238. </template>
  239. <script>
  240. let app = getApp();
  241. import { getCategoryList,getProductDetail } from '@/api/product.js';
  242. import easyLoadimage from '@/components/base/easy-loadimage.vue';
  243. import { mapGetters } from "vuex";
  244. import tuiSkeleton from '@/components/base/tui-skeleton.vue';
  245. import pageFooter from "@/components/pageFooter/index.vue";
  246. import animationType from '@/utils/animationType.js'
  247. // #ifdef MP
  248. import {
  249. getCategoryCacheTree,
  250. getMerchantInfo
  251. } from '../../api/merchant.js'
  252. import {
  253. getMerCollectAddApi,
  254. getMerCollectCancelApi
  255. } from '@/api/merchant.js';
  256. // 订单创建
  257. import {
  258. orderCreate,
  259. preOrderApi
  260. } from '@/api/order.js';
  261. // #endif
  262. let sysHeight = uni.getSystemInfoSync().statusBarHeight;
  263. export default {
  264. components: {
  265. easyLoadimage,
  266. tuiSkeleton,
  267. pageFooter,
  268. // #ifdef MP
  269. // #endif
  270. },
  271. computed:{
  272. getCartGoodsNumber() { //计算购物车总数
  273. return this.cart.reduce((acc, cur) => acc + cur.sum, 0)
  274. },
  275. getCartGoodsPrice() { //计算购物车总价
  276. return this.cart.reduce((acc, cur) => acc + cur.sum * cur.price, 0).toFixed(2)
  277. },
  278. disabledPay() { //是否达到起送价
  279. return this.orderType == 'takeout' && (this.getCartGoodsPrice < this.store.min_price) ? true : false
  280. },
  281. spread() { //差多少元起送
  282. if (this.orderType != 'takeout') return
  283. return parseFloat((this.store.min_price - this.getCartGoodsPrice).toFixed(2))
  284. }
  285. },
  286. data() {
  287. let active = 0;
  288. // #ifdef H5
  289. active = location.hash.substr(1);
  290. // #endif
  291. return {
  292. theme:app.globalData.theme,
  293. showSkeleton: true, //骨架屏显示隐藏
  294. navlist: [],
  295. hotList: [], //推荐分类
  296. sysHeight:sysHeight,
  297. productList: [ //菜品数据
  298. ],
  299. navActive: 0,
  300. activceCate: active,
  301. number: "",
  302. bottomheight: 0,
  303. hightArr: [],
  304. toView: "",
  305. winHeight: 0,
  306. pidIndex: 0,
  307. intoindex: "",
  308. pid: '',
  309. newData: {},
  310. activeRouter: '',
  311. page:1,//当前页
  312. limit:9999,//每页条
  313. Item:'',//跳转这一项数据
  314. merchanInfo:'',//商家信息
  315. navigationBarHeight: '',//导航栏高度
  316. cart: [], //购物车
  317. store: { //起送
  318. min_price: 0.01
  319. },
  320. orderType: 'takeout',
  321. lockcatble:false,//打开的购物车弹窗
  322. navigateUrl:'',//跳转详情路径
  323. tabindex:0,//点菜评价切换
  324. specifications:'',//点击的这一项菜品信息
  325. selectble:false,//规格弹窗
  326. productValue:[],//规格数组
  327. productid:'',//选中规格的id
  328. }
  329. },
  330. onLoad(options) {
  331. console.log('options',options)
  332. // 获取设备信息
  333. const systemInfo = uni.getSystemInfoSync();
  334. console.log('设备信息',systemInfo)
  335. // 设置导航栏高度
  336. this.navigationBarHeight = systemInfo.safeArea.top;
  337. let that = this
  338. that.Item=options.id
  339. console.log('数据',that.Item)
  340. that.getMerchantInfo()//商家信息
  341. that.getCategoryCacheTree()// // 商家页面-点菜分类
  342. uni.getSystemInfo({
  343. success: function(res) {
  344. that.winHeight = res.windowHeight
  345. },
  346. });
  347. // #ifdef H5
  348. document.body.addEventListener('touchmove', function(event) {
  349. if (that.$route.path == '/pages/goods_cate/goods_cate') {
  350. event.preventDefault();
  351. }
  352. }, {
  353. passive: false
  354. });
  355. // #endif
  356. },
  357. onShow() {
  358. let that = this
  359. let routes = getCurrentPages();
  360. let curRoute = routes[routes.length - 1].route;
  361. this.activeRouter = '/' + curRoute;
  362. if(uni.getStorageSync('cateNavActive')){
  363. this.navActive = uni.getStorageSync('cateNavActive')-1;
  364. uni.removeStorageSync('cateNavActive');
  365. }
  366. if(uni.getStorageSync('categoryId')){
  367. this.pid= uni.getStorageSync('categoryId');
  368. uni.removeStorageSync('categoryId');
  369. }
  370. this.pid && this.navActive && setTimeout(()=>this.tap(this.navActive, 'b' + this.pid), 200);
  371. setTimeout(() => {
  372. uni.removeStorageSync('categoryId');
  373. uni.removeStorageSync('cateNavActive');
  374. }, 300);
  375. },
  376. methods: {
  377. // 方法用于计算 childList 数组中的 sum 总和
  378. calculateSum(childList) {
  379. return childList.reduce((total, item) => total + (item.sum || 0), 0);
  380. },
  381. // 收藏接口
  382. getMerCollectAddApi(){
  383. // 商户id
  384. getMerCollectAddApi(this.merchanInfo.merId).then(res=>{
  385. console.log('收藏',res)
  386. if(res.code==200){
  387. this.$util.Tips({
  388. title: "收藏成功",
  389. });
  390. this.getMerchantInfo()//商家信息
  391. }
  392. })
  393. },
  394. // 取消收藏
  395. getMerCollectCancelApi(){
  396. getMerCollectCancelApi(this.merchanInfo.merId).then(res=>{
  397. console.log()
  398. if(res.code==200){
  399. this.$util.Tips({
  400. title: "取消收藏",
  401. });
  402. this.getMerchantInfo()//商家信息
  403. }
  404. })
  405. },
  406. // 点菜评价切换
  407. Tabnex(index){
  408. this.tabindex=index
  409. },
  410. // 跳转详情
  411. getOrderdetils(item){
  412. console.log(item)
  413. uni.navigateTo({
  414. url:`/pages/goods/goods_details/index?id=${item.id}&mt=0`
  415. })
  416. },
  417. // 去结算
  418. toPay() {
  419. uni.showLoading({
  420. title: '加载中'
  421. })
  422. let orderDetails = this.cart.map((item) => {
  423. return {
  424. attrValueId: 2819, //商品规格属性id(立即购买、活动购买必填)
  425. groupBuyActivityId: null,//拼团活动id(拼团下单时必填)
  426. groupBuyRecordId: 0, // 拼团记录id,营销类型2=拼团 时必填 0=开团 实际
  427. productId: item.id, //商品id
  428. productNum: item.sum //商品数量
  429. };
  430. });
  431. preOrderApi({
  432. "preOrderType": 'buyNow',
  433. //类型 预下单类型(“shoppingCart”:购物车下单,“buyNow”:
  434. // 立即购买,“video”: 视频号商品下单,“seckill”:秒杀下单,“group”:拼团下单)
  435. "orderDetails": orderDetails //购物车信息
  436. }).then(res=>{
  437. console.log('预下单接口',res)
  438. if(res.code==200){
  439. let cartList=JSON.stringify(this.cart)
  440. uni.setStorageSync('cart', JSON.parse(JSON.stringify(this.cart)))
  441. uni.navigateTo({
  442. // url: `/pages/goods/order_confirm/index?cartList=${cartList}`
  443. url: '/pages/goods/order_confirm/index?orderNo=' + res.data.orderNo
  444. })
  445. }
  446. })
  447. uni.hideLoading() //关闭动画
  448. },
  449. // 购物车清空
  450. Clery(){
  451. this.cart=[] //清空购物车数组
  452. // 重新获取
  453. this.getCategoryCacheTree()// // 商家页面-点菜分类
  454. },
  455. // 选规格打开
  456. Selectpox(item){
  457. this.specifications=item //这一项信息
  458. this.selectble=true
  459. getProductDetail(
  460. item.id,
  461. 0,0, ''
  462. ).then((res)=>{
  463. console.log('规格',res)
  464. if(res.code==200){
  465. this.productValue=res.data.productAttr[0].optionList //规格数组
  466. this.productid=res.data.productValue.默认.productId //默认选择的id
  467. console.log('id',this.productid)
  468. }
  469. })
  470. },
  471. // 关闭规格
  472. Close(){
  473. console.log(11)
  474. this.selectble=false
  475. this.cart=[]//清空购物车
  476. // 重新获取
  477. this.getCategoryCacheTree()// // 商家页面-点菜分类
  478. },
  479. // 规格选择
  480. xubox(id){
  481. if(this.productid==''){
  482. this.productid=id
  483. }else{
  484. this.productid=''
  485. }
  486. },
  487. // 规格加
  488. selectAddsum(){
  489. this.specifications.sum+=1
  490. },
  491. // 规格减少
  492. selectletloke(){
  493. this.specifications.sum-=1
  494. },
  495. // 规格加入购物车
  496. Addshoppcat(){
  497. if(this.productid==''){
  498. uni.showToast({
  499. title: '请选择规格', // 提示的文本
  500. icon: 'none', // 不显示图标
  501. duration: 2000 // 提示框显示的时间,单位是毫秒
  502. });
  503. return; // 阻止继续执行
  504. }
  505. if(this.specifications.sum==0){
  506. uni.showToast({
  507. title: '请加入商品数量', // 提示的文本
  508. icon: 'none', // 不显示图标
  509. duration: 2000 // 提示框显示的时间,单位是毫秒
  510. });
  511. return; // 阻止继续执行
  512. }
  513. // 便利数组
  514. // 遍历 productList,筛选出 sum > 0 的项并推入 cart 数组
  515. this.productList.forEach(item => {
  516. item.childList.forEach(child => {
  517. if (child.sum > 0 && !this.cart.some(cartItem => cartItem.id === child.id)) {
  518. this.cart.push(child); // 将 sum > 0 且 id 不重复的项推入 cart
  519. }
  520. });
  521. })
  522. console.log('购物车数组',this.cart)
  523. this.selectble=false
  524. },
  525. // 减少
  526. letloke(item){
  527. console.log('购物车', item);
  528. // 查找 cart 中是否已经有该 item,根据 id 判断
  529. const existingItem = this.cart.find(cartItem => cartItem.id === item.id);
  530. if (existingItem) {
  531. // 如果找到相同 id 的 item,减少数量
  532. if (existingItem.sum > 1) {
  533. existingItem.sum -= 1; // 减少数量
  534. } else {
  535. // 如果数量为 1,则移除该项
  536. existingItem.sum = 0 //赋值0;
  537. const index = this.cart.indexOf(existingItem);
  538. this.cart.splice(index, 1);
  539. }
  540. }
  541. console.log('购物车', this.cart);
  542. },
  543. //商品数量加入购物车
  544. Addsum(item){
  545. // 查找 cart 中是否已经有该 item,根据 id 判断
  546. const existingItem = this.cart.find(cartItem => cartItem.id === item.id);
  547. console.log('这一项',existingItem)
  548. if (existingItem) {
  549. // 如果找到相同 id 的 item,增加数量
  550. existingItem.sum += 1;
  551. } else {
  552. // 如果没有找到该 item,添加到 cart 数组
  553. item.sum = 1; // 初始化数量为 1
  554. this.cart.push(item);
  555. }
  556. console.log('购物车',this.cart)
  557. },
  558. // 减
  559. // 返回
  560. handBack() {
  561. const pages = getCurrentPages(); // 获取当前页面栈
  562. if (pages.length <= 1) {
  563. // 如果页面栈中只有一个页面(即当前页面),跳转到首页
  564. uni.switchTab({
  565. url: '/pages/index/index'
  566. });
  567. } else {
  568. // 如果页面栈有多个页面,返回上一页
  569. uni.navigateBack({
  570. detail: 1
  571. });
  572. }
  573. },
  574. // 获取高度
  575. infoScroll: function() {
  576. let that = this;
  577. //设置商品列表高度
  578. uni.getSystemInfo({
  579. success: function(res) {
  580. that.bottomheight = (res.windowHeight) * (750 / res.windowWidth) - 98;
  581. },
  582. });
  583. let hightArr = [];
  584. for (let i = 0; i < that.productList.length; i++) {
  585. let item = that.productList[i]
  586. if(!that.productList[i].childList){
  587. continue;
  588. }
  589. for (let j = 0; j < that.productList[i].childList.length; j++) {
  590. //获取元素所在位置
  591. let query = uni.createSelectorQuery().in(this);
  592. let idView = "#b" + item.id + j;
  593. query.select(idView).boundingClientRect();
  594. query.exec(function(res) {
  595. if(res[0]){
  596. let top = res[0].top;
  597. hightArr.push({top,i});
  598. }
  599. });
  600. };
  601. };
  602. that.hightArr = hightArr;
  603. },
  604. // 左侧点击
  605. tap: function(index, id) {
  606. this.toView = ''+id+0;
  607. this.navActive = index;
  608. setTimeout(()=>{
  609. uni.$emit('scroll');
  610. }, 300);
  611. },
  612. // 获取商家信息
  613. getMerchantInfo(){
  614. getMerchantInfo(this.Item).then(res => {
  615. console.log('商家信息',res)
  616. this.merchanInfo = res.data
  617. });
  618. },
  619. // 商家页面-点菜分类
  620. getCategoryCacheTree(){
  621. getCategoryCacheTree(this.Item).then(res => {
  622. // console.log('点菜分类数据',res.data)
  623. // 遍历 data 数组
  624. let data=res.data
  625. data.forEach(category => {
  626. // 给 category 添加 sum 字段,表示 childList 的 sum 总和
  627. category.sumber = 1;
  628. if (category.childList && Array.isArray(category.childList)) {
  629. // 给 childList 数组中的每个元素加上 sum 字段
  630. category.childList.forEach(item => {
  631. item.sum = 0; // 你可以根据需要设置sum的初始值
  632. });
  633. }
  634. });
  635. this.productList =data
  636. console.log('处理的数据',this.productList )
  637. //调取滚动
  638. this.$nextTick(function(){
  639. this.infoScroll();
  640. })
  641. this.showSkeleton = false
  642. })
  643. },
  644. // 滚动
  645. scroll: function(e) {
  646. uni.$emit('scroll');
  647. let scrollTop = e.detail.scrollTop + 10;
  648. let scrollArr = this.hightArr;
  649. for (let i = 0; i < scrollArr.length; i++) {
  650. if (scrollTop >= 0 && scrollTop < scrollArr[1].top - scrollArr[0].top) {
  651. this.navActive = 0
  652. } else if (scrollTop >= scrollArr[i].top - scrollArr[0].top && scrollTop < (scrollArr[i + 1] ? scrollArr[i + 1].top : 0) - scrollArr[0].top) {
  653. this.navActive = scrollArr[i].i
  654. } else if (scrollTop >= scrollArr[scrollArr.length - 1].top - scrollArr[0].top) {
  655. this.navActive = scrollArr[scrollArr.length - 1].i
  656. }
  657. }
  658. },
  659. }
  660. }
  661. </script>
  662. <style scoped lang="scss">
  663. /deep/.origin-img{
  664. border-radius: 50%;
  665. }
  666. .productSort {
  667. display: flex;
  668. flex-direction: column;
  669. width: 100%;
  670. .con-box {
  671. flex: 1;
  672. display: flex;
  673. overflow: hidden;
  674. }
  675. }
  676. .productSort .header {
  677. width: 100%;
  678. /* #ifndef MP */
  679. height: 96rpx;
  680. /* #endif */
  681. // background-color: #fff;
  682. border-bottom: 1rpx solid #f5f5f5;
  683. }
  684. .productSort .header .input {
  685. width: 700rpx;
  686. height: 60rpx;
  687. background-color: #f5f5f5;
  688. border-radius: 50rpx;
  689. box-sizing: border-box;
  690. padding: 0 25rpx;
  691. }
  692. .productSort .header .input .iconfont {
  693. font-size: 28rpx;
  694. color: #555;
  695. }
  696. .productSort .header .input .placeholder {
  697. color: #999;
  698. }
  699. .productSort .header .input input {
  700. font-size: 28rpx;
  701. height: 100%;
  702. width: 597rpx;
  703. }
  704. .productSort .header .input .input-box {
  705. display: flex;
  706. align-items: center;
  707. font-size: 28rpx;
  708. height: 100%;
  709. width: 597rpx;
  710. color: #999999;
  711. }
  712. .productSort .aside {
  713. background-color: #fff;
  714. overflow-y: auto;
  715. overflow-x: hidden;
  716. width: 200rpx;
  717. height: 100%;
  718. overflow: hidden;
  719. }
  720. .productSort .aside .item {
  721. height: 100rpx;
  722. width: 100%;
  723. font-size: 26rpx;
  724. color: #424242;
  725. }
  726. .productSort .aside .item_text {
  727. padding-left: 20rpx;
  728. overflow: hidden;
  729. text-overflow: ellipsis;
  730. display: -webkit-box;
  731. -webkit-line-clamp: 2;
  732. -webkit-box-orient: vertical;
  733. }
  734. .productSort .aside .item.on {
  735. background-color: #f7f7f7;
  736. color: #333;
  737. border-left: 4rpx solid var(--view-theme);
  738. width: 100%;
  739. text-align: center;
  740. @include main_color(theme);
  741. font-weight: bold;
  742. }
  743. .productSort .conter {
  744. flex: 1;
  745. height: 100%;
  746. padding: 0 14rpx;
  747. background-color: #f7f7f7;
  748. }
  749. .productSort .conter .listw .title {
  750. height: 100rpx;
  751. align-items: center;
  752. }
  753. .productSort .conter .listw .title .line {
  754. width: 100rpx;
  755. height: 2rpx;
  756. background-color: #f0f0f0;
  757. }
  758. .productSort .conter .listw .title .name {
  759. font-size: 28rpx;
  760. color: #333;
  761. margin: 0 30rpx;
  762. font-weight: bold;
  763. }
  764. .productSort .conter .listw .title .list_title,
  765. .productSort .conter .listw .title uni-image,
  766. .productSort .conter .listw .title image{
  767. width: 110rpx;
  768. height: 26rpx;
  769. border-radius: 0;
  770. }
  771. .productSort .conter .list {
  772. flex-wrap: wrap;
  773. background: #fff;
  774. border-radius: 16rpx;
  775. padding-bottom: 26rpx;
  776. }
  777. .productSort .conter .list .item {
  778. // width: 174rpx;
  779. margin-top: 26rpx;
  780. display: flex;
  781. align-items: center;
  782. }
  783. .productSort .conter .list .item .picture,
  784. .productSort .conter uni-image,
  785. .productSort .conter .list .item image,
  786. /deep/.easy-loadimage{
  787. width: 110rpx;
  788. height: 110rpx;
  789. }
  790. .productSort .conter .list .item .name {
  791. font-size: 24rpx;
  792. color: #333;
  793. height: 56rpx;
  794. line-height: 56rpx;
  795. width: 120rpx;
  796. text-align: center;
  797. }
  798. .header-box{
  799. position: fixed;
  800. z-index: 9999;
  801. }
  802. // 新的功能板块
  803. .box-top{
  804. padding: 20rpx;
  805. box-sizing: border-box;
  806. display: flex;
  807. flex-direction: column;
  808. gap: 20rpx;
  809. background-color: #fff;
  810. border-top-left-radius:30rpx ;
  811. border-top-right-radius: 30rpx;
  812. }
  813. .box-top1{
  814. display: flex;
  815. align-items: center;
  816. justify-content: space-between;
  817. }
  818. .box-txt{
  819. overflow-wrap: break-word;
  820. color: rgba(20, 20, 20, 1);
  821. font-size: 36rpx;
  822. font-family: PingFangSC-Semibold;
  823. font-weight: 600;
  824. text-align: left;
  825. white-space: nowrap;
  826. line-height: 50rpx;
  827. }
  828. .box-pin{
  829. display: flex;
  830. align-items: center;
  831. gap: 10rpx;
  832. }
  833. .box-txt2{
  834. overflow-wrap: break-word;
  835. color: rgba(253, 103, 22, 1);
  836. font-size: 28rpx;
  837. font-family: PingFangSC-Semibold;
  838. font-weight: 600;
  839. text-align: left;
  840. white-space: nowrap;
  841. line-height: 40rpx;
  842. }
  843. .box-txt3{
  844. overflow-wrap: break-word;
  845. color: rgba(153, 153, 153, 1);
  846. font-size: 22rpx;
  847. font-family: PingFangSC-Medium;
  848. font-weight: 500;
  849. text-align: left;
  850. white-space: nowrap;
  851. line-height: 32rpx;
  852. margin-top: 6rpx;
  853. }
  854. .box-shopp{
  855. overflow-wrap: break-word;
  856. color: rgba(20, 20, 20, 1);
  857. font-size: 24rpx;
  858. font-family: PingFangSC-Regular;
  859. font-weight: normal;
  860. text-align: left;
  861. white-space: nowrap;
  862. line-height: 34rpx;
  863. }
  864. .box-newtxt{
  865. background: #F8F9FB ;
  866. padding: 10rpx;
  867. box-sizing: border-box;
  868. overflow-wrap: break-word;
  869. color: rgba(133, 134, 135, 1);
  870. font-size: 22rpx;
  871. font-family: PingFangSC-Regular;
  872. font-weight: normal;
  873. text-align: left;
  874. white-space: nowrap;
  875. line-height: 32rpx;
  876. display: flex;
  877. align-items: center;
  878. gap: 6rpx;
  879. height: 60rpx;
  880. position: relative;
  881. }
  882. .boxcolor{
  883. background-color: #FF6702;
  884. }
  885. .box-color-txt{
  886. overflow-wrap: break-word;
  887. color: rgba(255, 255, 255, 1);
  888. font-size: 36rpx;
  889. font-family: PingFangSC-Medium;
  890. font-weight: 500;
  891. text-align: center;
  892. white-space: nowrap;
  893. }
  894. .back-button-1 {
  895. position: absolute;
  896. left: 20rpx;
  897. font-size: 30px; /* 设置箭头的大小 */
  898. color: #000; /* 设置箭头颜色 */
  899. width: 40px; /* 按钮的宽度 */
  900. height: 40px; /* 按钮的高度 */
  901. background-color: transparent; /* 背景透明 */
  902. border-radius: 50%; /* 圆形按钮 */
  903. cursor: pointer; /* 鼠标悬停时显示手指 */
  904. }
  905. .back-button-1::before {
  906. content: '<'; /* 设置按钮的内容为 "<" */
  907. font-size: 30px; /* 设置箭头符号的大小 */
  908. color: #000; /* 设置箭头颜色 */
  909. }
  910. .nexbox{
  911. background: #FFF;
  912. box-sizing: border-box;
  913. display: flex;
  914. flex-direction: column;
  915. gap: 10rpx;
  916. }
  917. .nexbox-txt{
  918. width: 100%;
  919. position: sticky;
  920. top: -2rpx;
  921. z-index: 99;
  922. background: #fff;
  923. box-sizing: border-box;
  924. height: 50rpx;
  925. display: flex;
  926. align-items: center;
  927. padding-left: 20rpx;
  928. color: #fd6716;
  929. }
  930. .row-middle{
  931. width: 100%;
  932. display: flex;
  933. justify-content: space-between;
  934. }
  935. .nexbox1{
  936. display: flex;
  937. flex-direction: column;
  938. gap: 15rpx;
  939. width: 70%;
  940. }
  941. .neximg{
  942. width: 25%;
  943. height: 100%;
  944. flex-shrink: 0;
  945. object-fit: contain; /* 保持图片等比例缩放,并且不会裁切 */
  946. }
  947. .nexbox1-txt{
  948. overflow-wrap: break-word;
  949. color: rgba(20, 20, 20, 1);
  950. font-size: 32rpx;
  951. font-family: PingFangSC-Semibold;
  952. font-weight: 600;
  953. white-space: nowrap;
  954. line-height: 44rpx;
  955. }
  956. .nexbox2{
  957. display: flex;
  958. align-items: center;
  959. gap: 20rpx;
  960. overflow-wrap: break-word;
  961. color: rgba(100, 100, 100, 1);
  962. font-size: 22rpx;
  963. font-family: PingFangSC-Regular;
  964. font-weight: normal;
  965. text-align: left;
  966. white-space: nowrap;
  967. line-height: 32rpx;
  968. }
  969. .nexbox3{
  970. display: flex;
  971. align-items: center;
  972. justify-content: space-between;
  973. }
  974. .nexbox-txt3{
  975. overflow-wrap: break-word;
  976. color: rgba(255, 152, 5, 1);
  977. font-size: 28rpx;
  978. font-family: PingFangSC-Semibold;
  979. font-weight: 600;
  980. white-space: nowrap;
  981. line-height: 40rpx;
  982. }
  983. .nexbox-img3{
  984. width: 36rpx !important;
  985. height: 36rpx !important;
  986. }
  987. .nexbox4{
  988. display: flex;
  989. align-items: center;
  990. gap: 20rpx;
  991. line-height: 18rpx;
  992. }
  993. .neximg1{
  994. width: 36rpx;
  995. height: 36rpx;
  996. background: #FFFFFF;
  997. border: 1px solid #FF6702;
  998. color: #FF6702;
  999. border-radius: 60%;
  1000. display: flex;
  1001. align-items: center;
  1002. justify-content: center;
  1003. }
  1004. // 购物车
  1005. .cart-box {
  1006. position: absolute;
  1007. // bottom: 30rpx;
  1008. left: 30rpx;
  1009. right: 30rpx;
  1010. height: 96rpx;
  1011. border-radius: 48rpx;
  1012. box-shadow: 0 0 20rpx rgba(0, 0, 0, 0.2);
  1013. background-color: #000;
  1014. display: flex;
  1015. align-items: center;
  1016. justify-content: space-between;
  1017. z-index: 9999;
  1018. .cart-img {
  1019. width: 50rpx;
  1020. height: 47rpx;
  1021. position: relative;
  1022. // margin-top: -48rpx;
  1023. }
  1024. .pay-btn {
  1025. height: 100%;
  1026. padding: 0 30rpx;
  1027. color: #FFFFFF;
  1028. border-radius: 0 50rpx 50rpx 0;
  1029. display: flex;
  1030. align-items: center;
  1031. font-size: $font-size-base;
  1032. }
  1033. .mark {
  1034. padding-left: 46rpx;
  1035. margin-right: 30rpx;
  1036. position: relative;
  1037. .tag {
  1038. background-color: $color-warning;
  1039. color: $text-color-white;
  1040. display: flex;
  1041. justify-content: center;
  1042. align-items: center;
  1043. font-size: $font-size-sm;
  1044. position: absolute;
  1045. right: -13rpx;
  1046. top: -20rpx;
  1047. border-radius: 100%;
  1048. padding: 4rpx;
  1049. width: 27rpx;
  1050. height: 27rpx;
  1051. opacity: .9;
  1052. }
  1053. }
  1054. .price {
  1055. flex: 1;
  1056. color: $text-color-base;
  1057. }
  1058. }
  1059. .cart-popup {
  1060. .top {
  1061. background-color: $bg-color-primary;
  1062. color: $color-primary;
  1063. padding: 10rpx 30rpx;
  1064. font-size: 24rpx;
  1065. text-align: right;
  1066. }
  1067. .cart-list {
  1068. background-color: #FFFFFF;
  1069. width: 100%;
  1070. overflow: hidden;
  1071. min-height: 1vh;
  1072. max-height: 60vh;
  1073. .wrapper {
  1074. height: 100%;
  1075. display: flex;
  1076. flex-direction: column;
  1077. padding: 0 30rpx;
  1078. margin-bottom: 156rpx;
  1079. .item {
  1080. display: flex;
  1081. justify-content: space-between;
  1082. align-items: center;
  1083. padding: 30rpx 0;
  1084. position: relative;
  1085. &::after {
  1086. content: ' ';
  1087. position: absolute;
  1088. bottom: 0;
  1089. left: 0;
  1090. width: 100%;
  1091. background-color: $border-color;
  1092. height: 2rpx;
  1093. transform: scaleY(.6);
  1094. }
  1095. .left {
  1096. flex: 1;
  1097. display: flex;
  1098. flex-direction: column;
  1099. overflow: hidden;
  1100. margin-right: 30rpx;
  1101. .name {
  1102. font-size: $font-size-sm;
  1103. color: $text-color-base;
  1104. }
  1105. .props {
  1106. color: $text-color-assist;
  1107. font-size: 24rpx;
  1108. overflow: hidden;
  1109. text-overflow: ellipsis;
  1110. white-space: nowrap;
  1111. }
  1112. }
  1113. .center {
  1114. margin-right: 120rpx;
  1115. font-size: $font-size-base;
  1116. }
  1117. .right {
  1118. display: flex;
  1119. align-items: center;
  1120. justify-content: space-between;
  1121. .btn {
  1122. width: 46rpx;
  1123. height: 46rpx;
  1124. border-radius: 100%;
  1125. padding: 0;
  1126. text-align: center;
  1127. line-height: 46rpx;
  1128. }
  1129. .number {
  1130. font-size: $font-size-base;
  1131. width: 46rpx;
  1132. height: 46rpx;
  1133. text-align: center;
  1134. line-height: 46rpx;
  1135. }
  1136. }
  1137. }
  1138. }
  1139. }
  1140. }
  1141. .back-button {
  1142. width: 30rpx;
  1143. height: 30rpx;
  1144. border-right: 4rpx solid #fff;
  1145. border-bottom: 4rpx solid #fff;
  1146. transform: rotate(135deg);
  1147. margin-left: 10rpx;
  1148. display: inline-block;
  1149. position: relative;
  1150. }
  1151. .newsTitle {
  1152. display: flex;
  1153. align-items: center;
  1154. }
  1155. // 购物车弹窗
  1156. .mode{
  1157. position: fixed;
  1158. width: 100%;
  1159. height: 100%;
  1160. left: 0;
  1161. top: 0;
  1162. background: rgba(33, 33, 33, 0.8);
  1163. z-index: 999;
  1164. display: flex;
  1165. align-items: flex-end;
  1166. }
  1167. .mode-1{
  1168. width: 100%;
  1169. height: 840rpx;
  1170. background: #FFF;
  1171. display: flex;
  1172. flex-direction: column;
  1173. gap: 20rpx;
  1174. // padding: 30rpx;
  1175. box-sizing: border-box;
  1176. overflow: auto; /* 添加这个属性使容器可以滚动 */
  1177. }
  1178. .mode-box{
  1179. width: 100%;
  1180. display: flex;
  1181. flex-direction: column;
  1182. gap: 20rpx;
  1183. padding: 30rpx;
  1184. box-sizing: border-box;
  1185. }
  1186. .mode-2{
  1187. width: 100%;
  1188. height: 200rpx;
  1189. display: flex;
  1190. align-items: center;
  1191. justify-content: space-between;
  1192. }
  1193. .mode-img{
  1194. border-radius: 5%;
  1195. width: 25%;
  1196. height: 150rpx;
  1197. flex-shrink: 0;
  1198. object-fit: contain; /* 保持图片等比例缩放,并且不会裁切 */
  1199. }
  1200. .mode-clear{
  1201. padding: 30rpx;
  1202. box-sizing: border-box;
  1203. position: sticky;
  1204. z-index: 99;
  1205. top: 0;
  1206. display: flex;
  1207. justify-content: space-between;
  1208. align-items: center;
  1209. background: #FFF;
  1210. border-bottom: 1px solid burlywood;
  1211. }
  1212. .mode-txt{
  1213. display: flex;
  1214. align-items: center;
  1215. gap: 8rpx;
  1216. }
  1217. .mode-txt1{
  1218. font-weight: 500;
  1219. font-size: 32rpx;
  1220. }
  1221. // 盒子
  1222. .xbox1{
  1223. margin-top: 26rpx;
  1224. display: flex;
  1225. align-items: center;
  1226. width: 100%;
  1227. justify-content: space-between;
  1228. }
  1229. // 点菜评价切换
  1230. .let-box{
  1231. display: flex;
  1232. align-items: center;
  1233. gap: 60rpx;
  1234. padding: 20rpx;
  1235. box-sizing: border-box;
  1236. }
  1237. .let-box1{
  1238. display: flex;
  1239. flex-direction: column;
  1240. align-items: center;
  1241. justify-content: center;
  1242. gap: 10rpx;
  1243. }
  1244. .let-line{
  1245. border-radius: 6rpx;
  1246. width: 40rpx;
  1247. height: 10rpx;
  1248. }
  1249. .let-txt{
  1250. overflow-wrap: break-word;
  1251. color: rgba(20, 20, 20, 1);
  1252. font-size: 28rpx;
  1253. font-weight: normal;
  1254. text-align: left;
  1255. white-space: nowrap;
  1256. line-height: 40rpx;
  1257. }
  1258. .actave{
  1259. background-color: rgba(255, 103, 2, 1);
  1260. }
  1261. .actave1{
  1262. color: rgba(255, 103, 2, 1);
  1263. }
  1264. .icon-img{
  1265. width: 40rpx;
  1266. height: 40rpx;
  1267. flex-shrink: 0;
  1268. }
  1269. .cboxtxt{
  1270. overflow-wrap: break-word;
  1271. color: rgba(153, 153, 153, 1);
  1272. font-size: 22rpx;
  1273. font-weight: normal;
  1274. text-align: left;
  1275. white-space: nowrap;
  1276. line-height: 32rpx;
  1277. display: flex;
  1278. align-items: center;
  1279. justify-content: flex-end;
  1280. padding: 10rpx;
  1281. box-sizing: border-box;
  1282. }
  1283. .xu-btn{
  1284. width: 120rpx;
  1285. border-radius: 10rpx;
  1286. height: 50rpx;
  1287. display: flex;
  1288. align-items: center;
  1289. justify-content: center;
  1290. background: rgba(255, 103, 2, 1);
  1291. color: #FFF;
  1292. font-size: 24rpx;
  1293. position: relative;
  1294. }
  1295. .nbox{
  1296. position: relative;
  1297. }
  1298. .xun-txt{
  1299. position: absolute;
  1300. right: 0;
  1301. top: -10rpx;
  1302. border-radius: 30%;
  1303. width: 30rpx;
  1304. height: 30rpx;
  1305. background: rgba(255, 103, 2, 1);
  1306. color: #FFF;
  1307. display: flex;
  1308. align-items: center;
  1309. justify-content: center;
  1310. }
  1311. // 规格弹窗
  1312. .sel-mode-1{
  1313. width: 100%;
  1314. height: 440rpx;
  1315. background: #FFF;
  1316. display: flex;
  1317. flex-direction: column;
  1318. gap: 20rpx;
  1319. box-sizing: border-box;
  1320. overflow: auto;
  1321. z-index: 9999;
  1322. padding: 20rpx;
  1323. box-sizing: border-box;
  1324. position: relative;
  1325. }
  1326. .close{
  1327. position: absolute;
  1328. top: 20rpx;
  1329. right: 20rpx;
  1330. font-size: 30rpx;
  1331. }
  1332. .sel-2{
  1333. display: flex;
  1334. align-items: center;
  1335. gap: 20rpx;
  1336. }
  1337. .sel-3{
  1338. display: flex;
  1339. flex-direction: column;
  1340. gap: 10rpx;
  1341. }
  1342. .sel-4{
  1343. display: flex;
  1344. align-items: center;
  1345. gap: 10rpx;
  1346. }
  1347. .sel-5{
  1348. width: 80prx;
  1349. height: 40rpx;
  1350. box-sizing: border-box;
  1351. display: flex;
  1352. align-items: center;
  1353. justify-content: center;
  1354. font-size: 24rpx;
  1355. background: #999999;
  1356. color: #FFF;
  1357. padding: 8rpx;
  1358. border-radius: 8rpx;
  1359. }
  1360. .sel-6{
  1361. display: flex;
  1362. align-items: center;
  1363. justify-content: space-between;
  1364. }
  1365. .sel-btn{
  1366. display: flex;
  1367. align-items: center;
  1368. justify-content: flex-end;
  1369. }
  1370. .sel-btn1{
  1371. width: 110px;
  1372. height: 60rpx;
  1373. display: flex;
  1374. align-items: center;
  1375. justify-content: center;
  1376. background: rgba(255, 103, 2, 1);
  1377. color: #FFF;
  1378. font-size: 30rpx;
  1379. border-radius: 10rpx;
  1380. }
  1381. </style>