读取投票项目列表(拉取问卷)

javascript 复制代码
WXAPI.voteItems({
  page: 1
})
  • page 获取第几页数据,不传该参数默认为1
  • pageSize 每页获取几条记录,不传该参数默认为50
  • status 状态 0 正常 1 关闭
  • categoryId 拉取指定分类的投票项目
  • orderBy 排序:idAsc, idDesc
  • showItems 传true,列表会显示所有的投票选项
json 复制代码
{
  "code": 0,
  "data": {
    "result": [
      {
        "categoryId": 78201,
        "content": "",
        "id": 147,
        "isLimitGroup": false,
        "isPublic": false,
        "items": [
          {
            "id": 919,
            "isBest": false,
            "paixu": 0,
            "status": 0,
            "title": "https://dcdn.it120.cc/2022/04/20/b86c5c91-f6c6-4600-9cfe-e76f2e834a49.jpeg",
            "titleType": 1,
            "type": 0,
            "userId": 10,
            "voteId": 147,
            "voteNum": 0
          },
          {
            "id": 920,
            "isBest": false,
            "paixu": 0,
            "status": 0,
            "title": "https://dcdn.it120.cc/2022/04/20/fd9809d5-f76c-4f79-9d4d-a04638487b58.jpeg",
            "titleType": 1,
            "type": 0,
            "userId": 10,
            "voteId": 147,
            "voteNum": 0
          },
          {
            "id": 921,
            "isBest": false,
            "paixu": 0,
            "status": 0,
            "title": "https://dcdn.it120.cc/2022/04/20/35251b0d-d54d-4f0b-8929-2889945b59c6.jpeg",
            "titleType": 1,
            "type": 0,
            "userId": 10,
            "voteId": 147,
            "voteNum": 0
          },
          {
            "id": 922,
            "isBest": false,
            "paixu": 0,
            "status": 0,
            "title": "https://dcdn.it120.cc/2022/04/20/7290a799-1867-4b87-bab2-2f7ec2a70c4d.jpeg",
            "titleType": 1,
            "type": 0,
            "userId": 10,
            "voteId": 147,
            "voteNum": 0
          }
        ],
        "joinNum": 0,
        "limitUserDay": 1,
        "limitUserTotal": 1,
        "rule": 0,
        "status": 0,
        "title": "舌体属于哪一种?",
        "type": 0,
        "userId": 10
      },
      {
        "categoryId": 78201,
        "content": "",
        "id": 146,
        "isLimitGroup": false,
        "isPublic": false,
        "items": [
          {
            "id": 912,
            "isBest": false,
            "paixu": 0,
            "status": 0,
            "title": "30岁以下",
            "titleType": 0,
            "type": 0,
            "userId": 10,
            "voteId": 146,
            "voteNum": 0
          },
          {
            "id": 913,
            "isBest": false,
            "paixu": 0,
            "status": 0,
            "title": "30-40",
            "titleType": 0,
            "type": 0,
            "userId": 10,
            "voteId": 146,
            "voteNum": 0
          },
          {
            "id": 914,
            "isBest": false,
            "paixu": 0,
            "status": 0,
            "title": "40-50",
            "titleType": 0,
            "type": 0,
            "userId": 10,
            "voteId": 146,
            "voteNum": 0
          },
          {
            "id": 915,
            "isBest": false,
            "paixu": 0,
            "status": 0,
            "title": "50-60",
            "titleType": 0,
            "type": 0,
            "userId": 10,
            "voteId": 146,
            "voteNum": 0
          },
          {
            "id": 916,
            "isBest": false,
            "paixu": 0,
            "status": 0,
            "title": "60岁以上",
            "titleType": 0,
            "type": 0,
            "userId": 10,
            "voteId": 146,
            "voteNum": 0
          }
        ],
        "joinNum": 0,
        "limitUserDay": 1,
        "limitUserTotal": 1,
        "rule": 0,
        "status": 0,
        "title": "您处于什么年龄段?",
        "type": 0,
        "userId": 10
      }
    ],
    "totalRow": 9,
    "totalPage": 1
  },
  "msg": "success"
}
  • id 题目记录ID
  • title 题目名称
  • rule 0 单选 1 多选
  • items 题目选项
    • id 答案记录ID
    • title 答案标题(或者图片答案的图片地址)
    • titleType 0 为文字答案; 1 为图片答案