Blame view

lvdao-miniapp/pages/activityDetail/activityDetail.vue 4.98 KB
e5b57447   杨鑫   '分包问卷'
1
2
3
4
5
6
7
  <template>
    <view class="page">
  	<view class="page-info">
  	  	<view class="banner">
  	  		<view class="title">{{tableData.activityName}}</view>
  			<view class="banner-info-top">
  				<view>{{tableData.startTime}}</view>
844aa73a   杨鑫   '最新'
8
  				<view><u-icon name="eye"></u-icon>{{tableData.viewsNumber}}人</view>
e5b57447   杨鑫   '分包问卷'
9
10
11
12
13
  			</view>
  	  		<view class="banner-info-item">
  	  			<text>
  					{{tableData.content}}
  				</text>
b1fef010   杨鑫   '最新代码'
14
  				<!-- <image :src="tableData.coverImage" style="width: 100%; height: 100vw; border-radius: 10rpx; margin-top: 30rpx;"></image> -->
f692f3a5   wesley88   1
15
  				<u-image  width="100%" :src="imgurl+tableData.coverImage" border-radius="10" mode="widthFix" style="margin-top:8px;margin-right:8px;" ></u-image>
e5b57447   杨鑫   '分包问卷'
16
17
18
19
20
21
22
23
24
  	  		</view>
  	  	</view>
  		<view class="info-box">
  			<view class="title">活动信息</view>
  			<view class="info-item">举办区域:{{tableData.region}}</view>
  			<view class="info-item">起止时间:{{tableData.startTime}} 至 {{tableData.endTime}}</view>
  			<view class="info-item">活动类型:{{tableData.activityType}}</view>
  		</view>
  	</view>
3a1f257b   杨鑫   最新
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
  	<!-- 底部 -->
  	<!-- <view style="height: 125rpx;"></view> -->
  	<view class="page-footer" v-if="tableData.auditStatus == 3">
  		<view class="footer-btn">
  			<u-button type="success" @click="baoShow">报名参加</u-button>
  		</view>
  	</view>
  	<u-popup class="userForm" v-model="joinShow" mode="center" border-radius="20" :closeable="true" width="90%" >
  		<view style="padding: 30rpx;">
  			<u-form class="form-box" :model="form" ref="uForm" :label-width="120" >
  				<view style="padding: 10rpx;">
  					<view class="title">请填写您的报名信息</view>
  					<u-form-item label="*姓名"><u-input v-model="form.signUpName" /></u-form-item>
  					<u-form-item label="*电话"><u-input v-model="form.signUpPhone" /></u-form-item>
  					<u-button type="success" @click="submit">提交</u-button>
  				</view>
  			</u-form>
  		</view>
  	</u-popup>
