index.vue 51 KB

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