| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431 |
- <template>
- <view>
- <view class="status_bar"></view>
- <view style="position: fixed;z-index: 100;top: 44px;">
- <uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回" title="售后系统" rightIcon="search"
- @clickRight="clickRight"></uni-nav-bar>
- <view class="inputs" :style="{'width':width+'rpx'}">
- <input type="text" value="" placeholder="请输入设备ID或设备名称" v-model="imports" @input="searchinp"
- class="inputbox" :clearable="false" />
- <u-icon name="search" size="40" class="icon" @click="search"></u-icon>
- </view>
- </view>
- <image :src="$imageURL+'/bigdata_app/image/afterSale/dcd7147f4b15d00c5c90006738b8453.png'"
- class="expertimages"></image>
- <view class="loading" v-if="loadingtf">
- <image src="../../static/images/ajax-loader.gif" mode="" class="img"></image>
- </view>
- <view class="aftersaleTF" v-if="aftersaleTF">
- 暂无数据
- </view>
- <view class="aftersale" v-else>
- <view class="aftersale_item" v-for="(item,index) in faultdata" :key="index">
- <view class="aftersale_item_title">
- <u-icon name="calendar" color="#71D8AF" size="34"></u-icon>
- <span>设备 ID:{{item.device_id}}</span>
- </view>
- <view class="aftersale_item_con">
- <p>设备类型:{{devtype[item.device_type]}}</p>
- <p>联系人:{{item.user?item.user:"无"}}</p>
- <p>联系电话:{{item.userphone?item.userphone:"无"}}</p>
- <p>位置:{{item.addr?item.addr:"无"}}</p>
- <!-- <p>故障上报时间:{{item.uptime|timeFormat()}}</p> -->
- <p>故障信息:{{item.errordesc}}</p>
- </view>
- <view class="aftersale_item_operate">
- <view class="aftersale_item_operate_tiem">
- {{item.uptime|timeFormat()}}
- </view>
- <view class="aftersale_item_operate_btn">
- <button :class="item.errorimg.length!=0?'imgs':'none'" :disabled="item.errorimg.length==0"
- @click="faultImg(item.errorimg)">图片</button>
- <button :class="item.errorvideo?'video':'none'" :disabled="!item.errorvideo"
- @click="faultVideo(item.errorvideo)">视频</button>
- </view>
- <!-- <button :class="item.errordesc?'fault':'none'" :disabled="!item.errordesc"
- @click="fault(item.errordesc)">故障原因</button> -->
- </view>
- </view>
- </view>
- <view class="addindent" @click="addf">
- 新 增 售 后 单
- </view>
- <u-modal v-model="show" :mask-close-able="maskcloseable" :show-confirm-button="showconfirmbutton" :title="title"
- class="model">
- <view class="model_box">
- <p v-if="faultinfo_tf">{{faultinfo}}</p>
- <u-swiper :list="faultimg" v-if="faultimg_tf" class="uswiper" height="400" style="width: 100%;"
- @click="examine(faultimg)"></u-swiper>
- <video :src="BASE_URL+faultvideo" controls v-if="faultvideo_tf" style="width:90%;"></video>
- </view>
- </u-modal>
- <view class="top" v-if="isTop" @click="top">
- <image :src="$imageURL+'/bigdata_app/image/6209a98f0cb3b5086f2ca36152c9269.png'" mode="">
- </image>
- </view>
- </view>
- </template>
- <script>
- import {
- Debounce,
- Throttle
- } from "../../util/anitthro.js"
- export default {
- data() {
- return {
- BASE_URL: 'http://8.136.98.49:8002',
- faultdata: [],
- title: "", //弹框标题
- show: false, //弹框先显示
- maskcloseable: true,
- showconfirmbutton: false,
- faultinfo: '', //故障信息
- faultinfo_tf: false, //故障信息显示
- faultvideo: '', //故障视频
- faultvideo_tf: false, //故障视频显示
- faultimg: [], //故障图片
- faultimg_tf: false, //故障图片显示
- page: 1,
- aftersaleTF: true,
- isTop: false,
- imports: "", //搜索设备id
- width: 0, //顶部搜索框的宽度
- loadingtf: false, //loading
- devtype: {
- }
- }
- },
- methods: {
- async getAftersale() {
- this.loadingtf = true
- const res = await this.$myRequest({
- url: '/api/api_gateway?method=after_sale.after_sale_manage.aftersale_info',
- data: {
- page: this.page,
- f_id: Number(this.imports)
- }
- })
- this.loadingtf = false
- if (res.counts == 0) {
- this.aftersaleTF = true
- } else {
- this.aftersaleTF = false
- }
- this.faultdata = this.faultdata.concat(res.data)
- for (var i = 0; i < this.faultdata.length; i++) {
- if (this.faultdata[i].errorimg) {
- if (!Array.isArray(this.faultdata[i].errorimg)) {
- this.faultdata[i].errorimg = JSON.parse(this.faultdata[i].errorimg)
- }
- } else {
- this.faultdata[i].errorimg = []
- }
- }
- console.log(res)
- },
- fault(info) { //查看故障信息
- this.title = "故障信息"
- this.show = true
- this.faultinfo = info
- this.faultimg_tf = false
- this.faultinfo_tf = true
- this.faultvideo_tf = false
- },
- faultImg(info) { //查看故障图片
- this.faultimg = []
- for (var i = 0; i < info.length; i++) {
- let obj = {}
- obj.image = info[i]
- this.faultimg.push(obj)
- }
- console.log(this.faultimg)
- this.title = "故障图片"
- this.show = true
- this.faultimg_tf = true
- this.faultinfo_tf = false
- this.faultvideo_tf = false
- },
- faultVideo(info) { //查看故障视频
- this.title = "故障视频"
- if (info.indexOf("[") != -1) {
- this.faultvideo = JSON.parse(info)[0]
- } else {
- this.faultvideo = info
- }
- console.log(this.faultvideo)
- this.show = true
- this.faultimg_tf = false
- this.faultinfo_tf = false
- this.faultvideo_tf = true
- },
- clickRight() { //搜索
- this.width = 600
- },
- addf() { //添加
- uni.navigateTo({
- url: "./addafter"
- })
- },
- clickLeft() {
- uni.switchTab({
- url: "../index/index"
- })
- },
- examine(url) {
- var imgarr = []
- for (var i = 0; i < url.length; i++) {
- imgarr.push(url[i].image)
- }
- console.log(imgarr)
- uni.previewImage({
- urls: imgarr
- });
- },
- top() {
- uni.pageScrollTo({
- scrollTop: 0,
- duration: 500
- })
- },
- search() { //搜索按钮搜索
- this.faultdata = []
- this.getAftersale()
- },
- searchinp() { //自动搜索
- Debounce(() => {
- this.faultdata = []
- this.getAftersale()
- }, 1000)()
- },
- async getdevtype() {
- const res = await this.$myRequest({
- url: '/api/api_gateway?method=home.homes.user_device_type',
- data: {}
- })
- console.log(res)
- for (var i = 0; i < res.length; i++) {
- this.devtype[res[i].id] = res[i].type_name
- }
- console.log(this.devtype)
- }
- },
- onLoad() {
- this.getdevtype()
- },
- onShow() {
- this.page = 1
- this.faultdata = []
- this.getAftersale()
- },
- onReachBottom() {
- this.page++
- this.getAftersale()
- },
- onPageScroll(e) { //nvue暂不支持滚动监听,可用bindingx代替
- if (e.scrollTop > 200) { //距离大于200时显示
- this.isTop = true
- } else { //距离小于200时隐藏
- this.isTop = false
- }
- },
- }
- </script>
- <style lang="scss">
- .expertimages {
- width: 100%;
- height: 154rpx;
- position: fixed;
- top: 88px;
- z-index: 100;
- }
- .aftersale_search {
- position: fixed;
- z-index: 100;
- top: 104rpx;
- right: 20rpx;
- .sp_icon {
- font-size: 36rpx;
- margin-left: 16rpx;
- }
- }
- .aftersaleTF {
- width: 100%;
- position: relative;
- top: 340rpx;
- text-align: center;
- padding-top: 40rpx;
- font-size: 20px;
- }
- .loading {
- position: fixed;
- top: 440px;
- width: 95%;
- left: 2.5%;
- text-align: center;
- .img {
- width: 300rpx;
- height: 40rpx;
- }
- }
- .inputs {
- height: 54rpx;
- background-color: #E4E4E4;
- border-radius: 27rpx;
- position: absolute;
- right: 20rpx;
- top: 24rpx;
- transition: width 0.5s;
- overflow: hidden;
- padding-top: 8rpx;
- box-sizing: border-box;
- .inputbox {
- width: 85%;
- text-indent: 1rem;
- font-size: 26rpx;
- }
- .icon {
- position: absolute;
- top: 8rpx;
- right: 26rpx;
- }
- }
- .aftersale {
- width: 100%;
- position: relative;
- top: 340rpx;
- margin-bottom: 80rpx;
- .aftersale_item {
- width: 90%;
- margin: 0 auto 30rpx;
- box-shadow: 0 0 10rpx #bcb9ca;
- padding: 30rpx 20rpx 20rpx;
- position: relative;
- box-sizing: border-box;
- .aftersale_item_title {
- width: 100%;
- span {
- margin-left: 16rpx;
- font-weight: 700;
- }
- }
- .aftersale_item_con {
- width: 92%;
- margin-left: 8%;
- margin-top: 20rpx;
- p {
- // height: 48rpx;
- line-height: 48rpx;
- font-size: 24rpx;
- color: #7d7d7d;
- }
- }
- .aftersale_item_operate {
- width: 100%;
- display: flex;
- justify-content: space-between;
- margin-top: 20rpx;
- .aftersale_item_operate_btn{
- display: flex;
- }
- .aftersale_item_operate_tiem{
- // line-height: 60rpx;
- height: 60rpx;
- padding-top: 30rpx;
- color: #BEBEBE;
- font-size: 12px;
- box-sizing: border-box;
- }
- button {
- width: 130rpx;
- padding: 0;
- font-size: 24rpx;
- color: #FFFFFF;
- margin-left: 20rpx;
- }
- .fault {
- background-color: #F78E01;
- }
- .imgs {
- background-color: #71CD9A;
- }
- .video {
- background-color: #53C6E6;
- }
- .none {
- background-color: #F3F3F3;
- color: #B4B4B4;
- }
- }
- .aftersale_item_icon {
- position: absolute;
- top: 0;
- right: 36rpx;
- image {
- width: 68rpx;
- height: 64rpx;
- }
- }
- }
- }
- .model {
- width: 90%;
- .model_box {
- width: 90%;
- margin: 40rpx auto 48rpx;
- display: flex;
- justify-content: center;
- }
- }
- .top {
- position: fixed;
- right: 30px;
- bottom: 100px;
- z-index: 100;
- image {
- width: 100rpx;
- height: 100rpx;
- }
- }
- .addindent {
- width: 100%;
- position: fixed;
- bottom: 0;
- left: 0;
- height: 80rpx;
- text-align: center;
- line-height: 80rpx;
- background-color: #71cd9a;
- color: #ffffff;
- font-size: 16px;
- }
- </style>
|