This commit is contained in:
sjeam 2025-09-03 17:47:31 +08:00
parent 6739e375ad
commit 63612f1bd4
5 changed files with 290 additions and 229 deletions

View File

@ -22,15 +22,15 @@
radius="0px 0px 20rpx 20rpx "
:width="'100%'"
:height="'100%'"
src="https://bpic.588ku.com/back_list_pic/23/05/17/75e92f4e681efeb526f7d8603199ca11.jpg"
:src="banner_list.image"
/>
<view
class="m-2 p-2 absolute bottom-0 text-center left-0 right-0 text-white bg-gray-300 bg-opacity-5"
class="m-2 p-2 absolute bottom-0 text-center left-0 right-0 text-white bg-black bg-opacity-30"
style="backdrop-filter: blur(2rpx); border-radius: 10rpx"
>
<text class="block font-size-4 text-left">三江区街道</text>
<text class="block font-size-4 text-left">{{ banner_list.name }}</text>
<text class="block font-size-3 text-left">
因举办古韵悠然的传统民俗文化节热度飙升在这里你能感受到乡村文化的深厚底蕴和无穷魅力
<!-- 因举办古韵悠然的传统民俗文化节热度飙升在这里你能感受到乡村文化的深厚底蕴和无穷魅力 -->
</text>
</view>
</view>
@ -40,36 +40,13 @@
<view class="p-2">
<wd-grid :column="4">
<view
@click="changeTab(item)"
v-for="item in [
{
name: '吃',
id: 1,
icon: 'https://bpic.588ku.com/back_list_pic/23/05/17/75e92f4e681efeb526f7d8603199ca11.jpg',
},
{
name: '住',
id: 2,
icon: 'https://www.beijing.gov.cn/renwen/bjgk/mygk/myfg/202208/W020220812574023612181.jpg',
},
{
name: '玩',
id: 3,
icon: 'https://www.keaitupian.cn/cjpic/frombd/2/253/1659552792/3869332496.jpg',
},
{
name: '购',
id: 4,
icon: 'https://aerial.scol.com.cn/items/202001/200102174156554000120F0A.jpg',
},
]"
>
<view @click="changeTab(item)" v-for="item in category">
<wd-grid-item use-slot>
<view>
<wd-img radius="20rpx" :width="'160rpx'" :height="'100rpx'" :src="item.icon" />
<wd-img radius="10rpx" :width="'160rpx'" :height="'100rpx'" :src="item.image" />
<view
class="absolute bottom-6 text-center left-0 right-0 text-white text-center text-gray-500 font-size-3"
class="absolute bottom-5 text-center left-0 right-0 text-white text-center text-gray-500 font-size-3 bg-black bg-opacity-20"
>
{{ item.name }}
</view>
@ -81,69 +58,24 @@
</view>
<scroll-view scroll-x="true" class="scroll-view-container">
<view
class="p-2"
style=""
@click="more"
v-for="item in [
{
name: '吃',
id: 1,
icon: 'https://bpic.588ku.com/back_list_pic/23/05/17/75e92f4e681efeb526f7d8603199ca11.jpg',
},
{
name: '住',
id: 2,
icon: 'https://www.beijing.gov.cn/renwen/bjgk/mygk/myfg/202208/W020220812574023612181.jpg',
},
{
name: '玩',
id: 3,
icon: 'https://www.keaitupian.cn/cjpic/frombd/2/253/1659552792/3869332496.jpg',
},
{
name: '购',
id: 4,
icon: 'https://aerial.scol.com.cn/items/202001/200102174156554000120F0A.jpg',
},
{
name: '购',
id: 4,
icon: 'https://aerial.scol.com.cn/items/202001/200102174156554000120F0A.jpg',
},
{
name: '购',
id: 4,
icon: 'https://aerial.scol.com.cn/items/202001/200102174156554000120F0A.jpg',
},
{
name: '购',
id: 4,
icon: 'https://aerial.scol.com.cn/items/202001/200102174156554000120F0A.jpg',
},
]"
>
<view class="p-2" style="" @click="more" v-for="item in index_list">
<wd-card custom-class="card-content">
<view class="content p-2" style="align-items: normal">
<view class="ps-2 flex-content-column">
<view class="ps-1 font-size-4 font-bold color-black">里海科技</view>
<view class="ps-1 font-size-4 font-bold color-black">{{ item.author }}</view>
<view class="ps-1 font-size-3 ellipsis-2">{{ item.description }}</view>
<view class="p-1 font-size-3" style="align-items: end">
<text class="pe-2 font-size-3">泸州市龙马潭区海吉星路</text>
</view>
</view>
<view class="relative" style="width: 280rpx; height: 200rpx">
<wd-img
:width="'100%'"
:height="'100%'"
radius="20rpx"
src="https://img.shetu66.com/2023/07/26/1690335889558220.png"
alt="joy"
/>
<wd-img :width="'100%'" :height="'100%'" radius="20rpx" :src="item.cover" alt="joy" />
<view
class="m-2 p-1 absolute bottom-0 text-right right-0 text-white bg-gray-300 bg-opacity-15"
class="m-2 p-1 absolute bottom-0 text-right right-0 text-white bg-black bg-opacity-20"
style="backdrop-filter: blur(2rpx); border-radius: 10rpx"
>
<text class="block font-size-3 text-left">距离100米</text>
<text class="block font-size-3 text-left">{{ item.category_name }}</text>
</view>
</view>
</view>
@ -154,51 +86,71 @@
</view>
</template>
<script lang="ts" setup>
<script lang="ts">
import {
getArticleCategoryAPI,
getArticleIndexAPI,
getArticleDetailAPI,
} from '@/service/crmeb/product.ts'
import { useUserStore } from '@/store'
import { getUrl, getWebUrl } from '@/utils'
const userStore = useUserStore()
const hasLogin = computed(() => userStore.userInfo?.id)
import { defineComponent } from 'vue'
// import StickyNav from './components/StickyNav.vue'
// import { toLogin } from '@/libs/login.js'
const currentTab = ref(1)
function changeTab(e) {
console.log(e)
currentTab.value = e.id
export default defineComponent({
data() {
return {
banner_list: [],
show: false,
index_list: {},
detail: {},
category: {},
currentTab: 1,
city: '',
title: '',
}
},
async onLoad(option) {
this.getCategory()
this.getDetail(1)
},
methods: {
changeTab(item) {
this.banner_list = item
console.log(item)
this.getIndex(item['id'])
},
async getCategory() {
const res = await getArticleCategoryAPI([])
// 使 map
this.category = res.data
this.banner_list = this.category[0]
this.getIndex(this.category[0]['id'])
},
function moreVillage() {
console.log('查看乡村')
uni.navigateTo({
url: '/pages-village-sub/home/index',
})
}
async getIndex(category_id) {
const res = await getArticleIndexAPI({ category_id: category_id })
// 使 map
this.index_list = res.data
},
async getDetail(id) {
const res = await getArticleDetailAPI({ id: id })
// 使 map
this.detail = res.data
},
function moreTourism() {
console.log('查看旅游')
uni.navigateTo({
url: '/pages-tourism-sub/home/index',
more(item) {
console.log(item)
if (item.type == 1) {
getUrl(item.url)
} else if (item.type == 2) {
getWebUrl(item.url)
}
},
},
})
}
function more() {
console.log('数字乡村详情')
uni.navigateTo({
url: '/pages/index/detail',
})
}
function goToShop() {
// if (this.isLogin) {
let urls = 'https://shop.lihaink.cn/'
uni.navigateTo({
url: `/pages/web_view/index?target=${urls}&title=区域特产`,
})
// } else {
// this.openAuto()
// }
}
//
function openAuto() {
toLogin()
}
</script>
<style lang="scss" scoped>

View File

@ -13,27 +13,37 @@
<template>
<view class="">
<view class="background_home">
<view class="" style="" @click="more">
<view
class=""
style=""
@click="
more({
type: 2,
url: ' ',
})
"
>
<wd-card custom-class="card-content">
<view class="relative" style="height: 680rpx">
<wd-swiper
value-key="url"
custom-text-style="color:#fff"
v-if="swiperList"
height="680rpx"
width="100%"
:list="swiperList"
autoplay
height="680rpx"
:indicator="{ type: 'dots-bar' }"
v-model:current="current"
@change="onChange"
></wd-swiper>
<view
class="m-2 p-2 absolute bottom-0 text-center left-0 right-0 text-white bg-gray-300 bg-opacity-5"
class="m-2 p-2 absolute bottom-0 text-center left-0 right-0 text-white bg-black bg-opacity-40"
style="backdrop-filter: blur(2rpx); border-radius: 10rpx"
>
<!-- <wd-search hide-cancel placeholder-left placeholder="请输入内容"></wd-search> -->
<text class="block font-size-4 text-left">{{ swiperList[current].name }}</text>
<text class="block font-size-4 text-left">{{ city }}</text>
<text class="block font-size-3 text-left">
{{ swiperList[current].title }}
{{ title }}
</text>
</view>
</view>
@ -103,8 +113,13 @@
<view
class="p-1"
style="display: inline-block; width: 300rpx"
@click="goToShop()"
v-for="item in product_30.list"
@click="
more({
type: 2,
url: ' ',
})
"
v-for="item in product_30"
>
<wd-card custom-class="card-content">
<view style="height: 200rpx; width: 300rpx">
@ -150,7 +165,16 @@
</view>
<view class="pe-2 ps-2">
<view class=" " style="" @click="more">
<view
class=" "
style=""
@click="
more({
type: 2,
url: ' ',
})
"
>
<wd-card custom-class="card-content">
<view class="relative" style="height: 380rpx">
<wd-img
@ -265,7 +289,16 @@
},
]"
>
<view class="p-1" style="" @click="goToShop('https://shop.lihaink.cn/')">
<view
class="p-1"
style=""
@click="
more({
type: 2,
url: ' ',
})
"
>
<wd-card custom-class="card-content">
<view style="height: 200rpx">
<wd-img
@ -315,7 +348,16 @@
</wd-card>
</view>
<view class="p-2" style="" @click="more">
<view
class="p-2"
style=""
@click="
more({
type: 2,
url: ' ',
})
"
>
<wd-card custom-class="card-content">
<view class="content p-2" style="align-items: normal">
<view style="width: 280rpx; height: 200rpx">
@ -390,7 +432,16 @@
},
]"
>
<view class="p-1" style="" @click="goToShop('https://shop.lihaink.cn/')">
<view
class="p-1"
style=""
@click="
more({
type: 2,
url: ' ',
})
"
>
<wd-card custom-class="card-content">
<view style="height: 200rpx">
<wd-img
@ -421,110 +472,144 @@
</wd-col>
</wd-row>
</view>
<fly-login v-model="show" />
<view class="p-1"></view>
</view>
</template>
<script lang="ts" setup>
<script lang="ts">
// import { toLogin } from '@/libs/login.js'
import { getProductAPI } from '@/service/crmeb/product.ts'
import { getProductAPI, getBannerAPI } from '@/service/crmeb/product.ts'
import { useUserStore } from '@/store'
import { getUrl, getWebUrl } from '@/utils'
onLoad(() => {
getProduct(30)
// postFoo()
const userStore = useUserStore()
const hasLogin = computed(() => userStore.userInfo?.id)
import { defineComponent } from 'vue'
export default defineComponent({
data() {
return {
show: false,
product_30: {},
swiperList: {},
currentTab: 1,
city: '',
title: '',
}
},
async onLoad(option) {
this.getBanner()
this.getProduct(30)
},
methods: {
async getBanner() {
const res = await getBannerAPI([])
// 使 map
this.swiperList = res.data.map((item) => {
return {
...item,
url: item.image,
}
})
const product_30 = ref([])
const getProduct = async (id) => {
this.city = this.swiperList[0].city
this.title = this.swiperList[0].title
},
async getProduct(id) {
const res = await getProductAPI(id)
product_30.value = res.data
this.product_30 = res.data['list']
// console.log(product_30.value)
}
// const data2 = ref<IFooItem>()
// const postFoo = async () => {
// const res = await postFooAPI('2')
// }
// const { loading, error, data, run } = useRequest<IFooItem>(() => getProductAPI(30), {
// immediate: true,
// initialData,
// })
//
const swiperList = [
{
name: '三江区街道',
title:
'因举办古韵悠然的传统民俗文化节热度飙升,在这里,你能感受到乡村文化的深厚底蕴和无穷魅力。',
url: 'https://img.shetu66.com/2023/07/04/1688453333865029.png',
},
{
name: '农资供应',
title:
'因举办古韵悠然的传统民俗文化节热度飙升,在这里,你能感受到乡村文化的深厚底蕴和无穷魅力。',
url: 'https://www.keaitupian.cn/cjpic/frombd/2/253/1659552792/3869332496.jpg',
},
{
name: '土地流转',
title:
'因举办古韵悠然的传统民俗文化节热度飙升,在这里,你能感受到乡村文化的深厚底蕴和无穷魅力。',
url: 'https://img-baofun.zhhainiao.com/pcwallpaper_ugc/static/a6bba9bd1de44293b8d08a64d94775e4.jpg',
},
]
const current = ref(1)
function onChange(e) {
// console.log(e)
current.value = e.current
}
const currentTab = ref(1)
function changeTab(e) {
onChange(e) {
console.log(e)
currentTab.value = e.id
}
this.city = this.swiperList[e.current].city
this.title = this.swiperList[e.current].title
},
function moreVillage() {
changeTab(e) {
console.log(e)
// this.currentTab = e.id
},
// async submitGroup() {
// const res = await setGroupAPI(this.addressinfo)
// this.show = false
// },
moreVillage() {
console.log('查看乡村')
uni.navigateTo({
url: '/pages-village-sub/home/index',
})
}
},
function moreTourism() {
moreTourism() {
console.log('查看旅游')
uni.navigateTo({
url: '/pages-tourism-sub/home/index',
})
},
// more(item) {
// uni.navigateTo({
// url: `/pages/web_view/index?target=${item.url}&title=${item.name}`,
// })
// },
more(item) {
console.log(item)
if (item.type == 1) {
getUrl(item.url)
} else if (item.type == 2) {
getWebUrl(item.url)
}
function more(item) {
uni.navigateTo({
url: `/pages/web_view/index?target=${item.url}&title=${item.name}`,
},
},
})
}
// function more() {
// const swiperList = [
// {
// city: '',
// title:
// '',
// url: 'https://img.shetu66.com/2023/07/04/1688453333865029.png',
// },
// {
// city: '',
// title:
// '',
// url: 'https://www.keaitupian.cn/cjpic/frombd/2/253/1659552792/3869332496.jpg',
// },
// {
// city: '',
// title:
// '',
// url: 'https://img-baofun.zhhainiao.com/pcwallpaper_ugc/static/a6bba9bd1de44293b8d08a64d94775e4.jpg',
// },
// ]
// function more {
// console.log('')
// uni.navigateTo({
// url: '/pages/index/detail',
// })
// }
function goToShop() {
// if (this.isLogin) {
// const target = encodeURIComponent('/pages/goods_cate/goods_cate')
const target = '/pages/goods_cate/goods_cate'
// let urls = 'https://test.shop.lihaink.cn/pages/user/login'
uni.navigateTo({
url: `/pages/web_view/index?target=${target}&title=区域特产`,
})
// } else {
// this.openAuto()
// function more {
// // if (this.isLogin) {
// // const target = encodeURIComponent('/pages/goods_cate/goods_cate')
// const target = '/pages/goods_cate/goods_cate'
// // let urls = 'https://test.shop.lihaink.cn/pages/user/login'
// uni.navigateTo({
// url: `/pages/web_view/index?target=${target}&title=`,
// })
// // } else {
// // this.openAuto()
// // }
// }
// //
// function openAuto() {
// toLogin()
// }
}
//
function openAuto() {
toLogin()
}
</script>
<style lang="scss" scoped>

View File

@ -60,7 +60,7 @@
},
{
name: '我的订单',
url: '/pages/users/user_money/index',
url: '/pages/users/order_list/index?status=-1',
type: 2,
icon: '/static/icons/village_service.png',
color: 'green',

View File

@ -14,6 +14,7 @@
</template>
</CustomNavbar> -->
<!-- <view class="content"> -->
<fly-login v-model="show" />
<web-view class="web-view" :webview-styles="webviewStyles" :src="local_url"></web-view>
<!-- </view> -->
</template>
@ -23,6 +24,8 @@ import { defineComponent, computed } from 'vue'
import CustomNavbar from '@/components/CustomNavbar.vue'
import { getUrlCrmebLogin } from '@/utils'
import { isMpWeixin } from '@/utils/platform'
//
const hasLogin = computed(() => userStore.userInfo?.id)
export default defineComponent({
data() {
return {
@ -44,6 +47,10 @@ export default defineComponent({
},
},
onLoad(option) {
if (hasLogin) {
this.show = true
return
}
// this.local_url = decodeURIComponent(getUrlCrmebLogin() + option.target)
console.log(getUrlCrmebLogin())
// const target = encodeURIComponent(option.target)

View File

@ -27,6 +27,7 @@ export interface IFooItem {
export function getProductAPI(cate_pid: string) {
return http.get<IFooItem>(getUrlCrmebProxy() + '/api/product/spu/lst', { cate_pid })
}
// 用户中心
export function getInfoAPI() {
return http.post('/api/user/info', {})
}
@ -52,9 +53,25 @@ export function getDistrictAPI() {
}
export function getStreetAPI(code: string) {
return http.get('/api/location/getStreet', { code })
return http.get('/api/location/getStreet', { code: code })
}
export function getVillageAPI(code: string) {
return http.get('/api/location/getVillage', { code })
return http.get('/api/location/getVillage', { code: code })
}
// 首页
export function getBannerAPI(data: any) {
return http.post('/api/banner/index', data)
}
export function getArticleCategoryAPI(data: any) {
return http.get('/api/article/category', data)
}
export function getArticleIndexAPI(data: any) {
return http.get('/api/article/index', data)
}
export function getArticleDetailAPI(data: any) {
return http.get('/api/article/detail', data)
}