Commit 99400581 authored by wangxuelai's avatar wangxuelai

'ss'

parent e6c07ac9
......@@ -62,7 +62,7 @@ Component({
interactionmode () {
const that = this;
wx.navigateTo({
url: `/business/pages/commenteditor/imagelistshow?tid=${this.data.tid}&cid=${this.data.cid}&sid=${this.data.sid}`,
url: `/business/pages/commenteditor/imagelistshow?tid=${this.data.tid}&cid=${this.data.cid}&sid=${this.data.sid}&mode=2`,
success () {
that.triggerEvent('hideChooseTypeDia')
}
......
......@@ -14,9 +14,12 @@ import {
getRandomFilename,
audioorigin,
matchBlacklist,
LocalStorage
LocalStorage,
imagify
} from '../../../utilities/index.js';
import {
wxGetImageInfo
} from '../../../utilities/wxApi.js';
Page({
data: {
imageRoot: app.globalData.imageRoot,
......@@ -26,22 +29,35 @@ Page({
selectedObj: {},
hasReviewedWork: {},
actiontext: '选好了,去点评',
id: 0,
tid: 0,
cid: 0,
sid: 0,
mode: 1, // 1是图片点评 2 互动电评
imgInfoList: [],
choosenImgs: []
// chooseimg
},
onLoad: function (options) { // Do some initialize when page load.
const {
id,
tid,
cid,
sid
sid,
mode
} = options;
this.setData({
id,
tid,
cid,
sid
sid,
mode
})
this.commentDetailGet();
wx.hideShareMenu()
wx.setNavigationBarColor({//设置导航栏颜色
frontColor: '#ffffff',//注意frontColor的值只能为000000或者111111
backgroundColor: '#222222'
});
},
onReady: function () { // Do something when page ready.
wx.hideShareMenu()
......@@ -77,6 +93,7 @@ Page({
this.setData({
videoArray: data.video_parse.filter((ele) => ele.type == 'image'),
})
this.getImgInfo(this.data.videoArray);
}
}).catch(() => {
wx.hideLoading();
......@@ -84,27 +101,41 @@ Page({
},
chooseimg (e) {
const { src, type } = e.currentTarget.dataset;
if (src == this.data.selectedObj.src) {
this.setData({
selectedObj: {
}
})
return;
}
let actiontext = this.data.actiontext;
if (this.data.hasReviewedWork[src]) {
actiontext = '已点评,去重评';
const choosenImgIndex = this.data.choosenImgs.findIndex(ele => ele.src == src); // 查看选中的数组中有没有 有 删除 没有 加入
const imgIndex = this.data.videoArray.findIndex(ele => ele.src == src); // 选出
if (choosenImgIndex == -1) {
this.data.choosenImgs.push({
...this.data.videoArray[imgIndex],
index: this.data.choosenImgs.length + 1
});
} else {
actiontext = '选好了,去点评';
this.data.choosenImgs.splice(choosenImgIndex, 1);
this.data.choosenImgs.forEach((ele, index) => {
ele.index = index + 1;
})
}
this.setData({
selectedObj: {
src,
type,
},
actiontext
choosenImgs: this.data.choosenImgs
})
},
getImgInfo(filterImage){
const that = this;
const imgUrls = filterImage.map((item)=>{return item.src})
this.data.imgInfoList = new Array(imgUrls.length);
for(let i=0; i<imgUrls.length; i++){
const url = imagify(imgUrls[i]);
wxGetImageInfo({src:url}).then((res)=>{
that.data.imgInfoList[i]= {
imageHeight: res.height,
imageWidth: res.width,
orientation: res.orientation,
actTemPath: res.path,
src: url,
}
}).catch(()=>{
})
}
},
memberComment() {
newMemberComment({
record_id: this.data.cid,
......@@ -139,23 +170,20 @@ Page({
})
},
gocomment (e) {
if (!this.data.selectedObj.src) {
if (this.data.choosenImgs.length == 0) {
wx.showToast({
title: '请选择您要点评的图片或视频',
title: `请选择您要${this.data.mode == 1 ? '标记' : '互动点评'}的图片`,
duration: 1500,
icon: 'none',
})
return;
};
console.log(this.data.selectedObj.src)
if (this.data.selectedObj.type == 'video') {
wx.navigateTo({
url: `/business/pages/commenteditor/videocomment?id=${this.data.id}&tid=${this.data.tid}&cid=${this.data.cid}&sid=${this.data.sid}&src=${encodeURIComponent(this.data.selectedObj.src)}`,
})
} else if (this.data.selectedObj.type == 'image') {
if (this.data.mode == 1) { // 图片标记
wx.navigateTo({
url: `/business/pages/commenteditor/imagecomment?id=${this.data.id}&tid=${this.data.tid}&cid=${this.data.cid}&sid=${this.data.sid}&src=${encodeURIComponent(this.data.selectedObj.src)}`,
})
} else if (this.data.mode == 2) { // 互动点评
}
}
})
\ No newline at end of file
<wxs module="judgeimghincludes">
function judge(src, arr) {
var a = arr.filter(function(ele) {
return ele.src == src
});
return a[0];
}
module.exports = {
judge: judge
}
</wxs>
<wxs src="../../../filter/index.wxs" module="filter" />
<view class="container">
<view class="headertooltip mb24">选择需要点评的图片或视频(暂时只支持一张)</view>
<view class="headertooltip mb24">请选择需要点评的作业图片,最多可选择9张</view>
<view class="imagebox">
<view class="imageitembox {{index%2==1 ? 'even' : ''}} {{index%2==0 ? 'odd' : ''}}" wx:for="{{videoArray}}" wx:for-item="imageitem" wx:key="index">
<view class="imageitem" data-src="{{imageitem.src}}" data-type="{{imageitem.type}}" bindtap="chooseimg">
<view class="imageuncheck" hidden="{{selectedObj.src == imageitem.src}}"></view>
<image class="imageischeck" hidden="{{selectedObj.src != imageitem.src}}" src="{{imageRoot}}2b/commenteditor/checked.png?{{imageVersion}}"></image>
<view class="imageuncheck" hidden="{{judgeimghincludes.judge(imageitem.src, choosenImgs)}}"></view>
<view class="imageischeck" hidden="{{!judgeimghincludes.judge(imageitem.src, choosenImgs)}}">{{judgeimghincludes.judge(imageitem.src, choosenImgs).index}}</view>
<block wx:if="{{imageitem.type == 'image'}}">
<image class="sign-img" mode="aspectFill" src="{{filter.imagify(imageitem.src, 'image/resize,w_320/format,jpg/quality,q_50')}}"></image>
</block>
......@@ -22,4 +33,6 @@
</view>
</view>
</view>
<view class="surebtn" bindtap="gocomment">{{actiontext}}</view>
\ No newline at end of file
<view class="surebtnbox">
<view class="surebtn {{choosenImgs.length > 0 ? 'active' : ''}}" bindtap="gocomment">下一步</view>
</view>
\ No newline at end of file
.container {
position: relative;
padding-bottom: 100rpx;
padding-bottom: 150rpx;
min-height: 100vh;
background-color: #222222;
}
.headertooltip {
height: 36px;
line-height: 36px;
background-color: rgba(255,209,70,0.1);
border-top: 1px solid rgba(255,209,70,1);
border-bottom: 1px solid rgba(255,209,70,1);
color: #FFC000;
background-color: rgba(153,153,153,0.1);
color: #fff;
font-size: 13px;
padding-left: 32rpx;
letter-spacing: 2rpx;
......@@ -19,8 +19,8 @@
}
.imageitembox {
width: 50%;
height: 460rpx;
margin-bottom: 10rpx;
height: 340rpx;
margin-bottom: 26rpx;
position: relative;
}
.imageitembox.odd {
......@@ -34,14 +34,14 @@
}
.imageitembox.odd .imageitem {
margin-right: 6rpx;
margin-right: 14rpx;
}
.imageitembox.even .imageitem {
margin-left: 6rpx;
margin-left: 14rpx;
}
.imageitem {
width: 346rpx;
height: 460rpx;
width: 340rpx;
height: 340rpx;
border-radius: 10rpx;
overflow: hidden;
position: relative;
......@@ -67,43 +67,38 @@
display: block;
}
.imageitem .sign-img {
width: 346rpx;
height: 460rpx;
width: 340rpx;
height: 340rpx;
position: absolute;
}
.imageischeck {
position: absolute;
width: 34rpx;
height: 34rpx;
border-radius: 4rpx;
right: 10rpx;
top: 10rpx;
width: 50rpx;
height: 50rpx;
border-radius: 50%;
background-color: #35BAFD;
font-size: 26rpx;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
right: 20rpx;
top: 20rpx;
z-index: 2;
}
.imageuncheck {
position: absolute;
border: 4rpx solid rgba(255,255,255,1);
width: 34rpx;
height: 34rpx;
border: 1px solid rgba(253,253,253,1);
width: 50rpx;
height: 50rpx;
border-radius: 4rpx;
right: 10rpx;
top: 10rpx;
background-color: rgba(0,0,0,0.3);
right: 20rpx;
top: 20rpx;
z-index: 2;
border-radius: 50%;
}
.surebtn {
height: 46px;
line-height: 46px;
color: #fff;
text-align: center;
background-color: #16B0FD;
position: fixed;
bottom: 0;
left: 0;
width: 100%;
font-size: 13px;
letter-spacing: 2rpx;
z-index: 50;
}
.hascomment {
position: absolute;
z-index: 5;
......@@ -111,4 +106,30 @@
height: 120rpx;
left: 6prx;
top: 6rpx;
}
.surebtnbox {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 150rpx;
background-color: #222222;
display: flex;
align-items: center;
justify-content: center;
z-index: 50;
}
.surebtn {
height: 46px;
line-height: 46px;
color: #fff;
text-align: center;
background-color: #CCCCCC;
width: 650rpx;
font-size: 16px;
border-radius: 23px;
letter-spacing: 2rpx;
}
.surebtn.active {
background-color: #35BAFD;
}
\ No newline at end of file
......@@ -1673,10 +1673,13 @@ Page({
})
},
goTaggedpicture(){
const imgString = JSON.stringify(this.data.commentDetail.filterImage.map((item)=>{return item.src}));
const imgInfoList = JSON.stringify(this.data.imgInfoList);
// const imgString = JSON.stringify(this.data.commentDetail.filterImage.map((item)=>{return item.src}));
// const imgInfoList = JSON.stringify(this.data.imgInfoList);
// wx.navigateTo({
// url: `/business/pages/commenteditor/taggedpicture?sid=${this.data.sid}&imgString=${imgString}&imgInfoList=${imgInfoList}`,
// })
wx.navigateTo({
url: `/business/pages/commenteditor/taggedpicture?sid=${this.data.sid}&imgString=${imgString}&imgInfoList=${imgInfoList}`,
url: `/business/pages/commenteditor/imagelistshow?tid=${this.data.tid}&cid=${this.data.cid}&sid=${this.data.sid}&mode=1`,
})
},
getImgInfo(filterImage){
......
......@@ -327,7 +327,7 @@
<image class="media-type-icon-img media-type-icon-picture" src="{{imageRoot}}2b/comment/biaoji.png?{{imageVersion}}" ></image>
</view>
<view class="media-type-name">
标记
添加标记
</view>
</view>
</view>
......
export default {
imageRoot: 'https://cdn.img.shangjiadao.cn/qingxiao/dakav2/images/',
host: 'https://qxapi.qingxiao.online/daka',
host2: 'https://wx.m.shangjiadao.cn',
// host: 'https://qxapi.qingxiao.online/daka',
// host2: 'https://wx.m.shangjiadao.cn',
storageVersion: '5.0',
imageVersion: '20200420',
// host: 'https://clock.wp53.cn',
// host2: 'https://test.wp53.cn',
host: 'https://clock.wp53.cn',
host2: 'https://test.wp53.cn',
appId: 'wxc1246ea029394785',
miniProgram: {
clock: 'wxdeee20e52a1fd7ee'
......
......@@ -58,7 +58,6 @@ function getRandomFilename(filename) {
}
function imagify(src, params) {
console.log(src,'src')
var reg = /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/g;
if (reg.test(src)) {
return src;
......
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