建材商城系统20241014
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.

468 lines
12 KiB

7 months ago
7 months ago
7 months ago
7 months ago
  1. <template>
  2. <view class="page">
  3. <view class="red-top">
  4. <view class="building-title">
  5. <view class="title-right">
  6. 建材
  7. </view>
  8. <view class="title-left">
  9. 寻找你想要的建材材料
  10. </view>
  11. </view>
  12. <view class="building-search">
  13. <view class="address">
  14. <image src="../../static/image/home/1.png" mode=""></image>
  15. <view class="eare">
  16. <text>深圳</text>
  17. </view>
  18. <view class="down-arrow"></view>
  19. </view>
  20. <view class="search">
  21. <!-- DC2828 -->
  22. <uv-search bgColor="#ffffff" placeholder="搜索材料" inputAlign="left" height="70"
  23. showAction="false"></uv-search>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="image-home">
  28. <uv-swiper class="uv-swaip" height="350rpx" :list="bannerList" circular bgColor="#ffffff">
  29. </uv-swiper>
  30. </view>
  31. <view class="building-class">
  32. <view style="width: 710rpx;">
  33. <uv-grid :col="4" :border="false">
  34. <uv-grid-item>
  35. <image class="image" src="../../static/image/home/3.png" mode=""></image>
  36. <text class="grid-text">XX建材</text>
  37. </uv-grid-item>
  38. <uv-grid-item>
  39. <image class="image" src="../../static/image/home/4.png" mode=""></image>
  40. <text class="grid-text">XX建材</text>
  41. </uv-grid-item>
  42. <uv-grid-item>
  43. <image class="image" src="../../static/image/home/5.png" mode=""></image>
  44. <text class="grid-text">XX建材</text>
  45. </uv-grid-item>
  46. <uv-grid-item>
  47. <image class="image" src="../../static/image/home/6.png" mode=""></image>
  48. <text class="grid-text">XX建材</text>
  49. </uv-grid-item>
  50. </uv-grid>
  51. </view>
  52. </view>
  53. <view class="hot-building">
  54. <text>热卖建材</text>
  55. </view>
  56. <view class="quick-order-container" @click="toUrl">
  57. <view class="new-message">
  58. 你有一条新的快捷下单信息
  59. </view>
  60. <view class="quick-order">
  61. <view class="number-order">
  62. 1
  63. </view>
  64. <image src="../../static/image/home/7.png" mode=""></image>
  65. </view>
  66. </view>
  67. <view class="shop-list" v-for="(item, index) in 20" @click="toGoodInfo(item, index)" :key="index">
  68. <view class="picture-shop">
  69. <image src="../../static/image/home/8.png" mode=""></image>
  70. </view>
  71. <view class="price-shop">
  72. <view class="top-shop">
  73. <text>泰山工装石膏板</text>
  74. <view class="tag-shop">
  75. <uv-tags text="建材材料" type="warning" plain size="mini"></uv-tags>
  76. <uv-tags text="快速下单" type="warning" plain size="mini"></uv-tags>
  77. </view>
  78. </view>
  79. <view class="bottom-price">
  80. <text style="font-size: 40rpx; ">38</text>.00/
  81. </view>
  82. </view>
  83. <view class="buy-shop">
  84. <uv-button
  85. type="primary"
  86. shape="circle"
  87. text="立即购买"></uv-button>
  88. </view>
  89. </view>
  90. <PrivacyAgreementPoup />
  91. <tabber select="home" />
  92. </view>
  93. </template>
  94. <script>
  95. import PrivacyAgreementPoup from '@/components/config/PrivacyAgreementPoup.vue'
  96. import tabber from '@/components/base/tabbar.vue'
  97. import mixinsList from '@/mixins/list.js'
  98. export default {
  99. mixins: [mixinsList],
  100. components: {
  101. tabber,
  102. PrivacyAgreementPoup,
  103. },
  104. data() {
  105. return {
  106. keyword: '',
  107. bannerList : [],
  108. mixinsListApi: 'getClassShopPageList',
  109. }
  110. },
  111. computed: {
  112. },
  113. onLoad() {
  114. this.getBanner()
  115. },
  116. methods: {
  117. // 获取轮播图
  118. getBanner() {
  119. this.$api('getBanner', res => {
  120. if (res.code == 200) {
  121. this.bannerList = res.result
  122. }
  123. })
  124. },
  125. toUrl() {
  126. uni.navigateTo({
  127. url: '/pages_order/order/fastCreateOrder'
  128. })
  129. // this.$utils.navigateTo('/pages_order/mine/address')
  130. },
  131. toGoodInfo(item, index) {
  132. // uni.navigateTo({
  133. // url: `/pages_order/order/product/productDetail?id=`+item.id
  134. // })
  135. uni.navigateTo({
  136. url: '/pages_order/product/productDetail'
  137. })
  138. },
  139. }
  140. }
  141. </script>
  142. <style scoped lang="scss">
  143. .red-top {
  144. position: relative;
  145. height: 420rpx;
  146. background: linear-gradient(to bottom, $uni-color, #f05a45);
  147. border-bottom-left-radius: 100rpx;
  148. border-bottom-right-radius: 100rpx;
  149. z-index: -1;
  150. .building-title {
  151. position: absolute;
  152. height: 100rpx;
  153. width: 100%;
  154. margin-top: 100rpx;
  155. .title-right {
  156. color: $uni-bg-color;
  157. height: 100rpx;
  158. line-height: 100rpx;
  159. font-size: 45rpx;
  160. font-weight: 900;
  161. margin-left: 30rpx;
  162. display: inline-block;
  163. }
  164. .title-left {
  165. display: inline-block;
  166. margin-left: 30rpx;
  167. font-size: 22rpx;
  168. color: $uni-bg-color;
  169. }
  170. }
  171. .building-search {
  172. position: absolute;
  173. height: 100rpx;
  174. width: 100%;
  175. margin-top: 200rpx;
  176. // background-color: black;
  177. .address {
  178. height: 100rpx;
  179. width: 150rpx;
  180. position: relative;
  181. display: flex;
  182. align-items: center;
  183. image {
  184. position: absolute;
  185. height: 20rpx;
  186. width: 15rpx;
  187. line-height: 20rpx;
  188. left: 40rpx;
  189. top: 42rpx;
  190. }
  191. .eare {
  192. width: 100rpx;
  193. height: 100rpx;
  194. line-height: 100rpx;
  195. margin-left: 60rpx;
  196. color: $uni-bg-color;
  197. }
  198. .down-arrow:after {
  199. content: "";
  200. display: inline-block;
  201. width: 0;
  202. height: 0;
  203. border-left: 10rpx solid transparent;
  204. border-right: 10rpx solid transparent;
  205. border-top: 15rpx solid $uni-bg-color;
  206. margin-top: 5rpx;
  207. position: absolute;
  208. top: 42rpx;
  209. left: 130rpx;
  210. }
  211. }
  212. .search {
  213. display: inline-block;
  214. position: absolute;
  215. top: 16rpx;
  216. left: 26%;
  217. width: 70%;
  218. :deep(.uv-search__content) {
  219. box-shadow: 0 5rpx 15rpx rgba(0, 0, 0, 0.1);
  220. }
  221. }
  222. }
  223. }
  224. .image-home {
  225. z-index: 1;
  226. height: 350rpx;
  227. margin: 0 20rpx;
  228. margin-top: -90rpx;
  229. border-radius: 20rpx;
  230. overflow: hidden;
  231. box-shadow: 0 10rpx 20rpx rgba(0, 0, 0, 0.1);
  232. }
  233. .building-class {
  234. height: 220rpx;
  235. display: flex;
  236. justify-content: space-around;
  237. align-items: center;
  238. /* 垂直居中 */
  239. background-color: $uni-bg-color;
  240. margin: 20rpx 0;
  241. border-radius: 20rpx;
  242. box-shadow: 0 5rpx 15rpx rgba(0, 0, 0, 0.05);
  243. image {
  244. margin-left: 20rpx;
  245. margin-right: 20rpx;
  246. margin-bottom: 10rpx;
  247. width: 100rpx;
  248. height: 100rpx;
  249. display: inline-block;
  250. transition: transform 0.3s;
  251. &:hover {
  252. transform: scale(1.05);
  253. }
  254. }
  255. :deep(.grid-text) {
  256. font-size: 26rpx;
  257. font-weight: 500;
  258. color: #333;
  259. }
  260. }
  261. .text-building {
  262. display: flex;
  263. justify-content: space-around;
  264. align-items: center;
  265. /* 垂直居中 */
  266. background-color: $uni-bg-color;
  267. text-align: center;
  268. font-weight: 500;
  269. margin-bottom: -30rpx;
  270. padding-bottom: 40rpx;
  271. // overflow: hidden;
  272. }
  273. .hot-building {
  274. margin-top: 25rpx;
  275. height: 80rpx;
  276. background-color: $uni-bg-color;
  277. display: flex;
  278. align-items: center;
  279. padding-left: 40rpx;
  280. font-size: 35rpx;
  281. font-weight: 600;
  282. color: #333;
  283. position: relative;
  284. &::after {
  285. content: '';
  286. position: absolute;
  287. left: 40rpx;
  288. bottom: 15rpx;
  289. width: 60rpx;
  290. height: 6rpx;
  291. background-color: $uni-color;
  292. border-radius: 3rpx;
  293. }
  294. }
  295. .quick-order-container {
  296. position: fixed;
  297. right: 30rpx;
  298. top: 40vh;
  299. z-index: 99;
  300. transition: transform 0.3s;
  301. &:active {
  302. transform: scale(0.95);
  303. }
  304. }
  305. .new-message {
  306. position: absolute;
  307. top: 50rpx;
  308. right: 100%;
  309. white-space: nowrap;
  310. background-color: #DC2828;
  311. border-radius: 20rpx;
  312. font-size: 25rpx;
  313. color: $uni-bg-color;
  314. padding: 5rpx 15rpx;
  315. margin-bottom: 10rpx;
  316. box-shadow: 0 5rpx 10rpx rgba(220, 40, 40, 0.3);
  317. animation: pulse 2s infinite;
  318. }
  319. .quick-order {
  320. position: relative;
  321. width: 230rpx;
  322. height: 160rpx;
  323. image {
  324. width: 100%;
  325. height: 100%;
  326. }
  327. .number-order {
  328. background-color: #DC2828;
  329. position: absolute;
  330. font-size: 30rpx;
  331. height: 40rpx;
  332. width: 40rpx;
  333. text-align: center;
  334. border-radius: 20rpx;
  335. color: #ffffff;
  336. top: 10rpx;
  337. left: 25rpx;
  338. }
  339. }
  340. .shop-list {
  341. width: 95%;
  342. height: 222rpx;
  343. display: flex;
  344. margin: 30rpx auto;
  345. background-color: #ffffff;
  346. border-radius: 20rpx;
  347. box-shadow: 0 5rpx 15rpx rgba(0, 0, 0, 0.05);
  348. transition: transform 0.3s, box-shadow 0.3s;
  349. &:active {
  350. transform: translateY(2rpx);
  351. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  352. }
  353. // /deep/
  354. .picture-shop {
  355. width: 240rpx;
  356. height: 100%;
  357. display: flex;
  358. align-items: center;
  359. justify-content: center;
  360. image {
  361. width: 200rpx;
  362. height: 150rpx;
  363. }
  364. }
  365. .price-shop {
  366. width: 250rpx;
  367. height: 100%;
  368. .top-shop {
  369. height: 100rpx;
  370. width: 100%;
  371. font-size: 30rpx;
  372. margin-top: 20rpx;
  373. text-align: center;
  374. font-weight: 600;
  375. overflow: hidden;
  376. text-overflow: ellipsis;
  377. white-space: nowrap;
  378. .tag-shop {
  379. display: flex;
  380. justify-content: space-around;
  381. margin-top: 10rpx;
  382. }
  383. .bottom-price {
  384. display: inline-block;
  385. color: #DC2828;
  386. height: 80rpx;
  387. width: 250rpx;
  388. line-height: 100rpx;
  389. }
  390. }
  391. .buy-shop {
  392. height: 100%;
  393. width: 250rpx;
  394. display: flex;
  395. justify-content: center;
  396. align-items: center;
  397. :deep(.uv-button) {
  398. transition: transform 0.2s;
  399. &:active {
  400. transform: scale(0.95);
  401. }
  402. }
  403. }
  404. }
  405. @keyframes pulse {
  406. 0% {
  407. transform: scale(1);
  408. }
  409. 50% {
  410. transform: scale(1.05);
  411. }
  412. 100% {
  413. transform: scale(1);
  414. }
  415. }
  416. }
  417. </style>