• uniapp兼容小程序下拉弹框形式展示数据


    goCamera: function() {
        let that = this
        // #ifdef  APP-PLUS
        uni.chooseImage({
         count: 1, //默认9
         sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
         sourceType: ['album', 'camera'], //从相册选择
         success: function(res) {
          console.log(res,"app")
          console.log(res.tempFilePaths);
          // debugger
          that.shop.img = res.tempFilePaths[0]
          console.log(that.shop.img)
           that.url = res.tempFilePaths[0]
          const tempFilePaths = res.tempFilePaths;
          
    
         }
        });
        // #endif
        // #ifdef  MP-WEIXIN
        wx.showActionSheet({
         itemList: ['拍照', '从相册中选择'],
         success(res) {
          console.log(res.tapIndex,"weixin")
          let sourceType = 'camera'
          if (res.tapIndex == 0) {
           sourceType = 'camera'
          } else if (res.tapIndex == 1) {
           sourceType = 'album'
          }
          wx.chooseImage({
           count: 1,
           sizeType: ['compressed'],
           sourceType: [sourceType],
           success: function(res) {
            console.log(res.tempFilePaths)
            const tempFilePaths = res.tempFilePaths[0]
             that.url = res.tempFilePaths[0]
             console.log(that.url)
            // uni.uploadFile({
            //  url: http.baseUrl + '/uploads/upload-supplier-shop-head-portrait/' + uni.getStorageSync('shopId'),
            //  methods: "post",
            //  filePath: tempFilePaths,
            //  name: 'upload',
            //  success: function(uploadFileRes) {
            //   console.log(JSON.parse(uploadFileRes.data).data);
            //   // _this.imgList = [..._this.imgList, uploadFileRes.data]
            //   that.shopDetail.shopHeadImgUrl = JSON.parse(uploadFileRes.data).data
            //  }
            // });
            // this.tui.href('../cropper-default?src=' + that.url);
            console.log("yaotiaole")
            uni.navigateTo({
             url:"./cropper-default?src=" + that.url +"&uploadtype=touxiang&shopId=" + that.shopId + "&shopName=" + that.shopName + "&sourceType=" + sourceType ,
             success: (r) => {
              console.log(r)
             }
            })
           },
          })
         },
        })
      

  • 相关阅读:
    cuda cdnn 安装
    神经网络的例子
    理解pytorch几个高级选择函数(如gather)
    opencv 膨胀和腐蚀
    PyPDF2
    百度ocr
    opencv 代码集合
    tesseract cuda pytorch安装
    Vue路由钩子 afterEach beforeEach区别
    (转载)中文区位码、国标码、机内码、输入码、字形码
  • 原文地址:https://www.cnblogs.com/ly1368489670/p/14069504.html
Copyright © 2020-2023  润新知