ソースを参照

上下架逻辑修改

zhaoxiaohai 3 年 前
コミット
f6b0257c49
1 ファイル変更5 行追加22 行削除
  1. 5 22
      pages/productManagement/change.js

+ 5 - 22
pages/productManagement/change.js

@@ -7,7 +7,6 @@ import {
 } from "../../utils/verify";
 const _Verify = new TestVerify();
 Page({
-
     /**
      * 页面的初始数据
      */
@@ -86,29 +85,12 @@ Page({
     },
     /* 上架开关 */
     switchChange() {
-        const checked = !this.data.checked;
+        const checked = !this.data.checked,
+            fisonsale = (checked) ? 1 : 0;
         this.setData({
-            checked
+            checked,
+            fisonsale
         });
-        const fisonsale = (checked) ? 1 : 0;
-        if (this.data.tagents_productid == 0) return;
-        _Http.basic({
-            "accesstoken": wx.getStorageSync('userData').token,
-            "classname": "customer.products.products",
-            "method": "updatesalestatus",
-            "content": {
-                "productlist": [{
-                    "tagents_productid": this.data.tagents_productid,
-                    "fisonsale": fisonsale
-                }]
-            }
-        }).then(res => {
-            console.log(res)
-            if (res.msg != "成功") return wx.showToast({
-                title: res.data,
-                icon: "error"
-            })
-        })
     },
     /* 表单验证 */
     formVerify() {
@@ -147,6 +129,7 @@ Page({
                 "fprodname": this.data.fprodname,
                 "fintroduction": this.data.fintroduction,
                 "ftag": this.data.ftag,
+                "fisonsale": this.data.fisonsale
             }
         }).then(res => {
             console.log(res)