| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637 |
- <template>
- <view class="shop">
- <view class="top"></view>
- <view class="head">
- <span class="cuIcon-back" @click="back"></span>
- <view class="case">
- 门店详情
- </view>
- </view>
- <view class="center">
- <view class="data">
- <view class="title">
- 门店信息
- <span></span>
- </view>
- <view class="content">
- <view class="img">
- <image :src="shopData.logo" mode=""></image>
- </view>
- <view class="name">
- {{shopData.storeName}}
- <view class="avg">
- <u-rate :count="count" v-model="shopData.grade" active-icon="heart-fill" inactive-icon="heart"
- :disabled="true"></u-rate>
- <span>{{shopData.grade}}分</span>
- </view>
- <span v-if="shopData.merchantStatus == 1">营业中</span>
- <span v-if="shopData.merchantStatus == 3" style="color: #FF8024;">歇业中</span>
- <span v-if="shopData.merchantStatus == 2" style="color: #999999;">门店关闭</span>
- </view>
- </view>
- <view class="address">
- <view class="area">{{shopData.locality}}</view>
- <view class="details">
- <span>{{shopData.address}}</span>
- <image src="/static/index/addressblue.png" mode=""></image>
- </view>
- </view>
- <view class="institution">
- 经营机构 <span>{{shopData.corporateName}}</span>
- </view>
- </view>
- </view>
- <view class="food">
- <view class="business" @click="isPopup = true">
- <image src="/static/index/business.png" mode=""></image>营业管理
- </view>
- <view class="edit" @click="edit">
- <image src="/static/index/edit.png" mode=""></image>编辑门店
- </view>
- </view>
- <view class="popup" v-if="isPopup">
- <view class="model">
- <view class="title">
- 营业管理
- <image src="/static/index/cut.png" mode="" @click="closePopup"></image>
- </view>
- <view class="btnList">
- <view class="box">
- <view class="btn" :class="currentIndex==index?'select':''" v-for="(item,index) in btnList" :key="index"
- @click="toggle(item,index)">
- {{item.name}}
- <image src="/static/index/select.png" mode="" v-if="currentIndex==index"></image>
- </view>
- </view>
- <view class="affirm" v-if="currentIndex ==1">
- 当前门店确定歇业?
- </view>
- <view class="affirm" v-if="currentIndex ==2">
- 关闭门店前需保证没有还未使用的有效服务券哦!
- </view>
- </view>
- <view class="sub">
- <view class="cancel" @click="closePopup">
- 取消
- </view>
- <view class="submit" @click="changeStatus">
- 确定
- </view>
- </view>
- </view>
- </view>
- <view class="popup res" v-if="isSuccess">
- <view class="content">
- <view class="title">
- <span v-show="shopStatus == 1">正常营业</span>
- <span v-show="shopStatus == 3">门店歇业</span>
- <span v-show="shopStatus == 2">关闭门店</span>
- </view>
- <view class="center">
- <image src="/static/index/start.png" mode="" v-show="shopStatus == 1"></image>
- <image src="/static/index/close.png" mode="" v-show="shopStatus == 2"></image>
- <image src="/static/index/rest.png" mode="" v-show="shopStatus == 3"></image>
- <span v-show="shopStatus == 1">恭喜发财,开业大吉!</span>
- <span v-show="shopStatus == 2">当前门店关闭成功</span>
- <span v-show="shopStatus == 3">当前门店已歇业</span>
- <view class="error" v-show="shopStatus == 4">
- 当前门店还存在有效服务券<br />
- 暂时无法关闭门店
- </view>
- </view>
- <view class="btn" :class="dynamicClass" @click="isSuccess = false">
- 确定
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- btnList: [{
- name: '正常营业',
- },
- {
- name: '门店歇业',
- },
- {
- name: '关闭门店',
- }
- ],
- currentIndex: 0,
- isPopup: false,
- dynamicClass: 'start',
- status: 3,
- isSuccess: false,
- count: 5,
- shopData: {},
- shopStatus: null,
- id: ''
- }
- },
- methods: {
- edit() {
- uni.navigateTo({
- url: '/pages/store/editStore'
- })
- },
- //返回
- back() {
- uni.switchTab({
- url:'/pages/index/index'
- })
- },
- //切换状态
- toggle(item, index) {
- this.currentIndex = index
- },
- changeStatus() {
- if (this.currentIndex == 0) {
- let data = {
- id: this.id,
- merchantStatus: 1
- }
- this.$http.post("/merchant/localMerchantInfo/editStatus", data).then(res => {
- if (res.data.code == 200) {
- this.isPopup = false
- this.getShopData()
- this.isSuccess = true
- }else {
- uni.showToast({
- icon: 'none',
- title: res.data.message
- })
- }
- })
- } else if (this.currentIndex == 1) {
- let data = {
- id: this.id,
- merchantStatus: 3
- }
- this.$http.post("/merchant/localMerchantInfo/editStatus", data).then(res => {
- if (res.data.code == 200) {
- this.isPopup = false
- this.getShopData()
- this.isSuccess = true
- }else {
- uni.showToast({
- icon: 'none',
- title: res.data.message
- })
- }
- })
- } else if (this.currentIndex == 2) {
- let data = {
- id: this.id,
- merchantStatus: 2
- }
- this.$http.post("/merchant/localMerchantInfo/editStatus", data).then(res => {
- if (res.data.code == 200) {
- this.isPopup = false
- this.getShopData()
- this.isSuccess = true
- } else {
- uni.showToast({
- icon: 'none',
- title: res.data.message
- })
- }
- })
- }
- },
- getShopData() {
- this.$http.get("/merchant/localMerchantInfo/queryById?id=" + this.id).then(res => {
- if (res.data.code == 200) {
- this.shopData = res.data.result
- this.shopStatus = res.data.result.merchantStatus
- this.currentStatus()
- }
- })
- },
- currentStatus() {
- if (this.shopStatus == 1) {
- this.currentIndex = 0
- this.dynamicClass = 'start'
- } else if (this.shopStatus == 2) {
- this.currentIndex = 2
- this.dynamicClass = 'close'
- } else if (this.shopStatus == 3) {
- this.currentIndex = 1
- this.dynamicClass = 'rest'
- }
- },
- closePopup() {
- this.isPopup = false
- this.currentStatus()
- }
- },
- mounted() {
- this.getShopData()
- },
- onShow() {
- let that = this
- uni.getStorage({
- key: 'login_user_info',
- success: function(res) {
- that.id = res.data.merchantId
- }
- })
- }
- }
- </script>
- <style lang="scss" scoped>
- page {
- width: 100%;
- height: 100%;
- }
- .shop {
- width: 100%;
- height: 100%;
- background: #F7F8FC;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- /*#ifdef APP-PLUS*/
- .top {
- width: 100%;
- height: var(--status-bar-height);
- background: linear-gradient(180deg, #FFF9F1 0%, #FFFFFF 100%);
- }
- /*#endif*/
- .head {
- width: 100%;
- height: 112rpx;
- padding: 20rpx;
- display: flex;
- align-items: center;
- background: linear-gradient(180deg, #FFF9F1 0%, #FFFFFF 100%);
- position: relative;
- .cuIcon-back {
- font-size: 40rpx;
- margin-right: 40rpx;
- }
- .case {
- position: absolute;
- left: 50%;
- transform: translateX(-50%);
- font-size: 36rpx;
- font-weight: 600;
- }
- }
- .center {
- width: 100%;
- flex: 1;
- padding: 0px 24rpx;
- .data {
- width: 100%;
- background: #FFFFFF;
- box-shadow: 0px 2rpx 8rpx 0px rgba(214, 225, 237, 0.1);
- border-radius: 16rpx;
- margin: 20rpx auto;
- padding: 20rpx 16rpx;
- .title {
- font-size: 28rpx;
- position: relative;
- margin-bottom: 16rpx;
- span {
- display: block;
- width: 108rpx;
- height: 5rpx;
- background: linear-gradient(90deg, #88BFFF 0%, #449AFF 100%);
- border-radius: 8rpx;
- position: absolute;
- bottom: 5rpx;
- }
- }
- .content {
- display: flex;
- height: 140rpx;
- .img {
- margin-right: 20rpx;
- width: 140rpx;
- height: 140rpx;
- image {
- width: 140rpx;
- height: 140rpx;
- }
- }
- .name {
- height: 100%;
- font-size: 32rpx;
- font-weight: 600;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- .avg {
- height: 23rpx;
- display: flex;
- align-items: center;
- margin-top: 8rpx;
- span {
- font-size: 32rpx;
- color: #FD4912;
- margin-left: 10rpx;
- }
- }
- span {
- display: block;
- height: 49rpx;
- font-size: 34rpx;
- color: #53CC48;
- line-height: 40rpx;
- }
- }
- }
- .address {
- margin-top: 32rpx;
- border-bottom: 1px solid #eee;
- padding-bottom: 16rpx;
- .area {
- height: 39rpx;
- font-size: 26rpx;
- color: #333333;
- line-height: 30rpx;
- }
- .details {
- display: flex;
- justify-content: space-between;
- span {
- display: block;
- width: 534rpx;
- font-size: 24rpx;
- color: #666666;
- line-height: 28rpx;
- margin-top: 8rpx;
- }
- image {
- width: 48rpx;
- height: 48rpx;
- }
- }
- }
- .institution {
- height: 55rpx;
- font-size: 26rpx;
- color: #232832;
- border-bottom: 1px solid #eee;
- padding-bottom: 16rpx;
- margin-top: 16rpx;
- span {
- margin-left: 20rpx;
- }
- }
- }
- }
- .food {
- width: 100%;
- height: 112rpx;
- background: #FFFFFF;
- display: flex;
- justify-content: space-around;
- align-items: center;
- font-size: 28rpx;
- color: #FFFFFF;
- image {
- width: 40rpx;
- height: 40rpx;
- margin-right: 10rpx;
- }
- .business {
- width: 324rpx;
- height: 76rpx;
- background: linear-gradient(90deg, #77B6FF 0%, #449AFF 100%);
- border-radius: 12rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- .edit {
- width: 324rpx;
- height: 76rpx;
- background: linear-gradient(90deg, #FFA05B 0%, #FF7918 100%);
- border-radius: 12rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- }
- .popup {
- width: 100vw;
- height: 100vh;
- position: fixed;
- top: 0;
- left: 0;
- background: rgba(0, 0, 0, 0.4);
- display: flex;
- align-items: flex-end;
- .model {
- width: 100%;
- background-color: #fff;
- border-radius: 20rpx 20rpx 0rpx 0rpx;
- padding: 0rpx 24rpx;
- padding-bottom: 20rpx;
- .title {
- width: 100%;
- height: 86rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- border-bottom: 1px solid #EEEEEE;
- position: relative;
- image {
- width: 40rpx;
- height: 40rpx;
- position: absolute;
- right: 0px;
- }
- }
- .btnList {
- width: 100%;
- height: 193rpx;
- border-bottom: 1px solid #EEEEEE;
- padding-top: 24rpx;
- .box {
- display: flex;
- justify-content: space-between;
- .btn {
- width: 196rpx;
- height: 66rpx;
- border-radius: 4rpx;
- border: 1px solid #C2C2C2;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 26rpx;
- position: relative;
- image {
- width: 24rpx;
- height: 24rpx;
- position: absolute;
- top: 0;
- right: 0;
- }
- }
- .select {
- background: rgba(68, 154, 255, 0.1);
- border: 1px solid #449AFF;
- color: #2983EC;
- }
- }
- .affirm {
- width: 100%;
- font-size: 24rpx;
- color: #666666;
- line-height: 28rpx;
- text-align: center;
- margin-top: 24rpx;
- }
- }
- .sub {
- display: flex;
- justify-content: space-between;
- margin-top: 16rpx;
- .cancel {
- width: 205rpx;
- height: 76rpx;
- border-radius: 54rpx;
- border: 1px solid #CCCCCC;
- font-size: 28rpx;
- color: #999999;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .submit {
- width: 443rpx;
- height: 76rpx;
- background: linear-gradient(90deg, #77B6FF 0%, #449AFF 100%);
- border-radius: 53rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 28rpx;
- color: #FFFFFF;
- }
- }
- }
- }
- .res {
- display: flex;
- align-items: center;
- justify-content: center;
- .content {
- width: 570rpx;
- background: #FFFFFF;
- border-radius: 16rpx;
- padding: 0px 24rpx;
- padding-bottom: 16rpx;
- .title {
- width: 100%;
- height: 86rpx;
- font-size: 32rpx;
- color: #333333;
- font-weight: 600;
- border-bottom: 1px solid #EEEEEE;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .center {
- font-size: 30rpx;
- color: #333333;
- line-height: 35rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- padding-top: 28rpx;
- border-bottom: 1px solid #EEEEEE;
- padding-bottom: 40rpx;
- margin-bottom: 16rpx;
- image {
- width: 100rpx;
- height: 100rpx;
- margin-bottom: 10rpx;
- }
- }
- .btn {
- width: 320rpx;
- height: 68rpx;
- border-radius: 66rpx;
- font-size: 28rpx;
- color: #FFFFFF;
- display: flex;
- align-items: center;
- justify-content: center;
- margin: 0rpx auto;
- }
- .start {
- background: #53CC48;
- }
- .close {
- background: #449AFF;
- }
- .rest {
- background: #FF8024;
- }
- }
- }
- }
- </style>
|