支付宝小程序淘宝模块-schema.json 表单设计

{
  "components": {
    "md_tab": {
      "type": "OfficialRadio",
      "dataName": "md_tab",
      "label": {
        "description": {
          "desc": ""
        },
        "title": ""
      },
      "wrapperStyle": {},
      "style": {},
      "invisible": false,
      "extension": {
        "shape": "button",
        "defaultValue": "1",
        "dataSource": [
          {
            "label": "数据设置",
            "value": "1"
          },
          {
            "label": "样式设置",
            "value": "2"
          }
        ]
      },
      "validateProps": {
        "dataType": "",
        "required": false,
        "validate": false
      }
    },
    "md_title_con": {
      "type": "OfficialContainer",
      "dataName": "md_title_con",
      "label": {
        "description": {
          "desc": ""
        },
        "title": "模块头部数据设置"
      },
      "wrapperStyle": {},
      "style": {},
      "invisible": false,
      "extension": {},
      "validateProps": {
        "dataType": "",
        "required": false,
        "validate": false
      }
    },
    "md_title_type": {
      "type": "OfficialRadio",
      "dataName": "md_title_type",
      "label": {
        "description": {
          "desc": ""
        },
        "title": ""
      },
      "wrapperStyle": {},
      "style": {},
      "invisible": false,
      "extension": {
        "shape": "radio",
        "defaultValue": "1",
        "dataSource": [
          {
            "label": "默认文字标题",
            "value": "1"
          },
          {
            "label": "自定义图片",
            "value": "2"
          }
        ]
      },
      "validateProps": {
        "dataType": "",
        "required": false,
        "validate": false
      }
    },
    "md_title": {
      "type": "OfficialInput",
      "dataName": "md_title",
      "label": {
        "description": {
          "desc": ""
        },
        "title": "请输入模块主标题"
      },
      "wrapperStyle": {},
      "style": {},
      "invisible": false,
      "extension": {
        "clear": true,
        "multiple": false
      },
      "validateProps": {
        "dataType": "Default",
        "required": false,
        "validate": false
      }
    },
    "md_title2": {
      "type": "OfficialInput",
      "dataName": "md_title2",
      "label": {
        "description": {
          "desc": ""
        },
        "title": "请输入模块副标题"
      },
      "wrapperStyle": {},
      "style": {},
      "invisible": false,
      "extension": {
        "clear": true,
        "multiple": false
      },
      "validateProps": {
        "dataType": "Default",
        "required": false,
        "validate": false
      }
    },
    "md_title_link": {
      "type": "OfficialLink",
      "dataName": "md_title_link",
      "label": {
        "description": {
          "desc": ""
        },
        "title": "超链接"
      },
      "wrapperStyle": {},
      "style": {},
      "invisible": false,
      "extension": {
        "placeholder": "请输入链接",
        "url": "//wangpu.taobao.com/shopdecorate/tools/linkSelector.htm"
      },
      "validateProps": {
        "dataType": "",
        "required": false,
        "validate": false
      }
    },
    "diy_title_image": {
      "type": "OfficialImage",
      "dataName": "diy_title_image",
      "label": {
        "description": {
          "desc": "尺寸80-500"
        },
        "title": "自定义模块标题图片"
      },
      "wrapperStyle": {},
      "style": {},
      "invisible": false,
      "extension": {
        "sendDataType": "url",
        "config": {
          "minHeight": 80,
          "maxHeight": 500,
          "needCrop": true,
          "mime": "jpg,png",
          "minWidth": 714,
          "type": "pic",
          "maxWidth": 714
        },
        "url": "//sucai.wangpu.taobao.com/select.htm"
      },
      "validateProps": {
        "dataType": "",
        "required": false,
        "validate": false
      }
    },
    "goods_type": {
      "type": "OfficialRadio",
      "dataName": "goods_type",
      "label": {
        "description": {
          "desc": ""
        },
        "title": "商品读取方式"
      },
      "wrapperStyle": {},
      "style": {},
      "invisible": false,
      "extension": {
        "shape": "radio",
        "defaultValue": "1",
        "dataSource": [
          {
            "label": "自动读取",
            "value": "1"
          },
          {
            "label": "手动选择",
            "value": "2"
          }
        ]
      },
      "validateProps": {
        "dataType": "",
        "required": false,
        "validate": false
      }
    },
    "goods_auto_con": {
      "type": "OfficialContainer",
      "dataName": "goods_auto_con",
      "label": {
        "description": {
          "desc": ""
        },
        "title": "自动读取商品数据设置"
      },
      "wrapperStyle": {},
      "style": {},
      "invisible": false,
      "extension": {},
      "validateProps": {
        "dataType": "",
        "required": false,
        "validate": false
      }
    },
    "goods_number": {
      "type": "OfficialNumberPicker",
      "dataName": "goods_number",
      "label": {
        "description": {
          "desc": ""
        },
        "title": "商品数量,最多4个"
      },
      "wrapperStyle": {},
      "style": {},
      "invisible": false,
      "extension": {
        "size": "medium",
        "min": 2,
        "max": 20
      },
      "validateProps": {
        "dataType": "Number",
        "required": false,
        "validate": false
      }
    },
    "category": {
      "type": "OfficialSelect",
      "dataName": "category",
      "label": {
        "description": {
          "desc": ""
        },
        "title": "商品分类"
      },
      "wrapperStyle": {},
      "style": {},
      "invisible": false,
      "extension": {
        "dataMap": {
          "result": "selectList",
          "label": "text",
          "value": "value"
        },
        "placeholder": "请选择分类",
        "url": "//wangpu.taobao.com/decorate/ajax/select/GetShopCategorySelect.do",
        "resType": "jsonp"
      },
      "validateProps": {
        "dataType": "",
        "required": false,
        "validate": false
      }
    },
    "price": {
      "type": "OfficialRange",
      "dataName": "price",
      "label": {
        "description": {
          "desc": ""
        },
        "title": "价格过滤"
      },
      "wrapperStyle": {},
      "style": {},
      "invisible": false,
      "extension": {
        "dataMap": {
          "start": "startPrice",
          "end": "endPrice"
        },
        "placeholder": "请输入"
      },
      "validateProps": {
        "dataType": "",
        "required": false,
        "validate": false
      }
    },
    "keyword": {
      "type": "OfficialInput",
      "dataName": "keyword",
      "label": {
        "description": {
          "desc": ""
        },
        "title": "关键字"
      },
      "wrapperStyle": {},
      "style": {},
      "invisible": false,
      "extension": {
        "clear": true,
        "multiple": false,
        "placeholder": "请输入关键字"
      },
      "validateProps": {
        "dataType": "Default",
        "required": false,
        "validate": false
      }
    },
    "sort": {
      "type": "OfficialSelect",
      "dataName": "sort",
      "label": {
        "description": {
          "desc": ""
        },
        "title": "商品排序"
      },
      "wrapperStyle": {},
      "style": {},
      "invisible": false,
      "extension": {
        "defaultValue": "oldstarts",
        "placeholder": "",
        "dataSource": [
          {
            "label": "新品",
            "value": "oldstarts"
          },
          {
            "label": "销量",
            "value": "hotsell"
          },
          {
            "label": "人气",
            "value": "coefp"
          },
          {
            "label": "收藏",
            "value": "ordercost"
          },
          {
            "label": "价格升序",
            "value": "bid"
          },
          {
            "label": "价格降序",
            "value": "_bid"
          }
        ]
      },
      "validateProps": {
        "dataType": "",
        "required": false,
        "validate": false
      }
    },
    "diy_data_con": {
      "type": "OfficialContainer",
      "dataName": "diy_data_con",
      "label": {
        "description": {
          "desc": ""
        },
        "title": "请手动选择商品"
      },
      "wrapperStyle": {},
      "style": {},
      "invisible": false,
      "extension": {},
      "validateProps": {
        "dataType": "",
        "required": false,
        "validate": false
      }
    },
    "goods_itemIds": {
      "type": "TaobaowpGoods",
      "dataName": "goods_itemIds",
      "label": {},
      "wrapperStyle": {},
      "style": {
        "width": "auto",
        "height": "auto"
      },
      "invisible": false,
      "extension": {
        "resType": "jsonp",
        "sendDataType": "url",
        "dialogType": "dialog",
        "getListUrl": "//wangpu.taobao.com/shopdecorate/ajax/tool/getItemLinkList.do",
        "url": "//wangpu.taobao.com/shopdecorate/tools/productSelector.htm",
        "config": {
          "type": "items",
          "source": "shop-decorator"
        },
        "maxCount": 20
      },
      "validateProps": {
        "required": true,
        "dataType": "Text",
        "validate": false
      }
    },
    "diy_data_type": {
      "type": "OfficialRadio",
      "dataName": "diy_data_type",
      "label": {
        "description": {
          "desc": ""
        },
        "title": ""
      },
      "wrapperStyle": {},
      "style": {},
      "invisible": false,
      "extension": {
        "shape": "radio",
        "defaultValue": "1",
        "dataSource": [
          {
            "label": "默认商品数据",
            "value": "1"
          },
          {
            "label": "自定义商品数据",
            "value": "2"
          }
        ]
      },
      "validateProps": {
        "dataType": "",
        "required": false,
        "validate": false
      }
    },
    "diy_goods_array": {
      "type": "OfficialArray",
      "dataName": "diy_goods_array",
      "label": {
        "description": {
          "desc": "图片宽330,高330-500"
        },
        "title": "自定义商品数据"
      },
      "wrapperStyle": {},
      "style": {},
      "invisible": false,
      "extension": {
        "itemTitle": "分组标题",
        "text": "添加",
        "itemTitleIndex": true
      },
      "validateProps": {
        "min": 1,
        "max": 10,
        "dataType": "Array",
        "required": false,
        "validate": false
      },
      "components": {
        "e1140900-3acf-11eb-930c-011e46861dbb": {
          "type": "OfficialMap",
          "dataName": "diy_goods_map",
          "label": {
            "description": {
              "desc": ""
            },
            "title": ""
          },
          "wrapperStyle": {},
          "style": {},
          "invisible": false,
          "extension": {},
          "validateProps": {
            "dataType": "Map",
            "required": false,
            "validate": false
          },
          "components": {
            "diy_goods_image": {
              "type": "OfficialImage",
              "dataName": "diy_goods_image",
              "label": {
                "description": {
                  "desc": ""
                },
                "title": ""
              },
              "wrapperStyle": {},
              "style": {},
              "invisible": false,
              "extension": {
                "sendDataType": "url",
                "config": {
                  "minHeight": 218,
                  "maxHeight": 218,
                  "needCrop": true,
                  "mime": "jpg,png",
                  "minWidth": 218,
                  "type": "pic",
                  "maxWidth": 218
                },
                "url": "//sucai.wangpu.taobao.com/select.htm"
              },
              "validateProps": {
                "dataType": "",
                "required": false,
                "validate": false
              }
            },
            "diy_goods_link": {
              "type": "OfficialLink",
              "dataName": "diy_goods_link",
              "label": {
                "description": {
                  "desc": ""
                },
                "title": "超链接"
              },
              "wrapperStyle": {},
              "style": {},
              "invisible": false,
              "extension": {
                "placeholder": "请输入链接",
                "url": "//wangpu.taobao.com/shopdecorate/tools/linkSelector.htm"
              },
              "validateProps": {
                "dataType": "",
                "required": false,
                "validate": false
              }
            },
            "diy_goods_title": {
              "type": "OfficialInput",
              "dataName": "diy_goods_title",
              "label": {
                "description": {
                  "desc": ""
                },
                "title": "商品标题"
              },
              "wrapperStyle": {},
              "style": {},
              "invisible": false,
              "extension": {
                "clear": true,
                "multiple": false
              },
              "validateProps": {
                "dataType": "Default",
                "required": false,
                "validate": false
              }
            }

          },
          "layout": [
            {
              "id": "diy_goods_image",
              "root": true,
              "children": []
            },
            {
              "id": "diy_goods_link",
              "root": true,
              "children": []
            },
            {
              "id": "diy_goods_title",
              "root": true,
              "children": []
            }
          ]
        }
      },
      "layout": [
        {
          "id": "e1140900-3acf-11eb-930c-011e46861dbb",
          "root": true,
          "children": []
        }
      ]
    },
    "text_array": {
      "type": "OfficialArray",
      "dataName": "text_array",
      "label": {
        "description": {
          "desc": "文字6个字以内"
        },
        "title": "自定义文字"
      },
      "wrapperStyle": {},
      "style": {},
      "invisible": false,
      "extension": {
        "itemTitle": "分组标题",
        "text": "添加",
        "itemTitleIndex": true
      },
      "validateProps": {
        "min": 1,
        "max": 8,
        "dataType": "Array",
        "required": false,
        "validate": false
      },
      "components": {
        "e1140900-3acf-11eb-930c-011e46861db0": {
          "type": "OfficialMap",
          "dataName": "diy_text_map",
          "label": {
            "description": {
              "desc": ""
            },
            "title": ""
          },
          "wrapperStyle": {},
          "style": {},
          "invisible": false,
          "extension": {},
          "validateProps": {
            "dataType": "Map",
            "required": false,
            "validate": false
          },
          "components": {
            "text_title": {
              "type": "OfficialInput",
              "dataName": "text_title",
              "label": {
                "description": {
                  "desc": ""
                },
                "title": "分类文字"
              },
              "wrapperStyle": {},
              "style": {},
              "invisible": false,
              "extension": {
                "clear": true,
                "multiple": false
              },
              "validateProps": {
                "dataType": "Default",
                "required": false,
                "validate": false
              }
            },
            "text_link": {
              "type": "OfficialLink",
              "dataName": "text_link",
              "label": {
                "description": {
                  "desc": ""
                },
                "title": "超链接"
              },
              "wrapperStyle": {},
              "style": {},
              "invisible": false,
              "extension": {
                "placeholder": "请输入链接",
                "url": "//wangpu.taobao.com/shopdecorate/tools/linkSelector.htm"
              },
              "validateProps": {
                "dataType": "",
                "required": false,
                "validate": false
              }
            }


          },
          "layout": [

            {
              "id": "text_title",
              "root": true,
              "children": []
            },
            {
              "id": "text_link",
              "root": true,
              "children": []
            }
          ]
        }
      },
      "layout": [
        {
          "id": "e1140900-3acf-11eb-930c-011e46861db0",
          "root": true,
          "children": []
        }
      ]
    },
    "param_con": {
      "type": "OfficialContainer",
      "dataName": "param_con",
      "label": {
        "description": {
          "desc": ""
        },
        "title": ""
      },
      "wrapperStyle": {

        "backgroundColor": "#eeeeee"

      },
      "style": {

        "display": "flex",
        "flexDirection": "row",
        "alignItems": "center",
        "justifyContent": "space-between"
      },
      "invisible": false,
      "extension": {},
      "validateProps": {
        "dataType": "",
        "required": false,
        "validate": false
      }
    },
    "diy_pic_image": {
      "type": "OfficialImage",
      "dataName": "diy_pic_image",

      "wrapperStyle": {
        "width": "100px",
        "height": "100px",
        "margin": "2px"
      },
      "style": {

      },
      "invisible": false,
      "extension": {
        "sendDataType": "url",
        "config": {
          "minHeight": 630,
          "maxHeight": 630,
          "needCrop": true,
          "mime": "jpg,png",
          "minWidth": 218,
          "type": "pic",
          "maxWidth": 218
        },
        "url": "//sucai.wangpu.taobao.com/select.htm"
      },
      "validateProps": {
        "dataType": "",
        "required": false,
        "validate": false
      }
    },
    "pic_link": {
      "type": "OfficialLink",
      "dataName": "pic_link",
      "label": {
        "description": {
          "desc": ""
        },
        "title": ""
      },
      "wrapperStyle": {

        "width":"180px",
        "marginRight": "7px"

      },
      "style": {

        

      },
      "invisible": false,
      "extension": {
        "placeholder": "广告图点击链接",
        "url": "//wangpu.taobao.com/shopdecorate/tools/linkSelector.htm"
      },
      "validateProps": {
        "dataType": "",
        "required": false,
        "validate": false
      }
    },
    "diy_style_con": {
      "type": "OfficialContainer",
      "dataName": "diy_style_con",
      "label": {
        "description": {
          "desc": ""
        },
        "title": ""
      },
      "wrapperStyle": {

      },
      "style": {

      },
      "invisible": false,
      "extension": {},
      "validateProps": {
        "dataType": "",
        "required": false,
        "validate": false
      }
    },
    "md_bg_color": {
      "type": "OfficialInput",
      "dataName": "md_bg_color",
      "label": {
        "description": {
          "desc": ""
        },
        "title": "模块背景色"
      },
      "wrapperStyle": {},
      "style": {},
      "invisible": false,
      "extension": {
        "clear": true,
        "multiple": false,
        "max": 7,
        "placeholder": "颜色值,如#ff0000"
      },
      "validateProps": {
        "dataType": "Default",
        "required": false,
        "validate": false
      }
    },
    "title_color": {
      "type": "OfficialInput",
      "dataName": "title_color",
      "label": {
        "description": {
          "desc": ""
        },
        "title": "模块标题文字颜色"
      },
      "wrapperStyle": {},
      "style": {},
      "invisible": false,
      "extension": {
        "clear": true,
        "multiple": false,
        "max": 7,
        "placeholder": "颜色值,如#ff0000"
      },
      "validateProps": {
        "dataType": "Default",
        "required": false,
        "validate": false
      }
    },
    "price_color": {
      "type": "OfficialInput",
      "dataName": "price_color",
      "label": {
        "description": {
          "desc": ""
        },
        "title": "价格颜色"
      },
      "wrapperStyle": {},
      "style": {},
      "invisible": false,
      "extension": {
        "clear": true,
        "multiple": false,
        "max": 7,
        "placeholder": "颜色值,如#ff0000"
      },
      "validateProps": {
        "dataType": "Default",
        "required": false,
        "validate": false
      }
    },
    "goods_color": {
      "type": "OfficialInput",
      "dataName": "goods_color",
      "label": {
        "description": {
          "desc": ""
        },
        "title": "商品文字颜色"
      },
      "wrapperStyle": {},
      "style": {},
      "invisible": false,
      "extension": {
        "clear": true,
        "multiple": false,
        "max": 7,
        "placeholder": "颜色值,如#ffffff"
      },
      "validateProps": {
        "dataType": "Default",
        "required": false,
        "validate": false
      }
    },
    "text_bg_color": {
      "type": "OfficialInput",
      "dataName": "text_bg_color",
      "label": {
        "description": {
          "desc": ""
        },
        "title": "左侧分类背景色"
      },
      "wrapperStyle": {},
      "style": {},
      "invisible": false,
      "extension": {
        "clear": true,
        "multiple": false,
        "max": 7,
        "placeholder": "颜色值,如#ffffff"
      },
      "validateProps": {
        "dataType": "Default",
        "required": false,
        "validate": false
      }
    },
    "text_bg_color1": {
      "type": "OfficialInput",
      "dataName": "text_bg_color1",
      "label": {
        "description": {
          "desc": ""
        },
        "title": "左侧分类偶数行背景色"
      },
      "wrapperStyle": {},
      "style": {},
      "invisible": false,
      "extension": {
        "clear": true,
        "multiple": false,
        "max": 7,
        "placeholder": "颜色值,如#ffffff"
      },
      "validateProps": {
        "dataType": "Default",
        "required": false,
        "validate": false
      }
    },
    "text_color": {
      "type": "OfficialInput",
      "dataName": "text_color",
      "label": {
        "description": {
          "desc": ""
        },
        "title": "左侧分类文字颜色"
      },
      "wrapperStyle": {},
      "style": {},
      "invisible": false,
      "extension": {
        "clear": true,
        "multiple": false,
        "max": 7,
        "placeholder": "颜色值,如#ffffff"
      },
      "validateProps": {
        "dataType": "Default",
        "required": false,
        "validate": false
      }
    }
  },
  "layout": [
    {
      "id": "md_tab",
      "root": true,
      "children": []
    },
    {
      "id": "md_title_con",
      "root": true,
      "children": [
        "md_title_type",
        "md_title",
        "md_title2",
        "md_title_link",
        "diy_title_image"
      ]
    },
    {
      "id": "goods_type",
      "root": true,
      "children": []
    },
    {
      "id": "goods_auto_con",
      "root": true,
      "children": [
        "goods_number",
        "category",
        "price",
        "keyword",
        "sort"
      ]
    },
    {
      "id": "diy_data_con",
      "root": true,
      "children": [
        "goods_itemIds",
        "diy_data_type"
      ]
    },
    {
      "id": "diy_goods_array",
      "root": true,
      "children": []
    },
    {
      "id": "text_array",
      "root": true,
      "children": []
    },
    {
      "id": "param_con",
      "root": true,
      "children": [
        "diy_pic_image",
        "pic_link"
      ]
    },

    {
      "id": "diy_style_con",
      "root": true,
      "children": [
        "md_bg_color",
        "title_color",
        "price_color",
        "goods_color",
        "text_bg_color",
        "text_bg_color1",
        "text_color"
      ]
    }
  ],
  "rules": [
    {
      "desc": "规则配置",
      "condition": "${moduleData.md_title_type} == 1",
      "components": {
        "diy_title_image": {
          "invisible": true
        }
      }
    },
    {
      "desc": "规则配置",
      "condition": "${moduleData.md_title_type} == 2",
      "components": {
        "md_title": {
          "invisible": true
        },
        "md_title2": {
          "invisible": true
        }
      }
    },
    {
      "desc": "规则配置",
      "condition": "${moduleData.goods_type} == 1",
      "components": {
        "diy_data_con": {
          "invisible": true
        },
        "diy_goods_array": {
          "invisible": true
        }
      }
    },
    {
      "desc": "规则配置",
      "condition": "${moduleData.goods_type} == 2",
      "components": {
        "goods_auto_con": {
          "invisible": true
        }
      }
    },
    {
      "desc": "规则配置",
      "condition": "${moduleData.diy_data_type} == 1",
      "components": {
        "diy_goods_array": {
          "invisible": true
        }
      }
    },
    {
      "desc": "规则配置",
      "condition": "${moduleData.show_image_type} == 1",
      "components": {
        "diy_image_height": {
          "invisible": true
        }
      }
    },
    {
      "desc": "规则配置",
      "condition": "${moduleData.md_tab} == 1",
      "components": {
        "diy_style_con": {
          "invisible": true
        }
      }
    },
    {
      "desc": "规则配置",
      "condition": "${moduleData.md_tab} == 2",
      "components": {
        "md_title_con": {
          "invisible": true
        },
        "goods_type": {
          "invisible": true
        },
        "goods_auto_con": {
          "invisible": true
        },
        "diy_data_con": {
          "invisible": true
        },
        "diy_goods_array": {
          "invisible": true
        },
        "text_array": {
          "invisible": true
        },
        "param_con": {
          "invisible": true
        }
      }
    }
  ],
  "moduleData": {}
}

