Commit 3014828d by honghong

发布页面修改,我的需求接口对接

parent b992107c
...@@ -11,7 +11,25 @@ const orderDetailMsg = (params) => { ...@@ -11,7 +11,25 @@ const orderDetailMsg = (params) => {
return ApiHttp('/xinrenli/order/',params,'GET') return ApiHttp('/xinrenli/order/',params,'GET')
} }
//我的需求
const myNeedList = (params) => {
return ApiHttp('/xinrenli/order/MyNeeds',params,'GET')
}
// 新增订单(发布)
const addOrderFunction = (params) =>{
return ApiHttp('/xinrenli/order',params,'POST')
}
// 修改订单(发布)
const updateOrderFunction = (params) =>{
return ApiHttp('/xinrenli/order',params,'PUT')
}
export { export {
userNeedSquare, userNeedSquare,
orderDetailMsg orderDetailMsg,
myNeedList,
addOrderFunction,
updateOrderFunction
} }
\ No newline at end of file
<template> <template>
<!-- 音频播放器组件 --> <!-- 音频播放器组件 -->
<view v-if='url' class='flex justify-between align-center audio j-sb'> <view v-if='url' class='flex justify-between a-center audio j-sb'>
<view class="d-flex a-center"> <view class="d-flex">
<view class='mr-3' @click='start(audioId)'> <view :class="status ? 'timeCheck' : ''" class="font" v-if="duration != 0">{{duration.toFixed(0)}}</view>
<view class='' @click='start(audioId)'>
<image :src='startPic' class='icon' v-show='!status'></image> <image :src='startPic' class='icon' v-show='!status'></image>
<image :src='endPic' class='icon' v-show='status'></image> <image :src='endPic' class='icon' v-show='status'></image>
</view> </view>
<!-- <view class='flex-1'> <!-- <view class='flex-1'>
<slider @change='changeAudio' :activeColor='activeColor' :min='0' :max='duration.toFixed(0)' :value='currentTime.toFixed(0)' :step='0.1'></slider> <slider @change='changeAudio' :activeColor='activeColor' :min='0' :max='duration.toFixed(0)'
:value='currentTime.toFixed(0)' :step='0.1'></slider>
</view> --> </view> -->
<view>{{getTime(Math.round(currentTime))}}</view> <!-- <view>{{getTime(Math.round(currentTime))}}</view> -->
</view> </view>
<view @click="handleIconDel"> <view>{{getTime(Math.round(currentTime))}}</view>
<view @click="handleIconDel" v-show="isDel">
<u-icon name="close-circle-fill" color="#D9001B" size="32"></u-icon> <u-icon name="close-circle-fill" color="#D9001B" size="32"></u-icon>
</view> </view>
</view> </view>
...@@ -23,7 +26,7 @@ ...@@ -23,7 +26,7 @@
return { return {
context: null, context: null,
currentTime: 0, currentTime: 0,
duration: 100, duration: 0,
status: false status: false
} }
}, },
...@@ -35,7 +38,8 @@ ...@@ -35,7 +38,8 @@
}, },
startPic: String, startPic: String,
endPic: String, endPic: String,
audioId: [String, Number] audioId: [String, Number],
isDel: true
}, },
created() { created() {
this.context = uni.createInnerAudioContext(); this.context = uni.createInnerAudioContext();
...@@ -54,7 +58,7 @@ ...@@ -54,7 +58,7 @@
}) })
}, },
methods: { methods: {
handleIconDel(){ handleIconDel() {
this.$emit('delete') this.$emit('delete')
}, },
start(id) { //点击播放 start(id) { //点击播放
...@@ -120,12 +124,17 @@ ...@@ -120,12 +124,17 @@
<style> <style>
.audio { .audio {
background: #F4F4F4; background: #F4F4F4;
padding: 20rpx; height: 68rpx;
padding: 0 20rpx;
font-size: 24rpx;
}
.timeCheck{
color:#2C66FF ;
} }
.icon { .icon {
width: 30rpx; width: 28rpx;
height: 30rpx; height: 28rpx;
} }
.flex { .flex {
......
<template> <template>
<view> <view>
<view class="d-flex a-center j-sb form-item-height paddding-x-three"> <view class="content">
<view class="form-item-name">标题<span class="must-sign">*</span></view> <view class="content-form">
<view class="input-box"> <u--form :label-style="{'font-size':'26rpx'}" label-position="top" labelWidth="150" :model="formInfo" ref="form" :rules="rules">
<input type="text" placeholder="请输入标题"> <u-form-item required label="标题" prop="title" borderBottom :customStyle="{
</view> 'flex-direction': 'row !important'}">
</view> <u--input fontSize="24rpx" placeholderStyle="color: #999" inputAlign="right" border="none"
<view class="d-flex a-center j-sb form-item-height"> v-model="formInfo.title" placeholder="请填写标题">
<view class="form-item-name">联系人<span class="must-sign">*</span></view> </u--input>
<view class="input-box"> </u-form-item>
<input type="text" placeholder="请输入联系人姓名"> <u-form-item required label="联系人" prop="linkman" borderBottom :customStyle="{
</view> 'flex-direction': 'row !important',}">
</view> <u--input fontSize="24rpx" placeholderStyle="color: #999" inputAlign="right" border="none"
<view class="d-flex a-center j-sb form-item-height"> v-model="formInfo.linkman" placeholder="请输入联系人姓名">
<view class="form-item-name">联系电话<span class="must-sign">*</span></view> </u--input>
<view class="input-box"> </u-form-item>
<input type="text" placeholder="请输入联系人手机号"> <u-form-item required label="联系电话" prop="phone" borderBottom :customStyle="{
</view> 'flex-direction': 'row !important',
</view> }">
<view class="d-flex a-center j-sb form-item-height"> <u--input fontSize="24rpx" placeholderStyle="color: #999" inputAlign="right" border="none"
<view class="form-item-name">维修时间<span class="must-sign">*</span></view> v-model="formInfo.phone" placeholder="请输入联系人手机号">
</u--input>
</u-form-item>
<u-form-item required label="维修时间" prop="repairTime" borderBottom :customStyle="{
'flex-direction': 'row !important',
}">
<view class="input-box d-flex a-center" @click="showTime = true"> <view class="input-box d-flex a-center" @click="showTime = true">
<u-datetime-picker ref="datePicker" :formatter="formatter" v-model="time" :show="showTime" mode="date" <u-datetime-picker ref="datePicker" :formatter="formatter" v-model="formInfo.repairTime"
@confirm="handleConfirmDate" @cancel="handleClose"></u-datetime-picker> :show="showTime" mode="date" @confirm="handleConfirmDate" @cancel="handleClose">
<input type="text" v-model="time" placeholder="请选择时间"> </u-datetime-picker>
<input type="text" v-model="formInfo.repairTime" placeholder="请选择时间">
<u-icon name="arrow-down-fill" color="#000000" size="28"></u-icon> <u-icon name="arrow-down-fill" color="#000000" size="28"></u-icon>
</view> </view>
</view> </u--input>
<view class="d-flex a-center j-sb form-item-height"> </u-form-item>
<view class="form-item-name">维修地址<span class="must-sign">*</span></view> <u-form-item required label="维修地址" prop="repairAddress" borderBottom :customStyle="{
<view class="input-box"> 'flex-direction': 'row !important',
<input type="text" placeholder="请填写维修地址"> }">
</view> <u--input fontSize="24rpx" placeholderStyle="color: #999" inputAlign="right" border="none"
</view> v-model="formInfo.repairAddress" placeholder="请填写维修地址">
<view class="d-flex a-center j-sb form-item-height"> </u--input>
<view class="form-item-name">预算金额<span class="must-sign">*</span></view> </u-form-item>
<view class="input-box"> <u-form-item required label="预算金额" prop="budget" borderBottom :customStyle="{
<input type="text" placeholder="请填写预算金额"> 'flex-direction': 'row !important',
</view> }">
</view> <u--input fontSize="24rpx" placeholderStyle="color: #999" inputAlign="right" border="none"
v-model="formInfo.budget" placeholder="请填写预算金额">
</u--input>
</u-form-item>
<view> <view>
<view> <view>
<view class="d-flex j-sb a-center form-item-height-only"> <view class="d-flex j-sb a-center form-item-height-only">
<view class="form-item-name">上传图片</view> <view class="form-item-name">上传图片</view>
<view class="form-tips">一下内容三选一必填</view> <view class="form-tips">一下内容三选一必填</view>
</view> </view>
<view class="paddding-x-three"> <view class="">
<comUpload></comUpload> <comUpload></comUpload>
</view> </view>
</view> </view>
...@@ -54,7 +62,7 @@ ...@@ -54,7 +62,7 @@
<view class="d-flex j-sb a-center form-item-height-only"> <view class="d-flex j-sb a-center form-item-height-only">
<view class="form-item-name">上传视频</view> <view class="form-item-name">上传视频</view>
</view> </view>
<view class="paddding-x-three"> <view class="">
<comUpload :acceptType="acceptType"></comUpload> <comUpload :acceptType="acceptType"></comUpload>
</view> </view>
</view> </view>
...@@ -78,11 +86,19 @@ ...@@ -78,11 +86,19 @@
</view> </view>
</u-popup> </u-popup>
</view> </view>
<view class="paddding-x-three">
<view class="form-item-name margin-y-two">备注</view> </view>
<u--textarea v-model="remark" height="128" placeholder="备注说明"></u--textarea> <u-form-item label="备注" prop="remark">
<u--textarea maxlength="-1" :customStyle="{
marginTop: '20rpx',
background: '#F5F5F5',
border: 'none'
}" v-model="formInfo.remark" placeholder="备注说明" height="128rpx"></u--textarea>
</u-form-item>
</u--form>
</view> </view>
</view> </view>
<view class="submit-btn" @click="handlePublish">发布需求</view>
</view> </view>
</template> </template>
...@@ -98,14 +114,49 @@ ...@@ -98,14 +114,49 @@
data() { data() {
return { return {
showTime: false, //时间选择器是否显示 showTime: false, //时间选择器是否显示
time: undefined, //时间选择器的值
remark: '',
acceptType: 'video', acceptType: 'video',
path: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-hello-uniapp/2cc220e0-c27a-11ea-9dfb-6da8e309e0d8.mp3', path: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-hello-uniapp/2cc220e0-c27a-11ea-9dfb-6da8e309e0d8.mp3',
voicePath: '', voicePath: '',
showPopup: false showPopup: false,
formInfo: {
title: undefined, //标题
linkman: undefined, //联系人
phone: undefined, //联系电话
repairTime: undefined, //维修时间
repairAddress: undefined, //维修地址
budget: undefined, //预算金额
remark: undefined, //备注说明
},
rules: {
title: {
type: 'string',
required: true,
message: '请填写标题',
trigger: ['blur', 'change']
},
linkman: {
type: 'string',
required: true,
message: '请填写备注说明',
trigger: ['blur', 'change']
},
repairAddress: {
type: 'string',
required: true,
message: '请填写备注说明',
trigger: ['blur', 'change']
},
budget: {
type: 'string',
required: true,
message: '请填写备注说明',
trigger: ['blur', 'change']
},
}
}; };
}, },
//暂停所有音频(一般用于页面切换时停止正在播放的音频) //暂停所有音频(一般用于页面切换时停止正在播放的音频)
onUnload() { //普通页面在 onUnload 生命周期中执行 onUnload() { //普通页面在 onUnload 生命周期中执行
uni.$emit('stop') uni.$emit('stop')
...@@ -116,9 +167,19 @@ ...@@ -116,9 +167,19 @@
created() { created() {
let that = this let that = this
// 时间格式化默认值 // 时间格式化默认值
that.time = uni.$u.timeFormat(Number(new Date()), 'yyyy-mm-dd'); that.formInfo.repairTime = uni.$u.timeFormat(Number(new Date()), 'yyyy-mm-dd');
}, },
methods: { methods: {
//发布需求按钮
handlePublish() {
this.$refs.form.validate().then(res => {
uni.$u.toast('校验通过')
}).catch(errors => {
uni.$u.toast('校验失败')
})
// this.$emit('submit', this.formInfo)
},
// 时间选择器确认事件 // 时间选择器确认事件
async handleConfirmDate(e) { async handleConfirmDate(e) {
// value:返回所选时间戳,mode:当前模式 // value:返回所选时间戳,mode:当前模式
...@@ -127,7 +188,7 @@ ...@@ -127,7 +188,7 @@
// 时间格式化 // 时间格式化
const timeFormat = uni.$u.timeFormat; const timeFormat = uni.$u.timeFormat;
let timeValue = await timeFormat(e.value, 'yyyy-mm-dd'); let timeValue = await timeFormat(e.value, 'yyyy-mm-dd');
that.time = timeValue that.formInfo.repairTime = timeValue
}, },
//时间选择器的关闭按钮事件 //时间选择器的关闭按钮事件
handleClose() { handleClose() {
...@@ -166,15 +227,27 @@ ...@@ -166,15 +227,27 @@
} }
</script> </script>
<style> <style lang="scss" scoped>
@import url("@/css/form.css"); .content {
&-form {
margin: 30rpx 20rpx;
width: calc(100% - 20rpx * 2);
::v-deep .u-border { /deep/ .u-form {
border: 0 !important; width: calc(100% - 20rpx * 2);
background: #F5F5F5 !important; margin: 0rpx 20rpx;
} }
::v-deep .u-upload__wrap__preview {
margin: 0 6rpx 10rpx 0 !important;
} }
}
@import url("@/css/form.css");
// ::v-deep .u-border {
// border: 0 !important;
// background: #F5F5F5 !important;
// }
// ::v-deep .u-upload__wrap__preview {
// margin: 0 6rpx 10rpx 0 !important;
// }
</style> </style>
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
} }
.form-item-height-only{ .form-item-height-only{
height: 103rpx; height: 103rpx;
padding: 0 30rpx;
} }
.form-item-name{ .form-item-name{
font-size: 26rpx; font-size: 26rpx;
......
...@@ -2,27 +2,27 @@ ...@@ -2,27 +2,27 @@
<view class="content"> <view class="content">
<view class="content-textarea"> <view class="content-textarea">
<view class="">标题</view> <view class="">标题</view>
<view class="">270</view> <view class="">{{detailData.title}}</view>
</view> </view>
<view class="content-textarea"> <view class="content-textarea">
<view class="">联系人</view> <view class="">联系人</view>
<view class="">270</view> <view class="">{{detailData.linkman}}</view>
</view> </view>
<view class="content-textarea"> <view class="content-textarea">
<view class="">联系电话</view> <view class="">联系电话</view>
<view class="">270</view> <view class="">{{detailData.phone}}</view>
</view> </view>
<view class="content-textarea"> <view class="content-textarea">
<view class="">维修时间</view> <view class="">维修时间</view>
<view class="">270</view> <view class="">{{detailData.repairTime | formatDate}}</view>
</view> </view>
<view class="content-textarea"> <view class="content-textarea">
<view class="">维修地址</view> <view class="">维修地址</view>
<view class="">270</view> <view class="">{{detailData.repairAddress}}</view>
</view> </view>
<view class="content-textarea"> <view class="content-textarea">
<view class="">预算金额</view> <view class="">预算金额</view>
<view class="">270</view> <view class="">{{detailData.budget}}</view>
</view> </view>
<view class="content-photograph"> <view class="content-photograph">
<view class="">上传图片 <view class="">上传图片
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<view class=""> <view class="">
语音描述 语音描述
</view> </view>
<view class="content-voice-audio" @click="doPlay()"> <view class="content-voice-audio">
</view> </view>
</view> </view>
...@@ -55,13 +55,14 @@ ...@@ -55,13 +55,14 @@
<view class=""> <view class="">
备注 备注
</view> </view>
<u--textarea v-model="value1" placeholder="请输入内容" disabled></u--textarea> <u--textarea v-model="detailData.remark" placeholder="请输入内容" disabled></u--textarea>
</view> </view>
<view class="content-reject" v-if="subscript == 1"> <view class="content-reject" v-if="detailData.status == 1">
<view class=""> <view class="font-bold">
<text></text>订单已驳回 <text></text>订单已驳回
</view> </view>
<u--textarea v-model="value1" placeholder="请输入内容" disabled></u--textarea> <view class="paddding-x-two">驳回理由:沟通金额没有谈妥</view>
<!-- <u--textarea v-model="detailData.value1" placeholder="请输入内容" disabled></u--textarea> -->
</view> </view>
<view class="content-reject" v-if="subscript == 3 && subs== '1'"> <view class="content-reject" v-if="subscript == 3 && subs== '1'">
<view class=""> <view class="">
...@@ -80,6 +81,7 @@ ...@@ -80,6 +81,7 @@
</template> </template>
<script> <script>
import {orderDetailMsg} from '../../api/system/index.js'
import apiBaseConfig from '@/config/index.js'; import apiBaseConfig from '@/config/index.js';
export default { export default {
data() { data() {
...@@ -87,61 +89,34 @@ ...@@ -87,61 +89,34 @@
imgBgUrl: apiBaseConfig.imgBgUrl, imgBgUrl: apiBaseConfig.imgBgUrl,
globalData: getApp().globalData, globalData: getApp().globalData,
scrollTopHeader: 0, scrollTopHeader: 0,
detailInfo:{},//接收的参数
subscript: '0', subscript: '0',
subs: '1' subs: '1',
detailData:{}
}; };
}, },
onLoad(option) { onLoad(option) {
this.subscript = option.subscript if(option.detailInfo){
this.detailInfo = JSON.parse(decodeURIComponent(option.detailInfo))
console.log(this.detailInfo,'结束')
}
this.getOrder()
return
this.subs = option.subs this.subs = option.subs
this.timer = null;
this.innerAudioContext = uni.createInnerAudioContext();
// 监听音频进入可以播放状态的事件
this.innerAudioContext.onCanplay(() => {
this.innerAudioContext.duration;
// 延迟大约300ms以上才能获取音频总时长
setTimeout(() => {
// 获取音频总时长
this.duration = this.formatSeconds(this.innerAudioContext.duration);
}, 300)
});
// 监听音频播放
this.innerAudioContext.onPlay(() => {
// 获取当前音频的播放时间
this.timer = setInterval(() => {
this.currentTime = this.formatSeconds(this.innerAudioContext.currentTime);
}, 1000)
})
}, },
methods: { methods: {
// 播放 //获取订单详情列表
doPlay() { getOrder(){
if (!this.innerAudioContext.src) { let that = this
// 音频地址 orderDetailMsg({id:that.detailInfo.id}).then(res=>{
this.innerAudioContext.src = console.log('订单详情',res)
"https://bjetxgzv.cdn.bspapp.com/VKCEYUGU-hello-uniapp/2cc220e0-c27a-11ea-9dfb-6da8e309e0d8.mp3"; if(res.code == 200){
} that.detailData = res.data
this.innerAudioContext.play();
},
// 暂停
doPause() {
this.innerAudioContext.pause();
// 清除定时器
clearInterval(this.timer);
},
// 将秒转换成03:30格式
formatSeconds(value) {
let minute = parseInt(value / 60);
let second = parseInt(value % 60);
if (minute < 10) {
minute = "0" + minute
}
if (second < 10) {
second = "0" + second
}
return minute + ":" + second;
} }
})
},
} }
} }
</script> </script>
...@@ -222,7 +197,7 @@ ...@@ -222,7 +197,7 @@
display: flex; display: flex;
margin-bottom: 20rpx; margin-bottom: 20rpx;
font-size: 28rpx; font-size: 28rpx;
font-weight: 700; // font-weight: 700;
color: #333333; color: #333333;
>text { >text {
...@@ -235,4 +210,5 @@ ...@@ -235,4 +210,5 @@
} }
} }
} }
</style> </style>
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
标题 标题
</view> </view>
<view class=""> <view class="">
{{orderDetail.title}} {{orderDetail && orderDetail.title ? orderDetail.title : '' }}
</view> </view>
</view> </view>
<view class="content-textarea"> <view class="content-textarea">
...@@ -13,42 +13,47 @@ ...@@ -13,42 +13,47 @@
成交金额 成交金额
</view> </view>
<view class=""> <view class="">
{{orderDetail.actualAmount}} {{orderDetail && orderDetail.actualAmount ? orderDetail.actualAmount : ''}}
</view> </view>
</view> </view>
<view class="content-photograph"> <view class="content-photograph" >
<view class=""> <view class="">
图片说明 图片说明
</view> </view>
<view class="content-photograph-photo"> <view class="content-photograph-photo">
<image class="content-photograph-photo-graph" src="../../static/logo.png" mode="" <image class="content-photograph-photo-graph" :src="v.url" mode=""
v-for="(v ,index) in 5" :key="index"></image> v-for="(v ,index) in orderDetail.fileVos" :key="v.id" v-if="v.fileType == 'picture'"></image>
</view> </view>
<view class="noData-text">暂无数据</view>
</view> </view>
<view class="content-frequency"> <view class="content-frequency">
<view class=""> <view class="">
视频说明 视频说明
</view> </view>
<view v-for="(v ,index) in 2" :key="index"> <view v-if="orderDetail && orderDetail.fileVos.length && v.fileType == 'video'" v-for="(v ,index) in orderDetail.fileVos" :key="v.id" >
<video id="myVideo" <video v-if="v.fileType == 'video'" id="myVideo"
src="https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/%E7%AC%AC1%E8%AE%B2%EF%BC%88uni-app%E4%BA%A7%E5%93%81%E4%BB%8B%E7%BB%8D%EF%BC%89-%20DCloud%E5%AE%98%E6%96%B9%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%8B@20200317.mp4" :src="v.url"
@error="videoErrorCallback" :danmu-list="danmuList" enable-danmu controls @error="videoErrorCallback" :danmu-list="danmuList" enable-danmu controls
:show-fullscreen-btn='false'></video> :show-fullscreen-btn='false'></video>
</view> </view>
<view class="noData-text">暂无数据</view>
</view> </view>
<view class="content-voice"> <view class="content-voice">
<view class=""> <view class="">
语音说明 语音说明
</view> </view>
<view class="content-voice-audio" @click="doPlay()"> <view class="margin-top-two">
<free-audio startPic='../../static/stopStatus.png' endPic='../../static/startStatus.png' audioId='audio1'
:url='path' :isDel="false"></free-audio>
<view class="noData-text">暂无数据</view>
</view> </view>
<!-- <view class="content-voice-audio" @click="doPlay()"></view> -->
</view> </view>
<view class="content-remarks"> <view class="content-remarks">
<view class=""> <view class="">
备注说明 备注说明
</view> </view>
<u--textarea v-model="value1" placeholder="请输入内容" disabled></u--textarea> <u--textarea v-model="orderDetail.remark" placeholder="请输入内容" disabled></u--textarea>
</view> </view>
</view> </view>
</view> </view>
...@@ -59,13 +64,18 @@ ...@@ -59,13 +64,18 @@
orderDetailMsg orderDetailMsg
} from '../../api/system/index.js' } from '../../api/system/index.js'
import apiBaseConfig from '@/config/index.js'; import apiBaseConfig from '@/config/index.js';
import freeAudio from '../../components/chengpeng-audio/free-audio.vue'
export default { export default {
components:{
freeAudio
},
data() { data() {
return { return {
imgBgUrl: apiBaseConfig.imgBgUrl, imgBgUrl: apiBaseConfig.imgBgUrl,
globalData: getApp().globalData, globalData: getApp().globalData,
scrollTopHeader: 0, scrollTopHeader: 0,
orderDetail:{} orderDetail:{},
path:'https://bjetxgzv.cdn.bspapp.com/VKCEYUGU-hello-uniapp/2cc220e0-c27a-11ea-9dfb-6da8e309e0d8.mp3'
}; };
}, },
onLoad(option) { onLoad(option) {
...@@ -176,7 +186,7 @@ ...@@ -176,7 +186,7 @@
padding: 30rpx 0rpx; padding: 30rpx 0rpx;
>view { >view {
display: flex; // display: flex;
>video { >video {
margin-top: 20rpx; margin-top: 20rpx;
......
...@@ -8,6 +8,9 @@ Vue.use(uView); ...@@ -8,6 +8,9 @@ Vue.use(uView);
import uniGo from '@/utils/unIGO.js'; import uniGo from '@/utils/unIGO.js';
Vue.prototype.$uniGo = uniGo; Vue.prototype.$uniGo = uniGo;
import checkRules from '@/utils/utils.js';
Vue.prototype.$checkRules = checkRules
import utilsMethods from '@/utils/utils.js'; import utilsMethods from '@/utils/utils.js';
Vue.prototype.$utilsMethods = utilsMethods; Vue.prototype.$utilsMethods = utilsMethods;
// 底部导航 // 底部导航
......
...@@ -5,11 +5,11 @@ ...@@ -5,11 +5,11 @@
<u-form-item required label="标题" prop="title" borderBottom :customStyle="{ <u-form-item required label="标题" prop="title" borderBottom :customStyle="{
'flex-direction': 'row !important' 'flex-direction': 'row !important'
}"> }">
<u--input inputAlign="right" maxlength="-1" border="none" v-model="model.title" placeholder="请填写标题"> <u--input inputAlign="right" border="none" v-model="model.title" placeholder="请填写标题">
</u--input> </u--input>
</u-form-item> </u-form-item>
<u-form-item required label="备注" prop="content" borderBottom> <u-form-item required label="备注" prop="content">
<u--textarea :customStyle="{ <u--textarea maxlength="-1" :customStyle="{
marginTop: '20rpx', marginTop: '20rpx',
background: '#F5F5F5', background: '#F5F5F5',
border: 'none' border: 'none'
......
<template> <template>
<view class="content"> <view class="content">
<view class="content-matter" v-for="(v,index) in 20" @click="jump" :key="index"> <view class="content-matter" v-for="(item,index) in list" @click="jump(item)" :key="index">
<view class="content-matter-lampwick"> <view class="content-matter-lampwick">
<view class="content-matter-lampwick-lampw"> <view class="content-matter-lampwick-lampw">
<view :class="subscript == '1' ? 'only-bg-red' : 'common-bg'" class=""></view> <view :class="subscript == '1' ? 'only-bg-red' : 'common-bg'" class=""></view>
<view class="">灯泡灯芯坏了</view> <view class="">{{item.title}}</view>
</view> </view>
<view class="content-matter-lampwick-wick"> <view class="content-matter-lampwick-wick">
维修时间:2023-02-23 维修时间:{{item.repairTime | formatDate}}
</view> </view>
</view> </view>
<view class="content-matter-substance"> <view class="content-matter-substance">
<image src="../../../static/logo.png" mode=""></image> <image :src="item.fileVos[0].url" mode=""></image>
<view class=""> <view class="">
<view class=""> <view class="">
说明:有一个字不是特别亮,希望换一盏灯希望换一盏灯希望换一盏灯 说明:{{item.remark ? item.remark : '暂无说明'}}
</view> </view>
<!-- // 已发布 --> <!-- // 已发布 -->
<view class="buttoncolor" v-if="subscript == '0'"> <view class="buttoncolor" v-if="subscript == '0'">
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</view> </view>
<!-- // 已驳回 --> <!-- // 已驳回 -->
<view class="d-flex a-end j-sb" v-if="subscript == '1'"> <view class="d-flex a-end j-sb" v-if="subscript == '1'">
<view class="reject flex-1 hiddenMore" > <view class="reject flex-1 hiddenMore">
驳回理由:没有明确问题描述没有明确问题描述没有明确问题描述没有明确问题描述 驳回理由:没有明确问题描述没有明确问题描述没有明确问题描述没有明确问题描述
</view> </view>
<button @click.stop="handleAgainAdd" class="buttoncl" style="margin-left: 20rpx;">重新发布</button> <button @click.stop="handleAgainAdd" class="buttoncl" style="margin-left: 20rpx;">重新发布</button>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<view class="unpaid" v-if="subscript == '2'"> <view class="unpaid" v-if="subscript == '2'">
<view class="unpaid-paid"> <view class="unpaid-paid">
<view class=""> <view class="">
已沟通审核通过,待支付<text>300元</text> 已沟通审核通过,待支付<text>{{item.actualAmount ? item.actualAmount : 0}}</text>
</view> </view>
<view class=""> <view class="">
截止1小时内支付完成<text>00:59:42</text> 截止1小时内支付完成<text>00:59:42</text>
...@@ -64,6 +64,10 @@ ...@@ -64,6 +64,10 @@
props: { props: {
subscript: { subscript: {
type: String, type: String,
},
list: {
type: Array,
default: []
} }
}, },
components: { components: {
...@@ -82,11 +86,13 @@ ...@@ -82,11 +86,13 @@
onLoad() { onLoad() {
}, },
methods: { methods: {
// 跳转详情页 // 跳转详情页
jump() { jump(data) {
this.$uniGo.navigateTo({ this.$uniGo.navigateTo({
url: `/demand/index/index?subscript=${this.subscript}` url: `/demand/index/index?detailInfo=${encodeURIComponent(JSON.stringify(data))}`
// url: `/demand/index/index?subscript=${this.subscript}`
}); });
}, },
// 跳转支付界面 // 跳转支付界面
...@@ -101,33 +107,33 @@ ...@@ -101,33 +107,33 @@
this.title = '确认取消订单吗' this.title = '确认取消订单吗'
this.titbut = '1' this.titbut = '1'
this.show = true this.show = true
} else if(val == 2){ } else if (val == 2) {
this.title = '确认提交退款申请吗' this.title = '确认提交退款申请吗'
this.titbut = '2' this.titbut = '2'
this.show = true this.show = true
}else if(val == 3){ } else if (val == 3) {
this.$uniGo.navigateTo({ this.$uniGo.navigateTo({
url: `/demand/index/index?subscript=${this.subscript}&subs=${'1'}` url: `/demand/index/index?subscript=${this.subscript}&subs=${'1'}`
}); });
}else if(val == 4){ } else if (val == 4) {
this.$uniGo.navigateTo({ this.$uniGo.navigateTo({
url: `/demand/index/index?subscript=${this.subscript}&subs=${'2'}` url: `/demand/index/index?subscript=${this.subscript}&subs=${'2'}`
}); });
} }
}, },
//重新发布按钮事件 //重新发布按钮事件
handleAgainAdd(){ handleAgainAdd() {
let that = this let that = this
that.$uniGo.navigateTo({ that.$uniGo.navigateTo({
url:`/demand/updateForm/updateForm` url: `/demand/updateForm/updateForm`
}) })
}, },
// 再看看 // 再看看
aindex(){ aindex() {
this.show = false this.show = false
}, },
// 取消订单2 立即退款3 // 取消订单2 立即退款3
aindexst(val){ aindexst(val) {
// console.log(val) // console.log(val)
this.show = false this.show = false
} }
...@@ -165,10 +171,12 @@ ...@@ -165,10 +171,12 @@
border-radius: 3rpx; border-radius: 3rpx;
margin-right: 10rpx; margin-right: 10rpx;
} }
.common-bg{
.common-bg {
background: #2C66FF; background: #2C66FF;
} }
.only-bg-red{
.only-bg-red {
background: #FD0000; background: #FD0000;
} }
......
...@@ -10,15 +10,15 @@ ...@@ -10,15 +10,15 @@
<view v-show="subscript == index" class="content-tabs-text-area"></view> <view v-show="subscript == index" class="content-tabs-text-area"></view>
</view> </view>
</view> </view>
<!-- <template v-if="arr && arr.length"> --> <template v-if="statusNeedList && statusNeedList.length">
<comindex class="content-mindex" :subscript='subscript'></comindex> <comindex :list="statusNeedList" class="content-mindex" :subscript='subscript'></comindex>
<!-- </template> --> </template>
<!-- <view v-else class="diagram"> <view v-else class="diagram">
<image src="@/static/icon/qst.png" mode=""></image> <image src="@/static/icon/qst.png" mode=""></image>
<view class=""> <view class="">
暂无数据 暂无数据
</view> </view>
</view> --> </view>
<com-tabbar :list=" [{ <com-tabbar :list=" [{
name: '首页', name: '首页',
icon: '/static/tabbar/tb1.png', icon: '/static/tabbar/tb1.png',
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
</template> </template>
<script> <script>
import {myNeedList} from '../../api/system/index.js'
import apiBaseConfig from '@/config/index.js'; import apiBaseConfig from '@/config/index.js';
import uniGo from '@/utils/unIGO.js'; import uniGo from '@/utils/unIGO.js';
import comindex from '@/pages/demand/components/index.vue' import comindex from '@/pages/demand/components/index.vue'
...@@ -74,6 +75,12 @@ ...@@ -74,6 +75,12 @@
name: '已接单' name: '已接单'
}], }],
subscript: '0', subscript: '0',
needInfo:{
pageSize:1,
pageNum:10,
status:0
},
statusNeedList:[]
} }
}, },
components: { components: {
...@@ -84,10 +91,27 @@ ...@@ -84,10 +91,27 @@
if(option.id){ if(option.id){
this.subscript = option.id this.subscript = option.id
} }
this.getMyNeedList()
}, },
methods: { methods: {
getMyNeedList(){
let that = this
that.needInfo.status = that.subscript
myNeedList(that.needInfo).then(res=>{
console.log(res,'我的需求')
if(res.code == 200){
if(res.total > 0){
that.statusNeedList = res.rows
}else{
that.statusNeedList = []
}
}
})
},
jump(ind) { jump(ind) {
let that = this
this.subscript = ind this.subscript = ind
that.getMyNeedList()
} }
} }
} }
......
...@@ -24,11 +24,11 @@ ...@@ -24,11 +24,11 @@
{{v.title}} {{v.title}}
</view> </view>
<view class=""> <view class="">
说明:{{v.remark}} 说明:{{v.remark ? v.remark : '暂无说明'}}
</view> </view>
<view class=""> <view class="">
<text>维修时间:</text> <text>维修时间:</text>
<text>{{v.repairTime}}</text> <text>{{v.repairTime | formatDate}}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -86,6 +86,11 @@ ...@@ -86,6 +86,11 @@
type: 'type' type: 'type'
}], }],
userNeedList:[],//需求广场列表 userNeedList:[],//需求广场列表
total:0,//列表总数
queryParams:{
pageNum:1,
pageSize:10,
}
} }
}, },
onLoad() { onLoad() {
...@@ -95,13 +100,20 @@ ...@@ -95,13 +100,20 @@
// console.log('页面滚动了onPageScroll-app', res.scrollTop); // console.log('页面滚动了onPageScroll-app', res.scrollTop);
this.scrollTopHeader = res.scrollTop; this.scrollTopHeader = res.scrollTop;
}, },
onReachBottom() {
let that = this
if(that.total < that.queryParams.pageNum * that.queryParams.pageSize){
}
},
methods: { methods: {
getSquare(){ getSquare(){
userNeedSquare().then(res=>{ userNeedSquare(this.queryParams).then(res=>{
console.log(res,'需求广场') console.log(res,'需求广场')
if(res.code == 200){ if(res.code == 200){
if(res.total > 0){ if(res.total > 0){
this.userNeedList = res.rows this.userNeedList = res.rows
this.total = res.total
} }
} }
}) })
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<view> <view>
<view :style="{ height: `calc(${globalData.statusBarHeight}rpx + 130rpx)` }"></view> <view :style="{ height: `calc(${globalData.statusBarHeight}rpx + 130rpx)` }"></view>
<view class="paddding-x-two "> <view class="paddding-x-two ">
<releaseForm></releaseForm> <releaseForm @submit="handleSubmit"></releaseForm>
<view class="submit-btn">发布需求</view>
</view> </view>
<com-navbar :leftIcon="false" :homeShow="false" bgColor="#fff" title="发布" <com-navbar :leftIcon="false" :homeShow="false" bgColor="#fff" title="发布"
:titleStyle="{ color: '#000', fontSize: '32rpx',scrollTopHeader: scrollTopHeader }" /> :titleStyle="{ color: '#000', fontSize: '32rpx',scrollTopHeader: scrollTopHeader }" />
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
</template> </template>
<script> <script>
import {addOrderFunction} from '@/api/system/index.js'
import releaseForm from '@/components/form.vue' import releaseForm from '@/components/form.vue'
export default { export default {
components: { components: {
...@@ -50,15 +51,21 @@ ...@@ -50,15 +51,21 @@
data() { data() {
return { return {
globalData: getApp().globalData, globalData: getApp().globalData,
} }
}, },
onShow() { onShow() {
let that = this let that = this
}, },
methods: { methods: {
handleSubmit(info){
console.log(info,'拿到表单')
},
handleAdd(){
addOrderFunction().then(res=>{
console.log('发布')
})
},
} }
} }
</script> </script>
......
...@@ -186,3 +186,9 @@ ...@@ -186,3 +186,9 @@
font-size: 24rpx; font-size: 24rpx;
} }
.noData-text{
color: #989898;
text-align: center;
margin: 20rpx 0;
}
...@@ -53,7 +53,6 @@ const ApiHttp = (url, params, method, isToken = true) => { ...@@ -53,7 +53,6 @@ const ApiHttp = (url, params, method, isToken = true) => {
data: params, data: params,
header, header,
success: (res) => { success: (res) => {
console.log(res,'封装接口成功')
const { const {
data data
} = res; } = res;
......
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