index.vue 34 KB

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