diff --git a/src/api/shop.ts b/src/api/shop.ts index 0ddcc72..70c1731 100644 --- a/src/api/shop.ts +++ b/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', + }) +} + + + diff --git a/src/pages.json b/src/pages.json index 9e12c24..83a108e 100644 --- a/src/pages.json +++ b/src/pages.json @@ -88,6 +88,13 @@ "navigationStyle": "custom" } }, + { + "path": "pages/index/shoppage/interactiveDetail", + "style": { + "navigationBarTitleText": "帖子详情", + "navigationStyle": "custom" + } + }, { "path": "pages/index/shoppage/financialAssistance", "style": { diff --git a/src/pages/index/active/activelist.vue b/src/pages/index/active/activelist.vue index c06ac09..336835f 100644 --- a/src/pages/index/active/activelist.vue +++ b/src/pages/index/active/activelist.vue @@ -1,7 +1,7 @@ \ No newline at end of file diff --git a/src/pages/index/shoppage/makeAssistance.vue b/src/pages/index/shoppage/makeAssistance.vue index ccb9a1d..423661e 100644 --- a/src/pages/index/shoppage/makeAssistance.vue +++ b/src/pages/index/shoppage/makeAssistance.vue @@ -6,14 +6,19 @@ 选择专区 - - - + + + + - + - + 发布 @@ -24,27 +29,58 @@ import { ref } from 'vue'; + import { addPosts } from '@/api/shop' - const list = ref([ - { name: '小店帮' }, - { name: '金融帮' }, - { name: '媒体帮' }, - { name: '企业帮' } - ]); + const list = ref([{ + name: '小店帮', + id: 1 + }, + { + name: '金融帮', + id: 2 + }, + { + name: '媒体帮', + id: 3 + }, + { + name: '企业帮', + id: 4 + } + ]); const showxz = ref(false) const xzvalue = ref('') + const xzid = ref(1) const nrvalue = ref('') - - const selectClick = (index) => { - console.log(index); - xzvalue.value = index.name - showxz.value = false - }; - + + const selectClick = (index) => { + xzvalue.value = index.name + xzid.value = index.id + showxz.value = false + }; + const submit = () => { - if(nrvalue.value !== '') { - console.log(nrvalue.value); + if (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) + } + }) + } + }) } } @@ -83,11 +119,13 @@ align-items: center; } } + .buts { display: flex; align-items: center; justify-content: center; width: 100%; + .button { margin-top: 108rpx; border-radius: 248rpx; @@ -98,7 +136,8 @@ font-size: 36rpx; font-weight: 500; line-height: 32rpx; - text-align: justify; /* 浏览器可能不支持 */ + text-align: justify; + /* 浏览器可能不支持 */ display: flex; align-items: center; letter-spacing: normal; diff --git a/src/pages/memberCenter/index.vue b/src/pages/memberCenter/index.vue index 0454bb7..edb363a 100644 --- a/src/pages/memberCenter/index.vue +++ b/src/pages/memberCenter/index.vue @@ -4,7 +4,7 @@ leftText="申请入会" @leftClick="leftClick"> - + - - {{userStore.userInfo.name||'无名称'}} + + {{userStore.userInfo.name}} - - 请登录 diff --git a/src/static/img/qdl.png b/src/static/img/qdl.png new file mode 100644 index 0000000..026a3d2 Binary files /dev/null and b/src/static/img/qdl.png differ diff --git a/src/static/img/search.png b/src/static/img/search.png index 5edd14d..36813e6 100644 Binary files a/src/static/img/search.png and b/src/static/img/search.png differ diff --git a/src/store/user.ts b/src/store/user.ts index d3444f5..8548063 100644 --- a/src/store/user.ts +++ b/src/store/user.ts @@ -14,6 +14,7 @@ export default defineStore( const mobile = ref('') const showtoast = ref(false) const userInfo = ref({}) + const cometype = ref(0) function getopenid(params : { code : string }) { return new Promise((resolve, reject) => { @@ -60,7 +61,7 @@ export default defineStore( title: '退出成功', mask: true, 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, getopenid, getUserInfo, - logOut + logOut, + cometype } }, {