当前位置: 首页 > news >正文

做网站计划营销广告文案

做网站计划,营销广告文案,深圳个人做网站,网上做造价网站在当前页面整个 view 中 给页面绑定 点击事件bindtap"onSwipeCellPage"给 van-swipe-cell 组件设置 id (for循环可以添加 id"swip-cell-{{item.id}}" )van-swipe-cell 组件 添加属性 当用户打开滑块时触发 bind:open"swiperCel…
  1. 在当前页面整个 view 中 给页面绑定 点击事件bindtap="onSwipeCellPage"
  2. 给 van-swipe-cell 组件设置 id (for循环可以添加 id="swip-cell-{{item.id}}"
  3. van-swipe-cell 组件 添加属性 当用户打开滑块时触发 bind:open="swiperCellOpen"
  4. van-swipe-cell 组件 添加属性 点击滑动单元格时触发的事件 bind:click="onSwipeCellClick"
  5. 需要对单元格实例数组进行遍历,遍历以后获取每一个实例,让每一个实例调用 close 方式即可

示例

  1. 新建文件夹 SwiperCell.js
Page({data: {swipeCellQueue: [], //用来存储滑动单元格实例 },// 当用户打开滑块时触发swiperCellOpen(event) {// 获取单元格实例const instance = this.selectComponent(`#${event.target.id}`)// 将实例追加到数据中this.data.swipeCellQueue.push(instance)},// 给页面绑定 点击事件onSwipeCellPage() { this.onSwipeCellCommonClick() },// 点击滑动单元格时触发的事件onSwipeCellClick() { this.onSwipeCellCommonClick() },onSwipeCellCommonClick() {// 需要对单元格实例数组进行遍历,遍历以后获取每一个实例,让每一个实例调用 close 方式即可this.data.swipeCellQueue.forEach((instance) => {instance.close()})// 将滑动单元格数组重置为空this.data.swipeCellQueue = []}
})
  1. 然后在使用文件 wxml 中 最外层的 view 绑定 页面点击事件 bindtap="onSwipeCellPage"
  2. 给 swipe-cell 绑定一个 id <van-swipe-cell class="goods-swipe" right-width="{{ 65 }}" id="swipe-cell-{{item.id}}">
  3. 给 swipe-cell 绑定open和click事件 <van-swipe-cell class="goods-swipe" right-width="{{ 65 }}" id="swipe-cell-{{item.id}}" bind:open="swiperCellOpen" bind:click="onSwipeCellClick">
  4. 在 使用文件 js 中 引入 Behaviors
  5. 然后在 onHide 方法 引入 在页面隐藏的时候,需要让删除滑块自动弹回
import { ComponentWithStore } from 'mobx-miniprogram-bindings'
import { userStore } from '@/stores/userStore'
import { reqDelCartGoods } from "@/api/cart"import { swipeCellBehavior } from "@/behaviors/swiperCell"
const computedBehavior = require("miniprogram-computed").behavior
ComponentWithStore({behaviors: [ swipeCellBehavior],storeBindings: {store: userStore,fields: ['token']},data: {cartList: []},methods: {//  如果使用 Compoent 方法来构建页面// 生命周期钩子函数 需要在 methods 中才可以// 删除商品async delCartGoods(evnet) {// 要删除的idlet { id } = evnet.currentTarget.dataset// 自己封装的 modal方法const isOk = await wx.modal({title: '提示',content: "您确定要删除吗?"})if (!isOk) {return}const res = await reqDelCartGoods(id)if (res.code === 200) {....}},onHide() {this.onSwipeCellCommonClick()}}
})
http://www.hkea.cn/news/221878/

相关文章:

  • 网站营销优化方案北京做的好的seo公司
  • 企业网站排名提升软件优化南宁seo优化
  • 创意合肥网站建设杭州seo公司排名
  • 网站专题页是什么中国十大关键词
  • 五月天做网站网络策划与营销
  • 高校网站如何建设论文谷歌官网下载
  • 做网站内容软件个人网站怎么做
  • 收废铁的做网站有优点吗海南百度推广开户
  • wordpress 二维码插件下载信阳搜索引擎优化
  • 个人网站二级域名做淘宝客企业推广策略
  • 厦门做网站seo的seo服务公司招聘
  • 安徽池州做企业网站百度搜索官方网站
  • 芜湖商城网站建设青岛百度快速优化排名
  • 我找伟宏篷布我做的事ko家的网站seoul怎么读
  • 即墨做网站优书网首页
  • 网站建设实践报告3000字放单平台
  • 中华人民共和国城乡住房建设厅网站seo技术外包
  • 网站做销售是斤么工作东莞网站营销推广
  • 做网站现在还行吗宁德市疫情
  • 响应式网站首页百度搜索资源
  • 工人找工作哪个网站好福州百度seo
  • 台湾做甜品的网站谷歌seo关键词排名优化
  • 织梦网站导入链接怎么做谷歌广告投放
  • 沈阳网站哪家公司做的好镇江关键字优化品牌
  • 台州本地做网站的做引流推广的平台600
  • 网站的导航用css怎么做网站外链查询
  • 青岛模版网站建设关键词优化按天计费
  • 高端网站建设服务器seo服务哪家好
  • 服装网站建设分析网站浏览器
  • 建站城企业邮箱怎么开通注册