shish 2 лет назад
Родитель
Сommit
a33424d893

+ 205 - 0
ghsApp/src/admin/cp/components/delCp.vue

@@ -0,0 +1,205 @@
+<template>
+<view class="product">
+	<view class="item-cmd_bx" >
+        <image :src="`${constant.imgUrl}/icon/official8.png`" v-if="info.auth && info.auth == 1" mode="widthFix" class="official"></image>
+		<view class="img_bx" @click="doIt(info)">
+			<view v-if="info.status == 2" class="sold-out">
+				<view class="sold-out-xj">已下架</view>
+			</view>
+			<image :src="info.cover" style="width:160upx;height:160upx;border-radius:10upx;" lazy-load="true" :lazy-load-margin="0"></image>
+		</view>
+		<view class="cmd-info_bx active" @click="doIt(info)">
+			<view class="tit">
+				{{ info.name }}
+			</view>
+			<view class="kc">
+				<text style="color:green;font-weight:normal;">{{ info.miniPrice?parseFloat(info.miniPrice):0 }} - {{ info.maxPrice?parseFloat(info.maxPrice):0 }}</text>
+			</view>
+			<view class="num-open_bx">
+				<template>
+					<view class="open-bx">
+						剩余 <text style="font-size:23upx;margin-left:9upx;">{{ info.stock?parseFloat(info.stock):0 }}</text>
+						<text style="margin-left:9upx;font-size:23upx;" v-if="info.onStock>0">路上<text style="font-weight:700;">{{info.onStock}}</text></text>
+						<text style="margin-left:9upx;font-size:23upx;display:inline-block;color:#999;font-weight:normal;">成本 {{ info.cost ? parseInt(info.cost) : 0 }}</text>
+						<text style="margin-left:9upx;font-size:23upx;display:inline-block;color:#999;font-weight:normal;">销量 {{ info.actualSold ? parseInt(info.actualSold) : 0 }}</text>
+					</view>
+				</template>
+			</view>
+		</view>
+	</view>
+	<text class="bottom-button" @click.stop="recoverCp(info)">恢复</text>
+	<text class="bottom-button" @click.stop="editCp(info)">编辑</text>
+</view>
+</template>
+<script>
+export default {
+	name: "item",
+	components: {
+	},
+	props: {
+		info: {
+			required: true
+		},
+		skipType:{
+			type: Number,
+			default:0
+		}
+	},
+	data() {
+		return {
+			frontHide:0
+		};
+	},
+	mounted(){
+		if(this.info){
+			this.frontHide = this.info.frontHide
+		}
+	},
+	methods: {
+		recoverCp(info){
+			this.$emit('recoverCp',info)
+		},
+		editCp(info){
+			this.$emit('editCp',info)
+		},
+		doIt(info){
+			this.$emit("doIt",info)
+		},
+		hideChangeFn(item,status){
+			this.$emit("hideChangeFn",item,status)
+		},
+		cancelPreSellFn(item){
+			this.$emit("cancelPreSellFn",item)
+		},
+		cancelDiscountFn(item){
+			this.$emit("cancelDiscountFn",item)
+		},
+		cancelFullOff(item){
+			this.$emit("cancelFullOff",item)
+		},
+		moreAction(item){
+			this.$emit('moreAction', item)
+		},
+		doPrintLabel(item,type){
+			this.$emit('doPrintLabel', item.id,type)
+		},
+		goToStockDetail(item){
+			this.$util.pageTo({url: "/pagesStorehouse/stockWarn/detailed?id="+item.id+'&name='+item.name})
+		},
+		breakSingleItem(item) {
+			this.$emit('breakSingleItem', item)
+		}
+	}
+};
+</script>
+<style lang="scss" scoped>
+.product{
+	height:230upx;
+}
+.bottom-button{
+	font-weight:normal;
+	border:2upx solid #cccccc;
+	font-size:24upx;
+	border-radius: 20upx;
+	padding:13upx 23upx 13upx 23upx;
+	margin:0 25upx 0 0;
+	float:right;
+	color:#aaa9a9;
+}
+.item-cmd_bx {
+	height:160upx;
+	position: relative;
+	margin-bottom: 20upx;
+	.official{
+		z-index:99;
+		position:absolute;
+		top:62upx;
+		right:25upx;
+		width:42upx;
+		height:42upx;
+		display:inline-block;
+	}
+	.img_bx {
+		height: 160upx;
+		width: 160upx;
+		position: absolute;
+		left: 0upx;
+		top: 0upx;
+		.sold-out{
+			z-index:10;
+			width:160upx;
+			height:160upx;
+			background-color:black;
+			position:absolute;
+			top:0;
+			left:0;
+			opacity: 0.6;
+			color:white;
+			text-align:center;
+			.sold-out-xj{
+				line-height:160upx;
+				font-size:28upx;
+			}
+		}
+	}
+	.cmd-info_bx {
+		position: relative;
+		padding-left: 177upx;
+
+
+		& .tit {
+			font-size: 30upx;
+			font-weight: bold;
+			color: #333333;
+			overflow: hidden;
+			white-space: nowrap;
+			text-overflow: ellipsis;
+			width:330upx;
+		}
+		.show-color{
+			display:inline-block;
+			width:25upx;
+			height:25upx;
+			background-color:rgb(9, 199, 9);
+			border-radius:15upx;
+			border:none;
+			margin-left:15upx;
+		}
+		& .kc {
+			color: red;
+			font-size: 27upx;
+			font-weight:bold;
+			padding: 24upx 0 24upx;
+			width:365upx;
+			overflow: hidden;
+			white-space: nowrap;
+		}
+		& .num-open_bx {
+			display: flex;
+			align-items: center;
+			& .price {
+				font-size: 28upx;
+				color: #999999;
+				flex: 1;
+			}
+			& .open-bx {
+				font-size:23upx;
+				color:#333333;
+				width:360upx;
+				overflow:hidden;
+				white-space:nowrap;
+				text{
+					font-size: 23upx;
+					font-weight:700;
+				}
+				text:nth-child(2){
+					font-weight:normal;
+				}
+				*.warn {
+					color: $redColor;
+				}
+			}
+		}
+	}
+}
+</style>

