Browse Source

上传

master
前端-胡立永 4 months ago
parent
commit
e4cd96fca4
17 changed files with 466 additions and 47 deletions
  1. +4
    -0
      common.scss
  2. +16
    -1
      components/base/navbar.vue
  3. +266
    -0
      components/list/activity/activityItem.vue
  4. +10
    -2
      components/list/dynamic/dynamicItem.vue
  5. +10
    -2
      components/list/dynamic/dynamicItemEdit.vue
  6. +9
    -1
      pages/index/activity.vue
  7. +0
    -5
      pages/index/center.vue
  8. +0
    -5
      pages/index/index.vue
  9. +4
    -8
      pages_order/activity/activityDetail.vue
  10. +33
    -0
      pages_order/components/list/comment/commentItem.vue
  11. +80
    -10
      pages_order/components/list/comment/commentList.vue
  12. +6
    -0
      pages_order/gourmet/gourmetDetail.vue
  13. +5
    -4
      pages_order/post/addPost.vue
  14. +6
    -0
      pages_order/post/postDetail.vue
  15. +7
    -1
      pages_order/renting/rentingDetail.vue
  16. +4
    -8
      pages_order/scenicSpot/scenicSpotDetail.vue
  17. +6
    -0
      pages_order/work/workDetail.vue

+ 4
- 0
common.scss View File

@ -37,4 +37,8 @@
margin: 0;
width: 0;
height: 0;
}
.uv-textarea{
min-height: 400rpx;
}

+ 16
- 1
components/base/navbar.vue View File

@ -4,8 +4,14 @@
<view class="title"
:style="{backgroundColor : bgColor}">
<view class="left">
<uv-icon name="home"
v-if="leftClick && length == 1"
@click="toHome"
color="#333" size="46rpx"></uv-icon>
<uv-icon name="arrow-left"
v-if="leftClick"
v-else-if="leftClick"
@click="$emit('leftClick')"
color="#333" size="46rpx"></uv-icon>
</view>
@ -72,9 +78,18 @@
},
data() {
return {
length : getCurrentPages().length
};
},
methods : {
toHome(){
if(this.length != 1){
return
}
uni.reLaunch({
url: '/pages/index/index'
})
}
}
}
</script>


+ 266
- 0
components/list/activity/activityItem.vue View File

@ -0,0 +1,266 @@
<template>
<view class="works" @click="$emit('click')">
<view class="box"
:style="{'--sexcolor' : sex[item.sex].color}">
<view class="headPortraitimg">
<image :src="item.userImage"
@click.stop="previewImage([item.userImage])"
mode="aspectFill"></image>
</view>
<view class="YaoduUniversalWall">
<view class="heide">
<view class="username text-ellipsis">
{{ item.userName }}
</view>
<view class="inde"
v-if="item.sex">
<!-- 性别 -->
{{ item.sex }}
</view>
<view class="inde"
v-if="item.yearDate">
<!-- 年份 -->
{{ item.yearDate }}
</view>
<view class="inde"
v-if="item.addId">
<!-- 地址 -->
{{ item.addId }}
</view>
<view class="authentication"
v-if="item.isContent">
<!-- 个人认证 -->
{{ item.isContent }}
</view>
</view>
<view class="Times">
<view class="TimeMonth">
<!-- 10-08 -->
{{ item.createTime }}发布
</view>
<!-- <view class="Month">
12:34
</view> -->
</view>
</view>
</view>
<view class="dynamics" v-html="$utils.stringFormatHtml(item.title)">
</view>
<view class="address"
v-if="item.address">
<uv-icon size="30rpx" name="map"></uv-icon>
<view class="text-ellipsis">
{{ item.address }}
</view>
</view>
<view class="Artworkimages">
<view class="wrokimg"
@click.stop="previewImage(images, i)"
:key="i" v-for="(img, i) in images">
<image :src="img" mode="aspectFill"></image>
</view>
</view>
<view class="bottom">
<view class="browse">
{{ item.isBrowse }}浏览
</view>
<view class="browse">
{{ item.isComment }}条评论
</view>
<view class="phone"
v-if="item.phone"
@click.stop="callPhone">
<image src="/static/image/home/phone.png" mode=""></image>
联系{{ ta[item.sex] }}
</view>
</view>
</view>
</template>
<script>
import mixinsSex from '@/mixins/sex.js'
export default {
mixins: [mixinsSex],
props: {
item: {},
},
data() {
return {
}
},
computed : {
images(){
if(!this.item.image){
return []
}
return this.item.image.split(',')
}
},
methods: {
callPhone(){
uni.makePhoneCall({
phoneNumber: this.item.phone,
success() {
console.log('安卓拨打成功');
},
fail() {
console.log('安卓拨打失败');
}
})
},
},
}
</script>
<style scoped lang="scss">
.works {
margin: 40rpx 20rpx;
background-color: #fff;
padding: 40rpx;
border-radius: 20rpx;
box-shadow: 0 0 6rpx 6rpx #00000011;
.box {
display: flex;
align-items: center;
.headPortraitimg {
width: 100rpx;
height: 100rpx;
border-radius: 15rpx;
overflow: hidden;
image{
width: 100%;
height: 100%;
}
}
.YaoduUniversalWall {
padding: 0rpx 10rpx;
.username {
max-width: 200rpx;
}
.heide {
display: flex;
justify-content: center;
align-items: center;
}
.inde {
display: flex;
justify-content: center;
align-items: center;
padding: 0rpx 10rpx;
margin: 0rpx 5rpx;
font-size: 20rpx;
height: 30rpx;
color: white;
// background-color: rgb(124, 136, 242);
background-color: var(--sexcolor);
border-radius: 7rpx;
flex-shrink: 0;
}
.authentication {
display: flex;
justify-content: center;
align-items: center;
padding: 0rpx 10rpx;
margin: 0rpx 5rpx;
font-size: 20rpx;
height: 34rpx;
padding: 0rpx 10rpx;
color: white;
background-color: #ffd036;
border-radius: 7rpx;
flex-shrink: 0;
}
.Times {
display: flex;
padding: 5rpx 0rpx;
font-size: 20rpx;
margin-top: 10rpx;
.Month {
margin: 0rpx 15rpx;
}
}
}
}
.personalInformation {
display: flex;
.inde {
font-size: 25rpx;
padding: 0rpx 8rpx;
}
.authentication {
font-size: 25rpx;
}
}
.dynamics {
margin-top: 20rpx;
font-size: 28rpx;
// font-weight: bold;
// line-height: 35rpx;
letter-spacing: 3rpx;
}
.address{
font-size: 24rpx;
margin-top: 20rpx;
display: flex;
align-items: center;
}
.Artworkimages {
display: flex;
flex-wrap: wrap;
.wrokimg {
margin: 10rpx;
image {
height: 190rpx;
width: 190rpx;
border-radius: 20rpx;
}
}
}
.bottom {
display: flex;
margin-top: 20rpx;
font-size: 24rpx;
.browse {
margin: 0rpx 30rpx;
color: rgb(132, 132, 132);
}
.phone{
background-color: rgba($uni-color, 0.2);
color: $uni-color;
padding: 8rpx 16rpx;
border-radius: 10rpx;
margin-left: auto;
image{
width: 20rpx;
height: 20rpx;
}
}
}
}
</style>

+ 10
- 2
components/list/dynamic/dynamicItem.vue View File

