Browse Source

代码处理

master
xpz2018 6 years ago
parent
commit
a39cc58958
7 changed files with 6 additions and 205 deletions
  1. BIN
      assets/image/login_logo.png
  2. 2
      pages/login/index.wxml
  3. 203
      pages/mall/index.wxs
  4. 2
      pages/mall/index/index.wxml
  5. 1
      pages/mall/order-detail/index.wxml
  6. 2
      pages/mall/order-offer/index.wxml
  7. 1
      pages/mall/search-list/index.wxml

BIN
assets/image/login_logo.png

Before After
Width: 786  |  Height: 112  |  Size: 15 KiB

2
pages/login/index.wxml

@ -1,6 +1,6 @@
<!--pages/login/index.wxml--> <!--pages/login/index.wxml-->
<view class="header-box flex justify-center"> <view class="header-box flex justify-center">
<image src="/assets/image/login_logo.png" style="width:420rpx;height:60rpx;margin-top:200rpx"></image>
<!-- <image src="/assets/image/login_logo.png" style="width:420rpx;height:60rpx;margin-top:200rpx"></image> -->
</view> </view>
<view class="padding content-box"> <view class="padding content-box">
<view class="cu-form-group" style="min-height:120rpx;padding:1rpx 16rpx"> <view class="cu-form-group" style="min-height:120rpx;padding:1rpx 16rpx">

203
pages/mall/index.wxs

