zhaoxiaohai 3 лет назад
Родитель
Сommit
0c206d17c7

+ 2 - 1
components/My_SupplyAndDemandItemBox/index.wxss

@@ -1,11 +1,12 @@
 /* 盒子 */
 .SupplyAndDemandItemBox {
-    width: 100%;
+    width: 702rpx;
     height: 286rpx;
     background: #FFFFFF;
     border-radius: 20rpx;
     padding: 0 14rpx;
     box-sizing: border-box;
+    margin: 0 auto;
     margin-bottom: 30rpx;
 }
 

+ 17 - 60
pages/announceDemand/index.js

@@ -15,7 +15,6 @@ Page({
         minDate: Number,
         showCalendar: false, //日历显示
         tsupplyanddemandid: 0, //ID 0为新增
-        newAdd: false, //是否新增 新增未保存直接退出页面会删除该供需
         popups: false, //弹出层控制
         ftype: "", //供需类型
         ftitle: "", //供需标题
@@ -34,16 +33,8 @@ Page({
      */
     onLoad: function (options) {
         this.setTime()
-        if (options.data == undefined) {
-            console.log('新增')
-            //新增
-            this.addOrModify()
-            this.setData({
-                newAdd: true
-            })
-        } else {
-            //修改
-
+        if (options.data != undefined) {
+            console.log("修改返回数据")
         }
     },
     setTime() {
@@ -92,23 +83,17 @@ Page({
             title: '请检查表单内容',
             icon: "error"
         });
-        this.setData({
-            newAdd: false
-        })
         this.addOrModify()
     },
     /* 新增或修改 */
     addOrModify() {
         let content = {};
-        if (this.data.tsupplyanddemandid == 0) {
-            //新增产品
-            content = {
-                "tsupplyanddemandid": 0,
-                "fissupply": 0
-            }
-        } else {
-            //修改需求
-            content = {
+        /* 发送请求 */
+        _Http.basic({
+            "accesstoken": wx.getStorageSync('userData').token,
+            "classname": "customer.supplyanddemand.supplyanddemand",
+            "method": "insertormodify",
+            "content": {
                 "tsupplyanddemandid": this.data.tsupplyanddemandid,
                 "ftype": this.data.ftype,
                 "ftitle": this.data.ftitle,
@@ -116,30 +101,16 @@ Page({
                 "fenddate": this.data.fenddate,
                 "fissupply": 0
             }
-        }
-        /* 发送请求 */
-        _Http.basic({
-            "accesstoken": wx.getStorageSync('userData').token,
-            "classname": "customer.supplyanddemand.supplyanddemand",
-            "method": "insertormodify",
-            "content": content
         }).then(res => {
-            console.log(res)
-            if (this.data.newAdd) {
-                this.setData({
-                    tsupplyanddemandid: res.data[0].tsupplyanddemandid
-                })
-            }else{
-                wx.showToast({
-                  title: '保存成功',
+            if (res.msg != "成功") return
+            wx.showToast({
+                title: '保存成功',
+            })
+            setTimeout(() => {
+                wx.navigateBack({
+                    delta: 1,
                 })
-                setTimeout(()=>{
-                    wx.navigateBack({
-                        delta: 1,
-                      })
-                },500)
-            }
-
+            }, 500)
         })
     },
     /* 弹出层 */
@@ -207,21 +178,7 @@ Page({
     /**
      * 生命周期函数--监听页面卸载
      */
-    onUnload: function () {
-        //新增未保存,退出页面删除新增
-        if (this.data.newAdd) {
-            _Http.basic({
-                "accesstoken": wx.getStorageSync('userData').token,
-                "classname": "customer.supplyanddemand.supplyanddemand",
-                "method": "deletesupplyanddemand",
-                "content": {
-                    "tsupplyanddemandid": this.data.tsupplyanddemandid
-                }
-            }).then(res => {
-                console.log(res)
-            })
-        }
-    },
+    onUnload: function () {},
 
     /**
      * 页面相关事件处理函数--监听用户下拉动作

+ 18 - 3
pages/tabbar-pages/supplyAndDemand/index.js

@@ -4,7 +4,20 @@ Page({
      * 页面的初始数据
      */
     data: {
-        active:0,//tabs 选中下标
+        active: 0, //tabs 选中下标
+        swiperBannerList: [{
+            id: "001",
+            url: "/static/banner/icon-1.jpg",
+            src: ''
+        }, {
+            id: "002",
+            url: "/static/banner/icon-2.jpg",
+            src: ''
+        }, {
+            id: "003",
+            url: "/static/banner/icon-3.png",
+            src: ''
+        }], //轮播图列表
         /* 宫格列表 */
         gridList: [{
             id: '001',
@@ -43,8 +56,10 @@ Page({
     onLoad: function (options) {
 
     },
-    gridJumpPage(even){
-        const {name} =even.target.dataset
+    gridJumpPage(even) {
+        const {
+            name
+        } = even.target.dataset
         console.log(name)
     },
     /**

+ 18 - 42
pages/tabbar-pages/supplyAndDemand/index.wxml

@@ -1,16 +1,22 @@
-<My_GeneralTemplate padTop="15rpx" padBot="16rpx">
-    <!-- 宫格 -->
-    <view class="grid_box">
-        <van-grid border="{{false}}" bindtap="gridJumpPage">
-            <van-grid-item wx:for="{{gridList}}" data-name="{{item.text}}" icon="{{item.icon}}" text="{{item.text}}" text-class="grid_text-class" />
-        </van-grid>
-    </view>
-</My_GeneralTemplate>
+<view class="supplyAndDemandBanner">
+    <swiper class="swiperBanner" autoplay indicator-dots circular="true" indicator-active-color="#fff">
+        <swiper-item wx:for="{{swiperBannerList}}" wx:key="index">
+            <image src="{{item.url}}" mode="aspectFill"></image>
+        </swiper-item>
+    </swiper>
+</view>
 <!-- tabs切换栏 -->
-<view class="tabs_box" style="margin-top: 25rpx;">
-    <van-tabs active="{{ active }}" tab-class="tabs-tab-class" tab-active-class="tabs-active-class" ellipsis="{{false}}" line-width="30px" color="#4DC2D4" title-active-color="#4DC2D4" swipeable>
+<view class="tabs_box">
+    <van-tabs active="{{ active }}" custom-class="tabs-custom-class" tab-active-class="tabs-active-class" ellipsis="{{false}}" line-width="30px" color="#4DC2D4" title-active-color="#4DC2D4" swipeable>
         <view style="height: 10rpx;"></view>
-        <van-tab title="我要联系">
+        <van-tab title="所有信息">
+            <!-- 宫格 -->
+            <view class="grid_box">
+                <van-grid border="{{false}}" bindtap="gridJumpPage">
+                    <van-grid-item wx:for="{{gridList}}" data-name="{{item.text}}" icon="{{item.icon}}" text="{{item.text}}" text-class="grid_text-class" />
+                </van-grid>
+            </view>
+            <!-- 列表 -->
             <My_SupplyAndDemandItemBox wx:for="{{5}}" title="【窗帘布】各位老板看下有以下面料的联系" time="2021-11-10 14:23:43">
                 <!-- 内容信息插槽 -->
                 <view slot="dataAndBut">
@@ -19,7 +25,7 @@
                             浏览次数:245次<text>意向沟通人数</text>:134次
                         </view>
                         <view class="dataAndBut_but">
-                            <van-button color="#4DC2D4" style="margin-left: 16rpx;" custom-class="custom-slotBut">我要联系</van-button>
+                            <van-button color="#4DC2D4" style="margin-left: 16rpx;" custom-class="custom-slotBut">一键联系</van-button>
                         </view>
                     </view>
                 </view>
@@ -40,36 +46,6 @@
                 </view>
             </My_SupplyAndDemandItemBox>
         </van-tab>
-        <van-tab title="已解决">
-            <My_SupplyAndDemandItemBox wx:for="{{5}}" title="【窗帘布】各位老板看下有以下面料的联系" time="2021-11-10 14:23:43">
-                <!-- 内容信息插槽 -->
-                <view slot="dataAndBut">
-                    <view class="dataAndBut">
-                        <view class="dataAndBut_data">
-                            浏览次数:245次<text>意向沟通人数</text>:134次
-                        </view>
-                        <view class="dataAndBut_but">
-                            <van-button color="#4DC2D4" style="margin-left: 16rpx;" custom-class="custom-slotBut butt-joint">已解决</van-button>
-                        </view>
-                    </view>
-                </view>
-            </My_SupplyAndDemandItemBox>
-        </van-tab>
-        <van-tab title="已过期">
-            <My_SupplyAndDemandItemBox wx:for="{{5}}" title="【窗帘布】各位老板看下有以下面料的联系" time="2021-11-10 14:23:43">
-                <!-- 内容信息插槽 -->
-                <view slot="dataAndBut">
-                    <view class="dataAndBut">
-                        <view class="dataAndBut_data">
-                            浏览次数:245次<text>意向沟通人数</text>:134次
-                        </view>
-                        <view class="dataAndBut_but">
-                            <van-button color="#4DC2D4" style="margin-left: 16rpx;" custom-class="custom-slotBut butt-joint">已过期</van-button>
-                        </view>
-                    </view>
-                </view>
-            </My_SupplyAndDemandItemBox>
-        </van-tab>
         <van-tab title="我的需求">
             <My_SupplyAndDemandItemBox wx:for="{{5}}" title="【窗帘布】各位老板看下有以下面料的联系" time="2021-11-10 14:23:43">
                 <!-- 下架按钮插槽 -->

+ 32 - 6
pages/tabbar-pages/supplyAndDemand/index.wxss

@@ -1,12 +1,38 @@
-.tabs_box {
+/* banner */
+.supplyAndDemandBanner {
     width: 100vw;
-    padding: 0 24rpx;
-    box-sizing: border-box;
+    height: 306rpx;
+    background-color: #FFFFFF;
+}
+
+.swiperBanner {
+    width: 702rpx;
+    height: 286rpx;
+    padding-top: 20rpx;
+    margin: 0 auto;
 }
 
-/* 去除tabs背景颜色 */
-.tabs_box scroll-view {
-    background-color: rgba(0, 0, 0, 0) !important;
+.swiperBanner swiper-item,
+.swiperBanner image {
+    width: 100%;
+    height: 100%;
+    border-radius: 15rpx;
+}
+
+
+
+/* 宫格区域盒子 */
+.grid_box {
+    width: 704rpx;
+    height: 330rpx;
+    background: #FFFFFF;
+    border-radius: 20px;
+    overflow: hidden;
+    margin: 10rpx auto 20rpx;
+}
+
+.tabs_box {
+    width: 100vw;
 }
 
 /* tabs选中项样式 */