diff --git a/Utils/Api.js b/Utils/Api.js index ce03a87..0e52564 100644 --- a/Utils/Api.js +++ b/Utils/Api.js @@ -310,5 +310,17 @@ export const getNewRateApplyDetail = params => { export const getRateApplyDetail = params => { return POST('GET', `${base}/merRate/getRateApplyDetail`, params).then(res => res.data); } +// # 设备绑定门店 +export const devicebindStore = params => { + return POST('POST', `${base}/device/bindStore`, params).then(res => res.data); +} + +//# 设备解绑门店 +export const unbindStore = params => { + return POST('POST', `${base}/device/unbindStore`, params).then(res => res.data); +} + + + diff --git a/pages/index/merchant-details/merchant-details.vue b/pages/index/merchant-details/merchant-details.vue index ff614f3..1e9d76f 100644 --- a/pages/index/merchant-details/merchant-details.vue +++ b/pages/index/merchant-details/merchant-details.vue @@ -92,7 +92,7 @@ - + @@ -112,8 +112,8 @@ - 修改结算 - 修改费率 + 修改结算 + 修改费率 @@ -228,9 +228,9 @@ }) }, //跳转设备管理 - jumpService(item, items) { + jumpService(item) { uni.navigateTo({ - url: '../serviceBuild/serviceBuild?storeid=' + item + '&type=' + items + url: '/pages/index/mineService/mineService?id=6' + '&storeid=' + item }) }, //更换结算信息 @@ -238,12 +238,12 @@ uni.navigateTo({ url: '/pages/index/updateSettlement/updateSettlement?id=' + this.merid }) - }, - //修改费率 - updatemodifyRate(){ - uni.navigateTo({ - url:'/pages/index/modifyRate/modifyRate?id=' + this.merid - }) + }, + //修改费率 + updatemodifyRate() { + uni.navigateTo({ + url: '/pages/index/modifyRate/modifyRate?id=' + this.merid + }) }, //跳转绑定二维码 jumpBindScan(item, items) { diff --git a/pages/index/mineService/mineService.vue b/pages/index/mineService/mineService.vue index 394a827..625d999 100644 --- a/pages/index/mineService/mineService.vue +++ b/pages/index/mineService/mineService.vue @@ -9,7 +9,7 @@ + @click="assignOrder(item.deviceNo,item.bindStatus)"> 编号: {{item.deviceNo}} @@ -24,6 +24,13 @@ 未绑定 + + + 商户名称: {{item.merName}} + + + 名店名称: {{item.storeName}} + 设备类型: {{item.deviceType | toFilter()}} @@ -36,7 +43,9 @@ import { getDeviceList, assignOrder, - replace + replace, + devicebindStore, + unbindStore } from '../../../Utils/Api.js'; let app = getApp(); export default { @@ -47,8 +56,8 @@ orderNo: '', //订单号 buildStatus: false, //是否分配 deviceNo: '', // 设备编号 - assderid: '', //分配id - storeid:'', //门店id + assderid: '', //分配id + storeid: '', //门店id pageNum: 1, pagesize: 10, isLoadMore: false, //是否加载中 @@ -82,7 +91,7 @@ this.buildStatus = true; this.getDeviceList(); } - if (this.sourceId == 2 || this.sourceId == 4) { + if (this.sourceId == 2 || this.sourceId == 4 || this.sourceId == 6) { this.buildStatus = false; this.getDeviceList(); } @@ -94,12 +103,18 @@ methods: { //查询列表 getDeviceList() { + let storeno; + if (this.sourceId == 6) { + storeno = ''; + } else { + storeno = this.storeid; + } let datas = { pageNum: this.pageNum, pageSize: this.pagesize, buildStatus: this.buildStatus, deviceNo: this.deviceNo, - storeId: this.storeid + storeId: storeno } getDeviceList(datas).then(res => { if (res.return_code == '000000' && res.return_data.list != '') { @@ -122,7 +137,7 @@ this.getDeviceList(); }, //分配设备 - assignOrder(item) { + assignOrder(item, item1) { if (this.sourceId == 2) { uni.showModal({ title: '温馨提示', @@ -160,6 +175,75 @@ }); } + if (this.sourceId == 6) { + uni.showModal({ + title: '温馨提示', + content: '是否分配当前设备', + success: (res) => { + if (res.confirm) { + uni.showLoading({ + title: '加载中' + }) + let datas = { + "storeId": this.storeid, + "deviceNo": item + } + devicebindStore(datas).then(res => { + uni.hideLoading(); + if (res.return_code == '000000') { + uni.showToast({ + title: '分配成功', + duration: 2000, + icon: 'none' + }) + uni.navigateBack({}) + } else { + uni.showToast({ + title: res.return_msg, + duration: 2000, + icon: 'none' + }) + } + }) + } else if (res.cancel) {} + } + }); + } + + if (this.sourceId == 3 && item1) { + uni.showModal({ + title: '温馨提示', + content: '是否解除当前设备', + success: (res) => { + if (res.confirm) { + uni.showLoading({ + title: '加载中' + }) + let datas = { + "deviceNo": item + } + unbindStore(datas).then(res => { + uni.hideLoading(); + if (res.return_code == '000000') { + uni.showToast({ + title: '解除成功', + duration: 2000, + icon: 'none' + }) + uni.navigateBack({}) + } else { + uni.showToast({ + title: res.return_msg, + duration: 2000, + icon: 'none' + }) + } + }) + } else if (res.cancel) {} + } + }); + } + if (this.sourceId == 4) { uni.showModal({ title: '温馨提示', @@ -264,8 +348,8 @@ width: calc(100% - 60rpx); display: flex; align-items: center; - margin-bottom: 10px; - padding: 0 0rpx 30rpx 14rpx; + margin-bottom: 4px; + padding: 0 0rpx 2rpx 6rpx; } .xfimg { @@ -274,4 +358,4 @@ position: fixed; right: 40rpx; } - + \ No newline at end of file diff --git a/pages/index/rateReview/rateReview.vue b/pages/index/rateReview/rateReview.vue index 2f87ed3..69d8519 100644 --- a/pages/index/rateReview/rateReview.vue +++ b/pages/index/rateReview/rateReview.vue @@ -8,7 +8,7 @@ 费率信息审核 - + {{item.rateTypeName}} {{item.ratePct}} (单位: 百分之一) diff --git a/pages/tabBar/home/home.vue b/pages/tabBar/home/home.vue index 56c1f08..2c51860 100644 --- a/pages/tabBar/home/home.vue +++ b/pages/tabBar/home/home.vue @@ -140,7 +140,7 @@ }, { title: '我的设备', - url: '../../index/mineService/mineService?id=1', + url: '../../index/mineService/mineService?id=1&storeid=', img: '../../../static/img/casihr.png' }, { diff --git a/pages/welcome/welcome.vue b/pages/welcome/welcome.vue index 7a53063..7cd585b 100644 --- a/pages/welcome/welcome.vue +++ b/pages/welcome/welcome.vue @@ -17,28 +17,28 @@ }, onLoad(options) { let that = this; - // uni.reLaunch({ - // url: '../tabBar/home/home' - // }) + uni.reLaunch({ + url: '../tabBar/home/home' + }) // #ifdef H5 - let arr1 = window.location.href; - let arr2 = arr1.split('='); - if (arr2[2]) { - var arr3 = arr2[2].split('&'); - if (arr3[0] != undefined && arr3[0]) { - app.globalData.h5code = arr3[0]; - uni.setStorage({ - key: "h5code", - data: arr3[0] - }) - } - } else { - // 获取openid - that.jumpcdx(); - } - if (app.globalData.h5code) { - that.getAccessToken(); - } + // let arr1 = window.location.href; + // let arr2 = arr1.split('='); + // if (arr2[2]) { + // var arr3 = arr2[2].split('&'); + // if (arr3[0] != undefined && arr3[0]) { + // app.globalData.h5code = arr3[0]; + // uni.setStorage({ + // key: "h5code", + // data: arr3[0] + // }) + // } + // } else { + // // 获取openid + // that.jumpcdx(); + // } + // if (app.globalData.h5code) { + // that.getAccessToken(); + // } // #endif }, methods: {