index.vue 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427
  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;">{{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>
  88. <view class="right-right">
  89. <view class="top">
  90. <text style="font-size: 30rpx; color: #333;">{{item.name||item.goodsName}}</text>
  91. </view>
  92. <view class="under">
  93. <!-- <view style="font-size: 24rpx; color: #777;">销量:{{item.salesVolume||item.soldNum||0}}</view> -->
  94. <view style="font-size: 24rpx; color: #777;">
  95. 销量:{{item.salesVolume!=null?item.salesVolume:item.soldNum}}</view>
  96. <view v-if='item.goodsType==1'
  97. style="font-size: 36rpx; color: #FF4141; font-weight: Bold; margin-top: 16rpx;">
  98. ¥{{item.discountPrice}}</view>
  99. <view v-else-if="item.goodsType==2"
  100. style="font-size: 36rpx; color: #FF4141; font-weight: Bold; margin-top: 16rpx;">
  101. ¥{{item.normalPrice}}</view>
  102. <view v-else-if="item.goodsType==3"
  103. style="font-size: 36rpx; color: #FF4141; font-weight: Bold; margin-top: 16rpx;">
  104. ¥{{item.avePrice}}</view>
  105. <view v-else
  106. style="font-size: 36rpx; color: #FF4141; font-weight: Bold; margin-top: 16rpx;">
  107. ¥{{item.discountPrice}}</view>
  108. </view>
  109. </view>
  110. </view>
  111. <view class="type-btn" v-if='!canyinmeishi'>
  112. <view class="type-btn-left">
  113. </view>
  114. <view class="type-btn-right">
  115. <!-- <view class="" @click="shanchu(item,index)">
  116. 删除
  117. </view> -->
  118. <!-- <view class="" @click="gaijia(item,index)" v-if='item.goodsType == 2'>
  119. 改价格
  120. </view> -->
  121. <view v-if="canyinmeishi" class="" @click="xiajia(item,index)">
  122. {{fromData.status==0?'下架':'上架'}}
  123. </view>
  124. <view v-if="!canyinmeishi" class="" @click="xiajia1(item,index)">
  125. {{fromData.status==0?'上架':'下架'}}
  126. </view>
  127. </view>
  128. </view>
  129. <view class="type-btn" v-if='canyinmeishi'>
  130. <view class="type-btn-left">
  131. </view>
  132. <view class="type-btn-right">
  133. <view class="" @click="shanchu(item,index)">
  134. 删除
  135. </view>
  136. <!-- <view class="" @click="gaijia(item,index)">
  137. 改价格
  138. </view> -->
  139. <view v-if="canyinmeishi" class="" @click="xiajia(item,index)">
  140. {{fromData.status==0?'下架':'上架'}}
  141. </view>
  142. <view v-if="!canyinmeishi" class="" @click="xiajia1(item,index)">
  143. {{fromData.status==0?'上架':'下架'}}
  144. </view>
  145. </view>
  146. </view>
  147. </view>
  148. </view>
  149. <!-- 批量按钮 -->
  150. <view class="btn-btn" v-if="Selected==true">
  151. <view class="bottom-btn">
  152. <view class="left">
  153. <view class="image">
  154. <image
  155. :src="selectedTags.length>0?'https://i.ringzle.com/file/20240228/c741a340e19642c59473e6f4a6d2f4be.png':'https://i.ringzle.com/file/20231027/db588133d67548fc82dfb0d128eac9a8.png'">
  156. </image>
  157. </view>
  158. <view class="text">
  159. 已选:{{selectedTags.length}}
  160. </view>
  161. </view>
  162. <view class="right">
  163. <view v-if="canyinmeishi" class="right-btn" @click="piliangxiajia">
  164. {{fromData.status==0?'批量下架':'批量上架'}}
  165. </view>
  166. <view v-if="!canyinmeishi" class="right-btn" @click="piliangxiajia">
  167. {{fromData.status==0?'批量上架':'批量下架'}}
  168. </view>
  169. <!-- <view class="right-btn" @click="piliangshanchu">
  170. 批量删除
  171. </view> -->
  172. </view>
  173. </view>
  174. </view>
  175. <!-- 改价弹出框 -->
  176. <u-popup :show="showPricing" @close="closegaijia" @open="opengaijia" :round="10">
  177. <view class="gaijiadiv">
  178. <view class="toubu">
  179. 改价格
  180. <view class="toubux" @click="closegaijia">
  181. <u-icon name="close" color="#000000" size="40"></u-icon>
  182. </view>
  183. </view>
  184. <view class="jiainput">
  185. <u--input type='number' v-model="newprice" placeholder="请输入价格" border="surround"
  186. clearable></u--input>
  187. </view>
  188. <view class="queding">
  189. <view class="queding1" @click="closegaijia">
  190. 取消
  191. </view>
  192. <view class="queding2" @click="quedingjiae">
  193. 确定
  194. </view>
  195. </view>
  196. </view>
  197. </u-popup>
  198. <!-- 下架弹出框 -->
  199. <u-modal :show="xiajiashow" :title="fromData.status==0?'下架选中的商品':'上架选中的商品'"
  200. :content="fromData.status==0?'下架后商品不可在前台继续售卖,是否继续?':'上架后商品可在前台售卖,是否继续?'" showConfirmButton='true'
  201. showCancelButton='true' @confirm='quedingxiajia' @cancel='quxiaoxiajia'></u-modal>
  202. <!-- 下架弹出框渔家乐 -->
  203. <u-modal :show="xiajiashow1" :title="fromData.status==1?'下架选中的商品':'上架选中的商品'"
  204. :content="fromData.status==1?'下架后商品不可在前台继续售卖,是否继续?':'上架后商品可在前台售卖,是否继续?'" showConfirmButton='true'
  205. showCancelButton='true' @confirm='quedingxiajia' @cancel='quxiaoxiajia'></u-modal>
  206. <!-- 删除弹出框 -->
  207. <u-modal :show="shanchushow" title="删除选中的商品" content='删除后的商品不可在前台继续售卖,是否继续?' showConfirmButton='true'
  208. showCancelButton='true' @confirm='quedingshanchu' @cancel='quxiaoshanchu'></u-modal>
  209. <view class="mainContain">
  210. <!-- <view class="nodata" v-if='dataList.length==0'>
  211. <NoData></NoData>
  212. </view> -->
  213. </view>
  214. <u-toast ref="uToast"></u-toast>
  215. </view>
  216. </template>
  217. <script>
  218. import TopTabs from '@/components/TopTabs/topTabs.vue';
  219. // import NoData from '../../components/NoData/index.vue';
  220. export default {
  221. components: {
  222. TopTabs,
  223. // NoData
  224. },
  225. data() {
  226. return {
  227. h: uni.getSystemInfoSync().windowHeight,
  228. mt: uni.getSystemInfoSync().statusBarHeight + 44,
  229. newprice: '',
  230. lsdata: {},
  231. current: 0,
  232. canyinmeishi: false,
  233. xiajiashow: false,
  234. xiajiashow1: false,
  235. shanchushow: false,
  236. tabList: [],
  237. homestayId: uni.getStorageSync('homestayId') || 0,
  238. roomType: [],
  239. selectedTags: [],
  240. mytotal: 0,
  241. isSelect: false,
  242. Selected: false,
  243. showPricing: false,
  244. areaShow: false,
  245. areaval:'上架时间',
  246. //餐饮
  247. list: [{
  248. name: '创建时间',
  249. key: 'createDate',
  250. value: 1
  251. },
  252. {
  253. name: '上架时间',
  254. key: 'updateDate',
  255. value: 1
  256. },
  257. {
  258. name: '销量从高到低',
  259. key: 'salesVolume',
  260. value: 1
  261. },
  262. {
  263. name: '价格从高到低',
  264. key: 'discountPrice',
  265. value: 1
  266. },
  267. {
  268. name: '价格从低到高',
  269. key: 'discountPrice',
  270. value: 0
  271. },
  272. // {
  273. // name: '库存从高到低',
  274. // key: 'price',
  275. // value: 1
  276. // },
  277. // {
  278. // name: '库存从低到高',
  279. // key: 'price',
  280. // value: 0
  281. // },
  282. ],
  283. //渔家乐
  284. list1: [
  285. {
  286. name: '上架时间',
  287. key: 'updateDate',
  288. value: 1
  289. },
  290. {
  291. name: '销量从高到低',
  292. key: 'soldNum',
  293. value: 1
  294. },
  295. // {
  296. // name: '价格从高到低',
  297. // key: '',
  298. // value: 1
  299. // },
  300. // {
  301. // name: '价格从低到高',
  302. // key: '',
  303. // value: 0
  304. // }
  305. ],
  306. areaShowIndex: null,
  307. merchantType:uni.getStorageSync('merchantType'),
  308. fromData: {
  309. merchantId: uni.getStorageSync('merchantId'), //商户id
  310. limit: 99,
  311. page: 1,
  312. sortType: '', //选择条件:1创建时间 2销量从高到低 3价格从高到低 4价格从低到高
  313. status: 0, //状态:0上架1下架
  314. }
  315. }
  316. },
  317. onLoad(option) {
  318. console.log('111111111111111111', uni.getStorageSync('merchantType'))
  319. //this.getHousekeeping();
  320. if (uni.getStorageSync('merchantType') == 4) {
  321. this.canyinmeishi = true;
  322. this.tabList = [{
  323. name: '出售中',
  324. id: 0
  325. },
  326. {
  327. name: '待上架',
  328. id: 1
  329. },
  330. ]
  331. this.getRepast(); //获取商品列表(餐饮美食)
  332. } else {
  333. this.canyinmeishi = false;
  334. this.tabList = [{
  335. name: '出售中',
  336. id: 1
  337. },
  338. {
  339. name: '待上架',
  340. id: 0
  341. },
  342. ]
  343. this.fromData = {
  344. merchantId: uni.getStorageSync('merchantId'), //商户id
  345. limit: 99999,
  346. page: 1,
  347. sortType: '', //选择条件:1创建时间 2销量从高到低 3价格从高到低 4价格从低到高
  348. status: 1, //状态:0上架1下架
  349. }
  350. this.yujialedata(); //获取商品列表(渔家乐)
  351. }
  352. },
  353. methods: {
  354. getHousekeeping() {
  355. this.$api.get('/sys/dict/type/all').then(res => {
  356. let alldata = res.data.data.find((p) => p.dictType == 'food_type').dataList;
  357. console.log('alldata', alldata)
  358. // this.categoryMain = alldata.map((item, index, arr) => {
  359. // let json = {};
  360. // json.name = item.dictLabel;
  361. // json.type = item.dictValue;
  362. // json.icon =
  363. // 'https://i.ringzle.com/file/20231125/a314703e463d43c7808714d1b29632ad.png';
  364. // return json
  365. // })
  366. })
  367. },
  368. piliangxiajia() {
  369. if (uni.getStorageSync('merchantType') == 4) {
  370. if (this.selectedTags.length == 0) {
  371. this.$refs.uToast.show({
  372. type: 'success',
  373. title: '',
  374. message: "请选择数据",
  375. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
  376. })
  377. } else {
  378. let namesArray = this.selectedTags.map(obj => obj.id);
  379. let postdata = {
  380. discountPrice: 0,
  381. ids: namesArray,
  382. status: this.fromData.status == 0 ? 1 : 0,
  383. };
  384. this.$api.post('/api/merchant/food/updateStatus', postdata).then(res => {
  385. this.$refs.uToast.show({
  386. type: 'success',
  387. title: '',
  388. message: "成功",
  389. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
  390. })
  391. this.selectedTags = [];
  392. this.Selected = false;
  393. this.getRepast(); //获取商品列表
  394. })
  395. }
  396. } else {
  397. if (this.selectedTags.length == 0) {
  398. this.$refs.uToast.show({
  399. type: 'success',
  400. title: '',
  401. message: "请选择数据",
  402. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
  403. })
  404. } else {
  405. let postdata = this.selectedTags.map((item, index, arr) => {
  406. let json = {};
  407. json.id = item.id;
  408. json.merchantId = uni.getStorageSync('merchantId');
  409. json.status = item.status == 0 ? 1 : 0;
  410. return json
  411. })
  412. // let namesArray = this.selectedTags.map(obj => obj.id);
  413. // let postdata = {
  414. // id: namesArray,
  415. // status: this.fromData.status,
  416. // };
  417. this.$api.post('/scenic/goods/batchUpDownFrame', postdata).then(res => {
  418. this.$refs.uToast.show({
  419. type: 'success',
  420. title: '',
  421. message: "成功",
  422. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
  423. })
  424. this.selectedTags = [];
  425. this.Selected = false;
  426. this.yujialedata(); //获取商品列表(渔家乐)
  427. })
  428. }
  429. }
  430. },
  431. piliangshanchu() {
  432. if (uni.getStorageSync('merchantType') == 4) {
  433. if (this.selectedTags.length == 0) {
  434. this.$refs.uToast.show({
  435. type: 'success',
  436. title: '',
  437. message: "请选择数据",
  438. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
  439. })
  440. } else {
  441. let namesArray = this.selectedTags.map(obj => obj.id);
  442. //status: this.fromData.status,
  443. this.$api.del('/api/merchant/food/delProduct', namesArray).then(res => {
  444. this.$refs.uToast.show({
  445. type: 'success',
  446. title: '',
  447. message: "成功",
  448. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
  449. })
  450. this.selectedTags = [];
  451. this.Selected = false;
  452. this.getRepast(); //获取商品列表
  453. })
  454. }
  455. } else {
  456. if (this.selectedTags.length == 0) {
  457. this.$refs.uToast.show({
  458. type: 'success',
  459. title: '',
  460. message: "请选择数据",
  461. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
  462. })
  463. } else {
  464. let namesArray = this.selectedTags.map(obj => obj.id);
  465. console.log('111111111111111111', namesArray)
  466. //status: this.fromData.status,
  467. this.$api.del('/scenic/goods', namesArray).then(res => {
  468. this.$refs.uToast.show({
  469. type: 'success',
  470. title: '',
  471. message: "成功",
  472. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
  473. })
  474. this.selectedTags = [];
  475. this.Selected = false;
  476. this.yujialedata(); //获取商品列表(渔家乐)
  477. })
  478. }
  479. }
  480. },
  481. shanchu(e, i) {
  482. //console.log('111111111111111111', e, i)
  483. this.lsdata = e;
  484. this.shanchushow = true;
  485. },
  486. quedingshanchu() {
  487. if (uni.getStorageSync('merchantType') == 4) {
  488. //(餐饮美食)
  489. let postdata = [this.lsdata.id];
  490. //status: this.fromData.status,
  491. console.log('postdata', postdata)
  492. this.$api.del('/api/merchant/food/delProduct', postdata).then(res => {
  493. this.$refs.uToast.show({
  494. type: 'success',
  495. title: '',
  496. message: "成功",
  497. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
  498. })
  499. this.quxiaoshanchu();
  500. this.getRepast(); //获取商品列表
  501. })
  502. } else {
  503. //(渔家乐)
  504. let postdata = [this.lsdata.id];
  505. //status: this.fromData.status,
  506. console.log('postdata', postdata)
  507. this.$api.del('/scenic/goods', postdata).then(res => {
  508. this.$refs.uToast.show({
  509. type: 'success',
  510. title: '',
  511. message: "成功",
  512. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
  513. })
  514. this.quxiaoshanchu();
  515. this.yujialedata(); //获取商品列表(渔家乐)
  516. })
  517. }
  518. },
  519. quxiaoshanchu() {
  520. // console.log('quxiaoxiajia',this.lsdata)
  521. this.lsdata = {};
  522. this.shanchushow = false;
  523. },
  524. gaijia(e, i) {
  525. console.log('111111111111111111', e, i)
  526. this.showPricing = true;
  527. this.lsdata = e;
  528. },
  529. closegaijia() {
  530. this.showPricing = false;
  531. this.newprice = '';
  532. this.lsdata = {};
  533. },
  534. quedingjiae() {
  535. if (uni.getStorageSync('merchantType') == 4) {
  536. //获取商品列表(餐饮美食)
  537. //console.log('111111111111111111', this.newprice)
  538. let postdata = {
  539. discountPrice: this.newprice,
  540. ids: [this.lsdata.id],
  541. status: this.fromData.status,
  542. };
  543. //console.log('postdata', postdata)
  544. this.$api.post('/api/merchant/food/updateDiscountPrice', postdata).then(res => {
  545. this.$refs.uToast.show({
  546. type: 'success',
  547. title: '',
  548. message: "成功",
  549. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
  550. })
  551. this.closegaijia();
  552. this.getRepast(); //获取商品列表
  553. })
  554. } else {
  555. //获取商品列表(渔家乐)
  556. if (this.lsdata.goodsType == 2) {
  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. } else {
  574. // let postdata = {
  575. // normalPrice: this.newprice,
  576. // id: this.lsdata.id,
  577. // status: this.fromData.status,
  578. // };
  579. // console.log('postdata', postdata)
  580. // this.$api.put('/scenic/goods', postdata).then(res => {
  581. // this.$refs.uToast.show({
  582. // type: 'success',
  583. // title: '',
  584. // message: "成功",
  585. // iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
  586. // })
  587. // this.closegaijia();
  588. // this.yujialedata(); //获取商品列表(渔家乐)
  589. // })
  590. }
  591. }
  592. },
  593. opengaijia() {},
  594. xiajia1(e, i) {
  595. console.log('111111111111111111', e, i)
  596. this.lsdata = e;
  597. this.xiajiashow1 = true;
  598. },
  599. xiajia(e, i) {
  600. console.log('111111111111111111', e, i)
  601. this.lsdata = e;
  602. this.xiajiashow = true;
  603. },
  604. quedingxiajia() {
  605. if (uni.getStorageSync('merchantType') == 4) {
  606. //获取商品列表(餐饮美食)
  607. let postdata = {
  608. discountPrice: this.lsdata.discountPrice,
  609. ids: [this.lsdata.id],
  610. status: this.fromData.status == 0 ? 1 : 0,
  611. };
  612. this.$api.post('/api/merchant/food/updateStatus', postdata).then(res => {
  613. this.$refs.uToast.show({
  614. type: 'success',
  615. title: '',
  616. message: "成功",
  617. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
  618. })
  619. this.quxiaoxiajia();
  620. this.getRepast(); //获取商品列表
  621. })
  622. } else {
  623. //获取商品列表(渔家乐)
  624. let postdata = {
  625. id: this.lsdata.id,
  626. status: this.fromData.status == 1 ? 0 : 1,
  627. };
  628. this.$api.put('/scenic/goods', postdata).then(res => {
  629. this.$refs.uToast.show({
  630. type: 'success',
  631. title: '',
  632. message: "成功",
  633. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
  634. })
  635. this.quxiaoxiajia();
  636. this.yujialedata();
  637. })
  638. }
  639. },
  640. quxiaoxiajia() {
  641. // console.log('quxiaoxiajia',this.lsdata)
  642. this.lsdata = {};
  643. this.xiajiashow = false;
  644. this.xiajiashow1 = false;
  645. },
  646. selectPerson(e, i) {
  647. if (this.selectedTags.includes(e)) {
  648. this.selectedTags = this.selectedTags.filter(t => t !== e);
  649. } else {
  650. this.selectedTags.push(e);
  651. }
  652. console.log(' this.selectedTags', this.selectedTags)
  653. },
  654. yujialedata() {
  655. this.$api.get('/scenic/goods/page', this.fromData).then(res => {
  656. console.log(res.data.data.list);
  657. this.roomType = res.data.data.list;
  658. this.mytotal = res.data.data.total;
  659. })
  660. },
  661. getRepast() {
  662. this.$api.get('/api/merchant/food/product/page', this.fromData).then(res => {
  663. console.log(res.data.data.list);
  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. image {
  1147. width: 100%;
  1148. height: 100%;
  1149. border-radius: 16rpx;
  1150. }
  1151. }
  1152. .right-right {}
  1153. }
  1154. .type-btn {
  1155. width: 100%;
  1156. display: flex;
  1157. justify-content: space-between;
  1158. .type-btn-left {
  1159. width: 50rpx;
  1160. }
  1161. .type-btn-right {
  1162. display: flex;
  1163. view {
  1164. padding: 15rpx 23rpx;
  1165. background-color: #F6F6F6;
  1166. font-size: 24rpx;
  1167. color: #333;
  1168. font-weight: Regular;
  1169. margin-right: 20rpx;
  1170. border-radius: 50rpx;
  1171. }
  1172. }
  1173. }
  1174. }
  1175. .top {
  1176. display: flex;
  1177. justify-content: space-between;
  1178. }
  1179. .under {
  1180. margin-top: 20rpx;
  1181. // display: flex;
  1182. // justify-content: space-between;
  1183. }
  1184. .btn-btn {
  1185. width: 100%;
  1186. height: 136rpx;
  1187. background-color: #fff;
  1188. position: fixed;
  1189. bottom: 0;
  1190. padding: 30rpx 0 0;
  1191. // margin: 0 auto;
  1192. z-index: 9;
  1193. // margin-top: 30rpx;
  1194. // margin-left: 30rpx;
  1195. .bottom-btn {
  1196. display: flex;
  1197. justify-content: space-between;
  1198. margin: 0 24rpx;
  1199. .left {
  1200. width: 25%;
  1201. display: flex;
  1202. align-items: center;
  1203. .image {
  1204. width: 38rpx;
  1205. height: 38rpx;
  1206. margin: 0 10rpx;
  1207. image {
  1208. width: 100%;
  1209. height: 100%;
  1210. }
  1211. }
  1212. }
  1213. .right {
  1214. width: 75%;
  1215. display: flex;
  1216. justify-content: space-evenly;
  1217. .right-btn {
  1218. width: 148rpx;
  1219. height: 80rpx;
  1220. line-height: 80rpx;
  1221. background-color: #1372FF;
  1222. border-radius: 16rpx;
  1223. font-size: 26rpx;
  1224. color: #fff;
  1225. font-weight: Regular;
  1226. text-align: center;
  1227. }
  1228. }
  1229. }
  1230. }
  1231. .btn {
  1232. margin: 0 auto;
  1233. width: 690rpx;
  1234. height: 96rpx;
  1235. background-color: #1372FF;
  1236. color: #fff;
  1237. display: flex;
  1238. justify-content: center;
  1239. align-items: center;
  1240. font-size: 34rpx;
  1241. border-radius: 48rpx;
  1242. }
  1243. </style>