Bläddra i källkod

调试支付

ms
zhoujie 2 år sedan
förälder
incheckning
9cad9ff5aa

+ 31
- 25
components/form-builder/form-builder-vue3.vue Visa fil

@@ -20,12 +20,11 @@
<view style="min-height: 90rpx;" :style="item.vertical == 2 ? 'margin-top: 20rpx' : ''"
:class="item.vertical == 2 ? 'as-layout-vertical' : 'as-layout-horizontal'" v-else>
<!-- 标题 -->
<view v-if="item.titleShow||item.titleShow===undefined&&item.type!=14"
class="as-gravity-center-start" :style="'min-width:'+ config.titleWidth + 'rpx'"
<view v-if="item.titleShow||item.titleShow===undefined&&item.type!=14" class="as-gravity-center-start"
:style="'min-width:'+ config.titleWidth + 'rpx'"
style="margin:0 20rpx;flex-direction: row;display: flex;flex-direction: row;">
<image class="img-size" :src="item.required ? '/static/image/must.png' : ''"></image>
<view :class="item.vertical == 2 ? 'text-left' : 'text-justify'" class="text-title"
style="width:100%;">
<view :class="item.vertical == 2 ? 'text-left' : 'text-justify'" class="text-title" style="width:100%;">
{{item.title}}
</view>
</view>
@@ -47,8 +46,7 @@
<view class="as-layout-horizontal" style="flex-wrap: wrap;margin: 10px 0;">
<label style="display: flex;flex-direction: row;margin-right: 30rpx;"
v-for="(itemData,index) in item.itemData " :key="index">
<checkbox style="transform:scale(0.7)" :value="itemData.value"
:checked="itemData.checked" />
<checkbox style="transform:scale(0.7)" :value="itemData.value" :checked="itemData.checked" />
<view>{{itemData.value}}</view>
</label>
</view>
@@ -70,12 +68,10 @@

<!-- 富文本框 -->
<view v-if="item.type == 5" style="width: 100%;">
<view
style="margin: 20rpx 30rpx 0 30rpx;border: 1px solid #999999;height: 200rpx;border-radius: 10px;">
<view style="margin: 20rpx 30rpx 0 30rpx;border: 1px solid #999999;height: 200rpx;border-radius: 10px;">
<textarea :disabled="item.disabled" class="text" v-model="item[item.value]"
@input="textareaInput($event,item)" placeholder-class="text-hint"
style="width: 100%;margin: 20rpx" :maxlength="item.maxlength" auto-height
:placeholder="item.hint ? item.hint : '请输入' + item.title">
@input="textareaInput($event,item)" placeholder-class="text-hint" style="width: 100%;margin: 20rpx"
:maxlength="item.maxlength" auto-height :placeholder="item.hint ? item.hint : '请输入' + item.title">
</textarea>
<view v-if="item.maxlength" class="as-gravity-center-end"
style="display: flex;flex-direction: row;height: 20%;">
@@ -110,20 +106,18 @@
<view class="text-error">
{{item.hint && item.hint.split(',')[0] ? item.hint.split(',')[0] : ''}}
</view>
<view class="as-layout-horizontal as-gravity-center"
style="height: 260rpx;margin-top: 20rpx;" :class="{dan:item.inputType === '999'}">
<view class="as-layout-horizontal as-gravity-center" style="height: 260rpx;margin-top: 20rpx;"
:class="{dan:item.inputType === '999'}">
<view class="as-layout-vertical as-gravity-center" style="width: 90%;height: 100%;">
<image
:src="item.placeholderImg ? item.placeholderImg.split(',')[0] : '../../static/image/license2.png'"
style="width: 100%;height: 80%;" :style="item.style"
@tap="ImageSelection(item,1)"></image>
style="width: 100%;height: 80%;" :style="item.style" @tap="ImageSelection(item,1)"></image>
<view class="as-gravity-center text-hint" style="margin-top: 5rpx;">
{{item.hint && item.hint.split(',')[1] ? item.hint.split(',')[1] : ''}}
</view>
</view>
<view style="width: 40rpx;"></view>
<view class="as-layout-vertical" style="width: 90%;height: 100%;"
v-if="item.inputType != '999'">
<view class="as-layout-vertical" style="width: 90%;height: 100%;" v-if="item.inputType != '999'">
<image
:src="item.placeholderImg && item.placeholderImg.split(',')[1] ? item.placeholderImg.split(',')[1] : '../../static/image/license2.png'"
style="width: 100%;height: 80%;" @tap="ImageSelection(item,2)"></image>
@@ -138,8 +132,7 @@
<!-- 车牌号输入 -->
<view v-if="item.type == 9" style="width: 100%">
<view style="margin: 20rpx 30rpx 0 30rpx;">
<car-num-ber-input @numberInputResult="numberInputResult($event,item)"
:defaultStr='item[item.value]'>
<car-num-ber-input @numberInputResult="numberInputResult($event,item)" :defaultStr='item[item.value]'>
</car-num-ber-input>
</view>
</view>
@@ -157,9 +150,8 @@
<view v-if="item.type == 11" style="width: 100%;">
<view class="as-layout-horizontal as-gravity-center">
<input v-model="item[item.value]" type="number"
:placeholder="item.hint ? item.hint : '请输入' + item.title"
placeholder-class="text-hint" class="text as-gravity-center-start"
:maxlength="item.maxlength" :style="item.style"
:placeholder="item.hint ? item.hint : '请输入' + item.title" placeholder-class="text-hint"
class="text as-gravity-center-start" :maxlength="item.maxlength" :style="item.style"
style="min-height: 90rpx;word-break:break-all" />