index.js

import { enhanceComponent } from 'tb-shop-enhance';

Component(enhanceComponent({
  data: {

 text1: [1, 2, 3,4,5,6,7,8,9]

},
  onInit() {
    // mock数据需要修改client文件夹中的page文件
    // 正常运行过程中模块总是默认传入data参数
  },
 
  didMount() {
    // 加载成功后可以异步获取数据更新数据展示,例如请求接口等操作
    const { gdc = {}, mds = {}, modUtils } = this.props.data;

    let diy_title_image={
      src:"https://img.alicdn.com/imgextra/i3/49368587/O1CN013Xx3eT2DItfGnAhNU_!!49368587.png",
      width:714,
      height:80
    };
    let diy_buy_image={
      src:"https://img.alicdn.com/imgextra/i1/899166132/O1CN01OFiGi11vAVKGuoFOA_!!899166132.png",
      width:150,
      height:35
    };

    this.setData({
      text_array:mds.moduleData.text_array,
      md_title_type:mds.moduleData.md_title_type,
      md_title:mds.moduleData.md_title,
      md_title2:mds.moduleData.md_title2,
      md_title_link:mds.moduleData.md_title_link,
      pic_link:mds.moduleData.pic_link,
      diy_title_image:mds.moduleData.diy_title_image?mds.moduleData.diy_title_image:diy_title_image,
      diy_buy_image:mds.moduleData.diy_buy_image?mds.moduleData.diy_buy_image:diy_buy_image,
      show_goods_sold:mds.moduleData.show_goods_sold,
      show_goods_price:mds.moduleData.show_goods_price,
      show_goods_desc:mds.moduleData.show_goods_desc,
      show_goods_subdesc:mds.moduleData.show_goods_subdesc,
      md_bg_color:mds.moduleData.md_bg_color,
      title_color:mds.moduleData.title_color,
      subtitle_color:mds.moduleData.subtitle_color,
      price_color:mds.moduleData.price_color,
      goods_color:mds.moduleData.goods_color,
      text_bg_color:mds.moduleData.text_bg_color,
      text_bg_color1:mds.moduleData.text_bg_color1,
      text_color:mds.moduleData.text_color
    })
   



    if(mds.moduleData.show_image_type==2 && mds.moduleData.diy_image_height){
      this.setData({
        diy_image_height:mds.moduleData.diy_image_height
      });
    }
    
    let sellerId='';
    if(gdc.userId){
      sellerId=gdc.userId;
    }else if(gdc.sellerId){
      sellerId=gdc.sellerId;
    }else if(gdc.designerId){
      sellerId=gdc.designerId;
    }
    
    switch(mds.moduleData.goods_type){
      case "1":
          let startPrice="",endPrice="";
          if(mds.moduleData.price){
            startPrice=mds.moduleData.price.startPrice;
            endPrice=mds.moduleData.price.endPrice;
          }
          my.tb.shopGetItem({
            "sellerId":sellerId,
            "isAuto":true,
            "itemIds":"",
            "pageSize":mds.moduleData.goods_number,
            "catId":mds.moduleData.category,
            "sort":mds.moduleData.sort,
            "keyWord":mds.moduleData.keyword,
            "startPrice":startPrice,
            "endPrice":endPrice,
          }).then(resp => {
            let goods_array=[];
            goods_array=resp.data.list;
            if(mds.moduleData.show_goods_subdesc){
              for(let i=0;i<goods_array.length;i++){
                if(mds.moduleData.diy_goods_subdesc){
                  goods_array[i].subtitle=mds.moduleData.diy_goods_subdesc;
                }
              }
            }
            this.setData({
              goods_array: goods_array
            });
          }).catch(err => {
            console.warn("自动推荐调用异常");
          })
        break;
      case "2":
          my.tb.shopGetItem({
            "sellerId":sellerId,
            "isAuto":false,
            "itemIds":mds.moduleData.goods_itemIds,
            "pageSize":"",
            "catId":"",
            "sort":"",
            "keyWord":"",
            "startPrice":"",
            "endPrice":""
          }).then(resp => {
            let goods_array=[];
            goods_array=resp.data.list;
            let diy_goods=mds.moduleData.diy_goods_array?mds.moduleData.diy_goods_array:[];
            for(let i=0;i<goods_array.length;i++){
              if(mds.moduleData.diy_goods_subdesc){
                goods_array[i].subtitle=mds.moduleData.diy_goods_subdesc;
              }
              if(diy_goods[i] && mds.moduleData.diy_data_type==2){
                if(diy_goods[i].diy_goods_image){
                  goods_array[i].imgUrl=diy_goods[i].diy_goods_image.src;
                }
                if(diy_goods[i].diy_goods_link){
                  goods_array[i].h5Url=diy_goods[i].diy_goods_link;
                }
                if(diy_goods[i].diy_goods_title){
                  goods_array[i].title=diy_goods[i].diy_goods_title;
                }
                if(diy_goods[i].diy_goods_subtitle){
                  goods_array[i].subtitle=diy_goods[i].diy_goods_subtitle;
                }
              }
            }
            this.setData({
              goods_array: goods_array
            });
          }).catch(err => {
            console.warn("手动推荐调用异常");
          })
        break;
    }
  },

  methods: {
    navigateToUrlTap(e) {
      const { mds = {}, modUtils } = this.props.data;
      const { url } = e.target.dataset;
     
      if (url) {
        modUtils.router.navigateToUrl(url, mds);
      }
    }
  }
}));

