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-20 22:02:02 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f618c248f034877f2270d389427cc7110d48548a
f618c248
1 parent
baf57cc5
✨ feat: 联调取消活动API
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
13 deletions
src/api/Reg/index.js
src/pages/joinActivity/index.vue
src/pages/joinInfo/index.vue
src/api/Reg/index.js
View file @
f618c24
/*
* @Date: 2022-10-20 13:15:00
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-10-20
13:38:30
* @LastEditTime: 2022-10-20
21:42:18
* @FilePath: /swx/src/api/Reg/index.js
* @Description: 报名信息
*/
...
...
@@ -11,6 +11,7 @@ const Api = {
MY_INFO
:
'/srv/?a=reg_my_info'
,
REG_ADD
:
'/srv/?a=reg_add'
,
REG_EDIT
:
'/srv/?a=reg_edit'
,
REG_CANCEL
:
'/srv/?a=reg_cancel'
,
}
/**
...
...
@@ -30,3 +31,9 @@ export const addRegAPI = (params) => fn(fetch.post(Api.REG_ADD, params));
* @returns
*/
export
const
editRegAPI
=
(
params
)
=>
fn
(
fetch
.
post
(
Api
.
REG_EDIT
,
params
));
/**
* @description: 取消活动报名
* @returns
*/
export
const
cancelRegAPI
=
(
params
)
=>
fn
(
fetch
.
post
(
Api
.
REG_CANCEL
,
params
));
...
...
src/pages/joinActivity/index.vue
View file @
f618c24
<!--
* @Date: 2022-09-27 17:13:05
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-10-20
18:40:43
* @LastEditTime: 2022-10-20
21:56:24
* @FilePath: /swx/src/pages/joinActivity/index.vue
* @Description: 活动报名
-->
...
...
@@ -213,15 +213,20 @@ const onSubmit = async (val) => {
params.i = getCurrentPageParam().reg_id;
const { code } = await editRegAPI(params);
if (code) {
Taro.redirectTo({
url: '../joinSuccess/index'
})
Taro.showToast({
title: '修改成功',
icon: 'success',
duration: 3000,
success: function () {
Taro.navigateBack()
}
});
}
} else {
const { code } = await addRegAPI(params);
if (code) {
Taro.redirectTo({
url: '../joinSuccess/index
'
url: '../joinSuccess/index
?id=' + getCurrentPageParam().id
})
}
}
...
...
src/pages/joinInfo/index.vue
View file @
f618c24
<!--
* @Date: 2022-09-27 17:13:05
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-10-20
18:50:36
* @LastEditTime: 2022-10-20
21:43:14
* @FilePath: /swx/src/pages/joinInfo/index.vue
* @Description: 活动报名
-->
...
...
@@ -54,21 +54,39 @@
<view @tap="editJoin" class="button">确认修改报名</view>
</view>
</view>
<van-dialog id="van-dialog" />
</template>
<script setup>
import { ref, onMounted } from "vue";
import "taro-ui-vue3/dist/style/components/input.scss";
import Taro from '@tarojs/taro'
import { myInfoAPI } from '@/api/Reg/index';
import { myInfoAPI
, cancelRegAPI
} from '@/api/Reg/index';
import { getCurrentPageParam } from "@/utils/weapp";
import Dialog from '@/components/vant-weapp/dialog/dialog';
const cancelJoin = (val) => {
Taro.showToast({
title: '取消成功',
icon: 'success',
duration: 2000
});
Dialog.confirm({
title: '标题',
message: '弹窗内容',
confirmButtonColor: '#199a74'
})
.then(async () => {
// on confirm
const { code, data } = await cancelRegAPI({ i: getCurrentPageParam().reg_id });
if (code) {
Taro.showToast({
title: '取消成功',
icon: 'success',
duration: 2000
});
Taro.navigateBack()
}
})
.catch(() => {
// on cancel
});
}
const editJoin = (val) => {
...
...
Please
register
or
login
to post a comment