├── .eslintignore
├── .eslintrc.js
├── .github
└── workflows
│ └── qqci.yml
├── .gitignore
├── LICENSE
├── README.md
├── app.js
├── app.json
├── app.qss
├── commitlint.config.js
├── config.js
├── image
├── audioPause.png
├── audioPlay.png
├── beauty-dis.png
├── beauty.png
├── camera-gray.png
├── camera.png
├── common
│ ├── ad.svg
│ ├── entry.svg
│ ├── icon-add.svg
│ ├── icon-arrow-right@2x.svg
│ ├── icon-copy.svg
│ ├── img-avatar@2x.png
│ ├── individuation.svg
│ ├── logo-mini.svg
│ ├── map.svg
│ ├── media.svg
│ ├── msg.svg
│ ├── new.png
│ ├── relationship.svg
│ ├── share.svg
│ └── wxPay.svg
├── icon-add@2x.png
├── icon-delete.svg
├── icon-pause-02.svg
├── icon-pause.svg
├── icon-play.svg
├── icon-share.svg
├── icon-stop-02.svg
├── icon-stop.svg
├── icon-voice.svg
├── index
│ ├── ad.svg
│ ├── api.svg
│ ├── canvas.svg
│ ├── content.svg
│ ├── custom-dress.svg
│ ├── device.svg
│ ├── form.svg
│ ├── group.svg
│ ├── location.svg
│ ├── logo-api.svg
│ ├── logo-component.svg
│ ├── logo-superpower.svg
│ ├── map.svg
│ ├── media.svg
│ ├── nav.svg
│ ├── network.svg
│ ├── official-dress.svg
│ ├── open.svg
│ ├── page.svg
│ ├── pc.svg
│ ├── publish.svg
│ ├── qzone.svg
│ ├── storage.svg
│ ├── view.svg
│ └── worker.svg
├── mic-dis.png
├── mic.png
├── play.png
├── plus.png
├── qq-miniapp.png
└── tabbar
│ ├── icon-api-selected@2x.png
│ ├── icon-api@2x.png
│ ├── icon-component-selected@2x.png
│ ├── icon-component@2x.png
│ ├── icon-superpower-selected@2x.png
│ └── icon-superpower@2x.png
├── miniprogram_npm
└── crypto-js
│ ├── index.js
│ └── index.js.map
├── package.json
├── page
├── API
│ ├── components
│ │ └── set-tab-bar
│ │ │ ├── set-tab-bar.js
│ │ │ ├── set-tab-bar.json
│ │ │ ├── set-tab-bar.qml
│ │ │ └── set-tab-bar.qss
│ ├── index.js
│ ├── index.json
│ ├── index.qml
│ ├── index.qss
│ └── pages
│ │ ├── InnerAudioContext
│ │ ├── InnerAudioContext.js
│ │ ├── InnerAudioContext.json
│ │ ├── InnerAudioContext.qml
│ │ ├── InnerAudioContext.qss
│ │ └── album.jpg
│ │ ├── action-sheet
│ │ ├── action-sheet.js
│ │ ├── action-sheet.json
│ │ ├── action-sheet.qml
│ │ └── action-sheet.qss
│ │ ├── animation
│ │ ├── animation.js
│ │ ├── animation.json
│ │ ├── animation.qml
│ │ └── animation.qss
│ │ ├── background-audio
│ │ ├── background-audio.js
│ │ ├── background-audio.json
│ │ ├── background-audio.qml
│ │ └── background-audio.qss
│ │ ├── canvas
│ │ ├── canvas.js
│ │ ├── canvas.json
│ │ ├── canvas.qml
│ │ ├── canvas.qss
│ │ └── example.js
│ │ ├── capture-screen
│ │ ├── capture-screen.js
│ │ ├── capture-screen.json
│ │ ├── capture-screen.qml
│ │ └── capture-screen.qss
│ │ ├── clipboard-data
│ │ ├── clipboard-data.js
│ │ ├── clipboard-data.json
│ │ ├── clipboard-data.qml
│ │ └── clipboard-data.qss
│ │ ├── download-file
│ │ ├── download-file.js
│ │ ├── download-file.json
│ │ ├── download-file.qml
│ │ └── download-file.qss
│ │ ├── file
│ │ ├── file.js
│ │ ├── file.json
│ │ ├── file.qml
│ │ └── file.qss
│ │ ├── get-location
│ │ ├── get-location.js
│ │ ├── get-location.json
│ │ ├── get-location.qml
│ │ └── get-location.qss
│ │ ├── get-network-type
│ │ ├── get-network-type.js
│ │ ├── get-network-type.json
│ │ ├── get-network-type.qml
│ │ └── get-network-type.qss
│ │ ├── get-qml-node-info
│ │ ├── get-qml-node-info.js
│ │ ├── get-qml-node-info.json
│ │ ├── get-qml-node-info.qml
│ │ └── get-qml-node-info.qss
│ │ ├── get-system-info
│ │ ├── get-system-info.js
│ │ ├── get-system-info.json
│ │ ├── get-system-info.qml
│ │ └── get-system-info.qss
│ │ ├── get-user-info
│ │ ├── get-user-info.js
│ │ ├── get-user-info.json
│ │ ├── get-user-info.qml
│ │ └── get-user-info.qss
│ │ ├── gyroscope
│ │ ├── gyroscope.js
│ │ ├── gyroscope.json
│ │ ├── gyroscope.qml
│ │ ├── gyroscope.qss
│ │ └── image.png
│ │ ├── image
│ │ ├── image.js
│ │ ├── image.json
│ │ ├── image.qml
│ │ └── image.qss
│ │ ├── intersection-observer
│ │ ├── intersection-observer.js
│ │ ├── intersection-observer.json
│ │ ├── intersection-observer.qml
│ │ └── intersection-observer.qss
│ │ ├── login
│ │ ├── login.js
│ │ ├── login.json
│ │ ├── login.qml
│ │ └── login.qss
│ │ ├── make-phone-call
│ │ ├── make-phone-call.js
│ │ ├── make-phone-call.json
│ │ ├── make-phone-call.qml
│ │ └── make-phone-call.qss
│ │ ├── modal
│ │ ├── modal.js
│ │ ├── modal.json
│ │ ├── modal.qml
│ │ └── modal.qss
│ │ ├── navigate-to-miniprogram
│ │ ├── navigate-to-miniprogram.js
│ │ ├── navigate-to-miniprogram.json
│ │ ├── navigate-to-miniprogram.qml
│ │ └── navigate-to-miniprogram.qss
│ │ ├── navigation-bar-loading
│ │ ├── navigation-bar-loading.js
│ │ ├── navigation-bar-loading.json
│ │ ├── navigation-bar-loading.qml
│ │ └── navigation-bar-loading.qss
│ │ ├── navigator
│ │ ├── navigator.js
│ │ ├── navigator.json
│ │ ├── navigator.qml
│ │ └── navigator.qss
│ │ ├── on-accelerometer-change
│ │ ├── on-accelerometer-change.js
│ │ ├── on-accelerometer-change.json
│ │ ├── on-accelerometer-change.qml
│ │ └── on-accelerometer-change.qss
│ │ ├── on-compass-change
│ │ ├── compass.png
│ │ ├── on-compass-change.js
│ │ ├── on-compass-change.json
│ │ ├── on-compass-change.qml
│ │ └── on-compass-change.qss
│ │ ├── on-network-status-change
│ │ ├── on-network-status-change.js
│ │ ├── on-network-status-change.json
│ │ ├── on-network-status-change.qml
│ │ └── on-network-status-change.qss
│ │ ├── page-scroll
│ │ ├── page-scroll.js
│ │ ├── page-scroll.json
│ │ ├── page-scroll.qml
│ │ └── page-scroll.qss
│ │ ├── pull-down-refresh
│ │ ├── pull-down-refresh.js
│ │ ├── pull-down-refresh.json
│ │ ├── pull-down-refresh.qml
│ │ └── pull-down-refresh.qss
│ │ ├── request
│ │ ├── request.js
│ │ ├── request.json
│ │ ├── request.qml
│ │ └── request.qss
│ │ ├── scan-code
│ │ ├── scan-code.js
│ │ ├── scan-code.json
│ │ ├── scan-code.qml
│ │ └── scan-code.qss
│ │ ├── screen-brightness
│ │ ├── screen-brightness.js
│ │ ├── screen-brightness.json
│ │ ├── screen-brightness.qml
│ │ └── screen-brightness.qss
│ │ ├── set-navigation-bar-title
│ │ ├── set-navigation-bar-title.js
│ │ ├── set-navigation-bar-title.json
│ │ ├── set-navigation-bar-title.qml
│ │ └── set-navigation-bar-title.qss
│ │ ├── setting
│ │ ├── setting.js
│ │ ├── setting.json
│ │ ├── setting.qml
│ │ └── setting.qss
│ │ ├── storage
│ │ ├── storage.js
│ │ ├── storage.json
│ │ ├── storage.qml
│ │ └── storage.qss
│ │ ├── toast
│ │ ├── toast.js
│ │ ├── toast.json
│ │ ├── toast.qml
│ │ └── toast.qss
│ │ ├── upload-file
│ │ ├── upload-file.js
│ │ ├── upload-file.json
│ │ ├── upload-file.qml
│ │ └── upload-file.qss
│ │ ├── vibrate
│ │ ├── vibrate.js
│ │ ├── vibrate.json
│ │ ├── vibrate.qml
│ │ └── vibrate.qss
│ │ ├── video
│ │ ├── video.js
│ │ ├── video.json
│ │ ├── video.qml
│ │ └── video.qss
│ │ ├── voice
│ │ ├── voice.js
│ │ ├── voice.json
│ │ ├── voice.qml
│ │ └── voice.qss
│ │ ├── web-socket
│ │ ├── web-socket.js
│ │ ├── web-socket.json
│ │ ├── web-socket.qml
│ │ └── web-socket.qss
│ │ └── worker
│ │ ├── worker.js
│ │ ├── worker.json
│ │ ├── worker.qml
│ │ └── worker.qss
├── common
│ ├── components
│ │ └── x-list
│ │ │ ├── x-list.js
│ │ │ ├── x-list.json
│ │ │ ├── x-list.qml
│ │ │ └── x-list.qss
│ ├── foot.qml
│ ├── head.qml
│ ├── index.qss
│ └── lib
│ │ └── qui.qss
├── component
│ ├── index.js
│ ├── index.json
│ ├── index.qml
│ ├── index.qss
│ ├── pages
│ │ ├── button
│ │ │ ├── button.js
│ │ │ ├── button.json
│ │ │ ├── button.qml
│ │ │ └── button.qss
│ │ ├── camera
│ │ │ ├── camera.js
│ │ │ ├── camera.json
│ │ │ ├── camera.qml
│ │ │ └── camera.qss
│ │ ├── canvas
│ │ │ ├── canvas.js
│ │ │ ├── canvas.json
│ │ │ ├── canvas.qml
│ │ │ └── canvas.qss
│ │ ├── checkbox
│ │ │ ├── checkbox.js
│ │ │ ├── checkbox.json
│ │ │ ├── checkbox.qml
│ │ │ └── checkbox.qss
│ │ ├── cover-view
│ │ │ ├── cover-view.js
│ │ │ ├── cover-view.json
│ │ │ ├── cover-view.qml
│ │ │ └── cover-view.qss
│ │ ├── editor
│ │ │ ├── editor.js
│ │ │ ├── editor.json
│ │ │ ├── editor.qml
│ │ │ └── editor.qss
│ │ ├── form
│ │ │ ├── form.js
│ │ │ ├── form.json
│ │ │ ├── form.qml
│ │ │ └── form.qss
│ │ ├── icon
│ │ │ ├── icon.js
│ │ │ ├── icon.json
│ │ │ ├── icon.qml
│ │ │ └── icon.qss
│ │ ├── image
│ │ │ ├── image.js
│ │ │ ├── image.json
│ │ │ ├── image.qml
│ │ │ └── image.qss
│ │ ├── input
│ │ │ ├── input.js
│ │ │ ├── input.json
│ │ │ ├── input.qml
│ │ │ └── input.qss
│ │ ├── label
│ │ │ ├── label.js
│ │ │ ├── label.json
│ │ │ ├── label.qml
│ │ │ └── label.qss
│ │ ├── movable-view
│ │ │ ├── movable-view.js
│ │ │ ├── movable-view.json
│ │ │ ├── movable-view.qml
│ │ │ └── movable-view.qss
│ │ ├── navigator
│ │ │ ├── navigate.js
│ │ │ ├── navigate.json
│ │ │ ├── navigate.qml
│ │ │ ├── navigate.qss
│ │ │ ├── navigator.js
│ │ │ ├── navigator.json
│ │ │ ├── navigator.qml
│ │ │ ├── navigator.qss
│ │ │ ├── redirect.js
│ │ │ ├── redirect.json
│ │ │ ├── redirect.qml
│ │ │ └── redirect.qss
│ │ ├── open-data
│ │ │ ├── open-data.js
│ │ │ ├── open-data.json
│ │ │ ├── open-data.qml
│ │ │ └── open-data.qss
│ │ ├── picker-view
│ │ │ ├── picker-view.js
│ │ │ ├── picker-view.json
│ │ │ ├── picker-view.qml
│ │ │ └── picker-view.qss
│ │ ├── picker
│ │ │ ├── picker.js
│ │ │ ├── picker.json
│ │ │ ├── picker.qml
│ │ │ └── picker.qss
│ │ ├── progress
│ │ │ ├── progress.js
│ │ │ ├── progress.json
│ │ │ ├── progress.qml
│ │ │ └── progress.qss
│ │ ├── radio
│ │ │ ├── radio.js
│ │ │ ├── radio.json
│ │ │ ├── radio.qml
│ │ │ └── radio.qss
│ │ ├── rich-text
│ │ │ ├── rich-text.js
│ │ │ ├── rich-text.json
│ │ │ ├── rich-text.qml
│ │ │ └── rich-text.qss
│ │ ├── scroll-view
│ │ │ ├── scroll-view.js
│ │ │ ├── scroll-view.json
│ │ │ ├── scroll-view.qml
│ │ │ └── scroll-view.qss
│ │ ├── slider
│ │ │ ├── slider.js
│ │ │ ├── slider.json
│ │ │ ├── slider.qml
│ │ │ └── slider.qss
│ │ ├── swiper
│ │ │ ├── swiper.js
│ │ │ ├── swiper.json
│ │ │ ├── swiper.qml
│ │ │ └── swiper.qss
│ │ ├── switch
│ │ │ ├── switch.js
│ │ │ ├── switch.json
│ │ │ ├── switch.qml
│ │ │ └── switch.qss
│ │ ├── text
│ │ │ ├── text.js
│ │ │ ├── text.json
│ │ │ ├── text.qml
│ │ │ └── text.qss
│ │ ├── textarea
│ │ │ ├── textarea.js
│ │ │ ├── textarea.json
│ │ │ ├── textarea.qml
│ │ │ └── textarea.qss
│ │ ├── video
│ │ │ ├── video.js
│ │ │ ├── video.json
│ │ │ ├── video.qml
│ │ │ └── video.qss
│ │ ├── view
│ │ │ ├── view.js
│ │ │ ├── view.json
│ │ │ ├── view.qml
│ │ │ └── view.qss
│ │ └── web-view
│ │ │ ├── web-view.js
│ │ │ ├── web-view.json
│ │ │ ├── web-view.qml
│ │ │ └── web-view.qss
│ └── resources
│ │ ├── kind
│ │ ├── daytime.png
│ │ └── night.png
│ │ └── pic
│ │ ├── 1.jpg
│ │ └── 2.jpg
└── superpower
│ ├── index.js
│ ├── index.json
│ ├── index.qml
│ ├── index.qss
│ ├── pages
│ ├── VoIPChat
│ │ ├── VoIPChat.js
│ │ ├── VoIPChat.json
│ │ ├── VoIPChat.qml
│ │ └── VoIPChat.qss
│ ├── ad-more-style
│ │ ├── ad-more-style.js
│ │ ├── ad-more-style.json
│ │ ├── ad-more-style.qml
│ │ └── ad-more-style.qss
│ ├── add-friend
│ │ ├── add-fried.qss
│ │ ├── add-friend.js
│ │ ├── add-friend.json
│ │ └── add-friend.qml
│ ├── address
│ │ ├── address.js
│ │ ├── address.json
│ │ ├── address.qml
│ │ └── address.qss
│ ├── entry
│ │ ├── entry.js
│ │ ├── entry.json
│ │ ├── entry.qml
│ │ └── entry.qss
│ ├── general-webpage-url
│ │ ├── general-webpage-url.js
│ │ ├── general-webpage-url.json
│ │ ├── general-webpage-url.qml
│ │ └── general-webpage-url.qss
│ ├── group-profile
│ │ ├── group-profile.js
│ │ ├── group-profile.json
│ │ ├── group-profile.qml
│ │ └── group-profile.qss
│ ├── individuation
│ │ ├── individuation.js
│ │ ├── individuation.json
│ │ ├── individuation.qml
│ │ └── individuation.qss
│ ├── liveplayer
│ │ ├── liveplayer.js
│ │ ├── liveplayer.json
│ │ ├── liveplayer.qml
│ │ └── liveplayer.qss
│ ├── livepusher-record
│ │ ├── livepusher-record.js
│ │ ├── livepusher-record.json
│ │ ├── livepusher-record.qml
│ │ └── livepusher-record.qss
│ ├── livepusher
│ │ ├── livepusher.js
│ │ ├── livepusher.json
│ │ ├── livepusher.qml
│ │ └── livepusher.qss
│ ├── map-more-style
│ │ ├── map-more-style.js
│ │ ├── map-more-style.json
│ │ ├── map-more-style.qml
│ │ └── map-more-style.qss
│ ├── map
│ │ ├── map.js
│ │ ├── map.json
│ │ ├── map.qml
│ │ └── map.qss
│ ├── media
│ │ ├── media.js
│ │ ├── media.json
│ │ ├── media.qml
│ │ └── media.qss
│ ├── message-subscribe
│ │ ├── message-subscribe.js
│ │ ├── message-subscribe.json
│ │ ├── message-subscribe.qml
│ │ └── message-subscribe.qss
│ ├── message-template
│ │ ├── message-template.js
│ │ ├── message-template.json
│ │ ├── message-template.qml
│ │ └── message-template.qss
│ ├── message
│ │ ├── message.js
│ │ ├── message.json
│ │ ├── message.qml
│ │ └── message.qss
│ ├── o2o
│ │ ├── o2o.js
│ │ ├── o2o.json
│ │ ├── o2o.qml
│ │ └── o2o.qss
│ ├── open-qzone-publish
│ │ ├── open-qzone-publish.js
│ │ ├── open-qzone-publish.json
│ │ ├── open-qzone-publish.qml
│ │ └── open-qzone-publish.qss
│ ├── public-profile
│ │ ├── public-profile.js
│ │ ├── public-profile.json
│ │ ├── public-profile.qml
│ │ └── public-profile.qss
│ ├── qzone
│ │ ├── qzone.js
│ │ ├── qzone.json
│ │ ├── qzone.qml
│ │ └── qzone.qss
│ ├── relationship
│ │ ├── relationship.js
│ │ ├── relationship.json
│ │ ├── relationship.qml
│ │ └── relationship.qss
│ ├── set-custom-dress
│ │ ├── avatar.png
│ │ ├── set-custom-dress.js
│ │ ├── set-custom-dress.json
│ │ ├── set-custom-dress.qml
│ │ └── set-custom-dress.qss
│ ├── set-official-dress
│ │ ├── 1.png
│ │ ├── 2.png
│ │ ├── set-official-dress.js
│ │ ├── set-official-dress.json
│ │ ├── set-official-dress.qml
│ │ └── set-official-dress.qss
│ └── wxPay
│ │ ├── wxPay.js
│ │ ├── wxPay.json
│ │ ├── wxPay.qml
│ │ └── wxPay.qss
│ └── resources
│ ├── kind
│ ├── daytime.png
│ └── night.png
│ └── pic
│ ├── 1.jpg
│ ├── 2.jpg
│ ├── custom_map_template_1.png
│ ├── custom_map_template_2.png
│ ├── custom_map_template_3.png
│ └── custom_map_template_4.png
├── project.config.json
├── sitemap.json
├── util
└── util.js
└── workers
└── fib
└── index.js
/.eslintignore:
--------------------------------------------------------------------------------
1 | /vendor
2 | /node_modules
3 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | commonjs: true,
4 | es6: true,
5 | },
6 | extends: [
7 | 'airbnb-base',
8 | ],
9 | globals: {
10 | Atomics: 'readonly',
11 | SharedArrayBuffer: 'readonly',
12 | 'worker': true,
13 | 'getApp': true,
14 | 'qq': true,
15 | 'Page': true,
16 | 'App': true,
17 | 'Component': true
18 | },
19 | parserOptions: {
20 | ecmaVersion: 2018,
21 | },
22 | rules: {
23 | "linebreak-style": 'off',
24 | 'no-param-reassign': 'off',
25 | 'no-plusplus': 'off',
26 | 'no-console': 'off',
27 | 'func-names': 'off'
28 | },
29 | };
30 |
--------------------------------------------------------------------------------
/.github/workflows/qqci.yml:
--------------------------------------------------------------------------------
1 | name: CI
2 |
3 | on:
4 | push:
5 | branches:
6 | - master
7 |
8 | jobs:
9 | build-qq-ci: #job名称
10 |
11 | runs-on: ubuntu-latest #运行环境
12 |
13 | steps:
14 |
15 | - name: Checkout
16 | uses: actions/checkout@master
17 |
18 | - name: ESLint checks
19 | run: |
20 | npm install
21 | npm run eslint
22 |
23 | - name: Build
24 | uses: docker://qqminiapp/build:latest
25 | env:
26 | PLUGIN_VERSION: 1.0.0
27 | PLUGIN_DESC: CI自动构建上传
28 | PLUGIN_APPTOKEN: ${{ secrets.APPTOKEN }}
29 | PLUGIN_BUILDUSER: ${{ github.actor }}
30 | PLUGIN_EXPERIENCE: true
31 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *swp
2 | .idea
3 | .DS_Store
4 | package-lock.json
5 |
6 | logs
7 | *.log
8 | npm-debug.log*
9 | yarn-debug.log*
10 | yarn-error.log*
11 | node_modules
12 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT LICENSE
2 |
3 | Copyright (c) 2019-present qq-web, https://q.qq.com/
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining
6 | a copy of this software and associated documentation files (the
7 | "Software"), to deal in the Software without restriction, including
8 | without limitation the rights to use, copy, modify, merge, publish,
9 | distribute, sublicense, and/or sell copies of the Software, and to
10 | permit persons to whom the Software is furnished to do so, subject to
11 | the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be
14 | included in all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # qq-miniprogram-demo
2 |
3 | QQ小程序示例源码
4 | > 请使用QQ开发者工具或手机QQ Android 客户端( Version ≥7.9.9)。
5 |
6 | 
7 |
8 | ## 推荐使用CI构建
9 |
10 | 强烈推荐使用QQ小程序官方提供的docker构建镜像,本示例使用GitHub Actions接入。
11 |
12 | [yml示例](https://github.com/qq-web/qq-miniprogram-demo/blob/master/.github/workflows/qqci.yml)
13 |
14 | [查看更多文档](https://q.qq.com/wiki/tools/ci/)
15 |
--------------------------------------------------------------------------------
/app.js:
--------------------------------------------------------------------------------
1 | const openIdUrl = require('./config').openIdUrl
2 |
3 | App({
4 | onLaunch(opts) {
5 | console.log('App Launch', opts)
6 | },
7 | onShow(opts) {
8 | console.log('App Show', opts)
9 | this.globalData.appOnShowOptions = opts;
10 | // qq.testNewApi()
11 | },
12 | onHide() {
13 | console.log('App Hide')
14 | },
15 | globalData: {
16 | hasLogin: false,
17 | openid: null,
18 | appOnShowOptions: null
19 | },
20 | // lazy loading openid
21 | getUserOpenId(callback) {
22 | const self = this
23 |
24 | if (self.globalData.openid) {
25 | callback(null, self.globalData.openid)
26 | } else {
27 | qq.login({
28 | success(data) {
29 | qq.request({
30 | url: openIdUrl,
31 | data: {
32 | code: data.code
33 | },
34 | success(res) {
35 | console.log('拉取openid成功', res)
36 | self.globalData.openid = res.data.openid
37 | callback(null, self.globalData.openid)
38 | },
39 | fail(res) {
40 | console.log('拉取用户openid失败,将无法正常使用开放接口等服务', res)
41 | callback(res)
42 | }
43 | })
44 | },
45 | fail(err) {
46 | console.log('qq.login 接口调用失败,将无法正常使用开放接口等服务', err)
47 | callback(err)
48 | }
49 | })
50 | }
51 | }
52 | })
53 |
--------------------------------------------------------------------------------
/commitlint.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | extends: ['@commitlint/config-conventional'],
3 | }
4 |
--------------------------------------------------------------------------------
/config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 小程序配置文件
3 | */
4 |
5 | // 此处主机域名是腾讯云解决方案分配的域名
6 | // 小程序后台服务解决方案:https://www.qcloud.com/solution/la
7 |
8 | const host = '14592619.qcloud.la'
9 |
10 | const config = {
11 |
12 | // 下面的地址配合云端 Server 工作
13 | host,
14 |
15 | // 登录地址,用于建立会话
16 | loginUrl: `https://${host}/login`,
17 |
18 | // 测试的请求地址,用于测试会话
19 | requestUrl: 'https://q.qq.com',
20 |
21 | // 用code换取openId
22 | openIdUrl: `https://q.qq.com/demo/openid`,
23 |
24 | // 测试的信道服务接口
25 | tunnelUrl: `https://${host}/tunnel`,
26 |
27 | // 生成支付订单的接口
28 | paymentUrl: `https://${host}/payment`,
29 |
30 | // 发送模板消息接口
31 | templateMessageUrl: `https://q.qq.com/demo/templateMessage`,
32 |
33 | // 存储示例value
34 | testValue: '520',
35 |
36 | // 发送订阅消息接口
37 | subscribeMessageUrl: `https://q.qq.com/demo/subscribeMessage`,
38 |
39 | // 上传文件接口
40 | uploadFileUrl: 'https://q.qq.com/upload',
41 |
42 | // 微信支付接口
43 | wxPayUrl: 'https://q.qq.com/demo/wxPay',
44 |
45 | // 下载示例图片接口
46 | downloadExampleUrl: 'https://qzonestyle.gtimg.cn/aoi/sola/20190717151707_2LoGUX7hZ1.png'
47 | }
48 |
49 | module.exports = config
50 |
--------------------------------------------------------------------------------
/image/audioPause.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/image/audioPause.png
--------------------------------------------------------------------------------
/image/audioPlay.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/image/audioPlay.png
--------------------------------------------------------------------------------
/image/beauty-dis.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/image/beauty-dis.png
--------------------------------------------------------------------------------
/image/beauty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/image/beauty.png
--------------------------------------------------------------------------------
/image/camera-gray.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/image/camera-gray.png
--------------------------------------------------------------------------------
/image/camera.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/image/camera.png
--------------------------------------------------------------------------------
/image/common/entry.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/image/common/icon-add.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/image/common/img-avatar@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/image/common/img-avatar@2x.png
--------------------------------------------------------------------------------
/image/common/individuation.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/image/common/map.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/image/common/new.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/image/common/new.png
--------------------------------------------------------------------------------
/image/common/share.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/image/common/wxPay.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/image/icon-add@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/image/icon-add@2x.png
--------------------------------------------------------------------------------
/image/icon-play.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/image/index/custom-dress.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/image/index/device.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/image/index/location.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/image/index/map.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/image/index/open.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/image/index/page.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/image/index/view.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/image/mic-dis.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/image/mic-dis.png
--------------------------------------------------------------------------------
/image/mic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/image/mic.png
--------------------------------------------------------------------------------
/image/play.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/image/play.png
--------------------------------------------------------------------------------
/image/plus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/image/plus.png
--------------------------------------------------------------------------------
/image/qq-miniapp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/image/qq-miniapp.png
--------------------------------------------------------------------------------
/image/tabbar/icon-api-selected@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/image/tabbar/icon-api-selected@2x.png
--------------------------------------------------------------------------------
/image/tabbar/icon-api@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/image/tabbar/icon-api@2x.png
--------------------------------------------------------------------------------
/image/tabbar/icon-component-selected@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/image/tabbar/icon-component-selected@2x.png
--------------------------------------------------------------------------------
/image/tabbar/icon-component@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/image/tabbar/icon-component@2x.png
--------------------------------------------------------------------------------
/image/tabbar/icon-superpower-selected@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/image/tabbar/icon-superpower-selected@2x.png
--------------------------------------------------------------------------------
/image/tabbar/icon-superpower@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/image/tabbar/icon-superpower@2x.png
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "miniprogram-demo",
3 | "version": "1.0.0",
4 | "description": "QQ小程序示例源码 > 请使用QQ开发者工具或QQ Android客户端7.9.9/Ios客户端8.0.3及以上版本运行。",
5 | "main": "app.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1",
8 | "cp": "cp -R ./ ../../github/fork/qq-miniprogram-demo/"
9 | },
10 | "repository": {
11 | "type": "git",
12 | "url": "http://git.code.oa.com/QQMiniApp/miniprogram-demo.git"
13 | },
14 | "author": "",
15 | "license": "ISC",
16 | "dependencies": {
17 | "crypto-js": "^3.1.9-1"
18 | },
19 | "devDependencies": {
20 | "@commitlint/config-conventional": "^9.0.1",
21 | "commitlint": "^9.0.1",
22 | "eslint": "^7.3.1",
23 | "eslint-config-airbnb": "^18.2.0",
24 | "eslint-plugin-import": "^2.22.0",
25 | "eslint-plugin-node": "^11.1.0",
26 | "eslint-plugin-promise": "^4.2.1",
27 | "husky": "^4.2.5",
28 | "lint-staged": "^10.2.11"
29 | },
30 | "lint-staged": {
31 | "./**/*.js": [
32 | "eslint --fix",
33 | "git add"
34 | ]
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/page/API/components/set-tab-bar/set-tab-bar.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/page/API/components/set-tab-bar/set-tab-bar.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
12 |
15 |
18 |
21 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/page/API/components/set-tab-bar/set-tab-bar.qss:
--------------------------------------------------------------------------------
1 | @import "../../../../app.qss";
2 |
3 |
4 | button {
5 | background-color:#EBEDF5;
6 | }
--------------------------------------------------------------------------------
/page/API/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "小程序接口能力展示",
3 | "usingComponents": {
4 | "set-tab-bar": "components/set-tab-bar/set-tab-bar"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/page/API/index.qss:
--------------------------------------------------------------------------------
1 | @import "../common/index.qss";
2 |
3 | page {
4 | background-color: #F5F6FA !important;
5 | }
--------------------------------------------------------------------------------
/page/API/pages/InnerAudioContext/InnerAudioContext.js:
--------------------------------------------------------------------------------
1 | const util = require('../../../../util/util.js')
2 |
3 | Page({
4 | onShareAppMessage() {
5 | return {
6 | title: 'InnerAudioContext',
7 | path: 'page/component/pages/InnerAudioContext/InnerAudioContext',
8 | }
9 | },
10 |
11 | data: {
12 | time: '00:00:00',
13 | title: '全新出发',
14 | singer: '腾讯二十周年主题曲',
15 | src: './album.jpg',
16 | isPlaying: false,
17 | },
18 | onLoad() {
19 | this.innerAudioContext = qq.createInnerAudioContext()
20 | this.innerAudioContext.src = 'http://down.qq.com/qzone/demo_music/%E3%80%8A%E5%85%A8%E6%96%B0%E5%87%BA%E5%8F%91%E3%80%8BFN%20MMM.wav'
21 | },
22 | play() {
23 | const that = this
24 | this.setData({
25 | isPlaying: true,
26 | })
27 | this.innerAudioContext.play()
28 | this.innerAudioContext.onTimeUpdate(() => {
29 | that.setData({
30 | time: util.formatTime(that.innerAudioContext.currentTime)
31 | })
32 | })
33 | },
34 | pause() {
35 | this.innerAudioContext.pause()
36 | this.setData({
37 | isPlaying: false,
38 | })
39 | },
40 |
41 | onUnload() {
42 | this.innerAudioContext.destroy()
43 | }
44 | })
45 |
--------------------------------------------------------------------------------
/page/API/pages/InnerAudioContext/InnerAudioContext.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "InnerAudioContext"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/InnerAudioContext/InnerAudioContext.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | {{title}}
11 | {{singer}}
12 | {{time}}
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/page/API/pages/InnerAudioContext/InnerAudioContext.qss:
--------------------------------------------------------------------------------
1 | /* page/component/pages/audio/audio.qss */
2 | .page-section {
3 | position: relative;
4 | background-color: #F5F6FA;
5 | width: 550rpx;
6 | margin: 0 auto;
7 | height: 120rpx;
8 | border: 4rpx;
9 | }
10 | image {
11 | position: absolute;
12 | top: 10rpx;
13 | left: 10rpx;
14 | width: 100rpx;
15 | height: 100rpx;
16 | }
17 |
18 | .page-body-button {
19 | position: absolute;
20 | left: 36rpx;
21 | top: 36rpx;
22 | width: 48rpx;
23 | height: 48rpx;
24 | }
25 |
26 | .text {
27 | position: absolute;
28 | }
29 | .title {
30 | left: 130rpx;
31 | top: 18rpx;
32 | font-family: PingFangSC-Regular;
33 | font-size: 28rpx;
34 | color: #03081A;
35 | letter-spacing: 0;
36 | text-align: center;
37 | }
38 | .singer {
39 | left: 130rpx;
40 | top: 68rpx;
41 | font-family: PingFangSC-Regular;
42 | font-size: 24rpx;
43 | color: #878B99;
44 | letter-spacing: 0;
45 | }
46 | .time {
47 | font-family: PingFangSC-Regular;
48 | font-size: 24rpx;
49 | color: #878B99;
50 | letter-spacing: 0;
51 | text-align: center;
52 | right: 20rpx;
53 | top: 16rpx;
54 | }
--------------------------------------------------------------------------------
/page/API/pages/InnerAudioContext/album.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/page/API/pages/InnerAudioContext/album.jpg
--------------------------------------------------------------------------------
/page/API/pages/action-sheet/action-sheet.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: '操作菜单',
5 | path: 'page/API/pages/action-sheet/action-sheet'
6 | }
7 | },
8 |
9 | actionSheetTap() {
10 | qq.showActionSheet({
11 | itemList: ['item1', 'item2', 'item3', 'item4'],
12 | success(e) {
13 | console.log(e.tapIndex)
14 | }
15 | })
16 | }
17 | })
18 |
--------------------------------------------------------------------------------
/page/API/pages/action-sheet/action-sheet.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "操作菜单"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/action-sheet/action-sheet.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/page/API/pages/action-sheet/action-sheet.qss:
--------------------------------------------------------------------------------
1 | /*
2 | .cancel {
3 | color: white;
4 | background: #303F9F;
5 | }
6 | .item {
7 | color: black;
8 | background: #C5CAE9;
9 | }*/
10 |
--------------------------------------------------------------------------------
/page/API/pages/animation/animation.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "动画"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/animation/animation.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/page/API/pages/animation/animation.qss:
--------------------------------------------------------------------------------
1 | .page-section {
2 | padding-bottom:60rpx;
3 | }
4 | .animation-element-wrapper {
5 | display: flex;
6 | width: 100%;
7 | padding-top: 150rpx;
8 | padding-bottom: 150rpx;
9 | justify-content: center;
10 | overflow: hidden;
11 | background-color: #F5F6FA;
12 | }
13 | .animation-element {
14 | width: 200rpx;
15 | height: 200rpx;
16 | background-color: #00CAFC;
17 | }
18 | .animation-buttons {
19 | padding: 30rpx 50rpx 10rpx;
20 | width: 100%;
21 | /* height: 400rpx; */
22 | box-sizing: border-box;
23 | }
24 | .animation-button {
25 | float: left;
26 | line-height: 2;
27 | width: 300rpx;
28 | margin: 15rpx 12rpx;
29 | }
30 |
31 | .animation-button-reset {
32 | width: 620rpx;
33 | }
34 |
35 |
36 |
37 | button {
38 | background-color:#EBEDF5;
39 | }
--------------------------------------------------------------------------------
/page/API/pages/background-audio/background-audio.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "背景音乐"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/canvas/canvas.js:
--------------------------------------------------------------------------------
1 | const example = require('./example.js')
2 |
3 | Page({
4 | onShareAppMessage() {
5 | return {
6 | title: '创建画布',
7 | path: 'page/API/pages/canvas/canvas'
8 | }
9 | },
10 |
11 | onLoad() {
12 | this.context = qq.createContext()
13 |
14 | const methods = Object.keys(example)
15 | this.setData({
16 | methods
17 | })
18 |
19 | const that = this
20 | methods.forEach(function (method) {
21 | that[method] = function () {
22 | example[method](that.context)
23 | const actions = that.context.getActions()
24 |
25 | qq.drawCanvas({
26 | canvasId: 'canvas',
27 | actions
28 | })
29 | }
30 | })
31 | },
32 |
33 | toTempFilePath() {
34 | qq.canvasToTempFilePath({
35 | canvasId: 'canvas',
36 | success(res) {
37 | console.log(res)
38 | },
39 |
40 | fail(res) {
41 | console.log(res)
42 | }
43 | })
44 | }
45 | })
46 |
--------------------------------------------------------------------------------
/page/API/pages/canvas/canvas.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "创建画布"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/canvas/canvas.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/page/API/pages/canvas/canvas.qss:
--------------------------------------------------------------------------------
1 | .canvas-element-wrapper {
2 | display: block;
3 | margin-bottom: 100rpx;
4 | }
5 | .canvas-element {
6 | width: 100%;
7 | height: 500rpx;
8 | background-color: #F5F6FA;
9 | }
10 | .canvas-buttons {
11 | padding: 30rpx 50rpx 10rpx;
12 | width: 100%;
13 | height: 400rpx;
14 | box-sizing: border-box;
15 | }
16 | .canvas-button {
17 | float: left;
18 | line-height: 2;
19 | width: 300rpx;
20 | margin: 15rpx 12rpx;
21 | }
22 |
23 |
24 |
25 | button {
26 | background-color:#EBEDF5;
27 | }
--------------------------------------------------------------------------------
/page/API/pages/capture-screen/capture-screen.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: '用户截屏事件',
5 | path: 'page/API/pages/capture-screen/capture-screen'
6 | }
7 | },
8 |
9 | data: {
10 | captured: false,
11 | },
12 | onLoad() {
13 | qq.onUserCaptureScreen(() => {
14 | this.setData({
15 | captured: true
16 | })
17 | })
18 | }
19 | })
20 |
--------------------------------------------------------------------------------
/page/API/pages/capture-screen/capture-screen.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "用户截屏事件"
3 | }
--------------------------------------------------------------------------------
/page/API/pages/capture-screen/capture-screen.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | 请进行屏幕截屏
10 | 截屏事件{{ captured ? "已" : "未" }}触发
11 |
12 |
13 |
14 | 请进行屏幕截屏
15 | 截屏事件{{ captured ? "已" : "未" }}触发
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/page/API/pages/capture-screen/capture-screen.qss:
--------------------------------------------------------------------------------
1 | .info-wrap {
2 | height:392rpx;
3 | }
--------------------------------------------------------------------------------
/page/API/pages/clipboard-data/clipboard-data.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: '剪切板',
5 | path: 'page/API/pages/clipboard-data/clipboard-data'
6 | }
7 | },
8 |
9 | data: {
10 | value: 'edit and copy me',
11 | pasted: '',
12 | },
13 |
14 | valueChanged(e) {
15 | this.setData({
16 | value: e.detail.value
17 | })
18 | },
19 |
20 | copy() {
21 | qq.setClipboardData({
22 | data: this.data.value,
23 | success() {
24 | qq.showToast({
25 | title: '复制成功',
26 | icon: 'success',
27 | duration: 1000
28 | })
29 | }
30 | })
31 | },
32 |
33 | paste() {
34 | const self = this
35 | qq.getClipboardData({
36 | success(res) {
37 | self.setData({
38 | pasted: res.data
39 | })
40 | qq.showToast({
41 | title: '粘贴成功',
42 | icon: 'success',
43 | duration: 1000
44 | })
45 | }
46 | })
47 | }
48 | })
49 |
--------------------------------------------------------------------------------
/page/API/pages/clipboard-data/clipboard-data.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "剪切板"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/clipboard-data/clipboard-data.qss:
--------------------------------------------------------------------------------
1 | @import "../../../common/lib/qui.qss";
--------------------------------------------------------------------------------
/page/API/pages/download-file/download-file.js:
--------------------------------------------------------------------------------
1 | const downloadExampleUrl = require('../../../../config').downloadExampleUrl
2 |
3 | Page({
4 | onShareAppMessage() {
5 | return {
6 | title: '下载文件',
7 | path: 'page/API/pages/download-file/download-file'
8 | }
9 | },
10 |
11 | downloadImage() {
12 | const self = this
13 |
14 | qq.downloadFile({
15 | url: downloadExampleUrl,
16 | success(res) {
17 | console.log('downloadFile success, res is', res)
18 |
19 | self.setData({
20 | imageSrc: res.tempFilePath
21 | })
22 | },
23 | fail({errMsg}) {
24 | console.log('downloadFile fail, err is:', errMsg)
25 | }
26 | })
27 | }
28 | })
29 |
--------------------------------------------------------------------------------
/page/API/pages/download-file/download-file.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "下载文件"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/download-file/download-file.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | 点击按钮下载服务端示例图片
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/page/API/pages/download-file/download-file.qss:
--------------------------------------------------------------------------------
1 | .info-wrap {
2 | padding-top:260rpx;
3 | padding-bottom:120rpx;
4 | }
5 |
6 | .img {
7 | display:block;
8 | margin:0 auto;
9 | width:600rpx;
10 | height:600rpx;
11 | }
--------------------------------------------------------------------------------
/page/API/pages/file/file.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "文件"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/file/file.qss:
--------------------------------------------------------------------------------
1 | .image {
2 | width: 100%;
3 | height: 360rpx;
4 | }
5 | .page-body-info {
6 | display: flex;
7 | box-sizing: border-box;
8 | padding: 30rpx;
9 | height: 420rpx;
10 | border-top: 1rpx solid #D9D9D9;
11 | border-bottom: 1rpx solid #D9D9D9;
12 | align-items: center;
13 | justify-content: center;
14 | }
15 |
16 |
17 | .choose-wrap {
18 | width:100%;
19 | height:296rpx;
20 | background-color:#FFF;
21 | }
22 | .choose-wrap__inner {
23 | display:flex;
24 | flex-direction:column;
25 | align-items:center;
26 | justify-content:center;
27 | min-height:100%;
28 | }
29 | .choose-wrap__img {
30 | height:240rpx;
31 | }
32 | .choose-wrap__icon {
33 | display:block;
34 | margin:0 auto;
35 | width:80rpx;
36 | height:80rpx;
37 | }
38 | .choose-wrap__txt {
39 | display:inline-block;
40 | margin-top:20rpx;
41 | line-height:1.3;
42 | text-align:center;
43 | font-size:28rpx;
44 | color:#B0B3BF;
45 | }
--------------------------------------------------------------------------------
/page/API/pages/get-location/get-location.js:
--------------------------------------------------------------------------------
1 | const util = require('../../../../util/util.js')
2 |
3 | const formatLocation = util.formatLocation
4 |
5 | Page({
6 | onShareAppMessage() {
7 | return {
8 | title: '获取位置',
9 | path: 'page/API/pages/get-location/get-location'
10 | }
11 | },
12 |
13 | data: {
14 | hasLocation: false,
15 | },
16 | getLocation() {
17 | const that = this
18 | qq.getLocation({
19 | type: 'gcj02',
20 | success(res) {
21 | console.log(res)
22 | that.setData({
23 | hasLocation: true,
24 | location: formatLocation(res.longitude, res.latitude)
25 | })
26 | },
27 | fail(err) {
28 | console.log('err', err)
29 | }
30 | })
31 | },
32 | clear() {
33 | this.setData({
34 | hasLocation: false
35 | })
36 | }
37 | })
38 |
--------------------------------------------------------------------------------
/page/API/pages/get-location/get-location.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "获取位置"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/get-location/get-location.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | 当前位置经纬度
11 |
12 | 未获取
13 |
14 |
15 |
16 | E: {{location.longitude[0]}}°{{location.longitude[1]}}′
17 | N: {{location.latitude[0]}}°{{location.latitude[1]}}′
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/page/API/pages/get-location/get-location.qss:
--------------------------------------------------------------------------------
1 | .page-body-info {
2 | height: 250rpx;
3 | }
4 | .page-body-text-small {
5 | font-size: 24rpx;
6 | color: #000;
7 | margin-bottom: 100rpx;
8 | }
9 | .page-body-text-location {
10 | display: flex;
11 | font-size: 50rpx;
12 | }
13 | .page-body-text-location text {
14 | margin: 10rpx;
15 | }
16 |
--------------------------------------------------------------------------------
/page/API/pages/get-network-type/get-network-type.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: '获取手机网络状态',
5 | path: 'page/API/pages/get-network-type/get-network-type'
6 | }
7 | },
8 |
9 | data: {
10 | hasNetworkType: false
11 | },
12 | getNetworkType() {
13 | const that = this
14 | qq.getNetworkType({
15 | success(res) {
16 | console.log(res)
17 | that.setData({
18 | hasNetworkType: true,
19 | networkType: res.subtype || res.networkType
20 | })
21 | }
22 | })
23 | },
24 | clear() {
25 | this.setData({
26 | hasNetworkType: false,
27 | networkType: ''
28 | })
29 | }
30 | })
31 |
--------------------------------------------------------------------------------
/page/API/pages/get-network-type/get-network-type.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "获取手机网络状态"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/get-network-type/get-network-type.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | 网络状态
11 |
12 | 未获取
13 | 点击蓝色按钮可获取网络状态
14 |
15 |
16 | {{networkType}}
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/page/API/pages/get-network-type/get-network-type.qss:
--------------------------------------------------------------------------------
1 | .page-body-info {
2 | height: 200rpx;
3 | }
4 | .page-body-text-network-type {
5 | font-size: 80rpx;
6 | font-family: -apple-system-font,Helvetica Neue,Helvetica,sans-serif;
7 | }
8 |
--------------------------------------------------------------------------------
/page/API/pages/get-qml-node-info/get-qml-node-info.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: '获取QML节点信息',
5 | path: 'page/API/pages/get-qml-node-info/get-qml-node-info'
6 | }
7 | },
8 |
9 | data: {
10 | metrics: []
11 | },
12 |
13 | onReady() {
14 | this.getNodeInfo()
15 | },
16 |
17 | getNodeInfo() {
18 | const $ = qq.createSelectorQuery()
19 | const target = $.select('.target')
20 | target.boundingClientRect()
21 |
22 | $.exec((res) => {
23 | const rect = res[0]
24 | if (rect) {
25 | const metrics = []
26 | // eslint-disable-next-line
27 | for (const key in rect) {
28 | if (key !== 'id' && key !== 'dataset') {
29 | const val = rect[key]
30 | metrics.push({key, val})
31 | }
32 | }
33 |
34 | this.setData({metrics})
35 | }
36 | })
37 | }
38 |
39 | })
40 |
--------------------------------------------------------------------------------
/page/API/pages/get-qml-node-info/get-qml-node-info.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "获取QML节点信息"
3 | }
--------------------------------------------------------------------------------
/page/API/pages/get-qml-node-info/get-qml-node-info.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | Drag
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | {{ item.key }}
20 | {{ item.val }}
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/page/API/pages/get-qml-node-info/get-qml-node-info.qss:
--------------------------------------------------------------------------------
1 | movable-view {
2 | display: flex;
3 | align-items: center;
4 | justify-content: center;
5 | height: 100rpx;
6 | width: 100rpx;
7 | background: #00CAFC;
8 | color: #fff;
9 | }
10 |
11 | movable-area {
12 | height: 550rpx;
13 | width: 550rpx;
14 | background-color: #FFFFFF;
15 | overflow: hidden;
16 | }
17 |
18 | .page-section {
19 | display: flex;
20 | justify-content: center;
21 | }
22 |
23 | .page-body {
24 | display: flex;
25 | flex-direction: column;
26 | align-items: center;
27 | }
28 |
29 | .metric {
30 | display: flex;
31 | flex-direction:column;
32 | width: 550rpx;
33 | padding:0 32rpx;
34 | box-sizing:border-box;
35 | }
36 | .metric__item {
37 | flex:1;
38 | text-align:center;
39 | }
40 | .metric__txt-label {
41 | display: inline-block;
42 | width:240rpx;
43 | text-align:left;
44 | line-height:1.5;
45 | /* font-weight:bold; */
46 | font-size:34rpx;
47 | }
48 | .metric__txt {
49 | display: inline-block;
50 | width:240rpx;
51 | line-height:1.5;
52 | font-size:34rpx;
53 | text-align:right;
54 | }
55 |
--------------------------------------------------------------------------------
/page/API/pages/get-system-info/get-system-info.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: '获取手机系统信息',
5 | path: 'page/API/pages/get-system-info/get-system-info'
6 | }
7 | },
8 |
9 | data: {
10 | systemInfo: {}
11 | },
12 | getSystemInfo() {
13 | const that = this
14 | qq.getSystemInfo({
15 | success(res) {
16 | that.setData({
17 | systemInfo: res
18 | })
19 | }
20 | })
21 | }
22 | })
23 |
--------------------------------------------------------------------------------
/page/API/pages/get-system-info/get-system-info.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "获取手机系统信息"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/get-system-info/get-system-info.qss:
--------------------------------------------------------------------------------
1 | @import "../../../common/lib/qui.qss";
2 |
3 |
4 | .qui-cell__txt-label {
5 | min-width:140rpx;
6 | }
7 | .qui-cell__bd {
8 | margin-left:50rpx;
9 | }
--------------------------------------------------------------------------------
/page/API/pages/get-user-info/get-user-info.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: '获取用户信息',
5 | path: 'page/API/pages/get-user-info/get-user-info'
6 | }
7 | },
8 |
9 | data: {
10 | hasUserInfo: false
11 | },
12 | getUserInfo(info) {
13 | const userInfo = info.detail.userInfo
14 | this.setData({
15 | userInfo,
16 | hasUserInfo: true
17 | })
18 | },
19 | clear() {
20 | this.setData({
21 | hasUserInfo: false,
22 | userInfo: {}
23 | })
24 | }
25 | })
26 |
--------------------------------------------------------------------------------
/page/API/pages/get-user-info/get-user-info.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "获取用户信息"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/get-user-info/get-user-info.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | 用户信息
12 |
13 | 未获取
14 | 点击蓝色按钮可获取用户头像及昵称
15 |
16 |
17 |
18 | {{userInfo.nickName}}
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/page/API/pages/get-user-info/get-user-info.qss:
--------------------------------------------------------------------------------
1 | .info-wrap {
2 | height:488rpx;
3 | }
4 |
5 | .userinfo-avatar {
6 | border-radius: 128rpx;
7 | width: 128rpx;
8 | height: 128rpx;
9 | }
10 | .userinfo-nickname {
11 | margin-top: 20rpx;
12 | font-size: 38rpx;
13 | }
--------------------------------------------------------------------------------
/page/API/pages/gyroscope/gyroscope.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: '监听陀螺仪数据',
5 | path: 'page/API/pages/gyroscope/gyroscope'
6 | }
7 | },
8 |
9 | data: {
10 | x: 0,
11 | y: 0,
12 | z: 0,
13 | enabled: false
14 | },
15 | onLoad() {
16 | const that = this
17 | this.startGyroscope()
18 | qq.onGyroscopeChange(function (res) {
19 | that.setData({
20 | x: res.x.toFixed(2),
21 | y: res.y.toFixed(2),
22 | z: res.z.toFixed(2)
23 | })
24 | that.position.ax = Math.sin(res.x * Math.PI / 2)
25 | that.position.ay = -Math.sin(res.y * Math.PI / 2)
26 | })
27 | },
28 | startGyroscope() {
29 | if (this.data.enabled) {
30 | return
31 | }
32 | const that = this
33 | qq.startGyroscope({
34 | success() {
35 | that.setData({
36 | enabled: true
37 | })
38 | }
39 | })
40 | },
41 | stopGyroscope() {
42 | if (!this.data.enabled) {
43 | return
44 | }
45 | const that = this
46 | qq.stopGyroscope({
47 | success() {
48 | that.setData({
49 | enabled: false
50 | })
51 | }
52 | })
53 | },
54 | onUnload() {
55 | clearInterval(this.interval)
56 | }
57 | })
58 |
--------------------------------------------------------------------------------
/page/API/pages/gyroscope/gyroscope.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "监听重力感应数据"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/gyroscope/gyroscope.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | 旋转手机即可获取旋转信息
10 |
11 |
12 |
13 |
14 | X: {{x}}
15 | Y: {{y}}
16 | Z: {{z}}
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/page/API/pages/gyroscope/gyroscope.qss:
--------------------------------------------------------------------------------
1 | .page-body-xyz {
2 | display: flex;
3 | justify-content: space-between;
4 | width: 700rpx;
5 | margin-top: 90rpx;
6 | box-sizing: border-box;
7 | text-align: center;
8 | }
9 | .page-body-canvas {
10 | margin-top: 30rpx;
11 | width: 302px;
12 | height: 302px;
13 | position: relative;
14 | }
15 | .page-body-ball {
16 | position: absolute;
17 | top: 0;
18 | left: 0;
19 | width: 302px;
20 | height: 302px;
21 | }
22 | .page-body-title {
23 | margin-bottom: 0;
24 | font-size: 32rpx;
25 | width: 250rpx;
26 | }
27 | .page-body-controls {
28 | margin-top: 30rpx;
29 | }
30 | .page-body-controls button {
31 | display:inline-block;
32 | margin-left:14rpx;
33 | width:336rpx;
34 | height:78rpx;
35 | }
36 |
--------------------------------------------------------------------------------
/page/API/pages/gyroscope/image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/page/API/pages/gyroscope/image.png
--------------------------------------------------------------------------------
/page/API/pages/image/image.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "图片"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/image/image.qss:
--------------------------------------------------------------------------------
1 | @import "../../../common/lib/qui.qss";
2 |
3 |
4 | .qui-cell__txt {
5 | padding-left:48rpx;
6 | }
7 | .qui-cell__txt-tips {
8 | padding:0;
9 | }
10 |
11 | .upload-wrap {
12 | padding:44rpx 0 28rpx 0;
13 | }
14 | .upload-wrap__bd {
15 | display:flex;
16 | flex-direction:row;
17 | flex-wrap:wrap;
18 | }
19 | .upload-wrap__item {
20 | margin-right:16rpx;
21 | margin-bottom:16rpx;
22 | }
23 | .upload-wrap__item:nth-last-of-type(1) {
24 | margin-right:0;
25 | }
26 | .upload-wrap__item_default {}
27 | .upload-wrap__img {
28 | display:block;
29 | width:96rpx;
30 | height:96rpx;
31 | border-radius:8rpx;
32 | }
--------------------------------------------------------------------------------
/page/API/pages/intersection-observer/intersection-observer.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: 'QML节点布局相交状态',
5 | path: 'page/API/pages/intersection-observer/intersection-observer'
6 | }
7 | },
8 |
9 | data: {
10 | appear: false
11 | },
12 | onLoad() {
13 | this._observer = qq.createIntersectionObserver(this)
14 | this._observer
15 | .relativeTo('.scroll-view')
16 | .observe('.ball', (res) => {
17 | console.log(res)
18 | this.setData({
19 | appear: res.intersectionRatio > 0
20 | })
21 | })
22 | },
23 | onUnload() {
24 | if (this._observer) this._observer.disconnect()
25 | }
26 | })
27 |
--------------------------------------------------------------------------------
/page/API/pages/intersection-observer/intersection-observer.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "QML节点布局相交状态"
3 | }
--------------------------------------------------------------------------------
/page/API/pages/intersection-observer/intersection-observer.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | 小球出现
11 |
12 |
13 | 小球消失
14 |
15 |
16 |
17 |
18 |
19 | 向下滚动让小球出现
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/page/API/pages/intersection-observer/intersection-observer.qss:
--------------------------------------------------------------------------------
1 | .scroll-view {
2 | height: 400rpx;
3 | background: #fff;
4 | }
5 |
6 | .scroll-area {
7 | height: 1300rpx;
8 | display: flex;
9 | flex-direction: column;
10 | align-items: center;
11 | transition: .5s;
12 | }
13 |
14 | .notice {
15 | margin-top: 150rpx;
16 | }
17 |
18 | .ball {
19 | width: 200rpx;
20 | height: 200rpx;
21 | background: #00CAFC;
22 | border-radius: 50%;
23 | }
24 |
25 | .filling {
26 | height: 400rpx;
27 | }
28 |
29 |
30 | .info-wrap {
31 | background-color:transparent;
32 | }
33 | .info-wrap__txt-title {
34 | margin-bottom:0;
35 | }
--------------------------------------------------------------------------------
/page/API/pages/login/login.js:
--------------------------------------------------------------------------------
1 | const app = getApp()
2 | Page({
3 | onShareAppMessage() {
4 | return {
5 | title: 'QQ登录',
6 | path: 'page/API/pages/login/login'
7 | }
8 | },
9 |
10 | onLoad() {
11 | this.setData({
12 | hasLogin: app.globalData.hasLogin
13 | })
14 | },
15 | data: {},
16 | login() {
17 | const that = this
18 | qq.login({
19 | success() {
20 | app.globalData.hasLogin = true
21 | that.setData({
22 | hasLogin: true
23 | })
24 | }
25 | })
26 | }
27 | })
28 |
--------------------------------------------------------------------------------
/page/API/pages/login/login.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "QQ登录"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/login/login.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | 已登录
11 | 每个QQ号中仅需登录 1 次,后续每次进入页面即可根据QQ id 自动拉取用户信息
12 |
13 |
14 | 每个QQ号中仅需登录一次
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/page/API/pages/login/login.qss:
--------------------------------------------------------------------------------
1 | .page-section {
2 | margin-top: 200rpx;
3 | display: flex;
4 | flex-direction: column;
5 | align-items: center;
6 | justify-content: center;
7 | width: 100%;
8 | padding: 0 50rpx;
9 | box-sizing: border-box;
10 | }
11 | .page-body-title {
12 | font-size: 60rpx;
13 | line-height: 200rpx;
14 | }
15 | .page-body-text {
16 | color: #bbb;
17 | font-size: 28rpx;
18 | line-height: 40rpx;
19 | margin: 0 0 100rpx 0;
20 | text-align: center;
21 | }
22 | .page-body-button {
23 | width: 100%;
24 | }
25 |
26 |
27 |
28 |
29 |
30 |
31 | page {
32 | background-color:#FFF;
33 | }
--------------------------------------------------------------------------------
/page/API/pages/make-phone-call/make-phone-call.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: '打电话',
5 | path: 'page/API/pages/make-phone-call/make-phone-call'
6 | }
7 | },
8 |
9 | data: {
10 | disabled: true
11 | },
12 | bindInput(e) {
13 | this.inputValue = e.detail.value
14 |
15 | if (this.inputValue.length > 0) {
16 | this.setData({
17 | disabled: false
18 | })
19 | } else {
20 | this.setData({
21 | disabled: true
22 | })
23 | }
24 | },
25 | makePhoneCall() {
26 | qq.makePhoneCall({
27 | phoneNumber: this.inputValue,
28 | success() {
29 | console.log('成功拨打电话')
30 | }
31 | })
32 | }
33 | })
34 |
--------------------------------------------------------------------------------
/page/API/pages/make-phone-call/make-phone-call.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "打电话"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/make-phone-call/make-phone-call.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | 请在下方输入电话号码
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/page/API/pages/make-phone-call/make-phone-call.qss:
--------------------------------------------------------------------------------
1 | @import "../../../common/lib/qui.qss";
2 |
3 |
4 | .page-bd {
5 | padding:0;
6 | }
7 | button {
8 | margin:40rpx 32rpx;
9 | }
--------------------------------------------------------------------------------
/page/API/pages/modal/modal.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: '模态弹窗',
5 | path: 'page/API/pages/modal/modal'
6 | }
7 | },
8 |
9 | data: {
10 | modalHidden: true,
11 | modalHidden2: true
12 | },
13 | modalTap() {
14 | qq.showModal({
15 | title: '弹窗标题',
16 | content: '弹窗内容,告知当前状态、信息和解决方法,描述文字尽量控制在三行内',
17 | showCancel: false,
18 | confirmText: '确定'
19 | })
20 | },
21 | noTitlemodalTap() {
22 | qq.showModal({
23 | content: '弹窗内容,告知当前状态、信息和解决方法,描述文字尽量控制在三行内',
24 | confirmText: '确定',
25 | cancelText: '取消'
26 | })
27 | }
28 | })
29 |
--------------------------------------------------------------------------------
/page/API/pages/modal/modal.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "模态弹窗"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/modal/modal.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/page/API/pages/modal/modal.qss:
--------------------------------------------------------------------------------
1 | /* page/API/pages/modal/modal.qss */
2 | button {
3 | background-color:#EBEDF5;
4 | }
--------------------------------------------------------------------------------
/page/API/pages/navigate-to-miniprogram/navigate-to-miniprogram.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 |
4 | },
5 | navigateToMiniProgram() {
6 | qq.navigateToMiniProgram({
7 | appId: '1108291530',
8 | success(res) {
9 | // 打开成功
10 | }
11 | })
12 | }
13 | })
14 |
--------------------------------------------------------------------------------
/page/API/pages/navigate-to-miniprogram/navigate-to-miniprogram.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "小程序跳转"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/navigate-to-miniprogram/navigate-to-miniprogram.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/page/API/pages/navigate-to-miniprogram/navigate-to-miniprogram.qss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/page/API/pages/navigate-to-miniprogram/navigate-to-miniprogram.qss
--------------------------------------------------------------------------------
/page/API/pages/navigation-bar-loading/navigation-bar-loading.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: '标题栏加载动画',
5 | path: 'page/API/pages/navigation-bar-loading/navigation-bar-loading'
6 | }
7 | },
8 |
9 | showNavigationBarLoading() {
10 | qq.showNavigationBarLoading()
11 | },
12 | hideNavigationBarLoading() {
13 | qq.hideNavigationBarLoading()
14 | }
15 | })
16 |
--------------------------------------------------------------------------------
/page/API/pages/navigation-bar-loading/navigation-bar-loading.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "标题栏加载动画"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/navigation-bar-loading/navigation-bar-loading.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/page/API/pages/navigation-bar-loading/navigation-bar-loading.qss:
--------------------------------------------------------------------------------
1 | button {
2 | background-color:#EBEDF5;
3 | }
--------------------------------------------------------------------------------
/page/API/pages/navigator/navigator.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: '页面跳转',
5 | path: 'page/API/pages/navigator/navigator'
6 | }
7 | },
8 |
9 | navigateTo() {
10 | qq.navigateTo({url: './navigator'})
11 | },
12 |
13 | navigateBack() {
14 | qq.navigateBack()
15 | },
16 |
17 | redirectTo() {
18 | qq.redirectTo({url: './navigator'})
19 | },
20 |
21 | switchTab() {
22 | qq.switchTab({url: '/page/component/index'})
23 | },
24 |
25 | reLaunch() {
26 | qq.reLaunch({url: '/page/component/index'})
27 | }
28 | })
29 |
--------------------------------------------------------------------------------
/page/API/pages/navigator/navigator.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "页面跳转"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/navigator/navigator.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/page/API/pages/navigator/navigator.qss:
--------------------------------------------------------------------------------
1 | button {
2 | background-color:#EBEDF5;
3 | }
--------------------------------------------------------------------------------
/page/API/pages/on-accelerometer-change/on-accelerometer-change.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "监听重力感应数据"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/on-accelerometer-change/on-accelerometer-change.qss:
--------------------------------------------------------------------------------
1 | .info-wrap {
2 | padding:0;
3 | background-color:transparent;
4 | }
5 | .info-wrap__hd {
6 | padding-top:16rpx;
7 | }
8 | .info-wrap__txt-tips {
9 | line-height:1.5;
10 | font-size:28rpx;
11 | color:#B0B3BF;
12 | }
13 | .info-wrap__bd {
14 | padding-top:30rpx;
15 | }
16 | .info-wrap__canvas {
17 | position: relative;
18 | z-index: 1;
19 | width: 302px;
20 | height: 302px;
21 | }
22 | .info-wrap__canvas-ball {
23 | position: absolute;
24 | top: 0;
25 | left: 0;
26 | width: 302px;
27 | height: 302px;
28 | }
29 | .axis-wrap {
30 | display:flex;
31 | flex-direction:row;
32 | align-items:center;
33 |
34 | padding-top:70rpx;
35 | padding-bottom:30rpx;
36 | }
37 | .axis-wrap__item {
38 | flex:1;
39 | text-align:center;
40 | }
41 | .axis-wrap__txt {
42 | line-height:1.5;
43 | font-size:28rpx;
44 | color:#4A4A4A;
45 | }
46 | .info-wrap__ft {
47 | display:flex;
48 | align-items:center;
49 | }
50 |
51 | button {
52 | margin-right:14rpx;
53 | width:336rpx;
54 | height:78rpx;
55 | }
56 | button:nth-last-of-type(1) {
57 | margin-right:0;
58 | }
--------------------------------------------------------------------------------
/page/API/pages/on-compass-change/compass.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/page/API/pages/on-compass-change/compass.png
--------------------------------------------------------------------------------
/page/API/pages/on-compass-change/on-compass-change.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: '监听罗盘数据',
5 | path: 'page/API/pages/on-compass-change/on-compass-change'
6 | }
7 | },
8 |
9 | data: {
10 | enabled: true,
11 | direction: 0
12 | },
13 | onReady() {
14 | const that = this
15 | qq.onCompassChange(function (res) {
16 | that.setData({
17 | direction: parseInt(res.direction, 10)
18 | })
19 | })
20 | },
21 | startCompass() {
22 | if (this.data.enabled) {
23 | return
24 | }
25 | const that = this
26 | qq.startCompass({
27 | success() {
28 | that.setData({
29 | enabled: true
30 | })
31 | }
32 | })
33 | },
34 | stopCompass() {
35 | if (!this.data.enabled) {
36 | return
37 | }
38 | const that = this
39 | qq.stopCompass({
40 | success() {
41 | that.setData({
42 | enabled: false
43 | })
44 | }
45 | })
46 | }
47 | })
48 |
--------------------------------------------------------------------------------
/page/API/pages/on-compass-change/on-compass-change.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "监听罗盘数据"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/on-compass-change/on-compass-change.qss:
--------------------------------------------------------------------------------
1 | .info-wrap {
2 | padding:0;
3 | background-color:transparent;
4 | }
5 | .info-wrap__hd {
6 | padding-top:16rpx;
7 | }
8 | .info-wrap__txt-tips {
9 | line-height:1.5;
10 | font-size:28rpx;
11 | color:#B0B3BF;
12 | }
13 | .info-wrap__bd {
14 | padding-top:60rpx;
15 | }
16 | .direction {
17 | position: relative;
18 | display: flex;
19 | width: 540rpx;
20 | height: 540rpx;
21 | align-items: center;
22 | justify-content: center;
23 | }
24 | .direction-value {
25 | position: relative;
26 | font-size: 200rpx;
27 | color: #353535;
28 | line-height: 1;
29 | z-index: 1;
30 | }
31 | .direction-degree {
32 | position: absolute;
33 | top: 0;
34 | right: -40rpx;
35 | font-size: 60rpx;
36 | }
37 | .bg-compass{
38 | position: absolute;
39 | top: 0;
40 | left: 0;
41 | width: 540rpx;
42 | height: 540rpx;
43 | transition: .1s;
44 | }
45 | .bg-compass-line{
46 | position: absolute;
47 | left: 267rpx;
48 | top: -10rpx;
49 | width: 6rpx;
50 | height: 56rpx;
51 | background-color: #00CAFC;
52 | border-radius: 999rpx;
53 | z-index: 1;
54 | }
55 |
56 | .info-wrap__ft {
57 | display:flex;
58 | align-items:center;
59 | padding-top:80rpx;
60 | }
61 | button {
62 | margin-right:14rpx;
63 | width:336rpx;
64 | height:78rpx;
65 | }
66 | button:nth-last-of-type(1) {
67 | margin-right:0;
68 | }
--------------------------------------------------------------------------------
/page/API/pages/on-network-status-change/on-network-status-change.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: '监听手机网络变化',
5 | path: 'page/API/pages/on-network-status-change/on-network-status-change'
6 | }
7 | },
8 |
9 | data: {
10 | isConnected: false,
11 | },
12 | onLoad() {
13 | const that = this
14 | qq.onNetworkStatusChange(function (res) {
15 | that.setData({
16 | isConnected: res.isConnected,
17 | networkType: res.networkType
18 | })
19 | })
20 | },
21 | onShow() {
22 | const that = this
23 | qq.getNetworkType({
24 | success(res) {
25 | that.setData({
26 | isConnected: res.networkType !== 'none',
27 | networkType: res.networkType
28 | })
29 | }
30 | })
31 | }
32 | })
33 |
--------------------------------------------------------------------------------
/page/API/pages/on-network-status-change/on-network-status-change.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "监听手机网络变化"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/on-network-status-change/on-network-status-change.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | 网络状态
12 |
13 | 没有网络连接
14 |
15 |
16 | {{networkType}}
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/page/API/pages/on-network-status-change/on-network-status-change.qss:
--------------------------------------------------------------------------------
1 | .info-wrap {
2 | height:488rpx;
3 | }
4 | .info-wrap__txt-wifi {
5 | line-height:1.5;
6 | font-size:62rpx;
7 | color:#03081A;
8 | }
--------------------------------------------------------------------------------
/page/API/pages/page-scroll/page-scroll.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: '页面滚动',
5 | path: 'page/API/pages/page-scroll/page-scroll'
6 | }
7 | },
8 |
9 | scrollToTop() {
10 | qq.pageScrollTo({
11 | scrollTop: 0,
12 | duration: 300
13 | })
14 | },
15 |
16 | scrollToBottom() {
17 | qq.pageScrollTo({
18 | scrollTop: 3000,
19 | duration: 300
20 | })
21 | }
22 | })
23 |
--------------------------------------------------------------------------------
/page/API/pages/page-scroll/page-scroll.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "页面滚动"
3 | }
--------------------------------------------------------------------------------
/page/API/pages/page-scroll/page-scroll.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/page/API/pages/page-scroll/page-scroll.qss:
--------------------------------------------------------------------------------
1 | .rect {
2 | width: 100rpx;
3 | height: 100rpx;
4 | background-color: #ccc;
5 | }
6 |
7 | .filling-area {
8 | height: 1500rpx;
9 | }
10 |
--------------------------------------------------------------------------------
/page/API/pages/pull-down-refresh/pull-down-refresh.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: '下拉刷新',
5 | path: 'page/API/pages/pull-down-refresh/pull-down-refresh'
6 | }
7 | },
8 |
9 | onPullDownRefresh() {
10 | qq.showToast({
11 | title: '正在加载...',
12 | icon: 'loading'
13 | })
14 | console.log('onPullDownRefresh', new Date())
15 | },
16 |
17 | stopPullDownRefresh() {
18 | qq.stopPullDownRefresh({
19 | complete(res) {
20 | qq.hideToast()
21 | console.log(res, new Date())
22 | }
23 | })
24 | }
25 | })
26 |
--------------------------------------------------------------------------------
/page/API/pages/pull-down-refresh/pull-down-refresh.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "下拉刷新",
3 | "enablePullDownRefresh": true
4 | }
5 |
--------------------------------------------------------------------------------
/page/API/pages/pull-down-refresh/pull-down-refresh.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | 下滑页面即可刷新
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/page/API/pages/pull-down-refresh/pull-down-refresh.qss:
--------------------------------------------------------------------------------
1 |
2 | .btn-area{
3 | margin-top: 300rpx;
4 | }
5 |
6 |
7 |
8 | button {
9 | background-color:#EBEDF5;
10 | }
--------------------------------------------------------------------------------
/page/API/pages/request/request.js:
--------------------------------------------------------------------------------
1 | const requestUrl = require('../../../../config').requestUrl
2 |
3 | const duration = 2000
4 |
5 | Page({
6 | onShareAppMessage() {
7 | return {
8 | title: '网络请求',
9 | path: 'page/API/pages/request/request'
10 | }
11 | },
12 |
13 | makeRequest() {
14 | const self = this
15 |
16 | self.setData({
17 | loading: true
18 | })
19 |
20 | qq.request({
21 | url: requestUrl,
22 | // data: {
23 | // noncestr: Date.now()
24 | // },
25 | success(result) {
26 | qq.showToast({
27 | title: '请求成功',
28 | icon: 'success',
29 | mask: true,
30 | duration,
31 | })
32 | self.setData({
33 | loading: false
34 | })
35 | console.log('request success', result)
36 | },
37 |
38 | fail({errMsg}) {
39 | console.log('request fail', errMsg)
40 | self.setData({
41 | loading: false
42 | })
43 | }
44 | })
45 | }
46 | })
47 |
--------------------------------------------------------------------------------
/page/API/pages/request/request.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "网络请求"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/request/request.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | 点击向服务器发起请求
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/page/API/pages/request/request.qss:
--------------------------------------------------------------------------------
1 | .info-wrap {
2 | padding-top:260rpx;
3 | padding-bottom:120rpx;
4 | }
--------------------------------------------------------------------------------
/page/API/pages/scan-code/scan-code.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: '扫码',
5 | path: 'page/API/pages/scan-code/scan-code'
6 | }
7 | },
8 |
9 | data: {
10 | result: ''
11 | },
12 |
13 | scanCode() {
14 | const that = this
15 | qq.scanCode({
16 | success(res) {
17 | that.setData({
18 | result: res.result
19 | })
20 | },
21 | fail() {}
22 | })
23 | }
24 | })
25 |
--------------------------------------------------------------------------------
/page/API/pages/scan-code/scan-code.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "扫码"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/scan-code/scan-code.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | 扫码结果
12 |
13 |
14 |
15 |
16 | {{result}}
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/page/API/pages/scan-code/scan-code.qss:
--------------------------------------------------------------------------------
1 | @import "../../../common/lib/qui.qss";
2 |
3 | .page-bd {
4 | padding:0;
5 | }
6 | button {
7 | margin:40rpx 32rpx;
8 | }
--------------------------------------------------------------------------------
/page/API/pages/screen-brightness/screen-brightness.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: '屏幕亮度',
5 | path: 'page/API/pages/screen-brightness/screen-brightness'
6 | }
7 | },
8 |
9 | data: {
10 | screenBrightness: 0
11 | },
12 |
13 | onLoad() {
14 | this._updateScreenBrightness()
15 | },
16 |
17 | changeBrightness(e) {
18 | const value = Number.parseFloat(
19 | (e.detail.value).toFixed(1)
20 | )
21 | qq.setScreenBrightness({
22 | value,
23 | success: () => {
24 | this._updateScreenBrightness()
25 | }
26 | })
27 | },
28 |
29 | _updateScreenBrightness() {
30 | qq.getScreenBrightness({
31 | success: (res) => {
32 | this.setData({
33 | screenBrightness: Number.parseFloat(
34 | res.value.toFixed(1)
35 | )
36 | })
37 | },
38 | fail(err) {
39 | console.error(err)
40 | }
41 | })
42 | }
43 | })
44 |
--------------------------------------------------------------------------------
/page/API/pages/screen-brightness/screen-brightness.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "屏幕亮度"
3 | }
--------------------------------------------------------------------------------
/page/API/pages/screen-brightness/screen-brightness.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | 当前屏幕亮度
10 | {{screenBrightness}}
11 |
12 |
13 |
14 |
15 | 设置屏幕亮度
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/page/API/pages/screen-brightness/screen-brightness.qss:
--------------------------------------------------------------------------------
1 | .info-wrap {
2 | height:488rpx;
3 | }
4 | .info-wrap__txt-result {
5 | line-height:1.5;
6 | font-size:80rpx;
7 | color:#03081A;
8 | }
9 |
10 | .others-wrap {}
11 | .others-wrap__hd {
12 | padding:32rpx 32rpx 16rpx 32rpx;
13 | }
14 | .others-wrap__txt {
15 | display:inline-block;
16 | line-height:1.3;
17 | font-size:28rpx;
18 | color:#8A8E9B;
19 | }
20 | .others-wrap__bd {
21 | padding:0 24rpx;
22 | }
--------------------------------------------------------------------------------
/page/API/pages/set-navigation-bar-title/set-navigation-bar-title.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "设置页面标题"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/set-navigation-bar-title/set-navigation-bar-title.qss:
--------------------------------------------------------------------------------
1 | @import "../../../common/lib/qui.qss";
2 |
3 | .qui-cell-group__txt-title {
4 | padding:0 32rpx 8rpx 32rpx;
5 | }
6 |
7 | .color-wrap {
8 | display:flex;
9 | flex-direction:row;
10 | flex-wrap:wrap;
11 |
12 | padding:20rpx 32rpx 20rpx 32rpx;
13 | }
14 | .color-wrap__item {
15 | margin-right:56rpx;
16 | margin-bottom:20rpx;
17 | width:68rpx;
18 | height:68rpx;
19 | border-radius:14rpx;
20 | border:4rpx solid transparent;
21 | box-sizing:border-box;
22 | }
23 | .color-wrap__item:nth-last-of-type(1) {
24 | margin-right:0;
25 | }
26 | .color-wrap__item_selected {
27 | border:4rpx solid #00CAFC;
28 | }
29 | .color-wrap__txt-color-1 {
30 | background-color:#03081A;
31 | }
32 | .color-wrap__txt-color-2 {
33 | background-color:#FFF;
34 | }
35 | .color-wrap__bg-color-1 {
36 | background-color:#FF596A;
37 | }
38 | .color-wrap__bg-color-2 {
39 | background-color:#FF9F40;
40 | }
41 | .color-wrap__bg-color-3 {
42 | background-color:#FFCC00;
43 | }
44 | .color-wrap__bg-color-4 {
45 | background-color:#00D96D;
46 | }
47 | .color-wrap__bg-color-5 {
48 | background-color:#21D9C9;
49 | }
50 | .color-wrap__bg-color-6 {
51 | background-color:#C773FF;
52 | }
--------------------------------------------------------------------------------
/page/API/pages/setting/setting.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: '设置',
5 | path: 'page/API/pages/setting/setting'
6 | }
7 | },
8 |
9 | data: {
10 | setting: {}
11 | },
12 |
13 | getSetting() {
14 | qq.getSetting({
15 | success: (res) => {
16 | console.log('res', res)
17 | this.setData({setting: res.authSetting})
18 | },
19 | fail: err => {
20 | console.log('err', err)
21 | }
22 | })
23 | }
24 | })
25 |
--------------------------------------------------------------------------------
/page/API/pages/setting/setting.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "设置"
3 | }
--------------------------------------------------------------------------------
/page/API/pages/setting/setting.qss:
--------------------------------------------------------------------------------
1 | @import "../../../common/lib/qui.qss";
2 |
3 | form {
4 | margin-top: 30rpx;
5 | }
6 |
7 | .qui-cell__hd {
8 | min-width:172rpx;
9 | }
10 | .qui-cell__bd {
11 | text-align:center;
12 | }
--------------------------------------------------------------------------------
/page/API/pages/storage/storage.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "数据存储"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/storage/storage.qss:
--------------------------------------------------------------------------------
1 | @import "../../../common/lib/qui.qss";
2 |
3 |
4 | .qui-cell__txt-label {
5 | min-width:120rpx;
6 | }
--------------------------------------------------------------------------------
/page/API/pages/toast/toast.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: '消息提示框',
5 | path: 'page/API/pages/toast/toast'
6 | }
7 | },
8 |
9 | toast1Tap() {
10 | qq.showToast({
11 | title: '默认'
12 | })
13 | },
14 |
15 | toast2Tap() {
16 | qq.showToast({
17 | title: 'duration 3000',
18 | duration: 3000
19 | })
20 | },
21 |
22 | toast3Tap() {
23 | qq.showToast({
24 | title: 'loading',
25 | icon: 'loading',
26 | duration: 5000
27 | })
28 | },
29 |
30 | hideToast() {
31 | qq.hideToast()
32 | }
33 | })
34 |
--------------------------------------------------------------------------------
/page/API/pages/toast/toast.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "消息提示框"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/toast/toast.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/page/API/pages/toast/toast.qss:
--------------------------------------------------------------------------------
1 | /* page/API/pages/toast/toast.qss */
2 | button {
3 | background-color:#EBEDF5;
4 | }
--------------------------------------------------------------------------------
/page/API/pages/upload-file/upload-file.js:
--------------------------------------------------------------------------------
1 | const uploadFileUrl = require('../../../../config').uploadFileUrl
2 |
3 | Page({
4 | onShareAppMessage() {
5 | return {
6 | title: '上传文件',
7 | path: 'page/API/pages/upload-file/upload-file'
8 | }
9 | },
10 |
11 | chooseImage() {
12 | const self = this
13 |
14 | qq.chooseImage({
15 | count: 1,
16 | sizeType: ['compressed'],
17 | sourceType: ['album'],
18 | success(res) {
19 | console.log('chooseImage success, temp path is', res.tempFilePaths[0])
20 |
21 | const imageSrc = res.tempFilePaths[0]
22 |
23 | qq.uploadFile({
24 | url: uploadFileUrl,
25 | filePath: imageSrc,
26 | name: 'data',
27 | success(res) {
28 | console.log('uploadImage success, res is:', res)
29 |
30 | qq.showToast({
31 | title: '上传成功',
32 | icon: 'success',
33 | duration: 1000
34 | })
35 |
36 | self.setData({
37 | imageSrc
38 | })
39 | },
40 | fail({errMsg}) {
41 | console.log('uploadImage fail, errMsg is', errMsg)
42 | }
43 | })
44 | },
45 |
46 | fail({errMsg}) {
47 | console.log('chooseImage fail, err is', errMsg)
48 | }
49 | })
50 | }
51 | })
52 |
--------------------------------------------------------------------------------
/page/API/pages/upload-file/upload-file.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "上传文件"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/upload-file/upload-file.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | 选择图片
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/page/API/pages/upload-file/upload-file.qss:
--------------------------------------------------------------------------------
1 | .upload-wrap {
2 | width:100%;
3 | height:296rpx;
4 | background-color:#FFF;
5 | }
6 | .upload-wrap__inner {
7 | display:flex;
8 | flex-direction:column;
9 | align-items:center;
10 | justify-content:center;
11 | min-height:100%;
12 | }
13 | .upload-wrap__img {
14 | height:240rpx;
15 | }
16 | .upload-wrap__icon {
17 | display:block;
18 | margin:0 auto;
19 | width:80rpx;
20 | height:80rpx;
21 | }
22 | .upload-wrap__txt {
23 | display:inline-block;
24 | margin-top:20rpx;
25 | line-height:1.3;
26 | text-align:center;
27 | font-size:28rpx;
28 | color:#B0B3BF;
29 | }
--------------------------------------------------------------------------------
/page/API/pages/vibrate/vibrate.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: '振动',
5 | path: 'page/API/pages/vibrate/vibrate'
6 | }
7 | },
8 |
9 | vibrateShort() {
10 | qq.vibrateShort({
11 | success(res) {
12 | console.log(res)
13 | },
14 | fail(err) {
15 | console.error(err)
16 | },
17 | complete() {
18 | console.log('completed')
19 | }
20 | })
21 | },
22 |
23 | vibrateLong() {
24 | qq.vibrateLong({
25 | success(res) {
26 | console.log(res)
27 | },
28 | fail(err) {
29 | console.error(err)
30 | },
31 | complete() {
32 | console.log('completed')
33 | }
34 | })
35 | }
36 | })
37 |
--------------------------------------------------------------------------------
/page/API/pages/vibrate/vibrate.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "振动"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/vibrate/vibrate.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/page/API/pages/vibrate/vibrate.qss:
--------------------------------------------------------------------------------
1 | button {
2 | background-color:#EBEDF5;
3 | }
--------------------------------------------------------------------------------
/page/API/pages/video/video.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "拍摄/选择视频"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/video/video.qss:
--------------------------------------------------------------------------------
1 | @import "../../../common/lib/qui.qss";
2 |
3 | .qui-cell__hd {
4 | min-width:136rpx;
5 | }
6 | .qui-cell__txt {
7 | padding-left:48rpx;
8 | }
9 |
10 |
11 | .video-wrap {
12 | padding:32rpx 0;
13 | margin-top:20rpx;
14 | width:100%;
15 | min-height:296rpx;
16 | background-color:#FFF;
17 | box-sizing:border-box;
18 | }
19 | .video-wrap__inner {
20 | display:flex;
21 | flex-direction:column;
22 | align-items:center;
23 | justify-content:center;
24 | min-height:296rpx;
25 | }
26 | .video-wrap__icon {
27 | display:block;
28 | margin:0 auto;
29 | width:80rpx;
30 | height:80rpx;
31 | }
32 | .video-wrap__txt {
33 | display:inline-block;
34 | margin-top:20rpx;
35 | line-height:1.3;
36 | text-align:center;
37 | font-size:28rpx;
38 | color:#B0B3BF;
39 | }
40 |
41 | .video {
42 | height:296rpx;
43 | }
--------------------------------------------------------------------------------
/page/API/pages/voice/voice.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "录音"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/voice/voice.qss:
--------------------------------------------------------------------------------
1 | .voice-wrap {
2 | padding-top:68rpx;
3 | }
4 | .voice-wrap__hd {
5 | text-align:center;
6 | height:136rpx;
7 | }
8 | .voice-wrap__txt-title {
9 | display:block;
10 | line-height:1.5;
11 | text-align:center;
12 | font-size:62rpx;
13 | color:#03081A;
14 | }
15 | .voice-wrap__txt-desc {
16 | display:block;
17 | line-height:1.3;
18 | text-align:center;
19 | font-size:34rpx;
20 | color:#03081A;
21 | }
22 | .voice-wrap__bd {
23 | display:flex;
24 | justify-content:center;
25 | align-items:center;
26 |
27 | padding-top:52rpx;
28 | }
29 | .voice-wrap__item {
30 | margin-right:240rpx;
31 | }
32 | .voice-wrap__item:nth-last-of-type(1) {
33 | margin-right:0;
34 | }
35 | .voice-wrap__icon {
36 | display:block;
37 | margin:0 auto;
38 | width:148rpx;
39 | height:148rpx;
40 | }
--------------------------------------------------------------------------------
/page/API/pages/web-socket/web-socket.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "Web Socket"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/web-socket/web-socket.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | Socket状态
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | 消息
22 |
23 |
24 | Hello, 小程序!
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/page/API/pages/web-socket/web-socket.qss:
--------------------------------------------------------------------------------
1 | @import "../../../common/lib/qui.qss";
2 |
3 | button {
4 | margin-top:40rpx;
5 | margin-bottom:40rpx;
6 | margin-left:32rpx;
7 | margin-right:32rpx;
8 | }
--------------------------------------------------------------------------------
/page/API/pages/worker/worker.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "多线程Worker"
3 | }
4 |
--------------------------------------------------------------------------------
/page/API/pages/worker/worker.qss:
--------------------------------------------------------------------------------
1 | @import "../../../common/lib/qui.qss";
2 |
3 | .canvas-wrap {}
4 | .canvas-wrap__bd {
5 | margin:0 auto;
6 | width: 275px;
7 | height: 275px;
8 | background-color: #fff;
9 | }
10 |
11 | .qui-cell-group + .qui-cell-group {
12 | margin-top:0;
13 | }
14 | .qui-cell_input .qui-input {
15 | padding-left:0rpx;
16 | }
--------------------------------------------------------------------------------
/page/common/components/x-list/x-list.js:
--------------------------------------------------------------------------------
1 | Component({
2 | properties: {
3 | logo: {
4 | type: String,
5 | value: ''
6 | },
7 | list: {
8 | type: Array,
9 | value: []
10 | }
11 | },
12 | data: {},
13 | lifetimes: {},
14 | methods: {
15 | navigateTo(e) {
16 | qq.navigateTo({
17 | url: e.currentTarget.dataset.url
18 | })
19 | }
20 | }
21 | })
22 |
--------------------------------------------------------------------------------
/page/common/components/x-list/x-list.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
4 |
--------------------------------------------------------------------------------
/page/common/components/x-list/x-list.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | {{item.name}}
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/page/common/components/x-list/x-list.qss:
--------------------------------------------------------------------------------
1 | .x-list__hd {
2 | display: flex;
3 | justify-content: center;
4 | padding: 40rpx 0;
5 | }
6 |
7 | .x-list__logo {
8 | width: 88rpx;
9 | height: 88rpx;
10 | }
11 |
12 | .x-list__item {
13 | position: relative;
14 | display: flex;
15 | align-items: center;
16 | height: 112rpx;
17 | margin-left: 32rpx;
18 | font-size: 34rpx;
19 | text-indent: 30rpx;
20 | border-bottom: 1rpx solid #eaedf6;
21 | }
22 | .x-list__item.new:after {
23 | content: 'NEW';
24 | display: block;
25 | width: 60rpx;
26 | height: 32rpx;
27 | position: absolute;
28 | top: 40rpx;
29 | right: 60rpx;
30 | color: #ffffff;
31 | font-size: 22rpx;
32 | line-height: 32rpx;
33 | text-align: center;
34 | text-indent: 0rpx;
35 | background-color: #ef1b1b;
36 | border-radius: 6rpx;
37 | }
38 | .x-list__item-more {
39 | display: block;
40 | position: absolute;
41 | top:50%;
42 | right: 24rpx;
43 | z-index: 12;
44 | width: 32rpx;
45 | height: 32rpx;
46 | transform:translateY(-50%);
47 | }
48 |
--------------------------------------------------------------------------------
/page/common/foot.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | QQ小程序示例
5 |
6 |
--------------------------------------------------------------------------------
/page/common/head.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{title}}
4 |
5 | {{desc}}
6 |
7 |
8 |
--------------------------------------------------------------------------------
/page/component/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "小程序官方组件展示"
3 | }
4 |
--------------------------------------------------------------------------------
/page/component/index.qss:
--------------------------------------------------------------------------------
1 | @import "../common/index.qss";
2 |
3 | page {
4 | background-color: #F5F6FA !important;
5 | }
--------------------------------------------------------------------------------
/page/component/pages/button/button.js:
--------------------------------------------------------------------------------
1 | const types = ['default', 'primary', 'warn']
2 | const pageObject = {
3 | data: {
4 | defaultSize: 'default',
5 | primarySize: 'default',
6 | warnSize: 'default',
7 | disabled: false,
8 | plain: false,
9 | loading: false
10 | },
11 |
12 | onShareAppMessage() {
13 | return {
14 | title: 'button',
15 | path: 'page/component/pages/button/button'
16 | }
17 | },
18 |
19 | setDisabled() {
20 | this.setData({
21 | disabled: !this.data.disabled
22 | })
23 | },
24 |
25 | setPlain() {
26 | this.setData({
27 | plain: !this.data.plain
28 | })
29 | },
30 |
31 | setLoading() {
32 | this.setData({
33 | loading: !this.data.loading
34 | })
35 | }
36 | }
37 |
38 | for (let i = 0; i < types.length; ++i) {
39 | (function (type) {
40 | pageObject[type] = function () {
41 | const key = type + 'Size'
42 | const changedData = {}
43 | changedData[key] =
44 | this.data[key] === 'default' ? 'mini' : 'default'
45 | this.setData(changedData)
46 | }
47 | }(types[i]))
48 | }
49 |
50 | Page(pageObject)
51 |
--------------------------------------------------------------------------------
/page/component/pages/button/button.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "button"
3 | }
4 |
--------------------------------------------------------------------------------
/page/component/pages/button/button.qss:
--------------------------------------------------------------------------------
1 | button{
2 | margin-top: 30rpx;
3 | margin-bottom: 30rpx;
4 | }
5 | .button-sp-area{
6 | margin: 0 auto;
7 | width: 60%;
8 | }
9 | .mini-btn{
10 | margin-right: 10rpx;
11 | }
--------------------------------------------------------------------------------
/page/component/pages/camera/camera.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: 'camera',
5 | path: 'page/component/pages/camera/camera'
6 | }
7 | },
8 |
9 | data: {
10 | src: '',
11 | videoSrc: '',
12 | position: 'back',
13 | mode: 'scanCode',
14 | result: {}
15 | },
16 | onLoad() {
17 | this.ctx = qq.createCameraContext()
18 | },
19 | takePhoto() {
20 | this.ctx.takePhoto({
21 | quality: 'high',
22 | success: (res) => {
23 | this.setData({
24 | src: res.tempImagePath
25 | })
26 | }
27 | })
28 | },
29 | startRecord() {
30 | this.ctx.startRecord({
31 | success: () => {
32 | console.log('startRecord')
33 | }
34 | })
35 | },
36 | stopRecord() {
37 | this.ctx.stopRecord({
38 | success: (res) => {
39 | this.setData({
40 | src: res.tempThumbPath,
41 | videoSrc: res.tempVideoPath
42 | })
43 | }
44 | })
45 | },
46 | togglePosition() {
47 | this.setData({
48 | position: this.data.position === 'front'
49 | ? 'back' : 'front'
50 | })
51 | },
52 | error(e) {
53 | console.log(e.detail)
54 | }
55 | })
56 |
--------------------------------------------------------------------------------
/page/component/pages/camera/camera.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "camera"
3 | }
--------------------------------------------------------------------------------
/page/component/pages/camera/camera.qss:
--------------------------------------------------------------------------------
1 | @import "../../../common/lib/qui.qss";
2 |
3 | camera {
4 | height: 500rpx;
5 | }
6 | .camera-wrap {
7 | display:flex;
8 | flex-direction:column;
9 | align-items:center;
10 | width:100%;
11 | }
12 | .preview-tips {
13 | margin: 20rpx 0;
14 | }
15 |
16 | .photo, .video {
17 | margin-top: 40rpx;
18 | width: 100%;
19 | }
20 |
21 |
22 | .first-btn {
23 | margin-top: 40rpx;
24 | }
25 |
26 | form {
27 | margin-top: 30rpx;
28 | }
29 | button {
30 | margin-top:0;
31 | margin-bottom:0;
32 | }
33 | .btn-area {
34 | margin-top:20rpx;
35 | }
--------------------------------------------------------------------------------
/page/component/pages/canvas/canvas.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "canvas"
3 | }
4 |
--------------------------------------------------------------------------------
/page/component/pages/canvas/canvas.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/page/component/pages/canvas/canvas.qss:
--------------------------------------------------------------------------------
1 | .canvas {
2 | width: 305px;
3 | height: 305px;
4 | background-color: #fff;
5 | }
6 |
--------------------------------------------------------------------------------
/page/component/pages/checkbox/checkbox.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: 'checkbox',
5 | path: 'page/component/pages/checkbox/checkbox'
6 | }
7 | },
8 |
9 | data: {
10 | items: [
11 | {value: 'USA', name: '美国'},
12 | {value: 'CHN', name: '中国', checked: 'true'},
13 | {value: 'BRA', name: '巴西'},
14 | {value: 'JPN', name: '日本'},
15 | {value: 'ENG', name: '英国'},
16 | {value: 'FRA', name: '法国'}
17 | ]
18 | },
19 |
20 | checkboxChange(e) {
21 | console.log('checkbox发生change事件,携带value值为:', e.detail.value)
22 |
23 | const items = this.data.items
24 | const values = e.detail.value
25 | for (let i = 0, lenI = items.length; i < lenI; ++i) {
26 | items[i].checked = false
27 |
28 | for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
29 | if (items[i].value === values[j]) {
30 | items[i].checked = true
31 | break
32 | }
33 | }
34 | }
35 |
36 | this.setData({
37 | items
38 | })
39 | }
40 | })
41 |
--------------------------------------------------------------------------------
/page/component/pages/checkbox/checkbox.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "checkbox"
3 | }
4 |
--------------------------------------------------------------------------------
/page/component/pages/checkbox/checkbox.qss:
--------------------------------------------------------------------------------
1 | @import "../../../common/lib/qui.qss";
2 |
3 |
4 | .checkbox-wrap {
5 | margin-bottom:60rpx;
6 | }
7 | .checkbox-wrap__hd {
8 | position: relative;
9 | z-index:1;
10 |
11 | margin:0 32rpx;
12 | }
13 | .checkbox-wrap__txt-title {
14 | display:inline-block;
15 | line-height:1.5;
16 | font-size:28rpx;
17 | color:#8A8E9B;
18 | }
19 | .checkbox-wrap__bd {
20 | margin-top:28rpx;
21 | padding:0 32rpx;
22 | }
23 | .checkbox-wrap__label {
24 | display:inline-block;
25 | margin-right:40rpx;
26 | line-height:1.5;
27 | font-size:28rpx;
28 | color:#03081A;
29 | }
30 |
--------------------------------------------------------------------------------
/page/component/pages/cover-view/cover-view.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: 'cover-view',
5 | path: 'page/component/pages/cover-view/cover-view'
6 | }
7 | },
8 |
9 | data: {
10 | latitude: 23.099994,
11 | longitude: 113.324520,
12 | }
13 | })
14 |
--------------------------------------------------------------------------------
/page/component/pages/cover-view/cover-view.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "cover-view"
3 | }
--------------------------------------------------------------------------------
/page/component/pages/cover-view/cover-view.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/page/component/pages/cover-view/cover-view.qss:
--------------------------------------------------------------------------------
1 | .cover-view {
2 | position: absolute;
3 | top: 50%;
4 | left: 50%;
5 | transform: translate(-50%, -50%);
6 | }
7 |
8 | .page-section-gap {
9 | padding: 0 75rpx;
10 | }
11 |
12 | .flex-wrp {
13 | display:flex;
14 | }
15 |
16 | .flex-item {
17 | width: 160rpx;
18 | height: 232rpx;
19 | font-size: 26rpx;
20 | }
21 |
22 | .demo-text-1 {
23 | background: rgba(0, 202, 252 0.8);
24 | }
25 |
26 | .demo-text-2 {
27 | background: rgba(176, 179, 191, 0.8);
28 | }
29 |
30 | .demo-text-3 {
31 | background: rgba(255, 255, 255, 0.8);
32 | }
--------------------------------------------------------------------------------
/page/component/pages/editor/editor.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: 'editor',
5 | path: 'page/component/pages/editor/editor'
6 | }
7 | }
8 | })
9 |
--------------------------------------------------------------------------------
/page/component/pages/editor/editor.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "editor"
3 | }
4 |
--------------------------------------------------------------------------------
/page/component/pages/editor/editor.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/page/component/pages/editor/editor.qss:
--------------------------------------------------------------------------------
1 | .editor-container {
2 | padding: 10rpx 25rpx;
3 | background-color: #fff;
4 | height: 80%;
5 | }
--------------------------------------------------------------------------------
/page/component/pages/form/form.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: 'form',
5 | path: 'page/component/pages/form/form'
6 | }
7 | },
8 |
9 | data: {
10 | pickerHidden: true,
11 | chosen: ''
12 | },
13 |
14 | pickerConfirm(e) {
15 | this.setData({
16 | pickerHidden: true
17 | })
18 | this.setData({
19 | chosen: e.detail.value
20 | })
21 | },
22 |
23 | pickerCancel() {
24 | this.setData({
25 | pickerHidden: true
26 | })
27 | },
28 |
29 | pickerShow() {
30 | this.setData({
31 | pickerHidden: false
32 | })
33 | },
34 |
35 | formSubmit(e) {
36 | console.log('form发生了submit事件,携带数据为:', e.detail.value)
37 | },
38 |
39 | formReset(e) {
40 | console.log('form发生了reset事件,携带数据为:', e.detail.value)
41 | this.setData({
42 | chosen: ''
43 | })
44 | }
45 | })
46 |
--------------------------------------------------------------------------------
/page/component/pages/form/form.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "form"
3 | }
4 |
--------------------------------------------------------------------------------
/page/component/pages/form/form.qss:
--------------------------------------------------------------------------------
1 | @import "../../../common/lib/qui.qss";
2 |
3 | .checkbox-wrap {
4 | margin-bottom:60rpx;
5 | }
6 | .checkbox-wrap__hd {
7 | position: relative;
8 | z-index:1;
9 |
10 | margin:0 32rpx;
11 | }
12 | .checkbox-wrap__txt-title {
13 | display:inline-block;
14 | line-height:1.5;
15 | font-size:28rpx;
16 | color:#8A8E9B;
17 | }
18 | .checkbox-wrap__bd {
19 | margin-top:28rpx;
20 | padding:0 32rpx;
21 | }
22 | .checkbox-wrap__label {
23 | display:inline-block;
24 | margin-right:40rpx;
25 | line-height:1.5;
26 | font-size:28rpx;
27 | color:#03081A;
28 | }
--------------------------------------------------------------------------------
/page/component/pages/icon/icon.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: 'icon',
5 | path: 'page/component/pages/icon/icon'
6 | }
7 | },
8 | })
9 |
--------------------------------------------------------------------------------
/page/component/pages/icon/icon.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "icon"
3 | }
4 |
--------------------------------------------------------------------------------
/page/component/pages/icon/icon.qss:
--------------------------------------------------------------------------------
1 | .icon-box{
2 | margin-bottom: 40rpx;
3 | padding: 0 75rpx;
4 | display: flex;
5 | align-items: center;
6 | }
7 | .icon-box-img{
8 | margin-right: 46rpx;
9 | }
10 | .icon-box-ctn{
11 | flex-shrink: 100;
12 | }
13 | .icon-box-title{
14 | font-size: 34rpx;
15 | }
16 | .icon-box-desc{
17 | margin-top: 12rpx;
18 | font-size: 26rpx;
19 | color: #888;
20 | }
21 |
22 | .icon-small-wrp{
23 | margin-right: 46rpx;
24 | width: 93px;
25 | height: 93px;
26 | display: flex;
27 | align-items: center;
28 | justify-content: center;
29 | }
--------------------------------------------------------------------------------
/page/component/pages/image/image.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: 'image',
5 | path: 'page/component/pages/image/image'
6 | }
7 | },
8 |
9 | })
10 |
--------------------------------------------------------------------------------
/page/component/pages/image/image.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "image"
3 | }
4 |
--------------------------------------------------------------------------------
/page/component/pages/image/image.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Local Image
10 |
11 |
12 |
13 |
14 |
15 | Internet Image
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/page/component/pages/image/image.qss:
--------------------------------------------------------------------------------
1 | .page-section-ctn {
2 | text-align: center;
3 | }
4 |
5 | .image {
6 | margin-top: 30rpx;
7 | width: 580rpx;
8 | height: 208rpx;
9 | }
--------------------------------------------------------------------------------
/page/component/pages/input/input.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: 'input',
5 | path: 'page/component/pages/input/input'
6 | }
7 | },
8 |
9 | data: {
10 | focus: false,
11 | inputValue: ''
12 | },
13 |
14 | bindKeyInput(e) {
15 | this.setData({
16 | inputValue: e.detail.value
17 | })
18 | },
19 |
20 | bindReplaceInput(e) {
21 | const value = e.detail.value
22 | let pos = e.detail.cursor
23 | let left
24 | if (pos !== -1) {
25 | // 光标在中间
26 | left = e.detail.value.slice(0, pos)
27 | // 计算光标的位置
28 | pos = left.replace(/11/g, '2').length
29 | }
30 |
31 | // 直接返回对象,可以对输入进行过滤处理,同时可以控制光标的位置
32 | return {
33 | value: value.replace(/11/g, '2'),
34 | cursor: pos
35 | }
36 |
37 | // 或者直接返回字符串,光标在最后边
38 | // return value.replace(/11/g,'2'),
39 | },
40 |
41 | bindHideKeyboard(e) {
42 | if (e.detail.value === '123') {
43 | // 收起键盘
44 | qq.hideKeyboard()
45 | }
46 | }
47 | })
48 |
--------------------------------------------------------------------------------
/page/component/pages/input/input.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "input"
3 | }
4 |
--------------------------------------------------------------------------------
/page/component/pages/input/input.qss:
--------------------------------------------------------------------------------
1 | @import "../../../common/lib/qui.qss";
2 |
3 |
4 | .qui-cell-group__txt-title {
5 | padding:4rpx 32rpx 8rpx 32rpx;
6 | }
--------------------------------------------------------------------------------
/page/component/pages/label/label.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "label"
3 | }
4 |
--------------------------------------------------------------------------------
/page/component/pages/label/label.qss:
--------------------------------------------------------------------------------
1 | .checkbox-wrap {
2 | margin-bottom:60rpx;
3 | }
4 | .checkbox-wrap_1 {}
5 | .checkbox-wrap_1 .checkbox-wrap__label {
6 | display:block;
7 | }
8 | .checkbox-wrap_2 {}
9 | .checkbox-wrap_2 .checkbox-wrap__label {
10 | display:inline-block;
11 | }
12 | .checkbox-wrap_3 {}
13 | .checkbox-wrap_3 .checkbox-wrap__label-txt {
14 | display:block;
15 | line-height:1.5;
16 | font-size:28rpx;
17 | color:#4D94FF;
18 | }
19 | .checkbox-wrap__hd {
20 | position: relative;
21 | z-index:1;
22 |
23 | margin:0 32rpx;
24 | }
25 | .checkbox-wrap__txt-title {
26 | display:inline-block;
27 | line-height:1.5;
28 | font-size:28rpx;
29 | color:#8A8E9B;
30 | }
31 | .checkbox-wrap__bd {
32 | margin-top:28rpx;
33 | padding:0 32rpx;
34 | }
35 | .checkbox-wrap__label {
36 | display:block;
37 | margin-bottom:40rpx;
38 | margin-right:40rpx;
39 | line-height:1.5;
40 | font-size:28rpx;
41 | color:#03081A;
42 | }
43 | .checkbox-wrap__label-item {
44 | display:block;
45 | margin-bottom:20rpx;
46 | }
--------------------------------------------------------------------------------
/page/component/pages/movable-view/movable-view.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: 'movable-view',
5 | path: 'page/component/pages/movable-view/movable-view'
6 | }
7 | },
8 |
9 | data: {
10 | x: 0,
11 | y: 0,
12 | scale: 2,
13 | },
14 |
15 | tap() {
16 | this.setData({
17 | x: 30,
18 | y: 30
19 | })
20 | },
21 |
22 | tap2() {
23 | this.setData({
24 | scale: 3
25 | })
26 | },
27 |
28 | onChange(e) {
29 | console.log(e.detail)
30 | },
31 |
32 | onScale(e) {
33 | console.log(e.detail)
34 | }
35 | })
36 |
--------------------------------------------------------------------------------
/page/component/pages/movable-view/movable-view.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "movable-view"
3 | }
--------------------------------------------------------------------------------
/page/component/pages/movable-view/movable-view.qss:
--------------------------------------------------------------------------------
1 | movable-view {
2 | display: flex;
3 | align-items: center;
4 | justify-content: center;
5 | height: 100rpx;
6 | width: 100rpx;
7 | background: #00CAFC;
8 | color: #fff;
9 | }
10 |
11 | movable-area {
12 | width: 622rpx;
13 | height: 310rpx;
14 | margin: 32rpx auto 0;
15 | background-color: #EBEDF5;
16 | overflow: hidden;
17 | }
18 |
19 | .max {
20 | width: 800rpx;
21 | height: 500rpx;
22 | }
23 |
24 | .page-section {
25 | width: 100%;
26 | }
27 |
28 | .page-section-title {
29 | margin-top: 100rpx;
30 | margin-bottom: -8rpx;
31 | }
32 |
33 | .page-section-title.first {
34 | margin-top: 0;
35 | }
36 |
37 | .btn-area {
38 | margin-top: -76rpx;
39 | }
40 |
--------------------------------------------------------------------------------
/page/component/pages/navigator/navigate.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: 'navigatePage',
5 | path: 'page/component/pages/navigator/navigate'
6 | }
7 | },
8 |
9 | onLoad(options) {
10 | console.log(options)
11 | this.setData({
12 | title: options.title
13 | })
14 | }
15 | })
16 |
--------------------------------------------------------------------------------
/page/component/pages/navigator/navigate.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "navigatePage"
3 | }
4 |
--------------------------------------------------------------------------------
/page/component/pages/navigator/navigate.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/page/component/pages/navigator/navigate.qss:
--------------------------------------------------------------------------------
1 | /* page/component/pages/navigator/navigate.qss */
--------------------------------------------------------------------------------
/page/component/pages/navigator/navigator.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: 'navigator',
5 | path: 'page/component/pages/navigator/navigator'
6 | }
7 | }
8 | })
9 |
--------------------------------------------------------------------------------
/page/component/pages/navigator/navigator.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "navigator"
3 | }
4 |
--------------------------------------------------------------------------------
/page/component/pages/navigator/navigator.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/page/component/pages/navigator/navigator.qss:
--------------------------------------------------------------------------------
1 | /* .navigator-hover button{
2 | background-color: #DEDEDE;
3 | }
4 | .other-navigator-hover button{
5 | background-color: #DEDEDE;
6 | } */
7 |
8 | button {
9 | background-color:#EBEDF5;
10 | }
--------------------------------------------------------------------------------
/page/component/pages/navigator/redirect.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: 'redirectPage',
5 | path: 'page/component/pages/navigator/redirect'
6 | }
7 | },
8 |
9 | onLoad(options) {
10 | console.log(options)
11 | this.setData({
12 | title: options.title
13 | })
14 | }
15 | })
16 |
--------------------------------------------------------------------------------
/page/component/pages/navigator/redirect.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "redirectPage"
3 | }
4 |
--------------------------------------------------------------------------------
/page/component/pages/navigator/redirect.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/page/component/pages/navigator/redirect.qss:
--------------------------------------------------------------------------------
1 | /* page/component/pages/navigator/redirect.qss */
--------------------------------------------------------------------------------
/page/component/pages/open-data/open-data.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: 'open-data',
5 | path: 'page/component/pages/open-data/open-data'
6 | }
7 | },
8 | })
9 |
--------------------------------------------------------------------------------
/page/component/pages/open-data/open-data.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "open-data"
3 | }
--------------------------------------------------------------------------------
/page/component/pages/open-data/open-data.qss:
--------------------------------------------------------------------------------
1 | @import "../../../common/lib/qui.qss";
2 |
3 | .avatar {
4 | display: flex;
5 | justify-content: center;
6 | margin-bottom: 40rpx;
7 | }
8 |
9 | .avatar-img {
10 | width: 50%;
11 | border-radius: 50%;
12 | }
13 |
14 | .country, .province, .city {
15 | padding-right: 10rpx;
16 | }
17 |
18 |
19 |
20 | .qui-cell__bd {
21 | padding-left:52rpx;
22 | }
--------------------------------------------------------------------------------
/page/component/pages/picker-view/picker-view.js:
--------------------------------------------------------------------------------
1 | const date = new Date()
2 | const years = []
3 | const months = []
4 | const days = []
5 |
6 | for (let i = 1990; i <= date.getFullYear(); i++) {
7 | years.push(i)
8 | }
9 |
10 | for (let i = 1; i <= 12; i++) {
11 | months.push(i)
12 | }
13 |
14 | for (let i = 1; i <= 31; i++) {
15 | days.push(i)
16 | }
17 |
18 | Page({
19 | onShareAppMessage() {
20 | return {
21 | title: 'picker-view',
22 | path: 'page/component/pages/picker-view/picker-view'
23 | }
24 | },
25 |
26 | data: {
27 | years,
28 | year: date.getFullYear(),
29 | months,
30 | month: 2,
31 | days,
32 | day: 2,
33 | value: [9999, 1, 1],
34 | isDaytime: true,
35 | },
36 |
37 | bindChange(e) {
38 | const val = e.detail.value
39 | this.setData({
40 | year: this.data.years[val[0]],
41 | month: this.data.months[val[1]],
42 | day: this.data.days[val[2]],
43 | isDaytime: !val[3]
44 | })
45 | }
46 | })
47 |
--------------------------------------------------------------------------------
/page/component/pages/picker-view/picker-view.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "picker-view"
3 | }
4 |
--------------------------------------------------------------------------------
/page/component/pages/picker-view/picker-view.qss:
--------------------------------------------------------------------------------
1 | .selected-date {
2 | text-align: center;
3 | margin: 30rpx;
4 | }
5 |
6 | .icon-container {
7 | display: flex;
8 | flex-direction: column;
9 | justify-content: center;
10 | align-items: center;
11 | }
12 |
13 | .picker-icon {
14 | width: 50rpx;
15 | height: 50rpx;
16 | }
--------------------------------------------------------------------------------
/page/component/pages/picker/picker.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "picker"
3 | }
4 |
--------------------------------------------------------------------------------
/page/component/pages/picker/picker.qss:
--------------------------------------------------------------------------------
1 | /* @import "../../../common/lib/weui.qss"; */
2 |
3 | .picker-wrap {
4 | flex: 1;
5 | }
6 |
7 | .section__title {
8 | margin: 32rpx 32rpx 16rpx 32rpx;
9 | font-size: 28rpx;
10 | color: #878B99;
11 | }
12 |
13 | .picker {
14 | display: flex;
15 | align-items: center;
16 | height: 112rpx;
17 | padding: 0 32rpx;
18 | font-size: 34rpx;
19 | color: #03081A;
20 | background-color: #fff;
21 | overflow: hidden;
22 | }
23 |
24 | .picker-label {
25 | margin-right: 48rpx;
26 | flex-shrink: 0;
27 | }
28 |
29 | .picker-value {
30 | flex: 1;
31 | text-align: justify;
32 | white-space: nowrap;
33 | -webkit-line-clamp: 1;
34 | -webkit-box-orient: vertical;
35 | text-overflow: ellipsis;
36 | overflow: hidden;
37 | }
38 |
--------------------------------------------------------------------------------
/page/component/pages/progress/progress.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: 'progress',
5 | path: 'page/component/pages/progress/progress'
6 | }
7 | },
8 | })
9 |
--------------------------------------------------------------------------------
/page/component/pages/progress/progress.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "progress"
3 | }
4 |
--------------------------------------------------------------------------------
/page/component/pages/progress/progress.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/page/component/pages/progress/progress.qss:
--------------------------------------------------------------------------------
1 | progress{
2 | width: 100%;
3 | }
4 | .progress-box{
5 | display: flex;
6 | height: 50rpx;
7 | margin-bottom: 60rpx;
8 | }
9 | .progress-cancel{
10 | margin-left: 40rpx;
11 | }
--------------------------------------------------------------------------------
/page/component/pages/radio/radio.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: 'radio',
5 | path: 'page/component/pages/radio/radio'
6 | }
7 | },
8 |
9 | data: {
10 | items: [
11 | {value: 'USA', name: '美国'},
12 | {value: 'CHN', name: '中国', checked: 'true'},
13 | {value: 'BRA', name: '巴西'},
14 | {value: 'JPN', name: '日本'},
15 | {value: 'ENG', name: '英国'},
16 | {value: 'FRA', name: '法国'},
17 | ]
18 | },
19 |
20 | radioChange(e) {
21 | console.log('radio发生change事件,携带value值为:', e.detail.value)
22 |
23 | const items = this.data.items
24 | for (let i = 0, len = items.length; i < len; ++i) {
25 | items[i].checked = items[i].value === e.detail.value
26 | }
27 |
28 | this.setData({
29 | items
30 | })
31 | }
32 | })
33 |
--------------------------------------------------------------------------------
/page/component/pages/radio/radio.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "radio"
3 | }
4 |
--------------------------------------------------------------------------------
/page/component/pages/radio/radio.qss:
--------------------------------------------------------------------------------
1 | @import "../../../common/lib/qui.qss";
2 |
3 | .checkbox-wrap {
4 | margin-bottom:60rpx;
5 | }
6 | .checkbox-wrap__hd {
7 | position: relative;
8 | z-index:1;
9 |
10 | margin:0 32rpx;
11 | }
12 | .checkbox-wrap__txt-title {
13 | display:inline-block;
14 | line-height:1.5;
15 | font-size:28rpx;
16 | color:#8A8E9B;
17 | }
18 | .checkbox-wrap__bd {
19 | margin-top:28rpx;
20 | padding:0 32rpx;
21 | }
22 | .checkbox-wrap__label {
23 | display:inline-block;
24 | margin-right:40rpx;
25 | line-height:1.5;
26 | font-size:28rpx;
27 | color:#03081A;
28 | }
29 |
--------------------------------------------------------------------------------
/page/component/pages/rich-text/rich-text.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "rich-text"
3 | }
--------------------------------------------------------------------------------
/page/component/pages/rich-text/rich-text.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | 通过 HTML String 渲染
12 |
13 |
14 | {{htmlSnip}}
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | 通过节点渲染
27 |
28 |
29 | {{nodeSnip}}
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/page/component/pages/rich-text/rich-text.qss:
--------------------------------------------------------------------------------
1 | scroll-view {
2 | height: 523rpx;
3 | white-space: pre;
4 | padding: 10rpx;
5 | box-sizing: border-box;
6 | background: #fff;
7 | }
8 |
9 | button {
10 | margin-top: 40rpx;
11 | margin-bottom: 0;
12 | }
13 |
14 |
15 | .code-wrap {}
16 | .code-wrap__hd {
17 | margin:4rpx 32rpx 8rpx 32rpx;
18 | }
19 | .code-wrap__txt-title {
20 | display:inline-block;
21 | line-height:1.5;
22 | font-size:28rpx;
23 | color:#8A8E9B;
24 | }
25 | .code-wrap__bd {
26 | margin-bottom:60rpx;
27 | padding:0 32rpx;
28 | }
29 | .code-wrap__ft {}
30 | .code-wrap__txt-result {
31 | padding-top:20rpx;
32 | }
--------------------------------------------------------------------------------
/page/component/pages/scroll-view/scroll-view.js:
--------------------------------------------------------------------------------
1 | const order = ['demo1', 'demo2', 'demo3']
2 |
3 | Page({
4 | onShareAppMessage() {
5 | return {
6 | title: 'scroll-view',
7 | path: 'page/component/pages/scroll-view/scroll-view'
8 | }
9 | },
10 |
11 | data: {
12 | toView: 'green'
13 | },
14 |
15 | upper(e) {
16 | console.log(e)
17 | },
18 |
19 | lower(e) {
20 | console.log(e)
21 | },
22 |
23 | scroll(e) {
24 | console.log(e)
25 | },
26 |
27 | scrollToTop() {
28 | this.setAction({
29 | scrollTop: 0
30 | })
31 | },
32 |
33 | tap() {
34 | for (let i = 0; i < order.length; ++i) {
35 | if (order[i] === this.data.toView) {
36 | this.setData({
37 | toView: order[i + 1],
38 | scrollTop: (i + 1) * 200
39 | })
40 | break
41 | }
42 | }
43 | },
44 |
45 | tapMove() {
46 | this.setData({
47 | scrollTop: this.data.scrollTop + 10
48 | })
49 | }
50 | })
51 |
--------------------------------------------------------------------------------
/page/component/pages/scroll-view/scroll-view.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "scroll-view"
3 | }
4 |
--------------------------------------------------------------------------------
/page/component/pages/scroll-view/scroll-view.qss:
--------------------------------------------------------------------------------
1 | .page-section-spacing{
2 | margin-top: 60rpx;
3 | }
4 | .scroll-view_H{
5 | white-space: nowrap;
6 | }
7 | .scroll-view-item{
8 | height: 300rpx;
9 | }
10 | .scroll-view-item_H{
11 | display: inline-block;
12 | width: 100%;
13 | height: 300rpx;
14 | }
15 |
--------------------------------------------------------------------------------
/page/component/pages/slider/slider.js:
--------------------------------------------------------------------------------
1 | const pageData = {
2 | onShareAppMessage() {
3 | return {
4 | title: 'slider',
5 | path: 'page/component/pages/slider/slider'
6 | }
7 | },
8 | }
9 |
10 | for (let i = 1; i < 5; ++i) {
11 | (function (index) {
12 | pageData['slider' + index + 'change'] = function (e) {
13 | console.log('slider' + index + '发生change事件,携带值为', e.detail.value)
14 | }
15 | }(i))
16 | }
17 |
18 | Page(pageData)
19 |
--------------------------------------------------------------------------------
/page/component/pages/slider/slider.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "slider"
3 | }
4 |
--------------------------------------------------------------------------------
/page/component/pages/slider/slider.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | 设置step
10 |
11 |
12 |
13 |
14 |
15 |
16 | 显示当前value
17 |
18 |
19 |
20 |
21 |
22 |
23 | 设置最小/最大值
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/page/component/pages/slider/slider.qss:
--------------------------------------------------------------------------------
1 | /* page/component/pages/slider/slider.qss */
--------------------------------------------------------------------------------
/page/component/pages/swiper/swiper.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: 'swiper',
5 | path: 'page/component/pages/swiper/swiper'
6 | }
7 | },
8 |
9 | data: {
10 | background: ['demo-text-1', 'demo-text-2', 'demo-text-3'],
11 | indicatorDots: true,
12 | vertical: false,
13 | autoplay: false,
14 | interval: 2000,
15 | duration: 500
16 | },
17 |
18 | changeIndicatorDots() {
19 | this.setData({
20 | indicatorDots: !this.data.indicatorDots
21 | })
22 | },
23 |
24 | changeAutoplay() {
25 | this.setData({
26 | autoplay: !this.data.autoplay
27 | })
28 | },
29 |
30 | intervalChange(e) {
31 | this.setData({
32 | interval: e.detail.value
33 | })
34 | },
35 |
36 | durationChange(e) {
37 | this.setData({
38 | duration: e.detail.value
39 | })
40 | }
41 | })
42 |
--------------------------------------------------------------------------------
/page/component/pages/swiper/swiper.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "swiper"
3 | }
4 |
--------------------------------------------------------------------------------
/page/component/pages/swiper/swiper.qss:
--------------------------------------------------------------------------------
1 | @import "../../../common/lib/qui.qss";
2 |
3 |
4 |
5 | .swiper-wrap {
6 | margin-bottom:40rpx;
7 | padding:0 60rpx;
8 | }
9 | swiper {
10 | height:140px;
11 | }
12 | .swiper-wrap__item {
13 | display: block;
14 | height: 140px;
15 | }
16 |
17 |
18 | .options-wrap {
19 | padding-bottom:40rpx;
20 | }
21 | .options-wrap__hd {
22 | position:relative;
23 | z-index:1;
24 |
25 | margin:32rpx 32rpx 20rpx 32rpx;
26 | }
27 | .options-wrap__txt-title {
28 | display:inline-block;
29 | line-height:1.5;
30 | font-size:28rpx;
31 | color:#8A8E9B;
32 | }
33 | .options-wrap__txt-time {
34 | position:absolute;
35 | top:50%;
36 | right:0;
37 | z-index:8;
38 | display:inline-block;
39 | line-height:1.5;
40 | font-size:28rpx;
41 | color:#8A8E9B;
42 | transform:translateY(-50%);
43 | }
44 | .options-wrap__bd {
45 | padding:0 32rpx;
46 | }
--------------------------------------------------------------------------------
/page/component/pages/switch/switch.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: 'switch',
5 | path: 'page/component/pages/switch/switch'
6 | }
7 | },
8 |
9 | switch1Change(e) {
10 | console.log('switch1 发生 change 事件,携带值为', e.detail.value)
11 | },
12 |
13 | switch2Change(e) {
14 | console.log('switch2 发生 change 事件,携带值为', e.detail.value)
15 | }
16 | })
17 |
--------------------------------------------------------------------------------
/page/component/pages/switch/switch.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "switch"
3 | }
4 |
--------------------------------------------------------------------------------
/page/component/pages/switch/switch.qss:
--------------------------------------------------------------------------------
1 | @import "../../../common/lib/qui.qss";
2 |
3 |
4 | .checkbox-wrap {
5 | margin-bottom:60rpx;
6 | }
7 | .checkbox-wrap__hd {
8 | position: relative;
9 | z-index:1;
10 |
11 | margin:0 32rpx;
12 | }
13 | .checkbox-wrap__txt-title {
14 | display:inline-block;
15 | line-height:1.5;
16 | font-size:28rpx;
17 | color:#8A8E9B;
18 | }
19 | .checkbox-wrap__bd {
20 | margin-top:28rpx;
21 | padding:0 32rpx;
22 | }
23 | .checkbox-wrap__label {
24 | display:inline-block;
25 | margin-right:30rpx;
26 | line-height:1.5;
27 | font-size:28rpx;
28 | color:#03081A;
29 | }
30 |
--------------------------------------------------------------------------------
/page/component/pages/text/text.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "text"
3 | }
4 |
--------------------------------------------------------------------------------
/page/component/pages/text/text.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | {{text}}
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/page/component/pages/text/text.qss:
--------------------------------------------------------------------------------
1 | .story-wrap {
2 | padding:0 60rpx;
3 | }
4 | .story-wrap__bd {}
5 | .story-wrap__list {
6 | display:flex;
7 | justify-content:center;
8 | align-items:center;
9 | padding:32rpx 0;
10 | min-height: 300rpx;
11 |
12 | background-color:#FFF;
13 | }
14 | .story-wrap__txt {
15 | text-align:center;
16 | color: #03081A;
17 | font-size:28rpx;
18 | line-height:1.5;
19 | }
20 | .story-wrap__ft {
21 | padding-top:40rpx;
22 | }
23 |
24 | button {
25 | margin-bottom:20rpx;
26 | }
--------------------------------------------------------------------------------
/page/component/pages/textarea/textarea.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: 'textarea',
5 | path: 'page/component/pages/textarea/textarea'
6 | }
7 | },
8 |
9 | data: {
10 | focus: false
11 | },
12 |
13 | bindTextAreaBlur(e) {
14 | console.log(e.detail.value)
15 | }
16 | })
17 |
--------------------------------------------------------------------------------
/page/component/pages/textarea/textarea.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "textarea"
3 | }
4 |
--------------------------------------------------------------------------------
/page/component/pages/textarea/textarea.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | 输入区域高度自适应,不会出现滚动条
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | 这是一个可以自动聚焦的textarea
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/page/component/pages/textarea/textarea.qss:
--------------------------------------------------------------------------------
1 | @import "../../../common/lib/qui.qss";
2 |
3 |
4 |
5 | textarea {
6 | width: 700rpx;
7 | padding: 32rpx 0;
8 | background-color: #fff;
9 | }
10 | .textarea-wrap {
11 | padding: 0 32rpx;
12 | background-color: #fff;
13 | }
14 | .qui-cell-group__txt-title {
15 | padding:4rpx 32rpx 8rpx 32rpx;
16 | }
--------------------------------------------------------------------------------
/page/component/pages/video/video.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "video"
3 | }
4 |
--------------------------------------------------------------------------------
/page/component/pages/video/video.qss:
--------------------------------------------------------------------------------
1 | @import "../../../common/lib/qui.qss";
2 |
3 | .video-wrap {
4 | margin-bottom:40rpx;
5 | text-align:center;
6 | }
7 | .video-wrap__bd {
8 | margin:0 auto;
9 | }
--------------------------------------------------------------------------------
/page/component/pages/view/view.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: 'view',
5 | path: 'page/component/pages/view/view'
6 | }
7 | },
8 | })
9 |
--------------------------------------------------------------------------------
/page/component/pages/view/view.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "view"
3 | }
4 |
--------------------------------------------------------------------------------
/page/component/pages/view/view.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | flex-direction: row\n横向布局
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | flex-direction: column\n纵向布局
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/page/component/pages/view/view.qss:
--------------------------------------------------------------------------------
1 | .flex-wrp{
2 | margin-top: 32rpx;
3 | display: flex;
4 | }
5 | .flex-item{
6 | flex: 1;
7 | height: 320rpx;
8 | font-size: 34rpx;
9 | }
10 | .flex-item-V{
11 | margin: 0 auto;
12 | width: 320rpx;
13 | height: 210rpx;
14 | }
15 |
16 | .page-section-spacing{
17 | padding: 0 60rpx;
18 | }
19 |
20 | .page-section-title{
21 | margin-top: -8rpx;
22 | margin-bottom: -8rpx;
23 | }
--------------------------------------------------------------------------------
/page/component/pages/web-view/web-view.js:
--------------------------------------------------------------------------------
1 | Page({
2 | onShareAppMessage() {
3 | return {
4 | title: 'webview',
5 | path: 'page/component/pages/web-view/web-view'
6 | }
7 | },
8 | })
9 |
--------------------------------------------------------------------------------
/page/component/pages/web-view/web-view.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "webview"
3 | }
4 |
--------------------------------------------------------------------------------
/page/component/pages/web-view/web-view.qml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/page/component/pages/web-view/web-view.qss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/page/component/pages/web-view/web-view.qss
--------------------------------------------------------------------------------
/page/component/resources/kind/daytime.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/page/component/resources/kind/daytime.png
--------------------------------------------------------------------------------
/page/component/resources/kind/night.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/page/component/resources/kind/night.png
--------------------------------------------------------------------------------
/page/component/resources/pic/1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/page/component/resources/pic/1.jpg
--------------------------------------------------------------------------------
/page/component/resources/pic/2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/page/component/resources/pic/2.jpg
--------------------------------------------------------------------------------
/page/superpower/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "小程序特殊能力展示"
3 | }
4 |
--------------------------------------------------------------------------------
/page/superpower/index.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 以下将演示小程序特殊能力,具体属性参数详见QQ小程序开发文档
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | {{item.name}}
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/page/superpower/index.qss:
--------------------------------------------------------------------------------
1 | @import "../common/index.qss";
2 |
3 | page {
4 | background-color: #F5F6FA !important;
5 | }
6 |
7 | .grid-list {
8 | display: flex;
9 | flex-wrap: wrap;
10 | }
11 |
12 | .grid-list__item {
13 | display: flex;
14 | flex-direction: column;
15 | justify-content: center;
16 | align-items: center;
17 | width: 224rpx;
18 | height: 224rpx;
19 | margin: 0 0 20rpx 20rpx;
20 | border-radius: 10rpx;
21 | background-color: #fff;
22 | position: relative;
23 | }
24 | .grid-list__item.new:after {
25 | content: 'NEW';
26 | display: block;
27 | width: 60rpx;
28 | height: 32rpx;
29 | margin: 6rpx;
30 | position: absolute;
31 | top: 0;
32 | right: 0;
33 | color: #ffffff;
34 | font-size: 22rpx;
35 | line-height: 32rpx;
36 | text-align: center;
37 | background-color: #ef1b1b;
38 | border-radius: 6rpx;
39 | }
40 | .grid-list__item-icon {
41 | width: 80rpx;
42 | height: 80rpx;
43 | margin-bottom: 20rpx;
44 | }
45 |
46 | .grid-list__item-title {
47 | font-size: 28rpx;
48 | }
49 |
--------------------------------------------------------------------------------
/page/superpower/pages/VoIPChat/VoIPChat.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "实时语音"
3 | }
4 |
--------------------------------------------------------------------------------
/page/superpower/pages/VoIPChat/VoIPChat.qss:
--------------------------------------------------------------------------------
1 | @import "../../../common/lib/qui.qss";
2 |
3 | .VolPChat-room {
4 | display: flex;
5 | justify-content: center;
6 | align-items: center;
7 | height: 392rpx;
8 | margin-top: 20rpx;
9 | font-size: 28rpx;
10 | color: #03081A;
11 | background-color: #fff;
12 | }
13 |
--------------------------------------------------------------------------------
/page/superpower/pages/ad-more-style/ad-more-style.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "广告能力"
3 | }
--------------------------------------------------------------------------------
/page/superpower/pages/add-friend/add-fried.qss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/page/superpower/pages/add-friend/add-fried.qss
--------------------------------------------------------------------------------
/page/superpower/pages/add-friend/add-friend.js:
--------------------------------------------------------------------------------
1 |
2 | Page({
3 | data: {},
4 | onShareAppMessage() {
5 | return {
6 | title: '添加好友',
7 | path: 'page/superpower/pages/add-friend/add-friend'
8 | }
9 | },
10 | getAuthorization() {
11 | qq.authorize({
12 | scope: 'setting.addFriend',
13 | success() {
14 | qq.showToast({
15 | title: '授权成功',
16 | icon: 'success',
17 | duration: 2000
18 | })
19 | },
20 | fail(e) {
21 | console.error(e)
22 | }
23 | })
24 | },
25 | addFriendHandler(e) {
26 | console.log(e)
27 | },
28 |
29 | onAddFriendError(a, b) {
30 | console.error(a, b)
31 | }
32 | })
33 |
--------------------------------------------------------------------------------
/page/superpower/pages/add-friend/add-friend.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "添加好友"
3 | }
4 |
--------------------------------------------------------------------------------
/page/superpower/pages/add-friend/add-friend.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/page/superpower/pages/address/address.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | address: null
4 | },
5 | onShareAppMessage() {
6 | return {
7 | title: '收货地址',
8 | path: 'page/component/pages/address/address'
9 | }
10 | },
11 |
12 | getAddress() {
13 | qq.chooseAddress({
14 | success: (res) => {
15 | console.log('success', res)
16 | this.setData({
17 | address: res
18 | })
19 | },
20 | fail: (res) => {
21 | console.log('fail', res)
22 | }
23 | })
24 | }
25 | })
26 |
--------------------------------------------------------------------------------
/page/superpower/pages/address/address.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "收货地址"
3 | }
--------------------------------------------------------------------------------
/page/superpower/pages/address/address.qss:
--------------------------------------------------------------------------------
1 | @import "../../../common/lib/qui.qss";
2 |
3 | .label{
4 | min-width:200rpx;
5 | }
6 |
--------------------------------------------------------------------------------
/page/superpower/pages/entry/entry.js:
--------------------------------------------------------------------------------
1 | const app = getApp()
2 |
3 | Page({
4 | data: {
5 | onShareAppMessage() {
6 | return {
7 | title: '场景化入口',
8 | path: '/page/superpower/pages/entry/entry'
9 | }
10 | },
11 | entryDataHash: ''
12 | },
13 |
14 | onReady() {
15 |
16 | },
17 | onShow() {
18 | const {entryDataHash} = app.globalData.appOnShowOptions
19 | console.log(entryDataHash)
20 | if (entryDataHash) {
21 | this.setData({entryDataHash})
22 | } else {
23 | this.setData({entryDataHash: ''})
24 | }
25 | },
26 | saveAppToDesktop() {
27 | qq.saveAppToDesktop()
28 | },
29 | onAddGroupApp(...args) {
30 | console.log(args)
31 | }
32 | })
33 |
--------------------------------------------------------------------------------
/page/superpower/pages/entry/entry.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "场景化入口"
3 | }
4 |
--------------------------------------------------------------------------------
/page/superpower/pages/entry/entry.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | {{ entryDataHash?'':'从自己管理的QQ群里打开小程序即可『添加到本群』'}}
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/page/superpower/pages/entry/entry.qss:
--------------------------------------------------------------------------------
1 | @import "../../../common/lib/qui.qss";
2 |
3 |
4 | .btn-area {
5 | margin-top:0;
6 | }
7 |
8 | .list-wrap__group-tips {
9 | padding:12rpx 32rpx 24rpx 62rpx;
10 | background-color:#F5F6FA;
11 | }
12 | .list-wrap__group-txt-tips {
13 | display:inline-block;
14 | line-height:1.3;
15 | font-size:28rpx;
16 | color:#878B99;
17 | }
--------------------------------------------------------------------------------
/page/superpower/pages/general-webpage-url/general-webpage-url.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | shareData: {
4 | title: '自定义转发标题',
5 | desc: '自定义转发描述',
6 | path: '/page/API/pages/share/share',
7 | generalWebpageUrl: 'https://q.qq.com'
8 | }
9 | },
10 |
11 | onShareAppMessage() {
12 | return this.data.shareData
13 | },
14 | })
15 |
--------------------------------------------------------------------------------
/page/superpower/pages/general-webpage-url/general-webpage-url.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "分享至PC"
3 | }
4 |
--------------------------------------------------------------------------------
/page/superpower/pages/general-webpage-url/general-webpage-url.qss:
--------------------------------------------------------------------------------
1 | @import "../../../common/lib/qui.qss";
2 |
3 |
4 |
5 | .qui-cell-group__txt-title {
6 | padding:0 32rpx 8rpx 32rpx;
7 | }
--------------------------------------------------------------------------------
/page/superpower/pages/group-profile/group-profile.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {},
3 | onShareAppMessage() {
4 | return {
5 | title: 'openGroupProfile',
6 | path: 'page/superpower/pages/group-profile/group-profile'
7 | }
8 | }
9 | })
10 |
--------------------------------------------------------------------------------
/page/superpower/pages/group-profile/group-profile.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "打开群资料卡"
3 | }
4 |
--------------------------------------------------------------------------------
/page/superpower/pages/group-profile/group-profile.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/page/superpower/pages/group-profile/group-profile.qss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/page/superpower/pages/group-profile/group-profile.qss
--------------------------------------------------------------------------------
/page/superpower/pages/individuation/individuation.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | logo: 'individuation',
4 | list: [{
5 | name: '设置官方装扮',
6 | url: '/page/superpower/pages/set-official-dress/set-official-dress'
7 | }, {
8 | name: '设置个性化装扮',
9 | url: '/page/superpower/pages/set-custom-dress/set-custom-dress'
10 | }]
11 | },
12 | onShareAppMessage() {
13 | return {
14 | title: '个性化能力',
15 | path: 'page/superpower/pages/individuation/individuation'
16 | }
17 | }
18 | })
19 |
--------------------------------------------------------------------------------
/page/superpower/pages/individuation/individuation.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "个性化能力"
3 | }
4 |
--------------------------------------------------------------------------------
/page/superpower/pages/individuation/individuation.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/page/superpower/pages/individuation/individuation.qss:
--------------------------------------------------------------------------------
1 | page {
2 | background-color: #F5F6FA;
3 | }
4 |
5 | .x-container {
6 | height: calc(100vh - 20rpx);
7 | margin-top: 20rpx;
8 | background-color: #fff;
9 | }
10 |
--------------------------------------------------------------------------------
/page/superpower/pages/liveplayer/liveplayer.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "liveplayer"
3 | }
4 |
--------------------------------------------------------------------------------
/page/superpower/pages/liveplayer/liveplayer.qss:
--------------------------------------------------------------------------------
1 | .liveplayer-box {
2 | height: 392rpx;
3 | background-color: #fff;
4 | }
5 |
6 | live-player {
7 | width: 100%;
8 | height: 392rpx;
9 | }
10 |
--------------------------------------------------------------------------------
/page/superpower/pages/livepusher-record/livepusher-record.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "RTMP推流"
3 | }
4 |
--------------------------------------------------------------------------------
/page/superpower/pages/livepusher-record/livepusher-record.qss:
--------------------------------------------------------------------------------
1 | live-pusher {
2 | width: 750rpx;
3 | height: 100vh;
4 | }
5 |
6 | .bottom_box
7 | {
8 | position: relative;
9 | width: 50px;
10 | height: 70px;
11 | margin-left:calc(100% / 8 - 25px);
12 | margin-right:calc(100% / 8 - 25px);
13 | display:inline-block;
14 | }
15 |
16 | .bottom_button
17 | {
18 | display:inline-block;
19 | position: absolute;
20 | width: 50px;
21 | height: 50px;
22 | }
23 |
24 | .bottom_button :active{
25 | opacity:0.55;
26 | }
27 |
28 | .bottom_text
29 | {
30 | position: absolute;
31 | display:inline-block;
32 | color: #ffffff;
33 | width: 100%;
34 | font-size:10px;
35 | bottom: 0;
36 | text-align: center;
37 | }
--------------------------------------------------------------------------------
/page/superpower/pages/livepusher/livepusher.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "livepusher"
3 | }
4 |
--------------------------------------------------------------------------------
/page/superpower/pages/map-more-style/map-more-style.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {},
3 | onShareAppMessage() {
4 | return {
5 | title: '地图底图样式',
6 | path: 'page/superpower/pages/map-more-style/map-more-style'
7 | }
8 | },
9 | regionchange(e) {
10 | console.log(e.type)
11 | },
12 | markertap(e) {
13 | console.log(e.markerId)
14 | },
15 | controltap(e) {
16 | console.log(e.controlId)
17 | }
18 | })
19 |
--------------------------------------------------------------------------------
/page/superpower/pages/map-more-style/map-more-style.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "地图底图样式"
3 | }
4 |
--------------------------------------------------------------------------------
/page/superpower/pages/map-more-style/map-more-style.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | 经典
10 |
11 |
12 |
13 | 墨渊
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/page/superpower/pages/map-more-style/map-more-style.qss:
--------------------------------------------------------------------------------
1 | .map-wrap {
2 | width: 750rpx;
3 | }
4 |
5 | .map-wrap map {
6 | width: 750rpx;
7 | height: 562rpx;
8 | }
9 |
10 | .map-wrap__title {
11 | margin: 12rpx 32rpx 16rpx 32rpx;
12 | font-size: 28rpx;
13 | color: #878B99;
14 | }
15 |
16 | .map-wrap__title-link {
17 | display: inline-block;
18 | color: #4D94FF;
19 | }
20 |
21 | .mt32 {
22 | margin-top: 32rpx;
23 | }
24 |
--------------------------------------------------------------------------------
/page/superpower/pages/map/map.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "地图"
3 | }
4 |
--------------------------------------------------------------------------------
/page/superpower/pages/map/map.qss:
--------------------------------------------------------------------------------
1 | .map-wrap {
2 | width: 750rpx;
3 | padding-bottom: 20rpx;
4 | }
5 |
6 | .map-wrap map {
7 | width: 750rpx;
8 | height: 562rpx;
9 | }
10 |
11 | .map-wrap__title {
12 | margin: 12rpx 32rpx 16rpx 32rpx;
13 | font-size: 28rpx;
14 | color: #878B99;
15 | }
16 |
17 | .map-wrap__title-link {
18 | display: inline-block;
19 | color: #4D94FF;
20 | }
21 |
--------------------------------------------------------------------------------
/page/superpower/pages/media/media.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | logo: 'media',
4 | list: [{
5 | name: 'liveplayer',
6 | url: '/page/superpower/pages/liveplayer/liveplayer'
7 | }, {
8 | name: 'livepusher',
9 | url: '/page/superpower/pages/livepusher/livepusher'
10 | }, {
11 | name: '实时语音',
12 | url: '/page/superpower/pages/VoIPChat/VoIPChat'
13 | }]
14 | },
15 | onShareAppMessage() {
16 | return {
17 | title: '音视频能力',
18 | path: 'page/superpower/pages/media/media'
19 | }
20 | }
21 | })
22 |
--------------------------------------------------------------------------------
/page/superpower/pages/media/media.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "音视频能力"
3 | }
4 |
--------------------------------------------------------------------------------
/page/superpower/pages/media/media.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/page/superpower/pages/media/media.qss:
--------------------------------------------------------------------------------
1 | page {
2 | background-color: #F5F6FA;
3 | }
4 |
5 | .x-container {
6 | height: calc(100vh - 20rpx);
7 | margin-top: 20rpx;
8 | background-color: #fff;
9 | }
10 |
--------------------------------------------------------------------------------
/page/superpower/pages/message-subscribe/message-subscribe.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "订阅消息"
3 | }
4 |
--------------------------------------------------------------------------------
/page/superpower/pages/message-subscribe/message-subscribe.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | 1天最多发送1条订阅消息
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/page/superpower/pages/message-subscribe/message-subscribe.qss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/page/superpower/pages/message-subscribe/message-subscribe.qss
--------------------------------------------------------------------------------
/page/superpower/pages/message-template/message-template.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "模版消息"
3 | }
4 |
--------------------------------------------------------------------------------
/page/superpower/pages/message-template/message-template.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
12 |
13 | 获取1次formid,即可发送1条消息
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/page/superpower/pages/message-template/message-template.qss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/page/superpower/pages/message-template/message-template.qss
--------------------------------------------------------------------------------
/page/superpower/pages/message/message.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | logo: 'msg',
4 | list: [{
5 | name: '模版消息',
6 | url: '/page/superpower/pages/message-template/message-template'
7 | }, {
8 | name: '订阅消息',
9 | url: '/page/superpower/pages/message-subscribe/message-subscribe'
10 | }]
11 | },
12 | onShareAppMessage() {
13 | return {
14 | title: '消息触达',
15 | path: 'page/superpower/pages/message/message'
16 | }
17 | }
18 | })
19 |
--------------------------------------------------------------------------------
/page/superpower/pages/message/message.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "消息触达"
3 | }
4 |
--------------------------------------------------------------------------------
/page/superpower/pages/message/message.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/page/superpower/pages/message/message.qss:
--------------------------------------------------------------------------------
1 | page {
2 | background-color: #F5F6FA;
3 | }
4 |
5 | .x-container {
6 | height: calc(100vh - 20rpx);
7 | margin-top: 20rpx;
8 | background-color: #fff;
9 | }
10 |
--------------------------------------------------------------------------------
/page/superpower/pages/o2o/o2o.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | logo: 'map',
4 | list: [{
5 | name: '地图',
6 | url: '/page/superpower/pages/map/map'
7 | }, {
8 | name: '获取用户收货地址',
9 | url: '/page/superpower/pages/address/address',
10 | isNew: true
11 | }]
12 | },
13 | onShareAppMessage() {
14 | return {
15 | title: '线下能力',
16 | path: 'page/superpower/pages/o2o/o2o'
17 | }
18 | }
19 | })
20 |
--------------------------------------------------------------------------------
/page/superpower/pages/o2o/o2o.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "线下能力"
3 | }
4 |
--------------------------------------------------------------------------------
/page/superpower/pages/o2o/o2o.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/page/superpower/pages/o2o/o2o.qss:
--------------------------------------------------------------------------------
1 | page {
2 | background-color: #F5F6FA;
3 | }
4 |
5 | .x-container {
6 | height: calc(100vh - 20rpx);
7 | margin-top: 20rpx;
8 | background-color: #fff;
9 | }
10 |
--------------------------------------------------------------------------------
/page/superpower/pages/open-qzone-publish/open-qzone-publish.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {},
3 | onShareAppMessage() {
4 | return {
5 | title: 'openQzonePublish',
6 | path: 'page/superpower/pages/open-qzone-publish/open-qzone-publish'
7 | }
8 | },
9 | openQzonePublish() {
10 | qq.openQzonePublish({
11 |
12 | })
13 | }
14 | })
15 |
--------------------------------------------------------------------------------
/page/superpower/pages/open-qzone-publish/open-qzone-publish.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "空间说说发表"
3 | }
4 |
--------------------------------------------------------------------------------
/page/superpower/pages/open-qzone-publish/open-qzone-publish.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/page/superpower/pages/open-qzone-publish/open-qzone-publish.qss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/page/superpower/pages/open-qzone-publish/open-qzone-publish.qss
--------------------------------------------------------------------------------
/page/superpower/pages/public-profile/public-profile.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {},
3 | onShareAppMessage() {
4 | return {
5 | title: 'openPublicProfile',
6 | path: 'page/superpower/pages/public-profile/public-profile'
7 | }
8 | }
9 | })
10 |
--------------------------------------------------------------------------------
/page/superpower/pages/public-profile/public-profile.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "打开公众号资料卡"
3 | }
4 |
--------------------------------------------------------------------------------
/page/superpower/pages/public-profile/public-profile.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/page/superpower/pages/public-profile/public-profile.qss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/page/superpower/pages/public-profile/public-profile.qss
--------------------------------------------------------------------------------
/page/superpower/pages/qzone/qzone.js:
--------------------------------------------------------------------------------
1 | const app = getApp()
2 |
3 | Page({
4 | data: {
5 | shareData: {
6 | title: 'showShareMenu',
7 | desc: '分享强化',
8 | path: '/page/superpower/pages/qzone/qzone'
9 | },
10 | entryDataHash:''
11 | },
12 |
13 | onReady(){
14 | const options = app.globalData.appOnShowOptions
15 |
16 | if (options && options.entryDataHash){
17 | this.setData({
18 | entryDataHash: options.entryDataHash
19 | })
20 | }
21 | },
22 |
23 | onShareAppMessage(e) {
24 | //进行快速分享,直接分享到当前聊天窗口,page.onShareAppMessage需要带上entryDataHash参数
25 | if(this.data.entryDataHash){
26 | this.data.shareData.entryDataHash = this.data.entryDataHash
27 | }
28 | return this.data.shareData
29 | },
30 |
31 | showBothShareMenu() {
32 | qq.showShareMenu({
33 | showShareItems: ['qq', 'qzone']
34 | })
35 | },
36 | showFriendShareMenu() {
37 | qq.showShareMenu({
38 | showShareItems: ['qq']
39 | })
40 | },
41 | showQzoneShareMenu() {
42 | qq.showShareMenu({
43 | showShareItems: ['qzone']
44 | })
45 | }
46 | })
47 |
--------------------------------------------------------------------------------
/page/superpower/pages/qzone/qzone.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "分享强化"
3 | }
4 |
--------------------------------------------------------------------------------
/page/superpower/pages/qzone/qzone.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | 点击右上角菜单转发给好友
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | 分享页面到群会话,从群会话中打开小程序即可『分享回原会话』
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/page/superpower/pages/qzone/qzone.qss:
--------------------------------------------------------------------------------
1 | @import "../../../common/lib/qui.qss";
2 |
3 |
4 | .btn-area {
5 | margin-top:0;
6 | }
7 |
8 | .list-wrap__group-tips {
9 | padding:12rpx 32rpx 24rpx 62rpx;
10 | background-color:#F5F6FA;
11 | }
12 | .list-wrap__group-txt-tips {
13 | display:inline-block;
14 | line-height:1.3;
15 | font-size:28rpx;
16 | color:#878B99;
17 | }
--------------------------------------------------------------------------------
/page/superpower/pages/relationship/relationship.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | logo: 'relationship',
4 | list: [{
5 | name: '添加好友',
6 | url: '/page/superpower/pages/add-friend/add-friend'
7 | }, {
8 | name: '一键加群(打开群资料卡)',
9 | url: '/page/superpower/pages/group-profile/group-profile'
10 | }, {
11 | name: '一键关注(打开公众号资料卡)',
12 | url: '/page/superpower/pages/public-profile/public-profile',
13 | isNew: true
14 | }]
15 | },
16 | onShareAppMessage() {
17 | return {
18 | title: '关系链拓展',
19 | path: 'page/superpower/pages/relationship/relationship'
20 | }
21 | }
22 | })
23 |
--------------------------------------------------------------------------------
/page/superpower/pages/relationship/relationship.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "关系链拓展"
3 | }
4 |
--------------------------------------------------------------------------------
/page/superpower/pages/relationship/relationship.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/page/superpower/pages/relationship/relationship.qss:
--------------------------------------------------------------------------------
1 | page {
2 | background-color: #F5F6FA;
3 | }
4 |
5 | .x-container {
6 | height: calc(100vh - 20rpx);
7 | margin-top: 20rpx;
8 | background-color: #fff;
9 | }
10 |
--------------------------------------------------------------------------------
/page/superpower/pages/set-custom-dress/avatar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/page/superpower/pages/set-custom-dress/avatar.png
--------------------------------------------------------------------------------
/page/superpower/pages/set-custom-dress/set-custom-dress.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "设置自定义装扮"
3 | }
4 |
--------------------------------------------------------------------------------
/page/superpower/pages/set-custom-dress/set-custom-dress.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | 头像尺寸仅支持640*640px
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/page/superpower/pages/set-custom-dress/set-custom-dress.qss:
--------------------------------------------------------------------------------
1 | .avatar-wrap {
2 | margin-bottom:100rpx;
3 | padding:0 32rpx;
4 | }
5 | .avatar-wrap:nth-last-of-type(1) {
6 | margin-bottom:0;
7 | }
8 | .avatar-wrap__hd {
9 | margin-top:40rpx;
10 | text-align:center;
11 | }
12 | .avatar-wrap__txt-title {
13 | display:inline-block;
14 | line-height:1.5;
15 | font-size:28rpx;
16 | color:#B0B3BF;
17 | }
18 | .avatar-wrap__bd {
19 | margin-top:40rpx;
20 | }
21 | .avatar-wrap__img {
22 | display:block;
23 | margin:0 auto;
24 | width:200rpx;
25 | height:200rpx;
26 | border-radius:100rpx;
27 | }
28 | .avatar-wrap__ft {
29 | margin-top:40rpx;
30 | }
--------------------------------------------------------------------------------
/page/superpower/pages/set-official-dress/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/page/superpower/pages/set-official-dress/1.png
--------------------------------------------------------------------------------
/page/superpower/pages/set-official-dress/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/page/superpower/pages/set-official-dress/2.png
--------------------------------------------------------------------------------
/page/superpower/pages/set-official-dress/set-official-dress.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "设置官方装扮"
3 | }
4 |
--------------------------------------------------------------------------------
/page/superpower/pages/set-official-dress/set-official-dress.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/page/superpower/pages/set-official-dress/set-official-dress.qss:
--------------------------------------------------------------------------------
1 | .avatar-wrap {
2 | margin-bottom:100rpx;
3 | padding:0 32rpx;
4 | }
5 | .avatar-wrap:nth-last-of-type(1) {
6 | margin-bottom:0;
7 | }
8 | .avatar-wrap__hd {}
9 | .avatar-wrap__bd {}
10 | .avatar-wrap__img {
11 | display:block;
12 | margin:0 auto;
13 | width:200rpx;
14 | height:200rpx;
15 | border-radius:100rpx;
16 | }
17 | .avatar-wrap__ft {
18 | margin-top:40rpx;
19 | }
--------------------------------------------------------------------------------
/page/superpower/pages/wxPay/wxPay.js:
--------------------------------------------------------------------------------
1 | const {wxPayUrl} = require('../../../../config.js')
2 |
3 | Page({
4 | data: {
5 | total_fee: 1
6 | },
7 | onLoad() {
8 | },
9 | handlePay() {
10 | // 下单
11 | qq.request({
12 | url: wxPayUrl,
13 | method: 'POST',
14 | data: {
15 | appType: 'miniprogram',
16 | total_fee: this.data.total_fee
17 | },
18 | success(res) {
19 | if (res.data) {
20 | const code = res.data.code
21 | const mwebUrl = res.data.mweb_url
22 | if (code === 0 && mwebUrl) {
23 | // 呼起微信支付
24 | qq.requestWxPayment({
25 | url: mwebUrl,
26 | referer: 'https://q.qq.com',
27 | success(res) {
28 | console.log('支付成功', res)
29 | },
30 | fail() {
31 | qq.showToast({
32 | title: '支付失败',
33 | icon: 'none'
34 | })
35 | }
36 | })
37 | } else {
38 | qq.showToast({
39 | title: '下单失败',
40 | icon: 'none'
41 | })
42 | }
43 | }
44 | },
45 | fail() {
46 | qq.showToast({
47 | title: '下单失败',
48 | icon: 'none'
49 | })
50 | }
51 | })
52 | },
53 | })
54 |
--------------------------------------------------------------------------------
/page/superpower/pages/wxPay/wxPay.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/page/superpower/pages/wxPay/wxPay.qml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 微信支付
4 |
5 | 共 {{ total_fee / 100 }}元
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/page/superpower/pages/wxPay/wxPay.qss:
--------------------------------------------------------------------------------
1 | @import "../../../common/lib/qui.qss";
2 |
3 | .pay-title {
4 | margin-bottom: 20rpx;
5 | }
6 |
7 | .pay-info {
8 | text-align: center;
9 | }
10 |
11 | .pay-total-fee {
12 | font-size: 60rpx;
13 | }
14 |
--------------------------------------------------------------------------------
/page/superpower/resources/kind/daytime.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/page/superpower/resources/kind/daytime.png
--------------------------------------------------------------------------------
/page/superpower/resources/kind/night.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/page/superpower/resources/kind/night.png
--------------------------------------------------------------------------------
/page/superpower/resources/pic/1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/page/superpower/resources/pic/1.jpg
--------------------------------------------------------------------------------
/page/superpower/resources/pic/2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/page/superpower/resources/pic/2.jpg
--------------------------------------------------------------------------------
/page/superpower/resources/pic/custom_map_template_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/page/superpower/resources/pic/custom_map_template_1.png
--------------------------------------------------------------------------------
/page/superpower/resources/pic/custom_map_template_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/page/superpower/resources/pic/custom_map_template_2.png
--------------------------------------------------------------------------------
/page/superpower/resources/pic/custom_map_template_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/page/superpower/resources/pic/custom_map_template_3.png
--------------------------------------------------------------------------------
/page/superpower/resources/pic/custom_map_template_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qq-web/qq-miniprogram-demo/b9c9a79617ac9bc84f3a6b344db5f309eb6f473c/page/superpower/resources/pic/custom_map_template_4.png
--------------------------------------------------------------------------------
/project.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "description": "项目配置文件",
3 | "packOptions": {
4 | "ignore": []
5 | },
6 | "setting": {
7 | "urlCheck": true,
8 | "es6": true,
9 | "postcss": true,
10 | "minified": true,
11 | "newFeature": true,
12 | "autoAudits": false,
13 | "checkInvalidKey": true,
14 | "remoteDebugLogEnable": false,
15 | "useAlphaLib": true,
16 | "nodeModules": true,
17 | "uglifyFileName": true,
18 | "uploadWithSourceMap": true,
19 | "sourcemapDisabled": true
20 | },
21 | "compileType": "miniprogram",
22 | "projectname": "miniapp",
23 | "debugOptions": {
24 | "hidedInDevtools": []
25 | },
26 | "isGameTourist": false,
27 | "simulatorPluginLibVersion": {},
28 | "qqappid": "1109548205",
29 | "scripts": {
30 | "beforeCompile": "",
31 | "beforePreview": "",
32 | "beforeUpload": ""
33 | },
34 | "qqLibVersion": "1.16.0",
35 | "condition": {}
36 | }
--------------------------------------------------------------------------------
/sitemap.json:
--------------------------------------------------------------------------------
1 | {
2 | "desc": "sitemap",
3 | "rules": [{
4 | "action": "allow",
5 | "page": "*"
6 | }]
7 | }
--------------------------------------------------------------------------------
/util/util.js:
--------------------------------------------------------------------------------
1 | function formatTime(time) {
2 | if (typeof time !== 'number' || time < 0) {
3 | return time
4 | }
5 |
6 | const hour = parseInt(time / 3600, 10)
7 | time %= 3600
8 | const minute = parseInt(time / 60, 10)
9 | time = parseInt(time % 60, 10)
10 | const second = time
11 |
12 | return ([hour, minute, second]).map(function (n) {
13 | n = n.toString()
14 | return n[1] ? n : '0' + n
15 | }).join(':')
16 | }
17 |
18 | function formatLocation(longitude, latitude) {
19 | if (typeof longitude === 'string' && typeof latitude === 'string') {
20 | longitude = parseFloat(longitude)
21 | latitude = parseFloat(latitude)
22 | }
23 |
24 | longitude = longitude.toFixed(2)
25 | latitude = latitude.toFixed(2)
26 |
27 | return {
28 | longitude: longitude.toString().split('.'),
29 | latitude: latitude.toString().split('.')
30 | }
31 | }
32 |
33 | function fib(n) {
34 | if (n < 1) return 0
35 | if (n <= 2) return 1
36 | return fib(n - 1) + fib(n - 2)
37 | }
38 |
39 | module.exports = {
40 | formatTime,
41 | formatLocation,
42 | fib
43 | }
44 |
--------------------------------------------------------------------------------
/workers/fib/index.js:
--------------------------------------------------------------------------------
1 | function fib(n) {
2 | if (n < 1) return 0
3 | if (n <= 2) return 1
4 | return fib(n - 1) + fib(n - 2)
5 | }
6 |
7 | worker.onMessage(function (msg) {
8 | if (msg.type === 'execFunc_fib') {
9 | worker.postMessage({
10 | type: 'execFunc_fib',
11 | result: fib(msg.params[0])
12 | })
13 | }
14 | })
15 |
--------------------------------------------------------------------------------