Commit 1994b063 authored by tanmoruo's avatar tanmoruo

已完成

parent 52d3ba73
Pipeline #273 failed with stages
{
"pages":[
"pages/index/index",
"pages/logs/logs"
"pages/index/index"
],
"window":{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "Weixin",
"navigationBarTitleText": "摇骰子",
"navigationBarTextStyle":"black"
},
"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()
Page({
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>
\ No newline at end of file
<view class="diceChangeColor">
<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**/
.userinfo {
.diceChangeColor {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: #aaa;
height: 100vh;
}
.diceChangeColor .content {
position: relative;
}
.userinfo-avatar {
overflow: hidden;
width: 128rpx;
height: 128rpx;
margin: 20rpx;
border-radius: 50%;
.countimg {
width: 400rpx;
height: 400rpx;
}
.usermotto {
margin-top: 200px;
.dice {
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