對微信小程序URL插入數組元素

前提:JS門外漢

        目前未找到直接對url賦值數組元素的方法,

         首先將URL寫成string,

        然後對string插入數組元素

 var txt = 'http://xmserver2.liankai.cn/api/EnvControllerAPI/InsertOrEditFortyWaysControllerData?coverFlag=1&forceCoverDataFlag=1&companyCode=1&farmCode=2&transmitterCode=1&c1=' + c[7] + '&c2=' + c[6] + '&c3=' + c[5] + '&c4=' + c[4] + '&c5=' + c[3] + '&c6=' + c[2] + '&c7=' + c[1] + '&c8=' + c[0]
    wx.request({
      url: txt,
      header: { 'Content-Type': 'json' },

至此就可以了

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章