index.axml

<view class="goods-list-box" >
  <view class="md-title" data-url="{{md_title_link}}" onTap="navigateToUrlTap">
    <view class="title-box" a:if="{{md_title_type==1?true:false}}" style="{{title_color?'color:'+title_color:''}}">
      <view class="title1">{{md_title}}</view>
      <view class="title2">{{md_title2}}</view>
    </view>
    <image class="diy-title" a:if="{{md_title_type==2?true:false}}" mode="aspectFill" src="{{diy_title_image.src}}" style="height:{{diy_title_image.height}}rpx;"/>
  </view>
  <view class="goods" style="{{md_bg_color?'background-color:'+md_bg_color+';':''}}{{goods_color?'color:'+goods_color+';':''}}">

    <view class="diy-left" style="{{text_bg_color?'background:'+text_bg_color+';':''}}{{text_color?'color:'+text_color+';':''}}">
      
       <block a:for="{{text_array}}" a:for-index="i">



<view class="wz n{{i}}" data-url="{{item.text_link}}" onTap="navigateToUrlTap" style="{{i%2==0?'background-color:'+text_bg_color1:''}}">{{item.text_title}}</view>
          

       </block>


    </view>   

    <block a:for="{{goods_array}}" a:for-index="i">
      <view class="item list{{i}}" data-url="{{item.h5Url}}" onTap="navigateToUrlTap">
        <image src="{{item.imgUrl}}" class="image" mode="aspectFill"/>
        <view class="desc" >{{item.title}}</view>
        
        <view class="price-box">
          <text class="rmb">¥</text>
          <text class="price" style="{{price_color?'color:'+ price_color+';':''}}">{{item.price}}</text>
          <text class="reserve-price" a:if="{{item.reservePrice?true:false}}">¥{{item.reservePrice}}</text>
        </view>
      </view>
    </block> 
  </view>
