Browse Source

Merge branch 'master' of https://git.intelgice.com/xiezhongxing/qd_81fang.git

xiezongxing 2 years ago
parent
commit
5a9391fb2e
5 changed files with 87 additions and 63 deletions
  1. 2 2
      main.js
  2. 59 41
      pages/activity/detail.vue
  3. 1 1
      pages/activity/locList.vue
  4. 24 18
      pages/activity/memberlist.vue
  5. 1 1
      pages/user/user.vue

+ 2 - 2
main.js

@@ -3,8 +3,8 @@ import store from './store'
 import App from './App'
 
 // 后端api地址
-// Vue.prototype.$unishow = "https://81f.dev.ytxxjs.cn/addons/unishop";
-Vue.prototype.$unishow = "https://81fdev.dev.ytxxjs.cn/addons/unishop";
+Vue.prototype.$unishow = "https://81f.dev.ytxxjs.cn/addons/unishop";
+// Vue.prototype.$unishow = "https://81fdev.dev.ytxxjs.cn/addons/unishop";
 
 // 为了方便每次上传的时候忘记修改上面的参数
 uni.getSystemInfo({

+ 59 - 41
pages/activity/detail.vue

@@ -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() {

+ 1 - 1
pages/activity/locList.vue

@@ -32,7 +32,7 @@
 					</view>
 
 					<view class="addressRight">
-						100m
+						{{item.distance||0}}m
 					</view>
 
 				</view>

+ 24 - 18
pages/activity/memberlist.vue

@@ -1,19 +1,24 @@
 <template>
     <view class="content">
         <view class="box">
-            <view class="orderItem" v-for="(item, index) in list" :key="index">
-				<image class="goodImg" src="https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTLuLiaFYKXBMuc4a35Yv0f2dAlClwv2rqeZSOibsp7MQMoB47VV24FdrQaLhrmjYESqn08PKlic43x7A/132" ></image>
-                <view class="orderInfo">
-                    <view class="info1">
-                        <view>{{ item.pname||'张三' }}</view>
-                    </view>
-                    <view class="info2">
-                        <view>{{ parse.filterTime(item.createtime) }}</view>
-                    </view>
-					
-		
-                </view>
-            </view>
+			
+			<block v-for="(item, index) in list" :key="index">
+				<view class="orderItem" >
+					<image class="goodImg" :src="item.avatar||'http://cdn.shop.weivee.com/shop/20200408/6162b21922f336ae9b320bc06582ab7f.png'" ></image>
+				    <view class="orderInfo">
+				        <view class="info1">
+				            <view>{{item.username}}</view>
+				        </view>
+				        <view class="info2">
+				            <view>{{ parse.filterTime(item.createtime) }}</view>
+				        </view>
+						
+						
+				    </view>
+				</view>
+				
+			</block>
+     
 			
 			
 			
@@ -58,14 +63,14 @@ export default {
             list: [				
 			],
             loaded: false,
-
+activity_id:""
         };
     }
     /**
      * 生命周期函数--监听页面加载
      */,
     onLoad: function (options) {
- 
+		this.activity_id = options.activity_id||''
         this.getlist();
     },
     /**
@@ -105,15 +110,16 @@ export default {
     methods: {
         async getlist() {
             var that = this;
-			         let res = await this.$api.request('/Activity/index', 'GET', {
+			         let res = await this.$api.request('/Activity/user_list', 'GET', {
 			         	page: this.page,
+						activity_id:this.activity_id
 			         });
 					 
 					 console.log(res)
 			         if (res) {
-			         	if (res.list.length > 0) {
+			         	if (res.user_list.length > 0) {
 			         
-			         		this.list = this.list.concat(res.list);
+			         		this.list = this.list.concat(res.user_list);
 			         
 			         		this.page++; 
 			         		

+ 1 - 1
pages/user/user.vue

@@ -22,7 +22,7 @@
 					{{userInfo.group.name}}
 				</view>
 				<view v-else>
-					<button class="get-user-info" @click="getUserInfo">提供资料成会员</button>
+					<button class="get-user-info" @click="getUserInfo">提供资料成会员</button>
 				</view>
 			</view>
 		</view>