Browse Source

修改bug

master
岳鹏龙 9 months ago
parent
commit
6701c54c7e
  1. 64
      src/api/shop.ts
  2. 7
      src/pages.json
  3. 2
      src/pages/index/active/activelist.vue
  4. 2
      src/pages/index/shoppage/financialAssistance.vue
  5. 354
      src/pages/index/shoppage/interactiveDetail.vue
  6. 178
      src/pages/index/shoppage/interactiveZone.vue
  7. 81
      src/pages/index/shoppage/makeAssistance.vue
  8. 2
      src/pages/memberCenter/index.vue
  9. 10
      src/pages/mine/index.vue
  10. BIN
      src/static/img/qdl.png
  11. BIN
      src/static/img/search.png
  12. 6
      src/store/user.ts

64
src/api/shop.ts

@ -76,3 +76,67 @@ export function myMedium() {
}) })
} }
//发帖
export function addPosts(data:any) {
return request.http({
url: '/api/huiqitong/posts/add',
method: 'POST',
data
})
}
//帖子列表
export function postsList(data:any) {
return request.http({
url: '/api/huiqitong/posts/list',
method: 'GET',
data
})
}
//评论帖子
export function commentsPosts(data:any) {
return request.http({
url: '/api/huiqitong/posts/comments',
method: 'POST',
data
})
}
//点赞/取消点赞
export function likesPosts(data:any) {
return request.http({
url: '/api/huiqitong/posts/likes',
method: 'POST',
data
})
}
//评论列表
export function commentsList(data:any) {
return request.http({
url: '/api/huiqitong/posts/comments/list',
method: 'GET',
data
})
}
//是否点赞
export function isLikes(data:any) {
return request.http({
url: '/api/huiqitong/posts/isLikes',
method: 'POST',
data
})
}
//帖子详情
export function postsInfo(id:any) {
return request.http({
url: '/api/huiqitong/posts/info/'+id,
method: 'GET',
})
}

7
src/pages.json

