给字段添加校验
This commit is contained in:
parent
7a434ce738
commit
75f097de67
|
|
@ -1,7 +1,18 @@
|
||||||
<template>
|
<template>
|
||||||
<scroll-view scroll-y class="pro-container box-border" :style="{backgroundImage: 'url('+config[brandName]?.src+')',height:`${config[brandName].height}rpx`}">
|
<scroll-view
|
||||||
|
scroll-y
|
||||||
|
class="pro-container box-border"
|
||||||
|
:style="{
|
||||||
|
backgroundImage: 'url(' + config[brandName]?.src + ')',
|
||||||
|
height: `${config[brandName]?.height}rpx`,
|
||||||
|
}"
|
||||||
|
>
|
||||||
<view class="pro-wrapper flex flex-wrap">
|
<view class="pro-wrapper flex flex-wrap">
|
||||||
<view v-for="(item,index) in products" :key="index" class="product-container">
|
<view
|
||||||
|
v-for="(item, index) in products"
|
||||||
|
:key="index"
|
||||||
|
class="product-container"
|
||||||
|
>
|
||||||
<ProductItem :detail="item" :index="index" />
|
<ProductItem :detail="item" :index="index" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -9,21 +20,20 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import ProductItem from './product-item'
|
import ProductItem from "./product-item";
|
||||||
import config from '../config'
|
import config from "../config";
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
products: {
|
products: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true,
|
required: true,
|
||||||
default:() => ([])
|
default: () => [],
|
||||||
},
|
},
|
||||||
brandName: {
|
brandName: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
default:''
|
default: "",
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
import md5 from 'js-md5';
|
import md5 from "js-md5";
|
||||||
import getSM3Sign from '@/api/ycnc'
|
import { getSM3Sign } from "@/api/ycnc";
|
||||||
export default function useCode() {
|
export default function useCode() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const authCallback = (params) => {
|
const authCallback = (params) => {
|
||||||
console.log('authCallback-use',params);
|
console.log("authCallback-use", params);
|
||||||
const {code} = params
|
const { code } = params;
|
||||||
resolve(code)
|
resolve(code);
|
||||||
}
|
};
|
||||||
const getNewAuthorization = async () => {
|
const getNewAuthorization = async () => {
|
||||||
let appId = import.meta.env.VITE_YCNC_APPID;
|
let appId = import.meta.env.VITE_YCNC_APPID;
|
||||||
let time = Date.now().toString();
|
let time = Date.now().toString();
|
||||||
|
|
@ -15,20 +15,20 @@ export default function useCode(){
|
||||||
// let signBefore = appId + time + secret;
|
// let signBefore = appId + time + secret;
|
||||||
// let sign = md5(signBefore);
|
// let sign = md5(signBefore);
|
||||||
//sm3加密
|
//sm3加密
|
||||||
let {data} = await getSM3Sign({params:{appId,time}})
|
let { data } = await getSM3Sign({ params: { appId, time } });
|
||||||
let param = {
|
let param = {
|
||||||
appId: appId,
|
appId: appId,
|
||||||
// sign: sign,
|
// sign: sign,
|
||||||
sign: data.sign,
|
sign: data?.sign,
|
||||||
time: time,
|
time: time,
|
||||||
tran_code: "157",
|
tran_code: "157",
|
||||||
fn: "authCallback",
|
fn: "authCallback",
|
||||||
needBind: ""
|
needBind: "",
|
||||||
};
|
};
|
||||||
console.log('auth-param157-use',param);
|
console.log("auth-param157-use", param);
|
||||||
Fw.device.api.getNewAuthorization(param)
|
Fw.device.api.getNewAuthorization(param);
|
||||||
};
|
};
|
||||||
window.authCallback = authCallback;
|
window.authCallback = authCallback;
|
||||||
getNewAuthorization()
|
getNewAuthorization();
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue