Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mallapp
Project
Project
Details
Activity
Releases
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
viitto
mallapp
Commits
ea46b111
Commit
ea46b111
authored
Jan 06, 2021
by
Mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
33bc6118
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
1079 additions
and
8 deletions
+1079
-8
index.vue
components/addialog/index.vue
+9
-4
com-float-button.vue
...ndcircle/components/com-float-button/com-float-button.vue
+142
-0
recording.vue
pages/friendcircle/components/recording.vue
+8
-0
sound-recording.vue
...iendcircle/components/sound-recording/sound-recording.vue
+263
-0
my-news.vue
pages/friendcircle/my-news.vue
+178
-0
release.vue
pages/friendcircle/release.vue
+457
-0
goods.vue
pages/goods/goods.vue
+1
-1
index.vue
pages/index/index.vue
+2
-2
investigation.vue
pages/school/investigation.vue
+19
-1
No files found.
components/addialog/index.vue
View file @
ea46b111
...
...
@@ -6,7 +6,7 @@
</swiper-item>
</swiper>
<view
class=
"close"
>
<u-icon
name=
"close"
color=
"#
000
"
size=
"56"
@
click=
"closeHandler"
/>
<u-icon
name=
"close"
color=
"#
FFF
"
size=
"56"
@
click=
"closeHandler"
/>
</view>
</view>
</
template
>
...
...
@@ -41,9 +41,14 @@
},
methods
:
{
clickHandler
(
e
)
{
if
(
e
.
currentTarget
.
dataset
.
url
&&
e
.
currentTarget
.
dataset
.
url
!=
""
)
{
// if (e.currentTarget.dataset.url && e.currentTarget.dataset.url != "") {
// uni.navigateTo({
// url: e.currentTarget.dataset.url
// });
// }
if
(
e
&&
e
!=
''
){
uni
.
navigateTo
({
url
:
e
.
currentTarget
.
dataset
.
url
url
:
e
});
}
},
...
...
@@ -69,7 +74,7 @@
.addialog
.close
{
position
:
absolute
;
bottom
:
14
%
;
bottom
:
25
%
;
left
:
50%
;
margin-left
:
-14px
;
}
...
...
pages/friendcircle/components/com-float-button/com-float-button.vue
0 → 100644
View file @
ea46b111
<
template
>
<view
class=
"com-float-button"
:style=
"
{ bottom: parseInt(bottom) + 'rpx' }" @touchmove.stop.prevent="stop">
<view
:class=
"
{ mark: show }" @click="show = false">
</view>
<view
:class=
"show ? 'list-active' : 'list'"
>
<view
class=
"list-item"
:class=
"
{ show: show }"
:style="{ width: parseInt(size) + 'rpx', height: parseInt(size) + 'rpx', background: item.background ? item.background : background }"
v-for="(item, index) in list"
:key="index"
@click="onClick(item)"
>
<image
class=
"icon"
:src=
"item.url"
mode=
"aspectFit"
></image>
<text
class=
"name"
:style=
"
{ fontSize: parseInt(fontSize) + 'rpx' }">
{{
item
.
name
}}
</text>
</view>
</view>
<view
class=
"list-item show no-mb"
:style=
"
{ width: parseInt(size) + 'rpx', height: parseInt(size) + 'rpx', background: item.background ? item.background : background }"
@click="show = !show"
>
<image
class=
"icon"
:src=
"show ? closeIcon : openIcon"
mode=
"aspectFit"
></image>
<text
class=
"name"
:style=
"
{ fontSize: parseInt(fontSize) + 'rpx' }">
{{
show
?
closeText
:
openText
}}
</text>
</view>
</view>
</
template
>
<
script
>
export
default
{
props
:
{
list
:
{
type
:
Array
,
default
:
()
=>
[]
},
// 离屏幕底部距离
bottom
:
{
type
:
[
String
,
Number
],
default
:
'350rpx'
},
// 图标大小,即按钮宽高rpx
size
:
{
type
:
[
String
,
Number
],
default
:
'85rpx'
},
fontSize
:
{
type
:
[
String
,
Number
],
default
:
'20rpx'
},
background
:
{
type
:
String
,
default
:
'rgba(0, 0, 0, 0.7)'
},
openText
:
{
type
:
String
,
default
:
'更多'
},
closeText
:
{
type
:
String
,
default
:
'返回'
},
openIcon
:
{
type
:
String
,
default
:
'https://vmhandsel.oss-cn-shenzhen.aliyuncs.com/1597905976399.png'
},
closeIcon
:
{
type
:
String
,
default
:
'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/fanhui.png'
}
},
data
()
{
return
{
show
:
false
};
},
methods
:
{
onClick
(
item
)
{
this
.
$emit
(
'click'
,
item
);
this
.
show
=
false
;
},
stop
()
{
return
false
;
}
}
};
</
script
>
<
style
lang=
"scss"
scoped
>
.com-float-button
{
position
:
fixed
;
right
:
20rpx
;
z-index
:
999
;
.mark
{
z-index
:
-1
;
position
:
fixed
;
left
:
0
;
right
:
0
;
top
:
0
;
bottom
:
0
;
background
:
rgba
(
0
,
0
,
0
,
0
.38
);
transition
:
all
0
.3s
linear
;
}
.list-active
{
position
:
absolute
;
bottom
:
80rpx
;
left
:
0
;
transform
:
scale
(
1
);
transition
:
all
0
.3s
ease-in-out
;
}
.list
{
position
:
absolute
;
bottom
:
0
;
left
:
0
;
transform
:
scale
(
0
);
transform-origin
:
bottom
;
opacity
:
0
;
transition
:
all
0
.3s
ease-in-out
;
}
.list-item
{
margin-bottom
:
20rpx
;
border-radius
:
50%
;
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
color
:
#fff
;
.iconfont
{
line-height
:
1
;
font-size
:
45rpx
;
}
&
.no-mb
{
margin-bottom
:
0
;
}
.icon
{
height
:
26rpx
;
}
.name
{
line-height
:
1
;
margin-top
:
8rpx
;
}
}
}
</
style
>
pages/friendcircle/components/recording.vue
0 → 100644
View file @
ea46b111
<
template
>
</
template
>
<
script
>
</
script
>
<
style
>
</
style
>
pages/friendcircle/components/sound-recording/sound-recording.vue
0 → 100644
View file @
ea46b111
<
template
>
<view
class=
"recorder"
>
<view
class=
"re-top"
v-if=
"showTop"
>
<view
class=
"re-cancel"
@
click=
"cancel"
>
取消
</view>
<view
class=
"re-confirm"
:style=
"
{color: theme}" @click="confirm">
{{
confirmText
}}
</view>
</view>
<text
class=
"title"
>
{{
finish
?
'点击播放'
:
'长按录制语音'
}}
</text>
<view
class=
"recorder-box"
v-if=
"!finish"
@
click=
"handle"
@
longpress=
"onStartRecoder"
@
touchend=
"onEndRecoder"
>
<!--
<u-circle-progress
:active-color=
"theme"
:duration=
"0"
:percent=
"calcProgress"
>
-->
<view
class=
"u-progress-content"
>
<image
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/huodongweikaishi.png"
mode=
"aspectFit"
:style=
"
{
width: width,
height: height
}">
</image>
</view>
<!--
</u-circle-progress>
-->
</view>
<view
class=
"recorder-box"
v-else
@
click=
"playVoice"
>
<!--
<u-circle-progress
:active-color=
"theme"
:duration=
"0"
:percent=
"playProgress"
>
-->
<view
class=
"u-progress-content"
>
<image
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/huodongweikaishi.png"
mode=
"aspectFit"
:style=
"
{
width: width,
height: height
}" v-if="!playStatus">
</image>
<image
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/huodongweikaishi.png"
mode=
"aspectFit"
:style=
"
{
width: width,
height: height
}" v-else>
</image>
</view>
<!--
</u-circle-progress>
-->
</view>
<text
class=
"now-date"
>
{{
reDate
}}
</text>
<view
@
click=
"reset"
>
重新录制
</view>
</view>
</
template
>
<
script
>
// import uCircleProgress from '../u-circle-progress/u-circle-progress.vue'
const
recorderManager
=
uni
.
getRecorderManager
();
const
innerAudioContext
=
uni
.
createInnerAudioContext
();
export
default
{
components
:
{
// uCircleProgress
},
props
:
{
width
:
{
type
:
String
,
default
:
'60rpx'
},
height
:
{
type
:
String
,
default
:
'60rpx'
},
showTop
:
{
type
:
Boolean
,
default
:
true
},
maximum
:
{
type
:
[
Number
,
String
],
default
:
15
},
duration
:
{
type
:
Number
,
default
:
20
},
theme
:
{
type
:
String
,
default
:
'#32b99d'
},
confirmText
:
{
type
:
String
,
default
:
'完成'
}
},
data
()
{
return
{
reDate
:
'00:00'
,
sec
:
0
,
min
:
0
,
finish
:
false
,
voicePath
:
''
,
playProgress
:
100
,
playTimer
:
null
,
timer
:
null
,
playStatus
:
false
};
},
created
()
{
// 监听
this
.
onMonitorEvents
()
},
computed
:
{
// 录制时间计算
calcProgress
()
{
return
(
this
.
sec
+
(
this
.
min
*
60
))
/
this
.
maximum
*
100
}
},
methods
:
{
// 完成事件
confirm
()
{
if
(
!
innerAudioContext
.
paused
)
{
innerAudioContext
.
stop
()
}
this
.
$emit
(
'confirm'
,
this
.
voicePath
)
},
// 取消事件
cancel
()
{
if
(
!
innerAudioContext
.
paused
)
{
innerAudioContext
.
stop
()
}
this
.
$emit
(
'cancel'
)
},
// 点击事件
handle
()
{
this
.
$emit
(
'click'
)
},
// 重新录制
reset
()
{
this
.
voicePath
=
''
this
.
min
=
0
this
.
sec
=
0
this
.
reDate
=
'00:00'
this
.
playProgress
=
100
this
.
finish
=
false
this
.
$emit
(
'reset'
)
},
// 播放暂停录音
playVoice
()
{
innerAudioContext
.
src
=
this
.
voicePath
;
if
(
innerAudioContext
.
paused
)
{
innerAudioContext
.
play
()
this
.
playStatus
=
true
}
else
{
innerAudioContext
.
stop
();
}
this
.
$emit
(
'playVoice'
,
innerAudioContext
.
paused
)
},
// 录制结束
onEndRecoder
()
{
recorderManager
.
stop
()
},
// 开始录制
onStartRecoder
()
{
console
.
log
(
2323
)
recorderManager
.
start
({
duration
:
this
.
maximum
*
1000
})
},
// 监听
onMonitorEvents
()
{
// 录制开始
recorderManager
.
onStart
(()
=>
{
uni
.
showLoading
({
title
:
'录制中...'
})
this
.
startDate
()
this
.
$emit
(
'start'
)
})
recorderManager
.
onError
((
err
)
=>
{
console
.
log
(
err
)
})
// 录制结束
recorderManager
.
onStop
(({
tempFilePath
})
=>
{
this
.
voicePath
=
tempFilePath
clearInterval
(
this
.
timer
)
uni
.
hideLoading
()
this
.
finish
=
true
this
.
$emit
(
'end'
)
})
// 播放进度
innerAudioContext
.
onTimeUpdate
(()
=>
{
let
totalDate
=
innerAudioContext
.
duration
let
nowTime
=
innerAudioContext
.
currentTime
let
surplus
=
totalDate
-
nowTime
this
.
playProgress
=
surplus
/
totalDate
*
100
let
_min
=
Math
.
floor
(
surplus
/
60
)
if
(
_min
<
10
)
_min
=
'0'
+
_min
;
let
_sec
=
Math
.
floor
(
surplus
%
60
)
if
(
_sec
<
10
)
_sec
=
'0'
+
_sec
;
this
.
reDate
=
_min
+
':'
+
_sec
})
// 播放暂停
innerAudioContext
.
onPause
(()
=>
{
this
.
resetDate
()
this
.
playProgress
=
100
this
.
playStatus
=
false
console
.
log
(
'播放暂停'
)
this
.
$emit
(
'stop'
)
})
// 播放停止
innerAudioContext
.
onStop
(()
=>
{
this
.
resetDate
()
this
.
playProgress
=
100
this
.
playStatus
=
false
console
.
log
(
'播放停止'
)
this
.
$emit
(
'stop'
)
})
},
// 录音计时
startDate
()
{
console
.
log
(
2333
)
clearInterval
(
this
.
timer
)
this
.
sec
=
0
this
.
min
=
0
this
.
timer
=
setInterval
(()
=>
{
this
.
sec
+=
this
.
duration
/
1000
if
(
this
.
sec
>=
60
)
{
this
.
min
++
this
.
sec
=
0
}
this
.
resetDate
()
},
this
.
duration
)
},
// 播放时间
resetDate
()
{
let
_s
=
this
.
sec
<
10
?
'0'
+
parseInt
(
this
.
sec
)
:
parseInt
(
this
.
sec
)
let
_m
=
this
.
min
<
10
?
'0'
+
this
.
min
:
this
.
min
this
.
reDate
=
_m
+
':'
+
_s
}
}
}
</
script
>
<
style
lang=
"scss"
>
.recorder
{
position
:
relative
;
display
:
flex
;
align-items
:
center
;
flex-direction
:
column
;
background-color
:
#fff
;
font-size
:
24rpx
;
width
:
100%
;
.re-top
{
display
:
flex
;
justify-content
:
space-between
;
padding
:
10rpx
20rpx
;
width
:
100%
;
font-size
:
28rpx
;
box-sizing
:
border-box
;
}
.title
{
font-size
:
36rpx
;
color
:
#333
;
padding
:
20rpx
0
30rpx
;
}
.recorder-box
{
position
:
relative
;
}
.now-date
{
font-size
:
28rpx
;
color
:
#666
;
padding
:
20rpx
0
;
}
}
</
style
>
pages/friendcircle/my-news.vue
0 → 100644
View file @
ea46b111
<
style
>
.mynews
{
width
:
100%
;
height
:
100vh
;
background
:
#FFF
;
}
.mynews
.mynews-top
{
width
:
100%
;
height
:
60px
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
}
.mynews
.top-box
{
padding
:
0
12px
;
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
justify-content
:
center
;
height
:
30px
;
border-radius
:
15px
;
background
:
#40766E
;
font-size
:
14px
;
color
:
#FFFFFF
;
}
</
style
>
<
template
>
<div
class=
'mynews'
>
<view
class=
"mynews-top"
>
<view
class=
"top-box"
>
<image
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/wodehufong.png"
mode=
"widthFix"
style=
"width: 16px;"
></image>
<text
style=
"margin-left: 6px;"
>
我的互动消息
</text>
</view>
</view>
<!-- 发布动态按钮 -->
<floatbutton
:list=
'list'
openIcon=
'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/fabupyq.png'
background=
'#40766E'
openText=
'发布'
bottom=
'80'
@
click=
'btnclick'
></floatbutton>
<u-empty
v-if=
"g.length == 0"
text=
"暂无动态"
mode=
"list"
></u-empty>
<view
v-if=
"g.length > 0"
style=
"
height: calc(100vh-60px);
width: calc(100vw);
overflow: hidden;
"
>
<scroll-view
:scroll-y=
"true"
:enable-back-to-top=
"true"
:enable-flex=
"true"
@
scrolltolower=
"lower"
:style=
"
{ height: '100%' }">
<view
class=
"ftBox"
>
<view
class=
"interDList"
v-for=
"(x, i) in g"
:key=
"i"
@
click=
"goteacher(x)"
>
</view>
</view>
<u-loadmore
:status=
"status"
:load-text=
"loadText"
:font-size=
"24"
:margin-top=
"20"
:margin-bottom=
"20"
bg-color=
"#FFF"
/>
</scroll-view>
</view>
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
@
gbAuth=
'gbAuth'
></auth>
</view>
</div>
</
template
>
<
script
>
import
auth
from
"../../components/auth/index.vue"
;
import
floatbutton
from
"./components/com-float-button/com-float-button.vue"
;
export
default
{
components
:
{
auth
,
floatbutton
},
data
()
{
return
{
pageTitle
:
"我的动态"
,
showAuth
:
false
,
msg
:
{
pageIndex
:
1
,
pageSize
:
10
,
},
mainColor
:
""
,
secondary
:
''
,
pricecolor
:
''
,
page_count
:
1
,
g
:
[],
loading
:
false
,
status
:
"loadmore"
,
count
:
0
,
loadText
:
{
loadmore
:
"轻轻上拉,加载更多"
,
loading
:
"努力加载中"
,
nomore
:
"没有更多了"
,
},
windowWidth
:
0
,
list
:[
{
name
:
'文本'
,
type
:
0
,
url
:
'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/Sound.png'
},
{
name
:
'图文'
,
type
:
1
,
url
:
'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/Sound.png'
},
{
name
:
'视频'
,
type
:
2
,
url
:
'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/Sound.png'
},
{
name
:
'语音'
,
type
:
3
,
url
:
'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/Sound.png'
},
]
}
},
created
()
{
this
.
contentHeight
=
this
.
$utils
.
calcContentHeight
(
-
40
)
+
"px"
;
this
.
mainColor
=
this
.
$uiConfig
.
mainColor
;
this
.
secondary
=
this
.
$uiConfig
.
secondary
;
this
.
pricecolor
=
this
.
$uiConfig
.
pricecolor
;
this
.
windowWidth
=
this
.
$utils
.
SystemInfo
().
windowWidth
;
},
mounted
()
{
let
currentPages
=
getCurrentPages
();
let
u
=
"/"
+
currentPages
[
currentPages
.
length
-
1
].
route
;
let
pages
=
wx
.
getStorageSync
(
"basedata"
)
?
wx
.
getStorageSync
(
"basedata"
).
bar_title
:
[];
pages
.
forEach
((
x
)
=>
{
if
(
x
.
value
==
u
)
{
this
.
pageTitle
=
x
.
new_name
?
x
.
new_name
:
x
.
name
;
}
});
uni
.
setNavigationBarTitle
({
title
:
this
.
pageTitle
,
});
},
onLoad
()
{
this
.
u
=
uni
.
getStorageSync
(
"mall_UserInfo"
);
if
(
!
this
.
u
)
{
this
.
u
=
{
nickName
:
"未登录"
,
avatarUrl
:
""
};
this
.
showAuth
=
true
;
}
else
{
this
.
init
();
}
},
methods
:
{
init
()
{
this
.
loading
=
true
;
this
.
request2
({
url
:
'/api/AppletEducation/MyDynamicList'
,
data
:
this
.
msg
},
res
=>
{
if
(
res
.
resultCode
==
1
)
{
this
.
loading
=
false
;
this
.
count
=
res
.
data
.
count
;
this
.
g
=
this
.
g
.
concat
(
res
.
data
.
pageData
);
this
.
page_count
=
res
.
data
.
pageCount
;
if
(
this
.
page_count
==
1
)
{
this
.
status
=
"nomore"
;
}
}
}
);
},
btnclick
(
item
){
uni
.
navigateTo
({
url
:
'/pages/friendcircle/release?type='
+
item
.
type
})
},
reloadUserinfo
()
{
this
.
u
=
uni
.
getStorageSync
(
"mall_UserInfo"
);
// this.showAuth=false;
this
.
init
();
},
//关闭登录窗口
gbAuth
()
{
uni
.
navigateBack
()
},
}
}
</
script
>
pages/friendcircle/release.vue
0 → 100644
View file @
ea46b111
<
style
>
.release
{
width
:
100%
;
height
:
100vh
;
background
:
#FFF
;
}
.release
.release-box
{
width
:
100%
;
padding
:
15px
;
}
.release
.option-box
{
width
:
100%
;
height
:
40px
;
padding
:
0
10px
;
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
font-size
:
14px
;
color
:
#333333
;
border-bottom
:
1px
soild
#DFDFDF
;
}
.release
.ob-l
{
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
}
.release
.ob-r
{
display
:
flex
;
flex
:
1
;
justify-content
:
flex-end
;
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
padding-left
:
10px
;
}
.release
.releasebtn
{
width
:
100%
;
height
:
45px
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
font-size
:
16px
;
color
:
#FFFFFF
;
background
:
#40766E
;
margin-top
:
83px
;
margin-bottom
:
80px
;
border-radius
:
22.5px
;
}
.release
.slot-btn
{
width
:
200
rpx
;
height
:
200
rpx
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
flex-direction
:
column
;
background
:
rgb
(
244
,
245
,
246
);
border-radius
:
10
rpx
;
margin-left
:
5px
;
}
.release
.slot-btn
.mian-title
{
font-size
:
28
rpx
;
color
:
#888
;
font-weight
:
600
;
margin
:
10
rpx
0
;
}
.release
.audio
{
width
:
100%
;
margin
:
10px
0
;
height
:
35px
;
background
:
#F9F9F9
;
border-radius
:
4px
;
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
justify-content
:
center
;
}
.release
.audio-o
{
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
font-size
:
12px
;
color
:
#333333
;
}
.release
.as-box
{
width
:
100%
;
height
:
235px
;
background
:
#FFFFFF
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
border-top-left-radius
:
10px
;
border-top-right-radius
:
10px
;
}
.release
.as-yuyin
{
margin-top
:
20px
;
width
:
90px
;
height
:
90px
;
border
:
3px
solid
#4F877F
;
background
:
#40766E
;
border-radius
:
50%
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
}
.release
.now-date
{
font-size
:
28
rpx
;
color
:
#666
;
padding
:
20
rpx
0
;
}
.release
.as-btn
{
width
:
100%
;
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
justify-content
:
space-around
;
}
.release
.as-btn-item
{
width
:
85px
;
height
:
40px
;
border-radius
:
20px
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
font-size
:
16px
;
color
:
#40766E
;
border
:
1px
solid
#40766E
;
}
</
style
>
<
template
>
<view
class=
"release"
>
<view
class=
"release-box"
>
<textarea
placeholder=
"今天又什么可以给大家分享呢?"
style=
"width: 100%;height: 100px;"
maxlength=
'-1'
confirm-type=
'done'
v-model=
"addMsg.Content"
>
</textarea>
<text
v-if=
'addMsg.FileType==1 || addMsg.FileType==2'
style=
"font-size: 12px;color: #333333;margin-bottom: 15px;"
>
上传图片或者视频
<span
style=
'color: ;#A9A9A9'
>
(图片无上限)
</span>
</text>
<u-upload
:action=
"action"
:file-list=
"fileList"
@
on-remove=
"onRemove1"
:custom-btn=
"true"
v-if=
'addMsg.FileType==1'
@
on-success=
"uploadSuccessHandler"
>
<view
slot=
"addBtn"
class=
"slot-btn"
>
<u-icon
name=
"photograph"
size=
"40"
color=
"#888"
></u-icon>
<view
class=
"mian-title"
>
上传图片
</view>
</view>
</u-upload>
<!-- 音频 -->
<view
class=
"audio"
v-if=
'addMsg.FileType==3'
>
<view
class=
"audio-o"
@
click=
"statraudio()"
>
<image
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/Sound2.png"
mode=
"widthFix"
style=
"width: 20px;height: auto;"
></image>
<text
style=
"margin-left: 10px;"
>
语音录制
</text>
<text
style=
"color: #BBBBBB;"
>
(点击进入录制页面)
</text>
</view>
</view>
<view
class=
"option-box"
@
click=
"getAddress()"
style=
"margin-top: 10px;"
>
<view
class=
"ob-l"
>
<image
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/Lockation.png"
mode=
"widthFix"
style=
"width: 15px;height: auto;"
></image>
<text
style=
"margin-left: 5px;"
>
所在位置
</text>
</view>
<view
class=
"ob-r"
>
<view
style=
"white-space: nowrap;text-overflow: ellipsis;overflow: hidden;width: 400rpx;text-align: right;"
>
{{
addMsg
.
Address
}}
</view>
<u-icon
name=
"arrow"
:size=
"32"
color=
"#B7B7B7"
></u-icon>
</view>
</view>
<view
class=
"option-box"
@
click=
"whoshow=true"
>
<view
class=
"ob-l"
>
<image
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/Users.png"
mode=
"widthFix"
style=
"width: 15px;height: auto;"
></image>
<text
style=
"margin-left: 5px;"
>
谁可以看
</text>
</view>
<view
class=
"ob-r"
>
<text>
{{
addMsg
.
IsOpen
==
1
?
'全部可见'
:
'关注可见'
}}
</text>
<u-icon
name=
"arrow"
:size=
"32"
color=
"#B7B7B7"
></u-icon>
</view>
</view>
<view
class=
"releasebtn"
@
click=
"publish"
>
发布
</view>
</view>
<u-popup
v-model=
"whoshow"
mode=
"center"
length=
"70%"
border-radius=
"14"
>
<view
style=
"width: 100%;background: #FFF;border-radius: 6px;
padding: 20px;"
>
<u-radio-group
v-model=
"addMsg.IsOpen"
:active-color=
'mainColor'
@
change=
'whoshow=false'
>
<u-radio
shape=
"circle"
style=
'width: 100%;margin: 5px 0;'
v-for=
"(item, index) in list"
:key=
"index"
:name=
"item.Id"
>
{{
item
.
name
}}
</u-radio>
</u-radio-group>
</view>
</u-popup>
<!-- 音频模块 -->
<u-popup
v-model=
"audioshow"
mode=
"bottom"
>
<view
class=
"as-box"
>
<view
class=
"as-yuyin"
@
longpress=
"onStartRecoder"
@
touchend=
"onEndRecoder"
>
<image
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mic.png"
mode=
"widthFix"
style=
"width: 37px;height: auto;"
></image>
</view>
<text
class=
"now-date"
>
{{
reDate
}}
</text>
<view
class=
"as-btn"
>
<view
class=
"as-btn-item"
@
click=
"audioshow=false"
>
取消
</view>
<view
class=
"as-btn-item"
@
click=
"asupload()"
>
确定
</view>
</view>
</view>
</u-popup>
</view>
</
template
>
<
script
>
import
soundRecording
from
'./components/sound-recording/sound-recording.vue'
const
recorderManager
=
uni
.
getRecorderManager
();
const
innerAudioContext
=
uni
.
createInnerAudioContext
();
export
default
{
components
:
{
soundRecording
},
data
()
{
return
{
whoshow
:
false
,
audioshow
:
false
,
pageTitle
:
"发布"
,
mainColor
:
""
,
secondary
:
''
,
pricecolor
:
''
,
addMsg
:
{
Content
:
''
,
LatAndLong
:
''
,
//经纬度可为空
Address
:
''
,
//地址
IsOpen
:
1
,
//1-是,2-关注可见
FileList
:
[],
FileType
:
0
,
},
fileList
:[],
list
:
[{
'name'
:
'全部可见'
,
Id
:
1
},
{
'name'
:
'关注可见'
,
Id
:
2
},
],
action
:
this
.
host2
+
"/api/File/UploadTencent"
,
reDate
:
'00:00'
,
timer
:
null
,
sec
:
0
,
min
:
0
,
voicePath
:
''
}
},
onLoad
(
options
)
{
if
(
options
&&
options
.
type
)
{
this
.
addMsg
.
FileType
=
options
.
type
}
this
.
mainColor
=
this
.
$uiConfig
.
mainColor
;
this
.
secondary
=
this
.
$uiConfig
.
secondary
;
this
.
pricecolor
=
this
.
$uiConfig
.
pricecolor
;
uni
.
setNavigationBarTitle
({
title
:
this
.
pageTitle
,
});
let
MallBaseId
=
uni
.
getStorageSync
(
"mall_UserInfo"
).
MallBaseId
?
uni
.
getStorageSync
(
"mall_UserInfo"
).
MallBaseId
:
1
;
this
.
action
=
this
.
host2
+
'/api/File/UploadTencent?MallBaseId='
+
MallBaseId
},
created
()
{
// 监听
this
.
onMonitorEvents
()
},
methods
:
{
publish
()
{
//发布
if
(
this
.
addMsg
.
FileType
==
0
&&
this
.
addMsg
.
Content
==
''
)
{
uni
.
showToast
({
title
:
'请输入此刻想法...'
,
icon
:
'none'
,
duration
:
2000
});
return
}
uni
.
showLoading
({
title
:
'发布中...'
})
console
.
log
(
this
.
addMsg
)
// this.request2({
// url: '/api/AppletEducation/PublishDynamic',
// data: this.addMsg
// },
// res => {
// uni.hideLoading()
// if (res.resultCode == 1) {
// uni.showToast({
// title: res.message,
// position: 'bottom',
// icon: 'none',
// duration: 2000
// });
// let pages = getCurrentPages(); // 当前页面
// let beforePage = pages[pages.length - 2]; // 前一个页面
// setTimeout(() => {
// uni.navigateBack({
// success: function() {
// beforePage.$vm.init(); // 执行前一个页面的created方法
// }
// });
// }, 1000)
// }
// }
// );
},
getAddress
()
{
let
that
=
this
;
uni
.
chooseLocation
({
success
:
function
(
res
)
{
that
.
addMsg
.
Address
=
res
.
name
;
that
.
addMsg
.
LatAndLong
=
res
.
longitude
+
','
+
res
.
latitude
;
},
fail
:
function
(
err
)
{
that
.
fetchAgainLocation
()
}
});
},
uploadSuccessHandler
(
data
,
index
,
lists
)
{
console
.
log
(
this
.
addMsg
.
FileList
)
let
r
=
JSON
.
parse
(
data
);
this
.
addMsg
.
FileList
.
push
(
r
.
data
);
console
.
log
(
this
.
addMsg
.
FileList
)
},
onRemove1
(
index
)
{
this
.
addMsg
.
FileList
.
splice
(
index
,
1
);
},
statraudio
(){
this
.
audioshow
=
true
},
fetchAgainLocation
()
{
let
that
=
this
wx
.
getSetting
({
success
:
(
res
)
=>
{
var
statu
=
res
.
authSetting
;
if
(
!
statu
[
'scope.userLocation'
])
{
wx
.
showModal
({
title
:
'是否授权当前位置'
,
content
:
'需要获取您的地理位置,请确认授权,否则地图功能将无法使用'
,
success
:
(
tip
)
=>
{
if
(
tip
.
confirm
)
{
console
.
log
(
tip
)
wx
.
openSetting
({
success
:
(
data
)
=>
{
console
.
log
(
data
)
if
(
data
.
authSetting
[
"scope.userLocation"
]
===
true
)
{
wx
.
showToast
({
title
:
'授权成功'
,
icon
:
'success'
,
duration
:
1000
})
if
(
that
.
latitude
!=
''
&&
that
.
longitude
!=
''
)
{
that
.
getAddress
()
}
else
{
that
.
getAddress
()
}
}
else
{
wx
.
showToast
({
title
:
'授权失败'
,
duration
:
1000
})
}
},
fail
:
(
err
)
=>
{
console
.
log
(
err
)
},
complete
:
()
=>
{}
});
}
}
})
}
},
fail
:
()
=>
{},
complete
:
()
=>
{}
})
},
// 开始录制
onStartRecoder
()
{
recorderManager
.
start
({
duration
:
600000
})
},
// 录制结束
onEndRecoder
()
{
recorderManager
.
stop
()
},
// 监听
onMonitorEvents
(){
// 录制开始
recorderManager
.
onStart
(()
=>
{
uni
.
showLoading
({
title
:
'录制中...'
})
this
.
startDate
()
})
// 录制结束
recorderManager
.
onStop
(({
tempFilePath
})
=>
{
this
.
voicePath
=
tempFilePath
clearInterval
(
this
.
timer
)
uni
.
hideLoading
()
console
.
log
(
tempFilePath
)
})
},
// 录音计时
startDate
()
{
clearInterval
(
this
.
timer
)
this
.
sec
=
0
this
.
min
=
0
this
.
timer
=
setInterval
(()
=>
{
this
.
sec
++
if
(
this
.
sec
>=
60
)
{
this
.
min
++
this
.
sec
=
0
}
this
.
resetDate
()
},
1000
)
},
resetDate
()
{
let
_s
=
this
.
sec
<
10
?
'0'
+
parseInt
(
this
.
sec
)
:
parseInt
(
this
.
sec
)
let
_m
=
this
.
min
<
10
?
'0'
+
this
.
min
:
this
.
min
this
.
reDate
=
_m
+
':'
+
_s
},
asupload
(){
console
.
log
(
2
)
let
that
=
this
uni
.
uploadFile
({
url
:
that
.
action
,
filePath
:
that
.
voicePath
,
name
:
'file'
,
formData
:
{
user
:
'tesdt'
},
success
:
(
uploadFileRes
)
=>
{
if
(
uploadFileRes
.
statusCode
==
200
)
console
.
log
(
uploadFileRes
);
},
fail
:
function
(
res
)
{
console
.
log
(
res
)
}
});
}
}
}
</
script
>
pages/goods/goods.vue
View file @
ea46b111
...
...
@@ -111,7 +111,7 @@
<view
class=
"sku-box u-skeleton-rect"
style=
"margin: 0;padding: 10px;"
v-if=
"g.friendUrl!=null && g.friendUrl!=''"
@
click=
"goCoiling(g.friendUrl)"
>
<image
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/goodsCoiling.png"
style=
"width: 100%;height: 68px;"
/>
</view>
<view
class=
"sku-box u-skeleton-rect"
style=
"align-items: flex-start;"
>
<view
class=
"sku-box u-skeleton-rect"
style=
"align-items: flex-start;"
v-if=
"(g.goods_marketing_award.integral.title != '')|| (g.goods_marketing_award.PresentFXGradeMsg != '')|| g.freeShippingName != null && g.freeShippingName != '' && (g.fullMoneyPinkage > 0 || g.fullNumPinkage > 0)"
>
<view
class=
"label"
style=
"margin-top: 5px;"
>
活动
</view>
<view
class=
"content"
style=
"display: flex;flex-direction: column"
>
<view
...
...
pages/index/index.vue
View file @
ea46b111
...
...
@@ -18,7 +18,7 @@
<u-icon
name=
"arrow-left"
size=
"44"
></u-icon>
</view>
</view>
<!--
<view
@
click=
'yj'
style=
"width: 200px;height: 50px;"
>
意见调查
</view>
-->
<!--
<view
@
click=
'yj'
style=
"width: 200px;height: 50px;"
>
发布
</view>
-->
<u-tabs
v-if=
"myPageData.home_pages && myPageData.home_pages.navs.length > 1"
name=
"name"
:list=
"myPageData.home_pages.navs"
:is-scroll=
"true"
:active-color=
"mainColor"
:current=
"active"
:bar-width=
"80"
:font-size=
"32"
:bold=
"false"
@
change=
"changeHandler"
></u-tabs>
<template
v-for=
"(item, i) in myPageData.home_pages.navs"
>
...
...
@@ -1118,7 +1118,7 @@
},
yj
(){
uni
.
navigateTo
({
url
:
'/pages/
school/investigation?ID=4'
//6未开始 9已填 10 //活动结束 //4未填写
url
:
'/pages/
friendcircle/release'
})
}
},
...
...
pages/school/investigation.vue
View file @
ea46b111
<
template
>
<view
class=
'investigation'
>
<view
class=
"investiga-box"
v-if=
'loading==true'
>
<!-- 活动还没开始 -->
<template
v-if=
"surveyData.isEnd==0"
>
...
...
@@ -165,6 +166,22 @@
</
template
>
</view>
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
@
gbAuth=
"gbAuth"
></auth>
<
template
v-if=
"loading==false && oneshow==true"
>
<view
class=
"fulfil"
>
<image
mode=
'widthFix'
style=
"width: 100px;margin: 50px 0;"
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/huodongweikaishi.png"
></image>
</view>
<view
class=
"fulfil-text"
>
亲您来早了 活动还未开始
</view>
<view
class=
"btn"
>
<view
class=
"btntext"
:style=
"
{'background':mainColor}" @click="goindex()">
返回首页
</view>
</view>
</
template
>
</view>
</template>
...
...
@@ -183,6 +200,7 @@
mainColor
:
""
,
usershow
:
true
,
showAuth
:
false
,
oneshow
:
false
,
mall_UserInfo
:{}
}
},
...
...
@@ -201,7 +219,7 @@
},
methods
:{
init
(){
console
.
log
(
this
.
ID
)
this
.
oneshow
=
true
;
//判断留一下
this
.
request2
({
url
:
'/api/AppletEducation/GetSurveyShowList'
,
data
:
{
ActivitySurveyId
:
this
.
ID
}
...
...
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