美文网首页
小程序集合

小程序集合

作者: Ann_l | 来源:发表于2018-06-21 11:06 被阅读0次

目录

问题集合

页面弹出背景滚动

在页面中弹窗弹出,对弹窗内容进行滑动以后,背景内容也进行滚动。

解决方案1、对弹出的页面设定属性 catchtouchmove="move

  <div
      catchtouchmove="move"
      class="c-modal-example"
      v-if="modal.visable"
      @click="close">
    <a @click="close"></a>
    <div class="content">
        <img
          src="/static/WechatIMG8076.jpeg"
          mode="aspectFit"
          :class="{
            'example__img__is-iphonex': device.isMiniProgramIsIPhoneX
          }">
    </div>
  </div>

解决方案2、对背景页面内容固定 :scroll-y="false"

    <scroll-view
      :scroll-y="false"
      @scrolltolower="getProducts"
      :style="{ height: windowHeight + 'px'}">
      <div class="tip" v-if="tipVisable">
        <div class="tip__icon">
          <img src="/static/tip-ted.jpg">
        </div>
        <div class="tip__cell">
          <a @click="tipVisable = !tipVisable"></a>
          <h1>Hi Devin</h1>
          <p>Movin Poster is a tool to create your own item poster to share in your Wechat moments or on any social platforms.</p>
          <span @click="showModalExample">See an example</span>
        </div>
      </div>
      <c-btn
        type="primary"
        @click="createPoster"
        suspend>
        Create poster
      </c-btn>
      <c-modal-example />
    </scroll-view>
form bindsubmit="formSubmit"无效

在mpvue中实现消息模版推送,发现总是提示 Do not have formSubmit handler in current page ,是因为在mpvue中绑定from提交事件的写法需要变成:@submit="postFormId"

> 解决方案1(demo)
<template>
  <div class="c-product-cards">
    <a v-if="items" v-for="(item, index) in items" :key="index">
      <form @submit="postFormId" report-submit="true">
        <button formType="submit" @click="goToProductDetail(item)"></button>
        <figure>
          <img :src="item.product_main_image_url" mode="aspectFill">
        </figure>
      </form>
    </a>
  </div>
</template>

<script>
import formApi from '@/utils/api/form'

export default {
  props: {
    items: {
      type: Array,
      default: () => []
    }
  },
  methods: {
    postFormId (e) {
      const data = {
        form_id: e.target.formId
      }
      formApi.postWXFormId(data)
    },
    goToProductDetail (item) {
      /*
      view = groupon 说明视角是要拼团
      view = normal 说明正常显示拼团和立即购买
      */
      wx.navigateTo({
        url: `/pages/product?id=${item.product_id}&view=normal`
      })
    }
  }
}
</script>

相关文章

  • 小程序集合

    目录 问题集合页面弹出背景滚动表单绑定bindsubmit无效 问题集合 页面弹出背景滚动 在页面中弹窗弹出,对弹...

  • 微信小程序从入门到跑路-下(转)

    小程序Demo集合 微信小程序Demo:银行卡识别小程序求一个测试类的微信小程序demo 微信小程序Demo:天...

  • python小程序集合

    获取随机唯一验证码 关键:随机且唯一,用数字和字母组合,参考网上的写法,就是用数字加分隔符加随机字符串的形式,这样...

  • 小程序问题集合

    空格符: 文本只显示一行: 自定义组件调用问题: 日期格式处理: wepy页面跳转传递参数: 富文本处理特殊文字:...

  • 2018-06-05 2017 7-12 Demo

    7月28日小程序Demo集合 微信小程序Demo:找电影 微信小程序Demo:体育新闻+赛事数据 微信小程序Dem...

  • 微信小程序资料集(下)

    8月18日小程序Demo集合 微信小程序Demo:股票分时图、K线图 微信小程序精品Demo:知乎日报 微信小程序...

  • 微信小程序资料集(中)

    12月1日小程序Demo集合 微信小程序Demo:金融理财计算器 微信小程序Demo:支付宝+微信二维码收款小程序...

  • 小程序源码自以及视频

    小程序视频教程集合(所有源码也都在了)

  • 小程序开发文档说明

    小程序开发说明文档 一、 目录结构: pages目录 (小程序页面的集合)index 目录(index页面)ind...

  • 小程序好文集合

    组件篇 微信小程序:组件实践 整体梳理 微信小程序开发深入解读

网友评论

      本文标题:小程序集合

      本文链接:https://www.haomeiwen.com/subject/eilqyftx.html