@ -60,8 +60,8 @@
<view class="Artworkimages">
<view class="wrokimg"
@click.stop="previewImage(item.image, i)"
:key="i" v-for="(img, i) in item.image">
@click.stop="previewImage(images, i)"
:key="i" v-for="(img, i) in images">
<image :src="img" mode="aspectFill"></image>
</view>
</view>
@ -93,6 +93,14 @@
return {
}
},
computed : {
images(){
if(!this.item.image){
return []
}
return this.item.image.split(',')
}
},
methods: {
callPhone(){
uni.makePhoneCall({


+ 10
- 2
components/list/dynamic/dynamicItemEdit.vue View File

@ -47,8 +47,8 @@
</view>
<view class="Artworkimages">
<view class="wrokimg"
@click.stop="previewImage(item.image, i)"
:key="i" v-for="(img, i) in item.image">
@click.stop="previewImage(images, i)"
:key="i" v-for="(img, i) in images">
<image :src="img" mode="aspectFill"></image>
</view>
</view>
@ -73,6 +73,14 @@
}
},
computed : {
images(){
if(!this.item.image){
return []
}
return this.item.image.split(',')
}
},
methods: {
},
}


+ 9
- 1
pages/index/activity.vue View File

@ -5,6 +5,12 @@
<view class="activityList">
<activityList :list="list"/>
<!-- <dynamicItem
:key="index"
v-for="(item, index) in list"
:item="item"
@click="$utils.navigateTo('/pages_order/post/postDetail?id=' + item.id)"
/> -->
</view>
<tabber select="1" />
@ -14,12 +20,14 @@
<script>
import tabber from '@/components/base/tabbar.vue'
import activityList from '@/components/list/activityList.vue'
import activityItem from '@/components/list/activity/activityItem.vue'
import mixinsList from '@/mixins/list.js'
export default {
mixins : [mixinsList],
components : {
tabber,
activityList
activityList,
activityItem,
},
data() {
return {


+ 0
- 5
pages/index/center.vue View File

@ -166,11 +166,6 @@
click({index}) {
this.type = index
},
getDataThen(list){
list.forEach(n => {
n.image = n.image ? n.image.split(',') : []
})
},
delDynamic(postId){
let self = this
uni.showModal({


+ 0
- 5
pages/index/index.vue View File

@ -240,11 +240,6 @@
}
})
},
getDataThen(list){
list.forEach(n => {
n.image = n.image ? n.image.split(',') : []
})
},
join(){
if(!uni.getStorageSync('token')){
uni.navigateTo({


+ 4
- 8
pages_order/activity/activityDetail.vue View File

@ -70,14 +70,10 @@
this.getData()
},
onShareAppMessage(res) {
// if (res.from === 'button') {//
// console.log(res.target)
// }
return {
title: this.item.title,
desc: this.item.content && this.item.content.slice(0, 30),
path: '/pages/publish/postDetail?id=' + this.id
}
return {
title: this.detail.title,
path: '/pages_order/activity/activityDetail?id=' + this.id
}
},
methods: {
getData() {


+ 33
- 0
pages_order/components/list/comment/commentItem.vue View File

@ -20,8 +20,17 @@
</view>
</view>
</view>
<view class="dynamics" v-html="$utils.stringFormatHtml(item.userValue)">
</view>
<view class="images">
<view class="image"
@click.stop="previewImage(images, i)"
:key="i" v-for="(img, i) in images">
<image :src="img" mode="aspectFill"></image>
</view>
</view>
</view>
</template>
@ -33,6 +42,14 @@
}
},
computed : {
images(){
if(!this.item.userImage){
return []
}
return this.item.userImage.split(',')
}
},
methods: {
}
@ -77,6 +94,22 @@
margin-left: 100rpx;
font-size: 28rpx;
letter-spacing: 3rpx;
word-break: break-all;
}
.images {
display: flex;
flex-wrap: wrap;
margin-top: 20rpx;
margin-left: 100rpx;
.image {
margin: 10rpx;
image {
height: 120rpx;
width: 120rpx;
border-radius: 20rpx;
}
}
}
}
</style>

+ 80
- 10
pages_order/components/list/comment/commentList.vue View File

@ -1,5 +1,5 @@
<template>
<view>
<view class="commemt">
<view class="comment-list">
<commentItem
v-for="(item,index) in list"
@ -9,21 +9,59 @@
<view class="submit-box">
<view class="top">
<uv-icon
color="#00cf05"
size="50rpx"
name="weixin-fill"></uv-icon>
<button
class="share"
open-type="share">
<uv-icon
color="#00cf05"
size="50rpx"
name="weixin-fill"></uv-icon>
</button>
<input type="text"
disabled
@click="$refs.popup.open('bottom')"
:placeholder="'评论给' + params.name"
v-model="form.userValue"/>
<view class="submit"
<!-- <view class="submit"
@click="submit">
发布
</view>
</view> -->
</view>
</view>
<uv-popup ref="popup" :round="30">
<view class="popup">
<view class="content-input">
<uv-textarea
v-model="form.userValue"
:maxlength="200"
autoHeight
count
focus
:placeholder="'评论给' + params.name"></uv-textarea>
</view>
<view class="images box">
<uv-upload
:fileList="fileList"
:maxCount="imageMax"
multiple
width="150rpx"
height="150rpx"
@delete="deleteImage"
@afterRead="afterRead"
:previewFullImage="true"></uv-upload>
</view>
<view class="uni-color-btn"
@click="submit">
发布
</view>
</view>
</uv-popup>
</view>
</template>
@ -37,6 +75,8 @@
data() {
return {
form : {},
imageMax : 9,
fileList : [],
}
},
methods: {
@ -55,13 +95,12 @@
return
}
// this.form.image = this.fileList.map((item) => item.url).join(",")
// this.form.orderId = this.params.orderId
// this.form.type = this.params.type
data.userImage = this.fileList.map((item) => item.url).join(",")
this.$api('addComment', data, res => {
if(res.code == 200){
this.$refs.popup.close()
this.form.userValue = ''
uni.showToast({
title: '发布成功!',
@ -71,11 +110,28 @@
}
})
},
deleteImage(e){
this.fileList.splice(e.index, 1)
},
afterRead(e){
let self = this
e.file.forEach(file => {
self.$Oss.ossUpload(file.url).then(url => {
self.fileList.push({
url
})
})
})
},
}
}
</script>
<style scoped lang="scss">
.commemt{
padding-bottom: env(safe-area-inset-bottom);
}
.comment-list {
margin-top: 20rpx;
padding-bottom: 150rpx;
@ -108,4 +164,18 @@
.submit {}
}
}
.popup{
.content-input{
min-height: 400rpx;
}
.box{
padding: 0 20rpx;
}
.images{
display: flex;
flex-wrap: wrap;
padding: 20rpx;
}
}
</style>

+ 6
- 0
pages_order/gourmet/gourmetDetail.vue View File

@ -108,6 +108,12 @@
this.params.orderId = options.id
},
onShareAppMessage(res) {
return {
title: this.detail.title,
path: '/pages_order/gourmet/gourmetDetail?id=' + this.id
}
},
onPullDownRefresh() {
this.getDetail()
},


+ 5
- 4
pages_order/post/addPost.vue View File

@ -264,12 +264,13 @@
this.form.latitude = res.latitude
this.form.longitude = res.longitude
if (!res.address && res.name) { //
if (res.name) { //
// if (!res.address && res.name) { //
return this.form.address = res.name
}
if (res.address || res.name) {
return this.form.address = res.address + res.name
}
// if (res.address || res.name) {
// return this.form.address = res.address + res.name
// }
this.form.address = '' //
this.form.latitude = ''
this.form.longitude = ''


+ 6
- 0
pages_order/post/postDetail.vue View File

@ -126,6 +126,12 @@
this.params.orderId = options.id
},
onShareAppMessage(res) {
return {
title: this.detail.title,
path: '/pages_order/post/postDetail?id=' + this.id
}
},
onPullDownRefresh() {
this.getDetail()
},


+ 7
- 1
pages_order/renting/rentingDetail.vue View File

@ -22,7 +22,7 @@
</view>
<view
style="padding: 36rpx; background: #FFF; position: absolute; z-index: 1; width: calc(100vw - 72rpx); min-height: 780rpx; border-radius: 20rpx 20rpx 20rpx 20rpx;margin-top: -20rpx;">
style="padding: 36rpx; background: #FFF;">
<view class="t0">{{ detail.money }}/</view>
<view class="t1">{{ detail.title }} {{ detail.home }}</view>
@ -158,6 +158,12 @@
this.params.orderId = options.id
},
onShareAppMessage(res) {
return {
title: this.detail.title,
path: '/pages_order/renting/rentingDetail?id=' + this.id
}
},
onPullDownRefresh() {
this.getDetail()
},


+ 4
- 8
pages_order/scenicSpot/scenicSpotDetail.vue View File

@ -81,14 +81,10 @@
this.getDetail()
},
onShareAppMessage(res) {
// if (res.from === 'button') {//
// console.log(res.target)
// }
// return {
// title: this.item.title,
// desc: this.item.content && this.item.content.slice(0, 30),
// path: '/pages/publish/postDetail?id=' + this.id
// }
return {
title: this.detail.name,
path: '/pages_order/scenicSpot/scenicSpotDetail?id=' + this.id
}
},
methods: {
getDetail() {


+ 6
- 0
pages_order/work/workDetail.vue View File

@ -135,6 +135,12 @@
onShow() {
this.getDetail()
},
onShareAppMessage(res) {
return {
title: this.detail.title,
path: '/pages_order/work/workDetail?id=' + this.id
}
},
methods: {
getDetail(){
let data = {


Loading…
Cancel
Save