shop.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555
  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" @click="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. edit(){
  134. uni.navigateTo({
  135. url: '/pages/store/editStore'
  136. })
  137. },
  138. //返回
  139. back() {
  140. uni.navigateBack({
  141. delta: 1
  142. });
  143. },
  144. //切换状态
  145. toggle(item, index) {
  146. this.currentIndex = index
  147. },
  148. getShopData() {
  149. this.$http.get("/merchant/localMerchantInfo/queryById?id=" + '1887039799020273666').then(res => {
  150. if (res.data.code == 200) {
  151. this.shopData = res.data.result
  152. this.shopStatus = res.data.result.merchantStatus
  153. this.currentStatus()
  154. }
  155. })
  156. },
  157. currentStatus(){
  158. if(this.shopStatus ==1){
  159. this.currentIndex = 0
  160. }else if(this.shopStatus ==2){
  161. this.currentIndex = 1
  162. } else if(this.shopStatus ==3){
  163. this.currentIndex = 2
  164. }
  165. },
  166. closePopup(){
  167. this.isPopup = false
  168. this.currentStatus()
  169. }
  170. },
  171. mounted() {
  172. this.getShopData()
  173. }
  174. }
  175. </script>
  176. <style lang="scss" scoped>
  177. page {
  178. width: 100%;
  179. height: 100%;
  180. }
  181. .shop {
  182. width: 100%;
  183. height: 100%;
  184. background: #F7F8FC;
  185. display: flex;
  186. flex-direction: column;
  187. justify-content: space-between;
  188. .head {
  189. width: 100%;
  190. height: 112rpx;
  191. padding: 20rpx;
  192. display: flex;
  193. align-items: center;
  194. background: linear-gradient(180deg, #FFF9F1 0%, #FFFFFF 100%);
  195. position: relative;
  196. .cuIcon-back {
  197. font-size: 40rpx;
  198. margin-right: 40rpx;
  199. }
  200. .case {
  201. position: absolute;
  202. left: 50%;
  203. transform: translateX(-50%);
  204. font-size: 36rpx;
  205. font-weight: 500;
  206. }
  207. }
  208. .center {
  209. width: 100%;
  210. flex: 1;
  211. padding: 0px 24rpx;
  212. .data {
  213. width: 100%;
  214. background: #FFFFFF;
  215. box-shadow: 0px 2rpx 8rpx 0px rgba(214, 225, 237, 0.1);
  216. border-radius: 16rpx;
  217. margin: 20rpx auto;
  218. padding: 20rpx 16rpx;
  219. .title {
  220. font-size: 28rpx;
  221. position: relative;
  222. margin-bottom: 16rpx;
  223. span {
  224. display: block;
  225. width: 108rpx;
  226. height: 5rpx;
  227. background: linear-gradient(90deg, #88BFFF 0%, #449AFF 100%);
  228. border-radius: 8rpx;
  229. position: absolute;
  230. bottom: 5rpx;
  231. }
  232. }
  233. .content {
  234. display: flex;
  235. height: 140rpx;
  236. .img {
  237. margin-right: 20rpx;
  238. width: 140rpx;
  239. height: 140rpx;
  240. image {
  241. width: 140rpx;
  242. height: 140rpx;
  243. }
  244. }
  245. .name {
  246. height: 100%;
  247. font-size: 32rpx;
  248. font-weight: 600;
  249. display: flex;
  250. flex-direction: column;
  251. justify-content: space-between;
  252. .avg {
  253. height: 23rpx;
  254. display: flex;
  255. align-items: center;
  256. margin-top: 8rpx;
  257. span {
  258. font-size: 32rpx;
  259. color: #FD4912;
  260. margin-left: 10rpx;
  261. }
  262. }
  263. span {
  264. display: block;
  265. height: 49rpx;
  266. font-size: 34rpx;
  267. color: #53CC48;
  268. line-height: 40rpx;
  269. }
  270. }
  271. }
  272. .address {
  273. margin-top: 32rpx;
  274. border-bottom: 1px solid #eee;
  275. padding-bottom: 16rpx;
  276. .area {
  277. height: 39rpx;
  278. font-size: 26rpx;
  279. color: #333333;
  280. line-height: 30rpx;
  281. }
  282. .details {
  283. display: flex;
  284. justify-content: space-between;
  285. span {
  286. display: block;
  287. width: 534rpx;
  288. font-size: 24rpx;
  289. color: #666666;
  290. line-height: 28rpx;
  291. margin-top: 8rpx;
  292. }
  293. image {
  294. width: 48rpx;
  295. height: 48rpx;
  296. }
  297. }
  298. }
  299. .institution {
  300. height: 55rpx;
  301. font-size: 26rpx;
  302. color: #232832;
  303. border-bottom: 1px solid #eee;
  304. padding-bottom: 16rpx;
  305. margin-top: 16rpx;
  306. span {
  307. margin-left: 20rpx;
  308. }
  309. }
  310. }
  311. }
  312. .food {
  313. width: 100%;
  314. height: 112rpx;
  315. background: #FFFFFF;
  316. display: flex;
  317. justify-content: space-around;
  318. align-items: center;
  319. font-size: 28rpx;
  320. color: #FFFFFF;
  321. image {
  322. width: 40rpx;
  323. height: 40rpx;
  324. margin-right: 10rpx;
  325. }
  326. .business {
  327. width: 324rpx;
  328. height: 76rpx;
  329. background: linear-gradient(90deg, #77B6FF 0%, #449AFF 100%);
  330. border-radius: 12rpx;
  331. display: flex;
  332. justify-content: center;
  333. align-items: center;
  334. }
  335. .edit {
  336. width: 324rpx;
  337. height: 76rpx;
  338. background: linear-gradient(90deg, #FFA05B 0%, #FF7918 100%);
  339. border-radius: 12rpx;
  340. display: flex;
  341. justify-content: center;
  342. align-items: center;
  343. }
  344. }
  345. .popup {
  346. width: 100vw;
  347. height: 100vh;
  348. position: fixed;
  349. top: 0;
  350. left: 0;
  351. background: rgba(0, 0, 0, 0.4);
  352. display: flex;
  353. align-items: end;
  354. .model {
  355. width: 100%;
  356. background-color: #fff;
  357. border-radius: 20rpx 20rpx 0rpx 0rpx;
  358. padding: 0rpx 24rpx;
  359. padding-bottom: 20rpx;
  360. .title {
  361. width: 100%;
  362. height: 86rpx;
  363. display: flex;
  364. align-items: center;
  365. justify-content: center;
  366. border-bottom: 1px solid #EEEEEE;
  367. position: relative;
  368. image {
  369. width: 40rpx;
  370. height: 40rpx;
  371. position: absolute;
  372. right: 0px;
  373. }
  374. }
  375. .btnList {
  376. width: 100%;
  377. height: 193rpx;
  378. border-bottom: 1px solid #EEEEEE;
  379. padding-top: 24rpx;
  380. .box {
  381. display: flex;
  382. justify-content: space-between;
  383. .btn {
  384. width: 196rpx;
  385. height: 66rpx;
  386. border-radius: 4rpx;
  387. border: 1px solid #C2C2C2;
  388. display: flex;
  389. align-items: center;
  390. justify-content: center;
  391. font-size: 26rpx;
  392. position: relative;
  393. image {
  394. width: 24rpx;
  395. height: 24rpx;
  396. position: absolute;
  397. top: 0;
  398. right: 0;
  399. }
  400. }
  401. .select {
  402. background: rgba(68, 154, 255, 0.1);
  403. border: 1px solid #449AFF;
  404. color: #2983EC;
  405. }
  406. }
  407. .affirm {
  408. width: 100%;
  409. font-size: 24rpx;
  410. color: #666666;
  411. line-height: 28rpx;
  412. text-align: center;
  413. margin-top: 24rpx;
  414. }
  415. }
  416. .sub {
  417. display: flex;
  418. justify-content: space-between;
  419. margin-top: 16rpx;
  420. .cancel {
  421. width: 205rpx;
  422. height: 76rpx;
  423. border-radius: 54rpx;
  424. border: 1px solid #CCCCCC;
  425. font-size: 28rpx;
  426. color: #999999;
  427. display: flex;
  428. align-items: center;
  429. justify-content: center;
  430. }
  431. .submit {
  432. width: 443rpx;
  433. height: 76rpx;
  434. background: linear-gradient(90deg, #77B6FF 0%, #449AFF 100%);
  435. border-radius: 53rpx;
  436. display: flex;
  437. align-items: center;
  438. justify-content: center;
  439. font-size: 28rpx;
  440. color: #FFFFFF;
  441. }
  442. }
  443. }
  444. }
  445. .res {
  446. display: flex;
  447. align-items: center;
  448. justify-content: center;
  449. .content {
  450. width: 570rpx;
  451. background: #FFFFFF;
  452. border-radius: 16rpx;
  453. padding: 0px 24rpx;
  454. padding-bottom: 16rpx;
  455. .title {
  456. width: 100%;
  457. height: 86rpx;
  458. font-size: 32rpx;
  459. color: #333333;
  460. font-weight: 600;
  461. border-bottom: 1px solid #EEEEEE;
  462. display: flex;
  463. align-items: center;
  464. justify-content: center;
  465. }
  466. .center {
  467. font-size: 30rpx;
  468. color: #333333;
  469. line-height: 35rpx;
  470. display: flex;
  471. flex-direction: column;
  472. align-items: center;
  473. justify-content: center;
  474. padding-top: 28rpx;
  475. border-bottom: 1px solid #EEEEEE;
  476. padding-bottom: 40rpx;
  477. margin-bottom: 16rpx;
  478. image {
  479. width: 100rpx;
  480. height: 100rpx;
  481. margin-bottom: 10rpx;
  482. }
  483. }
  484. .btn {
  485. width: 320rpx;
  486. height: 68rpx;
  487. border-radius: 66rpx;
  488. font-size: 28rpx;
  489. color: #FFFFFF;
  490. display: flex;
  491. align-items: center;
  492. justify-content: center;
  493. margin: 0rpx auto;
  494. }
  495. .start {
  496. background: #53CC48;
  497. }
  498. .rest {
  499. background: #FF8024;
  500. }
  501. }
  502. }
  503. }
  504. </style>