Commit 1994b063 authored by tanmoruo's avatar tanmoruo

已完成

parent 52d3ba73
Pipeline #273 failed with stages
{ {
"pages":[ "pages":[
"pages/index/index", "pages/index/index"
"pages/logs/logs"
], ],
"window":{ "window":{
"backgroundTextStyle":"light", "backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff", "navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "Weixin", "navigationBarTitleText": "摇骰子",
"navigationBarTextStyle":"black" "navigationBarTextStyle":"black"
}, },
"style": "v2", "style": "v2",
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -4,6 +4,39 @@ const app = getApp() ...@@ -4,6 +4,39 @@ const app = getApp()
Page({ Page({
data: { data: {
countimgSrc: "../../images/img/运行 拷贝 2.png"
}, },
// 触摸开始
tapDiceStart() {
let count = 0;
const that = this;
this.timing = setInterval(function() {
count += 1;
if (count >= 1 && count < 2) {
that.setData({
countimgSrc: "../../images/img/运行 拷贝.png"
})
} else if (count >= 2 && count <= 4) {
that.setData({
countimgSrc: "../../images/img/运行.png"
})
} else if (count >= 5 && count <= 6) {
that.setData({
countimgSrc: "../../images/img/运行 拷贝 3.png"
})
} else if (count >= 7 && count <= 9) {
that.setData({
countimgSrc: "../../images/img/运行 拷贝 4.png"
})
} else {
count = count - 10;
}
}, 1000)
},
// 触摸结束
tapSiceEnd() {
clearInterval(this.timing);
}
}) })
<view>nihao</view> <view class="diceChangeColor">
\ No newline at end of file <view class="content">
<image src="{{countimgSrc}}" class="countimg"></image>
<image src="../../images/img/<编组>.png" class="dice" bind:touchstart="tapDiceStart" bind:touchend="tapSiceEnd"></image>
</view>
</view>
\ No newline at end of file
/**index.wxss**/ .diceChangeColor {
.userinfo {
display: flex; display: flex;
flex-direction: column; justify-content: center;
align-items: center; align-items: center;
color: #aaa;
height: 100vh;
}
.diceChangeColor .content {
position: relative;
} }
.userinfo-avatar { .countimg {
overflow: hidden; width: 400rpx;
width: 128rpx; height: 400rpx;
height: 128rpx;
margin: 20rpx;
border-radius: 50%;
} }
.usermotto { .dice {
margin-top: 200px; position: absolute;
left: 130rpx;
top: 120rpx;
width: 160rpx;
height: 160rpx;
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment