Commit 681641f5 by 张立顺

v4.11.0 功能开发

1 parent 02dda58d
......@@ -8,16 +8,31 @@ module.exports = {
parser: 'babel-eslint'
},
rules: {
'vue/max-attributes-per-line': [
2,
{
singleline: 10,
multiline: {
max: 1,
allowFirstLine: false
}
}
],
// 强制第一个属性的位置(属性换行)
'vue/first-attribute-linebreak': 'off',
// [
// 2,
// {
// // 单行时,第一属性前不允许使用换行符
// singleline: 'beside',
// // 多行时,第一属性前必须使用换行符
// multiline: 'beside'
// }
// ],
// 强制每行的最大属性数
'vue/max-attributes-per-line': 'off',
// [
// 2,
// {
// // 单行时可以接收最大数量
// singleline: 10,
// // 多行时可以接收最大数量
// multiline: {
// max: 1
// }
// }
// ],
'"vue/max-attributes-per-line"': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/multiline-html-element-content-newline': 'off',
'vue/name-property-casing': ['error', 'PascalCase'],
......
......@@ -10,12 +10,14 @@ module.exports = {
// selectorBlackList: ['van-','ignore','ign-','.hairlines']
// },
'postcss-px-to-viewport': {
viewportWidth: 375, // 视窗的宽度,对应的是我们设计稿的宽度,一般是750
// viewportWidth: 375, // 视窗的宽度,对应的是我们设计稿的宽度,一般是750
viewportWidth: 750, // 视窗的宽度,对应的是我们设计稿的宽度,一般是750
unitPrecision: 3, // 指定`px`转换为视窗单位值的小数位数(很多时候无法整除)
viewportUnit: 'vw', // 指定需要转换成的视窗单位,建议使用vw
selectorBlackList: ['.ignore', '.hairlines', 'ign-'], // 指定不转换为视窗单位的类,可以自定义,可以无限添加,建议定义一至两个通用的类名
minPixelValue: 1, // 小于或等于`1px`不转换为视窗单位,你也可以设置为你想要的值
exclude: [/node_modules/],
mediaQuery: false // 允许在媒体查询中转换`px`
}
}
}
\ No newline at end of file
}
......@@ -19,6 +19,7 @@
to continue.</strong>
</noscript>
<div id="app"></div>
<!-- 接入支付宝sdk -->
<script src="https://gw.alipayobjects.com/as/g/h5-lib/alipayjsapi/3.1.1/alipayjsapi.min.js"> </script>
<!-- <script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script> -->
<!-- <script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script> -->
......
import request from './request'
import RequestMethods from './request.methods'
const path = 'dj.api.'
export function getProductType(data) {
data.method = `${path}goods.type.list`
return request(data)
const path = 'dj.api.smartcarlife.'
// /router/dj.api.smartcarlife.alipay.oauth.token
// 支付宝授权码换取用户ID
export function alipayOauthToken(data) {
data.method = `${path}alipay.oauth.token`
return request(data, RequestMethods.POST)
}
// 银行列表
export function getBankListApi(data) {
data.method = `${path}yseBankInfo.bankList`
// 发起支付
export function createWxPayH5(data) {
data.method = `${path}payOrder.createWxPayH5.noLogin`
console.log(data)
return request(data, RequestMethods.POST)
}
......@@ -13,7 +13,7 @@ import { baseConfig } from '@/main'
const request = (params = {}, method = RequestMethods.GET, noSignAttr = [], options) => {
// console.log(baseConfig)
// params.source = 'glsx'
console.log(params)
// console.log(params)
// params.appKey = 'd7ffc3346fc9a45bccaaa35300d59022'
params.appKey = baseConfig?.axios?.appkey
// clg
......@@ -35,7 +35,6 @@ const request = (params = {}, method = RequestMethods.GET, noSignAttr = [], opti
const path = '/rop-dj-car-boutique/router'
// baseConfig.axios.baseURL + params.method
const url = `${baseConfig.axios.baseURL}${path}?method=${params.method}`
console.log(url)
// console.log(url)
/**
* 调后端接口,请使用以下代码。
......
......@@ -8,7 +8,7 @@ import sha1 from 'sha1'
import qs from 'qs'
import { baseConfig } from '@/main'
import { util } from '@/utils'
console.log(util)
// console.log(util)
// // 等后面再处理
// console.log(baseConfig)
......
......@@ -22,7 +22,10 @@ import { bus, tools, store as local, util } from './utils'
import './utils/util'
import 'components'
import { components } from '@/plugins/vant'
components.forEach(component => Vue.use(component))
components.forEach(component => {
// console.log(component)
Vue.use(component)
})
Vue.prototype.api = api
Vue.prototype.bus = bus
Vue.prototype.tools = tools
......@@ -44,9 +47,10 @@ var baseConfig = {
secret: '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
}
}
// const isMock = ['prod', 'production'].includes(process.env.NODE_ENV)
// 使用fetch 解决axios提前实例化导致sign里面的secret不能通过配置中心动态获取
fetch('http://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-car-life-alipay-config')
fetch('https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-car-life-alipay-config')
.then(
response => {
// 处理http响应
......@@ -58,65 +62,71 @@ fetch('http://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-ca
}
)
.then(response => {
console.log(response)
// console.log(response)
const { code, data } = response
code == '200' && ((baseConfig = data), (window.$fetchConfig = data))
// window.$fetchConfig = res
// console.log('data', data)
// if (data.vconsole)
new VConsole()
new Vue({
router,
store,
// i18n,
render: h => {
// data.axios.baseURL =
// 'http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router'
Vue.prototype.baseConfig = data
return h(App)
})
.catch(el => {
console.log(el)
baseConfig = {
sysName: '嘀加支付宝h5系统',
hasReg: false,
hasAuth: false,
vconsole: true,
env: 'develop',
axios: {
baseURL: 'http://192.168.3.226:9711',
appkey: '48e5e13229b82c1b4e6e8c96151f0637',
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
timeout: 50000,
result: {
data_key: 'data',
message_key: 'message',
code_key: 'code',
code_success_value: 0,
code_message_map: {}
}
}
// created () {
// 处理路由 得到每一级的路由设置
// this.$store.commit('d2admin/page/init', frameInRoutes)
// 设置顶栏菜单 (暂时不需要)
// this.$store.commit('d2admin/menu/headerSet', menuHeader)
// 设置侧边栏菜单 (TODO 进行过滤)
// this.$store.commit('d2admin/menu/asideSet', menuAside)
// 初始化菜单搜索功能
// this.$store.commit('d2admin/search/init', menuHeader)
// },
// created() {
// // 系统配置
// Vue.config.devtools = true
// // 展示系统信息
// this.$store.commit('d2admin/releases/versionShow')
// // 用户登录后从数据库加载一系列的设置
// this.$store.dispatch('d2admin/account/load')
// // 获取并记录用户 UA
// this.$store.commit('d2admin/ua/get')
// // 初始化全屏监听
// this.$store.dispatch('d2admin/fullscreen/listen')
// },
// mounted() {}
}).$mount('#app')
}
})
// fetchConfig(!isMock).then(res => {
// // 从配置服务器获取动态配置
// // 设置 js中可以访问 $cdn
// Vue.use(cfg)
// window.$fetchConfig = res
// if (res.vconsole) new VConsole()
// /** 登录过期 重新登录 */
// // window.reLogin = () => {
// // console.log('重新登录')
// // // util.clearSessionId()
// // }
// window.vm = new Vue({
// el: '#app',
// router,
// store,
// render: h => h(App)
// })
// })
.finally(() => {
init()
})
function init() {
new VConsole()
new Vue({
router,
store,
// i18n,
render: h => {
// data.axios.baseURL =
// 'http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router'
// Vue.prototype.baseConfig = data
return h(App)
}
// created () {
// 处理路由 得到每一级的路由设置
// this.$store.commit('d2admin/page/init', frameInRoutes)
// 设置顶栏菜单 (暂时不需要)
// this.$store.commit('d2admin/menu/headerSet', menuHeader)
// 设置侧边栏菜单 (TODO 进行过滤)
// this.$store.commit('d2admin/menu/asideSet', menuAside)
// 初始化菜单搜索功能
// this.$store.commit('d2admin/search/init', menuHeader)
// },
// created() {
// // 系统配置
// Vue.config.devtools = true
// // 展示系统信息
// this.$store.commit('d2admin/releases/versionShow')
// // 用户登录后从数据库加载一系列的设置
// this.$store.dispatch('d2admin/account/load')
// // 获取并记录用户 UA
// this.$store.commit('d2admin/ua/get')
// // 初始化全屏监听
// this.$store.dispatch('d2admin/fullscreen/listen')
// },
// mounted() {}
}).$mount('#app')
}
export { baseConfig }
......@@ -8,88 +8,90 @@
*/
// 按需全局引入 vant组件
import {
Button,
List,
Cell,
Tabbar,
TabbarItem,
NavBar,
Search,
ActionSheet,
CellGroup,
Image as VanImage,
Tag,
Field,
Stepper,
Divider,
Step,
Steps,
NoticeBar,
RadioGroup,
Radio,
Uploader,
Tab,
Tabs,
DropdownMenu,
DropdownItem,
Grid,
GridItem,
Popup,
Calendar,
Cascader,
Checkbox,
CheckboxGroup,
Notify,
Icon,
Empty,
PullRefresh,
Picker,
Dialog,
ShareSheet,
Overlay,
loading,
SwipeCell
// Button,
// List,
// Cell,
// Tabbar,
// TabbarItem,
// NavBar,
// Search,
// ActionSheet,
// CellGroup,
// Image as VanImage,
// Tag,
// Field,
// Stepper,
// Divider,
// Step,
// Steps,
// NoticeBar,
// RadioGroup,
// Radio,
// Uploader,
// Tab,
// Tabs,
// DropdownMenu,
// DropdownItem,
// Grid,
// GridItem,
// Popup,
// Calendar,
// Cascader,
// Checkbox,
// CheckboxGroup,
// Notify,
// Icon,
// Empty,
// PullRefresh,
// Picker,
// Dialog,
// ShareSheet,
// Overlay,
// loading,
// SwipeCell
Toast
} from 'vant'
export const components = [
Button,
List,
Cell,
Tabbar,
TabbarItem,
NavBar,
Search,
ActionSheet,
CellGroup,
VanImage,
Tag,
Field,
Stepper,
Divider,
Step,
Steps,
NoticeBar,
RadioGroup,
Radio,
Uploader,
Tab,
Tabs,
DropdownMenu,
DropdownItem,
Grid,
GridItem,
Popup,
Calendar,
Cascader,
Checkbox,
CheckboxGroup,
Notify,
Icon,
Empty,
PullRefresh,
Picker,
Dialog,
ShareSheet,
Overlay,
loading,
SwipeCell
]
\ No newline at end of file
Toast
// Button,
// List,
// Cell,
// Tabbar,
// TabbarItem,
// NavBar,
// Search,
// ActionSheet,
// CellGroup,
// VanImage,
// Tag,
// Field,
// Stepper,
// Divider,
// Step,
// Steps,
// NoticeBar,
// RadioGroup,
// Radio,
// Uploader,
// Tab,
// Tabs,
// DropdownMenu,
// DropdownItem,
// Grid,
// GridItem,
// Popup,
// Calendar,
// Cascader,
// Checkbox,
// CheckboxGroup,
// Notify,
// Icon,
// Empty,
// PullRefresh,
// Picker,
// Dialog,
// ShareSheet,
// Overlay,
// loading,
// SwipeCell
]
......@@ -33,7 +33,20 @@ function createRouter() {
}
// http://scrm.dev.glsx.com.cn/dj-scrm-wx-work-attachment-activity/
router.beforeEach((to, from, next) => {
// // 判断当前浏览器环境 不是支付宝就跳转提示页面
const AlipayClient = /AlipayClient/.test(window.navigator.userAgent)
// console.log(AlipayClient)
// if (!AlipayClient && to.path !== '/tipsPage') return next('/tipsPage')
// if (/MicroMessenger/.test(window.navigator.userAgent)) {
// alert('微信客户端')
// } else if () {
// alert('支付宝客户端')
// } else {
// alert('其他浏览器')
// }
/* 路由发生变化修改页面title */
console.log('meta', to)
if (to.meta.title) {
store.dispatch('setPageMeta', to.meta)
} else {
......
......@@ -89,6 +89,18 @@ const routes = [
component: () => import('@/views/layouts')
},
{
path: '/tipsPage',
name: 'tipsPage',
meta: {
title: '提示'
},
// redirect: {
// name: 'index'
// },
// component: import('@/views/layouts/index')
component: () => import('@/views/tipsPage')
},
{
// path: '/ailpay',
path: '/',
redirect: { name: 'index' },
......@@ -99,6 +111,9 @@ const routes = [
// 支付页面
path: '/alipay',
name: 'alipay',
meta: {
title: '支付宝支付'
},
component: () => import('@/views/alipay')
}
]
......
......@@ -24,7 +24,7 @@
<script>
import { mapGetters } from 'vuex'
import { getProductType, getBankListApi } from '@/api/alipayApi'
// import { getProductType, getBankListApi } from '@/api/alipayApi'
export default {
name: 'AppLayout',
computed: {
......
<template>
<div class="cont">
<img class="tipIcon"
src="../images/tipIcon.png"
alt="">
<p class="tips">请使用支付宝扫描二维码完成支付</p>
</div>
</template>
<script>
export default {
}
</script>
<style scoped lang="scss">
.cont {
display: flex;
flex-direction: column;
align-items: center;
.tips {
font-size: 28px;
}
}
.tipIcon {
width: 120px;
height: 120px;
margin: 70px 0 30px;
}
</style>
......@@ -5,7 +5,8 @@ const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPl
const resolve = dir => path.join(__dirname, dir)
// page title
const name = defaultSettings.title || 'vue mobile template'
// const name = defaultSettings.title || 'vue mobile template'
const name = '嘀加 支付宝'
// 生产环境,测试和正式
const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV)
// externals
......@@ -61,6 +62,7 @@ module.exports = {
productionSourceMap: false, // 如果不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
devServer: {
disableHostCheck: true,
// port: 8080, // 端口
port: 80, // 端口
open: false, // 启动后打开浏览器
// public: 'http://scrm.dev.glsx.com.cn/dj-scrm-wx-work-main/#/',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!