add my assets show

wechat_user_type
houdelin 8 years ago
parent 64a4fe7a2d
commit 3db533a39b
  1. 5
      pages/my_assets/show.js
  2. 25
      pages/my_assets/show.wxml

@ -2,6 +2,7 @@ const my_assets = require('../../utils/my_assets.js')
Page({
data: {
my_asset: '',
},
onLoad: function(params) {
@ -9,9 +10,9 @@ Page({
my_assets.getAsset(params.sku, function(result) {
var data = getApp().store.sync(result.data)
that.setData({'my_assets': data})
that.setData({'my_asset': data})
wx.setStorage({
key: "my_assets",
key: "my_asset",
data: data
})
})

@ -1,12 +1,19 @@
<view>
<view>show</view>
</view>
<text>{{my_asset.product.name}}</text>
<text>资产编号{{my_asset.no}}</text>
<text>{{my_asset.product.unit}}</text>
<block wx:for="{{my_asset['sub-products']}}" wx:for-item="sub_product">
<view class="item">
<text>{{sub_product.name}} {{sub_product.stock}}</text>
</view>
</block>
<view class="my_assets">
<block wx:for-items="{{my_assets}}">
<view class="nav-item">
<text>{{item.name}}</text>
</view>
</block>
</view>
<block wx:for="{{my_asset['inventory-changes']}}" wx:for-item="inventory_change">
<view class="item">
<text>原因{{inventory_change.reason}}</text>
<text>数量{{inventory_change.quantity + ci.unit}}</text>
</view>
</block>
</view>

Loading…
Cancel
Save