微信小程序和JAVA的開發,屬于純天然的前后臺分離開發,
微信小程序負責前端頁面的樣式,邏輯以及跳轉。
后臺JAVA負責數據的封裝,業務邏輯,打包數據傳遞。(接口開發)
使用:
JSONObject操作獲取key對應的value: JSONObject jsonObject=JSONObject.fromObject(objectitem); String productno = jsonObject.getString("productno"); Integer number = jsonObject.getInt("number"); JSONArray獲取第幾個JSONObject jsonArray.get(0)