shop-enter.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707
  1. <template>
  2. <view class="shop-container">
  3. <!-- 顶部栏 -->
  4. <view class="shop-header-container">
  5. <image class="back-icon" src="../../../static/images/new-business/category/back.png" @click="back"></image>
  6. <view class="search-container">
  7. <text style="font-weight: bold;font-size: 36upx;">{{ transformation[currentType] }}</text>
  8. <tui-input
  9. v-if="ownSearchBar.includes(currentType)" v-model="queryInfo.search" label="" placeholder="社区商圈"
  10. clearable is-fillet padding="6upx 10upx 6upx 26upx"
  11. style="flex: 1;margin-left: 16upx;border: 2upx solid #EF5511;"
  12. >
  13. <template #right>
  14. <tui-button
  15. type="warning" width="120rpx" height="50rpx" shape="circle"
  16. style="background: #ee692f!important;"
  17. @click="queryInfo.search && (queryInfo.page = 1) && getNearByShopList()"
  18. >
  19. 搜索
  20. </tui-button>
  21. </template>
  22. </tui-input>
  23. </view>
  24. </view>
  25. <!-- 菜单栏 -->
  26. <view
  27. v-if="ownMenuBar.includes(currentType)"
  28. style="display: flex;align-items: center;flex-wrap: wrap;margin: 14upx 26upx 0;padding: 22upx 22upx 2upx;background-color: #ffffff;border-radius: 20upx;"
  29. >
  30. <view
  31. v-for="item in menuBarArr" :key="item.id" style="width: 20%;margin-bottom: 20upx;text-align: center;"
  32. @click="go(`/another-tf/another-user/shop/shop-deep?id=${item.id}&name=${item.storeName}`)"
  33. >
  34. <view>
  35. <BeeIcon
  36. :size="34"
  37. :src="item.picUrl ? common.seamingImgUrl(item.picUrl) : require('../../../static/images/index/design.png')"
  38. >
  39. </BeeIcon>
  40. </view>
  41. <view style="margin-top: 6upx;font-size: 26upx;white-space: nowrap;">{{ item.storeName }}</view>
  42. </view>
  43. </view>
  44. <!-- 特殊显示菜单栏 -->
  45. <view v-if="ownSpecialLineMenuBar.includes(currentType)" style="margin: 14upx 26upx 0;">
  46. <view
  47. v-if="menuBarArr.slice(0, -5).length"
  48. style="display: flex;align-items: center;flex-wrap: wrap;margin-bottom: 14upx;padding: 22upx 22upx 2upx;background-color: #ffffff;border-radius: 20upx;"
  49. >
  50. <view
  51. v-for="item in menuBarArr.slice(0, -5)" :key="item.id"
  52. style="width: 20%;margin-bottom: 20upx;text-align: center;"
  53. @click="go(`/another-tf/another-user/shop/shop-deep?id=${item.id}&name=${item.storeName}`)"
  54. >
  55. <view>
  56. <BeeIcon
  57. :size="34"
  58. :src="item.picUrl ? common.seamingImgUrl(item.picUrl) : require('../../../static/images/index/design.png')"
  59. >
  60. </BeeIcon>
  61. </view>
  62. <view style="margin-top: 6upx;font-size: 26upx;white-space: nowrap;">{{ item.storeName }}</view>
  63. </view>
  64. </view>
  65. <view v-if="menuBarArr.length" style="display: flex;overflow-x: auto;">
  66. <view
  67. v-for="item in menuBarArr.slice(-5)" :key="item.id"
  68. style="display: flex;align-items: center;margin-right: 24upx;padding: 12upx 20upx;background-color: #ffffff;"
  69. @click="go(`/another-tf/another-user/shop/shop-deep?id=${item.id}&name=${item.storeName}`)"
  70. >
  71. <view>
  72. <BeeIcon
  73. :size="18" style="line-height: 1;"
  74. :src="item.picUrl ? common.seamingImgUrl(item.picUrl) : require('../../../static/images/index/design.png')"
  75. >
  76. </BeeIcon>
  77. </view>
  78. <view style="margin-left: 12upx;font-size: 26upx;white-space: nowrap;">{{ item.storeName }}</view>
  79. </view>
  80. </view>
  81. </view>
  82. <!-- 限时秒杀 -->
  83. <view
  84. v-if="ownLimitedTimeSeckill.includes(currentType)"
  85. style="margin: 14upx 26upx 0;padding: 22upx;background: linear-gradient(122deg, #FDF3F1 2%, #FEEAEC 6%, #FFFBEF 12%, #FFFFFF 64%);border-radius: 20upx;"
  86. >
  87. <view style="display: flex;align-items: center;">
  88. <text style="font-size: 34upx;font-weight: bold;">限时秒杀</text>
  89. <view
  90. style="display: flex;align-items: center;margin-left: 18upx;background-color: #fce5df;border-radius: 20upx;"
  91. >
  92. <view
  93. style="width: 110upx;height: 36upx;padding: 6upx 12upx;font-size: 28upx;color: #ffffff;text-align: center;background-color: #f15d43;border-radius: 20upx 0 26upx 20upx;clip-path: polygon(0upx 0upx, 134upx 0, 124upx 8upx, 124upx 48upx, 0 48upx);"
  94. >
  95. <text style="margin-left: -10upx;">距结束</text>
  96. </view>
  97. <view style="font-size: 26upx;font-weight: bold;color: #f84715;padding: 0 14upx 0;">01:02:15</view>
  98. </view>
  99. </view>
  100. <view style="margin-top: 20upx;">
  101. <swiper autoplay vertical style="width: 100%;height: 160upx;">
  102. <swiper-item
  103. v-for="(item, index) in limitedTimeSeckillArr" :key="index"
  104. style="display: flex;justify-content: space-between;align-items: center;"
  105. >
  106. <view
  107. v-for="(part, count) in item" :key="count"
  108. style="display: flex;align-items: center;justify-content: space-between;width: 49%;height: 100%;overflow: hidden;"
  109. @click="go(`/pages/prod/prod?goodsId=${part.id}`)"
  110. >
  111. <view>
  112. <BeeIcon
  113. width="180upx" height="150upx" style="width: fit-content;border-radius: 22upx;overflow: hidden;"
  114. :src="item.url || require('../../../static/images/index/explosion.webp')"
  115. >
  116. </BeeIcon>
  117. <view style="height: 10upx;margin: 0 20upx;background-color: #c8c9b7;border-radius: 0 0 20upx 20upx;">
  118. </view>
  119. </view>
  120. <view
  121. style="flex: 1;display: flex;flex-direction: column;justify-content: space-around;width: 0;height: 100%;margin-left: 20upx;"
  122. >
  123. <view style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{ part.name }}</view>
  124. <view
  125. style="font-size: 26upx;color: #9e9e9e;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;"
  126. >
  127. {{ part.typeName }}
  128. </view>
  129. <view style="display: flex;flex-wrap: wrap;color: #ef530e;">
  130. <text>
  131. <text style="font-size: 24upx;">¥</text>
  132. <text style="font-weight: bold;">{{ part.price }}</text>
  133. </text>
  134. <text
  135. style="padding: 4upx 14upx;margin-left: 10upx;font-size: 24upx;border: 1upx solid #f9c1a6;border-radius: 16upx;"
  136. >
  137. {{ part.discount }}折
  138. </text>
  139. </view>
  140. </view>
  141. </view>
  142. </swiper-item>
  143. </swiper>
  144. </view>
  145. </view>
  146. <!-- 类别选择框(额外的同‘一级分类’的分类) -->
  147. <view v-if="ownSelectionBox.includes(currentType)" style="margin: 14upx 26upx 0;" class="selection-box-tab">
  148. <tui-tab
  149. :tabs="selectionBoxArr" :current="selectionBoxNum" scroll background-color="transparent"
  150. :size="32" bold
  151. bottom="6upx" color="#222229" selected-color="#222229" slider-bg-color="#ef530e"
  152. slider-height="4px"
  153. @change="(e) => selectionBoxNum = e.index"
  154. ></tui-tab>
  155. </view>
  156. <!-- 首要标签筛选框 -->
  157. <view v-if="ownPrimaryFilterBox.includes(currentType)" style="margin: 14upx 26upx 0;">
  158. <StorePrimaryFilterBox :type="currentType" @select="handleSelectPrimaryFilter"></StorePrimaryFilterBox>
  159. </view>
  160. <!-- 次要排序筛选框 -->
  161. <view v-if="ownSecondaryFilterBox.includes(currentType)" style="margin: 14upx 26upx 0;">
  162. <StoreSecondaryFilterBox @select="handleSelectSecondaryFilter"></StoreSecondaryFilterBox>
  163. </view>
  164. <!-- 酒店特殊中间结构 -->
  165. <view v-if="ownSpecialHotelBox.includes(currentType)">
  166. <view
  167. style="padding: 200upx 26upx 0;background: url('~@/../static/images/new-business/category/hotel-img.png') no-repeat center top/contain;"
  168. >
  169. <view style="padding: 28upx 22upx;background-color: #ffffff;border-radius: 24upx;">
  170. <view class="special-hotel-tab">
  171. <tui-tab
  172. :tabs="['国内', '民宿公寓', '钟点房']" :current="specialHotelBoxObj.tabIndex" scroll
  173. background-color="transparent" :size="32" bold bottom="6upx"
  174. color="#222229" selected-color="#222229"
  175. slider-bg-color="#ef530e" slider-height="3px"
  176. @change="(e) => specialHotelBoxObj.tabIndex = e.index"
  177. ></tui-tab>
  178. </view>
  179. <view style="display: flex;justify-content: space-between;align-items: center;margin-top: 18upx;">
  180. <TuanLocation free style="flex: 1;font-size: 38upx;font-weight: bold;">
  181. {{ $store.getters.currentShopCity || '定位失败' }}
  182. </TuanLocation>
  183. <view style="display: flex;align-items: center;padding-left: 16upx;border-left: 1upx solid #CDCDCD;">
  184. <BeeIcon
  185. :size="16" name="gps" color="#EF5613"
  186. style="padding: 2upx;border: 1upx solid #EF5613;border-radius: 50%;line-height: 1;"
  187. ></BeeIcon>
  188. <text style="margin-left: 14upx;font-size: 30upx;color: #EF5613;">我的位置</text>
  189. </view>
  190. </view>
  191. <view style="margin-top: 18upx;">
  192. <view
  193. style="display: flex;justify-content: space-between;align-items: center;"
  194. @click="$refs.refSpecialHotelBoxCalendar && $refs.refSpecialHotelBoxCalendar.show()"
  195. >
  196. <view style="display: flex;justify-content: space-between;align-items: center;">
  197. <view style="padding-right: 24upx;border-right: 1upx solid #D8D8D8;">
  198. <view style="display: flex;align-items: center;font-size: 24upx;">
  199. <BeeIcon :size="20" name="card-fill" color="#ef5613" style="margin-right: 6upx;"></BeeIcon>
  200. {{ specialHotelBoxObj.startDate === new Date().toLocaleString().substring(0, 10).replaceAll('/', '-')
  201. ? '今日' : '' }}入住
  202. </view>
  203. <view style="padding-top: 16upx;">
  204. <text style="color: #ef5613;">
  205. {{ specialHotelBoxObj.startDate.substring(5, 10).replaceAll('-', '月') }}日
  206. </text>
  207. <text v-if="specialHotelBoxObj.startWeek" style="padding-left: 8upx;font-size: 24upx;">
  208. {{
  209. specialHotelBoxObj.startWeek.replace('星期', '周') }}
  210. </text>
  211. </view>
  212. </view>
  213. <view style="padding-left: 24upx;">
  214. <view style="display: flex;align-items: center;font-size: 24upx;">
  215. <BeeIcon :size="20" name="friendadd-fill" color="#ef5613" style="margin-right: 6upx;"></BeeIcon>
  216. {{ specialHotelBoxObj.endDate === new Date(Date.now() + 24 * 60 * 60 *
  217. 1000).toLocaleString().substring(0, 10).replaceAll('/', '-') ? '明日' : '' }}离店
  218. </view>
  219. <view style="padding-top: 16upx;">
  220. <text>{{ specialHotelBoxObj.endDate.substring(5, 10).replaceAll('-', '月') }}日</text>
  221. <text v-if="specialHotelBoxObj.endWeek" style="padding-left: 8upx;font-size: 24upx;">
  222. {{
  223. specialHotelBoxObj.endWeek.replace('星期', '周') }}
  224. </text>
  225. </view>
  226. </view>
  227. </view>
  228. <view style="display: flex;justify-content: space-between;align-items: center;">
  229. <text style="margin-right: 6upx;font-size: 28upx;color: #014BB8;">
  230. 共{{
  231. (Date.parse(specialHotelBoxObj.endDate.replaceAll('-', '/')) -
  232. Date.parse(specialHotelBoxObj.startDate.replaceAll('-', '/'))) / (24 * 60 * 60 * 1000) }}晚
  233. </text>
  234. <BeeIcon :size="20" name="arrowright" color="#3D3D3D" style="line-height: 1;"></BeeIcon>
  235. </view>
  236. </view>
  237. <tui-calendar
  238. ref="refSpecialHotelBoxCalendar" :type="2" is-fixed
  239. :min-date="new Date().toLocaleString().substring(0, 10).replaceAll('/', '-')"
  240. :max-date="new Date(Date.now() + 180 * 24 * 60 * 60 * 1000).toLocaleString().substring(0, 10).replaceAll('/', '-')"
  241. @change="handleSelectSpecialHotelBoxCalendar"
  242. ></tui-calendar>
  243. </view>
  244. <view>
  245. <tui-input
  246. v-model="queryInfo.search" label="" placeholder="搜索酒店/地名/关键词" clearable
  247. padding="14upx 0upx"
  248. :margin-top="20"
  249. style="border-top: 1upx solid rgba(216, 216, 216, 0.5);border-bottom: 1upx solid rgba(216, 216, 216, 0.5);"
  250. >
  251. </tui-input>
  252. </view>
  253. <view style="margin-top: 20upx;">
  254. <tui-button
  255. type="warning" width="100%" height="82rpx"
  256. style="background: #ef5613!important;border-radius: 10upx;"
  257. >
  258. 查找酒店
  259. </tui-button>
  260. </view>
  261. </view>
  262. </view>
  263. <view
  264. style="margin: 14upx 26upx 0;padding: 22upx 22upx 36upx;background: linear-gradient(150deg, #FDF3F1 3%, #FEEAEC 6%, #FFFBEF 10%, #FFFFFF 45%);"
  265. >
  266. <view style="display: flex;align-items: center;">
  267. <text style="font-size: 34upx;font-weight: bold;">超低一口价</text>
  268. <view
  269. style="display: flex;align-items: center;margin-left: 18upx;background-color: #fce5df;border-radius: 20upx;"
  270. >
  271. <view
  272. style="width: 110upx;height: 36upx;padding: 6upx 12upx;font-size: 28upx;color: #ffffff;text-align: center;background-color: #f15d43;border-radius: 20upx 0 26upx 20upx;clip-path: polygon(0upx 0upx, 134upx 0, 124upx 8upx, 124upx 48upx, 0 48upx);"
  273. >
  274. <text style="margin-left: -10upx;">限时购</text>
  275. </view>
  276. <view style="font-size: 26upx;font-weight: bold;color: #f84715;padding: 0 14upx 0;">01:02:15</view>
  277. </view>
  278. </view>
  279. <view style="margin-top: 20upx;">
  280. <view
  281. v-for="(item, index) in specialHotelGoodsArr" :key="index" style="display: flex;margin-top: 18upx;"
  282. @click="go(`/pages/prod/prod?goodsId==${item.id}`)"
  283. >
  284. <view>
  285. <BeeIcon
  286. width="180upx" height="252upx" style="width: fit-content;border-radius: 22upx;overflow: hidden;"
  287. :src="item.url || require('../../../static/images/index/explosion.webp')"
  288. >
  289. </BeeIcon>
  290. </view>
  291. <view style="flex: 1;width: 0;margin-left: 20upx;">
  292. <view
  293. style="font-size: 34upx;font-weight: bold;word-break: break-all;display: -webkit-box;overflow: hidden;-webkit-box-orient: vertical;-webkit-line-clamp: 2;"
  294. >
  295. {{ item.name }}
  296. </view>
  297. <view
  298. style="margin-top: 6upx;font-size: 26upx;color: #9e9e9e;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;"
  299. >
  300. {{ item.typeName }}
  301. </view>
  302. <view style="margin-top: 8upx;">
  303. <view style="font-size: 26upx;color: #9e9e9e;text-align: right;">已售100+</view>
  304. <view style="display: flex;justify-content: flex-end;align-items: center;margin-top: 14upx;">
  305. <view style="margin-right: 12upx;">
  306. <view style="font-size: 26upx;color: #9e9e9e;text-align: right;">1晚价</view>
  307. <view style="display: flex;align-items: center;color: #ef530e;">
  308. <view style="font-size: 24upx;color: #9e9e9e;text-decoration: line-through;">¥444.44</view>
  309. <text>
  310. <text style="font-size: 24upx;">¥</text>
  311. <text style="font-size: 38upx;font-weight: bold;">{{ item.price }}</text>
  312. </text>
  313. <text
  314. style="padding: 2upx 10upx;margin-left: 10upx;font-size: 24upx;border: 1upx solid #f9c1a6;border-radius: 12upx;white-space: nowrap;"
  315. >
  316. {{ item.discount }}折
  317. </text>
  318. </view>
  319. </view>
  320. <tui-button
  321. type="warning" width="140rpx" height="72rpx" shape="circle"
  322. style="background: #ee6529!important;" @click="go(`/pages/prod/prod?goodsId==${item.id}`)"
  323. >
  324. 抢购
  325. </tui-button>
  326. </view>
  327. </view>
  328. </view>
  329. </view>
  330. </view>
  331. </view>
  332. </view>
  333. <view v-if="ownShopCardBox.includes(currentType) && nearbyShopList.length" style="margin: 14upx 26upx 0;">
  334. <CommonShop
  335. v-for="shop in nearbyShopList" :key="shop.shopId" :shop-info="shop" bottom-type="brief"
  336. margin="22upx 0"
  337. radius="20upx"
  338. ></CommonShop>
  339. </view>
  340. <view v-if="ownShopCardWithLineBox.includes(currentType) && nearbyShopList.length" style="margin: 14upx 26upx 0;">
  341. <CommonShop
  342. v-for="shop in nearbyShopList" :key="shop.shopId" :shop-info="shop" bottom-type="brief"
  343. margin="22upx 0"
  344. radius="20upx"
  345. >
  346. <view style="padding: 20upx 0">
  347. <view
  348. v-for="item in [{ id: 1, price: 288.88, originPrice: 444.44, name: '主题小包尊享休闲3小时gfgdfnbfngmhgmhgmghnh' }, { id: 2, price: 299.88, originPrice: 444.44, name: '主题小包尊享' }]"
  349. :key="item.id" style="display: flex;padding-left: 26upx;padding-right: 26upx;" class="shop-card-line"
  350. >
  351. <view style="text-align: right;padding-right: 26upx;">
  352. <view style="color: #EF530E;">¥{{ item.price }}</view>
  353. <view style="font-size: 28upx;color: #979797;">门市价:¥{{ item.originPrice }}</view>
  354. </view>
  355. <view style="flex: 1;width: 0;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
  356. <text
  357. style="padding: 2upx 6upx;margin-right: 16upx;font-size: 24upx;color: #ffffff;background-color: #ef5613;"
  358. >
  359. </text>
  360. <text style="font-size: 28upx;color: #a2a2a2;">{{ item.name }}</text>
  361. </view>
  362. </view>
  363. </view>
  364. </CommonShop>
  365. </view>
  366. <view v-if="ownShopCardWithGoodsBox.includes(currentType) && nearbyShopList.length" style="margin: 14upx 26upx 0;">
  367. <CommonShop
  368. v-for="shop in nearbyShopList" :key="shop.shopId" :shop-info="shop" bottom-type="brief"
  369. margin="22upx 0"
  370. radius="20upx"
  371. >
  372. <view style="padding: 20upx 26upx">
  373. <scroll-view scroll-x="true">
  374. <view style="display: flex;">
  375. <view
  376. v-for="item in [{ id: 1, price: 4.00, originPrice: 7.44, picUrl: 'https://jufeng-shop-1317254189.cos.ap-guangzhou.myqcloud.com/1699437546378-微信图片_20231108164901.jpg', name: '黄瓜一根约300g' }, { id: 2, price: 4.00, originPrice: 44.44, picUrl: 'https://jufeng-shop-1317254189.cos.ap-guangzhou.myqcloud.com/1700214488615-粤盐 加碘精制盐500克袋,3.5元.jpg', name: '粤盐 加碘精制盐500克袋' }, { id: 3, price: 5.00, originPrice: 14.74, picUrl: 'https://jufeng-shop-1317254189.cos.ap-guangzhou.myqcloud.com/1700214401740-茉莉香米500g,4.86元.jpg', name: '茉莉香米500g' }, { id: 4, price: 5.00, originPrice: 11.02, picUrl: 'https://jufeng-shop-1317254189.cos.ap-guangzhou.myqcloud.com/1700214433330-太太乐 鸡精调味料40克包,4.5元.jpg', name: '太太乐 鸡精调味料40克/包' }, { id: 5, price: 6.00, originPrice: 73.44, picUrl: 'https://jufeng-shop-1317254189.cos.ap-guangzhou.myqcloud.com/1700213979774-烧烤料(品牌随机),5.5.png', name: '烧烤料(品牌随机)' }, { id: 6, price: 6.00, originPrice: 99.20, picUrl: 'https://jufeng-shop-1317254189.cos.ap-guangzhou.myqcloud.com/1700214245309-国产 绿心猕猴桃一个约120克【维C】5.5元.jpg', name: '国产 绿心猕猴桃一个约120克【维C】' }]"
  377. :key="item.id"
  378. style="display: flex;flex-direction: column;justify-content: space-between;padding-right: 18upx;"
  379. >
  380. <view style="width: 160upx;">
  381. <tui-lazyload-img
  382. width="100%" height="168upx" mode="scaleToFill" radius="20upx"
  383. :src="item.picUrl"
  384. ></tui-lazyload-img>
  385. <view
  386. style="line-height: 1;word-break: break-all;display: -webkit-box;overflow: hidden;-webkit-box-orient: vertical;-webkit-line-clamp: 2;"
  387. >
  388. <text style="font-size: 24upx;">{{ item.name }}</text>
  389. </view>
  390. </view>
  391. <view style="margin-top: 14upx;display: flex;align-items: center;flex-wrap: wrap;">
  392. <view style="font-size: 28upx;font-weight: bold;color: #E02208;margin-right: 10upx;">
  393. <text style="font-size: 26upx;">¥</text>
  394. {{ item.price }}
  395. </view>
  396. <view style="font-size: 24upx;color: #979797;text-decoration: line-through;">
  397. ¥{{ item.originPrice }}
  398. </view>
  399. </view>
  400. </view>
  401. </view>
  402. </scroll-view>
  403. </view>
  404. </CommonShop>
  405. </view>
  406. <view v-if="ownBrandCardBox.includes(currentType) && nearbyShopList.length" style="margin: 14upx 26upx 0;">
  407. <tui-waterfall :list-data="nearbyShopList" :type="2" :page-size="queryInfo.pageSize">
  408. <template #left="{ entity }">
  409. <view style="width: 338upx;">
  410. <BrandShop :brand-info="entity" bottom-type="brief" :show-logo="false"></BrandShop>
  411. </view>
  412. </template>
  413. <template #right="{ entity }">
  414. <view style="width: 338upx;">
  415. <BrandShop :brand-info="entity" bottom-type="brief" :show-logo="false"></BrandShop>
  416. </view>
  417. </template>
  418. </tui-waterfall>
  419. </view>
  420. <view v-if="ownBrandCardWithPriceBox.includes(currentType) && nearbyShopList.length" style="margin: 14upx 26upx 0;">
  421. <tui-waterfall :list-data="nearbyShopList" :type="2" :page-size="queryInfo.pageSize">
  422. <template #left="{ entity }">
  423. <view style="width: 338upx;">
  424. <BrandShop :brand-info="entity" bottom-type="brief" show-price :show-logo="false"></BrandShop>
  425. </view>
  426. </template>
  427. <template #right="{ entity }">
  428. <view style="width: 338upx;">
  429. <BrandShop :brand-info="entity" bottom-type="brief" show-price :show-logo="false"></BrandShop>
  430. </view>
  431. </template>
  432. </tui-waterfall>
  433. </view>
  434. <view style="padding-bottom: 45upx;">
  435. <LoadingMore
  436. :status="!isEmpty && !nearbyShopList.length
  437. ? 'loading' : !isEmpty && nearbyShopList.length && (nearbyShopList.length >= nearbyTotal) ? 'no-more' : ''"
  438. >
  439. </LoadingMore>
  440. <tui-no-data v-if="isEmpty" :fixed="false" style="margin-top: 60upx;">暂无数据</tui-no-data>
  441. </view>
  442. </view>
  443. </template>
  444. <script>
  445. import CommonShop from '../../../pages/business-district/components/CommonShop.vue'
  446. import BrandShop from '../../../pages/business-district/components/BrandShop.vue'
  447. import StorePrimaryFilterBox from './components/StorePrimaryFilterBox.vue'
  448. import StoreSecondaryFilterBox from './components/StoreSecondaryFilterBox.vue'
  449. import { getShopCategorySonApi, getHomeBrandListApi } from '../../../api/anotherTFInterface'
  450. export default {
  451. name: 'ShopEnter',
  452. components: { CommonShop, BrandShop, StorePrimaryFilterBox, StoreSecondaryFilterBox },
  453. data() {
  454. return {
  455. transformation: {
  456. 0: '全部商家',
  457. 1: '同城家居',
  458. 2: '建材五金',
  459. 3: '找师傅',
  460. 4: '找家政',
  461. 5: '中介公司',
  462. 6: '美食团购',
  463. 7: '蔬菜生鲜',
  464. 8: '超市便利',
  465. 9: '养车用车',
  466. // 10: '便民服务',
  467. 11: '酒店民宿',
  468. 12: '美容理发',
  469. 13: '休闲娱乐',
  470. 14: '培训室',
  471. 15: '广告礼品',
  472. 16: '母婴店',
  473. 17: '儿童乐园',
  474. 18: '摄影室',
  475. 19: '花店',
  476. 20: '宠物',
  477. 21: '电影院',
  478. 22: '创意策划',
  479. 23: '酒庄',
  480. 24: '就医买药',
  481. 25: '金融财务'
  482. },
  483. currentType: '',
  484. // 判断每个类板块是否拥有某个页面结构
  485. ownSearchBar: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25'],
  486. ownMenuBar: ['1', '2', '3', '4', '5', '6', '7', '8', '13', '16'],
  487. ownSpecialLineMenuBar: [ '9' ],
  488. menuBarArr: [],
  489. ownLimitedTimeSeckill: [ '6' ],
  490. limitedTimeSeckillArr: [],
  491. // ownSelectionBox: ['2', '3', '4', '6', '9', '12', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23'],
  492. ownSelectionBox: [],
  493. selectionBoxArr: [],
  494. selectionBoxNum: 0,
  495. ownPrimaryFilterBox: [ '6' ],
  496. primaryFilterBoxObj: {
  497. quanbumeishi: '',
  498. fujin: '',
  499. zhinengpaixu: '',
  500. shaixuan: {
  501. yingyeshijian: '',
  502. cantingfuwu: ''
  503. }
  504. },
  505. ownSecondaryFilterBox: ['7', '8'],
  506. ownSpecialHotelBox: [ '11' ],
  507. specialHotelGoodsArr: [],
  508. specialHotelBoxObj: {
  509. tabIndex: 0,
  510. startDate: new Date().toLocaleString()
  511. .substring(0, 10)
  512. .replaceAll('/', '-'),
  513. endDate: new Date(Date.now() + 24 * 60 * 60 * 1000).toLocaleString()
  514. .substring(0, 10)
  515. .replaceAll('/', '-'),
  516. startWeek: '',
  517. endWeek: ''
  518. },
  519. ownShopCardBox: ['0', '1', '2', '3', '4', '6', '9', '12', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25'],
  520. ownShopCardWithLineBox: [ '13' ],
  521. ownShopCardWithGoodsBox: ['7', '8'],
  522. ownBrandCardBox: [ '5' ],
  523. ownBrandCardWithPriceBox: [ '11' ],
  524. nearbyShopList: [],
  525. nearbyTotal: 0,
  526. isEmpty: false,
  527. queryInfo: {
  528. page: 1,
  529. pageSize: 10,
  530. search: '',
  531. classifyId: ''
  532. }
  533. }
  534. },
  535. watch: {
  536. // 'queryInfo.search'(value) {
  537. // if (value) {
  538. // this.getNearByShopList(true)
  539. // }
  540. // }
  541. },
  542. async onLoad(options) {
  543. this.currentType = options.type || '0'
  544. this.queryInfo.classifyId = options.id || ''
  545. if (this.ownLimitedTimeSeckill.includes(this.currentType)) {
  546. const seckillGoodsArr = [{ url: '', name: '菜a菜菜菜菜菜菜菜菜菜菜菜菜菜菜菜菜菜菜', typeName: '套餐套餐套餐套餐', price: 99.99, discount: 9.9 }, { url: '', name: '菜b菜菜菜菜菜菜菜菜菜菜菜菜菜菜菜菜菜菜', typeName: '套餐套餐套餐套餐', price: 99.99, discount: 9.9 }, { url: '', name: '菜c菜菜菜菜菜菜菜菜菜菜菜菜菜菜菜菜菜菜', typeName: '套餐套餐套餐套餐', price: 99.99, discount: 9.9 }, { url: '', name: '菜d菜菜菜菜菜菜菜菜菜菜菜菜菜菜菜菜菜菜', typeName: '套餐套餐套餐套餐', price: 99.99, discount: 9.9 }, { url: '', name: '菜e菜菜菜菜菜菜菜菜菜菜菜菜菜菜菜菜菜菜', typeName: '套餐套餐套餐套餐', price: 99.99, discount: 9.9 }]
  547. this.limitedTimeSeckillArr = seckillGoodsArr.flatMap((item, index) => (index % 2 ? [] : [ seckillGoodsArr.slice(index, index + 2) ]))
  548. }
  549. if (this.ownSelectionBox.includes(this.currentType)) {
  550. if (this.currentType === '2') this.selectionBoxArr = ['全部', '品牌专卖', '独立大店', '企业连锁', '家居专卖']
  551. else if (this.currentType === '3') this.selectionBoxArr = ['水电安装', '家具安装', '家电维修', '招牌安装']
  552. else if (this.currentType === '4') this.selectionBoxArr = ['全部', '保姆', '月嫂', '保洁', '收纳']
  553. else if (this.currentType === '6') this.selectionBoxArr = ['美食餐厅', '精选团购', '单人餐']
  554. else if (this.currentType === '9') this.selectionBoxArr = ['加油站', '充电桩', '停车场', '代办点', '年检站']
  555. else if (this.currentType === '12') this.selectionBoxArr = ['全部', '理发店', '美甲美睫', '美容SPA', '纹眉锈眉', '医学美容']
  556. else if (this.currentType === '14') this.selectionBoxArr = ['全部', '商学院', '电商直播', '开店']
  557. else if (this.currentType === '15') this.selectionBoxArr = ['全部', '广告设计', '广告策划', '营销策划', '营销推广']
  558. else if (this.currentType === '16') this.selectionBoxArr = ['推荐', '月子中心', '备孕检查', '孕早期检查', '产检']
  559. else if (this.currentType === '17') this.selectionBoxArr = ['儿童游乐', '益智优教']
  560. else if (this.currentType === '18') this.selectionBoxArr = [ '还没有' ]
  561. else if (this.currentType === '19') this.selectionBoxArr = ['全部', '外卖', '到店', '电商包邮']
  562. else if (this.currentType === '20') this.selectionBoxArr = ['全部', '洗澡', '美容', '疫苗', '体检', '绝育', '驱虫']
  563. else if (this.currentType === '21') this.selectionBoxArr = ['热映影片', '大剧场', '销量最高', '评分最高']
  564. else if (this.currentType === '22') this.selectionBoxArr = ['全部', '商学院', '电商直播', '开店']
  565. else if (this.currentType === '23') this.selectionBoxArr = ['推荐', '酒吧']
  566. }
  567. if (this.ownSpecialHotelBox.includes(this.currentType)) {
  568. this.specialHotelGoodsArr = [{ url: '', name: '爆款】59元住全国 平日酒店晚通兑换券 中秋不加价 全国全国全国全国全国各器官svdsbv', typeName: '套餐套餐套餐套餐', price: 99.99, discount: 9.9 }, { url: '', name: '菜b菜菜菜菜菜菜菜菜菜菜菜菜菜菜菜菜菜菜', typeName: '套餐套餐dvfdgbvhjfdbfjbnfdhbu套餐套餐', price: 99.99, discount: 9.9 }, { url: '', name: '菜c菜菜菜菜菜菜菜菜菜菜菜菜菜菜菜菜菜菜', typeName: '套餐套餐套餐套餐', price: 99.99, discount: 9.9 }]
  569. }
  570. if (this.ownShopCardBox.includes(this.currentType) || this.ownShopCardWithLineBox.includes(this.currentType) || this.ownShopCardWithGoodsBox.includes(this.currentType) || this.ownBrandCardBox.includes(this.currentType) || this.ownBrandCardWithPriceBox.includes(this.currentType)) {
  571. this.getNearByShopList(true)
  572. }
  573. if (this.ownMenuBar.includes(this.currentType) || this.ownSpecialLineMenuBar.includes(this.currentType)) {
  574. const res = await getShopCategorySonApi({ pid: this.queryInfo.classifyId })
  575. this.menuBarArr = res.data || []
  576. }
  577. },
  578. methods: {
  579. back() {
  580. uni.switchTab({
  581. url: '/'
  582. })
  583. },
  584. handleSelectPrimaryFilter(e) {
  585. console.log(e)
  586. },
  587. handleSelectSecondaryFilter(e) {
  588. console.log(e)
  589. },
  590. handleSelectSpecialHotelBoxCalendar(e) {
  591. console.log(e)
  592. if (e.startDate === e.endDate) return this.$showToast('不能选择同一天')
  593. this.specialHotelBoxObj.startDate = e.startDate
  594. this.specialHotelBoxObj.endDate = e.endDate
  595. this.specialHotelBoxObj.startWeek = e.startWeek
  596. this.specialHotelBoxObj.endWeek = e.endWeek
  597. },
  598. getNearByShopList(isLoadmore) {
  599. uni.showLoading()
  600. getHomeBrandListApi({
  601. ...this.queryInfo,
  602. areaId: this.$store.state.location.locationInfo.adcode,
  603. longitude: this.$store.state.location.locationInfo.streetNumber.location.split(',')[0],
  604. latitude: this.$store.state.location.locationInfo.streetNumber.location.split(',')[1]
  605. })
  606. .then((res) => {
  607. this.nearbyTotal = res.data.total
  608. if (isLoadmore) {
  609. this.nearbyShopList.push(...res.data.list)
  610. } else {
  611. this.nearbyShopList = res.data.list
  612. }
  613. this.isEmpty = this.nearbyShopList.length === 0
  614. uni.hideLoading()
  615. })
  616. .catch(() => {
  617. uni.hideLoading()
  618. })
  619. }
  620. },
  621. onReachBottom() {
  622. if (this.nearbyShopList.length < this.nearbyTotal) {
  623. ++this.queryInfo.page
  624. this.getNearByShopList(true)
  625. }
  626. }
  627. }
  628. </script>
  629. <style lang="less" scoped>
  630. .shop-container {
  631. min-height: 100vh;
  632. background-color: #f6f6f8;
  633. box-sizing: border-box;
  634. padding: 108upx 0 0;
  635. .shop-header-container {
  636. position: fixed;
  637. top: 0;
  638. left: 0;
  639. right: 0;
  640. height: 108upx;
  641. width: 100vw;
  642. background-color: #fff;
  643. padding: 0 30upx;
  644. box-sizing: border-box;
  645. display: flex;
  646. align-items: center;
  647. z-index: 998;
  648. .back-icon {
  649. width: 48upx;
  650. height: 48upx;
  651. flex-shrink: 0;
  652. }
  653. .search-container {
  654. flex: 1;
  655. display: flex;
  656. align-items: center;
  657. }
  658. }
  659. .selection-box-tab {
  660. .tui-scroll__view {
  661. /deep/ .tui-tabs__line {
  662. margin-left: -26upx;
  663. clip-path: inset(0% 30% 0% 30% round 4upx 4upx 4upx 4upx);
  664. // background: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 20%, #ef530e 20%, #ef530e 80%, rgba(0, 0, 0, 0) 80%, rgba(0, 0, 0, 0) 100%)!important;
  665. // clip-path: polygon(20% 0, 80% 0, 80% 100%, 20% 100%);
  666. }
  667. }
  668. }
  669. .special-hotel-tab {
  670. .tui-scroll__view {
  671. /deep/ .tui-tabs__item {
  672. padding: 0 60upx 0 0;
  673. }
  674. /deep/ .tui-tabs__line {
  675. margin-left: -48upx;
  676. }
  677. }
  678. }
  679. .shop-card-line:not(:last-child) {
  680. padding-bottom: 24upx;
  681. margin-bottom: 24upx;
  682. border-bottom: 1upx solid #D8D8D8;
  683. }
  684. }
  685. </style>