|
|
@@ -0,0 +1,323 @@
|
|
|
+<template>
|
|
|
+ <view>
|
|
|
+ <view style="position: fixed;z-index: 100;">
|
|
|
+ <uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回" title="设备报修"></uni-nav-bar>
|
|
|
+ </view>
|
|
|
+ <view class="addafter_con">
|
|
|
+ <view class="addafter_con_top">
|
|
|
+ <p>基本信息</p>
|
|
|
+ <input type="number" v-model="adddata.id" placeholder="请填写设备ID" placeholder-style="color: #62BF89;font-size:24rpx"
|
|
|
+ @blur="addID" />
|
|
|
+ <input type="select" v-model="adddata.type" placeholder="请选择设备类型" placeholder-style="color: #62BF89;font-size:24rpx"
|
|
|
+ @click="show = true" disabled />
|
|
|
+ <input type="text" v-model="adddata.name" placeholder="请填写联系人名称" placeholder-style="color: #62BF89;font-size:24rpx" />
|
|
|
+ <input type="number" v-model="adddata.phone" placeholder="请填写联系人电话" placeholder-style="color: #62BF89;font-size:24rpx"
|
|
|
+ @blur="iphone" />
|
|
|
+ <input type="text" v-model="adddata.site" placeholder="请填写联系人地址" placeholder-style="color: #62BF89;font-size:24rpx" />
|
|
|
+ <u-action-sheet :list="actionSheetList" v-model="show" @click="actionSheetCallback"></u-action-sheet>
|
|
|
+ </view>
|
|
|
+ <view class="addafter_con_connect">
|
|
|
+ <image src="../../static/image/afterSale/5d9b8db91f11175aa5277fef40581ab.png" mode=""></image>
|
|
|
+ <image src="../../static/image/afterSale/5d9b8db91f11175aa5277fef40581ab.png" mode=""></image>
|
|
|
+ </view>
|
|
|
+ <view class="addafter_con_bot">
|
|
|
+ <p class="addafter_con_bot_title">保修详情</p>
|
|
|
+ <textarea v-model="adddata.text" placeholder="请描述设备问题" class="textarea" placeholder-style="color: #62BF89;font-size:26rpx" />
|
|
|
+ <p style="color: #808080;font-size: 24rpx;">{{adddata.text.length}}/140</p>
|
|
|
+ <view class="imgvideo">
|
|
|
+ <view class="imgvideo_img" v-for="(item,index) in 3">
|
|
|
+ <view @click="gainimg(index)">
|
|
|
+ <image src="../../static/image/afterSale/eee1e84bb85f6f6ff5c5866a3a42779.png" mode="" v-if="!uploadingTF[index]"></image>
|
|
|
+ </view>
|
|
|
+ <view class="uploading" v-if="uploadingTF[index]">
|
|
|
+ <u-icon name="close" class="delete" @click="deletes(index)"></u-icon>
|
|
|
+ <image :src="imageList[index]" mode="" class="uploading"></image>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="imgvideo_video" v-for="(item,index) in 3">
|
|
|
+ <view @click="gainvideo(index)">
|
|
|
+ <image src="../../static/image/afterSale/80314eaa07c32e9c76537a8a8224130.png" mode="" v-if="!uploadingTF[index+3]"></image>
|
|
|
+ </view>
|
|
|
+ <view class="uploading" v-if="uploadingTF[index+3]">
|
|
|
+ <u-icon name="close" class="delete" @click="deletes(index+3)"></u-icon>
|
|
|
+ <video :src="selfList[index]" controls class="uploading"></video>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <button @click="btn" :disabled="btnisTorF">提 交</button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+ export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ adddata:{//设备参数
|
|
|
+ id:'',
|
|
|
+ name:'',
|
|
|
+ phone:'',
|
|
|
+ text:'',
|
|
|
+ site:'',
|
|
|
+ type:'',
|
|
|
+ type_id:''
|
|
|
+ },
|
|
|
+ imageList:[],//图片链接
|
|
|
+ // postimageList:[],
|
|
|
+ uploadingTF:[false,false,false,false,false,false],//图片的删除
|
|
|
+ selfList:[],//视频链接
|
|
|
+ actionSheetList: [//设备选项
|
|
|
+ {
|
|
|
+ text: '杀虫灯'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '测报灯'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '智能性诱'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '环境检测'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '监控设备'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '孢子仪'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '性诱设备'
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ show:false,//选择器的显示
|
|
|
+ btnisTorF:false,
|
|
|
+ deviceid:false//设备号判断
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ clickLeft(){//返回
|
|
|
+ uni.navigateTo({
|
|
|
+ url:"./index"
|
|
|
+ })
|
|
|
+ },
|
|
|
+ gainimg(index){//添加图片
|
|
|
+ uni.chooseImage({
|
|
|
+ count: 1, //默认9
|
|
|
+ sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
|
|
+ sourceType: ['album','camera'], //从相册选择
|
|
|
+ success: (res)=> {
|
|
|
+ this.imageList[index]=res.tempFilePaths[0]
|
|
|
+ this.$forceUpdate() //强制刷新视图
|
|
|
+ this.uploadingTF[index]=true
|
|
|
+ // this.postimageList[index]=res.tempFilePaths[0].slice(res.tempFilePaths[0].indexOf(":")+1)
|
|
|
+ uni.getImageInfo({
|
|
|
+ src: res.tempFilePaths[0],
|
|
|
+ success:(image)=>{
|
|
|
+ console.log(image);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ gainvideo(index){//添加视频
|
|
|
+ uni.chooseVideo({
|
|
|
+ count: 1,
|
|
|
+ mediaType:['video'],
|
|
|
+ success:(res)=> {
|
|
|
+ console.log(res)
|
|
|
+ this.selfList[index]= res.tempFilePath;
|
|
|
+ this.$forceUpdate() //强制刷新视图
|
|
|
+ this.uploadingTF[index+3]=true
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ deletes(index){//删除
|
|
|
+ this.uploadingTF[index]=false
|
|
|
+ this.$forceUpdate() //强制刷新视图
|
|
|
+ },
|
|
|
+ async getaddafter(data) {
|
|
|
+ const res = await this.$myRequest({
|
|
|
+ url: '/api/api_gateway?method=after_sale.after_sale_manage.aftersale_apply',
|
|
|
+ data:{
|
|
|
+ device_id:data.id,
|
|
|
+ d_type:data.type,
|
|
|
+ errordesc:data.text,
|
|
|
+ errorimg:data.imageList,
|
|
|
+ addr:data.site,
|
|
|
+ user:data.name,
|
|
|
+ userphone:data.phone,
|
|
|
+ is_pc:0
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async getaddvideo(data) {
|
|
|
+ const res = await this.$myRequest({
|
|
|
+ url: '/api/api_gateway?method=after_sale.after_sale_manage.video_upload',
|
|
|
+ data:{
|
|
|
+ upload:data
|
|
|
+ }//after_sale.after_sale_manage.device_check
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async getID(data) {
|
|
|
+ const res = await this.$myRequest({
|
|
|
+ url: '/api/api_gateway?method=after_sale.after_sale_manage.device_check',
|
|
|
+ data:{
|
|
|
+ device_id:data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if(res!=''){
|
|
|
+ this.deviceid=true
|
|
|
+ }else{
|
|
|
+ this.deviceid=false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ btn(){//提交按钮
|
|
|
+ let obj ={}
|
|
|
+ obj.id=this.adddata.id
|
|
|
+ obj.type=this.adddata.type_id
|
|
|
+ obj.text=this.adddata.text
|
|
|
+ obj.imageList=JSON.stringify(this.imageList)
|
|
|
+ console.log(obj.imageList)
|
|
|
+ obj.site=this.adddata.site
|
|
|
+ obj.name=this.adddata.name
|
|
|
+ obj.phone=this.adddata.phone
|
|
|
+ // if(this.deviceid==false && this.adddata.type_id==''){
|
|
|
+ // uni.showToast({
|
|
|
+ // title: '设备ID和设备类型不能为空',
|
|
|
+ // duration: 2000,
|
|
|
+ // icon:'none'
|
|
|
+ // });
|
|
|
+ // }else{
|
|
|
+ // this.getaddafter(obj)
|
|
|
+ // if(this.selfList.length!=0){
|
|
|
+ // // this.getaddvideo(this.selfList)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ actionSheetCallback(index) {//选择器选择
|
|
|
+ this.adddata.type = this.actionSheetList[index].text;
|
|
|
+ this.adddata.type_id=index+2
|
|
|
+ },
|
|
|
+ iphone(){//检测手机
|
|
|
+ if(!/^1[23456789]\d{9}$/.test(this.adddata.phone)){
|
|
|
+ uni.showToast({
|
|
|
+ title: '手机号格式不正确',
|
|
|
+ duration: 2000,
|
|
|
+ icon:'none'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ addID(){
|
|
|
+ this.getID(this.adddata.id)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+ .addafter_con{
|
|
|
+ width: 100%;
|
|
|
+ padding: 110rpx 0;
|
|
|
+ background-color: #71CD9A;
|
|
|
+ .addafter_con_top{
|
|
|
+ width: 90%;
|
|
|
+ margin: 0 auto;
|
|
|
+ background-color: #FFFFFF;
|
|
|
+ padding: 16rpx 30rpx 36rpx;
|
|
|
+ border-radius: 20rpx;
|
|
|
+ p{
|
|
|
+ text-align: center;
|
|
|
+ font-size: 30rpx;
|
|
|
+ color: #62BF89;
|
|
|
+ }
|
|
|
+ input{
|
|
|
+ margin-top: 20rpx;
|
|
|
+ background-color: #F1FAF5;
|
|
|
+ color: #62BF89;
|
|
|
+ font-size:26rpx;
|
|
|
+ padding: 8rpx 26rpx;
|
|
|
+ border-radius: 20rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .addafter_con_connect{
|
|
|
+ width: 90%;
|
|
|
+ margin: -20rpx auto;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 0 16rpx;
|
|
|
+ image{
|
|
|
+ width: 20rpx;
|
|
|
+ height: 60rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .addafter_con_bot{
|
|
|
+ width: 90%;
|
|
|
+ margin: 0 auto;
|
|
|
+ background-color: #FFFFFF;
|
|
|
+ padding: 30rpx;
|
|
|
+ border-radius: 20rpx;
|
|
|
+ .addafter_con_bot_title{
|
|
|
+ text-align: center;
|
|
|
+ font-size: 30rpx;
|
|
|
+ color: #62BF89;
|
|
|
+ }
|
|
|
+ .textarea{
|
|
|
+ width: 94%;
|
|
|
+ height: 240rpx;
|
|
|
+ padding: 20rpx;
|
|
|
+ background-color: #F1FAF5;
|
|
|
+ margin-top: 20rpx;
|
|
|
+ font-size: 26rpx;
|
|
|
+ border-radius: 20rpx;
|
|
|
+ color: #62BF89;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .imgvideo{
|
|
|
+ width: 100%;
|
|
|
+ margin-top: 20rpx;
|
|
|
+ background-color: #FFFFFF;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-around;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ .imgvideo_img,.imgvideo_video{
|
|
|
+ width: 30%;
|
|
|
+ height: 160rpx;
|
|
|
+ border: 2rpx dashed #A3DABD;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 160rpx;
|
|
|
+ margin-bottom: 20rpx;
|
|
|
+ position: relative;
|
|
|
+ image{
|
|
|
+ width: 40rpx;
|
|
|
+ height: 32rpx;
|
|
|
+ }
|
|
|
+ .uploading{
|
|
|
+ width: 100%;
|
|
|
+ height: 160rpx;
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ .delete{
|
|
|
+ position: absolute;
|
|
|
+ top: -12rpx;
|
|
|
+ right: -12rpx;
|
|
|
+ font-size: 12rpx;
|
|
|
+ background-color: #FE0000;
|
|
|
+ border-radius: 50%;
|
|
|
+ color: #ffffff;
|
|
|
+ z-index: 50;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ button{
|
|
|
+ width: 100%;
|
|
|
+ height: 60rpx;
|
|
|
+ font-size: 30rpx;
|
|
|
+ line-height: 60rpx;
|
|
|
+ color: #FFFFFF;
|
|
|
+ background-color: #50CE87;
|
|
|
+ margin-top: 40rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|