Commit 61feeae6 by honghong

选则优惠券时判断,修改时提示错误

parent 0d4e104b
......@@ -2,7 +2,7 @@
<!-- 音频播放器组件 -->
<view v-if='url' class='flex justify-between a-center audio j-sb'>
<view class="d-flex">
<view :class="status ? 'timeCheck' : ''" class="font" >11</view>
<view :class="status ? 'timeCheck' : ''" class="font" v-if="duration.toFixed(0) > 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>
......@@ -68,13 +68,16 @@
this.status = false;
}
})
},
methods: {
handleIconDel() {
this.$emit('delete')
},
start(id) { //点击播放
let audioId = id;
if (this.status) {
this.context.pause();
this.status = !this.status;
......@@ -83,6 +86,7 @@
this.context.play()
this.status = !this.status;
}
},
onCanplay() { //进入可播放状态
this.context.onCanplay(() => {
......@@ -91,11 +95,13 @@
this.duration = this.context.duration;
}, 1000)
})
},
onTimeUpdate() { //音频播放进度
this.context.onTimeUpdate(() => {
if (!Number.isFinite(this.context.duration)) {
this.duration = this.context.currentTime + 10;
// this.duration = this.context.currentTime + 10;
this.duration = this.context.currentTime;
this.currentTime = this.context.currentTime;
} else {
this.duration = this.context.duration;
......
......@@ -239,12 +239,20 @@
// 获取上传图片的值
getPhotoList(data) {
let that = this
let photoList = []
that.formInfo.pictureList.push({
url: data.url,
fileType: 'picture'
})
// that.formInfo.pictureList = photoList
if(that.formInfo.pictureList){
that.formInfo.pictureList.push({
url: data.url,
fileType: 'picture'
})
}else{
let photoList = []
photoList.push({
url: data.url,
fileType: 'picture'
})
that.formInfo.pictureList = photoList
}
},
//删除照片
delPhotoItem(index) {
......@@ -265,30 +273,43 @@
},
// 上传音频事件
getVoiceList(data) {
getVoiceList(data, time) {
console.log(time, '总是从')
let that = this
that.showPopup = false
let voiceList = []
voiceList.push({
url: data.url,
fileType: 'voice'
fileType: 'voice',
fileDesc: time
})
that.formInfo.voiceList = voiceList
},
//确认修改和重新发布按钮
handleUpdateForm() {
let that = this
that.$refs.form.validate().then(res => {
if (res) {
if (that.formInfo.pictureList.length || that.formInfo.videoList.length || that.formInfo
.voiceList.length) {
that.$emit('submit', that.formInfo)
} else {
uni.$u.toast('图片、视频、音频选其一必填')
}
// that.$emit('submit', that.formInfo)
// that.$refs.form.validate().then(res => {
// if (res) {
// console.log('金1111')
// if (that.formInfo.pictureList.length || that.formInfo.videoList.length || that.formInfo
// .voiceList.length) {
// that.$emit('submit', that.formInfo)
// } else {
// uni.$u.toast('图片、视频、音频选其一必填')
// }
// }
// }).catch(errors => {
// uni.$u.toast('请完善信息')
// })
this.$refs.form.validate().then(res => {
if (that.formInfo.pictureList || that.formInfo.videoList || that.formInfo.voiceList) {
that.$emit('submit', that.formInfo)
} else {
uni.$u.toast('图片、视频、音频选其一必填')
}
}).catch(errors => {
uni.$u.toast('校验失败')
uni.$u.toast('请完善信息')
})
},
async handleAdd() {
......@@ -320,6 +341,7 @@
let that = this
this.$refs.form.validate().then(res => {
if (res) {
console.log(1)
if (that.formInfo.pictureList.length || that.formInfo.videoList.length || that.formInfo
.voiceList.length) {
that.handleAdd()
......@@ -328,7 +350,7 @@
}
}
}).catch(errors => {
uni.$u.toast('校验失败')
uni.$u.toast('请完善信息')
})
// this.$emit('submit', this.formInfo)
},
......@@ -424,9 +446,10 @@
top: -10rpx;
right: -10rpx;
}
.time-text{
color:#666666;
font-size:24rpx;
.time-text {
color: #666666;
font-size: 24rpx;
}
@import url("@/css/form.css");
......
......@@ -9,7 +9,7 @@
<view class="progress">
<progress :percent="time*(100/(duration/1000))" border-radius="10" color="#2C66FF" stroke-width="8"
backgroundColor="rgba(44,102,255,0.14)" />
<text class="txt">最大录音时长({{duration/1000}}秒 = {{duration/60000}}分钟)</text>
<!-- <text class="txt">最大录音时长({{duration/1000}}秒 = {{duration/60000}}分钟)</text> -->
</view>
<view class="anniu">
<view class="d-flex j-sa">
......@@ -61,7 +61,6 @@
methods: {
//上传录音按钮事件
async handleUpload(){
console.log('山海关穿 ',this.uploadUrl,this.tempFilePath)
let that = this
return new Promise((resolve, reject) => {
let a = wx.uploadFile({
......@@ -76,10 +75,11 @@
const {
data
} = JSON.parse(res.data);
console.log(data, '大街上可能')
this.$emit('getVal', data);
console.log(data, '大街上可能',that.time)
that.$emit('getVal', data,that.time);
setTimeout(() => {
let clear = setTimeout(() => {
clearTimeout(clear)
resolve(data.url)
// resolve(res.data.data)
}, 1000)
......
......@@ -30,7 +30,7 @@
<view>
<view class="content-photograph-photo" v-if="detailData && detailData.pictureList && detailData.pictureList.length">
<image class="content-photograph-photo-img" :src="v.url" mode=""
v-for="(v ,index) in detailData.pictureList" :key="index"></image>
v-for="(v ,index) in detailData.pictureList" :key="index" @click="handlePreview(index)"></image>
</view>
<view class="noData-text" v-else>暂无数据</view>
</view>
......@@ -86,7 +86,7 @@
</view>
<!-- <u--textarea v-model="value1" placeholder="请输入内容" disabled></u--textarea> -->
<view>退款金额:{{detailData.refundAmount}}</view>
<view>已扣除服务金额:{{detailData.payAmount - detailData.refundAmount}}</view>
<view>已扣除服务金额:{{(detailData.payAmount - detailData.refundAmount).toFixed(2)}}</view>
</view>
</view>
</view>
......@@ -135,6 +135,17 @@
that.detailData = data
}
},
handlePreview(index){
let that = this
var pictureList = that.detailData.pictureList.map(item => { // item 获取到的图片地址
return item.url;
});
uni.previewImage({
current: index,
urls: pictureList,
loop: true
})
}
}
}
......
......@@ -88,9 +88,9 @@
sumPrice(){
let that = this
// 1.判断优惠券是否有值并且价格大于优惠券时
console.log(that.payInfo.fullSubtraction,that.detailInfo.actualAmount,'第三句话')
// console.log(that.payInfo.fullSubtraction,that.detailInfo.actualAmount,'第三句话')
if(that.payInfo.fullSubtraction && Number(that.detailInfo.actualAmount) > Number(that.payInfo.fullSubtraction)){
console.log('优质',that.detailInfo.actualAmount - that.payInfo.fullSubtraction)
// console.log('优质',that.detailInfo.actualAmount - that.payInfo.fullSubtraction)
// 判断是否使用折扣(使用×折扣)
return that.isUse ? Number((that.detailInfo.actualAmount - that.payInfo.fullSubtraction) * that.discountList[0].discountRatio).toFixed(2): Number(that.detailInfo.actualAmount - that.payInfo.fullSubtraction).toFixed(2)
}else{
......@@ -120,7 +120,7 @@
let that = this
if (val == 1) {
this.$uniGo.navigateTo({
url: `/my/coupon/index?type=pay`
url: `/my/coupon/index?type=pay&price=${this.detailInfo.actualAmount}`
});
} else {
let orderQuery = {
......
<template>
<view class="index">
<com-navbar :title="title" :titleStyle="{ color: '#000000', fontSize: '32rpx' }" />
<view class="index-content" v-if="useCouponList.length && couponLoseList.length">
<view class="index-content" v-if="useCouponList.length || couponLoseList.length">
<view class="index-content-item" v-for="(item,index) in useCouponList">
<view class="index-content-item-nav baiyin-flex baiyin-flex-c-b">
<text></text>
......@@ -32,7 +32,7 @@
<view class="index-content-item-qu-bl-rk-a index-content-item-qu-bl-rk-axl">订单金额满</view>
<view class="index-content-item-qu-bl-rk-b index-content-item-qu-bl-rk-bxl">{{item.minUsed}}</view>
<view class="index-content-item-qu-bl-rk-c index-content-item-qu-bl-rk-cxl">可使用</view>
<view class="index-content-item-qu-bl-rk-d index-content-item-qu-bl-rk-dxl">去使用</view>
<view class="index-content-item-qu-bl-rk-d index-content-item-qu-bl-rk-dxl" @click="optionData.type === 'coupon'?jumpPay(item):null">去使用</view>
</view>
</template>
</view>
......@@ -104,7 +104,7 @@
onLoad(option) {
let self = this;
self.optionData = option;
console.log(option)
console.log(option,'option')
self.initial();
self.getCoupon()
self.getLoseCoupon()
......@@ -146,8 +146,18 @@
break;
}
},
jump(data) {
uni.$emit('payInfo',data)
jump(data) {
if(data.minUsed <= this.optionData.price){
uni.$emit('payInfo',data)
uni.navigateBack({
delta: 1
});
}else{
uni.showToast({
title:'请选择合适的优惠券',
icon:'none'
})
}
// 获取所有页面栈实例列表
// let pages = getCurrentPages();
......@@ -158,9 +168,14 @@
// prevPage.$vm.times = 100;
//uni.navigateTo跳转的返回,默认1为返回上一级
uni.navigateBack({
delta: 1
});
},
jumpPay(){
// console.log('去适应')
this.$uniGo.redirectTo({
url:'/pages/release/index'
})
}
}
};
......
......@@ -37,8 +37,8 @@
<view class="">
已沟通审核通过,待支付<text>{{item.actualAmount ? item.actualAmount : 0}}</text>
</view>
<view class="">
截止1小时内支付完成<text v-if="isEndTime">{{isEndTime}}</text>
<view class="" v-if="item.isEndTime">
截止1小时内支付完成<text>{{item.isEndTime}}</text>
</view>
</view>
<view class="" @click.stop="payment(item)">
......@@ -49,8 +49,8 @@
<view class="buttoncolor" v-if="subscript == '3'">
<button v-if="item.status == 3" style="background: red;" class="buttoncl"
@click.stop="abolish(2,item)">退款</button>
<button v-else-if="item.status == 6" class="buttonclde buttonGray"
@click.stop="abolish(4,item)">已退款</button>
<button v-else-if="item.status == 5 || item.status == 6" class="buttonclde buttonGray"
@click.stop="abolish(4,item)">{{item.status == 5 ? '退款中' : '已退款'}}</button>
<button class="buttoncl" @click.stop="abolish(3,item)">详情</button>
</view>
</view>
......@@ -96,25 +96,30 @@
}
},
mounted() {
if(this.subscript == 2){
this.list.map(item=>{
if (this.subscript == 2) {
this.list.map((item,index)=>{
this.timer = setInterval(() => {
this.showtime(item.modifyTime)
this.showtime(item,index)
}, 1000)
})
}
},
beforeDestroy() {
clearInterval(this.timer);
this.timer = null;
},
methods: {
showtime(modifyTime) {
showtime(item,index) {
let that = this
//获取当前时间
var curTime = new Date();
var curTimeDate = curTime.getTime(); //当前时间戳
// 发起支付的时间
var startTime = new Date(modifyTime);
var startTime = new Date(item.modifyTime);
// 发起支付的时间+1小时
var addHour = startTime.setHours(startTime.getHours() + 1)
console.log(addHour,'大伤脑筋')
console.log(new Date(addHour),'大伤脑筋111')
// console.log(addHour,'大伤脑筋')
// console.log(new Date(addHour),'大伤脑筋111')
var lefttime = addHour - curTimeDate,
leftd = Math.floor(lefttime / (1000 * 60 * 60 * 24)), //计算天数
lefth = Math.floor((lefttime / (1000 * 60 * 60) % 24) + leftd * 24) < 10 ? "0" + Math.floor((lefttime /
......@@ -124,15 +129,16 @@
Math.floor(lefttime / (1000 * 60) % 60), //计算分钟数
lefts = Math.floor(lefttime / 1000 % 60) < 10 ? "0" + Math.floor(lefttime / 1000 % 60) : Math.floor(
lefttime / 1000 % 60); //计算秒数
this.countdownh = lefth //返回倒计时的字符串
this.countdownm = leftm //返回倒计时的字符串
this.countdowns = lefts //返回倒计时的字符串
that.countdownh = lefth //返回倒计时的字符串
that.countdownm = leftm //返回倒计时的字符串
that.countdowns = lefts //返回倒计时的字符串
// 倒计时结束时,显示00:00:00
if (lefttime < 0) {
this.countdownh = this.countdownm = this.countdowns = "00"
that.countdownh = that.countdownm = that.countdowns = "00"
}
this.isEndTime = this.countdownh + '时' + this.countdownm + '分' + this.countdowns + '秒'
that.$set(item,'isEndTime',that.countdownh + '时' + that.countdownm + '分' + that.countdowns + '秒')
// that.isEndTime = that.countdownh + '时' + that.countdownm + '分' + that.countdowns + '秒'
},
// 跳转详情页
jump(data) {
......@@ -305,6 +311,7 @@
.buttonGray {
border: 1rpx solid #666666 !important;
color: #666666 !important;
margin-right: 20rpx;
}
.reject {
......
......@@ -101,7 +101,6 @@
this.getSquare()
},
onPageScroll(res) {
// console.log('页面滚动了onPageScroll-app', res.scrollTop);
this.scrollTopHeader = res.scrollTop;
},
onReachBottom() {
......@@ -118,7 +117,7 @@
if(res.code == 200){
if(res.total > 0){
that.total = res.total
if(that.total <= that.queryParams.pageNum){
if(that.total <= that.queryParams.pageSize){
that.loadStatus = 'nomore'
}
if(that.queryParams.pageNum == 1){
......
......@@ -86,7 +86,7 @@
const {code,total,rows} = data_back;
if(code === 200 && total > 0) {
that.total = total
if(that.total < that.queryParams.pageSize){
if(that.total <= that.queryParams.pageSize){
that.loadStatus = 'nomore'
}else{
that.loadStatus = 'loading'
......
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