123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208 |
- <template>
- <view class="container">
- <view class="list">
- <view @click="detail(item.id,item.admin_id)" class="item" v-for="(item,index) in list" :key="index">
- <view class="top flex flex-y-center box-pack-between">
- <view class="name">{{item.device_type==1?'品生':item.device_type==2?'品生(新)':item.device_type==3?'百励华':item.device_type==4?'百励华-WiFi':''}} </view>
- <view class="flex-y-center">
- <view class="del" @click.stop="del(item.id)">删除</view>
- </view>
- </view>
-
- <view class="content flex flex-y-center box-pack-between" v-if="type==1" hover-class="nav-hover">
- <view class="cell flex flex-y-center">
- <view class="title">门店:</view>
- <view class="desc">{{item.store_title}}</view>
- </view>
- </view>
-
- <view class="content flex flex-y-center box-pack-between" hover-class="nav-hover">
- <view class="cell flex flex-y-center">
- <view class="title">设备号:</view>
- <view class="desc">{{item.device_id}}</view>
- </view>
- <view class="cell flex flex-y-center">
- <view class="title">播报方式:</view>
- <view class="desc">{{item.type==1?'收款播报':'排队播报'}}</view>
- </view>
- </view>
- </view>
- <view class="no-more">没有更多内容了~</view>
- </view>
- <view class="footer-bar">
- <view class="content flex flex-center">
- <navigator :url="`./hornAdd?type=${type}`" class="btn">+新增云喇叭</navigator>
- </view>
- </view>
-
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- store_id: "",
- list: [],
- page: 1,
- is_bottom: false,
- type:2,
- }
- },
- onLoad(options) {
- this.type=options.type;
- this.store_id = uni.getStorageSync("store_id");
- },
- onShow() {
- this.getData(1)
- },
- onReachBottom() {
- if (!this.is_bottom) {
- this.getData(this.page + 1)
- }
- },
-
- methods: {
- detail(id,admin_id){
- let type=this.type;
- uni.navigateTo({
- url:`./hornAdd?id=${id}&type=${type}`
- })
- },
-
- del(id) {
- uni.showModal({
- title: '提示',
- content: '是否要删除?',
- showCancel: true,
- cancelText: '取消',
- confirmText: '确定',
- success: res => {
- if (res.confirm) {
- this.request({
- url: 'Smdcshop/horn_delect',
- data: {
- id: id,
- },
- }).then(res => {
- console.log(res, "res")
- if (res.code === 200 || res.code === "200") {
- uni.showToast({
- title: "删除成功",
- icon: "none",
- })
- setTimeout(() => {
- this.getData(1)
- }, 2000)
- }
- }).catch((res) => {
- uni.showToast({
- title: res.message,
- icon: "none",
- })
- });
- }
- },
- fail: () => {},
- complete: () => {}
- });
- },
- getData(page) {
- if (page == 1) {
- this.list = []
- this.page = 1
- this.is_bottom = false
- }
- this.request({
- url: 'Smdcshop/horn_index',
- data: {
- admin_id: uni.getStorageSync("admin_id"),
- page,
- limit: 10,
-
- // store_id: uni.getStorageSync("store_id")
- }
- }).then(res => {
- if (res.code == 200 && res.data.length) {
- this.list = this.list.concat(res.data)
- this.page = page
- } else {
- this.is_bottom = true
- }
- })
- }
- }
- }
- </script>
- <style>
- @import url("./static/css/common.css");
- .del {
- height: 44rpx;
- line-height: 44rpx;
- padding: 0 15rpx;
- font-size: 24rpx;
- background-color: #FF5722;
- margin-right: 25rpx;
- color: #fff;
- border-radius: 4rpx;
- }
- page {
- background-color: #F4F5F7;
- }
- .list {
- padding: 30rpx 25rpx;
- }
- .list .item {
- border-radius: 8rpx;
- overflow: hidden;
- padding-left: 30rpx;
- border-left: 8rpx solid #247EFF;
- background-color: #fff;
- margin-bottom: 30rpx;
- }
- .list .item .top {
- height: 80rpx;
- border-bottom: 1rpx solid #f5f5f5;
- }
- .list .item .top .name {
- font-size: 30rpx;
- line-height: 80rpx;
- font-weight: bold;
- }
- .list .item .top .type-btn {
- zoom: 0.7;
- margin-right: 25rpx;
- }
- .list .item .content {
- padding: 20rpx 0 24rpx;
- }
- .list .item .content .cell {
- flex: none;
- /* width: 50%; */
- box-sizing: border-box;
- padding-right: 30rpx;
- font-size: 26rpx;
- line-height: 37rpx;
- color: #666;
- }
- .list .item .content .cell .title {
- color: #99A0AD;
- }
- </style>
|