index.vue 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345
  1. <template>
  2. <view class="pages" :style="{'min-height':h+'px','padding-top':(mt)+'px'}">
  3. <c-nav-bar title="商品管理"></c-nav-bar>
  4. <view class="tb">
  5. <view class="tabs">
  6. <view v-for="(item,index) in tabList" :key="index" @tap="changeTab1(item,index)">
  7. <!-- <text :class="index==current?'active':''">{{item.name}}({{mytotal}})</text> -->
  8. <text :class="index==current?'active':''">{{item.name}}</text>
  9. </view>
  10. </view>
  11. </view>
  12. <!-- 房型数量 -->
  13. <view class="">
  14. <view class="typeNum">
  15. <view class="left" style="font-size: 24rpx; color: #777;" @click="areaShowed()">
  16. <text :class="areaShow==true?'active':''" style="margin-right: 20rpx;">上架时间</text>
  17. <u-icon name="arrow-down-fill" bold='true' v-if="areaShow==false" size="20" labelPos="left"
  18. labelSize="26"></u-icon>
  19. <u-icon name="arrow-up-fill" bold='true' v-else color="#007a68" labelColor='#007a68' size="20"
  20. labelPos="left" labelSize="26"></u-icon>
  21. </view>
  22. <view class="right" @click="showList">
  23. <view class="image">
  24. <image src="https://i.ringzle.com/file/20240313/f3d301b3bc4544ffaf5a0d96a761dd00.png" mode="">
  25. </image>
  26. </view>
  27. <view class="text">
  28. 批量操作
  29. </view>
  30. </view>
  31. </view>
  32. <!-- 区域筛选 -->
  33. <view class="contented" :style="{'height':(h-mt)+'px'}" v-show="areaShow">
  34. <view class="custom_popup">
  35. <view class="types">
  36. <view class="pricequjian" >
  37. <view class="jiage" v-for="(item, index) in list1" :key="index"
  38. @click="clickareaShow(item, index)">
  39. <view class="contentpeice">
  40. <view class="title" :class="{'Doublactive': areaShowIndex == index}">
  41. {{item.name}}
  42. </view>
  43. <view class="image" v-if="areaShowIndex == index">
  44. <image
  45. src="https://i.ringzle.com/file/20240316/16dd69efb40242de83da8207539ec73e.png"
  46. mode=""></image>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. <!-- 房型选择 -->
  56. <view class="type" v-for="(item,index) in roomType" :key="index">
  57. <view class="left" v-if="Selected==true">
  58. <view class="image">
  59. <image @tap="selectPerson(item,index)"
  60. :src="selectedTags.includes(item)?'https://i.ringzle.com/file/20240228/c741a340e19642c59473e6f4a6d2f4be.png':'https://i.ringzle.com/file/20231027/db588133d67548fc82dfb0d128eac9a8.png'">
  61. </image>
  62. </view>
  63. </view>
  64. <view style="width: 100%;">
  65. <view class="right">
  66. <view class="right-left">
  67. <image :src="item.coverImg" mode=""></image>
  68. </view>
  69. <view class="right-right">
  70. <view class="top">
  71. <text style="font-size: 30rpx; color: #333;">{{item.name||item.goodsName}}</text>
  72. </view>
  73. <view class="under">
  74. <!-- <view style="font-size: 24rpx; color: #777;">销量:{{item.salesVolume||item.soldNum||0}}</view> -->
  75. <view style="font-size: 24rpx; color: #777;">
  76. 销量:{{item.salesVolume!=null?item.salesVolume:item.soldNum}}</view>
  77. <view v-if='item.goodsType==1'
  78. style="font-size: 36rpx; color: #FF4141; font-weight: Bold; margin-top: 16rpx;">
  79. ¥{{item.discountPrice}}</view>
  80. <view v-else-if="item.goodsType==2"
  81. style="font-size: 36rpx; color: #FF4141; font-weight: Bold; margin-top: 16rpx;">
  82. ¥{{item.normalPrice}}</view>
  83. <view v-else-if="item.goodsType==3"
  84. style="font-size: 36rpx; color: #FF4141; font-weight: Bold; margin-top: 16rpx;">
  85. ¥{{item.avePrice}}</view>
  86. <view v-else
  87. style="font-size: 36rpx; color: #FF4141; font-weight: Bold; margin-top: 16rpx;">
  88. ¥{{item.discountPrice}}</view>
  89. </view>
  90. </view>
  91. </view>
  92. <view class="type-btn" v-if='!canyinmeishi'>
  93. <view class="type-btn-left">
  94. </view>
  95. <view class="type-btn-right">
  96. <view class="" @click="shanchu(item,index)">
  97. 删除
  98. </view>
  99. <view class="" @click="gaijia(item,index)" v-if='item.goodsType == 2'>
  100. 改价格
  101. </view>
  102. <view v-if="canyinmeishi" class="" @click="xiajia(item,index)">
  103. {{fromData.status==0?'下架':'上架'}}
  104. </view>
  105. <view v-if="!canyinmeishi" class="" @click="xiajia1(item,index)">
  106. {{fromData.status==0?'上架':'下架'}}
  107. </view>
  108. </view>
  109. </view>
  110. <view class="type-btn" v-if='canyinmeishi'>
  111. <view class="type-btn-left">
  112. </view>
  113. <view class="type-btn-right">
  114. <view class="" @click="shanchu(item,index)">
  115. 删除
  116. </view>
  117. <view class="" @click="gaijia(item,index)">
  118. 改价格
  119. </view>
  120. <view v-if="canyinmeishi" class="" @click="xiajia(item,index)">
  121. {{fromData.status==0?'下架':'上架'}}
  122. </view>
  123. <view v-if="!canyinmeishi" class="" @click="xiajia1(item,index)">
  124. {{fromData.status==0?'上架':'下架'}}
  125. </view>
  126. </view>
  127. </view>
  128. </view>
  129. </view>
  130. <!-- 批量按钮 -->
  131. <view class="btn-btn" v-if="Selected==true">
  132. <view class="bottom-btn">
  133. <view class="left">
  134. <view class="image">
  135. <image
  136. :src="selectedTags.length>0?'https://i.ringzle.com/file/20240228/c741a340e19642c59473e6f4a6d2f4be.png':'https://i.ringzle.com/file/20231027/db588133d67548fc82dfb0d128eac9a8.png'">
  137. </image>
  138. </view>
  139. <view class="text">
  140. 已选:{{selectedTags.length}}
  141. </view>
  142. </view>
  143. <view class="right">
  144. <view v-if="canyinmeishi" class="right-btn" @click="piliangxiajia">
  145. {{fromData.status==0?'批量下架':'批量上架'}}
  146. </view>
  147. <view v-if="!canyinmeishi" class="right-btn" @click="piliangxiajia">
  148. {{fromData.status==0?'批量上架':'批量下架'}}
  149. </view>
  150. <view class="right-btn" @click="piliangshanchu">
  151. 批量删除
  152. </view>
  153. </view>
  154. </view>
  155. </view>
  156. <!-- 改价弹出框 -->
  157. <u-popup :show="showPricing" @close="closegaijia" @open="opengaijia" :round="10">
  158. <view class="gaijiadiv">
  159. <view class="toubu">
  160. 改价格
  161. <view class="toubux" @click="closegaijia">
  162. <u-icon name="close" color="#000000" size="40"></u-icon>
  163. </view>
  164. </view>
  165. <view class="jiainput">
  166. <u--input type='number' v-model="newprice" placeholder="请输入价格" border="surround"
  167. clearable></u--input>
  168. </view>
  169. <view class="queding">
  170. <view class="queding1" @click="closegaijia">
  171. 取消
  172. </view>
  173. <view class="queding2" @click="quedingjiae">
  174. 确定
  175. </view>
  176. </view>
  177. </view>
  178. </u-popup>
  179. <!-- 下架弹出框 -->
  180. <u-modal :show="xiajiashow" :title="fromData.status==0?'下架选中的商品':'上架选中的商品'"
  181. :content="fromData.status==0?'下架后商品不可在前台继续售卖,是否继续?':'上架后商品可在前台售卖,是否继续?'" showConfirmButton='true'
  182. showCancelButton='true' @confirm='quedingxiajia' @cancel='quxiaoxiajia'></u-modal>
  183. <!-- 下架弹出框渔家乐 -->
  184. <u-modal :show="xiajiashow1" :title="fromData.status==1?'下架选中的商品':'上架选中的商品'"
  185. :content="fromData.status==1?'下架后商品不可在前台继续售卖,是否继续?':'上架后商品可在前台售卖,是否继续?'" showConfirmButton='true'
  186. showCancelButton='true' @confirm='quedingxiajia' @cancel='quxiaoxiajia'></u-modal>
  187. <!-- 删除弹出框 -->
  188. <u-modal :show="shanchushow" title="删除选中的商品" content='删除后的商品不可在前台继续售卖,是否继续?' showConfirmButton='true'
  189. showCancelButton='true' @confirm='quedingshanchu' @cancel='quxiaoshanchu'></u-modal>
  190. <view class="mainContain">
  191. <!-- <view class="nodata" v-if='dataList.length==0'>
  192. <NoData></NoData>
  193. </view> -->
  194. </view>
  195. <u-toast ref="uToast"></u-toast>
  196. </view>
  197. </template>
  198. <script>
  199. import TopTabs from '@/components/TopTabs/topTabs.vue';
  200. // import NoData from '../../components/NoData/index.vue';
  201. export default {
  202. components: {
  203. TopTabs,
  204. // NoData
  205. },
  206. data() {
  207. return {
  208. h: uni.getSystemInfoSync().windowHeight,
  209. mt: uni.getSystemInfoSync().statusBarHeight + 44,
  210. newprice: '',
  211. lsdata: {},
  212. current: 0,
  213. canyinmeishi: false,
  214. xiajiashow: false,
  215. xiajiashow1: false,
  216. shanchushow: false,
  217. tabList: [],
  218. homestayId: uni.getStorageSync('homestayId') || 0,
  219. roomType: [],
  220. selectedTags: [],
  221. mytotal: 0,
  222. isSelect: false,
  223. Selected: false,
  224. showPricing: false,
  225. areaShow: false,
  226. list1: [{
  227. name: '创建时间',
  228. id: 1,
  229. },
  230. {
  231. name: '价格从高到低',
  232. id: 2,
  233. },
  234. {
  235. name: '价格从低到高',
  236. id: 4,
  237. },
  238. {
  239. name: '销量从高到低',
  240. id: 2,
  241. },
  242. ],
  243. areaShowIndex: null,
  244. fromData: {
  245. merchantId: uni.getStorageSync('merchantId'), //商户id
  246. limit: 99999,
  247. page: 1,
  248. sortType: '', //选择条件:1创建时间 2销量从高到低 3价格从高到低 4价格从低到高
  249. status: 0, //状态:0上架1下架
  250. }
  251. }
  252. },
  253. onLoad(option) {
  254. console.log('111111111111111111', uni.getStorageSync('merchantType'))
  255. //this.getHousekeeping();
  256. if (uni.getStorageSync('merchantType') == 4) {
  257. this.canyinmeishi = true;
  258. this.tabList = [{
  259. name: '出售中',
  260. id: 0
  261. },
  262. {
  263. name: '待上架',
  264. id: 1
  265. },
  266. ]
  267. this.getRepast(); //获取商品列表(餐饮美食)
  268. } else {
  269. this.canyinmeishi = false;
  270. this.tabList = [{
  271. name: '出售中',
  272. id: 1
  273. },
  274. {
  275. name: '待上架',
  276. id: 0
  277. },
  278. ]
  279. this.fromData = {
  280. merchantId: uni.getStorageSync('merchantId'), //商户id
  281. limit: 99999,
  282. page: 1,
  283. sortType: '', //选择条件:1创建时间 2销量从高到低 3价格从高到低 4价格从低到高
  284. status: 1, //状态:0上架1下架
  285. }
  286. this.yujialedata(); //获取商品列表(渔家乐)
  287. }
  288. },
  289. methods: {
  290. getHousekeeping() {
  291. this.$api.get('/sys/dict/type/all').then(res => {
  292. let alldata = res.data.data.find((p) => p.dictType == 'food_type').dataList;
  293. console.log('alldata', alldata)
  294. // this.categoryMain = alldata.map((item, index, arr) => {
  295. // let json = {};
  296. // json.name = item.dictLabel;
  297. // json.type = item.dictValue;
  298. // json.icon =
  299. // 'https://i.ringzle.com/file/20231125/a314703e463d43c7808714d1b29632ad.png';
  300. // return json
  301. // })
  302. })
  303. },
  304. piliangxiajia() {
  305. if (uni.getStorageSync('merchantType') == 4) {
  306. if (this.selectedTags.length == 0) {
  307. this.$refs.uToast.show({
  308. type: 'success',
  309. title: '',
  310. message: "请选择数据",
  311. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
  312. })
  313. } else {
  314. let namesArray = this.selectedTags.map(obj => obj.id);
  315. let postdata = {
  316. discountPrice: 0,
  317. ids: namesArray,
  318. status: this.fromData.status == 0 ? 1 : 0,
  319. };
  320. this.$api.post('/api/merchant/food/updateStatus', postdata).then(res => {
  321. this.$refs.uToast.show({
  322. type: 'success',
  323. title: '',
  324. message: "成功",
  325. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
  326. })
  327. this.selectedTags = [];
  328. this.Selected = false;
  329. this.getRepast(); //获取商品列表
  330. })
  331. }
  332. } else {
  333. if (this.selectedTags.length == 0) {
  334. this.$refs.uToast.show({
  335. type: 'success',
  336. title: '',
  337. message: "请选择数据",
  338. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
  339. })
  340. } else {
  341. let postdata = this.selectedTags.map((item, index, arr) => {
  342. let json = {};
  343. json.id = item.id;
  344. json.merchantId = uni.getStorageSync('merchantId');
  345. json.status = item.status == 0 ? 1 : 0;
  346. return json
  347. })
  348. // let namesArray = this.selectedTags.map(obj => obj.id);
  349. // let postdata = {
  350. // id: namesArray,
  351. // status: this.fromData.status,
  352. // };
  353. this.$api.post('/scenic/goods/batchUpDownFrame', postdata).then(res => {
  354. this.$refs.uToast.show({
  355. type: 'success',
  356. title: '',
  357. message: "成功",
  358. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
  359. })
  360. this.selectedTags = [];
  361. this.Selected = false;
  362. this.yujialedata(); //获取商品列表(渔家乐)
  363. })
  364. }
  365. }
  366. },
  367. piliangshanchu() {
  368. if (uni.getStorageSync('merchantType') == 4) {
  369. if (this.selectedTags.length == 0) {
  370. this.$refs.uToast.show({
  371. type: 'success',
  372. title: '',
  373. message: "请选择数据",
  374. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
  375. })
  376. } else {
  377. let namesArray = this.selectedTags.map(obj => obj.id);
  378. //status: this.fromData.status,
  379. this.$api.del('/api/merchant/food/delProduct', namesArray).then(res => {
  380. this.$refs.uToast.show({
  381. type: 'success',
  382. title: '',
  383. message: "成功",
  384. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
  385. })
  386. this.selectedTags = [];
  387. this.Selected = false;
  388. this.getRepast(); //获取商品列表
  389. })
  390. }
  391. } else {
  392. if (this.selectedTags.length == 0) {
  393. this.$refs.uToast.show({
  394. type: 'success',
  395. title: '',
  396. message: "请选择数据",
  397. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
  398. })
  399. } else {
  400. let namesArray = this.selectedTags.map(obj => obj.id);
  401. console.log('111111111111111111', namesArray)
  402. //status: this.fromData.status,
  403. this.$api.del('/scenic/goods', namesArray).then(res => {
  404. this.$refs.uToast.show({
  405. type: 'success',
  406. title: '',
  407. message: "成功",
  408. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
  409. })
  410. this.selectedTags = [];
  411. this.Selected = false;
  412. this.yujialedata(); //获取商品列表(渔家乐)
  413. })
  414. }
  415. }
  416. },
  417. shanchu(e, i) {
  418. //console.log('111111111111111111', e, i)
  419. this.lsdata = e;
  420. this.shanchushow = true;
  421. },
  422. quedingshanchu() {
  423. if (uni.getStorageSync('merchantType') == 4) {
  424. //(餐饮美食)
  425. let postdata = [this.lsdata.id];
  426. //status: this.fromData.status,
  427. console.log('postdata', postdata)
  428. this.$api.del('/api/merchant/food/delProduct', postdata).then(res => {
  429. this.$refs.uToast.show({
  430. type: 'success',
  431. title: '',
  432. message: "成功",
  433. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
  434. })
  435. this.quxiaoshanchu();
  436. this.getRepast(); //获取商品列表
  437. })
  438. } else {
  439. //(渔家乐)
  440. let postdata = [this.lsdata.id];
  441. //status: this.fromData.status,
  442. console.log('postdata', postdata)
  443. this.$api.del('/scenic/goods', postdata).then(res => {
  444. this.$refs.uToast.show({
  445. type: 'success',
  446. title: '',
  447. message: "成功",
  448. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
  449. })
  450. this.quxiaoshanchu();
  451. this.yujialedata(); //获取商品列表(渔家乐)
  452. })
  453. }
  454. },
  455. quxiaoshanchu() {
  456. // console.log('quxiaoxiajia',this.lsdata)
  457. this.lsdata = {};
  458. this.shanchushow = false;
  459. },
  460. gaijia(e, i) {
  461. console.log('111111111111111111', e, i)
  462. this.showPricing = true;
  463. this.lsdata = e;
  464. },
  465. closegaijia() {
  466. this.showPricing = false;
  467. this.newprice = '';
  468. this.lsdata = {};
  469. },
  470. quedingjiae() {
  471. if (uni.getStorageSync('merchantType') == 4) {
  472. //获取商品列表(餐饮美食)
  473. //console.log('111111111111111111', this.newprice)
  474. let postdata = {
  475. discountPrice: this.newprice,
  476. ids: [this.lsdata.id],
  477. status: this.fromData.status,
  478. };
  479. //console.log('postdata', postdata)
  480. this.$api.post('/api/merchant/food/updateDiscountPrice', postdata).then(res => {
  481. this.$refs.uToast.show({
  482. type: 'success',
  483. title: '',
  484. message: "成功",
  485. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
  486. })
  487. this.closegaijia();
  488. this.getRepast(); //获取商品列表
  489. })
  490. } else {
  491. //获取商品列表(渔家乐)
  492. if (this.lsdata.goodsType == 2) {
  493. let postdata = {
  494. normalPrice: this.newprice,
  495. id: this.lsdata.id,
  496. status: this.fromData.status,
  497. };
  498. console.log('postdata', postdata)
  499. this.$api.put('/scenic/goods', postdata).then(res => {
  500. this.$refs.uToast.show({
  501. type: 'success',
  502. title: '',
  503. message: "成功",
  504. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
  505. })
  506. this.closegaijia();
  507. this.yujialedata(); //获取商品列表(渔家乐)
  508. })
  509. } else {
  510. // let postdata = {
  511. // normalPrice: this.newprice,
  512. // id: this.lsdata.id,
  513. // status: this.fromData.status,
  514. // };
  515. // console.log('postdata', postdata)
  516. // this.$api.put('/scenic/goods', postdata).then(res => {
  517. // this.$refs.uToast.show({
  518. // type: 'success',
  519. // title: '',
  520. // message: "成功",
  521. // iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
  522. // })
  523. // this.closegaijia();
  524. // this.yujialedata(); //获取商品列表(渔家乐)
  525. // })
  526. }
  527. }
  528. },
  529. opengaijia() {},
  530. xiajia1(e, i) {
  531. console.log('111111111111111111', e, i)
  532. this.lsdata = e;
  533. this.xiajiashow1 = true;
  534. },
  535. xiajia(e, i) {
  536. console.log('111111111111111111', e, i)
  537. this.lsdata = e;
  538. this.xiajiashow = true;
  539. },
  540. quedingxiajia() {
  541. if (uni.getStorageSync('merchantType') == 4) {
  542. //获取商品列表(餐饮美食)
  543. let postdata = {
  544. discountPrice: this.lsdata.discountPrice,
  545. ids: [this.lsdata.id],
  546. status: this.fromData.status == 0 ? 1 : 0,
  547. };
  548. this.$api.post('/api/merchant/food/updateStatus', postdata).then(res => {
  549. this.$refs.uToast.show({
  550. type: 'success',
  551. title: '',
  552. message: "成功",
  553. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
  554. })
  555. this.quxiaoxiajia();
  556. this.getRepast(); //获取商品列表
  557. })
  558. } else {
  559. //获取商品列表(渔家乐)
  560. let postdata = {
  561. id: this.lsdata.id,
  562. status: this.fromData.status == 1 ? 0 : 1,
  563. };
  564. this.$api.put('/scenic/goods', postdata).then(res => {
  565. this.$refs.uToast.show({
  566. type: 'success',
  567. title: '',
  568. message: "成功",
  569. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
  570. })
  571. this.quxiaoxiajia();
  572. this.yujialedata();
  573. })
  574. }
  575. },
  576. quxiaoxiajia() {
  577. // console.log('quxiaoxiajia',this.lsdata)
  578. this.lsdata = {};
  579. this.xiajiashow = false;
  580. this.xiajiashow1 = false;
  581. },
  582. selectPerson(e, i) {
  583. if (this.selectedTags.includes(e)) {
  584. this.selectedTags = this.selectedTags.filter(t => t !== e);
  585. } else {
  586. this.selectedTags.push(e);
  587. }
  588. console.log(' this.selectedTags', this.selectedTags)
  589. },
  590. yujialedata() {
  591. this.$api.get('/scenic/goods/page', this.fromData).then(res => {
  592. console.log(res.data.data.list);
  593. this.roomType = res.data.data.list;
  594. this.mytotal = res.data.data.total;
  595. })
  596. },
  597. getRepast() {
  598. this.$api.get('/api/merchant/food/product/page', this.fromData).then(res => {
  599. console.log(res.data.data.list);
  600. this.roomType = res.data.data.list;
  601. this.mytotal = res.data.data.total;
  602. })
  603. },
  604. // 区域筛选
  605. clickareaShow(e, i) {
  606. this.areaShowIndex = i;
  607. this.areaShow = false;
  608. this.fromData.sortType = e.id;
  609. this.fromData.page = 1;
  610. this.getRepast();
  611. },
  612. // 上架时间
  613. areaShowed() {
  614. console.log(123);
  615. this.areaShow = !this.areaShow
  616. },
  617. changeTab1(e, i) {
  618. this.roomType = [];
  619. this.selectedTags = [];
  620. this.current = i;
  621. this.fromData.status = e.id;
  622. this.fromData.page = 1;
  623. if (uni.getStorageSync('merchantType') == 4) {
  624. this.getRepast(); //获取商品列表(餐饮美食)
  625. } else {
  626. this.yujialedata(); //获取商品列表(渔家乐)
  627. }
  628. },
  629. // 批量显示
  630. showList() {
  631. this.Selected = !this.Selected
  632. },
  633. }
  634. }
  635. </script>
  636. <style lang="scss" scoped>
  637. .queding {
  638. width: 750rpx;
  639. height: 140rpx;
  640. display: flex;
  641. justify-content: space-around;
  642. align-items: center;
  643. .queding1 {
  644. width: 330rpx;
  645. height: 88rpx;
  646. background: #F0F2F5;
  647. border-radius: 44rpx;
  648. font-family: PingFangSC, PingFang SC;
  649. font-weight: 400;
  650. font-size: 32rpx;
  651. color: #333333;
  652. line-height: 88rpx;
  653. text-align: center;
  654. font-style: normal;
  655. }
  656. .queding2 {
  657. width: 330rpx;
  658. height: 88rpx;
  659. background: #007A69;
  660. border-radius: 44rpx;
  661. font-family: PingFangSC, PingFang SC;
  662. font-weight: 400;
  663. font-size: 32rpx;
  664. color: #FFFFFF;
  665. line-height: 88rpx;
  666. text-align: center;
  667. font-style: normal;
  668. }
  669. }
  670. .jiainput {
  671. width: 690rpx;
  672. height: 100rpx;
  673. margin: 0 auto;
  674. }
  675. .gaijiadiv {
  676. width: 750rpx;
  677. height: 950rpx;
  678. .toubu {
  679. width: 750rpx;
  680. height: 110rpx;
  681. font-family: PingFang-SC, PingFang-SC;
  682. font-weight: bold;
  683. font-size: 36rpx;
  684. color: #333333;
  685. line-height: 110rpx;
  686. text-align: center;
  687. font-style: normal;
  688. position: relative;
  689. .toubux {
  690. position: absolute;
  691. top: 33rpx;
  692. right: 30rpx;
  693. }
  694. }
  695. }
  696. .Doublactive {
  697. // background-color: #F0F7F6 !important;
  698. color: #007A69 !important;
  699. // border: 1px solid #007A69 !important;
  700. }
  701. .contented {
  702. width: 100%;
  703. padding: 0 24rpx;
  704. box-sizing: border-box;
  705. position: relative;
  706. }
  707. .custom_popup {
  708. width: 100%;
  709. height: 100%;
  710. background: rgba(0, 0, 0, .4);
  711. top: 0;
  712. left: 0;
  713. position: absolute;
  714. z-index: 999;
  715. .types {
  716. width: 100%;
  717. padding: 20rpx 30rpx;
  718. box-sizing: border-box;
  719. background: #FFFFFF;
  720. .pricequjian {
  721. width: 100%;
  722. min-height: 240rpx;
  723. .contentpeice {
  724. width: 100%;
  725. display: flex;
  726. justify-content: space-between;
  727. margin: 30rpx 0;
  728. .title {
  729. font-weight: Regular;
  730. font-size: 28rpx;
  731. color: #333333;
  732. }
  733. .image {
  734. width: 28rpx;
  735. height: 20rpx;
  736. image {
  737. width: 100%;
  738. height: 100%;
  739. }
  740. }
  741. }
  742. }
  743. }
  744. }
  745. .pages {
  746. background: #F5F8FA;
  747. box-sizing: border-box;
  748. .tb {
  749. width: 100%;
  750. top: 0;
  751. left: 0;
  752. z-index: 999;
  753. .searchBoxParent {
  754. width: 100%;
  755. background: #fff;
  756. padding: 20rpx 24rpx 6rpx;
  757. box-sizing: border-box;
  758. .searchBox {
  759. width: 100%;
  760. background-color: #fff;
  761. }
  762. }
  763. .tabs {
  764. background: #fff;
  765. padding: 26rpx 0;
  766. display: flex;
  767. align-items: center;
  768. width: 100%;
  769. &>view {
  770. width: 25%;
  771. font-size: 28rpx;
  772. font-family: PingFangSC-Regular, PingFang SC;
  773. font-weight: 400;
  774. color: black;
  775. line-height: 40rpx;
  776. position: relative;
  777. text-align: center;
  778. }
  779. .active {
  780. font-size: 32rpx;
  781. font-family: PingFang-SC-Bold, PingFang-SC;
  782. font-weight: bold;
  783. color: black;
  784. line-height: 45rpx;
  785. }
  786. .active::after {
  787. position: absolute;
  788. content: '';
  789. width: 50rpx;
  790. height: 8rpx;
  791. background: #007A69;
  792. bottom: -26rpx;
  793. left: 60%;
  794. margin-left: -42rpx;
  795. }
  796. }
  797. }
  798. .green {}
  799. .mainContain {
  800. display: flex;
  801. flex-direction: column;
  802. padding: 0 20rpx;
  803. .nodata {
  804. background: white;
  805. }
  806. .card {
  807. background: #fff;
  808. border-radius: 16rpx;
  809. margin: 20rpx 0;
  810. padding: 20rpx;
  811. .header {
  812. display: flex;
  813. justify-content: space-between;
  814. border-bottom: 1px #f3f3f3 solid;
  815. padding: 20rpx;
  816. .red {
  817. color: indianred;
  818. }
  819. .green {
  820. color: #999999;
  821. }
  822. .blue {
  823. color: #1372FF;
  824. }
  825. .grey {
  826. color: #4C5F76;
  827. }
  828. .orange {
  829. color: #FF9100;
  830. }
  831. }
  832. .mainContent {
  833. // border-bottom: 1px #f3f3f3 solid;
  834. display: flex;
  835. padding: 20rpx 0;
  836. // justify-content: space-evenly;
  837. .image {
  838. background-repeat: no-repeat;
  839. background-size: cover;
  840. width: 198rpx;
  841. height: 180rpx;
  842. border-radius: 16rpx;
  843. }
  844. .middle {
  845. padding-top: 16rpx;
  846. color: #777777;
  847. // display: flex;
  848. // flex-direction: column;
  849. // justify-content: space-between;
  850. margin-left: 25rpx;
  851. width: 100%;
  852. .title {
  853. font-weight: 700;
  854. font-size: 32rpx;
  855. color: black;
  856. }
  857. .info {
  858. padding-top: 30rpx;
  859. color: #777777;
  860. // display: flex;
  861. // flex-direction: column;
  862. &>span {
  863. margin-top: 10rpx;
  864. }
  865. }
  866. }
  867. .price {
  868. color: red;
  869. text-align: center;
  870. height: 100%;
  871. align-items: center;
  872. align-self: center;
  873. font-size: 29rpx;
  874. font-weight: 700;
  875. }
  876. }
  877. .bottom {
  878. // padding: 30rpx 20rpx;
  879. display: flex;
  880. justify-content: flex-end;
  881. .detail {
  882. // border: 1rpx solid darkgrey;
  883. border-radius: 16rpx;
  884. color: darkgrey;
  885. padding: 13rpx 34rpx;
  886. background-color: #F6F6F6;
  887. font-size: 26rpx;
  888. color: #333333;
  889. font-weight: Regular;
  890. }
  891. .del {
  892. border-radius: 16rpx;
  893. color: darkgrey;
  894. padding: 13rpx 34rpx;
  895. background-color: #007A69;
  896. font-size: 26rpx;
  897. color: #fff;
  898. font-weight: Regular;
  899. }
  900. }
  901. }
  902. }
  903. }
  904. .u-input__content {
  905. margin-top: 22rpx !important;
  906. }
  907. .uicon-arrow-right,
  908. .uicon-close-circle-fill {
  909. margin-top: 32rpx !important;
  910. margin-right: 20rpx !important;
  911. }
  912. .pop-pop {
  913. height: 65vh;
  914. padding: 46rpx 20rpx 0;
  915. .hander-one {
  916. display: flex;
  917. justify-content: space-between;
  918. .text {
  919. font-size: 36rpx;
  920. color: #333333;
  921. font-weight: bold;
  922. }
  923. .del {}
  924. }
  925. .hander-two {
  926. display: flex;
  927. align-items: center;
  928. margin: 30rpx 0;
  929. .hander-two-text {
  930. font-size: 30rpx;
  931. color: #333333;
  932. font-weight: Regular;
  933. }
  934. .hander-two-image {
  935. display: flex;
  936. align-items: center;
  937. .image {
  938. margin: 0 10rpx;
  939. width: 30rpx;
  940. height: 30rpx;
  941. image {
  942. width: 100%;
  943. height: 100%;
  944. }
  945. }
  946. }
  947. }
  948. .hander-three {
  949. display: flex;
  950. border: 1rpx solid #CCCCCC;
  951. border-radius: 16rpx;
  952. justify-content: space-between;
  953. height: 102rpx;
  954. line-height: 102rpx;
  955. .hander-three-text {
  956. width: 200rpx;
  957. text-align: left;
  958. display: flex;
  959. justify-content: space-between;
  960. margin: 0 20rpx;
  961. }
  962. .hander-three-input {
  963. width: 55%;
  964. }
  965. .hander-three-icon {
  966. height: 102rpx;
  967. line-height: 102rpx;
  968. }
  969. }
  970. .hander-four {
  971. margin-top: 30rpx;
  972. display: flex;
  973. border-radius: 16rpx;
  974. justify-content: space-between;
  975. border: 1rpx solid #CCCCCC;
  976. height: 102rpx;
  977. line-height: 102rpx;
  978. .hander-three-text {
  979. width: 200rpx;
  980. text-align: center;
  981. display: flex;
  982. justify-content: space-between;
  983. margin: 0 20rpx;
  984. }
  985. .hander-three-input {
  986. width: 55%;
  987. }
  988. .hander-three-icon {
  989. height: 102rpx;
  990. line-height: 102rpx;
  991. }
  992. }
  993. }
  994. .page {
  995. background: #F3F4F4;
  996. padding-bottom: 260rpx;
  997. box-sizing: border-box;
  998. overflow-y: auto;
  999. overflow-x: auto;
  1000. }
  1001. .typeNum {
  1002. // width: 100%;
  1003. height: 73rpx;
  1004. display: flex;
  1005. justify-content: space-between;
  1006. padding: 23rpx 24rpx;
  1007. align-items: center;
  1008. .left {
  1009. display: flex;
  1010. align-items: center;
  1011. .active {
  1012. color: #007A69;
  1013. }
  1014. }
  1015. .right {
  1016. display: flex;
  1017. align-items: center;
  1018. .image {
  1019. margin: 0 10rpx;
  1020. width: 30rpx;
  1021. height: 30rpx;
  1022. image {
  1023. width: 100%;
  1024. height: 100%;
  1025. }
  1026. }
  1027. .text {
  1028. font-size: 28rpx;
  1029. font-weight: Regular;
  1030. color: #333333;
  1031. }
  1032. }
  1033. }
  1034. .type {
  1035. margin: 0 auto;
  1036. border-radius: 10rpx 10rpx 10rpx 10rpx;
  1037. width: 86%;
  1038. // height: 114rpx;
  1039. background-color: #fff;
  1040. padding: 30rpx;
  1041. margin-bottom: 20rpx;
  1042. display: flex;
  1043. .left {
  1044. height: 114rpx;
  1045. line-height: 200rpx;
  1046. margin-right: 20rpx;
  1047. .image {
  1048. margin: 0 10rpx;
  1049. width: 30rpx;
  1050. height: 30rpx;
  1051. image {
  1052. width: 100%;
  1053. height: 100%;
  1054. }
  1055. }
  1056. }
  1057. .right {
  1058. width: 100%;
  1059. display: flex;
  1060. .right-left {
  1061. width: 172rpx;
  1062. height: 172rpx;
  1063. border-radius: 16rpx;
  1064. margin-right: 22rpx;
  1065. image {
  1066. width: 100%;
  1067. height: 100%;
  1068. border-radius: 16rpx;
  1069. }
  1070. }
  1071. .right-right {}
  1072. }
  1073. .type-btn {
  1074. width: 100%;
  1075. display: flex;
  1076. justify-content: space-between;
  1077. .type-btn-left {
  1078. width: 50rpx;
  1079. }
  1080. .type-btn-right {
  1081. display: flex;
  1082. view {
  1083. padding: 15rpx 23rpx;
  1084. background-color: #F6F6F6;
  1085. font-size: 24rpx;
  1086. color: #333;
  1087. font-weight: Regular;
  1088. margin-right: 20rpx;
  1089. border-radius: 50rpx;
  1090. }
  1091. }
  1092. }
  1093. }
  1094. .top {
  1095. display: flex;
  1096. justify-content: space-between;
  1097. }
  1098. .under {
  1099. margin-top: 20rpx;
  1100. // display: flex;
  1101. // justify-content: space-between;
  1102. }
  1103. .btn-btn {
  1104. width: 100%;
  1105. height: 136rpx;
  1106. background-color: #fff;
  1107. position: fixed;
  1108. bottom: 0;
  1109. padding: 30rpx 0 0;
  1110. // margin: 0 auto;
  1111. z-index: 9;
  1112. // margin-top: 30rpx;
  1113. // margin-left: 30rpx;
  1114. .bottom-btn {
  1115. display: flex;
  1116. justify-content: space-between;
  1117. margin: 0 24rpx;
  1118. .left {
  1119. width: 25%;
  1120. display: flex;
  1121. align-items: center;
  1122. .image {
  1123. width: 38rpx;
  1124. height: 38rpx;
  1125. margin: 0 10rpx;
  1126. image {
  1127. width: 100%;
  1128. height: 100%;
  1129. }
  1130. }
  1131. }
  1132. .right {
  1133. width: 75%;
  1134. display: flex;
  1135. justify-content: space-evenly;
  1136. .right-btn {
  1137. width: 148rpx;
  1138. height: 80rpx;
  1139. line-height: 80rpx;
  1140. background-color: #1372FF;
  1141. border-radius: 16rpx;
  1142. font-size: 26rpx;
  1143. color: #fff;
  1144. font-weight: Regular;
  1145. text-align: center;
  1146. }
  1147. }
  1148. }
  1149. }
  1150. .btn {
  1151. margin: 0 auto;
  1152. width: 690rpx;
  1153. height: 96rpx;
  1154. background-color: #1372FF;
  1155. color: #fff;
  1156. display: flex;
  1157. justify-content: center;
  1158. align-items: center;
  1159. font-size: 34rpx;
  1160. border-radius: 48rpx;
  1161. }
  1162. </style>