index.vue 48 KB

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