@ -88,6 +88,13 @@
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{
"path": "pages/index/shoppage/interactiveDetail",
"style": {
"navigationBarTitleText": "帖子详情",
"navigationStyle": "custom"
}
},
{ {
"path": "pages/index/shoppage/financialAssistance", "path": "pages/index/shoppage/financialAssistance",
"style": { "style": {

2
src/pages/index/active/activelist.vue

@ -1,7 +1,7 @@
<template> <template>
<view class="container"> <view class="container">
<u-search @search="search" @clickIcon="clickIcon" @clear="clear" shape="square" placeholder="请输入搜索内容" <u-search @search="search" @clickIcon="clickIcon" @clear="clear" shape="square" placeholder="请输入搜索内容"
placeholderColor="#2a98ff" v-model="keyword" searchIcon="/static/img/search.png" searchIconSize="14" placeholderColor="#A9D4FF" v-model="keyword" searchIcon="/static/img/search.png" searchIconSize="14"
:showAction="false" height="40" margin="40rpx 24rpx 24rpx 24rpx" bgColor="#FFFFFF"></u-search> :showAction="false" height="40" margin="40rpx 24rpx 24rpx 24rpx" bgColor="#FFFFFF"></u-search>
<scroll-view scroll-y="auto" class="main" @scrolltolower="onloadmore"> <scroll-view scroll-y="auto" class="main" @scrolltolower="onloadmore">

2
src/pages/index/shoppage/financialAssistance.vue

@ -3,7 +3,7 @@
</u-navbar> </u-navbar>
<view class="container"> <view class="container">
<u-search @search="search" @clickIcon="clickIcon" @clear="clear" shape="square" placeholder="请输入搜索内容" <u-search @search="search" @clickIcon="clickIcon" @clear="clear" shape="square" placeholder="请输入搜索内容"
placeholderColor="#2a98ff" v-model="keyword" searchIcon="/static/img/search.png" searchIconSize="14" placeholderColor="#A9D4FF" v-model="keyword" searchIcon="/static/img/search.png" searchIconSize="14"
:showAction="false" height="40" margin="40rpx 24rpx 24rpx 24rpx" bgColor="#FFFFFF"></u-search> :showAction="false" height="40" margin="40rpx 24rpx 24rpx 24rpx" bgColor="#FFFFFF"></u-search>
<view class="main"> <view class="main">
<scroll-view scroll-y="auto" class="hyonne" @scrolltolower="onloadmore"> <scroll-view scroll-y="auto" class="hyonne" @scrolltolower="onloadmore">

354
src/pages/index/shoppage/interactiveDetail.vue

@ -0,0 +1,354 @@
<template>
<u-navbar :title="'帖子详情'" placeholder="true" bgColor="#F1F3F9" :autoBack="true" />
<view class="container">
<scroll-view class="cardbox">
<view class="dhone">
<view class="head">
<image style="height: 96rpx;width: 96rpx;border-radius: 50%;"
:src="baseurl + '/' + listdata.member_head_pic" mode="">
</image>
<view class="namepart">
<text class="name">{{listdata.member_nickname}}</text>
<text class="date">{{listdata.create_time}}</text>
</view>
</view>
<text class="pl">{{listdata.content}}</text>
<view class="bottom">
<view class="left">
<image style="width: 36rpx;height: 34rpx;"
:src="listdata.is_like?'/static/img/ydz.png':'/static/img/dz.png'"
@click="dzClick(listdata.is_like,listdata.posts_id)" mode="">
</image>
<text class="value">{{listdata.like_count}}</text>
</view>
<view class="right">
<image style="width: 36rpx;height: 36rpx;" src="@/static/img/pl.png" mode=""></image>
<text class="value">{{listdata.comment_count}}</text>
</view>
</view>
<scroll-view style="max-height: 60vh;" scroll-y="true" @scrolltolower="scrolltolower">
<view class="ypl" v-for="(item,index) in pllist" :key="index">
<view class="head">
<view class="left">
<image style="height: 40rpx;width: 40rpx;border-radius: 50%;"
:src="baseurl + '/' + item.member_head_pic" mode=""></image>
<text class="name">{{item.member_nickname}}</text>
</view>
<view class="right">
<text class="value">{{item.like_count}}</text>
<image style="width: 24rpx;height: 24rpx;margin-left: 8rpx;"
:src="item.is_like?'/static/img/ydz.png':'/static/img/dz.png'"
@click="pldzClick(item.is_like,item.comments_id)" mode="">
</image>
</view>
</view>
<text class="pl">{{item.content}}</text>
</view>
</scroll-view>
</view>
</scroll-view>
<view class="plpart">
<u-textarea class="textarea" v-model="plvalue" height="20" placeholder="请输入内容" autoHeight></u-textarea>
<view class="butt" @click="pullmess">发布</view>
</view>
</view>
</template>
<script setup>
import {
onLoad
} from '@dcloudio/uni-app';
import {
ref
} from 'vue';
import {
postsInfo,
commentsList,
likesPosts,
commentsPosts
} from '@/api/shop'
import useUserStore from '@/store/user'
const userStore = useUserStore()
const baseurl = ref(import.meta.env.VITE_APP_BASE_URL + '/')
const listdata = ref({})
const plvalue = ref('')
const dzClick = (like, id) => {
if (userStore.userInfo.moblie === undefined) {
uni.showToast({
title: '请登录后操作!',
icon: 'none'
})
} else {
listdata.value.is_like = !like
if (!like) {
listdata.value.like_count++
} else {
listdata.value.like_count--
}
likesPosts({
target_id: id,
type: 'posts'
})
}
}
const pldzClick = (like, id) => {
if (userStore.userInfo.moblie === undefined) {
uni.showToast({
title: '请登录后操作!',
icon: 'none'
})
} else {
pllist.value.forEach((ele) => {
if (ele.comments_id === id) {
ele.is_like = !ele.is_like
if (ele.is_like) {
ele.like_count++
} else {
ele.like_count--
}
likesPosts({
target_id: id,
type: 'comments'
})
}
})
}
}
const postsid = ref(0)
const page = ref(1)
const limit = ref(6)
const pllist = ref([])
const getplList = async (id) => {
await commentsList({
page: page.value,
limit: limit.value,
posts_id: postsid.value
}).then((res) => {
if (res.code === 1) {
pllist.value = [...pllist.value,...res.data.data]
}
})
}
const scrolltolower = async () => {
page.value++
await getplList()
}
const pullmess = async () => {
await commentsPosts({
posts_id: postsid.value,
content: plvalue.value
}).then((res) => {
if (res.code === 1) {
uni.showToast({
title: '评论成功',
duration: 1000,
success: async () => {
plvalue.value = ''
page.value = 1
await postsInfo(postsid.value).then((res) => {
listdata.value = res.data
})
await getplList()
}
})
}
})
}
onLoad(async (param) => {
postsid.value = param.id
page.value = 1
await postsInfo(param.id).then((res) => {
listdata.value = res.data
})
await getplList()
})
</script>
<style scoped lang="scss">
.container {
overflow-y: hidden;
background-color: #FFFFFF;
height: calc(100vh - 182rpx);
width: 100%;
box-sizing: border-box;
.cardbox {
.dhone {
margin-top: 30rpx;
width: 100%;
padding: 40rpx;
display: grid;
align-items: center;
box-sizing: border-box;
background: #FFFFFF;
.head {
display: flex;
align-items: center;
.namepart {
margin-left: 20rpx;
display: grid;
.name {
font-family: Source Han Sans;
font-size: 28rpx;
font-weight: 350;
line-height: 26rpx;
letter-spacing: normal;
color: #0C092A;
}
.date {
margin-top: 18rpx;
font-family: Source Han Sans;
font-size: 28rpx;
font-weight: 350;
line-height: 30rpx;
letter-spacing: normal;
color: #858494;
}
}
}
.pl {
margin-top: 24rpx;
font-family: Source Han Sans;
font-size: 28rpx;
font-weight: 350;
text-align: justify;
/* 浏览器可能不支持 */
letter-spacing: normal;
color: #0C092A;
}
.bottom {
margin-top: 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
.left {
display: flex;
align-items: center;
.value {
margin-left: 8rpx;
font-family: Source Han Sans;
font-size: 36rpx;
font-weight: 350;
line-height: 72rpx;
display: flex;
align-items: center;
letter-spacing: normal;
color: #858494;
}
}
.right {
display: flex;
align-items: center;
.value {
margin-left: 8rpx;
font-family: Source Han Sans;
font-size: 36rpx;
font-weight: 350;
line-height: 72rpx;
display: flex;
align-items: center;
letter-spacing: normal;
color: #858494;
}
}
}
}
}
.ypl {
width: 100%;
border-radius: 8rpx;
background: #F8F9FA;
padding: 24rpx;
margin-top: 22rpx;
.head {
display: flex;
align-items: center;
justify-content: space-between;
.left {
display: flex;
align-items: center;
.name {
margin-left: 8rpx;
font-family: Source Han Sans;
font-size: 28rpx;
font-weight: 350;
line-height: 26rpx;
letter-spacing: normal;
color: #333333;
}
}
.right {
display: flex;
align-items: center;
.value {
font-family: Source Han Sans;
font-size: 24rpx;
font-weight: 350;
line-height: 20rpx;
letter-spacing: normal;
color: #858494;
}
}
}
.pl {
font-family: Source Han Sans;
font-size: 24rpx;
font-weight: 350;
line-height: normal;
text-align: justify;
/* 浏览器可能不支持 */
display: flex;
align-items: center;
letter-spacing: normal;
color: #0C092A;
}
}
}
.plpart {
position: fixed;
bottom: 0;
width: 100%;
padding: 20px 15px;
box-sizing: border-box;
display: flex;
align-items: center;
.textarea {}
.butt {
margin-left: 10px;
padding: 9px 8px;
box-sizing: border-box;
background-color: #5AC725;
border-radius: 5px;
color: #FFFFFF;
}
}
</style>

178
src/pages/index/shoppage/interactiveZone.vue

@ -2,84 +2,116 @@
<u-navbar :title="'互动专区'" placeholder="true" bgColor="#F1F3F9" :autoBack="true" /> <u-navbar :title="'互动专区'" placeholder="true" bgColor="#F1F3F9" :autoBack="true" />
<view class="container"> <view class="container">
<u-tabs :list="list1" @click="click"></u-tabs> <u-tabs :list="list1" @click="click"></u-tabs>
<scroll-view class="cardbox"> <scroll-view class="cardbox" scroll-y="true" @scrolltolower="scrolltolower">
<view class="dhone"> <view class="dhone" v-for="(item,index) in datalist" :key="index">
<view class="head"> <view class="head">
<image style="height: 96rpx;width: 96rpx;border-radius: 50%;" src="@/static/img/tx.png" mode=""> <image style="height: 96rpx;width: 96rpx;border-radius: 50%;" :src="url + '/' + item.member_head_pic" mode="">
</image> </image>
<view class="namepart"> <view class="namepart">
<text class="name">王铎</text> <text class="name">{{item.member_nickname}}</text>
<text class="date">1月31日</text> <text class="date">{{item.create_time}}</text>
</view> </view>
</view> </view>
<text class="pl">小店帮好不好好不好小店帮好不好好不好小店帮好不好好不好小店帮好不好好不好</text> <text class="pl">{{item.content}}</text>
<view class="ypl"> <view class="ypl" v-if="item.comments">
<view class="head"> <view class="head">
<view class="left"> <view class="left">
<image style="height: 40rpx;width: 40rpx;border-radius: 50%;" src="@/static/img/tx.png" <image style="height: 40rpx;width: 40rpx;border-radius: 50%;" :src="url + '/' + item.comments?.member_head_pic"
mode=""></image> mode=""></image>
<text class="name">王铎</text> <text class="name">{{item.comments?.member_nickname}}</text>
</view> </view>
<view class="right"> <view class="right">
<text class="value">866</text> <text class="value">{{item.comments?.like_count}}</text>
<image style="width: 24rpx;height: 24rpx;margin-left: 8rpx;" src="@/static/img/dz.png" <image style="width: 24rpx;height: 24rpx;margin-left: 8rpx;" :src="item.comments.is_like?'/static/img/ydz.png':'/static/img/dz.png'"
mode=""></image> mode="" @click="pldzClick(item.posts_id,item.comments.is_like,item.comments.comments_id)"></image>
</view> </view>
</view> </view>
<text class="pl">小店帮好不好好不好小店帮好不好好不好小店帮好不好好不好小店帮好不好好不好</text> <text class="pl">{{item.comments?.content}}</text>
</view> </view>
<view class="bottom"> <view class="bottom">
<view class="left"> <view class="left">
<image style="width: 36rpx;height: 34rpx;" <image style="width: 36rpx;height: 34rpx;"
:src="showdz?'/static/img/dz.png':'/static/img/ydz.png'" @click="showdz = !showdz" mode=""> :src="item.is_like?'/static/img/ydz.png':'/static/img/dz.png'" @click="dzClick(item.is_like,item.posts_id)" mode="">
</image> </image>
<text class="value">866</text> <text class="value">{{item.like_count}}</text>
</view> </view>
<view class="right"> <view class="right">
<image style="width: 36rpx;height: 36rpx;" src="@/static/img/pl.png" mode="" <image style="width: 36rpx;height: 36rpx;" src="@/static/img/pl.png" mode=""
@click="showinput = true"></image> @click="godetail(item.posts_id)"></image>
<text class="value">21</text> <text class="value">{{item.comment_count}}</text>
</view> </view>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<image class="hdzq" src="@/static/img/fbhd.png" mode="" @click="goxzhdzq"></image> <liuDragButton :widthPx="'145rpx'">
<view class="inputbox" v-if="showinput" @click="showinput = false"> <image class="hdzq" src="@/static/img/fbhd.png" mode="" @click="goxzhdzq"></image>
<view @click.stop="clicknb"> </liuDragButton>
<u-textarea height="300" v-model="plvalue" placeholder="请输入内容" autoHeight
@confirm="confirm"></u-textarea>
</view>
</view>
</template> </template>
<script setup> <script setup>
const showdz = ref(true) import { postsList, likesPosts } from '@/api/shop'
const showinput = ref(false) import liuDragButton from '@/uni_modules/liu-drag-button/components/liu-drag-button/liu-drag-button.vue'
const plvalue = ref('') import useUserStore from '@/store/user'
const userStore = useUserStore()
const url = ref(import.meta.env.VITE_APP_BASE_URL)
// //
const list1 = reactive([{ const list1 = reactive([{
name: '小店帮' name: '小店帮',
id: 1
}, },
{ {
name: '金融帮' name: '金融帮',
id: 2
}, },
{ {
name: '媒体帮' name: '媒体帮',
id: 3
}, },
{ {
name: '企业帮' name: '企业帮',
id: 4
} }
]); ]);
const typeid = ref(1)
// //
function click(item) { const click = async(item) => {
console.log('item', item); page.value = 1
typeid.value = item.id
datalist.value = []
await getpostsList()
} }
//
function clicknb() { const dzClick = (like,id) => {
console.log('item'); if(userStore.userInfo.moblie === undefined) {
uni.showToast({
title: '请登录后操作!',
icon: 'none'
})
} else {
datalist.value.forEach((ele)=> {
if(ele.posts_id === id) {
ele.is_like = !ele.is_like
if(ele.is_like) {
ele.like_count++
} else {
ele.like_count--
}
likesPosts({target_id: id, type: 'posts'})
}
})
}
}
const scrolltolower = async() => {
page.value++
await getpostsList()
} }
const goxzhdzq = () => { const goxzhdzq = () => {
@ -87,21 +119,68 @@
url: '/pages/index/shoppage/makeAssistance' url: '/pages/index/shoppage/makeAssistance'
}) })
} }
const confirm = (e) => { const godetail = (id) => {
console.log(e); uni.navigateTo({
url: '/pages/index/shoppage/interactiveDetail?id='+id
})
} }
const page = ref(1)
const limit = ref(4)
const datalist = ref([])
const getpostsList = async() => {
await postsList({page: page.value, limit: limit.value, type_id: typeid.value}).then((res)=> {
if(res.code === 1) {
datalist.value = [...datalist.value, ...res.data.data]
}
})
}
const pldzClick = (postid, like, id) => {
if (userStore.userInfo.moblie === undefined) {
uni.showToast({
title: '请登录后操作!',
icon: 'none'
})
} else {
datalist.value.forEach((ele) => {
if (ele.posts_id === postid) {
ele.comments.is_like = !like
if (ele.comments.is_like) {
ele.comments.like_count++
} else {
ele.comments.like_count--
}
likesPosts({
target_id: id,
type: 'comments'
})
}
})
}
}
onLoad(async(e)=> {
page.value = 1
datalist.value = []
await getpostsList()
console.log(userStore.cometype);
})
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.container { .container {
background-color: #F1F3F9; background-color: #F1F3F9;
height: calc(100vh - 182rpx); height: calc(100vh - 96px);
overflow: hidden;
width: 100%; width: 100%;
.cardbox { .cardbox {
max-height: 80vh; max-height: calc(100vh - 150px);
overflow-y: auto;
.dhone { .dhone {
margin-top: 30rpx; margin-top: 30rpx;
@ -261,19 +340,4 @@
top: 75%; top: 75%;
} }
.inputbox {
background-color: #8686868f;
width: 100vw;
height: 100vh;
position: absolute;
top: 0;
left: 0;
:deep(.u-textarea) {
position: fixed;
bottom: 20%;
left: 0rpx;
width: 100vw;
}
}
</style> </style>

81
src/pages/index/shoppage/makeAssistance.vue

@ -6,14 +6,19 @@
<text class="txt">选择专区</text> <text class="txt">选择专区</text>
</view> </view>
<view class="right"> <view class="right">
<input style="text-align: end;" v-model="xzvalue" type="text" placeholder="请选择您要提问的专区" placeholder-class="placlass" disabled @tap="showxz = true" /> <input style="text-align: end;" v-model="xzvalue" type="text" placeholder="请选择您要提问的专区"
<u-action-sheet :actions="list" @select="selectClick" @close="showxz = false" :show="showxz" closeOnClickOverlay="true"></u-action-sheet> placeholder-class="placlass" disabled @tap="showxz = true" />
<image style="width: 16rpx;height: 28rpx;margin-left: 8rpx;" src="@/static/img/right.png" mode=""></image> <u-action-sheet :actions="list" @select="selectClick" @close="showxz = false" :show="showxz"
closeOnClickOverlay="true"></u-action-sheet>
<image style="width: 16rpx;height: 28rpx;margin-left: 8rpx;" src="@/static/img/right.png" mode="">
</image>
</view> </view>
</view> </view>
<u-textarea v-model="nrvalue" placeholder="请输入您的内容...." count autoHeight maxlength="200" height="266" border="none"></u-textarea> <u-textarea v-model="nrvalue" placeholder="请输入您的内容...." count autoHeight maxlength="200" height="266"
border="none"></u-textarea>
<view class="buts"> <view class="buts">
<view class="button" @click="submit" :style="nrvalue===''?'background: linear-gradient(90deg, rgba(0, 127, 255, 0.3) 0%, rgba(153, 204, 255, 0.3) 100%)':''"> <view class="button" @click="submit"
:style="nrvalue===''?'background: linear-gradient(90deg, rgba(0, 127, 255, 0.3) 0%, rgba(153, 204, 255, 0.3) 100%)':''">
发布 发布
</view> </view>
</view> </view>
@ -24,27 +29,58 @@
import { import {
ref ref
} from 'vue'; } from 'vue';
import { addPosts } from '@/api/shop'
const list = ref([ const list = ref([{
{ name: '小店帮' }, name: '小店帮',
{ name: '金融帮' }, id: 1
{ name: '媒体帮' }, },
{ name: '企业帮' } {
]); name: '金融帮',
id: 2
},
{
name: '媒体帮',
id: 3
},
{
name: '企业帮',
id: 4
}
]);
const showxz = ref(false) const showxz = ref(false)
const xzvalue = ref('') const xzvalue = ref('')
const xzid = ref(1)
const nrvalue = ref('') const nrvalue = ref('')
const selectClick = (index) => { const selectClick = (index) => {
console.log(index); xzvalue.value = index.name
xzvalue.value = index.name xzid.value = index.id
showxz.value = false showxz.value = false
}; };
const submit = () => { const submit = () => {
if(nrvalue.value !== '') { if (nrvalue.value !== '') {
console.log(nrvalue.value); let params = {
type_id: xzid.value,
content: nrvalue.value
}
addPosts(params).then((res)=> {
if(res.code === 1) {
uni.showToast({
title: '发布成功',
duration: 1500,
success() {
setTimeout(()=> {
uni.navigateTo({
url: '/pages/index/shoppage/interactiveZone'
})
},1500)
}
})
}
})
} }
} }
</script> </script>
@ -83,11 +119,13 @@
align-items: center; align-items: center;
} }
} }
.buts { .buts {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 100%; width: 100%;
.button { .button {
margin-top: 108rpx; margin-top: 108rpx;
border-radius: 248rpx; border-radius: 248rpx;
@ -98,7 +136,8 @@
font-size: 36rpx; font-size: 36rpx;
font-weight: 500; font-weight: 500;
line-height: 32rpx; line-height: 32rpx;
text-align: justify; /* 浏览器可能不支持 */ text-align: justify;
/* 浏览器可能不支持 */
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;

2
src/pages/memberCenter/index.vue

@ -4,7 +4,7 @@
leftText="申请入会" @leftClick="leftClick"> leftText="申请入会" @leftClick="leftClick">
</u-navbar> </u-navbar>
<u-search @search="search" @clickIcon="clickIcon" @clear="clear" shape="square" placeholder="请输入搜索内容" <u-search @search="search" @clickIcon="clickIcon" @clear="clear" shape="square" placeholder="请输入搜索内容"
placeholderColor="#2a98ff" v-model="keyword" searchIcon="/static/img/search.png" searchIconSize="14" placeholderColor="#A9D4FF" v-model="keyword" searchIcon="/static/img/search.png" searchIconSize="14"
:showAction="false" height="40" margin="40rpx 24rpx 24rpx 24rpx" bgColor="#FFFFFF"></u-search> :showAction="false" height="40" margin="40rpx 24rpx 24rpx 24rpx" bgColor="#FFFFFF"></u-search>
<u-tabs :list="filterTabs" :activeStyle="{color: '#0C092A',fontsize: '30rpx'}" keyName="title" <u-tabs :list="filterTabs" :activeStyle="{color: '#0C092A',fontsize: '30rpx'}" keyName="title"

10
src/pages/mine/index.vue

@ -2,17 +2,17 @@
<view class="container"> <view class="container">
<image style="width: 100%;" src="@/static/img/ztback.png" mode="widthFix"></image> <image style="width: 100%;" src="@/static/img/ztback.png" mode="widthFix"></image>
<view class="main"> <view class="main">
<view class="head" v-if="userStore.userInfo.moblie"> <view class="head">
<view class="left"> <view class="left">
<u-avatar <u-avatar v-if="userStore.userInfo.moblie"
:src="url + '/' + userStore.userInfo.head_pic" :src="url + '/' + userStore.userInfo.head_pic"
:size="72"></u-avatar> :size="72"></u-avatar>
<text class="name">{{userStore.userInfo.name||'无名称'}}</text> <img v-else style="width: 72px;height: 72px;border-radius: 50%;" src="@/static/img/qdl.png" alt="" />
<text class="name">{{userStore.userInfo.name}}</text>
</view> </view>
<image style="width: 48rpx;height: 48rpx;" src="@/static/img/setting.png" mode="" <image v-if="userStore.userInfo.moblie" style="width: 48rpx;height: 48rpx;" src="@/static/img/setting.png" mode=""
@click="goeditinfo('')"></image> @click="goeditinfo('')"></image>
</view> </view>
<text v-else>请登录</text>
<view class="editlist"> <view class="editlist">
<view class="editone" @click="goeditinfo('关联企业')"> <view class="editone" @click="goeditinfo('关联企业')">
<view class="left"> <view class="left">

BIN
src/static/img/qdl.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
src/static/img/search.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 718 B

After

Width:  |  Height:  |  Size: 832 B

6
src/store/user.ts

@ -14,6 +14,7 @@ export default defineStore(
const mobile = ref('') const mobile = ref('')
const showtoast = ref(false) const showtoast = ref(false)
const userInfo = ref<userInfoStoreInt>({}) const userInfo = ref<userInfoStoreInt>({})
const cometype = ref(0)
function getopenid(params : { code : string }) { function getopenid(params : { code : string }) {
return new Promise<any>((resolve, reject) => { return new Promise<any>((resolve, reject) => {
@ -60,7 +61,7 @@ export default defineStore(
title: '退出成功', title: '退出成功',
mask: true, mask: true,
success() { success() {
setTimeout(() => uni.reLaunch({ url: 'pages/login/login' }), 1000) setTimeout(() => uni.navigateTo({ url: 'pages/login/login' }), 1000)
} }
}) })
} }
@ -73,7 +74,8 @@ export default defineStore(
userInfo, userInfo,
getopenid, getopenid,
getUserInfo, getUserInfo,
logOut logOut,
cometype
} }
}, },
{ {

Loading…
Cancel
Save