123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- import {
- ApiModel
- } from "../../utils/api";
- const _Http = new ApiModel;
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- requestList: [], //请求列表
- showBtn: -1, //选中下标
- pattern: false, //显示方式选择
- tabsList: ['商户二维码', '加入请求'], //tabs
- tabsIndex: 0, //tabs 选中下标
- joinList: [], //申请加入列表
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- //子账号 只可看见商户二维码
- if (wx.getStorageSync('userData').fisadministrator == 0) return this.setData({
- tabsList: ['商户二维码']
- });
- /* 获取申请列表 */
- _Http.basic({
- "accesstoken": wx.getStorageSync('userData').token,
- "classname": "customer.usercenter.teammsg.teammsg",
- "method": "getEntryTeamApplyList",
- "content": {
- pageSize: 1000
- }
- }).then(res => {
- console.log("团队申请加入列表", res)
- if (res.msg != '成功') return wx.showToast({
- title: res.data,
- icon: "none"
- });
- this.setData({
- joinList: res.data
- })
- })
- },
- /* tabs切换页面 */
- setIndex({
- detail
- }) {
- this.setData({
- tabsIndex: detail
- });
- },
- /* 下拉触底 */
- scrolltolower() {
- if (!this.data.scrolltolowerThrottle) return;
- if (this.data.pageTotal < this.data.pageNumber) return;
- this.setData({
- scrolltolowerThrottle: false
- })
- this.getList();
- },
- /* 获得列表 */
- getList() {},
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
- },
- /* 选择 */
- showBtnIndex(e) {
- const {
- index
- } = e.currentTarget.dataset;
- if (index == this.data.showBtn) return this.setData({
- showBtn: -1
- });
- this.setData({
- pattern: false,
- showBtn: index,
- });
- },
- /* 同意 */
- ratify(e) {
- const that = this;
- wx.showModal({
- title: "提示",
- content: "是否同意“" + that.data.joinList[that.data.showBtn].fname + "”加入到您的团队",
- success: (res => {
- if (res.confirm) that.checkEntryTeamApply(1);
- })
- })
- },
- /* 拒绝 */
- refuse(e) {
- const that = this;
- wx.showModal({
- title: "提示",
- content: "是否拒绝“" + that.data.joinList[that.data.showBtn].fname + "”加入团队申请",
- success: (res => {
- if (res.confirm) that.checkEntryTeamApply(0);
- })
- })
- },
- /* 审核 */
- checkEntryTeamApply(isPass) {
- _Http.basic({
- "accesstoken": wx.getStorageSync('userData').token,
- "classname": "customer.usercenter.teammsg.teammsg",
- "method": "checkEntryTeamApply",
- "content": {
- "isPass": isPass,
- "tenterprise_userid": this.data.joinList[this.data.showBtn].tenterprise_userid,
- "tagentteamapplyid": this.data.joinList[this.data.showBtn].tagentteamapplyid
- }
- }).then(res => {
- console.log(res)
- })
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
- }
- })
|