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

545 lines
11 KiB

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