123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452 |
- <template>
- <view class="pages"
- :style="{'min-height':h+'px','padding-top':(mt)+'px','padding-botom':(Selected?100:0)+'px','box-sizing':(Selected?'content-box':'border-box')}">
- <c-nav-bar title="商品管理"></c-nav-bar>
- <view class="tb">
- <view class="tabs">
- <view v-for="(item,index) in tabList" :key="index" @tap="changeTab1(item,index)">
- <!-- <text :class="index==current?'active':''">{{item.name}}({{mytotal}})</text> -->
- <text :class="index==current?'active':''">{{item.name}}</text>
- </view>
- </view>
- </view>
- <!-- 房型数量 -->
- <view class="">
- <view class="typeNum">
- <view class="left" style="font-size: 24rpx; color: #777;" @click="areaShowed()">
- <text :class="areaShow==true?'active':''" style="margin-right: 20rpx;">{{areaval}}</text>
- <u-icon name="arrow-down-fill" bold='true' v-if="areaShow==false" size="20" labelPos="left"
- labelSize="26"></u-icon>
- <u-icon name="arrow-up-fill" bold='true' v-else color="#007a68" labelColor='#007a68' size="20"
- labelPos="left" labelSize="26"></u-icon>
- </view>
- <view class="right" @click="showList">
- <view class="image">
- <image src="https://i.ringzle.com/file/20240313/f3d301b3bc4544ffaf5a0d96a761dd00.png" mode="">
- </image>
- </view>
- <view class="text">
- 批量操作
- </view>
- </view>
- </view>
- <!-- 区域筛选 -->
- <view class="contented" :style="{'height':(h-mt)+'px'}" v-show="areaShow">
- <view class="custom_popup">
- <view class="types">
- <view class="pricequjian">
- <template v-if="merchantType==10">
- <!-- 渔家乐 -->
- <view class="jiage" v-for="(item, index) in list1" :key="index"
- @click="clickareaShow(item, index)">
- <view class="contentpeice">
- <view class="title" :class="{'Doublactive': areaShowIndex == index}">
- {{item.name}}
- </view>
- <view class="image" v-if="areaShowIndex == index">
- <image
- src="https://i.ringzle.com/file/20240316/16dd69efb40242de83da8207539ec73e.png"
- mode=""></image>
- </view>
- </view>
- </view>
- </template>
- <template v-else>
- <!-- 餐饮 -->
- <view class="jiage" v-for="(item, index) in list" :key="index"
- @click="clickareaShow(item, index)">
- <view class="contentpeice">
- <view class="title" :class="{'Doublactive': areaShowIndex == index}">
- {{item.name}}
- </view>
- <view class="image" v-if="areaShowIndex == index">
- <image
- src="https://i.ringzle.com/file/20240316/16dd69efb40242de83da8207539ec73e.png"
- mode=""></image>
- </view>
- </view>
- </view>
- </template>
- </view>
- </view>
- </view>
- </view>
- </view>
- <!-- 房型选择 -->
- <view class="type" v-for="(item,index) in roomType" :key="index">
- <view class="left" v-if="Selected==true">
- <view class="image">
- <image @tap="selectPerson(item,index)"
- :src="selectedTags.includes(item)?'https://i.ringzle.com/file/20240228/c741a340e19642c59473e6f4a6d2f4be.png':'https://i.ringzle.com/file/20231027/db588133d67548fc82dfb0d128eac9a8.png'">
- </image>
- </view>
- </view>
- <view style="width: 100%;">
- <view class="right">
- <view class="right-left">
- <image :src="item.coverImg" mode=""></image>
- <view class="rl_type" v-if="typecfg[item.goodsType]">{{typecfg[item.goodsType]}}</view>
- </view>
- <view class="right-right">
- <view class="top">
- <text style="font-size: 30rpx; color: #333;">{{item.name||item.goodsName}}</text>
- </view>
- <view class="under">
- <!-- <view style="font-size: 24rpx; color: #777;">销量:{{item.salesVolume||item.soldNum||0}}</view> -->
- <view style="font-size: 24rpx; color: #777;">
- 销量:{{item.salesVolume!=null?item.salesVolume:item.soldNum}}</view>
- <view v-if='item.goodsType==1'
- style="font-size: 36rpx; color: #FF4141; font-weight: Bold; margin-top: 16rpx;">
- ¥{{item.discountPrice}}</view>
- <view v-else-if="item.goodsType==2"
- style="font-size: 36rpx; color: #FF4141; font-weight: Bold; margin-top: 16rpx;">
- ¥{{item.normalPrice}}</view>
- <view v-else-if="item.goodsType==3"
- style="font-size: 36rpx; color: #FF4141; font-weight: Bold; margin-top: 16rpx;">
- ¥{{item.avePrice}}</view>
- <view v-else
- style="font-size: 36rpx; color: #FF4141; font-weight: Bold; margin-top: 16rpx;">
- ¥{{item.discountPrice}}</view>
- </view>
- </view>
- </view>
- <view class="type-btn" v-if='!canyinmeishi'>
- <view class="type-btn-left">
- </view>
- <view class="type-btn-right">
- <view v-if="canyinmeishi" class="" @click="xiajia(item,index)">
- {{fromData.status==0?'下架':'上架'}}
- </view>
- <view v-if="!canyinmeishi" class="" @click="xiajia1(item,index)">
- {{fromData.status==0?'上架':'下架'}}
- </view>
- </view>
- </view>
- <view class="type-btn" v-if='canyinmeishi'>
- <view class="type-btn-left">
- </view>
- <view class="type-btn-right">
- <view class="" @click="shanchu(item,index)">
- 删除
- </view>
- <!-- <view class="" @click="gaijia(item,index)">
- 改价格
- </view> -->
- <view v-if="canyinmeishi" class="" @click="xiajia(item,index)">
- {{fromData.status==0?'下架':'上架'}}
- </view>
- <view v-if="!canyinmeishi" class="" @click="xiajia1(item,index)">
- {{fromData.status==0?'上架':'下架'}}
- </view>
- </view>
- </view>
- </view>
- </view>
- <!-- 批量按钮 -->
- <view class="btn-btn" v-if="Selected==true">
- <view class="bottom-btn">
- <view class="left">
- <view class="image">
- <image
- :src="selectedTags.length>0?'https://i.ringzle.com/file/20240228/c741a340e19642c59473e6f4a6d2f4be.png':'https://i.ringzle.com/file/20231027/db588133d67548fc82dfb0d128eac9a8.png'">
- </image>
- </view>
- <view class="text">
- 已选:{{selectedTags.length}}
- </view>
- </view>
- <view class="right">
- <view v-if="canyinmeishi" class="right-btn" @click="piliangxiajia">
- {{fromData.status==0?'批量下架':'批量上架'}}
- </view>
- <view v-if="!canyinmeishi" class="right-btn" @click="piliangxiajia">
- {{fromData.status==0?'批量上架':'批量下架'}}
- </view>
- </view>
- </view>
- </view>
- <!-- 改价弹出框 -->
- <u-popup :show="showPricing" @close="closegaijia" @open="opengaijia" :round="10">
- <view class="gaijiadiv">
- <view class="toubu">
- 改价格
- <view class="toubux" @click="closegaijia">
- <u-icon name="close" color="#000000" size="40"></u-icon>
- </view>
- </view>
- <view class="jiainput">
- <u--input type='number' v-model="newprice" placeholder="请输入价格" border="surround"
- clearable></u--input>
- </view>
- <view class="queding">
- <view class="queding1" @click="closegaijia">
- 取消
- </view>
- <view class="queding2" @click="quedingjiae">
- 确定
- </view>
- </view>
- </view>
- </u-popup>
- <!-- 下架弹出框 -->
- <u-modal :show="xiajiashow" :title="fromData.status==0?'下架选中的商品':'上架选中的商品'"
- :content="fromData.status==0?'下架后商品不可在前台继续售卖,是否继续?':'上架后商品可在前台售卖,是否继续?'" showConfirmButton='true'
- showCancelButton='true' @confirm='quedingxiajia' @cancel='quxiaoxiajia'></u-modal>
- <!-- 下架弹出框渔家乐 -->
- <u-modal :show="xiajiashow1" :title="fromData.status==1?'下架选中的商品':'上架选中的商品'"
- :content="fromData.status==1?'下架后商品不可在前台继续售卖,是否继续?':'上架后商品可在前台售卖,是否继续?'" showConfirmButton='true'
- showCancelButton='true' @confirm='quedingxiajia' @cancel='quxiaoxiajia'></u-modal>
- <!-- 删除弹出框 -->
- <u-modal :show="shanchushow" title="删除选中的商品" content='删除后的商品不可在前台继续售卖,是否继续?' showConfirmButton='true'
- showCancelButton='true' @confirm='quedingshanchu' @cancel='quxiaoshanchu'></u-modal>
- <view class="mainContain">
- <!-- <view class="nodata" v-if='dataList.length==0'>
- <NoData></NoData>
- </view> -->
- </view>
- <u-toast ref="uToast"></u-toast>
- </view>
- </template>
- <script>
- import TopTabs from '@/components/TopTabs/topTabs.vue';
- // import NoData from '../../components/NoData/index.vue';
- export default {
- components: {
- TopTabs,
- // NoData
- },
- data() {
- return {
- h: uni.getSystemInfoSync().windowHeight,
- mt: uni.getSystemInfoSync().statusBarHeight + 44,
- newprice: '',
- lsdata: {},
- current: 0,
- canyinmeishi: false,
- xiajiashow: false,
- xiajiashow1: false,
- shanchushow: false,
- tabList: [],
- homestayId: uni.getStorageSync('homestayId') || 0,
- roomType: [],
- selectedTags: [],
- mytotal: 0,
- isSelect: false,
- Selected: false,
- showPricing: false,
- areaShow: false,
- areaval: '上架时间',
- //餐饮
- list: [{
- name: '创建时间',
- key: 'createDate',
- value: 1
- },
- {
- name: '上架时间',
- key: 'updateDate',
- value: 1
- },
- {
- name: '销量从高到低',
- key: 'salesVolume',
- value: 1
- },
- {
- name: '价格从高到低',
- key: 'discountPrice',
- value: 1
- },
- {
- name: '价格从低到高',
- key: 'discountPrice',
- value: 0
- },
- // {
- // name: '库存从高到低',
- // key: 'price',
- // value: 1
- // },
- // {
- // name: '库存从低到高',
- // key: 'price',
- // value: 0
- // },
- ],
- //渔家乐
- list1: [{
- name: '上架时间',
- key: 'updateDate',
- value: 1
- },
- {
- name: '销量从高到低',
- key: 'soldNum',
- value: 1
- },
- // {
- // name: '价格从高到低',
- // key: '',
- // value: 1
- // },
- // {
- // name: '价格从低到高',
- // key: '',
- // value: 0
- // }
- ],
- areaShowIndex: null,
- merchantType: uni.getStorageSync('merchantType'),
- fromData: {
- merchantId: uni.getStorageSync('merchantId'), //商户id
- limit: 99,
- page: 1,
- sortType: '', //选择条件:1创建时间 2销量从高到低 3价格从高到低 4价格从低到高
- status: 0, //状态:0上架1下架
- },
- typecfg: {
- 1: '特价船',
- 2: '包船'
- }
- }
- },
- onLoad(option) {
- console.log('111111111111111111', uni.getStorageSync('merchantType'))
- //this.getHousekeeping();
- if (uni.getStorageSync('merchantType') == 4) {
- this.canyinmeishi = true;
- this.tabList = [{
- name: '出售中',
- id: 0
- },
- {
- name: '待上架',
- id: 1
- },
- ]
- this.getRepast(); //获取商品列表(餐饮美食)
- } else {
- this.canyinmeishi = false;
- this.tabList = [{
- name: '出售中',
- id: 1
- },
- {
- name: '待上架',
- id: 0
- },
- ]
- this.fromData = {
- merchantId: uni.getStorageSync('merchantId'), //商户id
- limit: 99999,
- page: 1,
- sortType: '', //选择条件:1创建时间 2销量从高到低 3价格从高到低 4价格从低到高
- status: 1, //状态:0上架1下架
- }
- this.yujialedata(); //获取商品列表(渔家乐)
- }
- },
- methods: {
- getHousekeeping() {
- this.$api.get('/sys/dict/type/all').then(res => {
- let alldata = res.data.data.find((p) => p.dictType == 'food_type').dataList;
- console.log('alldata', alldata)
- // this.categoryMain = alldata.map((item, index, arr) => {
- // let json = {};
- // json.name = item.dictLabel;
- // json.type = item.dictValue;
- // json.icon =
- // 'https://i.ringzle.com/file/20231125/a314703e463d43c7808714d1b29632ad.png';
- // return json
- // })
- })
- },
- piliangxiajia() {
- if (uni.getStorageSync('merchantType') == 4) {
- if (this.selectedTags.length == 0) {
- this.$refs.uToast.show({
- type: 'success',
- title: '',
- message: "请选择数据",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
- })
- } else {
- let namesArray = this.selectedTags.map(obj => obj.id);
- let postdata = {
- discountPrice: 0,
- ids: namesArray,
- status: this.fromData.status == 0 ? 1 : 0,
- };
- this.$api.post('/api/merchant/food/updateStatus', postdata).then(res => {
- this.$refs.uToast.show({
- type: 'success',
- title: '',
- message: "成功",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
- })
- this.selectedTags = [];
- this.Selected = false;
- this.getRepast(); //获取商品列表
- })
- }
- } else {
- if (this.selectedTags.length == 0) {
- this.$refs.uToast.show({
- type: 'success',
- title: '',
- message: "请选择数据",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
- })
- } else {
- let postdata = this.selectedTags.map((item, index, arr) => {
- let json = {};
- json.id = item.id;
- json.merchantId = uni.getStorageSync('merchantId');
- json.status = item.status == 0 ? 1 : 0;
- return json
- })
- // let namesArray = this.selectedTags.map(obj => obj.id);
- // let postdata = {
- // id: namesArray,
- // status: this.fromData.status,
- // };
- this.$api.post('/scenic/api/goods/batchUpDownFrame', postdata).then(res => {
- this.$refs.uToast.show({
- type: 'success',
- title: '',
- message: "成功",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
- })
- this.selectedTags = [];
- this.Selected = false;
- this.yujialedata(); //获取商品列表(渔家乐)
- })
- }
- }
- },
- piliangshanchu() {
- if (uni.getStorageSync('merchantType') == 4) {
- if (this.selectedTags.length == 0) {
- this.$refs.uToast.show({
- type: 'success',
- title: '',
- message: "请选择数据",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
- })
- } else {
- let namesArray = this.selectedTags.map(obj => obj.id);
- //status: this.fromData.status,
- this.$api.del('/api/merchant/food/delProduct', namesArray).then(res => {
- this.$refs.uToast.show({
- type: 'success',
- title: '',
- message: "成功",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
- })
- this.selectedTags = [];
- this.Selected = false;
- this.getRepast(); //获取商品列表
- })
- }
- } else {
- if (this.selectedTags.length == 0) {
- this.$refs.uToast.show({
- type: 'success',
- title: '',
- message: "请选择数据",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
- })
- } else {
- let namesArray = this.selectedTags.map(obj => obj.id);
- console.log('111111111111111111', namesArray)
- //status: this.fromData.status,
- this.$api.del('/scenic/api/goods', namesArray).then(res => {
- this.$refs.uToast.show({
- type: 'success',
- title: '',
- message: "成功",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
- })
- this.selectedTags = [];
- this.Selected = false;
- this.yujialedata(); //获取商品列表(渔家乐)
- })
- }
- }
- },
- shanchu(e, i) {
- //console.log('111111111111111111', e, i)
- this.lsdata = e;
- this.shanchushow = true;
- },
- quedingshanchu() {
- if (uni.getStorageSync('merchantType') == 4) {
- //(餐饮美食)
- let postdata = [this.lsdata.id];
- //status: this.fromData.status,
- console.log('postdata', postdata)
- this.$api.del('/api/merchant/food/delProduct', postdata).then(res => {
- this.$refs.uToast.show({
- type: 'success',
- title: '',
- message: "成功",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
- })
- this.quxiaoshanchu();
- this.getRepast(); //获取商品列表
- })
- } else {
- //(渔家乐)
- let postdata = [this.lsdata.id];
- //status: this.fromData.status,
- console.log('postdata', postdata)
- this.$api.del('/scenic/api/goods', postdata).then(res => {
- this.$refs.uToast.show({
- type: 'success',
- title: '',
- message: "成功",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
- })
- this.quxiaoshanchu();
- this.yujialedata(); //获取商品列表(渔家乐)
- })
- }
- },
- quxiaoshanchu() {
- // console.log('quxiaoxiajia',this.lsdata)
- this.lsdata = {};
- this.shanchushow = false;
- },
- gaijia(e, i) {
- console.log('111111111111111111', e, i)
- this.showPricing = true;
- this.lsdata = e;
- },
- closegaijia() {
- this.showPricing = false;
- this.newprice = '';
- this.lsdata = {};
- },
- quedingjiae() {
- if (uni.getStorageSync('merchantType') == 4) {
- //获取商品列表(餐饮美食)
- //console.log('111111111111111111', this.newprice)
- let postdata = {
- discountPrice: this.newprice,
- ids: [this.lsdata.id],
- status: this.fromData.status,
- };
- //console.log('postdata', postdata)
- this.$api.post('/api/merchant/food/updateDiscountPrice', postdata).then(res => {
- this.$refs.uToast.show({
- type: 'success',
- title: '',
- message: "成功",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
- })
- this.closegaijia();
- this.getRepast(); //获取商品列表
- })
- } else {
- //获取商品列表(渔家乐)
- if (this.lsdata.goodsType == 2) {
- let postdata = {
- normalPrice: this.newprice,
- id: this.lsdata.id,
- status: this.fromData.status,
- };
- console.log('postdata', postdata)
- this.$api.put('/scenic/api/goods', postdata).then(res => {
- this.$refs.uToast.show({
- type: 'success',
- title: '',
- message: "成功",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
- })
- this.closegaijia();
- this.yujialedata(); //获取商品列表(渔家乐)
- })
- } else {
- // let postdata = {
- // normalPrice: this.newprice,
- // id: this.lsdata.id,
- // status: this.fromData.status,
- // };
- // console.log('postdata', postdata)
- // this.$api.put('/scenic/goods', postdata).then(res => {
- // this.$refs.uToast.show({
- // type: 'success',
- // title: '',
- // message: "成功",
- // iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
- // })
- // this.closegaijia();
- // this.yujialedata(); //获取商品列表(渔家乐)
- // })
- }
- }
- },
- opengaijia() {},
- GetDateStr(AddCount) {
- var dd = new Date();
- dd.setDate(dd.getDate() + AddCount); //获取AddDayCount天后的日期
- var y = dd.getFullYear();
- var m = dd.getMonth() + 1; //获取当前月份的日期
- var d = dd.getDate();
- m = m > 9 ? m : "0" + m;
- d = d > 9 ? d : "0" + d;
- return y + "-" + m + "-" + d;
- },
- xiajia1(e, i) {
- if (e.goodsType==1&&this.GetDateStr(2) != e.playDate && !e.status) {
- return this.$showToast("日期已过期");
- }
- this.lsdata = e;
- this.xiajiashow1 = true;
- },
- xiajia(e, i) {
- console.log('111111111111111111', e, i)
- this.lsdata = e;
- this.xiajiashow = true;
- },
- quedingxiajia() {
- if (uni.getStorageSync('merchantType') == 4) {
- //获取商品列表(餐饮美食)
- let postdata = {
- discountPrice: this.lsdata.discountPrice,
- ids: [this.lsdata.id],
- status: this.fromData.status == 0 ? 1 : 0,
- };
- this.$api.post('/api/merchant/food/updateStatus', postdata).then(res => {
- this.$refs.uToast.show({
- type: 'success',
- title: '',
- message: "成功",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
- })
- this.quxiaoxiajia();
- this.getRepast(); //获取商品列表
- })
- } else {
- //获取商品列表(渔家乐)
- let postdata = {
- id: this.lsdata.id,
- status: this.fromData.status == 1 ? 0 : 1,
- };
- this.$api.put('/scenic/api/goods', postdata).then(res => {
- this.$refs.uToast.show({
- type: 'success',
- title: '',
- message: "成功",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
- })
- this.quxiaoxiajia();
- this.yujialedata();
- })
- }
- },
- quxiaoxiajia() {
- // console.log('quxiaoxiajia',this.lsdata)
- this.lsdata = {};
- this.xiajiashow = false;
- this.xiajiashow1 = false;
- },
- selectPerson(e, i) {
- if (this.selectedTags.includes(e)) {
- this.selectedTags = this.selectedTags.filter(t => t !== e);
- } else {
- this.selectedTags.push(e);
- }
- console.log(' this.selectedTags', this.selectedTags)
- },
- yujialedata() {
- this.$api.get('/scenic/api/goods/page', this.fromData).then(res => {
- this.roomType = res.data.data.list.filter(d => d.goodsType != 3);
- if(this.fromData.status===0){
- this.roomType = res.data.data.list.filter(d => d.goodsType == 2);
- }
- this.mytotal = res.data.data.total;
- })
- },
- getRepast() {
- this.$api.get('/api/merchant/food/product/page', this.fromData).then(res => {
- this.roomType = res.data.data.list;
- this.mytotal = res.data.data.total;
- })
- },
- // 区域筛选
- clickareaShow(e, i) {
- this.areaShowIndex = i;
- this.areaShow = false;
- this.areaval = e.name;
- // this.fromData.sortType = e.id;
- // this.fromData.page = 1;
- //this.getRepast();
- this.sortPrice(e)
- },
- sortPrice(item) {
- // if (item.val == 1) {
- // this.pricesort = 1
- // } else {
- // this.pricesort = 2
- // }
- //let val = this.pricesort;
- this.roomType.sort(function(a, b) {
- if (item.value == 1) { //降序
- return b[item.key] - a[item.key];
- } else {
- return a[item.key] - b[item.key]; // 升序
- }
- });
- },
- // 上架时间
- areaShowed() {
- console.log(123);
- this.areaShow = !this.areaShow
- },
- changeTab1(e, i) {
- this.roomType = [];
- this.selectedTags = [];
- this.current = i;
- this.fromData.status = e.id;
- this.fromData.page = 1;
- if (uni.getStorageSync('merchantType') == 4) {
- this.getRepast(); //获取商品列表(餐饮美食)
- } else {
- this.yujialedata(); //获取商品列表(渔家乐)
- }
- },
- // 批量显示
- showList() {
- this.Selected = !this.Selected
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .queding {
- width: 750rpx;
- height: 140rpx;
- display: flex;
- justify-content: space-around;
- align-items: center;
- .queding1 {
- width: 330rpx;
- height: 88rpx;
- background: #F0F2F5;
- border-radius: 44rpx;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 32rpx;
- color: #333333;
- line-height: 88rpx;
- text-align: center;
- font-style: normal;
- }
- .queding2 {
- width: 330rpx;
- height: 88rpx;
- background: #007A69;
- border-radius: 44rpx;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 32rpx;
- color: #FFFFFF;
- line-height: 88rpx;
- text-align: center;
- font-style: normal;
- }
- }
- .jiainput {
- width: 690rpx;
- height: 100rpx;
- margin: 0 auto;
- }
- .gaijiadiv {
- width: 750rpx;
- height: 950rpx;
- .toubu {
- width: 750rpx;
- height: 110rpx;
- font-family: PingFang-SC, PingFang-SC;
- font-weight: bold;
- font-size: 36rpx;
- color: #333333;
- line-height: 110rpx;
- text-align: center;
- font-style: normal;
- position: relative;
- .toubux {
- position: absolute;
- top: 33rpx;
- right: 30rpx;
- }
- }
- }
- .Doublactive {
- // background-color: #F0F7F6 !important;
- color: #007A69 !important;
- // border: 1px solid #007A69 !important;
- }
- .contented {
- width: 100%;
- padding: 0 24rpx;
- box-sizing: border-box;
- position: relative;
- }
- .custom_popup {
- width: 100%;
- height: 100%;
- background: rgba(0, 0, 0, .4);
- top: 0;
- left: 0;
- position: absolute;
- z-index: 999;
- .types {
- width: 100%;
- padding: 2rpx 30rpx;
- box-sizing: border-box;
- background: #FFFFFF;
- .pricequjian {
- width: 100%;
- min-height: 240rpx;
- .contentpeice {
- width: 100%;
- display: flex;
- justify-content: space-between;
- margin: 36rpx 0;
- .title {
- font-weight: Regular;
- font-size: 28rpx;
- color: #333333;
- }
- .image {
- width: 28rpx;
- height: 20rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- }
- }
- }
- }
- .pages {
- background: #F5F8FA;
- box-sizing: border-box;
- .tb {
- width: 100%;
- top: 0;
- left: 0;
- z-index: 999;
- .searchBoxParent {
- width: 100%;
- background: #fff;
- padding: 20rpx 24rpx 6rpx;
- box-sizing: border-box;
- .searchBox {
- width: 100%;
- background-color: #fff;
- }
- }
- .tabs {
- background: #fff;
- padding: 26rpx 0;
- display: flex;
- align-items: center;
- width: 100%;
- &>view {
- width: 25%;
- font-size: 28rpx;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: black;
- line-height: 40rpx;
- position: relative;
- text-align: center;
- }
- .active {
- font-size: 32rpx;
- font-family: PingFang-SC-Bold, PingFang-SC;
- font-weight: bold;
- color: black;
- line-height: 45rpx;
- }
- .active::after {
- position: absolute;
- content: '';
- width: 50rpx;
- height: 8rpx;
- background: #007A69;
- bottom: -26rpx;
- left: 60%;
- margin-left: -42rpx;
- }
- }
- }
- .green {}
- .mainContain {
- display: flex;
- flex-direction: column;
- padding: 0 20rpx;
- .nodata {
- background: white;
- }
- .card {
- background: #fff;
- border-radius: 16rpx;
- margin: 20rpx 0;
- padding: 20rpx;
- .header {
- display: flex;
- justify-content: space-between;
- border-bottom: 1px #f3f3f3 solid;
- padding: 20rpx;
- .red {
- color: indianred;
- }
- .green {
- color: #999999;
- }
- .blue {
- color: #1372FF;
- }
- .grey {
- color: #4C5F76;
- }
- .orange {
- color: #FF9100;
- }
- }
- .mainContent {
- // border-bottom: 1px #f3f3f3 solid;
- display: flex;
- padding: 20rpx 0;
- // justify-content: space-evenly;
- .image {
- background-repeat: no-repeat;
- background-size: cover;
- width: 198rpx;
- height: 180rpx;
- border-radius: 16rpx;
- }
- .middle {
- padding-top: 16rpx;
- color: #777777;
- // display: flex;
- // flex-direction: column;
- // justify-content: space-between;
- margin-left: 25rpx;
- width: 100%;
- .title {
- font-weight: 700;
- font-size: 32rpx;
- color: black;
- }
- .info {
- padding-top: 30rpx;
- color: #777777;
- // display: flex;
- // flex-direction: column;
- &>span {
- margin-top: 10rpx;
- }
- }
- }
- .price {
- color: red;
- text-align: center;
- height: 100%;
- align-items: center;
- align-self: center;
- font-size: 29rpx;
- font-weight: 700;
- }
- }
- .bottom {
- // padding: 30rpx 20rpx;
- display: flex;
- justify-content: flex-end;
- .detail {
- // border: 1rpx solid darkgrey;
- border-radius: 16rpx;
- color: darkgrey;
- padding: 13rpx 34rpx;
- background-color: #F6F6F6;
- font-size: 26rpx;
- color: #333333;
- font-weight: Regular;
- }
- .del {
- border-radius: 16rpx;
- color: darkgrey;
- padding: 13rpx 34rpx;
- background-color: #007A69;
- font-size: 26rpx;
- color: #fff;
- font-weight: Regular;
- }
- }
- }
- }
- }
- .u-input__content {
- margin-top: 22rpx !important;
- }
- .uicon-arrow-right,
- .uicon-close-circle-fill {
- margin-top: 32rpx !important;
- margin-right: 20rpx !important;
- }
- .pop-pop {
- height: 65vh;
- padding: 46rpx 20rpx 0;
- .hander-one {
- display: flex;
- justify-content: space-between;
- .text {
- font-size: 36rpx;
- color: #333333;
- font-weight: bold;
- }
- .del {}
- }
- .hander-two {
- display: flex;
- align-items: center;
- margin: 30rpx 0;
- .hander-two-text {
- font-size: 30rpx;
- color: #333333;
- font-weight: Regular;
- }
- .hander-two-image {
- display: flex;
- align-items: center;
- .image {
- margin: 0 10rpx;
- width: 30rpx;
- height: 30rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- }
- }
- .hander-three {
- display: flex;
- border: 1rpx solid #CCCCCC;
- border-radius: 16rpx;
- justify-content: space-between;
- height: 102rpx;
- line-height: 102rpx;
- .hander-three-text {
- width: 200rpx;
- text-align: left;
- display: flex;
- justify-content: space-between;
- margin: 0 20rpx;
- }
- .hander-three-input {
- width: 55%;
- }
- .hander-three-icon {
- height: 102rpx;
- line-height: 102rpx;
- }
- }
- .hander-four {
- margin-top: 30rpx;
- display: flex;
- border-radius: 16rpx;
- justify-content: space-between;
- border: 1rpx solid #CCCCCC;
- height: 102rpx;
- line-height: 102rpx;
- .hander-three-text {
- width: 200rpx;
- text-align: center;
- display: flex;
- justify-content: space-between;
- margin: 0 20rpx;
- }
- .hander-three-input {
- width: 55%;
- }
- .hander-three-icon {
- height: 102rpx;
- line-height: 102rpx;
- }
- }
- }
- .page {
- background: #F3F4F4;
- padding-bottom: 260rpx;
- box-sizing: border-box;
- overflow-y: auto;
- overflow-x: auto;
- }
- .typeNum {
- // width: 100%;
- height: 73rpx;
- display: flex;
- justify-content: space-between;
- padding: 23rpx 24rpx;
- align-items: center;
- .left {
- display: flex;
- align-items: center;
- .active {
- color: #007A69;
- }
- }
- .right {
- display: flex;
- align-items: center;
- .image {
- margin: 0 10rpx;
- width: 30rpx;
- height: 30rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .text {
- font-size: 28rpx;
- font-weight: Regular;
- color: #333333;
- }
- }
- }
- .type {
- margin: 0 auto;
- border-radius: 10rpx 10rpx 10rpx 10rpx;
- width: 86%;
- // height: 114rpx;
- background-color: #fff;
- padding: 30rpx;
- margin-bottom: 20rpx;
- display: flex;
- .left {
- height: 114rpx;
- line-height: 200rpx;
- margin-right: 20rpx;
- .image {
- margin: 0 10rpx;
- width: 30rpx;
- height: 30rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- }
- .right {
- width: 100%;
- display: flex;
- .right-left {
- width: 172rpx;
- height: 172rpx;
- border-radius: 16rpx;
- margin-right: 22rpx;
- position: relative;
- image {
- width: 100%;
- height: 100%;
- border-radius: 16rpx;
- }
- .rl_type {
- width: 80rpx;
- height: 34rpx;
- background: #FEB000;
- border-radius: 16rpx 0 18rpx 0;
- line-height: 34rpx;
- text-align: center;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 20rpx;
- color: #FFFFFF;
- position: absolute;
- left: 0;
- top: 0;
- }
- }
- .right-right {}
- }
- .type-btn {
- width: 100%;
- display: flex;
- justify-content: space-between;
- .type-btn-left {
- width: 50rpx;
- }
- .type-btn-right {
- display: flex;
- view {
- padding: 15rpx 23rpx;
- background-color: #F6F6F6;
- font-size: 24rpx;
- color: #333;
- font-weight: Regular;
- margin-right: 20rpx;
- border-radius: 50rpx;
- }
- }
- }
- }
- .top {
- display: flex;
- justify-content: space-between;
- }
- .under {
- margin-top: 20rpx;
- // display: flex;
- // justify-content: space-between;
- }
- .btn-btn {
- width: 100%;
- height: 136rpx;
- background-color: #fff;
- position: fixed;
- bottom: 0;
- padding: 30rpx 0 0;
- // margin: 0 auto;
- z-index: 9;
- // margin-top: 30rpx;
- // margin-left: 30rpx;
- .bottom-btn {
- display: flex;
- justify-content: space-between;
- margin: 0 24rpx;
- .left {
- width: 25%;
- display: flex;
- align-items: center;
- .image {
- width: 38rpx;
- height: 38rpx;
- margin: 0 10rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- }
- .right {
- width: 75%;
- display: flex;
- justify-content: flex-end;
- .right-btn {
- width: 148rpx;
- height: 80rpx;
- line-height: 80rpx;
- background-color: #007A69;
- border-radius: 16rpx;
- font-size: 26rpx;
- color: #fff;
- font-weight: Regular;
- text-align: center;
- }
- }
- }
- }
- .btn {
- margin: 0 auto;
- width: 690rpx;
- height: 96rpx;
- background-color: #1372FF;
- color: #fff;
- display: flex;
- justify-content: center;
- align-items: center;
- font-size: 34rpx;
- border-radius: 48rpx;
- }
- </style>
|