身份证,通话
This commit is contained in:
parent
21c79178fd
commit
b5685a0d6f
|
|
@ -11,18 +11,18 @@
|
|||
<image v-if="type=='ios'" src="/static/image/call/iosSearchRight.png" mode=""></image>
|
||||
</view>
|
||||
<view class="selectType" v-if="type=='huawei'">
|
||||
<view class="btn active">
|
||||
<view class="btn " :class="{'active':active}" @click.stop="setActive(true)">
|
||||
全部来电
|
||||
</view>
|
||||
<view class="btn">
|
||||
<view class="btn" :class="{'active':!active}" @click.stop="setActive(false)">
|
||||
未接来电
|
||||
</view>
|
||||
</view>
|
||||
<view class="selectTypeVivo" v-if="type=='vivo'">
|
||||
<view class="btn active">
|
||||
<view class="btn " :class="{'active':active}" @click.stop="setActive(true)">
|
||||
全部
|
||||
</view>
|
||||
<view class="btn">
|
||||
<view class="btn" :class="{'active':!active}" @click.stop="setActive(false)">
|
||||
未接
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -53,6 +53,7 @@
|
|||
})
|
||||
|
||||
const data = reactive({
|
||||
active:true,
|
||||
statusBarHeight: 0,
|
||||
showTipLayer: true,
|
||||
title:'最近通话',
|
||||
|
|
@ -67,6 +68,7 @@
|
|||
})
|
||||
|
||||
let {
|
||||
active,
|
||||
searchTitle,
|
||||
title,
|
||||
list,
|
||||
|
|
@ -77,7 +79,7 @@
|
|||
if(props.type=='xiaomi'){
|
||||
searchTitle.value="搜索联系人"
|
||||
title.value="通话"
|
||||
console.log('aaaaaaaaaaa')
|
||||
// console.log('aaaaaaaaaaa')
|
||||
}else if(props.type=='oppo'){
|
||||
title.value="通话"
|
||||
}else if(props.type=='huawei'){
|
||||
|
|
@ -85,6 +87,11 @@
|
|||
}
|
||||
|
||||
})
|
||||
|
||||
function setActive(status){
|
||||
active.value=status
|
||||
uni.$emit('setActive',status)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<uni-nav-bar :backgroundColor="navBgColor" class="nav-bar" :border="false" :title="title" fixed="true">
|
||||
<uni-nav-bar :backgroundColor="navBgColor" class="nav-bar" :border="false" :title="title" fixed="true" statusBar="true">
|
||||
<template v-slot:left>
|
||||
<slot name="left">
|
||||
<view :class="[type+'LeftTitle']" :style="{opacity:(type!='huawei'&&type!='oppo'?1: navOpacity)}">
|
||||
|
|
@ -11,18 +11,18 @@
|
|||
<view class="nav-bar-title " :class="['nav-bar-title-'+type]">
|
||||
<slot>
|
||||
<view class="iosBox" v-if="type=='ios'">
|
||||
<view class="btn active">
|
||||
<view class="btn " :class="{'active':active}" @click.stop="setActive(true)">
|
||||
全部来电
|
||||
</view>
|
||||
<view class="btn">
|
||||
<view class="btn" :class="{'active':!active}" @click.stop="setActive(false)">
|
||||
未接来电
|
||||
</view>
|
||||
</view>
|
||||
<view class="oppoBox" v-if="type=='oppo'" :style="{opacity: navOpacity?1-navOpacity:1}">
|
||||
<view class="btn active">
|
||||
<view class="btn " :class="{'active':active}" @click.stop="setActive(true)">
|
||||
全部
|
||||
</view>
|
||||
<view class="btn">
|
||||
<view class="btn" :class="{'active':!active}" @click.stop="setActive(false)">
|
||||
未接
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -80,6 +80,7 @@
|
|||
})
|
||||
|
||||
const data = reactive({
|
||||
active:true,
|
||||
statusBarHeight: 0,
|
||||
LeftTitle:'',
|
||||
showTipLayer: true,
|
||||
|
|
@ -88,6 +89,7 @@
|
|||
})
|
||||
|
||||
let {
|
||||
active,
|
||||
LeftTitle,
|
||||
showTipLayer,
|
||||
navOpacity,
|
||||
|
|
@ -96,7 +98,7 @@
|
|||
|
||||
// 监听 scrollTop 变化
|
||||
watch(() => props.scrollTop, (newValue, oldValue) => {
|
||||
console.log('scrollTop changed:', newValue);
|
||||
// console.log('scrollTop changed:', newValue);
|
||||
// 根据 scrollTop 的值计算导航栏透明度
|
||||
if (newValue > 0) {
|
||||
// 当 scrollTop 大于 0 时,透明度逐渐增加
|
||||
|
|
@ -123,11 +125,15 @@
|
|||
LeftTitle.value=''
|
||||
}
|
||||
})
|
||||
function setActive(status){
|
||||
active.value=status
|
||||
uni.$emit('setActive',status)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
::v-deep .uni-navbar__header-btns {
|
||||
width: 25vw !important;
|
||||
width: 27vw !important;
|
||||
}
|
||||
|
||||
.iosLeftTitle {
|
||||
|
|
@ -246,6 +252,7 @@
|
|||
background: #FFFFFF;
|
||||
box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.1);
|
||||
border-radius: 6px 6px 6px 6px;
|
||||
margin: 0 2px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
2
main.js
2
main.js
|
|
@ -27,7 +27,7 @@ export function createApp() {
|
|||
const systemInfo = uni.getStorageSync('systemInfo') || {}
|
||||
app.config.globalProperties.$system = systemInfo.platform == 'ios' ? 'iOS' : 'Android'
|
||||
app.config.globalProperties.$systemInfo = systemInfo
|
||||
uni.setStorageSync('version', '1.0.3.sp1')
|
||||
uni.setStorageSync('version', '1.0.3.sp2')
|
||||
app.config.globalProperties.$version = uni.getStorageSync('version')
|
||||
|
||||
app.use(globalMethods);
|
||||
|
|
|
|||
|
|
@ -193,6 +193,14 @@
|
|||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "qf-image/qf-image",
|
||||
"style": {
|
||||
"navigationBarTitleText": "图片裁剪",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "train-tickets/ctrip-train-tickets/ctrip-train-tickets",
|
||||
"style": {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
<template>
|
||||
<view class="container">
|
||||
<!-- 自定义头部导航栏 -->
|
||||
<ZdyNavbar :type="data.type" :scrollTop="data.scrollTop"/>
|
||||
<ZdyNavbar :type="data.type" :scrollTop="data.scrollTop" @click="open"/>
|
||||
<ZdyHeader :type="data.type" />
|
||||
<callList :type="data.type"></callList>
|
||||
<callList :type="data.type" ref="callLogList"></callList>
|
||||
<tabbar :type="data.type" />
|
||||
<image v-if="data.type!='ios'" :src="`/static/image/call/${data.type}BtnImg.png`" mode="" class="btnImg" :class="['btnImg_'+data.type]"></image>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -13,7 +14,7 @@
|
|||
import ZdyHeader from "@/components/call-log/header/header.vue"
|
||||
import callList from "@/components/call-log/list/list.vue"
|
||||
import tabbar from "@/components/call-log/tabbar/tabbar.vue"
|
||||
|
||||
import {util} from"@/utils/common.js"
|
||||
|
||||
import { ref, reactive, watch, nextTick, getCurrentInstance } from "vue";
|
||||
import { onLoad, onShow, onReady, onPageScroll, onReachBottom } from "@dcloudio/uni-app";
|
||||
|
|
@ -22,24 +23,75 @@
|
|||
type: 'vivo',
|
||||
scrollTop:0
|
||||
})
|
||||
|
||||
let callLogList = ref();
|
||||
onLoad((option) => {
|
||||
data.type=option.type
|
||||
|
||||
})
|
||||
onReady(() => {
|
||||
|
||||
})
|
||||
onShow(() => {})
|
||||
onShow(() => {
|
||||
try {
|
||||
if (plus.os.name === 'Android') {
|
||||
let colorTabbar="#FAFAFA"
|
||||
if(data.type=='xiaomi'||data.type=='oppo'){
|
||||
colorTabbar="#FFF"
|
||||
}
|
||||
util.setAndroidSystemBarColor(colorTabbar)
|
||||
setTimeout(() => {
|
||||
plus.navigator.setStatusBarStyle("dark");
|
||||
}, 500)
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.log("修改导航条颜色失败", error);
|
||||
}
|
||||
})
|
||||
onPageScroll((e) => {
|
||||
console.log(e)
|
||||
// console.log(e)
|
||||
data.scrollTop=e.scrollTop
|
||||
|
||||
})
|
||||
onReachBottom(() => {
|
||||
|
||||
})
|
||||
function open(){
|
||||
console.log(callLogList.value)
|
||||
callLogList.value.openAddModal()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
<style lang="scss" >
|
||||
page{
|
||||
background-color: #fff;
|
||||
}
|
||||
.btnImg{
|
||||
position: fixed;
|
||||
|
||||
}
|
||||
.btnImg_vivo{
|
||||
width: 80px;
|
||||
height: 96px;
|
||||
left: 40px;
|
||||
bottom: 130px;
|
||||
}
|
||||
.btnImg_huawei{
|
||||
width: 54px;
|
||||
height: 54px;
|
||||
left: calc(50% - 27px);
|
||||
bottom: 65px;
|
||||
}
|
||||
.btnImg_oppo{
|
||||
width: 58px;
|
||||
height: 58px;
|
||||
right: 20px;
|
||||
bottom: 100px;
|
||||
}
|
||||
.btnImg_xiaomi{
|
||||
width: 55px;
|
||||
height: 55px;
|
||||
right: 34px;
|
||||
bottom: 100px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -39,7 +39,7 @@ const source = ref([{
|
|||
},
|
||||
icon: 'iphone',
|
||||
messageUrl: "/pages/message/list-index?phone=iphone",
|
||||
callUrl: ""
|
||||
callUrl: "/pages/call-log/call?type=ios"
|
||||
},
|
||||
{
|
||||
name: '华为',
|
||||
|
|
@ -50,7 +50,7 @@ const source = ref([{
|
|||
},
|
||||
icon: 'huawei',
|
||||
messageUrl: "/pages/message/list-index?phone=huawei",
|
||||
callUrl: ""
|
||||
callUrl: "/pages/call-log/call?type=huawei"
|
||||
},
|
||||
{
|
||||
name: '小米',
|
||||
|
|
@ -61,7 +61,7 @@ const source = ref([{
|
|||
},
|
||||
icon: 'mi',
|
||||
messageUrl: "/pages/message/list-index?phone=mi",
|
||||
callUrl: ""
|
||||
callUrl: "/pages/call-log/call?type=xiaomi"
|
||||
},
|
||||
{
|
||||
name: 'oppo',
|
||||
|
|
@ -72,7 +72,7 @@ const source = ref([{
|
|||
},
|
||||
icon: 'oppo',
|
||||
messageUrl: "/pages/message/list-index?phone=oppo",
|
||||
callUrl: ""
|
||||
callUrl: "/pages/call-log/call?type=oppo"
|
||||
}, {
|
||||
name: 'vivo',
|
||||
color: {
|
||||
|
|
@ -82,7 +82,7 @@ const source = ref([{
|
|||
},
|
||||
icon: 'vivo',
|
||||
messageUrl: "/pages/message/list-index?phone=vivo",
|
||||
callUrl: ""
|
||||
callUrl: "/pages/call-log/call?type=vivo"
|
||||
},
|
||||
])
|
||||
|
||||
|
|
|
|||
|
|
@ -256,10 +256,15 @@ const otherList = [{
|
|||
path: "/pages/other/card/card"
|
||||
},
|
||||
{
|
||||
icon: "/static/image/index/qita/card.png",
|
||||
icon: "/static/image/index/qita/message.png",
|
||||
name: "短信",
|
||||
path: "/pages/common/call-and-message-entry/call-and-message-entry?type=message"
|
||||
},
|
||||
{
|
||||
icon: "/static/image/index/qita/call.png",
|
||||
name: "通话",
|
||||
path: "/pages/common/call-and-message-entry/call-and-message-entry?type=call"
|
||||
},
|
||||
]
|
||||
|
||||
const data = reactive({
|
||||
|
|
|
|||
|
|
@ -11,34 +11,37 @@
|
|||
<l-painter isCanvasToTempFilePath @success="successImage" @progress="progress" hidden
|
||||
:css="`width:${data.width}px;height:${data.height }px;background-color:#fff;`">
|
||||
<l-painter-view
|
||||
:css="`margin-top:116px;margin-left:75px;position: relative;width:650px;height:360px;background-image: url('/static/image/other/card/cardBGImg.png');background-size:650px 360px;`">
|
||||
:css="`margin-top:109px;margin-left:75px;position: relative;width:666px;height:406px;background-image: url('/static/image/other/card/cardBGImg.png');background-size:6660px 406px;`">
|
||||
<!-- 头部年月 -->
|
||||
<l-painter-view :css="`position: absolute;left:122px;top:28px;`">
|
||||
<l-painter-view :css="`position: absolute;left:122px;top:50px;`">
|
||||
<l-painter-text :css="data.textCss+data.textCssLeft" :text="data.form.name" />
|
||||
</l-painter-view>
|
||||
<l-painter-view :css="`position: absolute;left:122px;top:78px;`">
|
||||
<l-painter-view :css="`position: absolute;left:122px;top:100px;`">
|
||||
<l-painter-text :css="data.textCss2+data.textCssLeft" :text="data.form.gender" />
|
||||
</l-painter-view>
|
||||
<l-painter-view :css="`position: absolute;left:254px;top:78px;`">
|
||||
<l-painter-view :css="`position: absolute;left:260px;top:100px;`">
|
||||
<l-painter-text :css="data.textCss2+data.textCssLeft" :text="data.form.nation" />
|
||||
</l-painter-view>
|
||||
<l-painter-view :css="`position: absolute;left:122px;top:126px;`">
|
||||
<l-painter-text v-for="(item,index) in data.form.year.toString()" :css="data.textCss3+data.textCssLeft" :text="item" :key="index" />
|
||||
<l-painter-view :css="`position: absolute;left:122px;top:148px;`">
|
||||
<l-painter-text v-for="(item,index) in data.form.year.toString()" :css="data.textCss3+data.textCssLeft"
|
||||
:text="item" :key="index" />
|
||||
</l-painter-view>
|
||||
<l-painter-view :css="`position: absolute;left:184px;top:126px;`">
|
||||
<l-painter-view :css="`position: absolute;left:190px;top:148px;`">
|
||||
<l-painter-text :css="data.textCss2+data.textCssCenter" :text="data.form.month.toString()" />
|
||||
</l-painter-view>
|
||||
<l-painter-view :css="`position: absolute;left:244px;top:126px;`">
|
||||
<l-painter-view :css="`position: absolute;left:250px;top:148px;`">
|
||||
<l-painter-text :css="data.textCss2+data.textCssCenter" :text="data.form.day.toString()" />
|
||||
</l-painter-view>
|
||||
<l-painter-view :css="`position: absolute;left:122px;top:177px;width:274px;`">
|
||||
<l-painter-text v-for="(item,index) in data.form.address" :css="data.textCss3+data.textCssLeft" :text="item" :key="index"/>
|
||||
<l-painter-view :css="`position: absolute;left:122px;top:196px;width:274px;`">
|
||||
<l-painter-text v-for="(item,index) in data.form.address" :css="data.textCss3+data.textCssLeft" :text="item"
|
||||
:key="index" />
|
||||
</l-painter-view>
|
||||
<l-painter-view :css="`position: absolute;left:223px;top:300px;`">
|
||||
<l-painter-text v-for="(item,index) in data.form.idNumber" :css="data.textCss4+data.textCssLeft" :text="item" :key="index"/>
|
||||
<l-painter-view :css="`position: absolute;left:223px;top:320px;`">
|
||||
<l-painter-text v-for="(item,index) in data.form.idNumber" :css="data.textCss4+data.textCssLeft" :text="item"
|
||||
:key="index" />
|
||||
</l-painter-view>
|
||||
<l-painter-view :css="`position: absolute;right:48px;top:55px;`">
|
||||
<l-painter-image v-if="data.form.photo" :src="data.form.photo" css="width: 196px; height: 230px;"/>
|
||||
<l-painter-view :css="`position: absolute;right:48px;top:62px;`">
|
||||
<l-painter-image v-if="data.form.photo" :src="data.form.photo" css="width: 196px; height: 230px;" />
|
||||
<l-painter-view v-else css="width: 196px; height: 230px;background-color:#fff;">
|
||||
</l-painter-view>
|
||||
</l-painter-view>
|
||||
|
|
@ -104,28 +107,28 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
// 自定义头部
|
||||
import ZdyNavbar from "@/components/nav-bar/nav-bar.vue"
|
||||
// 自定义头部
|
||||
import ZdyNavbar from "@/components/nav-bar/nav-bar.vue"
|
||||
|
||||
import {
|
||||
import {
|
||||
ref,
|
||||
reactive,
|
||||
watch,
|
||||
nextTick,
|
||||
getCurrentInstance
|
||||
} from "vue";
|
||||
import {
|
||||
} from "vue";
|
||||
import {
|
||||
onLoad,
|
||||
onShow,
|
||||
onReady,
|
||||
onPullDownRefresh,
|
||||
onReachBottom
|
||||
} from "@dcloudio/uni-app";
|
||||
const {
|
||||
} from "@dcloudio/uni-app";
|
||||
const {
|
||||
appContext,
|
||||
proxy
|
||||
} = getCurrentInstance();
|
||||
const data = reactive({
|
||||
} = getCurrentInstance();
|
||||
const data = reactive({
|
||||
navbar: {
|
||||
title: "身份证",
|
||||
bgColor: '#EDEDED',
|
||||
|
|
@ -149,77 +152,136 @@ const data = reactive({
|
|||
textCss3: 'word-spacing: 10px;letter-spacing: 10px;margin-right:2px;font-family: "SimHei", "Microsoft YaHei", sans-serif;text-align: left;color:#3D3D3D;font-size:22px;mix-blend-mode: overlay;',
|
||||
textCss4: 'word-spacing: 10px;margin-right:3px;letter-spacing: 10px;font-family: "card", "Microsoft YaHei", sans-serif;text-align: left;color:#1a1a1a;font-size:28px;mix-blend-mode: overlay;display:flex;',
|
||||
|
||||
textCssLeft:'text-align: left;',
|
||||
textCssCenter:'text-align: center;'
|
||||
textCssLeft: 'text-align: left;',
|
||||
textCssCenter: 'text-align: center;'
|
||||
})
|
||||
|
||||
// 弹窗相关
|
||||
const showEditPopup = ref(false);
|
||||
const editForm = ref({});
|
||||
//
|
||||
function successImage(e){
|
||||
data.code=e
|
||||
}
|
||||
function progress(e){
|
||||
if(e<0.03){
|
||||
// 弹窗相关
|
||||
const showEditPopup = ref(false);
|
||||
const editForm = ref({});
|
||||
//
|
||||
function successImage(e) {
|
||||
console.log(e)
|
||||
data.code = e
|
||||
}
|
||||
|
||||
function progress(e) {
|
||||
console.log(e)
|
||||
if (e < 0.03) {
|
||||
uni.showLoading({
|
||||
title:"生成中"
|
||||
title: "生成中"
|
||||
})
|
||||
}
|
||||
if(e==1){
|
||||
if (e == 1) {
|
||||
setTimeout(() => {
|
||||
uni.hideLoading()
|
||||
}, 1000)
|
||||
|
||||
}
|
||||
console.log(e)
|
||||
}
|
||||
// 打开编辑弹窗
|
||||
function edit() {
|
||||
}
|
||||
// 打开编辑弹窗
|
||||
function edit() {
|
||||
console.log(data.form)
|
||||
// 复制当前表单数据到编辑表单
|
||||
editForm.value = JSON.parse(JSON.stringify(data.form));
|
||||
// 显示弹窗
|
||||
showEditPopup.value = true;
|
||||
}
|
||||
}
|
||||
|
||||
// 关闭编辑弹窗
|
||||
function closeEditPopup() {
|
||||
// 关闭编辑弹窗
|
||||
function closeEditPopup() {
|
||||
showEditPopup.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 保存编辑表单
|
||||
function saveEditForm() {
|
||||
// 保存编辑表单
|
||||
function saveEditForm() {
|
||||
// 将编辑后的数据复制回原始表单
|
||||
data.form = JSON.parse(JSON.stringify(editForm.value));
|
||||
uni.setStorageSync("cardForm",data.form)
|
||||
// 关闭弹窗
|
||||
showEditPopup.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 选择图片
|
||||
function chooseImage() {
|
||||
// 选择图片
|
||||
function chooseImage() {
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
sizeType: ['original', 'compressed'],
|
||||
sourceType: ['album', 'camera'],
|
||||
crop:{
|
||||
width:'196px',
|
||||
height:"230px"
|
||||
},
|
||||
success: (res) => {
|
||||
editForm.value.photo = res.tempFilePaths[0];
|
||||
uni.showLoading({
|
||||
title:"抠图中"
|
||||
})
|
||||
convertLocalImageToFile(res.tempFilePaths[0]).then(file => {
|
||||
proxy.$imageUpload(file.split(',', 2)[1]).then(resimage=>{
|
||||
console.log(resimage);
|
||||
console.log(resimage.data);
|
||||
editForm.value.photo = decodeURI(resimage.data);
|
||||
uni.hideLoading()
|
||||
}).catch(err=>{
|
||||
uni.hideLoading()
|
||||
console.log(err.data.message)
|
||||
uni.showToast({
|
||||
icon:"none",
|
||||
title:err.data.message
|
||||
})
|
||||
})
|
||||
|
||||
}).catch(err=>{
|
||||
|
||||
uni.hideLoading()
|
||||
})
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log('选择图片失败', err);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 预览图片
|
||||
function previewImage() {
|
||||
|
||||
/**
|
||||
* 将本地图片路径通过 Canvas 转换为 File 对象
|
||||
* @param {string} localPath - 本地图片路径(如从 uni.chooseImage 获取的 tempFilePath)
|
||||
* @param {Object} options - 可选参数
|
||||
* @param {string} options.format - 输出格式 'image/png' 或 'image/jpeg',默认 'image/png'
|
||||
* @param {number} options.quality - 图片质量(仅 jpeg 有效),0~1,默认 0.92
|
||||
* @param {number} options.maxWidth - 最大宽度(等比缩放),不填则使用原图尺寸
|
||||
* @param {number} options.maxHeight - 最大高度(等比缩放),不填则使用原图尺寸
|
||||
* @returns {Promise<File>} 返回一个 Promise,resolve 为 File 对象
|
||||
*/
|
||||
function convertLocalImageToFile(localPath) {
|
||||
return new Promise((resolve, reject) => {
|
||||
// 1. 读取本地图片为 Base64(避免 Image 对象直接加载本地路径的兼容问题)
|
||||
plus.io.resolveLocalFileSystemURL(localPath, (entry) => {
|
||||
entry.file((file) => {
|
||||
const reader = new plus.io.FileReader();
|
||||
reader.onload = (e) => {
|
||||
const base64Data = e.target.result; // 格式如 data:image/jpeg;base64,/9j/...
|
||||
resolve(e.target.result)
|
||||
};
|
||||
reader.onerror = (err) => reject(err);
|
||||
reader.readAsDataURL(file); // 读取为 DataURL
|
||||
}, reject);
|
||||
}, reject);
|
||||
|
||||
});
|
||||
}
|
||||
// 预览图片
|
||||
function previewImage() {
|
||||
if (data.code) {
|
||||
uni.previewImage({
|
||||
urls: [data.code],
|
||||
current: 0
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 保存图片
|
||||
function saveImage() {
|
||||
// 保存图片
|
||||
function saveImage() {
|
||||
if (data.code) {
|
||||
console.log(data.code)
|
||||
uni.showLoading({
|
||||
|
|
@ -355,9 +417,9 @@ function saveImage() {
|
|||
icon: 'none'
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onLoad((option) => {
|
||||
onLoad((option) => {
|
||||
// 进入身份证页面埋点
|
||||
proxy.$apiUserEvent('all', {
|
||||
type: 'event',
|
||||
|
|
@ -365,19 +427,23 @@ onLoad((option) => {
|
|||
prefix: '.uni.other.',
|
||||
value: "身份证"
|
||||
})
|
||||
})
|
||||
onReady(() => {
|
||||
let formdata=uni.getStorageSync("cardForm")
|
||||
if(formdata){
|
||||
data.form=formdata
|
||||
}
|
||||
})
|
||||
onReady(() => {
|
||||
|
||||
})
|
||||
onShow(() => { })
|
||||
onPullDownRefresh(() => {
|
||||
})
|
||||
onShow(() => {})
|
||||
onPullDownRefresh(() => {
|
||||
setTimeout(() => {
|
||||
uni.stopPullDownRefresh();
|
||||
}, 1000);
|
||||
})
|
||||
onReachBottom(() => {
|
||||
})
|
||||
onReachBottom(() => {
|
||||
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
@ -386,20 +452,20 @@ onReachBottom(() => {
|
|||
src: url("/static/font/card.ttf");
|
||||
}
|
||||
|
||||
* {
|
||||
* {
|
||||
box-sizing: content-box;
|
||||
}
|
||||
}
|
||||
|
||||
.aadadad {
|
||||
.aadadad {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.heiti {
|
||||
.heiti {
|
||||
font-family: "SimHei", "Microsoft YaHei", sans-serif;
|
||||
}
|
||||
}
|
||||
|
||||
/* 弹窗样式 */
|
||||
.popup-overlay {
|
||||
/* 弹窗样式 */
|
||||
.popup-overlay {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
|
|
@ -410,89 +476,89 @@ onReachBottom(() => {
|
|||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 9999;
|
||||
}
|
||||
}
|
||||
|
||||
.popup-content {
|
||||
.popup-content {
|
||||
background-color: #fff;
|
||||
border-radius: 10px;
|
||||
width: 90%;
|
||||
max-width: 500px;
|
||||
max-height: 80vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.popup-header {
|
||||
.popup-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
}
|
||||
|
||||
.popup-title {
|
||||
.popup-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.popup-close {
|
||||
.popup-close {
|
||||
font-size: 48rpx;
|
||||
color: #999;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.popup-body {
|
||||
.popup-body {
|
||||
padding: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.form-section {
|
||||
.form-section {
|
||||
margin-bottom: 30rpx;
|
||||
padding: 20rpx;
|
||||
background-color: #f5f5f5;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.section-title {
|
||||
.section-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
margin-bottom: 20rpx;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.form-row {
|
||||
.form-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.form-label {
|
||||
.form-label {
|
||||
width: 200rpx;
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.form-input {
|
||||
.form-input {
|
||||
flex: 1;
|
||||
padding: 15rpx;
|
||||
border: 1rpx solid #ddd;
|
||||
border-radius: 4rpx;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.form-separator {
|
||||
.form-separator {
|
||||
margin: 0 10rpx;
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.form-total {
|
||||
.form-total {
|
||||
margin-top: 10rpx;
|
||||
padding-top: 10rpx;
|
||||
border-top: 1rpx dashed #ddd;
|
||||
}
|
||||
}
|
||||
|
||||
.form-total-input {
|
||||
.form-total-input {
|
||||
background-color: #f9f9f9;
|
||||
color: #ff6b35;
|
||||
font-weight: bold;
|
||||
|
|
@ -528,41 +594,41 @@ onReachBottom(() => {
|
|||
object-fit: cover;
|
||||
}
|
||||
|
||||
.popup-footer {
|
||||
.popup-footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx;
|
||||
border-top: 1rpx solid #eee;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-cancel,
|
||||
.btn-save {
|
||||
.btn-cancel,
|
||||
.btn-save {
|
||||
width: 48%;
|
||||
padding: 20rpx;
|
||||
border-radius: 4rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-cancel {
|
||||
.btn-cancel {
|
||||
background-color: #f5f5f5;
|
||||
color: #333;
|
||||
border: 1rpx solid #ddd;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-save {
|
||||
background-color: #ff6b35;
|
||||
.btn-save {
|
||||
background-color: #187AFF;
|
||||
color: #fff;
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* 保存图片按钮 */
|
||||
.button-container {
|
||||
/* 保存图片按钮 */
|
||||
.button-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 30rpx 0;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-save-image {
|
||||
.btn-save-image {
|
||||
background: linear-gradient(90deg, #187AFF 0%, #3295FC 100%);
|
||||
color: #fff;
|
||||
border: none;
|
||||
|
|
@ -574,15 +640,15 @@ onReachBottom(() => {
|
|||
transition: all 0.3s ease;
|
||||
text-align: center;
|
||||
min-width: 160rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-save-image:hover {
|
||||
.btn-save-image:hover {
|
||||
transform: translateY(-2rpx);
|
||||
box-shadow: 0 4rpx 12rpx rgba(7, 72, 193, 0.4);
|
||||
}
|
||||
}
|
||||
|
||||
.btn-save-image:active {
|
||||
.btn-save-image:active {
|
||||
transform: translateY(0);
|
||||
box-shadow: 0 2rpx 6rpx rgba(7, 140, 193, 0.3);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<template>
|
||||
<view>
|
||||
<qf-image-cropper :width="196" :height="230" :radius="0" @crop="handleCrop" :reverseRotatable="true"></qf-image-cropper>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
methods: {
|
||||
handleCrop(e) {
|
||||
uni.saveFile({
|
||||
tempFilePath: e.tempFilePath,
|
||||
success: function(res) {
|
||||
res.avatar = res.savedFilePath
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.7 KiB |
|
|
@ -4,6 +4,9 @@ import {
|
|||
postJson
|
||||
} from "@/utils/requests.js"
|
||||
import pageData from "@/static/json/page.json"
|
||||
import {
|
||||
jsonString
|
||||
} from "../uni_modules/uv-ui-tools/libs/function/test";
|
||||
export default {
|
||||
install(app, options) {
|
||||
|
||||
|
|
@ -148,7 +151,7 @@ export default {
|
|||
temp += "&" + CryptoJS.MD5(key).toString();
|
||||
config.data.signature = CryptoJS.MD5(temp).toString();
|
||||
}
|
||||
// console.log("config:", config)
|
||||
console.log("config:", config)
|
||||
return config
|
||||
};
|
||||
|
||||
|
|
@ -169,11 +172,14 @@ export default {
|
|||
const sortedKeys = Object.keys(data.data).sort();
|
||||
let str = ''
|
||||
for (const key of sortedKeys) {
|
||||
if(!(data.url=='api/image/segment/base64'&&key=='file')){
|
||||
str += '&' + key + '=' + encodeURIComponent(data.data[key]);
|
||||
}
|
||||
}
|
||||
str = str.replace('&', '?')
|
||||
// 拼接URL
|
||||
host = host + str
|
||||
host=host+str
|
||||
console.log(host)
|
||||
console.log(data)
|
||||
const response = await new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
url: host,
|
||||
|
|
@ -181,15 +187,17 @@ export default {
|
|||
data: data.data,
|
||||
header,
|
||||
success: res => {
|
||||
console.log(res)
|
||||
try {
|
||||
if (isCode) {
|
||||
res.data = deCode(res.data.data)
|
||||
console.log(res.data)
|
||||
} else {
|
||||
res.data = res.data.data
|
||||
}
|
||||
|
||||
} catch (err) {
|
||||
|
||||
console.log(err);
|
||||
}
|
||||
resolve(res.data);
|
||||
},
|
||||
|
|
@ -201,8 +209,6 @@ export default {
|
|||
return response;
|
||||
};
|
||||
|
||||
|
||||
|
||||
app.config.globalProperties.$getUserInfo = async () => {
|
||||
try {
|
||||
let user = await app.config.globalProperties.$requestPromise({
|
||||
|
|
@ -214,22 +220,69 @@ export default {
|
|||
if (user.code == 0) {
|
||||
uni.setStorageSync('AppUser', user.data)
|
||||
uni.setStorageSync('userInfo', user.data)
|
||||
// uni.showModal({
|
||||
// title: '提示',
|
||||
// content: JSON.stringify(user.data),
|
||||
// success: function (res) {
|
||||
// if (res.confirm) {
|
||||
// console.log('用户点击确定');
|
||||
// } else if (res.cancel) {
|
||||
// console.log('用户点击取消');
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
}
|
||||
} catch (error) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
}
|
||||
// 上传图片
|
||||
app.config.globalProperties.$uploadImage = async (filePath) => {
|
||||
//头部header
|
||||
let header = uni.getStorageSync('header')
|
||||
//请求地址
|
||||
let host = uni.getStorageSync('host') + 'api/image/segment'
|
||||
header['content-type'] = "multipart/form-data"
|
||||
|
||||
// // 排序
|
||||
let data={
|
||||
method:'POST',
|
||||
data:{},
|
||||
url:'api/image/segment'
|
||||
}
|
||||
data = sign(data)
|
||||
const sortedKeys = Object.keys(data.data).sort();
|
||||
let str = ''
|
||||
for (const key of sortedKeys) {
|
||||
str += '&' + key + '=' + encodeURIComponent(data.data[key]);
|
||||
}
|
||||
|
||||
str = str.replace('&', '?')
|
||||
// 拼接URL
|
||||
host = host + str
|
||||
console.log(host);
|
||||
console.log(data);
|
||||
uni.uploadFile({
|
||||
url: host, // 完整URL
|
||||
filePath: filePath,
|
||||
name: 'file',
|
||||
method:"POST",
|
||||
header: header,
|
||||
formData:{
|
||||
...data.data
|
||||
},
|
||||
success: (res) => {
|
||||
console.log('1.上传成功:',JSON.stringify(res));
|
||||
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('2. 错误详情:', JSON.stringify(err));
|
||||
},
|
||||
complete: (res) => {
|
||||
console.log('3. 上传完成');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
app.config.globalProperties.$imageUpload = async (imagePath) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
postJson('a', 'api/image/segment/base64', {
|
||||
file:imagePath
|
||||
}).then(res=>{
|
||||
resolve(res)
|
||||
}).catch(err=>{
|
||||
reject(err)
|
||||
})
|
||||
})
|
||||
};
|
||||
}
|
||||
};
|
||||
|
|
@ -185,6 +185,7 @@ const request = (method = 'GET', serverUrl, domainUrl, params, dataType = "json"
|
|||
console.log("传参详情", data)
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request(data).then(res => {
|
||||
console.log(deCode(res.data.data))
|
||||
if (res.statusCode == 200) {
|
||||
if (res.data.encrypt) {
|
||||
if (q != 'test') {
|
||||
|
|
|
|||
Loading…
Reference in New Issue