酒店桌布为微信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

408 lines
8.1 KiB

9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
  1. <template>
  2. <view class="page">
  3. <navbar/>
  4. <view class="search">
  5. <view @click="showSelectArea" class="left-area">
  6. <image src="@/static/image/home/address-icon.png"></image>
  7. <view class="area">{{ area }}</view>
  8. <image src="@/static/image/home/arrow-icon.png" mode="aspectFit"></image>
  9. <view class="parting-line">|</view>
  10. </view>
  11. <view class="center-area">
  12. <image
  13. style="margin-right: 20rpx;"
  14. src="@/static/image/home/search-icon.png"></image>
  15. <input v-model="queryParams.title"
  16. placeholder="桌布租赁" />
  17. </view>
  18. <!-- <view class="right-area">
  19. <view @click="searchAddress" class="search-button">
  20. 搜索
  21. </view>
  22. </view> -->
  23. </view>
  24. <view class="swipe">
  25. <uv-swiper
  26. :list="bannerList"
  27. indicator
  28. height="320rpx"
  29. keyName="url"></uv-swiper>
  30. </view>
  31. <!-- 水洗店 -->
  32. <view class="userShop"
  33. v-if="userShop">
  34. <view class="list">
  35. <view class="item"
  36. v-for="(item, index) in 4"
  37. :key="index">
  38. <view class="">
  39. <view class="">
  40. 我的客户
  41. </view>
  42. <view class="num">
  43. {{ 30 }}
  44. </view>
  45. </view>
  46. <view class="">
  47. <image :src="`/static/image/home/${index}.png`" mode=""></image>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. <!-- 酒店 -->
  53. <view class="user"
  54. v-else>
  55. <uv-notice-bar
  56. fontSize="28rpx"
  57. :text="text"></uv-notice-bar>
  58. <view class="shop">
  59. <image
  60. class="image"
  61. src="https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg"
  62. mode=""></image>
  63. <view class="shopInfo">
  64. <view class="title">
  65. HOUS水洗店
  66. </view>
  67. <view class="tags">
  68. <view class="tag">
  69. 桌布水洗
  70. </view>
  71. <view class="tag">
  72. 桌布租赁
  73. </view>
  74. </view>
  75. <view class="time">
  76. 9:00-18:00
  77. </view>
  78. <view class="address">
  79. 长沙市天心区桂花坪街道231号
  80. </view>
  81. </view>
  82. <view class="btns">
  83. <view class="btn">
  84. 我要水洗
  85. </view>
  86. </view>
  87. <view class="tips">
  88. 关联门店主信门店
  89. </view>
  90. </view>
  91. <view class="productList">
  92. <productList/>
  93. </view>
  94. </view>
  95. <!-- <selectArea ref="selectArea" @close="closeAreaPro" @select="selectArea"></selectArea> -->
  96. <tabber select="0"/>
  97. </view>
  98. </template>
  99. <script>
  100. import Position from '@/utils/position.js'
  101. import tabber from '@/components/base/tabbar.vue'
  102. import productList from '@/components/user/productList.vue'
  103. import { mapGetters } from 'vuex'
  104. // import selectArea from '../../components/selectArea.vue';
  105. export default {
  106. components : {
  107. tabber,
  108. productList,
  109. },
  110. data() {
  111. return {
  112. area: '长沙',
  113. text : '长沙市刘师傅在服务过程中客户投诉“服务过程中有不文明的行为”.....',
  114. queryParams: {
  115. pageNo: 1,
  116. pageSize: 10,
  117. title: ''
  118. },
  119. bannerList: [
  120. {
  121. url: 'https://cdn.uviewui.com/uview/swiper/swiper3.png',
  122. },
  123. {
  124. url: 'https://cdn.uviewui.com/uview/swiper/swiper2.png',
  125. },
  126. {
  127. url: 'https://cdn.uviewui.com/uview/swiper/swiper3.png',
  128. },
  129. ],
  130. productList: [],
  131. }
  132. },
  133. computed : {
  134. ...mapGetters(['userShop']),
  135. },
  136. methods: {
  137. //显示选择地区
  138. showSelectArea() {
  139. // this.$refs.selectArea.open()
  140. },
  141. //搜索地址
  142. searchAddress() {
  143. Position.getLocation(res => {
  144. Position.selectAddress(res.longitude, res.latitude, success => {
  145. let address = this.extractProvinceAndCity(success)
  146. this.queryParams.title = address.city
  147. })
  148. })
  149. },
  150. //提取用户选择的地址信息(省市县信息)
  151. extractProvinceAndCity(res) { //提取用户选择的地址信息(省市)
  152. if (!res.address && res.name) { //用户直接选择城市的逻辑
  153. return {
  154. province: '',
  155. city: res.name
  156. };
  157. }
  158. if (res.address) { //用户选择了详细地址,要从详细地址中提取出省市县信息
  159. // 使用正则表达式匹配省市县
  160. const regex = /(?<province>[\u4e00-\u9fa5]+?省)(?<city>[\u4e00-\u9fa5]+?(?:市|自治州|盟|地区))/;
  161. const match = res.address.match(regex);
  162. if (match) { // 如果匹配成功,则返回省和市的信息
  163. return {
  164. province: match.groups.province,
  165. city: match.groups.city
  166. };
  167. }
  168. }
  169. return { //用户没选择地址就点了确定按钮
  170. province: '',
  171. city: ''
  172. }
  173. },
  174. }
  175. }
  176. </script>
  177. <style scoped lang="scss">
  178. .search {
  179. height: 82rpx;
  180. width: 710rpx;
  181. background: #FFFFFF;
  182. margin: 20rpx auto;
  183. border-radius: 41rpx;
  184. box-sizing: border-box;
  185. padding: 0 15rpx;
  186. display: flex;
  187. align-items: center;
  188. // justify-content: space-between;
  189. .left-area,
  190. .center-area {
  191. display: flex;
  192. align-items: center;
  193. }
  194. .left-area {
  195. max-width: 160rpx;
  196. image {
  197. flex-shrink: 0;
  198. width: 26rpx;
  199. height: 26rpx;
  200. }
  201. .area {
  202. font-size: 24rpx;
  203. display: -webkit-box;
  204. -webkit-line-clamp: 2;
  205. /* 限制显示两行 */
  206. -webkit-box-orient: vertical;
  207. overflow: hidden;
  208. text-overflow: ellipsis;
  209. color: #292929;
  210. }
  211. .parting-line {
  212. flex-shrink: 0;
  213. font-size: 26rpx;
  214. color: #ccc;
  215. margin: 0rpx 5rpx;
  216. }
  217. }
  218. .center-area {
  219. display: flex;
  220. flex-wrap: nowrap;
  221. align-items: center;
  222. width: calc(100% - 290rpx);
  223. margin-left: 30rpx;
  224. image {
  225. width: 26rpx;
  226. height: 26rpx;
  227. }
  228. .van-field {
  229. background-color: transparent;
  230. box-sizing: border-box;
  231. height: 82rpx;
  232. line-height: 82rpx;
  233. width: calc(100% - 30rpx);
  234. padding: 0rpx 10rpx 0rpx 0rpx;
  235. input {
  236. height: 82rpx;
  237. font-size: 60rpx;
  238. }
  239. }
  240. }
  241. .right-area {
  242. .search-button {
  243. background: #60BDA2;
  244. height: 60rpx;
  245. width: 130rpx;
  246. font-size: 26rpx;
  247. border-radius: 35rpx;
  248. color: white;
  249. display: flex;
  250. align-items: center;
  251. justify-content: center;
  252. }
  253. }
  254. }
  255. .swipe{
  256. overflow: hidden;
  257. border-radius: 20rpx;
  258. margin: 20rpx;
  259. }
  260. .page{
  261. padding-bottom: 200rpx;
  262. & /deep/ .uv-icon__icon{
  263. font-size: 30rpx !important;
  264. }
  265. // 水洗店
  266. .userShop{
  267. .list{
  268. display: flex;
  269. flex-wrap: wrap;
  270. .item{
  271. display: flex;
  272. justify-content: center;
  273. align-items: center;
  274. width: 330rpx;
  275. margin: 20rpx;
  276. padding: 30rpx 0;
  277. color: #FFFFFF;
  278. line-height: 50rpx;
  279. border-radius: 20rpx;
  280. font-size: 28rpx;
  281. .num{
  282. font-size: 38rpx;
  283. font-weight: 900;
  284. }
  285. image{
  286. width: 110rpx;
  287. height: 110rpx;
  288. margin-left: 20rpx;
  289. }
  290. &:nth-child(1){
  291. background: #F07A77;
  292. }
  293. &:nth-child(2){
  294. background: #F48B4E;
  295. }
  296. &:nth-child(3){
  297. background: #6487E1;
  298. }
  299. &:nth-child(4){
  300. background: #61B7E6;
  301. }
  302. }
  303. }
  304. }
  305. // 酒店
  306. .user{
  307. padding: 20rpx;
  308. .shop{
  309. position: relative;
  310. display: flex;
  311. align-items: center;
  312. justify-content: center;
  313. background-color: #fff;
  314. margin-top: 20rpx;
  315. border-radius: 20rpx;
  316. padding: 20rpx;
  317. overflow: hidden;
  318. .image{
  319. width: 180rpx;
  320. height: 180rpx;
  321. margin-right: 20rpx;
  322. border-radius: 20rpx;
  323. }
  324. .shopInfo{
  325. font-size: 22rpx;
  326. .title{
  327. font-size: 30rpx;
  328. }
  329. .tags{
  330. display: flex;
  331. .tag{
  332. padding: 4rpx 6rpx;
  333. border: 1rpx solid #FFAC6E;
  334. color: #FFAC6E;
  335. margin-right: 10rpx;
  336. margin-top: 10rpx;
  337. font-size: 18rpx;
  338. }
  339. }
  340. .time{
  341. margin-top: 10rpx;
  342. display: flex;
  343. }
  344. .address{
  345. margin-top: 10rpx;
  346. display: flex;
  347. }
  348. }
  349. .btns{
  350. margin-left: auto;
  351. display: flex;
  352. align-items: center;
  353. justify-content: center;
  354. .btn{
  355. background-color: $uni-color;
  356. color: #fff;
  357. box-shadow: 0 0 5rpx 5rpx #FFAC6E;
  358. padding: 10rpx 20rpx;
  359. flex-shrink: 0;
  360. border-radius: 35rpx;
  361. }
  362. }
  363. .tips{
  364. position: absolute;
  365. top: 0;
  366. right: 0;
  367. font-size: 24rpx;
  368. color: #FFAC6E;
  369. background-color: #FEF5EE;
  370. padding: 10rpx 20rpx;
  371. border-radius: 10rpx;
  372. }
  373. }
  374. }
  375. }
  376. </style>