ycm il y a 2 ans
Parent
commit
49a1397dca

+ 24 - 6
pages/order/placeOrder/placeOrder.js

@@ -20,7 +20,9 @@ Page({
         shop: [],
         worke: "",
         status: "",
-        order_num:""
+        order_num:"",
+        bannerlist: [],
+        noticelist: [],
     },
 
     /**
@@ -35,11 +37,11 @@ Page({
         }
     
         if(typeof options.parmise!="undefined"){
-            console.log('-------'+options.parmise)
             var worke = JSON.parse(options.parmise);
             this.setData({
                 worke:worke
             })
+            console.log(this.data.worke)
             this.getcart();
         }else if(typeof options.network_id!="undefined"){
             this.getNwetwork(options.network_id)
@@ -65,6 +67,20 @@ Page({
     },
     onShow() {
         this.getcart();
+        this.getnotice()
+    },
+    getnotice(){
+        let that = this
+        app.api.useApi(app.globalData.baseAppUrl + "api/network_notice", {
+            network_id: that.data.worke.id
+        }, "get").then(function (res) {
+            if (res.code == 200) {
+                that.setData({
+                    bannerlist: res.message.data.first,
+                    noticelist: res.message.data.notice
+                })
+            }
+        })
     },
     goto(){
         wx.navigateTo({
@@ -505,6 +521,7 @@ Page({
         })
     },
     getHeight() {
+        let that =this
         var clientHeight;
         wx.getSystemInfo({
             success: (res) => {
@@ -521,13 +538,14 @@ Page({
             query3.exec(r => {
                 query1.exec(res => {
                     if (res && res[0] != null) {
-                        this.setData({
-                            height: clientHeight - res[0].height - result[0].height - r[0].height - 40
+                        console.log(r)
+                        that.setData({
+                            height: clientHeight - res[0].height - result[0].height - r[0].height
                         })
 
                     } else {
-                        this.setData({
-                            height: clientHeight - result[0].height - r[0].height - 40
+                        that.setData({
+                            height: clientHeight - result[0].height - r[0].height
                         })
                     }
                     console.log(clientHeight, result[0].height, r[0].height);

+ 27 - 28
pages/order/placeOrder/placeOrder.wxml

@@ -33,15 +33,17 @@
     </view>
 </view>
 
-<!-- <view class="scrollBox" id="scrollBox">
+<view class="scrollBox" id="scrollBox">
     <scroll-view scroll-x>
-        <image src="/image/order/houwaitao.png" class="show" wx:for="{{5}}" wx:key="index"></image>
+        <image src="{{item.url}}" class="show" wx:for="{{bannerlist}}" wx:key="index"></image>
     </scroll-view>
-</view> -->
+</view>
+
+<van-notice-bar wx:for="{{noticelist}}" wx:key="index" mode="closeable" left-icon="/image/icon/message.png" bind:close="closeNews" text="{{item.content}}" h/>
 <!-- <van-notice-bar mode="closeable" left-icon="/image/icon/message.png" bind:close="closeNews" text="在代码阅读过程中人们说脏话的频率是衡量代码质量的唯一标准。" h/> -->
 
 
-<view class="contioner flex al-s" style="height: {{height}}px;">
+<view class="contioner flex al-s" style="height: {{height-(noticelist.length * 40)}}px;">
 
 
     <view class="slidebar">
@@ -91,35 +93,32 @@
                                         <van-icon name="plus" size="12" />
                                     </view>
                                 </view> -->
-
-                                <view wx:if="{{item.good_type == 1}}">
-                                    <view class="btn-sky btn flex ju-c" wx:if="{{item.num == 0}}" bindtap="shoppingPlus"  data-item="{{item}}">
-                                        <van-icon name="plus" size="12" />
-                                    </view>
-
-                                    <view class="flex" wx:else>
-                                        <view class="btn-border btn flex ju-c" bindtap="shoppingMinus" data-item="{{item}}">
-                                            <van-icon name="minus" size="12" color="#191C27" />
-                                        </view>
-                                        <view class="nums">
-                                            {{item.num}}
-                                        </view>
-                                        <view class="btn-sky btn flex ju-c" bindtap="shoppingPlus" data-item="{{item}}">
+                                <view wx:if="{{worke.business_status==1}}">
+                                    <view wx:if="{{item.good_type == 1}}">
+                                        <view class="btn-sky btn flex ju-c" wx:if="{{item.num == 0}}" bindtap="shoppingPlus"  data-item="{{item}}">
                                             <van-icon name="plus" size="12" />
                                         </view>
+
+                                        <view class="flex" wx:else>
+                                            <view class="btn-border btn flex ju-c" bindtap="shoppingMinus" data-item="{{item}}">
+                                                <van-icon name="minus" size="12" color="#191C27" />
+                                            </view>
+                                            <view class="nums">
+                                                {{item.num}}
+                                            </view>
+                                            <view class="btn-sky btn flex ju-c" bindtap="shoppingPlus" data-item="{{item}}">
+                                                <van-icon name="plus" size="12" />
+                                            </view>
+                                        </view>
                                     </view>
-                                </view>
-                                <view wx:else>
-                                    <view class="main8">
-                                        <!-- bindtap="shoppingPlus"  data-item="{{item}}" -->
-                                        <text lines="1" class="word16" bindtap="getOrderone" data-gid="{{item.id}}">立即下单</text>
+                                    <view wx:else>
+                                        <view class="main8">
+                                            <!-- bindtap="shoppingPlus"  data-item="{{item}}" -->
+                                            <text lines="1" class="word16" bindtap="getOrderone" data-gid="{{item.id}}">立即下单</text>
+                                        </view>
                                     </view>
                                 </view>
 
-
-
-
-
                             </view>
                         </view>
                     </view>
@@ -129,7 +128,7 @@
     </view>
 </view>
 
-<view class="footerBox flex ju-c" id="footerBar">
+<view class="footerBox flex ju-c" wx:if="{{worke.business_status==1}}" id="footerBar">
     <view class="btnBox flex ju-b">
         <view class="le flex" bindtap="btnShow">
             <view class="box">

+ 4 - 3
pages/order/placeOrder/placeOrder.wxss

@@ -112,7 +112,7 @@
 
 .scrollBox {
     white-space: nowrap;
-    padding: 32rpx 0;
+    /* padding: 32rpx 0; */
     /* padding-left: 32rpx; */
 }
 
