Search

PythonReactSEOPDF
OpenClaw

mini-program-dev

微信小程序开发辅助。提供代码模板、API 示例、常见问题解答。

chandler07140 source installs☆ 0 Repository stars

Installation

Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.

SkillHub CLI

skillhub install chandler0714/mini-program-dev

Inspect the source and compatibility requirements, then follow its installation steps.

Give your agent the source link and ask it to inspect instructions and dependencies before explaining the installation steps.

View source ↗Guides

Skill instructions

微信小程序开发辅助

常用代码模板

页面结构
// pages/demo/demo.js
Page({
  data: {
    message: 'Hello',
    list: [],
    loading: false
  },

  onLoad(options) {
    // 页面加载
    this.fetchData();
  },

  onShow() {
    // 页面显示
  },

  onPullDownRefresh() {
    // 下拉刷新
    this.fetchData().then(() => {
      wx.stopPullDownRefresh();
    });
  },

  fetchData() {
    this.setData({ loading: true });
    return new Promise((resolve, reject) => {
      wx.request({
        url: 'https://api.example.com/data',
        success: res => {
          this.setData({ 
            list: res.data,
            loading: false 
          });
          resolve(res);
        },
        fail: reject
      });
    });
  },

  handleTap(e) {
    console.log('tap', e.currentTarget.dataset);
  }
})
<!-- pages/demo/demo.wxml -->
<view class="container">
  <text class="title">{{message}}</text>
  
  <block wx:for="{{list}}" wx:key="id">
    <view class="item" bindtap="handleTap" data-id="{{item.id}}">
      {{item.name}}
    </view>
  </block>

  <loading wx:if="{{loading}}">加载中...</loading>
</view>
/* pages/demo/demo.wxss */
.container {
  padding: 20rpx;
}

.title {
  font-size: 32rpx;
  font-weight: bold;
  display: block;
  margin-bottom: 20rpx;
}

.item {
  padding: 20rpx;
  border-bottom: 1rpx solid #eee;
}
常用 API
// 提示框
wx.showToast({ title: '成功', icon: 'success' });
wx.showModal({ title: '提示', content: '确认?' });

// 跳转页面
wx.navigateTo({ url: '/pages/detail/detail?id=1' });
wx.redirectTo({ url: '/pages/detail/detail' });
wx.switchTab({ url: '/pages/index/index' });

// 存储
wx.setStorageSync('key', 'value');
const value = wx.getStorageSync('key');

// 授权
wx.getUserProfile({
  success: res => {
    console.log(res.userInfo);
  }
});

// 支付
wx.requestPayment({
  timeStamp: '',
  nonceStr: '',
  package: '',
  signType: 'MD5',
  paySign: '',
  success: () => {},
  fail: () => {}
}...

Source information

Source
github
Repository
openclaw/skills
Path
skills/chandler0714/mini-program-dev
Version
—
Commit
d480df381897a0e9b727204190af150bf2c1fd19
Classification source
rules
Status
active
Visibility
public

These signals come from indexed source analysis and may lag behind changes. Check the current source files.

Extracted content

SKILL.md
# 微信小程序开发辅助

## 常用代码模板

### 页面结构

```javascript
// pages/demo/demo.js
Page({
  data: {
    message: 'Hello',
    list: [],
    loading: false
  },

  onLoad(options) {
    // 页面加载
    this.fetchData();
  },

  onShow() {
    // 页面显示
  },

  onPullDownRefresh() {
    // 下拉刷新
    this.fetchData().then(() => {
      wx.stopPullDownRefresh();
    });
  },

  fetchData() {
    this.setData({ loading: true });
    return new Promise((resolve, reject) => {
      wx.request({
        url: 'https://api.example.com/data',
        success: res => {
          this.setData({ 
            list: res.data,
            loading: false 
          });
          resolve(res);
        },
        fail: reject
      });
    });
  },

  handleTap(e) {
    console.log('tap', e.currentTarget.dataset);
  }
})
```

```xml
<!-- pages/demo/demo.wxml -->
<view class="container">
  <text class="title">{{message}}</text>
  
  <block wx:for="{{list}}" wx:key="id">
    <view class="item" bindtap="handleTap" data-id="{{item.id}}">
      {{item.name}}
    </view>
  </block>

  <loading wx:if="{{loading}}">加载中...</loading>
</view>
```

```css
/* pages/demo/demo.wxss */
.container {
  padding: 20rpx;
}

.title {
  font-size: 32rpx;
  font-weight: bold;
  display: block;
  margin-bottom: 20rpx;
}

.item {
  padding: 20rpx;
  border-bottom: 1rpx solid #eee;
}
```

### 常用 API

```javascript
// 提示框
wx.showToast({ title: '成功', icon: 'success' });
wx.showModal({ title: '提示', content: '确认?' });

// 跳转页面
wx.navigateTo({ url: '/pages/detail/detail?id=1' });
wx.redirectTo({ url: '/pages/detail/detail' });
wx.switchTab({ url: '/pages/index/index' });

// 存储
wx.setStorageSync('key', 'value');
const value = wx.getStorageSync('key');

// 授权
wx.getUserProfile({
  success: res => {
    console.log(res.userInfo);
  }
});

// 支付
wx.requestPayment({
  timeStamp: '',
  nonceStr: '',
  package: '',
  signType: 'MD5',
  paySign: '',
  success: () => {},
  fail: () => {}
}...

Related skills

OpenClaw

geo-optimization

capt-marbles

Generative Engine Optimization (GEO) for AI search visibility. Optimize content to appear in ChatGPT, Perplexity, Claude, and Google AI Overviews. Use when optimizing websites, pages, or content for LLM discove...

OpenClaw

139mail

chang-tong

139邮箱邮件收发 Skill - 支持 IMAP/SMTP 协议,兼容139/QQ/163/Gmail等主流邮箱 功能: 1. 发送邮件(SMTP) 2. 接收邮件(IMAP) 3. 查看收件箱列表 4. 查看未读邮件 当用户提到 "发邮件"、"收邮件"、"查看邮件"、"邮箱"...