页面
Some checks are pending
Auto Merge Main to Other Branches / Merge main into i18n (push) Waiting to run
Auto Merge Main to Other Branches / Merge main into base-sard-ui (push) Waiting to run

This commit is contained in:
sjeam 2025-09-05 14:17:20 +08:00
parent d5019d0c9c
commit 844619e18e
17 changed files with 176 additions and 133 deletions

3
env/.env vendored
View File

@ -13,7 +13,8 @@ VITE_LOGIN_URL = '/pages/login/index'
# 数字乡村
VITE_SERVER_BASEURL = 'http://test.data-middle.lihaink.cn'
VITE_UPLOAD_BASEURL = 'http://test.data-middle.lihaink.cn/upload'
# 商城
VITE_SHOP_SERVER_BASEURL = 'https://shop.lihaink.cn'
# 村集体
VITE_CRMEB_SERVER_BASEURL = 'https://test.shop.lihaink.cn'

View File

@ -81,10 +81,10 @@ const httpInterceptor = {
const userStore = useUserStore()
const { token } = userStore.userInfo as unknown as IUserInfo
// console.log('token', token)
// if (token) {
// options.header.Authorization = `Bearer ${token.access_token}`
// }
options.header.Authorization = `Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3ZWJtYW4udGlueXdhbi5jbiIsImF1ZCI6IndlYm1hbi50aW55d2FuLmNuIiwiaWF0IjoxNzU2ODYzNDAwLCJuYmYiOjE3NTY4NjM0MDAsImV4cCI6MTc1Njg3MDYwMCwiZXh0ZW5kIjp7ImlkIjoyMX19.5jmRqytXC-mqeNZBvef6vo4fm4RE0T-QR_mGzjZaAYM`
if (token) {
options.header.Authorization = `Bearer ${token.access_token}`
}
// options.header.Authorization = `Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3ZWJtYW4udGlueXdhbi5jbiIsImF1ZCI6IndlYm1hbi50aW55d2FuLmNuIiwiaWF0IjoxNzU2ODYzNDAwLCJuYmYiOjE3NTY4NjM0MDAsImV4cCI6MTc1Njg3MDYwMCwiZXh0ZW5kIjp7ImlkIjoyMX19.5jmRqytXC-mqeNZBvef6vo4fm4RE0T-QR_mGzjZaAYM`
},
}

View File