@@ -121,10 +121,11 @@
 }
 
 .scrollBox .show {
-    width: 390rpx;
+    width: 100%;
     margin-right: 16rpx;
     height: 170rpx;
     border-radius: 10rpx;
+    background: #eee;
 }
 
 .footerBox {
@@ -190,7 +191,7 @@
 }
 
 .listBox {
-    min-height: 550rpx;
+    /* min-height: 550rpx; */
     width: 80%;
     white-space: nowrap;
     height: 100%;

+ 10 - 3
pages/tabber/home/index.js

@@ -31,6 +31,7 @@ Page({
         islocation: "",
         
         hasUserInfo: false,
+        noticelist: []
     },
 
     /**
@@ -137,10 +138,16 @@ Page({
                 that.setData({
                     worke: res.message.data
                 })
+                app.api.useApi(app.globalData.baseAppUrl + "api/network_notice", {
+                    network_id: that.data.worke.id
+                }, "get").then(function (res) {
+                    if (res.code == 200) {
+                        that.setData({
+                            noticelist: res.message.data.notice
+                        })
+                    }
+                })
             }
-
-           
-
         }).catch(function (err) {
             console.log(err);
         })

+ 3 - 4
pages/tabber/home/index.wxml

@@ -41,7 +41,7 @@
 
 <!-- or gray -->
 <!-- wx:if="{{hasUserInfo}}" -->
-<view class="btns skyBlue " bindtap="placeOrder">
+<view class="btns {{worke.business_status==1?'skyBlue':'skygrey'}}" bindtap="placeOrder">
     <text>{{!islocation?'下单洗衣':'请先开启定位'}}</text>
     <view class="tips flex" hidden>活动活动活动活动</view>
 </view>
@@ -52,10 +52,9 @@
 
 <!-- <taskOrder value="3" bind:rightClick="rightClick"/> -->
 
-<view class="footerTips flex ju-b" hidden>
+<view class="footerTips flex ju-b" wx:for="{{noticelist}}" wx:key="index">
     <image src="/image/home/tips.png" class="tips"></image>
-    <view class="message">春节期间暂停服务,放假安排:2022-01-01至2022-02-02,
-        暂停期间干洗柜中未取衣物可超常取出</view>
+    <view class="message">{{item.content}}</view>
 </view>
 
 <view class="infoBoxs" style="top:{{btnInfo.top + btnInfo.height}}px;" wx:if="{{topShow}}">

+ 5 - 4
pages/tabber/home/index.wxss

@@ -172,6 +172,10 @@ page{
     background: linear-gradient(270deg, #467FFF 0%, #4699FF 100%);
     color: #FFFFFF;
 }
+.btns.skygrey{
+    background: #ccc;
+    color: #fff;
+}
 
 .btns.gray {
     color: #FFFFFF;
@@ -195,14 +199,11 @@ page{
 
 
 .footerTips {
-    position: fixed;
-    z-index: 10;
-    left: 0;
-    bottom: 0;
     width: 750rpx;
     height: 104rpx;
     background: #FDFCEC;
     padding: 0 24rpx;
+    margin: 0 0 4rpx;
 }
 
 .footerTips .tips {

+ 1 - 27
project.private.config.json

@@ -3,33 +3,7 @@
         "compileHotReLoad": false,
         "urlCheck": false
     },
-    "condition": {
-        "miniprogram": {
-            "list": [
-                {
-                    "name": "优惠券",
-                    "pathName": "pages/my/coupon/coupon",
-                    "query": "",
-                    "launchMode": "default",
-                    "scene": null
-                },
-                {
-                    "name": "领取优惠券",
-                    "pathName": "pages/my/share/share",
-                    "query": "",
-                    "launchMode": "default",
-                    "scene": null
-                },
-                {
-                    "name": "我的",
-                    "pathName": "pages/tabber/my/index",
-                    "query": "",
-                    "launchMode": "default",
-                    "scene": null
-                }
-            ]
-        }
-    },
+    "condition": {},
     "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
     "libVersion": "2.23.1",
     "projectname": "laundry_m"