Browse Source

add tid1807 logic

tid1867
刘嘉炜 3 months ago
parent
commit
47407c13b2
  1. 4
      src/manifest.json
  2. 39
      src/pages.json
  3. 5
      src/pages/index/index.vue
  4. 13
      src/pages/menu/forth.vue
  5. BIN
      src/static/images/tab/ta_1.png
  6. BIN
      src/static/images/tab/ta_2.png
  7. BIN
      src/static/images/tab/ta_3.png
  8. BIN
      src/static/images/tab/ta_4.png
  9. BIN
      src/static/images/tab/tab_1.png
  10. BIN
      src/static/images/tab/tab_2.png
  11. BIN
      src/static/images/tab/tab_3.png
  12. BIN
      src/static/images/tab/tab_4.png
  13. 2
      src/subpackage/menu/components/mine/line_tab.vue
  14. 30
      src/subpackage/message/components/detail/answer_item.vue
  15. 27
      src/subpackage/message/components/detail/image_flow.vue
  16. 26
      src/subpackage/message/components/detail/info.vue
  17. 2
      src/subpackage/message/components/edit/upload_img.vue
  18. 1
      src/subpackage/message/components/fixed_button.vue
  19. 12
      src/subpackage/message/components/message_item.vue
  20. 5
      src/subpackage/message/js/api.js
  21. 138
      src/subpackage/message/pages/complaint/detail.vue
  22. 18
      src/subpackage/message/pages/complaint/list.vue
  23. 171
      src/subpackage/message/pages/work_order/detail.vue
  24. 105
      src/subpackage/message/pages/work_order/list.vue
  25. BIN
      src/subpackage/message/static/images/arrow_b2.png
  26. BIN
      src/subpackage/message/static/images/message.png
  27. 8
      src/utils/util.js

4
src/manifest.json

@ -76,7 +76,9 @@
"appid" : "wx7106e84614cf0060", "appid" : "wx7106e84614cf0060",
"setting" : { "setting" : {
"urlCheck" : false, "urlCheck" : false,
"minified" : true
"minified" : true,
"ignoreDevUnusedFiles": false,
"ignoreUploadUnusedFiles": false
}, },
"usingComponents" : true, "usingComponents" : true,
"optimization": { "optimization": {

39
src/pages.json

@ -2,7 +2,11 @@
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages "pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { }
"style": {
"componentPlaceholder": {
"bottom-logo": "view"
}
}
}, },
{ {
"path": "pages/menu/forth", "path": "pages/menu/forth",
@ -924,6 +928,7 @@
{ {
"path": "pages/complaint/list", "path": "pages/complaint/list",
"style" : { "style" : {
"enablePullDownRefresh" : true,
"navigationBarTitleText": "投诉建议" "navigationBarTitleText": "投诉建议"
} }
}, },
@ -934,6 +939,19 @@
} }
}, },
{ {
"path": "pages/work_order/list",
"style" : {
"enablePullDownRefresh" : true,
"navigationBarTitleText": "工单列表"
}
},
{
"path": "pages/work_order/detail",
"style" : {
"navigationBarTitleText": "工单详情"
}
},
{
"path": "pages/work_order/edit", "path": "pages/work_order/edit",
"style" : { "style" : {
"navigationBarTitleText": "提交工单" "navigationBarTitleText": "提交工单"
@ -958,5 +976,24 @@
"navigationBarTitleText": "欧轩智能商家助手", "navigationBarTitleText": "欧轩智能商家助手",
"navigationBarBackgroundColor": "#009874", "navigationBarBackgroundColor": "#009874",
"backgroundColor": "#f2f2f7" "backgroundColor": "#f2f2f7"
},
"tabBar": {
"color": "#B2B2B2",
"selectedColor": "#009874",
"backgroundColor": "#FFFFFF",
"list": [
{
"pagePath": "pages/index/index",
"text": "工作台",
"iconPath": "static/images/tab/tab_1.png",
"selectedIconPath": "static/images/tab/ta_1.png"
},
{
"pagePath": "pages/menu/forth",
"text": "我的",
"iconPath": "static/images/tab/tab_4.png",
"selectedIconPath": "static/images/tab/ta_4.png"
}
]
} }
} }

