wangfukang 2 years ago
parent
commit
764656c808
  1. 2
      pages/index/index.vue
  2. 73
      pages/inventory/goodsList1.vue
  3. 182
      pages/inventory/inventory.vue
  4. 9
      pages/login/login.vue

2
pages/index/index.vue

@ -177,7 +177,7 @@
<view class="border-line"></view> <view class="border-line"></view>
<u-cell icon="rewind-right-fill" url="/package1/index/updateShopMsg" title="更新店铺信息" clickable <u-cell icon="rewind-right-fill" url="/package1/index/updateShopMsg" title="更新店铺信息" clickable
isLink arrow-direction="left"></u-cell> isLink arrow-direction="left"></u-cell>
<u-cell v-if="shopName == '提钱' || shopName == '测试库新店' || shopName == '提钱退休'" <u-cell v-if="shopName == '炘钱' || shopName == '测试库新店' || shopName == '提钱退休'"
icon="integral-fill" url="/package1/AI/addAiList" title="管理员登录" clickable isLink icon="integral-fill" url="/package1/AI/addAiList" title="管理员登录" clickable isLink
arrow-direction="left"></u-cell> arrow-direction="left"></u-cell>
<!-- <u-cell icon="integral-fill" url="" title="电费缴纳" clickable isLink <!-- <u-cell icon="integral-fill" url="" title="电费缴纳" clickable isLink

73
pages/inventory/goodsList1.vue

