@@ -1,6 +1,6 @@ | |||
const __request_base_url__ = { | |||
develop: "http://192.168.11.11:9061/api", | |||
// develop: "https://qmhh.t-aaron.com/api", | |||
// develop: "http://192.168.11.11:9061/api", | |||
develop: "https://qmhhapi-test.t-aaron.com/api", | |||
trial: "https://qmhhapi-test.t-aaron.com/api", | |||
release: "https://qmhh.t-aaron.com/api" | |||
} |
@@ -37,7 +37,7 @@ Page({ | |||
handleSubmit(){ | |||
if(this.data.userInfo.applyName=='' || this.data.userInfo.applyPhone==''){ | |||
wx.showToast({ | |||
title: '请填写完整', | |||
title: '请输入姓名/电话', | |||
icon:'none' | |||
}) | |||
return |
@@ -6,6 +6,7 @@ Page({ | |||
* 页面的初始数据 | |||
*/ | |||
data: { | |||
activityId: null, | |||
list:[], | |||
nickname:'', | |||
activityTitle:'', |
@@ -19,12 +19,18 @@ | |||
.activity{ | |||
display: flex; | |||
flex-wrap: wrap; | |||
justify-content: space-between; | |||
text-align: center; | |||
} | |||
.activity_name{ | |||
width: 300rpx; | |||
font-size: 34rpx; | |||
font-family: Source Han Sans CN; | |||
font-weight: 400; | |||
color: #000000; | |||
overflow: hidden; | |||
white-space: nowrap; | |||
text-overflow: ellipsis; | |||
} | |||
.part_middle{ | |||
margin: 31rpx 31rpx 22rpx 27rpx; | |||
@@ -42,6 +48,7 @@ | |||
line-height: 36rpx; | |||
text-align: center; | |||
margin-left: 39rpx; | |||
align-items: center; | |||
} | |||
.is_apply{ | |||
background: #006DF7; |
@@ -9,6 +9,7 @@ Page({ | |||
data: { | |||
status:false, | |||
activityInfo:{}, | |||
dataSource: {}, | |||
list:[], | |||
userPage:{ | |||
page:1, | |||
@@ -27,7 +28,23 @@ Page({ | |||
this.setData({ | |||
activityInfo:data | |||
}) | |||
this.getApply() | |||
let imgs=data.intro.match(/<img.*?src="(.*)".*?\/>/g); | |||
if(!imgs){ | |||
this.setData({'dataSource.content': data.intro}) | |||
} else { | |||
for(let img of imgs){ | |||
let temp | |||
temp=img.replace(/(width=".*?"|height=".*?")/g,""); | |||
if(/style="(.*?)"/.test(temp)){ | |||
temp=temp.replace(RegExp.$1,RegExp.$1+"width:100% !important;height:auto;display:block") | |||
}else{ | |||
temp=temp.replace(/<img/,"<img style='width:100% !important;height:auto;display:block'") | |||
} | |||
data.intro=data.intro.replace(img,temp) | |||
} | |||
this.setData({'dataSource.content': data.intro}) | |||
} | |||
this.getApplyStatus() | |||
}, | |||
/** | |||
@@ -41,7 +58,7 @@ Page({ | |||
* 生命周期函数--监听页面显示 | |||
*/ | |||
onShow() { | |||
this.activitySubmit() | |||
// this.activitySubmit() | |||
}, | |||
/** | |||
@@ -71,7 +88,7 @@ Page({ | |||
onReachBottom() { | |||
}, | |||
getApply(){ | |||
getApplyStatus(){ | |||
const openid = wx.getStorageSync('openid') | |||
const params = { | |||
openid, | |||
@@ -79,7 +96,7 @@ Page({ | |||
} | |||
api_getApply(params).then(res=>{ | |||
if(res.code==0){ | |||
let status = res.data==null?true:res.data.status==3?true:false | |||
let status = res.data?.status || 3 | |||
this.setData({ | |||
status | |||
}) | |||
@@ -114,16 +131,19 @@ Page({ | |||
return `${year}年${month}月${day}日`; | |||
}, | |||
goApply(e){ | |||
if(this.data.status){ | |||
if(this.data.status === 1){ | |||
wx.showToast({ | |||
title: '您已报名', | |||
title: '您已参加该活动', | |||
icon:"none" | |||
}) | |||
return | |||
} | |||
if(this.data.status === 3){ | |||
wx.navigateTo({ | |||
url:"/package_first/pages/ActivityApply/index?id=" + this.data.activityInfo.id | |||
}) | |||
url:"/package_first/pages/ActivityApply/index?id=" + this.data.activityInfo.id | |||
}) | |||
} | |||
}, | |||
/** | |||
* 用户点击右上角分享 |
@@ -1,9 +1,7 @@ | |||
<!--package_first/pages/VolunteerDetail/index.wxml--> | |||
<view class="VolunteerDetail_container"> | |||
<view class="main"> | |||
<view class="content"> | |||
{{activityInfo.intro}} | |||
</view> | |||
<rich-text class="content" type="node" style="width:100%; white-space: pre-wrap;word-break: break-all;" nodes="{{dataSource.content}}"></rich-text> | |||
<view > | |||
<image class="Volunteer_image" src="{{activityInfo.imageUrl}}" mode=""/> | |||
</view> | |||
@@ -17,6 +15,6 @@ | |||
</view> | |||
</view> | |||
<view wx:if="{{activityInfo.status==2}}" class="button" bindtap="goApply"> | |||
{{status?'已报名':'立即报名'}} | |||
{{status === 2 ?'已报名':'立即报名'}} | |||
</view> | |||
</view> |
@@ -7,6 +7,9 @@ | |||
} | |||
.main{ | |||
width: 100%; | |||
height: calc(100vh - 170rpx); | |||
overflow: hidden; | |||
overflow-y: scroll; | |||
background: #FFFFFF; | |||
box-shadow: 0rpx 0rpx 14rpx 2rpx rgba(43,93,184,0.09); | |||
border-radius: 20rpx; |
@@ -6,25 +6,29 @@ Page({ | |||
videoProgress: 0, | |||
openid: null, | |||
initialTime: 0, | |||
control:false, | |||
statusList:{ | |||
0: '待学习', | |||
1: '学习中', | |||
2: '已学习', | |||
}, | |||
classList:{ | |||
0: 'no--sutdy', | |||
1: 'is--sutdy', | |||
0: 'no--study', | |||
1: 'is--study', | |||
2: 'is--finish', | |||
}, | |||
detail: {} | |||
}, | |||
onLoad(options){ | |||
let data = JSON.parse(decodeURIComponent(options.data)) | |||
data.status = data.status === 0 ? 1 : data.status | |||
const openid = wx.getStorageSync('openid') | |||
this.setData({ | |||
detail:data, | |||
openid | |||
openid, | |||
control : data.status === 2 ? true : false, | |||
}) | |||
console.log(this.data.detail) | |||
this.getProgress() | |||
}, | |||
onHide(){ | |||
@@ -46,17 +50,18 @@ Page({ | |||
} | |||
getVideoProgress(data).then(res=>{ | |||
this.setData({ | |||
initialTime:res.data.videoProgress | |||
initialTime:res.data.videoProgress, | |||
}) | |||
}) | |||
}, | |||
handleEnded(status){ | |||
const isNumber = typeof(status) === 'number' | |||
const params = { | |||
status: status === 1 ? 1 : 2, | |||
status: status === 2 ? 2 : 1, | |||
videoId: this.data.detail.id, | |||
openid: this.data.openid, | |||
videoProgress: typeof(status) === 'number' ? this.data.videoProgress : 0 | |||
videoProgress: isNumber ? this.data.videoProgress : 0 | |||
} | |||
updateProgress(params) | |||
.then(res=>{ | |||
@@ -65,7 +70,7 @@ Page({ | |||
initialTime = res.data==null?0:res.data | |||
} | |||
this.setData({ | |||
'detail.status': status === 1 ? 1 : 2, | |||
'detail.status': params.status, | |||
}) | |||
}) | |||
} |
@@ -6,7 +6,7 @@ | |||
autoplay="{{false}}" | |||
muted="{{true}}" | |||
initial-time="{{ initialTime }}" | |||
show-progress="{{false}}" | |||
show-progress="{{ control }}" | |||
show-mute-btn="{{true}}" | |||
enable-progress-gesture="{{false}}" | |||
bindtimeupdate="saveTime" |
@@ -26,7 +26,7 @@ | |||
border-radius: 4rpx; | |||
} | |||
.no--sutdy{ | |||
.no--study{ | |||
background: #EBAC14; | |||
} | |||