Skip to content

Commit

Permalink
finish
Browse files Browse the repository at this point in the history
  • Loading branch information
BubbleSci committed Jun 26, 2020
1 parent f8cea31 commit 9855073
Show file tree
Hide file tree
Showing 11 changed files with 91 additions and 59 deletions.
22 changes: 18 additions & 4 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
//app.js
App({
onLaunch: function () {

}
})

})
// onLaunch: function(options) {
// },

// onShow: function(options) {
// },

// onHide: function() {
// },

// onError: function(msg) {
// },

// //options(path,query,isEntryPage))
// onPageNotFound: function(options) {
// }

7 changes: 7 additions & 0 deletions app.wxss
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,10 @@
padding: 200rpx 0;
box-sizing: border-box;
}
page {
--themeColor: #eb4450;
font-size: 28rpx;
}
image {
width: 100%;
}
Binary file added pages/index/images/apple.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
50 changes: 39 additions & 11 deletions pages/index/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,43 @@
//index.js
//获取应用实例
//const app = getApp()
const app = getApp()
var aprise, bprise, dprise

Page({
getNum:function(){//这里的获取值和html不一样
// let appleNum = document.getElementById("aNum").value;
// let bananaNum = document.getElementById("bNum").value;
// let dragonNum = document.getElementById("dNum").value;
// let aprise = aNum*1;
// let bprise = bNum*5;
// let dprise = dNum*10;
// let total = aprise+bprise+dprise;
// console.log( total),
data:{
focous:false,
inputValue:''
},
bindKeyInput: function (e) {
this.setData({
inputValue: e.detail.value,
})
console.log(e)
switch(e.currentTarget.dataset.type){
case "1":
aprise = e.detail.value*2
console.log(aprise)
break
case "2":
bprise = e.detail.value*5
console.log(bprise)
break
case "3":
dprise = e.detail.value*10
console.log(dprise)
break
}
},
tapLogin:function(){
wx.navigateTo({
url: '/pages/logs/logs',

})
}
})
}
// getNum:function(){
// var total = aprise +bprise +dprise ;
// console.log (total);
// }
// }
)
46 changes: 16 additions & 30 deletions pages/index/index.wxml
Original file line number Diff line number Diff line change
@@ -1,34 +1,20 @@
<!--index.wxml-->
<view class="container">
<view class="btn">
<image src='pages/images/苹果图1.jpg'></image>
<!--<select id="aNum">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>-->
<!--<view class="container">-->
<view class='btn'>
<image src='images/apple.jpg' mode='widthFix'></image>
<text>选择您所需要的数量:</text>
<input type="number" bindinput="bindKeyInput" data-type="1"></input>
</view>
<view class="nav">
<image src='pages/images/香蕉图1.jpg'></image>
<select id="bNum">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>

<view class="btn">
<image src='images/banana.jpg' mode='widthFix'></image>
<text>选择您所需要的数量:</text>
<input type="number" bindinput="bindKeyInput" data-type="2"></input>
</view>
<view class="nav">
<image src='pages/images/火龙果图1.jpg'></image>
<select id="dNum">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>

<view class="btn">
<image src='images/dragon.jpg' mode ='widthFix'></image>
<text>选择您所需要的数量:</text>
<input type="number" bindinput="bindKeyInput" data-type="3"></input>
</view>
</view>
<button bindtap="getNum">确定</button>
<button bindtap="tapLogin">确定</button>
4 changes: 2 additions & 2 deletions pages/index/index.wxss
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ nav{
margin: 20rpx;
border-radius: 50%;
}
btn{
.btn{
width: 60%;
background: local;
}
btn image{
.btn image{
width: 100;
}
12 changes: 5 additions & 7 deletions pages/logs/logs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@

Page({
data: {
logs: [{
name:'苹果',age:'aprise',
name:'香蕉',age:'bprise',
name:'火龙果',age:'dprise',
name:'西瓜',age:'xprise',
}
]
list: [
{name:'苹果',age:'aprise'},
{name:'香蕉',age:'bprise'},
{name:'火龙果',age:'dprise'}
]
},
// onLoad: function () {
// this.setData({
Expand Down
9 changes: 4 additions & 5 deletions pages/logs/logs.wxml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<!--logs.wxml-->
<view wx:for="{{logs}}" >
<block wx:for-item="log">
<text>{{item.name}}</text>
<text>{{item.age}}</text>
</block>
<text>您的订单</text>
<view wx:for="{{list}}" >
<text>{{ item.name }}</text>
<text>{{ item.age }}</text>
</view>

0 comments on commit 9855073

Please sign in to comment.