index.vue 32 KB

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