index.vue 36 KB

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