青蛙卖大米小程序2024-11-24
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.

531 lines
10 KiB

6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
  1. <template>
  2. <view class="page">
  3. <navbar bgColor="#88D259" />
  4. <view class="bg-color"></view>
  5. <view class="page-title">
  6. {{ configList.index_title }}
  7. </view>
  8. <view class="search">
  9. <uv-search placeholder="搜你喜欢的产品" bgColor="#fff" v-model="keyword"></uv-search>
  10. </view>
  11. <view class="swipe">
  12. <uv-swiper
  13. :list="bannerList"
  14. indicator height="320rpx"
  15. keyName="image"></uv-swiper>
  16. </view>
  17. <view class="notice">
  18. <uv-notice-bar fontSize="32rpx" :text="notice"></uv-notice-bar>
  19. </view>
  20. <view class="menu">
  21. <uv-grid :border="false" :col="4" >
  22. <uv-grid-item v-for="(item,index) in baseList" :key="index" @click="$utils.navigateTo(item.path)">
  23. <image :src="item.image" mode=""></image>
  24. <text class="menu-text">{{item.title}}</text>
  25. </uv-grid-item>
  26. </uv-grid>
  27. </view>
  28. <view class="map">
  29. {{ configList.index_center_image }}
  30. <image :src="configList.index_center_image" mode="aspectFill" />
  31. </view>
  32. <view class="commodity"
  33. @click="$utils.navigateTo('/pages/index/category')">
  34. <view class="box">
  35. <view class="top">
  36. <view class="top-text">
  37. <view>Experience the product</view>
  38. <view>体验产品 ___ _</view>
  39. </view>
  40. </view>
  41. <view class="centre">
  42. <view class="boxs"
  43. :key="index"
  44. v-for="(item, index) in riceProductList">
  45. <view class="box-text">
  46. <view>{{ item.title }}</view>
  47. <view>{{ item.sku }}</view>
  48. <text class="text1">{{ item.price }}</text>
  49. <text class="text2">原价{{ item.oldPrice }}</text>
  50. </view>
  51. <view class="box-img">
  52. <image :src="item.image" mode="aspectFill"></image>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. <view class="commodity"
  59. @click="$utils.navigateTo('/pages/index/category')">
  60. <view class="box">
  61. <view class="top">
  62. <view class="top-text">
  63. <view>Conventional product</view>
  64. <view>常规产品 ___ _</view>
  65. </view>
  66. </view>
  67. <view class="centre">
  68. <view class="boxs"
  69. :key="index"
  70. v-for="(item, index) in commonProductList">
  71. <view class="box-text">
  72. <view>{{ item.title }}</view>
  73. <view>{{ item.sku }}</view>
  74. <text class="text1">{{ item.price }}</text>
  75. <text class="text2">原价{{ item.oldPrice }}</text>
  76. </view>
  77. <view class="box-img">
  78. <image :src="item.image" mode="aspectFill"></image>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. <view class="commodity">
  85. <view class="box">
  86. <view class="top">
  87. <view class="top-text">
  88. <view>News trends</view>
  89. <view>新闻动态 ___ _</view>
  90. </view>
  91. <view class="top1" @click="$utils.navigateTo('/pages_order/home/journalism')">
  92. 更多
  93. </view>
  94. </view>
  95. <view class="centre">
  96. <view class="boxs"
  97. :key="index"
  98. v-for="(item, index) in newList"
  99. >
  100. <view class="images">
  101. <image :src="item.image" mode="aspectFill"></image>
  102. </view>
  103. <view class="box-fone">
  104. <view>{{ item.title }}</view>
  105. <view>{{ item.title }}</view>
  106. </view>
  107. </view>
  108. </view>
  109. </view>
  110. </view>
  111. <view class="qr">
  112. <view class="scan">扫码关注公众号</view>
  113. <view class="qr-scan">
  114. <image :src="configList.down_image" mode="aspectFill"></image>
  115. </view>
  116. <view class="qr-bottom">
  117. <view>保存公众号二维码图片</view>
  118. <view>长按识别公众号</view>
  119. </view>
  120. </view>
  121. <PrivacyAgreementPoup />
  122. <tabber select="home" />
  123. </view>
  124. </template>
  125. <script>
  126. import PrivacyAgreementPoup from '@/components/config/PrivacyAgreementPoup.vue'
  127. import Position from '@/utils/position.js'
  128. import tabber from '@/components/base/tabbar.vue'
  129. import {
  130. mapGetters
  131. } from 'vuex'
  132. export default {
  133. components: {
  134. tabber,
  135. PrivacyAgreementPoup,
  136. },
  137. data() {
  138. return {
  139. area: '长沙',
  140. notice: '长沙市刘师傅在服务过程中客户投诉“服务过程中有不文明的行为”.....',
  141. bannerList: [],
  142. baseList: [{
  143. image: '/static/image/home/0.png',
  144. title: '关于我们',
  145. path: '/pages_order/home/introduce',
  146. },
  147. {
  148. image: '/static/image/home/1.png',
  149. title: '产品介绍',
  150. },
  151. {
  152. image: '/static/image/home/2.png',
  153. title: '促销活动',
  154. },
  155. {
  156. image: '/static/image/home/3.png',
  157. title: '商城',
  158. },
  159. {
  160. image: '/static/image/home/4.png',
  161. title: '邀请好友',
  162. },
  163. {
  164. image: '/static/image/home/5.png',
  165. title: '新闻中心',
  166. path: '/pages_order/home/journalism',
  167. },
  168. {
  169. image: '/static/image/home/6.png',
  170. title: '企业合作',
  171. },
  172. {
  173. image: '/static/image/home/7.png',
  174. title: '联系我们',
  175. },
  176. ],
  177. productList: [],
  178. keyword: '',
  179. commonProductList : [],//常规产品
  180. riceProductList : [],//体验产品
  181. newList : [],//新闻列表
  182. }
  183. },
  184. computed: {},
  185. onShow() {
  186. this.getBanner()
  187. this.getRiceNoticeList()
  188. this.getRiceCommonProductList()
  189. this.getRiceProductList()
  190. this.getRiceNewsList()
  191. this.getRiceIconList()
  192. },
  193. onPullDownRefresh() {
  194. this.getBanner()
  195. this.getRiceNoticeList()
  196. this.getRiceCommonProductList()
  197. this.getRiceProductList()
  198. this.getRiceNewsList()
  199. },
  200. methods: {
  201. // 获取轮播图
  202. getBanner(){
  203. this.$api('getRiceBanner', res => {
  204. if(res.code == 200){
  205. this.bannerList = res.result
  206. }
  207. })
  208. },
  209. // 获取公告
  210. getRiceNoticeList(){
  211. this.$api('getRiceNoticeList', res => {
  212. if(res.code == 200){
  213. this.notice = res.result.content
  214. }
  215. })
  216. },
  217. // 获取常规产品
  218. getRiceCommonProductList(){
  219. this.$api('getRiceCommonProductList', res => {
  220. uni.stopPullDownRefresh()
  221. if(res.code == 200){
  222. this.commonProductList = res.result
  223. }
  224. })
  225. },
  226. // 获取首页体验产品
  227. getRiceProductList(){
  228. this.$api('getRiceProductList', res => {
  229. if(res.code == 200){
  230. this.riceProductList = res.result
  231. }
  232. })
  233. },
  234. // 获取首页新闻列表
  235. getRiceNewsList(){
  236. this.$api('getRiceNewsList', res => {
  237. if(res.code == 200){
  238. this.newList = res.result.records
  239. }
  240. })
  241. },
  242. // 获取首页跳转图标
  243. getRiceIconList(){
  244. this.$api('getRiceIconList', res => {
  245. if(res.code == 200){
  246. this.newList = res.result.records
  247. }
  248. })
  249. },
  250. },
  251. }
  252. </script>
  253. <style scoped lang="scss">
  254. .page {
  255. position: relative;
  256. .bg-color {
  257. width: 100%;
  258. position: absolute;
  259. top: 0;
  260. left: 0;
  261. height: 550rpx;
  262. background: linear-gradient(to bottom, #88D259, #88D259, #fff);
  263. }
  264. .page-title {
  265. position: relative;
  266. margin-left: 30rpx;
  267. margin-bottom: 30rpx;
  268. }
  269. .search {
  270. position: relative;
  271. background: #FFFFFF;
  272. margin: 20rpx;
  273. border-radius: 41rpx;
  274. padding: 10rpx 20rpx;
  275. display: flex;
  276. align-items: center;
  277. /deep/ .uv-search__action {
  278. background-color: $uni-color;
  279. color: #FFFFFF;
  280. padding: 10rpx 20rpx;
  281. border-radius: 30rpx;
  282. }
  283. }
  284. .swipe {
  285. position: relative;
  286. overflow: hidden;
  287. border-radius: 20rpx;
  288. margin: 20rpx;
  289. }
  290. .menu {
  291. margin: 20rpx;
  292. border-radius: 20rpx;
  293. padding: 20rpx;
  294. background-color: #fff;
  295. box-shadow: 0 0 10rpx 10rpx #00000009;
  296. image {
  297. width: 80rpx;
  298. height: 80rpx;
  299. margin-top: 10rpx;
  300. }
  301. .menu-text {
  302. font-size: 28rpx;
  303. margin-bottom: 10rpx;
  304. margin-top: 10rpx;
  305. }
  306. }
  307. .notice {
  308. margin: 0 20rpx;
  309. /deep/ .uv-notice-bar {
  310. background: linear-gradient(to right, #f9edc9, #dfedd6);
  311. border-radius: 16rpx;
  312. }
  313. /deep/ .uv-notice {
  314. padding: 14rpx 0;
  315. }
  316. /deep/ .uv-icon__icon {
  317. font-size: 36rpx !important;
  318. color: #000 !important;
  319. }
  320. }
  321. .map {
  322. margin: 20rpx;
  323. height: 100rpx;
  324. border-radius: 16rpx;
  325. image {
  326. width: 100%;
  327. height: 100%;
  328. }
  329. }
  330. .commodity {
  331. display: flex;
  332. justify-content: center;
  333. align-items: center;
  334. margin: 20rpx;
  335. border-radius: 16rpx;
  336. background-color: #fff;
  337. .box {
  338. width: 100%;
  339. margin: 20rpx;
  340. .top {
  341. display: flex;
  342. border-left: 6rpx solid #A3D250;
  343. align-items: center;
  344. justify-content: space-between;
  345. .top-text {
  346. margin-left: 20rpx;
  347. view:nth-child(1) {
  348. font-size: 24rpx;
  349. color: #474747;
  350. }
  351. view:nth-child(2) {
  352. font-size: 32rpx;
  353. color: #A3D250;
  354. font-weight: 600;
  355. }
  356. }
  357. .top1 {
  358. font-size: 26rpx;
  359. color: #fff;
  360. padding: 10rpx 30rpx;
  361. background-color: #F6CD59;
  362. border-radius: 30rpx;
  363. }
  364. }
  365. }
  366. .centre {
  367. margin: 40rpx 20rpx;
  368. display: flex;
  369. flex-direction: column;
  370. align-items: center;
  371. justify-content: center;
  372. .boxs {
  373. display: flex;
  374. width: 100%;
  375. align-items: center;
  376. justify-content: center;
  377. margin-top: 10rpx;
  378. .images {
  379. width: 180rpx;
  380. height: 140rpx;
  381. flex-shrink: 0;
  382. border-radius: 8rpx;
  383. overflow: hidden;
  384. image {
  385. width: 100%;
  386. height: 100%;
  387. }
  388. }
  389. .box-fone {
  390. margin-left: 20rpx;
  391. flex: 1;
  392. view:nth-child(1) {
  393. font-size: 36rpx;
  394. color: #474747;
  395. }
  396. view:nth-child(2) {
  397. margin-top: 10rpx;
  398. font-size: 28rpx;
  399. color: #A2A2A2;
  400. }
  401. }
  402. .box-text,
  403. .box-img {
  404. flex: 1;
  405. }
  406. .box-img{
  407. height: 220rpx;
  408. image{
  409. width: 100%;
  410. height: 100%;
  411. }
  412. }
  413. .box-text {
  414. view:nth-child(1) {
  415. font-size: 32rpx;
  416. font-weight: 500;
  417. margin-top: 30rpx;
  418. }
  419. view:nth-child(2) {
  420. font-size: 28rpx;
  421. color: #CCCCCC;
  422. margin-bottom: 30rpx;
  423. }
  424. .text1 {
  425. color: red;
  426. font-size: 68rpx;
  427. }
  428. .text2 {
  429. font-size: 28rpx;
  430. color: #CCCCCC;
  431. }
  432. }
  433. .box-img {
  434. image {
  435. height: 100%;
  436. width: 100%;
  437. }
  438. }
  439. }
  440. }
  441. }
  442. .qr {
  443. margin-top: 40rpx;
  444. .scan {
  445. text-align: center;
  446. font-size: 28rpx;
  447. color: #A2A2A2;
  448. }
  449. .qr-scan {
  450. margin: 20rpx auto;
  451. width: 400rpx;
  452. height: 400rpx;
  453. image {
  454. height: 100%;
  455. width: 100%;
  456. }
  457. }
  458. .qr-bottom {
  459. display: flex;
  460. font-size: 28rpx;
  461. color: #A2A2A2;
  462. justify-content: space-around;
  463. view {
  464. border: 2rpx solid #A2A2A2;
  465. padding: 20rpx;
  466. border-radius: 45rpx;
  467. }
  468. }
  469. }
  470. }
  471. </style>