Commit a9590243 authored by lvtz's avatar lvtz

Merge branch 'wxl-develop' of git.server:wangxuelai/wechatapp.shangjiadao.com into qrcode_lvtz

parents cb3dbadd 9e05eca6
......@@ -47,7 +47,19 @@ Component({
return false;
}
app.globalData.accountExpired = false;
wx.reLaunch({
let pages = getCurrentPages();
let currPage = null; //当前页面
let prevPage = null; //上一个页面
if (pages.length >= 2) {
currPage = pages[pages.length - 1]; //当前页面
prevPage = pages[pages.length - 2]; //上一个页面
}
//console.log(prevPage, 'pages');
if(prevPage.route == "business/pages/exchangebusiness/index") {
wx.navigateBack();
return;
}
wx.navigateTo({
url: `/business/pages/exchangebusiness/index`,
})
}
......
......@@ -21,5 +21,5 @@
</view>
</view>
</view>
<view class="surebtn" bindtap="gocomment">{{actiontext}}</view>
</view>
\ No newline at end of file
</view>
<view class="surebtn" bindtap="gocomment">{{actiontext}}</view>
\ No newline at end of file
......@@ -171,18 +171,18 @@ Page({
for (let i in this.data.scoreObject) {
totalScore += Number(this.data.scoreObject[i].score);
}
const averageScore = totalScore / 4;
const leftScore = averageScore % 1;
let score = 0;
if (leftScore <= 0.5 && leftScore > 0) {
score = Math.floor(averageScore) + 0.5;
} else if (leftScore > 0.5) {
score = Math.ceil(averageScore);
} else {
score = averageScore;
}
const averageScore = (totalScore / 4).toFixed(1);
// const leftScore = averageScore % 1;
// let score = 0;
// if (leftScore <= 0.5 && leftScore > 0) {
// score = Math.floor(averageScore) + 0.5;
// } else if (leftScore > 0.5) {
// score = Math.ceil(averageScore);
// } else {
// score = averageScore;
// }
this.setData({
averageScore: score,
averageScore,
})
},
goModifyScoreTemp () {
......@@ -1485,7 +1485,7 @@ Page({
this.data.imgInfoList = new Array(imgUrls.length);
const maxImgHeight = this.data.windowHeight - 180;
for(let i=0; i<imgUrls.length; i++){
const url = imagify(imgUrls[i]);
const url = imagify(imgUrls[i], 'image/resize,w_400/format,jpg/quality,q_50');
wxGetImageInfo({src:url}).then((res)=>{
console.log(res,'res')
let imageWidth ='';
......
......@@ -48,7 +48,8 @@ Page({
myimg:'' ,// 临时保存的图片
shortCanvas:false,
imgInfoList: [],
initImgInfoList: []
initImgInfoList: [],
maxCanvasToTemp: 0
},
/**
......@@ -234,10 +235,10 @@ Page({
getImgInfo(){
const { imgArr, AcSubIndex, imgInfoList } = this.data;
const that = this;
let url = imagify(imgArr[AcSubIndex]);
let url = imagify(imgArr[AcSubIndex], 'image/resize,w_400/format,jpg/quality,q_50');
const maxImgHeight = this.data.windowHeight - 180;
// let url = imgArr[AcSubIndex];
if(imgInfoList[AcSubIndex]) {
if(imgInfoList[AcSubIndex] && imgInfoList[AcSubIndex].actTemPath) {
return;
}
wxGetImageInfo({src:url}).then((res)=>{
......@@ -448,45 +449,51 @@ Page({
},ctx)
}
setTimeout(() => {
wx.canvasToTempFilePath({
x: 0,
y: 0,
width: imgInfoList[AcSubIndex].imageWidth*2,
height: imgInfoList[AcSubIndex].imageHeight*2,
destWidth: imgInfoList[AcSubIndex].imageWidth*2,
destHeight: imgInfoList[AcSubIndex].imageHeight*2,
canvasId: 'tempCanvas',
success(res) {
const tempFilePath = res.tempFilePath;
that.ctx.clearRect(0,0,750, imgInfoList[AcSubIndex].imageHeight);
that.ctx.draw(true);
that.setData({
[`imgArr[${AcSubIndex}]`]: tempFilePath,
[`imgInfoList[${AcSubIndex}]`]: {
imageWidth:imgInfoList[AcSubIndex].imageWidth,
imageHeight: imgInfoList[AcSubIndex].imageHeight,
actTemPath: tempFilePath,
isDraw: true
},
textArr:[],
sourceArr:[],
},()=>{
})
if(type=="next" || index || index==0){
that.setData({
AcSubIndex:(index || index==0) ? index : that.data.AcSubIndex+=1,
shortCanvas:false,
})
that.getImgInfo();
}else if(type == "back"){
that.goBack();
}
wx.hideLoading();
},
fail(res){
wx.hideLoading()
}
})
// wx.canvasToTempFilePath({
// x: 0,
// y: 0,
// width: imgInfoList[AcSubIndex].imageWidth*2,
// height: imgInfoList[AcSubIndex].imageHeight*2,
// destWidth: imgInfoList[AcSubIndex].imageWidth*2,
// destHeight: imgInfoList[AcSubIndex].imageHeight*2,
// canvasId: 'tempCanvas',
// success(res) {
// const tempFilePath = res.tempFilePath;
// that.ctx.clearRect(0,0,750, imgInfoList[AcSubIndex].imageHeight);
// that.ctx.draw(true);
// that.setData({
// [`imgArr[${AcSubIndex}]`]: tempFilePath,
// [`imgInfoList[${AcSubIndex}]`]: {
// imageWidth:imgInfoList[AcSubIndex].imageWidth,
// imageHeight: imgInfoList[AcSubIndex].imageHeight,
// actTemPath: tempFilePath,
// isDraw: true
// },
// textArr:[],
// sourceArr:[],
// maxCanvasToTemp: 0,
// },()=>{
// })
// if(type=="next" || index || index==0){
// that.setData({
// AcSubIndex:(index || index==0) ? index : that.data.AcSubIndex+=1,
// shortCanvas:false,
// })
// that.getImgInfo();
// }else if(type == "back"){
// that.goBack();
// }
// wx.hideLoading();
// },
// fail(res){
// this.data.maxCanvasToTemp+=1;
// if(this.data.maxCanvasToTemp<3){
// }
// wx.hideLoading()
// }
// })
that.canvasToTempFilePath(imgInfoList, type, index, AcSubIndex);
}, 1000)
}else{
that.getImgInfo();
......@@ -595,4 +602,53 @@ Page({
}
ctx.draw(true);
},
canvasToTempFilePath(imgInfoList, type, index, AcSubIndex ){
const that = this;
wx.canvasToTempFilePath({
x: 0,
y: 0,
width: imgInfoList[AcSubIndex].imageWidth*2,
height: imgInfoList[AcSubIndex].imageHeight*2,
destWidth: imgInfoList[AcSubIndex].imageWidth*2,
destHeight: imgInfoList[AcSubIndex].imageHeight*2,
canvasId: 'tempCanvas',
success(res) {
const tempFilePath = res.tempFilePath;
that.ctx.clearRect(0,0,750, imgInfoList[AcSubIndex].imageHeight);
that.ctx.draw(true);
that.setData({
[`imgArr[${AcSubIndex}]`]: tempFilePath,
[`imgInfoList[${AcSubIndex}]`]: {
imageWidth:imgInfoList[AcSubIndex].imageWidth,
imageHeight: imgInfoList[AcSubIndex].imageHeight,
actTemPath: tempFilePath,
isDraw: true
},
textArr:[],
sourceArr:[],
maxCanvasToTemp: 0,
},()=>{
})
if(type=="next" || index || index==0){
that.setData({
AcSubIndex:(index || index==0) ? index : that.data.AcSubIndex+=1,
shortCanvas:false,
})
that.getImgInfo();
}else if(type == "back"){
that.goBack();
}
wx.hideLoading();
},
fail(res){
that.data.maxCanvasToTemp+=1;
if(that.data.maxCanvasToTemp<3){
that.canvasToTempFilePath(imgInfoList, type, index ,AcSubIndex);
}else{
wx.hideLoading()
}
}
})
}
})
\ No newline at end of file
......@@ -101,6 +101,7 @@ Component({
diashow: true,
transformOrigin: `${e.currentTarget.offsetLeft - dialogOffSetLeft + 30}px ${e.currentTarget.offsetTop - dialogOffSetTop + 30}px`
})
this.triggerEvent('hideCanvas', false);
const visitor = LocalStorage.getItem('visitor');
activityLog({
type: 24,
......@@ -113,6 +114,7 @@ Component({
this.setData({
contentHide: true
})
this.triggerEvent('hideCanvas', true);
setTimeout(() => {
this.setData({
contentHide: false,
......
......@@ -385,7 +385,7 @@ function countDownToSecond(timeStamp) {
var png = ''
if (Math.floor(score/startscore) >= 1) {
return 'fullstar.png';
} else if (Math.floor(score/startscore) < 1 && (score%startscore/0.5)%2 == 1 && (score > (startscore-1))) {
} else if ((score/startscore) < 1 && ((score-0)) >= ((startscore-0) - 0.5) ) {
return 'halfstar.png';
} else {
return 'emptystar.png';
......
......@@ -2024,6 +2024,11 @@ Page({
chartshow: true
})
},
hideCanvas(e){
this.setData({
chartshow: e.detail
})
},
// 视频播放相关代码
// 防止悬浮窗滚动页面滚动,无特殊意义
ture () { },
......
......@@ -292,6 +292,7 @@
<view class="" wx:if="{{sid != 0 && advertisementshow}}" >
<advertisement
sid="{{sid}}"
bind:hideCanvas="hideCanvas"
bind:resetretract="resetretract"
retract="{{retract}}"
classId="{{id}}"
......
......@@ -671,15 +671,6 @@ Page({
})
},
joinAdPost(){
// if(this.data.params.name==""){
// wx.showModal({
// title: '提示',
// content: '请输入姓名',
// showCancel: false,
// confirm: true
// })
// return;
// }
if(this.data.params.mobile==""){
wx.showModal({
title: '提示',
......@@ -784,12 +775,12 @@ Page({
})
}
setTimeout(()=>{wx.hideLoading()}, 500);
},
bindpause(e){
const id = e.currentTarget.dataset.id;
this.data.videoStatus[id] = {
isplay:false
isplay:false,
isClick: this.data.videoStatus[id] ? (this.data.videoStatus[id].isClick || false) : false
}
this.setData({
videoStatus:this.data.videoStatus
......
......@@ -10,11 +10,12 @@
<block wx:for="{{playList}}" wx:for-index="playindex" wx:for-item="playitem" wx:key="{{playindex}}" style="position: relative">
<swiper-item>
<view class="video-box-wrapper" wx-if="{{playitem.type==2}}">
<video bindprogress="videoProgress" class="{{videoStatus['video'+currentIndex].isClick || videoStatus['video'+currentIndex].isplay ? 'show-video' : ''}}" src="{{filter.transformOssVideofyM3u8(filter.jsonParse(playitem.content))}}" bindplay="bindplay" bindpause="bindpause" loop="{{true}}" bindtap="clickVideo" show-play-btn="{{false}}" show-center-play-btn="{{false}}" controls="{{false}}" data-type="{{playitem.type}}" data-id="video{{playindex}}" id="video{{playindex}}" poster="{{filter.videoPoster(playitem.video)}}" autoplay="{{false}}" wx-if="{{filter.isLoadVideo(playindex, currentIndex, playList.length)}}"></video>
{{videoStatus['video'+currentIndex].isClick}}
<video bindprogress="videoProgress" style="{{videoStatus['video'+currentIndex].isClick || videoStatus['video'+currentIndex].isplay ? 'left: 0;' : ''}}" src="{{filter.transformOssVideofyM3u8(filter.jsonParse(playitem.content))}}" bindplay="bindplay" bindpause="bindpause" loop="{{true}}" bindtap="clickVideo" show-play-btn="{{false}}" show-center-play-btn="{{false}}" controls="{{false}}" data-type="{{playitem.type}}" data-id="video{{playindex}}" id="video{{playindex}}" poster="{{filter.videoPoster(playitem.video)}}" autoplay="{{false}}" wx-if="{{filter.isLoadVideo(playindex, currentIndex, playList.length)}}"></video>
<image class="video-poster" src="{{filter.jpgvideoPoster(filter.jsonParse(playitem.content)[0], 'image/resize,w_400/format,jpg/quality,q_60')}}" mode="widthFix" lazy-load="false" binderror="" bindload="" wx:else/>
<view class="video-play-icon-box" bindtap="clickVideo" data-type="{{playitem.type}}" data-id="video{{playindex}}" id="video{{playindex}}" poster="{{filter.videoPoster(playitem.video)}}" wx:if="{{playitem.type==2 &&!videoStatus['video'+playindex].isplay}}">
<image class="video-play-icon" src="{{imageRoot}}2c/websiteindex/bigplay.png?{{imageVersion}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload=""></image>
</view>
<image class="video-poster" src="{{filter.jpgvideoPoster(filter.jsonParse(playitem.content)[0], 'image/resize,w_400/format,jpg/quality,q_60')}}" mode="widthFix" lazy-load="false" binderror="" bindload="" />
</view>
<swiper indicator-dots="{{false}}" current="{{innerCurrent[playindex]?innerCurrent[playindex]:0}}" bindchange="innerCurrentChange" style="height:100vh;" wx:if="{{playitem.type==1}}" data-index="{{playindex}}">
<block wx:for="{{filter.jsonParse(playitem.content)}}" wx:key="{{index}}">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment