|
|
@ -1,79 +1,81 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<view class="page"> |
|
|
|
<view class="page"> |
|
|
|
<template v-for="c in courses"> |
|
|
|
<template v-for="c in courses"> |
|
|
|
<view v-if="c.list.length" class="block"> |
|
|
|
<view v-if="c.list.length && c.list.filter(e => !e.edited).length" class="block"> |
|
|
|
<view class="l-title">{{ c.name }}</view> |
|
|
|
<view class="l-title">{{ c.name }}</view> |
|
|
|
<uni-icons class="arrow" type="top" size="20" color="#007EFF" @click="toggle(c)"></uni-icons> |
|
|
|
<uni-icons class="arrow" type="top" size="20" color="#007EFF" @click="toggle(c)"></uni-icons> |
|
|
|
<view v-show="!c.shrink"> |
|
|
|
<view v-show="!c.shrink"> |
|
|
|
<view v-for="(item, i) in c.list"> |
|
|
|
<template v-for="(item, i) in c.list"> |
|
|
|
<view class="pro-name"> |
|
|
|
<view v-if="!item.edited" :key="i"> |
|
|
|
<view class="left"> |
|
|
|
<view class="pro-name"> |
|
|
|
<image class="icon" :src="$util.getIcon(item)" mode="widthFix"></image> |
|
|
|
<view class="left"> |
|
|
|
{{ item.productName }} |
|
|
|
<image class="icon" :src="$util.getIcon(item)" mode="widthFix"></image> |
|
|
|
</view> |
|
|
|
{{ item.productName }} |
|
|
|
<uni-icons v-if="isAdd || isRenew" class="del" type="trash" size="25" color="#ADADAD" @click="delCourse(c, i)"></uni-icons> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<uni-icons v-if="isAdd || isRenew" class="del" type="trash" size="25" color="#ADADAD" @click="delCourse(c, i)"></uni-icons> |
|
|
|
<view class="form-list"> |
|
|
|
|
|
|
|
<view class="line"> |
|
|
|
|
|
|
|
<view class="name">产品类型</view> |
|
|
|
|
|
|
|
<view class="val">{{ item.typeName }}</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view :class="['line', {err: err === 'periodOfUse' + item.dataOrCourseId + item.authority}]"> |
|
|
|
<view class="form-list"> |
|
|
|
<view class="name">使用期限</view> |
|
|
|
<view class="line"> |
|
|
|
<view class="period-wrap"> |
|
|
|
<view class="name">产品类型</view> |
|
|
|
<input class="period" type="number" v-model="item.periodOfUse" placeholder="请输入" :disabled="isEdit" @input="calcDate(item, !item.authority)" @change="handleErr(item, 'periodOfUse')"> |
|
|
|
<view class="val">{{ item.typeName }}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view v-if="isEdit">{{ units.find(e => e.id === item.options).text }}</view> |
|
|
|
<view :class="['line', {err: err === 'periodOfUse' + item.dataOrCourseId + item.authority}]"> |
|
|
|
<view v-else class="val unit" @click="selectUnit(item)"> |
|
|
|
<view class="name">使用期限</view> |
|
|
|
<text>{{ units.find(e => e.id === item.options).text }}</text> |
|
|
|
<view class="period-wrap"> |
|
|
|
<image class="icon" src="@/static/image/arrow-down.png" mode="widthFix"></image> |
|
|
|
<input class="period" type="number" v-model="item.periodOfUse" placeholder="请输入" :disabled="isEdit" @input="calcDate(item, !item.authority)" @change="handleErr(item, 'periodOfUse')"> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view v-if="isEdit">{{ units.find(e => e.id === item.options).text }}</view> |
|
|
|
|
|
|
|
<view v-else class="val unit" @click="selectUnit(item)"> |
|
|
|
|
|
|
|
<text>{{ units.find(e => e.id === item.options).text }}</text> |
|
|
|
|
|
|
|
<image class="icon" src="@/static/image/arrow-down.png" mode="widthFix"></image> |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view :class="['line req', {err: err === 'startTime' + item.dataOrCourseId + item.authority}]"> |
|
|
|
<view :class="['line req', {err: err === 'startTime' + item.dataOrCourseId + item.authority}]"> |
|
|
|
<view class="name">起止日期</view> |
|
|
|
<view class="name">起止日期</view> |
|
|
|
<view v-if="isEdit">{{ item.endTime ? item.startTime + ' - ' + item.endTime : item.startTime}}</view> |
|
|
|
<view v-if="isEdit">{{ item.endTime ? item.startTime + ' - ' + item.endTime : item.startTime}}</view> |
|
|
|
<view v-else class="val unit"> |
|
|
|
<view v-else class="val unit"> |
|
|
|
<uni-datetime-picker type="date" v-model="item.startTime" :border="false" @change="calcDate(item)"> |
|
|
|
<uni-datetime-picker type="date" v-model="item.startTime" :border="false" @change="calcDate(item)"> |
|
|
|
<view :class="['ph', {val: item.startTime}]"> |
|
|
|
<view :class="['ph', {val: item.startTime}]"> |
|
|
|
{{ item.endTime ? item.startTime + ' - ' + item.endTime : item.startTime}} |
|
|
|
{{ item.endTime ? item.startTime + ' - ' + item.endTime : item.startTime}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uni-datetime-picker> |
|
|
|
</uni-datetime-picker> |
|
|
|
<image class="icon" src="@/static/image/arrow-down.png" mode="widthFix"></image> |
|
|
|
<image class="icon" src="@/static/image/arrow-down.png" mode="widthFix"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view :class="['line req', {err: err === 'accountNum' + item.dataOrCourseId + item.authority}]"> |
|
|
|
<view :class="['line req', {err: err === 'accountNum' + item.dataOrCourseId + item.authority}]"> |
|
|
|
<view class="name">数量</view> |
|
|
|
<view class="name">数量</view> |
|
|
|
<view v-if="item.authority" class="ph">1</view> |
|
|
|
<view v-if="item.authority" class="ph">1</view> |
|
|
|
<input v-else type="number" v-model="item.accountNum" placeholder="请输入账号数量" @input="calcFinalPrice(item)" @change="handleErr(item, 'accountNum')"> |
|
|
|
<input v-else type="number" v-model="item.accountNum" placeholder="请输入账号数量" @input="calcFinalPrice(item)" @change="handleErr(item, 'accountNum')"> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="line"> |
|
|
|
|
|
|
|
<view class="name">{{ item.authority ? '市场价' : '市场单价' }}</view> |
|
|
|
|
|
|
|
<view class="ph">{{ item.marketValue }}元</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="line"> |
|
|
|
|
|
|
|
<view class="name">结算价</view> |
|
|
|
|
|
|
|
<view class="inline"> |
|
|
|
|
|
|
|
<input type="number" v-model="item.settlementPrice" placeholder="请输入" @change="handleErr(item, 'settlementPrice')"> |
|
|
|
|
|
|
|
元 |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="line"> |
|
|
|
<view class="line"> |
|
|
|
<view class="name">{{ item.authority ? '市场价' : '市场单价' }}</view> |
|
|
|
<view class="name">折扣率</view> |
|
|
|
<view class="ph">{{ item.marketValue }}元</view> |
|
|
|
<view class="ph">{{ item.discountRate }}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="line"> |
|
|
|
<view class="line"> |
|
|
|
<view class="name">结算价</view> |
|
|
|
<view class="name">平台服务费</view> |
|
|
|
<view class="inline"> |
|
|
|
<view class="ph">{{ item.serviceFee }}元</view> |
|
|
|
<input type="number" v-model="item.settlementPrice" placeholder="请输入" @change="handleErr(item, 'settlementPrice')"> |
|
|
|
</view> |
|
|
|
元 |
|
|
|
<view :class="['line req', {err: err === 'finalPrice' + item.dataOrCourseId + item.authority}]"> |
|
|
|
</view> |
|
|
|
<view class="name">成交价</view> |
|
|
|
</view> |
|
|
|
<view class="inline"> |
|
|
|
<view class="line"> |
|
|
|
<input type="number" v-model="item.finalPrice" placeholder="请输入" :disabled="isEdit && !item.authority" @input="calcFinalValue(item)" @change="handleErr(item, 'finalPrice')"> |
|
|
|
<view class="name">折扣率</view> |
|
|
|
元 |
|
|
|
<view class="ph">{{ item.discountRate }}</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="line"> |
|
|
|
|
|
|
|
<view class="name">平台服务费</view> |
|
|
|
|
|
|
|
<view class="ph">{{ item.serviceFee }}元</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view :class="['line req', {err: err === 'finalPrice' + item.dataOrCourseId + item.authority}]"> |
|
|
|
|
|
|
|
<view class="name">成交价</view> |
|
|
|
|
|
|
|
<view class="inline"> |
|
|
|
|
|
|
|
<input type="number" v-model="item.finalPrice" placeholder="请输入" :disabled="isEdit && !item.authority" @input="calcFinalValue(item)" @change="handleErr(item, 'finalPrice')"> |
|
|
|
|
|
|
|
元 |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
</template> |
|
|
@ -364,10 +366,12 @@ |
|
|
|
msg = '请输入成交价!' |
|
|
|
msg = '请输入成交价!' |
|
|
|
break |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
e.edited = 1 // 未编辑过的标识,编辑过了的产品在编辑产品页不再显示 |
|
|
|
} |
|
|
|
} |
|
|
|
if (msg) return this.$util.errMsg(msg) |
|
|
|
if (msg) return this.$util.errMsg(msg) |
|
|
|
if (this.orderRepeat.length) return this.$util.errMsg(this.repeatMsg) // 有重复订单不能提交 |
|
|
|
if (this.orderRepeat.length) return this.$util.errMsg(this.repeatMsg) // 有重复订单不能提交 |
|
|
|
uni.setStorageSync('courses', this.courses) |
|
|
|
uni.setStorageSync('courses', this.courses) |
|
|
|
|
|
|
|
uni.setStorageSync('orderEdited', 1) |
|
|
|
uni.navigateBack() |
|
|
|
uni.navigateBack() |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|