Browse Source

需求与供应

zhaoxiaohai 3 years ago
parent
commit
1759c94602

+ 8 - 0
README.md

@@ -14,6 +14,8 @@
 
 ​	announceDemand -- 发布需求
 
+​	supplyAndDemand -- 供应与需求
+
 # 自定义组件:
 
 ​	My_Background -- 背景图片 //登录页面背景
@@ -36,6 +38,10 @@
 
 ​	My_Checkbox -- 多选框 经营类目
 
+​	My_SupplyAndDemandItemBox -- 供需子项盒子
+
+​	My_adsorbRight -- 右边吸附按钮 -- 发布需求
+
 # 缓存
 
 ​	userData -- 用户基本数据 -- 保存数据:index-用户列表下标,token,fisadministrator--是否主账号,tagentsid,tenterpriseid,userid
@@ -44,6 +50,8 @@
 
 # 全局变量
 
+​	account_list:[] -- 角色列表
+
 # wxss
 
 ​	css/form.wxss -- 表单样式 登录

+ 7 - 2
app.json

@@ -8,7 +8,8 @@
         "pages/productManagement/index",
         "pages/storeMessage/index",
         "pages/announceDemand/index",
-        "pages/productManagement/change"
+        "pages/productManagement/change",
+        "pages/tabbar-pages/supplyAndDemand/index"
     ],
     "usingComponents": {
         "van-button": "@vant/weapp/button/index",
@@ -16,7 +17,11 @@
         "van-icon": "@vant/weapp/icon/index",
         "My_GeneralTemplate": "/components/My_GeneralTemplate/index",
         "My_GreyRectangleForm": "/components/My_GreyRectangleForm/index",
-        "My_UploadFiles":"/components/My_UploadFiles/index"
+        "My_UploadFiles": "/components/My_UploadFiles/index",
+        "van-grid": "@vant/weapp/grid/index",
+        "van-grid-item": "@vant/weapp/grid-item/index",
+        "van-tab": "@vant/weapp/tab/index",
+        "van-tabs": "@vant/weapp/tabs/index"
     },
     "window": {
         "backgroundTextStyle": "light",

+ 21 - 1
app.wxss

@@ -1,6 +1,7 @@
 page {
     font-family: PingFangSC-Medium, PingFang SC;
     background-color: #F6F7F8;
+    padding-bottom: 80rpx;
 }
 
 /* 灰色矩形盒子 */
@@ -13,4 +14,23 @@ page {
     border-radius: 10rpx;
     box-sizing: border-box;
     margin-bottom: 30rpx;
-}
+}
+
+/* start--文本行数限制--start */
+.u-line-1 {
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+  }
+  
+  .u-line-2 {
+    -webkit-line-clamp: 2;
+  }
+  
+  .u-line-2 {
+    overflow: hidden;
+    word-break: break-all;
+    text-overflow: ellipsis;
+    display: -webkit-box;
+    -webkit-box-orient: vertical;
+  }

+ 4 - 0
components/My_GeneralTemplate/index.js

@@ -7,6 +7,10 @@ Component({
         /* 盒子下内边距 */
         padBot:{
             type:String
+        },
+        padTop:{
+            type:String,
+            value:"40rpx"
         }
     },
 

+ 1 - 1
components/My_GeneralTemplate/index.wxml

@@ -1,4 +1,4 @@
-<view class="container" style="padding-bottom: {{padBot}};">
+<view class="container" style="padding-bottom: {{padBot}}; padding-top: {{padTop}};">
     <slot></slot>
 </view>
 <!-- 背景图片 -->

+ 1 - 1
components/My_GeneralTemplate/index.wxss

@@ -3,9 +3,9 @@
     width: 702rpx;
     background: #FFFFFF;
     border-radius: 40rpx;
-    padding-top: 40rpx;
     box-sizing: border-box;
     margin: 252rpx auto 0;
+    overflow: hidden;
 }
 
 /* 顶部背景图片 */

+ 46 - 0
components/My_SupplyAndDemandItemBox/index.js

