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