index.vue 48 KB

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