goodsList.vue 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751
  1. <template>
  2. <view>
  3. <view>
  4. <view class="food_all">
  5. <!-- banner -->
  6. <swiper class="swiper" :autoplay="true" interval="2000" duration="500" :circular="true"
  7. style="width: 100%;height: 300rpx;">
  8. <swiper-item v-for="(item,index) in shopDet.shopBanner" :key='index'>
  9. <image :src="item" mode="scaleToFill" style="width: 100%;"></image>
  10. </swiper-item>
  11. </swiper>
  12. <view class="shop padding">
  13. <view class="flex justify-between">
  14. <view style="width: 500rpx;">
  15. <view class="text-xl text-bold">{{shopDet.shopName}}</view>
  16. <view class="flex align-center margin-top-xs">
  17. <view style="color: #FD6416;font-weight: bold;font-size: 30rpx;">
  18. <u-icon name="star-fill" color="#FD6416" size="28"></u-icon>
  19. {{shopDet.shopScore?shopDet.shopScore:0}}
  20. </view>
  21. <view class="margin-left-xs text-gray">销量 {{shopDet.shopSales?shopDet.shopSales:0}}</view>
  22. <view class="margin-left-xs text-gray" v-if="shopDet.errandTime">约{{shopDet.errandTime}}分钟
  23. </view>
  24. <view class="margin-left-xs text-gray" v-if="shopDet.minimumDelivery">{{shopDet.minimumDelivery}}元起送</view>
  25. </view>
  26. <view class="flex align-center margin-top-xs">
  27. <!-- <view style="color: #FCD202;margin-right: 8rpx;">{{shopDet.autoSendOrder==1?'商家配送':'平台配送'}}</view> -->
  28. <view style="margin-right: 8rpx;">{{shopDet.autoSendOrder==1?'商家配送:':'平台配送:'}}</view>
  29. <view class="text-gray" style="margin-right: 8rpx;">配送费{{shopDet.errandMoney?shopDet.errandMoney:0}}元</view>
  30. <!-- <view class="lable text-gray" v-if="shopDet.exemptMinMoney">满{{shopDet.exemptMinMoney}}元免配送费</view> -->
  31. <view class="lable flex justify-center align-center" v-if="shopDet.enableFullReductionFlag==0&&shopDet.exemptMinMoney">
  32. 满{{item.exemptMinMoney}}免配送费</view>
  33. </view>
  34. </view>
  35. <view>
  36. <image :src="shopDet.shopCover" class="radius" style="width: 110rpx;height: 110rpx;">
  37. </image>
  38. </view>
  39. </view>
  40. <view class="flex align-center margin-top-xs" v-if="shopDet.shopNotice">
  41. <text style="width: 14%;">公告:</text>
  42. <u-notice-bar color="#AAAAAA" :speed="100" border-radius="30" padding="0rpx 0rpx" bg-color="#f5f5f5" style="width: 86%;" type="none" mode="horizontal" :volume-icon="false" :list="shopDet.shopNotice.split(',')"></u-notice-bar>
  43. </view>
  44. <view class="margin-top-xs" style="width: 100%;height: 40rpx;" v-if="couponList.length>0">
  45. <scroll-view scroll-x="true" class="scroll-view_H">
  46. <view class="coupon-item flex align-center" v-for="(item,index) in couponList" :key="index" @click="getcoupons()">
  47. <view>¥</view>
  48. <view class="" style="font-weight: bold;font-size: 24rpx;margin-right: 10rpx;">
  49. {{item.money}}
  50. </view>
  51. <view style="margin-right: 20rpx;">满{{item.minMoney}}可用</view>
  52. <view style="font-weight: bold;">领</view>
  53. </view>
  54. <!-- <view class="flex align-center" style="width: 100%;height: 100%;">
  55. </view> -->
  56. </scroll-view>
  57. </view>
  58. </view>
  59. <!-- 食品 -->
  60. <view class="food">
  61. <!-- 店名地址 -->
  62. <view class="food_address">
  63. <view class="flex flex-sub bg justify-between padding-right-xl">
  64. <view @click="switchTab(1)" :class="current==1? 'select':''" class="tabBtn">
  65. <view class="title">全部商品</view>
  66. <view :class="current==1? 'active1':''"></view>
  67. </view>
  68. <view @click="switchTab(2)" :class="current==2? 'select':''" class="tabBtn">
  69. <view class="title">评价</view>
  70. <view :class="current==2? 'active1':''"></view>
  71. </view>
  72. <view @click="switchTab(3)" :class="current==3? 'select':''" class="tabBtn">
  73. <view class="title">商家</view>
  74. <view :class="current==3? 'active1':''"></view>
  75. </view>
  76. </view>
  77. <!-- <view class="flex Switch">
  78. <view @click="tabSwidth(1)" :class="orderType==1?'selSwitch':''">自取</view>
  79. <view @click="tabSwidth(2)" :class="orderType==2?'selSwitch':''">外卖</view>
  80. </view> -->
  81. <view>
  82. <image @click="goPindan()" src="../../../static/images/index/pindan.png" style="width: 160rpx;height: 64rpx;" mode=""></image>
  83. </view>
  84. </view>
  85. <view class="VerticalBox" v-if="current==1">
  86. <scroll-view class="VerticalNav nav bg-gray" scroll-y scroll-with-animation
  87. :scroll-top="verticalNavTop" style="height:calc(100vh - 590upx)">
  88. <view style="font-size: 28upx;" class="cu-item text-lg"
  89. :class="index==tabCur?'cur':'text-gray'" v-for="(item,index) in dataList" :key="index"
  90. @tap="TabSelect" :data-id="index">
  91. {{item.classifyName}}
  92. </view>
  93. </scroll-view>
  94. <scroll-view class="VerticalMain" scroll-y scroll-with-animation
  95. style="height:calc(100vh - 590rpx)" :scroll-into-view="'main-'+mainCur"
  96. @scroll="VerticalMain">
  97. <view class="bg-white padding-sm margin-bottom-sm" v-if="item.goodsList.length>0" v-for="(item,index) in dataList"
  98. :key="index" :id="'main-'+index">
  99. <view class="flex justify-between padding-bottom-sm" @click="goDet(ite.goodsId)"
  100. v-for="(ite,ind) in item.goodsList" :key='ind'>
  101. <image :src="ite.goodsCover" mode=""
  102. style="width: 184rpx;height: 184rpx;border-radius: 10rpx;"></image>
  103. <view
  104. class="flex-sub margin-left-sm padding-tb-xs flex flex-direction justify-between">
  105. <view class="text-black text-lg text-bold" style="font-size: 30upx;">
  106. {{ite.goodsName}}
  107. </view>
  108. <view class="text-gray text-sm u-line-2"
  109. style="overflow: hidden;line-clamp: 2;-webkit-line-clamp: 2;width: 100%;">
  110. {{ite.goodsSynopsis?ite.goodsSynopsis:''}}
  111. </view>
  112. <view class="flex justify-between">
  113. <view class="text-sm text-red">
  114. ¥ <text class="text-lg">{{ite.goodsMoney}}</text>
  115. </view>
  116. <image @click.stop="selSku(ite)" src="../../../static/images/index/add.png"
  117. mode="" style="width: 40rpx;height: 40rpx"></image>
  118. </view>
  119. </view>
  120. </view>
  121. </view>
  122. </scroll-view>
  123. <empty v-if="!dataList.length"></empty>
  124. </view>
  125. <view class="" v-if="current==2">
  126. <view class="flex margin-lr padding-tb-sm u-border-bottom" v-if="shopDet.shopScore">
  127. <view class="flex padding-right">
  128. <view class="text-sl" style="color: #FD6416;">{{shopDet.shopScore}}</view>
  129. <view class="flex flex-direction justify-around margin-left-sm">
  130. <view>商家评分</view>
  131. <view class="flex">
  132. <u-icon v-for="ite in shopDet.shopScore1" :key='ite' color="#FCD202"
  133. name="star-fill"></u-icon>
  134. </view>
  135. </view>
  136. </view>
  137. <view class="flex-sub flex justify-around u-border-left padding-left">
  138. <view class="flex flex-direction justify-around text-center">
  139. <view>好评</view>
  140. <view>{{EvaluateData.goodReputation}}</view>
  141. </view>
  142. <view class="flex flex-direction justify-around text-center">
  143. <view>中评</view>
  144. <view>{{EvaluateData.mediumReview}}</view>
  145. </view>
  146. <view class="flex flex-direction justify-around text-center">
  147. <view>差评</view>
  148. <view>{{EvaluateData.negativeComment}}</view>
  149. </view>
  150. </view>
  151. </view>
  152. <view class="padding-tb-sm margin-lr">
  153. <u-button hover-class='none' @click="sel(0)" type="primary" shape="circle" size="mini"
  154. :plain="false" :custom-style="count==0?customStyle:customStyle1">全部评论</u-button>
  155. <u-button hover-class='none' @click="sel(1)" type="primary" shape="circle" size="mini"
  156. :plain="false" :custom-style="count==1?customStyle:customStyle1">
  157. 好评({{EvaluateData.goodReputation}})</u-button>
  158. <u-button hover-class='none' @click="sel(2)" type="primary" shape="circle" size="mini"
  159. :plain="false" :custom-style="count==2?customStyle:customStyle1">
  160. 中评({{EvaluateData.mediumReview}})</u-button>
  161. <u-button hover-class='none' @click="sel(3)" type="primary" shape="circle" size="mini"
  162. :plain="false" :custom-style="count==3?customStyle:customStyle1">
  163. 差评({{EvaluateData.negativeComment}})</u-button>
  164. </view>
  165. <view class="padding-tb-sm margin-lr u-border-bottom" v-for="(item, index) in EvaluateList"
  166. :key='index'>
  167. <view class="flex justify-between align-center">
  168. <view class="flex align-center">
  169. <u-avatar :src="item.avatar" size="65"></u-avatar>
  170. <view class=" margin-left-sm" style="line-height: 46upx;">{{item.nickName}}</view>
  171. <view class="flex margin-left-sm">
  172. <u-icon v-for="ite in item.score" :key='ite' color="#FCD202" name="star-fill">
  173. </u-icon>
  174. </view>
  175. </view>
  176. <view>{{item.createTime}}</view>
  177. </view>
  178. <view class="margin-top-sm">{{item.evaluateMessage}}</view>
  179. <view class="pinglunImg" v-if="item.pictures!=undefined && item.pictures">
  180. <view class="pinglunImg-box flex justify-between flex-wrap">
  181. <image style="margin-bottom: 20rpx;" @click="yuanlan(item.pictures==undefined?[]:item.pictures.split(','),index2)" v-for="(item2,index2) in item.pictures==undefined?[]:item.pictures.split(',')" :src="item2" mode=""></image>
  182. <image style="margin-bottom: 20rpx;width: 160rpx;height: 0;" src="" mode=""></image>
  183. <image style="margin-bottom: 20rpx;width: 160rpx;height: 0;" src="" mode=""></image>
  184. </view>
  185. </view>
  186. <view class="margin-top-sm" v-if="item.shopReplyMessage">
  187. <view class="flex align-center">
  188. <view class=" flex align-center text-df" style="color: #999999;">
  189. <view class="text-df">商家回复:</view>{{item.shopReplyMessage}}
  190. </view>
  191. </view>
  192. </view>
  193. </view>
  194. <empty v-if="!EvaluateList.length"></empty>
  195. </view>
  196. <view class="margin-lr padding-bottom" v-if="current==3">
  197. <view class="flex align-center">
  198. <view class="flex-sub">
  199. <view class="text-black text-lg text-bold">{{shopDet.shopName}}</view>
  200. <view class="margin-top-sm" @click="goMap">
  201. <u-icon name="map" size="28"></u-icon> {{shopDet.detailedAddress}}
  202. </view>
  203. </view>
  204. <image @click="call(shopDet.phone)" src="../../../static/images/index/phone.png"
  205. class="radius" style="width: 38rpx;height: 49rpx;">
  206. </image>
  207. </view>
  208. <image :src="shopDet.shopCover" class="radius margin-top-sm"
  209. style="width: 140rpx;height: 140rpx;">
  210. </image>
  211. <view class="text-black text-lg text-bold margin-top-xs">商家信息</view>
  212. <view class="text-black margin-top-xs text-df">
  213. 营业时间:{{shopDet.businessHours}}-{{shopDet.lockHours}}</view>
  214. <view class="text-black margin-top-xs text-df">商家品类:{{shopDet.shopTypeName}}</view>
  215. <view class="text-black margin-top-xs text-df">配送范围:{{shopDet.distributionDistance}}以内</view>
  216. <view class="text-black margin-top-xs text-df" v-if="shopDet.shopNotice">公告:{{shopDet.shopNotice}}</view>
  217. <view class="text-black margin-top-xs text-df" v-else>公告:店铺开业啦!</view>
  218. </view>
  219. </view>
  220. <!-- 结算 -->
  221. <view class="settlement" @click="isPopupShow" v-if="current==1">
  222. <view class="settlement_img">
  223. <image src="../../../static/images/index/diancan.png" mode=""></image>
  224. <view class="settlement_hot">{{goodsNum}}</view>
  225. </view>
  226. <view class="settlement_le">
  227. <text>¥</text>{{totalPrice}}
  228. </view>
  229. <view class="settlement_ri" @click.stop="goConfirm()">去结算</view>
  230. </view>
  231. <!-- 购物车弹窗 -->
  232. <u-popup v-model="popupShow" mode="bottom" border-radius="20">
  233. <view class="padding">
  234. <view class="flex justify-between align-center margin-bottom-sm">
  235. <view class="text-bold text-black text-df">已选餐品</view>
  236. <view class="flex align-center">
  237. <image src="../../../static/images/index/delete.png" style="width: 28rpx;height: 31rpx;"
  238. mode=""></image>
  239. <text class="margin-left-xs" @click="empty">清空购物车</text>
  240. </view>
  241. </view>
  242. <scroll-view scroll-y='true' class="popup">
  243. <view v-for="(item,index) in goodsList.orderGoodsList[0]" :key='inedx'>
  244. <view class="flex align-center margin-tb-sm">
  245. <image :src="item.goodsPicture[0]"
  246. style="width: 96rpx;height: 96rpx;border-radius: 10rpx;">
  247. </image>
  248. <view class="margin-left-sm">
  249. <view>{{item.goodsName}}</view>
  250. <view v-if="item.skuMessage">{{item.skuMessage}}</view>
  251. </view>
  252. </view>
  253. <view class="flex justify-between align-center">
  254. <view class="text-bold text-sm">¥<text class="text-lg">{{item.goodsPrice}}</text>
  255. </view>
  256. <view class="flex align-center justify-between">
  257. <view @click.stop="noAdd(item,index)">
  258. <image src="../../../static/images/index/jian.png"
  259. style="width: 54rpx;height: 54rpx;"></image>
  260. </view>
  261. <view class="text-center margin-lr-xs">{{item.goodsNum}}</view>
  262. <view @click="add(item,index)">
  263. <image src="../../../static/images/index/add.png"
  264. style="width: 50rpx;height: 50rpx;"></image>
  265. </view>
  266. </view>
  267. </view>
  268. </view>
  269. </scroll-view>
  270. </view>
  271. <view class="settlement1 margin-top-lg">
  272. <view class="settlement_img">
  273. <image src="../../../static/images/index/diancan.png" mode=""></image>
  274. <view class="settlement_hot">{{goodsNum}}</view>
  275. </view>
  276. <view class="settlement_le">
  277. <text>¥</text>{{totalPrice}}
  278. </view>
  279. <view class="settlement_ri" @click.stop="goConfirm()">去结算</view>
  280. </view>
  281. </u-popup>
  282. <!-- 选择规格弹窗 -->
  283. <u-popup v-model="skuShow" mode="center" :closeable='true' border-radius="20">
  284. <view style="width: 700rpx;">
  285. <view class="text-center text-lg text-bold padding-tb">{{goodsDet.goodsName}}</view>
  286. <view class="margin-top-sm padding-lr" v-for="(item,index) in attrList" :key="index">
  287. <view class="text-bold text-black">{{item.value}}</view>
  288. <view class="flex margin-tb-sm flex-wrap">
  289. <view v-for="(ite, ind) in item.detail" :key="ind" @click="skuSel(ite,index,ind)"
  290. class="margin-bottom-sm">
  291. <view class="skuBtn"
  292. :class="item.goodsId == index && item.attrId == ind?'active': ''">
  293. {{ite.name}}
  294. </view>
  295. </view>
  296. </view>
  297. </view>
  298. <view class="flex justify-between padding-lr padding-top">
  299. <view>
  300. <view class="text-xl text-bold text-black"><text class="text-sm">¥</text>{{price}}
  301. </view>
  302. <view class="detail_describe_text2">{{checkString}}</view>
  303. </view>
  304. <u-number-box v-model="value" min="1" @change="valChange"></u-number-box>
  305. </view>
  306. <view class="detail_account_bottom padding">
  307. <view class="detail_account_bottom_le" @click="payment()">立即购买</view>
  308. <view class="detail_account_bottom_ri" @click="orderSel(2)">加入购物车</view>
  309. </view>
  310. </view>
  311. </u-popup>
  312. <!-- 优惠券弹窗 -->
  313. <!-- coupons -->
  314. <u-popup v-model="coupons" height="520rpx" mode="bottom" :closeable="true">
  315. <view class="yhq flex justify-center align-center">
  316. <view class="yhq-box">
  317. <view class="yhq-box-title">
  318. 优惠券
  319. </view>
  320. <view class="yhq-box-list">
  321. <scroll-view scroll-y="true" style="width: 100%;height: 100%;padding-bottom: 20rpx;">
  322. <view class="yhq-box-list-item flex justify-center align-center" v-for="(item,index) in couponList" :key="index">
  323. <view class="yhq-box-list-item-c flex justify-between align-center">
  324. <view class="yhq-box-list-item-c-l flex align-center">
  325. <image :src="item.couponPicture?item.couponPicture:'../../../static/logo.png'" style="width: 80rpx;height: 80rpx;border-radius: 20rpx;" mode=""></image>
  326. <view class="" style="margin-left: 20rpx;">
  327. <view class="">
  328. <text style="color: red;margin-right: 10rpx;">¥{{item.money}}</text>
  329. <text style="font-weight: bold;margin-right: 10rpx;">优惠券</text>
  330. (满{{item.minMoney}}元可用)
  331. </view>
  332. <view class="" style="font-size: 20rpx;color: gray;">
  333. 领取后{{item.endDate}}天内有效
  334. </view>
  335. </view>
  336. </view>
  337. <view class="yhq-box-list-item-c-r" style="color: red;" @click="lingqv(item.couponId)">
  338. 领取
  339. </view>
  340. </view>
  341. </view>
  342. </scroll-view>
  343. </view>
  344. </view>
  345. </view>
  346. </u-popup>
  347. </view>
  348. <u-skeleton :loading="loading" :animation="true" bgColor="#FFF"></u-skeleton>
  349. </view>
  350. </view>
  351. </template>
  352. <script>
  353. import empty from '@/components/empty.vue'
  354. export default {
  355. components: {
  356. empty
  357. },
  358. data() {
  359. return {
  360. customStyle: {
  361. color: '#333333',
  362. background: '#FCD202',
  363. marginRight: '20rpx',
  364. border: 0
  365. },
  366. customStyle1: {
  367. color: '#333333',
  368. background: '#F2F2F2',
  369. marginRight: '20rpx',
  370. border: 0
  371. },
  372. current: 1,
  373. loading: false, // 是否显示骨架屏组件
  374. tabCur: 0,
  375. mainCur: 0,
  376. verticalNavTop: 0,
  377. load: true,
  378. dataList: [],
  379. shopDet: {},
  380. shopList: [],
  381. city: '西安',
  382. lat: '',
  383. lng: '',
  384. shopName: '',
  385. page: 1,
  386. limit: 10,
  387. evaluatePage: 1,
  388. evaluateLimit: 10,
  389. show: true,
  390. totalPrice: 0,
  391. goodsNum: 0,
  392. goodsList: [],
  393. popupShow: false,
  394. skuShow: false,
  395. userId: '',
  396. hintShow: false, //
  397. shouquan: 0,
  398. orderType: 2,
  399. value: 1,
  400. goodsDet: {},
  401. skuId: '',
  402. skuMessage: '',
  403. skuList: [],
  404. attrList: [],
  405. checkString: '',
  406. checkStateList: [],
  407. CheckattrValue: false,
  408. price: 0,
  409. echoSkuList: [],
  410. echoSku: [],
  411. isEchoSku: {},
  412. shopId: '',
  413. lng: '',
  414. lat: '',
  415. commentList: [],
  416. EvaluateList: [],
  417. EvaluateData: {},
  418. grade: '',
  419. count: 0,
  420. orderId: '',
  421. couponList:[],//优惠券列表
  422. coupons:false,
  423. }
  424. },
  425. onLoad(option) {
  426. let that = this
  427. that.shopId = option.shopId
  428. that.orderId = uni.getStorageSync('orderId')?uni.getStorageSync('orderId'):''
  429. if (that.orderId) {
  430. that.getOrderDetail();
  431. }
  432. console.log('店铺id', option.shopId)
  433. console.log('订单id', that.orderId)
  434. uni.getLocation({
  435. type: 'gcj02', //返回可以用于uni.openLocation的经纬度
  436. success: function(res) {
  437. that.lat = res.latitude;
  438. that.lng = res.longitude;
  439. that.getData()
  440. },fail(e) {
  441. uni.hideLoading();
  442. uni.showModal({
  443. title: '温馨提示',
  444. content: '您的定位权限未开启,请开启后再来操作吧!',
  445. showCancel: true,
  446. cancelText: '取消',
  447. confirmText: '确认',
  448. success: res => {
  449. if(res.confirm){
  450. uni.openSetting({ // 打开设置页
  451. success(rea) {
  452. console.log(rea.authSetting)
  453. }
  454. });
  455. }
  456. }
  457. });
  458. }
  459. });
  460. },
  461. onShow() {
  462. this.userId = uni.getStorageSync('userId')
  463. if (this.orderId) {
  464. this.getOrderDetail();
  465. }
  466. this.getOrderList()
  467. this.getcouponList()
  468. },
  469. onShareAppMessage(res) { //发送给朋友
  470. return {
  471. title: this.shopDet.shopName,
  472. path: '/pages/index/index?shopId=' + this.shopDet.shopId,
  473. imageUrl: this.shopDet.shopCover,
  474. }
  475. },
  476. onShareTimeline(res) { //分享到朋友圈
  477. return {
  478. title: this.shopDet.shopName,
  479. path: '/pages/index/index?shopId=' + this.shopDet.shopId,
  480. imageUrl: this.shopDet.shopCover,
  481. }
  482. },
  483. methods: {
  484. getOrderDetail() {
  485. this.$Request.getT('/app/order/selectOrderById?orderId=' + this.orderId).then(res => {
  486. if (res.code == 0 && res.data) {
  487. if (res.data.isPay && res.data.isPay == 1) {
  488. this.orderId = '';
  489. uni.removeStorageSync('orderId')
  490. }
  491. }
  492. });
  493. },
  494. getcoupons(){
  495. this.coupons = true
  496. },
  497. //领取优惠券
  498. lingqv(couponId,needIntegral){
  499. let that = this
  500. let data = {
  501. couponId: couponId,
  502. }
  503. that.$Request.postT("/app/coupon/buyCoupon", data).then(res => {
  504. if (res.code == 0) {
  505. uni.showToast({
  506. title:'领取成功'
  507. })
  508. that.coupons = false
  509. }else{
  510. uni.showToast({
  511. title:res.msg,
  512. icon:'none'
  513. })
  514. }
  515. });
  516. },
  517. //获取商家优惠券
  518. getcouponList(){
  519. // couponList
  520. let data = {
  521. shopId: this.shopId,
  522. }
  523. this.$Request.get("/app/coupon/seleteAllCoupon", data).then(res => {
  524. if (res.code == 0 && res.data) {
  525. this.couponList = res.data
  526. }
  527. });
  528. },
  529. // 预览图片
  530. yuanlan(arr,index){
  531. uni.previewImage({
  532. urls:arr,
  533. current:index
  534. })
  535. },
  536. goNav(url) {
  537. uni.navigateTo({
  538. url
  539. })
  540. },
  541. switchTab(e) {
  542. // this.page = 1
  543. this.current = e
  544. if (this.current == 1) {
  545. this.getData()
  546. } else if (this.current == 2) {
  547. this.getEvaluateList()
  548. } else if (this.current == 3) {
  549. }
  550. },
  551. sel(e) {
  552. this.grade = e
  553. this.count = e
  554. this.evaluatePage = 1
  555. this.getEvaluateList()
  556. },
  557. // 获取评论列表
  558. getEvaluateList() {
  559. let data = {
  560. shopId: this.shopId,
  561. page: this.evaluatePage,
  562. limit: this.evaluateLimit,
  563. grade: this.grade
  564. }
  565. this.$Request.get("/app/goods/selectEvaluateByShopId", data).then(res => {
  566. if (res.code == 0 && res.data) {
  567. this.EvaluateData = res.data
  568. if (this.evaluatePage == 1) {
  569. this.EvaluateList = res.data.pageUtils.list
  570. } else {
  571. this.EvaluateList = [...this.EvaluateList, ...res.data.pageUtils.list]
  572. }
  573. }
  574. });
  575. },
  576. // 获取店铺信息
  577. getData() {
  578. let data = {
  579. shopId: this.shopId,
  580. lng: this.lng,
  581. lat: this.lat
  582. }
  583. this.$Request.get("/app/goods/selectGoodsList", data).then(res => {
  584. if (res.code == 0 && res.data) {
  585. this.dataList = res.data.list
  586. this.shopDet = res.data.goodsShop
  587. for (var i = 0; i < this.dataList.length; i++) {
  588. this.dataList[i].id = i
  589. }
  590. this.shopDet.shopScore1 = Math.floor(this.shopDet.shopScore)
  591. this.shopDet.errandTime = Math.round(this.shopDet.errandTime)
  592. this.shopDet.shopBanner = this.shopDet.shopBanner.split(',')
  593. this.shopDet.shopScore = this.shopDet.shopScore.toFixed(2)
  594. if (this.shopDet.distributionDistance < 1000) {
  595. this.shopDet.distributionDistance = '<1000m'
  596. } else {
  597. this.shopDet.distributionDistance = Number(this.shopDet.distributionDistance / 1000) +
  598. 'km'
  599. }
  600. uni.setNavigationBarTitle({
  601. title: this.shopDet.shopName
  602. })
  603. }
  604. });
  605. },
  606. getEchoOrder() {
  607. let data = {
  608. shopId: this.shopId,
  609. goodsId: this.goodsDet.goodsId
  610. }
  611. this.$Request.get("/app/order/echoOrder", data).then(res => {
  612. if (res.code == 0 && res.data.length) {
  613. this.echoSkuList = res.data
  614. this.echoSku = res.data[0].skuMessage.split(',')
  615. }
  616. });
  617. },
  618. // 弹窗展示商品详情
  619. selSku(item) {
  620. console.log(item)
  621. this.checkStateList = []
  622. this.checkString = ''
  623. this.$Request.get("/app/goods/selectGoodsById?goodsId=" + item.goodsId).then(res => {
  624. uni.hideLoading()
  625. if (res.code == 0) {
  626. this.goodsDet = res.data
  627. this.goodsDet.goodsLabel = this.goodsDet.goodsLabel.split(',')
  628. this.goodsDet.goodsPicture = this.goodsDet.goodsPicture.split(',')
  629. console.log(this.goodsDet.goodsPicture)
  630. this.price = this.goodsDet.goodsMoney
  631. this.skuList = this.goodsDet.sku
  632. if (this.goodsDet.attr.length) {
  633. this.attrList = this.goodsDet.attr[0] ? this.goodsDet.attr[0].attrValue : []
  634. } else {
  635. this.skuId = this.goodsDet.sku[0].id
  636. }
  637. console.log(this.attrList)
  638. this.attrList.forEach(res => {
  639. let data = {
  640. name: ''
  641. }
  642. this.checkStateList.push(data);
  643. let detail = [];
  644. res.detail.split(',').forEach(d => {
  645. let data = {
  646. name: '',
  647. state: ''
  648. }
  649. data.name = d;
  650. detail.push(data);
  651. });
  652. res.detail = detail;
  653. })
  654. this.getEchoOrder()
  655. this.skuShow = true
  656. }
  657. });
  658. },
  659. // 选择规格
  660. skuSel(item, index, ind) {
  661. console.log(item, index, ind)
  662. this.attrList[index].goodsId = index
  663. this.attrList[index].attrId = ind
  664. this.checkStateList[index].name = item.name;
  665. this.checkString = '';
  666. this.checkStateList.forEach(d => {
  667. if (d.name) {
  668. if (this.checkString) {
  669. this.checkString = this.checkString + ',' + d.name;
  670. } else {
  671. this.checkString = d.name;
  672. }
  673. }
  674. });
  675. console.log(this.skuList)
  676. for (var i = 0; i < this.skuList.length; i++) {
  677. let d = this.skuList[i];
  678. if (d.detailJson == this.checkString) {
  679. console.log(d.detailJson, this.checkString)
  680. // if (d.stock > 0) {
  681. this.skuId = d.id
  682. this.skuMessage = d.detailJson
  683. this.price = d.skuPrice
  684. this.CheckattrValue = true;
  685. // } else {
  686. // this.$queue.showToast('库存不足请选择其他规格')
  687. // }
  688. break
  689. } else {
  690. this.CheckattrValue = false;
  691. }
  692. }
  693. },
  694. valChange(e) {
  695. console.log('当前值为: ' + e.value)
  696. this.value = e.value
  697. },
  698. // 立即购买
  699. payment() {
  700. if (!this.userId) {
  701. uni.navigateTo({
  702. url: '/pages/public/login'
  703. })
  704. return
  705. }
  706. if (this.attrList.length) {
  707. if (this.checkString == '' || !this.CheckattrValue) {
  708. this.$queue.showToast('请选择正确的商品规格');
  709. return;
  710. }
  711. }
  712. let goodstr1 = 0 //商品库的 必须次数
  713. let goodstr2 = 0 //购物车的 必须次数
  714. let regex = new RegExp('必选', 'g');
  715. let dataList = JSON.stringify(this.dataList)
  716. if (dataList.match(regex)) {
  717. goodstr1 = dataList.match(regex).length
  718. console.log("goodstr1----" + goodstr1)
  719. if (dataList.indexOf('必选') != -1) { //检测商品是否存在必选
  720. let goodsList = JSON.stringify(this.goodsDet)
  721. if (goodsList.match(regex)) {
  722. goodstr2 = goodsList.match(regex).length
  723. console.log("goodstr2----" + goodstr2)
  724. if (goodstr1 == goodstr2) { //检查购物车商品是否存在必须
  725. let data = {
  726. goodsId: this.goodsDet.goodsId,
  727. skuMessage: this.skuMessage,
  728. skuId: this.skuId,
  729. num: this.value,
  730. orderType: this.orderType,
  731. shopId: this.shopId,
  732. }
  733. this.$Request.post("/app/order/buyGoods", data).then(res => {
  734. if (res.code == 0) {
  735. this.skuShow = false
  736. uni.navigateTo({
  737. url: '/pages/index/shop/payOrder?orderId=' + res.data + '&orderType=' + this
  738. .orderType
  739. })
  740. } else {
  741. this.$queue.showToast(res.msg);
  742. }
  743. })
  744. } else {
  745. uni.showToast({
  746. title: "有" + goodstr1 + "个必选商品,请选择后结算",
  747. icon: "none"
  748. })
  749. return
  750. }
  751. } else {
  752. uni.showToast({
  753. title: "有" + goodstr1 + "个必选商品,请选择后结算",
  754. icon: "none"
  755. })
  756. return
  757. }
  758. }
  759. } else {
  760. let data = {
  761. goodsId: this.goodsDet.goodsId,
  762. skuMessage: this.skuMessage,
  763. skuId: this.skuId,
  764. num: this.value,
  765. orderType: this.orderType,
  766. shopId: this.shopId,
  767. }
  768. this.$Request.post("/app/order/buyGoods", data).then(res => {
  769. if (res.code == 0) {
  770. this.skuShow = false
  771. uni.navigateTo({
  772. url: '/pages/index/shop/payOrder?orderId=' + res.data + '&orderType=' + this
  773. .orderType
  774. })
  775. } else {
  776. this.$queue.showToast(res.msg);
  777. }
  778. })
  779. }
  780. // let data = {
  781. // goodsId: this.goodsDet.goodsId,
  782. // skuMessage: this.skuMessage,
  783. // skuId: this.skuId,
  784. // num: this.value,
  785. // orderType: this.orderType,
  786. // shopId: this.shopId,
  787. // }
  788. // this.$Request.post("/app/order/buyGoods", data).then(res => {
  789. // if (res.code == 0) {
  790. // this.skuShow = false
  791. // uni.navigateTo({
  792. // url: '/pages/index/shop/payOrder?orderId=' + res.data + '&orderType=' + this
  793. // .orderType
  794. // })
  795. // } else {
  796. // this.$queue.showToast(res.msg);
  797. // }
  798. // })
  799. },
  800. // 加入购物车
  801. orderSel(e) {
  802. if (!this.userId) {
  803. uni.navigateTo({
  804. url: '/pages/public/login'
  805. })
  806. return
  807. }
  808. if (this.attrList.length) {
  809. if (this.checkString == '' || !this.CheckattrValue) {
  810. this.$queue.showToast('请选择正确的商品规格');
  811. return;
  812. }
  813. }
  814. console.log(this.goodsDet)
  815. console.log(this.echoSku, 'echoSku')
  816. if (this.echoSku.length) {
  817. this.echoSkuList.forEach(res => {
  818. if (res.skuMessage == this.skuMessage) {
  819. this.isEchoSku = res
  820. }
  821. })
  822. if (JSON.stringify(this.isEchoSku) != "{}") {
  823. let data = {
  824. orderGoodsId: this.isEchoSku.id,
  825. type: 1,
  826. num: this.value,
  827. shopId: this.shopId,
  828. }
  829. this.$Request.get("/app/order/updateGoodsNum", data).then(res => {
  830. if (res.code == 0) {
  831. // setTimeout(function() {
  832. this.skuShow = false
  833. this.getOrderList()
  834. // },1000)
  835. } else {
  836. this.$queue.showToast(res.msg);
  837. }
  838. });
  839. return
  840. }
  841. }
  842. let data = {
  843. goodsId: this.goodsDet.goodsId,
  844. skuMessage: this.skuMessage,
  845. skuId: this.skuId,
  846. num: this.value,
  847. shopId: this.shopId,
  848. orderId: this.orderId
  849. }
  850. this.$Request.post("/app/order/joinOrder", data).then(res => {
  851. if (res.code == 0) {
  852. this.$queue.showToast('添加成功');
  853. if (e == 1) {
  854. uni.navigateTo({
  855. url: '/pages/diancan/confirmOrder?shopId=' + this.shopId
  856. })
  857. } else {
  858. // setTimeout(function() {
  859. this.skuShow = false
  860. this.getOrderList()
  861. // },1000)
  862. }
  863. } else {
  864. this.$queue.showToast(res.msg);
  865. }
  866. })
  867. },
  868. // 切换外卖/自提
  869. tabSwidth(e) {
  870. this.orderType = e
  871. this.getOrderList()
  872. },
  873. // 展示购物车弹窗
  874. isPopupShow() {
  875. // console.log(this.goodsList.orderGoodsList[0])
  876. if (this.goodsList && this.goodsList.orderGoodsList[0].length > 0) {
  877. this.popupShow = true
  878. } else {
  879. uni.showToast({
  880. title: '请先添加商品',
  881. icon: "none"
  882. })
  883. }
  884. },
  885. // 添加数量
  886. add(item, index) {
  887. // this.count++;
  888. console.log(item, index)
  889. this.goodsList.orderGoodsList[0][index].goodsNum++
  890. let data = {
  891. orderGoodsId: this.goodsList.orderGoodsList[0][index].id,
  892. type: 1,
  893. num: 1,
  894. shopId: this.shopId
  895. }
  896. this.$Request.get("/app/order/updateGoodsNum", data).then(res => {
  897. if (res.code == 0) {
  898. this.getOrderList()
  899. } else {
  900. this.$queue.showToast(res.msg);
  901. this.goodsList.orderGoodsList[0][index].goodsNum--
  902. }
  903. });
  904. },
  905. // 减少数量
  906. noAdd(item, index) {
  907. console.log(item, index)
  908. this.goodsList.orderGoodsList[0][index].goodsNum--
  909. // this.count--;
  910. let data = {
  911. orderGoodsId: this.goodsList.orderGoodsList[0][index].id,
  912. type: 2,
  913. num: 1,
  914. shopId: this.shopId
  915. }
  916. this.$Request.get("/app/order/updateGoodsNum", data).then(res => {
  917. if (res.code == 0) {
  918. this.getOrderList()
  919. }
  920. });
  921. },
  922. // 清空购物车
  923. empty() {
  924. let data = {
  925. shopId: this.shopId,
  926. }
  927. this.$Request.post("/app/order/emptyShoppingTrolley", data).then(res => {
  928. if (res.code == 0) {
  929. this.popupShow = false
  930. this.goodsList = []
  931. this.echoSkuList = []
  932. this.echoSku = []
  933. this.getOrderList()
  934. this.getEchoOrder()
  935. }
  936. });
  937. },
  938. // 获取购物车商品列表
  939. getOrderList() {
  940. let data = {
  941. shopId: this.shopId,
  942. page: 1,
  943. limit: 1000,
  944. status: 1,
  945. // orderType: this.orderType
  946. }
  947. this.$Request.get("/app/order/selectAllOrderList", data).then(res => {
  948. if (res.code == 0) {
  949. this.goodsList = res.data.pageUtils.list[0]
  950. if (this.goodsList) {
  951. console.log(this.goodsList)
  952. this.goodsList.orderGoodsList[0].forEach(res => {
  953. res.goodsPicture = res.goodsPicture.split(',')
  954. })
  955. if (!this.goodsList.orderGoodsList[0].length) {
  956. this.popupShow = false
  957. }
  958. }
  959. this.totalPrice = res.data.money
  960. this.goodsNum = 0
  961. if (this.goodsList && this.goodsList.orderGoodsList[0]) {
  962. this.goodsList.orderGoodsList[0].forEach(res => {
  963. this.goodsNum += res.goodsNum
  964. })
  965. }
  966. }
  967. });
  968. },
  969. // 跳转商品详情
  970. goDet(id) {
  971. uni.navigateTo({
  972. url: '/pages/index/shop/goodsDet?goodsId=' + id + '&shopId=' + this.shopId + '&orderType=' +
  973. this.orderType + '&orderId=' + this.orderId
  974. })
  975. },
  976. // 去结算
  977. goConfirm() {
  978. if (!this.userId) {
  979. uni.navigateTo({
  980. url: '/pages/public/login'
  981. })
  982. return
  983. }
  984. let goodstr1 = 0 //商品库的 必须次数
  985. let goodstr2 = 0 //购物车的 必须次数
  986. let regex = new RegExp('必选', 'g');
  987. if (this.goodsList && this.goodsList.orderGoodsList[0].length > 0) {
  988. let dataList = JSON.stringify(this.dataList)
  989. if (dataList.match(regex)) {
  990. goodstr1 = dataList.match(regex).length
  991. console.log("goodstr1----" + goodstr1)
  992. if (dataList.indexOf('必选') != -1) { //检测商品是否存在必选
  993. let goodsList = JSON.stringify(this.goodsList.orderGoodsList)
  994. if (goodsList.match(regex)) {
  995. goodstr2 = goodsList.match(regex).length
  996. console.log("goodstr2----" + goodstr2)
  997. if (goodstr1 == goodstr2) { //检查购物车商品是否存在必须
  998. uni.navigateTo({
  999. url: '/pages/index/shop/confirmOrder?shopId=' + this.shopId + '&orderType=' + this
  1000. .orderType
  1001. })
  1002. } else {
  1003. uni.showToast({
  1004. title: "有"+goodstr1+"个必选商品,请选择后结算",
  1005. icon: "none"
  1006. })
  1007. return
  1008. }
  1009. } else {
  1010. uni.showToast({
  1011. title: "有"+goodstr1+"个必选商品,请选择后结算",
  1012. icon: "none"
  1013. })
  1014. return
  1015. }
  1016. }
  1017. } else {
  1018. uni.navigateTo({
  1019. url: '/pages/index/shop/confirmOrder?shopId=' + this.shopId + '&orderType=' + this
  1020. .orderType
  1021. })
  1022. }
  1023. } else {
  1024. uni.showToast({
  1025. title: '请先添加商品',
  1026. icon: "none"
  1027. })
  1028. }
  1029. },
  1030. TabSelect(e) {
  1031. console.log(e.currentTarget.dataset.id)
  1032. this.tabCur = e.currentTarget.dataset.id;
  1033. this.mainCur = e.currentTarget.dataset.id;
  1034. this.verticalNavTop = (e.currentTarget.dataset.id - 1) * 50
  1035. },
  1036. VerticalMain(e) {
  1037. let that = this;
  1038. let tabHeight = 0;
  1039. if (this.load) {
  1040. for (let i = 0; i < this.dataList.length; i++) {
  1041. let view = uni.createSelectorQuery().select("#main-" + this.dataList[i].id);
  1042. view.fields({
  1043. size: true
  1044. }, data => {
  1045. this.dataList[i].top = tabHeight;
  1046. tabHeight = tabHeight + data.height;
  1047. this.dataList[i].bottom = tabHeight;
  1048. }).exec();
  1049. }
  1050. this.load = false
  1051. }
  1052. let scrollTop = e.detail.scrollTop;
  1053. // console.log(scrollTop,'111')
  1054. for (let i = 0; i < this.dataList.length; i++) {
  1055. if (scrollTop > this.dataList[i].top && scrollTop < this.dataList[i].bottom) {
  1056. this.verticalNavTop = (this.dataList[i].id - 1) * 50
  1057. this.tabCur = this.dataList[i].id
  1058. console.log(scrollTop) //不能删除
  1059. return false
  1060. }
  1061. }
  1062. },
  1063. // 打电话
  1064. call(e) {
  1065. uni.makePhoneCall({
  1066. phoneNumber: e
  1067. });
  1068. },
  1069. // 点击调起地图查看位置
  1070. goMap() {
  1071. //查看位置需要传经纬度才能执行
  1072. let that = this
  1073. uni.authorize({
  1074. scope: 'scope.userLocation',
  1075. success(res) {
  1076. uni.openLocation({
  1077. latitude: that.shopDet.shopLat,
  1078. longitude: that.shopDet.shopLng,
  1079. success: function() {}
  1080. });
  1081. },
  1082. fail(err) {
  1083. }
  1084. })
  1085. },
  1086. goPindan() {
  1087. if (!this.userId) {
  1088. uni.navigateTo({
  1089. url: '/pages/public/login'
  1090. })
  1091. return
  1092. }
  1093. if(this.orderId) {
  1094. uni.navigateTo({
  1095. url: '/pages/index/shop/pindanDet?shopId=' + this.shopId +'&orderId=' + this.orderId
  1096. })
  1097. } else {
  1098. let data = {
  1099. shopId: this.shopId,
  1100. }
  1101. this.$Request.post("/app/order/shareTheBill", data).then(res => {
  1102. if (res.code == 0) {
  1103. uni.navigateTo({
  1104. url: '/pages/index/shop/pindanDet?shopId=' + this.shopId +'&orderId=' + res.data
  1105. })
  1106. }
  1107. });
  1108. }
  1109. }
  1110. },
  1111. onReachBottom: function() {
  1112. if (this.current == 2) {
  1113. this.evaluatePage = this.evaluatePage + 1;
  1114. this.getEvaluateList()
  1115. }
  1116. },
  1117. }
  1118. </script>
  1119. <style scoped lang="scss">
  1120. page {
  1121. background-color: #FFFFFF;
  1122. }
  1123. .pinglunImg{
  1124. width: 100%;
  1125. margin-top: 10rpx;
  1126. }
  1127. .pinglunImg-box{
  1128. width: 100%;
  1129. image{
  1130. // margin-left: 10rpx;
  1131. width: 160upx;
  1132. height: 160upx;
  1133. border-radius: 10rpx;
  1134. }
  1135. }
  1136. .coupon-item{
  1137. display: inline-block;
  1138. height: 46rpx;
  1139. margin-right: 20rpx;
  1140. border: 1px solid red;
  1141. border-radius: 10rpx;
  1142. padding: 0rpx 10rpx 0rpx 10rpx;
  1143. font-size: 20rpx;
  1144. color: red;
  1145. line-height: 44rpx;
  1146. view{
  1147. display: inline-block;
  1148. }
  1149. }
  1150. .scroll-view_H{
  1151. width: 100%;
  1152. white-space: nowrap;
  1153. }
  1154. .yhq{
  1155. width: 100%;
  1156. height: 520rpx;
  1157. background-color: #F5F5F5;
  1158. overflow-y: hidden;
  1159. .yhq-box{
  1160. width: 686rpx;
  1161. height: 500rpx;
  1162. // background-color: red;
  1163. .yhq-box-title{
  1164. width: 100%;
  1165. text-align: center;
  1166. font-weight: bold;
  1167. }
  1168. .yhq-box-list{
  1169. width: 100%;
  1170. height: auto;
  1171. height: 460rpx;
  1172. margin-top: 30rpx;
  1173. .yhq-box-list-item{
  1174. width: 100%;
  1175. height: 120rpx;
  1176. border-radius: 24rpx;
  1177. background-color: #FFFFFF;
  1178. margin-bottom: 20rpx;
  1179. }
  1180. .yhq-box-list-item-c{
  1181. width: 646rpx;
  1182. height: 100%;
  1183. }
  1184. }
  1185. }
  1186. }
  1187. .bg1 {
  1188. background: #FFFFFF;
  1189. }
  1190. .sticky-tabs {
  1191. z-index: 990;
  1192. position: sticky;
  1193. top: var(--window-top);
  1194. // background-color: #fff;
  1195. }
  1196. /* // 使用mescroll-uni,则top为0 */
  1197. .mescroll-uni,
  1198. /deep/.mescroll-uni {
  1199. .sticky-tabs {
  1200. top: 0;
  1201. }
  1202. }
  1203. .shop {
  1204. position: absolute;
  1205. top: 80rpx;
  1206. left: 0;
  1207. right: 0;
  1208. width: 686rpx;
  1209. margin: auto;
  1210. background: #FFFFFF;
  1211. border-radius: 20rpx;
  1212. box-shadow: 0 0 20rpx #CCCCCC;
  1213. }
  1214. .skuBtn {
  1215. padding: 10rpx 30rpx;
  1216. border-radius: 10rpx;
  1217. text-align: center;
  1218. margin: 10rpx 20rpx;
  1219. font-size: 28rpx;
  1220. color: #333333;
  1221. border: 2px solid #F2F2F2;
  1222. }
  1223. .active {
  1224. background: rgba(252, 210, 2, 0.2) !important;
  1225. border: 2px solid #FCD202 !important;
  1226. opacity: 0.6;
  1227. }
  1228. .active1 {
  1229. /* width: 82rpx; */
  1230. height: 16rpx;
  1231. background: #FCD202;
  1232. position: relative;
  1233. top: -10rpx;
  1234. z-index: 9;
  1235. }
  1236. .popup {
  1237. /* height: 500rpx; */
  1238. max-height: 500rpx;
  1239. /* overflow-y: auto; */
  1240. }
  1241. .tabBtn {
  1242. /* background-color: #f6f6fa; */
  1243. height: 60rpx;
  1244. line-height: 60rpx;
  1245. color: #999999;
  1246. font-size: 38rpx;
  1247. }
  1248. .Switch {
  1249. width: 164rpx;
  1250. height: 62rpx;
  1251. color: #FFFFFF;
  1252. background: #FCD202;
  1253. border-radius: 30rpx;
  1254. display: flex;
  1255. align-items: center;
  1256. padding: 2rpx;
  1257. }
  1258. .Switch>view {
  1259. /* flex: 1; */
  1260. width: 80rpx;
  1261. text-align: center;
  1262. line-height: 62rpx;
  1263. height: 58rpx;
  1264. }
  1265. .selSwitch {
  1266. color: #333333;
  1267. background: #FFFFFF;
  1268. border-radius: 30rpx;
  1269. }
  1270. .hintPopul {
  1271. width: 100%;
  1272. height: 100vh;
  1273. position: absolute;
  1274. top: 0;
  1275. background: rgba(0, 0, 0, .4);
  1276. }
  1277. .content {
  1278. position: absolute;
  1279. left: 0;
  1280. right: 0;
  1281. top: 0;
  1282. bottom: 0;
  1283. margin: auto;
  1284. text-align: center;
  1285. width: 500rpx;
  1286. height: 400rpx;
  1287. border-radius: 20rpx;
  1288. background-color: #fff;
  1289. padding-top: 120rpx;
  1290. }
  1291. .content image {
  1292. position: absolute;
  1293. top: -50rpx;
  1294. left: 0;
  1295. right: 0;
  1296. margin: auto;
  1297. }
  1298. .hintText {
  1299. font-size: 30rpx;
  1300. }
  1301. .VerticalNav.nav {
  1302. width: 200upx;
  1303. white-space: initial;
  1304. }
  1305. .VerticalNav.nav .cu-item {
  1306. width: 100%;
  1307. text-align: center;
  1308. background-color: #f1f1f1;
  1309. margin: 0;
  1310. border: none;
  1311. height: 50px;
  1312. position: relative;
  1313. }
  1314. .VerticalNav.nav .cu-item.cur {
  1315. background-color: #fff;
  1316. }
  1317. .VerticalBox {
  1318. display: flex;
  1319. }
  1320. .VerticalMain {
  1321. background-color: #f1f1f1;
  1322. flex: 1;
  1323. }
  1324. .detail_describe_text2 {
  1325. font-weight: 500;
  1326. margin-top: 2%;
  1327. color: #999999;
  1328. }
  1329. .detail_account_bottom {
  1330. margin-top: 20rpx;
  1331. width: 100%;
  1332. display: flex;
  1333. justify-content: space-between;
  1334. /* margin: 4% 0 3%; */
  1335. }
  1336. .detail_account_bottom_le {
  1337. width: 47.5%;
  1338. /* margin-right: 5%; */
  1339. border-radius: 44rpx;
  1340. text-align: center;
  1341. line-height: 2.8;
  1342. border: 2rpx solid #FCD202;
  1343. }
  1344. .detail_account_bottom_ri {
  1345. width: 47.5%;
  1346. border-radius: 44rpx;
  1347. text-align: center;
  1348. line-height: 2.8;
  1349. background-color: #FCD202;
  1350. }
  1351. .food_all {
  1352. position: relative;
  1353. }
  1354. .text-through {
  1355. text-decoration: line-through
  1356. }
  1357. /* 食物 */
  1358. .food {
  1359. width: 100%;
  1360. overflow: hidden;
  1361. // position: absolute;
  1362. // top: 350rpx;
  1363. background-color: #FFFFFF;
  1364. border-top-left-radius: 18rpx;
  1365. border-top-right-radius: 18rpx;
  1366. }
  1367. .food_address {
  1368. margin: 3%;
  1369. display: flex;
  1370. justify-content: space-between;
  1371. align-items: center;
  1372. margin-top: 120rpx;
  1373. }
  1374. .food_address_le {
  1375. width: 75%;
  1376. }
  1377. .food_address_le_top {
  1378. display: flex;
  1379. align-items: center;
  1380. justify-content: space-between;
  1381. }
  1382. .food_address_le_top_le {
  1383. width: 40rpx;
  1384. height: 37rpx;
  1385. }
  1386. .food_address_le_top_le image {
  1387. width: 40rpx;
  1388. height: 37rpx;
  1389. }
  1390. .food_address_le_top_ce {
  1391. line-height: 1.6;
  1392. font-size: 38rpx;
  1393. font-weight: 600;
  1394. color: #333333;
  1395. }
  1396. .food_address_le_top_ce_ri {
  1397. width: 14rpx;
  1398. /* margin: 1% 0 0 2%; */
  1399. height: 24rpx;
  1400. margin-left: 2%;
  1401. }
  1402. .food_address_le_top_ce_ri image {
  1403. width: 14rpx;
  1404. height: 24rpx;
  1405. }
  1406. .food_address_text {
  1407. font-weight: 500;
  1408. font-size: 24rpx;
  1409. color: #999999;
  1410. }
  1411. .food_address_ri {
  1412. width: 24%;
  1413. height: 55rpx;
  1414. display: flex;
  1415. padding: 0.5% 1%;
  1416. background-color: #FCD202;
  1417. border-radius: 31rpx;
  1418. color: #FFFFFF;
  1419. }
  1420. .food_address_ri_sty {
  1421. flex: 1;
  1422. text-align: center;
  1423. padding-top: 4%;
  1424. font-size: 24rpx;
  1425. }
  1426. .food_address_ri_sty_active {
  1427. width: 100%;
  1428. overflow: hidden;
  1429. background-color: #FFFFFF;
  1430. border-radius: 31rpx;
  1431. color: #333333;
  1432. text-align: center;
  1433. }
  1434. /* 结算 */
  1435. .settlement {
  1436. width: 94%;
  1437. background-color: #000000;
  1438. line-height: 3.4;
  1439. border-radius: 49rpx;
  1440. position: fixed;
  1441. bottom: 10rpx;
  1442. left: 3%;
  1443. display: flex;
  1444. justify-content: space-between;
  1445. }
  1446. .settlement1 {
  1447. width: 94%;
  1448. background-color: #000000;
  1449. line-height: 2.8;
  1450. border-radius: 49rpx;
  1451. position: relative;
  1452. /* bottom: 10rpx; */
  1453. left: 0;
  1454. right: 0;
  1455. /* left: 3%; */
  1456. display: flex;
  1457. justify-content: space-between;
  1458. margin: 20rpx auto;
  1459. }
  1460. .settlement_le {
  1461. width: 45%;
  1462. padding-left: 20%;
  1463. color: #FFFFFF;
  1464. font-size: 30rpx;
  1465. }
  1466. .settlement_le text {
  1467. font-size: 22rpx;
  1468. }
  1469. .settlement_ri {
  1470. width: 35%;
  1471. background-color: #FCD202;
  1472. font-family: PingFang SC;
  1473. font-weight: 800;
  1474. color: #333333;
  1475. text-align: center;
  1476. border-top-right-radius: 49rpx;
  1477. border-bottom-right-radius: 49rpx;
  1478. }
  1479. .settlement_img {
  1480. width: 91rpx;
  1481. height: 96rpx;
  1482. position: absolute;
  1483. // bottom: 30rpx;
  1484. left: 5%;
  1485. }
  1486. .settlement_img image {
  1487. width: 74rpx;
  1488. height: 81rpx;
  1489. }
  1490. .settlement_hot {
  1491. width: 35rpx;
  1492. height: 35rpx;
  1493. line-height: 35rpx;
  1494. text-align: center;
  1495. border-radius: 50%;
  1496. position: absolute;
  1497. top: -10rpx;
  1498. right: 0;
  1499. background-color: #FF130A;
  1500. color: #FFFFFF;
  1501. font-size: 20rpx;
  1502. font-weight: bold;
  1503. color: #FFFFFF;
  1504. }
  1505. .select_all {
  1506. width: 100%;
  1507. position: relative;
  1508. }
  1509. /* 餐厅 */
  1510. .select {
  1511. color: #000000;
  1512. font-weight: bold;
  1513. background-color: #fff;
  1514. z-index: 10;
  1515. }
  1516. .select_line {
  1517. width: 15%;
  1518. height: 6rpx;
  1519. margin: 0 auto 4%;
  1520. background: #E6E6E6;
  1521. border-radius: 4rpx;
  1522. }
  1523. .select_search {
  1524. width: 100%;
  1525. margin: 2% 0;
  1526. display: flex;
  1527. align-items: center;
  1528. }
  1529. .select_search_le {
  1530. /* width: 10%; */
  1531. font-size: 30rpx;
  1532. line-height: 2.5;
  1533. margin-right: 1%;
  1534. }
  1535. .select_search_ce {
  1536. /* width: 5%; */
  1537. /* margin-top: 1%; */
  1538. margin-right: 20rpx;
  1539. margin-left: 6rpx;
  1540. /* margin: 0 20rpx; */
  1541. width: 20rpx;
  1542. height: 10rpx;
  1543. }
  1544. .select_search_ri {
  1545. /* width: 84%; */
  1546. height: 72rpx;
  1547. flex: 1;
  1548. display: flex;
  1549. }
  1550. .select_search_ri input {
  1551. flex: 1;
  1552. /* width: 100%; */
  1553. height: 72rpx;
  1554. background: #F5F5F5;
  1555. color: #999999;
  1556. border-radius: 36rpx;
  1557. text-decoration: 42rpx;
  1558. text-align: center;
  1559. }
  1560. /* 附近 */
  1561. .nearby {
  1562. width: 100%;
  1563. position: relative;
  1564. }
  1565. .nearby_text {
  1566. width: 18%;
  1567. font-size: 30rpx;
  1568. font-weight: 800;
  1569. color: #333333;
  1570. text-align: center;
  1571. border-bottom: 16rpx solid #FCD202;
  1572. /* line-height: 20rpx; */
  1573. margin-top: 10rpx;
  1574. }
  1575. .nearby_address_active {
  1576. border: 2rpx solid #FCD202;
  1577. width: 100%;
  1578. padding: 3%;
  1579. margin-top: 3%;
  1580. border-radius: 10upx;
  1581. display: flex;
  1582. }
  1583. .nearby_address {
  1584. width: 100%;
  1585. padding: 3%;
  1586. margin-top: 3%;
  1587. border-radius: 10upx;
  1588. display: flex;
  1589. }
  1590. .nearby_address_le {
  1591. flex: 1;
  1592. }
  1593. .nearby_address_ri {
  1594. line-height: 2.5;
  1595. text-align: right;
  1596. /* flex: 1; */
  1597. }
  1598. .nearby_text2 {
  1599. /* line-height: 1.5; */
  1600. display: flex;
  1601. justify-content: space-between;
  1602. align-items: center;
  1603. }
  1604. .nearby_text2_ {
  1605. font-size: 30rpx;
  1606. font-weight: 800;
  1607. color: #333333;
  1608. }
  1609. .nearby_text3 {
  1610. font-size: 24rpx;
  1611. font-weight: 500;
  1612. color: #999999;
  1613. margin-top: 2%;
  1614. }
  1615. /* 添加地址 */
  1616. .goorder {
  1617. width: 100%;
  1618. padding: 2% 3%;
  1619. position: fixed;
  1620. bottom: 0;
  1621. background-color: #FFFFFF;
  1622. border-top: 1rpx solid #999999;
  1623. }
  1624. .goorder_but {
  1625. width: 100%;
  1626. line-height: 2.5;
  1627. text-align: center;
  1628. background: #FCD202;
  1629. border-radius: 36rpx;
  1630. }
  1631. </style>