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

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

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日

悬赏问题

  • ¥20 IDEA 下 lombok 不生效,找不到get
  • ¥15 sas无法加载传输模块
  • ¥15 ABAQUS模拟钢管混凝土往复荷载,滞回曲线卸载荷载却比加载荷载大是为什么
  • ¥15 IOS设置了charels得代理,但是显示无互联网连接,无法打开chls.pro/ssl下载证书
  • ¥40 一维度流体仿真软件前端如何开发
  • ¥500 DELPHI环境安卓定位实时发送及回调消息展示
  • ¥15 易视腾is-E5-ngh怎么刷机,求各位们分享一下吧
  • ¥15 Androidstudio的程序,求各位帮帮我
  • ¥15 岩石声发射矩张量反演软件
  • ¥15 用Python完成一个任务