Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
wechatapp.shangjiadao.com
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxuelai
wechatapp.shangjiadao.com
Commits
99400581
Commit
99400581
authored
Apr 23, 2020
by
wangxuelai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'ss'
parent
e6c07ac9
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
145 additions
and
81 deletions
+145
-81
index.js
business/components/commentEditorTypeChoose/index.js
+1
-1
imagelistshow.js
business/pages/commenteditor/imagelistshow.js
+58
-30
imagelistshow.wxml
business/pages/commenteditor/imagelistshow.wxml
+17
-4
imagelistshow.wxss
business/pages/commenteditor/imagelistshow.wxss
+58
-37
index.js
business/pages/commenteditor/index.js
+6
-3
index.wxml
business/pages/commenteditor/index.wxml
+1
-1
constants.js
constants/constants.js
+4
-4
index.js
utilities/index.js
+0
-1
No files found.
business/components/commentEditorTypeChoose/index.js
View file @
99400581
...
...
@@ -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'
)
}
...
...
business/pages/commenteditor/imagelistshow.js
View file @
99400581
...
...
@@ -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
business/pages/commenteditor/imagelistshow.wxml
View file @
99400581
<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
business/pages/commenteditor/imagelistshow.wxss
View file @
99400581
.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:
46
0rpx;
margin-bottom:
10
rpx;
height:
34
0rpx;
margin-bottom:
26
rpx;
position: relative;
}
.imageitembox.odd {
...
...
@@ -34,14 +34,14 @@
}
.imageitembox.odd .imageitem {
margin-right:
6
rpx;
margin-right:
14
rpx;
}
.imageitembox.even .imageitem {
margin-left:
6
rpx;
margin-left:
14
rpx;
}
.imageitem {
width: 34
6
rpx;
height:
46
0rpx;
width: 34
0
rpx;
height:
34
0rpx;
border-radius: 10rpx;
overflow: hidden;
position: relative;
...
...
@@ -67,43 +67,38 @@
display: block;
}
.imageitem .sign-img {
width: 34
6
rpx;
height:
46
0rpx;
width: 34
0
rpx;
height:
34
0rpx;
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:
34
rpx;
height:
34
rpx;
border:
1px solid rgba(253,253,253
,1);
width:
50
rpx;
height:
50
rpx;
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
business/pages/commenteditor/index.js
View file @
99400581
...
...
@@ -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
){
...
...
business/pages/commenteditor/index.wxml
View file @
99400581
...
...
@@ -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>
...
...
constants/constants.js
View file @
99400581
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'
...
...
utilities/index.js
View file @
99400581
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment