1.新增绑定二维码功能

huipay-master
杨杰 3 years ago
parent cb1ec4fab7
commit 30e8656005
  1. 8
      App.vue
  2. 12
      Utils/Api.js
  3. 63
      pages.json
  4. 244
      pages/index/bindScan/bindScan.vue
  5. 2
      pages/index/collectNotes/collectNotes.vue
  6. 16
      pages/index/merchant-details/merchant-details.vue
  7. 165
      pages/index/scanList/scanList.vue
  8. 5
      pages/index/serviceBuild/serviceBuild.vue
  9. 10
      pages/tabBar/home/home.vue
  10. 4
      uni.scss

@ -4,11 +4,11 @@
// url: 'http://192.168.3.4:9301/crest',
// imgUrl: 'https://192.168.3.4:9301/filesystem/',
//
url: 'https://pay.bxb.cn/crest',
imgUrl: 'https://xuan-pay-private.obs.cn-southwest-2.myhuaweicloud.com',
//
// url: 'https://paycs.dctpay.com/crest',
// url: 'https://pay.bxb.cn/crest',
// imgUrl: 'https://xuan-pay-private.obs.cn-southwest-2.myhuaweicloud.com',
//
url: 'https://paycs.dctpay.com/crest',
imgUrl: 'https://xuan-pay-private.obs.cn-southwest-2.myhuaweicloud.com',
userInfo: "",
openId: '',
code: '',

@ -107,3 +107,15 @@ export const storemoveHomeCount = params => {
export const getTradeOrderList = params => {
return POST('GET', `${base}/tradeOrder/getTradeOrderList`, params).then(res => res.data);
}
//业务员绑定门店二维码
export const bindStore = params => {
return POST('POST', `${base}/payQrCode/bindStore`, params).then(res => res.data);
}
//业务员查询二维码列表
export const getSalesmanQrCodeList = params => {
return POST('GET', `${base}/payQrCode/getSalesmanQrCodeList`, params).then(res => res.data);
}
//门店查询二维码列表
export const getStoreQrCodeList = params => {
return POST('GET', `${base}/payQrCode/getStoreQrCodeList`, params).then(res => res.data);
}

@ -12,7 +12,7 @@
}
}
},{
}, {
"path": "pages/tabBar/home/home",
"style": {
"navigationBarTextStyle": "white",
@ -23,7 +23,7 @@
"softinputNavBar": "none"
}
}
},{
}, {
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "首页"
@ -148,9 +148,8 @@
}
}
}
,{
"path" : "pages/index/mcc-list/mcc-list",
}, {
"path": "pages/index/mcc-list/mcc-list",
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "商户类别",
@ -161,11 +160,9 @@
}
}
}
,{
"path" : "pages/index/collectNotes/collectNotes",
"style" :
{
}, {
"path": "pages/index/collectNotes/collectNotes",
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "收款记录",
"onReachBottomDistance": 50,
@ -175,11 +172,9 @@
}
}
}
,{
"path" : "pages/index/doorManage/doorManage",
"style" :
{
}, {
"path": "pages/index/doorManage/doorManage",
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "门店管理",
"onReachBottomDistance": 50,
@ -189,11 +184,21 @@
}
}
}, {
"path": "pages/index/serviceBuild/serviceBuild",
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "绑定设备",
"onReachBottomDistance": 50,
"app-plus": {
"titleNView": false, //
"softinputNavBar": "none"
}
,{
"path" : "pages/index/serviceBuild/serviceBuild",
"style" :
{
}
}, {
"path": "pages/index/addService/addService",
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "绑定设备",
"onReachBottomDistance": 50,
@ -203,13 +208,23 @@
}
}
}, {
"path": "pages/index/bindScan/bindScan",
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "绑定二维码",
"onReachBottomDistance": 50,
"app-plus": {
"titleNView": false, //
"softinputNavBar": "none"
}
,{
"path" : "pages/index/addService/addService",
"style" :
{
}
}, {
"path": "pages/index/scanList/scanList",
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "绑定设备",
"navigationBarTitleText": "二维码列表",
"onReachBottomDistance": 50,
"app-plus": {
"titleNView": false, //

@ -0,0 +1,244 @@
<template>
<view>
<view class="input-box">
<view class="icon search"></view>
<input placeholder="输入二维码序列号" v-model="scanNo" placeholder-style="color:#c0c0c0;" @input="toSearch()" />
</view>
<view v-if="serviceList == ''" class="mart60 fotct font14 fcor666">
<image mode="widthFix" style="width: 70vw;" src="../../../static/img/noorder.png"></image>
</view>
<view class="height110 width94 backcorfff mart20" v-for="(item,index) in serviceList" :key="index">
<view class="font20 font306adb paddtop10 fontwig6 padleft15">{{item.serialNumber}}</view>
<view class="mart10 fcor666 padleft15 font14" v-if="typeId == 1">绑定时间: {{item.storeBindTime | timeFormat('yyyy-mm-dd')}}
{{item.storeBindTime | timeFormat('hh:mm')}}
</view>
<view class="mart10 fcor666 padleft15 font14" v-else>创建: {{item.createTime | timeFormat('yyyy-mm-dd')}}
{{item.createTime | timeFormat('hh:mm')}}
</view>
<button class="btns" @click="bindStore(item.id)" v-if="typeId == 1">绑定二维码</button>
</view>
</view>
</template>
<script>
import {
bindStore,
getSalesmanQrCodeList,
getStoreQrCodeList
} from '../../../Utils/Api.js';
let app = getApp();
export default {
data() {
return {
serviceList: [],
pageNum: 1,
pagesize: 15,
isLoadMore: false, //
userInfo: app.globalData.userInfo, //
typeId: '', //
storeId: '', //id
scanNo: '' //
}
},
onReachBottom() { //
if (!this.isLoadMore) { //
this.isLoadMore = true
this.pageNum += 1
if (this.typeId == 2) {
this.getStoreQrCodeList();
} else {
this.getSalesmanQrCodeList();
}
}
},
onLoad(options) {
this.typeId = options.type;
this.storeId = options.storeid;
if (options.type == 2) {
this.getStoreQrCodeList();
} else {
this.getSalesmanQrCodeList();
}
},
methods: {
toSearch() {
this.pageNum = 1;
this.pageSize = 10;
this.isNoMoreData = false;
this.serviceList = [];
if (this.typeId == 2) {
this.getStoreQrCodeList();
} else {
this.getSalesmanQrCodeList();
}
},
//
getStoreQrCodeList() {
uni.showLoading({
title: '加载中...'
})
if (this.isNoMoreData) {
uni.hideLoading()
return false;
}
let pagenum = this.pageNum;
let params = {
pageNum: pagenum,
pageSize: this.pagesize,
serialNumber: this.scanNo,
storeId: this.storeId
}
getStoreQrCodeList(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000' && res.return_data.list) {
this.isLoadMore = res.return_data.list.length == this.pageSize ? false : true;
this.serviceList = this.serviceList.concat(res.return_data.list);
if (res.return_data.total == (this.pageNum * this.pageSize)) {
this.isLoadMore = true;
}
this.pageNum = res.return_data.list.length == this.pageSize ? ++pagenum : pagenum;
} else {
this.serviceList = [];
this.isLoadMore = true
}
});
},
//
getSalesmanQrCodeList() {
uni.showLoading({
title: '加载中...'
})
if (this.isNoMoreData) {
uni.hideLoading()
return false;
}
let pagenum = this.pageNum;
let datas = {
salesmanId: this.userInfo.salesman.id,
isAssignStore: false,
serialNumber: this.scanNo,
pageNum: pagenum,
pageSize: this.pagesize,
}
getSalesmanQrCodeList(datas).then(res => {
uni.hideLoading();
if (res.return_code == '000000' && res.return_data.list) {
this.isLoadMore = res.return_data.list.length == this.pageSize ? false : true;
this.serviceList = this.serviceList.concat(res.return_data.list);
if (res.return_data.total == (this.pageNum * this.pageSize)) {
this.isLoadMore = true;
}
this.pageNum = res.return_data.list.length == this.pageSize ? ++pagenum : pagenum;
} else {
this.serviceList = [];
this.isLoadMore = true
}
});
},
//
bindStore(item) {
let that = this;
uni.showModal({
title: '绑定二维码',
content: '是否绑定当前二维码。',
success: (res) => {
if (res.confirm) {
uni.showLoading({
title: '提交中...'
})
let params = {
"qrCodeId": item,
"storeId": that.storeId
}
bindStore(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
uni.showToast({
title: '提交成功',
icon: 'none',
duration: 2000,
success() {
setTimeout(() => {
uni.navigateBack({})
}, 1000);
}
})
} else {
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
}
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
}
}
</script>
<style lang="scss">
page {
background-color: #f8f9f9;
}
.input-box {
width: 90%;
margin-left: 5%;
margin-top: 15px;
height: 70rpx;
background-color: #f5f5f5;
border-radius: 10rpx;
position: relative;
display: flex;
align-items: center;
.icon {
display: flex;
align-items: center;
position: absolute;
top: 2px;
left: 5px;
width: 60upx;
height: 60upx;
font-size: 34upx;
color: #c0c0c0;
}
input {
padding-left: 50upx;
height: 28upx;
font-size: 28upx;
width: 100%;
}
}
.font306adb {
color: #306adb;
}
.xfimg {
width: 100rpx;
bottom: 60rpx;
position: fixed;
right: 40rpx;
}
.btns {
width: 25%;
margin-left: 68%;
height: 35px;
line-height: 35px;
background-color: #0083f5;
color: #FFFFFF;
font-weight: bold;
font-size: 14px;
padding: 0px;
}
</style>

@ -1,6 +1,6 @@
<template>
<view>
<view v-if="!notesList" class="mart60 fotct font14 fcor666">
<view v-if="notesList == ''" class="mart60 fotct font14 fcor666">
<image mode="widthFix" style="width: 70vw;" src="../../../static/img/noorder.png"></image>
</view>
<view class="height90 width94 backcorfff mart20" v-for="(item,index) in notesList" :key="index">

@ -75,8 +75,10 @@
<view class="margle10 font14 fcor999 width90p">{{item.storeRegion.address}}</view>
</view>
<view class="height45 width100">
<button class="btns mart10 marRight20" @click.stop="jumpService(item.id,1)">绑定设备</button>
<button class="btns mart10 marRight20" @click.stop="jumpService(item.id,2)">设备列表</button>
<button class="btns mart10 marRight10" @click.stop="jumpBindScan(item.id,1)">二维码列表</button>
<button class="btns mart10 marRight10" @click.stop="jumpBindScan(item.id,2)">绑定二维码</button>
<button class="btns mart10 marRight10" @click.stop="jumpService(item.id,1)">绑定设备</button>
<button class="btns mart10 marRight10" @click.stop="jumpService(item.id,2)">设备列表</button>
</view>
<view class="lin10"></view>
</view>
@ -172,6 +174,12 @@
uni.navigateTo({
url: '../serviceBuild/serviceBuild?storeid=' + item + '&type=' + items
})
},
//
jumpBindScan(item, items) {
uni.navigateTo({
url: '../bindScan/bindScan?storeid=' + item + '&type=' + items
})
}
}
}
@ -212,14 +220,14 @@
}
.btns {
width: 25%;
width: 21%;
float: right;
height: 35px;
line-height: 35px;
background-color: #0083f5;
color: #FFFFFF;
font-weight: bold;
font-size: 14px;
font-size: 12px;
padding: 0px;
}

@ -0,0 +1,165 @@
<template>
<view>
<view class="input-box">
<view class="icon search"></view>
<input placeholder="输入二维码序列号" v-model="scanNo" placeholder-style="color:#c0c0c0;" @input="toSearch()" />
</view>
<view v-if="serviceList == ''" class="mart60 fotct font14 fcor666">
<image mode="widthFix" style="width: 70vw;" src="../../../static/img/noorder.png"></image>
</view>
<view class="width94 backcorfff mart20" v-for="(item,index) in serviceList" :key="index" @click="lookimgage(item.qrCodeUrl)">
<view class="font20 font306adb paddtop10 fontwig6 padleft15">{{item.serialNumber}}</view>
<view class="mart10 fcor666 padleft15 font14 paddbotm10">绑定时间:
{{item.storeBindTime | timeFormat('yyyy-mm-dd')}}
{{item.storeBindTime | timeFormat('hh:mm')}}
</view>
</view>
<wybPopup ref="popup" type="center" height="650" width="600" bgColor="" radius="6" :showCloseIcon="false">
<image class="popImg" :src="images"></image>
</wybPopup>
</view>
</template>
<script>
import {
getStoreQrCodeList
} from '../../../Utils/Api.js';
import wybPopup from '../../../components/wyb-popup/wyb-popup.vue'
let app = getApp();
export default {
components: {
wybPopup
},
data() {
return {
serviceList: [],
pageNum: 1,
pagesize: 15,
isLoadMore: false, //
userInfo: app.globalData.userInfo, //
scanNo: '' ,//
images:'' //
}
},
onReachBottom() { //
if (!this.isLoadMore) { //
this.isLoadMore = true
this.pageNum += 1
this.getStoreQrCodeList();
}
},
onLoad(options) {
this.getStoreQrCodeList();
},
methods: {
toSearch() {
this.pageNum = 1;
this.pageSize = 10;
this.isNoMoreData = false;
this.serviceList = [];
this.getStoreQrCodeList();
},
//
getStoreQrCodeList() {
uni.showLoading({
title: '加载中...'
})
if (this.isNoMoreData) {
uni.hideLoading()
return false;
}
let pagenum = this.pageNum;
let params = {
pageNum: pagenum,
pageSize: this.pagesize,
serialNumber: this.scanNo,
storeId: this.userInfo.store.id
}
getStoreQrCodeList(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000' && res.return_data.list) {
this.isLoadMore = res.return_data.list.length == this.pageSize ? false : true;
this.serviceList = this.serviceList.concat(res.return_data.list);
if (res.return_data.total == (this.pageNum * this.pageSize)) {
this.isLoadMore = true;
}
this.pageNum = res.return_data.list.length == this.pageSize ? ++pagenum : pagenum;
} else {
this.serviceList = [];
this.isLoadMore = true
}
});
},
lookimgage(item){
this.images = item;
this.$refs.popup.show();
}
}
}
</script>
<style lang="scss">
page {
background-color: #f8f9f9;
}
.input-box {
width: 90%;
margin-left: 5%;
margin-top: 15px;
height: 70rpx;
background-color: #f5f5f5;
border-radius: 10rpx;
position: relative;
display: flex;
align-items: center;
.icon {
display: flex;
align-items: center;
position: absolute;
top: 2px;
left: 5px;
width: 60upx;
height: 60upx;
font-size: 34upx;
color: #c0c0c0;
}
input {
padding-left: 50upx;
height: 28upx;
font-size: 28upx;
width: 100%;
}
}
.font306adb {
color: #306adb;
}
.xfimg {
width: 100rpx;
bottom: 60rpx;
position: fixed;
right: 40rpx;
}
.btns {
width: 25%;
margin-left: 68%;
height: 35px;
line-height: 35px;
background-color: #0083f5;
color: #FFFFFF;
font-weight: bold;
font-size: 14px;
padding: 0px;
}
.popImg {
width: 300px;
height: 300px;
}
</style>

@ -11,9 +11,12 @@
</view>
<view class="height110 width94 backcorfff mart20" v-for="(item,index) in serviceList" :key="index">
<view class="font20 font306adb paddtop10 fontwig6 padleft15">{{item.deviceSn}}</view>
<view class="mart10 fcor666 padleft15 font14">绑定时间: {{item.storeBindTime | timeFormat('yyyy-mm-dd')}}
<view class="mart10 fcor666 padleft15 font14" v-if="typeId == 1">绑定时间: {{item.storeBindTime | timeFormat('yyyy-mm-dd')}}
{{item.storeBindTime | timeFormat('hh:mm')}}
</view>
<view class="mart10 fcor666 padleft15 font14" v-else>创建时间: {{item.createTime | timeFormat('yyyy-mm-dd')}}
{{item.createTime | timeFormat('hh:mm')}}
</view>
<button class="btns" @click="bindStoreDevice(item.id)" v-if="typeId == 1">绑定设备</button>
</view>
<!-- <image src="../../../static/img/addser.png" mode="widthFix" class="xfimg" @click="jumpaddService"></image> -->

@ -116,13 +116,11 @@
title: '收款记录',
url: '../../index/collectNotes/collectNotes',
img: '../../../static/img/home1.png'
},{
title: '二维码列表',
url: '../../index/scanList/scanList',
img: '../../../static/img/home2.png'
}
// ,
// {
// title: '',
// url: '../../index/serviceBuild/serviceBuild',
// img: '../../../static/img/home2.png'
// }
]
return;
}

@ -185,6 +185,10 @@ $uni-font-size-paragraph:30upx;
.marglerig{
margin-right: 5px;
}
.marRight10{
margin-right: 10px;
}
.marRight20{
margin-right: 20px;
}

Loading…
Cancel
Save