vue, vux调用微信点击图片,上传图片,删除图片,接口,其中选图接口,苹果手机显示有问题,查看不到图片,提交会提示fail not exist,解决如下

<template>  <div v-cloak v-show="show">        <div v-show="mailbox">          <div class="deanMailbox" >            <div class="deanMailDiv">              <div>                <ul class="uplodeUl">                  <li v-for="(item,index) in images" class="uplodeLi">                    <img :src="item.imgSrc" class="uplodeImg"/>                    <div @click=‘remove_img(index)‘ class="imgA"></div>                  </li>                  <li>                    <div class="uplodeDean" v-if="images.length != 10" @click="chooseImg">                      <img src="../assets/img/uolode.png" width="100%" height="100%"/>                    </div>                    <span class="uplodeTxt font16" v-if="images.length<2">上传问题照片</span>                  </li>                </ul>              </div>            </div>          </div>          <div class="squadButton agencyBut" v-on:click="submit">提交</div>        </div>      </div>    </div>  </div></template><script>  let $ = require(‘Jquery‘)  export default {    name: ‘sommoProblem‘,    data () {      return {        show: false,        feedback: [{          cat_list: []        }],        sommoProblem: true,        mailbox: false,        feedbacks: false,        feed_index: 0,        sommoProblemOne: true,        sommoProblemTwo: false,        sommeoIndex: 0,        back: [],        selectShows: true,        myback: [],        selectProblem: ‘‘,        textAreaProblem: ‘‘,        images: [],        imageArray: [],        myFeedBackOnClick: false,        infoList: {},        styleObject: {          width: ‘‘,          height: ‘‘        },        avatar: ‘‘,        userNames: ‘‘,        img: [],        style: {          width: ‘‘        }      }    },    methods: {      verify: function () {        let thisObj = this        this.$chaos.setTitle(‘帮助与反馈‘)        this.$chaos.verify(function () {          thisObj.$chaos.ajax({   //需要调用微信jdk接口,后台已经打包好了,前端直接调用的接口,想要在vux中使用微信jdk必须在引用vux给的东西,这个可以在 https://vux.li/#/?id=%E4%BD%BF%E7%94%A8%E5%BE%AE%E4%BF%A1-jssdk 网站中看到            data: {              url: location.href.split(‘#‘)[0]            },            slient: true,            userinfo: true,            url: ‘Weixin/get_jssdk_config‘,              callback: function (type, res) {              if (type !== ‘success‘) {                return              }              if (res.status) {                thisObj.$wechat.config(res.info)              }            }          })        })      },      getLocalImgData: function (localIds) {        let localId = localIds.pop()        let thisObj = this        thisObj.$wechat.getLocalImgData({   //vux中把wx换成 thisObj.$wechat
          localId: localId,          success: function (res) {            let localData = res.localData            thisObj.images.push({imgSrc: localData, localId: localId})            if (localIds.length > 0) {              thisObj.getLocalImgData(localIds)            }          },          fail: function () {            thisObj.$vux.toast.show({              text: ‘图片有误‘,              type: ‘text‘,              width: ‘180px‘,              position: ‘bottom‘            })          }        })      },      chooseImg: function () {        let thisObj = this        thisObj.$wechat.chooseImage({          count: 9, // 默认9          sizeType: [‘original‘, ‘compressed‘],          sourceType: [‘album‘, ‘camera‘],          success: function (res) {            let localIds = res.localIds            if (window.__wxjs_is_wkwebview) {  //判断是否是WKWebview内核,也就是苹果内核              thisObj.getLocalImgData(localIds)            } else {              for (let i = 0; i < localIds.length; i++) {                thisObj.images.push({imgSrc: localIds[i], localId: localIds[i]})              }            }            setTimeout(function () {              $(‘.uplodeImg‘).each(function () {                if ($(this).height() > $(this).width()) {                  $(this).css({‘width‘: ‘100%‘, ‘height‘: ‘auto‘})                } else {                  $(this).css({‘width‘: ‘auto‘, ‘height‘: ‘100%‘})                }              })            }, 600)          }        })      },      remove_img: function (index) {        let thisObj = this        thisObj.$vux.confirm.show({          title: ‘系统提示‘,          content: ‘确认要删除吗?‘,          onConfirm () {            thisObj.images.splice(index, 1)          }        })      },      submit: function () {        let thisObj = this        thisObj.imageArray = []        thisObj.wx_upload_img(thisObj.images.length)      },      wx_upload_img: function (index) {        let thisObj = this        if (index === 0) {          if (thisObj.images.length >= 9) {            thisObj.$vux.toast.show({              text: ‘图片最多上传9张‘,              type: ‘text‘,              width: ‘180px‘,              position: ‘bottom‘            })            return          }          thisObj.$vux.confirm.show({            title: ‘系统提醒‘,            content: ‘确认要提交吗?‘,            onConfirm () {              thisObj.$vux.loading.show({                text: ‘Loading‘              })              thisObj.$chaos.ajax({                data: {                  file: thisObj.imageArray                },                slient: true,                userinfo: true,                url: ‘User/user_leave_msg‘,                callback: function (type, res) {                  if (type !== ‘success‘) {                    return                  }                  if (res.status) {                    thisObj.$vux.loading.hide()                  } else {                    thisObj.$vux.toast.show({                      text: res.msg,                      type: ‘text‘,                      width: ‘180px‘,                      position: ‘bottom‘                    })                  }                }              })            }          })          return        }        let thisSrc = thisObj.images[index - 1][‘localId‘]        thisObj.$wechat.uploadImage({          localId: thisSrc, // 需要上传的图片的本地ID,由chooseImage接口获得          isShowProgressTips: 0, // 默认为1,显示进度提示          success: function (res) {            let serverId = res.serverId // 返回图片的服务器端ID            thisObj.imageArray.push(serverId)            thisObj.wx_upload_img(index - 1)          }        })      }    },    created: function () {      this.verify()    },    watch: {      ‘$route‘: ‘verify‘    }  }</script><style scoped>  .divmyFeed{    margin-bottom:30px;  }  #feedUl li{    float: left;    margin-right: 5px;    overflow: hidden;    margin-bottom: 5px;  }  #feedUl li:nth-child(3n){    margin-right: 0px;  }  #feedUl:after{    content: ‘‘;    display: block;    clear: both;  }  #feedUl{    margin-top: 10px;  }  [v-cloak] {    display: none;  }  .noMessageColor{    color: #bbb;    margin-bottom: 10px;  }  .messageImg{    text-align: center;    margin-top: 180px;  }  .myFeedOn {    margin: 10px 30px 10px 38px;    background: #FFFFFF;    box-shadow: 0 1px 5px #ccc;    /*padding:10px 15px;*/  }  .myFeedTitle {    padding: 15px 20px;    position: relative;  }  .feedCon {    padding-bottom: 10px;    border-bottom: 1px solid #bebebe;  }  .feedQues{    padding: 8px 0px;    word-break: break-all;    text-align: justify;  }  .feedTitle {    padding: 14px 0px 14px 32px;    overflow: hidden;  }  .boderB {    border-bottom: 1px solid #dfdfdf;    border-top: 1px solid #dfdfdf;  }  .feedP2 {    color: #393939;    font-size:16px;    line-height: 1.9;    text-align: justify;  }  .feedP1 {    font-size: 14px;    color: #6c6c6c;    line-height: 1.5;  }  .feedImage{    position: absolute;    left: -24px;    top: 22px;    width: 60px;    height: 60px;    border-radius: 50%;    overflow: hidden;  }  .feedBottom {    padding: 30px 0px 6px;    margin-bottom: 20px;  }  .feedBottomYellow {    font-size: 14px;    text-align: center;    line-height: 1.3;    color: #ffa200;  }  .feedBottomP {    font-size: 14px;    text-align: center;    line-height: 3;    color: #bababa;  }  .imgA{    position: absolute;    top:0px;    right:0px;    width: 20px;    height:20px;    background-size: 100% 100%;    background-image: url(../assets/img/del.png);  }  .uplodeLi{    width: 22%;    float: left;    margin-right: 4%;    overflow: hidden;    box-sizing: border-box;    height: 73px;    margin-bottom: 7px;    position: relative;  }  .uplodeLi:nth-child(4n){    margin-right: 0%;  }  .fileInput{    position: absolute;    top: 0;    left: 0;    right: 0;    bottom: 0;    width: 100%;    opacity: 0;  }  .selectDiv{    position: relative;  }  .placeProble{    position: absolute;    left: -47px;    top: 10px;    background: transparent;    z-index: -8;  }  .selectDiv{    display: inline-block;  }  .sommoProblemTxt li {    border-bottom: 1px solid #e2e2e2;  }  .uplodeUl:after{    content: ‘‘;    display: block;    clear: both;  }  .sommoProblemTxtP {    margin: 0 30px;    background: url(../assets/img/circle.png) no-repeat;    text-indent: 20px;    background-size: 2.5%;    background-position: 0 6px;  }  .personalUl a, .opinionA a {    color: #363636;  }  .sommoProblemHead {    border-bottom: 1px solid #fbac36;    padding: 4px 0;  }  .sommoProblemHead li {    width: 33.333%;    float: left;    text-align: center;    line-height: 2.5;    position: relative;  }  .opinionA li {    padding: 20px 30px;  }  .sommoProblemBor:after {    content: ‘‘;    display: block;    width: 45%;    margin: 0 auto;    height: 2px;    background: #fbac36;  }  .sommoProblemHead li {    width: 33.333%;    float: left;    text-align: center;    line-height: 2.5;    position: relative;  }  .sommoProblemHead li {    width: 33.333%;    float: left;    text-align: center;    line-height: 2.5;    position: relative;  }  .sommoProblemHead ul:after {    content: ‘‘;    display: block;    clear: both;  }  .deanMailbox {    border-bottom: 1px solid #e2e2e2;  }  .deanMailSel {    width: 100%;    text-align: center;    border-bottom: 1px solid #e2e2e2;  }  .deanMailboxSelect {    -webkit-appearance: none;    background: transparent;    border: 0;    font-size: 16px;    line-height: 2.8;    z-index: 999;    width: 100%;    padding-right: 20px;    height: 45px;    width: 90px;    outline: none;  }  .placeProble{    width: 120px;  }  .deanMailboxSelect:active{    background: transparent;  }  .deanMailboxI {    width: 11px;    height: 8px;    background-image: url(../assets/img/xiala.png);    font-weight:bold;">#FFFFFF;    background-size: 100% 100%;    display: inline-block;    position: absolute;    top: 20px;    right: 0;  }  .deanMailDiv {    margin: 15px 20px;  }  .deanMailboxTextarea {    resize: none;    width: 100%;    border: 0;    font-size: 16px;  }  .uplodeDean {    width: 22%;    height: 73px;    display: inline-block;    position: relative;  }  .uplodeTxt {    padding: 0px 10px;  }  .font16 {    font-size: 16px;  }  .myFeedback {    margin: 0 20px;  }  .myFeedback li {    background: #f6f6f6;    padding: 20px 20px 11px;    margin: 20px 0;    box-shadow: 0 1px 4px #ccc;  }  .myFeedbackDiv {    margin-bottom: 5px;  }  .fl {    float: left;  }  .myFeed {    margin-left: 70px;    overflow: hidden;    text-overflow: ellipsis;    white-space: nowrap;    word-break: break-all;  }  .shz {    color: #d30012;  }  .myFeedXz {    width: 30px;    height: 12px;    margin: 16px auto 0;    background: url(../assets/img/xiala.png) no-repeat;    background-size: 65%;    background-position: center center;  }</style>
时间: 2024-07-29 21:22:32

vue, vux调用微信点击图片,上传图片,删除图片,接口,其中选图接口,苹果手机显示有问题,查看不到图片,提交会提示fail not exist,解决如下的相关文章

asp源码微信公众号拍照或从手机相册中选图接口

'设置参数值 Public Sub setParameter(parameter, parameterValue) If parameters.Exists(parameter) = True Then parameters.Remove(parameter) End If parameters.Add parameter, parameterValue End Sub 'Microsoft.XMLHTTP 'Get/Post方法请求url,获取请求内容 Public Function Requ

微信JS-SDK 分享到朋友圈 分享给朋友 分享到QQ 拍照或从手机相册中选图 识别音频并返回识别结果 使用微信内置地图查看位置 原文:http://www.cnblogs.com/txw1958/p/weixin-js-sdk-demo.html

wx.ready(function () { // 1 判断当前版本是否支持指定 JS 接口,支持批量判断 document.querySelector('#checkJsApi').onclick = function () { wx.checkJsApi({ jsApiList: [ 'getNetworkType', 'previewImage' ], success: function (res) { alert(JSON.stringify(res)); } }); }; // 2.

第三方网站不能调用微信公众平台里的图片了 显示&quot;此图片来自微信公众号平台未经允许不可引用&quot;

下午ytkah在自己小博客搜索时看到有几篇文章图片显示不了,再访问一些网站时发现有些图片无法显示出来,显示"此图片来自微信公众号平台未经允许不可引用",如下图所示,这个应该是最近微信团队对有原创保护能力的公众帐号又一举措. 是不是有点似曾相识?没错,第三方网站调用QQ空间里面的图片也是不能完整显示,提示“此图片来自QQ空间,未经允许不可引用”. 其实,腾讯这些措施应该也是无赖之举,微信公众平台已有近800万公众号入驻了,很多公众号的单篇图文消息都超过了10+阅读量,可以想象整个公众平台

微信点击关注图片(点击上方蓝色字关注图标)

标签: 微信关注图片 微信点击关注图标 微信平台求关注图片 微信求关注动态图片 微信求关注图标素材   微信求关注图标素材,微信求关注图片,微信求关注,微信求关注图标,微信求关注素材. 找这个素材很上火?试试自己煲广东凉茶下火快(http://menghuange.taobao.com) 梦幻阁健康食品立足于粤北山区,出售野生的各种养生食材,养生汤料,保健茶饮,野生药材特产. [花 草 茶] 清热降火茶 瘦身减肥茶 补血益气茶 清肝明目茶 清咽润喉茶 排毒养颜茶 [凉茶原料] 二十味茶  清热解

Vue 调用微信扫一扫功能

这个功能呢就是公众号里面埋一个网页,有个功能扫一扫,调用微信的js-sdk来弄: https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141115 官方文档 第一步绑定域名,就是你在公众号登录之后要设置域名,还有白名单,这个喊后端去弄,前端又不晓得哪些是白名单,域名是好多 第二部:安装js-sdk的包(用npm 或yarn安装npm install weixin-js-sdk --save) 第三部:配置wx.config 这个里

.net Core 调用微信Jsapi接口,H5解析二维码

项目里需要用到扫描二维码,自己实现,不会. 找到了两种解决方案: 通过reqrcode.js,这是一个前端解析二维码内容的js库.如果二维码比较清晰,用这种效果也不错 调用微信扫一扫功能,这种效果很好.但是调试接口超级麻烦. 具体实现:前端代码(vue)(前端用到 vux) <template> <div class="main"> <group title="打印机参数" label-width="5.5em"&g

第三方平台也能为未微信认证的订阅号调用自定义菜单接口和素材管理接口

3月20号已认证微信公众号可通过第三方平台管理微信公众平台素材,现在自定义菜单接口和素材管理接口向第三方平台旗下未认证订阅号开放,未认证订阅号也可以授权给第三方平台,让第三方平台开发者帮助实现自定义菜单和素材管理业务.但请注意,为了避免接口安全风险,公众号自身仍旧没有上述接口权限,无法调用这些接口. 未认证订阅号的自定义菜单接口能力,与公众平台官网内能力是相同的,具体如下: 1. 点击菜单后,公众号回复一条消息,支持图文消息.图片.语音.视频类型,不支持文本消息: 2. 点击菜单后,跳转到公众号

微信企业号 JS-SDK:上传图片

微信企业号 JS-SDK:上传图片 微信的JS-SDK提供了微信客户端相关的功能,如:拍照.选图.语音.位置等手机系统的能力,同时可以直接使用微信分享.扫一扫等微信特有的能力,为微信用户提供更优质的网页体验.这里将会介绍如何通过调用JS-SDK接口从手机摄像头或相册内上传图片. 目录 1. 介绍 2. 代码示例 1. 介绍 1.1 流程说明 首先看下整个Demo的流程: ①微信客户端访问页面 ②获取JS-SDK中的相关权限 API:http://qydev.weixin.qq.com/wiki/

MPVUE - 使用vue.js开发微信小程序

MPVUE - 使用vue.js开发微信小程序 什么是mpvue? mpvue 是美团点评前端团队开源的一款使用 Vue.js 开发微信小程序的前端框架.框架提供了完整的 Vue.js 开发体验,开发者编写 Vue.js 代码,mpvue 将其解析转换为小程序并确保其正确运行. 简单上手mpvue 官方提供了一套quickstart模板. vue init mpvue/mpvue-quickstart my-project 安装好依赖之后,执行npm run dev,将会将小程序文件打包进dis