前端页面完成

master
kefei 6 years ago
parent b0a2671443
commit 82ec259a50

@ -36,4 +36,5 @@ Page({
duration: 2000 duration: 2000
}); });
}, },
}) })

@ -5,6 +5,7 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
'iscart':false,
'goodList': [ 'goodList': [
{ {
'cover': '/pages/index/image/suanfa.jpg', 'cover': '/pages/index/image/suanfa.jpg',
@ -178,6 +179,7 @@ Page({
this.calculateTotal(); this.calculateTotal();
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
@ -233,6 +235,18 @@ Page({
onShareAppMessage: function () { onShareAppMessage: function () {
}, },
newAddress: function () {
if (this.data.totalCount >0)
{wx.navigateTo({
url: '/pages/order/order'
})}
else
{
wx.showToast({
title: '没有选择商品',
icon: 'success',
duration: 2000
})
}
}
}) })

@ -61,9 +61,9 @@
<text>¥{{totalPrice}}</text> <text>¥{{totalPrice}}</text>
</view> </view>
</view> </view>
<navigator url='../checkout/index'>
<view class='btn {{totalCount > 0 ? "btn-primary" : "btn-default"}}'>去结算</view> <view class='btn {{totalCount > 0 ? "btn-primary" : "btn-default"}}' bindtap="newAddress">去结算</view>
</navigator>
</view> </view>

@ -11,7 +11,7 @@ Page({
'totalPrice': 0, 'totalPrice': 0,
'address':'湖南师范大学理学院', 'address':'湖南师范大学理学院',
'consignee': "杨盼成", 'consignee': "杨盼成",
'phone': '12345678912', 'phone': '123456789',
'unpaidList': [//待付款 'unpaidList': [//待付款
{ {
'cover': '../index/image/suanfa.jpg', 'cover': '../index/image/suanfa.jpg',

@ -15,6 +15,11 @@ Page({
url: '/pages/userInfo/userInfo' url: '/pages/userInfo/userInfo'
}) })
}, },
towode: function () {
wx.navigateTo({
url: "/pages/wode/wode"
})
},
bindDateChange: function (e) { bindDateChange: function (e) {
this.setData({ this.setData({
date: e.detail.value date: e.detail.value
@ -25,10 +30,5 @@ Page({
this.setData({ this.setData({
tapCurrent: current tapCurrent: current
}) })
}, }
newAddress: function () {
wx.navigateTo({
url: "/pages/wode/wode"
})
},
}) })

@ -3,14 +3,14 @@
<view class="address_item flexRowBetween"> <view class="address_item flexRowBetween">
<view class="address_left"> <view class="address_left">
<view class="text1"> <view class="text1">
李雷 杨盼成
</view> </view>
<view class="text1 text_other"> <view class="text1 text_other">
科技路高新大都荟 湖南师范大学
</view> </view>
</view> </view>
<view class="address_right"> <view class="address_right">
18888888888 123456789
</view> </view>
</view> </view>
<view class="address_set flexRowBetween"> <view class="address_set flexRowBetween">
@ -27,10 +27,7 @@
<text>删除</text> <text>删除</text>
</view> </view>
</view> </view>
<view class="submit_info" bindtap="towode">保存
<view class="submit_info" bindtap="newAddress">
保存
</view> </view>
</view> </view>

@ -40,23 +40,7 @@ Page({
}) })
}, },
onLoad: function() { onLoad: function() {
console.log('onLoad')
var that = this
//调用应用实例的方法获取全局数据
app.getUserInfo(function(userInfo) {
//更新数据
that.setData({
userInfo: userInfo
})
})
},
getUserInfo: function(e) {
console.log(e)
app.globalData.userInfo = e.detail.userInfo
this.setData({
userInfo: e.detail.userInfo,
hasUserInfo: true
})
}, },
address: function() { address: function() {
wx.navigateTo({ wx.navigateTo({

@ -13,8 +13,8 @@
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.4.4", "libVersion": "2.4.4",
"appid": "wxd037e598f9fc428d", "appid": "wx18f06ad86d422b11",
"projectname": "%E5%B0%8F%E7%A8%8B%E5%BA%8F%E5%BC%80%E5%8F%91%E6%B5%8B%E8%AF%95111", "projectname": "%E5%B0%8F%E7%A8%8B%E5%BA%8F",
"debugOptions": { "debugOptions": {
"hidedInDevtools": [] "hidedInDevtools": []
}, },

Loading…
Cancel
Save