@@ -0,0 +1,46 @@
+// components/My_SupplyAndDemandItemBox/index.js
+Component({
+    options: {
+        addGlobalClass: true,
+        multipleSlots: true
+    },
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+        title: {
+            type: String,
+            value: "标题"
+        },
+        time: {
+            type: String
+        },
+        imageList: {
+            type: Array,
+            value: ['/static/userImage.png', '/static/changeImg.png', "/static/login/identity.png", '/static/changeImg.png', "/static/login/identity.png"]
+        }
+    },
+
+    /**
+     * 组件的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+        /* 预览图片 */
+        previewImage(e) {
+            const {
+                index
+            } = e.currentTarget.dataset
+            wx.previewImage({
+                urls: this.data.imageList,
+                current:index
+            })
+        }
+    }
+})

+ 4 - 0
components/My_SupplyAndDemandItemBox/index.json

@@ -0,0 +1,4 @@
+{
+    "component": true,
+    "usingComponents": {}
+}

+ 20 - 0
components/My_SupplyAndDemandItemBox/index.wxml

@@ -0,0 +1,20 @@
+<view class="SupplyAndDemandItemBox">
+    <!-- 标题,按钮 -->
+    <view class="title-and-but">
+        <view class="supply-and-demand-title u-line-2">{{title}}</view>
+        <view class="supply-and-demand-but">
+            <slot name='soldOutBut'></slot>
+        </view>
+    </view>
+    <!-- 时间,内容 -->
+    <view class="time-content">
+        <view class="supply-and-demand-time">{{time}}</view>
+        <view class="supply-and-demand-content">
+            <image wx:for="{{imageList}}" wx:if="{{index<3}}" src="{{item}}" mode="aspectFit" data-index="{{index}}" bindtap="previewImage"></image>
+        </view>
+    </view>
+    <!-- 数据,按钮 -->
+    <view>
+        <slot name='dataAndBut'></slot>
+    </view>
+</view>

+ 62 - 0
components/My_SupplyAndDemandItemBox/index.wxss

@@ -0,0 +1,62 @@
+/* 盒子 */
+.SupplyAndDemandItemBox {
+    width: 100%;
+    height: 286rpx;
+    background: #FFFFFF;
+    border-radius: 20rpx;
+    padding: 0 14rpx;
+    box-sizing: border-box;
+    margin-bottom: 30rpx;
+}
+
+/* 标题和按钮 */
+.title-and-but {
+    display: flex;
+    justify-content: space-between;
+    width: 100%;
+    padding: 30rpx 20rpx 0;
+    box-sizing: border-box;
+}
+
+/* 标题 */
+.supply-and-demand-title {
+    width: 530rpx;
+    height: 80rpx;
+    font-size: 28rpx;
+    color: #000000;
+}
+
+/* 按钮 */
+.supply-and-demand-but {
+    margin-top: 8rpx;
+}
+
+/* 时间与内容 */
+.time-content {
+    display: flex;
+    justify-content: space-between;
+    align-items: flex-end;
+    height: 95rpx;
+    width: 100%;
+    margin-top: 6rpx;
+    border-bottom: 1px solid rgba(151, 151, 151, .2);
+    padding-bottom: 10rpx;
+    box-sizing: border-box;
+}
+
+.supply-and-demand-time {
+    font-size: 24rpx;
+    color: rgba(0, 0, 0, .4);
+    margin-left: 16rpx;
+}
+
+.supply-and-demand-content {
+    display: flex;
+}
+
+.supply-and-demand-content>image {
+    width: 108rpx;
+    height: 84rpx;
+    border-radius: 8rpx;
+    margin-left: 10rpx;
+}

+ 27 - 0
components/My_adsorbRight/index.js

@@ -0,0 +1,27 @@
+// components/My_adsorbRight/index.js
+Component({
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+
+    },
+
+    /**
+     * 组件的初始数据
+     */
+    data: {
+        show: false
+    },
+
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+        isButtonShow() {
+            this.setData({
+                show: !this.data.show
+            })
+        },
+    }
+})

+ 6 - 0
components/My_adsorbRight/index.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+        "van-transition": "@vant/weapp/transition/index"
+    }
+}

+ 10 - 0
components/My_adsorbRight/index.wxml

