Commit 62a2110d by 张立顺

Merge branch 'dev_v4.11.0' into 'master'

Dev v4.11.0

See merge request !1
2 parents 05d7bc21 34ea879b
auth.token=45d2be625091494b9a0de35af25bb273c0a471650575471096d60dd61f6995e6
defaults.url = http://sentry.glsx.com.cn
defaults.org = sentry
defaults.project =dj-car-alipay
...@@ -11,7 +11,7 @@ const plugins = [ ...@@ -11,7 +11,7 @@ const plugins = [
'vant' 'vant'
] ]
] ]
// 去除 console.log // 去除 console.log 先打开调试
if (IS_PROD) { if (IS_PROD) {
plugins.push('transform-remove-console') plugins.push('transform-remove-console')
} }
......
{ {
"name": "gh-hall", "name": "dj-car-alipay",
"version": "1.0.0", "version": "1.0.0",
"description": "GH Hall By Work WeChat", "description": "dj-car-alipay By h5",
"author": "limin <limin.mail@qq.com>", "author": "limin <limin.mail@qq.com>",
"private": true, "private": true,
"scripts": { "scripts": {
...@@ -12,11 +12,18 @@ ...@@ -12,11 +12,18 @@
"dev": "set NODE_OPTIONS=--openssl-legacy-provider && npm run serve" "dev": "set NODE_OPTIONS=--openssl-legacy-provider && npm run serve"
}, },
"dependencies": { "dependencies": {
"@sentry/browser": "^7.12.1",
"@sentry/integrations": "^7.12.1",
"@sentry/tracing": "^7.12.1",
"@sentry/vue": "^7.12.1",
"@sentry/webpack-plugin": "^1.19.0",
"autoprefixer": "^8.0.0", "autoprefixer": "^8.0.0",
"axios": "^0.27.2", "axios": "^0.27.2",
"build": "^0.1.4",
"core-js": "^3.6.4", "core-js": "^3.6.4",
"dayjs": "^1.10.5", "dayjs": "^1.10.5",
"lib-flexible": "^0.3.2", "lib-flexible": "^0.3.2",
"npm": "^5.8.0",
"postcss-loader": "^6.2.0", "postcss-loader": "^6.2.0",
"qs": "^6.11.0", "qs": "^6.11.0",
"sass": "^1.54.4", "sass": "^1.54.4",
...@@ -40,6 +47,7 @@ ...@@ -40,6 +47,7 @@
"babel-plugin-transform-remove-console": "^6.9.4", "babel-plugin-transform-remove-console": "^6.9.4",
"eslint": "^6.7.2", "eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2", "eslint-plugin-vue": "^6.2.2",
"file-loader": "^4.0.0",
"postcss-px-to-viewport": "^1.1.1", "postcss-px-to-viewport": "^1.1.1",
"postcss-pxtorem": "^5.1.1", "postcss-pxtorem": "^5.1.1",
"sass-loader": "^8.0.2", "sass-loader": "^8.0.2",
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
<meta name="viewport" <meta name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no,viewport-fit=cover"> content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no,viewport-fit=cover">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.css) { %> <!-- <% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.css) { %>
<link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="preload" as="style" /> <link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="preload" as="style" />
<link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="stylesheet" /> <link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="stylesheet" />
<% } %> <% } %> -->
<title> <title>
<%= webpackConfig.name %> <%= webpackConfig.name %>
</title> </title>
...@@ -24,9 +24,9 @@ ...@@ -24,9 +24,9 @@
<!-- <script src="//res.wx.qq.com/open/js/jweixin-1.2.0.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> --> <!-- <script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script> -->
<!-- 使用CDN加速的JS文件,配置在vue.config.js下 --> <!-- 使用CDN加速的JS文件,配置在vue.config.js下 -->
<% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.js) { %> <!-- <% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.js) { %>
<script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script> <script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
<% } %> <% } %> -->
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
</body> </body>
......
...@@ -5,7 +5,9 @@ const path = 'dj.api.smartcarlife.' ...@@ -5,7 +5,9 @@ const path = 'dj.api.smartcarlife.'
// /router/dj.api.smartcarlife.alipay.oauth.token // /router/dj.api.smartcarlife.alipay.oauth.token
// 支付宝授权码换取用户ID // 支付宝授权码换取用户ID
export function alipayOauthToken(data) { export function alipayOauthToken(data) {
console.log('data', data)
data.method = `${path}alipay.oauth.token` data.method = `${path}alipay.oauth.token`
console.log('data', data)
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
// 发起支付 // 发起支付
......
...@@ -116,10 +116,11 @@ service.interceptors.response.use( ...@@ -116,10 +116,11 @@ service.interceptors.response.use(
// subErrors: null // subErrors: null
// } // }
const dataAxios = response.data const dataAxios = response.data
console.log('dataAxios', dataAxios)
const ruleResult = baseConfig.axios.result const ruleResult = baseConfig.axios.result
// 这个状态码是和后端约定的 // 这个状态码是和后端约定的
// 有 code 代表这是一个后端接口 可以进行进一步的判断 // 有 code 代表这是一个后端接口 可以进行进一步的判断
var goBackArr = ['20', '21'] // var goBackArr = ['20', '21']
// console.log(dataAxios[ruleResult.code_key]) // console.log(dataAxios[ruleResult.code_key])
// if (goBackArr.includes(dataAxios[ruleResult.code_key])) { // if (goBackArr.includes(dataAxios[ruleResult.code_key])) {
// // await store.dispatch('d2admin/account/logout') // // await store.dispatch('d2admin/account/logout')
...@@ -141,6 +142,7 @@ service.interceptors.response.use( ...@@ -141,6 +142,7 @@ service.interceptors.response.use(
}, },
error => { error => {
console.log(error, 'error')
if (error && error.response) { if (error && error.response) {
switch (error.response.status) { switch (error.response.status) {
case 400: case 400:
......
<template> <template>
<van-overlay :show="show"> <van-overlay :show="show">
<!-- z-index="9999999" --> <!-- z-index="9999999" -->
<div <div class="wrapper"
class="wrapper" @click.stop>
@click.stop
>
<div class="img"> <div class="img">
<div <div class="sprite-icon icon-poster-close"
class="sprite-icon icon-poster-close" @click.prevent="close"></div>
@click.prevent="close" <van-image :src="activityData.posterUrl"
></div>
<van-image
:src="activityData.posterUrl"
width="100%" width="100%"
height="100%" height="100%">
>
<template v-slot:loading> <template v-slot:loading>
<van-loading <van-loading type="spinner"
type="spinner" size="20" />
size="20"
/>
</template> </template>
</van-image> </van-image>
</div> </div>
<div class="btns flex"> <div class="btns flex">
<div <div class="save text-center"
class="save text-center" @click.prevent="save">保存到相册</div>
@click.prevent="save" <div class="share text-center"
>保存到相册</div> @click.prevent="share">分享</div>
<div
class="share text-center"
@click.prevent="share"
>分享</div>
</div> </div>
</div> </div>
</van-overlay> </van-overlay>
...@@ -47,7 +35,7 @@ export default { ...@@ -47,7 +35,7 @@ export default {
img: null img: null
} }
}, },
mounted() {}, mounted() { },
watch: { watch: {
value(n) { value(n) {
this.show = n this.show = n
...@@ -62,8 +50,8 @@ export default { ...@@ -62,8 +50,8 @@ export default {
this.showToast('请长按海报保存') this.showToast('请长按海报保存')
}, },
share() { share() {
let { currentItem, apiName, activityData } = this const { currentItem, apiName, activityData } = this
let flag = apiName != 'shopmallApi' const flag = apiName != 'shopmallApi'
if (currentItem.userId) { if (currentItem.userId) {
console.log(activityData) console.log(activityData)
window.$wx window.$wx
......
...@@ -16,19 +16,19 @@ ...@@ -16,19 +16,19 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
export default { export default {
name: 'ScrollView', name: 'ScrollView',
data () { data() {
return { return {
loading: false, loading: false,
finished: false, finished: false
} }
}, },
props: ['ScrollViewclass'], props: ['ScrollViewclass'],
mounted () { mounted() {
}, },
methods: { methods: {
onLoad () { onLoad() {
this.$emit('ReachBottom') this.$emit('ReachBottom')
}, }
} }
} }
</script> </script>
......
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
}, },
placeholder: String placeholder: String
}, },
data () { data() {
return { return {
value: 0, value: 0,
option: [ option: [
...@@ -54,15 +54,15 @@ export default { ...@@ -54,15 +54,15 @@ export default {
} }
}, },
watch: { watch: {
'updata' (n) { 'updata'(n) {
this.value = this.index this.value = this.index
}, },
'keyword' (n) { 'keyword'(n) {
this.searchValue = n this.searchValue = n
} }
}, },
methods: { methods: {
onEmit (e, name) { onEmit(e, name) {
this.$emit(name, e) this.$emit(name, e)
} }
} }
......
...@@ -38,28 +38,28 @@ export default { ...@@ -38,28 +38,28 @@ export default {
default: new Date().getTime() default: new Date().getTime()
} }
}, },
data () { data() {
return { return {
tabIndex: this.index, tabIndex: this.index,
data: this.list data: this.list
} }
}, },
watch: { watch: {
'index' (n) { 'index'(n) {
this.tabIndex = n this.tabIndex = n
}, },
'updata' (n) { 'updata'(n) {
this.data = this.list this.data = this.list
} }
}, },
mounted () { mounted() {
}, },
methods: { methods: {
click (tabIndex) { click(tabIndex) {
this.tabIndex = tabIndex this.tabIndex = tabIndex
this.$emit('change', tabIndex) this.$emit('change', tabIndex)
}, },
handleChange(id){ handleChange(id) {
this.tabIndex = id this.tabIndex = id
} }
} }
......
...@@ -32,13 +32,13 @@ export default { ...@@ -32,13 +32,13 @@ export default {
} }
} }
}, },
data () { data() {
return { return {
value: '' value: ''
} }
}, },
methods: { methods: {
change (value) { change(value) {
this.$emit('change', value) this.$emit('change', value)
} }
} }
......
...@@ -65,8 +65,8 @@ export default { ...@@ -65,8 +65,8 @@ export default {
name: 'VipDialog', name: 'VipDialog',
props: ['value', 'id'], props: ['value', 'id'],
watch: { watch: {
value (n) { value(n) {
let { id, component_id } = this const { id, component_id } = this
if (component_id == id && n) { if (component_id == id && n) {
this.showBox = true this.showBox = true
return return
...@@ -85,17 +85,17 @@ export default { ...@@ -85,17 +85,17 @@ export default {
} }
} }
}, },
data () { data() {
return { return {
showBox: false, showBox: false,
data: {}, data: {},
component_id: '' component_id: ''
} }
}, },
mounted () { mounted() {
}, },
methods: { methods: {
onCancel () { onCancel() {
this.$emit('cancel') this.$emit('cancel')
} }
} }
......
...@@ -11,5 +11,5 @@ const componentsFiles = require.context(`./`, true, /.vue$/) ...@@ -11,5 +11,5 @@ const componentsFiles = require.context(`./`, true, /.vue$/)
componentsFiles.keys().forEach(path => { componentsFiles.keys().forEach(path => {
const component = componentsFiles(path).default const component = componentsFiles(path).default
Vue.component(component.name, component) Vue.component(component.name, component)
})
// export default [Icon, NavBar, TabBar, Organization, CustomerList, CustomerDetail, OrderList, OrderDetail, TimerTabs, CarType, RadioCell, CheckBoxCell, ValidateField]
\ No newline at end of file \ No newline at end of file
})
// export default [Icon, NavBar, TabBar, Organization, CustomerList, CustomerDetail, OrderList, OrderDetail, TimerTabs, CarType, RadioCell, CheckBoxCell, ValidateField]
...@@ -47,6 +47,25 @@ var baseConfig = { ...@@ -47,6 +47,25 @@ var baseConfig = {
secret: '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353' secret: '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
} }
} }
import * as Sentry from '@sentry/vue'
import { BrowserTracing } from '@sentry/tracing'
// 实例化
// process.env.NODE_ENV === 'production' &&
Sentry.init({
Vue,
dsn: 'https://f0db411905b541eebe6d591707f561a4@sentry.glsx.com.cn/26',
integrations: [
new BrowserTracing({
routingInstrumentation: Sentry.vueRouterInstrumentation(router),
tracingOrigins: ['localhost', 'my-site-url.com', /^\//]
})
],
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production
tracesSampleRate: 1.0
})
// const isMock = ['prod', 'production'].includes(process.env.NODE_ENV) // const isMock = ['prod', 'production'].includes(process.env.NODE_ENV)
// 使用fetch 解决axios提前实例化导致sign里面的secret不能通过配置中心动态获取 // 使用fetch 解决axios提前实例化导致sign里面的secret不能通过配置中心动态获取
...@@ -62,12 +81,13 @@ fetch('https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-c ...@@ -62,12 +81,13 @@ fetch('https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-c
} }
) )
.then(response => { .then(response => {
// console.log(response) console.log(response)
const { code, data } = response const { code, data } = response
code == '200' && ((baseConfig = data), (window.$fetchConfig = data)) code == '200' && ((baseConfig = data), (window.$fetchConfig = data))
}) })
.catch(el => { .catch(el => {
console.log(el) // console.log(el)
baseConfig = { baseConfig = {
sysName: '嘀加支付宝h5系统', sysName: '嘀加支付宝h5系统',
hasReg: false, hasReg: false,
...@@ -93,7 +113,7 @@ fetch('https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-c ...@@ -93,7 +113,7 @@ fetch('https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-c
init() init()
}) })
function init() { function init() {
new VConsole() baseConfig.vconsole && new VConsole()
new Vue({ new Vue({
router, router,
store, store,
......
...@@ -24,8 +24,9 @@ const router = createRouter() ...@@ -24,8 +24,9 @@ const router = createRouter()
function createRouter() { function createRouter() {
return new Router({ return new Router({
// mode: 'history', // 如果是 history模式 需要配置vue.config.js publicPath // mode: 'history', // 如果是 history模式 需要配置vue.config.js publicPath
base: process.env.BASE_URL, base: 'dj-carlife-web-alipay',
scrollBehavior: function (to, from, savedPosition) { // base: process.env.BASE_URL,
scrollBehavior: function(to, from, savedPosition) {
return savedPosition || { x: 0, y: 0 } return savedPosition || { x: 0, y: 0 }
}, },
routes routes
...@@ -36,7 +37,7 @@ router.beforeEach((to, from, next) => { ...@@ -36,7 +37,7 @@ router.beforeEach((to, from, next) => {
// // 判断当前浏览器环境 不是支付宝就跳转提示页面 // // 判断当前浏览器环境 不是支付宝就跳转提示页面
const AlipayClient = /AlipayClient/.test(window.navigator.userAgent) const AlipayClient = /AlipayClient/.test(window.navigator.userAgent)
// console.log(AlipayClient) // console.log(AlipayClient)
// if (!AlipayClient && to.path !== '/tipsPage') return next('/tipsPage') if (!AlipayClient && to.path !== '/tipsPage') return next('/tipsPage')
// if (/MicroMessenger/.test(window.navigator.userAgent)) { // if (/MicroMessenger/.test(window.navigator.userAgent)) {
// alert('微信客户端') // alert('微信客户端')
......
...@@ -34,7 +34,7 @@ function typeColor(type = 'default') { ...@@ -34,7 +34,7 @@ function typeColor(type = 'default') {
* @param {String} info info text * @param {String} info info text
* @param {String} type style * @param {String} type style
*/ */
log.capsule = function (title, info, type = 'primary') { log.capsule = function(title, info, type = 'primary') {
console.log( console.log(
`%c ${title} %c ${info} %c`, `%c ${title} %c ${info} %c`,
'background:#35495E; padding: 1px; border-radius: 3px 0 0 3px; color: #fff;', 'background:#35495E; padding: 1px; border-radius: 3px 0 0 3px; color: #fff;',
...@@ -46,42 +46,42 @@ log.capsule = function (title, info, type = 'primary') { ...@@ -46,42 +46,42 @@ log.capsule = function (title, info, type = 'primary') {
/** /**
* @description 打印彩色文字 * @description 打印彩色文字
*/ */
log.colorful = function (textArr) { log.colorful = function(textArr) {
console.log(`%c${textArr.map(t => t.text || '').join('%c')}`, ...textArr.map(t => `color: ${typeColor(t.type)};`)) console.log(`%c${textArr.map(t => t.text || '').join('%c')}`, ...textArr.map(t => `color: ${typeColor(t.type)};`))
} }
/** /**
* @description 打印 default 样式的文字 * @description 打印 default 样式的文字
*/ */
log.default = function (text) { log.default = function(text) {
log.colorful([{ text }]) log.colorful([{ text }])
} }
/** /**
* @description 打印 primary 样式的文字 * @description 打印 primary 样式的文字
*/ */
log.primary = function (text) { log.primary = function(text) {
log.colorful([{ text, type: 'primary' }]) log.colorful([{ text, type: 'primary' }])
} }
/** /**
* @description 打印 success 样式的文字 * @description 打印 success 样式的文字
*/ */
log.success = function (text) { log.success = function(text) {
log.colorful([{ text, type: 'success' }]) log.colorful([{ text, type: 'success' }])
} }
/** /**
* @description 打印 warning 样式的文字 * @description 打印 warning 样式的文字
*/ */
log.warning = function (text) { log.warning = function(text) {
log.colorful([{ text, type: 'warning' }]) log.colorful([{ text, type: 'warning' }])
} }
/** /**
* @description 打印 danger 样式的文字 * @description 打印 danger 样式的文字
*/ */
log.danger = function (text) { log.danger = function(text) {
log.colorful([{ text, type: 'danger' }]) log.colorful([{ text, type: 'danger' }])
} }
......
...@@ -27,6 +27,6 @@ export default { ...@@ -27,6 +27,6 @@ export default {
} }
}, },
consts: { consts: {
USER_KEY: 'USER_KEY', USER_KEY: 'USER_KEY'
} }
} }
...@@ -133,7 +133,7 @@ export function deepClone(target) { ...@@ -133,7 +133,7 @@ export function deepClone(target) {
// 如果是一个数组的话 // 如果是一个数组的话
if (Array.isArray(target)) { if (Array.isArray(target)) {
result = [] // 将result赋值为一个数组,并且执行遍历 result = [] // 将result赋值为一个数组,并且执行遍历
for (let i in target) { for (const i in target) {
// 递归克隆数组中的每一项 // 递归克隆数组中的每一项
result.push(this.deepClone(target[i])) result.push(this.deepClone(target[i]))
} }
...@@ -146,7 +146,7 @@ export function deepClone(target) { ...@@ -146,7 +146,7 @@ export function deepClone(target) {
} else { } else {
// 否则是普通对象,直接for in循环,递归赋值对象的所有值 // 否则是普通对象,直接for in循环,递归赋值对象的所有值
result = {} result = {}
for (let i in target) { for (const i in target) {
result[i] = this.deepClone(target[i]) result[i] = this.deepClone(target[i])
} }
} }
...@@ -159,7 +159,7 @@ export function deepClone(target) { ...@@ -159,7 +159,7 @@ export function deepClone(target) {
} }
export function fixed(num, decimal) { export function fixed(num, decimal) {
num = num.toString() num = num.toString()
let index = num.indexOf('.') const index = num.indexOf('.')
if (index !== -1) { if (index !== -1) {
num = num.substring(0, decimal + index + 1) num = num.substring(0, decimal + index + 1)
} else { } else {
...@@ -180,11 +180,11 @@ export function transformDecimal(number, i) { ...@@ -180,11 +180,11 @@ export function transformDecimal(number, i) {
// 判断是否为数值型 // 判断是否为数值型
if (!isNaN(num)) { if (!isNaN(num)) {
// 切分整数与小数 // 切分整数与小数
let arr = num.toString().split('.') const arr = num.toString().split('.')
// 是小数且小数位大于保留个数 // 是小数且小数位大于保留个数
if (arr.length > 1 && arr[1].length > i) { if (arr.length > 1 && arr[1].length > i) {
// 小数部分字符串 // 小数部分字符串
let decimal = arr[1].slice(i, i + 1) const decimal = arr[1].slice(i, i + 1)
// toFixed 有 bug,四舍六入五随机 // toFixed 有 bug,四舍六入五随机
// 当四舍五入的数为 5,给其 + 1 // 当四舍五入的数为 5,给其 + 1
if (decimal === '5') { if (decimal === '5') {
......
...@@ -116,31 +116,40 @@ export default { ...@@ -116,31 +116,40 @@ export default {
// openId: 'oQ6Sh5cGirPd55Oc1J1oJSRpboFM', // openId: 'oQ6Sh5cGirPd55Oc1J1oJSRpboFM',
// openId: '', // openId: '',
userId: '', // 测试用数据 userId: '', // 测试用数据
// userId: '2088012113317722', // 测试用数据 // userId: '2088012113317722' // 测试用数据
tradeNO: ''// 测试用数据 tradeNO: ''// 测试用数据
// tradeNO: '2022083122001417721446143547'// 测试用数据 // tradeNO: '2022083122001417721446143547'// 测试用数据
} }
}, },
mounted() { mounted() {
const that = this const that = this
console.log(baseConfig)
const { appId } = baseConfig const { appId } = baseConfig
// console.log(appId) // console.log(appId)
const { merchantName, merchantId } = this.getHrefParams() const { merchantName, merchantId } = this.getHrefParams()
this.merchantId = merchantId this.merchantId = merchantId
this.merchantName = merchantName this.merchantName = merchantName
// console.log(merchanInfo) console.log(appId, 'appId')
// console.log('ap.getAuthCode', ap.getAuthCode)
// ap.alert(appId)
// 请求用户授权 // 请求用户授权
// ap.getAuthCode({ ap.getAuthCode({
// // appId: '${appId}', // appId: '${appId}',
// appId, appId,
// // scopes: ['auth_user'] // scopes: ['auth_user']
// // 主动授权:auth_user,静默授权:auth_base。或者其它scope // 主动授权:auth_user,静默授权:auth_base。或者其它scope
// scopes: ['auth_base'] scopes: ['auth_base']
// }, function (res) { }, function (res) {
// res.authCode && that.gteOpenId(res.authCode) // ap.alert(JSON.stringify(res))
// }) console.log(JSON.stringify(res))
res.authCode && that.getOpenId(res.authCode)
}, function (res) {
// alert(JSON.stringify(res))
console.log('res.fail', res)
// res.authCode && that.getOpenId(res.authCode)
})
// this.gteOpenId('ab3aa51e466140b5b96475706653UX72') // this.getOpenId('ab3aa51e466140b5b96475706653UX72')
// this.aliPayment() // this.aliPayment()
...@@ -152,15 +161,17 @@ export default { ...@@ -152,15 +161,17 @@ export default {
// }) // })
}, },
methods: { methods: {
gteOpenId(code) { getOpenId(code) {
// ap.alert(JSON.stringify(code)) console.log('getOpenId', code)
// console.log('gteOpenId', code) console.log(alipayOauthToken)
// !code&&console.log('alipayOauthToken')
code && alipayOauthToken({ code }).then((result) => { code && alipayOauthToken({ code }).then((result) => {
// alert('alipayOauthToken', JSON.stringify(result))
console.log('alipayOauthToken', result) console.log('alipayOauthToken', result)
const { userId } = result const { userId } = result
this.userId = userId this.userId = userId
// ap.alert(JSON.stringify(result))
}).catch((err) => { }).catch((err) => {
// alert(JSON.stringify(err))
// ap.alert(JSON.stringify(err)) // ap.alert(JSON.stringify(err))
console.log('err', err) console.log('err', err)
}) })
...@@ -219,7 +230,7 @@ export default { ...@@ -219,7 +230,7 @@ export default {
}, },
// 键盘输入 // 键盘输入
handleKey(key) { handleKey(key) {
const that = this // const that = this
// const { key } = e.currentTarget.dataset // const { key } = e.currentTarget.dataset
// console.log(this) // console.log(this)
// console.log(this) // console.log(this)
...@@ -261,7 +272,7 @@ export default { ...@@ -261,7 +272,7 @@ export default {
}, },
// 支付 // 支付
handlePay() { handlePay() {
const _this = this // const _this = this
const { payMoney, merchantId, unPayMoneyList, userId } = this const { payMoney, merchantId, unPayMoneyList, userId } = this
if (payMoney === '' || unPayMoneyList.includes(payMoney)) return if (payMoney === '' || unPayMoneyList.includes(payMoney)) return
// this.wxPayment(payMoney) // this.wxPayment(payMoney)
...@@ -290,8 +301,9 @@ export default { ...@@ -290,8 +301,9 @@ export default {
// return // return
createWxPayH5(params).then((result) => { createWxPayH5(params).then((result) => {
const { tradeNO } = JSON.parse(result.jsapiPayInfo) const { tradeNO } = JSON.parse(result.jsapiPayInfo)
this.outTradeNo = tradeNO this.tradeNO = tradeNO
this.outTradeNo && this.aliPayment() console.log('tradeNO', tradeNO)
this.tradeNO && this.aliPayment()
}).catch((err) => { }).catch((err) => {
console.log(err) console.log(err)
}).finally(() => { }).finally(() => {
...@@ -301,7 +313,7 @@ export default { ...@@ -301,7 +313,7 @@ export default {
aliPayment() { aliPayment() {
const that = this const that = this
// 调用支付宝api唤起支付功能 // 调用支付宝api唤起支付功能
console.log('this.outTradeNo', this.tradeNO) console.log('this.tradeNO', this.tradeNO)
const { tradeNO } = this const { tradeNO } = this
AlipayJSBridge.call( AlipayJSBridge.call(
'tradePay', 'tradePay',
...@@ -352,6 +364,13 @@ export default { ...@@ -352,6 +364,13 @@ export default {
</script> </script>
<style scoped> <style scoped>
* {
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.clearfix::after { .clearfix::after {
content: ''; content: '';
display: table; display: table;
...@@ -448,6 +467,8 @@ export default { ...@@ -448,6 +467,8 @@ export default {
} }
.deletIcon { .deletIcon {
/* 禁用图片保存事件 */
pointer-events: none;
width: 54px; width: 54px;
height: 42px; height: 42px;
} }
......
...@@ -9,7 +9,9 @@ ...@@ -9,7 +9,9 @@
<script> <script>
export default { export default {
mounted() {
// console.log(test)
}
} }
</script> </script>
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
const path = require('path') const path = require('path')
const defaultSettings = require('./src/config/conf.js') const defaultSettings = require('./src/config/conf.js')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
const SentryWebpackPlugin = require('@sentry/webpack-plugin')
const resolve = dir => path.join(__dirname, dir) const resolve = dir => path.join(__dirname, dir)
// page title // page title
...@@ -53,13 +54,14 @@ const spritesmithFunction = data => { ...@@ -53,13 +54,14 @@ const spritesmithFunction = data => {
return `${shared}\n${perSprite}` return `${shared}\n${perSprite}`
} }
module.exports = { module.exports = {
// publicPath: IS_PROD ? './' : '/dj-scrm-wx-work-lwk/', // 本地调试时需登录时使用 publicPath: IS_PROD ? '/dj-carlife-web-alipay' : './', // 本地调试时需登录时使用
// publicPath: './', // publicPath: './',
publicPath: '/dj-carlife-web-alipay', // 署应用包时的基本 URL。 vue-router history模式使用 // publicPath: '/dj-carlife-web-alipay', // 署应用包时的基本 URL。 vue-router history模式使用
// publicPath: '/dj-carlife-web-alipay/', // 署应用包时的基本 URL。 vue-router history模式使用
outputDir: 'dist', // 生产环境构建文件的目录 outputDir: 'dist', // 生产环境构建文件的目录
assetsDir: 'static', // outputDir的静态资源(js、css、img、fonts)目录 // assetsDir: 'static', // outputDir的静态资源(js、css、img、fonts)目录
lintOnSave: !IS_PROD, lintOnSave: !IS_PROD,
productionSourceMap: false, // 如果不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。 // productionSourceMap: false, // 如果不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
devServer: { devServer: {
disableHostCheck: true, disableHostCheck: true,
// port: 8080, // 端口 // port: 8080, // 端口
...@@ -138,6 +140,21 @@ module.exports = { ...@@ -138,6 +140,21 @@ module.exports = {
// // externals // // externals
// config.externals = externals // config.externals = externals
// } // }
// sentry 配置
// process.env.NODE_ENV === 'production' &&
Object.assign(config, {
plugins: [
...config.plugins,
new SentryWebpackPlugin({
// webpack specific configuration
release: '0.0.1',
include: './dist', // 需要上传到sentry服务器的资源目录,会自动匹配js 以及map文件
ignore: ['node_modules', 'vue.config.js'], // 忽略文件目录,当然我们在inlcude中制定了文件路径,这个忽略目录可以不加
configFile: '.sentryclirc',
urlPrefix: '~/dj-car-alipay/'
})
]
})
}, },
chainWebpack: config => { chainWebpack: config => {
...@@ -179,15 +196,15 @@ module.exports = { ...@@ -179,15 +196,15 @@ module.exports = {
}) })
.end() .end()
/** /**
* 打包分析 * 打包分析 取消 vuecli4 开始自带有
*/ */
if (IS_PROD) { // if (IS_PROD) {
config.plugin('webpack-report').use(BundleAnalyzerPlugin, [ // config.plugin('webpack-report').use(BundleAnalyzerPlugin, [
{ // {
analyzerMode: 'static' // analyzerMode: 'static'
} // }
]) // ])
} // }
config config
// https://webpack.js.org/configuration/devtool/#development // https://webpack.js.org/configuration/devtool/#development
.when(!IS_PROD, config => config.devtool('cheap-source-map')) .when(!IS_PROD, config => config.devtool('cheap-source-map'))
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!