真机报错
Error:Expect START descriptor with depth 2 but get another /wxf.../0/page_frame.html:15:6835
由下面的方法触发的
setModalStatus(e) { this .timers && clearTimeout( this .timers); const animation = wx.createAnimation({ duration: 200, timingFunction: 'linear' , delay: 0, }); this .animation = animation; const window_height = getIn(getApp(), [ 'globalData' , 'window_height' ]); animation.translateY(window_height).step(); const _height = 0; this .setData({ animationData: animation.export() }); if (e.currentTarget.dataset.status == 1) { //获取弹出数据 let idx = e.currentTarget.dataset.index; if (getIn( this .data.orderObject,[ 'coupon' ,idx])){ const coupon = { selected: this .data.coupon.selected, list: this .data.orderObject.coupon[idx].coupon_list, muid_mtype: idx } this .setData({ coupon, showModalStatus: true }); } else { return false ; } } this .times = setTimeout(() => { animation.translateY(_height).step(); this .setData({ animationData: animation.export(), }); if (e.currentTarget.dataset.status == 0) { //刷新每个店铺的结算价格 let total_member_total = 0.00; Object.values( this .data.orderObject.data).map((o)=>{ total_member_total += parseFloat(o.member_total, 2); }); this .setData( { 'orderObject.total_member_total' : total_member_total, showModalStatus: false } ); this .getTotalPrice( this .data.countMoney, this .freight); } }, 200); }, // 提交订单 submitOrder() { const token = getIn( this .data, [ 'auth' , 'token' ]); // const token = "8e401730f575dc80f4b612fc8f85f7d8"; const address_id = getIn( this .data, [ 'addressObject' , 'id' ]); const _this = this ; if (!address_id) { showFail( '请选择收货地址' ); } if (! this .data.isAreaAddress) { showFail( '收货地址不在产品销售区域' ); } wx.showLoading(); const order_client = 5; const exchange_score = this .data.scoreValue; const cart = getIn( this .data, [ 'orderObject' , 'cart_product' ]); const remark = []; // 留言 //处理选择的优惠券---begin const selected = this .data.coupon.selected; const selected_arr = []; Object.keys(selected).map((x) => { selected_arr.push(selected[x]+ '-' +x); }) const coupon = selected_arr.join( ',' ); //---over const params = { token, address_id, order_client, exchange_score, cart, remark, coupon, shipping_type: 1 }; this .createOrder(params, (status, result) => { if (status == SUCCESS) { const order_id = result.data.order_ids.join && result.data.order_ids.join( ',' ); const pay_way = 2; const trade_type = 'JSAPI' ; const domain = getIn(config, [ 'domain' ]); const openid = getIn( this .data.auth, [ 'user' , 'openid' ]); const payParams = { token, order_id, pay_way, trade_type, domain, openid, }; const queryString = `id=${order_id}`; // 刷新购物车 notify && notify( 'updateShippingCart' ); this .fetchPayOrder(token, payParams, (status, result) => { if (status == SUCCESS) { wx.requestPayment({ timeStamp: getIn(result, [ 'data' , 'times' ]), nonceStr: getIn(result, [ 'data' , 'nonce_str' ]), package: getIn(result, [ 'data' , 'prepay_id' ]), signType: 'MD5' , paySign: getIn(result, [ 'data' , 'sign' ]), success(res) { _this.onRedirectToOrder(ORDER_DETAIL_PATH, queryString); }, fail(res) { _this.onRedirectToOrder(ORDER_DETAIL_PATH, queryString); }, complete(res) { wx.hideLoading(); }, }); } else if (status == FAIL) { wx.hideLoading(); _this.onRedirectToOrder(ORDER_DETAIL_PATH, queryString); } }); } else if (status == FAIL) { wx.hideLoading(); showFail( '提交订单失败' ); } }); }, onRedirectToOrder(pathname, queryString) { global.navigateHelper && global.navigateHelper.redirectTo && global.navigateHelper.redirectTo({ pathname, queryString }); }, }; |
由下面wxml 的优惠方式触发
< view class = "container" > < view style = "flex:1;margin-bottom: 50px" > < import src = "./cell/OrderAddressCell.wxml" /> < template is = "OrderAddressCell" data = "{{window_width, ...addressObject}}" /> < view wx:for = "{{orderObject.data}}" wx:for-index = "idx" wx:key = "{{idx}}" wx:for-item = "item" > < view wx:for = "{{item.list}}" wx:for-index = "indexs" wx:key = "{{indexs}}" wx:for-item = "activityItem" > < block wx:if = "{{activityItem.activity_id}}" > < import src = './cell/FullReductionCell.wxml' /> < template is = "FullReductionCell" data = "{{fullReductionItem: activityItem, window_width}}" /> </ block > < block wx:else> < view class = "blackStyle" /> < block wx:for = "{{activityItem.list}}" wx:for-index = "_index" wx:key = "{{_index}}" wx:for-item = "_productItem" > < import src = './cell/OrderProductCell' /> < template is = "OrderProductCell" data = "{{..._productItem, window_width}}" /> </ block > </ block > </ view > < view wx:if="{{orderObject.coupon[item.muid_mtype].coupon_list.length > 0}}" class="couponContent" bindtap="setModalStatus" data-status="1" data-index="{{idx}}"> < text class = "couponText" >优惠方式</ text > < view class = "endContent" > < view wx:if="{{item.reduce_amount > 0}}"> 满{{item.reach_amount}}元 < text wx:if = "{{item.type!=2}}" >减{{item.face_value}}元</ text > < text wx:else>打{{item.discount}}折</ text > 省:{{item.reduce_amount}}元 </ view > < view wx:else>不使用优惠券</ view > < span class = "arrow_icon arrowIcon" /> </ view > </ view > < view class = "couponContent" > < text class = "couponText" >配送方式</ text > < view class = "endContent" > < text class = "couponText" >快递</ text > </ view > </ view > < view class = "couponContent" > < text class = "couponText" >买家留言:</ text > < input placeholder = "选填,对本次交易的" placeholder-style = "color: #cccccc; font-size: 14px;" 车 = "saveRemark" data-member_id = "{{item.member_id}}" data-type_id = "{{item.type_id}}" /> </ view > < block wx:if="{{orderObject.data.length > 1}}"> < import src = "../../shippingcart/cell/ShopFootCell" /> < template is = "ShopFootCell" data = "{{num: item.member_num, total: item.member_total}}" /> </ block > < view class = "blackStyle" /> </ view > < block wx:if = "{{isOpenScore}}" > < import src = "./cell/OrderScoreCell.wxml" /> < template is = "OrderScoreCell" data = "{{isScoreCheck, credit_scale: orderObject.credit_scale, scoreValue, consume_credit: orderObject.consume_credit, countMoney}}" /> </ block > < view class = "blackStyle" /> </ view > < import src = "./cell/SubmitFootCell.wxml" /> < template is = "SubmitFootCell" data = "{{isScoreCheck, total_num: orderObject.total_num, total_member_total: totalPrice, countMoney, freight}}" /> </ view > < import src = "../../coupon/template/couponSelect.wxml" /> < template is = "couponSelect" data = "{{showModalStatus, animationData,couponList:coupon.list,muid_mtype:coupon.muid_mtype}}" /> |
百度资料甚少,官方帮忙下~真机都会报,模拟器都没问题。
这个问题还不是统一不支持,我这边只有IOS 10.2.1(14D27) 不支持Object.values()
@小谢 解决了吗,如何解决的呢
碰到同样的问题,暂时没有找到原因。git上面有个说原因是使用wx-前缀的自定义组件,我的也不是这种情况。目前的解决方法是组件将原来的依赖的多个变量转变成依赖一个。代码如下。有什么好的其他方法可以一起交流~ // 之前
楼主解决没,我也碰到了
手机调试 就是报这个错。。。
手机上,打开调试,看下日志。