applyFor.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. import {
  2. ApiModel
  3. } from "../../utils/api";
  4. const _Http = new ApiModel;
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. showBtn: -1,//选中下标
  11. pattern: false,//显示方式选择
  12. dropDownList:false,//显示下拉菜单
  13. methodsList:['上游','下游','双向合作'],
  14. addvalue:""
  15. },
  16. /**
  17. * 生命周期函数--监听页面加载
  18. */
  19. onLoad: function (options) {
  20. },
  21. onChange({detail}){
  22. this.setData({
  23. addvalue:detail
  24. })
  25. },
  26. onClick(){
  27. _Http.basic({
  28. "accesstoken": wx.getStorageSync('userData').token,
  29. "classname": "customer.tagents.tagents",
  30. "method": "apply_cooperation",
  31. "content": {
  32. "tcooperationagentsid": "27303",
  33. "ftype": "1"
  34. }
  35. }).then(res=>{
  36. console.log(res)
  37. })
  38. },
  39. /**
  40. * 生命周期函数--监听页面初次渲染完成
  41. */
  42. onReady: function () {
  43. },
  44. modeSelect(e){
  45. const { index } = e.target.dataset;
  46. const content=(this.data.methodsList[index]=='双向合作')?'是否确定***作为您的'+this.data.methodsList[index]+'伙伴':'是否确定***作为您的'+this.data.methodsList[index]+'合作伙伴';
  47. wx.showModal({
  48. title: '提示',
  49. content: content,
  50. success: function (res) {
  51. if (res.confirm) {
  52. console.log('确定')
  53. } else {
  54. console.log('取消')
  55. }
  56. }
  57. })
  58. },
  59. /* 选择 */
  60. showBtnIndex(e) {
  61. const {
  62. index
  63. } = e.currentTarget.dataset;
  64. if(index==this.data.showBtn) return;
  65. this.setData({
  66. pattern: false,
  67. showBtn: index,
  68. })
  69. },
  70. /* 选择合作方式 */
  71. chooseCooperationMode(){
  72. this.setData({
  73. dropDownList:!this.data.dropDownList
  74. })
  75. },
  76. hiddenDropDown(){
  77. this.setData({
  78. dropDownList:false
  79. })
  80. },
  81. /* 同意 */
  82. ratify(e) {
  83. this.setData({
  84. pattern: true
  85. })
  86. },
  87. /**
  88. * 生命周期函数--监听页面显示
  89. */
  90. onShow: function () {
  91. },
  92. /**
  93. * 生命周期函数--监听页面隐藏
  94. */
  95. onHide: function () {
  96. },
  97. /**
  98. * 生命周期函数--监听页面卸载
  99. */
  100. onUnload: function () {
  101. },
  102. /**
  103. * 页面相关事件处理函数--监听用户下拉动作
  104. */
  105. onPullDownRefresh: function () {
  106. },
  107. /**
  108. * 页面上拉触底事件的处理函数
  109. */
  110. onReachBottom: function () {
  111. },
  112. /**
  113. * 用户点击右上角分享
  114. */
  115. onShareAppMessage: function () {
  116. }
  117. })