5
src/pages/index/index.vue

@ -49,6 +49,9 @@
<navigator url="/subpackage/party/pages/login/login">party/pages/login/login</navigator> <navigator url="/subpackage/party/pages/login/login">party/pages/login/login</navigator>
</view> --> </view> -->
</view> </view>
<bottom-logo></bottom-logo>
<view class="ox-dark-mask" v-if="isShowAuthorModal"> <view class="ox-dark-mask" v-if="isShowAuthorModal">
<view class="ic-author-modal"> <view class="ic-author-modal">
<view class="iam-title">微信授权</view> <view class="iam-title">微信授权</view>
@ -88,6 +91,7 @@
import util from '../../utils/util'; import util from '../../utils/util';
import { servers } from '../../js/server'; import { servers } from '../../js/server';
import { API } from '../../js/api'; import { API } from '../../js/api';
import bottomLogo from "@/subpackage/menu/components/bottom_logo.vue";
const tabList = [ const tabList = [
{ {
id: 0, id: 0,
@ -187,6 +191,7 @@
// #endif // #endif
export default { export default {
components: { bottomLogo },
computed: { computed: {
isProfile: _=>util.isProfile(), isProfile: _=>util.isProfile(),
// loginStatus(){ // loginStatus(){

13
src/pages/menu/forth.vue

@ -20,7 +20,7 @@
</template> </template>
</line-tab> </line-tab>
<line-tab :icon-num='4'>总后台(<text class="fm-txt">admin.ouxuanzhineng.cn <text class="ft-copy">复制</text></text>)</line-tab> <line-tab :icon-num='4'>总后台(<text class="fm-txt">admin.ouxuanzhineng.cn <text class="ft-copy">复制</text></text>)</line-tab>
<line-tab :icon-num='5'>投诉建议</line-tab>
<line-tab :icon-num='5' @click="toComplaint">投诉建议</line-tab>
<line-tab :icon-num='6'>解绑退出</line-tab> <line-tab :icon-num='6'>解绑退出</line-tab>
</block> </block>
<bottom-logo></bottom-logo> <bottom-logo></bottom-logo>
@ -31,6 +31,7 @@
import mineHeader from "@/subpackage/menu/components/mine/header.vue"; import mineHeader from "@/subpackage/menu/components/mine/header.vue";
import lineTab from "@/subpackage/menu/components/mine/line_tab.vue"; import lineTab from "@/subpackage/menu/components/mine/line_tab.vue";
import bottomLogo from "@/subpackage/menu/components/bottom_logo.vue"; import bottomLogo from "@/subpackage/menu/components/bottom_logo.vue";
import { routeTo, debounce, showLoad, hideLoad, showModal, showNone } from "@/utils/util.js";
export default { export default {
components:{ components:{
mineHeader, mineHeader,
@ -39,9 +40,19 @@ export default {
}, },
data(){ data(){
return { return {
brand_id: '',
menuPackageLoaded: false menuPackageLoaded: false
} }
}, },
onLoad(options){
this.brand_id = options?.brand_id ?? '';
},
methods: {
toComplaint(){
let { brand_id } = this;
routeTo(`/subpackage/message/pages/complaint/list?brand_id=${brand_id}`, 'nT');
},
}
} }
</script> </script>

BIN
src/static/images/tab/ta_1.png

After

Width: 56  |  Height: 56  |  Size: 558 B

BIN
src/static/images/tab/ta_2.png

After

Width: 56  |  Height: 56  |  Size: 795 B

BIN
src/static/images/tab/ta_3.png

After

Width: 56  |  Height: 56  |  Size: 726 B

BIN
src/static/images/tab/ta_4.png

After

Width: 56  |  Height: 56  |  Size: 553 B

BIN
src/static/images/tab/tab_1.png

After

Width: 56  |  Height: 56  |  Size: 653 B

BIN
src/static/images/tab/tab_2.png

After

Width: 56  |  Height: 56  |  Size: 986 B

BIN
src/static/images/tab/tab_3.png

After

Width: 56  |  Height: 56  |  Size: 939 B

BIN
src/static/images/tab/tab_4.png

After

Width: 56  |  Height: 56  |  Size: 668 B

2
src/subpackage/menu/components/mine/line_tab.vue

@ -1,5 +1,5 @@
<template> <template>
<view class="line-tab">
<view class="line-tab" @click="$emit('click')">
<image class="lt-icon" mode="aspectFit" :src="'/subpackage/menu/static/images/mine_tab/' + iconNum + '.png'"></image> <image class="lt-icon" mode="aspectFit" :src="'/subpackage/menu/static/images/mine_tab/' + iconNum + '.png'"></image>
<view class="lt-right"> <view class="lt-right">
<view class="lr-left"> <view class="lr-left">

30
src/subpackage/message/components/detail/answer_item.vue

@ -1,16 +1,33 @@
<template> <template>
<view class="answer-item">
<view class="answer-item" :class="{ 'active-bg': activeBg }">
<view class="ai-user"> <view class="ai-user">
<view class="au-name">李小小</view>
<view class="au-time">[回复] 20241220 10:12:31</view>
<view class="au-name">{{ name || '-' }}</view>
<view class="au-time">[回复] {{ time || '-' }}</view>
</view> </view>
<view class="ai-content">情况已核实目前正在解决中</view>
<view class="ai-content">{{ content || '-' }}</view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
props: {
name: {
type: String,
default: ''
},
time: {
type: String,
default: ''
},
content: {
type: String,
default: ''
},
activeBg: {
type: Boolean,
default: false
}
}
} }
</script> </script>
@ -19,6 +36,9 @@ export default {
padding: 30upx 22upx; padding: 30upx 22upx;
background: #fff; background: #fff;
border-radius: 10upx; border-radius: 10upx;
&.active-bg{
background: #faeada;
}
} }
.ai-user{ .ai-user{
@include ctf; @include ctf;

27
src/subpackage/message/components/detail/image_flow.vue

@ -1,12 +1,34 @@
<template> <template>
<view class="image-flow"> <view class="image-flow">
<image class="if-img" v-for="i in 5" :key="i"></image>
<image
class="if-img"
v-for="(e, i) in imgs"
:key="i"
:src="e"
mode="aspectFill"
@click="previewImg(e)"
></image>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
props: {
imgs: {
type: Array,
default: ()=>[]
}
},
methods: {
previewImg(url) {
let { imgs } = this;
uni.previewImage({
urls: imgs,
current: url
})
}
}
} }
</script> </script>
@ -17,11 +39,10 @@ export default {
border-radius: 20upx; border-radius: 20upx;
font-size: 0; font-size: 0;
.if-img{ .if-img{
margin: 0 14upx;
margin: 0 12upx;
width: 200upx; width: 200upx;
height: 200upx; height: 200upx;
border-radius: 10upx; border-radius: 10upx;
background: skyblue;
&:nth-of-type(n+4){ &:nth-of-type(n+4){
margin-top: 28upx; margin-top: 28upx;
} }

26
src/subpackage/message/components/detail/info.vue

@ -2,22 +2,35 @@
<view class="detail-info"> <view class="detail-info">
<view class="di-line"> <view class="di-line">
<view class="dl-name">标题</view> <view class="dl-name">标题</view>
<view class="dl-value">门禁开门异常</view>
<view class="dl-value">{{ title || '-' }}</view>
</view> </view>
<view class="di-line"> <view class="di-line">
<view class="dl-name">类型</view> <view class="dl-name">类型</view>
<view class="dl-value">硬件</view>
<view class="dl-value">{{ type || '-' }}</view>
</view> </view>
<view class="di-line"> <view class="di-line">
<view class="dl-name">反馈内容</view> <view class="dl-name">反馈内容</view>
<view class="dl-value">开不了门</view>
<view class="dl-value">{{ content || '-' }}</view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
props: {
title: {
type: String,
default: ''
},
type: {
type: String,
default: ''
},
content: {
type: String,
default: ''
}
},
} }
</script> </script>
@ -27,7 +40,9 @@ export default {
border-radius: 10upx; border-radius: 10upx;
background: #fff; background: #fff;
.di-line{ .di-line{
@include ctf(space-between);
display: flex;
align-items: flex-start;
justify-content: space-between;
&+.di-line{ &+.di-line{
margin-top: 10upx; margin-top: 10upx;
} }
@ -39,7 +54,6 @@ export default {
flex-grow: 1; flex-grow: 1;
text-align: right; text-align: right;
@include flcw(28upx, 40upx, #1a1a1a); @include flcw(28upx, 40upx, #1a1a1a);
@include tHide;
} }
} }
} }

2
src/subpackage/message/components/edit/upload_img.vue

@ -3,7 +3,7 @@
<view class="ui-title">上传照片<text class="ut-txt">(最多上传{{ max }}只支持.jpgpng 格式)</text></view> <view class="ui-title">上传照片<text class="ut-txt">(最多上传{{ max }}只支持.jpgpng 格式)</text></view>
<view class="ui-ls"> <view class="ui-ls">
<view class="ul-item" v-for="(e, i) in imgTemLs" :key="i"> <view class="ul-item" v-for="(e, i) in imgTemLs" :key="i">
<image class="ui-pic" @click="previewImg(e)" mode="aspectFit" :src="e"></image>
<image class="ui-pic" @click="previewImg(e)" mode="aspectFill" :src="e"></image>
<image class="ui-close" @click="delImg(i)" mode="aspectFit" src="/subpackage/message/static/images/close.png"></image> <image class="ui-close" @click="delImg(i)" mode="aspectFit" src="/subpackage/message/static/images/close.png"></image>
</view> </view>
<view class="ul-item ul-add" @click="chooseImg" v-if="max > imgTemLs.length"> <view class="ul-item ul-add" @click="chooseImg" v-if="max > imgTemLs.length">

1
src/subpackage/message/components/fixed_button.vue

@ -17,6 +17,7 @@ export default {
bottom: 0; bottom: 0;
width: 100%; width: 100%;
padding: 10upx 24upx; padding: 10upx 24upx;
@include isPd(10upx);
.fb-btn{ .fb-btn{
@include clearBtn; @include clearBtn;
text-align: center; text-align: center;

12
src/subpackage/message/components/message_item.vue

@ -1,15 +1,15 @@
<template> <template>
<view class="message-item">
<image class="mi-icon"></image>
<view class="message-item" @click="$emit('click:item')">
<image class="mi-icon" mode="aspectFit" src="/subpackage/message/static/images/message.png"></image>
<view class="mi-content"> <view class="mi-content">
<view class="mc-info"> <view class="mc-info">
<view class="mi-top"> <view class="mi-top">
<view class="mt-title">{{ title || '-' }}</view> <view class="mt-title">{{ title || '-' }}</view>
<view class="mt-tag" v-if="status">{{ status || '-' }}</view> <view class="mt-tag" v-if="status">{{ status || '-' }}</view>
</view> </view>
<view class="mi-content">{{ content || '-' }}</view>
<view class="mi-text">{{ content || '-' }}</view>
</view> </view>
<image class="mc-arrow"></image>
<image class="mc-arrow" mode="aspectFit" src="/subpackage/message/static/images/arrow_b2.png"></image>
</view> </view>
</view> </view>
</template> </template>
@ -44,7 +44,6 @@ export default {
margin-right: 24upx; margin-right: 24upx;
width: 108upx; width: 108upx;
height: 108upx; height: 108upx;
background: skyblue;
} }
.mi-content{ .mi-content{
flex-grow: 1; flex-grow: 1;
@ -67,7 +66,7 @@ export default {
@include flcw(24upx, 34upx, $mColor); @include flcw(24upx, 34upx, $mColor);
} }
} }
.mi-content{
.mi-text{
margin-top: 18upx; margin-top: 18upx;
@include flcw(28upx, 40upx, #9C9C9F); @include flcw(28upx, 40upx, #9C9C9F);
@include tHide(2); @include tHide(2);
@ -80,7 +79,6 @@ export default {
margin-top: 8upx; margin-top: 8upx;
width: 28upx; width: 28upx;
height: 28upx; height: 28upx;
background: skyblue;
} }
} }
} }

5
src/subpackage/message/js/api.js

@ -4,7 +4,12 @@ export const MESSAGE_API = {
zs_message_imgs:`${ORIGIN}/upload/file/zs_message_imgs`, // 投诉/工单图片 zs_message_imgs:`${ORIGIN}/upload/file/zs_message_imgs`, // 投诉/工单图片
complaintSubmit:`${ORIGIN}/admin/assistant/complaint/submit`, // 投诉提交 complaintSubmit:`${ORIGIN}/admin/assistant/complaint/submit`, // 投诉提交
complaintList:`${ORIGIN}/admin/assistant/complaint/list`, // 投诉列表 complaintList:`${ORIGIN}/admin/assistant/complaint/list`, // 投诉列表
complaintInfo:`${ORIGIN}/admin/assistant/complaint/info`, // 投诉详情
complaintReply:`${ORIGIN}/admin/assistant/complaint/reply`, // 投诉回复
workorderSubmit:`${ORIGIN}/admin/assistant/workorder/submit`, // 工单提交 workorderSubmit:`${ORIGIN}/admin/assistant/workorder/submit`, // 工单提交
workorderList:`${ORIGIN}/admin/assistant/workorder/list`, // 工单列表
workorderInfo:`${ORIGIN}/admin/assistant/workorder/info`, // 工单详情
workorderReply:`${ORIGIN}/admin/assistant/workorder/reply`, // 工单回复
} }

138
src/subpackage/message/pages/complaint/detail.vue

@ -1,14 +1,28 @@
<template> <template>
<view class="complaint-detail"> <view class="complaint-detail">
<view class="top-status">当前状态xxx处理中</view>
<view class="top-status">当前状态{{ orderInfo.status || '-' }}</view>
<view class="heigh-space" style="height: 24upx;"></view> <view class="heigh-space" style="height: 24upx;"></view>
<detail-info></detail-info>
<detail-info
:title="orderInfo.title || '-'"
:type="orderInfo.type || '-'"
:content="orderInfo.content || '-'"
></detail-info>
<block v-if="imgArr.length">
<view class="heigh-space" style="height: 24upx;"></view>
<image-flow :imgs="imgArr"></image-flow>
</block>
<view class="heigh-space" style="height: 24upx;"></view> <view class="heigh-space" style="height: 24upx;"></view>
<image-flow></image-flow>
<view class="heigh-space" style="height: 24upx;"></view>
<button class="right-btn">回复</button>
<view class="heigh-space" style="height: 24upx;"></view>
<answer-item></answer-item>
<button class="right-btn" @click="replyBtn">回复</button>
<block v-for="(e, i) in commentArr" :key="i">
<view class="heigh-space" style="height: 24upx;"></view>
<answer-item
:name="e.user_name || ''"
:time="e.reply_time || ''"
:content="e.content || ''"
:active-bg="e.is_creator"
></answer-item>
</block>
</view> </view>
</template> </template>
@ -16,16 +30,126 @@
import detailInfo from "../../components/detail/info.vue"; import detailInfo from "../../components/detail/info.vue";
import imageFlow from "../../components/detail/image_flow.vue"; import imageFlow from "../../components/detail/image_flow.vue";
import answerItem from "../../components/detail/answer_item.vue"; import answerItem from "../../components/detail/answer_item.vue";
import { routeTo, debounce, showLoad, hideLoad, showModal, showNone } from "@/utils/util.js";
import { MESSAGE_API } from "../../js/api.js";
import server from "../../js/server.js";
export default { export default {
components: { components: {
detailInfo, imageFlow, answerItem detailInfo, imageFlow, answerItem
}, },
computed: {
imgArr(){
let { orderInfo } = this;
let _showimgs = orderInfo?.showimgs ?? [];
return _showimgs;
},
commentArr(){
let { orderInfo } = this;
let _comment = orderInfo?.comment ?? [];
return _comment;
}
},
data(){
return {
orderInfo: {}
}
},
onLoad(options){
this.complaintInfo({
brand_id: options?.brand_id ?? '',
id: options?.id ?? ''
})
},
methods: {
replyBtn(){
let { orderInfo } = this;
showModal({
title: '回复',
showCancel: true,
editable: true,
placeholderText: '请输入回复内容',
success: mRes=>{
console.log('replyBtn mRes --->', mRes);
if(mRes?.confirm && mRes?.content)this.complaintReply({
brand_id: orderInfo?.brand_id ?? '',
id: orderInfo?.id ?? '',
reply_text: mRes?.content ?? ''
})
.then(res =>{
if(res === 'success'){
setTimeout(_=>{
this.complaintInfo({
brand_id: orderInfo?.brand_id ?? '',
id: orderInfo?.id ?? ''
})
}, 1000);
}
})
}
})
},
complaintInfo({ brand_id, id }){
showLoad();
return server.post({
url: MESSAGE_API.complaintInfo,
data: { brand_id: +brand_id, id: +id },
isDefaultGet: false,
})
.then(res => {
hideLoad();
let _data = res?.data || {};
if(_data.code === 0){
let _info = _data?.data ?? {};
return this.orderInfo = _info;
}else{
return Promise.reject(_data);
}
})
.catch(err => {
hideLoad();
showModal({
title: '提示',
content: err.message || '加载失败!'
})
console.warn('subpackage message pages complaint detail complaintInfo err --->', err);
// return Promise.reject(err);
})
},
complaintReply({ brand_id, id, reply_text }){
showLoad();
return server.post({
url: MESSAGE_API.complaintReply,
data: { brand_id: +brand_id, id: +id, reply_text },
isDefaultGet: false,
})
.then(res => {
hideLoad();
let _data = res?.data || {};
if(_data.code === 0){
showNone(_data?.message ?? '回复成功!');
return 'success'
}else{
return Promise.reject(_data);
}
})
.catch(err => {
hideLoad();
showModal({
title: '提示',
content: err.message || '操作失败!'
})
console.warn('subpackage message pages complaint detail complaintReply err --->', err);
// return Promise.reject(err);
})
},
},
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.complaint-detail{ .complaint-detail{
padding: 24upx; padding: 24upx;
@include isPd(24upx);
} }
.top-status{ .top-status{
padding: 0 24upx; padding: 0 24upx;

18
src/subpackage/message/pages/complaint/list.vue

@ -6,6 +6,7 @@
:title="e.title" :title="e.title"
:status="e.status" :status="e.status"
:content="e.content" :content="e.content"
@click:item="itemClick(e)"
></message-item> ></message-item>
<view style="height: 24rpx;"></view> <view style="height: 24rpx;"></view>
</block> </block>
@ -29,6 +30,7 @@ export default {
return { return {
brand_id: '', brand_id: '',
listData: [], listData: [],
page: 1
} }
}, },
onLoad(options){ onLoad(options){
@ -36,7 +38,23 @@ export default {
this.brand_id = _bid; this.brand_id = _bid;
this.complaintList({ brand_id: _bid }); this.complaintList({ brand_id: _bid });
}, },
async onPullDownRefresh(){
let { brand_id } = this;
this.listData = [];
this.page = 1;
await this.complaintList({ brand_id });
uni.stopPullDownRefresh();
},
onReachBottom(){
let { page, brand_id } = this;
this.complaintList({ page: page + 1, brand_id });
},
methods: { methods: {
itemClick(e){
let { brand_id } = this;
let _qryStr = `brand_id=${brand_id ?? ''}&id=${e?.id ?? ''}`;
routeTo(`/subpackage/message/pages/complaint/detail?${_qryStr}`, 'nT');
},
clickBtn(){ clickBtn(){
let { brand_id } = this; let { brand_id } = this;
routeTo(`/subpackage/message/pages/complaint/edit?brand_id=${brand_id ?? ''}`, 'nT'); routeTo(`/subpackage/message/pages/complaint/edit?brand_id=${brand_id ?? ''}`, 'nT');

171
src/subpackage/message/pages/work_order/detail.vue

@ -0,0 +1,171 @@
<template>
<view class="complaint-detail">
<view class="top-status">当前状态{{ orderInfo.status || '-' }}</view>
<view class="heigh-space" style="height: 24upx;"></view>
<detail-info
:title="orderInfo.title || '-'"
:type="orderInfo.type || '-'"
:content="orderInfo.content || '-'"
></detail-info>
<block v-if="imgArr.length">
<view class="heigh-space" style="height: 24upx;"></view>
<image-flow :imgs="imgArr"></image-flow>
</block>
<view class="heigh-space" style="height: 24upx;"></view>
<button class="right-btn" @click="replyBtn">回复</button>
<block v-for="(e, i) in commentArr" :key="i">
<view class="heigh-space" style="height: 24upx;"></view>
<answer-item
:name="e.user_name || ''"
:time="e.reply_time || ''"
:content="e.content || ''"
:active-bg="e.is_creator"
></answer-item>
</block>
</view>
</template>
<script>
import detailInfo from "../../components/detail/info.vue";
import imageFlow from "../../components/detail/image_flow.vue";
import answerItem from "../../components/detail/answer_item.vue";
import { routeTo, debounce, showLoad, hideLoad, showModal, showNone } from "@/utils/util.js";
import { MESSAGE_API } from "../../js/api.js";
import server from "../../js/server.js";
export default {
components: {
detailInfo, imageFlow, answerItem
},
computed: {
imgArr(){
let { orderInfo } = this;
let _showimgs = orderInfo?.showimgs ?? [];
return _showimgs;
},
commentArr(){
let { orderInfo } = this;
let _comment = orderInfo?.comment ?? [];
return _comment;
}
},
data(){
return {
orderInfo: {}
}
},
onLoad(options){
this.workorderInfo({
brand_id: options?.brand_id ?? '',
id: options?.id ?? ''
})
},
methods: {
replyBtn(){
let { orderInfo } = this;
showModal({
title: '回复',
showCancel: true,
editable: true,
placeholderText: '请输入回复内容',
success: mRes=>{
console.log('replyBtn mRes --->', mRes);
if(mRes?.confirm && mRes?.content)this.workorderReply({
brand_id: orderInfo?.brand_id ?? '',
id: orderInfo?.id ?? '',
reply_text: mRes?.content ?? ''
})
.then(res =>{
if(res === 'success'){
setTimeout(_=>{
this.workorderInfo({
brand_id: orderInfo?.brand_id ?? '',
id: orderInfo?.id ?? ''
})
}, 1000);
}
})
}
})
},
workorderInfo({ brand_id, id }){
showLoad();
return server.post({
url: MESSAGE_API.workorderInfo,
data: { brand_id: +brand_id, id: +id },
isDefaultGet: false,
})
.then(res => {
hideLoad();
let _data = res?.data || {};
if(_data.code === 0){
let _info = _data?.data ?? {};
return this.orderInfo = _info;
}else{
return Promise.reject(_data);
}
})
.catch(err => {
hideLoad();
showModal({
title: '提示',
content: err.message || '加载失败!'
})
console.warn('subpackage message pages work_order detail workorderInfo err --->', err);
// return Promise.reject(err);
})
},
workorderReply({ brand_id, id, reply_text }){
showLoad();
return server.post({
url: MESSAGE_API.workorderReply,
data: { brand_id: +brand_id, id: +id, reply_text },
isDefaultGet: false,
})
.then(res => {
hideLoad();
let _data = res?.data || {};
if(_data.code === 0){
showNone(_data?.message ?? '回复成功!');
return 'success'
}else{
return Promise.reject(_data);
}
})
.catch(err => {
hideLoad();
showModal({
title: '提示',
content: err.message || '操作失败!'
})
console.warn('subpackage message pages work_order detail workorderReply err --->', err);
// return Promise.reject(err);
})
},
},
}
</script>
<style lang="scss">
.complaint-detail{
padding: 24upx;
@include isPd(24upx);
}
.top-status{
padding: 0 24upx;
text-align: center;
border-radius: 10upx;
background: #fff;
@include tHide;
@include flcw(28upx, 84upx, #1A1A1A);
}
.right-btn{
margin-left: auto;
margin-right: 0upx;
width: 192upx;
text-align: center;
border-radius: 10upx;
background: $mColor;
@include flcw(32upx, 88upx, #FFFFFF);
}
</style>

105
src/subpackage/message/pages/work_order/list.vue

@ -0,0 +1,105 @@
<template>
<view class="complaint-list">
<view class="cl-ls">
<block v-for="(e, i) in listData" :key="i">
<message-item
:title="e.title"
:status="e.status"
:content="e.content"
@click:item="itemClick(e)"
></message-item>
<view style="height: 24rpx;"></view>
</block>
</view>
<fixed-button @click="clickBtn"></fixed-button>
</view>
</template>
<script>
import fixedButton from "../../components/fixed_button.vue";
import messageItem from "../../components/message_item.vue";
import { routeTo, debounce, showLoad, hideLoad, showModal, showNone } from "@/utils/util.js";
import { MESSAGE_API } from "../../js/api.js";
import server from "../../js/server.js";
export default {
components: {
fixedButton,
messageItem,
},
data(){
return {
brand_id: '',
listData: [],
page: 1
}
},
onLoad(options){
let _bid = options?.brand_id ?? '';
this.brand_id = _bid;
this.workorderList({ brand_id: _bid });
},
async onPullDownRefresh(){
let { brand_id } = this;
this.listData = [];
this.page = 1;
await this.workorderList({ brand_id });
uni.stopPullDownRefresh();
},
onReachBottom(){
let { page, brand_id } = this;
this.workorderList({ page: page + 1, brand_id });
},
methods: {
itemClick(e){
let { brand_id } = this;
let _qryStr = `brand_id=${brand_id ?? ''}&id=${e?.id ?? ''}`;
routeTo(`/subpackage/message/pages/work_order/detail?${_qryStr}`, 'nT');
},
clickBtn(){
let { brand_id } = this;
routeTo(`/subpackage/message/pages/work_order/edit?brand_id=${brand_id ?? ''}`, 'nT');
},
workorderList({ brand_id, page = 1, page_size = 20}){
showLoad();
return server.post({
url: MESSAGE_API.workorderList,
data: { brand_id: +brand_id, page, page_size },
isDefaultGet: false,
})
.then(res => {
hideLoad();
let _data = res?.data || {};
if(_data.code === 0){
let _ls = _data?.data ?? [];
if(page === 1)return this.listData = _ls;
if(!_ls.length)return showNone('没有更多!');
this.page = page;
this.listData = [ ...this.listData, ..._ls ];
return _ls;
}else{
return Promise.reject(_data);
}
})
.catch(err => {
hideLoad();
showModal({
title: '提示',
content: err.message || '加载失败!'
})
console.warn('subpackage message pages work_order list workorderList err --->', err);
// return Promise.reject(err);
})
},
}
}
</script>
<style lang="scss">
.complaint-list{
@include isPd(132upx);
.cl-ls{
padding: 28upx 24upx 0;
}
}
</style>

BIN
src/subpackage/message/static/images/arrow_b2.png

After

Width: 15  |  Height: 15  |  Size: 226 B

BIN
src/subpackage/message/static/images/message.png

After

Width: 54  |  Height: 54  |  Size: 959 B

8
src/utils/util.js

@ -80,7 +80,9 @@ export function showModal({
confirmColor='#009874', confirmColor='#009874',
success, success,
fail, fail,
complete
complete,
editable = false,
placeholderText = ''
}){ }){
uni.showModal({ uni.showModal({
title, title,
@ -91,7 +93,9 @@ export function showModal({
confirmText, confirmText,
success, success,
fail, fail,
complete
complete,
editable,
placeholderText,
}) })
} }

Loading…
Cancel
Save