Commit 0b2dd4d9 by honghong

对接用户需求列表,详情,意见反馈,动态列表和详情,用户评论列表和添加用户评论接口

parent 40d1a790
import {
ApiHttp
} from '@/utils/request.js'
// 新增用户反馈
const addUserFeedback = (params) => {
return ApiHttp('/xinrenli/userFeedback', params, 'POST')
}
// 查询优惠卷列表
const couponListGet = (params) =>{
return ApiHttp('/xinrenli/coupon/list',params,'GET')
}
export {
addUserFeedback,
couponListGet
}
\ No newline at end of file
import {
ApiHttp
} from '@/utils/request.js'
//查询文章列表
const userArticleGet = (params) => {
return ApiHttp('/xinrenli/article/list',params,'GET')
}
// 获取文章详细信息
const articleDetail = (params) => {
return ApiHttp(`/xinrenli/article/${params}`,'GET')
}
// 查询用户评论列表
const userEvaluateGet = (params) => {
return ApiHttp('/xinrenli/userComment/list',params,'GET')
}
// 新增用户评论
const addUserEvaluate = (params) => {
return ApiHttp('/xinrenli/userComment',params,'POST')
}
export {
userArticleGet,
articleDetail,
userEvaluateGet,
addUserEvaluate
}
\ No newline at end of file
import {
ApiHttp
} from '@/utils/request.js'
//用户需求广场
const userNeedSquare = (params) => {
return ApiHttp('/xinrenli/order/userDemandSquare',params,'GET')
}
// 获取订单详细信息
const orderDetailMsg = (params) => {
return ApiHttp('/xinrenli/article',params,'GET')
}
export {
userNeedSquare,
orderDetailMsg
}
\ No newline at end of file
<template> <template>
<view> <view>
<view class="d-flex margin-top-two" v-for="(item,index) in personEvalList"> <view class="d-flex margin-top-two" v-for="(item,index) in personEvalList">
<img class="avatar-img" :src="item.avatar" alt=""> <img class="avatar-img" :src="item.userHead" alt="">
<view class="flex-1 margin-left-one"> <view class="flex-1 margin-left-one">
<view class="d-flex a-center j-sb"> <view class="d-flex a-center j-sb">
<view class="nickname">{{item.nickname}}</view> <view class="nickname">{{item.createUser ? item.createUser : ''}}</view>
<view class="font">{{item.date}}</view> <view class="font">{{item.createTime | formatDate}}</view>
</view> </view>
<view class="evaluateText">{{item.content}}</view> <view class="evaluateText">{{item.content}}</view>
</view> </view>
......
...@@ -3,27 +3,29 @@ ...@@ -3,27 +3,29 @@
<!-- 评价 --> <!-- 评价 -->
<view class="evaluate"> <view class="evaluate">
<view class="evaluateCenter"> <view class="evaluateCenter">
<view class="evaluateItem" v-for="(item, index) in list" :key="index"> <view class="evaluateItem" v-for="(item, index) in list" :key="index" @click="handleLookId(item)">
<view class="evaluateTip d-flex a-center j-sb"> <view class="evaluateTip d-flex j-sb a-center">
<view class="d-flex a-center"> <view class="d-flex a-center">
<image class="img" :src="item.image" mode="widthFix"></image> <image class="img" src="../static/logoLogin.png" mode="widthFix"></image>
<view class="evaluate-name">{{ item.name}}</view> <view class="evaluate-name">{{ item.createUser}}</view>
</view> </view>
<view class="font">{{item.createTime | formatDate}}</view>
<view class="font">{{item.time}}</view>
</view> </view>
<view class="evaluate-title">这是文章标题!</view> <view class="evaluate-title">{{item.title}}</view>
<view class="evaluateText" :class="{lineclamp2:item.contentAll}"> {{item.content}} </view> <view class="evaluateText" :class="{lineclamp2:item.contentAll}"> {{item.content}} </view>
<!-- <view class="" v-if="item.isMore"> <!-- <view class="" v-if="item.isMore">
<view class="rightText" v-if="item.contentAll" @click="changeAllFun(item, index)">全部</view> <view class="rightText" v-if="item.contentAll" @click="changeAllFun(item, index)">全部</view>
<view class="rightText" v-else @click="changeAllFun(item, index)">收起</view> <view class="rightText" v-else @click="changeAllFun(item, index)">收起</view>
</view> --> </view> -->
<view class="evaluateListImg"> <view class="evaluateListImg">
<view class="evaluateListImgItem" v-for="(itm, ind) in item.imageList" :key="ind" <view class="evaluateListImgItem" v-for="(itm, ind) in item.fileVos" :key="ind"
@click.stop="handlePreview(index,ind)"> @click.stop="handlePreview(index,ind)">
<image :src="itm.url" mode="scaleToFill"></image> <image :src="itm.url" mode="scaleToFill"></image>
</view> </view>
</view> </view>
<view class="margin-top-two">
<comment-list :personEvalList="item.commentVos"></comment-list>
</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -72,17 +74,23 @@ ...@@ -72,17 +74,23 @@
}) })
this.list = list this.list = list
}, },
//点击获取id
handleLookId(data) {
this.$emit('getId', data.id)
},
//图片预览 //图片预览
handlePreview(index, inx) { handlePreview(index, inx) {
console.log(index, inx)
let that = this let that = this
var photoList = that.list[index].imageList.map(item => { // item 获取到的图片地址 var photoList = that.list[index].fileVos.map(item => { // item 获取到的图片地址
return item.url; return item.url;
}); });
uni.previewImage({ console.log(photoList, '第三')
current: inx, // uni.previewImage({
urls: photoList, // current: inx,
loop: true // urls: photoList,
}) // loop: true
// })
} }
} }
...@@ -91,7 +99,7 @@ ...@@ -91,7 +99,7 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.evaluate .evaluateCenter .evaluateItem { .evaluate .evaluateCenter .evaluateItem {
display: inline-block; // display: inline-block;
} }
// 展开收起 // 展开收起
......
// let hostUrl = 'https://baiyingroup.nyinhong.com', // 测试 let hostUrl = 'http://xinrenli.nyinhong.com', // 测试
// // let hostUrl = 'https://baiyin-uat.nyinhong.com', // UAT // let hostUrl = 'http://192.168.0.109:7001', // UAT
// // let hostUrl = 'https://pepsibdp.masterkong.com.cn', // prd // // let hostUrl = 'https://pepsibdp.masterkong.com.cn', // prd
// api = '/api', api = '/api',
// imgApi = '/admimage/';
let hostUrl = '',
api = '',
imgApi = '/admimage/'; imgApi = '/admimage/';
// let hostUrl = '',
// api = '',
// imgApi = '/admimage/';
switch (process.env.UNI_BASE_ENV) { switch (process.env.UNI_BASE_ENV) {
case 'development': case 'development':
hostUrl = process.env.UNI_BASE_URL; hostUrl = process.env.UNI_BASE_URL;
......
<template> <template>
<view class="content"> <view class="content">
<view class="content-textarea"> <view class="content-textarea">
<view class=""> <view class="">
标题 标题
</view> </view>
<view class=""> <view class="">
灯泡坏了 灯泡坏了
</view> </view>
</view> </view>
<view class="content-textarea"> <view class="content-textarea">
<view class=""> <view class="">
成交金额 成交金额
</view> </view>
<view class=""> <view class="">
270 270
</view> </view>
</view> </view>
<view class="content-photograph"> <view class="content-photograph">
<view class=""> <view class="">
图片说明 图片说明
</view> </view>
<view class="content-photograph-photo"> <view class="content-photograph-photo">
<image class="content-photograph-photo-graph" src="../../static/logo.png" mode="" <image class="content-photograph-photo-graph" src="../../static/logo.png" mode=""
v-for="(v ,index) in 5" :key="index"></image> v-for="(v ,index) in 5" :key="index"></image>
</view> </view>
</view> </view>
<view class="content-frequency"> <view class="content-frequency">
<view class=""> <view class="">
视频说明 视频说明
</view> </view>
<view v-for="(v ,index) in 2" :key="index"> <view v-for="(v ,index) in 2" :key="index">
<video id="myVideo" <video id="myVideo"
src="https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/%E7%AC%AC1%E8%AE%B2%EF%BC%88uni-app%E4%BA%A7%E5%93%81%E4%BB%8B%E7%BB%8D%EF%BC%89-%20DCloud%E5%AE%98%E6%96%B9%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%8B@20200317.mp4" src="https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/%E7%AC%AC1%E8%AE%B2%EF%BC%88uni-app%E4%BA%A7%E5%93%81%E4%BB%8B%E7%BB%8D%EF%BC%89-%20DCloud%E5%AE%98%E6%96%B9%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%8B@20200317.mp4"
@error="videoErrorCallback" :danmu-list="danmuList" enable-danmu controls @error="videoErrorCallback" :danmu-list="danmuList" enable-danmu controls
:show-fullscreen-btn='false'></video> :show-fullscreen-btn='false'></video>
</view> </view>
</view> </view>
<view class="content-voice"> <view class="content-voice">
<view class=""> <view class="">
语音说明 语音说明
</view> </view>
<view class="content-voice-audio" @click="doPlay()"> <view class="content-voice-audio" @click="doPlay()">
</view> </view>
</view> </view>
<view class="content-remarks"> <view class="content-remarks">
<view class=""> <view class="">
备注说明 备注说明
</view> </view>
<u--textarea v-model="value1" placeholder="请输入内容" disabled></u--textarea> <u--textarea v-model="value1" placeholder="请输入内容" disabled></u--textarea>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import apiBaseConfig from '@/config/index.js'; import {
export default { orderDetailMsg
data() { } from '../../api/system/index.js'
return { import apiBaseConfig from '@/config/index.js';
imgBgUrl: apiBaseConfig.imgBgUrl, export default {
globalData: getApp().globalData, data() {
scrollTopHeader: 0 return {
}; imgBgUrl: apiBaseConfig.imgBgUrl,
}, globalData: getApp().globalData,
onLoad() { scrollTopHeader: 0
this.timer = null; };
this.innerAudioContext = uni.createInnerAudioContext(); },
// 监听音频进入可以播放状态的事件 onLoad(option) {
this.innerAudioContext.onCanplay(() => { console.log(option.id,'结束')
this.innerAudioContext.duration; this.getDetailData(option.id)
// 延迟大约300ms以上才能获取音频总时长 this.timer = null;
setTimeout(() => { this.innerAudioContext = uni.createInnerAudioContext();
// 获取音频总时长 // 监听音频进入可以播放状态的事件
this.duration = this.formatSeconds(this.innerAudioContext.duration); this.innerAudioContext.onCanplay(() => {
}, 300) this.innerAudioContext.duration;
}); // 延迟大约300ms以上才能获取音频总时长
// 监听音频播放 setTimeout(() => {
this.innerAudioContext.onPlay(() => { // 获取音频总时长
// 获取当前音频的播放时间 this.duration = this.formatSeconds(this.innerAudioContext.duration);
this.timer = setInterval(() => { }, 300)
this.currentTime = this.formatSeconds(this.innerAudioContext.currentTime); });
}, 1000) // 监听音频播放
this.innerAudioContext.onPlay(() => {
}) // 获取当前音频的播放时间
}, this.timer = setInterval(() => {
methods: { this.currentTime = this.formatSeconds(this.innerAudioContext.currentTime);
// 播放 }, 1000)
doPlay() {
if (!this.innerAudioContext.src) { })
// 音频地址 },
this.innerAudioContext.src = methods: {
"https://bjetxgzv.cdn.bspapp.com/VKCEYUGU-hello-uniapp/2cc220e0-c27a-11ea-9dfb-6da8e309e0d8.mp3"; getDetailData(id){
} orderDetailMsg({id:id}).then(res=>{
this.innerAudioContext.play(); console.log(res,'详情')
}, })
// 暂停 },
doPause() { // 播放
this.innerAudioContext.pause(); doPlay() {
// 清除定时器 if (!this.innerAudioContext.src) {
clearInterval(this.timer); // 音频地址
}, this.innerAudioContext.src =
// 将秒转换成03:30格式 "https://bjetxgzv.cdn.bspapp.com/VKCEYUGU-hello-uniapp/2cc220e0-c27a-11ea-9dfb-6da8e309e0d8.mp3";
formatSeconds(value) { }
let minute = parseInt(value / 60); this.innerAudioContext.play();
let second = parseInt(value % 60); },
if (minute < 10) { // 暂停
minute = "0" + minute doPause() {
} this.innerAudioContext.pause();
if (second < 10) { // 清除定时器
second = "0" + second clearInterval(this.timer);
} },
return minute + ":" + second; // 将秒转换成03:30格式
} formatSeconds(value) {
} let minute = parseInt(value / 60);
} let second = parseInt(value % 60);
</script> if (minute < 10) {
minute = "0" + minute
<style lang="scss" scoped> }
.content { if (second < 10) {
padding: 0rpx 40rpx 160rpx; second = "0" + second
}
&-textarea { return minute + ":" + second;
display: flex; }
justify-content: space-between; }
padding: 30rpx 10rpx; }
border-bottom: 1rpx solid #E7E7E7; </script>
>view { <style lang="scss" scoped>
font-size: 26rpx; .content {
font-family: AlibabaPuHuiTi-Regular, AlibabaPuHuiTi; padding: 0rpx 40rpx 160rpx;
font-weight: 400;
color: #333333; &-textarea {
} display: flex;
} justify-content: space-between;
padding: 30rpx 10rpx;
&-photograph { border-bottom: 1rpx solid #E7E7E7;
padding: 30rpx 0rpx;
>view {
&-photo { font-size: 26rpx;
display: flex; font-family: AlibabaPuHuiTi-Regular, AlibabaPuHuiTi;
flex-wrap: wrap; font-weight: 400;
justify-content: flex-start; color: #333333;
}
&-graph { }
margin-top: 20rpx;
margin-right: 20rpx; &-photograph {
width: 210rpx; padding: 30rpx 0rpx;
height: 210rpx;
} &-photo {
display: flex;
&-graph:nth-child(3n) { flex-wrap: wrap;
margin-right: 0rpx; justify-content: flex-start;
}
} &-graph {
margin-top: 20rpx;
} margin-right: 20rpx;
width: 210rpx;
&-frequency { height: 210rpx;
padding: 30rpx 0rpx; }
>view { &-graph:nth-child(3n) {
display: flex; margin-right: 0rpx;
}
>video { }
margin-top: 20rpx;
width: 373rpx; }
height: 210rpx;
} &-frequency {
} padding: 30rpx 0rpx;
}
>view {
&-voice { display: flex;
padding: 30rpx 0rpx;
>video {
&-audio { margin-top: 20rpx;
margin-top: 20rpx; width: 373rpx;
background: #F5F5F5; height: 210rpx;
border-radius: 6rpx; }
height: 68rpx; }
} }
}
&-voice {
&-remarks { padding: 30rpx 0rpx;
>view {
margin-bottom: 20rpx; &-audio {
} margin-top: 20rpx;
} background: #F5F5F5;
} border-radius: 6rpx;
height: 68rpx;
}
}
&-remarks {
>view {
margin-bottom: 20rpx;
}
}
}
</style> </style>
import App from './App' import App from './App'
import store from './store'; import store from './store';
import uView from 'uview-ui'; import uView from 'uview-ui';
Vue.use(uView); Vue.use(uView);
import uniGo from '@/utils/unIGO.js'; import uniGo from '@/utils/unIGO.js';
Vue.prototype.$uniGo = uniGo; Vue.prototype.$uniGo = uniGo;
import utilsMethods from '@/utils/utils.js'; import utilsMethods from '@/utils/utils.js';
Vue.prototype.$utilsMethods = utilsMethods; Vue.prototype.$utilsMethods = utilsMethods;
// 底部导航 // 底部导航
import comTabbar from '@/components/tabbar/tabbar'; import comTabbar from '@/components/tabbar/tabbar';
Vue.component('com-tabbar', comTabbar) Vue.component('com-tabbar', comTabbar)
// 上传 // 上传
import comUpload from '@/components/upload/aIndex.vue'; import comUpload from '@/components/upload/aIndex.vue';
Vue.component('com-upload', comUpload) Vue.component('com-upload', comUpload)
// 头部导航 // 头部导航
import comNavBar from '@/components/navBar/aIndex'; import comNavBar from '@/components/navBar/aIndex';
Vue.component('com-navbar', comNavBar) Vue.component('com-navbar', comNavBar)
//人员评论列表 //人员评论列表
import commentList from '@/components/comment/comment.vue' import commentList from '@/components/comment/comment.vue'
Vue.component('comment-list',commentList) Vue.component('comment-list', commentList)
uni.$u.setConfig({
config: { // 时间过滤器
unit: 'rpx' Vue.filter('formatDate', date => {
}, let newDate = new Date(date);
props: { let year = newDate.getFullYear();
radio: { let month = newDate.getMonth().toString().padStart(2, 0);
size: 15 let day = newDate.getDay().toString().padStart(2, 0);
} return year + '-' + month + '-' + day;
} })
}) uni.$u.setConfig({
config: {
// #ifndef VUE3 unit: 'rpx'
import Vue from 'vue' },
Vue.config.productionTip = false props: {
App.mpType = 'app' radio: {
const app = new Vue({ size: 15
...App, }
store }
}) })
app.$mount()
// #endif // #ifndef VUE3
import Vue from 'vue'
// #ifdef VUE3 Vue.config.productionTip = false
import { App.mpType = 'app'
createSSRApp const app = new Vue({
} from 'vue' ...App,
export function createApp() { store
const app = createSSRApp(App) })
return { app.$mount()
app, // #endif
store
} // #ifdef VUE3
} import {
createSSRApp
} from 'vue'
export function createApp() {
const app = createSSRApp(App)
return {
app,
store
}
}
// #endif // #endif
...@@ -69,13 +69,11 @@ ...@@ -69,13 +69,11 @@
</view> </view>
</template> </template>
<script> <script>
import apiBaseConfig from '@/config/index.js'; import {couponListGet} from '../../api/my/index.js'
export default { export default {
data() { data() {
return { return {
imgBgUrl: apiBaseConfig.imgBgUrl,
globalData: getApp().globalData,
scrollTopHeader: 0, scrollTopHeader: 0,
optionData: {}, optionData: {},
title: '' title: ''
...@@ -85,9 +83,15 @@ ...@@ -85,9 +83,15 @@
let self = this; let self = this;
self.optionData = option; self.optionData = option;
console.log(option) console.log(option)
self.initial(); self.initial();
self.getCoupon()
}, },
methods: { methods: {
getCoupon(){
couponListGet().then(res=>{
console.log('优惠券',res)
})
},
initial() { initial() {
let self = this; let self = this;
switch (self.optionData.type) { switch (self.optionData.type) {
......
<template> <template>
<view class="content"> <view class="content">
<view class="content-form"> <view class="content-form">
<u--form label-position="top" labelWidth="100" :model="model" :rules="rules" ref="form"> <u--form label-position="top" labelWidth="100" :model="model" :rules="rules" ref="form">
<u-form-item <u-form-item required label="标题" prop="title" borderBottom :customStyle="{
required 'flex-direction': 'row !important'
label="标题" }">
prop="title" <u--input inputAlign="right" maxlength="-1" border="none" v-model="model.title" placeholder="请填写标题">
borderBottom </u--input>
:customStyle="{ </u-form-item>
'flex-direction': 'row !important' <u-form-item required label="备注" prop="content" borderBottom>
}" <u--textarea :customStyle="{
> marginTop: '20rpx',
<u--input inputAlign="right" maxlength="-1" border="none" v-model="model.title" placeholder="请填写标题"></u--input> background: '#F5F5F5',
</u-form-item> border: 'none'
<u-form-item required label="备注" prop="remarks" borderBottom> }" v-model="model.content" placeholder="备注说明" height="128rpx"></u--textarea>
<u--textarea </u-form-item>
:customStyle="{ </u--form>
marginTop: '20rpx', </view>
background: '#F5F5F5', <u-button @click="handleSubmit" text="提交反馈" color="#2C66FF" :customStyle="{
border: 'none' width: '710rpx',
}" height: '80rpx',
v-model="model.remarks" borderRadius: '10rpx',
placeholder="备注说明" padding: '0rpx',
height="128rpx" position: 'absolute',
></u--textarea> bottom: '142rpx',
</u-form-item> left: '20rpx'
</u--form> }"></u-button>
</view> </view>
<u-button </template>
text="提交反馈"
color="#2C66FF" <script>
:customStyle="{ // import apiBaseConfig from '@/config/index.js';
width: '710rpx', import {
height: '80rpx', addUserFeedback
borderRadius: '10rpx', } from '@/api/my/index.js'
padding: '0rpx', export default {
position: 'absolute', data() {
bottom: '142rpx', return {
left: '20rpx' // imgBgUrl: apiBaseConfig.imgBgUrl,
}" globalData: getApp().globalData,
></u-button> scrollTopHeader: 0,
</view> model: {
</template> title: '',
content: '',
<script> userId:'111',
import apiBaseConfig from '@/config/index.js'; modifyTime:'2021-12-03 09:30:11',
export default { deleteStatus:0,
data() { createUser:'李哈哈',
return { modifyUser:'杜小渣'
imgBgUrl: apiBaseConfig.imgBgUrl, },
globalData: getApp().globalData, rules: {
scrollTopHeader: 0, title: {
model: { type: 'string',
title: '', required: true,
remarks: '' message: '请填写标题',
}, trigger: ['blur', 'change']
rules: { },
title: { content: {
type: 'string', type: 'string',
required: true, required: true,
message: '请填写标题', message: '请填写备注说明',
trigger: ['blur', 'change'] trigger: ['blur', 'change']
}, }
remarks: { }
type: 'string', };
required: true, },
message: '请填写备注说明', onLoad() {},
trigger: ['blur', 'change'] onReady() {
} //如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
} this.$refs.form.setRules(this.rules);
}; },
}, methods: {
onLoad() {}, handleSubmit() {
onReady() { let that = this
//如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。 that.model = {
this.$refs.form.setRules(this.rules); ...that.model,
}, content:that.model.content.trim()
methods: {} }
}; that.$refs.form.validate().then(res => {
</script> addUserFeedback(that.model).then(res=>{
if(res.code == 200){
<style lang="scss" scoped> uni.showToast({
.content { title:'提交成功!',
&-form { icon:'none',
margin: 30rpx 20rpx; duration:2000,
width: calc(100% - 20rpx * 2); success() {
/deep/ .u-form { setTimeout(()=>{
width: calc(100% - 20rpx * 2); that.$uniGo.navigateBack({
margin: 0rpx 20rpx; delta: 1
} });
} that.resetForm()
} },1000)
}
})
}
})
// uni.$u.toast('校验通过')
}).catch(errors => {
uni.$u.toast('请完善信息')
})
},
resetForm(){
this.model = {
title: '',
content: '',
userId:'111',
modifyTime:'2021-12-03 09:30:11',
deleteStatus:0,
createUser:'李哈哈',
modifyUser:'杜小渣'
}
}
}
};
</script>
<style lang="scss" scoped>
.content {
&-form {
margin: 30rpx 20rpx;
width: calc(100% - 20rpx * 2);
/deep/ .u-form {
width: calc(100% - 20rpx * 2);
margin: 0rpx 20rpx;
}
}
}
</style> </style>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</view> </view>
<view class="paddding-x-two"> <view class="paddding-x-two">
<view class="eval-box"> <view class="eval-box">
<view class="evaluate-title">文章标题文章标题文章标题文章标题文章标题</view> <view class="evaluate-title">{{articleData.title}}</view>
<view class="d-flex a-center j-sb margin-top-two"> <view class="d-flex a-center j-sb margin-top-two">
<view class="d-flex a-center"> <view class="d-flex a-center">
<image class="img" <image class="img"
...@@ -19,23 +19,23 @@ ...@@ -19,23 +19,23 @@
<view class="evaluate-name">张三</view> <view class="evaluate-name">张三</view>
</view> </view>
<view class="eval-time">发布于2022-11-16</view> <view class="eval-time">发布于{{ articleData.createTime | formatDate}}</view>
</view> </view>
<view class="evaluateText text-indent"> <view class="evaluateText text-indent">
评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容 {{articleData.content}}
</view> </view>
</view> </view>
</view> </view>
<view class="bgWhite"> <view class="bgWhite">
<view class="padding-aval"> <view class="padding-aval">
<comment-list :personEvalList="personEvalList"></comment-list> <comment-list :personEvalList="userEvalList"></comment-list>
</view> </view>
</view> </view>
</view> </view>
<view class="comment-box"> <view class="comment-box">
<view class="paddding-x-two comment-box-height d-flex a-center j-sb"> <view class="paddding-x-two comment-box-height d-flex a-center j-sb">
<input class="send-input" type="text" placeholder="评论一下吧"> <input v-model="content" class="send-input" type="text" placeholder="评论一下吧">
<view class="send-btn-box">发送</view> <view class="send-btn-box" @click="handleSend">发送</view>
</view> </view>
</view> </view>
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
</template> </template>
<script> <script>
import {articleDetail,userEvaluateGet,addUserEvaluate} from '../../api/order/index.js'
export default { export default {
data() { data() {
return { return {
...@@ -76,11 +77,59 @@ ...@@ -76,11 +77,59 @@
date: '2022-05-11', date: '2022-05-11',
content: '评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容' content: '评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容'
}, },
] ],
articleData:{},
userQuery:{
pageNum:1,
pageSize:10,
articleId:null
},
userEvalList:[],
content:'',//评论的内容
} }
}, },
onLoad(option) {
console.log(option.id,'接受的')
this.getDetail(option.id)
this.getUserEvalList(option.id)
},
methods: { methods: {
getDetail(id){
let that = this
articleDetail(id).then(res=>{
console.log(res,'文章详情')
if(res.code == 200){
that.articleData = res.data
}
})
},
getUserEvalList(id){
let that = this
that.userQuery.articleId = id
userEvaluateGet(that.userQuery).then(res=>{
console.log(res,'用户评论列表')
if(res.code == 200){
if(res.total > 0){
this.userEvalList = res.rows
}
}
})
},
handleSend(){
let that = this
that.content = that.content.trim()
if(that.content){
addUserEvaluate({content:this.content.trim()}).then(res=>{
console.log('发送',res)
})
}else{
return uni.showToast({
title:'不可发布空白内容',
icon:'none'
})
}
}
} }
} }
</script> </script>
......
...@@ -16,19 +16,19 @@ ...@@ -16,19 +16,19 @@
<view></view> <view></view>
<view>用户需求广场</view> <view>用户需求广场</view>
</view> </view>
<view class="" v-if="arr && arr.length"> <view class="" v-if="userNeedList && userNeedList.length">
<view class="content-matter-marketplace" v-for="(v , index) in 10" @click="clickJump" :key="index"> <view class="content-matter-marketplace" v-for="(v , index) in userNeedList" @click="clickJump(v)" :key="index">
<image src="/static//icon/sytb.png" mode=""></image> <image :src="v.fileVos[0].url" mode=""></image>
<view class="content-matter-marketplace-bazaar"> <view class="content-matter-marketplace-bazaar d-flex flex-column j-center">
<view class=""> <view class="">
灯泡灯芯坏了 {{v.title}}
</view> </view>
<view class=""> <view class="">
说明:有一个字不是特别亮,希望换一盏灯希望换一盏灯希望换一盏灯 说明:{{v.remark}}
</view> </view>
<view class=""> <view class="">
<text>维修时间:</text> <text>维修时间:</text>
<text>2023-02-23</text> <text>{{v.repairTime}}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -46,16 +46,14 @@ ...@@ -46,16 +46,14 @@
</view> </view>
</template> </template>
<script> <script>
import apiBaseConfig from '@/config/index.js'; import { userNeedSquare } from '@/api/system/index.js'
export default { export default {
data() { data() {
return { return {
title: 'Hello', title: 'Hello',
imgBgUrl: apiBaseConfig.imgBgUrl,
globalData: getApp().globalData, globalData: getApp().globalData,
scrollTopHeader: 0, scrollTopHeader: 0,
arr: [],
tabBarList: [{ tabBarList: [{
name: "首页", // name name: "首页", // name
icon: "/static/tabbar/tb1.png", // 图标 icon: "/static/tabbar/tb1.png", // 图标
...@@ -86,18 +84,31 @@ ...@@ -86,18 +84,31 @@
selectIcon: "/static/tabbar/td4.png", // 选中图标 selectIcon: "/static/tabbar/td4.png", // 选中图标
url: "/pages/my/index", url: "/pages/my/index",
type: 'type' type: 'type'
}], }],
userNeedList:[],//需求广场列表
} }
}, },
onLoad() {}, onLoad() {
this.getSquare()
},
onPageScroll(res) { onPageScroll(res) {
// console.log('页面滚动了onPageScroll-app', res.scrollTop); // console.log('页面滚动了onPageScroll-app', res.scrollTop);
this.scrollTopHeader = res.scrollTop; this.scrollTopHeader = res.scrollTop;
}, },
methods: { methods: {
clickJump() { getSquare(){
userNeedSquare().then(res=>{
console.log(res,'需求广场')
if(res.code == 200){
if(res.total > 0){
this.userNeedList = res.rows
}
}
})
},
clickJump(info) {
this.$uniGo.navigateTo({ this.$uniGo.navigateTo({
url: `/home/index/index` url: `/home/index/index?id=${info.id}`
}); });
}, },
} }
......
...@@ -2,11 +2,8 @@ ...@@ -2,11 +2,8 @@
<view class="content"> <view class="content">
<view :style="{ height: `calc(${globalData.statusBarHeight}rpx + 130rpx)` }"></view> <view :style="{ height: `calc(${globalData.statusBarHeight}rpx + 130rpx)` }"></view>
<view class="friends-list-box" @click="handleDetail"> <view class="friends-list-box">
<evaluateList :list="evaluateList"></evaluateList> <evaluateList :list="articleList" @getId="handleDetail"></evaluateList>
<view class="margin-top-two">
<comment-list :personEvalList="personEvalList"></comment-list>
</view>
</view> </view>
<com-navbar :leftIcon="false" :homeShow="false" bgColor="#fff" title="动态" <com-navbar :leftIcon="false" :homeShow="false" bgColor="#fff" title="动态"
:titleStyle="{ color: '#000', fontSize: '32rpx',scrollTopHeader: scrollTopHeader }" /> :titleStyle="{ color: '#000', fontSize: '32rpx',scrollTopHeader: scrollTopHeader }" />
...@@ -45,6 +42,7 @@ ...@@ -45,6 +42,7 @@
</template> </template>
<script> <script>
import {userArticleGet} from '../../api/order/index.js'
import evaluateList from '../../components/evaluate.vue' import evaluateList from '../../components/evaluate.vue'
export default { export default {
components: { components: {
...@@ -53,6 +51,13 @@ ...@@ -53,6 +51,13 @@
data() { data() {
return { return {
globalData: getApp().globalData, globalData: getApp().globalData,
queryParams:{
pageNum:1,//当前页数
pageSize:10,//分页大小
},
articleList:[],//文章列表
total:0,//总数
evaluateList: [{ evaluateList: [{
name: '马保国', name: '马保国',
image: 'https://slzh-oss.oss-cn-beijing.aliyuncs.com/usercenter/template/2c94809a787cec070179e01ec0ba02a9.jpg', image: 'https://slzh-oss.oss-cn-beijing.aliyuncs.com/usercenter/template/2c94809a787cec070179e01ec0ba02a9.jpg',
...@@ -97,35 +102,31 @@ ...@@ -97,35 +102,31 @@
date: '2022-01-31', date: '2022-01-31',
content: '评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容' content: '评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容'
}, },
{
avatar: 'https://img1.baidu.com/it/u=3486651663,3991438881&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
nickname: '李小乖',
date: '2022-05-11',
content: '评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容'
},
{
avatar: 'https://img2.baidu.com/it/u=955956276,3392954639&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
nickname: '李哈哈',
date: '2022-01-31',
content: '评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容'
},
{
avatar: 'https://img1.baidu.com/it/u=3486651663,3991438881&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
nickname: '李小乖',
date: '2022-05-11',
content: '评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容'
},
] ]
} }
}, },
onLoad() { onLoad() {
this.getArticleList()
}, },
methods: { methods: {
handleDetail() { getArticleList(){
let that = this
userArticleGet(that.queryParams).then(res=>{
console.log('文章列表',res.rows)
if(res.code == 200){
if(res.total > 0){
that.articleList = res.rows
that.total = res.total
}
}
})
},
handleDetail(id) {
let that = this let that = this
that.$uniGo.navigateTo({ that.$uniGo.navigateTo({
url: '/order/detail/detail' url: '/order/detail/detail?id='+id
}) })
} }
......
import store from '@/store' import store from '@/store'
import apiBaseConfig from '@/config/index.js' import apiBaseConfig from '@/config/index.js'
function httpBaseUrl() { function httpBaseUrl() {
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
return '/dev-api' return '/dev-api'
// #endif // #endif
} }
function switchMethod(method) { function switchMethod(method) {
let header = {}; let header = {};
switch (method) { switch (method) {
case 'POST': case 'POST':
header = { header = {
// 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8', // 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
'Content-Type': 'application/json;charset=UTF-8', 'Content-Type': 'application/json;charset=UTF-8',
} }
break; break;
case 'GET': case 'GET':
header = { header = {
'Content-Type': 'application/json;charset=UTF-8', 'Content-Type': 'application/json;charset=UTF-8',
} }
break; break;
} }
return header return header
} }
/** /**
* url 接口地址 * url 接口地址
* params 参数 * params 参数
* method 请求方式,必须全大写 * method 请求方式,必须全大写
* isToken 请求头是否设置token,默认true * isToken 请求头是否设置token,默认true
**/ **/
const ApiHttp = (url, params, method, isToken = true) => { const ApiHttp = (url, params, method, isToken = true) => {
let header = {}, let header = {},
token = store.state.login.token || null; token = store.state.login.token || null;
header = switchMethod(method) header = switchMethod(method)
// console.log(store.state.login.token,'================token') // console.log(store.state.login.token,'================token')
if (isToken) { if (isToken) {
header = { header = {
...header, ...header,
'Authorization': `Bearer ${token}` 'Authorization': `Bearer ${token}`
} }
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// uni.showLoading({ // uni.showLoading({
// title: '加载中...', // title: '加载中...',
// mask: true, // mask: true,
// }); // });
uni.request({ uni.request({
url: `${apiBaseConfig.domain}${url}`, url: `${apiBaseConfig.domain}${url}`,
method, method,
data: params, data: params,
header, header,
success: (res) => { success: (res) => {
const { console.log(res,'封装接口成功')
data const {
} = res; data
const { } = res;
code, const {
msg code,
} = data; msg
if (code === 200) { } = data;
resolve(data); if (code === 200) {
} else if (code === 401) { resolve(data);
resolve(data); } else if (code === 401) {
} else { resolve(data);
if (url == '/group-buy/by-consumer-order/leader/refunde' || } else {
url == '/group-buy/by-collective-leader/releaseOrder' || if (url == '/group-buy/by-consumer-order/leader/refunde' ||
url == '/group-buy/by-collective-leader-authentication/apply/leader') { url == '/group-buy/by-collective-leader/releaseOrder' ||
resolve(data); url == '/group-buy/by-collective-leader-authentication/apply/leader') {
return resolve(data);
} return
uni.showToast({ }
title: msg || '系统内部错误', uni.showToast({
icon: "none" title: msg || '系统内部错误',
}) icon: "none"
if (url == '/system/xcxLogin' || url == 'system/getPhone') { })
uni.clearStorageSync(); if (url == '/system/xcxLogin' || url == 'system/getPhone') {
store.dispatch('loginOut') uni.clearStorageSync();
} store.dispatch('loginOut')
}
}
}, }
fail: (err) => { },
console.log(err, 'pppppppppppp') fail: (err) => {
uni.showToast({ console.log(err, 'pppppppppppp')
title: err.errMsg, uni.showToast({
icon: "none" title: err.errMsg,
}) icon: "none"
if (url == '/system/xcxLogin' || url == 'system/getPhone') { })
uni.clearStorageSync(); if (url == '/system/xcxLogin' || url == 'system/getPhone') {
store.dispatch('loginOut') uni.clearStorageSync();
} store.dispatch('loginOut')
reject(err) }
}, reject(err)
complete: () => { },
// uni.hideLoading(); complete: () => {
} // uni.hideLoading();
}) }
}) })
} })
}
export {
ApiHttp export {
ApiHttp
} }
const isEmojiCharacter = (substring) => {
for (var i = 0; i < substring.length; i++) {
var hs = substring.charCodeAt(i);
if (0xd800 <= hs && hs <= 0xdbff) {
if (substring.length > 1) {
var ls = substring.charCodeAt(i + 1);
var uc = ((hs - 0xd800) * 0x400) + (ls - 0xdc00) + 0x10000;
if (0x1d000 <= uc && uc <= 0x1f77f) {
return true;
}
}
} else if (substring.length > 1) {
var ls = substring.charCodeAt(i + 1);
if (ls == 0x20e3) {
return true;
}
} else {
if (0x2100 <= hs && hs <= 0x27ff) {
return true;
} else if (0x2B05 <= hs && hs <= 0x2b07) {
return true;
} else if (0x2934 <= hs && hs <= 0x2935) {
return true;
} else if (0x3297 <= hs && hs <= 0x3299) {
return true;
} else if (hs == 0xa9 || hs == 0xae || hs == 0x303d || hs == 0x3030 ||
hs == 0x2b55 || hs == 0x2b1c || hs == 0x2b1b ||
hs == 0x2b50) {
return true;
}
}
}
}
export {
isEmojiCharacter
}
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