大数据综合课程设计(二)

在微信开发者工具中,创建一个新的小程序,路径C:\Users\32356\Desktop\code\wechat_study,在创建文件的目录下,删去除project.config.json和tsconfig.json文件外所有文件,在调试器中新建pages文件夹下创建index文件夹直接回车自动生成四个文件,选择app.json进行编译。

原来

{

  "pages": [

    "pages/index/index"

  ]

}

编译为

{

  "pages": [

    "pages/index/index"

  ],

  "window": {

    "backgroundTextStyle": "light",

    "navigationBarBackgroundColor": "#f0f",

    "navigationBarTitleText": "随川",

    "navigationBarTextStyle": "white"

  },

  "style": "v2",

  "sitemapLocation": "sitemap.json"

}

之后进入创建的index文件夹中的index.wxml 同时在小程序路径的新建文件夹static下放入照片

编译输入

<view class="indexContainer">

  <image class="avatarUrl" src="/stuck/images/f.png"></image>

  <text class="userName">刘佳琳</text>

  <view class="goStudy">

   <text>hello world</text>

  </view>

</view>

之后在index.wxss中编译

各元素格式,大小,颜色,居中,边框... 大小用rpx相对大小,不使用px。

编译内容为

/* pages/index/index.wxss */

page{

  height: 100%;

}

.indexContainer{

  display: flex;

  flex-direction: column;

  align-items: center;

  background: #f0f;

  height: 100%;

}

.avatarUrl{

  width: 100px;

  height: 100px;

  border-radius: 50%;

  margin: 100rpx 0;

}

.userName{

  font-size: 32rpx;

  margin: 100rpx 0;

    

}

.goStudy{

  width: 300rpx;

  height: 80rpx;

  line-height:80rpx ;

  text-align: center;

  font-size: 28rpx;

  border: 1rpx solid #333;

  border-radius: 10rpx;

}

最后Ctrl+s运行小程序

实现index页静态搭建

结果如下

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值