第四章作业

五环

运行代码

wxml代码

<canvas canvas-id="wu"></canvas>

js代码

Page({
  onLoad: function (options) {
    const ctx = wx.createCanvasContext('wu');
 
    const colors = ["blue", "black", "red", "yellow","green" ];
 
    ctx.beginPath();
    ctx.arc(50, 50, 40, 0, 2 * Math.PI);
    ctx.setStrokeStyle(colors[0]);
    ctx.stroke();
 
    ctx.beginPath();
    ctx.arc(110, 50, 40, 0, 2 * Math.PI);
    ctx.setStrokeStyle(colors[1]);
    ctx.stroke();
 
    ctx.beginPath();
    ctx.arc(170, 50, 40, 0, 2 * Math.PI);
    ctx.setStrokeStyle(colors[2]);
    ctx.stroke();
 
    ctx.beginPath();
    ctx.arc(80, 90, 40, 0, 2 * Math.PI);
    ctx.setStrokeStyle(colors[3]);
    ctx.stroke();
 
    ctx.beginPath();
    ctx.arc(140, 90, 40, 0, 2 * Math.PI);
    ctx.setStrokeStyle(colors[4]);
    ctx.stroke();
 
    ctx.draw();
  }
})

wxss代码

canvas{
  margin-left: 200rpx;
  margin-top: 200rpx;
}

运行结果

 书单

运行代码

wxml代码

<view class="head">← 书单</view>
<view class="p1">
  <view class="p2">培养商业意识,走出生活,职场和事业的困境</view>
  <view class="p3">创新者是如何思考问题的?本书单包括了互联网,思维方式,商业,文案,市场,营销等方方面面,是在思维方式上的创新,略去传统商学院的教条</view>
</view>
<view class="shu">
  <view class="imgone" style="display: flex;">
   <image class="img1" src="../san/img/金字塔原理.jpg"/>
    <view class="textone">
      <view class="text1">金字塔原理</view>
      <view class="text2">芭芭拉•明托(Barbara Minto)</view>
      <view class="text3">金字塔原理是一种重点突出、逻辑清晰、主次分明的逻辑思路、表达方式和规范动作……</view>
    </view>
  </view>
  <view class="xian"></view>
  <view class="imgtwo" style="display: flex;">
    <image class="img2" src="../san/img/基业长青.jpg"/>
    <view class="texttwo">
      <view class="text1">基业长青</view>
      <view class="text2">[美]吉姆•柯林斯,杰里•波勒斯</view>
      <view class="text3">《基业长青(珍藏版)》打破了旧有神话,提供了新颖的见解,并为那些有志于建立经得……</view>
    </view>
  </view>
</view>

wxss代码

.head{
  font-size: 60rpx;
  margin-top: 200rpx;
}
.p1{
  background-color: black;
}
.p2{
  color: aliceblue;
  text-align: center;
  font-size: 45rpx;
  padding: 30rpx;
}
.p3{
  color: aliceblue;
  padding: 20rpx;
}

.shu{
  margin: 50rpx;
}
.textone{
  margin-left: 50rpx;
}
.img1{
  width: 700rpx;
  height: 350rpx;
}
.img2{
  width: 700rpx;
  height: 350rpx;
}
.text1{
  font-size: 70rpx;
  font-weight: 700;
}
.text2{
  font-size: 40rpx;
  font-weight: 600;
}
.xian{
  margin-top: 50rpx;
  border-bottom: 4px solid #ccc;
}

.imgtwo{
  margin-top: 50rpx;
}
.texttwo{
  margin-left: 50rpx;
}

运行结果

 拼车

运行代码

wxml代码

<view>西安找拼车</view>
<view class="one">联系方式(手机和微信至少填一项)</view>
<view style="border-bottom: 1px solid #ccc;"></view>
<view class="two">
<view class="two2">称呼*</view>
<input type="text" placeholder="请输入称呼" style="margin-top: 12px;margin-left: 75px;"/>
</view>
<view class="two">
<view class="two2">手机号</view>
<input type="password" placeholder="请输入手机号" style="margin-top: 12px;margin-left: 65px;"/>
</view>
<view style="display: flex; line-height: 50px;border-bottom: 1px solid #ccc;">
<view class="two2">微信号</view>
<input type="text" placeholder="请输入微信号" style="margin-top: 12px;margin-left: 65px;"/>
</view>
<view style="border-bottom: 1px solid #ccc;"></view>
<view class="pc">拼车信息</view>
<view class="two">
<view class="two2">出发地点*</view>
<input type="text" placeholder="限7个字" style="margin-top: 12px;margin-left: 40px;"/>
</view>
<view class="two">
<view class="n1">目的地*</view>
<input type="text" placeholder="限7个字" style="margin-top: 12px;margin-left: 55px;"/>
</view>
<view style="display: flex; line-height: 50px;">
<view style="font-size: 18px;  font-weight: bold;margin-left:20px ;">空座数*</view>
<input type="text" placeholder="请输入空座数" style="margin-top: 12px;margin-left: 50px;"/>
</view>
<view style="border-bottom: 1px solid #ccc;"></view>