</view>

mock.json

{
  "mds": {
    "moduleName": "banner",
    "componetId": "6610",
    "widgetId": "87",
    "isEmpty": "false",
    "defaultImage": "http://gtms02.alicdn.com/tps/i2/TB1VGOiFVXXXXcraXXXGJ_gSVXX-304-170.png",
    "moduleData": {
      "md_title_type":"1",
      "md_title":"经管励志系列",
      "subtitle_color":"#000000",
      "md_title2":"NEW / SHOW / MORE",
      "diy_title_image":{
        "src":"https://img.alicdn.com/imgextra/i3/49368587/O1CN013Xx3eT2DItfGnAhNU_!!49368587.png",
        "height":80
      },
      "goods_type":"2",
      "text_bg_color":"",
      "text_bg_color1":"",
      "text_color":"",
      "goods_number":"7",
      "goods_itemIds":"632895632066,626502636758,632025366162,632191241334",
      "diy_data_type":"2",
      "diy_goods_array":[
        {
          "diy_goods_image":{
            "src":"https://img.alicdn.com/bao/uploaded/i3/2928093914/O1CN01NCUBct1emeqYSnjQg_!!0-item_pic.jpg"
          },
          "diy_goods_title":"测试标题测试标题1",
          "diy_goods_subtitle":"商品副标题1"
        },
        {
          "diy_goods_image":{
            "src":"https://img.alicdn.com/bao/uploaded/i3/2928093914/O1CN01NCUBct1emeqYSnjQg_!!0-item_pic.jpg"
          },
          "diy_goods_title":"测试标题测试标题222",
          "diy_goods_subtitle":"商品副标题2"
        }
      ],
      "text_array":[
        {
          "text_title":"青春文艺",
          "text_link":""
        },
                {
          "text_title":"少儿图书",
          "text_link":""
        },
                {
          "text_title":"科学技术",
          "text_link":""
        },
                {
          "text_title":"母婴育儿",
          "text_link":""
        },
                {
          "text_title":"家庭两性",
          "text_link":""
        },
                {
          "text_title":"时尚生活",
          "text_link":""
        },
                {
          "text_title":"人文社科",
          "text_link":""
        },
                {
          "text_title":"私房套装",
          "text_link":""
        }
      ],
      "show_goods_sold":false,
      "show_goods_price":true,
      "show_goods_desc":true,
      "show_image_type":"1",
      "diy_image_height":460
    },
    "assetsPackageName": "taobaowpmod"
  },
  "gdc": {
    "preView": true,
    "title": "Rax && WeAPP",
    "pageId": 75527005,
    "userId": 2928093914,
    "uuidRqt": "f256ebe2b7d03",
    "extParam": "{}",
    "loginUserId": "0",
    "shopId": 112772958,
    "cate_id": "1801",
    "pathInfo": "shop/activity",
    "path": "shop/activity",
    "userNick": "test",
    "pageName": "Page_WeApp",
    "atp_isdpp": "4v112772958",
    "at_isb": "0",
    "at_alis": "1_2202220535",
    "is_join_shopshunt": true
  },
  "pageInfo": {}
}