Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
swx_weapp
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
hookehuyr
2022-10-26 09:52:34 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9e77905a1d18e2c70f3db91d6ab55f8459c5e29a
9e77905a
1 parent
f160a6f9
创建活动页面API逻辑联调
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
7 deletions
src/api/Activity/index.js
src/pages/activityDetail/index.vue
src/pages/my/index.vue
src/pages/myCreateActivity/index.vue
src/api/Activity/index.js
View file @
9e77905
/*
* @Date: 2022-10-20 13:15:00
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-10-25 1
5:37:28
* @LastEditTime: 2022-10-25 1
7:27:05
* @FilePath: /swx/src/api/Activity/index.js
* @Description: 活动信息
*/
...
...
@@ -9,6 +9,7 @@ import { fn, fetch } from '../fn';
const
Api
=
{
ACTIVITY_JOIN_LIST
:
'/srv/?a=activity_join_list'
,
ACTIVITY_ADD_LIST
:
'/srv/?a=activity_add_list'
,
}
/**
...
...
@@ -16,3 +17,9 @@ const Api = {
* @returns
*/
export
const
joinListAPI
=
(
params
)
=>
fn
(
fetch
.
get
(
Api
.
ACTIVITY_JOIN_LIST
,
params
));
/**
* @description: 我创建的活动列表
* @returns
*/
export
const
addListAPI
=
(
params
)
=>
fn
(
fetch
.
get
(
Api
.
ACTIVITY_ADD_LIST
,
params
));
...
...
src/pages/activityDetail/index.vue
View file @
9e77905
<!--
* @Date: 2022-09-26 14:36:57
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-10-2
5 16:26:07
* @LastEditTime: 2022-10-2
6 09:14:00
* @FilePath: /swx/src/pages/activityDetail/index.vue
* @Description: 活动详情页
-->
...
...
@@ -106,7 +106,7 @@
</view>
</view>
<view style="height: 6rem;"></view>
<activity-bar :user-type="userType" :reg-id="reg_id" :member-role="member_role" :is-end="is_end" />
<activity-bar :user-type="userType" :reg-id="reg_id" :member-role="member_role" :is-end="is_end"
:activity-status="activity_status"
/>
<!-- <van-action-sheet
:z-index="10"
...
...
@@ -462,6 +462,7 @@ import "./index.less";
import { activityInfoAPI } from '@/api/Host/index';
import { pageQuery } from '@/utils/tools.js'
import mixin from '@/utils/mixin';
import { getCurrentPageParam } from "@/utils/weapp";
require('@tarojs/taro/html.css')
export default {
...
...
@@ -478,6 +479,8 @@ export default {
this.member_role = data.member_role;
this.reg_id = data.reg_id;
}
// 活动状态判断显示
this.activity_status = getCurrentPageParam().status;
},
mounted() {
},
...
...
@@ -488,6 +491,7 @@ export default {
member_role: '',
reg_id: '',
is_end: '',
activity_status: '',
}
},
computed: {
...
...
src/pages/my/index.vue
View file @
9e77905
<!--
* @Date: 2022-09-21 14:51:44
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-10-25 1
5:12:40
* @LastEditTime: 2022-10-25 1
8:29:15
* @FilePath: /swx/src/pages/my/index.vue
* @Description: 我的页面
-->
...
...
@@ -64,10 +64,12 @@
</view>
<view style="height: 6rem;"></view>
<navbar activated="my" />
<van-toast id="van-toast" />
</template>
<script setup>
import { ref } from "vue";
import { ref
, onMounted
} from "vue";
// import icon_vip from '@/images/icon/vip@2x.png'
import Taro from '@tarojs/taro'
// import { AtAvatar } from 'taro-ui-vue3'
...
...
@@ -78,7 +80,19 @@ import icon_user from '@/images/icon/peiban@2x.png'
import icon_company from '@/images/icon/zhubanfang@2x.png'
import navbar from '@/components/navbar.vue'
import activityCard from '@/components/activity-card.vue'
import { text } from "stream/consumers";
import { hostListAPI } from '@/api/Host/index'
import Toast from '@/components/vant-weapp/toast/toast';
const host_id = ref('');
onMounted(async () => {
// 获取主办方列表信息
const { code, data } = await hostListAPI();
if (code) {
if (data.my_hosts.length) {
host_id.value = data.my_hosts[0]?.id
}
}
})
// 参加的活动
const joinActivity = () => {
...
...
@@ -88,8 +102,12 @@ const joinActivity = () => {
}
// 创建的活动
const createActivity = () => {
if (!host_id.value) {
Toast('您还未创建过主办方');
return false;
}
Taro.navigateTo({
url: '../myCreateActivity/index
'
url: '../myCreateActivity/index
?host_id=' + host_id.value
})
}
// 陪伴的用户
...
...
src/pages/myCreateActivity/index.vue
View file @
9e77905
This diff is collapsed. Click to expand it.
Please
register
or
login
to post a comment