wxss代码

.one{
  background-color: #F5F5F5;
  line-height: 50px;
  color: #B1AFB0;
  border-bottom: 1px solid #ccc;
  padding-left: 20px;
}
.two{
display: flex;
line-height: 50px;
}
.pc{
background-color: #F5F5F5;
line-height: 50px;
color: #B1AFB0;
border-bottom: 1px solid #ccc;
padding-left: 20px;
}
.two2{
font-size: 17px; 
font-weight: bold;
margin-left:20px 
}

运行结果

 人生进程

运行代码

app.json代码

{
  "pages": [
    "pages/san/san",
    "pages/yy/yy",
    "pages/ww/ww",
    "pages/qq/qq"
  ],
  "window": {
    "backgroundColor": "#F6F6F6",
    "backgroundTextStyle": "light",
    "navigationBarBackgroundColor": "#F6F6F6",
    "navigationBarTitleText": "www",
    "navigationBarTextStyle": "black"
  },
  "tabBar": {
    "color": "#666666",
    "selectedColor": "#ff0000",
    "borderStyle":"black",
    "backgroundColor": "#ffffff",
    "list": [{
      "pagePath": "pages/san/san",
      "iconPath": "./image/Ai.png",
      "selectedIconPath": "./image/Ai.png",
      "text": "首页"
    },
    {
      "pagePath": "pages/yy/yy",
      "iconPath": "./image/Ai.png",
      "selectedIconPath": "./image/Ai.png",
      "text": "年月日"
    },
    {
      "pagePath": "pages/ww/ww",
      "iconPath": "./image/Ai.png",
      "selectedIconPath": "./image/Ai.png",
      "text": "静思"
    },
    {
      "pagePath": "pages/qq/qq",
      "iconPath": "./image/Ai.png",
      "selectedIconPath": "./image/Ai.png",
      "text": "关于"
    }]
  },
  "style": "v2",
  "componentFramework": "glass-easel",
  "lazyCodeLoading": "requiredComponents"
}

wxml代码

<view style="text-align: center;font-size: 16x;position: absolute;left: 120px;">中国阶段人均寿命900个月</view>
<view style="position: absolute;padding-top: 30px;font-size: 26px;left: 70px;">2005年8月至今155个月</view>
<view  style=" border:1px solid black;width: 100px;position: absolute;height: 20px;top: 92px;left: 85px;"></view>
<view style="position: absolute;padding-top: 90px;font-size: 16px;padding-left: 188px;"></view><view style="border: 5px;color: black;position: absolute;left: 240px;top: 92px;">换一个日期</view>
<view  style=" border:1px solid black;width: 100px;position: absolute;height: 20px;top: 92px;left: 230px;"></view>
<view style="position: absolute;padding-top: 90px;font-size: 16px;padding-left: 490px;"><view style="position: absolute;left: 100px;top: 92px;">清除记录</view></view>
<view><image src="./img/dc.jpg" mode="" style="position: absolute;top:140px;left: 85px;height: 370px;width: 250px;"/></view>
<view style="position: absolute;top:540px;font-size: 18px;left:10px;">能把后面前行行走的机会抓住的人,十有八九都会成功</view>

wxss代码

 
 .tou{
  float: left;
  margin-top: 8px;
  width: 450px; 
  height: 220px;
}
.tu1{
  margin: 0 auto;
  float: left;
  display: block;
  width: 180px; 
  height: 160px;
}
.yi{
  margin-top: 10px;
}
.ig1{
  margin-top: 5px;
}
.ig2 {
  position: absolute; 
 
}
.ig2 image{
  position: relative;
  top: 274px;
  left: 2px;
}
 
.ig3{
  margin-top: 5px;
  position: absolute;
}
.ig3 image{
  position: relative;
  top: 390px;
}
.yi{
  margin-top: 5px;
  float: right;
}
.er{
  margin-top: 5px;
  float: right;
}
.tu2{
  margin: 0 auto;
  float: left;
  display: block;
  width: 180px; 
  height: 160px;
  margin-top: 60px;
}
.zi1{
  margin: 0 auto;
  display: block;
  font-size: 30px;
  float: none;
  display: block;
  margin-left: 200px;
  margin-top: 10px; 
}
.zi2{
  display: block;
  font-size: 15px;
 float: none;
  display: block;
  margin-left: 200px;
  margin-top: 10px;
}
.zi3{
  display: block;
  font-size: 10px;
  float: right;
  display: block;
  margin-left: 200px;
  margin-top: 10px;
}

运行结果

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值