Commit 186c3552 by 张立顺

fix bug

1 parent 995eccad
...@@ -23,7 +23,7 @@ const accountInfo = wx.getAccountInfoSync() ...@@ -23,7 +23,7 @@ const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync() const systemInfo = wx.getSystemInfoSync()
const envName = accountInfo.miniProgram.envVersion const envName = accountInfo.miniProgram.envVersion
//手动控制体验版环境的请求 true就依据下面index false就默认2 //手动控制体验版环境的请求 true就依据下面index false就默认2
const manual = false const manual = true
const release = false const release = false
// 判断小程序环境 // 判断小程序环境
......
var replaceItemText = function (item) { var replaceItemText = function (item) {
var reg = getRegExp(';~;', 'g') var reg = getRegExp(';~;', 'g')
// return item.replace(reg, ' ') // return item.replace(reg, ' ')
return item ? item.replace(reg, ' ') : null return item ? item.replace(reg, ' ') : null
...@@ -11,13 +10,20 @@ var isIncludesItem = function (list, item) { ...@@ -11,13 +10,20 @@ var isIncludesItem = function (list, item) {
// var flag = list.indexOf(item) // var flag = list.indexOf(item)
return list.indexOf(item) != -1 return list.indexOf(item) != -1
} }
var subStatus = function (item) { var subStatus = function (constructionStatus) {
var staus = { console.log(constructionStatus);
"Y": 'constructionFlaged', switch (constructionStatus) {
"N": 'constructionFlaging', case 1:
"Z": '' case 2:
return 'constructionFlaged';
case 0:
return 'constructionFlaging';
case 3:
return '';
default:
return '';
} }
return staus[item.constructionFlaged] || '' // return 'constructionFlaging';
} }
/* /*
* 导出 * 导出
......
...@@ -620,7 +620,12 @@ Page({ ...@@ -620,7 +620,12 @@ Page({
data.list.map(e => { data.list.map(e => {
if (e.orderTime) if (e.orderTime)
e.orderTime = new Date(e.orderTime).format('yyyy-MM-dd hh:mm:ss') e.orderTime = new Date(e.orderTime).format('yyyy-MM-dd hh:mm:ss')
// 判断一下是否所有子订单都已经施工,是就跳转 施工完成
e.allConstructionFlag = true
e.subOrderList.map(i => { e.subOrderList.map(i => {
if (i.constructionFlag != 'Y') {
e.allConstructionFlag = false
}
i.totalPrice = Number(wx.$util.decimal(i.totalPrice, 2)).toFixed(2) i.totalPrice = Number(wx.$util.decimal(i.totalPrice, 2)).toFixed(2)
}) })
e.total_price = e.totalPrice e.total_price = e.totalPrice
...@@ -644,6 +649,9 @@ Page({ ...@@ -644,6 +649,9 @@ Page({
g.price = g.totalPrice g.price = g.totalPrice
? Number(g.totalPrice) / Number(g.number) ? Number(g.totalPrice) / Number(g.number)
: g.upgradePrice : g.upgradePrice
if (g.constructionFlag != 'Y') {
e.allConstructionFlag = false
}
}) })
item.goodsList = item.packageGoodsOrderList item.goodsList = item.packageGoodsOrderList
item.price = item.goodsList.reduce((prev, cur) => { item.price = item.goodsList.reduce((prev, cur) => {
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
<view class="goods-list" style="padding-bottom:{{ li.subOrderList.length<1?0:'' }}"> <view class="goods-list" style="padding-bottom:{{ li.subOrderList.length<1?0:'' }}">
<block wx:if="{{ li.subOrderList.length }}"> <block wx:if="{{ li.subOrderList.length }}">
<block wx:for="{{ li.subOrderList }}" wx:key="sindex" wx:for-item="i" wx:for-index="sindex"> <block wx:for="{{ li.subOrderList }}" wx:key="sindex" wx:for-item="i" wx:for-index="sindex">
<view catch:tap="foldUp" data-item="{{ i }}" data-index="{{ sindex }}" data-listindex="{{ ind }}" class="goods {{ filter.subStatus(li.constructionFlag) }} {{i.packageGoodsOrderList?'pullDownArrow':''}} {{i.foldUp?'showAllGoodsListFlag':''}}" wx:if="{{ li.showAllGoodsListFlag ? true : sindex < 2 }}"> <view catch:tap="foldUp" data-item="{{ i }}" data-index="{{ sindex }}" data-listindex="{{ ind }}" class="goods {{ filter.subStatus(i.constructionStatus) }} {{i.packageGoodsOrderList?'pullDownArrow':''}} {{sindex.foldUp?'showAllGoodsListFlag':'' }}" wx:if="{{ li.showAllGoodsListFlag ? true : sindex < 2 }}">
<view class="goods-name text-hide"> <view class="goods-name text-hide">
{{filter.replaceItemText(i.upgradeGoodsAlias) ||filter.replaceItemText(i.upgradeGoodsName) || i.packageName||''}} {{filter.replaceItemText(i.upgradeGoodsAlias) ||filter.replaceItemText(i.upgradeGoodsName) || i.packageName||''}}
</view> </view>
...@@ -64,8 +64,8 @@ ...@@ -64,8 +64,8 @@
</view> </view>
<!-- 显示套餐子商品 --> <!-- 显示套餐子商品 -->
<view class="packgoodsListCon" wx:if="{{ i.packageGoodsOrderList&&!i.foldUp&&( li.showAllGoodsListFlag ? true : sindex < 2) }}"> <view class="packgoodsListCon" wx:if="{{ i.packageGoodsOrderList&&!i.foldUp&&( li.showAllGoodsListFlag ? true : sindex < 2) }}">
<block wx:for="{{ i.packageGoodsOrderList }}" wx:key="sindex" wx:for-item="packchild" wx:for-index="sindex"> <block wx:for="{{ i.packageGoodsOrderList }}" wx:key="packindex" wx:for-item="packchild" wx:for-index="packindex">
<view class="goods {{ filter.subStatus(li.constructionFlag) }}"> <view class="goods {{ filter.subStatus(packchild.constructionStatus) }}">
<view class="goods-name text-hide"> <view class="goods-name text-hide">
{{filter.replaceItemText(packchild.upgradeGoodsAlias) ||filter.replaceItemText(packchild.upgradeGoodsName) || packchild.packageName||''}} {{filter.replaceItemText(packchild.upgradeGoodsAlias) ||filter.replaceItemText(packchild.upgradeGoodsName) || packchild.packageName||''}}
</view> </view>
......
...@@ -50,10 +50,10 @@ ...@@ -50,10 +50,10 @@
</view> </view>
<view class="meal-bd-bottom">{{g.upgradeGoodsType===1?g.positionStr: g.upgradeGoodsTypeName}} <view class="meal-bd-bottom">{{g.upgradeGoodsType===1?g.positionStr: g.upgradeGoodsTypeName}}
<view class="count">x{{g.number}}</view> <view class="count">x{{g.number}}</view>
<view class="artificer" bindtap="selectArtificer" data-item="{{g}}"> <!-- <view class="artificer" bindtap="selectArtificer" data-item="{{g}}">
<text class="{{!g.technicianName ? 'grey_text' : ''}} 'text-hide'">{{g.technicianName || '选择技师'}}</text> <text class="{{!g.technicianName ? 'grey_text' : ''}} 'text-hide'">{{g.technicianName || '选择技师'}}</text>
<image src="/components/images/arrow-x.png" mode="" /> <image src="/components/images/arrow-x.png" mode="" />
</view> </view> -->
</view> </view>
</view> </view>
</view> </view>
...@@ -73,10 +73,10 @@ ...@@ -73,10 +73,10 @@
<view class="type">x{{item.number}}</view> <view class="type">x{{item.number}}</view>
</view> </view>
<!-- 太阳膜类且配置技师 不需要限制是太阳膜 && item.upgradeGoodsPosition--> <!-- 太阳膜类且配置技师 不需要限制是太阳膜 && item.upgradeGoodsPosition-->
<view wx:if="{{orderInfo.isOpenArtificer }}" class="artificer" bindtap="selectArtificer" data-item="{{item}}"> <!-- <view wx:if="{{orderInfo.isOpenArtificer }}" class="artificer" bindtap="selectArtificer" data-item="{{item}}">
<text class="{{!item.technicianName ? 'grey_text' : ''}} 'text-hide'">{{item.technicianName || '选择技师'}}</text> <text class="{{!item.technicianName ? 'grey_text' : ''}} 'text-hide'">{{item.technicianName || '选择技师'}}</text>
<image src="/components/images/arrow-x.png" mode="" /> <image src="/components/images/arrow-x.png" mode="" />
</view> </view> -->
</view> </view>
</view> </view>
</block> </block>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!