Commit 186c3552 by 张立顺

fix bug

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