add my assets

wechat_user_type
houdelin 8 years ago
parent 7ea3acc97e
commit cd1194c577
  1. 3
      app.json
  2. 6
      pages/mine/mine.js
  3. 2
      pages/mine/mine.wxml
  4. 52
      pages/my_assets/index.js
  5. 3
      pages/my_assets/index.wxml
  6. 0
      pages/my_assets/index.wxss

@ -5,7 +5,8 @@
"pages/address/address",
"pages/cart/cart",
"pages/mine/mine",
"pages/category/category"
"pages/category/category",
"pages/my_assets/index"
],
"window":{
"backgroundColor": "#f2f2f2",

@ -19,6 +19,12 @@ Page({
onShow: function() {
},
bindShowAsset: function (e) {
wx.navigateTo({
url: `../my_assets/index?id=${e.currentTarget.dataset.id}`
})
},
onLoad: function() {
var that = this
var token = wx.getStorageSync('userToken')

@ -39,7 +39,7 @@
<scroll-view scroll-x="true">
<view class="long-view">
<block wx:for="{{zichan_slides}}" wx:for-item="slide" wx:key="id">
<view class="item">
<view class="item" bindtap="bindShowAsset" data-id="{{slide.id}}">
<view class="image">
<image class="slide-img" src="{{slide.image}}"/>
</view>

@ -0,0 +1,52 @@
const product = require('../../utils/product.js')
Page({
data: {
items: [],
slides: [],
navs: [{icon: "../../images/asset.png", name: "资产"},
{icon: "../../images/direct_sale.png", name: "直销"},
{icon: "../../images/our_select.png", name: "甄选"},
{icon: "../../images/packing.png", name: "包装"}],
popularity_products: [],
new_products: [],
hot_products: [],
promotions: []
},
bindShowProduct: function (e) {
wx.navigateTo({
url: `../show_product/show_product?id=${e.currentTarget.dataset.id}`
})
},
catchTapCategory: function (e) {
wx.navigateTo({
url: `../category/category?type=${e.currentTarget.dataset.type}`
})
},
onLoad: function() {
var that = this
product.getSlides(function(result) {
var data = getApp().store.sync(result.data)
that.setData({'slides': data})
wx.setStorage({
key:"indexSlides",
data:data
})
})
product.getProducts(function(result) {
var data = getApp().store.sync(result.data)
that.setData({
items: data,
popularity_products: data.filter(product => product.flag === '最热'),
new_products: data.filter(product => product.flag === '新品'),
hot_products: data.filter(product => product.flag === '火爆'),
})
wx.setStorageSync('products', data)
})
}
})

@ -0,0 +1,3 @@
<view>
<view>my_assets</view>
</view>
Loading…
Cancel
Save