shop.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550
  1. <template>
  2. <view class="shop">
  3. <view class="head">
  4. <span class="cuIcon-back" @click="back"></span>
  5. <view class="case">
  6. 门店详情
  7. </view>
  8. </view>
  9. <view class="center">
  10. <view class="data">
  11. <view class="title">
  12. 门店信息
  13. <span></span>
  14. </view>
  15. <view class="content">
  16. <view class="img">
  17. <image :src="'http://192.168.0.36:8080/jeecg-boot/'+shopData.headPhoto" mode=""></image>
  18. </view>
  19. <view class="name">
  20. {{shopData.storeName}}
  21. <view class="avg">
  22. <u-rate :count="count" v-model="shopData.commentGradeAvg" active-icon="heart-fill" inactive-icon="heart"
  23. :disabled="true"></u-rate>
  24. <span>{{shopData.commentGradeAvg}}分</span>
  25. </view>
  26. <span v-if="shopData.merchantStatus == 1">营业中</span>
  27. <span v-if="shopData.merchantStatus == 2" style="color: #FF8024;">歇业中</span>
  28. <span v-if="shopData.merchantStatus == 3" style="color: #999999;">门店关闭</span>
  29. </view>
  30. </view>
  31. <view class="address">
  32. <view class="area">{{shopData.locality}}</view>
  33. <view class="details">
  34. <span>{{shopData.address}}</span>
  35. <image src="/static/index/addressblue.png" mode=""></image>
  36. </view>
  37. </view>
  38. <view class="institution">
  39. 经营机构 <span>{{shopData.corporateName}}</span>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="food">
  44. <view class="business" @click="isPopup = true">
  45. <image src="/static/index/business.png" mode=""></image>营业管理
  46. </view>
  47. <view class="edit">
  48. <image src="/static/index/edit.png" mode=""></image>编辑门店
  49. </view>
  50. </view>
  51. <view class="popup" v-if="isPopup">
  52. <view class="model">
  53. <view class="title">
  54. 营业管理
  55. <image src="/static/index/cut.png" mode="" @click="closePopup"></image>
  56. </view>
  57. <view class="btnList">
  58. <view class="box">
  59. <view class="btn" :class="currentIndex==index?'select':''" v-for="(item,index) in btnList" :key="index"
  60. @click="toggle(item,index)">
  61. {{item.name}}
  62. <image src="/static/index/select.png" mode="" v-if="currentIndex==index"></image>
  63. </view>
  64. </view>
  65. <view class="affirm" v-if="currentIndex ==1">
  66. 当前门店确定歇业?
  67. </view>
  68. <view class="affirm" v-if="currentIndex ==2">
  69. 关闭门店前需保证没有还未使用的有效服务券哦!
  70. </view>
  71. </view>
  72. <view class="sub">
  73. <view class="cancel" @click="closePopup">
  74. 取消
  75. </view>
  76. <view class="submit">
  77. 确定
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. <view class="popup res" v-if="isSuccess">
  83. <view class="content">
  84. <view class="title">
  85. <span v-if="status == 1">正常营业</span>
  86. <span v-if="status == 2">门店歇业</span>
  87. <span v-if="status == 3|| status == 4">关闭门店</span>
  88. </view>
  89. <view class="center">
  90. <image src="/static/index/start.png" mode="" v-if="status == 1"></image>
  91. <image src="/static/index/rest.png" mode="" v-if="status == 2"></image>
  92. <image src="/static/index/close.png" mode="" v-if="status == 3"></image>
  93. <span v-if="shopData.merchantStatus == 1">恭喜发财,开业大吉!</span>
  94. <span v-if="shopData.merchantStatus == 2">当前门店关闭成功</span>
  95. <span v-if="shopData.merchantStatus == 3">当前门店已歇业</span>
  96. <view class="error" v-if="shopData.merchantStatus == 3|| shopData.merchantStatus == 4">
  97. 当前门店还存在有效服务券<br />
  98. 暂时无法关闭门店
  99. </view>
  100. </view>
  101. <view class="btn" :class="dynamicClass" @click="isSuccess = false">
  102. 确定
  103. </view>
  104. </view>
  105. </view>
  106. </view>
  107. </template>
  108. <script>
  109. export default {
  110. data() {
  111. return {
  112. btnList: [{
  113. name: '正常营业',
  114. },
  115. {
  116. name: '门店歇业',
  117. },
  118. {
  119. name: '关闭门店',
  120. }
  121. ],
  122. currentIndex: 0,
  123. isPopup: false,
  124. dynamicClass: 'start',
  125. status: 3,
  126. isSuccess: false,
  127. count: 5,
  128. shopData: {},
  129. shopStatus:null
  130. }
  131. },
  132. methods: {
  133. //返回
  134. back() {
  135. uni.navigateBack({
  136. delta: 1
  137. });
  138. },
  139. //切换状态
  140. toggle(item, index) {
  141. this.currentIndex = index
  142. },
  143. getShopData() {
  144. this.$http.get("/merchant/localMerchantInfo/queryById?id=" + '1887039799020273666').then(res => {
  145. if (res.data.code == 200) {
  146. this.shopData = res.data.result
  147. this.shopStatus = res.data.result.merchantStatus
  148. this.currentStatus()
  149. }
  150. })
  151. },
  152. currentStatus(){
  153. if(this.shopStatus ==1){
  154. this.currentIndex = 0
  155. }else if(this.shopStatus ==2){
  156. this.currentIndex = 1
  157. } else if(this.shopStatus ==3){
  158. this.currentIndex = 2
  159. }
  160. },
  161. closePopup(){
  162. this.isPopup = false
  163. this.currentStatus()
  164. }
  165. },
  166. mounted() {
  167. this.getShopData()
  168. }
  169. }
  170. </script>
  171. <style lang="scss" scoped>
  172. page {
  173. width: 100%;
  174. height: 100%;
  175. }
  176. .shop {
  177. width: 100%;
  178. height: 100%;
  179. background: #F7F8FC;
  180. display: flex;
  181. flex-direction: column;
  182. justify-content: space-between;
  183. .head {
  184. width: 100%;
  185. height: 112rpx;
  186. padding: 20rpx;
  187. display: flex;
  188. align-items: center;
  189. background: linear-gradient(180deg, #FFF9F1 0%, #FFFFFF 100%);
  190. position: relative;
  191. .cuIcon-back {
  192. font-size: 40rpx;
  193. margin-right: 40rpx;
  194. }
  195. .case {
  196. position: absolute;
  197. left: 50%;
  198. transform: translateX(-50%);
  199. font-size: 36rpx;
  200. font-weight: 500;
  201. }
  202. }
  203. .center {
  204. width: 100%;
  205. flex: 1;
  206. padding: 0px 24rpx;
  207. .data {
  208. width: 100%;
  209. background: #FFFFFF;
  210. box-shadow: 0px 2rpx 8rpx 0px rgba(214, 225, 237, 0.1);
  211. border-radius: 16rpx;
  212. margin: 20rpx auto;
  213. padding: 20rpx 16rpx;
  214. .title {
  215. font-size: 28rpx;
  216. position: relative;
  217. margin-bottom: 16rpx;
  218. span {
  219. display: block;
  220. width: 108rpx;
  221. height: 5rpx;
  222. background: linear-gradient(90deg, #88BFFF 0%, #449AFF 100%);
  223. border-radius: 8rpx;
  224. position: absolute;
  225. bottom: 5rpx;
  226. }
  227. }
  228. .content {
  229. display: flex;
  230. height: 140rpx;
  231. .img {
  232. margin-right: 20rpx;
  233. width: 140rpx;
  234. height: 140rpx;
  235. image {
  236. width: 140rpx;
  237. height: 140rpx;
  238. }
  239. }
  240. .name {
  241. height: 100%;
  242. font-size: 32rpx;
  243. font-weight: 600;
  244. display: flex;
  245. flex-direction: column;
  246. justify-content: space-between;
  247. .avg {
  248. height: 23rpx;
  249. display: flex;
  250. align-items: center;
  251. margin-top: 8rpx;
  252. span {
  253. font-size: 32rpx;
  254. color: #FD4912;
  255. margin-left: 10rpx;
  256. }
  257. }
  258. span {
  259. display: block;
  260. height: 49rpx;
  261. font-size: 34rpx;
  262. color: #53CC48;
  263. line-height: 40rpx;
  264. }
  265. }
  266. }
  267. .address {
  268. margin-top: 32rpx;
  269. border-bottom: 1px solid #eee;
  270. padding-bottom: 16rpx;
  271. .area {
  272. height: 39rpx;
  273. font-size: 26rpx;
  274. color: #333333;
  275. line-height: 30rpx;
  276. }
  277. .details {
  278. display: flex;
  279. justify-content: space-between;
  280. span {
  281. display: block;
  282. width: 534rpx;
  283. font-size: 24rpx;
  284. color: #666666;
  285. line-height: 28rpx;
  286. margin-top: 8rpx;
  287. }
  288. image {
  289. width: 48rpx;
  290. height: 48rpx;
  291. }
  292. }
  293. }
  294. .institution {
  295. height: 55rpx;
  296. font-size: 26rpx;
  297. color: #232832;
  298. border-bottom: 1px solid #eee;
  299. padding-bottom: 16rpx;
  300. margin-top: 16rpx;
  301. span {
  302. margin-left: 20rpx;
  303. }
  304. }
  305. }
  306. }
  307. .food {
  308. width: 100%;
  309. height: 112rpx;
  310. background: #FFFFFF;
  311. display: flex;
  312. justify-content: space-around;
  313. align-items: center;
  314. font-size: 28rpx;
  315. color: #FFFFFF;
  316. image {
  317. width: 40rpx;
  318. height: 40rpx;
  319. margin-right: 10rpx;
  320. }
  321. .business {
  322. width: 324rpx;
  323. height: 76rpx;
  324. background: linear-gradient(90deg, #77B6FF 0%, #449AFF 100%);
  325. border-radius: 12rpx;
  326. display: flex;
  327. justify-content: center;
  328. align-items: center;
  329. }
  330. .edit {
  331. width: 324rpx;
  332. height: 76rpx;
  333. background: linear-gradient(90deg, #FFA05B 0%, #FF7918 100%);
  334. border-radius: 12rpx;
  335. display: flex;
  336. justify-content: center;
  337. align-items: center;
  338. }
  339. }
  340. .popup {
  341. width: 100vw;
  342. height: 100vh;
  343. position: fixed;
  344. top: 0;
  345. left: 0;
  346. background: rgba(0, 0, 0, 0.4);
  347. display: flex;
  348. align-items: end;
  349. .model {
  350. width: 100%;
  351. background-color: #fff;
  352. border-radius: 20rpx 20rpx 0rpx 0rpx;
  353. padding: 0rpx 24rpx;
  354. padding-bottom: 20rpx;
  355. .title {
  356. width: 100%;
  357. height: 86rpx;
  358. display: flex;
  359. align-items: center;
  360. justify-content: center;
  361. border-bottom: 1px solid #EEEEEE;
  362. position: relative;
  363. image {
  364. width: 40rpx;
  365. height: 40rpx;
  366. position: absolute;
  367. right: 0px;
  368. }
  369. }
  370. .btnList {
  371. width: 100%;
  372. height: 193rpx;
  373. border-bottom: 1px solid #EEEEEE;
  374. padding-top: 24rpx;
  375. .box {
  376. display: flex;
  377. justify-content: space-between;
  378. .btn {
  379. width: 196rpx;
  380. height: 66rpx;
  381. border-radius: 4rpx;
  382. border: 1px solid #C2C2C2;
  383. display: flex;
  384. align-items: center;
  385. justify-content: center;
  386. font-size: 26rpx;
  387. position: relative;
  388. image {
  389. width: 24rpx;
  390. height: 24rpx;
  391. position: absolute;
  392. top: 0;
  393. right: 0;
  394. }
  395. }
  396. .select {
  397. background: rgba(68, 154, 255, 0.1);
  398. border: 1px solid #449AFF;
  399. color: #2983EC;
  400. }
  401. }
  402. .affirm {
  403. width: 100%;
  404. font-size: 24rpx;
  405. color: #666666;
  406. line-height: 28rpx;
  407. text-align: center;
  408. margin-top: 24rpx;
  409. }
  410. }
  411. .sub {
  412. display: flex;
  413. justify-content: space-between;
  414. margin-top: 16rpx;
  415. .cancel {
  416. width: 205rpx;
  417. height: 76rpx;
  418. border-radius: 54rpx;
  419. border: 1px solid #CCCCCC;
  420. font-size: 28rpx;
  421. color: #999999;
  422. display: flex;
  423. align-items: center;
  424. justify-content: center;
  425. }
  426. .submit {
  427. width: 443rpx;
  428. height: 76rpx;
  429. background: linear-gradient(90deg, #77B6FF 0%, #449AFF 100%);
  430. border-radius: 53rpx;
  431. display: flex;
  432. align-items: center;
  433. justify-content: center;
  434. font-size: 28rpx;
  435. color: #FFFFFF;
  436. }
  437. }
  438. }
  439. }
  440. .res {
  441. display: flex;
  442. align-items: center;
  443. justify-content: center;
  444. .content {
  445. width: 570rpx;
  446. background: #FFFFFF;
  447. border-radius: 16rpx;
  448. padding: 0px 24rpx;
  449. padding-bottom: 16rpx;
  450. .title {
  451. width: 100%;
  452. height: 86rpx;
  453. font-size: 32rpx;
  454. color: #333333;
  455. font-weight: 600;
  456. border-bottom: 1px solid #EEEEEE;
  457. display: flex;
  458. align-items: center;
  459. justify-content: center;
  460. }
  461. .center {
  462. font-size: 30rpx;
  463. color: #333333;
  464. line-height: 35rpx;
  465. display: flex;
  466. flex-direction: column;
  467. align-items: center;
  468. justify-content: center;
  469. padding-top: 28rpx;
  470. border-bottom: 1px solid #EEEEEE;
  471. padding-bottom: 40rpx;
  472. margin-bottom: 16rpx;
  473. image {
  474. width: 100rpx;
  475. height: 100rpx;
  476. margin-bottom: 10rpx;
  477. }
  478. }
  479. .btn {
  480. width: 320rpx;
  481. height: 68rpx;
  482. border-radius: 66rpx;
  483. font-size: 28rpx;
  484. color: #FFFFFF;
  485. display: flex;
  486. align-items: center;
  487. justify-content: center;
  488. margin: 0rpx auto;
  489. }
  490. .start {
  491. background: #53CC48;
  492. }
  493. .rest {
  494. background: #FF8024;
  495. }
  496. }
  497. }
  498. }
  499. </style>