|
@@ -10,13 +10,11 @@ Page({
|
|
|
data: {
|
|
|
requestList: [], //请求列表
|
|
|
showBtn: -1, //选中下标
|
|
|
- addvalue: "",
|
|
|
scrolltolowerThrottle: true, //下拉触底截流
|
|
|
pageNumber: 1, //请求分页
|
|
|
pageTotal: 1, //总页数
|
|
|
tabsList: ['建立新合作', '合作请求'], //tabs
|
|
|
tabsIndex: 0, //tabs 选中下标
|
|
|
- show: false, //弹出层控制
|
|
|
},
|
|
|
/**
|
|
|
* 生命周期函数--监听页面加载
|
|
@@ -59,12 +57,10 @@ Page({
|
|
|
"pageSize": 20,
|
|
|
"where": {
|
|
|
"condition": "",
|
|
|
- "ftype": "",
|
|
|
"fstatus": "申请"
|
|
|
}
|
|
|
}
|
|
|
}).then(res => {
|
|
|
- console.log(res)
|
|
|
if (res.msg != "成功") return wx.showToast({
|
|
|
title: res.data,
|
|
|
icon: 'none'
|
|
@@ -83,56 +79,29 @@ Page({
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- onChange({
|
|
|
- detail
|
|
|
- }) {
|
|
|
- this.setData({
|
|
|
- addvalue: detail
|
|
|
- })
|
|
|
- },
|
|
|
- onClick() {
|
|
|
- _Http.basic({
|
|
|
- "accesstoken": wx.getStorageSync('userData').token,
|
|
|
- "classname": "customer.tagents.tagents",
|
|
|
- "method": "apply_cooperation",
|
|
|
- "content": {
|
|
|
- "tcooperationagentsid": "27303",
|
|
|
- "ftype": "1"
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- console.log(res)
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
/**
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
*/
|
|
|
onReady: function () {
|
|
|
|
|
|
},
|
|
|
- /* 回调 */
|
|
|
- optionChange({
|
|
|
- detail
|
|
|
- }) {
|
|
|
- let ftype = 1;
|
|
|
+ /* 选择 */
|
|
|
+ showBtnIndex(e) {
|
|
|
+ let {
|
|
|
+ index
|
|
|
+ } = e.currentTarget.dataset;
|
|
|
+ if (index == this.data.showBtn) index = -1;
|
|
|
+ this.setData({
|
|
|
+ showBtn: index,
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /* 同意 */
|
|
|
+ ratify() {
|
|
|
const i = this.data.showBtn,
|
|
|
- content = (detail == '双向合作') ? '是否确定将“' + this.data.requestList[i].fbrand + '”作为您的“' + detail + '”伙伴' : '是否确定将“' + this.data.requestList[i].fbrand + '”作为您的“' + detail + '合作”伙伴',
|
|
|
that = this;
|
|
|
- switch (detail) {
|
|
|
- case "上游":
|
|
|
- ftype = 1;
|
|
|
- break;
|
|
|
- case "下游":
|
|
|
- ftype = 2;
|
|
|
- break;
|
|
|
- case "双向合作":
|
|
|
- ftype = 3;
|
|
|
- break;
|
|
|
- };
|
|
|
- console.log(ftype)
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
- content: content,
|
|
|
+ content: "是否同意“" + that.data.requestList[i].fbrand + '”的合作申请',
|
|
|
success: function (res) {
|
|
|
if (res.confirm) {
|
|
|
_Http.basic({
|
|
@@ -140,8 +109,7 @@ Page({
|
|
|
"classname": "customer.tagents.tagents",
|
|
|
"method": "cooperation",
|
|
|
"content": {
|
|
|
- "tcooperationagentsid": that.data.requestList[i].tcooperationagentsid,
|
|
|
- "ftype": ftype
|
|
|
+ "tcooperationagentsid": that.data.requestList[i].tcooperationagentsid
|
|
|
}
|
|
|
}).then(res => {
|
|
|
console.log(res)
|
|
@@ -156,34 +124,13 @@ Page({
|
|
|
requestList.splice(i, 1);
|
|
|
that.setData({
|
|
|
requestList,
|
|
|
- showBtn: -1,
|
|
|
- show: false
|
|
|
+ showBtn: -1
|
|
|
})
|
|
|
})
|
|
|
- } else {
|
|
|
- that.setData({
|
|
|
- show: false
|
|
|
- })
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- /* 选择 */
|
|
|
- showBtnIndex(e) {
|
|
|
- let {
|
|
|
- index
|
|
|
- } = e.currentTarget.dataset;
|
|
|
- if (index == this.data.showBtn) index = -1;
|
|
|
- this.setData({
|
|
|
- showBtn: index,
|
|
|
- })
|
|
|
- },
|
|
|
- /* 同意 */
|
|
|
- ratify() {
|
|
|
- this.setData({
|
|
|
- show: !this.data.show
|
|
|
- })
|
|
|
- },
|
|
|
/* 拒绝 */
|
|
|
refuse(e) {
|
|
|
const {
|