All Projects → Younglina → my-project

Younglina / my-project

Licence: other
mpvue体验

Programming Languages

javascript
184084 projects - #8 most used programming language
Vue
7211 projects
HTML
75241 projects

Projects that are alternatives of or similar to my-project

mpvue canvas drawer
[mpvue版本]微信小程序上canvas绘制图片助手,一个json就制作分享朋友圈图片
Stars: ✭ 43 (+72%)
Mutual labels:  mpvue
mpvue-netBar
use mpvue for find network
Stars: ✭ 16 (-36%)
Mutual labels:  mpvue
generator-mpvue-project
Yeoman generator of mpvue project
Stars: ✭ 25 (+0%)
Mutual labels:  mpvue
mtapp
💫 💫 Vue全家桶(配Nuxt)+ssr服务器渲染+koa2 打造美团App项目(还在更新...)📦
Stars: ✭ 30 (+20%)
Mutual labels:  mpvue
uParse
📰适用于 uni-app/mpvue 的富文本解析自定义组件
Stars: ✭ 45 (+80%)
Mutual labels:  mpvue
image
mpvue-Unsplash
Stars: ✭ 31 (+24%)
Mutual labels:  mpvue
mpvue-wechat-zhihu
一个入门级别的资讯类微信小程序
Stars: ✭ 25 (+0%)
Mutual labels:  mpvue
mpvue-imooc-ebook-docs
「小慕读书」官网
Stars: ✭ 52 (+108%)
Mutual labels:  mpvue
webpack-mpvue-startup
A template with webpack 3 + mpvue 1 setup for projects startup
Stars: ✭ 13 (-48%)
Mutual labels:  mpvue
spa-custom-hooks
💯 Custom hook of business layer (asynchronous task notification solution), supporting various applets and Vue architectures (uni app, wepy, mpvue, etc.)
Stars: ✭ 307 (+1128%)
Mutual labels:  mpvue
mpvue-one
使用mpvue构建的ONE·一个小程序,仅供学习使用
Stars: ✭ 19 (-24%)
Mutual labels:  mpvue
mp-framework-benchmark
mp-framework-benchmark
Stars: ✭ 49 (+96%)
Mutual labels:  mpvue
mpvue-gesture-lock
微信小程序手势解锁(Dom实现,避免小程序Canvas卡顿问题),基于 Mpvue
Stars: ✭ 34 (+36%)
Mutual labels:  mpvue
Dailyfresh-B2C
这是一个 ☛全栈/全端/全平台☚ 的B2C模式的电商项目, web后台基于Django2.0 + Python3.6, 前后端分离,前端使用Vue框架开发。移动端基于Flutter开发,一套代码支持Android&IOS平台。微信小程序基于mpvue框架开发。
Stars: ✭ 74 (+196%)
Mutual labels:  mpvue
mpvue-vant-weapp
使用mpvue导入vant-weapp
Stars: ✭ 20 (-20%)
Mutual labels:  mpvue
showModal
适用于uni-app 的跨端显示弹层,使用接口参数与uni-app 中的showModal参数一致
Stars: ✭ 67 (+168%)
Mutual labels:  mpvue
mpvue-apps
使用 Vue.js 开发小程序的前端框架
Stars: ✭ 21 (-16%)
Mutual labels:  mpvue
image-cropper
💯一款功能强大的微信小程序图片裁剪插件
Stars: ✭ 1,123 (+4392%)
Mutual labels:  mpvue
mpvue-busline
公交lite —— 用mpvue重写的公交查询小程序。
Stars: ✭ 50 (+100%)
Mutual labels:  mpvue
common-mpvue
使用mpvue开发小程序通用能力封装
Stars: ✭ 31 (+24%)
Mutual labels:  mpvue

my-project

在尝试开发了一个微信小程序之,后发现有mpvue这么个东西可以来开发小程序以后就忍不住了,所以把小程序和我用vue开发过的版本结合修改以后,再尝试用mpvue+iview-weapp开发一个版本。
后台接口用的是NeteaseCloudMusicApi,感谢大佬的分享

git地址,demo项目代码质量不是很好,哈哈哈哈多多见谅😁

更新记录(前几次更新忘记写记录...)

18/9/25 修改账号页

预览(不动点大图看)

目前完成

  • 推荐歌单
  • 排行榜
  • 歌单详情
  • 播放页
  • 歌单评论
  • 搜索
  • 扫一扫(基础功能)
  • 周边(百度地图api)

项目搭建

  • 最开始还是要把微信小程序开发工具下载一下
  • mpvue项目建立,跟着官网走一遍是最快的 快速上手
  • 支持iview-weapp,还是跟着官网快速上手,这里就一个地方要注意,把下载下来的iview-weapp项目的dist文件夹(可以改名字)是放到你项目编译后的dist目录下,iview-weapp官网没有效果的展示,所以建议扫它上面的二维码查看效果以后对照它的代码进行开发
  • 最后就是用微信小程序开发工具打开项目(不是dist目录),用你常用的编译器编写代码(src目录下)

请求方面

微信小程序有自带的wx.request()可以使用,还可以用Flyio,我是用的Flyio
具体使用的话可以再每个模块中

var Fly=require("flyio/dist/npm/wx")
var fly=new Fly
fly.get(url).then(res=>{})

还有就是在main.js中

const Fly = require('flyio/dist/npm/wx');
let fly = new Fly();
Vue.prototype.$fly = fly;
//模块中使用 
this.$fiy.get(url).then(res=>{}) 

路由跳转传参

wx.navigateTo({url:'../test/main?id='+id})
第一种:

onShow (options) {

let id = options.id

}

第二种:在所有页面组件内可以通过 this.$root.$mp.query 获取,要注意就是:写在mounted函数里,写到created报错。

第三种:在所有的组件内可以通过 this.$root.$mp.appOptions获取。
正常情况下三种应该都是可以的,某一种没用的时候就尝试另外两种

vuex方面

还是和vue里面的使用一样,简单的
/src/store/store.js

import Vue from 'vue'
import Vuex from 'vuex';

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
   oneState:'one'
    }
  },
  mutations: {
    setItem: (state,data) => {
      state.oneState = data
    },
  },
  getters : {
    getItem (state) {
        return state.oneState
    },
});

/src/main.js

import store from './store/store'
Vue.prototype.$store = store;

/src/page/text.vue

import {mapGetters} from 'vuex'
  export default {
     computed:{
       ...mapGetters([
         'oneState'
        ])
     },
     },
     methods:{
         test(){
             this.$store.commit('setItem', 'two')
         }
     }

总结

好了,基本的开发流程就是这样,具体的开发大部分还是像vue开发那样,自己在开发的时候,遇到的坑还是有的,但网上基本都能找到解决方案,具体遇到的时候就查一查都能查到,收获很多。 最后这里还有一个用vue开发的版本可在线预览,建议用chrome的手机模式预览

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].