@ -18,6 +18,8 @@
<view class="shop-box" style="border-bottom: 1px solid #eee;margin-bottom: 20rpx;"> <view class="shop-box" style="border-bottom: 1px solid #eee;margin-bottom: 20rpx;">
<view style="height: 80rpx;display: flex;padding: 5px 0;border-bottom: 1px solid #eee;"> <view style="height: 80rpx;display: flex;padding: 5px 0;border-bottom: 1px solid #eee;">
<view @tap.stop="scanCodeAdd" style="width: 33.33%;text-align: center;line-height: 70rpx;"> <view @tap.stop="scanCodeAdd" style="width: 33.33%;text-align: center;line-height: 70rpx;">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/b3d67b975feb44edb12f0fd0a6e1afdf.png"
alt="" style="width: 28%;height: 77% !important;padding-right: 20rpx;" @tap.stop="checksaoma()" />
<uni-icons type="scan" size="12"></uni-icons> <uni-icons type="scan" size="12"></uni-icons>
<text>扫一扫</text> <text>扫一扫</text>
</view> </view>
@ -954,6 +956,7 @@
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
<!-- 弹出生成货号 --> <!-- 弹出生成货号 -->
<uni-popup ref="SNDialog" background-color="#fff" :is-mask-click="true"> <uni-popup ref="SNDialog" background-color="#fff" :is-mask-click="true">
<view class="type-popup" style="max-height: 1000rpx;overflow: scroll;margin-bottom: 0;border-radius: 0;"> <view class="type-popup" style="max-height: 1000rpx;overflow: scroll;margin-bottom: 0;border-radius: 0;">
@ -1215,6 +1218,7 @@
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
<view class="mask-model" v-if="methodMask"> <view class="mask-model" v-if="methodMask">
<view>实收金额计算方式</view> <view>实收金额计算方式</view>
<view> <view>
@ -1228,6 +1232,20 @@
<u-keyboard ref="uKeyboard" @confirm='keyboardConfirm' @cancel="keyCancel" @close="keyCancel" <u-keyboard ref="uKeyboard" @confirm='keyboardConfirm' @cancel="keyCancel" @close="keyCancel"
@change="valChange" @backspace="backspace" :overlay='true' :closeOnClickOverlay='true' @change="valChange" @backspace="backspace" :overlay='true' :closeOnClickOverlay='true'
:defaultText="keyboardNum" mode="price" :show="showPrice"></u-keyboard> :defaultText="keyboardNum" mode="price" :show="showPrice"></u-keyboard>
<uni-popup ref="saomaType" background-color="#fff">
<view class="popup-pay-content">
<view class="popup-pay-title">
<text>选择开单方式</text>
</view>
<view class="popup-pay-container" @tap="checkSaomaType('0')">
<text style="display: inline-block">销售</text>
</view>
<view class="popup-pay-container" @tap="checkSaomaType('1')">
<text style="display: inline-block">退货</text>
</view>
</view>
</uni-popup>
<!-- 弹出多图轮播 --> <!-- 弹出多图轮播 -->
<uni-popup ref="showImgDiaLog" background-color="#fff"> <uni-popup ref="showImgDiaLog" background-color="#fff">
<view class="showImg-box"> <view class="showImg-box">
@ -1380,6 +1398,7 @@
voiceType:'new', voiceType:'new',
current: 0, current: 0,
lunbocurrent: 4, lunbocurrent: 4,
saomaotype:'0',
voiceText: ' ', voiceText: ' ',
voiceText1:' ', voiceText1:' ',
discCurrent: '', //折扣 discCurrent: '', //折扣
@ -1723,6 +1742,12 @@
this.oneGoodsId = id this.oneGoodsId = id
this.$refs.returnDialog.open('bottom') this.$refs.returnDialog.open('bottom')
}, },
checkSaomaType(type){
let that = this;
this.saomaotype = type
this.$refs.saomaType.close()
this.scanCodeAdd()
},
onePecsReturnToCarList(){ onePecsReturnToCarList(){
let data = { let data = {
attributeList: '{"颜色":"均色","尺码":"均码"}', attributeList: '{"颜色":"均色","尺码":"均码"}',
@ -2386,6 +2411,9 @@
} }
}, },
checksaoma(){
this.$refs.saomaType.open()
},
AiHandleData() { AiHandleData() {
let that = this; let that = this;
for (let i = 0; i < this.carList1.length; i++) { for (let i = 0; i < this.carList1.length; i++) {
@ -3098,7 +3126,7 @@
if (this.isPlusAndMinus == false) { if (this.isPlusAndMinus == false) {
for (var i = 0; i < this.temporaryList.length; i++) { for (var i = 0; i < this.temporaryList.length; i++) {
if (this.evalue.length == 0) { if (this.evalue.length == 0) {
if(Number(this.allChangeNum) > this.temporaryList[i].productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400')){ if(Number(this.allChangeNum) > this.temporaryList[i].productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400' || this.shopId == '1818888277105709056')){
this.tui.toast(this.temporaryList[i].name + "已超出可售数量",300) this.tui.toast(this.temporaryList[i].name + "已超出可售数量",300)
}else{ }else{
this.temporaryList[i].productCount = Number(this.allChangeNum) this.temporaryList[i].productCount = Number(this.allChangeNum)
@ -3109,7 +3137,7 @@
} else { } else {
for (var j = 0; j < this.evalue.length; j++) { for (var j = 0; j < this.evalue.length; j++) {
if (this.evalue[j] == this.temporaryList[i].name) { if (this.evalue[j] == this.temporaryList[i].name) {
if(Number(this.allChangeNum) > this.temporaryList[i].productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400')){ if(Number(this.allChangeNum) > this.temporaryList[i].productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400' || this.shopId == '1818888277105709056')){
this.tui.toast(this.temporaryList[i].name + "已超出可售数量",300) this.tui.toast(this.temporaryList[i].name + "已超出可售数量",300)
}else{ }else{
this.temporaryList[i].productCount = Number(this.allChangeNum) this.temporaryList[i].productCount = Number(this.allChangeNum)
@ -3192,7 +3220,7 @@
if (this.temporaryList[i].productCount == undefined) { if (this.temporaryList[i].productCount == undefined) {
this.temporaryList[i].productCount = 1 this.temporaryList[i].productCount = 1
} else { } else {
if(this.temporaryList[i].productCount + 1 > this.temporaryList[i].productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400')){ if(this.temporaryList[i].productCount + 1 > this.temporaryList[i].productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400' || this.shopId == '1818888277105709056')){
this.tui.toast(this.temporaryList[i].name + "已超出可售数量",300) this.tui.toast(this.temporaryList[i].name + "已超出可售数量",300)
}else{ }else{
this.temporaryList[i].productCount++ this.temporaryList[i].productCount++
@ -3204,7 +3232,7 @@
if (this.temporaryList[i].productCount == undefined) { if (this.temporaryList[i].productCount == undefined) {
this.temporaryList[i].productCount = 1 this.temporaryList[i].productCount = 1
} else { } else {
if(this.temporaryList[i].productCount + 1 > this.temporaryList[i].productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400')){ if(this.temporaryList[i].productCount + 1 > this.temporaryList[i].productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400' || this.shopId == '1818888277105709056')){
this.tui.toast(this.temporaryList[i].name + "已超出可售数量",300) this.tui.toast(this.temporaryList[i].name + "已超出可售数量",300)
}else{ }else{
this.temporaryList[i].productCount++ this.temporaryList[i].productCount++
@ -3625,19 +3653,10 @@
value1 += '"' + '颜色' + '":"' + data[i].value + '",' value1 += '"' + '颜色' + '":"' + data[i].value + '",'
value1 += '"' + '尺码' + '":"' + dataJ[j].value + '"' value1 += '"' + '尺码' + '":"' + dataJ[j].value + '"'
value1 += "}" value1 += "}"
if(this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400'){
for(let a = 0;a<this.pecsList.length;a++){
if(value1 == this.pecsList[a].attributeList && (this.pecsList[a].stockCount != null && Number(this.pecsList[a].stockCount) > 0)){
value.push(value1) value.push(value1)
this.evalue.push(name) this.evalue.push(name)
} }
} }
}else{
value.push(value1)
this.evalue.push(name)
}
}
}
} }
if (this.temporaryList.length == 0) { if (this.temporaryList.length == 0) {
for (var i = 0; i < value.length; i++) { for (var i = 0; i < value.length; i++) {
@ -3780,7 +3799,7 @@
} }
}, },
numChange(e, index) { numChange(e, index) {
if(Number(e) > this.temporaryList[index].productCount && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400')){ if(Number(e) > this.temporaryList[index].productCount && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400' || this.shopId == '1818888277105709056')){
this.tui.toast("已超出可售数量",300) this.tui.toast("已超出可售数量",300)
}else{ }else{
this.temporaryList[index].productCount = Number(e) this.temporaryList[index].productCount = Number(e)
@ -3816,7 +3835,7 @@
}, },
mapnumChange(e, id, id1) { mapnumChange(e, id, id1) {
let that = this; let that = this;
if(!this.carList.get(id).isNew && e > this.carList.get(id).stockLogList.get(id1).productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400')){ if(!this.carList.get(id).isNew && e > this.carList.get(id).stockLogList.get(id1).productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400' || this.shopId == '1818888277105709056')){
this.tui.toast("已超出可售数量",300) this.tui.toast("已超出可售数量",300)
}else{ }else{
this.carList.get(id).productCount = 0 this.carList.get(id).productCount = 0
@ -3886,7 +3905,7 @@
this.temporaryChange() this.temporaryChange()
}, },
mapPlusNum(index) { mapPlusNum(index) {
if(this.temporaryList[index].productCount + 1 > this.temporaryList[index].productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400')){ if(this.temporaryList[index].productCount + 1 > this.temporaryList[index].productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400' || this.shopId == '1818888277105709056')){
this.tui.toast("已超出可售数量",300) this.tui.toast("已超出可售数量",300)
}else{ }else{
this.temporaryList[index].productCount++ this.temporaryList[index].productCount++
@ -3982,7 +4001,7 @@
}, },
onePlusNum(index, index1) { onePlusNum(index, index1) {
let that = this; let that = this;
if(!this.carList.get(index).isNew && this.carList.get(index).stockLogList.get(index1).productCount + 1 > this.carList.get(index).stockLogList.get(index1).productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400')){ if(!this.carList.get(index).isNew && this.carList.get(index).stockLogList.get(index1).productCount + 1 > this.carList.get(index).stockLogList.get(index1).productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400' || this.shopId == '1818888277105709056')){
this.tui.toast("已超出可售数量") this.tui.toast("已超出可售数量")
}else{ }else{
this.carList.get(index).stockLogList.get(index1).productCount++ this.carList.get(index).stockLogList.get(index1).productCount++
@ -8645,6 +8664,9 @@
if (shopId == uni.getStorageSync('shopId').substring('10','12')) { if (shopId == uni.getStorageSync('shopId').substring('10','12')) {
that.productId = base.decode(res.result.split(',')[0]) that.productId = base.decode(res.result.split(',')[0])
that.toggle('bottom', base.decode(res.result.split(',')[0])); that.toggle('bottom', base.decode(res.result.split(',')[0]));
setTimeout(res => {
that.scanCodeAdd()
}, 1100)
} else { } else {
setTimeout(res => { setTimeout(res => {
that.tui.toast('您的店铺中暂无该商品!') that.tui.toast('您的店铺中暂无该商品!')
@ -8678,7 +8700,14 @@
that.tui.toast(res) that.tui.toast(res)
}) })
} }
uni.vibrateLong({
success: function () {
console.log('震动成功');
},
fail: function () {
console.log('震动失败');
}
})
}, },
fail: (res) => { fail: (res) => {
console.log('扫描失败',res) console.log('扫描失败',res)
@ -10258,6 +10287,9 @@
//this.getKCList(res1.result.stock) //this.getKCList(res1.result.stock)
that.$nextTick(() => { that.$nextTick(() => {
let productcount1 = 1 let productcount1 = 1
if(that.saomaotype == '1'){
productcount1 = -1
}
let stockcount = null let stockcount = null
if(this.pecsList.length == 1){ if(this.pecsList.length == 1){
attr = this.pecsList[0].attributeList attr = this.pecsList[0].attributeList
@ -10273,7 +10305,7 @@
if(that.carList.get(id).stockLogList.has(attr)){ if(that.carList.get(id).stockLogList.has(attr)){
let oldProductCount = that.carList.get(id).stockLogList.get(attr).productCount let oldProductCount = that.carList.get(id).stockLogList.get(attr).productCount
if(oldProductCount != undefined){ if(oldProductCount != undefined){
productcount1 += Number(oldProductCount) productcount1 = productcount1 + Number(oldProductCount)
} }
} }
} }
@ -11739,6 +11771,7 @@
this.tui.request(url, "post", this.sellObj, false, false).then((res) => { this.tui.request(url, "post", this.sellObj, false, false).then((res) => {
if (res.code == 200) { if (res.code == 200) {
that.saomaotype = ''
uni.showToast({ uni.showToast({
title: "开单成功", title: "开单成功",
icon: 'none' icon: 'none'
@ -12278,7 +12311,7 @@
this.khData = res.result this.khData = res.result
this.khName = { this.khName = {
id: res.result.userId, id: res.result.userId,
name: res.result.userName, name: this.khName.name,
noEarn: res.result.amountOwed, noEarn: res.result.amountOwed,
categoryId: res.result.categoryId categoryId: res.result.categoryId
} }

182
pages/inventory/inventory.vue

@ -1,7 +1,8 @@
<!-- 库存列表页 --> <!-- 库存列表页 -->
<template> <template>
<view> <view>
<view class="" style="width: 100%;display: flex;border-top: 1px solid #eee;border-bottom: 1px solid #eee;position: fixed;background: #fff;top: 0;z-index: 99;"> <view class=""
style="width: 100%;display: flex;border-top: 1px solid #eee;border-bottom: 1px solid #eee;position: fixed;background: #fff;top: 0;z-index: 99;">
<view class="title-left"> <view class="title-left">
<view class="title-left-box" style="color:blue;text-decoration: underline;" @tap="goWarnList"> <view class="title-left-box" style="color:blue;text-decoration: underline;" @tap="goWarnList">
<text>{{warnMsg.tailWarnCount}}</text> <text>{{warnMsg.tailWarnCount}}</text>
@ -47,29 +48,38 @@
</view> </view>
</view> </view>
<view class="search"> <view class="search">
<uni-search-bar class="uni-mt-10" radius="5" placeholder="商品名称/货号/供应商" cancelButton="none" @blur="search" @clear="clearSearch" /> <uni-search-bar class="uni-mt-10" radius="5" placeholder="商品名称/货号/供应商" cancelButton="none" @blur="search"
@clear="clearSearch" />
</view> </view>
<view class="content-left" style="height: 78%;float: left;position: fixed;top: 23%;"> <view class="content-left" style="height: 78%;float: left;position: fixed;top: 23%;">
<view v-if="gateType == ''" class="left-box" v-for="(item, index) in indexList" :key="index" <view v-if="gateType == ''" class="left-box" v-for="(item, index) in indexList" :key="index"
:class="item.parentId ? 'left-box-hover':''" @tap="clickLeftBtn(index)"> :class="item.parentId ? 'left-box-hover':''" @tap="clickLeftBtn(index)">
<text style="width: 100%;height: 90rpx;line-height: 90rpx;display: inline-block;overflow: hidden;" :class="item.parentId ? 'red' :''">{{item.categoryName}}</text> <text style="width: 100%;height: 90rpx;line-height: 90rpx;display: inline-block;overflow: hidden;"
:class="item.parentId ? 'red' :''">{{item.categoryName}}</text>
</view> </view>
</view> </view>
<view class="content-right" style="width: 570rpx;background: #fff;margin-left:170rpx;margin-top: 300rpx;"> <view class="content-right" style="width: 570rpx;background: #fff;margin-left:170rpx;margin-top: 300rpx;">
<view style="display: flex;height: 60rpx;line-height: 60rpx;background: #C6E2FF;color: #777;text-align: center;"> <view
style="display: flex;height: 60rpx;line-height: 60rpx;background: #C6E2FF;color: #777;text-align: center;">
<view style="width: 33%;"> <view style="width: 33%;">
款数:{{indexList[categoryIndex].count != undefined ? indexList[categoryIndex].count : 0}} 款数:{{indexList[categoryIndex].count != undefined ? indexList[categoryIndex].count : 0}}
</view> </view>
<view style="width: 46%;" @tap.stop="seeStockCount(indexList[categoryIndex].stockCount,indexList[categoryIndex].minusStockCount)"> <view style="width: 46%;"
@tap.stop="seeStockCount(indexList[categoryIndex].stockCount,indexList[categoryIndex].minusStockCount)">
库存数:{{indexList[categoryIndex].stockCount != undefined ? indexList[categoryIndex].stockCount + indexList[categoryIndex].minusStockCount: 0}} 库存数:{{indexList[categoryIndex].stockCount != undefined ? indexList[categoryIndex].stockCount + indexList[categoryIndex].minusStockCount: 0}}
<uni-icons type="help" size="15" style="padding-right: 50rpx;" @tap.stop="seeStockCount(indexList[categoryIndex].stockCount,indexList[categoryIndex].minusStockCount)"></uni-icons> <uni-icons type="help" size="15" style="padding-right: 50rpx;"
@tap.stop="seeStockCount(indexList[categoryIndex].stockCount,indexList[categoryIndex].minusStockCount)"></uni-icons>
</view> </view>
<view style="width: 17%;position: relative;" @tap.stop="goodsListSort"> <view style="width: 17%;position: relative;" @tap.stop="goodsListSort">
排序 排序
<uni-icons type="up" size="14" v-if="sort == ''" style="position: absolute;top: -4px;right: 0;"></uni-icons> <uni-icons type="up" size="14" v-if="sort == ''"
<uni-icons type="down" size="14" v-if="sort == ''" style="position: absolute;top: 6px;right: 0;"></uni-icons> style="position: absolute;top: -4px;right: 0;"></uni-icons>
<uni-icons type="up" size="14" color='#FF6A6A' v-if="sort != '' && orderSort == 'asc'" style="position: absolute;top: 0;right: 0;"></uni-icons> <uni-icons type="down" size="14" v-if="sort == ''"
<uni-icons type="down" size="14" color='#FF6A6A' v-if="sort != '' && orderSort == 'desc'" style="position: absolute;top: 0;right: 0;"></uni-icons> style="position: absolute;top: 6px;right: 0;"></uni-icons>
<uni-icons type="up" size="14" color='#FF6A6A' v-if="sort != '' && orderSort == 'asc'"
style="position: absolute;top: 0;right: 0;"></uni-icons>
<uni-icons type="down" size="14" color='#FF6A6A' v-if="sort != '' && orderSort == 'desc'"
style="position: absolute;top: 0;right: 0;"></uni-icons>
</view> </view>
</view> </view>
<view class="right-box" v-for="(item,index) in shopList" :key="index" @tap="goDetail(item)"> <view class="right-box" v-for="(item,index) in shopList" :key="index" @tap="goDetail(item)">
@ -84,14 +94,16 @@
<!-- 1上架 0下架 --> <!-- 1上架 0下架 -->
<view class="up-down" v-if="item.delFlag ==1" @tap.stop="upDown('0',item)">下架</view> <view class="up-down" v-if="item.delFlag ==1" @tap.stop="upDown('0',item)">下架</view>
<view class="up-down" v-if="item.delFlag ==0" @tap.stop="upDown('1',item)">上架</view> <view class="up-down" v-if="item.delFlag ==0" @tap.stop="upDown('1',item)">上架</view>
<view @tap.stop="oneShare(item)" style="position: absolute;top: 0;right: 20rpx;width: 100rpx;height: 80rpx;"> <view @tap.stop="oneShare(item)"
style="position: absolute;top: 0;right: 20rpx;width: 100rpx;height: 80rpx;">
<button class="shareBtn"> <button class="shareBtn">
<uni-icons type="redo" size="22"></uni-icons> <uni-icons type="redo" size="22"></uni-icons>
</button> </button>
</view> </view>
<view class="box-right-price"> <view class="box-right-price">
<view class="price-box" v-if='type==0'> <view class="price-box" v-if='type==0'>
<text style="color: red;">{{item.inStorageStatus==0?'待入库':item.purchasePrice==null?'新商品':item.purchasePrice}}</text> <text
style="color: red;">{{item.inStorageStatus==0?'待入库':item.purchasePrice==null?'新商品':item.purchasePrice}}</text>
<text>采购价</text> <text>采购价</text>
</view> </view>
<view class="price-box"> <view class="price-box">
@ -110,7 +122,8 @@
</view> </view>
</view> </view>
</view> </view>
<view @tap.stop="seeCustomCategory(item.customerCategoryRule)" style="padding: 4px 2px;position: absolute;right: 20rpx;bottom: 104rpx;background: #088FEB;border-radius: 5px;color: #fff;"> <view @tap.stop="seeCustomCategory(item.customerCategoryRule)"
style="padding: 4px 2px;position: absolute;right: 20rpx;bottom: 104rpx;background: #088FEB;border-radius: 5px;color: #fff;">
客户价格 客户价格
</view> </view>
</view> </view>
@ -128,14 +141,16 @@
<!-- 1上架 0下架 --> <!-- 1上架 0下架 -->
<view class="up-down" v-if="item.delFlag ==1" @tap.stop="upDown('0',item)">下架</view> <view class="up-down" v-if="item.delFlag ==1" @tap.stop="upDown('0',item)">下架</view>
<view class="up-down" v-if="item.delFlag ==0" @tap.stop="upDown('1',item)">上架</view> <view class="up-down" v-if="item.delFlag ==0" @tap.stop="upDown('1',item)">上架</view>
<view @tap.stop="oneShare(item)" style="position: absolute;top: 20rpx;right: 20rpx;width: 100rpx;height: 100rpx;"> <view @tap.stop="oneShare(item)"
style="position: absolute;top: 20rpx;right: 20rpx;width: 100rpx;height: 100rpx;">
<button class="shareBtn"> <button class="shareBtn">
<uni-icons type="redo" size="22"></uni-icons> <uni-icons type="redo" size="22"></uni-icons>
</button> </button>
</view> </view>
<view class="box-right-price"> <view class="box-right-price">
<view class="price-box" v-if='type==0'> <view class="price-box" v-if='type==0'>
<text style="color: red;">{{item.inStorageStatus==0?'待入库':item.purchasePrice==null?'新商品':item.purchasePrice}}</text> <text
style="color: red;">{{item.inStorageStatus==0?'待入库':item.purchasePrice==null?'新商品':item.purchasePrice}}</text>
<text>采购价</text> <text>采购价</text>
</view> </view>
<view class="price-box"> <view class="price-box">
@ -154,7 +169,9 @@
</view> </view>
</view> </view>
</view> </view>
<view @tap.stop="seeCustomCategory(item.customerCategoryRule)" v-if="item.customerCategoryRule != null && item.customerCategoryRule != ''" style="padding: 4px 2px;position: absolute;right: 20rpx;bottom: 104rpx;background: #088FEB;border-radius: 5px;color: #fff;"> <view @tap.stop="seeCustomCategory(item.customerCategoryRule)"
v-if="item.customerCategoryRule != null && item.customerCategoryRule != ''"
style="padding: 4px 2px;position: absolute;right: 20rpx;bottom: 104rpx;background: #088FEB;border-radius: 5px;color: #fff;">
客户价格 客户价格
</view> </view>
</view> </view>
@ -202,16 +219,21 @@
<uni-popup ref="sharePopup" background-color="#fff"> <uni-popup ref="sharePopup" background-color="#fff">
<view style="height: 250rpx;"> <view style="height: 250rpx;">
<button open-type="share" @tap="$refs.sharePopup.close()" class="popup-photo">分享给微信好友</button> <button open-type="share" @tap="$refs.sharePopup.close()" class="popup-photo">分享给微信好友</button>
<view @tap="$refs.sharePopup.close()" class="popup-photo" style="border-bottom:0;border-top:10px solid #eee;">取消</view> <!-- <button @tap="getUserData" class="popup-photo">生成商品图</button> -->
<view @tap="$refs.sharePopup.close()" class="popup-photo"
style="border-bottom:0;border-top:10px solid #eee;">取消</view>
</view> </view>
</uni-popup> </uni-popup>
<!-- 弹出多图轮播 --> <!-- 弹出多图轮播 -->
<uni-popup ref="imgPopup" background-color="#fff"> <uni-popup ref="imgPopup" background-color="#fff">
<view class="showImg-box"> <view class="showImg-box">
<swiper indicator-dots class="swiper-box" @change="lunbochange" circular autoplay :current="swiperDotIndex"> <swiper indicator-dots class="swiper-box" @change="lunbochange" circular autoplay
:current="swiperDotIndex">
<swiper-item v-for="(item, index) in bigImg" :key="index"> <swiper-item v-for="(item, index) in bigImg" :key="index">
<view class="swiper-item"> <view class="swiper-item">
<image mode='aspectFit' show-menu-by-longpress :src="item.productPicture" alt="" style="width: 100%;height: 100%;border-radius: 10px;" /></image> <image mode='aspectFit' show-menu-by-longpress :src="item.productPicture" alt=""
style="width: 100%;height: 100%;border-radius: 10px;" />
</image>
</view> </view>
</swiper-item> </swiper-item>
</swiper> </swiper>
@ -267,6 +289,9 @@
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
<view v-if="canvasshow">
<canvas canvas-id="myCanvas" :style="{height:canvasHeight+'px',width:canvasWidth+'px'}"></canvas>
</view>
</view> </view>
</template> </template>
@ -278,10 +303,13 @@
computed: mapState(['shopIndex', 'region']), computed: mapState(['shopIndex', 'region']),
data() { data() {
return { return {
canvasshow: false,
size: 30, size: 30,
customerCategoryList: [], customerCategoryList: [],
indexList: [], indexList: [],
zheng: '0', zheng: '0',
canvasWidth:0,
canvasHeight:0,
fu: '0', fu: '0',
bigImg: [], bigImg: [],
swiperDotIndex: 0, swiperDotIndex: 0,
@ -296,6 +324,7 @@
warnMsg: [], warnMsg: [],
goodsData: [], goodsData: [],
searchName: '', searchName: '',
base64: '',
categoryIndex: 0, categoryIndex: 0,
windowHeight: 0, windowHeight: 0,
shopList1: [], shopList1: [],
@ -352,6 +381,105 @@
this.getweiruku() this.getweiruku()
}, },
methods: { methods: {
getUserData() {
let that = this;
this.tui.request("/order/ow/getWechatQrcode", "post", {
page: 'package1/index/downStearmList',
scene: this.khid,
envVersion: __wxConfig.envVersion,
}, false, true).then((res1) => {
if (res1.code == 200) {
let imgA = res1.result;
uni.downloadFile({
url: imgA,
success: (res2) => {
this.base64 = res2.tempFilePath
uni.showLoading({
title: '请求中...'
})
setTimeout(res3 => {
uni.hideLoading()
that.getData()
}, 500)
}
});
} else {
this.tui.toast(res.message)
}
}).catch((res) => {
console.log('报错', res)
})
},
getData() {
let that = this
uni.showLoading({
title: '生成中...'
})
this.canvasshow = true
//背景图
let imgA = this.goodsData.productPicture;
uni.getImageInfo({
src: imgA,
success: function(image) {
console.log(image.width);
console.log(image.height);
// 1920 1500 1920/1500 1.5 800/1.5
// if(image.height > 1500){
// that.canvasHeight = 1700
// that.canvasWidth = (image.width/ Number((image.height/1500).toFixed(2))).toFixed(0)
// }else{
that.canvasWidth = image.width
that.canvasHeight = image.height + 200
// }
const ctx = uni.createCanvasContext('myCanvas', this);
ctx.setFillStyle('#fff');
ctx.fillRect(0, 0, that.canvasWidth, that.canvasHeight);
// // 绘制第一张图片
ctx.drawImage(image.path, 0, 0, image.width, image.height);
ctx.draw()
// 绘制第二张图片
ctx.drawImage(that.base64, 25, that.canvasHeight - 175, 150, 150);
ctx.draw(true);
ctx.font = "20px 宋体";
// 设置字体样式
ctx.setFontSize(28)
// 设置文字颜色
ctx.fillStyle = '#FF5809';
// 绘制文字
ctx.fillText(uni.getStorageSync('shopName'), 200 , that.canvasHeight - 125);
// 设置字体样式
ctx.setFontSize(24)
// 设置文字颜色
ctx.fillStyle = '#000';
// 绘制文字
ctx.fillText('长按识别查看商品', 200 ,that.canvasHeight - 75);
ctx.draw(true)
setTimeout(ress => {
uni.canvasToTempFilePath({
x: 0,
y: 0,
width: that.canvasWidth,
height: that.canvasHeight,
destWidth: that.canvasWidth,
destHeight: that.canvasHeight,
canvasId: 'myCanvas',
success: (res3) => {
that.canvasshow = false
that.tempFilePath = res3.tempFilePath
uni.previewImage({
urls: [res3.tempFilePath]
})
uni.hideLoading()
}
});
}, 500)
}
});
},
lunbochange(e) { lunbochange(e) {
this.current = e.detail.current this.current = e.detail.current
}, },
@ -575,7 +703,9 @@
}, },
oneShare(item) { oneShare(item) {
this.goodsData = item this.goodsData = item
this.picture = (item.productPicture == null || item.productPicture == "") ?'https://jewel-shop.oss-cn-beijing.aliyuncs.com/70c3d9a274ff4feeb6df0bcb8be0f733.jpg':item.productPicture this.picture = (item.productPicture == null || item.productPicture == "") ?
'https://jewel-shop.oss-cn-beijing.aliyuncs.com/70c3d9a274ff4feeb6df0bcb8be0f733.jpg' : item
.productPicture
this.$refs.sharePriceDialog.open() this.$refs.sharePriceDialog.open()
}, },
//商品上下架 //商品上下架
@ -845,6 +975,7 @@
flex-direction: column; flex-direction: column;
margin-top: 10rpx; margin-top: 10rpx;
} }
.box-right-name { .box-right-name {
font-size: 26rpx; font-size: 26rpx;
height: 50rpx; height: 50rpx;
@ -885,6 +1016,7 @@
width: 140rpx; width: 140rpx;
text-align: center; text-align: center;
} }
.noPic { .noPic {
border-radius: 10px; border-radius: 10px;
width: 140rpx; width: 140rpx;
@ -895,6 +1027,7 @@
color: #777; color: #777;
background: #eee; background: #eee;
} }
.popup-pay-content { .popup-pay-content {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -922,14 +1055,17 @@
border-top: 1px solid #eee; border-top: 1px solid #eee;
color: #fff; color: #fff;
} }
.showImg-box { .showImg-box {
width: 700rpx; width: 700rpx;
height: 1000rpx; height: 1000rpx;
border-radius: 10px; border-radius: 10px;
} }
.swiper-box { .swiper-box {
height: 1000rpx; height: 1000rpx;
} }
.swiper-item { .swiper-item {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -940,6 +1076,7 @@
background-color: #cee1fd; background-color: #cee1fd;
border-radius: 10px; border-radius: 10px;
} }
.popup-photo { .popup-photo {
height: 110rpx; height: 110rpx;
line-height: 110rpx; line-height: 110rpx;
@ -948,9 +1085,11 @@
font-weight: 800; font-weight: 800;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
} }
.vue-ref { .vue-ref {
padding-bottom: 0 !important; padding-bottom: 0 !important;
} }
.shareBtn { .shareBtn {
background: rgba(255, 255, 255, 0); background: rgba(255, 255, 255, 0);
width: 90rpx; width: 90rpx;
@ -960,9 +1099,11 @@
border: 1px solid #fff; border: 1px solid #fff;
background-color: rgba(255, 255, 255, 0); background-color: rgba(255, 255, 255, 0);
} }
.shareBtn::after { .shareBtn::after {
border: none; border: none;
} }
.popup-photo { .popup-photo {
height: 110rpx; height: 110rpx;
line-height: 110rpx; line-height: 110rpx;
@ -983,6 +1124,7 @@
} }
} }
.popup-content { .popup-content {
align-items: center; align-items: center;
justify-content: center; justify-content: center;

9
pages/login/login.vue

@ -116,8 +116,17 @@
} }
}, },
onLoad(option) { onLoad(option) {
if(option.saleId){
this.saleId = option.saleId this.saleId = option.saleId
}
if(option.userId){
this.userId = option.userId this.userId = option.userId
}
if(uni.getStorageSync('codePage')){
this.wayValue = 2
this.$forceUpdate()
uni.removeStorageSync('codePage')
}
if(uni.getStorageSync('hiver_token') != '' && uni.getStorageSync('wayValue') == 2){ if(uni.getStorageSync('hiver_token') != '' && uni.getStorageSync('wayValue') == 2){
uni.reLaunch({ uni.reLaunch({
url: '/package1/other/custom?saleId=' + this.saleId + '&userId=' + this.userId url: '/package1/other/custom?saleId=' + this.saleId + '&userId=' + this.userId

Loading…
Cancel
Save