tianyi 7 days ago
parent
commit
df2b48fb44
  1. 100
      pages/Orderstatistics/index.vue
  2. 403
      pages/index/index.vue
  3. 6
      pages/login/login.vue
  4. 1
      pages/myCenter/shopDetail.vue

100
pages/Orderstatistics/index.vue

@ -79,27 +79,14 @@
</view>
</view>
</uni-popup>
<view>
蓝牙状态{{printStatus?'已连接':'未连接'}}
</view>
<view @click="closePrint" style="width:100rpx;height: 150rpx;background:#000;margin-left: 50px;color:#fff;">断开连接
</view>
<view style="width:100rpx;height: 150rpx;background:#000;">
<kk-printer ref="kkprinter" :bufferData="bufferData" :printNum="printNum"
:defaultText="defaultText" @statusChange="statusChange"></kk-printer>
</view>
</view>
</template>
<script>
import cell from '../../components/ordercell/index.vue'
import util from '@/components/kk-printer/utils/util.js';
import * as blesdk from '@/components/kk-printer/utils/bluetoolth.js';
import kkPrinter from '@/components/kk-printer/index.vue';
export default {
components: {
cell,
kkPrinter
cell
},
computed: {
i18n() {
@ -110,6 +97,7 @@
return {
bufferData: [],
printNum: 1,
yNum: 10,
defaultText: '连接蓝牙',
p: 1,
centerarray: ['完成订单', '已抢订单', '配送里程'],
@ -137,7 +125,8 @@
this.tab2 = [this.i18n.eva.quanbu, this.i18n.order.yiwancheng, this.i18n.order.yizhuandan]
},
onLoad(option) {
var that = this
let that = this;
if (option.index) {
this.selectedIndex2 = option.index
}
@ -151,19 +140,94 @@
this.printStatus = uni.getStorageSync('deviceId') ? true : false
},
methods: {
statusChange(){
onPrint() {
var that = this
that.yNum = 10
let strCmd = blesdk.CreatCPCLPage(440, 1800, 1, 0);
strCmd += blesdk.addCPCLSETMAG(2, 2)
strCmd += blesdk.addCPCLLocation(2);
strCmd += blesdk.addCPCLSETBOLD('400');
// strCmd += blesdk.addCPCLText('0', that.yNum, '24', '2', 0, getApp().globalData.printData[0].order_id)
strCmd += blesdk.addCPCLText('0', that.yNum, '24', '2', 0, "#0112 外卖单")
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLSETBOLD('0')
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '七里香快餐明珠精品馆')
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, "预计时间:2026-02-01 13:14:00")
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, "*********")
strCmd += blesdk.addCPCLSETMAG(2, 2)
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '1', 0, '王 先生')
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLText('0', that.yNum += 50, '24', '0', 0, '联系电话: *******0775')
strCmd += blesdk.addCPCLSETMAG(2, 2)
strCmd += blesdk.addCPCLText('0', that.yNum += 50, '24', '0', 0, '地址:河北东川建设集团有限公司(河北省沧州市运河区)******')
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLText('0', that.yNum += 50, '24', '0', 0, '为保护隐私,顾客电话及地址已隐藏,')
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '您可登陆商家端或骑手端查看')
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0,
'*******************************************')
strCmd += blesdk.addCPCLSETMAG(2, 2)
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '1、红烧黛玉')
strCmd += blesdk.addCPCLSETMAG(2, 2)
strCmd += blesdk.addCPCLText('0', that.yNum += 50, '24', '0', 0, 'X1 16元')
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLText('0', that.yNum += 50, '24', '0', 0,
'*******************************************')
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '配送费: 1元')
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '合计金额: 17元')
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0,
'*******************************************')
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '商品取到后,如有任何商品问题,请')
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '联系商家或平台,客服将为您服务客')
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '服电话13521030702,谢谢您的惠顾')
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
},
statusChange() {
this.printStatus = true;
},
//deviceId
closePrint() {
if(this.printStatus){
if (this.printStatus) {
uni.removeStorageSync('deviceId')
this.printStatus = false
uni.showToast({
title: "蓝牙已断开",
icon: 'success'
})
}else{
} else {
uni.showToast({
title: "蓝牙已断开",
icon: 'success'

403
pages/index/index.vue

@ -2,10 +2,178 @@
<view class="page">
<view class="swiper-container">
<view class="swiper-page" v-show="currentIndex == 0">
<view @click="updateStatus" style="margin-top: 500rpx;">
营业状态<text>{{businessStatus == '1'?'暂停营业':'正常营业'}}</text>
<view class="title">
<view class="title-sreach">
<view class="title-name">
商家中心
</view>
</view>
</view>
<view class="shop-title">
<view class="title1">
<img :src="shop.shopIcon" alt="" />
</view>
<view class="title2">
<view class="title22">
{{shop.shopName}}
</view>
<view class="title33" @tap="updateStatus">
{{businessStatus == '1'?'暂停营业':'正常营业'}}
<uni-icons type="right" size="12"></uni-icons>
</view>
</view>
</view>
<view class="shop-order">
<view class="order1">
待办事项
</view>
<view class="order2">
<view class="order22">
<view class="order33" @tap="goDetail('db',3)">
<view class="order44">
0
</view>
<view class="order55">
待接单
</view>
</view>
<view class="order33" @tap="goDetail('db',4)">
<view class="order44">
0
</view>
<view class="order55">
待取货
</view>
</view>
<view class="order33" @tap="goDetail('db',5)">
<view class="order44">
0
</view>
<view class="order55">
待送达
</view>
</view>
</view>
<view class="order22">
<view class="order33" @tap="goDetail('db',2)">
<view class="order44">
0
</view>
<view class="order55">
待消费
</view>
</view>
<view class="order33" @tap="goDetail('db',7)">
<view class="order44">
0
</view>
<view class="order55">
待退款
</view>
</view>
<view class="order33" @tap="goDetail('db',11)">
<view class="order44">
0
</view>
<view class="order55">
待售后
</view>
</view>
<view class="order33" @tap="goDetail('pj')">
<view class="order44">
0
</view>
<view class="order55">
待回复差评
</view>
</view>
</view>
</view>
</view>
<view class="shop-order">
<view class="order1" style="display: flex;">
<view style="flex: 1;">
今日实时数据
</view>
<view @tap="goDetail('tj')">
更多
<uni-icons type="right" size="12"></uni-icons>
</view>
</view>
<view class="data2">
<view class="data22">
<view class="data222">
0
</view>
<view class="data333">
今日订单
</view>
</view>
<view class="data22">
<view class="data222">
0
</view>
<view class="data333">
营业额
</view>
</view>
</view>
</view>
<view class="shop-order">
<view class="order1">
必备工具
</view>
<view class="menu2">
<view class="menu22" @tap="goDetail('sp')">
<view class="menu33">
<image src="../../static/image/dingdan/dd0.png" alt="" />
</view>
<view class="menu44">
商品管理
</view>
</view>
<view class="menu22" @tap="goDetail('dp')">
<view class="menu33">
<image src="../../static/image/dingdan/dd1.png" alt="" />
</view>
<view class="menu44">
店铺管理
</view>
</view>
<view class="menu22" @tap="goDetail('dd')">
<view class="menu33">
<image src="../../static/image/dingdan/dd2.png" alt="" />
</view>
<view class="menu44">
订单管理
</view>
</view>
<view class="menu22" @tap="goDetail('zd')">
<view class="menu33">
<image src="../../static/image/dingdan/dd3.png" alt="" />
</view>
<view class="menu44">
账单结算
</view>
</view>
<view class="menu22" @tap="goDetail('pj')">
<view class="menu33">
<image src="../../static/image/dingdan/dd4.png" alt="" />
</view>
<view class="menu44">
顾客评价
</view>
</view>
<view class="menu22" @tap="goDetail('hx')">
<view class="menu33" style="width: 100%;height: 56rpx;">
<uni-icons type="scan" size="25"></uni-icons>
</view>
<view class="menu44">
扫码核销
</view>
</view>
</view>
</view>
<view @click="nishuode">商品该分类</view>
</view>
<view class="swiper-page" v-show="currentIndex == 1">
<de-livery ref="deLivery"></de-livery>
@ -28,6 +196,7 @@
width: 0,
currentIndex: 0,
businessStatus:1,
shop:{}
}
},
components: {
@ -42,29 +211,26 @@
that.width = info.screenWidth * 2;
}
});
this.getBusinessStatus()
},
onLoad() {
},
methods: {
nishuode(){
uni.navigateTo({
url: '/pages/goods/goodsList'
})
},
//
getBusinessStatus(){
this.NB.sendRequest('/app/shoptakeaway/getByShopId', {
this.NB.sendRequest("/app/shoptakeaway/getByShopId", {
shopId: uni.getStorageSync('shopId')
}, false, 'get', 'application/x-www-form-urlencoded').then(res => {
}, true, 'GET', 'application/x-www-form-urlencoded').then((res) => {
if (res.code == 200) {
this.shop = res.result
this.shop.shopIcon = uni.getStorageSync('shopIcon')
this.businessStatus = res.result.status
} else {
uni.showToast(res.message)
this.tui.toast(res.message)
}
})
uni.hideLoading()
}).catch((res) => {})
},
//
updateStatus(){
@ -74,22 +240,106 @@
content: '要更改营业状态吗?',
success: function (res1) {
if (res1.confirm) {
that.NB.sendRequest('/app/shoptakeaway/update', {
shopId:uni.getStorageSync('shopId'),
that.NB.sendRequest("/app/shoptakeaway/update", {
shopId: uni.getStorageSync('shopId'),
status:that.businessStatus == "1"?'0':that.businessStatus == "0"?'1':'2'
}, false, 'post', 'application/x-www-form-urlencoded').then(res => {
}, true, 'post', 'application/x-www-form-urlencoded').then((res) => {
if (res.code == 200) {
uni.showToast("更改成功")
that.businessStatus = that.businessStatus == "1"?'0':that.businessStatus == "0"?'1':'2'
} else {
uni.showToast(res.message)
that.tui.toast(res.message)
}
})
uni.hideLoading()
}).catch((res) => {})
}
}
});
},
goDetail(type,index) {
let url = ''
switch (type) {
case 'tj':
url = '/package1/myCenter/dataStatistics'
break;
case 'db':
url = '/package2/shop/shopOrderList?index=' + index
break;
case 'sp':
url = '/package1/myCenter/goodsList'
break;
case 'dp':
url = ''
break;
case 'dd':
url = '/package2/shop/shopOrderList'
break;
case 'zd':
url = '/package2/shop/shopBill'
break;
case 'pj':
let item = {
shopScore:uni.getStorageSync('shopScore'),
id:uni.getStorageSync('id')
}
url = '/package1/group/shopEvaluate?item=' + JSON.stringify(item)
break;
case 'hx':
this.scanCodeAdd()
break;
default:
}
uni.navigateTo({
url: url
})
},
//
scanCodeAdd() {
let that = this;
uni.scanCode({
success: (res) => {
if (res.scanType == "QR_CODE") { //
console.log('二维码',res)
// let shopId = base.decode(res.result.split(',')[1])
// if (shopId == uni.getStorageSync('shopId').substring('10', '12')) {
// that.productId = base.decode(res.result.split(',')[0])
// that.toggle('bottom', base.decode(res.result.split(',')[0]));
// } else {
// that.tui.toast('')
// }
} else {
console.log('条形码',res)
// that.NB.sendRequest("/app/product/getByBarcode", "POST", {
// barcode: res.result
// }, false, true).then((res1) => {
// if (res1.code == 200) {
// that.productId = res1.result[0].id
// if (res1.result == '') {
// that.tui.toast('')
// } else {
// that.toggle('bottom', res1.result[0].id);
// }
// } else {
// that.tui.toast(res.message)
// }
// }).catch((res) => {
// that.tui.toast(res)
// })
}
},
fail: (res) => {
uni.showToast({
title: '扫描失败',
icon: 'none'
})
}
})
},
//tab
changeIndex(index) {
let that = this;
@ -109,6 +359,119 @@
}
</script>
<style>
<style lang="scss">
@import url("./index.css");
.title {
background: url('https://jewel-shop.oss-cn-beijing.aliyuncs.com/8bc15960c2dc40268e295d6dd23aecce.png') no-repeat;
width: 100%;
height: 20%;
}
.title-sreach {
width: 100%;
display: flex;
height: 200rpx;
position: relative;
}
.title-name {
padding-top: 110rpx;
font-size: 36rpx;
font-weight: 700;
flex: 1;
text-align: center;
}
.shop-title {
width: 95%;
margin: 0 auto;
padding: 20rpx;
background: #fff;
border-radius: 20rpx;
display: flex;
font-size: 28rpx;
font-weight: 700;
}
.title1 {
width: 70rpx;
height: 70rpx;
img {
width: 100%;
height: 100%;
border-radius: 10rpx;
}
}
.title2{
flex: 1;
line-height: 70rpx;
display: flex;
}
.title22{
flex: 1;
padding-left: 20rpx;
}
.shop-order{
width: 95%;
margin: 20rpx auto 0;
background: #fff;
border-radius: 20rpx;
padding: 0 20rpx 0;
}
.order1{
height: 70rpx;
line-height: 70rpx;
font-size: 28rpx;
font-weight: 700;
border-bottom: 1px solid #eee;
}
.order22{
display: flex;
height: 100rpx;
padding-top: 20rpx;
}
.order33{
flex: 1;
text-align: center;
}
.order44{
font-size: 28rpx;
font-weight: 700;
}
.data2{
display: flex;
height: 140rpx;
text-align: center;
padding-top: 20rpx;
}
.data22{
flex: 1;
}
.data222{
font-size: 36rpx;
font-weight: 700;
padding-bottom: 20rpx;
}
.menu2{
display: flex;
flex-wrap: wrap;
text-align: center;
padding-top: 20rpx;
}
.menu22{
width: 25%;
height: 120rpx;
}
.menu33{
image{
width: 50rpx;
height: 50rpx;
background-size: 100%;
}
}
.menu44{
height: 40rpx;
line-height: 40rpx;
}
</style>

6
pages/login/login.vue

@ -354,7 +354,8 @@
mobile: this.mobile,
code: this.codes,
saveLogin: true,
type: this.wayValue
type: this.wayValue,
clientId: uni.getStorageSync('registerID')
};
} else {
url = `/auth/login`;
@ -364,7 +365,8 @@
captchaId: this.captchaId,
code: this.code,
saveLogin: true,
type: 0
type: 0,
clientId: uni.getStorageSync('registerID')
};
}
let that = this;

1
pages/myCenter/shopDetail.vue

@ -186,6 +186,7 @@
content: '更新信息成功',
showCancel:false,
success: function (res) {
uni.setStorageSync('shop',this.shop)
if (res.confirm) {
uni.navigateBack()
}

Loading…
Cancel
Save