index.vue 34 KB

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