Browse Source

no message

feature/v2.1
xpz2018 4 years ago
parent
commit
63e624b047
3 changed files with 37 additions and 12 deletions
  1. 6
      pages/process/order-check/index.wxml
  2. 13
      pages/process/order-price/index.js
  3. 30
      pages/process/order-price/index.wxml

6
pages/process/order-check/index.wxml

@ -32,6 +32,12 @@
<view class="text-gray">{{form.emptyWeight || '- -'}}</view> <view class="text-gray">{{form.emptyWeight || '- -'}}</view>
</view> </view>
</van-cell> </van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">净重(公斤)</view>
<view class="text-gray">{{form.netWeight || '- -'}}</view>
</view>
</van-cell>
<view class="flex flex-center bg-white margin-top" style="justify-content: flex-start;padding: 24rpx 32rpx;border-bottom:1rpx solid #f3f3f3"> <view class="flex flex-center bg-white margin-top" style="justify-content: flex-start;padding: 24rpx 32rpx;border-bottom:1rpx solid #f3f3f3">
<view style="height:30rpx;width:6rpx;background-image: linear-gradient(180deg, #007AFF 0%, #027BFF 15%, #5AABFF 45%, #CAF4FE 100%);"></view> <view style="height:30rpx;width:6rpx;background-image: linear-gradient(180deg, #007AFF 0%, #027BFF 15%, #5AABFF 45%, #CAF4FE 100%);"></view>
<view class="text-black text-sg text-bold" style="margin-left: 12rpx">定价信息</view> <view class="text-black text-sg text-bold" style="margin-left: 12rpx">定价信息</view>

13
pages/process/order-price/index.js

@ -88,21 +88,22 @@ Scene({
this.setData({ visible: false }) this.setData({ visible: false })
}, },
changeDeductType: function(e){ changeDeductType: function(e){
this.setData({ ['form.sign']: e.currentTarget.dataset.type, focus: e.currentTarget.dataset.type })
var type = Number(e.currentTarget.dataset.type)
this.setData({ ['form.sign']: type, focus: type })
}, },
bindInput: function (e) { bindInput: function (e) {
this.data.form[e.target.id] = e.detail.value
this.data.form[e.target.id] = e.detail
if(e.target.id == 'deductPercent'){ if(e.target.id == 'deductPercent'){
if(util.isEmpty(e.detail.value) || Number(e.detail.value) <= 0){
if(util.isEmpty(e.detail) || Number(e.detail) <= 0){
this.setData({ ['form.deductWeight']: null, ['form.deductPercent']: null }) this.setData({ ['form.deductWeight']: null, ['form.deductPercent']: null })
} else { } else {
this.setData({ ['form.deductWeight']: math.divide(math.times(this.data.form.totalWeight, Number(e.detail.value)), 100).toFixed(3) })
this.setData({ ['form.deductWeight']: math.divide(math.times(this.data.form.totalWeight, Number(e.detail)), 100).toFixed(3) })
} }
} else if(e.target.id == 'deductWeight'){ } else if(e.target.id == 'deductWeight'){
if(util.isEmpty(e.detail.value) || Number(e.detail.value) <= 0){
if(util.isEmpty(e.detail) || Number(e.detail) <= 0){
this.setData({ ['form.deductWeight']: null, ['form.deductPercent']: null }) this.setData({ ['form.deductWeight']: null, ['form.deductPercent']: null })
} else { } else {
this.setData({ ['form.deductPercent']: math.times(math.divide(Number(e.detail.value), this.data.form.totalWeight), 100).toFixed(2) })
this.setData({ ['form.deductPercent']: math.times(math.divide(Number(e.detail), this.data.form.totalWeight), 100).toFixed(2) })
} }
} }
}, },

30
pages/process/order-price/index.wxml

@ -60,7 +60,7 @@
<view style="height:30rpx;width:6rpx;background-image: linear-gradient(180deg, #007AFF 0%, #027BFF 15%, #5AABFF 45%, #CAF4FE 100%);"></view> <view style="height:30rpx;width:6rpx;background-image: linear-gradient(180deg, #007AFF 0%, #027BFF 15%, #5AABFF 45%, #CAF4FE 100%);"></view>
<view class="text-black text-sg text-bold" style="margin-left: 12rpx">定价信息</view> <view class="text-black text-sg text-bold" style="margin-left: 12rpx">定价信息</view>
</view> </view>
<van-cell>
<!-- <van-cell>
<view slot="title" class="flex flex-justify"> <view slot="title" class="flex flex-justify">
<view class="flex flex-center text-black"> <view class="flex flex-center text-black">
<view class="text-red text-xl" style="line-height: 10px; padding-top: 8px">*</view> <view class="text-red text-xl" style="line-height: 10px; padding-top: 8px">*</view>
@ -69,8 +69,14 @@
<input id="unitPrice" type="digit" placeholder-style="color:#aaa" style="text-align: right" maxlength="8" <input id="unitPrice" type="digit" placeholder-style="color:#aaa" style="text-align: right" maxlength="8"
placeholder="请输入单价" value="{{form.unitPrice || ''}}" bindinput="bindInput" /> placeholder="请输入单价" value="{{form.unitPrice || ''}}" bindinput="bindInput" />
</view> </view>
</van-cell>
<van-cell>
</van-cell> -->
<van-field id="unitPrice" value="{{ form.unitPrice || '' }}" type="digit" placeholder="请输入单价" clearable input-align="right" bind:change="bindInput">
<view slot="label" class="flex text-black" style="width:200rpx">
<view class="text-red text-xl" style="line-height: 10px; padding-top: 12px">*</view>
<text>单价(元/公斤)</text>
</view>
</van-field>
<!-- <van-cell>
<view slot="title" class="flex flex-justify"> <view slot="title" class="flex flex-justify">
<view class="flex flex-center text-black" data-type="1" bindtap="changeDeductType"> <view class="flex flex-center text-black" data-type="1" bindtap="changeDeductType">
<van-checkbox value="{{ form.sign == 1 }}" icon-size="32rpx"></van-checkbox> <van-checkbox value="{{ form.sign == 1 }}" icon-size="32rpx"></van-checkbox>
@ -80,8 +86,14 @@
placeholder-style="color:#aaa" style="text-align: right;flex:1" maxlength="10" placeholder="请输入扣重重量(选填)" placeholder-style="color:#aaa" style="text-align: right;flex:1" maxlength="10" placeholder="请输入扣重重量(选填)"
value="{{form.deductWeight}}" bindinput="bindInput" data-type="1" bindtap="changeDeductType" /> value="{{form.deductWeight}}" bindinput="bindInput" data-type="1" bindtap="changeDeductType" />
</view> </view>
</van-cell>
<van-cell>
</van-cell> -->
<van-field id="deductWeight" value="{{ form.deductWeight || '' }}" data-type="1" type="digit" placeholder="请输入扣重重量(选填)" clearable disabled="{{form.sign == 2}}" input-align="right" focus="{{focus == 1}}" bind:change="bindInput" bind:click-input="changeDeductType">
<view slot="label" class="flex flex-center text-black" style="justify-content: flex-start" data-type="1" bindtap="changeDeductType">
<van-checkbox value="{{ form.sign == 1 }}" icon-size="32rpx"></van-checkbox>
<text style="margin-left:8rpx">扣重(公斤)</text>
</view>
</van-field>
<!-- <van-cell>
<view slot="title" class="flex flex-justify"> <view slot="title" class="flex flex-justify">
<view class="flex flex-center text-black" data-type="2" bindtap="changeDeductType"> <view class="flex flex-center text-black" data-type="2" bindtap="changeDeductType">
<van-checkbox value="{{ form.sign == 2 }}" icon-size="32rpx"></van-checkbox> <van-checkbox value="{{ form.sign == 2 }}" icon-size="32rpx"></van-checkbox>
@ -91,7 +103,13 @@
placeholder-style="color:#aaa" style="text-align: right;flex:1" maxlength="10" placeholder="请输入扣点比例(选填)" placeholder-style="color:#aaa" style="text-align: right;flex:1" maxlength="10" placeholder="请输入扣点比例(选填)"
value="{{form.deductPercent}}" bindinput="bindInput" data-type="2" bindtap="changeDeductType" /> value="{{form.deductPercent}}" bindinput="bindInput" data-type="2" bindtap="changeDeductType" />
</view> </view>
</van-cell>
</van-cell> -->
<van-field id="deductPercent" value="{{ form.deductPercent || '' }}" type="digit" placeholder="请输入扣点比例(选填)" clearable disabled="{{form.sign == 1}}" input-align="right" focus="{{focus == 2}}" bind:change="bindInput" data-type="2" maxlength="10" bind:click-input="changeDeductType">
<view slot="label" class="flex flex-center text-black" style="justify-content: flex-start" data-type="2" bindtap="changeDeductType">
<van-checkbox value="{{ form.sign == 2 }}" icon-size="32rpx"></van-checkbox>
<text style="margin-left:8rpx">扣点(%)</text>
</view>
</van-field>
<van-cell> <van-cell>
<view slot="title" class="flex flex-justify"> <view slot="title" class="flex flex-justify">
<view class="text-black">无皮过磅</view> <view class="text-black">无皮过磅</view>

Loading…
Cancel
Save