wangfukang 3 years ago
parent
commit
1a88ea9b43
  1. 17
      pages/billing/changeGoods1.vue
  2. 16
      pages/index/downStearmList.vue
  3. 5
      pages/index/order.vue
  4. 6
      pages/index/orderDetail.vue
  5. 13
      pages/index/shareStyle.vue
  6. 33
      pages/index/waitStorageDetail.vue
  7. 15
      pages/inventory/changeGoods1.vue
  8. 313
      pages/inventory/goodsList1.vue
  9. 23
      pages/inventory/inventory.vue
  10. 92
      pages/login/login.vue

17
pages/billing/changeGoods1.vue

@ -1,7 +1,7 @@
<template>
<view class="page1">
<view class="title-box">
<uni-search-bar class="uni-mt-10" radius="5" placeholder="请输入商品名称/编号" cancelButton="none"
<uni-search-bar class="uni-mt-10" radius="5" placeholder="商品名称/货号/供应商" cancelButton="none"
@confirm="search" />
</view>
<view class="content-box">
@ -225,7 +225,8 @@
} else {
this.indexList[i].parentId = false
}
}
}
this.categoryId = this.indexList[0].id
this.getShareList(this.indexList[0].id);
} else {
this.tui.toast(res.message)
@ -315,7 +316,7 @@
//点击分类获取商品列表
getShareList(id) {
this.tui.request("/app/product/getShareList", "POST", {
categoryId: id,
categoryId: this.categoryId,
supplierName: this.searchName,
pageNum: this.pageNum,
pageSize: '10'
@ -391,11 +392,8 @@
},
//顶部搜索框
search(res) {
this.searchName = res.value
uni.showToast({
title: '搜索:' + res.value,
icon: 'none'
})
this.searchName = res.value
this.getShareList()
},
//未入库遮罩
clickMask(item){
@ -419,7 +417,8 @@
} else {
this.indexList[i].parentId = false
}
}
}
this.categoryId = this.indexList[index].id
this.getShareList(this.indexList[index].id)
},
inputDialogToggle() {

16
pages/index/downStearmList.vue

@ -1,7 +1,7 @@
<template>
<view class="page1">
<view class="title-box">
<uni-search-bar class="uni-mt-10" radius="5" placeholder="请输入商品名称/编号" cancelButton="none"
<uni-search-bar class="uni-mt-10" radius="5" placeholder="请输入商品名称/货号" cancelButton="none"
@confirm="search" />
</view>
<view class="content-box">
@ -183,7 +183,7 @@
shopList: [],
info: 0,
categoryId: '', //分类id
keywords: '', //搜索框输入值
searchName: '', //搜索框输入值
shopId: '', //店铺id,
checkbox: [], //需要分享的商品id
temporaryNum: 0,
@ -387,11 +387,8 @@
},
//顶部搜索框
search(res) {
this.searchName = res.value
uni.showToast({
title: '搜索:' + res.value,
icon: 'none'
})
this.searchName = res.value
this.getShareList()
},
inputDialogToggle() {
this.$refs.inputDialog.open()
@ -521,9 +518,8 @@
//点击分类获取商品列表
getShareList(id) {
this.tui.request("/app/productShare/getShareList", "POST", {
keywords: this.keywords,
id: id,
// id:'1717828137930330112',
keywords: this.searchName,
id: this.khid,
pageNum: this.pageNum,
pageSize: '10'
}, false, true).then((res) => {

5
pages/index/order.vue

@ -45,7 +45,10 @@
console.log('options', options);
this.type = options.type;
this.listStatus = options.listStatus
this.getOrderInfoList()
},
onShow(){
this.getOrderInfoList()
},
onReachBottom() {
if (this.page >= this.totalPages) return;

6
pages/index/orderDetail.vue

@ -24,8 +24,8 @@
style="width: 140rpx;height: 140rpx;margin: 30rpx 0 0 30rpx;">
<view class="shop-productName">
<view style="color:#FF5809;">品名:{{item.productName}} ({{item.productSn == null ? '暂无':item.productSn}})</view>
<view>单价:{{item.price}} 数量:{{item.productCount}} 总价:{{item.discountAmount}}</view>
<view v-if="item.supplierName !=undefined">供应商:{{item.supplierName}}</view>
<view>单价:{{item.price == null ? '暂无':item.price}} 数量:{{item.productCount == null ? '暂无':item.productCount}} 总价:{{item.discountAmount == null ? '暂无':item.discountAmount}}</view>
<view v-if="item.supplierName !=undefined">供应商:{{item.supplierName == null ? '暂无':item.supplierName}}</view>
</view>
</view>
<view class="shop-type">
@ -143,7 +143,7 @@
<view class="tui-order-title">
回款历史
</view>
<view class="tui-order-content" v-for="(item,index) in collection">
<view class="tui-order-content" style="border-bottom: 1px solid #E0E0E0;" v-for="(item,index) in collection">
<view class="tui-order-flex">
<view class="tui-item-title">回款金额:</view>
<view class="tui-item-content">{{ item.amount }}</view>

13
pages/index/shareStyle.vue

@ -148,7 +148,8 @@
this.indexList[i].parentId = true
} else {
this.indexList[i].parentId = false
}
}
this.categoryId = this.indexList[i].id
this.getShareList(this.indexList[i].id);
}
@ -160,7 +161,7 @@
//点击分类获取商品列表
getShareList(id) {
this.tui.request("/app/product/getShareList", "POST", {
categoryId: id,
categoryId: this.categoryId,
supplierName: this.searchName,
pageNum: this.pageNum,
pageSize: '100'
@ -177,10 +178,7 @@
//顶部搜索框
search(res) {
this.searchName = res.value
uni.showToast({
title: '搜索:' + res.value,
icon: 'none'
})
this.getShareList()
},
//未入库遮罩
clickMask(item) {
@ -204,7 +202,8 @@
} else {
this.indexList[i].parentId = false
}
}
}
this.categoryId = this.shopList[index].id
this.goodsList = this.shopList[index]
// this.getShareList(this.indexList[index].id)
},

33
pages/index/waitStorageDetail.vue

@ -99,7 +99,7 @@
</view>
</view>
<view class="tui-tabbar">
<view class="tui-btn-mr" v-if="type==0 && sales.inStorageStatus == 1" @tap="inputDialogToggle">回款</view>
<view class="tui-btn-mr" v-if="type==0 && sales.inStorageStatus == 1 && noPay >0" @tap="inputDialogToggle">回款</view>
<view class="tui-btn-mr" v-if="type==0 && sales.inStorageStatus == 0" @click="inventorySubmit">确认提交</view>
</view>
<!-- 弹出输入框 -->
@ -173,6 +173,26 @@
inputDialogToggle() {
this.$refs.inputDialog.open()
},
sureNpPay(e){
if(e>this.noPay){
uni.showToast({
title: "回款金额不应超过欠款金额!",
icon: 'none'
})
return
}
this.tui.request('/app/purchase/editPayPrice','post', {
id:this.sales.id,
price:e
},false,true).then(res => {
uni.showToast({
title: "成功!",
icon: 'none'
})
uni.navigateBack();
}).catch(res => {});
},
inventorySubmit() {
if (this.noPay == 0 || this.alreadyPay == 0 || this.shouldPay == 0) {
uni.showToast({
@ -191,17 +211,6 @@
supplierId: this.sales.supplierId, //供应商id和姓名
supplierName: this.sales.supplierName
}
// let purchaseDetails = [];
// this.goodsList.forEach(function(value, key) {
// value.stockLogList.forEach(function(values, keys) {
// let obj = {
// productCount: values,
// attributeList: keys
// }
// value.stockLogList1.push(obj)
// })
// purchaseDetails.push(value)
// })
this.tui.request("/app/stock/putInPrice", "post", {
purchase: purchase,
purchaseDetails: this.goodsList

15
pages/inventory/changeGoods1.vue

@ -1,7 +1,7 @@
<template>
<view class="page1">
<view class="title-box">
<uni-search-bar class="uni-mt-10" radius="5" placeholder="请输入商品名称/编号" cancelButton="none"
<uni-search-bar class="uni-mt-10" radius="5" placeholder="商品名称/货号/供应商" cancelButton="none"
@confirm="search" />
</view>
<view class="content-box">
@ -205,7 +205,8 @@
} else {
this.indexList[i].parentId = false
}
}
}
this.categoryId = this.indexList[0].id
this.getShareList(this.indexList[0].id);
} else {
this.tui.toast(res.message)
@ -292,7 +293,7 @@
//点击分类获取商品列表
getShareList(id) {
this.tui.request("/app/product/getShareList", "POST", {
categoryId: id,
categoryId: this.categoryId,
supplierName: this.searchName,
pageNum: this.pageNum,
pageSize: '10'
@ -372,10 +373,7 @@
//顶部搜索框
search(res) {
this.searchName = res.value
uni.showToast({
title: '搜索:' + res.value,
icon: 'none'
})
this.getShareList()
},
//未入库遮罩
clickMask(item){
@ -399,7 +397,8 @@
} else {
this.indexList[i].parentId = false
}
}
}
this.categoryId = this.indexList[index].id
this.getShareList(this.indexList[index].id)
},
inputDialogToggle() {

313
pages/inventory/goodsList1.vue

@ -296,13 +296,32 @@
</view>
</view>
</uni-popup>
</view>
</view>
<!-- 打印弹出 -->
<uni-popup ref="printerPopup" background-color="#fff">
<view style="width: 500rpx;height: 300rpx;font-size: 36rpx;">
<view style="height: 80rpx;text-align: center;line-height: 80rpx;font-weight: bold;">
提示
</view>
<view style="text-align: center;line-height: 50px;height: 100rpx;">
需要打印销售小票吗?
</view>
<view style="display: flex;height: 100rpx;margin-top: 20rpx;border-top: 1px solid #eee;position: relative;">
<view @tap='printChenel' style="width:250rpx;line-height: 100rpx;text-align: center;border-right: 1px solid #eee;">
暂不需要
</view>
<kk-printer ref="kkprinter" :bufferData="bufferData" @onPrint="onPrint" style="width: 250rpx;height: 100rpx;line-height: 50px;color: #000;background:#088FEB;position: absolute;bottom: 0;text-align: center;right: 0;"></kk-printer>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
<script>
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: {},
data() {
return {
lsprice:0,//临时零售价
@ -318,6 +337,7 @@
keyList: [],
temporaryList: [],
zNum: 0,
bufferData: '',
zPrice:0,
priceOk:'', //已收金额
value: 0,
@ -389,8 +409,13 @@
pbAddress:'',
carList1:[],
radioType1:0,
saleId:''
saleId:'',
saleDetailList:[],
yNum:150
}
},
components: {
kkPrinter
},
onShow() {
let that = this;
@ -893,112 +918,194 @@
})
},
//点击底部开单按钮
goSell() {
goSell() {
console.log(this.carList)
this.$refs.printerPopup.open('center')
// console.log(this.khName)
// console.log(this.lbgName)
// console.log(this.wlName)
if(this.khName == ''){
this.tui.toast('请选择客户!')
return
}
if(this.xsyId ==''){
this.tui.toast('请选择销售员!')
return
}
if(this.relPrice == (0 || '')){
this.tui.toast('请输入实收金额!')
return
}else if(this.priceOk==(0 || '')){
this.tui.toast('请输入已收金额!')
return
}
if(this.carList.size == 0){
this.tui.toast('请添加商品!')
return
}
if(this.radioType != ''){
if(this.radioType == 0 || this.radioType == 1 || this.radioType== 4){
if(this.wlName == ''){
this.tui.toast('请选择配送公司!')
return
}
if(this.radioType1 == 0){
if(this.lbgName == ''){
this.tui.toast('请选择配送人员!')
return
}
// if(this.khName == ''){
// this.tui.toast('请选择客户!')
// return
// }
// if(this.xsyId ==''){
// this.tui.toast('请选择销售员!')
// return
// }
// if(this.relPrice == (0 || '')){
// this.tui.toast('请输入实收金额!')
// return
// }else if(this.priceOk==(0 || '')){
// this.tui.toast('请输入已收金额!')
// return
// }
// if(this.carList.size == 0){
// this.tui.toast('请添加商品!')
// return
// }
// if(this.radioType != ''){
// if(this.radioType == 0 || this.radioType == 1 || this.radioType== 4){
// if(this.wlName == ''){
// this.tui.toast('请选择配送公司!')
// return
// }
// if(this.radioType1 == 0){
// if(this.lbgName == ''){
// this.tui.toast('请选择配送人员!')
// return
// }
}
}else if(this.radioType== 3){
if(this.pbAddress == ''){
this.tui.toast('请输入拼包地址!')
return
}
}
}else{
this.tui.toast('请选择发货方式!')
return
}
let obj = {
orderByWorker: this.lbgName.workerId,
saleId:this.saleId,
sale: {
// relPrice:,
alreadyEarn: this.priceOk, //已付金额
realAmount: this.relPrice, //实收金额
noEarn: this.relPrice - this.priceOk, //欠款
totalAmount: this.shouldPay, //总金额
area: this.khName.area,
city: this.khName.city,
province: this.khName.province,
payStatus: 1,
receiveAddress: this.khName.address,
userId:this.khName.userId,
userName:this.khName.name,
transportType: this.radioType1 == 1?2:this.radioType, //this.radioType
discount: this.discountNum,
createBy: this.xsyId,
createByName:this.createByName,
remark: this.remark,
otherExpense:this.otherExpense ==''?0:this.otherExpense, //其他费用
shareAddress:this.pbAddress,
transCompany: this.wlName.id,
companyName:this.wlName.companyName,
},
saleDetailList: []
}
let purchaseDetails = [];
this.carList.forEach(function(value, key) {
console.log(value.stockLogList)
value.stockLogList.forEach(function(values, keys) {
let obj = {
productCount: values,
attributeList: keys
}
value.stockLogList1.push(obj)
})
console.log(value)
purchaseDetails.push(value)
})
obj.saleDetailList = purchaseDetails;
this.tui.request("/app/sale/buyNew", "post", obj, false, false).then((res) => {
if (res.code == 200) {
uni.showToast({
title: res.message,
icon: 'none'
})
setTimeout(res => {
uni.redirectTo({
url: "/pages/index/order"
})
}, 500)
// }
// }else if(this.radioType== 3){
// if(this.pbAddress == ''){
// this.tui.toast('请输入拼包地址!')
// return
// }
// }
// }else{
// this.tui.toast('请选择发货方式!')
// return
// }
// let obj = {
// orderByWorker: this.lbgName.workerId,
// saleId:this.saleId,
// sale: {
// // relPrice:,
// alreadyEarn: this.priceOk, //已付金额
// realAmount: this.relPrice, //实收金额
// noEarn: this.relPrice - this.priceOk, //欠款
// totalAmount: this.shouldPay, //总金额
// area: this.khName.area,
// city: this.khName.city,
// province: this.khName.province,
// payStatus: 1,
// receiveAddress: this.khName.address,
// userId:this.khName.userId,
// userName:this.khName.name,
// transportType: this.radioType1 == 1?2:this.radioType, //this.radioType
// discount: this.discountNum,
// createBy: this.xsyId,
// createByName:this.createByName,
// remark: this.remark,
// otherExpense:this.otherExpense ==''?0:this.otherExpense, //其他费用
// shareAddress:this.pbAddress,
// transCompany: this.wlName.id,
// companyName:this.wlName.companyName,
// },
// saleDetailList: []
// }
// let purchaseDetails = [];
// this.carList.forEach(function(value, key) {
// console.log(value.stockLogList)
// value.stockLogList.forEach(function(values, keys) {
// let obj = {
// productCount: values,
// attributeList: keys
// }
// value.stockLogList1.push(obj)
// })
// console.log(value)
// purchaseDetails.push(value)
// })
//this.saleDetailList = purchaseDetails;
// obj.saleDetailList = purchaseDetails;
// this.tui.request("/app/sale/buyNew", "post", obj, false, false).then((res) => {
// if (res.code == 200) {
// uni.showToast({
// title: "开单成功",
// icon: 'none'
// })
// setTimeout(res => {
// this.$refs.printerPopup.open('center')
// }, 1000)
}else{
this.tui.toast(res.message)
}
})
// }else{
// this.tui.toast(res.message)
// }
// })
},
//打印取消按钮
printChenel(){
uni.redirectTo({
url: "/pages/index/order"
})
},
//打印小票
onPrint(opt) {
let that = this;
//快递单600*1040 入库单440*320 8像素=1mm
/**
* 打印文字
* x: 文字方块左上角X座标,单位dot
* y: 文字方块左上角Y座标,单位dot
* fontName,fontSize: 字体,取值: 參考文檔
* rotation: 旋转 1-90度 2-180度 3-270度 其他-不旋转
* content: 文字内容
*/
let strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLSETMAG(2, 2)
blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLLocation(2); //对齐指令 0-左对齐 1-右对齐 2-居中
strCmd += blesdk.addCPCLText('0', '30', '24', '0', 0, uni.getStorageSync('shopName'))
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中
strCmd += blesdk.addCPCLText('0', '100', '24', '0', 0, '客户:'+this.khName.name)
strCmd += blesdk.addCPCLText('0', '130', '24', '0', 0, '销售:'+this.createByName)
strCmd += blesdk.addCPCLText('280', '130', '24', '0', 0, '日期:'+this.formatDate(new Date(), 'YYYY-MM-DD')) //+
strCmd += blesdk.addCPCLText('0', '150', '24', '0', 0, '=========================================================')
this.carList.forEach(function(value,key){
strCmd += blesdk.addCPCLText('0', that.yNum+= 30, '24', '0', 0, value.productName+'('+value.productSn+')'+'折扣:'+(value.discount<10?value.discount:'无折扣'))
value.stockLogList.forEach(function(value1,key1){
strCmd += blesdk.addCPCLText('0', that.yNum+= 30, '24', '0', 0,(that.slicePrint(key1))+'*'+value1)
strCmd += blesdk.addCPCLText('200', that.yNum, '24', '0', 0, '单价:'+value.lsprice)
strCmd += blesdk.addCPCLText('360', that.yNum, '24', '0', 0, '总价:'+(value.lsprice*value1))
})
})
strCmd += blesdk.addCPCLText('0', this.yNum+=20, '24', '0', 0, '===============================================================')
strCmd += blesdk.addCPCLText('0', this.yNum+=30, '24', '0', 0, '总数量:'+this.totalAmount)
strCmd += blesdk.addCPCLText('200', this.yNum, '24', '0', 0, '总金额'+this.shouldPay)
strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '应收:'+this.relPrice)
strCmd += blesdk.addCPCLText('0', this.yNum+=30, '24', '0', 0, '实收:'+this.priceOk)
strCmd += blesdk.addCPCLText('200', this.yNum, '24', '0', 0, '欠款:'+this.noPay)
strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '其他费用:'+this.otherExpense)
strCmd += blesdk.addCPCLText('0', this.yNum+=30, '24', '0', 0, '备注:'+this.remark)
strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中
strCmd += blesdk.addCPCLPrint();
this.bufferData = strCmd;
},
//截取
slicePrint(val) {
var name = ''
if (typeof(val) == 'string') {
let newObj = JSON.parse(val)
for (let as in newObj) {
name += newObj[as] + '/'
}
}
return name;
},
formatDate(date, fmt) {
var o = {
'M+': date.getMonth() + 1, //月份
'D+': date.getDate(), //日
'H+': date.getHours(), //小时
'm+': date.getMinutes(), //分
's+': date.getSeconds(), //秒
'q+': Math.floor((date.getMonth() + 3) / 3), //季度
'S': date.getMilliseconds() //毫秒
};
if (/(Y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
for (var k in o)
if (new RegExp('(' + k + ')').test(fmt))
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)));
return fmt;
},
//编辑每一个的单价
clickPrice(index) {
console.log(index)

23
pages/inventory/inventory.vue

@ -37,7 +37,7 @@
</view>
</view>
<view class="search">
<uni-search-bar class="uni-mt-10" radius="5" placeholder="商品名称/编号" cancelButton="none" @confirm="search" />
<uni-search-bar class="uni-mt-10" radius="5" placeholder="商品名称/货号/供应商" cancelButton="none" @confirm="search" />
<view class="title-right-bottom title-btn"
style="width:22%;float: left;height:75rpx;line-height: 75rpx;margin-top:5px;"
@tap.stop="onGridClick('1')">
@ -98,14 +98,14 @@
data() {
return {
size: 30,
keyword: '',
indexList: [],
pageNum: 1, //分页的页码
shopList: [],
categoryId: '', //分类id
shopId: '', //店铺id,
type:'',
warnMsg:[]
warnMsg:[],
searchName:''
}
},
onShow() {
@ -128,7 +128,8 @@
} else {
this.indexList[i].parentId = false
}
}
}
this.categoryId = this.indexList[0].id
this.getShareList(this.indexList[0].id);
} else {
this.tui.toast(res.message)
@ -153,7 +154,8 @@
} else {
this.indexList[i].parentId = false
}
}
}
this.categoryId = this.indexList[index].id
this.getShareList(this.indexList[index].id)
},
//入库单详情
@ -165,8 +167,8 @@
//点击分类获取商品列表
getShareList(id) {
this.tui.request("/app/product/getShareList", "POST", {
categoryId: id,
supplierName: this.keyword,
categoryId: this.categoryId,
supplierName: this.searchName,
pageNum: this.pageNum,
pageSize: '10'
}, false, false).then((res) => {
@ -196,6 +198,7 @@
} else {
that.tui.toast(res.message)
}
this.categoryId = data.categoryId
that.getShareList(data.categoryId)
}).catch((res) => {})
} else { //上架
@ -207,12 +210,18 @@
} else {
that.tui.toast(res.message)
}
this.categoryId = data.categoryId
that.getShareList(data.categoryId)
}).catch((res) => {})
}
}
}
})
},
//搜索接口
search(e){
this.searchName = e.value
this.getShareList()
},
//点击头部 分类管理 和 新增入库 按钮
onGridClick(target) {

92
pages/login/login.vue

@ -156,47 +156,65 @@
type: this.wayValue
}
loginUrl='/auth/smsLogin'
}
this.tui.request(loginUrl, "POST", data, true, true).then((res) => {
if (res.code == 200) {
uni.setStorageSync("hiver_token", res.result.accessToken)
// let state = {
// token: res.result.accessToken
// }
// this.login(state)
//多店铺的时候,在这里加上打开店铺选择弹窗
if (this.wayValue == 1) { //物流公司登录
setTimeout(() => {
uni.reLaunch({
url: '/pages/index/logistics'
})
}, 200)
this.tui.toast('登录成功', 2000, true)
} else if(this.wayValue == 2){ //下游客户登录
setTimeout(() => {
uni.reLaunch({
url: '/pages/other/custom'
})
}, 200)
this.tui.toast('登录成功', 2000, true)
}else if (res.result.shopList.length > 1 && this.wayValue == 0) {
this.shopList = res.result.shopList;
this.toggle("center");
}else{
uni.setStorageSync('shopName',res.result.shopList[0].shopName)
uni.setStorageSync('type',res.result.shopList[0].type)
}
if(this.wayValue == 1){
this.tui.request("/app/logitics/login", "POST", {
username: this.username,
password: this.password,
code: this.code,
saveLogin: true,
type: this.wayValue
}, true, true).then((res) => {
console.log(res)
if (res.code == 200) {
uni.setStorageSync("hiver_token", res.result.lcomToken)
uni.setStorageSync("transCompany", res.result.logiticsCompany.id)
this.tui.toast('登录成功', 2000, true)
setTimeout(() => {
uni.reLaunch({
url: '/pages/index/index'
// url: '/pages/index/logistics'
url: '/pages/other/logistics'
})
}, 200)
this.tui.toast('登录成功', 2000, true)
}
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
}else{
this.tui.toast(res.message)
}
}).catch((res) => {})
}else{
this.tui.request(loginUrl, "POST", data, true, true).then((res) => {
if (res.code == 200) {
uni.setStorageSync("hiver_token", res.result.accessToken)
// let state = {
// token: res.result.accessToken
// }
// this.login(state)
//多店铺的时候,在这里加上打开店铺选择弹窗
if(this.wayValue == 2){ //下游客户登录
setTimeout(() => {
uni.reLaunch({
url: '/pages/other/custom'
})
}, 200)
this.tui.toast('登录成功', 2000, true)
}else if (res.result.shopList.length > 1 && this.wayValue == 0) {
this.shopList = res.result.shopList;
this.toggle("center");
}else{
uni.setStorageSync('shopName',res.result.shopList[0].shopName)
uni.setStorageSync('type',res.result.shopList[0].type)
setTimeout(() => {
uni.reLaunch({
url: '/pages/index/index'
// url: '/pages/index/logistics'
})
}, 200)
this.tui.toast('登录成功', 2000, true)
}
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
}
},
//多店铺的时候点击选择需要登录的店铺
checkShop(item) {

Loading…
Cancel
Save