<button style="width: 160rpx;font-size: 24rpx;height: 60rpx" :disabled="item.disabled"
@@ -179,8 +171,8 @@

<!-- 车牌颜色 -->
<view v-if="item.type == 13" style="width: 100%;">
<licensePlateColor @numberplateResult="numberplateResult($event,item)"
:defaultStr='item[item.value]' :vanType='vanType'>
<licensePlateColor @numberplateResult="numberplateResult($event,item)" :defaultStr='item[item.value]'
:vanType='vanType'>
</licensePlateColor>
</view>
<!-- 上传图片,证件照等 -->
@@ -352,7 +344,8 @@
var str = e.replace(/\s*/g, "");
item[item.value] = str
}
function numberplateResult(e: any, item){

function numberplateResult(e: any, item) {
item[item.value] = e.id
console.log(e);
}
@@ -453,6 +446,19 @@
return
}
}
if (data.type == 2 && !data.show) {
if (data.checkReg) {
let regs = new RegExp(data.checkReg) //g代表全部
if (!regs.test(data[data.value])) {
showToast(data.checkPrompt || data.title + '校验失败')
return
}
}
if (data.minlength && data[data.value].length && +data.minlength > data[data.value].length) {
showToast(data.title + '最小长度为' + data.minlength)
return
}
}

if (data.value.indexOf(',') != -1 && data.type == 8) {
if (data[data.value.split(',')[0]]) {

+ 3
- 0
components/form-builder/tools.ts Visa fil

@@ -33,6 +33,9 @@ export interface TypeData {
num: number; //富文本输入长度计数
mode: string; //选择器类型 date time selector
uploadCarBottom: boolean; //选择器类型 date time selector
checkReg: string; //选择器类型 date time selector
checkPrompt: string; //选择器类型 date time selector
minlength: string; //选择器类型 date time selector
}

//通过name拿到当前字段的坐标值

+ 1
- 0
pages/mailingAddress/mailingAddress.vue Visa fil

@@ -94,6 +94,7 @@
commitInterface,
jumpPage
} = config.value
console.log(data);
request(commitInterface || '3dc2df0ba7004fffbd97192cbaa66b6f', {
data,
}).then((res) => {

+ 30
- 30
pages/payment/payment.vue Visa fil

@@ -141,37 +141,37 @@
}, 1000)

// 根据公网ip获取支付地址
// myJsonp({
// url: 'https://www.taobao.com/help/getip.php',
// success(res) {
// console.log(res)
// const data = {
// fee: 1,
// spbillCreateIp: res.ip,
// }
// OrdinaryRequest({
// data,
// }).then(res => {
// if (res.code === 200) {
// console.log(res.data)
// // window.location.href = res.data.h5Url
// // window.open(res.data.h5Url)
// // 在当前窗口中打开一个新窗口
// // const newWindow = window.open('', '_self'); // 给 URL 添加自定义请求头信息
// // const url = res.data.h5Url;
// // const headers = {
// // 'Referer': 'www.aaa.com'
// // };
// // const params = new URLSearchParams(headers).toString();
// // const urlWithHeader = `${url}?${params}`; // 设置新窗口的 URL
// // newWindow.location.href = urlWithHeader;
// // const h5Url = res.data.h5Url.substring(21)
myJsonp({
url: 'https://www.taobao.com/help/getip.php',
success(res) {
console.log(res)
const data = {
fee: 1,
spbillCreateIp: res.ip,
}
OrdinaryRequest({
data,
}).then(res => {
if (res.code === 200) {
console.log(res.data)
// window.location.href = res.data.h5Url
window.open(res.data.h5Url, '_blank')
// 在当前窗口中打开一个新窗口
// const newWindow = window.open('', '_self'); // 给 URL 添加自定义请求头信息
// const url = res.data.h5Url;
// const headers = {
// 'Referer': 'www.aaa.com'
// };
// const params = new URLSearchParams(headers).toString();
// const urlWithHeader = `${url}?${params}`; // 设置新窗口的 URL
// newWindow.location.href = urlWithHeader;
// const h5Url = res.data.h5Url.substring(21)

// // toWeixin(h5Url)
// }
// })
// }
// })
// toWeixin(h5Url)
}
})
}
})


// const data = {

+ 2
- 2
utils/network/encryption.js Visa fil

@@ -161,12 +161,12 @@ function textToBase64(text, key, iv) {

//调用中台参数
export function encryption(ifCode, subdata, type) {
var requestData = new Array();
let requestData = new Array();
requestData["ifCode"] = ifCode;
// requestData["appId"] = "52030131"; // || "admin001"
requestData["appId"] = "admin001"; // || "admin001"

requestData["signType"] = "MD5"; // || "NONE"
// requestData["signType"] = "MD5"; // || "NONE"
// requestData["encryptType"] = "SM4";
requestData["encryptType"] = "NONE";
requestData["reqId"] = requestData["appId"] + "_" + getDate() + "_" + generateMixed(5);

+ 1
- 1
vite.config.js Visa fil

@@ -9,7 +9,7 @@ export default defineConfig({
server: {
cors: true, // 默认启用并允许任何源
proxy: {
'^//wxpay': { //微信支付
'^/wxpay': { //微信支付
target: 'http://192.168.1.3:8080', // 目标服务
changeOrigin: true,
// rewrite: path => path.replace(/^\/api/, ''),

Laddar…
Avbryt
Spara