Commit ea46b111 authored by Mac's avatar Mac

提交

parent 33bc6118
......@@ -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;
}
......
<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>
<template>
</template>
<script>
</script>
<style>
</style>
<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>
<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>
This diff is collapsed.
......@@ -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
......
......@@ -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'
})
}
},
......
<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}
......
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