| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322 |
- <template>
- <div id="mainPage">
- <img src="../static/images/main/banner.png" height="121" width="414"/>
- <span class="shopNum">
- 俱乐部场馆共 1 处
- </span>
- <ul class="list">
- <li v-for="l in list" @click="goAppoint(l)" v-if="l.Status == 1 && l.ShopID == currShopId">
- <img src="../static/images/main/771.png" height="133" width="130"/>
- <div class="rt">
- <h5>{{l.ShopName}}</h5>
- <span>今日预约名额剩余
- <i v-if="l.RemainOrdernum > 0">{{l.RemainOrdernum}}</i>
- <i v-if="l.RemainOrdernum == 0" class="red">{{l.RemainOrdernum}}</i>
- 人</span>
- <span>地址:{{l.Addr}}</span>
- <em class="green" v-if="l.WxStatus == 1">点击预约</em>
- <em class="red" v-else>不可预约</em>
- </div>
- </li>
- <div class="tips" v-if="list == ''">
- <p style="text-align: center">
- 暂无可预约的门店
- </p>
- </div>
- </ul>
- <bottomTab :curTab="thisTab"></bottomTab>
- </div>
- </template>
- <script>
- import {
- ManagerSelfQuery,
- OrderShopQuery,
- testSelect,
- testTable,
- } from '../api/getApiRes.js'
- import bottomTab from '../components/bottomTab'
- import axios from 'axios';
- let qs = require('qs');
- import Global from '../Global.js'
- export default {
- data() {
- return {
- thisTab: '预约课程',
- shopNum: 0,
- recordNum: 0,
- Dannum: 0,
- GetHotelCounts: 0,
- GetDetectorNum: 0,
- currShopId: 0,
- list: [],
- }
- },
- mounted() {
- this.getManagerSelfQuery();
- },
- destroyed() {
- },
- methods: {
- getManagerSelfQuery() {
- let that = this;
- let param = {
- token: localStorage.token,
- };
- let postdata = qs.stringify(param);
- ManagerSelfQuery(postdata).then(res => {
- let json = res;
- if (json.Code == 0) {
- this.currShopId = json.Rs.ShopId;
- this.getList();
- } else {
- that.$toast.message(json.Memo);
- if (json.Code == 1010) {
- that.$router.push({path: '/login'});
- }
- }
- })
- },
- getList() {
- let that = this;
- let param = {
- token: localStorage.token,
- };
- let postdata = qs.stringify(param);
- OrderShopQuery(postdata).then(res => {
- let json = res;
- if (json.Code == 0) {
- that.list = json.Rs;
- if (that.list) {
- that.shopNum = json.Rs.length;
- }
- } else {
- that.$toast.message(json.Memo);
- }
- })
- },
- onGoNewPage(path) {
- this.$router.push({path: '/' + path});
- },
- goPage(pages) {
- this.$router.push({path: pages});
- },
- goAppoint(row) {
- let that = this;
- if (row.Status == 2) {
- that.Toast(row.name + '不可预约');
- return false
- } else {
- this.$router.push({
- path: '/appoint', query: {
- shopId: row.ShopID
- }
- });
- }
- }
- },
- beforeRouteEnter(to, from, next) {
- next(vm => {
- //因为当钩子执行前,组件实例还没被创建
- // vm 就是当前组件的实例相当于上面的 this,所以在 next 方法里你就可以把 vm 当 this 来用了。
- if (to.name == '') {
- vm.getList();
- }
- });
- },
- watch: {
- $route(to) {
- if (to.name == '') {
- this.getList();
- }
- },
- 'active'() {
- this.getList();
- }
- },
- components: {
- bottomTab
- }
- }
- </script>
- <style scoped>
- #mainPage {
- width: 100%;
- height: 100%;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- background: #f2f2f2;
- }
- .goPage {
- overflow: hidden;
- display: block;
- margin: 0 auto;
- background: #fff;
- height: 50px;
- line-height: 50px;
- padding: 0 20px;
- color: #333;
- font-size: 18px;
- border-bottom: 1px solid #f2f2f2;
- }
- .goPage span {
- float: left;
- }
- .goPage i {
- float: right;
- margin-top: 12px;
- }
- .goPage img {
- overflow: hidden;
- display: block;
- width: 8px;
- height: 14px;
- float: right;
- margin-top: 16px;
- margin-right: 10px;
- }
- .goTitle i {
- margin-top: 10px;
- float: right;
- }
- .mapContainer {
- width: 100%;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- max-height: 317px;
- }
- .shopNum {
- width: 100%;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- font-family: "PingFang SC";
- font-weight: 300;
- font-size: 14px;
- color: #909090;
- text-align: center;
- }
- .list {
- width: 94%;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- padding-left: 3%;
- padding-right: 3%;
- margin-top: 10px;
- padding-bottom: 20px;
- }
- .list li {
- width: 100%;
- height: 133px;
- background: transparent;
- margin-bottom: 20px;
- border-radius: 13px;
- background: #fff;
- box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
- overflow: hidden;
- }
- .list img {
- float: left;
- }
- .list .rt {
- width: 58%;
- float: left;
- padding-left: 15px;
- }
- .list .rt h5 {
- font-family: "PingFang SC";
- font-weight: normal;
- font-size: 18px;
- text-align: left;
- color: #3b3b3b;
- margin: 0;
- margin-top: 18px;
- margin-bottom: 7px;
- }
- .list .rt span {
- width: 100%;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- font-family: "PingFang SC";
- font-weight: normal;
- font-size: 12px;
- text-align: left;
- color: #909090;
- }
- .list .rt em {
- width: 100%;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- font-family: "PingFang SC";
- font-weight: normal;
- font-size: 16px;
- padding-right: 1px;
- margin-top: 5px;
- float: right;
- text-align: right;
- }
- .list .rt em.green {
- color: #37cb00;
- }
- .list .rt em.red {
- color: #F8847F;
- }
- .red {
- color: #F8847F;
- }
- @media only screen and (max-width: 640px) {
- }
- @media only screen and (max-width: 480px) {
- }
- @media only screen and (max-width: 375px) {
- }
- @media only screen and (max-width: 360px) {
- }
- @media only screen and (max-width: 320px) {
- .list .rt {
- width: 52%;
- }
- .list .rt em {
- font-size: 14px;
- }
- }
- @media only screen and (min-width: 641px) {
- }
- </style>
|