index.vue 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938
  1. <template>
  2. <view class="content">
  3. <view @click="goAddress()" class="address text-bold">
  4. <view class="address_name">{{address?address:'选择地址'}}</view>
  5. <u-icon name="arrow-down" color="#333333" size="28"></u-icon>
  6. </view>
  7. <!-- #ifdef H5 -->
  8. <view class="bg-white">
  9. <!-- #endif -->
  10. <!-- #ifndef H5 -->
  11. <view class="bg-white" style="margin-top: 180rpx;">
  12. <!-- #endif -->
  13. <view class="padding-lr padding-top">
  14. <view class="flex align-center padding-left" @click="goNav('/pages/index/search/index')"
  15. style="border: 2rpx solid #FFAF5E;height: 80rpx;border-radius: 60rpx;">
  16. <u-icon name="search" size="46"></u-icon>
  17. <view class="flex-sub text-gray margin-left-sm">输入商家或商品名称</view>
  18. <view class="search-btn">搜索</view>
  19. </view>
  20. </view>
  21. <view class="padding-top padding-lr">
  22. <swiper class="swiper radius" :autoplay="true" interval="2000" duration="500" :circular="true"
  23. style="width: 100%;height: 280rpx;">
  24. <swiper-item v-for="(item,index) in bannerList" :key='index' @click="goNav(item.url)">
  25. <image :src="item.imageUrl" class="radius" style="width: 100%;height: 280rpx;"></image>
  26. </swiper-item>
  27. </swiper>
  28. </view>
  29. <view class="padding-lr radius" v-if="XCXIsSelect == '是'">
  30. <u-grid :col="5" :border="false">
  31. <u-grid-item v-for="(item,index) in gridData" :key='index' @tap="goDetail(item)">
  32. <image :src="item.imageUrl" style="width: 92rpx;height: 92rpx;border-radius: 92rpx;">
  33. </image>
  34. <view class="grid-text margin-top-sm">{{item.name}}</view>
  35. </u-grid-item>
  36. </u-grid>
  37. </view>
  38. </view>
  39. <!-- 公告 -->
  40. <view class="flex justify-between align-center bg-white padding-bottom padding-lr radius bg-white"
  41. style="width: 100%;height: 100rpx;">
  42. <image src="../../static/images/index/gonggao.png" style="width: 140rpx;height: 50rpx;" mode=""></image>
  43. <view class="flex-sub margin-left-sm">
  44. <swiper class="swiper" autoplay="1500" :vertical='true' style="height: 40rpx;overflow: hidden;">
  45. <swiper-item>
  46. <text>{{noticeList.value}}</text>
  47. </swiper-item>
  48. </swiper>
  49. </view>
  50. </view>
  51. <view class="flex justify-between padding-lr bg-white" v-if="XCXIsSelect == '是'">
  52. <image src="../../static/images/index/jifen.png" @click="goNav('/my/integral/index')"
  53. style="width: 338rpx;height: 180rpx;" mode=""></image>
  54. <image src="../../static/images/index/renwu.png" @click="goNav('/my/task/index')"
  55. style="width: 338rpx;height: 180rpx;" mode=""></image>
  56. </view>
  57. <!-- <view class="padding-top padding-lr bg-white" v-if="!shopStatus == 1&&XCXIsSelect=='是'">
  58. <image src="../../static/images/index/banner.png" @click="goNav('/my/apply/index')"
  59. style="width: 100%;height: 170rpx;" mode=""></image>
  60. </view> -->
  61. <!-- 活动推荐 -->
  62. <view class="huodong flex justify-center" v-if="huodongList.length>0&&XCXIsSelect!='否'">
  63. <view class="huodong-box flex justify-center">
  64. <view class="huodong-box-c">
  65. <view class="huodong-box-c-title flex justify-between align-center">
  66. <view class="huodong-box-c-title-l flex align-center">
  67. <image src="../../static/images/index/hd.png" mode=""></image>
  68. </view>
  69. <view class="huodong-box-c-title-r">
  70. 美食速达
  71. </view>
  72. </view>
  73. <view class="huodong-box-c-list">
  74. <swiper @change="swiperChange" :indicator-dots="false" display-multiple-items="3"
  75. :circular="true" style="height: 300rpx;" :autoplay="false" previous-margin="5"
  76. :interval="300" :duration="300">
  77. <swiper-item v-for="(item,index) in huodongList"
  78. style="border-radius: 28rpx;height: 320rpx;"
  79. @click="gotohuodong(item.name,item.id,item.imageUrl,item.url)">
  80. <view class="swiper-item flex justify-center flex-wrap align-center"
  81. style="width: 200rpx;height: 240rpx;background: linear-gradient(0deg, rgba(252, 210, 2, 0.8) 0%, rgba(252, 210, 2, 1) 100%);border-radius: 28rpx;"
  82. :style="currents==index?'height:260rpx;border-radius: 28rpx;':'margin-top:14rpx;'">
  83. <view class="flex justify-center align-center"
  84. :style="currents==index?'height:200rpx':''"
  85. style="width: 190rpx;height: 180rpx;border-radius: 28rpx;margin-top: 5rpx;">
  86. <image :src="item.imageUrl"
  87. style="width: 95%;height: 95%;border-radius: 20rpx;" mode="aspectFill">
  88. </image>
  89. </view>
  90. <view class=""
  91. style="width: 100%;text-align: center;font-size: 32rpx;color: white;font-weight: bold;padding-bottom: 10rpx;">
  92. {{item.name}}
  93. </view>
  94. </view>
  95. </swiper-item>
  96. </swiper>
  97. </view>
  98. </view>
  99. </view>
  100. </view>
  101. <!-- 推荐商家 -->
  102. <view class="jxShop flex justify-center" v-if="jxlist.length>0&&XCXIsSelect!='否'">
  103. <view class="jxShop-box flex justify-center">
  104. <view class="jxShop-box-c">
  105. <view class="jxShop-box-c-title flex justify-between align-center">
  106. <view class="jxShop-box-c-title-l">
  107. 推荐商家
  108. </view>
  109. <view class="jxShop-box-c-title-r flex align-center" @click="gotoList()">
  110. 更多
  111. <u-icon name="arrow-right" color="#1E1F31" size="28"></u-icon>
  112. </view>
  113. </view>
  114. <view class="jxShop-box-c-list flex justify-between">
  115. <view class="jxShop-box-c-list-item"
  116. @click="goShopDet(item.shopId,item,item.shopActivityList)"
  117. v-for="(item,index) in jxlist" :key="index">
  118. <image :src="item.shopCover" mode="aspectFill"></image>
  119. <view class="jxShop-box-c-list-item-name">
  120. {{item.shopName}}
  121. </view>
  122. </view>
  123. <view class="jxShop-box-c-list-item" style="height: 0;">
  124. </view>
  125. <view class="jxShop-box-c-list-item" style="height: 0;">
  126. </view>
  127. </view>
  128. </view>
  129. </view>
  130. </view>
  131. <view class="flex justify-center"
  132. style="position: relative;background-color: #ffffff;padding-top: 20rpx;padding-bottom: 20rpx;">
  133. <view style="width: 686rpx;" class="flex justify-between align-center bg-white">
  134. <view :class="current==1?'select':''" @click="confirm(1)">综合排序</view>
  135. <view :class="current==3?'select':''" @click="confirm(3)">距离优先</view>
  136. <view :class="current==4?'select':''" @click="confirm(4)">销量优先</view>
  137. <view class="flex" @click="isShow = !isShow">
  138. <view class="flex align-center" style="margin: 0 auto;">
  139. <view :class="isShow?'select':''">筛选</view>
  140. <u-icon v-if="!isShow" name="arrow-down" size="28"></u-icon>
  141. <u-icon v-if="isShow" name="arrow-up" color="#FCD202" size="28"></u-icon>
  142. </view>
  143. </view>
  144. </view>
  145. <view v-if="isShow"
  146. style="position: absolute;top: 50rpx;width: 100%;z-index: 10;background: rgba(0,0,0,.5);height: 100vh;"
  147. @click="isShow =false">
  148. <view class="padding-lr bg-white">
  149. <view class="flex justify-between align-center padding-tb-sm u-border-bottom"
  150. v-for="(item,index) in options4" :key='index' @click.stop="getSelect(item)">
  151. <view class="text-df" :class="item.select?'select':''">{{item.shopTypeName}}</view>
  152. <u-icon v-if="item.select" name="checkmark" color="#FCD202" size="28"></u-icon>
  153. </view>
  154. </view>
  155. </view>
  156. </view>
  157. <!-- 活动筛选 -->
  158. <view class="hd flex justify-center" v-if="hdlist.length>0">
  159. <view class="hd-box">
  160. <scroll-view scroll-x="true" class="scroll-view_H">
  161. <view class="hd-box-item" :style="currenthd==index?'background-color:#fcd202;':''"
  162. @click="searchhd(index,item.id)" v-for="(item,index) in hdlist" :key="index">
  163. {{item.title}}
  164. </view>
  165. </scroll-view>
  166. </view>
  167. </view>
  168. <view class="padding-lr">
  169. <view class="margin-tb-sm flex justify-between bg-white padding-sm radius"
  170. v-for="(item,index) in shopList" :key='index'
  171. @click="goShopDet(item.shopId,item,item.shopActivityList)">
  172. <image :src="item.shopCover[0]" class="radius" style="width: 160rpx;height: 160rpx;"></image>
  173. <view class=" margin-left-sm" style="width: 450rpx;">
  174. <view class=" flex flex-direction justify-between">
  175. <view class="text-lg text-bold text-black">{{item.shopName}}</view>
  176. <view class="flex align-center margin-top-xs" style="width: 100%;">
  177. <u-icon name="star-fill" color="#FD6416" size="28"></u-icon>
  178. <text class="text-lg" style=""> {{item.shopScore?item.shopScore:0}}</text>
  179. <text
  180. class="text-gray flex-sub margin-left-xs">销量{{item.shopSales?item.shopSales:0}}</text>
  181. <text class="text-gray margin-left-xs">{{item.errandTime}}分钟</text>
  182. <text class="text-gray margin-left-xs">{{item.distance}}</text>
  183. </view>
  184. <view class="text-gray margin-top-xs flex justify-between">
  185. <view>起送 ¥{{item.minimumDelivery}} 配送 ¥{{item.errandMoney?item.errandMoney:0}}</view>
  186. <view style="color: #FCD202;">{{item.autoSendOrder==1?'商家配送':'平台配送'}}</view>
  187. </view>
  188. <view class="text-gray margin-top-xs" v-if="item.businessHours&&item.lockHours">
  189. 营业时间:{{item.businessHours}}-{{item.lockHours}}</view>
  190. <view class="flex margin-top-xs justify-between align-start" style="width: 100%;">
  191. <view class="flex flex-wrap align-center"
  192. style="width: 100%;height: 100%;overflow: hidden;">
  193. <!-- <view class="lable flex justify-center align-center" v-if="item.enableFullReductionFlag==1">
  194. 不参与配送费满减</view> -->
  195. <view class="lable flex justify-center align-center" v-if="item.enableFullReductionFlag==0&&item.exemptMinMoney">
  196. 满{{item.exemptMinMoney}}免配送费</view>
  197. <view v-for="(ite,ind) in item.shopActivityList" :key='ind' v-if="item.shopActivityList && ite.activityType!='1'">
  198. <view class="lable flex justify-center align-center" style="border-radius: 4rpx;background-color: #ffffff;color: red;box-sizing: border-box;">
  199. <text v-if="ite.activityType=='2'">时段</text>
  200. <text v-if="ite.activityType=='3'">满额</text>
  201. <text v-if="ite.activityType=='4'">全场</text>
  202. <text style="margin-left: 3px;">|</text>
  203. <text style="margin-left: 3px;">{{ite.activityName}}</text>
  204. </view>
  205. <!-- <view class="lable flex justify-center align-center"
  206. style="border-radius: 4rpx;border: 1rpx solid red;background-color: #ffffff;color: red;box-sizing: border-box;"
  207. >{{ite.activityName}}
  208. </view> -->
  209. </view>
  210. <view class="lable flex justify-center align-center" v-for="(ite,ind) in item.shopLable" :key='ind'
  211. v-if="item.shopLable">
  212. {{ite}}
  213. </view>
  214. <view class="lable flex justify-center align-center" v-if="item.couponList" style="border-radius: 4rpx;border: 1rpx solid red;background-color: #ffffff;color: red;box-sizing: border-box;" v-for="(it,ide) in item.couponList" :key="ide">
  215. <text>优惠券</text>
  216. <text style="margin-left: 3px;">|</text>
  217. <text style="margin-left: 3px;">满{{it.minMoney}}减{{it.money}}</text>
  218. </view>
  219. </view>
  220. </view>
  221. </view>
  222. <view class="flex margin-top-xs">
  223. <view v-for="(ite,ind) in item.goodsList" :key='ind'
  224. @click.stop="goDet(ite.goodsId,item.shopId)" style="width: 33%;">
  225. <image :src="ite.goodsCover" style="width: 120rpx;height: 120rpx;" class="radius"
  226. mode="">
  227. </image>
  228. <view class="u-line-1 text-df text-bold margin-top-xs">{{ite.goodsName}}</view>
  229. <view class="text-bold margin-top-xs" style="color: #FD6416;"> <text
  230. class="text-sm">¥</text> {{ite.goodsMoney}}</view>
  231. </view>
  232. </view>
  233. </view>
  234. </view>
  235. </view>
  236. <!-- <empty v-if="!shopList.length" ></empty> -->
  237. <view class="page-box" v-if="!shopList.length">
  238. <view class="centre" v-if="XCXIsSelect == '是'">
  239. <image src="../../static/images/empty.png" mode=""></image>
  240. <view class="tips">暂无内容</view>
  241. </view>
  242. <view class="centre" v-else-if="XCXIsSelect == '否'">
  243. <image style="width: 345px;height: 140px;" src="https://mxys.chuanghai-tech.com/img/20240315/12fa3c96351f4f10abae1ba251d4c284.jpg" mode=""></image>
  244. </view>
  245. </view>
  246. <!-- 打样提示 -->
  247. <view v-if="hintShow" class="hintPopul" @click.stop="hintShow=false">
  248. <view class="content_">
  249. <image src="../../static/images/index/shop.png" mode="" style="width: 200rpx;height: 180rpx;">
  250. </image>
  251. <view class="text-xl text-bold">店铺打烊啦</view>
  252. <view class="hintText margin-top-sm text-gray">现在店铺已经打烊了,营业时间</view>
  253. <view class="margin-top-xs text-gray margin-bottom">{{shop.businessHours}}-{{shop.lockHours}}</view>
  254. <view class="skuBtn" @click="hintShow=false">知道了</view>
  255. </view>
  256. </view>
  257. <u-popup v-model="Authorization" mode="center" close-icon="close-circle" close-icon-pos="top-right"
  258. close-icon-color="#8f9298" close-icon-size="50">
  259. <view class="contentview">
  260. <view class="title">隐私保护指引</view>
  261. <view class="des" @click="openPrivacyContract">
  262. 在使用当前小程序服务之前,请仔细阅读<text
  263. style="color: #FF7F00;">{{privacyContractName}}</text>。如你同意{{privacyContractName}},请点击“同意”开始使用。
  264. </view>
  265. <view class="btns">
  266. <button class="item reject" @click="exitMiniProgram">拒绝</button>
  267. <button id="agree-btn" class="item agree" open-type="agreePrivacyAuthorization"
  268. @agreeprivacyauthorization="handleAgreePrivacyAuthorization">同意</button>
  269. </view>
  270. </view>
  271. </u-popup>
  272. <!-- 新人红包 -->
  273. <view class="hongbao" v-if="waimaiHB == '是' &&HBShow">
  274. <view style="width: 62%;margin: 0 auto;position: relative;">
  275. <view @click="HBShow=false"
  276. style="position: absolute;right: -10rpx;top: -10rpx;z-index: 999;;font-size: 60rpx;font-weight: bold;">
  277. X
  278. </view>
  279. <!-- @click="takemoney()" ../../static/images/index/hb_bg.png-->
  280. <image :src="Tupian('/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20240520171928.jpg')" class="hb_img"></image>
  281. <!-- <image src="../../static/images/index/hb_btn.png" class="hb_btn" @click="takemoney()"></image> -->
  282. </view>
  283. </view>
  284. <!-- 联系客服悬浮按钮区域 -->
  285. <view class="serviceBtn" @click="goChat">
  286. <img src="../../static/images/my/13.png" style="width: 60rpx;height: 60rpx;" mode="scaleToFill" />
  287. <view class="serviceBtn_text">
  288. 联系客服
  289. </view>
  290. </view>
  291. </view>
  292. </template>
  293. <script>
  294. import empty from '@/components/empty.vue'
  295. import {
  296. requestAndroidPermission,
  297. gotoAppPermissionSetting
  298. } from '@/components/permission.js'
  299. export default {
  300. components: {
  301. empty
  302. },
  303. data() {
  304. return {
  305. Authorization: false,
  306. privacyContractName: '',
  307. lookShow: false,
  308. currenthd: -1,
  309. hdlist: [],
  310. activityId: '',
  311. currents: 1,
  312. HBShow: false,
  313. isShow: false,
  314. hintShow: false,
  315. address: '暂无地址',
  316. city:'',
  317. bannerList: [{
  318. "id": 3,
  319. "createTime": "2021-12-24 17:52:27",
  320. "name": "banner3",
  321. "imageUrl": "https://diancan.xianmxkj.com/file/uploadPath/2021/12/24/0bfdbabcde9c62b42e77aecdb583033b.png",
  322. "state": 1,
  323. "classify": 1,
  324. "url": "",
  325. "sort": 3,
  326. "describess": "banner3"
  327. },
  328. {
  329. "id": 45,
  330. "createTime": "2021-12-24 17:52:27",
  331. "name": "banner",
  332. "imageUrl": "https://diancan.xianmxkj.com/file/uploadPath/2021/12/24/589d72b40a690147a48854a3b7f88953.png",
  333. "state": 1,
  334. "classify": 1,
  335. "url": "",
  336. "sort": 1,
  337. "describess": ""
  338. },
  339. ],
  340. gridData: [],
  341. page: 1,
  342. limit: 10,
  343. shopList: [],
  344. screen: '1',
  345. lng: '',
  346. lat: '',
  347. shopType: '1',
  348. shopTypeList: [{
  349. id: '0',
  350. shopTypeName: "全部"
  351. }],
  352. userId: '',
  353. src1: '../../static/images/index/xia.png',
  354. noticeList: {},
  355. show: false,
  356. typeShow: false,
  357. current: 1,
  358. sort: 1,
  359. fabuclassifyId: '',
  360. typeName: '全部',
  361. fabuclassifyName: '筛选',
  362. shopTypeId: '',
  363. value1: 0,
  364. value2: 0,
  365. value3: 0,
  366. value4: 0,
  367. options1: [{
  368. label: '综合排序',
  369. value: 1,
  370. }],
  371. options2: [{
  372. value: '3',
  373. label: "距离优先"
  374. }],
  375. options3: [{
  376. value: '4',
  377. label: "销量优先"
  378. }],
  379. options4: [{
  380. id: '',
  381. select: true,
  382. shopTypeName: "全部"
  383. }],
  384. defaultIndex: [0, 0, 0, 0],
  385. filterData: [
  386. [{
  387. label: '综合排序',
  388. value: '1',
  389. }],
  390. [{
  391. label: '距离优先',
  392. value: '3',
  393. }],
  394. [{
  395. label: '销量优先',
  396. value: '4',
  397. }],
  398. [{
  399. label: '不限性别',
  400. value: '0',
  401. },
  402. {
  403. label: '限男生',
  404. value: 1,
  405. },
  406. {
  407. label: '限女生',
  408. value: 2,
  409. }
  410. ],
  411. ],
  412. shopStatus: '',
  413. shop: {},
  414. title: '综合排序',
  415. title1: '距离优先',
  416. title2: '销量优先',
  417. title3: '筛选',
  418. XCXIsSelect: '否',
  419. arr: [],
  420. showModal: true,
  421. shopId: '',
  422. totalCount: 0,
  423. newUserFlagWm: 2,
  424. waimaiHB: '否',
  425. tuiguang: '',
  426. tuiguangImg: '',
  427. huodongList: [],
  428. jxlist: [],
  429. huoList:[],//商户参与的活动
  430. token:""
  431. }
  432. },
  433. onLoad(e) {
  434. let that = this
  435. that.token = that.$queue.getData("token")
  436. that.userId = uni.getStorageSync('userId') ? uni.getStorageSync('userId') : ''
  437. that.getZiZhi();
  438. that.getBannerList()
  439. that.getGridList()
  440. that.getShopType()
  441. that.getNoticeList()
  442. // that.getHuoDongList() //活动列表
  443. that.getHuoDList() //活动轮播
  444. that.gethdlist();
  445. uni.getLocation({
  446. type: 'gcj02', //返回可以用于uni.openLocation的经纬度
  447. highAccuracyExpireTime: 100,
  448. success: function(res) {
  449. that.lat = res.latitude;
  450. that.lng = res.longitude;
  451. that.defaultAddress()
  452. // that.getShopList()
  453. },
  454. fail(e) {
  455. uni.showModal({
  456. title: '温馨提示',
  457. content: '您的定位权限未开启,请开启后再来刷新操作吧!',
  458. showCancel: true,
  459. cancelText: '取消',
  460. confirmText: '确认',
  461. success: res => {
  462. if (res.confirm) {
  463. // #ifdef MP-WEIXIN
  464. uni.openSetting({ // 打开设置页
  465. success(rea) {
  466. console.log(rea.authSetting)
  467. }
  468. });
  469. // #endif
  470. // #ifdef APP-PLUS
  471. gotoAppPermissionSetting()
  472. // #endif
  473. }
  474. }
  475. });
  476. }
  477. });
  478. console.log(that.lat, that.lng, '经纬度')
  479. // #ifdef MP-WEIXIN
  480. if (e.scene) {
  481. const scene = decodeURIComponent(e.scene);
  482. let list = scene.split(',');
  483. let shopId;
  484. if (list.length > 0) {
  485. shopId = list[0]; //获取shopid
  486. }
  487. // uni.setStorageSync('shopId',e.shopId)
  488. console.log(e, '首页')
  489. console.log(scene, '商铺id')
  490. console.log(shopId, 'shopId')
  491. if (shopId) {
  492. that.shopId = shopId
  493. }
  494. if (!that.userId) {
  495. uni.navigateTo({
  496. url: '/pages/public/login'
  497. })
  498. return;
  499. }
  500. setTimeout(function() {
  501. uni.navigateTo({
  502. url: '/pages/index/shop/index?shopId=' + that.shopId
  503. })
  504. }, 100)
  505. } else if (e.orderId) {
  506. uni.setStorageSync('orderId', e.orderId)
  507. if (!that.userId) {
  508. uni.navigateTo({
  509. url: '/pages/public/login'
  510. })
  511. return;
  512. }
  513. setTimeout(function() {
  514. uni.navigateTo({
  515. url: '/pages/index/shop/goodsList?shopId=' + e.shopId
  516. })
  517. }, 100)
  518. }
  519. try {
  520. wx.getPrivacySetting({
  521. success: res => {
  522. console.log("是否需要授权:", res.needAuthorization, "隐私协议的名称为:", res.privacyContractName)
  523. if (res.needAuthorization) {
  524. that.privacyContractName = res.privacyContractName;
  525. // this.$refs.popusAuthorization.open();
  526. that.Authorization = true;
  527. }
  528. },
  529. fail: () => {},
  530. complete: () => {},
  531. })
  532. } catch (e) {
  533. //TODO handle the exception
  534. }
  535. // #endif
  536. },
  537. onShow() {
  538. let that = this
  539. that.token = that.$queue.getData('token')
  540. that.$Request.get('/app/common/type/264').then(res => {
  541. if (res.code == 0) {
  542. // #ifdef MP-WEIXIN
  543. that.XCXIsSelect = res.data.value;
  544. that.$queue.setData('XCXIsSelect', res.data.value);
  545. that.$queue.setData('shangxianSelect', res.data.value);
  546. // #endif
  547. // #ifndef MP-WEIXIN
  548. that.$queue.setData('XCXIsSelect', '是');
  549. that.$queue.setData('shangxianSelect', '是');
  550. that.XCXIsSelect = '是'
  551. // #endif
  552. }
  553. });
  554. that.getHuoDList() //活动轮播
  555. that.gethdlist();
  556. uni.getLocation({
  557. type: 'gcj02', //返回可以用于uni.openLocation的经纬度
  558. success: function(res) {
  559. console.log(res)
  560. that.lat = res.latitude;
  561. that.lng = res.longitude;
  562. that.defaultAddress()
  563. }
  564. });
  565. that.userId = uni.getStorageSync('userId') ? uni.getStorageSync('userId') : ''
  566. that.lng = uni.getStorageSync('lng') ? uni.getStorageSync('lng') : that.lng
  567. that.lat = uni.getStorageSync('lat') ? uni.getStorageSync('lat') : that.lat
  568. console.log(that.userId, '我的id')
  569. // if (this.lng && this.lat) {
  570. // that.defaultAddress()
  571. that.getjxShop(); //精选商家
  572. // }
  573. if (that.userId) {
  574. that.getUserInfo()
  575. that.$Request.getT('/app/common/type/266').then(res => { //订单取消通知
  576. if (res.code == 0) {
  577. if (res.data && res.data.value) {
  578. that.arr.push(res.data.value)
  579. }
  580. }
  581. })
  582. that.$Request.getT('/app/common/type/269').then(res => { //订单状态通知
  583. if (res.code == 0) {
  584. if (res.data && res.data.value) {
  585. that.arr.push(res.data.value)
  586. }
  587. }
  588. })
  589. // #ifdef MP-WEIXIN
  590. if (that.showModal) {
  591. that.openMsg()
  592. }
  593. // #endif
  594. }
  595. // this.getShopList()
  596. },
  597. onShareAppMessage(res) { //发送给朋友
  598. return {
  599. title: this.tuiguang,
  600. path: '/pages/index/index',
  601. imageUrl: this.tuiguangImg,
  602. }
  603. },
  604. onShareTimeline(res) { //分享到朋友圈
  605. return {
  606. title: this.tuiguang,
  607. path: '/pages/index/index',
  608. imageUrl: this.tuiguangImg,
  609. }
  610. },
  611. methods: {
  612. goChat() {
  613. if (this.token) {
  614. uni.navigateTo({
  615. url: '/my/setting/chat'
  616. })
  617. } else {
  618. this.bindlogin()
  619. }
  620. },
  621. bindlogin() {
  622. uni.navigateTo({
  623. url: '/pages/public/login'
  624. })
  625. },
  626. // 打开隐私协议页面
  627. openPrivacyContract() {
  628. let that = this;
  629. wx.openPrivacyContract({
  630. fail: () => {
  631. that.$queue.showToast('遇到错误无法打开!');
  632. }
  633. })
  634. },
  635. // 拒绝隐私协议
  636. exitMiniProgram() {
  637. // 直接退出小程序
  638. wx.exitMiniProgram()
  639. },
  640. // 同意隐私协议
  641. handleAgreePrivacyAuthorization() {
  642. // this.$refs.popusAuthorization.close();
  643. this.Authorization = false;
  644. let that = this;
  645. uni.getLocation({
  646. type: 'gcj02', //返回可以用于uni.openLocation的经纬度
  647. highAccuracyExpireTime: 100,
  648. success: function(res) {
  649. console.log(res)
  650. that.lat = res.latitude;
  651. that.lng = res.longitude;
  652. that.defaultAddress()
  653. // that.getShopList()
  654. },
  655. fail(e) {
  656. uni.showModal({
  657. title: '温馨提示',
  658. content: '您的定位权限未开启,请开启后再来刷新操作吧!',
  659. showCancel: true,
  660. cancelText: '取消',
  661. confirmText: '确认',
  662. success: res => {
  663. if (res.confirm) {
  664. // #ifdef MP-WEIXIN
  665. uni.openSetting({ // 打开设置页
  666. success(rea) {
  667. console.log(rea.authSetting)
  668. }
  669. });
  670. // #endif
  671. // #ifdef APP-PLUS
  672. gotoAppPermissionSetting()
  673. // #endif
  674. }
  675. }
  676. });
  677. }
  678. });
  679. },
  680. selectShow() {
  681. this.lookShow = !this.lookShow
  682. },
  683. //筛选活动
  684. searchhd(index, activityId) {
  685. if (index == this.currenthd) {
  686. this.page=1
  687. this.currenthd = -1
  688. this.activityId = '';
  689. this.shopList =[]
  690. this.getShopList()
  691. } else {
  692. console.log('eww','ll')
  693. this.page=1
  694. this.currenthd = index;
  695. this.activityId = activityId;
  696. this.shopList =[]
  697. // this.getShopList()
  698. this.huoDListSh()
  699. }
  700. },
  701. //获取所有活动
  702. gethdlist() {
  703. // this.$Request.get("/app/activityManage/getActivityList").then(res => {
  704. let data={
  705. page:1,
  706. limit:10,
  707. }
  708. this.$Request.get('/app/activity/page').then(res => {
  709. if (res.code == 0) {
  710. var total=res.totalCount
  711. let data={
  712. page:1,
  713. limit:total,
  714. }
  715. this.$Request.get('/app/activity/page').then(res => {
  716. if (res.code == 0) {
  717. res.data.list.map((item, index) => {
  718. if (item.id == 14) {
  719. res.data.list.splice(index, 1)
  720. }
  721. })
  722. this.hdlist = res.data.list
  723. }
  724. });
  725. }
  726. });
  727. },
  728. // 获取精选商家
  729. getjxShop() {
  730. let data = {
  731. activityId: 14,
  732. page: 1,
  733. limit: 4,
  734. lat: this.lat,
  735. lng: this.lng,
  736. }
  737. this.$Request.get("/app/activityManage/getShoActivityShopList", data).then(res => {
  738. if (res.code == 0) {
  739. this.jxlist = res.data.records
  740. }
  741. });
  742. },
  743. gotoList() {
  744. uni.navigateTo({
  745. url: '/running/huodong/list?activityId=14'
  746. })
  747. },
  748. gotohuodong(name,id,imageUrl, url) {
  749. uni.navigateTo({
  750. url: url + '?activityTitle=' + name+'&activityId='+id+'&imageUrl='+imageUrl
  751. })
  752. },
  753. // 获取活动轮播图
  754. getHuoDList() {
  755. let data = {
  756. classify: 12
  757. }
  758. this.$Request.get("/app/banner/selectBannerList", data).then(res => {
  759. if (res.code == 0) {
  760. let arr = []
  761. arr = res.data
  762. arr.map((item, index) => {
  763. if (item.name == '推荐商家') {
  764. arr.splice(index, 1)
  765. }
  766. })
  767. this.huodongList = arr
  768. }
  769. });
  770. },
  771. swiperChange(e) {
  772. if (this.huodongList.length - 1 == e.detail.current) {
  773. this.currents = 0
  774. } else {
  775. this.currents = e.detail.current + 1
  776. }
  777. // this.moneys = this.swiper[this.currents].mysteryBoxTypePrice
  778. // this.boxType = this.swiper[this.currents].mysteryBoxTypeId
  779. // this.getgoodsList(this.swiper[this.currents].mysteryBoxTypeId)
  780. },
  781. //活动列表
  782. getHuoDongList() {
  783. // huodongList
  784. //
  785. // this.$Request.getT('/app/activityManage/getActivityList').then(res => {
  786. let data={
  787. page:1,
  788. limit:10,
  789. }
  790. this.$Request.getT('/app/activity/page',data).then(res => {
  791. if (res.code === 0) {
  792. var total=res.totalCount
  793. let data={
  794. page:1,
  795. limit:total,
  796. }
  797. this.$Request.getT('/app/activity/page',data).then(res => {
  798. if (res.code === 0) {
  799. this.huodongList = res.data.list
  800. }
  801. });
  802. }
  803. });
  804. },
  805. // 分享文案和图片
  806. getZiZhi() {
  807. this.$Request.getT('/app/common/type/239').then(res => {
  808. if (res.code === 0) {
  809. this.tuiguang = res.data.value;
  810. }
  811. });
  812. this.$Request.getT('/app/common/type/238').then(res => {
  813. if (res.code === 0) {
  814. this.tuiguangImg = res.data.value;
  815. }
  816. });
  817. },
  818. // 红包
  819. takemoney() {
  820. this.$Request.getT('/app/userinfo/getNewUserRedPacketWm').then(res => {
  821. console.log(res.code)
  822. if (res.code == 0) {
  823. this.HBShow = false
  824. this.getUserInfo()
  825. setTimeout(function() {
  826. uni.navigateTo({
  827. url: '/my/coupon/index'
  828. })
  829. }, 100)
  830. }
  831. });
  832. },
  833. getSelect(e) {
  834. this.options4.forEach(res => {
  835. if (res.id == e.id) {
  836. res.select = true
  837. this.page = 1
  838. this.shopTypeId = e.id
  839. this.getShopList();
  840. this.isShow = false
  841. } else {
  842. res.select = false
  843. }
  844. })
  845. },
  846. // 获取用户信息
  847. getUserInfo() {
  848. this.$Request.getT('/app/user/selectUserMessage').then(res => {
  849. console.log(res)
  850. if (res.code == 0) {
  851. this.shopStatus = res.data.shopStatus
  852. this.newUserFlagWm = res.data.newUserFlagWm
  853. if (this.newUserFlagWm == 1) {
  854. this.waimaiHB = this.$queue.getData('waimaiHB');
  855. if (this.waimaiHB === '是') {
  856. this.HBShow = true
  857. }
  858. } else {
  859. this.HBShow = false
  860. }
  861. }
  862. });
  863. },
  864. // 获取公告
  865. getNoticeList() {
  866. let data = {
  867. page: 1,
  868. limit: 100
  869. }
  870. this.$Request.get("/app/common/type/432", data).then(res => {
  871. if (res.code == 0) {
  872. this.noticeList = res.data
  873. // console.log(this.noticeList,999);
  874. }
  875. });
  876. },
  877. confirm(e) {
  878. this.isShow = false
  879. this.page = 1
  880. this.current = e;
  881. this.getShopList();
  882. },
  883. // 获取轮播图
  884. getBannerList() {
  885. let data = {
  886. classify: 1
  887. }
  888. this.$Request.get("/app/banner/selectBannerList", data).then(res => {
  889. if (res.code == 0) {
  890. this.bannerList = res.data
  891. }
  892. });
  893. },
  894. // 获取轮播图
  895. getGridList() {
  896. let data = {
  897. classify: 4
  898. }
  899. this.$Request.get("/app/banner/selectBannerList", data).then(res => {
  900. if (res.code == 0) {
  901. this.gridData = res.data
  902. }
  903. });
  904. },
  905. // 商户类型
  906. getShopType() {
  907. this.$Request.getT('/app/shoptype/selectShopTypeList').then(res => {
  908. if (res.code == 0) {
  909. // this.shopTypeList = [...this.shopTypeList ,...res.data]
  910. res.data.forEach(res => {
  911. res.select = false
  912. })
  913. this.options4 = [...this.options4, ...res.data]
  914. console.log(this.options4, '+++++++++++++++++++')
  915. }
  916. })
  917. },
  918. //活动下的商户
  919. huoDListSh(){
  920. let data = {
  921. page: this.page,
  922. limit: this.limit,
  923. screen: this.current,
  924. shopTypeId: this.shopTypeId,
  925. lng: this.lng,
  926. lat: this.lat,
  927. // activityId: this.activityId,
  928. city:this.city,
  929. }
  930. this.$Request.getT('/app/goods/selectShop', data).then(res => {
  931. if (res.code == 0) {
  932. var totalCount=res.data.totalCount
  933. let data = {
  934. page: this.page,
  935. limit: totalCount,
  936. }
  937. console.log(data,this.activityId)
  938. this.$Request.getT(`/app/activity-shop/activity-shop-page/${this.activityId}`, data).then(res => {
  939. console.log(res,'hhhhhh2h')
  940. if (res.code == 0) {
  941. var huodongList=[]
  942. huodongList=res.data.list
  943. let data = {
  944. page: this.page,
  945. limit: totalCount,
  946. screen: this.current,
  947. shopTypeId: this.shopTypeId,
  948. lng: this.lng,
  949. lat: this.lat,
  950. // activityId: this.activityId,
  951. city:this.city,
  952. }
  953. this.$Request.getT('/app/goods/selectShop', data).then(res => {
  954. if (res.code == 0) {
  955. this.totalCount = res.data.totalCount
  956. res.data.list.forEach(ret => {
  957. if (ret.distance > 1000) {
  958. ret.distance = Number((ret.distance / 1000)).toFixed(2) + "km"
  959. } else {
  960. if (ret.distance == 0) {
  961. ret.distance = "0m";
  962. } else {
  963. ret.distance = Number(ret.distance).toFixed(1) + "m";
  964. }
  965. }
  966. ret.shopScore = ret.shopScore.toFixed(1)
  967. ret.shopLable = ret.shopLable ? ret.shopLable.split(',') : ''
  968. ret.shopCover = ret.shopCover ? ret.shopCover.split(',') :
  969. '../../static/logo.png'
  970. ret.errandTime = Math.round(ret.errandTime)
  971. })
  972. var shopList=[]
  973. shopList=res.data.list
  974. for (let i = 0; i < shopList.length; i++) {
  975. let item1 = shopList[i];
  976. // 内层循环遍历array2
  977. for (let j = 0; j < huodongList.length; j++) {
  978. let item2 = huodongList[j];
  979. // 检查id是否相等
  980. if (item1.shopId === item2.shopId) {
  981. // 如果相等,将对象添加到matchedArray
  982. this.shopList.push(item1);
  983. // 如果只需要添加一次,则可以在这里退出内层循环
  984. // break;
  985. }
  986. }
  987. }
  988. // for(var i=0;i<shopList.length;i++){
  989. // let item1 = shopList[i];
  990. // for(var j=0;j<huodongList.length;j++){
  991. // let item2 = huodongList[j];
  992. // console.log(shopList[i].shopId==huodongList[j].shopId,'oppoo')
  993. // if(item1.shopId==item2.shopId){
  994. // this.shopList.push(item1)
  995. // console.log(this.shopList,'pp')
  996. // // return一次就退出
  997. // }else{
  998. // this.shopList =[]
  999. // }
  1000. // }
  1001. // }
  1002. }
  1003. })
  1004. }
  1005. })
  1006. }
  1007. uni.stopPullDownRefresh();
  1008. uni.hideLoading()
  1009. })
  1010. },
  1011. // 商户列表
  1012. getShopList() {
  1013. console.log(this.city,'city')
  1014. uni.setStorageSync('lng', this.lng);
  1015. uni.setStorageSync('lat', this.lat);
  1016. let data = {
  1017. page: this.page,
  1018. limit: this.limit,
  1019. screen: this.current,
  1020. shopTypeId: this.shopTypeId,
  1021. lng: this.lng,
  1022. lat: this.lat,
  1023. // activityId: this.activityId,
  1024. city:this.city,
  1025. }
  1026. console.log(data,'jjj')
  1027. this.$Request.getT('/app/goods/selectShop', data).then(res => {
  1028. console.log(res,'hhhhhh')
  1029. if (res.code == 0) {
  1030. this.totalCount = res.data.totalCount
  1031. res.data.list.forEach(ret => {
  1032. if (ret.distance > 1000) {
  1033. ret.distance = Number((ret.distance / 1000)).toFixed(2) + "km"
  1034. } else {
  1035. if (ret.distance == 0) {
  1036. ret.distance = "0m";
  1037. } else {
  1038. ret.distance = Number(ret.distance).toFixed(1) + "m";
  1039. }
  1040. }
  1041. ret.shopScore = ret.shopScore.toFixed(1)
  1042. ret.shopLable = ret.shopLable ? ret.shopLable.split(',') : ''
  1043. ret.shopCover = ret.shopCover ? ret.shopCover.split(',') :
  1044. '../../static/logo.png'
  1045. ret.errandTime = Math.round(ret.errandTime)
  1046. })
  1047. if (this.page == 1) {
  1048. this.shopList = res.data.list
  1049. } else {
  1050. this.shopList = [...this.shopList, ...res.data.list]
  1051. }
  1052. console.log(this.shopList)
  1053. }
  1054. uni.stopPullDownRefresh();
  1055. uni.hideLoading()
  1056. })
  1057. },
  1058. goNav(url) {
  1059. console.log(url)
  1060. if (this.userId) {
  1061. if (uni.getStorageSync('sendMsg')) {
  1062. console.log('授权+1')
  1063. wx.requestSubscribeMessage({
  1064. tmplIds: this.arr,
  1065. success(re) {
  1066. console.log(JSON.stringify(re), 111111111111)
  1067. var datas = JSON.stringify(re);
  1068. if (datas.indexOf("accept") != -1) {
  1069. // console.log(re)
  1070. }
  1071. },
  1072. fail: (res) => {
  1073. // console.log(res)
  1074. }
  1075. })
  1076. }
  1077. uni.navigateTo({
  1078. url
  1079. })
  1080. } else {
  1081. uni.navigateTo({
  1082. url: '/pages/public/login'
  1083. })
  1084. }
  1085. },
  1086. goShopDet(url, e,shuzu) {
  1087. if (uni.getStorageSync('sendMsg')) {
  1088. console.log('授权+1')
  1089. wx.requestSubscribeMessage({
  1090. tmplIds: this.arr,
  1091. success(re) {
  1092. console.log(JSON.stringify(re), 111111111111)
  1093. var datas = JSON.stringify(re);
  1094. if (datas.indexOf("accept") != -1) {
  1095. // console.log(re)
  1096. }
  1097. },
  1098. fail: (res) => {
  1099. // console.log(res)
  1100. }
  1101. })
  1102. }
  1103. this.shop = e
  1104. // console.log(e, '当前店铺')
  1105. let myDate = new Date();
  1106. let hours = myDate.getHours();
  1107. let minute = myDate.getMinutes();
  1108. let openTime = this.shop.businessHours.split(':')[0] //开始小时
  1109. let openTime1 = this.shop.businessHours.split(':')[1] //开始分钟
  1110. let closeTime = this.shop.lockHours.split(':')[0] //结束小时
  1111. let closeTime1 = this.shop.lockHours.split(':')[1] //结束分钟.
  1112. console.log(hours)
  1113. console.log(minute)
  1114. console.log(openTime)
  1115. console.log(openTime1)
  1116. console.log(closeTime)
  1117. console.log(closeTime1)
  1118. console.log(minute >= closeTime1)
  1119. if (hours < openTime) {
  1120. this.hintShow = true
  1121. return
  1122. } else if (hours == openTime && minute < openTime1) {
  1123. this.hintShow = true
  1124. return
  1125. } else if (hours > closeTime) {
  1126. this.hintShow = true
  1127. return
  1128. } else if (hours == closeTime && minute >= closeTime1) {
  1129. this.hintShow = true
  1130. return
  1131. }
  1132. console.log(url)
  1133. let items = encodeURIComponent(JSON.stringify(shuzu));
  1134. if (this.userId) {
  1135. uni.navigateTo({
  1136. url:'/pages/index/shop/index?shopId='+url+'&huoListss='+items
  1137. })
  1138. } else {
  1139. uni.navigateTo({
  1140. url: '/pages/public/login'
  1141. })
  1142. }
  1143. },
  1144. defaultAddress() {
  1145. if (uni.getStorageSync('city')) {
  1146. this.address = uni.getStorageSync('city')
  1147. this.lng = uni.getStorageSync('lng')
  1148. this.lat = uni.getStorageSync('lat')
  1149. this.page = 1
  1150. this.getShopList()
  1151. return
  1152. }
  1153. let data = {
  1154. page: 1,
  1155. limit: 1000
  1156. }
  1157. this.$Request.get('/app/address/selectAddressList', data).then(res => {
  1158. if (res.code == 0 && res.data.list.length) {
  1159. this.address = res.data.list[0].addressDetail
  1160. this.city=res.data.list[0].city
  1161. this.lng = res.data.list[0].lng
  1162. this.lat = res.data.list[0].lat
  1163. res.data.list.forEach(res => {
  1164. if (res.addressDefault) {
  1165. this.address = res.addressDetail
  1166. this.city=res.city
  1167. this.lng = res.lng
  1168. this.lat = res.lat
  1169. }
  1170. })
  1171. console.log('选择的经纬度', this.lng, this.lat)
  1172. } else {
  1173. let data = {
  1174. lat: this.lat,
  1175. lng: this.lng
  1176. }
  1177. this.$Request.get("/app/address/selectCity", data).then(res => {
  1178. if (res.code == 0) {
  1179. this.address = res.data.city
  1180. // console.log(3333333333)
  1181. // this.getShopList()
  1182. }
  1183. });
  1184. }
  1185. this.page = 1
  1186. this.getShopList()
  1187. })
  1188. },
  1189. goAddress() {
  1190. let userId = this.$queue.getData('userId');
  1191. if (!userId) {
  1192. uni.navigateTo({
  1193. url: '/pages/public/login'
  1194. })
  1195. return
  1196. }
  1197. uni.navigateTo({
  1198. url: '/pages/index/selectCampus'
  1199. })
  1200. },
  1201. // 查看金刚区详情
  1202. goDetail(item) {
  1203. if (uni.getStorageSync('sendMsg')) {
  1204. console.log('授权+1',this.arr)
  1205. wx.requestSubscribeMessage({
  1206. tmplIds: this.arr,
  1207. success(re) {
  1208. console.log(JSON.stringify(re), 111111111111)
  1209. var datas = JSON.stringify(re);
  1210. if (datas.indexOf("accept") != -1) {
  1211. // console.log(re)
  1212. }
  1213. },
  1214. fail: (res) => {
  1215. // console.log(res)
  1216. }
  1217. })
  1218. }
  1219. let userId = this.$queue.getData('userId');
  1220. if (!userId) {
  1221. uni.navigateTo({
  1222. url: '/pages/public/login'
  1223. })
  1224. return
  1225. }
  1226. //如果是小程序跳转就是设置这个
  1227. if (item.describes) {
  1228. uni.navigateToMiniProgram({
  1229. appId: item.describes,
  1230. path: item.classifyUrl,
  1231. success: res => {
  1232. // 打开成功
  1233. console.log("打开成功", res);
  1234. },
  1235. fail: err => {
  1236. console.log(err);
  1237. }
  1238. })
  1239. return
  1240. }
  1241. uni.navigateTo({
  1242. url: item.url
  1243. });
  1244. },
  1245. // 开启订阅消息
  1246. openMsg() {
  1247. console.log('订阅消息')
  1248. var that = this
  1249. uni.getSetting({
  1250. withSubscriptions: true, //是否获取用户订阅消息的订阅状态,默认false不返回
  1251. success(ret) {
  1252. console.log(ret.subscriptionsSetting, '------------------')
  1253. // if (ret.subscriptionsSetting.itemSettings && Object.keys(ret.subscriptionsSetting.itemSettings).length == 2) {
  1254. if (ret.subscriptionsSetting.itemSettings) {
  1255. uni.setStorageSync('sendMsg', true)
  1256. uni.openSetting({ // 打开设置页
  1257. success(rea) {
  1258. console.log(rea.authSetting)
  1259. }
  1260. });
  1261. } else { // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
  1262. console.log(99999)
  1263. uni.setStorageSync('sendMsg', false)
  1264. uni.showModal({
  1265. title: '提示',
  1266. content: '为了更好的体验,请绑定消息推送',
  1267. confirmText: '确定',
  1268. cancelText: '取消',
  1269. success: function(res) {
  1270. if (res.confirm) {
  1271. console.log(that.arr)
  1272. wx.requestSubscribeMessage({
  1273. tmplIds: that.arr,
  1274. success(re) {
  1275. console.log(JSON.stringify(re),
  1276. '++++++++++++++')
  1277. var datas = JSON.stringify(re);
  1278. if (datas.indexOf("accept") != -1) {
  1279. console.log(re)
  1280. uni.setStorageSync('sendMsg', true)
  1281. }
  1282. },
  1283. fail: (res) => {
  1284. console.log(res)
  1285. }
  1286. })
  1287. uni.setStorageSync('sendMsg', true)
  1288. console.log('确认')
  1289. that.showModal = false
  1290. } else if (res.cancel) {
  1291. console.log('取消')
  1292. uni.setStorageSync('sendMsg', false)
  1293. that.showModal = true
  1294. }
  1295. }
  1296. })
  1297. }
  1298. }
  1299. })
  1300. },
  1301. // 跳转商品详情
  1302. goDet(goodsId, shopId) {
  1303. let userId = this.$queue.getData('userId');
  1304. if (!userId) {
  1305. uni.navigateTo({
  1306. url: '/pages/public/login'
  1307. })
  1308. return
  1309. }
  1310. uni.navigateTo({
  1311. url: '/pages/index/shop/goodsDet?goodsId=' + goodsId + '&shopId=' + shopId + '&orderType=2'
  1312. })
  1313. },
  1314. },
  1315. onReachBottom: function() {
  1316. console.log('当前长度',this.shopList.length,this.totalCount)
  1317. if (this.shopList.length < this.totalCount) {
  1318. if(this.activityId==''){
  1319. wx.showLoading({
  1320. title: '加载中...',
  1321. mask: true, // 是否显示透明蒙层,防止触摸穿透
  1322. })
  1323. this.page = this.page + 1;
  1324. this.getShopList()
  1325. }
  1326. } else {
  1327. uni.showToast({
  1328. title: '已经到底了',
  1329. icon: 'none'
  1330. })
  1331. }
  1332. },
  1333. onPullDownRefresh: function() {
  1334. if(this.activityId==''){
  1335. this.page = 1;
  1336. this.getShopList()
  1337. }
  1338. },
  1339. }
  1340. </script>
  1341. <style lang="scss" scoped>
  1342. .privacy {
  1343. position: fixed;
  1344. top: 0;
  1345. right: 0;
  1346. bottom: 0;
  1347. left: 0;
  1348. background: rgba(0, 0, 0, .5);
  1349. z-index: 9999999;
  1350. display: flex;
  1351. align-items: center;
  1352. justify-content: center;
  1353. }
  1354. .contentview {
  1355. width: 632rpx;
  1356. padding: 48rpx;
  1357. box-sizing: border-box;
  1358. background: #fff;
  1359. border-radius: 16rpx;
  1360. }
  1361. .contentview .title {
  1362. text-align: center;
  1363. color: #333;
  1364. font-weight: bold;
  1365. font-size: 32rpx;
  1366. }
  1367. .contentview .des {
  1368. font-size: 26rpx;
  1369. color: #666;
  1370. margin-top: 40rpx;
  1371. text-align: justify;
  1372. line-height: 1.6;
  1373. }
  1374. .contentview .des .link {
  1375. color: #07c160;
  1376. text-decoration: underline;
  1377. }
  1378. button::after {
  1379. border: none;
  1380. }
  1381. .btns {
  1382. margin-top: 48rpx;
  1383. display: flex;
  1384. }
  1385. .btns .item {
  1386. justify-content: space-between;
  1387. width: 244rpx;
  1388. height: 80rpx;
  1389. display: flex;
  1390. align-items: center;
  1391. justify-content: center;
  1392. border-radius: 16rpx;
  1393. box-sizing: border-box;
  1394. border: none;
  1395. }
  1396. .btns .reject {
  1397. background: #f4f4f5;
  1398. color: #909399;
  1399. }
  1400. .btns .agree {
  1401. background: #07c160;
  1402. color: #fff;
  1403. }
  1404. .hd {
  1405. width: 100%;
  1406. height: auto;
  1407. // margin-top: 20rpx;
  1408. background-color: #ffffff;
  1409. .hd-box {
  1410. width: 686rpx;
  1411. height: 100%;
  1412. // padding-top: 20rpx;
  1413. padding-bottom: 20rpx;
  1414. .scroll-view_H {
  1415. width: 100%;
  1416. white-space: nowrap;
  1417. }
  1418. .hd-box-item {
  1419. display: inline-block;
  1420. padding: 10rpx 20rpx 10rpx 20rpx;
  1421. background-color: #F7F5F6;
  1422. font-size: 24rpx;
  1423. border-radius: 8rpx;
  1424. margin-right: 10rpx;
  1425. }
  1426. }
  1427. }
  1428. .select {
  1429. color: #FCD202;
  1430. }
  1431. .jxShop {
  1432. width: 100%;
  1433. height: 320rpx;
  1434. background-color: #ffffff;
  1435. .jxShop-box {
  1436. margin-top: 20rpx;
  1437. width: 686rpx;
  1438. height: 300rpx;
  1439. // background-color: #F7F5F6;
  1440. // background: linear-gradient(rgba(252,210,2,0.4) 1%,#fffdf2 100%);
  1441. // background: linear-gradient(#ffee99 1%,#fffbe5 100%);
  1442. background: #fff8d3;
  1443. border-radius: 16rpx;
  1444. .jxShop-box-c {
  1445. width: 626rpx;
  1446. height: 100%;
  1447. }
  1448. .jxShop-box-c-title {
  1449. width: 100%;
  1450. margin-top: 20rpx;
  1451. }
  1452. .jxShop-box-c-title-l {
  1453. color: #1A1A1A;
  1454. font-size: 34rpx;
  1455. font-weight: 800;
  1456. }
  1457. .jxShop-box-c-title-r {
  1458. color: #1E1F31;
  1459. font-size: 26rpx;
  1460. font-weight: 500;
  1461. }
  1462. .jxShop-box-c-list {
  1463. width: 100%;
  1464. height: 190rpx;
  1465. margin-top: 20rpx;
  1466. }
  1467. .jxShop-box-c-list-item {
  1468. width: 149rpx;
  1469. height: 100%;
  1470. background: #ffffff;
  1471. border-radius: 8px;
  1472. image {
  1473. width: 100%;
  1474. height: 114rpx;
  1475. border-radius: 8rpx 8rpx 0 0;
  1476. }
  1477. .jxShop-box-c-list-item-name {
  1478. width: 149rpx;
  1479. text-align: center;
  1480. font-size: 28rpx;
  1481. color: #1A1A1A;
  1482. font-weight: bold;
  1483. margin-top: 10rpx;
  1484. overflow: hidden;
  1485. white-space: nowrap;
  1486. text-overflow: ellipsis;
  1487. padding-left: 10rpx;
  1488. padding-right: 10rpx;
  1489. }
  1490. }
  1491. }
  1492. }
  1493. .huodong {
  1494. width: 100%;
  1495. height: 380rpx;
  1496. // margin-top: 20rpx;
  1497. background-color: #ffffff;
  1498. .huodong-box {
  1499. margin-top: 20rpx;
  1500. width: 686rpx;
  1501. height: 360rpx;
  1502. // background-color: #D4FCE2;
  1503. background-color: #fff8d3;
  1504. border-radius: 24rpx;
  1505. .huodong-box-c {
  1506. width: 646rpx;
  1507. height: 100%;
  1508. }
  1509. .huodong-box-c-title {
  1510. margin-top: 20rpx;
  1511. }
  1512. .huodong-box-c-title-l {
  1513. // color: #34CD40;
  1514. color: rgba(252, 210, 2, 1);
  1515. font-size: 44rpx;
  1516. font-weight: 600;
  1517. image {
  1518. width: 276rpx;
  1519. height: 65rpx;
  1520. }
  1521. // font-style: italic;
  1522. }
  1523. .huodong-box-c-title-r {
  1524. // background: linear-gradient(114deg, rgba(252, 210, 2, 0.2) 0%, rgba(252, 210, 2, 0.5) 50%, rgba(252, 210, 2, 1) 100%);
  1525. background-color: #FFE3C7;
  1526. border-radius: 40rpx;
  1527. color: #FF8D1A;
  1528. font-size: 26rpx;
  1529. font-weight: 600;
  1530. padding: 10rpx 20rpx;
  1531. }
  1532. .huodong-box-c-list {
  1533. width: 100%;
  1534. height: 320rpx;
  1535. margin-top: 10rpx;
  1536. }
  1537. .huodong-box-c-list-l {
  1538. width: 190rpx;
  1539. height: 250rpx;
  1540. background: linear-gradient(0deg, #34CD41 0%, #48DB19 100%);
  1541. border-radius: 24rpx;
  1542. }
  1543. .huodong-box-c-list-l-t {
  1544. width: 180rpx;
  1545. height: 240rpx;
  1546. border-radius: 24rpx;
  1547. background-color: #ffffff;
  1548. margin-top: 5rpx;
  1549. }
  1550. .huodong-box-c-list-l-t>image {
  1551. width: 160rpx;
  1552. height: 170rpx;
  1553. margin-top: 10rpx;
  1554. border-radius: 24rpx;
  1555. }
  1556. .huodong-box-c-list-l-t-b {
  1557. width: 100%;
  1558. height: 56rpx;
  1559. background-color: #E0F7F1;
  1560. color: #36CF3D;
  1561. font-size: 30rpx;
  1562. border-radius: 24rpx;
  1563. }
  1564. .huodong-box-c-list-l-t-t {
  1565. width: 100%;
  1566. text-align: center;
  1567. font-size: 36rpx;
  1568. // font-weight: bold;
  1569. font-weight: 600;
  1570. color: #ffffff;
  1571. }
  1572. .huodong-box-c-list-c {
  1573. width: 220rpx;
  1574. height: 280rpx;
  1575. background: linear-gradient(0deg, #34CD41 0%, #48DB19 100%);
  1576. border-radius: 24rpx;
  1577. }
  1578. .huodong-box-c-list-c-t {
  1579. width: 211rpx;
  1580. height: 270rpx;
  1581. border-radius: 24rpx;
  1582. background-color: #ffffff;
  1583. margin-top: 5rpx;
  1584. }
  1585. .huodong-box-c-list-c-t>image {
  1586. width: 186rpx;
  1587. height: 190rpx;
  1588. margin-top: 10rpx;
  1589. border-radius: 24rpx;
  1590. }
  1591. .huodong-box-c-list-c-b {
  1592. width: 100%;
  1593. height: 70rpx;
  1594. background-color: #E0F7F1;
  1595. color: #36CF3D;
  1596. font-size: 30rpx;
  1597. border-radius: 24rpx;
  1598. }
  1599. .huodong-box-c-list-c-t-t {
  1600. width: 100%;
  1601. text-align: center;
  1602. font-size: 36rpx;
  1603. // font-weight: bold;
  1604. font-weight: 600;
  1605. color: #ffffff;
  1606. }
  1607. }
  1608. }
  1609. .search-btn {
  1610. width: 132rpx;
  1611. height: 80rpx;
  1612. font-size: 28rpx;
  1613. text-align: center;
  1614. line-height: 80rpx;
  1615. background: #FFAF5E;
  1616. border-radius: 36px;
  1617. }
  1618. .address {
  1619. width: 100%;
  1620. background-color: #FFAF5E;
  1621. display: flex;
  1622. align-items: center;
  1623. // #ifndef H5
  1624. position: fixed;
  1625. top: 0;
  1626. height: 180rpx;
  1627. // line-height: 260rpx;
  1628. padding: 80rpx 34rpx 0rpx;
  1629. // #endif
  1630. // #ifdef H5
  1631. height: 80rpx;
  1632. line-height: 80rpx;
  1633. padding: 0 34rpx;
  1634. // #endif
  1635. font-size: 32rpx;
  1636. z-index: 999;
  1637. .address_name {
  1638. max-width: 90%;
  1639. overflow: hidden;
  1640. text-overflow: ellipsis;
  1641. white-space: nowrap;
  1642. }
  1643. }
  1644. .lable {
  1645. border: 1rpx solid #FFE6D9;
  1646. height: 40rpx;
  1647. padding: 0 14rpx;
  1648. background: #FFE6D9;
  1649. border-radius: 4rpx;
  1650. font-weight: 500;
  1651. color: #FD6416;
  1652. font-size: 20rpx;
  1653. margin-right: 10rpx;
  1654. margin-bottom: 10rpx;
  1655. }
  1656. .tabs {
  1657. margin-bottom: 20rpx;
  1658. display: flex;
  1659. justify-content: space-between;
  1660. align-items: center;
  1661. }
  1662. .tabs_name {
  1663. flex: 1;
  1664. /* display: inline-block; */
  1665. text-align: center;
  1666. margin-bottom: 30rpx 0;
  1667. position: relative;
  1668. display: flex;
  1669. /* justify-content: space-between; */
  1670. align-items: center;
  1671. }
  1672. .tabs_name view {
  1673. margin: 0 auto;
  1674. display: flex;
  1675. align-items: center;
  1676. }
  1677. .tabs_2 {
  1678. /* width: 30%; */
  1679. }
  1680. .actives {
  1681. color: #007AFF;
  1682. }
  1683. .tabsicon {
  1684. position: absolute;
  1685. top: 0;
  1686. right: 22rpx;
  1687. width: 20rpx;
  1688. height: 40rpx;
  1689. z-index: 1;
  1690. }
  1691. .tabs_icon {
  1692. width: 12rpx;
  1693. height: 8rpx;
  1694. z-index: 1;
  1695. margin-left: 10rpx;
  1696. }
  1697. .icon1 {
  1698. /* position: absolute; */
  1699. /* top: 6rpx; */
  1700. }
  1701. .icon2 {
  1702. position: absolute;
  1703. bottom: 6rpx;
  1704. }
  1705. .page-box {
  1706. // position: relative;
  1707. // z-index: 0;
  1708. // top: 70px;
  1709. }
  1710. .centre {
  1711. margin: auto;
  1712. height: 400rpx;
  1713. text-align: center;
  1714. font-size: 32rpx;
  1715. }
  1716. .centre image {
  1717. width: 387rpx;
  1718. height: 341rpx;
  1719. margin: 40rpx auto 20rpx;
  1720. }
  1721. .centre .tips {
  1722. font-size: 32rpx;
  1723. color: #2F3044;
  1724. margin: 20rpx 0 40rpx;
  1725. font-weight: 700;
  1726. }
  1727. .hintPopul {
  1728. width: 100%;
  1729. height: 100%;
  1730. position: fixed;
  1731. top: 0;
  1732. background: rgba(0, 0, 0, .4);
  1733. z-index: 999;
  1734. }
  1735. .content_ {
  1736. position: absolute;
  1737. left: 0;
  1738. right: 0;
  1739. top: 0;
  1740. bottom: 0;
  1741. margin: auto;
  1742. text-align: center;
  1743. width: 500rpx;
  1744. height: 400rpx;
  1745. border-radius: 20rpx;
  1746. background-color: #fff;
  1747. padding-top: 120rpx;
  1748. }
  1749. .content_ image {
  1750. position: absolute;
  1751. top: -50rpx;
  1752. left: 0;
  1753. right: 0;
  1754. margin: auto;
  1755. }
  1756. .hintText {
  1757. font-size: 30rpx;
  1758. }
  1759. .skuBtn {
  1760. width: 460rpx;
  1761. height: 60rpx;
  1762. line-height: 60rpx;
  1763. text-align: center;
  1764. background: #FCD202;
  1765. font-size: 28rpx;
  1766. border: 2rpx solid #FCD202;
  1767. color: #333333;
  1768. border-radius: 50rpx;
  1769. font-weight: 700;
  1770. margin: auto;
  1771. }
  1772. .hongbao {
  1773. width: 100%;
  1774. /* height: 100px; */
  1775. /* background: #007AFF; */
  1776. position: fixed;
  1777. top: 34%;
  1778. /* bottom: 50%; */
  1779. left: 0rpx;
  1780. right: 0rpx;
  1781. /* display: none; */
  1782. }
  1783. .hb_img {
  1784. width: 100%;
  1785. height: 535rpx;
  1786. }
  1787. .hb_btn {
  1788. width: 70%;
  1789. height: 72rpx;
  1790. position: absolute;
  1791. top: 315rpx;
  1792. left: 80rpx;
  1793. }
  1794. .serviceBtn{
  1795. position: fixed;
  1796. right: 52rpx;
  1797. bottom: 50rpx;
  1798. display: flex;
  1799. flex-direction: column;
  1800. align-items: center;
  1801. justify-content: center;
  1802. width: 140rpx;
  1803. height: 140rpx;
  1804. border-radius: 50%;
  1805. color: #fff;
  1806. font-size: 20rpx;
  1807. background-color: #3E8EF7;
  1808. box-shadow: 0 0 7rpx #000;
  1809. .serviceBtn_text{
  1810. margin-top: 5rpx;
  1811. }
  1812. }
  1813. </style>