+ 335 - 0
ghsApp/src/admin/cp/delList.vue

@@ -0,0 +1,335 @@
+<template>
+    <view class="app-content" style="background:white;">
+          <view class="billing_box_bg">
+              <view class="input-wrap">
+                  <view style="padding:0upx 0upx 0upx 0upx;margin-right:10upx;" >
+                      <button class="admin-button-com middle blue" @click="selectFlowerNumFn()">图片分类</button>
+                  </view>
+                  <view class="search-bar">
+                      <app-search-module v-model="py" placeholder="这里搜索产品" @input="searchFn"/>
+                  </view>
+                  <view style="padding:0 0upx 0 15upx;" >
+                      <button class="admin-button-com middle blue" @click="pageTo({ url: '/admin/cp/ptCpList' })">添加产品</button>
+                  </view>
+              </view>
+              <view class="scroll-middle_bx">
+                <scroll-view scroll-y scroll-with-animation class="tab-view" :scroll-top="scrollTop">
+                    <div v-for="(item, index) in globalCpClassList" :key="index" class="tab-bar-item" :class="[classIndex == index ? 'active' : '']" :data-current="index" @tap.stop="swichClass(index,item)">
+                        <text style="text-align: center;">{{ item.name || "" }}</text>
+                    </div>
+                </scroll-view>
+
+                <scroll-view scroll-y class="right-box" :scroll-into-view="scroll_into_view" scroll-with-animation="true"
+                            @scroll="scrolling" lower-threshold="100" @scrolltolower="scrollBottom">
+
+                    <block v-if="!$util.isEmpty(globalCpList)">
+                        <view class="item_list_bx selectAll">
+                            <view class="item_list_title"></view>
+                            <view v-if="!$util.isEmpty(globalCpList)">
+                                <template v-for="(productItem, productIndex) in globalCpList">
+                                    <view style="height:255upx" :key="productIndex">
+                                        <cpStock :info="productItem" @moreAction="moreAction" @doIt="doIt" @editCp="editCp" @recoverCp="recoverCp"
+                                        @cancelDiscountFn="cancelDiscountFn" @cancelFullOff="cancelFullOff"
+                                        :ref="`cpRef${productItem.id}`" @hideChangeFn="hideChangeFn">
+                                        </cpStock>
+                                    </view>
+                                </template>
+                            </view>
+                            <view v-else>
+                                <view style="height:260upx;text-align:center;color:#CCCCCC;position: relative;">
+                                    <view style="position: absolute;margin:auto;top:130upx;left:0;right:0;bottom:0;">暂无花材</view>
+                                </view>
+                            </view>
+                        </view>
+                    </block>
+                    <block v-else>
+                        <view style="width:100%">
+                            <app-wrapper-empty  title="加载中" :is-empty="$util.isEmpty(globalCpList)" />
+                        </view>
+                    </block>
+                </scroll-view>
+
+              </view>
+          </view>
+  
+          <uni-popup ref="selectFlowerNumRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
+              <view style="display:flex;padding:20upx;height:auto;justify-content: space-between;align-items:center;flex-wrap:wrap;max-height:100vh;overflow:auto;">
+  
+                  <view v-for="(item, index) in globalCpList" :key="index" @tap.stop="changeClass(index,item)" style="margin-bottom:20upx;margin-left:3upx;">
+                  <image :src="item.classCover" style="width:120upx;height:120upx;border-radius:10upx;"></image>
+                  <view style="margin-top:5upx;overflow: hidden;white-space: nowrap;width:120upx;text-align:center;">{{item.className}}</view>
+                  </view>
+  
+              </view>
+          </uni-popup>
+  
+      </view>
+  </template>
+  <script>
+  import AppSearchModule from "@/components/module/app-search";
+  import AppWrapperEmpty from "@/components/app-wrapper-empty";
+  import cpStock from "./components/delCp";
+  import cpMins from "@/mixins/cp";
+  import { mapGetters } from "vuex";
+  import { getWeixinId } from "@/api/invite";
+  import { getCpClassMenu,getCpList,recoverCpFn } from "@/api/cp";
+  import { getHdPoster,getSkPoster,changeFrontHide,applyAuth } from '@/api/item'
+  import uniPopup from '@/uni_modules/uni-popup/components/uni-popup/uni-popup.vue';
+  import ModalModule from "@/components/plugin/modal"
+  export default {
+      name: "list",
+      components: {
+          AppSearchModule,
+          AppWrapperEmpty,
+          cpStock,
+          uniPopup,
+          ModalModule
+      },
+      mixins: [cpMins],
+      data() {
+          return {
+            autoLoad: false,
+            selectJobType: "stock",
+            tabIndex: 0,
+            getAppIdList:{},
+            status:0,
+            delStatus:0,
+            warning:0,
+            currentInfo:{},
+            posterUrl:'',
+            classIndex: 0,
+            globalCpClassList:[],
+            globalCpList:[],
+            page:1,
+            currentClassId:0,
+            finishGetCp:0,
+            skip:0,
+            py:''
+          };
+      },
+      computed:{
+          ...mapGetters(["getMyShopInfo","getLoginInfo"]),
+          ...mapGetters({ loginInfo: "getLoginInfo",dictInfo:"getDictionariesInfo" })
+      },
+      onLoad() {
+        let that = this
+        that.skip = that.option.skip ? that.option.skip : 0
+        getWeixinId().then(res => {
+            that.getAppIdList = res.data
+        })
+        getCpClassMenu().then(res=>{
+            if(res.code == 1){
+                that.globalCpClassList = res.data.list ? res.data.list : []
+                if(!this.$util.isEmpty(that.globalCpClassList)){
+                    let current = that.globalCpClassList[0]
+                    that.currentClassId = current.id
+                    that.getCpList()
+                }
+            }
+        })
+      },
+      methods: {
+        searchFn(){
+            if(!this.$util.isEmpty(this.py)){
+                this.search = this.py
+                this.page = 1
+                this.classIndex = -1
+                this.finishGetCp = 0
+                this.getCpList()
+            }else{
+                this.search = ''
+                this.page = 1
+                this.classIndex = 0
+                this.finishGetCp = 0
+                this.getCpList()
+            }
+        },
+        selectFlowerNumFn(){
+            this.$msg('开发中')
+        },
+        recoverCp(info){
+            let that = this
+            this.$util.confirmModal({content:'确认恢复?'},() => {
+                recoverCpFn({id:info.id}).then(res=>{
+                    if(res.code == 1){
+                        that.$msg(res.msg)
+                    }
+                })
+            })
+        },
+        editCp(info){
+            this.$util.pageTo({url: '/admin/cp/updateCp?id='+info.id})
+        },
+        doIt(info){
+            if(this.skip == 0){
+                this.$util.pageTo({url: '/admin/cp/item?cpId='+info.id})
+            } 
+            if(this.skip == 1){
+                //返回上一页带参数
+                let pages = getCurrentPages();
+                let prevPage = pages[ pages.length - 2 ];
+                //修改上一页data里面的xjData
+                prevPage.$vm.backCpInfo = {cpId:info.id,cpName:info.name,needUpdate:1}
+                uni.navigateBack()
+            }
+        },
+        getCpList(){
+            if(this.finishGetCp == 1){
+                return false
+            }
+            let that = this
+            getCpList({classId:that.currentClassId,page:that.page,search:this.py,requestType:'del'}).then(res=>{
+                if(res.code == 1){
+                    that.globalCpList = that.page == 1 ? res.data.list : that.globalCpList.concat(res.data.list)
+                    if(res.data.moreData == 1){
+                        that.page++
+                    }else{
+                        that.finishGetCp = 1
+                    }
+                }
+            })
+        },
+		swichClass(cur,item) {
+			this.classIndex = cur
+            this.page = 1
+            this.currentClassId = item.id
+            this.finishGetCp = 0
+            this.getCpList()
+		},
+		scrollBottom(){
+            this.getCpList()
+        },
+        scrolling(){
+
+        },
+        changeClass(index,item){
+            this.$refs.selectFlowerNumRef.close()
+            this.swichClass(index,item)
+        }
+      }
+  };
+  </script>
+  
+  <style lang="scss" scoped>
+  .billing_box_bg {
+      height: 100%;
+      display: flex;
+      background:white;
+      flex-direction: column;
+      .input-wrap {
+          display: flex;
+          padding: 22upx 20upx 22upx 13upx;
+          .search-bar {
+              flex: 1;
+          }
+          .city-select {
+              display: flex;
+              flex-shrink: 0;
+              align-items: center;
+              margin-right: 15upx;
+              margin-left: 45upx;
+              background-color: #ffff;
+              .iconfont {
+                  margin-left: 20upx;
+                  font-size: 30upx;
+              }
+          }
+      }
+      .scroll-middle_bx {
+          flex: 1;
+          display: flex;
+          width: 100%;
+          height: 100%;
+          overflow: hidden;
+      }
+      .tab-view {
+          height: calc(100vh - 140upx);
+          width: 170upx;
+          flex-shrink: 0;
+          background-color: #f0f2f6;
+          .tab-bar-item {
+              position: relative;
+              width: 170upx;
+              height: 90upx;
+              box-sizing: border-box;
+              display: flex;
+              align-items: center;
+              justify-content: center;
+              font-size: 26upx;
+              color: #444;
+              font-weight: 400;
+              .tag {
+                  display: flex;
+                  padding: 0 20upx;
+                  align-items: center;
+                  position: absolute;
+                  right: 0;
+                  top: 0;
+                  height: 32upx;
+                  background: #ff2842;
+                  border-radius: 16upx;
+                  color: #fff;
+                  font-size: 20upx;
+              }
+        &:last-child{
+          margin-bottom: 110upx;
+        }
+          }
+  
+          .active {
+              position: relative;
+              color: $mainColor;
+              font-size: 26upx;
+              background: #fff;
+          }
+  
+          .active::before {
+              content: "";
+              position: absolute;
+              border-left: 8upx solid $mainColor;
+              height: 100%;
+              left: 0;
+          }
+      }
+      .right-box {
+          height: calc(100vh - 140upx);
+          flex: 1;
+          box-sizing: border-box;
+      }
+      .item_list_bx {
+          padding: 40upx 16upx;
+      }
+      .item_list_title {
+          margin-bottom: 20upx;
+          font-size: 24upx;
+          font-weight: 600;
+          color: #666666;
+      }
+      .select-cmd_bx {
+          & .kc {
+              color: #999999;
+              font-size: 28upx;
+              font-weight: 400;
+              margin-bottom: 60upx;
+              text-align: center;
+              margin-top: 10upx;
+          }
+          & .num_bx {
+              display: flex;
+              align-items: center;
+              margin-bottom: 80upx;
+              & > input {
+                  width: 212upx;
+                  height: 80upx;
+                  border: 1upx solid #dddddd;
+                  border-radius: 4upx;
+                  text-align: center;
+                  margin-right: 24upx;
+              }
+          }
+      }
+  }
+  .class-popup-style{
+      z-index:999999;
+  }
+  </style>

