测试<img src="x">

<?php>
echo 1;
</php>

<1>

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
<template> <view> <image :src="mySrc" style="width: 100%;"></image> <view class="show"> <button type="primary" @click="selectimg()">请上传户口本页面</button> </view> <view> <uni-section title="姓名" type="line"> <uni-card :is-shadow="false"> <text class="uni-body">{{personname}}</text> </uni-card> </uni-section> <uni-section title="身份证号" type="line"> <uni-card :is-shadow="false"> <text class="uni-body">6105******</text> </uni-card> </uni-section> <uni-section title="评论区" type="line" padding> <uni-easyinput type="textarea" v-model="value" placeholder="请输入内容"></uni-easyinput> </uni-section> </view> <uni-section title="评论得分" type="line" padding> <uni-rate v-model="rateValue" @change="onChange" /> </uni-section> <view> <button type="primary">确定评论</button> </view> </view> </template> <script> export default { data() { return { mySrc: require("@/static/logo/lo3.png"), personname:"", }; }, methods: { selectimg() { uni.chooseImage({ count: 1, sizeType: ['original', 'compressed'], sourceType: ['album'], success: (res) => { console.log(res.tempFilePaths[0]); this.mySrc = res.tempFilePaths[0]; this.changeImgToBase64(res.tempFilePaths[0]); } }); }, changeImgToBase64(source_img) { uni.getFileSystemManager().readFile({ filePath: source_img, encoding: "base64", success: (res) => { console.log("加密之后的图片格式:" + JSON.stringify(res)); this.makeFinalResult(res.data); }, }); }, async makeFinalResult(base64) { let token = await uni.request({ url: 'https://aip.baidubce.com/oauth/2.0/token', data: { grant_type: 'client_credentials', client_id: '2kKeVk6LvdFX8knIyYUodMDr', client_secret: '9pSXGfzvv7q1Fo76WRkeyXVpZGrj8zxb', }, success: (res) => { console.log("获取token:===>" + res.data.access_token); token = res.data.access_token; }, }); uni.request({ url: 'https://aip.baidubce.com/rest/2.0/ocr/v1/household_register?access_token=' + token, method: 'POST', data: { image: base64, }, header: { "Content-Type": "application/x-www-form-urlencoded", }, success: (res) => { console.log("最终的结果:" + JSON.stringify(res)); //this.personname = res.words_result.Name.words; }, }); }, }, }; </script> <style lang="scss"> .show { display: flex; justify-content: center; height: 100vh; align-items: center; } <style>
最新发布
07-20

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值