index.vue 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461
  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. if (e.goodsType==1&&this.GetDateStr(2) != e.playDate && !e.status) {
  611. return this.$showToast("日期已过期");
  612. }
  613. this.lsdata = e;
  614. this.xiajiashow1 = true;
  615. },
  616. xiajia(e, i) {
  617. console.log('111111111111111111', e, i)
  618. this.lsdata = e;
  619. this.xiajiashow = true;
  620. },
  621. quedingxiajia() {
  622. if (uni.getStorageSync('merchantType') == 4) {
  623. //获取商品列表(餐饮美食)
  624. let postdata = {
  625. discountPrice: this.lsdata.discountPrice,
  626. ids: [this.lsdata.id],
  627. status: this.fromData.status == 0 ? 1 : 0,
  628. };
  629. this.$api.post('/api/merchant/food/updateStatus', postdata).then(res => {
  630. this.$refs.uToast.show({
  631. type: 'success',
  632. title: '',
  633. message: "成功",
  634. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
  635. })
  636. this.quxiaoxiajia();
  637. this.getRepast(); //获取商品列表
  638. })
  639. } else {
  640. //获取商品列表(渔家乐)
  641. let postdata = {
  642. id: this.lsdata.id,
  643. status: this.fromData.status == 1 ? 0 : 1,
  644. };
  645. this.$api.put('/scenic/api/goods', postdata).then(res => {
  646. this.$refs.uToast.show({
  647. type: 'success',
  648. title: '',
  649. message: "成功",
  650. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
  651. })
  652. this.quxiaoxiajia();
  653. this.yujialedata();
  654. })
  655. }
  656. },
  657. quxiaoxiajia() {
  658. // console.log('quxiaoxiajia',this.lsdata)
  659. this.lsdata = {};
  660. this.xiajiashow = false;
  661. this.xiajiashow1 = false;
  662. },
  663. selectPerson(e, i) {
  664. if (this.selectedTags.includes(e)) {
  665. this.selectedTags = this.selectedTags.filter(t => t !== e);
  666. } else {
  667. this.selectedTags.push(e);
  668. }
  669. console.log(' this.selectedTags', this.selectedTags)
  670. },
  671. yujialedata() {
  672. this.$api.get('/scenic/api/goods/page', this.fromData).then(res => {
  673. this.roomType = res.data.data.list.filter(d => d.goodsType != 3);
  674. if(this.fromData.status===0){
  675. this.roomType = res.data.data.list.filter(d => d.goodsType == 2);
  676. }
  677. this.mytotal = res.data.data.total;
  678. })
  679. },
  680. getRepast() {
  681. this.$api.get('/api/merchant/food/product/page', this.fromData).then(res => {
  682. this.roomType = res.data.data.list;
  683. this.mytotal = res.data.data.total;
  684. })
  685. },
  686. // 区域筛选
  687. clickareaShow(e, i) {
  688. this.areaShowIndex = i;
  689. this.areaShow = false;
  690. this.areaval = e.name;
  691. // this.fromData.sortType = e.id;
  692. // this.fromData.page = 1;
  693. //this.getRepast();
  694. this.sortPrice(e)
  695. },
  696. sortPrice(item) {
  697. // if (item.val == 1) {
  698. // this.pricesort = 1
  699. // } else {
  700. // this.pricesort = 2
  701. // }
  702. //let val = this.pricesort;
  703. this.roomType.sort(function(a, b) {
  704. if (item.value == 1) { //降序
  705. return b[item.key] - a[item.key];
  706. } else {
  707. return a[item.key] - b[item.key]; // 升序
  708. }
  709. });
  710. },
  711. // 上架时间
  712. areaShowed() {
  713. console.log(123);
  714. this.areaShow = !this.areaShow
  715. },
  716. changeTab1(e, i) {
  717. this.roomType = [];
  718. this.selectedTags = [];
  719. this.current = i;
  720. this.fromData.status = e.id;
  721. this.fromData.page = 1;
  722. if (uni.getStorageSync('merchantType') == 4) {
  723. this.getRepast(); //获取商品列表(餐饮美食)
  724. } else {
  725. this.yujialedata(); //获取商品列表(渔家乐)
  726. }
  727. },
  728. // 批量显示
  729. showList() {
  730. this.Selected = !this.Selected
  731. },
  732. }
  733. }
  734. </script>
  735. <style lang="scss" scoped>
  736. .queding {
  737. width: 750rpx;
  738. height: 140rpx;
  739. display: flex;
  740. justify-content: space-around;
  741. align-items: center;
  742. .queding1 {
  743. width: 330rpx;
  744. height: 88rpx;
  745. background: #F0F2F5;
  746. border-radius: 44rpx;
  747. font-family: PingFangSC, PingFang SC;
  748. font-weight: 400;
  749. font-size: 32rpx;
  750. color: #333333;
  751. line-height: 88rpx;
  752. text-align: center;
  753. font-style: normal;
  754. }
  755. .queding2 {
  756. width: 330rpx;
  757. height: 88rpx;
  758. background: #007A69;
  759. border-radius: 44rpx;
  760. font-family: PingFangSC, PingFang SC;
  761. font-weight: 400;
  762. font-size: 32rpx;
  763. color: #FFFFFF;
  764. line-height: 88rpx;
  765. text-align: center;
  766. font-style: normal;
  767. }
  768. }
  769. .jiainput {
  770. width: 690rpx;
  771. height: 100rpx;
  772. margin: 0 auto;
  773. }
  774. .gaijiadiv {
  775. width: 750rpx;
  776. height: 950rpx;
  777. .toubu {
  778. width: 750rpx;
  779. height: 110rpx;
  780. font-family: PingFang-SC, PingFang-SC;
  781. font-weight: bold;
  782. font-size: 36rpx;
  783. color: #333333;
  784. line-height: 110rpx;
  785. text-align: center;
  786. font-style: normal;
  787. position: relative;
  788. .toubux {
  789. position: absolute;
  790. top: 33rpx;
  791. right: 30rpx;
  792. }
  793. }
  794. }
  795. .Doublactive {
  796. // background-color: #F0F7F6 !important;
  797. color: #007A69 !important;
  798. // border: 1px solid #007A69 !important;
  799. }
  800. .contented {
  801. width: 100%;
  802. padding: 0 24rpx;
  803. box-sizing: border-box;
  804. position: relative;
  805. }
  806. .custom_popup {
  807. width: 100%;
  808. height: 100%;
  809. background: rgba(0, 0, 0, .4);
  810. top: 0;
  811. left: 0;
  812. position: absolute;
  813. z-index: 999;
  814. .types {
  815. width: 100%;
  816. padding: 2rpx 30rpx;
  817. box-sizing: border-box;
  818. background: #FFFFFF;
  819. .pricequjian {
  820. width: 100%;
  821. min-height: 240rpx;
  822. .contentpeice {
  823. width: 100%;
  824. display: flex;
  825. justify-content: space-between;
  826. margin: 36rpx 0;
  827. .title {
  828. font-weight: Regular;
  829. font-size: 28rpx;
  830. color: #333333;
  831. }
  832. .image {
  833. width: 28rpx;
  834. height: 20rpx;
  835. image {
  836. width: 100%;
  837. height: 100%;
  838. }
  839. }
  840. }
  841. }
  842. }
  843. }
  844. .pages {
  845. background: #F5F8FA;
  846. box-sizing: border-box;
  847. .tb {
  848. width: 100%;
  849. top: 0;
  850. left: 0;
  851. z-index: 999;
  852. .searchBoxParent {
  853. width: 100%;
  854. background: #fff;
  855. padding: 20rpx 24rpx 6rpx;
  856. box-sizing: border-box;
  857. .searchBox {
  858. width: 100%;
  859. background-color: #fff;
  860. }
  861. }
  862. .tabs {
  863. background: #fff;
  864. padding: 26rpx 0;
  865. display: flex;
  866. align-items: center;
  867. width: 100%;
  868. &>view {
  869. width: 25%;
  870. font-size: 28rpx;
  871. font-family: PingFangSC-Regular, PingFang SC;
  872. font-weight: 400;
  873. color: black;
  874. line-height: 40rpx;
  875. position: relative;
  876. text-align: center;
  877. }
  878. .active {
  879. font-size: 32rpx;
  880. font-family: PingFang-SC-Bold, PingFang-SC;
  881. font-weight: bold;
  882. color: black;
  883. line-height: 45rpx;
  884. }
  885. .active::after {
  886. position: absolute;
  887. content: '';
  888. width: 50rpx;
  889. height: 8rpx;
  890. background: #007A69;
  891. bottom: -26rpx;
  892. left: 60%;
  893. margin-left: -42rpx;
  894. }
  895. }
  896. }
  897. .green {}
  898. .mainContain {
  899. display: flex;
  900. flex-direction: column;
  901. padding: 0 20rpx;
  902. .nodata {
  903. background: white;
  904. }
  905. .card {
  906. background: #fff;
  907. border-radius: 16rpx;
  908. margin: 20rpx 0;
  909. padding: 20rpx;
  910. .header {
  911. display: flex;
  912. justify-content: space-between;
  913. border-bottom: 1px #f3f3f3 solid;
  914. padding: 20rpx;
  915. .red {
  916. color: indianred;
  917. }
  918. .green {
  919. color: #999999;
  920. }
  921. .blue {
  922. color: #1372FF;
  923. }
  924. .grey {
  925. color: #4C5F76;
  926. }
  927. .orange {
  928. color: #FF9100;
  929. }
  930. }
  931. .mainContent {
  932. // border-bottom: 1px #f3f3f3 solid;
  933. display: flex;
  934. padding: 20rpx 0;
  935. // justify-content: space-evenly;
  936. .image {
  937. background-repeat: no-repeat;
  938. background-size: cover;
  939. width: 198rpx;
  940. height: 180rpx;
  941. border-radius: 16rpx;
  942. }
  943. .middle {
  944. padding-top: 16rpx;
  945. color: #777777;
  946. // display: flex;
  947. // flex-direction: column;
  948. // justify-content: space-between;
  949. margin-left: 25rpx;
  950. width: 100%;
  951. .title {
  952. font-weight: 700;
  953. font-size: 32rpx;
  954. color: black;
  955. }
  956. .info {
  957. padding-top: 30rpx;
  958. color: #777777;
  959. // display: flex;
  960. // flex-direction: column;
  961. &>span {
  962. margin-top: 10rpx;
  963. }
  964. }
  965. }
  966. .price {
  967. color: red;
  968. text-align: center;
  969. height: 100%;
  970. align-items: center;
  971. align-self: center;
  972. font-size: 29rpx;
  973. font-weight: 700;
  974. }
  975. }
  976. .bottom {
  977. // padding: 30rpx 20rpx;
  978. display: flex;
  979. justify-content: flex-end;
  980. .detail {
  981. // border: 1rpx solid darkgrey;
  982. border-radius: 16rpx;
  983. color: darkgrey;
  984. padding: 13rpx 34rpx;
  985. background-color: #F6F6F6;
  986. font-size: 26rpx;
  987. color: #333333;
  988. font-weight: Regular;
  989. }
  990. .del {
  991. border-radius: 16rpx;
  992. color: darkgrey;
  993. padding: 13rpx 34rpx;
  994. background-color: #007A69;
  995. font-size: 26rpx;
  996. color: #fff;
  997. font-weight: Regular;
  998. }
  999. }
  1000. }
  1001. }
  1002. }
  1003. .u-input__content {
  1004. margin-top: 22rpx !important;
  1005. }
  1006. .uicon-arrow-right,
  1007. .uicon-close-circle-fill {
  1008. margin-top: 32rpx !important;
  1009. margin-right: 20rpx !important;
  1010. }
  1011. .pop-pop {
  1012. height: 65vh;
  1013. padding: 46rpx 20rpx 0;
  1014. .hander-one {
  1015. display: flex;
  1016. justify-content: space-between;
  1017. .text {
  1018. font-size: 36rpx;
  1019. color: #333333;
  1020. font-weight: bold;
  1021. }
  1022. .del {}
  1023. }
  1024. .hander-two {
  1025. display: flex;
  1026. align-items: center;
  1027. margin: 30rpx 0;
  1028. .hander-two-text {
  1029. font-size: 30rpx;
  1030. color: #333333;
  1031. font-weight: Regular;
  1032. }
  1033. .hander-two-image {
  1034. display: flex;
  1035. align-items: center;
  1036. .image {
  1037. margin: 0 10rpx;
  1038. width: 30rpx;
  1039. height: 30rpx;
  1040. image {
  1041. width: 100%;
  1042. height: 100%;
  1043. }
  1044. }
  1045. }
  1046. }
  1047. .hander-three {
  1048. display: flex;
  1049. border: 1rpx solid #CCCCCC;
  1050. border-radius: 16rpx;
  1051. justify-content: space-between;
  1052. height: 102rpx;
  1053. line-height: 102rpx;
  1054. .hander-three-text {
  1055. width: 200rpx;
  1056. text-align: left;
  1057. display: flex;
  1058. justify-content: space-between;
  1059. margin: 0 20rpx;
  1060. }
  1061. .hander-three-input {
  1062. width: 55%;
  1063. }
  1064. .hander-three-icon {
  1065. height: 102rpx;
  1066. line-height: 102rpx;
  1067. }
  1068. }
  1069. .hander-four {
  1070. margin-top: 30rpx;
  1071. display: flex;
  1072. border-radius: 16rpx;
  1073. justify-content: space-between;
  1074. border: 1rpx solid #CCCCCC;
  1075. height: 102rpx;
  1076. line-height: 102rpx;
  1077. .hander-three-text {
  1078. width: 200rpx;
  1079. text-align: center;
  1080. display: flex;
  1081. justify-content: space-between;
  1082. margin: 0 20rpx;
  1083. }
  1084. .hander-three-input {
  1085. width: 55%;
  1086. }
  1087. .hander-three-icon {
  1088. height: 102rpx;
  1089. line-height: 102rpx;
  1090. }
  1091. }
  1092. }
  1093. .page {
  1094. background: #F3F4F4;
  1095. padding-bottom: 260rpx;
  1096. box-sizing: border-box;
  1097. overflow-y: auto;
  1098. overflow-x: auto;
  1099. }
  1100. .typeNum {
  1101. // width: 100%;
  1102. height: 73rpx;
  1103. display: flex;
  1104. justify-content: space-between;
  1105. padding: 23rpx 24rpx;
  1106. align-items: center;
  1107. .left {
  1108. display: flex;
  1109. align-items: center;
  1110. .active {
  1111. color: #007A69;
  1112. }
  1113. }
  1114. .right {
  1115. display: flex;
  1116. align-items: center;
  1117. .image {
  1118. margin: 0 10rpx;
  1119. width: 30rpx;
  1120. height: 30rpx;
  1121. image {
  1122. width: 100%;
  1123. height: 100%;
  1124. }
  1125. }
  1126. .text {
  1127. font-size: 28rpx;
  1128. font-weight: Regular;
  1129. color: #333333;
  1130. }
  1131. }
  1132. }
  1133. .type {
  1134. margin: 0 auto;
  1135. border-radius: 10rpx 10rpx 10rpx 10rpx;
  1136. width: 86%;
  1137. // height: 114rpx;
  1138. background-color: #fff;
  1139. padding: 30rpx;
  1140. margin-bottom: 20rpx;
  1141. display: flex;
  1142. .left {
  1143. height: 114rpx;
  1144. line-height: 200rpx;
  1145. margin-right: 20rpx;
  1146. .image {
  1147. margin: 0 10rpx;
  1148. width: 30rpx;
  1149. height: 30rpx;
  1150. image {
  1151. width: 100%;
  1152. height: 100%;
  1153. }
  1154. }
  1155. }
  1156. .right {
  1157. width: 100%;
  1158. display: flex;
  1159. .right-left {
  1160. width: 172rpx;
  1161. height: 172rpx;
  1162. border-radius: 16rpx;
  1163. margin-right: 22rpx;
  1164. position: relative;
  1165. image {
  1166. width: 100%;
  1167. height: 100%;
  1168. border-radius: 16rpx;
  1169. }
  1170. .rl_type {
  1171. width: 80rpx;
  1172. height: 34rpx;
  1173. background: #FEB000;
  1174. border-radius: 16rpx 0 18rpx 0;
  1175. line-height: 34rpx;
  1176. text-align: center;
  1177. font-family: PingFangSC, PingFang SC;
  1178. font-weight: 400;
  1179. font-size: 20rpx;
  1180. color: #FFFFFF;
  1181. position: absolute;
  1182. left: 0;
  1183. top: 0;
  1184. }
  1185. }
  1186. .right-right {}
  1187. }
  1188. .type-btn {
  1189. width: 100%;
  1190. display: flex;
  1191. justify-content: space-between;
  1192. .type-btn-left {
  1193. width: 50rpx;
  1194. }
  1195. .type-btn-right {
  1196. display: flex;
  1197. view {
  1198. padding: 15rpx 23rpx;
  1199. background-color: #F6F6F6;
  1200. font-size: 24rpx;
  1201. color: #333;
  1202. font-weight: Regular;
  1203. margin-right: 20rpx;
  1204. border-radius: 50rpx;
  1205. }
  1206. }
  1207. }
  1208. }
  1209. .top {
  1210. display: flex;
  1211. justify-content: space-between;
  1212. }
  1213. .under {
  1214. margin-top: 20rpx;
  1215. // display: flex;
  1216. // justify-content: space-between;
  1217. }
  1218. .btn-btn {
  1219. width: 100%;
  1220. height: 136rpx;
  1221. background-color: #fff;
  1222. position: fixed;
  1223. bottom: 0;
  1224. padding: 30rpx 0 0;
  1225. // margin: 0 auto;
  1226. z-index: 9;
  1227. // margin-top: 30rpx;
  1228. // margin-left: 30rpx;
  1229. .bottom-btn {
  1230. display: flex;
  1231. justify-content: space-between;
  1232. margin: 0 24rpx;
  1233. .left {
  1234. width: 25%;
  1235. display: flex;
  1236. align-items: center;
  1237. .image {
  1238. width: 38rpx;
  1239. height: 38rpx;
  1240. margin: 0 10rpx;
  1241. image {
  1242. width: 100%;
  1243. height: 100%;
  1244. }
  1245. }
  1246. }
  1247. .right {
  1248. width: 75%;
  1249. display: flex;
  1250. justify-content: flex-end;
  1251. .right-btn {
  1252. width: 148rpx;
  1253. height: 80rpx;
  1254. line-height: 80rpx;
  1255. background-color: #007A69;
  1256. border-radius: 16rpx;
  1257. font-size: 26rpx;
  1258. color: #fff;
  1259. font-weight: Regular;
  1260. text-align: center;
  1261. }
  1262. }
  1263. }
  1264. }
  1265. .btn {
  1266. margin: 0 auto;
  1267. width: 690rpx;
  1268. height: 96rpx;
  1269. background-color: #1372FF;
  1270. color: #fff;
  1271. display: flex;
  1272. justify-content: center;
  1273. align-items: center;
  1274. font-size: 34rpx;
  1275. border-radius: 48rpx;
  1276. }
  1277. </style>