@ -25,7 +25,6 @@
:list="swiperList"
autoplay
:indicator="{ type: 'dots-bar' }"
@change="onChange"
></wd-swiper>
</view>
<view
@ -39,7 +38,7 @@
{{ detail.description }}
</view>
<view class="p-1 font-size-3" style="align-items: end">
<view class="p-1 font-size-3" style="align-items: end" @click="location(detail)">
<text class="pe-2 font-size-3">
<wd-icon name="location" size="28rpx" color="#87d76b"></wd-icon>
泸州市龙马潭区海吉星路
@ -64,7 +63,8 @@
<wd-card custom-class="card-content m-2">
<view class="m-2 p-2 font-size-4 color-black">场所介绍</view>
<view class="m-2 px-2" style="backdrop-filter: blur(2rpx); border-radius: 10rpx">
<wd-textarea v-html="detail.content" />
<!-- <wd-textarea v-html="detail.content" /> -->
<rich-text :nodes="detail.content"></rich-text>
</view>
</wd-card>
</view>
@ -81,19 +81,15 @@
</wd-card>
</view>
<scroll-view scroll-x="true" class="scroll-view-container">
<view
class="p-2"
style=""
@click="more"
v-for="item in index_list"
v-if="item.id != detail.id"
>
<scroll-view v-if="index_list.length > 0" scroll-x="true" class="scroll-view-container">
<view class="p-2" style="" v-for="item in index_list">
<wd-card custom-class="card-content">
<view class="content p-2" style="align-items: normal" @click="goPage(item)">
<view class="px-2 flex-content-column">
<view class="px-1 font-size-4 color-black">{{ item.author }}</view>
<view class="px-1 font-size-3 ellipsis-2">{{ item.description }}</view>
<view class="ps-2 flex-content-column">
<view class="ps-1 font-size-4 font-bold color-black ellipsis-2">
{{ 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>
@ -121,14 +117,11 @@ import {
getArticleCategoryAPI,
getArticleIndexAPI,
getArticleDetailAPI,
openLocation,
} 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 { http } from '@/utils/http'
export default defineComponent({
data() {
return {
@ -164,6 +157,30 @@ export default defineComponent({
goPage(item) {
getUrl('/pages/about/detail?id=' + item.id)
},
//
location(res) {
// uni.getLocation({
// type: 'gcj02',
// success: function (res) {
// console.log(res)
// },
// })
// openLocation(res.latitude, res.longitude, res.address, res.address)
openLocation(28.910634, 105.436959)
// http
// .get(`https://test.shop.lihaink.cn/api/lbs/geocoder?location=${28.910634},${105.436959}`)
// .catch((res) => {
// console.log(res)
// // // that.addFrom_address = res.data.address
// // // that.addFrom.province = res.data.address_component.province
// // // that.addFrom.city = res.data.address_component.city
// // // that.addFrom.district = res.data.address_component.district
// // // that.addFrom.latitude = res.data.location.latitude
// // // that.addFrom.longitude = res.data.location.longitude
// // // // that.addFrom.detail = res.data.address_component.street
// })
},
},
})
</script>

View File

@ -62,7 +62,9 @@
<wd-card custom-class="card-content">
<view class="content p-2" style="align-items: normal" @click="goPage(item)">
<view class="ps-2 flex-content-column">
<view class="ps-1 font-size-4 font-bold color-black">{{ item.author }}</view>
<view class="ps-1 font-size-4 font-bold color-black ellipsis-2">
{{ 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">

View File

@ -60,21 +60,30 @@
name: '租赁服务',
url: '/pages/activity/lease/index',
icon: '/static/icons/village_service.png',
type: 3,
color: 'green',
},
{
name: '农事服务',
url: '/pages/store/home/index?id=13',
icon: '/static/icons/agriculture_service.png',
type: 3,
color: 'blue',
},
{
name: '店铺街',
url: '/pages/store/shopStreet/index',
icon: '/static/icons/agriculture_course.png',
type: 3,
color: 'orange',
},
{ name: '美丽乡村', icon: '/static/icons/rural_ecommerce.png', color: 'red' },
{
name: '村集体',
url: '',
icon: '/static/icons/rural_ecommerce.png',
type: 2,
color: 'red',
},
]"
>
<wd-grid-item use-slot>
@ -101,7 +110,16 @@
好物上新季特产抢先购
</text>
</view>
<wd-button type="primary" size="small">
<wd-button
type="primary"
size="small"
@click="
more({
type: 2,
url: '',
})
"
>
<wd-text text="更多" color="#ffffff" size="24rpx"></wd-text>
</wd-button>
</view>
@ -116,7 +134,7 @@
@click="
more({
type: 2,
url: ' ',
url: `/pages/goods_details/index?id=${item.product_id} `,
})
"
v-for="item in product_30"
@ -361,14 +379,14 @@
// import { toLogin } from '@/libs/login.js'
import { getProductAPI, getBannerAPI } from '@/service/crmeb/product.ts'
import { useUserStore } from '@/store'
import { getUrl, getWebUrl } from '@/utils'
import { getUrl, getWebUrl, getShopWebUrl } from '@/utils'
import {
getArticleCategoryAPI,
getArticleIndexAPI,
getArticleDetailAPI,
} from '@/service/crmeb/product.ts'
const userStore = useUserStore()
const hasLogin = computed(() => userStore.userInfo?.id)
import { defineComponent } from 'vue'
export default defineComponent({
@ -376,7 +394,7 @@ export default defineComponent({
return {
show: false,
product_30: {},
swiperList: {},
swiperList: [],
index_eat: {},
index_live: {},
index_play: {},
@ -456,70 +474,30 @@ export default defineComponent({
url: '/pages-tourism-sub/home/index',
})
},
// more(item) {
// uni.navigateTo({
// url: `/pages/web_view/index?target=${item.url}&title=${item.name}`,
// })
// },
switchTab(index) {
uni.switchTab({
url: '/pages/about/index?category_id=' + index,
})
},
more(item) {
const hasLogin = userStore.userInfo['id'] ? true : false
if (!hasLogin) {
this.show = true
return
}
console.log(item)
if (item.type == 1) {
getUrl(item.url)
} else if (item.type == 2) {
getWebUrl(item.url)
} else if (item.type == 3) {
getShopWebUrl(item.url)
}
},
},
})
// 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 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()
// }
</script>
<style lang="scss" scoped>

View File

@ -7,42 +7,40 @@
<template>
<view class="background_home">
<view class=" " style="">
<wd-card custom-class="card-content">
<view class="relative h-50">
<wd-img
<view class="relative h-50">
<!-- <wd-img
radius="0px 0px 20rpx 20rpx "
:width="'100%'"
:height="'100%'"
src="https://img.shetu66.com/2023/06/14/1686734441937414.png"
/>
<view
class="m-4 absolute bottom-0 text-left left-0 right-0 text-white bg-black bg-opacity-0"
style="backdrop-filter: blur(2rpx); border-radius: 10rpx"
>
<view class="p-4">
<view class="flex items-center leading-6" v-if="hasLogin">
<image class="w-18 h-18 rounded-full" :src="userStore.userInfo?.avatar"></image>
/> -->
<view
class="m-4 absolute bottom-0 text-left left-0 right-0 text-white bg-black bg-opacity-0"
style="backdrop-filter: blur(2rpx); border-radius: 10rpx"
>
<view class="p-4">
<view class="flex items-center leading-6" v-if="hasLogin">
<image class="w-18 h-18 rounded-full" :src="userStore.userInfo?.avatar"></image>
<view class="ml-2 flex-content-column">
<view class="ps-1 font-size-4 font-bold">
微信用户{{ userStore.userInfo?.nickname }}
</view>
<view class="ml-1 font-size-3" style="align-items: end">
<text class="pe-2 font-size-3">ID{{ userStore.userInfo?.id }}</text>
</view>
<view class="ml-2 flex-content-column">
<view class="ps-1 font-size-4 font-bold">
微信用户{{ userStore.userInfo?.nickname }}
</view>
<view class="ml-1 font-size-3" style="align-items: end">
<text class="pe-2 font-size-3">ID{{ userStore.userInfo?.id }}</text>
</view>
</view>
<view class="flex items-center leading-6" v-else @click="show = true">
<image class="w-18 h-18 rounded-full" :src="userStore.userInfo?.avatar"></image>
<view class="ml-2 font-size-4">去登录</view>
</view>
<!-- <fly-content :line="10" /> -->
<!-- <button v-if="hasLogin" class="mt-2" @click="logout">退出登录</button> -->
</view>
<view class="flex items-center leading-6" v-else @click="show = true">
<image class="w-18 h-18 rounded-full" :src="userStore.userInfo?.avatar"></image>
<view class="ml-2 font-size-4">去登录</view>
</view>
<!-- <fly-content :line="10" /> -->
<!-- <button v-if="hasLogin" class="mt-2" @click="logout">退出登录</button> -->
</view>
</view>
</wd-card>
</view>
</view>
<view class="p-2">
@ -55,28 +53,28 @@
name: '我的钱包',
url: '/pages/users/user_money/index',
type: 2,
icon: '/static/icons/village_service.png',
icon: '/static/icons/my1.png',
color: 'green',
},
{
name: '我的订单',
url: '/pages/users/order_list/index?status=-1',
type: 2,
icon: '/static/icons/village_service.png',
icon: '/static/icons/my2.png',
color: 'green',
},
{
name: '我的收藏',
url: '/pages/users/user_goods_collection/index',
type: 2,
icon: '/static/icons/agriculture_service.png',
icon: '/static/icons/my3.png',
color: 'blue',
},
{
name: '浏览记录',
url: '/pages/users/browsingHistory/index',
type: 2,
icon: '/static/icons/agriculture_service.png',
icon: '/static/icons/my4.png',
color: 'blue',
},
@ -84,14 +82,14 @@
name: '平台客服',
url: '17309090670',
type: 2,
icon: '/static/icons/rural_ecommerce.png',
icon: '/static/icons/my5.png',
color: 'red',
},
{
name: '设置',
url: '/pages/my/setting',
type: 1,
icon: '/static/icons/rural_ecommerce.png',
icon: '/static/icons/my7.png',
color: 'red',
},
]"
@ -132,10 +130,10 @@ const logout = () => {
}
function more(item) {
if (hasLogin.value) {
show.value = true
return
}
// if (!hasLogin.value) {
// show.value = true
// return
// }
if (item.name == '平台客服') {
uni.showModal({
title: '提示',

View File

@ -16,21 +16,24 @@
</template>
</CustomNavbar>
<!-- <view class="content"> -->
<web-view class="web-view" :webview-styles="webviewStyles" :src="local_url"></web-view>
<fly-login v-model="show" />
<web-view class="web-view" :webview-styles="webviewStyles" :src="target"></web-view>
<!-- </view> -->
</template>
<!-- :style="{ width: windowW + 'px', height: windowH + 'px' }" -->
<script>
import { defineComponent, computed } from 'vue'
import CustomNavbar from '@/components/CustomNavbar.vue'
import { getUrlCrmebLogin } from '@/utils'
import { getUrlShop } from '@/utils'
//
const hasLogin = computed(() => userStore.userInfo?.id)
export default defineComponent({
data() {
return {
show: false,
windowH: 0,
windowW: 0,
local_url: '',
target: '',
title: '',
webviewStyles: {
progress: {
@ -46,12 +49,17 @@ export default defineComponent({
},
},
onLoad(option) {
// if (hasLogin) {
// this.show = true
// return
// }
uni.setNavigationBarTitle({
title: '商城', //
})
this.local_url = decodeURIComponent(getUrlCrmebLogin() + option.local_url)
this.target = decodeURIComponent(getUrlShop() + option.target)
console.log('target:', this.target)
this.title = option.title || '商城首页'
try {

View File

@ -47,10 +47,10 @@ export default defineComponent({
},
},
onLoad(option) {
if (hasLogin) {
this.show = true
return
}
// if (hasLogin) {
// this.show = true
// return
// }
// this.local_url = decodeURIComponent(getUrlCrmebLogin() + option.target)
console.log(getUrlCrmebLogin())
// const target = encodeURIComponent(option.target)

View File

@ -75,3 +75,28 @@ export function getArticleIndexAPI(data: any) {
export function getArticleDetailAPI(data: any) {
return http.get('/api/article/detail', data)
}
/**
*
* @param latitude
* @param longitude
* @param name
* @param address
*/
export function openLocation(
latitude: number,
longitude: number,
name: string = '',
address: string = '',
) {
return new Promise<void>((resolve, reject) => {
uni.openLocation({
latitude,
longitude,
name,
address,
success: () => resolve(),
fail: (err) => reject(err),
})
})
}

BIN
src/static/icons/my1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 745 B

BIN
src/static/icons/my2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
src/static/icons/my3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
src/static/icons/my4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
src/static/icons/my5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
src/static/icons/my6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
src/static/icons/my7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -174,6 +174,11 @@ export function getUrlCrmebLogin() {
}
}
export function getUrlShop() {
// 请求基准地址
let baseUrl = import.meta.env.VITE_SHOP_SERVER_BASEURL
return baseUrl
}
export function getUrlCrmeb() {
// 请求基准地址
let baseUrl = import.meta.env.VITE_CRMEB_SERVER_BASEURL
@ -186,13 +191,6 @@ export function getUrlCrmebProxy() {
return baseUrl
}
// 代登录跳转
export function getWebUrl(url) {
console.log(url)
return uni.navigateTo({
url: `/pages/web_view/index?target=${url}`,
})
}
//模块跳转
export function getUrl(url) {
console.log(url)
@ -200,3 +198,19 @@ export function getUrl(url) {
url: url,
})
}
// 代登录跳转
export function getWebUrl(url) {
console.log(url)
return uni.navigateTo({
url: `/pages/web_view/index?target=${url}`,
})
}
// 代登录跳转
export function getShopWebUrl(url) {
console.log(url)
return uni.navigateTo({
url: `/pages/web_view/h5?target=${url}`,
})
}