index.vue 48 KB

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