@@ -0,0 +1,10 @@
+<view class="adsorb-right">
+    <view class="but-left" bindtap="isButtonShow">
+        <image src="../../static/icon-01.png" mode="aspectFill"></image>
+    </view>
+    <van-transition show="{{ show }}" name="slide-right">
+        <view class="but-right">
+            发布
+        </view>
+    </van-transition>
+</view>

+ 37 - 0
components/My_adsorbRight/index.wxss

@@ -0,0 +1,37 @@
+.adsorb-right {
+    position: fixed;
+    display: flex;
+    right: 0;
+    top: 70%;
+    box-shadow: 4rpx 8rpx 12rpx 0px rgba(0, 0, 0, 0.28);
+    border-radius: 38rpx 0 0 38rpx;
+    overflow: hidden;
+    background: linear-gradient(180deg, #84E3EC 0%, #4DC2D4 100%);
+}
+
+/* 按钮左侧 */
+.but-left {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    width: 54rpx;
+    height: 62rpx;
+}
+
+.but-left>image{
+    width: 26rpx;
+    height: 26rpx;
+    margin-left: 10rpx;
+}
+
+/* 按钮右侧 */
+.but-right {
+    display: flex;
+    align-items: center;
+    width: 82rpx;
+    height: 62rpx;
+    font-size: 32rpx;
+    font-weight: 500;
+    color: #FFFFFF;
+    margin-left: 8rpx;
+}

+ 0 - 2
pages/productManagement/index.json

@@ -1,8 +1,6 @@
 {
   "usingComponents": {
     "My_MembersAndProducts": "/components/My_MembersAndProducts/index",
-    "van-tab": "@vant/weapp/tab/index",
-    "van-tabs": "@vant/weapp/tabs/index",
     "van-divider": "@vant/weapp/divider/index",
     "van-loading": "@vant/weapp/loading/index",
     "My_SearchInputBox":"/components/My_SearchInputBox/index"

+ 99 - 0
pages/tabbar-pages/supplyAndDemand/index.js

@@ -0,0 +1,99 @@
+// pages/tabbar-pages/supplyAndDemand/index.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        active:0,//tabs 选中下标
+        /* 宫格列表 */
+        gridList: [{
+            id: '001',
+            text: '寻找面料',
+            icon: '/static/login/Phone.png'
+        }, {
+            id: '002',
+            text: '面料设计',
+            icon: '/static/login/identity.png'
+        }, {
+            id: '003',
+            text: '平面设计',
+            icon: '/static/login/username.png'
+        }, {
+            id: '004',
+            text: '产品策划',
+            icon: '/static/login/verificationcode.png'
+        }, {
+            id: '005',
+            text: '寻找主播',
+            icon: '/static/login/verificationcode.png'
+        }, {
+            id: '006',
+            text: '摄影摄像',
+            icon: '/static/login/identity.png'
+        }, {
+            id: '007',
+            text: '商业培训',
+            icon: '/static/login/username.png'
+        }],
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+
+    },
+    gridJumpPage(even){
+        const {name} =even.target.dataset
+        console.log(name)
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 6 - 0
pages/tabbar-pages/supplyAndDemand/index.json

@@ -0,0 +1,6 @@
+{
+  "usingComponents": {
+    "My_SupplyAndDemandItemBox": "/components/My_SupplyAndDemandItemBox/index",
+    "My_adsorbRight": "/components/My_adsorbRight/index"
+  }
+}

+ 96 - 0
pages/tabbar-pages/supplyAndDemand/index.wxml

@@ -0,0 +1,96 @@
+<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>
+<!-- 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 style="height: 10rpx;"></view>
+        <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">我要联系</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">
+                <!-- 内容信息插槽 -->
+                <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">
+                <!-- 下架按钮插槽 -->
+                <view slot="soldOutBut">
+                    <van-button plain color="#4DC2D4" custom-class="soldOutBut">下架</van-button>
+                </view>
+                <!-- 内容信息插槽 -->
+                <view slot="dataAndBut">
+                    <view class="dataAndBut">
+                        <view class="dataAndBut_data">
+                            浏览次数:245次<text>意向沟通人数</text>:134次
+                        </view>
+                        <view class="dataAndBut_but">
+                            <van-button color="#4DC2D4" custom-class="custom-slotBut">编辑</van-button>
+                            <van-button color="#4DC2D4" style="margin-left: 16rpx;" custom-class="custom-slotBut">正在对接</van-button>
+                        </view>
+                    </view>
+                </view>
+            </My_SupplyAndDemandItemBox>
+        </van-tab>
+    </van-tabs>
+</view>
+<!-- 右侧吸附按钮 -->
+<My_adsorbRight></My_adsorbRight>

+ 72 - 0
pages/tabbar-pages/supplyAndDemand/index.wxss

@@ -0,0 +1,72 @@
+.tabs_box {
+    width: 100vw;
+    padding: 0 24rpx;
+    box-sizing: border-box;
+}
+
+/* 去除tabs背景颜色 */
+.tabs_box scroll-view {
+    background-color: rgba(0, 0, 0, 0) !important;
+}
+
+/* tabs选中项样式 */
+.tabs-active-class {
+    font-size: 32rpx !important;
+    font-weight: 600 !important;
+}
+
+/* 下架按钮插槽样式 */
+.soldOutBut {
+    width: 76rpx !important;
+    height: 45rpx !important;
+    background: rgba(77, 194, 212, 0.1) !important;
+    box-shadow: 0px 0px 12rpx 0px rgba(0, 0, 0, 0.1) !important;
+    border-radius: 10rpx !important;
+    border: 2rpx solid #4DC2D4 !important;
+    padding: 0 !important;
+}
+
+/* 数据,按钮 插槽样式 */
+.dataAndBut {
+    display: flex;
+    justify-content: space-between !important;
+    align-items: center;
+    flex-wrap: nowrap;
+    margin-top: 14rpx;
+}
+
+.dataAndBut_data {
+    flex: 1;
+    display: flex;
+    font-size: 24rpx;
+    color: #000000;
+    margin-left: 16rpx;
+}
+
+.dataAndBut_data>text {
+    color: #4DC2D4;
+    text-decoration: underline;
+    margin-left: 8rpx;
+}
+
+.dataAndBut_but {
+    display: flex;
+    align-items: center;
+    margin-right: 6rpx;
+}
+
+.custom-slotBut {
+    height: 44rpx !important;
+    background: linear-gradient(180deg, #84E3EC 0%, #4DC2D4 100%) !important;
+    box-shadow: 0px 0px 12rpx 0px rgba(0, 0, 0, 0.1) !important;
+    border-radius: 10rpx !important;
+    color: 20rpx !important;
+    padding: 0 14rpx !important;
+    border: 0 !important;
+}
+
+/* 正在对接按钮 */
+.butt-joint {
+    background: linear-gradient(180deg, #D3D3D3 0%, #A7A8A8 100%) !important;
+
+}

+ 1 - 2
pages/tabbar-pages/user/index.json

@@ -1,6 +1,5 @@
 {
   "usingComponents": {
-    "van-grid": "@vant/weapp/grid/index",
-    "van-grid-item": "@vant/weapp/grid-item/index"
+
   }
 }

+ 2 - 2
project.config.json

@@ -30,7 +30,7 @@
             "disablePlugins": [],
             "outputPath": ""
         },
-        "useIsolateContext": true,
+        "useIsolateContext": false,
         "userConfirmedBundleSwitch": false,
         "packNpmManually": true,
         "packNpmRelationList": [
@@ -47,7 +47,7 @@
     },
     "compileType": "miniprogram",
     "libVersion": "2.21.1",
-    "appid": "wxb11e9f7d77c97c10",
+    "appid": "wx210f6f5080f20d0c",
     "projectname": "%E5%B8%83%E4%B8%87%E5%AE%B6%E5%B0%8F%E7%A8%8B%E5%BA%8F",
     "debugOptions": {
         "hidedInDevtools": []

+ 6 - 0
project.private.config.json

@@ -65,6 +65,12 @@
                     "pathName": "pages/storeMessage/index",
                     "query": "",
                     "scene": null
+                },
+                {
+                    "name": "供应与需求",
+                    "pathName": "pages/tabbar-pages/supplyAndDemand/index",
+                    "query": "",
+                    "scene": null
                 }
             ]
         }

BIN
static/icon-01.png