|
|
@@ -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>
|