Commit 4c919657 by 张立顺

Merge branch 'develop' into 'master'

Develop

See merge request !3
2 parents 62a2110d 5c8a4891
# 配置中心获取的对应环境的appid
开发环境 2021003146603701
测试环境 2021003142659655
线上环境 2021003142677540
# gh-hall # gh-hall
基于 vue-cli4.0 + webpack 4 + vant ui + sass+ rem 适配方案+axios 封装,构建手机端模板脚手架 基于 vue-cli4.0 + webpack 4 + vant ui + sass+ rem 适配方案+axios 封装,构建手机端模板脚手架
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"author": "limin <limin.mail@qq.com>", "author": "limin <limin.mail@qq.com>",
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve ", "serve": " vue-cli-service serve ",
"build": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build", "build": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
"stage": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode staging", "stage": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode staging",
"lint": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service lint --fix", "lint": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service lint --fix",
......
...@@ -16,3 +16,8 @@ export function createWxPayH5(data) { ...@@ -16,3 +16,8 @@ export function createWxPayH5(data) {
console.log(data) console.log(data)
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
/** 获取用户协议配置 */
export function getTitleByModule(data) {
data.method = `${path}privacyAgreement.getTitleByModule`
return request(data, RequestMethods.POST)
}
...@@ -51,8 +51,8 @@ import * as Sentry from '@sentry/vue' ...@@ -51,8 +51,8 @@ import * as Sentry from '@sentry/vue'
import { BrowserTracing } from '@sentry/tracing' import { BrowserTracing } from '@sentry/tracing'
// 实例化 // 实例化
// process.env.NODE_ENV === 'production' && process.env.NODE_ENV === 'production' &&
Sentry.init({ Sentry.init({
Vue, Vue,
dsn: 'https://f0db411905b541eebe6d591707f561a4@sentry.glsx.com.cn/26', dsn: 'https://f0db411905b541eebe6d591707f561a4@sentry.glsx.com.cn/26',
integrations: [ integrations: [
...@@ -65,7 +65,7 @@ Sentry.init({ ...@@ -65,7 +65,7 @@ Sentry.init({
// of transactions for performance monitoring. // of transactions for performance monitoring.
// We recommend adjusting this value in production // We recommend adjusting this value in production
tracesSampleRate: 1.0 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不能通过配置中心动态获取
......
...@@ -26,7 +26,7 @@ function createRouter() { ...@@ -26,7 +26,7 @@ function createRouter() {
// mode: 'history', // 如果是 history模式 需要配置vue.config.js publicPath // mode: 'history', // 如果是 history模式 需要配置vue.config.js publicPath
base: 'dj-carlife-web-alipay', base: 'dj-carlife-web-alipay',
// base: process.env.BASE_URL, // base: process.env.BASE_URL,
scrollBehavior: function(to, from, savedPosition) { scrollBehavior: function (to, from, savedPosition) {
return savedPosition || { x: 0, y: 0 } return savedPosition || { x: 0, y: 0 }
}, },
routes routes
...@@ -36,7 +36,9 @@ function createRouter() { ...@@ -36,7 +36,9 @@ function createRouter() {
router.beforeEach((to, from, next) => { 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)) {
......
...@@ -101,6 +101,18 @@ const routes = [ ...@@ -101,6 +101,18 @@ const routes = [
component: () => import('@/views/tipsPage') component: () => import('@/views/tipsPage')
}, },
{ {
path: '/userCollaboration',
name: 'userCollaboration',
meta: {
title: '车主协议'
},
// redirect: {
// name: 'index'
// },
// component: import('@/views/layouts/index')
component: () => import('@/views/userCollaboration')
},
{
// path: '/ailpay', // path: '/ailpay',
path: '/', path: '/',
redirect: { name: 'index' }, redirect: { name: 'index' },
......
<template> <template>
<div> <div>
<!-- <button id="test"
@click="getAuthCode"> getAuthCode </button> -->
<div v-if="unpaid"> <div v-if="unpaid">
<div class="pay-container" <div class="pay-container"
@click.stop="handleHiddenKey"> @click.stop="handleHiddenKey">
...@@ -23,6 +21,19 @@ ...@@ -23,6 +21,19 @@
class="pay-cursor" /> class="pay-cursor" />
<div class="pay-after-icon">元</div> <div class="pay-after-icon">元</div>
</div> </div>
<div class="userCollaborationContainer"
v-if="userCollaborationName">
<!-- <label class="radio"> value="{{userCollaborationCheck}}" -->
<input type="radio"
class="radio"
@click="handleRadio"
:checked="userCollaborationCheck" />
<div class="label"
@click="handleRadio">我已阅读并同意</div>
<!-- </label> -->
<div class="linkText"
@click="navToUserCollaboration">《{{userCollaborationName}}》</div>
</div>
</div> </div>
</div> </div>
<div class="keyboard " <div class="keyboard "
...@@ -90,7 +101,7 @@ ...@@ -90,7 +101,7 @@
</template> </template>
<script> <script>
import { alipayOauthToken, createWxPayH5 } from '@/api/alipayApi' import { alipayOauthToken, createWxPayH5, getTitleByModule } from '@/api/alipayApi'
import { baseConfig } from '@/main' import { baseConfig } from '@/main'
export default { export default {
name: 'Alipay', name: 'Alipay',
...@@ -117,8 +128,10 @@ export default { ...@@ -117,8 +128,10 @@ export default {
// openId: '', // openId: '',
userId: '', // 测试用数据 userId: '', // 测试用数据
// userId: '2088012113317722' // 测试用数据 // userId: '2088012113317722' // 测试用数据
tradeNO: ''// 测试用数据 tradeNO: '', // 测试用数据
// tradeNO: '2022083122001417721446143547'// 测试用数据 // tradeNO: '2022083122001417721446143547'// 测试用数据
userCollaborationName: '',
userCollaborationCheck: false
} }
}, },
mounted() { mounted() {
...@@ -159,8 +172,24 @@ export default { ...@@ -159,8 +172,24 @@ export default {
// forbidClick: true, // forbidClick: true,
// duration: 0 // duration: 0
// }) // })
// 获取用户协议配置
this.getTitleByModule()
}, },
methods: { methods: {
getTitleByModule() {
getTitleByModule({ module: 'PrivacyAgreement' }).then((result) => {
// console.log(result)
this.userCollaborationName = result
}).catch((err) => {
console.log(err)
})
},
navToUserCollaboration() {
this.$router.push({ name: 'userCollaboration' })
},
handleRadio() {
this.userCollaborationCheck = !this.userCollaborationCheck
},
getOpenId(code) { getOpenId(code) {
console.log('getOpenId', code) console.log('getOpenId', code)
console.log(alipayOauthToken) console.log(alipayOauthToken)
...@@ -188,53 +217,17 @@ export default { ...@@ -188,53 +217,17 @@ export default {
console.log('param', obj) console.log('param', obj)
return name ? obj[name] : obj return name ? obj[name] : obj
}, },
// 获取付款门店信息
getMerthcantInfo(id) {
// api.qrCodeScene(
// {
// id
// },
// res => {
// console.log(res)
// const { returnCode, data } = res
// const op = {}
// if (returnCode == '0') {
// if (data) {
// data.split('&').map(item => {
// const [key, val] = item.split('=')
// op[key] = val
// })
// this.setData({
// ...op
// })
// // util.showLoading('加载中...')
// console.log(op)
// // this.getInfo(op)
// }
// }
// }
// )
},
// 隐藏键盘 // 隐藏键盘
handleHiddenKey() { handleHiddenKey() {
// this.setData({
// })
this.keyHidden = true this.keyHidden = true
}, },
// 显示键盘 // 显示键盘
handleShowKey() { handleShowKey() {
// this.setData({
// })
this.keyHidden = false this.keyHidden = false
console.log(this.keyHidden) console.log(this.keyHidden)
}, },
// 键盘输入 // 键盘输入
handleKey(key) { handleKey(key) {
// const that = this
// const { key } = e.currentTarget.dataset
// console.log(this)
// console.log(this)
const { payMoney, unPayMoneyList } = this const { payMoney, unPayMoneyList } = this
// 删除金额 // 删除金额
if (key === 'X') { if (key === 'X') {
...@@ -273,8 +266,11 @@ export default { ...@@ -273,8 +266,11 @@ export default {
// 支付 // 支付
handlePay() { handlePay() {
// const _this = this // const _this = this
const { payMoney, merchantId, unPayMoneyList, userId } = this const { payMoney, merchantId, unPayMoneyList, userId, userCollaborationName, userCollaborationCheck } = this
if (payMoney === '' || unPayMoneyList.includes(payMoney)) return if (payMoney === '' || unPayMoneyList.includes(payMoney)) return
if (userCollaborationName && !userCollaborationCheck) {
return this.showToast(`请先阅读并勾选《${userCollaborationName}》`)
}
// this.wxPayment(payMoney) // this.wxPayment(payMoney)
// console.log(Number(payMoney), '付款') // console.log(Number(payMoney), '付款')
// if (userId) { // if (userId) {
...@@ -295,10 +291,6 @@ export default { ...@@ -295,10 +291,6 @@ export default {
forbidClick: true, forbidClick: true,
duration: 0 duration: 0
}) })
// util.showLoading('加载中...')
// 调用支付接口生成对应的微信支付参数
// console.log(params)
// return
createWxPayH5(params).then((result) => { createWxPayH5(params).then((result) => {
const { tradeNO } = JSON.parse(result.jsapiPayInfo) const { tradeNO } = JSON.parse(result.jsapiPayInfo)
this.tradeNO = tradeNO this.tradeNO = tradeNO
...@@ -333,37 +325,13 @@ export default { ...@@ -333,37 +325,13 @@ export default {
}, },
// 支付成功获取订单回调信息 // 支付成功获取订单回调信息
successInfo() { successInfo() {
const { outTradeNo, orderInfoList, showOrderInfo } = this
// api.queryPayOrderStatus(
// { outTradeNo },
// res => {
// util.hideLoading()
// console.log(res)
// const { data, returnCode } = res
// if (returnCode == 0) {
// data &&
// orderInfoList.forEach(element => {
// element['info'] = data[element['name']]
// })
// this.setData({
// unpaid: false,
// showOrderInfo: !!data,
// orderInfoList
// })
// }
// // let { returnCode, data } = res
// },
// rej => {
// console.log(rej)
// util.hideLoading()
// }
// )
} }
} }
} }
</script> </script>
<style scoped> <style scoped lang="scss">
* { * {
-webkit-touch-callout: none; -webkit-touch-callout: none;
-webkit-user-select: none; -webkit-user-select: none;
...@@ -390,7 +358,25 @@ export default { ...@@ -390,7 +358,25 @@ export default {
/* flex-direction: column; */ /* flex-direction: column; */
/* flex-wrap: wrap; */ /* flex-wrap: wrap; */
} }
.userCollaborationContainer {
display: flex;
// align-items: center;
align-items: flex-start;
margin-top: 30px;
// font-size: 28px;
.radio {
margin-top: 9px;
}
.label {
margin-left: 10px;
min-width: 240px;
// width: 180px;
}
}
.linkText {
color: #3582ee;
}
.pay-header .shopIcon { .pay-header .shopIcon {
height: 88px; height: 88px;
width: 88px; width: 88px;
......
<template>
<iframe class="userCollaboration"
src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/userCollaboration.html"
frameborder="0"></iframe>
</template>
<script>
export default {
}
</script>
<style>
.userCollaboration {
width: 100vw;
height: 100vh;
}
</style>
...@@ -141,7 +141,7 @@ module.exports = { ...@@ -141,7 +141,7 @@ module.exports = {
// config.externals = externals // config.externals = externals
// } // }
// sentry 配置 // sentry 配置
// process.env.NODE_ENV === 'production' && process.env.NODE_ENV === 'production' &&
Object.assign(config, { Object.assign(config, {
plugins: [ plugins: [
...config.plugins, ...config.plugins,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!