All Projects → qutz → Vue Mall

qutz / Vue Mall

微信公众号测试项目

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Vue Mall

Vue axios spa
基于vue2+axios+vux+vue-router+vuex构建的单页微信端项目
Stars: ✭ 54 (-27.03%)
Mutual labels:  axios, vuex, vue-router, vue2
Vue Admin
基于Vue2、element ui、vue-cli、vuex、vue-router、axios 、echarts后台管理系统demo. 权限管理,用户管理,菜单管理。无限级菜单,下拉树形选择框
Stars: ✭ 1,135 (+1433.78%)
Mutual labels:  axios, vuex, vue-router, vue2
Vue Cli Multi Page
基于vue-cli模板的多页面多路由项目,一个PC端页面入口,一个移动端页面入口,且有各自的路由, vue+webpack+vue-router+vuex+mock+axios
Stars: ✭ 145 (+95.95%)
Mutual labels:  axios, vuex, vue-router, vue2
Vuedemo sell eleme
ele by vue2.x 🐧
Stars: ✭ 1,349 (+1722.97%)
Mutual labels:  axios, vuex, vue-router, vue2
Vue Quasar Admin
Vue 2.0 admin-dashboard based on Quasar-Framework
Stars: ✭ 516 (+597.3%)
Mutual labels:  axios, vuex, vue-router, vue2
Seemusic
Vue 云音乐播放器,网易云音乐API,可听网易云高品质付费歌曲。 Vue music player
Stars: ✭ 112 (+51.35%)
Mutual labels:  axios, vuex, vue-router, vue2
Vue2 Study
vue 的webpack配置,按需加载,element-ui,vuex
Stars: ✭ 16 (-78.38%)
Mutual labels:  axios, vuex, vue-router, vue2
Vue2 Shop
A shop developed with Vue2 + Vue-router + Axios + Vuex + Node + Express + MongoDB + Webpack
Stars: ✭ 103 (+39.19%)
Mutual labels:  axios, vuex, vue-router, vue2
Vue News
Vue2.5知乎日报单页应用
Stars: ✭ 300 (+305.41%)
Mutual labels:  axios, vuex, vue-router, vue2
Vue Testing Examples
Advanced testing with vuejs. When you need to go beyond Getting started section and see some real world example with everything that proper tests should have.
Stars: ✭ 288 (+289.19%)
Mutual labels:  axios, vuex, vue-router, vue2
Vue2 Admin
基于vue-element-admin、Vue2 权限、监控、管理系统(包含地图等嵌套)
Stars: ✭ 74 (+0%)
Mutual labels:  axios, vuex, vue-router, vue2
Vue Music Player
🎵Vue.js写一个音乐播放器+📖One(一个).A music player + One by Vue.js
Stars: ✭ 729 (+885.14%)
Mutual labels:  axios, vuex, vue-router, vue2
Vue Cnode
🔥Vue.js打造一个开源的CNode社区。CNode by Vue.js
Stars: ✭ 249 (+236.49%)
Mutual labels:  axios, vuex, vue-router, vue2
Vue Home
🏠 A simple project(Vue Community SPA) which bases on vue+vue-cli+vue-router+axios+ scss.
Stars: ✭ 256 (+245.95%)
Mutual labels:  axios, vuex, vue-router, vue2
Vue Music
基于vue2.0的网易云音乐播放器,api来自于NeteaseCloudMusicApi,v2.0为最新版本
Stars: ✭ 855 (+1055.41%)
Mutual labels:  axios, vuex, vue-router, vue2
Vue Qq
🎨 Vue family bucket with socket.io and express/koa2 , create a web version of mobile QQ, supporting real-time group chat, real-time private chat, special care, shielding chat, smart IP geographic location, real-time display temperature and other QQ core functions
Stars: ✭ 861 (+1063.51%)
Mutual labels:  axios, vuex, vue-router, vue2
Pretty Vendor
[零食商贩] - 基于vue全家桶 + koa2 + sequelize + mysql 搭建的移动商城应用
Stars: ✭ 57 (-22.97%)
Mutual labels:  vuex, vue-router, vue2
Jdf Phone Ui
🖖 前端混合开发整合框架(cordova插件,微信,H5)
Stars: ✭ 18 (-75.68%)
Mutual labels:  axios, vuex, vue-router
Mall Admin Web
mall-admin-web是一个电商后台管理系统的前端项目,基于Vue+Element实现。 主要包括商品管理、订单管理、会员管理、促销管理、运营管理、内容管理、统计报表、财务管理、权限管理、设置等功能。
Stars: ✭ 9,123 (+12228.38%)
Mutual labels:  axios, vuex, vue-router
Vue Chat
👥Vue全家桶+Socket.io+Express/Koa2打造一个智能聊天室。
Stars: ✭ 887 (+1098.65%)
Mutual labels:  vuex, vue-router, vue2

vue-mall

微信公众号测试项目

测试功能

1、微信网页授权

授权方案采用 image

图片引用地址SegmentFault

这种授权在第4步请求服务器返回token后,vue客服端直接重定向到最开始进入的页面

    let params = { ...to.query }
    // api接口登录
    wxmp.login(params).then(res => {
      setToken(res.data.token)
      window.location.href = window.location.origin + getToUrl()
    })

2、微信自定义分享

微信分享使用的是history模式实现自定义分享

经过测试实现步骤如下:

  • 授权后进入router.beforeEach时判断系统类型,是IOS系统就记录当前URL到vuex中

注意:如果进入路由有重定向,需要加入重定向后的路由名称,比如'/'重定向到'/home'

    if (!Vue.device.isAndroid) {
      if (!store.state.app.iosJsUrl) {
        let landingPage = document.URL
        // 如果进入路由有跳转需要加入跳转后的路由名称,比如/跳转到/home
        if (to.name === HOME && landingPage.indexOf(HOME) === -1) {
          landingPage = landingPage + HOME
        }
        store.commit(types.SET_WX_JS_URL, {iosJsUrl: landingPage})
      }
    }
  • 进入router.afterEach时判断系统类型,获取不同的jssdk签名地址
router.afterEach(to => {
  // store.commit(types.UPDATE_LOADING_STATUS, {isLoading: false})
  let _url = window.location.origin + to.fullPath
  if (!Vue.device.isAndroid) {
    _url = store.state.app.iosJsUrl.split('#')[0]
  }
  wechat.getJSSDK(_url)
})
  • vue全局公用函数实现分享
  Vue.prototype.wxShare = wechat.setWxShare

  setWxShare (title, desc, link, imgUrl) {
    Vue.wechat.ready(() => {
      // 分享给朋友
      Vue.wechat.onMenuShareAppMessage({
        title: title, // 分享标题
        desc: desc,   // 分享描述
        link: link,   // 分享链接 默认以当前链接
        imgUrl: imgUrl, // 分享图标
        success () {
        },
        cancel () {
        }
      })
      // 分享到朋友圈
      Vue.wechat.onMenuShareTimeline({
        title: title, // 分享标题
        desc: desc,   // 分享描述
        link: link,   // 分享链接 默认以当前链接
        imgUrl: imgUrl, // 分享图标
        success () {
        },
        cancel () {
        }
      })
    })
  }
  • 页面中调用wxShare实现自定义分享
  activated () {
    this.share()
  },
  methods: {
    share () {
      let link = window.location.href.split('#')[0]
      this.wxShare('首页', '首页内容', link, 'https://o3e85j0cv.qnssl.com/tulips-1083572__340.jpg')
    }
  }

最后最重要的一点是:

调试分享的时候使用域名地址,不要使用ip+端口

调试分享的时候使用域名地址,不要使用ip+端口

调试分享的时候使用域名地址,不要使用ip+端口

重要的事情得说三遍,被这个坑惨了

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report

# run unit tests
npm run unit

# run e2e tests
npm run e2e

# run all tests
npm test

For a detailed explanation on how things work, check out the guide and docs for vue-loader.

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].