天天看點

微信小程式七夕節禮物

VSCode

Node.js

HbuilderX

安裝前端開發環境

微信小程式七夕節禮物

image.png

npm install -g cnpm
--registry=https://registry.npm.taobao.org           

複制

cnpm install -g less           

複制

微信小程式七夕節禮物

image.png

HBuilderX是國内最優秀的前端開發工具,我們用它來開發Electron項目和小程式項目

微信小程式七夕節禮物

image.png

微信小程式七夕節禮物

image.png

微信小程式七夕節禮物

image.png

微信小程式七夕節禮物

image.png

微信小程式七夕節禮物

image.png

微信小程式七夕節禮物

image.png

微信小程式七夕節禮物

image.png

{
  "pages": [
    "pages/index/index"
  ],
  "requiredBackgroundModes": [
    "audio",
    "location"
  ],
  "subPackages": [],
  "window": {
    "navigationBarTextStyle": "black",
    "navigationBarTitleText": "我喜歡你",
    "navigationBarBackgroundColor": "#F8F8F8",
    "backgroundColor": "#F8F8F8"
  },
  "usingComponents": {}
}           

複制

@import './common/main.wxss';           

複制

require('./common/runtime.js')
require('./common/vendor.js')
require('./common/main.js')           

複制

.content {
  padding: 0 40rpx;
}
.content image {
  width: 100%;
}
.content .title {
  display: block;
  text-align: center;
  font-size: 50rpx;
  font-weight: bold;
}
.content .operate {
  text-align: center;
  margin-top: 30rpx;
  margin-bottom: 30rpx;
}
.content .operate .btn {
  width: 200rpx;
  height: 80rpx;
  display: inline-block;
}
.content .operate .btn:first-of-type {
  margin-right: 40rpx;
}
.content .message {
  font-size: 34rpx;
  margin: 15rpx 0;
  color: #333;
}           

複制

<view class="content"><image src="../../static/g1.gif" mode="widthFix"></image><text class="title">小姐姐,做我女朋友吧!</text><view class="operate"><button class="btn" type="primary" data-event-opts="{{[['tap',[['agree',['$event']]]]]}}" bindtap="__e">好呀</button><button class="btn" type="warn" data-event-opts="{{[['tap',[['disagree',['$event']]]]]}}" bindtap="__e">不好</button></view><block wx:for="{{love}}" wx:for-item="one" wx:for-index="__i0__" wx:key="*this"><view class="message">{{one}}</view></block></view>           

複制

若本号内容有做得不到位的地方(比如:涉及版權或其他問題),請及時聯系我們進行整改即可,會在第一時間進行處理。