index.vue 54 KB

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