页面
This commit is contained in:
parent
ee9c32bf7a
commit
95e24b2100
@ -49,7 +49,7 @@ const onChange = (e) => {
|
||||
console.log(value)
|
||||
}
|
||||
|
||||
const onSubmit = () => {
|
||||
const onSubmit = async () => {
|
||||
// 1、上传刚刚的图片,并返回网络地址
|
||||
// 2、把用户信息存起来
|
||||
// if (avatarUrl.value === defaultAvatarUrl) {
|
||||
@ -70,7 +70,8 @@ const onSubmit = () => {
|
||||
emit('update:modelValue', false)
|
||||
// console.log('保存用户信息')
|
||||
// userStore.setUserInfo({ nickname: nickname.value, avatar: avatarUrl.value })
|
||||
userStore.wxLogin()
|
||||
await userStore.wxLogin()
|
||||
await userStore.getUserInfo()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -33,12 +33,16 @@
|
||||
>
|
||||
<view class="content p-2 text-left" style="align-items: normal">
|
||||
<view class="px-2 flex-content-column">
|
||||
<view class="p-1 font-size-4 color-black">{{ detail.author }}</view>
|
||||
<view class="p-1 font-size-4 color-black font-bold">{{ detail.author }}</view>
|
||||
<view class="p-1 ellipsis-2 font-size-3">
|
||||
{{ detail.description }}
|
||||
</view>
|
||||
|
||||
<view class="p-1 font-size-3" style="align-items: end" @click="location(detail)">
|
||||
<view
|
||||
class="p-1 font-size-3 color-black"
|
||||
style="align-items: end"
|
||||
@click="location(detail)"
|
||||
>
|
||||
<text class="pe-2 font-size-3">
|
||||
<wd-icon name="location" size="28rpx" color="#87d76b"></wd-icon>
|
||||
泸州市龙马潭区海吉星路
|
||||
@ -61,7 +65,7 @@
|
||||
<view class="p-8"></view>
|
||||
<view class="p-2">
|
||||
<wd-card custom-class="card-content m-2">
|
||||
<view class="m-2 p-2 font-size-4 color-black">场所介绍</view>
|
||||
<view class="m-2 p-2 font-size-4 color-black font-bold">场所介绍</view>
|
||||
<view class="m-2 px-2 pb-2" style="backdrop-filter: blur(2rpx); border-radius: 10rpx">
|
||||
<!-- <wd-textarea v-html="detail.content" /> -->
|
||||
<rich-text :nodes="detail.content"></rich-text>
|
||||
@ -73,8 +77,8 @@
|
||||
<template #title>
|
||||
<view class="title">
|
||||
<view>
|
||||
<text class="text-xl px-2 text-sm font-size-4">更多推荐</text>
|
||||
<text class="px-2 text-xl text-sm font-size-3 color-gray-500"></text>
|
||||
<text class="text-xl px-2 text-sm font-size-4 font-bold">更多推荐</text>
|
||||
<text class="px-2 text-xl text-sm font-size-3 color-black"></text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@ -92,7 +96,7 @@
|
||||
<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>
|
||||
<text class="pe-2 font-size-3 color-black">泸州市龙马潭区海吉星路</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative" style="width: 280rpx; height: 200rpx">
|
||||
|
@ -24,15 +24,13 @@
|
||||
:height="'100%'"
|
||||
:src="banner_list.image"
|
||||
/>
|
||||
<view
|
||||
<!-- <view
|
||||
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">{{ banner_list.name }}</text>
|
||||
<text class="block font-size-3 text-left">
|
||||
<!-- 因举办古韵悠然的传统民俗文化节热度飙升,在这里,你能感受到乡村文化的深厚底蕴和无穷魅力。 -->
|
||||
</text>
|
||||
</view>
|
||||
<text class="block font-size-3 text-left"></text>
|
||||
</view> -->
|
||||
</view>
|
||||
</wd-card>
|
||||
</view>
|
||||
|
@ -36,7 +36,7 @@
|
||||
:indicator="{ type: 'dots-bar' }"
|
||||
@change="onChange"
|
||||
></wd-swiper>
|
||||
<view
|
||||
<!-- <view
|
||||
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"
|
||||
>
|
||||
@ -44,7 +44,7 @@
|
||||
<text class="block font-size-3 text-left ellipsis-2">
|
||||
{{ title }}
|
||||
</text>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</wd-card>
|
||||
</view>
|
||||
@ -88,7 +88,7 @@
|
||||
<wd-grid-item use-slot>
|
||||
<view class="p-2">
|
||||
<wd-img radius="20rpx" :width="'100rpx'" :height="'100rpx'" :src="item.icon" />
|
||||
<view class="ps-2 pt-2 pb-2 text-center font-size-3 font-blod">
|
||||
<view class="ps-2 pt-2 pb-2 text-center font-size-3 font-blod color-black">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
</view>
|
||||
@ -104,8 +104,8 @@
|
||||
<template #title>
|
||||
<view class="title">
|
||||
<view>
|
||||
<text class="text-xl text-sm font-size-4">当季产品</text>
|
||||
<text class="ps-2 text-xl text-sm font-size-3 color-gray-500">
|
||||
<text class="text-xl text-sm font-size-4 font-bold color-black">当季产品</text>
|
||||
<text class="ps-2 text-xl text-sm font-size-3 color-black">
|
||||
好物上新季,特产抢先购
|
||||
</text>
|
||||
</view>
|
||||
@ -143,7 +143,9 @@
|
||||
<view style="height: 200rpx; width: 300rpx">
|
||||
<wd-img radius="20rpx" :width="'100%'" :height="'100%'" :src="item.image" />
|
||||
</view>
|
||||
<view class="ps-2 pt-2 font-size-4 font-bold">{{ item.store_name }}</view>
|
||||
<view class="ps-2 pt-2 font-size-4 font-bold color-black">
|
||||
{{ item.store_name }}
|
||||
</view>
|
||||
<view class="ps-2 pt-2 font-size-3 ellipsis">{{ item.store_info }}</view>
|
||||
<view class="ps-2 pt-2 pb-2">
|
||||
<view class="text-sm text-gray-500 text-left">
|
||||
@ -170,10 +172,8 @@
|
||||
<template #title>
|
||||
<view class="title">
|
||||
<view>
|
||||
<text class="text-xl text-sm font-size-4">美丽乡村</text>
|
||||
<text class="ps-2 text-xl text-sm font-size-3 color-gray-500">
|
||||
美丽乡村风貌展示厅
|
||||
</text>
|
||||
<text class="text-xl text-sm font-size-4 font-bold">美丽乡村</text>
|
||||
<text class="ps-2 text-xl text-sm font-size-3 color-black">美丽乡村风貌展示厅</text>
|
||||
</view>
|
||||
<wd-button type="primary" size="small" @click="switchTab(eat_id)">
|
||||
<wd-text text="更多" color="#ffffff" size="24rpx"></wd-text>
|
||||
@ -230,10 +230,8 @@
|
||||
<template #title>
|
||||
<view class="title">
|
||||
<view>
|
||||
<text class="text-xl text-sm font-size-4">特产好物</text>
|
||||
<text class="ps-2 text-xl text-sm font-size-3 color-gray-500">
|
||||
精选好物,不容错过
|
||||
</text>
|
||||
<text class="text-xl text-sm font-size-4 font-bold">特产好物</text>
|
||||
<text class="ps-2 text-xl text-sm font-size-3 color-black">精选好物,不容错过</text>
|
||||
</view>
|
||||
<wd-button type="primary" size="small" @click="switchTab(live_id)">
|
||||
<wd-text text="更多" color="#ffffff" size="24rpx"></wd-text>
|
||||
@ -260,22 +258,9 @@
|
||||
<view style="height: 200rpx">
|
||||
<wd-img radius="20rpx" :width="'100%'" :height="'100%'" :src="item.cover" />
|
||||
</view>
|
||||
<view class="ps-2 pt-2 font-size-4 font-bold">{{ item.title }}</view>
|
||||
<view class="ps-2 pt-2 font-size-4 font-bold color-black">{{ item.title }}</view>
|
||||
<view class="ps-2 pt-2 font-size-3 ellipsis">{{ item.description }}</view>
|
||||
<view class="ps-2 pt-2 pb-2">
|
||||
<!-- <view class="text-sm text-gray-500 text-left">
|
||||
<wd-text size="20rpx" color="red" :text="item.price" mode="price" prefix="¥" />
|
||||
<wd-text size="20rpx" color="red" text="券后价" mode="text" prefix=" " />
|
||||
<wd-text
|
||||
size="18rpx"
|
||||
color="gray"
|
||||
:text="item.ot_price"
|
||||
mode="price"
|
||||
decoration="line-through"
|
||||
prefix="¥"
|
||||
/>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="ps-2 pt-2 pb-2"></view>
|
||||
</wd-card>
|
||||
</view>
|
||||
</view>
|
||||
@ -288,8 +273,8 @@
|
||||
<template #title>
|
||||
<view class="title">
|
||||
<view>
|
||||
<text class="text-xl text-sm font-size-4">热门咨询</text>
|
||||
<text class="ps-2 text-xl text-sm font-size-3 color-gray-500">
|
||||
<text class="text-xl text-sm font-size-4 font-bold">热门咨询</text>
|
||||
<text class="ps-2 text-xl text-sm font-size-3 color-black">
|
||||
热门咨询,一键掌握新鲜事
|
||||
</text>
|
||||
</view>
|
||||
@ -309,9 +294,11 @@
|
||||
<wd-img :width="'100%'" :height="'100%'" radius="20rpx" :src="item.cover" alt="joy" />
|
||||
</view>
|
||||
<view class="ps-2 flex-content-column">
|
||||
<view class="ps-1 font-size-3 font-bold">{{ item.title }}</view>
|
||||
<view class="ps-1 font-size-3 font-bold ellipsis-2 color-black">
|
||||
{{ item.title }}
|
||||
</view>
|
||||
<view class="px-1 font-size-3 ellipsis-2">{{ item.description }}</view>
|
||||
<view class="p-1 font-size-3" style="align-items: end">
|
||||
<view class="p-1 font-size-3 color-black" style="align-items: end">
|
||||
<text class="pe-2 font-size-3">2025-8-23</text>
|
||||
<wd-tag custom-class="space font-size-3" type="danger" round>
|
||||
{{ item.category_name }}
|
||||
@ -328,10 +315,8 @@
|
||||
<template #title>
|
||||
<view class="title">
|
||||
<view>
|
||||
<text class="text-xl text-sm font-size-4">景区旅游</text>
|
||||
<text class="ps-2 text-xl text-sm font-size-3 color-gray-500">
|
||||
好玩儿路线一网打尽
|
||||
</text>
|
||||
<text class="text-xl text-sm font-size-4 font-bold">景区旅游</text>
|
||||
<text class="ps-2 text-xl text-sm font-size-3 color-black">好玩儿路线一网打尽</text>
|
||||
</view>
|
||||
<wd-button type="primary" size="small" @click="switchTab(purchase_id)">
|
||||
<wd-text text="更多" color="#ffffff" size="24rpx"></wd-text>
|
||||
@ -349,7 +334,7 @@
|
||||
<view style="height: 200rpx">
|
||||
<wd-img radius="20rpx" :width="'100%'" :height="'100%'" :src="item.cover" />
|
||||
</view>
|
||||
<view class="ps-2 pt-2 font-size-4 font-bold">{{ item.author }}</view>
|
||||
<view class="ps-2 pt-2 font-size-4 font-bold color-black">{{ item.author }}</view>
|
||||
<view class="ps-2 pt-2 font-size-3 ellipsis">{{ item.description }}</view>
|
||||
<view class="ps-2 pt-2 pb-2">
|
||||
<!-- <view class="text-sm text-gray-500 text-left">
|
||||
|
@ -104,7 +104,7 @@
|
||||
<wd-grid-item use-slot>
|
||||
<view class="p-2">
|
||||
<wd-img radius="20rpx" :width="'60rpx'" :height="'60rpx'" :src="item.icon" />
|
||||
<view class="ps-2 pt-2 pb-2 text-center text-gray-500 font-size-3">
|
||||
<view class="ps-2 pt-2 pb-2 text-center color-black font-size-3">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
</view>
|
||||
@ -112,7 +112,7 @@
|
||||
</view>
|
||||
</wd-grid>
|
||||
</wd-card>
|
||||
<button v-if="hasLogin" class="mt-2" @click="logout">退出登录</button>
|
||||
<!-- <button v-if="hasLogin" class="mt-2" @click="logout">退出登录</button> -->
|
||||
</view>
|
||||
<fly-login v-model="show" />
|
||||
</view>
|
||||
|
@ -142,11 +142,11 @@
|
||||
},
|
||||
]"
|
||||
></wd-col-picker>
|
||||
<button v-if="type === 1" class="mt-2" @click="goBack">返回</button>
|
||||
</wd-popup>
|
||||
</wd-card>
|
||||
</view>
|
||||
<button v-if="hasLogin" class="mt-2" @click="logout">退出登录</button>
|
||||
<button class="mt-2" @click="goBack">返回</button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -179,6 +179,7 @@ import {
|
||||
export default defineComponent({
|
||||
data() {
|
||||
return {
|
||||
type: 0, // 0 点击进入 1 跳转登录
|
||||
hasLogin: false,
|
||||
showPhone: false,
|
||||
showName: false,
|
||||
@ -216,7 +217,14 @@ export default defineComponent({
|
||||
}
|
||||
},
|
||||
async onLoad(option) {
|
||||
this.show = option.show || false
|
||||
this.type = option.type || 0
|
||||
if (this.type === 1) {
|
||||
//跳转登录
|
||||
} else {
|
||||
//点击进入
|
||||
this.show = true
|
||||
}
|
||||
|
||||
this.getArea()
|
||||
this.getUserInfo()
|
||||
},
|
||||
@ -323,6 +331,10 @@ export default defineComponent({
|
||||
this.show = false
|
||||
//重新获取地址信息
|
||||
userStore.getUserInfo()
|
||||
//跳转页面,设置后返回
|
||||
if (this.type === 1) {
|
||||
this.goBack()
|
||||
}
|
||||
},
|
||||
|
||||
//地址改版事件
|
||||
|
@ -58,7 +58,7 @@ function more(item) {
|
||||
<template #title>
|
||||
<view class="title">
|
||||
<view>
|
||||
<text class="text-sm text-xl font-size-4">看看附近</text>
|
||||
<text class="text-sm text-xl font-size-4 font-bold">看看附近</text>
|
||||
<text class="ps-2 text-sm text-xl font-size-3 color-gray-500">
|
||||
好物上新季,特产抢先购
|
||||
</text>
|
||||
@ -135,7 +135,7 @@ function more(item) {
|
||||
<wd-grid-item use-slot>
|
||||
<view class="p-2">
|
||||
<wd-img radius="20rpx" width="100rpx" height="100rpx" :src="item.icon" />
|
||||
<view class="pb-2 ps-2 pt-2 text-center font-size-3 text-gray-500">
|
||||
<view class="pb-2 ps-2 pt-2 text-center font-size-3 color-black">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
</view>
|
||||
@ -152,7 +152,7 @@ function more(item) {
|
||||
<template #title>
|
||||
<view class="title">
|
||||
<view>
|
||||
<text class="text-sm text-xl font-size-4">游玩必备</text>
|
||||
<text class="text-sm text-xl font-size-4 font-bold">游玩必备</text>
|
||||
<text class="ps-2 text-sm text-xl font-size-3 color-gray-500">
|
||||
好物上新季,特产抢先购
|
||||
</text>
|
||||
@ -194,7 +194,7 @@ function more(item) {
|
||||
<wd-grid-item use-slot>
|
||||
<view class="p-2">
|
||||
<wd-img radius="20rpx" width="100rpx" height="100rpx" :src="item.icon" />
|
||||
<view class="pb-2 ps-2 pt-2 text-center font-size-3 text-gray-500">
|
||||
<view class="pb-2 ps-2 pt-2 text-center font-size-3 color-black">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
</view>
|
||||
@ -250,7 +250,7 @@ function more(item) {
|
||||
<wd-grid-item use-slot>
|
||||
<view class="p-2">
|
||||
<wd-img radius="20rpx" width="100rpx" height="100rpx" :src="item.icon" />
|
||||
<view class="pb-2 ps-2 pt-2 text-center font-size-3 text-gray-500">
|
||||
<view class="pb-2 ps-2 pt-2 text-center font-size-3 color-black">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
</view>
|
||||
|
@ -29,7 +29,7 @@ export function getProductAPI(cate_pid: string) {
|
||||
}
|
||||
// 用户中心
|
||||
export function getInfoAPI() {
|
||||
return http.post('/api/user/info', {})
|
||||
return http.get('/api/user/info', {})
|
||||
}
|
||||
|
||||
export function setInfoPI(data: any) {
|
||||
|
@ -36,7 +36,7 @@ export const useUserStore = defineStore(
|
||||
// val.avatar = 'https://oss.laf.run/ukw0y1-site/avatar.jpg?feige'
|
||||
}
|
||||
//判断是否设置村庄
|
||||
val.isset = userInfoState.village ? true : false
|
||||
val.isset = val.village ? true : false
|
||||
userInfo.value = val
|
||||
}
|
||||
const setUserAvatar = (avatar: string) => {
|
||||
@ -55,13 +55,16 @@ export const useUserStore = defineStore(
|
||||
*/
|
||||
const getUserInfo = async () => {
|
||||
const res = await _getUserInfo()
|
||||
const userInfo = res.data
|
||||
setUserInfo(userInfo)
|
||||
const user = res.data
|
||||
const newData = userInfo.value
|
||||
newData.isset = user.village ? true : false
|
||||
userInfo.value = newData
|
||||
// uni.setStorageSync('userInfo', userInfo)
|
||||
// uni.setStorageSync('token', userInfo.token)
|
||||
// TODO 这里可以增加获取用户路由的方法 根据用户的角色动态生成路由
|
||||
return res
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户登录
|
||||
* @param credentials 登录参数
|
||||
|
@ -45,7 +45,7 @@ page {
|
||||
}
|
||||
|
||||
.color-black {
|
||||
color: #333333 !important;
|
||||
color: #333333ff !important;
|
||||
}
|
||||
|
||||
.default-color {
|
||||
@ -142,6 +142,7 @@ $container-width: 100%;
|
||||
$padding-width: 20rpx;
|
||||
.ellipsis {
|
||||
display: inline-block;
|
||||
color: #333333ff !important;
|
||||
|
||||
width: calc($container-width - $padding-width); /* 确保容器有宽度 */
|
||||
/* 防止文字换行 */
|
||||
@ -152,6 +153,7 @@ $padding-width: 20rpx;
|
||||
/* 确保元素有宽度 */
|
||||
}
|
||||
.ellipsis-2 {
|
||||
color: #333333ff !important;
|
||||
display: -webkit-box;
|
||||
// font-weight: 500;
|
||||
font-size: 40rpx;
|
||||
@ -166,6 +168,7 @@ $padding-width: 20rpx;
|
||||
}
|
||||
|
||||
.ellipsis-5 {
|
||||
color: #333333ff !important;
|
||||
display: -webkit-box;
|
||||
// font-weight: 500;
|
||||
font-size: 40rpx;
|
||||
|
@ -23,7 +23,7 @@ $uni-color-warning: #f0ad4e;
|
||||
$uni-color-error: #dd524d;
|
||||
|
||||
/* 文字基本颜色 */
|
||||
$uni-text-color: #333; // 基本色
|
||||
$uni-text-color: #333333ff; // 基本色
|
||||
$uni-text-color-inverse: #fff; // 反色
|
||||
$uni-text-color-grey: #999; // 辅助灰色,如加载更多的提示信息
|
||||
$uni-text-color-placeholder: #808080;
|
||||
|
@ -220,32 +220,30 @@ import { useUserStore } from '@/store'
|
||||
export function hasLogin() {
|
||||
const hasLogin = useUserStore().userInfo.id ? true : false
|
||||
// console.log(useUserStore().userInfo)
|
||||
|
||||
// console.log('是否登录', hasLogin)
|
||||
// console.log('是否登录sss', useUserStore().userInfo)
|
||||
// //强制跳转设置村庄
|
||||
// if (hasLogin && !useUserStore().userInfo.isset) {
|
||||
// // if (!this.phone) {
|
||||
// // uni.showToast({
|
||||
// // title: '请填写手机号',
|
||||
// // icon: 'none',
|
||||
// // })
|
||||
// // return
|
||||
// // }
|
||||
// uni.showModal({
|
||||
// title: '温馨提示',
|
||||
// content: ' 您尚未完善个人信息,是否前往设置你的个人地址?',
|
||||
// success: function (res) {
|
||||
// if (res.confirm) {
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/my/setting',
|
||||
// })
|
||||
// }
|
||||
// },
|
||||
// })
|
||||
|
||||
// return
|
||||
// }
|
||||
console.log('是否登录', hasLogin)
|
||||
console.log('是否登录sss', useUserStore().userInfo)
|
||||
//强制跳转设置村庄
|
||||
if (hasLogin && !useUserStore().userInfo.isset) {
|
||||
// if (!this.phone) {
|
||||
// uni.showToast({
|
||||
// title: '请填写手机号',
|
||||
// icon: 'none',
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: ' 您尚未完善个人信息,是否前往设置你的个人地址?',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/setting?type=1',
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
return
|
||||
}
|
||||
//返回是否登录
|
||||
return hasLogin
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user