shish 3 лет назад
Родитель
Сommit
e241956dcf
3 измененных файлов с 265 добавлено и 59 удалено
  1. 3 3
      hdApp/src/admin/home/login.vue
  2. 254 5
      hdApp/src/admin/home/workbench.vue
  3. 8 51
      hdApp/src/pagesPurchase/order.vue

+ 3 - 3
hdApp/src/admin/home/login.vue

@@ -13,12 +13,12 @@
 				<view>
 				<input @focus="password=''" v-model="password" class="experInput" placeholder="密码" type="password" />
 				</view>
-				<view style="margin-top:40upx;">
+				<view style="margin-top:10upx;">
 				<button class="admin-button-com small blue buttonText" @click="loginFun">登陆</button>
 				</view>
 				<!-- #ifdef MP-WEIXIN -->
 				<view style="margin-top:55upx;">
-				<button class="admin-button-com small buttonText" style="background-color:#2BA245;border-color:#2BA245;color:white;"
+				<button class="admin-button-com small buttonText" style="background-color:#2BA245;border-color:#2BA245;color:white;height:120upx;line-height:120upx;"
 				open-type="getPhoneNumber" @getphonenumber="wxPhoneLogin">微信手机号一键登录</button>
 				</view>
 				<!-- #endif -->
@@ -394,7 +394,7 @@ export default {
         height:90upx;
       }
       .logo{
-        width:180upx;
+        width:150upx;
         margin:0 auto;
 		border-radius:20upx;
       }

+ 254 - 5
hdApp/src/admin/home/workbench.vue

@@ -1,5 +1,13 @@
 <template>
-  <div class="app-main app-content">
+<view>
+  <block v-if="loginStyle  == 0">
+    <view style="width:100vw;height:500upx;display:flex;align-items:center;justify-content:center;">
+      <button class="admin-button-com big blue" @click="pageTo({url:'/admin/home/login'})">点我登录</button>
+      <view style="position:absolute;top:330upx;font-size:35upx;">请选择<text style="color:red;margin-left:8upx;font-weight:bold;">微信手机号一键登录</text></view>
+    </view>
+  </block>
+  <block v-else>
+  <div class="app-main app-content" v-if="loginStyle  == 2">
     <div class="user-wrap" :style="{ backgroundImage: `url(${constant.imgUrl}/home/bg_hd_home.png)` }">
       <div class="user-top">
         <div class="app-size-28">今日概况</div>
@@ -66,8 +74,40 @@
         </div>
       </div>
     </div>
-    <NotLogin></NotLogin>
   </div>
+  <view class="order-page" v-else>
+    <view class="order_list">
+      <block>
+        <block v-if="!$util.isEmpty(supplierList)">
+          <view class="list_item" v-for="(ghsInfo, index) in supplierList" :key="index">
+            <view class="store_name">
+              <image :src="ghsInfo.avatar"></image>
+              <view class="store_title">{{ghsInfo.name}}</view>
+              <view class="accumulative"></view>
+            </view>
+
+            <view :class="[ghsInfo.isOpen == 0 ? 'cg-button-rest' : 'cg-button']" @click="enterShop(ghsInfo)">买花</view>
+
+            <view class="store_btn">
+              <view class="btn_entrance" @click="pageTo({url:'/pagesPurchase/shopping'})" > 买花记录 </view>
+              <view class="btn_entrance" @click="pageTo({ url: '/admin/clear/list?ghsId='+ghsInfo.id})">结账记录</view>
+              <view class="btn_entrance" @click="pageTo({ url: '/admin/ghs/debtChange?ghsId='+ghsInfo.id})">欠款变动明细</view>
+            </view>
+            <text v-if="ghsInfo.isOpen == 0" 
+            style="position:absolute;top:0upx;left:0upx;color:white;background-color:#CCCCCC;padding:3upx 18upx;font-size:24upx;">已休店</text>
+            <view style="position:absolute;top:275upx;font-size:36upx;text-align:center;width:100vw;color:red;font-weight:bold;" @click="settleAccounts(ghsInfo)" v-if="Number(ghsInfo.debtAmount)>0"
+            >待结 {{ghsInfo.debtNum}}笔 {{ghsInfo.debtAmount?parseFloat(ghsInfo.debtAmount):0}}元 <text style="text-decoration:underline;margin-left:18upx;">查看明细</text></view>
+          </view>
+        </block>
+        <block v-else>
+          <AppWrapperEmpty title="暂无供应商" :is-empty="$util.isEmpty(supplierList)" />
+        </block>
+      </block>
+    </view>
+  </view>
+
+  </block>
+</view>
 </template>
 <script>
 import { mapGetters, mapState } from "vuex";
