Code.ren 2021-10-03 13:18 采纳率: 0%
浏览 64

微信小程序座位预约怎么实现座位图的更新

img


就是怎么实现座位图的更新,怎去更新这个js文件



```javascript
// 本地模拟json数据
var json = {
  "errorCode": 0,
  "errorMsg": "",
  "name": "7号厅",
  "movieName": "惊奇队长",
  "showTime": "2019-03-06 周五 16:50",
  "cinema_name": "惊奇队长影院",
  "seatList": [
    {
      "id": "16879097",
      "row": "1",
      "col": "1",
      "gRow": 1,
      "gCol": 19,
      "type": "0",
      "flag": "0",
      "price": "69"
    },
    {
      "id": "16879097",
      "row": "1",
      "col": "1",
      "gRow": 1,
      "gCol": 18,
      "type": "0",
      "flag": "0",
      "price": "69"
    },
    {
      "id": "16879097",
      "row": "1",
      "col": "1",
      "gRow": 1,
      "gCol": 17,
      "type": "0",
      "flag": "0",
      "price": "69"
    },
    {
      "id": "16879097",
      "row": "1",
      "col": "1",
      "gRow": 2,
      "gCol": 5,
      "type": "0",
      "flag": "0",
      "price": "69"
    },

    {
      "id": "16879100",
      "row": "1",
      "col": "3",
      "gRow": 1,
      "gCol": 7,
      "type": "0",
      "flag": "0",
      "price": "69"
    },
    {
      "id": "16879103",
      "row": "1",
      "col": "6",
      "gRow": 1,
      "gCol": 10,
      "type": "0-2",
      "flag": "0",
      "price": "69"
    },
    {
      "id": "16879107",
      "row": "1",
      "col": "9",
      "gRow": 1,
      "gCol": 14,
      "type": "0",
      "flag": "0",
      "price": "69"
    },
    {
      "id": "16879113",
      "row": "2",
      "col": "1",
      "gRow": 2,
      "gCol": 3,
      "type": "0",
      "flag": "0",
      "price": "69"
    },
    {
      "id": "16879117",
      "row": "2",
      "col": "4",
      "gRow": 2,
      "gCol": 7,
      "type": "0",
      "flag": "0",
      "price": "69"
    },
    {
      "id": "16879120",
      "row": "2",
      "col": "7",
      "gRow": 2,
      "gCol": 10,
      "type": "0",
      "flag": "0",
      "price": "69"
    },
    {
      "id": "16879124",
      "row": "2",
      "col": "10",
      "gRow": 2,
      "gCol": 14,
      "type": "0",
      "flag": "0",
      "price": "69"
    },
    {
      "id": "16879114",
      "row": "2",
      "col": "2",
      "gRow": 2,
      "gCol": 4,
      "type": "0",
      "flag": "0",
      "price": "69"
    },
    {
      "id": "16879118",
      "row": "2",
      "col": "5",
      "gRow": 2,
      "gCol": 8,
      "type": "0",
      "flag": "0",
      "price": "69"
    },
    {
      "id": "16879121",
      "row": "2",
      "col": "8",
      "gRow": 2,
      "gCol": 11,
      "type": "0",
      "flag": "0",
      "price": "69"
    },
    {
      "id": "16879125",
      "row": "2",
      "col": "11",
      "gRow": 2,
      "gCol": 15,
      "type": "0",
      "flag": "0",
      "price": "69"
    },
    {
      "id": "16879116",
      "row": "2",
      "col": "3",
      "gRow": 2,
      "gCol": 6,
      "type": "0",
      "flag": "0",
      "price": "69"
    },
    {
      "id": "16879119",
      "row": "2",
      "col": "6",
      "gRow": 2,
      "gCol": 9,
      "type": "0-3",
      "flag": "0",
      "price": "69"
    },
    {
      "id": "16879122",
      "row": "2",
      "col": "9",
      "gRow": 2,
      "gCol": 12,
      "type": "0",
      "flag": "0",
      "price": "69"
    },
    {
      "id": "16879142",
      "row": "3",
      "col": "13",
      "gRow": 3,
      "gCol": 15,
      "type": "0",
      "flag": "0",
      "price": "69"
    },
    {
      "id": "16879129",
      "row": "3",
      "col": "2",
      "gRow": 3,
      "gCol": 2,
      "type": "0",
      "flag": "0",
      "price": "69"
    },
    {
      "id": "16879133",
      "row": "3",
      "col": "5",
      "gRow": 3,
      "gCol": 6,
      "type": "0",
      "flag": "0",
      "price": "69"
    },
    {
      "id": "16879136",
      "row": "3",
      "col": "8",
      "gRow": 3,
      "gCol": 9,
      "type": "0",
      "flag": "0",
      "price": "69"
    },
    {
      "id": "16879139",
      "row": "3",
      "col": "11",
      "gRow": 3,
      "gCol": 12,
      "type": "0",
      "flag": "0",
      "price": "69"
    },
    {
      "id": "16879143",
      "row": "3",
      "col": "14",
      "gRow": 3,
      "gCol": 16,
      "type": "0",
      "flag": "0",
      "price": "69"
    },
    {
      "id": "16879130",
      "row": "3",
      "col": "3",
      "gRow": 3,
      "gCol": 3,
      "type": "0",
      "flag": "0",
      "price": "69"
    },
    {
      "id": "16879134",
      "row": "3",
      "col": "6",
      "gRow": 3,
      "gCol": 7,
      "type": "0",
      "flag": "0",
      "price": "69"
    },
    {
      "id": "16879137",
      "row": "3",
      "col": "9",
      "gRow": 3,
      "gCol": 10,
      "type": "0",
      "flag": "0",
      "price": "69"
    },
    {
      "id": "16879141",
      "row": "3",
      "col": "12",
      "gRow": 3,
      "gCol": 14,
      "type": "0",
      "flag": "0",
      "price": "69"
    },
    {
      "id": "16879144",
      "row": "3",
      "col": "15",
      "gRow": 3,
      "gCol": 17,
      "type": "0",
      "flag": "0",
      "price": "69"
    },
    {
      "id": "16879128",
      "row": "3",
      "col": "1",
      "gRow": 3,
      "gCol": 1,
      "type": "0",
      "flag": "0",
      "price": "69"
    },
    {
      "id": "16879131",
      "row": "3",
      "col": "4",
      "gRow": 3,
      "gCol": 4,
      "type": "0",
      "flag": "0",
      "price": "69"
    },
    {
      "id": "16879135",
      "row": "3",
      "col": "7",
      "gRow": 3,
      "gCol": 8,
      "type": "0",
      "flag": "0",
      "price": "69"
    },
    {
      "id": "16879138",
      "row": "3",
      "col": "10",
      "gRow": 3,

  ],
  "seatTypeList": [
    {
      "name": "可选",
      "type": "0",
      "seats": 1,
      "icon": "https://i.postimg.cc/BbbWyY5D/image.png",
      "isShow": "1",
      "position": "up"
    },
    {
      "name": "已选",
      "type": "0-1",
      "seats": 1,
      "icon": "https://i.postimg.cc/1X2dd93h/image.png",
      "isShow": "1",
      "position": "up"
    },
    {
      "name": "已售",
      "type": "0-2",
      "seats": 1,
      "icon": "https://i.postimg.cc/LXywzkds/image.png",
      "isShow": "1",
      "position": "up"
    },
    {
      "name": "维修",
      "type": "0-3",
      "seats": 1,
      "icon": "https://i.postimg.cc/BZVRbCcY/image.png",
      "isShow": "1",
      "position": "up"
    },
    {
      "name": "情侣首座可选",
      "type": "1",
      "seats": 1,
      "icon": "https://i.postimg.cc/bYVfbP8R/image.png",
      "isShow": "0",
      "position": "up"
    },
    {
      "name": "情侣首座已选",
      "type": "1-1",
      "seats": 1,
      "icon": "https://i.postimg.cc/nrC5TsZG/image.png",
      "isShow": "0",
      "position": "up"
    },
    {
      "name": "情侣首座已售",
      "type": "1-2",
      "seats": 1,
      "icon": "https://i.postimg.cc/8CS2DPBT/image.png",
      "isShow": "0",
      "position": "up"
    },
    {
      "name": "情侣首座维修",
      "type": "1-3",
      "seats": 1,
      "icon": "https://i.postimg.cc/QMJRMG01/image.png",
      "isShow": "0",
      "position": "up"
    },
    {
      "name": "情侣次座可选",
      "type": "2",
      "seats": 1,
      "icon": "https://i.postimg.cc/sxLFRYKL/image.png",
      "isShow": "0",
      "position": "up"
    },
    {
      "name": "情侣次座已选",
      "type": "2-1",
      "seats": 1,
      "icon": "https://i.postimg.cc/nc68R1Xj/image.png",
      "isShow": "0",
      "position": "up"
    },
    {
      "name": "情侣次座已售",
      "type": "2-2",
      "seats": 1,
      "icon": "https://i.postimg.cc/P5ZgB8D6/image.png",
      "isShow": "0",
      "position": "up"
    },
    {
      "name": "情侣次座维修",
      "type": "2-3",
      "seats": 1,
      "icon": "https://i.postimg.cc/3Jy5FqxQ/image.png",
      "isShow": "0",
      "position": "up"
    },
    {
      "name": "情侣座",
      "type": "5",
      "seats": 2,
      "icon": "https://i.postimg.cc/85kxJK03/image.png",
      "isShow": "1",
      "position": "up"
    }
  ]
}

// 定义数据出口
module.exports = {
  dataList: json
}
  • 写回答

1条回答 默认 最新

  • 崽崽的谷雨 2021-10-08 11:43
    关注

    如果是实时的就需要长链接 如果不是 可以 弄一个刷新按钮点击重新获取接口 ,重新渲染 座位表

    评论

报告相同问题?

问题事件

  • 创建了问题 10月3日

悬赏问题

  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 AT89C51控制8位八段数码管显示时钟。
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题