baoqu-vue-utils-mobile

0.0.53 • Public • Published

Build Setup

入口mainjs中引用
import { router, urlUtils, cache, createPersistedState, NetworkAccessor, Network, SecurityType } from fengqu-vue-utils-mobile

cache


  |---cacheInit
  |---getDeviceId
  |---getToken
  |---getUserInfo
  |---getAppId
  |---getCsrfToken
  |---isLogin
  |---clear
get对应的都有set方法
......

filter


  |---badge (badge)
  |---currency (price, needSymbol = false, needPoint = false, denominator = 100.0)
  |---imageFormat (url, width, height, cut = 1)
  第一个参数不传默认使用对象
  ......

msg


  |---toast (message, position = 'center', duration = 3000)
  |---loading
    |---show
    |---hide
  对象已已注册到全局
  Vue.$toast(message, position = 'center', duration = 3000)
  Vue.$loading.show()
  Vue.$loading.hide()

router

  import { router } from 'fengqu-vue-utils-mobile'
  Vue.use(router, routerConfig)
  routerConfig为当前页面配置的路由规则,例
  routerConfig = {
    wowIndex: {
      path: '/pages/index/index',
      needLogin: false,
      type: 'mini',
      inTab: true
    },
    seat: {
      path: '/pages/shop/shopScanningList/index',
      type: 'mini',
      needLogin: false
    }
  }

scan


  对象已已注册到全局
  Vue.prototype.$scan({
    getBarcode, 此处是条码.默认接受条码code,不可传
    getIceStoreId, 此处调用冰柜开门接口,默认接受storeid,如方法不传将直接跳转冰柜首页
    getBoxStoreId, 此处调用盒子开门接口,默认接受storeid,如方法不传将直接跳转盒子首页,并接受参数storeid, type
    closeBoxStoreId, 此处调用盒子关门接口,默认接受storeid,如方法不传将直接跳转盒子首页, 并接受参数storeid, type
    AddItemsForStore, 此处调用盒子加车接口,接受参数[{ itemId, num: 1 }],如不传将不加车
    boxScanJoin, 此处调用盒子加车成功回调接口,如不传将加车成功并跳转盒子首页带参数storeid
    mScanJoin,此处调用冰柜加车成功回调接口,如不传将加车成功并跳转商圈首页
  })

storage


  对象已已注册到全局
  Object  = {
    key: value,
    expiresDays: 2(过期天数)
  }
  Vue.$storage.setStorage(Object)
  Vue.$storage.getStorage('key')
  Vue.$storage.removeStorage('key')

urlUtils


|---getURL (path, params) 返回完整带参url
|---getURLPathKey (url) 通过url返回当前url在路由中的key,必须符合业务配置的域名规则才可获取
|---getParams (url) 通过url返回当前url的参数,包括非?的参数,必须符合业务配置的域名规则才可获取

createPersistedState


  import { createPersistedState } from fengqu-vue-utils-mobile
  vue 缓存
  vuex-store中使用
  plugins: [createPersistedState]

Network

NetworkAccessor
使用方法
let network = new WowShopcart_AddItemsForStore(params)
return NetworkAccessor.sendRequest(network)
Network  请求默认参数
SecurityType  加密类型
......

后续更新中。。。。。

Readme

Keywords

none

Package Sidebar

Install

npm i baoqu-vue-utils-mobile

Weekly Downloads

1

Version

0.0.53

License

ISC

Unpacked Size

33.4 kB

Total Files

19

Last publish

Collaborators

  • evanxiao