index.vue 55 KB

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