123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688 |
- <template>
- <view class="equipment-home">
- <view class="top-bg">
- <view class="status_bar">
- </view>
- <view class="title">
- <view class="arrow" @click="backPage()">
- <image src="../../static/image/white-left.png" mode=""></image>
- </view>
- 氢予健康
- </view>
- </view>
- <view class="top">
- <view class="name">
- <image src="../../static/image/name1.png" mode="" class="icon"></image>
- 站点名称:{{siteDetail.name}}
- </view>
- <view class="name">
- <image src="../../static/image/address1.png" mode="" class="icon"></image>
- 详细地址:{{siteDetail.address}}
- </view>
- <view class="name">
- <image src="../../static/image/guanliyuan.png" mode="" class="icon"></image>
- 站长:{{siteDetail.contact_name}}
- </view>
- <view class="name">
- <image src="../../static/image/phone1.png" mode="" class="icon"></image>
- 服务电话:{{siteDetail.contact_mobile}}
- </view>
- </view>
- <view class="residue-time" v-if="sytime!==0">
- 吸氢卡剩余时长<text class="surplus-time">{{sytime}}</text>分钟<text style="float: right;" @click="lookDetail">查看详情></text>
- </view>
- <view class="title1">
- <view class="title1-left" @click="changeTab(1)">
- <view :class="currentTab==1 ? 'title-active' : 'title-active1'">
- 设备列表
- </view>
- </view>
- <view class="title1-right" @click="changeTab(2)">
- <view :class="currentTab==2 ? 'title-active' : 'title-active1'">
- 优惠套餐
- </view>
- </view>
- </view>
- <!-- 设备列表 -->
- <view class="" v-if="currentTab==1">
- <view class="list" v-for="(item,index) in equipmentList" :key='index' @click="equipmentDetail(item.id)">
- <view class="list-title">
- 设备编号:<text style="color: #ff9c45;">{{item.no ? item.no : '--'}}</text>
- <text class="iconfont icon-iconfontjiantou2"></text>
- </view>
- <view class="list-text">
- <view class="left">
- <image src="../../static/image/name.png" mode=""></image>
- <!-- <view class="text">
- 水位:{{item.water_level_warning_text}}
- </view> -->
- </view>
- <view class="right" v-if="!item.type || item.type==0">
- <view class="right-text">
- <view class="name">
- 工作状态
- </view>
- <view class="status">
- {{item.a_test ? item.a_test : '--'}}
- </view>
- </view>
- <view class="right-text">
- <view class="name">
- 设备状态
- </view>
- <view class="status">
- {{item.is_line_text ? item.is_line_text : '--'}}
- </view>
- </view>
- </view>
- <view class="right" v-else>
- <view class="right-text">
- <view class="name">
- A端口
- </view>
- <view class="status">
- {{item.a_test ? item.a_test : '--'}}
- </view>
- </view>
- <view class="right-text">
- <view class="name">
- B端口
- </view>
- <view class="status">
- {{item.b_test ? item.b_test : '--'}}
- </view>
- </view>
- <view class="right-text">
- <view class="name">
- 状态
- </view>
- <view class="status">
- {{item.is_line_text ? item.is_line_text : '--'}}
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="none" v-if="equipmentList.length==0">
- <image src="../../static/image/null.png"></image>
- <text>暂无设备列表</text>
- </view>
- </view>
- <!-- 优惠套餐 -->
- <view class="" v-if="currentTab==2">
- <view class="box">
- <view class="card" v-for="(item,index) in cardList" :key='index'>
- <view :class="card_id==item.id ? 'active' : 'card-list-item'" @click="changeCard(item.id)">
- <view class="right-tips" v-if="item.discount!==0">限时{{item.discount/10}}折</view>
- <view class="card-title">
- <!-- <text>30次/5天</text> -->
- <!-- <text>7天不限次</text> -->
- <text>{{item.time}}分钟时长卡</text>
- </view>
- <view class="card-money">
- <text class="money-num">{{item.price}}</text>元
- <text class="yuanjia">{{item.money}}元</text>
- </view>
- </view>
- </view>
- <view class="buy-buttom" @click="buyButtom">购买</view>
- <view class="none" v-if="cardList.length==0">
- <image src="../../static/image/null.png"></image>
- <text>暂无优惠套餐</text>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- var app = getApp()
- export default {
- data() {
- return {
- shop_id: '',
- siteDetail: '',
- equipmentList: [1, 2, 1, 1, 1, 3],
- currentTab: 1,
- cardList: [], //卡券列表
- card_id: 1,
- sytime: 0
- }
- },
- onLoad(options) {
- uni.showLoading()
- console.log(options, '0-0-0-0-0-0-0-0-0-0-0-0-')
- let params = {
- id: options.id
- }
- this.shop_id = options.id
- this.getSiteDetail(params)
- this.getCardsList(params)
- this.getEquipmentList(options.id)
- this.getSurplusTime(options.id)
- },
- methods: {
- //站点详细信息
- getSiteDetail: function(params) {
- uni.showLoading()
- app.request('/shops/' + params.id, '', 'get').then(res => {
- console.log(res)
- this.siteDetail = res.data.data.data
- app.globalData.a_minute_money = res.data.data.data.a_minute_money
- app.globalData.b_minute_money = res.data.data.data.b_minute_money
- app.globalData.ab_minute_money = res.data.data.data.ab_minute_money
- uni.hideLoading()
- })
- },
- //卡券列表
- getCardsList: function(params) {
- let data = {
- shop_id: params.id
- }
- app.request('/shop/cards', data, 'get').then(res => {
- console.log(res, 'cardlist')
- this.cardList = res.data.data.data
- })
- },
- //剩余时长
- getSurplusTime: function(id) {
- app.request('/shop/me-card?shop_id=' + id, '', 'get').then(res => {
- console.log(res.data.data.time, 'shengyushichang ')
- this.sytime = res.data.data.time
- console.log(this.sytime, 'pppppp')
- })
- },
- //设备列表
- getEquipmentList: function(e) {
- uni.showLoading()
- let params = {
- shop_id: e
- }
- app.request('/devices', params, 'get').then(res => {
- this.equipmentList = res.data.data.data
- uni.hideLoading()
- console.log(this.equipmentList, '设备列表')
- })
- },
- //设备详情
- equipmentDetail: function(e) {
- uni.navigateTo({
- url: './service?id=' + e
- })
- },
- //tab切换
- changeTab: function(e) {
- this.currentTab = e
- },
- //选择优惠券
- changeCard: function(e) {
- console.log(e, '选择优惠券')
- this.card_id = e
- },
- //购买优惠券
- buyButtom: function(e) {
- let data = {
- shop_id: this.shop_id,
- card_id: this.card_id
- }
- app.request('/shop/card', data, 'post').then(res => {
- console.log(res.data.data, '下单')
- let data = res.data.data
- if (res.statusCode == 200) {
- uni.requestPayment({
- provider: data.provider,
- timeStamp: data.timeStamp,
- nonceStr: data.nonceStr,
- package: data.package,
- signType: 'MD5',
- paySign: data.paySign,
- success: function(res) {
- console.log('success:' + JSON.stringify(res));
- uni.reLaunch({
- url: '../mine/pay_success'
- })
- },
- fail: function(err) {
- console.log('fail:' + JSON.stringify(err));
- }
- })
- }
- })
- },
- //查看订单吸氢时长
- lookDetail: function() {
- uni.navigateTo({
- url: '../mine/card_use?shop_id=' + this.shop_id
- })
- },
- backPage: function() {
- uni.navigateBack()
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .equipment-home {
- width: 100%;
- .top-bg {
- // background-color: #ff964a;
- background-color: $mine-background-color;
- border-radius: 0 0 40upx 40upx;
- height: 350upx;
- .status_bar {
- height: var(--status-bar-height);
- width: 100%;
- }
- .title {
- text-align: center;
- line-height: 100upx;
- height: 100upx;
- font-size: 38upx;
- color: #FFFFFF;
- position: relative;
- .arrow {
- position: absolute;
- width: 100upx;
- height: 100upx;
- left: 10upx;
- top: 25upx;
- image {
- float: left;
- height: 50upx;
- width: 50upx;
- }
- }
- }
- }
- .top {
- margin: 30upx;
- margin-top: -130upx;
- padding: 30upx;
- background-color: #FFFFFF;
- border-radius: 12upx;
- .name {
- // height: 50upx;
- line-height: 50upx;
- font-size: 30upx;
- color: #555555;
- image {
- height: 30upx;
- width: 30upx;
- margin-right: 20upx;
- display: inline-block;
- vertical-align: top;
- margin-top: 10upx;
- }
- }
- }
- .residue-time {
- padding: 20rpx 30rpx;
- margin: 0 30rpx;
- color: #FFFFFF;
- font-size: 28rpx;
- // color: #f0d84d;
- background-image: linear-gradient(to right, #F0AD4E, #f0d84d);
- border-radius: 12rpx;
- }
- .surplus-time {
- font-size: 34rpx;
- font-weight: 600;
- display: inline-block;
- margin: 0 5rpx;
- }
- .title1 {
- height: 100upx;
- // line-height: 70upx;
- font-size: 30upx;
- font-weight: bold;
- color: #555555;
- margin: 50upx 30upx 30upx;
- padding-left: 20upx;
- background-color: #FFFFFF;
- text-align: center;
- display: flex;
- .title1-left {
- flex: 1;
- }
- .title-active {
- margin: 0 auto;
- margin-top: 10rpx;
- height: 80;
- line-height: 80rpx;
- width: 80%;
- background-color: #027675;
- border-radius: 50rpx;
- color: #FFFFFF;
- }
- .title-active1 {
- margin: 0 auto;
- margin-top: 20rpx;
- height: 60rpx;
- line-height: 60rpx;
- width: 70%;
- // background-color: #16DAD8;
- border-radius: 20rpx;
- }
- .title1-right {
- flex: 1;
- }
- }
- .list {
- margin: 30upx;
- background-color: #FFFFFF;
- padding: 30upx;
- border-radius: 12upx;
- .list-title {
- border-bottom: solid 1upx #F1F1F1;
- color: #555555;
- font-size: 26upx;
- font-weight: bold;
- height: 70upx;
- line-height: 70upx;
- .icon-iconfontjiantou2 {
- float: right;
- }
- }
- .list-text {
- display: flex;
- padding: 30upx 0;
- .left {
- flex: 0 0 150upx;
- text-align: center;
- margin-right: 30upx;
- .text {
- font-size: 24upx;
- text-align: center;
- height: 50upx;
- line-height: 50upx;
- }
- image {
- margin-top: 20upx;
- height: 100upx;
- width: 100upx;
- }
- }
- .right {
- flex: 1;
- display: flex;
- .right-text {
- flex: 1;
- vertical-align: top;
- text-align: center;
- .name {
- font-size: 30upx;
- color: #808080;
- height: 70upx;
- line-height: 70upx;
- }
- .status {
- height: 90upx;
- line-height: 90upx;
- font-size: 32upx;
- font-weight: bold;
- }
- }
- }
- }
- }
- // 优惠套餐
- .box {
- /* width: 100%; */
- /* height: 100%; */
- /* display: flex;
- flex-direction: column;
- align-items: center; */
- padding-bottom: 20upx;
- }
- .card {
- margin: 30upx;
- }
- .card-list1 {
- position: relative;
- border: solid 5upx #eceaea;
- background-color: #fff;
- padding: 30upx;
- /* background: #ffe98f;
- border: solid 5upx var(--globleColor); */
- border-radius: 20upx;
- }
- .active {
- position: relative;
- padding: 30upx;
- border-radius: 20upx;
- color: #FFFFFF;
- background-image: linear-gradient(to right, #3bba91, #027675);
- border: solid 5upx var(--globleColor);
- }
- .card-title {
- font-size: 30upx;
- font-weight: 500;
- }
- .card-tips {
- font-size: 26upx;
- margin-top: 10upx;
- }
- .card-money {
- font-size: 26upx;
- margin-top: 30upx;
- }
- .money-num {
- font-size: 50upx;
- font-weight: bold;
- }
- .yuanjia {
- color: #2c2c6c;
- display: inline-block;
- margin-left: 10upx;
- text-decoration: line-through;
- }
- .card-list {
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- flex-direction: row;
- }
- .card-content {
- margin: 30upx;
- }
- .card-list-item {
- position: relative;
- flex: 0 0 45%;
- border: solid 5upx #eceaea;
- padding: 20upx;
- border-radius: 30upx;
- background-color: #fff;
- margin-top: 30upx;
- }
- .active1 {
- position: relative;
- flex: 0 0 45%;
- padding: 20upx 0;
- border-radius: 30upx;
- margin-top: 30upx;
- background: #3bba91;
- border: solid 5upx $mine-background-color
- }
- .right-tips {
- position: absolute;
- height: 40upx;
- padding: 0 30upx;
- font-size: 22upx;
- line-height: 40upx;
- color: #ffffff;
- font-weight: bold;
- background-color: rgb(235, 58, 4);
- border-radius: 0 20upx;
- top: 0;
- right: 0;
- }
- .item-money {
- margin-top: 10upx;
- }
- .buy-buttom {
- height: 100upx;
- width: 80%;
- margin: 0 auto;
- margin-top: 50upx;
- background-color: #027675;
- color: #FFFFFF;
- text-align: center;
- border-radius: 50upx;
- line-height: 100upx;
- font-size: 32upx;
- font-weight: bold;
- }
- .box .hot {
- /* padding-top: ; */
- width: 690upx;
- padding: 30upx 0;
- /* height:296upx; */
- background: rgba(255, 255, 255, 1);
- border-radius: 20upx;
- background-size: 100% 100%;
- display: flex;
- flex-direction: column;
- justify-content: center;
- box-sizing: border-box;
- padding-left: 47upx;
- margin-top: 30upx;
- }
- .box .hot .title {
- font-size: 38upx;
- font-family: PingFang SC;
- font-weight: bold;
- color: rgba(42, 42, 42, 1);
- }
- .box .hot .frequency {
- font-size: 32upx;
- font-family: PingFang SC;
- color: rgba(153, 153, 153, 1);
- }
- .box .hot .info {
- display: flex;
- align-items: flex-end;
- padding: 19upx 0upx;
- }
- .box .hot .info text:nth-of-type(1) {
- font-size: 46upx;
- font-family: PingFang SC;
- font-weight: bold;
- color: rgba(42, 42, 42, 1);
- }
- .box .hot .info text:nth-of-type(2) {
- font-size: 26upx;
- font-family: PingFang SC;
- color: rgba(153, 153, 153, 1);
- padding-left: 19upx;
- padding-bottom: 6upx;
- text-decoration: line-through;
- }
- .box .hot .buy {
- width: 160upx;
- height: 70upx;
- margin-bottom: 20upx;
- background: #5E5D5D;
- /* background:var(--globleColor); */
- border-radius: 40upx;
- display: flex;
- /* margin-left: 20upx; */
- align-items: center;
- justify-content: center;
- font-size: 32upx;
- font-family: PingFang SC;
- color: rgba(255, 255, 255, 1);
- }
- .box .hot .info .buy text {
- font-size: 26upx;
- color: #ffffff;
- }
- .none {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- width: 100%;
- margin-top: 30%;
- height: 90%;
- }
- .none image {
- height: 200upx;
- width: 200upx;
- }
- .none text {
- /* padding-right: 70upx; */
- padding-top: 50upx;
- }
- }
- </style>
|