@@ -77,9 +117,11 @@ import { getShopInfo } from "@/utils/auth";
 import { consoleIndex } from "@/api/workbench";
 import NotLogin from "@/components/not-login";
 import autoUpdateMixins from "@/mixins/autoUpdate";
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import { ghsList } from "@/api/purchase/index";
 export default {
   name: "workbench",
-  components: { NotLogin },
+  components: { NotLogin,AppWrapperEmpty },
   mixins: [autoUpdateMixins],
   data () {
     return {
@@ -116,17 +158,47 @@ export default {
         { name: "总采购(元)", value: 0 }
       ],
       cgSrc: `${this.$constant.imgUrl}/ghs/home/cg.png`,
-      kdSrc: `${this.$constant.imgUrl}/ghs/home/kd.png`
+      kdSrc: `${this.$constant.imgUrl}/ghs/home/kd.png`,
+      supplierList: [],
+      //登录状态 0未登录 1登录仅用到了采购 2登录用到完整功能
+      loginStyle :0
     };
   },
   computed: {
     ...mapGetters({ loginInfo: "getLoginInfo",dictInfo:"getDictionariesInfo" })
   },
+	watch: {
+		//只需要采购花材的花店不显示底部菜单
+		loginInfo(newVal) {
+      if(!this.$util.isEmpty(newVal.admin) && newVal.admin.currentShopId > 0){
+          if(!this.$util.isEmpty(newVal.onlyCg)){
+            if(Number(newVal.onlyCg) == 1){
+              this.loginStyle  = 1
+              uni.hideTabBar()
+            }
+          }else{
+            this.loginStyle  = 2
+          }
+      }
+		}
+	},
   onPullDownRefresh () {
     this.init();
     uni.stopPullDownRefresh();
   },
   onShow () {
+
+      if(!this.$util.isEmpty(this.loginInfo.admin) && this.loginInfo.admin.currentShopId > 0){
+          if(!this.$util.isEmpty(this.loginInfo.onlyCg)){
+            if(Number(this.loginInfo.onlyCg) == 1){
+              this.loginStyle  = 1
+              uni.hideTabBar()
+            }
+          }else{
+            this.loginStyle  = 2
+          }
+      }
+
       getShopInfo().then(res => {
         if(res.name){
           uni.setNavigationBarTitle({ title: res.name })
@@ -136,6 +208,25 @@ export default {
       })
   },
   methods: {
+    enterShop(item) {
+      if(item.isOpen == 0){
+        this.$msg('休息了')
+        return false
+      }
+      const { id } = item
+      this.pageTo({url: '/pagesPurchase/ghsProduct?id='+id,type:2})
+    },
+    settleAccounts (item) {
+      this.pageTo({ url: '/pagesPurchase/gathering?id='+item.id})
+    },
+    gotoDetails (val) {
+      this.pageTo({ url: '/pagesPurchase/purDetails?status=' + val.status + '&id=' + val.id, type:2 })
+    },
+    getGHSList () {
+      return ghsList().then(res => {
+        this.supplierList = res.data.list
+      })
+    },
     goGd(){
       //选择花材生成制作单和订单
       this.$util.pageTo({url:'/admin/order/workOrder'})
@@ -192,6 +283,9 @@ export default {
       this.$util.pageTo(item)
     },
     init () {
+
+        this.getGHSList()
+
         getWeixinId().then(res => {
           this.getappIdList = res.data
         });
@@ -199,7 +293,7 @@ export default {
         this.isMini = 1
         // #endif
         let that = this
-        consoleIndex({isMini:this.isMini}).then(res => {
+          consoleIndex({isMini:this.isMini}).then(res => {
           this.data = res.data;
         })
 
@@ -413,4 +507,159 @@ export default {
     font-size: 34upx;
   }
 }
+.order-page {
+  .order_list {
+    height: 100%;
+    background: #f0f2f6;
+    padding: 0 0 20upx;
+    margin-bottom:100upx;
+    padding-top:4upx;
+    .list_item {
+      margin: 20upx 0 0;
+      position: relative;
+      height: 380upx;
+      width: 100vw;
+      background: #fff;
+      display: flex;
+      align-items: center;
+      .dist{
+        position: absolute;
+        top:0upx;
+        left: 0upx;
+        width:110upx;
+        text-align:center;
+        height:30upx;
+        background:#ecebeb;
+        font-size:22upx;
+        color:white;
+      }
+      .debt-amount{
+        color:red;
+        position: absolute;
+        top:75upx;
+        font-size:26upx;
+        right:260upx;
+      }
+      .cg-button{
+          display: inline-block;
+          font-size: 33upx;
+          font-weight:bold;
+          color: white;
+          border: 1px solid #3385FF;
+          border-radius: 45upx;
+          padding: 20upx 40upx;
+          position: absolute;
+          top:56upx;
+          right:60upx;
+          background: #3385FF;
+      }
+      .cg-button-rest{
+          display: inline-block;
+          font-size: 33upx;
+          font-weight:bold;
+          color: white;
+          border: 1px solid #CCCCCC;
+          border-radius: 45upx;
+          padding: 20upx 40upx;
+          position: absolute;
+          top:56upx;
+          right:60upx;
+          background: #CCCCCC;
+      }
+      .book-button{
+          display: inline-block;
+          font-size: 25upx;
+          border-radius: 120upx;
+          padding: 15upx 30upx;
+          position: absolute;
+          top:250upx;
+          right:300upx;
+      }
+      .could-book{
+          color: white;
+          border: 1px solid #657cac;
+          background: #657cac;
+      }
+      .not-book{
+          color: white;
+          border: 1px solid #CCCCCC;
+          background: #CCCCCC;
+      }
+      .book-button-text{
+          position: absolute;
+          top:330upx;
+          right:210upx;
+          .explain{
+            text-decoration: underline;
+            font-size:25upx;
+          }
+      }
+      .could-book-text{
+          color:#666666;
+      }
+      .not-book-text{
+        color:#CCCCCC;
+      }
+      & > .store_name {
+        margin-left: 30upx;
+        width: 700upx;
+        display: block;
+        position: absolute;
+        top:70upx;
+        left: 0upx;
+        image{
+          width:50upx;
+          height:50upx;
+          border-radius:60upx;
+          float:left;
+        }
+        & > .store_title {
+          margin-bottom: 58upx;
+          margin-left:10upx;
+          width: 486upx;
+          white-space: nowrap;
+          text-overflow: ellipsis;
+          overflow: hidden;
+          word-break: break-all;
+          font-size: 36upx;
+          font-weight: 700;
+          color: #333;
+          display:inline-block;
+        }
+        & > .accumulative {
+          font-size: 26upx;
+          color: #999;
+        }
+      }
+      & > .store_btn {
+        position: absolute;
+        top:180upx;
+        left: 0upx;
+        & > .btn_entrance {
+          display: inline-block;
+          font-size: 35upx;
+          color: #BBBBBB;
+          padding: 10upx 10upx;
+          margin-left: 45upx;
+          text-decoration: underline;
+          color:#666666;
+        }
+      }
+      .fl_line {
+        position: absolute;
+        top:120upx;
+        left: 40upx;
+        font-size:23upx;
+        color:red;
+        text{
+          margin-right:40upx;
+        }
+      }
+    }
+  }
+  .pay_list {
+    padding-top: 20upx;
+    background-color: #f0f2f6;
+  }
+}
 </style>

+ 8 - 51
hdApp/src/pagesPurchase/order.vue

@@ -15,39 +15,31 @@
             <view class="store_btn">
               <view class="btn_entrance" @click="pageTo({url:'/pagesPurchase/shopping'})" > 买花记录 </view>
               <view class="btn_entrance" @click="pageTo({ url: '/admin/clear/list?ghsId='+ghsInfo.id})">结账记录</view>
-              <view class="btn_entrance" style="color:red;font-weight:bold;" @click="settleAccounts(ghsInfo)">待结订单 </view>
               <view class="btn_entrance" @click="pageTo({ url: '/admin/ghs/debtChange?ghsId='+ghsInfo.id})">欠款变动明细</view>
             </view>
             <text v-if="ghsInfo.isOpen == 0" 
             style="position:absolute;top:0upx;left:0upx;color:white;background-color:#CCCCCC;padding:3upx 18upx;font-size:24upx;">已休店</text>
-            <view style="position:absolute;top:275upx;font-size:33upx;text-align:center;width:100vw;color:red;font-weight:bold;" @click="settleAccounts(ghsInfo)" v-if="Number(ghsInfo.debtAmount)>0"
-            >待结 {{ghsInfo.debtNum}}笔 {{ghsInfo.debtAmount?parseFloat(ghsInfo.debtAmount):0}}元 <text style="text-decoration:underline;margin-left:18upx;">查看</text></view>
+            <view style="position:absolute;top:275upx;font-size:36upx;text-align:center;width:100vw;color:red;font-weight:bold;" @click="settleAccounts(ghsInfo)" v-if="Number(ghsInfo.debtAmount)>0"
+            >待结 {{ghsInfo.debtNum}}笔 {{ghsInfo.debtAmount?parseFloat(ghsInfo.debtAmount):0}}元 <text style="text-decoration:underline;margin-left:18upx;">查看明细</text></view>
           </view>
         </block>
         <block v-else>
-          <AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(supplierList)" />
+          <AppWrapperEmpty title="暂无供应商" :is-empty="$util.isEmpty(supplierList)" />
         </block>
       </block>
     </view>
   </view>
 </template>
 <script>
-import OrderItem from "./orderItem";
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
 import { ghsList } from "@/api/purchase/index";
-import { bcGhs } from "@/api/ghs/index";
 export default {
   components: {
-    AppWrapperEmpty,
-    OrderItem,
+    AppWrapperEmpty
   },
   data () {
     return {
-      list: {
-        data: []
-      },
-      supplierList: [],
-      tabIndex: 0
+      supplierList: []
     }
   },
   onPullDownRefresh() {
@@ -56,21 +48,6 @@ export default {
     })
   },
   methods: {
-    bcGhs(){
-      let that =this
-      uni.showLoading()
-      bcGhs().then(res=>{
-        uni.hideLoading()
-        if(res.code == 1){
-          setTimeout(function(){
-            that.pageTo({url: '/pagesPurchase/order',type:3})
-          },1000)
-        }
-      })
-    },
-		inviteGhs(){
-      this.pageTo({ url: '/pagesInvite/inviteShop'})
-		},
     enterShop(item) {
       if(item.isOpen == 0){
         this.$msg('门店休息了')
@@ -79,24 +56,6 @@ export default {
       const { id } = item
       this.pageTo({url: '/pagesPurchase/ghsProduct?id='+id,type:2})
     },
-    bookItem(item){
-      this.$msg("升级中");
-      return false
-      //没有设置每公斤运费则不能进入预订页面
-      if(item.kiloFee && Number(item.kiloFee)<=0){
-        this.$msg("即将开通,敬请期待");
-        return false
-      }
-      const { id } = item
-      this.pageTo({url: '/pagesPurchase/bookProduct?id='+id,type:2})
-    },
-    getBookItemExplain(item){
-      if(item.kiloFee && Number(item.kiloFee)<=0){
-        this.$msg("即将开通,敬请期待");
-        return false
-      }
-      this.pageTo('/pagesPurchase/bookExplain?id='+item.id)
-    },
     init() {
       this.getGHSList()
     },
@@ -105,11 +64,9 @@ export default {
         this.supplierList = res.data.list
       })
     },
-    //结账
     settleAccounts (item) {
       this.pageTo({ url: '/pagesPurchase/gathering?id='+item.id})
     },
-    //采购记录详情
     gotoDetails (val) {
       this.pageTo({ url: '/pagesPurchase/purDetails?status=' + val.status + '&id=' + val.id, type:2 })
     }
@@ -128,7 +85,7 @@ export default {
     .list_item {
       margin: 20upx 0 0;
       position: relative;
-      height: 350upx;
+      height: 380upx;
       width: 100vw;
       background: #fff;
       display: flex;
@@ -248,10 +205,10 @@ export default {
         left: 0upx;
         & > .btn_entrance {
           display: inline-block;
-          font-size: 33upx;
+          font-size: 35upx;
           color: #BBBBBB;
           padding: 10upx 10upx;
-          margin-left: 16upx;
+          margin-left: 45upx;
           text-decoration: underline;
           color:#666666;
         }