Commit 3014828d by honghong

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

parent b992107c
......@@ -11,7 +11,25 @@ const orderDetailMsg = (params) => {
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 {
userNeedSquare,
orderDetailMsg
orderDetailMsg,
myNeedList,
addOrderFunction,
updateOrderFunction
}
\ No newline at end of file
<template>
<!-- 音频播放器组件 -->
<view v-if='url' class='flex justify-between align-center audio j-sb'>
<view class="d-flex a-center">
<view class='mr-3' @click='start(audioId)'>
<view v-if='url' class='flex justify-between a-center audio j-sb'>
<view class="d-flex">
<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='endPic' class='icon' v-show='status'></image>
</view>
<!-- <view class='flex-1'>
<slider @change='changeAudio' :activeColor='activeColor' :min='0' :max='duration.toFixed(0)' :value='currentTime.toFixed(0)' :step='0.1'></slider>
</view> -->
<view>{{getTime(Math.round(currentTime))}}</view>
<!-- <view class='flex-1'>
<slider @change='changeAudio' :activeColor='activeColor' :min='0' :max='duration.toFixed(0)'
:value='currentTime.toFixed(0)' :step='0.1'></slider>
</view> -->
<!-- <view>{{getTime(Math.round(currentTime))}}</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>
</view>
</view>
......@@ -23,7 +26,7 @@
return {
context: null,
currentTime: 0,
duration: 100,
duration: 0,
status: false
}
},
......@@ -35,7 +38,8 @@
},
startPic: String,
endPic: String,
audioId: [String, Number]
audioId: [String, Number],
isDel: true
},
created() {
this.context = uni.createInnerAudioContext();
......@@ -54,7 +58,7 @@
})
},
methods: {
handleIconDel(){
handleIconDel() {
this.$emit('delete')
},
start(id) { //点击播放
......@@ -120,12 +124,17 @@
<style>
.audio {
background: #F4F4F4;
padding: 20rpx;
height: 68rpx;
padding: 0 20rpx;
font-size: 24rpx;
}
.timeCheck{
color:#2C66FF ;
}
.icon {
width: 30rpx;
height: 30rpx;
width: 28rpx;
height: 28rpx;
}
.flex {
......
......@@ -5,7 +5,6 @@
}
.form-item-height-only{
height: 103rpx;
padding: 0 30rpx;
}
.form-item-name{
font-size: 26rpx;
......
......@@ -2,27 +2,27 @@
<view class="content">
<view class="content-textarea">
<view class="">标题</view>
<view class="">270</view>
<view class="">{{detailData.title}}</view>
</view>
<view class="content-textarea">
<view class="">联系人</view>
<view class="">270</view>
<view class="">{{detailData.linkman}}</view>
</view>
<view class="content-textarea">
<view class="">联系电话</view>
<view class="">270</view>
<view class="">{{detailData.phone}}</view>
</view>
<view class="content-textarea">
<view class="">维修时间</view>
<view class="">270</view>
<view class="">{{detailData.repairTime | formatDate}}</view>
</view>
<view class="content-textarea">
<view class="">维修地址</view>
<view class="">270</view>
<view class="">{{detailData.repairAddress}}</view>
</view>
<view class="content-textarea">
<view class="">预算金额</view>
<view class="">270</view>
<view class="">{{detailData.budget}}</view>
</view>
<view class="content-photograph">
<view class="">上传图片
......@@ -47,7 +47,7 @@
<view class="">
语音描述
</view>
<view class="content-voice-audio" @click="doPlay()">
<view class="content-voice-audio">
</view>
</view>
......@@ -55,13 +55,14 @@
<view class="">
备注
</view>
<u--textarea v-model="value1" placeholder="请输入内容" disabled></u--textarea>
<u--textarea v-model="detailData.remark" placeholder="请输入内容" disabled></u--textarea>
</view>
<view class="content-reject" v-if="subscript == 1">
<view class="">
<view class="content-reject" v-if="detailData.status == 1">
<view class="font-bold">
<text></text>订单已驳回
</view>
<u--textarea v-model="value1" placeholder="请输入内容" disabled></u--textarea>
</view>
<view class="paddding-x-two">驳回理由:沟通金额没有谈妥</view>
<!-- <u--textarea v-model="detailData.value1" placeholder="请输入内容" disabled></u--textarea> -->
</view>
<view class="content-reject" v-if="subscript == 3 && subs== '1'">
<view class="">
......@@ -79,69 +80,43 @@
</view>
</template>
<script>
<script>
import {orderDetailMsg} from '../../api/system/index.js'
import apiBaseConfig from '@/config/index.js';
export default {
data() {
return {
imgBgUrl: apiBaseConfig.imgBgUrl,
globalData: getApp().globalData,
scrollTopHeader: 0,
scrollTopHeader: 0,
detailInfo:{},//接收的参数
subscript: '0',
subs: '1'
subs: '1',
detailData:{}
};
},
onLoad(option) {
this.subscript = option.subscript
onLoad(option) {
if(option.detailInfo){
this.detailInfo = JSON.parse(decodeURIComponent(option.detailInfo))
console.log(this.detailInfo,'结束')
}
this.getOrder()
return
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: {
// 播放
doPlay() {
if (!this.innerAudioContext.src) {
// 音频地址
this.innerAudioContext.src =
"https://bjetxgzv.cdn.bspapp.com/VKCEYUGU-hello-uniapp/2cc220e0-c27a-11ea-9dfb-6da8e309e0d8.mp3";
}
this.innerAudioContext.play();
methods: {
//获取订单详情列表
getOrder(){
let that = this
orderDetailMsg({id:that.detailInfo.id}).then(res=>{
console.log('订单详情',res)
if(res.code == 200){
that.detailData = res.data
}
})
},
// 暂停
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>
......@@ -222,7 +197,7 @@
display: flex;
margin-bottom: 20rpx;
font-size: 28rpx;
font-weight: 700;
// font-weight: 700;
color: #333333;
>text {
......@@ -234,5 +209,6 @@
}
}
}
}
}
</style>
......@@ -5,7 +5,7 @@
标题
</view>
<view class="">
{{orderDetail.title}}
{{orderDetail && orderDetail.title ? orderDetail.title : '' }}
</view>
</view>
<view class="content-textarea">
......@@ -13,42 +13,47 @@
成交金额
</view>
<view class="">
{{orderDetail.actualAmount}}
{{orderDetail && orderDetail.actualAmount ? orderDetail.actualAmount : ''}}
</view>
</view>
<view class="content-photograph">
<view class="content-photograph" >
<view class="">
图片说明
</view>
<view class="content-photograph-photo">
<image class="content-photograph-photo-graph" src="../../static/logo.png" mode=""
v-for="(v ,index) in 5" :key="index"></image>
<image class="content-photograph-photo-graph" :src="v.url" mode=""
v-for="(v ,index) in orderDetail.fileVos" :key="v.id" v-if="v.fileType == 'picture'"></image>
</view>
<view class="noData-text">暂无数据</view>
</view>
<view class="content-frequency">
<view class="">
视频说明
</view>
<view v-for="(v ,index) in 2" :key="index">
<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"
<view v-if="orderDetail && orderDetail.fileVos.length && v.fileType == 'video'" v-for="(v ,index) in orderDetail.fileVos" :key="v.id" >
<video v-if="v.fileType == 'video'" id="myVideo"
:src="v.url"
@error="videoErrorCallback" :danmu-list="danmuList" enable-danmu controls
:show-fullscreen-btn='false'></video>
</view>
<view class="noData-text">暂无数据</view>
</view>
<view class="content-voice">
<view class="">
语音说明
</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 class="content-voice-audio" @click="doPlay()"></view> -->
</view>
<view class="content-remarks">
<view class="">
备注说明
</view>
<u--textarea v-model="value1" placeholder="请输入内容" disabled></u--textarea>
<u--textarea v-model="orderDetail.remark" placeholder="请输入内容" disabled></u--textarea>
</view>
</view>
</view>
......@@ -59,13 +64,18 @@
orderDetailMsg
} from '../../api/system/index.js'
import apiBaseConfig from '@/config/index.js';
import freeAudio from '../../components/chengpeng-audio/free-audio.vue'
export default {
components:{
freeAudio
},
data() {
return {
imgBgUrl: apiBaseConfig.imgBgUrl,
globalData: getApp().globalData,
scrollTopHeader: 0,
orderDetail:{}
orderDetail:{},
path:'https://bjetxgzv.cdn.bspapp.com/VKCEYUGU-hello-uniapp/2cc220e0-c27a-11ea-9dfb-6da8e309e0d8.mp3'
};
},
onLoad(option) {
......@@ -176,7 +186,7 @@
padding: 30rpx 0rpx;
>view {
display: flex;
// display: flex;
>video {
margin-top: 20rpx;
......
......@@ -8,6 +8,9 @@ Vue.use(uView);
import uniGo from '@/utils/unIGO.js';
Vue.prototype.$uniGo = uniGo;
import checkRules from '@/utils/utils.js';
Vue.prototype.$checkRules = checkRules
import utilsMethods from '@/utils/utils.js';
Vue.prototype.$utilsMethods = utilsMethods;
// 底部导航
......
......@@ -5,11 +5,11 @@
<u-form-item required label="标题" prop="title" borderBottom :customStyle="{
'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-form-item>
<u-form-item required label="备注" prop="content" borderBottom>
<u--textarea :customStyle="{
<u-form-item required label="备注" prop="content">
<u--textarea maxlength="-1" :customStyle="{
marginTop: '20rpx',
background: '#F5F5F5',
border: 'none'
......
......@@ -10,15 +10,15 @@
<view v-show="subscript == index" class="content-tabs-text-area"></view>
</view>
</view>
<!-- <template v-if="arr && arr.length"> -->
<comindex class="content-mindex" :subscript='subscript'></comindex>
<!-- </template> -->
<!-- <view v-else class="diagram">
<template v-if="statusNeedList && statusNeedList.length">
<comindex :list="statusNeedList" class="content-mindex" :subscript='subscript'></comindex>
</template>
<view v-else class="diagram">
<image src="@/static/icon/qst.png" mode=""></image>
<view class="">
暂无数据
</view>
</view> -->
</view>
<com-tabbar :list=" [{
name: '首页',
icon: '/static/tabbar/tb1.png',
......@@ -53,7 +53,8 @@
</view>
</template>
<script>
<script>
import {myNeedList} from '../../api/system/index.js'
import apiBaseConfig from '@/config/index.js';
import uniGo from '@/utils/unIGO.js';
import comindex from '@/pages/demand/components/index.vue'
......@@ -73,7 +74,13 @@
}, {
name: '已接单'
}],
subscript: '0',
subscript: '0',
needInfo:{
pageSize:1,
pageNum:10,
status:0
},
statusNeedList:[]
}
},
components: {
......@@ -83,11 +90,28 @@
// console.log(option, 'pppppp')
if(option.id){
this.subscript = option.id
}
}
this.getMyNeedList()
},
methods: {
jump(ind) {
this.subscript = ind
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) {
let that = this
this.subscript = ind
that.getMyNeedList()
}
}
}
......
......@@ -24,11 +24,11 @@
{{v.title}}
</view>
<view class="">
说明:{{v.remark}}
说明:{{v.remark ? v.remark : '暂无说明'}}
</view>
<view class="">
<text>维修时间:</text>
<text>{{v.repairTime}}</text>
<text>{{v.repairTime | formatDate}}</text>
</view>
</view>
</view>
......@@ -85,7 +85,12 @@
url: "/pages/my/index",
type: 'type'
}],
userNeedList:[],//需求广场列表
userNeedList:[],//需求广场列表
total:0,//列表总数
queryParams:{
pageNum:1,
pageSize:10,
}
}
},
onLoad() {
......@@ -94,14 +99,21 @@
onPageScroll(res) {
// console.log('页面滚动了onPageScroll-app', res.scrollTop);
this.scrollTopHeader = res.scrollTop;
},
onReachBottom() {
let that = this
if(that.total < that.queryParams.pageNum * that.queryParams.pageSize){
}
},
methods: {
getSquare(){
userNeedSquare().then(res=>{
userNeedSquare(this.queryParams).then(res=>{
console.log(res,'需求广场')
if(res.code == 200){
if(res.total > 0){
this.userNeedList = res.rows
this.total = res.total
}
}
})
......
......@@ -2,8 +2,8 @@
<view>
<view :style="{ height: `calc(${globalData.statusBarHeight}rpx + 130rpx)` }"></view>
<view class="paddding-x-two ">
<releaseForm></releaseForm>
<view class="submit-btn">发布需求</view>
<releaseForm @submit="handleSubmit"></releaseForm>
</view>
<com-navbar :leftIcon="false" :homeShow="false" bgColor="#fff" title="发布"
:titleStyle="{ color: '#000', fontSize: '32rpx',scrollTopHeader: scrollTopHeader }" />
......@@ -42,6 +42,7 @@
</template>
<script>
import {addOrderFunction} from '@/api/system/index.js'
import releaseForm from '@/components/form.vue'
export default {
components: {
......@@ -50,15 +51,21 @@
data() {
return {
globalData: getApp().globalData,
}
},
onShow() {
let that = this
},
methods: {
handleSubmit(info){
console.log(info,'拿到表单')
},
handleAdd(){
addOrderFunction().then(res=>{
console.log('发布')
})
},
}
}
</script>
......
......@@ -185,4 +185,10 @@
.font{
font-size: 24rpx;
}
.noData-text{
color: #989898;
text-align: center;
margin: 20rpx 0;
}
......@@ -53,7 +53,6 @@ const ApiHttp = (url, params, method, isToken = true) => {
data: params,
header,
success: (res) => {
console.log(res,'封装接口成功')
const {
data
} = res;
......
......@@ -45,7 +45,7 @@ const phoneFun = (phones) => {
} else {
return true;
}
}
}
/*
获取当前日期 YYYY-MM-DD
......
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