• 支付宝小程序 头部导航背景颜色渐变


    支付宝小程序 头部导航背景颜色渐变

    页面的json中写入

    export default {
      navigationBarTitleText: "",
      enablePullDownRefresh: true,
       transparentTitle: "always",
       titlePenetrate: "YES"
    };
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    view

     
    
    • 1

    css

    .cdn {
      position: fixed;
      width: 100%;
      height: 269px;
      // background-image: url("../../static/img/bg2x.png");
      // background-size: cover;
      background-image: linear-gradient(
        269deg,
        rgba(0, 170, 177, 0.99) 0%,
        #02c5cc 100%
      );
      background-image: linear-gradient(269deg, #009ee7 1%, #13b4ff 100%);
      background-image: linear-gradient(269deg, #0094d9 1%, #13b4ff 100%);
      background-image: linear-gradient(128deg, #e3f7ff 15%, #3f9fff 100%);
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15

    下面是ocr图片识别

    chooseImage() {
    const that = this;
    Taro.chooseImage({
    sizeType: [“original”, “compressed”], // 可以指定是原图还是压缩图,默认二者都有
    sourceType: [“album”, “camera”], // 可以指定来源是相册还是相机,默认二者都有
    success(res) {
    console.log(res);
    let file = res.tempFilePaths[0];
    that.files = res.tempFilePaths[0];
    console.log(file);
    Taro.getImageInfo({
    src: file,
    success(imageInfo) {
    var imgType = imageInfo.type;
    console.log(imageInfo);
    Taro.getFileSystemManager().readFile({
    filePath: file, //选择图片返回的相对路径
    encoding: “base64”, //这个是很重要的
    success: (res) => {
    //成功的回调
    //返回base64格式
    var base64Str =
    “data:image/” + imgType + “;base64,” + res.data;
    // console.log(base64Str);
    var img = res.data;
    console.log(img);
    // that.uploadImg(base64Str);
    that.uploadImg(img);
    },
    fail: (err) => {
    console.log(err);
    reject(err);
    },
    });
    },
    });
    },
    });
    },
    uploadImg(img) {
    OCR01({
    img_content: img,
    }).then((res) => {
    console.log(res);
    this.name = res.name;
    this.num = res.num;
    setSessionStore(“name”, res.name);
    setSessionStore(“num”, res.num);
    });
    },
    chooseImage() {
    const that = this;
    Taro.chooseImage({
    sizeType: [“original”, “compressed”], // 可以指定是原图还是压缩图,默认二者都有
    sourceType: [“album”, “camera”], // 可以指定来源是相册还是相机,默认二者都有
    success(res) {
    console.log(res);
    let file = res.tempFilePaths[0];
    that.files = res.tempFilePaths[0];
    console.log(file);
    Taro.getImageInfo({
    src: file,
    success(imageInfo) {
    var imgType = imageInfo.type;
    console.log(imageInfo);
    Taro.getFileSystemManager().readFile({
    filePath: file, //选择图片返回的相对路径
    encoding: “base64”, //这个是很重要的
    success: (res) => {
    //成功的回调
    //返回base64格式
    var base64Str =
    “data:image/” + imgType + “;base64,” + res.data;
    // console.log(base64Str);
    var img = res.data;
    console.log(img);
    // that.uploadImg(base64Str);
    that.uploadImg(img);
    },
    fail: (err) => {
    console.log(err);
    reject(err);
    },
    });
    },
    });
    },
    });
    },
    uploadImg(img) {
    OCR01({
    img_content: img,
    }).then((res) => {
    console.log(res);
    this.name = res.name;
    this.num = res.num;
    setSessionStore(“name”, res.name);
    setSessionStore(“num”, res.num);
    });
    },

    在这里插入图片描述

  • 相关阅读:
    MySQL1——喵喵期末不挂科
    Flutter 文件读写-path_provider
    LangChain:打造自己的LLM应用 | 京东云技术团队
    LVGL---基础对象(lv_obj)
    2022就业季惊喜来袭!正版Adobe软件,终于能正经白嫖一把了
    LogUtils工具类
    NAACL2022:(代码实践)好的视觉引导促进更好的特征提取,多模态命名实体识别(附源代码下载)...
    java面试题ConcurrentHashMap 的工作原理及代码实现
    农村人口房屋管理系统(VB+access)
    嵌入式Linux与物联网软件开发:C语言内核深度解析
  • 原文地址:https://blog.csdn.net/q4717529/article/details/126509885