Joeshu 3 years ago
parent
commit
64661b54b0
6 changed files with 22 additions and 244 deletions
  1. 0 1
      .env.development
  2. 0 1
      .env.production
  3. 1 207
      src/apis/index.js
  4. 7 23
      src/store/index.js
  5. 1 1
      src/utils/index.js
  6. 13 11
      src/views/home/index.vue

+ 0 - 1
.env.development

@@ -1,4 +1,3 @@
-NODE_ENV = 'development'
 
 # 自定义环境变量
 VUE_APP_ENV = 'dev'

+ 0 - 1
.env.production

@@ -1,4 +1,3 @@
-NODE_ENV = 'production'
 
 # 自定义环境变量
 VUE_APP_ENV = 'prod'

+ 1 - 207
src/apis/index.js

@@ -54,11 +54,8 @@ export function cloud_card(data) {
  * 云卡有效期查询(查询)
  */
 export function cloud_cardTtl(data) {
-  const params = Object.keys(data)
-    .map((key) => key + '=' + encodeURIComponent(data[key]))
-    .join('&')
   return request({
-    url: `/api/wechat/front/cloud_card/ttl?${params}`,
+    url: `/api/wechat/front/cloud_card/ttl?${qs.stringify(data)}`,
     method: 'post',
     data,
   })
@@ -76,116 +73,6 @@ export function apiUserInfo(data) {
 }
 
 /**
- * apiOrgList
- */
-export function apiOrgList(data) {
-  return request({
-    url: `/api/wechat/front/common/wechatPublicOrgList`,
-    method: 'get',
-    params: data,
-  })
-}
-
-/**
- * apiServesList
- */
-export function apiServesList(data) {
-  return request({
-    url: `/api/wechat/front/common/serves`,
-    method: 'post',
-    data: qs.stringify(data),
-  })
-}
-
-/**
- * apiIndexServes
- */
-export function apiIndexServes(data) {
-  return request({
-    url: `/api/wechat/front/common/indexServes`,
-    method: 'post',
-    data: qs.stringify(data),
-  })
-}
-
-/**
- * apiUserSign
- */
-export function apiUserSign(data) {
-  return request({
-    url: `/api/wechat/front/login`,
-    method: 'post',
-    data: qs.stringify(data),
-  })
-}
-
-/**
- * apiUserCode
- */
-export function apiUserCode(data) {
-  return request({
-    url: `/api/wechat/front/smsCode`,
-    method: 'post',
-    data: qs.stringify(data),
-  })
-}
-
-/**
- * apiUserOtherInfo
- */
-export function apiUserOtherInfo(data) {
-  return request({
-    url: `/api/organisation/wechat/front/user/getOtherUserInfo`,
-    method: 'post',
-    data: qs.stringify(data),
-  })
-}
-
-/**
- * apiGetRecommendInfo
- */
-export function apiGetRecommendInfo(data) {
-  return request({
-    url: `/api/wechat/front/common/getRecommendInfo`,
-    method: 'post',
-    data: qs.stringify(data),
-  })
-}
-
-/**
- * apiGetNoticeList
- */
-export function apiGetNoticeList(data) {
-  return request({
-    url: `${getAPI('origin')}/super_service/wechat/notice/noticeList`,
-    method: 'post',
-    data: qs.stringify(data),
-  })
-}
-
-/**
- * apiGetBannerList
- */
-export function apiGetBannerList(data) {
-  return request({
-    url: `${getAPI('origin')}/super_service/wechat/notice/bannerList`,
-    method: 'post',
-    data: qs.stringify(data),
-  })
-}
-
-/**
- * changeMobile
- */
-export function changeMobile(data) {
-  return request({
-    url: `/api/wechat/front/changeMobile`,
-    method: 'post',
-    data: qs.stringify(data),
-  })
-}
-
-/**
  * logout
  */
 export function logout(data) {
@@ -197,82 +84,6 @@ export function logout(data) {
 }
 
 /**
- * getBanner
- */
-export function getBanner(data) {
-  return request({
-    url: `/api/notify/wechat/notice/getBanner`,
-    method: 'post',
-    data: qs.stringify(data),
-  })
-}
-
-/**
- * 企业邀请码
- */
-export function getCompInviteURL(data) {
-  return request({
-    url: `/api/wechat/front/common/getCompInviteURL`,
-    method: 'post',
-    data: qs.stringify(data),
-  })
-}
-
-/**
- * addUserToVir
- */
-export function addUserToVir(data) {
-  return request({
-    url: `/api/organisation/wechat/front/user/addUserToVir`,
-    method: 'post',
-    data: qs.stringify(data),
-  })
-}
-
-/**
- * 加入企业
- */
-export function addVirWhiteUser(data) {
-  return request({
-    url: `/api/organisation/wechat/front/user/addVirWhiteUser`,
-    method: 'post',
-    data: qs.stringify(data),
-  })
-}
-
-/**
- * getEnterVirInfo
- */
-export function getEnterVirInfo(data) {
-  return request({
-    url: `/api/organisation/wechat/front/user/getVirInfo`,
-    method: 'post',
-    data: qs.stringify(data),
-  })
-}
-/**
- * 获取企业列表
- */
-export function getVirSelectList(key, data) {
-  return request({
-    url: `/api/organisation/wechat/front/user/getVirSelectList/${key}`,
-    method: 'get',
-    params: data,
-  })
-}
-
-/**
- * getVirAndUser
- */
-export function getVirAndUser(key, data) {
-  return request({
-    url: `/api/organisation/wechat/front/user/getVirAndUser/${key}`,
-    method: 'get',
-    params: data,
-  })
-}
-
-/**
  * 微信签名权限验证接口
  */
 export function getFenXiang(data) {
@@ -322,26 +133,9 @@ export function getWxConfig() {
 }
 
 export default {
-  // 服务之窗
   cloud_card,
   cloud_cardTtl,
   apiUserInfo,
-  apiOrgList,
-  apiServesList,
-  apiIndexServes,
-  apiUserSign,
-  apiUserCode,
-  apiUserOtherInfo,
-  apiGetRecommendInfo,
-  apiGetNoticeList,
-  apiGetBannerList,
-  getCompInviteURL,
-  addUserToVir,
-  addVirWhiteUser,
-  getEnterVirInfo,
-  getVirSelectList,
-  getVirAndUser,
-  changeMobile,
   logout,
   // 微信签名
   getFenXiang,

+ 7 - 23
src/store/index.js

@@ -1,15 +1,15 @@
 import Vue from 'vue'
 import Vuex from 'vuex'
-import { getLocalforage, setLocalforage, fromCamelCase, appendCss } from '@/utils'
+import { fromCamelCase, appendCss } from '@/utils'
 import { getProjectConfigProvider } from '@/apis'
 
 Vue.use(Vuex)
 
 export default new Vuex.Store({
   state: {
-    pid: getLocalforage('pid', ''),
-    openId: getLocalforage('openId', ''),
-    manifest: {},
+    manifest: {
+      theme: {},
+    },
     token: '',
   },
   getters: {
@@ -19,37 +19,21 @@ export default new Vuex.Store({
     theme: (state) => {
       return state.manifest.theme
     },
-    pid: (state) => state.pid,
-    openId: (state) => state.openId,
   },
   mutations: {
+    saveManifest(state, data) {
+      state.manifest = data
+    },
     login(state, data = {}) {
       state.token = data.token
     },
     logout(state, data) {
       state.token = ''
     },
-    setPid(state, payload) {
-      state.pid = payload
-      setLocalforage('pid', payload)
-    },
-    setOpenId(state, payload) {
-      state.openId = payload
-      setLocalforage('openId', payload)
-      setLocalforage('openid', payload)
-      sessionStorage.setItem('openId', payload)
-      sessionStorage.setItem('openid', payload)
-    },
-    saveManifest(state, data) {
-      state.manifest = data
-    },
   },
   actions: {
     /**
      * 获取项目个性化配置
-     * @param {*} param0
-     * @param {*} params
-     * @returns
      */
     async getServiceConfigProvider({ commit }, params) {
       return await getProjectConfigProvider(params).then((res) => {

+ 1 - 1
src/utils/index.js

@@ -130,7 +130,7 @@ export function getEnv() {
  */
 export function getAPI(code = 'api') {
   const host = process.env.NODE_ENV === 'production' ? location.host : process.env.VUE_APP_BASE_HOST
-  const basePath = process.env.NODE_ENV === 'production' ? `/${location.pathname.split('/')[1]}` : '/merge_cloud' // 基础部署路径
+  const basePath = process.env.NODE_ENV === 'production' ? `/${location.pathname.split('/')[1]}` : '/super_cloud' // 基础部署路径
   const origin = `//${host}`
   const api = `${origin}${basePath}`
 

+ 13 - 11
src/views/home/index.vue

@@ -140,6 +140,7 @@ const openList2 = [
     label: '扫一扫',
     value: 3,
     icon: require('@/assets/images/icon_scan.png'),
+    func: 'onWeChatScan',
   },
 ]
 
@@ -182,6 +183,7 @@ export default {
         expired: false,
         expiredText: '二维码已失效',
       },
+      list0: [],
       list: [],
       list2: [],
       timer: null,
@@ -212,17 +214,6 @@ export default {
       this.onPage('handle')
     }, 1000),
     onCellClick(item) {
-      // if (type === 'scan') {
-      //   wx.scanQRCode({
-      //     needResult: 0, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
-      //     scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有
-      //     success: function (res) {
-      //       let result = res.resultStr // 当needResult 为 1 时,扫码返回的结果
-      //       console.log(result)
-      //     },
-      //   })
-      //   return
-      // }
       if (item.func) {
         this[item.func](item)
       } else {
@@ -234,6 +225,17 @@ export default {
         url: '/pages/weChatPayView/weChatPayView',
       })
     },
+    onWeChatScan() {
+      wx.scanQRCode({
+        needResult: 0,
+        scanType: ['qrCode', 'barCode'],
+        success: (res) => {
+          console.log(`[wx.scanQRCode]`, res)
+          let { resultStr } = res
+          alert(resultStr)
+        },
+      })
+    },
     openListModel(data) {
       return openList0.filter((v) => {
         // 显示微信支付,1-小程序 2-公众号 3-小程序加公众号