给字段添加校验
This commit is contained in:
parent
7a434ce738
commit
75f097de67
|
|
@ -1,42 +1,52 @@
|
|||
<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 v-for="(item,index) in products" :key="index" class="product-container">
|
||||
<ProductItem :detail="item" :index="index"/>
|
||||
<view
|
||||
v-for="(item, index) in products"
|
||||
:key="index"
|
||||
class="product-container"
|
||||
>
|
||||
<ProductItem :detail="item" :index="index" />
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import ProductItem from './product-item'
|
||||
import config from '../config'
|
||||
const props = defineProps({
|
||||
products:{
|
||||
type:Array,
|
||||
required: true,
|
||||
default:() => ([])
|
||||
},
|
||||
brandName:{
|
||||
type:String,
|
||||
required:true,
|
||||
default:''
|
||||
}
|
||||
})
|
||||
|
||||
import ProductItem from "./product-item";
|
||||
import config from "../config";
|
||||
const props = defineProps({
|
||||
products: {
|
||||
type: Array,
|
||||
required: true,
|
||||
default: () => [],
|
||||
},
|
||||
brandName: {
|
||||
type: String,
|
||||
required: true,
|
||||
default: "",
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.pro-container{
|
||||
width:780rpx;
|
||||
.pro-container {
|
||||
width: 780rpx;
|
||||
padding: 136rpx 60rpx 72rpx;
|
||||
// margin-bottom: -24rpx;
|
||||
background-repeat: no-repeat;
|
||||
background-size: contain;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.pro-wrapper{
|
||||
.product-container{
|
||||
.pro-wrapper {
|
||||
.product-container {
|
||||
width: calc((100% - 40rpx) / 3);
|
||||
margin-right: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
|
@ -45,15 +55,15 @@
|
|||
// margin-right:0 !important;
|
||||
// }
|
||||
view:nth-child(3n) {
|
||||
margin-right:0 !important;
|
||||
margin-right: 0 !important;
|
||||
}
|
||||
// view:nth-child(3n+1):nth-last-child(-n+3) > .pro-item-wrapper,
|
||||
// view:nth-child(3n+1):nth-last-child(-n+3)~view > .pro-item-wrapper{
|
||||
// view:nth-child(3n+1):nth-last-child(-n+3)~view > .pro-item-wrapper{
|
||||
// margin-bottom: 0 !important;
|
||||
// }
|
||||
view:nth-child(3n+1):nth-last-child(-n+3),
|
||||
view:nth-child(3n+1):nth-last-child(-n+3)~view{
|
||||
// }
|
||||
view:nth-child(3n + 1):nth-last-child(-n + 3),
|
||||
view:nth-child(3n + 1):nth-last-child(-n + 3) ~ view {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -1,34 +1,34 @@
|
|||
import md5 from 'js-md5';
|
||||
import getSM3Sign from '@/api/ycnc'
|
||||
export default function useCode(){
|
||||
return new Promise((resolve,reject) => {
|
||||
const authCallback = (params) => {
|
||||
console.log('authCallback-use',params);
|
||||
const {code} = params
|
||||
resolve(code)
|
||||
}
|
||||
const getNewAuthorization = async () => {
|
||||
let appId = import.meta.env.VITE_YCNC_APPID;
|
||||
let time = Date.now().toString();
|
||||
//MD5加密
|
||||
// let secret = import.meta.env.VITE_YCNC_SECRET;
|
||||
// let signBefore = appId + time + secret;
|
||||
// let sign = md5(signBefore);
|
||||
//sm3加密
|
||||
let {data} = await getSM3Sign({params:{appId,time}})
|
||||
let param = {
|
||||
appId: appId,
|
||||
// sign: sign,
|
||||
sign: data.sign,
|
||||
time: time,
|
||||
tran_code: "157",
|
||||
fn: "authCallback",
|
||||
needBind: ""
|
||||
};
|
||||
console.log('auth-param157-use',param);
|
||||
Fw.device.api.getNewAuthorization(param)
|
||||
};
|
||||
window.authCallback = authCallback;
|
||||
getNewAuthorization()
|
||||
})
|
||||
}
|
||||
import md5 from "js-md5";
|
||||
import { getSM3Sign } from "@/api/ycnc";
|
||||
export default function useCode() {
|
||||
return new Promise((resolve, reject) => {
|
||||
const authCallback = (params) => {
|
||||
console.log("authCallback-use", params);
|
||||
const { code } = params;
|
||||
resolve(code);
|
||||
};
|
||||
const getNewAuthorization = async () => {
|
||||
let appId = import.meta.env.VITE_YCNC_APPID;
|
||||
let time = Date.now().toString();
|
||||
//MD5加密
|
||||
// let secret = import.meta.env.VITE_YCNC_SECRET;
|
||||
// let signBefore = appId + time + secret;
|
||||
// let sign = md5(signBefore);
|
||||
//sm3加密
|
||||
let { data } = await getSM3Sign({ params: { appId, time } });
|
||||
let param = {
|
||||
appId: appId,
|
||||
// sign: sign,
|
||||
sign: data?.sign,
|
||||
time: time,
|
||||
tran_code: "157",
|
||||
fn: "authCallback",
|
||||
needBind: "",
|
||||
};
|
||||
console.log("auth-param157-use", param);
|
||||
Fw.device.api.getNewAuthorization(param);
|
||||
};
|
||||
window.authCallback = authCallback;
|
||||
getNewAuthorization();
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue