Commit 2f8104a6 by 张立顺

v4.11.0 feat

1 parent 0daeedcf
......@@ -4,7 +4,7 @@
"private": true,
"scripts": {
"serve": "vue-cli-service serve --open",
"start": "npm run serve",
"start": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve ",
"dev": "npm run serve",
"build": "vue-cli-service build --mode nomock && rm -fr ./dist/js/*.map ",
"build:nomock": "vue-cli-service build --mode nomock",
......
......@@ -54,3 +54,21 @@ export function createWeappQrcode(data) {
data.method = `dj.api.smartcarlife.common.createWeappQrcode.new`
return request(data, 'post')
}
// 获取园区店支付宝页面二维码
export function alipayQrcode(data) {
data.method = `dj.api.smarcarlife.yqMerchantConfig.alipay.qrcode`
return request(data, 'post')
}
// 获取园区店配置项
export function yqMerchantConfigDetail(data) {
data.method = `dj.api.smarcarlife.yqMerchantConfig.detail`
return request(data, 'post')
}
// 关联园区店加企微二维码
export function serviceMerchantRelateQrcode(data) {
data.method = `dj.api.smartcarlife.serviceMerchant.relate.qrcode`
return request(data, 'post')
}
......@@ -7,8 +7,6 @@
import sha1 from 'sha1'
import qs from 'qs'
import { baseConfig } from '@/main'
// // 等后面再处理
// console.log(baseConfig)
// // const secret =
// // window.location.href.includes('dj.glsx.com.cn') ||
......
<!-- 弹窗 -->
<template>
<div>
<el-dialog
:title="title"
:visible.sync="isVisible"
:show-close="showClose"
:before-close="handleClose"
:close-on-click-modal="false"
:width="width"
>
<el-dialog :title="title"
:visible.sync="isVisible"
:show-close="showClose"
:before-close="handleClose"
:close-on-click-modal="false"
:width="width">
<span slot="title">
{{title}}
<span class="dialog-sub-title">
......@@ -18,15 +16,11 @@
<slot></slot>
<div slot="footer">
<slot name="btn-start"></slot>
<el-button
type="primary"
@click="handleConfirm"
:loading="$store.state.d2admin.loading.value"
>{{btnOkLabel}}</el-button>
<el-button
v-if="!noCancel"
@click="handleClose"
>取消</el-button>
<el-button type="primary"
@click="handleConfirm"
:loading="$store.state.d2admin.loading.value">{{btnOkLabel}}</el-button>
<el-button v-if="!noCancel"
@click="handleClose">取消</el-button>
<slot name="btn-middle"></slot>
</div>
</el-dialog>
......
......@@ -16,5 +16,6 @@ Vue.component('d2-search', () => import('./d2-search/index.vue'))
Vue.component('relateStoreDialog', () =>
import('./d2-form/relateStoreDialog.vue')
)
Vue.component('baseDialog', () => import('./baseDialog/index.vue'))
// Vue.component([authButton.name], authButton)
Vue.component(authButton.name, authButton)
<template>
<div>
<div class="d2-mr personal-wrap">
<el-popover ref="popover1"
placement="top-start"
width="400"
@show="redPotShow = false"
popper-class="popper"
v-model="visible"
trigger="hover">
<p class="title">导出和导出任务</p>
<p class="tips"> 导出和导出任务加载完成后将自动进行下载,加载过程中不要离开系统,否则将导致任务自动清空</p>
<!-- <div v-for="(item,index) in dowloadList"
<div class="d2-mr personal-wrap">
<el-popover ref="popover1"
placement="top-start"
width="400"
@show="redPotShow = false"
popper-class="popper"
v-model="visible"
trigger="hover">
<p class="title">导出和导出任务</p>
<p class="tips"> 导出和导出任务加载完成后将自动进行下载,加载过程中不要离开系统,否则将导致任务自动清空</p>
<!-- <div v-for="(item,index) in dowloadList"
:key="index"
class="downloadSty">
<span class="one-line-ellipsis downName">{{item.name}}</span>
<span class="downLabel"> {{item.labelText}}</span>
</div> -->
<div v-for="(item,index) in updateList"
:key="index+'a'"
class="updateListClass">
<div v-for="(item,index) in updateList"
:key="index+'a'"
class="updateListClass">
<div v-if="item.progress!= 100">
<p>{{item.name}}</p>
<el-progress :percentage="item.progress?item.progress:2"></el-progress>
</div>
<div v-else>
<p>{{item.name||''}}</p>
<p>成功{{item.succNum}}条<span v-if="item.failNum">,失败{{item.failNum}}条</span></p>
</div>
<div v-if="item.progress!= 100">
<p>{{item.name}}</p>
<el-progress :percentage="item.progress?item.progress:2"></el-progress>
</div>
<!-- @click="test" -->
<span slot="reference">
<i class="el-icon-bell tipsIcon "
:class="{'redPot':redPotShow }"></i>
</span>
</el-popover>
<div v-else>
<p>{{item.name||''}}</p>
<p>成功{{item.succNum}}条<span v-if="item.failNum">,失败{{item.failNum}}条</span></p>
</div>
</div>
<!-- @click="test" -->
<span slot="reference">
<i class="el-icon-bell tipsIcon "
:class="{'redPot':redPotShow }"></i>
</span>
</el-popover>
<span v-if="show"
class="btn-text">{{info && info.detail ? (info.detail.userType == 2 ? `${info.detail.userName}` : '管理员') : '未登录'}}</span>
<span class="btn-text out-txt"
@click="clear">退出</span>
</div>
<span v-if="show"
class="btn-text">{{info && info.detail ? (info.detail.userType == 2 ? `${info.detail.userName}` : '管理员') : '未登录'}}</span>
<span class="btn-text out-txt"
@click="clear">退出</span>
</div>
</template>
......
......@@ -310,7 +310,6 @@ export default {
...mapActions({
close: 'd2admin/page/close'
}),
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = _.cloneDeep(this.searchForm)
......
......@@ -51,7 +51,7 @@
:accountDetailVisible="accountDetailVisible"
:merchantRow="merchantRow"></account-detail>
</baseDialog>
<settingDetail :show="settingDetailVisible"></settingDetail>
<!-- <settingDetail :show="settingDetailVisible"></settingDetail> -->
</d2-container>
</template>
......@@ -62,15 +62,15 @@ import { getListApi, getMerchantLevelApi } from '@api/publicAccount'
import { mapActions } from 'vuex'
import accountDetail from './accountDetail'
import { BaseData, merchantStoreServiceList } from '@/common/constants.js'
import baseDialog from '@/components/baseDialog/baseDialog'
import settingDetail from './settingDetail.vue'
// import baseDialog from '@/components/baseDialog/baseDialog'
// import settingDetail from './settingDetail.vue'
export default {
name: 'accountList',
data() {
return {
// 账户详情
accountDetailVisible: false,
settingDetailVisible: false,
// settingDetailVisible: false,
merchantRow: {},
nameToOption: {
1: 'dj',
......@@ -221,8 +221,8 @@ export default {
},
components: {
accountDetail,
baseDialog,
settingDetail
// baseDialog,
// settingDetail
},
mounted() {
......@@ -238,9 +238,9 @@ export default {
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
associationSettings() {
this.settingDetailVisible = true
},
// associationSettings() {
// this.settingDetailVisible = true
// },
async getBaseData() {
this.baseData.channelTypeList = await this.get(BaseData.channelType)
this.getOptionsList()
......
<template>
<baseDialog :isShow.sync="show"
:config="dialogConfig.setting"
:dialogConfig="dialogConfig.config"
@closeDialog="handleDetailClose"
class="settingContainer">
<span class="test">222</span>
</baseDialog>
</template>
<script>
import baseDialog from '@/components/baseDialog/baseDialog'
export default {
name: 'settingDetail',
components: {
baseDialog
},
props: {
show: {
type: Boolean,
default: true
}
},
data() {
return {
dialogConfig: {
setting: {
showClose: true,
appendToBody: false,
// width: '720px',
btnList: [
]
},
config: {
title: '查看详情',
width: '720px'
}
}
}
},
methods: {
handleDetailClose() {
}
}
}
</script>
<style lang="scss" scoped>
::v-deep.settingContainer {
// color: rebeccapurple;
.el-dialog__header {
border: none;
}
}
</style>
<template>
<d2-dialog title="加微二维码"
:isVisible="qRcodeVisible"
class="qRcodeDailog"
width="585px"
@closeDialog="handleClose"
@confirmDialog="handleAddConfirm">
<!-- btnOkLabel="下载二维码" -->
<div class="dialogContainer">
<p class="merchantName">商户名称 {{merchantInfo.merchantName}}</p>
<p class="merchantId">商户号 {{merchantInfo.merchantId}}</p>
<el-upload action=""
class="elupload"
list-type="picture-card"
accept=".jpg,.png"
:auto-upload="false"
:show-file-list="false"
:disabled="!!imgUrl"
:on-change="e => handleChange(e,)"
:on-preview="e => handlePreview(e, )"
:on-remove="e => handleRemove(e, )">
<span class="img-btn">
<img v-if="imgUrl"
:src='imgUrl'
class="rectImg">
<span class="img-btns">
<span class="btn-item">
<i @click.stop='handleRemove()'
class="el-icon-delete"></i>
<!-- <i @click.stop="handleImgLook"
class="el-icon-zoom-in"></i> -->
</span>
</span>
</span>
<i v-if="!imgUrl "
class="el-icon-plus avatar-uploader-icon "
style="color: #8c939d;">
<span class="icon-text">上传图片</span>
</i>
<!-- <img v-if="!imgUrl "
:src='examplePicUrl'
class="rectImg"> -->
<!-- <div slot="tip"
class="el-upload__tip">只能上传jpg/png文件,且不超过1M</div> -->
</el-upload>
<!-- <span v-if="txtDescript">{{txtDescript}}</span> -->
<!-- <p v-show="!imgUrl"
slot="errorTips"
class="car-error-txt">请上传{{txtDescript}}</p> -->
</div>
</d2-dialog>
</template>
<script>
// import baseDialog from '@/components/baseDialog/baseDialog'
import { uploadImg } from '@/api/sys.base'
import { yqMerchantConfigDetail, serviceMerchantRelateQrcode } from '@/api/serviceManage'
export default {
name: 'QRcodeDialog',
components: {
// baseDialog
},
props: {
qRcodeVisible: {
type: Boolean,
default: false
},
merchantInfo: {
type: Object
// default: function () {
// return {
// merchantId: '44209883',
// merchantName: 'test'
// }
// }
}
},
data() {
return {
imgUrl: '',
defaultImgUrl: '',
oldImgUrl: ''
// dialogConfig: {
// setting: {
// showClose: true,
// appendToBody: false,
// // width: '720px',
// btnList: [
// ]
// },
// config: {
// title: '上传加微二维码',
// width: '720px'
// }
// }
}
},
mounted() {
this.yqMerchantConfigDetail()
},
methods: {
yqMerchantConfigDetail() {
// let parmas = this.merchantInfo.merchantId
yqMerchantConfigDetail({ yqMerchantId: this.merchantInfo.merchantId }).then((result) => {
console.log(result)
const { workWechatQrcode } = result
this.imgUrl = workWechatQrcode
}).catch((err) => {
console.log(err)
})
},
handleClose() {
this.$emit('update:qRcodeVisible', false)
},
async handleAddConfirm() {
// 跟原来不一样认为是修改
if (this.oldImgUrl != this.imgUrl) {
const params = {
yqMerchantId: this.merchantInfo.merchantId,
imgUrl: this.imgUrl
}
const result = await serviceMerchantRelateQrcode(params)
console.log(result)
this.notice.okTips()
// .then((result) => {
// console.log(result)
// }).catch((err) => {
// console.log(err)
// });
}
this.handleClose()
},
handleChange(file, attrName, targetItem) {
if (!(file.size / 1024 / 1024 < 1)) {
this.$message.error('请上传小于1M的图片')
return false
}
this.handleImgChange({ file })
// this.$emit('handleImgChange', { file: file, attrName: attrName, targetItem: targetItem })
},
handlePreview() { },
handleRemove(attrName, targetItem) {
// this.$emit('handleImgRemove', { attrName: attrName, targetItem: targetItem })
this.imgUrl = ''
},
handleImgChange({ file, attrName, targetItem }) {
// var hasFnList = ['idCard', 'idCardBack', 'bankCard', 'businessLicense', 'authorizerIdCard']
console.log(file)
var reader = new FileReader()
var fileInfo = file.raw
reader.readAsDataURL(fileInfo)
reader.onload = e => {
const imgFile = e.target.result
const base64 = fileInfo.name.split('.')[1] + '@' + imgFile.split(',')[1]
uploadImg({ file: base64 }).then(res => {
console.log(res)
// http://qcimg01.glsx.com.cn:7060/group1/M00/02/25/wKgD3mMMeE2AIylRAADPUBbxKwQ414.png
this.imgUrl = res
// this.picObj[attrName].url = res
// this.editForm.papers[this.picObj[attrName].attrName] = this.picObj[attrName].url
// this.writeToEditForm(attrName)
// this.$refs.editFormRef.$refs.editForm.clearValidate(targetItem.name)
// if (hasFnList.includes(attrName)) {
// targetItem.autoRecognitionFn(res, attrName)
// }
})
}
},
handleImgRemove({ attrName, targetItem }) {
this.picObj[attrName].url = ''
delete this.editForm.papers[this.picObj[attrName].attrName]
// this.writeToEditForm(attrName, false)
// this.$refs.editFormRef.$refs.editForm.validateField(targetItem.name)
}
}
}
</script>
<style lang="scss" scoped>
::v-deep.qRcodeDailog {
// color: rebeccapurple;
// .el-dialog__header {
// border: none;
// }
.el-icon-plus {
position: relative;
}
.icon-text {
position: absolute;
white-space: nowrap;
top: 28px;
left: -14px;
font-size: 14px;
}
}
.dialogContainer {
box-sizing: border-box;
width: 300px;
height: 290px;
margin: auto;
padding: 16px 24px;
display: flex;
flex-direction: column;
// align-items: center;
// justify-content: center;
text-align: left;
border: 1px solid #e8e8e8;
p {
margin: 0;
}
.merchantName {
font-weight: 600;
margin-bottom: 10px;
}
.elupload {
margin: auto;
}
.disabled .el-upload--picture-card {
display: none;
}
.el-upload--picture-card {
width: 140px;
height: 92px;
line-height: 98px;
}
.rectImg {
width: 100%;
height: 100%;
// width: 137px;
// height: 90px;
}
.img-btn {
display: inline-block;
position: relative;
}
.img-btn .img-btns {
display: none;
position: absolute;
width: 146px;
height: 146px;
left: 0;
top: 0;
z-index: 2;
color: #fff;
background: rgba(0, 0, 0, 0.5);
}
.img-btn .img-btns .btn-item {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.img-btn .img-btns .btn-item {
display: flex;
width: 70%;
justify-content: space-around;
}
.img-btn:hover .img-btns {
display: block;
}
.el-upload--picture-card i {
color: #fff;
}
}
// .gl-upload-img .car-error-txt {
// font-size: 12px;
// line-height: 6px;
// margin: 0 0;
// }
</style>
......@@ -120,6 +120,9 @@
:accountDetailVisible="financialRulesDetailVisible">
</financialRulesDetail>
</baseDialog>
<QRcodeDialog :qRcodeVisible.sync="QRcodeDialog"
v-if="QRcodeDialog"
:merchantInfo="viewDetailData"></QRcodeDialog>
</d2-container>
</template>
......@@ -128,25 +131,26 @@ import { Util } from '@/common/util'
import _ from 'lodash'
import viewDetail from './viewDetail'
import financialRulesDetail from './financialRulesDetail'
import baseDialog from '@/components/baseDialog/baseDialog'
// import baseDialog from '@/components/baseDialog/baseDialog'
import { getList, deleteMerchant, serviceGetMerchantList, addServiceMerchant, getPartnerByYq } from '@api/merchant'
import { mapActions } from 'vuex'
import { getParkStore } from '@api/editCustomer'
import { BaseData, userTypeList, ghUserTypeList, merchantClassifyList } from '@/common/constants.js'
import relateStoreMerDialog from './components/relateStoreMerDialog'
import QRcodeDialog from './components/QRcodeDialog'
export default {
name: 'merchantManage',
components: {
viewDetail,
relateStoreMerDialog,
financialRulesDetail,
baseDialog
// divisionRule
QRcodeDialog
},
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
financialRulesDetailVisible: false,
QRcodeDialog: false,
dialogConfig: {
setting: {
showClose: true,
......@@ -394,7 +398,11 @@ export default {
}
})
},
// 加微二维码
handleQrcode(row) {
this.viewDetailData = _.cloneDeep(row)
this.QRcodeDialog = true
},
// 关联导流方
handleMerchantChange(value) {
getPartnerByYq({ yqMerchantId: value }).then(res => {
......
......@@ -3,30 +3,57 @@
<d2-dialog title="收款二维码"
:isVisible="qRcodeVisible"
class="qRcodeDailog"
width="40%"
btnOkLabel="下载二维码"
width="750px"
btnOkLabel="全部下载"
@closeDialog="handleClose"
@confirmDialog="handleAddConfirm">
<div class="codeDiv"
id="view">
<img style="width:100%;height:100%"
src="./images/code3.png">
<!-- v-if="qrCodeURL" <div class="imgDiv"> -->
<img v-if="qrCodeURL"
class="qrImg"
id="img1"
crossorigin="anonymous"
:src="qrCodeURL">
<div v-if="!qrCodeURL"
class="el-icon-loading loadingIcon"></div>
<!-- </div> -->
<div class="merchantNameDiv">{{info.yqMerchantName}}</div>
<div class="qrcon">
<div class="wxcon">
<div class="codeDiv"
id="wxview">
<img style="width:100%;height:100%"
src="./images/code3.png">
<!-- v-if="qrCodeURL" <div class="imgDiv"> -->
<img v-if="qrCodeURL"
class="qrImg"
id="img1"
crossorigin="anonymous"
:src="qrCodeURL">
<div v-if="!qrCodeURL"
class="el-icon-loading loadingIcon"></div>
<!-- </div> -->
<div class="merchantNameDiv">{{info.yqMerchantName}}</div>
</div>
<el-button style="marginTop:20px"
@click="takeScreenshot('wxview')">下载</el-button>
</div>
<div class="alicon">
<div class="codeDiv"
id="aliview">
<img style="width:100%;height:100%"
src="./images/alipay.png">
<!-- v-if="qrCodeURL" <div class="imgDiv"> -->
<img v-if="aliqrCodeURL"
class="qrImg"
id="img1"
crossorigin="anonymous"
:src="aliqrCodeURL">
<div v-if="!aliqrCodeURL"
class="el-icon-loading loadingIcon"></div>
<!-- </div> -->
<div class="merchantNameDiv">{{info.yqMerchantName}}</div>
</div>
<el-button style="marginTop:20px"
@click="takeScreenshot('aliview')">下载</el-button>
</div>
</div>
</d2-dialog>
</template>
<script>
import { createWeappQrcode } from '@api/serviceManage'
import { createWeappQrcode, alipayQrcode } from '@api/serviceManage'
import { baseConfig } from '@/main'
import html2canvas from 'html2canvas'
export default {
name: 'qRcodeDialog',
......@@ -44,6 +71,7 @@ export default {
merchantList: []
},
qrCodeURL: '',
aliqrCodeURL: '',
defaultImg: require('./images/defaultImg.png')
}
},
......@@ -68,6 +96,7 @@ export default {
mounted() {
this.createQrcodeImage()
this.alipayQrcode()
},
methods: {
......@@ -136,11 +165,11 @@ export default {
},
// 下载保存图片
takeScreenshot() {
takeScreenshot(eleId) {
// const opts = {
// useCORS: true
// }
html2canvas(document.getElementById('view'), {
html2canvas(document.getElementById(eleId), {
backgroundColor: null,
allowTaint: true, // 允许污染
taintTest: true, // 在渲染前测试图片(没整明白有啥用)
......@@ -149,6 +178,7 @@ export default {
this.convertCanvasToImg(canvas)
})
},
// 转换图片格式
convertCanvasToImg(canvas) {
// canvas base64 转 blob
......@@ -181,17 +211,41 @@ export default {
a.dispatchEvent(clickEvent)
},
handleAddConfirm() {
this.takeScreenshot()
alipayQrcode() {
// this
console.log(baseConfig.alipayPath)
const params = {
path: baseConfig.alipayPath,
yqMerchantId: this.info.yqMerchantId,
yqMerchantName: this.info.yqMerchantName
}
alipayQrcode(params).then((result) => {
console.log(result)
this.aliqrCodeURL = result
}).catch((err) => {
console.log(err)
})
},
handleAddConfirm() {
this.takeScreenshot('wxview')
setTimeout(() => {
this.takeScreenshot('aliview')
}, 2000)
// this.takeScreenshot()
},
// downloadImg(eleName) {
// this.takeScreenshot(eleName)
// // const fnName = name
// // this[fnName]()
// },
handleClose() {
this.$emit('dialogClose', true)
}
}
}
</script>
<style>
<style >
.dateItem {
display: flex;
}
......@@ -199,6 +253,17 @@ export default {
display: flex;
margin-left: 0 !important;
}
.qrcon {
display: flex;
}
.wxcon,
.alicon {
text-align: center;
}
.wxcon {
margin-right: 20px;
}
.codeDiv {
width: 345px;
height: 468px;
......
......@@ -257,7 +257,7 @@ export default {
}
})
},
// 收款二维码按钮
collectionQRcode(row) {
this.recordInfo = row
this.qRcodeVisible = !this.qRcodeVisible
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!