页面
This commit is contained in:
parent
3e613abdd7
commit
60ec7f93cc
@ -6,7 +6,7 @@ export interface IUserInfoVo {
|
||||
nickname: string
|
||||
avatar: string
|
||||
token: string
|
||||
isset: boolean
|
||||
village_id: number
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -126,7 +126,11 @@
|
||||
},
|
||||
{
|
||||
"path": "pages/service/find",
|
||||
"type": "page"
|
||||
"type": "page",
|
||||
"layout": "tabbar",
|
||||
"style": {
|
||||
"navigationBarTitleText": "服务"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/service/index",
|
||||
|
@ -118,7 +118,7 @@ export default defineComponent({
|
||||
banner_list: [],
|
||||
show: false,
|
||||
index_list: {},
|
||||
detail: {},
|
||||
// detail: {},
|
||||
category: {},
|
||||
currentTab: 1,
|
||||
city: '',
|
||||
@ -128,7 +128,7 @@ export default defineComponent({
|
||||
async onLoad(option) {
|
||||
console.log(option)
|
||||
this.getCategory()
|
||||
this.getDetail(1)
|
||||
// this.getDetail(1)
|
||||
},
|
||||
methods: {
|
||||
changeTab(item) {
|
||||
@ -149,11 +149,11 @@ export default defineComponent({
|
||||
// 使用正确的 map 方法返回新数组
|
||||
this.index_list = res.data
|
||||
},
|
||||
async getDetail(id) {
|
||||
const res = await getArticleDetailAPI({ id: id })
|
||||
// 使用正确的 map 方法返回新数组
|
||||
this.detail = res.data
|
||||
},
|
||||
// async getDetail(id) {
|
||||
// const res = await getArticleDetailAPI({ id: id })
|
||||
// // 使用正确的 map 方法返回新数组
|
||||
// this.detail = res.data
|
||||
// },
|
||||
goPage(item) {
|
||||
getUrl('/pages/about/detail?id=' + item.id)
|
||||
},
|
||||
|
@ -1,3 +1,11 @@
|
||||
<route lang="json5">
|
||||
{
|
||||
layout: 'tabbar',
|
||||
style: {
|
||||
navigationBarTitleText: '服务',
|
||||
},
|
||||
}
|
||||
</route>
|
||||
<script>
|
||||
import QQMapWX from 'qqmap-wx-jssdk'
|
||||
|
||||
|
@ -24,7 +24,7 @@ const { safeAreaInsets } = uni.getSystemInfoSync()
|
||||
function more(item) {
|
||||
uni.navigateTo({
|
||||
// url: `/pages/web_view/index?target=${item.url}&title=${item.name}`,
|
||||
url: `/pages/service/find?keyword=${item.name}`,
|
||||
url: `/pages/service/find?keyword=${item.keyword}`,
|
||||
})
|
||||
|
||||
// uni.openLocation({
|
||||
@ -81,54 +81,54 @@ function more(item) {
|
||||
color: 'green',
|
||||
},
|
||||
{
|
||||
name: '农事服务',
|
||||
keyword: '停车场',
|
||||
name: '母婴服务',
|
||||
keyword: '母婴',
|
||||
url: '/pages/store/home/index?id=13',
|
||||
icon: '/static/icons/fj_2.png',
|
||||
color: 'blue',
|
||||
},
|
||||
{
|
||||
name: '店铺街',
|
||||
keyword: '停车场',
|
||||
url: '/pages/store/shopStreet/index',
|
||||
icon: '/static/icons/fj_3.png',
|
||||
color: 'orange',
|
||||
},
|
||||
{
|
||||
name: '特产产品',
|
||||
keyword: '停车场',
|
||||
url: '/pages/activity/lease/index',
|
||||
icon: '/static/icons/fj_4.png',
|
||||
color: 'green',
|
||||
},
|
||||
// {
|
||||
// name: '店铺街',
|
||||
// keyword: '停车场',
|
||||
// url: '/pages/store/shopStreet/index',
|
||||
// icon: '/static/icons/fj_3.png',
|
||||
// color: 'orange',
|
||||
// },
|
||||
// {
|
||||
// name: '特产产品',
|
||||
// keyword: '停车场',
|
||||
// url: '/pages/activity/lease/index',
|
||||
// icon: '/static/icons/fj_4.png',
|
||||
// color: 'green',
|
||||
// },
|
||||
{
|
||||
name: '特色美食',
|
||||
keyword: '停车场',
|
||||
keyword: '美食',
|
||||
url: '/pages/store/home/index?id=13',
|
||||
icon: '/static/icons/fj_5.png',
|
||||
color: 'blue',
|
||||
},
|
||||
{
|
||||
name: '当季产品',
|
||||
keyword: '停车场',
|
||||
url: '/pages/activity/lease/index',
|
||||
icon: '/static/icons/fj_6.png',
|
||||
color: 'orange',
|
||||
},
|
||||
{
|
||||
name: '美丽乡村',
|
||||
keyword: '停车场',
|
||||
url: '/pages/activity/lease/index',
|
||||
icon: '/static/icons/fj_7.png',
|
||||
color: 'red',
|
||||
},
|
||||
{
|
||||
name: '景区景色',
|
||||
keyword: '景区',
|
||||
url: '/pages/activity/lease/index',
|
||||
icon: '/static/icons/fj_8.png',
|
||||
color: 'red',
|
||||
},
|
||||
// {
|
||||
// name: '当季产品',
|
||||
// keyword: '停车场',
|
||||
// url: '/pages/activity/lease/index',
|
||||
// icon: '/static/icons/fj_6.png',
|
||||
// color: 'orange',
|
||||
// },
|
||||
// {
|
||||
// name: '美丽乡村',
|
||||
// keyword: '乡村',
|
||||
// url: '/pages/activity/lease/index',
|
||||
// icon: '/static/icons/fj_7.png',
|
||||
// color: 'red',
|
||||
// },
|
||||
// {
|
||||
// name: '景区景色',
|
||||
// keyword: '景区',
|
||||
// url: '/pages/activity/lease/index',
|
||||
// icon: '/static/icons/fj_8.png',
|
||||
// color: 'red',
|
||||
// },
|
||||
]"
|
||||
@click="more(item)"
|
||||
>
|
||||
@ -181,13 +181,13 @@ function more(item) {
|
||||
icon: '/static/icons/ly_2.png',
|
||||
color: 'blue',
|
||||
},
|
||||
{
|
||||
name: '天气预报',
|
||||
keyword: '景区',
|
||||
url: '/pages/activity/lease/index',
|
||||
icon: '/static/icons/ly_3.png',
|
||||
color: 'orange',
|
||||
},
|
||||
// {
|
||||
// name: '天气预报',
|
||||
// keyword: '景区',
|
||||
// url: '/pages/activity/lease/index',
|
||||
// icon: '/static/icons/ly_3.png',
|
||||
// color: 'orange',
|
||||
// },
|
||||
]"
|
||||
@click="more(item)"
|
||||
>
|
||||
|
@ -19,6 +19,7 @@ const userStore = useUserStore()
|
||||
|
||||
// 检查是否授权
|
||||
const userId = computed(() => userStore.userInfo?.id)
|
||||
const village_id = computed(() => userStore.userInfo?.village_id)
|
||||
export default defineComponent({
|
||||
data() {
|
||||
return {
|
||||
@ -44,7 +45,7 @@ export default defineComponent({
|
||||
const target = option.target
|
||||
console.log('userId', userId.value)
|
||||
if (isMpWeixin) {
|
||||
this.local_url = `${getUrlCrmebLogin()}?target=${target}&user_id=${userId.value}`
|
||||
this.local_url = `${getUrlCrmebLogin()}?target=${target}&user_id=${userId.value}&village_id=${village_id.value}`
|
||||
} else {
|
||||
this.local_url = getUrlCrmebLogin() + target
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ const userInfoState: IUserInfoVo = {
|
||||
nickname: '',
|
||||
avatar: '/static/images/default-avatar.png',
|
||||
token: '',
|
||||
isset: false,
|
||||
village_id: 0,
|
||||
}
|
||||
|
||||
export const useUserStore = defineStore(
|
||||
@ -39,7 +39,7 @@ export const useUserStore = defineStore(
|
||||
// // val.avatar = 'https://oss.laf.run/ukw0y1-site/avatar.jpg?feige'
|
||||
// }
|
||||
// 判断是否设置村庄
|
||||
val.isset = val.village ? true : false
|
||||
val.village_id = val.village ? val.village : 0
|
||||
userInfo.value = val
|
||||
}
|
||||
const setUserAvatar = (avatar: string) => {
|
||||
@ -65,7 +65,7 @@ export const useUserStore = defineStore(
|
||||
removeUserInfo()
|
||||
}
|
||||
const newData = userInfo.value
|
||||
newData.isset = !!user.village
|
||||
newData.village_id = user.village ? user.village : 0
|
||||
newData.avatar = user.avatar
|
||||
newData.nickname = user.nickname
|
||||
userInfo.value = newData
|
||||
|
@ -223,11 +223,13 @@ import { useUserStore } from '@/store'
|
||||
export async function hasLogin() {
|
||||
const res = await getInfoAPI()
|
||||
// const res = await http.get('/api/user/info', {})
|
||||
console.log('hasLogin', res)
|
||||
// console.log('hasLogin', res)
|
||||
console.log('village_id', useUserStore().userInfo.village_id)
|
||||
if (res.code === 401) {
|
||||
const hasLogin = false
|
||||
//强制跳转设置村庄
|
||||
if (hasLogin && !useUserStore().userInfo.isset) {
|
||||
|
||||
if (hasLogin && useUserStore().userInfo.village_id === 0) {
|
||||
// if (!this.phone) {
|
||||
// uni.showToast({
|
||||
// title: '请填写手机号',
|
||||
@ -253,7 +255,7 @@ export async function hasLogin() {
|
||||
} else {
|
||||
const hasLogin = true
|
||||
//强制跳转设置村庄
|
||||
if (hasLogin && !useUserStore().userInfo.isset) {
|
||||
if (hasLogin && useUserStore().userInfo.village_id === 0) {
|
||||
// if (!this.phone) {
|
||||
// uni.showToast({
|
||||
// title: '请填写手机号',
|
||||
|
Loading…
x
Reference in New Issue
Block a user