@ -1,43 +1,3 @@
function orderStatus(status) {
if (status == 2) {
return '已完成'
} else if (status == 3) {
return '已取消'
} else if (status == 4) {
return '待调度'
} else if (status == 5) {
return '待装货'
} else if (status == 6) {
return '待验货'
} else if (status == 7) {
return '待入库'
} else if (status == 8) {
return '已入库'
}
return ''
}
function customerType(type) {
if (type == 0) {
return 'A'
} else if (type == 1) {
return 'B'
} else if (type == 2) {
return 'C'
}
return ''
}
function colorType(type) {
if (type == 0) {
return 'blue'
} else if (type == 1) {
return 'green'
} else if (type == 2) {
return 'tree'
}
return ''
}
function formatePrice(price) { function formatePrice(price) {
return Number(parseFloat(price) / 100).toFixed(2) return Number(parseFloat(price) / 100).toFixed(2)
@ -46,91 +6,12 @@ function formatePrice(price) {
function formateWeight(weight) { function formateWeight(weight) {
return Number(parseFloat(weight) / 1000).toFixed(3) return Number(parseFloat(weight) / 1000).toFixed(3)
} }
function deductMoney(money) {
if (money < 0) {
return '待定'
} else if (money === 0) {
return money
}
return (money / 100).toFixed(2)
}
function deductStatus(deductionStatus) {
switch (deductionStatus) {
case 0:
return '【待客户确认】'
case 1:
return '【客户同意】'
case -1:
return '【客户拒绝】'
}
}
function orderDate(order) {
if (order.orderStatus == 4) {
return '下单日期:' + order.orderDate
} else if (order.orderStatus == 5) {
return '调度日期' + order.schedulingCreateDate
} else if (order.orderStatus == 6) {
return '装货日期:' + order.shippingDate
} else if (order.orderStatus == 7 || order.orderStatus == 8 || order.orderStatus == 2) {
return '验货日期:' + order.inspectionDate
}
return ''
}
function isInspectable(order, centerId) {
if (!order) {
return false
}
if (order.orderStatus === 6) {
if (centerId === 1) {
return true
}
return Number(order.destinationOperationCenterId) === centerId
}
return false
}
function isStockinable(order, centerId) {
if (!order) {
return false
}
if (order.orderStatus === 7) {
if (centerId === 1) {
return true
}
return Number(order.destinationOperationCenterId) === centerId
}
return false
}
function canHandle(order, centerId) {
if (order.inspectionId > 0 && order.deductMoney == -1) {
if (centerId === 1) {
return true
}
return Number(order.destinationOperationCenterId) === centerId
}
return false
}
function isAbnormalable(order, centerId) {
if (order.orderStatus === 6) {
if (centerId === 1) {
return true
}
return Number(order.destinationOperationCenterId) === centerId
}
return false
}
function isEmpty(val) { function isEmpty(val) {
return typeof val === 'undefined' || val === '' || val === null return typeof val === 'undefined' || val === '' || val === null
} }
function formateOrderDate(datetime) {
function formateDate(datetime) {
if (isEmpty(datetime)) { if (isEmpty(datetime)) {
return '' return ''
} }
@ -156,86 +37,8 @@ function formateOrderDate(datetime) {
return datetime + week return datetime + week
} }
function getCateName(item) {
if (!item.categoriesName){
return ''
}
if (item.categoriesName.toString().length < 10) {
return item.categoriesName
}
return item.categoriesName.substring(0, 10) + '...'
}
function handleWeight(weight) {
if (!weight) {
return ''
}
return '折算重量:' + Number(weight / 1000).toFixed(3) + '吨'
}
/**
* 4: 'green',
5: 'green',
6: 'green',
7: 'green',
8: 'green',
0: 'grey',
1: 'green',
2: 'grey',
3: 'grey'
*/
function orderStatusColor(status) {
if (status == 4) {
return 'yellow'
} else if (status == 5) {
return 'yellow'
} else if (status == 6) {
return 'yellow'
} else if (status == 7) {
return 'yellow'
} else if (status == 8) {
return 'yellow'
} else if (status == 0) {
return 'gray'
} else if (status == 1) {
return 'gray'
} else if (status == 2) {
return 'blue'
} else if (status == 3) {
return 'gray'
}
return ''
}
function getGuidePrice(cateId, cateList) {
for (var i = 0; i < cateList.length; i++) {
if (parseInt(cateId) == parseInt(cateList[i].value)) {
return '今日指导价:¥' + formatePrice(cateList[i].price) + '元/kg'
}
}
return ''
}
function offesWeight(offsetWeight, totalWeight) {
return offsetWeight > 0.01 * totalWeight
}
module.exports = { module.exports = {
orderStatus: orderStatus,
customerType: customerType,
colorType: colorType,
formatePrice: formatePrice, formatePrice: formatePrice,
deductMoney: deductMoney,
deductStatus: deductStatus,
orderDate: orderDate,
isInspectable: isInspectable,
canHandle: canHandle,
formateWeight: formateWeight, formateWeight: formateWeight,
formateOrderDate: formateOrderDate,
getCateName: getCateName,
handleWeight: handleWeight,
orderStatusColor: orderStatusColor,
getGuidePrice: getGuidePrice,
isStockinable: isStockinable,
offesWeight: offesWeight
formateDate: formateDate
} }

2
pages/mall/index/index.wxml

@ -1,5 +1,5 @@
<!--pages/message/index.wxml--> <!--pages/message/index.wxml-->
<wxs module="order" src="../index.wxs"></wxs>
<!-- <wxs module="order" src="../index.wxs"></wxs> -->
<cu-custom bgColor="bg-white" isBack="{{false}}"> <cu-custom bgColor="bg-white" isBack="{{false}}">
<!-- <view slot="right">原子商城原子商城原子商城原子商城</view> --> <!-- <view slot="right">原子商城原子商城原子商城原子商城</view> -->
<view slot="content" style="color:black;font-size:18px">原纸商城</view> <view slot="content" style="color:black;font-size:18px">原纸商城</view>

1
pages/mall/order-detail/index.wxml

@ -1,5 +1,4 @@
<!--pages/task/task-detail/index.wxml--> <!--pages/task/task-detail/index.wxml-->
<wxs module="order" src="../index.wxs"></wxs>
<cu-custom bgColor="bg-white" isBack="{{true}}"> <cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="backText">返回</view> <view slot="backText">返回</view>
<view slot="content" style="color:black;font-size:18px">订单详情</view> <view slot="content" style="color:black;font-size:18px">订单详情</view>

2
pages/mall/order-offer/index.wxml

@ -1,5 +1,5 @@
<!--pages/task/task-detail/index.wxml--> <!--pages/task/task-detail/index.wxml-->
<wxs module="order" src="../index.wxs"></wxs>
<!-- <wxs module="mall" src="../index.wxs"></wxs> -->
<cu-custom bgColor="bg-white" isBack="{{true}}"> <cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="backText">返回</view> <view slot="backText">返回</view>
<view slot="content" style="color:black;font-size:18px">确认订单</view> <view slot="content" style="color:black;font-size:18px">确认订单</view>

1
pages/mall/search-list/index.wxml

@ -1,5 +1,4 @@
<!--pages/message/index.wxml--> <!--pages/message/index.wxml-->
<wxs module="order" src="../index.wxs"></wxs>
<cu-custom bgColor="bg-white" isBack="{{true}}"> <cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="backText">返回</view> <view slot="backText">返回</view>
<view slot="content" style="color:black;font-size:18px">原纸商城</view> <view slot="content" style="color:black;font-size:18px">原纸商城</view>

Loading…
Cancel
Save