小程序产品库完成
This commit is contained in:
236
src/mods/AppPlease/AppPlease.vue
Normal file
236
src/mods/AppPlease/AppPlease.vue
Normal file
@@ -0,0 +1,236 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="fixed-top">
|
||||
<div class="header-search">
|
||||
<div class="search-input-content">
|
||||
<img src="https://cdn.cunwuyun.cn/img/search-blue.svg" alt="" class="search-icon">
|
||||
<input type="text" placeholder="请输入标题" class="search-input" placeholder-style="color:#E2E8F1;"
|
||||
v-model="inputValue" @confirm="getList" confirm-type="search"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="header-select">
|
||||
<div class="select-item" @click="leaveMessageTypeShow = true">
|
||||
<span>{{ typeName || '提问类型' }}</span>
|
||||
<img src="https://cdn.cunwuyun.cn/img/down.svg" alt="" class="down-icon">
|
||||
</div>
|
||||
<div class="select-item" @click="timeSelectShow = true">
|
||||
<span>{{ searchTime || '提问时间' }}</span>
|
||||
<img src="https://cdn.cunwuyun.cn/img/down.svg" alt="" class="down-icon">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="please-list">
|
||||
<div class="item" v-for="(item, index) in messageList" :key="index" @click="toDetail(item.id)">
|
||||
<p class="item-title"><span class="item-type"
|
||||
:class="'color-'+item.type">{{
|
||||
$dict.getLabel('leaveMessageType', item.type)
|
||||
}}</span>{{ item.title }}
|
||||
</p>
|
||||
<div>
|
||||
<span>提问人:{{ item.leaveName }}</span>
|
||||
<span>{{ ittem.createTime }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<AiEmpty v-if="!messageList.length"/>
|
||||
</div>
|
||||
<div class="fixed-bottom bottom-btn">
|
||||
<div @click="$linkTo('./questionList')">提问记录</div>
|
||||
<div class="btn-active" @click="$linkTo('./add')">我要提问</div>
|
||||
</div>
|
||||
<u-select v-model="leaveMessageTypeShow" :list="leaveMessageTypeList" @confirm="confirmMessageType"
|
||||
confirm-color="#07c160"></u-select>
|
||||
<u-picker v-model="timeSelectShow" mode="time" :params="params" :start-year="startDate" :end-year="endDate"
|
||||
:default-selector="defaultDate"
|
||||
confirm-color="#07c160" @confirm="timeSelectConfirm"></u-picker>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {mapState} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: "AppPlease",
|
||||
appName:"随心问",
|
||||
computed: {
|
||||
...mapState(['user', 'token']),
|
||||
startDate() {
|
||||
return this.getDate('start')
|
||||
},
|
||||
endDate() {
|
||||
return this.getDate('end')
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const currentDate = this.getDate({
|
||||
format: true
|
||||
})
|
||||
return {
|
||||
inputValue: '',
|
||||
timeSelectShow: false,
|
||||
params: {
|
||||
year: true,
|
||||
month: true,
|
||||
day: false,
|
||||
hour: false,
|
||||
minute: false,
|
||||
second: false,
|
||||
},
|
||||
startYear: '',
|
||||
endYear: '',
|
||||
defaultDate: [],
|
||||
searchTime: '',
|
||||
leaveMessageTypeShow: false,
|
||||
leaveMessageTypeList: [],
|
||||
type: '',
|
||||
typeName: '',
|
||||
messageList: []
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.$dict.load('leaveMessageType').then((res) => {
|
||||
this.$nextTick(() => {
|
||||
this.$dict.getDict('leaveMessageType').map(i => {
|
||||
var item = {
|
||||
label: i.dictName,
|
||||
value: i.dictValue
|
||||
}
|
||||
this.leaveMessageTypeList.push(item)
|
||||
})
|
||||
})
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
var searchParams = {
|
||||
createTime: this.searchTime ? this.searchTime + '-' + "01" + ' ' + '00' + ":" + "00" + ":" + "00" : '',
|
||||
title: this.inputValue,
|
||||
type: this.type,
|
||||
userType: 0,//小程序用户
|
||||
}
|
||||
this.$instance.post(`/app/appleavemessage/listForWx`, searchParams).then(res => {
|
||||
if (res.data.records) {
|
||||
res.data.records.map((item) => {
|
||||
// var reg = new RegExp('(?<=.).', 'g')
|
||||
// item.leaveName = item.leaveName.replace(reg, '*')
|
||||
if (item.leaveName) {
|
||||
item.leaveName = item.leaveName.substring(0, 1) + '**'
|
||||
}
|
||||
|
||||
})
|
||||
this.messageList = res.data.records
|
||||
}
|
||||
})
|
||||
},
|
||||
timeSelectConfirm(e) {
|
||||
this.searchTime = e.year + '-' + e.month
|
||||
this.getList()
|
||||
},
|
||||
confirmMessageType(e) {
|
||||
this.typeName = e[0].label
|
||||
this.type = e[0].value
|
||||
this.getList()
|
||||
},
|
||||
getDate(type) {
|
||||
const date = new Date();
|
||||
let year = date.getFullYear();
|
||||
if (type === 'start') {
|
||||
year = year - 10;
|
||||
} else if (type === 'end') {
|
||||
year = year;
|
||||
}
|
||||
return `${year}`;
|
||||
},
|
||||
toDetail(id) {
|
||||
this.$linkTo(`./detail?id=${id}`)
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
@import "../../common/common.scss";
|
||||
|
||||
.page {
|
||||
width: 100%;
|
||||
background-color: #F3F6F9;
|
||||
|
||||
.please-list {
|
||||
padding: 240px 32px 144px;
|
||||
|
||||
.item {
|
||||
width: 686px;
|
||||
background: #FFF;
|
||||
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.02);
|
||||
border-radius: 8px;
|
||||
padding: 32px;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 32px;
|
||||
|
||||
.item-title {
|
||||
word-break: break-all;
|
||||
line-height: 44px;
|
||||
color: #333;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
margin-bottom: 16px;
|
||||
|
||||
.item-type {
|
||||
border-radius: 8px;
|
||||
padding: 8px 8px 4px;
|
||||
font-size: 26px;
|
||||
line-height: 36px;
|
||||
margin-right: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
div {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
color: #999;
|
||||
font-size: 28px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bottom-btn {
|
||||
height: 112px;
|
||||
line-height: 110px;
|
||||
font-weight: 500;
|
||||
color: #666;
|
||||
font-size: 36px;
|
||||
display: flex;
|
||||
background-color: #fff;
|
||||
border-top: 2px solid #ddd;
|
||||
box-sizing: border-box;
|
||||
|
||||
div {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.btn-active {
|
||||
background-color: #1365DD;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.color-0 {
|
||||
background: #FFEBEF;
|
||||
color: #F46;
|
||||
}
|
||||
|
||||
.color-1 {
|
||||
background: #E8EFFF;
|
||||
color: #26f;
|
||||
}
|
||||
|
||||
.color-2 {
|
||||
background: #E8EFFF;
|
||||
color: #26f;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
222
src/mods/AppPlease/add.vue
Normal file
222
src/mods/AppPlease/add.vue
Normal file
@@ -0,0 +1,222 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="add-form">
|
||||
<div class="form-item mar-b8">
|
||||
<span class="item-tips">*</span>
|
||||
<span class="label">提问类型</span>
|
||||
<span :class="typeName ? 'value color-333' : 'value color-999'"
|
||||
@click="leaveMessageTypeShow = true">{{ typeName || '请选择' }}</span>
|
||||
<img src="https://cdn.cunwuyun.cn/img/right-icon-999.png" alt="" class="right-icon">
|
||||
</div>
|
||||
<div class="form-item mar-b8">
|
||||
<span class="item-tips">*</span>
|
||||
<span class="label">所在地区</span>
|
||||
<span class="value color-999">
|
||||
<AiAreaPicker v-model="areaId" class="picker" :name.sync="areaName">
|
||||
<div :class="areaName == '请选择' ? 'text color-999' : 'text color-333' ">{{ areaName || "请选择" }}</div>
|
||||
</AiAreaPicker>
|
||||
</span>
|
||||
<img src="https://cdn.cunwuyun.cn/img/right-icon-999.png" alt="" class="right-icon">
|
||||
</div>
|
||||
<div class="form-item title-line">
|
||||
<span class="item-tips">*</span>
|
||||
<span class="label">提问标题</span>
|
||||
<div class="item-input">
|
||||
<input type="text" placeholder="请输入标题(30字以内)" placeholder-style="color:#999;" maxlength="30" v-model="title">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-item mar-b8">
|
||||
<span class="item-tips">*</span>
|
||||
<span class="label">提问内容</span>
|
||||
<div class="item-input fs-32">
|
||||
<u-input type="textarea" height="140" placeholder="请输入提问内容(500字以内)" placeholder-style="color:#999;"
|
||||
maxlength="500" v-model="content"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-item">
|
||||
<span class="item-tips"></span>
|
||||
<span class="label">图片上传<span class="mini-label">(最多9张)</span></span>
|
||||
<div class="upload">
|
||||
<AiUploader :limit="9" v-model="files"></AiUploader>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<u-select v-model="leaveMessageTypeShow" :list="leaveMessageTypeList" @confirm="confirmMessageType"
|
||||
confirm-color="#07c160"></u-select>
|
||||
<div class="fixed-bottom confirm-btn" @click="confirm">提交</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {mapState} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: "my",
|
||||
computed: {
|
||||
...mapState(['global'])
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
type: '',
|
||||
typeName: '',
|
||||
areaId: '',
|
||||
areaName: "",
|
||||
areaRange: "",
|
||||
title: '',
|
||||
content: '',
|
||||
files: [],
|
||||
flag: false,
|
||||
leaveMessageTypeList: [],
|
||||
leaveMessageTypeShow: false
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.$dict.load('leaveMessageType').then((res) => {
|
||||
this.$nextTick(() => {
|
||||
this.$dict.getDict('leaveMessageType').map(i => {
|
||||
var item = {
|
||||
label: i.dictName,
|
||||
value: i.dictValue
|
||||
}
|
||||
this.leaveMessageTypeList.push(item)
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
confirm() {
|
||||
if (this.flag) return
|
||||
this.$loading()
|
||||
var params = {
|
||||
type: this.type,
|
||||
areaId: this.areaId,
|
||||
title: this.title,
|
||||
content: this.content,
|
||||
images: JSON.stringify(this.files),
|
||||
status: 0
|
||||
}
|
||||
if (!params.type) {
|
||||
return this.$toast('请选择留言类型')
|
||||
}
|
||||
if (!params.areaId) {
|
||||
return this.$toast('请选择所在地区')
|
||||
}
|
||||
if (!params.title) {
|
||||
return this.$toast('请输入提问标题')
|
||||
}
|
||||
if (!params.content) {
|
||||
return this.$toast('请输入提问内容')
|
||||
}
|
||||
this.flag = true
|
||||
this.$instance.post(`/app/appleavemessage/addOrUpdate-wx`, params).then(res => {
|
||||
if (res && res.code == 0) {
|
||||
this.$hideLoading()
|
||||
uni.showModal({
|
||||
title: '您已成功提交留言',
|
||||
confirmText: "查看记录",
|
||||
confirmColor: "#197DF0",
|
||||
showCancel: false,
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
this.flag = false
|
||||
uni.redirectTo({
|
||||
url: './questionList'
|
||||
})
|
||||
} else {
|
||||
this.flag = false
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.flag = false
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
this.flag = false
|
||||
})
|
||||
},
|
||||
confirmMessageType(e) {
|
||||
this.typeName = e[0].label
|
||||
this.type = e[0].value
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
@import "../../common/common.scss";
|
||||
|
||||
.page {
|
||||
width: 100%;
|
||||
background-color: #F3F6F9;
|
||||
|
||||
.add-form {
|
||||
padding-bottom: 112px;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
padding: 34px 32px 34px 12px;
|
||||
line-height: 44px;
|
||||
background-color: #fff;
|
||||
|
||||
.item-tips {
|
||||
display: inline-block;
|
||||
width: 12px;
|
||||
font-size: 32px;
|
||||
color: #FF4466;
|
||||
}
|
||||
|
||||
.label {
|
||||
display: inline-block;
|
||||
min-width: 126px;
|
||||
color: #333;
|
||||
font-size: 32px;
|
||||
margin-left: 8px;
|
||||
|
||||
.mini-label {
|
||||
color: #999;
|
||||
font-size: 28px;
|
||||
}
|
||||
}
|
||||
|
||||
.value {
|
||||
display: inline-block;
|
||||
width: 518px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.text {
|
||||
display: inline-block;
|
||||
width: 520px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.color-333 {
|
||||
color: #333 !important;
|
||||
}
|
||||
|
||||
.right-icon {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
margin-left: 8px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.item-input {
|
||||
padding-bottom: 4px;
|
||||
margin-left: 24px;
|
||||
margin-top: 32px input {
|
||||
line-height: 42px;
|
||||
font-size: 32px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.upload {
|
||||
margin: 32px 0 024px;
|
||||
}
|
||||
}
|
||||
|
||||
.mar-b8 {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
299
src/mods/AppPlease/detail.vue
Normal file
299
src/mods/AppPlease/detail.vue
Normal file
@@ -0,0 +1,299 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="detail">
|
||||
<div class="detail-header">
|
||||
<p class="info-title">[{{ $dict.getLabel('leaveMessageType', detailInfo.type) }}] {{ detailInfo.title }}</p>
|
||||
<div class="info-item">
|
||||
<span class="label">留言编号:</span>
|
||||
<span class="value">{{ detailInfo.msgCode }}</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="label">留言时间:</span>
|
||||
<span class="value">{{ detailInfo.createTime }}</span>
|
||||
</div>
|
||||
<!-- <div class="info-item">
|
||||
<span class="label">受理单位:</span>
|
||||
<span class="value">{{detailInfo.createTime}}</span>
|
||||
</div> -->
|
||||
<div class="info-item">
|
||||
<span class="label">处理状态:</span>
|
||||
<span class="value">{{ $dict.getLabel('leaveMessageStatus', detailInfo.status) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="detail-content">
|
||||
<p class="info-content">{{ detailInfo.content }}</p>
|
||||
<div class="img-list" v-if="detailInfo.iamgeList.length">
|
||||
<img :src="item.url" alt="" v-for="(item,index) in detailInfo.iamgeList" key="index"
|
||||
@click="previewdealListImage(index, detailInfo.iamgeList)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="reply-content" v-if="appLeaveMessageReplyList.length">
|
||||
<div class="reply-title">
|
||||
<img src="https://cdn.cunwuyun.cn/img/dialogue.svg" alt="">沟通记录
|
||||
</div>
|
||||
<div class="reply-list">
|
||||
<div class="item" v-for="(item, index) in appLeaveMessageReplyList" :key="index">
|
||||
<div class="item-top">
|
||||
<div class="user-img-bg" v-if="item.createUnitName">{{ item.first }}</div>
|
||||
<img :src="item.headPortrait" alt="" class="user-img"
|
||||
v-if="!item.createUnitName && item.createUserName && !item.openId">
|
||||
<img :src="avatarUrl" alt="" class="user-img" v-if="item.openId">
|
||||
|
||||
<span class="item-title" v-if="item.createUnitName">{{ item.createUnitName }} 回复</span>
|
||||
<span class="item-title" v-if="!item.createUnitName && item.createUserName && !item.openId">{{
|
||||
item.createUserName
|
||||
}} 回复</span>
|
||||
<span class="item-title" v-if="item.openId">我的 回复</span>
|
||||
|
||||
<span class="item-time">{{ item.createTime }}</span>
|
||||
</div>
|
||||
<div class="item-content">
|
||||
<p>{{ item.content }}</p>
|
||||
<div class="img-list">
|
||||
<img :src="items.url" alt="" v-for="(items,indexs) in item.images" :key="indexs"
|
||||
@click="previewdealListImage(indexs, item.images)">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="no-more">------------ 没有更多回复了 ------------</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fixed-bottom confirm-btn" @click="toReply" v-if="detailInfo.status != 2">发表回复</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {mapState} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: "my",
|
||||
computed: {
|
||||
...mapState(['user', 'token'])
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
id: '',
|
||||
detailInfo: {},
|
||||
appLeaveMessageReplyList: [],
|
||||
avatarUrl: ''
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.id = options.id
|
||||
this.avatarUrl = this.user.avatarUrl
|
||||
},
|
||||
onShow() {
|
||||
this.$dict.load('leaveMessageType', 'leaveMessageStatus')
|
||||
this.getEventDetail()
|
||||
},
|
||||
methods: {
|
||||
getEventDetail() {
|
||||
this.$instance.post(`/app/appleavemessage/queryDetailById-wx?id=${this.id}`).then(res => {
|
||||
console.log(res)
|
||||
if (res.code == 0) {
|
||||
if (res.data) {
|
||||
res.data.iamgeList = JSON.parse(res.data.images)
|
||||
this.detailInfo = res.data;
|
||||
res.data.appLeaveMessageReplyList.map(item => {
|
||||
if (item.createUnitName) {
|
||||
item.first = item.createUnitName.substring(0, 1);
|
||||
}
|
||||
if (item.images) {
|
||||
item.images = JSON.parse(item.images);
|
||||
}
|
||||
return item
|
||||
})
|
||||
this.appLeaveMessageReplyList = res.data.appLeaveMessageReplyList;
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
previewdealListImage(current, imgList) {
|
||||
var tempList = []
|
||||
for (var i in imgList) {
|
||||
tempList.push(imgList[i].url)
|
||||
}
|
||||
uni.previewImage({
|
||||
current: tempList[current],
|
||||
urls: tempList
|
||||
})
|
||||
},
|
||||
//回复
|
||||
toReply() {
|
||||
this.$linkTo(`./reply?code=${this.detailInfo.msgCode}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
@import "../../common/common.scss";
|
||||
|
||||
.page {
|
||||
width: 100%;
|
||||
background-color: #f3f6f9;
|
||||
|
||||
.detail {
|
||||
padding-bottom: 112px;
|
||||
|
||||
.detail-header {
|
||||
width: 100%;
|
||||
background: #197DF0;
|
||||
padding: 24px 32px 16px 32px;
|
||||
box-sizing: border-box;
|
||||
color: #FFF;
|
||||
|
||||
.info-title {
|
||||
font-weight: 500;
|
||||
line-height: 64px;
|
||||
word-break: break-all;
|
||||
font-size: 40px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.info-item {
|
||||
line-height: 40px;
|
||||
font-size: 28px;
|
||||
margin-bottom: 16px;
|
||||
|
||||
.label {
|
||||
display: inline-block;
|
||||
text-align: justify;
|
||||
text-align-last: justify;
|
||||
width: 148px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.value {
|
||||
display: inline-block;
|
||||
width: calc(100% - 148px);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.detail-content {
|
||||
background-color: #fff;
|
||||
padding: 32px 32px 032px;
|
||||
margin-bottom: 16px;
|
||||
|
||||
.info-content {
|
||||
line-height: 56px;
|
||||
color: #666;
|
||||
font-size: 32px;
|
||||
padding-bottom: 32px;
|
||||
}
|
||||
|
||||
.img-list {
|
||||
padding-bottom: 16px img {
|
||||
width: 218px;
|
||||
height: 218px;
|
||||
margin: 0 16px 16px 0;
|
||||
}
|
||||
|
||||
img:nth-of-type(3n) {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.reply-content {
|
||||
background-color: #fff;
|
||||
padding: 032px;
|
||||
|
||||
.reply-title {
|
||||
width: 100%;
|
||||
height: 112px;
|
||||
line-height: 112px;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
font-size: 32px img {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
vertical-align: middle;
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.reply-list {
|
||||
.item {
|
||||
margin-bottom: 32px;
|
||||
|
||||
.item-top {
|
||||
margin-bottom: 16px;
|
||||
|
||||
.user-img {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
border-radius: 50%;
|
||||
margin-right: 16px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.user-img-bg {
|
||||
display: inline-block;
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
line-height: 64px;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
font-size: 28px;
|
||||
border-radius: 50%;
|
||||
margin-right: 16px;
|
||||
vertical-align: middle;
|
||||
background-color: #197DF0;
|
||||
}
|
||||
|
||||
.item-title {
|
||||
display: inline-block;
|
||||
width: 342px;
|
||||
font-size: 28px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #197DF0;
|
||||
line-height: 40px;
|
||||
}
|
||||
|
||||
.item-time {
|
||||
font-size: 28px;
|
||||
color: #999;
|
||||
line-height: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
.item-content {
|
||||
width: 606px;
|
||||
padding: 16px 16px 0;
|
||||
box-sizing: border-box;
|
||||
background: #F3F6F9;
|
||||
margin-left: 72px p {
|
||||
line-height: 40px;
|
||||
color: #333;
|
||||
font-size: 28px;
|
||||
word-break: break-all;
|
||||
padding-bottom: 16px;
|
||||
}
|
||||
|
||||
.img-list {
|
||||
img {
|
||||
width: 132px;
|
||||
height: 132px;
|
||||
margin: 0 16px 16px 0;
|
||||
}
|
||||
|
||||
img:nth-of-type(4n) {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.no-more {
|
||||
padding: 64px 0;
|
||||
color: #999;
|
||||
font-size: 24px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
229
src/mods/AppPlease/questionList.vue
Normal file
229
src/mods/AppPlease/questionList.vue
Normal file
@@ -0,0 +1,229 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="fixed-top">
|
||||
<div class="header-tab">
|
||||
<div class="tab-item" v-for="(item, index) in tabList" :key="index" @click="tabClick(index)">{{ item }}<span
|
||||
class="active-line" v-if="tabIndex == index"></span></div>
|
||||
</div>
|
||||
<div class="header-search">
|
||||
<div class="search-input-content">
|
||||
<img src="https://cdn.cunwuyun.cn/img/search-blue.svg" alt="" class="search-icon">
|
||||
<input type="text" placeholder="请输入标题或者编号" class="search-input" placeholder-style="color:#E2E8F1;"
|
||||
v-model="inputValue" @confirm="getList" confirm-type="search"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="header-select">
|
||||
<div class="select-item" @click="leaveMessageTypeShow = true">
|
||||
<span>{{ typeName || '提问类型' }}</span>
|
||||
<img src="https://cdn.cunwuyun.cn/img/down.svg" alt="" class="down-icon">
|
||||
</div>
|
||||
<div class="select-item" @click="timeSelectShow = true">
|
||||
<span>{{ searchTime || '提问时间' }}</span>
|
||||
<img src="https://cdn.cunwuyun.cn/img/down.svg" alt="" class="down-icon">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="please-list">
|
||||
<div class="item" v-for="(item, index) in messageList" :key="index" @click="toDetail(item.id)">
|
||||
<p class="item-title"><span class="item-type"
|
||||
:class="'color-'+item.type">{{
|
||||
$dict.getLabel('leaveMessageType', item.type)
|
||||
}}</span>{{ item.title }}
|
||||
</p>
|
||||
<div>
|
||||
<span>提问人:{{ item.leaveName }}</span>
|
||||
<span>{{ ittem.createTime }}</span>
|
||||
</div>
|
||||
<img :src="'https://cdn.cunwuyun.cn/dvcp/question/status'+item.status+'.png'" alt="" class="item-status">
|
||||
</div>
|
||||
<AiEmpty v-if="!messageList.length" class="pad-t168"/>
|
||||
</div>
|
||||
<u-select v-model="leaveMessageTypeShow" :list="leaveMessageTypeList" @confirm="confirmMessageType"
|
||||
confirm-color="#07c160"></u-select>
|
||||
<u-picker v-model="timeSelectShow" mode="time" :params="params" :start-year="startDate" :end-year="endDate"
|
||||
:default-selector="defaultDate"
|
||||
confirm-color="#07c160" @confirm="timeSelectConfirm"></u-picker>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {mapState} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: "my",
|
||||
computed: {
|
||||
...mapState(['user', 'token'])
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tabList: ['全部', '待回复', '已回复', '处理完成'],
|
||||
tabIndex: 0,
|
||||
status: '',
|
||||
inputValue: '',
|
||||
timeSelectShow: false,
|
||||
params: {
|
||||
year: true,
|
||||
month: true,
|
||||
day: false,
|
||||
hour: false,
|
||||
minute: false,
|
||||
second: false,
|
||||
},
|
||||
startYear: '',
|
||||
endYear: '',
|
||||
defaultDate: [],
|
||||
searchTime: '',
|
||||
leaveMessageTypeShow: false,
|
||||
leaveMessageTypeList: [],
|
||||
type: '',
|
||||
typeName: '',
|
||||
messageList: []
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.$dict.load('leaveMessageType').then((res) => {
|
||||
this.$nextTick(() => {
|
||||
this.$dict.getDict('leaveMessageType').map(i => {
|
||||
var item = {
|
||||
label: i.dictName,
|
||||
value: i.dictValue
|
||||
}
|
||||
this.leaveMessageTypeList.push(item)
|
||||
})
|
||||
})
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.messageList = []
|
||||
var searchParams = {
|
||||
createTime: this.searchTime ? this.searchTime + "08" + ' ' + '00' + ":" + "00" + ":" + "00" : '',
|
||||
title: this.inputValue,
|
||||
type: this.type,
|
||||
status: this.status,
|
||||
userType: 0,//小程序用户
|
||||
openId: this.user.openId
|
||||
}
|
||||
this.$instance.post(`/app/appleavemessage/listForWx`, searchParams).then(res => {
|
||||
if (res.data.records) {
|
||||
res.data.records.map((item) => {
|
||||
// var reg = new RegExp('(?<=.).', 'g')
|
||||
// item.leaveName = item.leaveName.replace(reg, '*')
|
||||
item.leaveName = item.leaveName.substring(0, 1) + '**'
|
||||
})
|
||||
this.messageList = res.data.records
|
||||
}
|
||||
})
|
||||
},
|
||||
timeSelectConfirm(e) {
|
||||
this.searchTime = e.year + '-' + e.month
|
||||
this.getList()
|
||||
},
|
||||
confirmMessageType(e) {
|
||||
this.typeName = e[0].label
|
||||
this.type = e[0].value
|
||||
this.getList()
|
||||
},
|
||||
getDate(type) {
|
||||
const date = new Date();
|
||||
let year = date.getFullYear();
|
||||
if (type === 'start') {
|
||||
year = year - 10;
|
||||
} else if (type === 'end') {
|
||||
year = year;
|
||||
}
|
||||
return `${year}`;
|
||||
},
|
||||
toDetail(id) {
|
||||
this.$linkTo(`./detail?id=${id}`)
|
||||
},
|
||||
tabClick(index) {
|
||||
this.tabIndex = index
|
||||
if (!this.tabIndex) {
|
||||
this.status = ''
|
||||
} else {
|
||||
this.status = this.tabIndex - 1
|
||||
}
|
||||
this.getList()
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
@import "../../common/common.scss";
|
||||
|
||||
.page {
|
||||
width: 100%;
|
||||
background-color: #F3F6F9;
|
||||
|
||||
.please-list {
|
||||
padding: 336px 32px 144px;
|
||||
|
||||
.item {
|
||||
width: 686px;
|
||||
background: #FFF;
|
||||
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.02);
|
||||
border-radius: 8px;
|
||||
padding: 32px;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 32px;
|
||||
position: relative;
|
||||
|
||||
.item-title {
|
||||
word-break: break-all;
|
||||
line-height: 44px;
|
||||
color: #333;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
margin-bottom: 16px;
|
||||
|
||||
.item-type {
|
||||
border-radius: 8px;
|
||||
padding: 8px 8px 4px;
|
||||
font-size: 26px;
|
||||
line-height: 36px;
|
||||
margin-right: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
div {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
color: #999;
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.item-status {
|
||||
width: 136px;
|
||||
height: 136px;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.color-0 {
|
||||
background: #FFEBEF;
|
||||
color: #F46;
|
||||
}
|
||||
|
||||
.color-1 {
|
||||
background: #E8EFFF;
|
||||
color: #26f;
|
||||
}
|
||||
|
||||
.color-2 {
|
||||
background: #E8EFFF;
|
||||
color: #26f;
|
||||
}
|
||||
|
||||
.fixed-top {
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
161
src/mods/AppPlease/reply.vue
Normal file
161
src/mods/AppPlease/reply.vue
Normal file
@@ -0,0 +1,161 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="pad-b112">
|
||||
<div class="bg-197DF0"></div>
|
||||
<div class="add-form">
|
||||
<div class="form-item">
|
||||
<span class="item-tips">*</span>
|
||||
<span class="label">留言内容</span>
|
||||
<div class="item-input title-line">
|
||||
<u-input type="textarea" height="200" placeholder="请输入留言内容(500字以内)" placeholder-style="color:#999;"
|
||||
maxlength="500" v-model="content"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-item">
|
||||
<span class="item-tips"></span>
|
||||
<span class="label">图片上传<span class="mini-label">(最多9张)</span></span>
|
||||
<div class="upload">
|
||||
<AiUploader :limit="9" v-model="files"></AiUploader>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fixed-bottom confirm-btn" @click="reply">提交</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import AiUploader from '@/components/AiUploader/AiUploader'
|
||||
import {mapState} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: "my",
|
||||
components: {
|
||||
AiUploader
|
||||
},
|
||||
computed: {
|
||||
...mapState(['user', 'token'])
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
content: '',
|
||||
files: [],
|
||||
avatarUrl: ''
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.msgCode = options.code
|
||||
this.avatarUrl = this.user.avatarUrl
|
||||
},
|
||||
methods: {
|
||||
reply() {
|
||||
if (!this.content) {
|
||||
return this.$toast('请输入留言内容')
|
||||
}
|
||||
var params = {
|
||||
"content": this.content,
|
||||
"images": JSON.stringify(this.files),
|
||||
"msgCode": this.msgCode,
|
||||
"userType": 0,
|
||||
'headPortrait': this.avatarUrl
|
||||
}
|
||||
this.$instance.post(`/app/appleavemessagereply/addOrUpdateForWX`, params).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.showModal({
|
||||
title: '留言回复成功',
|
||||
confirmText: "查看详情",
|
||||
confirmColor: "#197DF0",
|
||||
showCancel: false,
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
uni.navigateBack()
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
@import "../../common/common.scss";
|
||||
|
||||
.page {
|
||||
width: 100%;
|
||||
background-color: #F3F6F9;
|
||||
|
||||
.pad-b112 {
|
||||
padding-bottom: 112px;
|
||||
}
|
||||
|
||||
.bg-197DF0 {
|
||||
width: 100%;
|
||||
height: 112px;
|
||||
background: #197DF0;
|
||||
}
|
||||
|
||||
.add-form {
|
||||
width: 686px;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.02);
|
||||
border-radius: 8px;
|
||||
margin: -68px 0 032px;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
padding: 34px 32px 012px;
|
||||
line-height: 44px;
|
||||
|
||||
.item-tips {
|
||||
display: inline-block;
|
||||
width: 12px;
|
||||
font-size: 32px;
|
||||
color: #FF4466;
|
||||
}
|
||||
|
||||
.label {
|
||||
display: inline-block;
|
||||
min-width: 126px;
|
||||
color: #333;
|
||||
font-size: 32px;
|
||||
margin-left: 8px;
|
||||
|
||||
.mini-label {
|
||||
color: #999;
|
||||
font-size: 28px;
|
||||
}
|
||||
}
|
||||
|
||||
.value {
|
||||
display: inline-block;
|
||||
width: 520px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.right-icon {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
margin-left: 8px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.item-input {
|
||||
padding-bottom: 4px;
|
||||
margin-left: 24px input {
|
||||
line-height: 42px;
|
||||
margin-top: 32px;
|
||||
}
|
||||
}
|
||||
|
||||
.upload {
|
||||
margin: 32px 0 024px;
|
||||
padding-bottom: 32px;
|
||||
}
|
||||
}
|
||||
|
||||
.mar-b8 {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user