#32 zhangtao

Merged
gitadmin merged 2 commits from zhangtao into develop 1 year ago
  1. +7
    -0
      api/volunteer.js
  2. +33
    -5
      package_first/pages/ActivityApply/index.js
  3. +80
    -56
      package_first/pages/AddPicture/index.js
  4. +16
    -2
      package_first/pages/AddPicture/index.wxml
  5. +76
    -2
      package_first/pages/AddPicture/index.wxss
  6. +27
    -3
      package_first/pages/AttentionMethod/index.js
  7. +4
    -2
      package_first/pages/AttentionMethod/index.wxss
  8. +23
    -7
      package_first/pages/LearningVideo/index.js
  9. +3
    -3
      package_first/pages/LearningVideo/index.wxml
  10. +4
    -1
      package_first/pages/LearningVideo/index.wxss
  11. +15
    -4
      package_first/pages/ProtectionActivity/index.js
  12. +17
    -7
      package_first/pages/ProtectionSuggestion/index.js
  13. +1
    -1
      package_first/pages/ProtectionSuggestion/index.wxml
  14. +21
    -18
      package_first/pages/VolunteerActivity/index.js
  15. +2
    -4
      package_first/pages/VolunteerActivity/index.wxml
  16. +21
    -10
      package_first/pages/VolunteerActivity/index.wxss
  17. +47
    -18
      package_first/pages/VolunteerDetail/index.js
  18. +4
    -6
      package_first/pages/VolunteerDetail/index.wxml
  19. +7
    -4
      package_first/pages/VolunteerDetail/index.wxss
  20. +19
    -17
      package_first/pages/videoDetail/index.js
  21. +1
    -1
      package_first/pages/videoDetail/index.wxml
  22. +1
    -1
      package_first/pages/videoDetail/index.wxss

+ 7
- 0
api/volunteer.js View File

@@ -20,4 +20,11 @@ export const activityGetApply = function (data) {
method: 'GET',
data
})
}
export const api_getApply = function (data) {
return request({
url: '/westreamActivityApply/getApply',
method: 'GET',
data
})
}

+ 33
- 5
package_first/pages/ActivityApply/index.js View File

