Преглед на файлове

添加更改合作模式

xiaohaizhao преди 2 години
родител
ревизия
ce20247142
променени са 3 файла, в които са добавени 60 реда и са изтрити 4 реда
  1. 55 1
      packageA/setclient/detail.js
  2. 3 1
      packageA/setclient/detail.wxml
  3. 2 2
      utils/Http.js

+ 55 - 1
packageA/setclient/detail.js

@@ -5,7 +5,17 @@ Page({
         isLeader: false, //是否为负责人
         tabsActive: 1, //tabs 选中项
         sa_customersid: 0,
-
+        modeList: [{
+                name: '潜在',
+            },
+            {
+                name: '合作中'
+            },
+            {
+                name: '已终止'
+            }
+        ],
+        changeMode: false
     },
     onLoad(options) {
         const appAuth = wx.getStorageSync('auth').wCustomer;
@@ -75,6 +85,41 @@ Page({
         })
         this.getDetail();
     },
+    modeSelect(e) {
+        console.log(e)
+        let {
+            sa_customersid,
+            status
+        } = this.data.detail,
+            that = this;
+        wx.showModal({
+            title: '提示',
+            content: `是否确定将合作模式更改为:“${e.detail.name}”`,
+            complete: (res) => {
+                if (res.cancel) that.modeCancel()
+                if (res.confirm) _Http.basic({
+                    "id": 20221010164602,
+                    "content": {
+                        "sa_customersids": [sa_customersid],
+                        "status": e.detail.name
+                    }
+                }).then(res => {
+                    console.log("更改合作模式", res)
+                    wx.showToast({
+                        title: res.msg != '成功' ? '修改成功' : res.msg,
+                        icon: "none"
+                    })
+                    if (res.msg == '成功') that.getDetail()
+                    that.modeCancel()
+                })
+            }
+        })
+    },
+    modeCancel() {
+        this.setData({
+            changeMode: false
+        })
+    },
     //详情按钮回调
     tabbarOnClick({
         detail
@@ -82,6 +127,11 @@ Page({
         let data = this.data.detail,
             that = this;
         switch (detail.label) {
+            case "更改合作模式":
+                this.setData({
+                    changeMode: true
+                })
+                break;
             case "退回":
                 wx.showModal({
                     title: '提示',
@@ -316,6 +366,10 @@ Page({
                 icon: "icon-zhuanyi",
                 label: "更换负责人"
             })
+            if (isLeader) tabbarList.push({
+                icon: "icon-dibu-biangengchengjiaozhuangtai",
+                label: "更改合作模式"
+            })
             tabbarList.push({
                 icon: "icon-shanchu",
                 label: "作废"

+ 3 - 1
packageA/setclient/detail.wxml

@@ -69,4 +69,6 @@
         <view class="exp">最近跟进时间:{{item.followdate||" --"}}</view>
     </navigator>
 </van-popup>
-<wxs src='../../utils/wxmlQueryPer.wxs' module="per" />
+<wxs src='../../utils/wxmlQueryPer.wxs' module="per" />
+<!-- 更换合作模式 -->
+<van-action-sheet show="{{ changeMode }}" actions="{{ modeList }}" cancel-text="取消" bind:select='modeSelect' bind:cancel='modeCancel' bind:click-overlay='modeCancel' z-index='9999999' />

+ 2 - 2
utils/Http.js

@@ -4,8 +4,8 @@ class HTTP {
         if (ENV === 'release') { // 正式版
             this.baseUrl = "https://oms.idcgroup.com.cn:8079";
         } else {
-            this.baseUrl = "http://61.164.207.46:8000";
-            // this.baseUrl = "https://oms.idcgroup.com.cn:8079";
+            // this.baseUrl = "http://61.164.207.46:8000";
+            this.baseUrl = "https://oms.idcgroup.com.cn:8079";
         }
         console.log("接口地址:", this.baseUrl)
     }