+ 2 - 1
ghsApp/src/admin/home/apply.vue

@@ -49,7 +49,8 @@ export default {
                     title:'产品',
                     list:[
                         {name: "产品列表",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/cp/list"},
-                        {name: "产品分类",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/cp/class"}
+                        {name: "产品分类",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/cp/class"},
+                        {name: "已删除",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/cp/delList"},
                     ]
                 },
                 {

+ 4 - 0
ghsApp/src/api/cp/index.js

@@ -58,4 +58,8 @@ export const getCpDetail = data => {
 
 export const delCpFn = data => {
 	return https.get('/cp/del-cp', data)
+}
+
+export const recoverCpFn = data => {
+	return https.get('/cp/recover-cp', data)
 }

+ 1 - 0
ghsApp/src/pages.json

@@ -414,6 +414,7 @@
 			"root": "admin/cp",
 			"pages": [
 				{"path": "list","style": {"navigationBarTitleText": "产品列表"}},
+				{"path": "delList","style": {"navigationBarTitleText": "已删除"}},
 				{"path": "class","style": {"navigationBarTitleText": "产品分类"}},
 				{"path": "item","style": {"navigationBarTitleText": "花材"}},
 				{"path": "ptCpList","style": {"navigationBarTitleText": "从平台找产品"}},