index.vue 51 KB

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