let app=getApp();
let domain = app.globalData.domain;
let opinionInfoUrl = domain + "/dingding/opinionInfo";

Page({
  data:{ 
    typeList: [{ name: "产品建议", value: "产品建议", checked: true }, { name: "产品问题", value: "产品问题" }, { name: "咨询帮助", value: "咨询帮助"}]
  },

  onLoad: function() {
     // 页面加载
    //  console.info(`Page onLoad with query: ${JSON.stringify(query)}`);
     
  },
  opinionInfo(){
     console.log("携带参数", e.detail.value);
    dd.httpRequest({
      url: updateInfoUrl,
      method: 'POST',
      data: {
        
      },
      dataType: 'json',
      success: function(res) {
           console.log('success----', res)


        if (res.data.success) {
          dd.alert({
            title: '提交成功',
            buttonText: '确定',
            success: () => {
              dd.navigateBack({
              delta: 1
             })
            },
          });
        } else {
          dd.showToast({
            type: 'fail',
            content: res.data.message,
            duration: 3000,
            success: () => {
             
            },
          });
        }
      },
      fail: function(res) {
        console.log("httpRequestFail---", res)
        dd.alert({ content: JSON.stringify(res) });
      },
      complete: function(res) {
        dd.hideLoading();
      }

    });
  },
  sumit(){
    dd.alert({
      content: '提交成功',
      buttonText: '我知道了',
      
    })
   
  },
  onReady() {
    // 页面加载完成
    
  },
 
  onShow() {
  

  },
  onHide() {
    // 页面隐藏
  },
  onUnload() {
    // 页面被关闭
  },
  onTitleClick() {
    // 标题被点击
  },
  onPullDownRefresh() {
    // 页面被下拉
  },
  onReachBottom() {
    // 页面被拉到底部
  },
  onShareAppMessage() {
    // 返回自定义分享信息

  },
});
