Commit 181aea40 authored by 罗林杰's avatar 罗林杰

修改查询是否停用

parent 92a318e3
...@@ -38,3 +38,10 @@ export function pay(data) { ...@@ -38,3 +38,10 @@ export function pay(data) {
} }
}) })
} }
export function isApplication(data) {
return request({
url:'/app/cmsActivity/getActivityIsApplication',
method: 'GET',
data
})
}
\ No newline at end of file
...@@ -176,7 +176,7 @@ ...@@ -176,7 +176,7 @@
//已登录 //已登录
isStopAccount().then(res => { isStopAccount().then(res => {
//如果flag=0 被禁用了 踢出该用户 //如果flag=0 被禁用了 踢出该用户
if (res.data == '0') { if (res.data.data == '0') {
uni.removeStorageSync('userInfo') uni.removeStorageSync('userInfo')
uni.removeStorageSync('token') uni.removeStorageSync('token')
uni.navigateTo({ uni.navigateTo({
......
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
if (token != '') { if (token != '') {
isStopAccount().then(res => { isStopAccount().then(res => {
//如果flag=0 被禁用了 踢出该用户 //如果flag=0 被禁用了 踢出该用户
if (res.data == '0') { if (res.data.data == '0') {
uni.removeStorageSync('userInfo') uni.removeStorageSync('userInfo')
uni.removeStorageSync('token') uni.removeStorageSync('token')
this.isLoginPop = true this.isLoginPop = true
......
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
if (token != '') { if (token != '') {
isStopAccount().then(res => { isStopAccount().then(res => {
//如果flag=0 被禁用了 踢出该用户 //如果flag=0 被禁用了 踢出该用户
if (res.data == '0') { if (res.data.data == '0') {
uni.removeStorageSync('userInfo') uni.removeStorageSync('userInfo')
uni.removeStorageSync('token') uni.removeStorageSync('token')
uni.navigateTo({ uni.navigateTo({
......
...@@ -200,7 +200,7 @@ ...@@ -200,7 +200,7 @@
} else { } else {
isStopAccount().then(res => { isStopAccount().then(res => {
//如果flag=0 被禁用了 踢出该用户 //如果flag=0 被禁用了 踢出该用户
if (res.data == '0') { if (res.data.data == '0') {
uni.removeStorageSync('userInfo') uni.removeStorageSync('userInfo')
uni.removeStorageSync('token') uni.removeStorageSync('token')
uni.navigateTo({ uni.navigateTo({
......
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
</view> </view>
</view> </view>
<view class="act-bottom"> <view class="act-bottom">
<view class="act-button" @click="open">报名</view> <view v-if="activityDetail.isApplication == '1' && isApplication == false" class="act-button" @click="open">报名</view>
<view v-else-if="activityDetail.isApplication == '1' && isApplication == true" class="act-button" style="background: #999999;">已报名</view>
</view> </view>
</view> </view>
<!-- 报名弹窗 --> <!-- 报名弹窗 -->
...@@ -35,14 +36,17 @@ ...@@ -35,14 +36,17 @@
</view> </view>
</view> </view>
<view class="buy-num"> <view class="buy-num">
<view class="buynum-title">购买数量</view> <!-- <view class="buynum-title">购买数量</view>-->
<view class="buynum-math"> <!-- <view class="buynum-math">-->
<view class="num">{{buynum}}</view> <!-- <view class="num">{{buynum}}</view>-->
</view> <!-- </view>-->
<view class="buy-num-math">
<view>已报名人数:{{activityDetail.applicationCount}}/{{activityDetail.maxApplicationCount}}</view>
</view>
</view> </view>
<view class="all-price"> <view class="all-price">
<view class="all-money">共计:<text>{{totalprice}}</text></view> <view class="all-money">共计:<text>{{totalprice}}</text></view>
<view class="all-button" @click="submitorder">确认支付</view> <view class="all-button" @click="submitorder">确认报名</view>
</view> </view>
</view> </view>
</u-popup> </u-popup>
...@@ -50,7 +54,7 @@ ...@@ -50,7 +54,7 @@
</template> </template>
<script> <script>
import {activityDetail, addApplication, pay} from "../api/activity/index.js" import {activityDetail, addApplication, isApplication, pay} from "../api/activity/index.js"
export default { export default {
data() { data() {
return { return {
...@@ -61,12 +65,16 @@ import {activityDetail, addApplication, pay} from "../api/activity/index.js" ...@@ -61,12 +65,16 @@ import {activityDetail, addApplication, pay} from "../api/activity/index.js"
activityId: '', // 活动id activityId: '', // 活动id
buynum: 1, // 购买数量 buynum: 1, // 购买数量
totalprice: 0, //总价 totalprice: 0, //总价
isApplication: false,
} }
}, },
onLoad(options) { onLoad(options) {
this.activityId = JSON.parse(options.id) this.activityId = JSON.parse(options.id)
this.getActivityDetail()
}, },
onShow() {
this.getActivityDetail()
this.getUserInfo()
},
methods: { methods: {
// 获取活动详情 // 获取活动详情
getActivityDetail(){ getActivityDetail(){
...@@ -78,6 +86,19 @@ import {activityDetail, addApplication, pay} from "../api/activity/index.js" ...@@ -78,6 +86,19 @@ import {activityDetail, addApplication, pay} from "../api/activity/index.js"
'<img style="max-width:100%;height:auto;border-radius: 12px 12px 12px 12px;" ') '<img style="max-width:100%;height:auto;border-radius: 12px 12px 12px 12px;" ')
}) })
}, },
//查询当前用户是否已经报名
getUserInfo(){
const form = {
activityId: this.activityId
}
isApplication(form).then(res => {
if (res.data.code === 200){
if (res.data.data =='1'){
this.isApplication = true
}
}
})
},
// 打开报名弹窗 // 打开报名弹窗
open() { open() {
const token = uni.getStorageSync('token') const token = uni.getStorageSync('token')
...@@ -172,6 +193,7 @@ import {activityDetail, addApplication, pay} from "../api/activity/index.js" ...@@ -172,6 +193,7 @@ import {activityDetail, addApplication, pay} from "../api/activity/index.js"
title: '报名成功!', title: '报名成功!',
icon: 'none' icon: 'none'
}) })
this.getUserInfo()
} }
} else if(res.data.code !== 200){ } else if(res.data.code !== 200){
uni.showToast({ uni.showToast({
......
...@@ -168,7 +168,7 @@ export default{ ...@@ -168,7 +168,7 @@ export default{
//已登录 //已登录
isStopAccount().then(res => { isStopAccount().then(res => {
//如果flag=0 被禁用了 踢出该用户 //如果flag=0 被禁用了 踢出该用户
if (res.data == '0') { if (res.data.data == '0') {
uni.removeStorageSync('userInfo') uni.removeStorageSync('userInfo')
uni.removeStorageSync('token') uni.removeStorageSync('token')
uni.navigateTo({ uni.navigateTo({
...@@ -218,7 +218,7 @@ export default{ ...@@ -218,7 +218,7 @@ export default{
//已登录 //已登录
isStopAccount().then(res => { isStopAccount().then(res => {
//如果flag=0 被禁用了 踢出该用户 //如果flag=0 被禁用了 踢出该用户
if (res.data == '0') { if (res.data.data == '0') {
uni.removeStorageSync('userInfo') uni.removeStorageSync('userInfo')
uni.removeStorageSync('token') uni.removeStorageSync('token')
uni.navigateTo({ uni.navigateTo({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment