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>
<view>
<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="d-flex a-center j-sb">
<view class="nickname">{{item.nickname}}</view>
<view class="font">{{item.date}}</view>
<view class="nickname">{{item.createUser ? item.createUser : ''}}</view>
<view class="font">{{item.createTime | formatDate}}</view>
</view>
<view class="evaluateText">{{item.content}}</view>
</view>
......
......@@ -3,27 +3,29 @@
<!-- 评价 -->
<view class="evaluate">
<view class="evaluateCenter">
<view class="evaluateItem" v-for="(item, index) in list" :key="index">
<view class="evaluateTip d-flex a-center j-sb">
<view class="evaluateItem" v-for="(item, index) in list" :key="index" @click="handleLookId(item)">
<view class="evaluateTip d-flex j-sb a-center">
<view class="d-flex a-center">
<image class="img" :src="item.image" mode="widthFix"></image>
<view class="evaluate-name">{{ item.name}}</view>
<image class="img" src="../static/logoLogin.png" mode="widthFix"></image>
<view class="evaluate-name">{{ item.createUser}}</view>
</view>
<view class="font">{{item.time}}</view>
<view class="font">{{item.createTime | formatDate}}</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="" v-if="item.isMore">
<view class="rightText" v-if="item.contentAll" @click="changeAllFun(item, index)">全部</view>
<view class="rightText" v-else @click="changeAllFun(item, index)">收起</view>
</view> -->
<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)">
<image :src="itm.url" mode="scaleToFill"></image>
</view>
</view>
<view class="margin-top-two">
<comment-list :personEvalList="item.commentVos"></comment-list>
</view>
</view>
</view>
</view>
......@@ -72,17 +74,23 @@
})
this.list = list
},
//点击获取id
handleLookId(data) {
this.$emit('getId', data.id)
},
//图片预览
handlePreview(index, inx) {
console.log(index, inx)
let that = this
var photoList = that.list[index].imageList.map(item => { // item 获取到的图片地址
var photoList = that.list[index].fileVos.map(item => { // item 获取到的图片地址
return item.url;
});
uni.previewImage({
current: inx,
urls: photoList,
loop: true
})
console.log(photoList, '第三')
// uni.previewImage({
// current: inx,
// urls: photoList,
// loop: true
// })
}
}
......@@ -91,7 +99,7 @@
<style lang="scss" scoped>
.evaluate .evaluateCenter .evaluateItem {
display: inline-block;
// display: inline-block;
}
// 展开收起
......
// let hostUrl = 'https://baiyingroup.nyinhong.com', // 测试
// // let hostUrl = 'https://baiyin-uat.nyinhong.com', // UAT
let hostUrl = 'http://xinrenli.nyinhong.com', // 测试
// let hostUrl = 'http://192.168.0.109:7001', // UAT
// // let hostUrl = 'https://pepsibdp.masterkong.com.cn', // prd
// api = '/api',
// imgApi = '/admimage/';
let hostUrl = '',
api = '',
api = '/api',
imgApi = '/admimage/';
// let hostUrl = '',
// api = '',
// imgApi = '/admimage/';
switch (process.env.UNI_BASE_ENV) {
case 'development':
hostUrl = process.env.UNI_BASE_URL;
......
......@@ -55,6 +55,9 @@
</template>
<script>
import {
orderDetailMsg
} from '../../api/system/index.js'
import apiBaseConfig from '@/config/index.js';
export default {
data() {
......@@ -64,7 +67,9 @@
scrollTopHeader: 0
};
},
onLoad() {
onLoad(option) {
console.log(option.id,'结束')
this.getDetailData(option.id)
this.timer = null;
this.innerAudioContext = uni.createInnerAudioContext();
// 监听音频进入可以播放状态的事件
......@@ -86,6 +91,11 @@
})
},
methods: {
getDetailData(id){
orderDetailMsg({id:id}).then(res=>{
console.log(res,'详情')
})
},
// 播放
doPlay() {
if (!this.innerAudioContext.src) {
......
......@@ -24,7 +24,16 @@ Vue.component('com-navbar', comNavBar)
//人员评论列表
import commentList from '@/components/comment/comment.vue'
Vue.component('comment-list',commentList)
Vue.component('comment-list', commentList)
// 时间过滤器
Vue.filter('formatDate', date => {
let newDate = new Date(date);
let year = newDate.getFullYear();
let month = newDate.getMonth().toString().padStart(2, 0);
let day = newDate.getDay().toString().padStart(2, 0);
return year + '-' + month + '-' + day;
})
uni.$u.setConfig({
config: {
unit: 'rpx'
......
......@@ -70,12 +70,10 @@
</template>
<script>
import apiBaseConfig from '@/config/index.js';
import {couponListGet} from '../../api/my/index.js'
export default {
data() {
return {
imgBgUrl: apiBaseConfig.imgBgUrl,
globalData: getApp().globalData,
scrollTopHeader: 0,
optionData: {},
title: ''
......@@ -86,8 +84,14 @@
self.optionData = option;
console.log(option)
self.initial();
self.getCoupon()
},
methods: {
getCoupon(){
couponListGet().then(res=>{
console.log('优惠券',res)
})
},
initial() {
let self = this;
switch (self.optionData.type) {
......
......@@ -2,35 +2,22 @@
<view class="content">
<view class="content-form">
<u--form label-position="top" labelWidth="100" :model="model" :rules="rules" ref="form">
<u-form-item
required
label="标题"
prop="title"
borderBottom
:customStyle="{
<u-form-item required label="标题" prop="title" borderBottom :customStyle="{
'flex-direction': 'row !important'
}"
>
<u--input inputAlign="right" maxlength="-1" border="none" v-model="model.title" placeholder="请填写标题"></u--input>
}">
<u--input inputAlign="right" maxlength="-1" border="none" v-model="model.title" placeholder="请填写标题">
</u--input>
</u-form-item>
<u-form-item required label="备注" prop="remarks" borderBottom>
<u--textarea
:customStyle="{
<u-form-item required label="备注" prop="content" borderBottom>
<u--textarea :customStyle="{
marginTop: '20rpx',
background: '#F5F5F5',
border: 'none'
}"
v-model="model.remarks"
placeholder="备注说明"
height="128rpx"
></u--textarea>
}" v-model="model.content" placeholder="备注说明" height="128rpx"></u--textarea>
</u-form-item>
</u--form>
</view>
<u-button
text="提交反馈"
color="#2C66FF"
:customStyle="{
<u-button @click="handleSubmit" text="提交反馈" color="#2C66FF" :customStyle="{
width: '710rpx',
height: '80rpx',
borderRadius: '10rpx',
......@@ -38,22 +25,29 @@
position: 'absolute',
bottom: '142rpx',
left: '20rpx'
}"
></u-button>
}"></u-button>
</view>
</template>
<script>
import apiBaseConfig from '@/config/index.js';
export default {
// import apiBaseConfig from '@/config/index.js';
import {
addUserFeedback
} from '@/api/my/index.js'
export default {
data() {
return {
imgBgUrl: apiBaseConfig.imgBgUrl,
// imgBgUrl: apiBaseConfig.imgBgUrl,
globalData: getApp().globalData,
scrollTopHeader: 0,
model: {
title: '',
remarks: ''
content: '',
userId:'111',
modifyTime:'2021-12-03 09:30:11',
deleteStatus:0,
createUser:'李哈哈',
modifyUser:'杜小渣'
},
rules: {
title: {
......@@ -62,7 +56,7 @@ export default {
message: '请填写标题',
trigger: ['blur', 'change']
},
remarks: {
content: {
type: 'string',
required: true,
message: '请填写备注说明',
......@@ -76,19 +70,62 @@ export default {
//如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
this.$refs.form.setRules(this.rules);
},
methods: {}
};
methods: {
handleSubmit() {
let that = this
that.model = {
...that.model,
content:that.model.content.trim()
}
that.$refs.form.validate().then(res => {
addUserFeedback(that.model).then(res=>{
if(res.code == 200){
uni.showToast({
title:'提交成功!',
icon:'none',
duration:2000,
success() {
setTimeout(()=>{
that.$uniGo.navigateBack({
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 {
.content {
&-form {
margin: 30rpx 20rpx;
width: calc(100% - 20rpx * 2);
/deep/ .u-form {
width: calc(100% - 20rpx * 2);
margin: 0rpx 20rpx;
}
}
}
}
</style>
......@@ -10,7 +10,7 @@
</view>
<view class="paddding-x-two">
<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">
<image class="img"
......@@ -19,23 +19,23 @@
<view class="evaluate-name">张三</view>
</view>
<view class="eval-time">发布于2022-11-16</view>
<view class="eval-time">发布于{{ articleData.createTime | formatDate}}</view>
</view>
<view class="evaluateText text-indent">
评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容
{{articleData.content}}
</view>
</view>
</view>
<view class="bgWhite">
<view class="padding-aval">
<comment-list :personEvalList="personEvalList"></comment-list>
<comment-list :personEvalList="userEvalList"></comment-list>
</view>
</view>
</view>
<view class="comment-box">
<view class="paddding-x-two comment-box-height d-flex a-center j-sb">
<input class="send-input" type="text" placeholder="评论一下吧">
<view class="send-btn-box">发送</view>
<input v-model="content" class="send-input" type="text" placeholder="评论一下吧">
<view class="send-btn-box" @click="handleSend">发送</view>
</view>
</view>
......@@ -43,6 +43,7 @@
</template>
<script>
import {articleDetail,userEvaluateGet,addUserEvaluate} from '../../api/order/index.js'
export default {
data() {
return {
......@@ -76,13 +77,61 @@
date: '2022-05-11',
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: {
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>
<style>
......
......@@ -16,19 +16,19 @@
<view></view>
<view>用户需求广场</view>
</view>
<view class="" v-if="arr && arr.length">
<view class="content-matter-marketplace" v-for="(v , index) in 10" @click="clickJump" :key="index">
<image src="/static//icon/sytb.png" mode=""></image>
<view class="content-matter-marketplace-bazaar">
<view class="" v-if="userNeedList && userNeedList.length">
<view class="content-matter-marketplace" v-for="(v , index) in userNeedList" @click="clickJump(v)" :key="index">
<image :src="v.fileVos[0].url" mode=""></image>
<view class="content-matter-marketplace-bazaar d-flex flex-column j-center">
<view class="">
灯泡灯芯坏了
{{v.title}}
</view>
<view class="">
说明:有一个字不是特别亮,希望换一盏灯希望换一盏灯希望换一盏灯
说明:{{v.remark}}
</view>
<view class="">
<text>维修时间:</text>
<text>2023-02-23</text>
<text>{{v.repairTime}}</text>
</view>
</view>
</view>
......@@ -47,15 +47,13 @@
</template>
<script>
import apiBaseConfig from '@/config/index.js';
import { userNeedSquare } from '@/api/system/index.js'
export default {
data() {
return {
title: 'Hello',
imgBgUrl: apiBaseConfig.imgBgUrl,
globalData: getApp().globalData,
scrollTopHeader: 0,
arr: [],
tabBarList: [{
name: "首页", // name
icon: "/static/tabbar/tb1.png", // 图标
......@@ -87,17 +85,30 @@
url: "/pages/my/index",
type: 'type'
}],
userNeedList:[],//需求广场列表
}
},
onLoad() {},
onLoad() {
this.getSquare()
},
onPageScroll(res) {
// console.log('页面滚动了onPageScroll-app', res.scrollTop);
this.scrollTopHeader = res.scrollTop;
},
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({
url: `/home/index/index`
url: `/home/index/index?id=${info.id}`
});
},
}
......
......@@ -2,11 +2,8 @@
<view class="content">
<view :style="{ height: `calc(${globalData.statusBarHeight}rpx + 130rpx)` }"></view>
<view class="friends-list-box" @click="handleDetail">
<evaluateList :list="evaluateList"></evaluateList>
<view class="margin-top-two">
<comment-list :personEvalList="personEvalList"></comment-list>
</view>
<view class="friends-list-box">
<evaluateList :list="articleList" @getId="handleDetail"></evaluateList>
</view>
<com-navbar :leftIcon="false" :homeShow="false" bgColor="#fff" title="动态"
:titleStyle="{ color: '#000', fontSize: '32rpx',scrollTopHeader: scrollTopHeader }" />
......@@ -45,6 +42,7 @@
</template>
<script>
import {userArticleGet} from '../../api/order/index.js'
import evaluateList from '../../components/evaluate.vue'
export default {
components: {
......@@ -53,6 +51,13 @@
data() {
return {
globalData: getApp().globalData,
queryParams:{
pageNum:1,//当前页数
pageSize:10,//分页大小
},
articleList:[],//文章列表
total:0,//总数
evaluateList: [{
name: '马保国',
image: 'https://slzh-oss.oss-cn-beijing.aliyuncs.com/usercenter/template/2c94809a787cec070179e01ec0ba02a9.jpg',
......@@ -97,35 +102,31 @@
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: '评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容'
},
{
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() {
this.getArticleList()
},
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
that.$uniGo.navigateTo({
url: '/order/detail/detail'
url: '/order/detail/detail?id='+id
})
}
......
......@@ -53,6 +53,7 @@ const ApiHttp = (url, params, method, isToken = true) => {
data: params,
header,
success: (res) => {
console.log(res,'封装接口成功')
const {
data
} = res;
......
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