|
@@ -59,16 +59,20 @@
|
|
|
</view>
|
|
|
|
|
|
<view class="mList">
|
|
|
- <view class="mItem" v-for="(item,index) in info.user_list" :key='index'>
|
|
|
+ <block v-for="(item, index) in info.user_list" :key="index">
|
|
|
+ <view class="mItem" v-if="index<=4">
|
|
|
|
|
|
- <image :src="item.avatar">
|
|
|
- </image>
|
|
|
- <view>{{item.username}}</view>
|
|
|
+ <image
|
|
|
+ :src="item.avatar||'http://cdn.shop.weivee.com/shop/20200408/6162b21922f336ae9b320bc06582ab7f.png'">
|
|
|
+ </image>
|
|
|
+ <view>{{item.username}}</view>
|
|
|
|
|
|
- </view>
|
|
|
+ </view>
|
|
|
+ </block>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view v-if="!info.user_list.length" style='color:#999;text-align:center;margin:50rpx 0;font-size:30rpx'>暂无数据
|
|
|
</view>
|
|
|
-
|
|
|
- <view v-if="!info.user_list.length" style='color:#999;text-align:center;margin:50rpx 0;font-size:30rpx'>暂无数据</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
@@ -105,22 +109,38 @@
|
|
|
</button>
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
|
|
|
- <button class="btn2" @click="btnConfirm" v-if="info.activity.activity_status==1&&phone">
|
|
|
- 活动报名
|
|
|
- </button>
|
|
|
|
|
|
|
|
|
- <button class="btn2" v-if="info.activity.activity_status==1&&!phone" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">
|
|
|
- 活动报名
|
|
|
- </button>
|
|
|
+ <view class="btn3" v-if="info.join_status==1">
|
|
|
+ 已报名
|
|
|
+ </view>
|
|
|
+
|
|
|
+
|
|
|
+ <block v-if="info.join_status==0">
|
|
|
+
|
|
|
+ <button class="btn2" @click="btnConfirm" v-if="info.activity.activity_status==1&&phone">
|
|
|
+ 活动报名
|
|
|
+ </button>
|
|
|
+
|
|
|
+
|
|
|
+ <button class="btn2" v-if="info.activity.activity_status==1&&!phone" open-type="getPhoneNumber"
|
|
|
+ @getphonenumber="decryptPhoneNumber">
|
|
|
+ 活动报名
|
|
|
+ </button>
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
- <view class="btn3" v-if="info.activity.activity_status==0">
|
|
|
- 活动结束
|
|
|
- </view>
|
|
|
+
|
|
|
+
|
|
|
+ <view class="btn3" v-if="info.activity.activity_status==0">
|
|
|
+ 活动结束
|
|
|
+ </view>
|
|
|
+
|
|
|
+ </block>
|
|
|
+
|
|
|
+
|
|
|
|
|
|
</view>
|
|
|
|
|
@@ -162,7 +182,7 @@
|
|
|
return {
|
|
|
info: "",
|
|
|
id: "",
|
|
|
- phone:""
|
|
|
+ phone: ""
|
|
|
};
|
|
|
}
|
|
|
/**
|
|
@@ -172,7 +192,7 @@
|
|
|
onLoad: function(options) {
|
|
|
this.id = options.id || 4;
|
|
|
this.phone = uni.getStorageSync('userInfo').mobile || ''
|
|
|
-
|
|
|
+
|
|
|
this.getinfo();
|
|
|
},
|
|
|
/**
|
|
@@ -199,27 +219,27 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- async decryptPhoneNumber(e){
|
|
|
+ async decryptPhoneNumber(e) {
|
|
|
var that = this
|
|
|
console.log(e)
|
|
|
-
|
|
|
+
|
|
|
let res = await that.$api.request('/User/get_phone', 'GET', {
|
|
|
- access_token:uni.getStorageSync('access_token')||'',
|
|
|
+ access_token: uni.getStorageSync('access_token') || '',
|
|
|
code: e.detail.code
|
|
|
});
|
|
|
-
|
|
|
- if(res){
|
|
|
-
|
|
|
+
|
|
|
+ if (res) {
|
|
|
+
|
|
|
this.phone = res
|
|
|
-
|
|
|
+
|
|
|
var userInfo = uni.getStorageSync('userInfo');
|
|
|
-
|
|
|
- userInfo.mobile = phone;
|
|
|
-
|
|
|
- uni.setStorageSync('userInfo',userInfo)
|
|
|
+
|
|
|
+ userInfo.mobile = this.phone;
|
|
|
+
|
|
|
+ uni.setStorageSync('userInfo', userInfo)
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
btnConfirm() {
|
|
|
|
|
@@ -233,16 +253,14 @@
|
|
|
|
|
|
let res = await that.$api.request('/Activity/activity_join', 'GET', {
|
|
|
activity_id: that.id,
|
|
|
- phone:that.phone||''
|
|
|
+ phone: that.phone || ''
|
|
|
});
|
|
|
|
|
|
- if (res) {
|
|
|
-
|
|
|
- uni.showToast({
|
|
|
- title: '报名成功'
|
|
|
- })
|
|
|
+
|
|
|
+ setTimeout(function(){
|
|
|
+ that.getinfo()
|
|
|
+ },1000)
|
|
|
|
|
|
- }
|
|
|
} else if (res.cancel) {
|
|
|
console.log('用户点击取消');
|
|
|
}
|
|
@@ -255,7 +273,7 @@
|
|
|
},
|
|
|
goMore() {
|
|
|
uni.navigateTo({
|
|
|
- url: "/pages/activity/memberlist"
|
|
|
+ url: "/pages/activity/memberlist?activity_id="+this.id
|
|
|
})
|
|
|
},
|
|
|
callPhone() {
|