Commit 6cc1d54f authored by yuwenwen's avatar yuwenwen

移动端问题修改

parent cd3c81fd
......@@ -13,11 +13,16 @@
</view>
<view class="dynamic-content-box">
<view class="text">{{form.content}}</view>
<view class="imgs" v-if="form.attachments && form.attachments.length > 0">
<view class="imgs" v-if="form.type=='IMAGE'&&form.attachments && form.attachments.length > 0">
<template v-for="(item,index) in form.attachments">
<image class="item" :src="item.url"></image>
</template>
</view>
<view class="imgs" v-if="form.type=='VIDEO'&&form.attachments && form.attachments.length > 0">
<template v-for="(item,index) in form.attachments">
<video class="item" :src="item.url"></video>
</template>
</view>
</view>
<view class="datetime-box">{{form.createTime}}</view>
<view class="operation-box">
......@@ -164,7 +169,7 @@
},
toDynamicDetailPage() {
let pathName = window.location.pathname
if(pathName == '/pages/dynamic-detail/dynamic-detail'){
if(pathName.indexOf('/pages/dynamic-detail/dynamic-detail') > -1){
return;
}
uni.navigateTo({
......
......@@ -150,7 +150,7 @@
const extension = '.' + newlist[0].url.split('.').pop().toLowerCase();
_this.isVideo = videoExtensions.includes(extension);
} else {
_this.isVideo = false
_this.isVideo = false;
}
if (newlist && newlist.length > 0) {
const imgExtensions = ['.png', '.jpg', '.jpeg', '.PNG', '.JPG', '.JPEG', '.svg'];
......@@ -161,6 +161,7 @@
}
_this.fileList = newlist;
this.limiData = this.limit - newlist.length
_this.$emit('componentsType', _this.isVideo ? 'VIDEO':'IMAGE')
},
immediate: true
}
......
......@@ -7,41 +7,46 @@
<scroll-view class="scroll-view-index" scroll-y :show-scrollbar="false" @scrolltolower="loadMore">
<template v-for="(item,index) in list">
<dynamic-item :form="item" @refresh="getList" ></dynamic-item>
<dynamic-item :form="item" @refresh="getList"></dynamic-item>
</template>
</scroll-view>
<!-- 发布按钮 -->
<view class="add-dynamic-box" @click="toPublishPage">
<movable-area class="movable-area">
<movable-view class="add-dynamic-box move-button" :x="area.x" :y="area.y" direction="all" @change="onChange"
damping="30" @click="toPublishPage">
<image class="icon" src="/static/images/publish-icon.png"></image>
</view>
</movable-view>
</movable-area>
</view>
</template>
<script>
import DynamicItem from '@/components/Dynamic-Item.vue'
import {dynamicList} from '@/api/api.js'
import {
dynamicList
} from '@/api/api.js'
export default {
data() {
return {
list: [],
queryParams:{
pageNum:1,
pageSize:10
queryParams: {
pageNum: 1,
pageSize: 10
},
total:0,
total: 0,
area: {
x: 330,
y: 600
}
}
},
components:{
components: {
DynamicItem
},
onLoad() {
this.getList()
let _this = this;
uni.$on('hanldeDynamicRefresh',function(){
uni.$on('hanldeDynamicRefresh', function() {
_this.getList()
})
},
......@@ -49,8 +54,8 @@
uni.$off('hanldeDynamicRefresh')
},
methods: {
getList(){
dynamicList(this.queryParams).then(res=>{
getList() {
dynamicList(this.queryParams).then(res => {
console.log(res)
this.list = res.rows
})
......@@ -58,15 +63,19 @@
loadMore() {
},
toPublishPage(){
toPublishPage() {
uni.navigateTo({
url:'/pages/publish/publish'
url: '/pages/publish/publish'
})
},
toPKDetailPage(){
toPKDetailPage() {
uni.navigateTo({
url:'/pages/pk-detail/pk-detail'
url: '/pages/pk-detail/pk-detail'
})
},
onChange(e) {
this.area.y = e.detail.y;
this.area.x = e.detail.x
}
}
}
......@@ -74,4 +83,23 @@
<style lang="scss" scoped>
@import '@/static/styles/index.scss';
.movable-area {
position: fixed;
height: 100%;
width: 100%;
z-index: 999;
pointer-events: none;
left: 0;
top: 0;
.move-button {
pointer-events: auto;
display: flex;
justify-content: center;
align-items: center;
pointer-events: auto;
border-radius: 50%;
}
}
</style>
\ No newline at end of file
......@@ -8,7 +8,7 @@
<view class="publish-box">
<textarea class="textarea" v-model="form.content" placeholder="分享有趣事~"
placeholder-class="placeholder-class" />
<image-upload v-model="form.attachments" :limit="9" :showIcons="true" @handleTopic="handleOpenTopicSelection"></image-upload>
<image-upload v-model="form.attachments" :limit="9" :showIcons="true" @componentsType="handleSetComponentsType" @handleTopic="handleOpenTopicSelection"></image-upload>
</view>
<view class="permission-box">
<view class="item">
......@@ -123,7 +123,7 @@
topicList: [],
form: {
content: '',
type: 'IMAGE',
type: 'TEXT',
topicNames: [],
topicIds: [],
linkUrl: '',
......@@ -165,6 +165,13 @@
console.log(e)
this.form.voteOptionType = e.detail.value
},
handleSetComponentsType(type){
if(type && this.form.attachments.length > 0){
this.form.type = type
}else{
this.form.type = 'TEXT'
}
},
// 发布动态
handleSubmit(){
if(this.topicList.length > 0){
......
......@@ -269,9 +269,9 @@
display: flex;
align-items: center;
justify-content: center;
position: fixed;
right: 34rpx;
top: 700rpx;
// position: fixed;
// right: 34rpx;
// top: 700rpx;
.icon{
width: 44rpx;
height: 44rpx;
......
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