index.vue 34 KB

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