You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hunjianghu/江可飞/小程序开发/pages/wode/wode.js

66 lines
1.4 KiB

6 years ago
// pages/wode/wode.js
var app = getApp()
Page({
data: {
userInfo: {},
motto: 'Hello World',
// orderItems
6 years ago
orderItems: [{
6 years ago
typeId: 0,
name: '待付款',
url: 'bill',
imageurl: '/pages/index/image/fukuan.png',
},
{
typeId: 1,
6 years ago
name: '待收货',
6 years ago
url: 'bill',
6 years ago
imageurl: '/pages/index/image/shouhuo.png'
6 years ago
},
{
typeId: 2,
6 years ago
name: '待发货',
6 years ago
url: 'bill',
6 years ago
imageurl: '/pages/index/image/fahuo.png',
6 years ago
},
{
typeId: 3,
name: '待评价',
url: 'bill',
imageurl: '/pages/index/image/pingjia.png'
}
],
},
//事件处理函数
6 years ago
toOrder: function(event) {
var typeId = event.currentTarget.dataset.typeid
// console.log(typeId);
6 years ago
wx.navigateTo({
6 years ago
url: '../order/order?typeId=' + typeId
6 years ago
})
},
6 years ago
onLoad: function() {
6 years ago
console.log('onLoad')
var that = this
//调用应用实例的方法获取全局数据
6 years ago
app.getUserInfo(function(userInfo) {
6 years ago
//更新数据
that.setData({
userInfo: userInfo
})
})
6 years ago
},
6 years ago
getUserInfo: function(e) {
6 years ago
console.log(e)
app.globalData.userInfo = e.detail.userInfo
this.setData({
userInfo: e.detail.userInfo,
hasUserInfo: true
})
},
6 years ago
address: function() {
6 years ago
wx.navigateTo({
url: "/pages/shdz/shdz"
})
},
6 years ago
})