修改
This commit is contained in:
parent
035cc138eb
commit
5c303e6e02
@ -102,3 +102,17 @@ export function publicKey(stationCode:any) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//获取小程序二维码
|
||||
interface Rcode{
|
||||
path:String
|
||||
width:String
|
||||
}
|
||||
export function getCode(params:Rcode) {
|
||||
return server.request({
|
||||
url: '/cloud/batterystation/xcx/qrcode/create',
|
||||
method: 'get',
|
||||
params,
|
||||
responseType:'blob'
|
||||
})
|
||||
}
|
||||
|
||||
@ -15,7 +15,8 @@
|
||||
|
||||
<div v-if="showcode" style="display: flex;align-items: center;padding-right: 30px;color: #80aedd;cursor: pointer;">
|
||||
<div @click="setpublicKey" style="padding-right: 40px;color: #b88230;">生成公钥</div>
|
||||
<div @click="xcxcode" style="padding-right: 6px;">查看小程序码</div>
|
||||
<div @click="xcxcode(1)" style="padding-right: 20px;">生成小程序码</div>
|
||||
<!-- <div @click="xcxcode(2)" style="padding-right: 6px;color: #aeaf96;">生成预约二维码</div> -->
|
||||
<!-- <el-icon><Download /></el-icon> -->
|
||||
</div>
|
||||
|
||||
@ -51,24 +52,37 @@
|
||||
>
|
||||
|
||||
<img :src="urlcode" width="400" height="400" />
|
||||
<el-button @click="downloadImage()">下载</el-button>
|
||||
<div style="text-align: right;">
|
||||
<el-button @click="downloadImage()">下载</el-button>
|
||||
</div>
|
||||
|
||||
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import{ getqrcode,publicKey } from '@/api/swapstation/hdz'
|
||||
import{
|
||||
getqrcode,
|
||||
publicKey,
|
||||
getCode
|
||||
} from '@/api/swapstation/hdz'
|
||||
const props = withDefaults(defineProps<{
|
||||
name?:string
|
||||
showjt?:boolean
|
||||
showcls?:boolean
|
||||
showcode?:boolean,
|
||||
hdzcode?:string
|
||||
hdzcode?:string,
|
||||
openAllDay?:string|number,
|
||||
startTime?:string,
|
||||
endTime?:string
|
||||
}>(), {
|
||||
name:'',
|
||||
showjt:true,
|
||||
showcls:true,
|
||||
showcode:false
|
||||
showcode:false,
|
||||
openAllDay:'',
|
||||
startTime:'',
|
||||
endTime:''
|
||||
})
|
||||
//${import.meta.env.VITE_APP_BASE_API} http://192.168.5.200:9103
|
||||
let url = `${import.meta.env.VITE_APP_BASE_API}/cloud/batterystation/xcx/qrcode/get?path=pages/home/index?code=${props.hdzcode}&width=400&env_version=trial`
|
||||
@ -110,12 +124,8 @@
|
||||
let openpop = ref(false)
|
||||
let urlcode = ref<any>('')
|
||||
//获取小程序码
|
||||
function xcxcode(){
|
||||
getqrcode({
|
||||
path:`pages/home/index?code=${props.hdzcode}`,
|
||||
width:'400',
|
||||
env_version:'trial' //要打开的小程序版本。正式版为"release",体验版为"trial",开发版为"develop"。默认是正式版。
|
||||
}).then((rps:any) => {
|
||||
function xcxcode(type:number){
|
||||
codehand(type).then((rps:any) => {
|
||||
openpop.value = true
|
||||
|
||||
let reader = new FileReader()
|
||||
@ -130,9 +140,26 @@
|
||||
function downloadImage() {
|
||||
const a = document.createElement('a');
|
||||
a.href = urlcode.value
|
||||
a.download = props.name
|
||||
a.download = props.name+'.jpg'
|
||||
// a.setAttribute('download', props.name+'.jpg');
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
}
|
||||
|
||||
//获取预约二维码
|
||||
function codehand(type:number) {
|
||||
if(type == 1){
|
||||
return getqrcode({
|
||||
path: `pages/home/index?hdzcode=${props.hdzcode}&hdzname=${props.name}&openAllDay=${props.openAllDay}&stiem=${props.startTime}&etime=${props.endTime}`, //`code=${props.hdzcode}&hdzname=${props.name}`,
|
||||
width:'400',
|
||||
env_version:'release' //要打开的小程序版本。正式版为"release",体验版为"trial",开发版为"develop"。默认是正式版。
|
||||
})
|
||||
}
|
||||
return getCode({
|
||||
path:`homePages/reservation/index?code=${props.hdzcode}&hdzname=${props.name}`, //`pages/home/index?code=${props.hdzcode}&hdzname=${props.name}`, //`code=${props.hdzcode}&hdzname=${props.name}`,
|
||||
width:'400',
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
@ -301,10 +301,10 @@
|
||||
pageNo:1, //页数
|
||||
ucode:'', //换电车主ID
|
||||
status:'',
|
||||
plateNum:'', //车牌号
|
||||
swapDayBegin:getDateDaysAgo(30), //预约换电日期开始,示例值(yyyyMMdd)
|
||||
swapDayEnd:getDateDaysAgo(), //预约换电日期结束
|
||||
stationCode:'' //换电站编码
|
||||
plateNum:'', //车牌号
|
||||
swapDayBegin:getDateDaysAgo(30).replace(/-/g,''), //预约换电日期开始,示例值(yyyyMMdd)
|
||||
swapDayEnd:getDateDaysAgo().replace(/-/g,''), //预约换电日期结束
|
||||
stationCode:'' //换电站编码
|
||||
})
|
||||
|
||||
//查询
|
||||
|
||||
@ -371,7 +371,15 @@
|
||||
:with-header="false"
|
||||
size="70%"
|
||||
>
|
||||
<tit @close="handleClose" :name="addata.name" :hdzcode="addata.code" :showcode="true" />
|
||||
<tit
|
||||
@close="handleClose"
|
||||
:name="addata.name"
|
||||
:hdzcode="addata.code"
|
||||
:showcode="true"
|
||||
:openAllDay="addata.openAllDay"
|
||||
:startTime="addata.runStartTime"
|
||||
:endTime="addata.runEndTime"
|
||||
/>
|
||||
<el-row :gutter="25">
|
||||
<el-col :span="24" style="margin-bottom: 20px;">
|
||||
<div style="padding: 0;border: 2px solid #73b9c9;border-radius: 10px;">
|
||||
|
||||
@ -221,6 +221,20 @@
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-if="userType == 1">
|
||||
<el-form-item label="关联微信用户" prop="wxuser">
|
||||
<el-autocomplete
|
||||
style="width: 100%"
|
||||
v-model="wxuser"
|
||||
:fetch-suggestions="querySearchAsync"
|
||||
placeholder="请输入手机号查询"
|
||||
clearable
|
||||
@blur="autoblur"
|
||||
@select="handleSelect"
|
||||
@clear="autoclear"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
@ -311,6 +325,10 @@
|
||||
|
||||
import Fphdz from './fphdz.vue'
|
||||
|
||||
import {
|
||||
getwxlist
|
||||
} from '@/api/operation/wxuser'
|
||||
|
||||
import { ref,reactive,nextTick } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
|
||||
@ -421,7 +439,8 @@
|
||||
readonly:'2', //是否内置账号,内置账号不允许动
|
||||
avatar:'', //头像
|
||||
businessCode:'', //运营商code 企业用户code
|
||||
businessCode1:'' //运营商code 企业用户code
|
||||
businessCode1:'', //运营商code 企业用户code
|
||||
wuid:''
|
||||
})
|
||||
|
||||
const rules = ref({
|
||||
@ -498,6 +517,8 @@
|
||||
}
|
||||
|
||||
//userform.avatar = row.avatar
|
||||
userform.wuid = row.wuid?row.wuid:''
|
||||
wxuser.value = row.wuid?row.wuid:''
|
||||
}else{
|
||||
userform.pkId = ''
|
||||
userform.uid = ''
|
||||
@ -514,6 +535,9 @@
|
||||
//userform.avatar = ''
|
||||
userform.businessCode = ''
|
||||
userform.businessCode1 = ''
|
||||
|
||||
userform.wuid = ''
|
||||
wxuser.value = ''
|
||||
}
|
||||
}
|
||||
|
||||
@ -669,6 +693,55 @@
|
||||
hdzcode.value = row.stationCodes
|
||||
}
|
||||
|
||||
//关联微信用户
|
||||
let wxuser = ref('')
|
||||
|
||||
async function querySearchAsync (queryString: string, cb:any) {
|
||||
getwxlist({
|
||||
pageSize:100, //每页条数
|
||||
pageNo:1, //页数
|
||||
phoneNumber:queryString, //手机号
|
||||
// nickName:queryString, //昵称
|
||||
// name:queryString //名称
|
||||
}).then((res) => {
|
||||
if (res.data && (res.data as any).records.length > 0) {
|
||||
// mapList.value = res.data;
|
||||
let listss = (res.data as any).records.map((n:any) => {
|
||||
return {
|
||||
value: `${n.name?n.name:'暂未设置姓名'}—${n.phoneNumber?n.phoneNumber:'暂未绑定手机号'}`,
|
||||
name: n.name,
|
||||
phoneNumber:n.phoneNumber,
|
||||
id:n.wuid //??
|
||||
}
|
||||
})
|
||||
cb(listss)
|
||||
//return listss
|
||||
// callback(mapList.value);
|
||||
}else{
|
||||
cb([])
|
||||
}
|
||||
}).catch(() => {
|
||||
cb([])
|
||||
})
|
||||
}
|
||||
|
||||
function autoblur() {
|
||||
if(userform.userId === ''){
|
||||
wxuser.value = ''
|
||||
}
|
||||
}
|
||||
|
||||
function autoclear() {
|
||||
// addata.userId = ''
|
||||
// addata.plateNum = ''
|
||||
// carlist.value.splice(0)
|
||||
userform.wuid = ''
|
||||
}
|
||||
|
||||
function handleSelect(v: any) {
|
||||
userform.wuid = v.id
|
||||
}
|
||||
|
||||
function handhdx() {
|
||||
hdzpop.value = false
|
||||
handleQuery()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user