diff --git a/api/activity.js b/api/activity.js index ec02f2a..5c1b7f2 100644 --- a/api/activity.js +++ b/api/activity.js @@ -25,3 +25,16 @@ export function activityDetail(data) { data }); } + +/** + * 活动签到 + * @param {Object} data + */ +export function activitySign(data) { + + return request({ + url: `${host}/activity/sign-activity`, + method: "post", + data + }); +} diff --git a/pages/Activity/components/index.scss b/pages/Activity/components/index.scss index 9efa27b..8f540c2 100644 --- a/pages/Activity/components/index.scss +++ b/pages/Activity/components/index.scss @@ -150,6 +150,8 @@ background-color:#FF9545; } &.gray{ + width:500rpx; + text-align: center; background-color:#f1f1f1; } } diff --git a/pages/Activity/index.vue b/pages/Activity/index.vue index e0ff22c..8bbccc6 100644 --- a/pages/Activity/index.vue +++ b/pages/Activity/index.vue @@ -35,7 +35,7 @@ + + + + + + @@ -251,8 +258,11 @@ :text="getButton()" @click="((detail.status === 0 || detail.status === 1)&&detail.is_regist !==1) ? api.navTo('/pages/Join/index?user_type=2&relevancy_type=2&id='+id,true):openNoticePop()"> - + - + 社区顾问 diff --git a/pages/Project/index.vue b/pages/Project/index.vue index 5cf2e77..9d86c7b 100644 --- a/pages/Project/index.vue +++ b/pages/Project/index.vue @@ -46,6 +46,13 @@ + + + + + + diff --git a/pages/ScanCode/index.vue b/pages/ScanCode/index.vue index 42d9e5b..19c274c 100644 --- a/pages/ScanCode/index.vue +++ b/pages/ScanCode/index.vue @@ -15,6 +15,7 @@ import {imghost} from "@/config/host"; import api from "@/utils/functions"; +import {activitySign} from "../../api/activity"; export default { computed: {}, @@ -22,7 +23,7 @@ export default { }, onLoad(option) { - this.activityId = ''; + this.activityId = option.id; this.signIn(); }, data() { @@ -38,9 +39,16 @@ export default { methods: { signIn(){ uni.showLoading({title:'签到中'}); - uni.$u.sleep(2000).then(() => { + activitySign({activity_id:this.activityId}).then(res => { + uni.hideLoading(); + if(res.code === 200){ + api.navTo('/pages/ScanCode/done') + }else{ + api.error(res.msg) + } + + }).catch(err => { uni.hideLoading(); - api.navTo('/pages/ScanCode/done') }) }, }, diff --git a/utils/functions.js b/utils/functions.js index 873c31c..78ad54a 100644 --- a/utils/functions.js +++ b/utils/functions.js @@ -76,7 +76,7 @@ const api = { address: details.activedeta.city+details.activedeta.address, //地址参数,例:固定地址,address: '北京市海淀区彩和坊路海淀西大街74号' success: function(res) {//成功后的回调 console.log(res); - relove(res.result.location) + relove(res.result) }, fail: function(error) { console.error(error);