e5b57447   杨鑫   '分包问卷'
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
    </view>
  </template>
  
  <script>
  
  export default {
    data() {
      return {
  		tableData:{},
  		swiperList: [
  			{
  				id: 0,
  				type: 'image',
  				url: this.$imgUrl('/img/1.jpg')
  			}
  		],
  		joinShow: false,
  		form: {
3a1f257b   杨鑫   最新
62
63
  			signUpName: '',
  			signUpPhone: '',
580aa78b   杨鑫   我的
64
  			activityApplicationId:'',
e5b57447   杨鑫   '分包问卷'
65
66
  		},
  		pagesize: {
e5b57447   杨鑫   '分包问卷'
67
  			id:'',
f692f3a5   wesley88   1
68
69
  		},
  		imgurl:''
e5b57447   杨鑫   '分包问卷'
70
71
72
      };
    },
    onLoad(option){
f692f3a5   wesley88   1
73
  	    this.imgurl = this.$img
e5b57447   杨鑫   '分包问卷'
74
75
76
77
78
79
80
81
82
83
  	  		let str = unescape(option.scene);
  	  
  	  if(option.scene){
  	  		let str = unescape(option.scene)
  	  		// 使用 split() 方法按等号分割字符串,并获取第二个元素(索引为1),即带单引号的值
  	  		let valueWithQuotes = str.split('=')[1];
  	  		
  	  		// 使用 slice() 或 substring() 去除两端的单引号
  	  		let value = valueWithQuotes.slice(1, -1); 
  	  		this.pagesize.id = value
a18f16a9   杨鑫   提交1
84
  	  	  
e5b57447   杨鑫   '分包问卷'
85
86
87
88
  	  }else{
  	  	this.pagesize.id = option.item
  	  	
  	  }
844aa73a   杨鑫   '最新'
89
  	  
f1b706dd   杨鑫   '最新'
90
91
92
93
94
95
96
97
98
99
100
101
102
  	  this.$http.sendRequest('/cereActivityApplication/queryById', 'POST',this.pagesize,1).then(res => {
  	  	this.tableData = res.data.data
  		if(!option.flow){
  				   	let obj ={
  				   		id:option.item,
  				   		viewsNumber:Number(this.tableData.viewsNumber)+1
  				   	}
  				   	this.$http.sendRequest('/cereActivityApplication/edit', 'POST',obj,1).then(res => {})
  		}
  		 	})
  			
  
  	
e5b57447   杨鑫   '分包问卷'
103
  	  
e5b57447   杨鑫   '分包问卷'
104
105
106
107
108
109
110
  	
  	  
    },
    mounted() {
        
    },
    methods: {
3a1f257b   杨鑫   最新
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
  	  baoShow(){
  	  		  this.joinShow = true
  	  		  this.form.signUpName = ''
  	  		  this.form.signUpPhone = ''
  	  },
  	  submit() {
  	  	if (!this.form.signUpName) {
  	  		uni.showToast({
  	  			icon: 'none',
  	  			title: '请输入姓名'
  	  		});
  	  		return
  	  	}
  	  	
  	  	
  	  	if (!this.form.signUpPhone) {
  	  		uni.showToast({
  	  			icon: 'none',
  	  			title: '请输入联系电话'
  	  		});
  	  		return 
  	  	}
bbf88c5c   杨鑫   活动
133
134
  		// const dateString = this.getCurrentDateTime()
  		// 	this.form.signUpTime = new Date(dateString)
580aa78b   杨鑫   我的
135
  		this.form.activityApplicationId = this.tableData.id
3a1f257b   杨鑫   最新
136
  	  	this.form.signUpTime = this.getCurrentDateTime()
bbf88c5c   杨鑫   活动
137
  	  	this.$http.sendRequest('/cereActivityApplicationSignUp/insert', 'POST',this.form,1).then(res => {
a18f16a9   杨鑫   提交1
138
  			
3a1f257b   杨鑫   最新
139
  			if(res.data.code == '200'){
a18f16a9   杨鑫   提交1
140
141
142
143
144
  		uni.showToast({
  			icon: 'none',
  			title: '报名成功'
  		})
  		
3a1f257b   杨鑫   最新
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
  			}
  	  		// uni.showToast({
  	  		// 	title: res.data.data,
  	  		// 	duration: 2000,
  	  			
  	  		// })
  	  		// this.$refs.uToast.show({
  	  		// 					title: res.data.data,
  	  		// 					url: '/pages/home/home'
  	  		// 				})
  	  	     // uni.switchTab({
  	  	     // 	url: '/pages/home/home'
  	  	     // })
  	  	})
  	  	this.joinShow = false
a18f16a9   杨鑫   提交1
160
161
  	  	this.form.signUpName = ''
  	  	this.form.signUpPhone = ''
3a1f257b   杨鑫   最新
162
163
164
165
  	  	
  	  
  	  },
  
e5b57447   杨鑫   '分包问卷'
166
167
168
169
170
  		leaseAdd(){
  			uni.navigateTo({
  				url: '/pages/leaseAdd/leaseAdd'
  			})
  		},
3a1f257b   杨鑫   最新
171
172
173
174
175
176
177
178
179
180
181
  		getCurrentDateTime() {
  		  const now = new Date();
  		  const year = now.getFullYear();
  		  const month = String(now.getMonth() + 1).padStart(2, '0'); // 月份是从0开始的,所以需要+1
  		  const day = String(now.getDate()).padStart(2, '0');
  		  const hours = String(now.getHours()).padStart(2, '0');
  		  const minutes = String(now.getMinutes()).padStart(2, '0');
  		  const seconds = String(now.getSeconds()).padStart(2, '0');
  		
  		  return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
  		},
bbf88c5c   杨鑫   活动
182
  		
e5b57447   杨鑫   '分包问卷'
183
184
185
186
187
188
189
    }
  };
  </script>
  
  <style scoped lang="scss">
  @import 'activityDetail.scss';
  </style>