@@ -7,6 +7,8 @@ Page({
*/
data: {
activityId: null,
activityInfo:{},
tobegin:true,
userInfo: {
applyName: '',
applyPhone: ''
@@ -17,9 +19,9 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const activityId = options.id
const activityInfo = JSON.parse(decodeURIComponent(options.activityInfo))
this.setData({
activityId
activityInfo
})
},

@@ -35,9 +37,10 @@ Page({
},

handleSubmit(){
if(this.data.userInfo.applyName=='' || this.data.userInfo.applyPhone==''){
wx.showToast({
title: '请填写完整',
title: '请输入姓名/电话',
icon:'none'
})
return
@@ -50,15 +53,40 @@ Page({
})
return
}
if(!this.data.tobegin){
return
}
this.data.tobegin = false
setTimeout(()=>{
this.data.tobegin=true
this.setData({
tobegin:this.data.tobegin
})
},2000)
const openid = wx.getStorageSync('openid')
const userInfo = wx.getStorageSync('userInfo')
const params = {
...this.data.userInfo,
openid,
activityId: this.data.activityId
nickname:userInfo.nickname,
activityId: this.data.activityInfo.id,
activityTitle:this.data.activityInfo.activityTitle
}
activitySubmit(params)
.then(res=>{
if(res.code==0){
wx.showToast({
title: '报名成功',
icon:"none"
}),
setTimeout(()=>{
wx.navigateBack()
}
,2000)
}
})
this.setData({
tobegin:this.data.tobegin
})
},


+ 80
- 56
package_first/pages/AddPicture/index.js View File

@@ -9,8 +9,17 @@ Page({
* 页面的初始数据
*/
data: {
ossForm: {},
imageList:[],
imagePreviewList: [],
formRules: {
imageList: {
validator: function (value) {
return value.length!=0;
},
warning: false
}
}
},

/**
@@ -176,68 +185,83 @@ validateForm() {
},
/* 表单上传 */
submit(){
let ossForm = this.data.ossForm
let temp = []
if (this.data.imageList.length > 0) {
wx.showLoading({title:"上传中",mask:true})
temp = this.data.imageList.map(item => {
console.log(item);
// 设置文件上传路径
const randomString = Math.random().toString(36).slice(2)
const timestamp = new Date().getTime()
const key = `imagedir/${randomString}_${timestamp}.png`
// 上传图片
return new Promise((resolve, reject)=> {
wx.uploadFile({
url: 'https://ta-tech-image.oss-cn-shanghai.aliyuncs.com',
filePath: item,
name: 'file',
formData: {
key,
OSSAccessKeyId: ossForm.OSSAccessKeyId,
signature: ossForm.signature,
policy: ossForm.policy,
'x-oss-security-token': ossForm.SecurityToken
},
success: (res)=> {
if(res.statusCode === 204) {
// 上传成功,将图片路径resolve出去
resolve(key)
} else {
wx.showToast({
title: '图片上传失败',
})
this.validateForm().then(res => {
let ossForm = this.data.ossForm
let temp = []
if (this.data.imageList.length > 0) {
wx.showLoading({title:"上传中",mask:true})
temp = this.data.imageList.map(item => {
console.log(item);
// 设置文件上传路径
const randomString = Math.random().toString(36).slice(2)
const timestamp = new Date().getTime()
const key = `imagedir/${randomString}_${timestamp}.png`
// 上传图片
return new Promise((resolve, reject)=> {
wx.uploadFile({
url: 'https://ta-tech-image.oss-cn-shanghai.aliyuncs.com',
filePath: item,
name: 'file',
formData: {
key,
OSSAccessKeyId: ossForm.OSSAccessKeyId,
signature: ossForm.signature,
policy: ossForm.policy,
'x-oss-security-token': ossForm.SecurityToken
},
success: (res)=> {
if(res.statusCode === 204) {
// 上传成功,将图片路径resolve出去
resolve(key)
wx.showToast({
title: '您的图片已提交',
icon:'none'
})
setTimeout(()=>{
wx.redirectTo({
url: '../../pages/AttentionMethod/index',
})
},2000)
} else {
wx.showToast({
title: '图片上传失败',
})
reject('图片上传失败')
}
},
fail: (e)=> {
console.log(e);
reject('图片上传失败')
}
},
fail: (e)=> {
console.log(e);
reject('图片上传失败')
}
})
})
})
})
Promise.all(temp).then((res)=> {
let tenantObj = wx.getStorageSync('tenant')
let openid = wx.getStorageSync('openid')
let data = {
openid:openid,
imageUrl:res.join(','),
tenantId:tenantObj.tenantId
}
api_TiktokAdd(data).then(res => {
if (res.code === 0) {
wx.reLaunch({
url: '/package_first/pages/successPage/index',
})
Promise.all(temp).then((res)=> {
let tenantObj = wx.getStorageSync('tenant')
let openid = wx.getStorageSync('openid')
let data = {
openid:openid,
imageUrl:res.join(','),
tenantId:tenantObj.tenantId
}
}).finally(()=>{
wx.hideLoading();
api_TiktokAdd(data).then(res => {
if (res.code === 0) {
wx.showToast({
title: '您的图片已提交',
icon:'none'
})
setTimeout(()=>{
wx.navigateBack()
},2000)
}
}).finally(()=>{
wx.hideLoading();
})
}).catch(()=> {
wx.hideLoading()
})
}).catch(()=> {
wx.hideLoading()
})
}
}
})
}
})

+ 16
- 2
package_first/pages/AddPicture/index.wxml View File

@@ -2,16 +2,30 @@
<view>
<view class="add_container">
<view class="title">上传图片</view>
<view class="upload_image" bindtap="uploadImage">
<!-- <view class="upload_image" bindtap="uploadImage">
<view class="add_imageList" wx:for="{{imageList}}" wx:key="index">
<image style="width:100%;" mode="widthFix" src="{{item}}"></image>
<div class="close" data-current="{{index}}" catchtap="deleteImage"></div>
</view>
<view wx:if="{{imageList.length<5}}" class="upload_part">
<image style="height: 70rpx;width:70rpx;" mode="widthFix" src="../../../assets/img/upload.png"></image>
<image class="upload_img" style="height: 70rpx;width:70rpx;" mode="widthFix" src="../../../assets/img/upload.png"></image>
<view class="upload_text">上传图片</view>
</view>
</view> -->
<view class="upload_images {{formRules.imageList.warning? 'warning': ''}}">
<view class="image_list">
<view class="image_preview" wx:for="{{imagePreviewList}}" wx:key="index">
<image class="image_item" src="{{item}}" mode="aspectFill" data-item="{{item}}">
</image>
<div class="close" data-current="{{index}}" catchtap="deleteImage"></div>
</view>
<view class="upload_image" bindtap="uploadImage" wx:if="{{imageList.length<5}}">
<image style="height: 56rpx;width: 56rpx; padding-top: 80rpx;" mode="widthFix" src="../../../assets/img/upload.png"></image>
<view class="upload_text">上传图片</view>
</view>
</view>
<text class="tips">请先上传图片</text>
</view>
<view class="button" bindtap="submit">
提交
</view>

+ 76
- 2
package_first/pages/AddPicture/index.wxss View File

@@ -30,8 +30,8 @@
}
.close{
position: absolute;
top:180rpx;
right:65rpx;
top:0;
right:0;
transform: translate(40%,-40%);
height:50rpx;
width:50rpx;
@@ -39,8 +39,36 @@
border-radius: 50%;
z-index: 10;
}
.close::before{
content: "";
display: block;
position: absolute;
width: 60%;
height: 6rpx;
top:50%;
left:50%;
background:rgb(124, 124, 124);
transform-origin: center;
/* transform: ; */
transform: translate(-50%,-50%) rotate(45deg);
}
.close::after{
content: "";
display: block;
position: absolute;
width: 60%;
height: 6rpx;
top:50%;
left:50%;
background:rgb(124, 124, 124);
transform-origin: center;
/* transform: ; */
transform: translate(-50%,-50%) rotate(-45deg);
}
.upload_part {
padding-top: 70rpx;
width: 100%;
height: 180rpx;
}

.upload_text{
@@ -63,4 +91,50 @@

.add_imageList {
width: 100%;
}
.tips{
position: absolute;
bottom: 150rpx;
left: 0rpx;
color: red;
font-size: 24rpx;
transform: translate(27rpx, -5rpx);
display: none;
}
.form_item.warning .tips, .use_purpose.warning .tips, .upload_images.warning .tips{
display: block;
}
.image_item {
height:100%;
width: 100%;
margin-right: 30rpx;
margin-bottom: 20rpx;
}
.image_preview {
height: 250rpx;
width: 100%;
margin-right: 30rpx;
margin-bottom: 20rpx;
position: relative;
}
.image_list {
width: 100%;
margin-top: 20rpx;
padding: 20rpx 0;
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
align-content: flex-start;
}
/* 上传图片 */
.upload_images {
width: 100%;
margin-bottom: 30rpx;
padding: 0 30rpx;
display: flex;
justify-content: space-between;
align-items: flex-start;
font-size: 28rpx;
color: #666666;
position: relative;
}

+ 27
- 3
package_first/pages/AttentionMethod/index.js View File

@@ -1,18 +1,26 @@
// package_first/pages/AttentionMethod/index.js
import {
api_getIsApply
} from '../../../api/attention.js';
Page({

/**
* 页面的初始数据
*/
data: {
status:null
},

/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {

// let status = options.status
// this.setData({
// status
// })
// console.log(status);
},

/**
@@ -26,7 +34,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
this.getIsApply()
},

/**
@@ -62,8 +70,24 @@ Page({
*/
onShareAppMessage() {

},
getIsApply(){
const {tenantId} = wx.getStorageSync('tenant')
const openid = wx.getStorageSync('openid')
const data = { openid }
api_getIsApply(data).then(res=>{
console.log(res);
this.data.status = res.data
})
},
goPage(e){
if(this.data.status == 1 ){
wx.showToast({
title: '您已参加该活动',
icon:"none"
})
return
}
wx.navigateTo({
url: `/package_first/pages/AddPicture/index`,
})

+ 4
- 2
package_first/pages/AttentionMethod/index.wxss View File

@@ -2,10 +2,12 @@
.attention_container{
position: relative;
width: 100%;
background-color: RGBA(224, 235, 255, 1);
}
.main{
width: 100%;
height: 2640rpx;
height: 1940rpx;
padding-bottom: 40rpx;
}
.button{
width: calc(100% - 60rpx);
@@ -19,6 +21,6 @@
text-align: center;
line-height: 95rpx;
position: fixed;
bottom: 55rpx;
bottom: 30rpx;
left: 30rpx;
}

+ 23
- 7
package_first/pages/LearningVideo/index.js View File

@@ -10,6 +10,11 @@ Page({
params: {
openid: null
},
userPage:{
page:1,
limit:10
},
total:0,
current: ''
},

@@ -74,7 +79,13 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom() {

if(this.data.userPage.page*this.data.userPage.limit<this.data.total){
this.data.userPage.page++
this.setData({
userPage:this.data.userPage
})
this.westreamVideo()
}
},

/**
@@ -92,17 +103,22 @@ Page({
...this.data.userPage
}
api_westreamVideo(data).then(res=>{
let list = [...this.data.list,...res.data.records]
let list = []
if(this.data.userPage.page==1){
list = res.data.records
}else{
list = [...this.data.list,...res.data.records]
}
let total = res.data.total
this.setData({
total,
list,
})
if(list.status == 0){
data.entersList[0].isstudy = true
}else if(list.status == 1){
data.entersList[1].isstudy = true
}
// if(list.status == 0){
// data.entersList[0].isstudy = true
// }else if(list.status == 1){
// data.entersList[1].isstudy = true
// }
})
},
handleDetail(e){

+ 3
- 3
package_first/pages/LearningVideo/index.wxml View File

@@ -6,13 +6,13 @@
<view class="cotent">
<view class="title">
<view class="title_text">{{item.videoTitle}}</view>
<view class="{{item.status==1?'item__tag sutdying':item.status==0?'item__tag no--sutdy':'item__tag is--sutdy'}}">
{{item.status==1?'学习中':item.status==0?'待学习':'已学习'}}
<view class="{{item.status==2?'item__tag is--sutdy':'item__tag no--sutdy'}}">
{{item.status==2?'已学习':'待学习'}}
</view>
</view>
<view class="title_content">{{item.videoBrief}}</view>
</view>
</view>
<view class="bottom">- 更多视频 敬请期待 -</view>
</list>
<view class="bottom">- 更多视频 敬请期待 -</view>
</view>

+ 4
- 1
package_first/pages/LearningVideo/index.wxss View File

@@ -77,11 +77,14 @@
background-color: #1BE9BC;
}
.bottom{
width: 100%;

font-size: 26rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #C5C5C5;
line-height: 36rpx;
text-align: center;
margin-top: 27rpx;
padding-top: 27rpx;
background: #F2F6F9;
}

+ 15
- 4
package_first/pages/ProtectionActivity/index.js View File

@@ -9,6 +9,7 @@ Page({
* 页面的初始数据
*/
data: {
tikStatus:null,
entersList:[
{
title:'关注抖音',
@@ -96,22 +97,32 @@ Page({
const entersList = this.data.entersList
const {tenantId} = wx.getStorageSync('tenant')
const openid = wx.getStorageSync('openid')
if(tenantId === null){
if(tenantId !== 5 ){
entersList[0].isShow = false
this.setData({ entersList })
}else{
const data = { openid }
api_getIsApply(data).then(res=>{
entersList[0].isJoin = !!res.data
this.setData({ entersList })
let tikStatus = res.data
entersList[0].isJoin = res.data == 2 ? true:false
this.setData({ entersList,tikStatus })
})
}

},
goPage(e){
const { path } = e.currentTarget.dataset
// if(path=='/package_first/pages/AttentionMethod/index'){
// wx.navigateTo({
// url: '/package_first/pages/AttentionMethod/index?status='+this.data.tikStatus
// })
// }else{
// wx.navigateTo({
// url: path
// })
// }
wx.navigateTo({
url: path
url: path
})
},
homepage(e){

+ 17
- 7
package_first/pages/ProtectionSuggestion/index.js View File

@@ -1,5 +1,4 @@
// package_first/pages/ProtectionSuggestion/ProtectionSuggestion.js
// import { PostProcess } from 'XrFrame/xrFrameSystem';

import { api_westreamSuggest,
api_getUserInfo
} from '../../../api/suggestion';
@@ -12,6 +11,7 @@ Page({
form : {
content:''
},
tobegin:true,
dialogShow:false,
userInfo:{},
formRules: {
@@ -120,6 +120,16 @@ Page({
icon:'none'
})
}else{
if(!this.data.tobegin){
return
}
this.data.tobegin = false
setTimeout(()=>{
this.data.tobegin = true
this.setData({
tobegin:this.data.tobegin
})
},2000)
let data = {
tenantId:tenantObj.tenantId,
openid : openid,
@@ -128,18 +138,18 @@ Page({
}
api_westreamSuggest(data).then(res=>{
// let dialogShow = true
// this.setData({
// dialogShow,
// })
this.setData({
tobegin:this.data.tobegin
})
wx.showToast({
title: '提交成功',
title: '您的宝贵意见已提交',
icon:'none'
})
setTimeout(()=>{
wx.switchTab({
url: '/pages/FirstPage/index',
})
},1000)
},2000)
})
}
}

+ 1
- 1
package_first/pages/ProtectionSuggestion/index.wxml View File

@@ -10,7 +10,7 @@
<view class="bottom">
<view class="suggestion">护河建议</view>
<view class="suggestion_text">
<textarea class="text_content" maxlength="150" bindinput="remarkInputAction" placeholder="请留下您的宝贵意见。" auto-focus="true" value="{{form.content}}" />
<textarea class="text_content" maxlength="200" bindinput="remarkInputAction" placeholder="请留下您的宝贵意见。" auto-focus="true" value="{{form.content}}" />
</view>
<view class="button" bindtap="submit">
提交

+ 21
- 18
package_first/pages/VolunteerActivity/index.js View File

@@ -1,13 +1,13 @@
// package_first/pages/volunteerActivity/index.js
import {api_westreamActivity,activitySubmit,} from '../../../api/volunteer';
import {api_westreamActivity,activitySubmit,api_getApply} from '../../../api/volunteer';
Page({

/**
* 页面的初始数据
*/
data: {
activityId: null,
list:[],
activityId:'',
nickname:'',
activityTitle:'',
applyName:'',
@@ -23,7 +23,11 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {

const activityId = options.id
this.setData({
activityId
})
console.log(options);
},

/**
@@ -65,7 +69,13 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom() {

if(this.data.userPage.page*this.data.userPage.limit<this.data.total){
this.data.userPage.page++
this.setData({
userPage:this.data.userPage
})
this.westreamActivity()
}
},

/**
@@ -91,26 +101,24 @@ Page({
}
api_westreamActivity(data).then(res=>{
let list =[]
if(this.data.userPage.page==1){
list =res.data.records
}else{
list = [...this.data.list,...res.data.records]
}
let total = res.data.total
list = list.reduce((pre,item)=>{
res.data.records = res.data.records.reduce((pre,item)=>{
return [...pre,{
...item,
activityBeginTime:this.formatDate(item.activityBeginTime),
activityEndTime:this.formatDate(item.activityEndTime)
}]
},[])
if(this.data.userPage.page==1){
list =res.data.records
}else{
list = [...this.data.list,...res.data.records]
}
let total = res.data.total
this.setData({
total,
list,
}),
console.log(res);
})
},

@@ -120,9 +128,4 @@ Page({
url: '/package_first/pages/VolunteerDetail/index?data='+ encodeURIComponent(data),
})
},
go_applypage(){
wx.navigateTo({
url: '/package_first/pages/ActivityApply/index',
})
}
})

+ 2
- 4
package_first/pages/VolunteerActivity/index.wxml View File

@@ -18,12 +18,10 @@
</view>
</view>
<view class="activity_bottom">
<view>
<view class="apply" wx:if="{{item.status==2}}" bindtap="go_applypage">立即报名</view>
<view class="apply" wx:if="{{item.status==2}}" data-item="{{item}}" bindtap="showDetail">立即报名</view>
<view class="join" bindtap="showDetail" data-item="{{item}}">进入活动 》</view>
</view>
</view>
</view>
<view class="bottom">- 更多视频 敬请期待 -</view>
<view class="bottom">- 更多活动 敬请期待 -</view>
</view>
</view>

+ 21
- 10
package_first/pages/VolunteerActivity/index.wxss View File

@@ -1,7 +1,7 @@
/* package_first/pages/volunteerActivity/index.wxss */
.volunteerActivity_container{
width: 100%;
height: 100vh;
height: 100%;
background: #F2F6F9;
padding: 30rpx;
}
@@ -9,22 +9,30 @@
width: calc(100%-60rpx);
background-color:#FFFFFF ;
margin-bottom: 19rpx;
padding-bottom: 19rpx;
border-radius: 10rpx;
padding-bottom: 41rpx;
}
.activity_image{
width: 100%;
height: 277rpx;
border-radius: 10rpx;
border-top-right-radius: 10rpx;
border-top-left-radius: 10rpx;

}
.activity{
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.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;
@@ -39,9 +47,10 @@
font-family: Source Han Sans CN;
font-weight: 400;
color: #FFFFFF;
line-height: 36rpx;
line-height: 42rpx;
text-align: center;
margin-left: 39rpx;
align-items: center;
}
.is_apply{
background: #006DF7;
@@ -69,21 +78,23 @@
border-radius: 10px;
}
.activity_bottom{
position: relative;
padding: 0 30rpx 35rpx 33rpx;
padding: 22rpx 30rpx 35rpx 33rpx;
}
.join{
position: absolute;
top: 0;
right: 0;
display: block;
float: right;
font-size: 32rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #3275E9;
line-height: 36rpx;
padding-bottom: 41rpx;

}
.apply{
display: block;
float: left;
width: 125rpx;
height: 42rpx;
background: #006DF7;
@@ -92,7 +103,7 @@
font-family: Source Han Sans CN;
font-weight: 400;
color: #FFFFFF;
line-height: 36rpx;
line-height: 42rpx;
text-align: center;
}
.bottom{

+ 47
- 18
package_first/pages/VolunteerDetail/index.js View File

@@ -1,5 +1,5 @@
// package_first/pages/VolunteerDetail/index.js
import {api_westreamActivity,activitySubmit} from '../../../api/volunteer';
import {api_westreamActivity,activitySubmit,api_getApply} from '../../../api/volunteer';

Page({

@@ -9,6 +9,7 @@ Page({
data: {
status:false,
activityInfo:{},
dataSource: {},
list:[],
userPage:{
page:1,
@@ -27,6 +28,23 @@ Page({
this.setData({
activityInfo:data
})
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()
},

/**
@@ -40,7 +58,8 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
this.activitySubmit()
// this.activitySubmit()
this.getApplyStatus()
},

/**
@@ -70,6 +89,21 @@ Page({
onReachBottom() {

},
getApplyStatus(){
const openid = wx.getStorageSync('openid')
const params = {
openid,
activityId: this.data.activityInfo.id,
}
api_getApply(params).then(res=>{
if(res.code==0){
let status = res.data?.status || 3
this.setData({
status
})
}
})
},
activitySubmit(){
let tenantObj = wx.getStorageSync('tenant')
@@ -98,29 +132,24 @@ Page({
return `${year}年${month}月${day}日`;
},
goApply(e){

if(this.data.status){
if(this.data.status === 1){
wx.showToast({
title: '您已参加该活动',
icon:"none"
})
return
}
// if(status == 2){
// console.log(this.data.status);
// wx.navigateTo({
// url:"/package_first/pages/ActivityApply/index"
// })
// }else{
// wx.showToast({
// title: '不在报名时间',
// icon:'none'
// })
// }
wx.navigateTo({
url:"/package_first/pages/ActivityApply/index?id=" + this.data.activityInfo.id
if(this.data.status === 3){
let activityInfo = JSON.stringify(this.data.activityInfo)
wx.navigateTo({
url:"/package_first/pages/ActivityApply/index?activityInfo=" + encodeURIComponent(activityInfo)
})
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

+ 4
- 6
package_first/pages/VolunteerDetail/index.wxml View File

@@ -1,11 +1,9 @@
<!--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=""/>
<!-- <image class="Volunteer_image" src="{{activityInfo.imageUrl}}" mode=""/> -->
</view>
<view class="apply_time">
<view class="apply">报名时间:</view>
@@ -16,7 +14,7 @@
<view class="time_act">{{activityInfo.activityBeginTime}}~{{activityInfo.activityEndTime}}</view>
</view>
</view>
<view class="button" bindtap="goApply">
{{status==3?'已报名':'报名'}}
<view wx:if="{{activityInfo.status==2}}" class="button" bindtap="goApply">
{{status === 2 ?'已报名':'立即报名'}}
</view>
</view>

+ 7
- 4
package_first/pages/VolunteerDetail/index.wxss View File

@@ -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;
@@ -36,24 +39,24 @@
.time_act{
width: 645rpx;
height: 66rpx;
background: rgba(50, 117, 233, 0.2);
background: rgba(16, 177, 255, 0.2);
color: rgba(16, 177, 255, 1);
border-radius: 4rpx;
font-size: 30rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #3275E9;
text-align: center;
line-height:66rpx;
}
.time{
width: 645rpx;
height: 66rpx;
background: rgba(16, 177, 255, 0.2);
border-radius: 4rpx;
font-size: 30rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: rgba(16, 177, 255, 1);
background: rgba(50, 117, 233, 0.2);
color: #3275E9;
text-align: center;
line-height:66rpx;
}

+ 19
- 17
package_first/pages/videoDetail/index.js View File

@@ -6,33 +6,30 @@ Page({
videoProgress: 0,
openid: null,
initialTime: 0,
control:false,
statusList:{
0: '待学习',
1: '学习中',
// 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 ? 0 : data.status
const openid = wx.getStorageSync('openid')
this.setData({
detail:data,
openid
openid,
control : data.status === 2 ? true : false,
})
this.getProgress()
},
onHide(){
this.handleEnded(this.data.detail.status)
},
onUnload(){
this.handleEnded(this.data.detail.status)
},

saveTime(e){
let time = e.detail.currentTime
this.setData({
@@ -46,26 +43,31 @@ Page({
}
getVideoProgress(data).then(res=>{
this.setData({
initialTime:res.data.videoProgress
initialTime:res.data.videoProgress,
})
})
},
handleEnded(status){
handleEnded(){
if(this.data.control){
return
}
const isNumber = typeof(status) === 'number'
const params = {
status: status === 1 ? 1 : 2,
status: 2,
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=>{
let initialTime = null
if(res.code == 0){
if(res.code == 0){
initialTime = res.data==null?0:res.data
}
this.setData({
'detail.status': status === 1 ? 1 : 2,
'detail.status': params.status,
control : true
})
})
}

+ 1
- 1
package_first/pages/videoDetail/index.wxml View File

@@ -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"

+ 1
- 1
package_first/pages/videoDetail/index.wxss View File

@@ -26,7 +26,7 @@
border-radius: 4rpx;
}

.no--sutdy{
.no--study{
background: #EBAC14;
}


Loading…
Cancel
Save