This commit is contained in:
唐明明
2021-10-26 17:26:01 +08:00
parent 422427f549
commit 89cb4bea28
17 changed files with 1540 additions and 16452 deletions

View File

@@ -2,8 +2,8 @@
"name" : "链商星球", "name" : "链商星球",
"appid" : "__UNI__1F65101", "appid" : "__UNI__1F65101",
"description" : "安徽星煌,链商星球商家工具", "description" : "安徽星煌,链商星球商家工具",
"versionName" : "1.0.5", "versionName" : "1.0.6",
"versionCode" : 105, "versionCode" : 106,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {

File diff suppressed because it is too large Load Diff

View File

@@ -1,105 +1,105 @@
<template> <template>
<view class="content-flex" v-if="!loding"> <view class="content-flex" v-if="!loding">
<scroll-view class="stair" scroll-y> <scroll-view class="stair" scroll-y>
<view class="stair-item" :class="{'show': stairIndex == index}" v-for="(item, index) in category" :key="index" @click="stairIndex = index">{{item.name}}</view> <view class="stair-item" :class="{'show': stairIndex == index}" v-for="(item, index) in category" :key="index" @click="stairIndex = index">{{item.name}}</view>
<view class="ios-bottom"></view> <view class="ios-bottom"></view>
</scroll-view> </scroll-view>
<scroll-view class="second" scroll-y> <scroll-view class="second" scroll-y>
<view class="second-item" v-for="(item, index) in category[stairIndex].children" :key="index" @click="onCategory(item.category_id)"> <view class="second-item" v-for="(item, index) in category[stairIndex].children" :key="index" @click="onCategory(item.category_id)">
{{item.name}}<uni-icons class="arrow-icon" type="arrowright" color="#999" size="14"></uni-icons> {{item.name}}<uni-icons class="arrow-icon" type="arrowright" color="#999" size="14"></uni-icons>
</view> </view>
<view class="ios-bottom"></view> <view class="ios-bottom"></view>
</scroll-view> </scroll-view>
</view> </view>
</template> </template>
<script> <script>
import { managesCategory } from '@/apis/interfaces/goods' import { managesCategory } from '@/apis/interfaces/goods'
export default { export default {
data() { data() {
return { return {
loding : true, loding : true,
category : [], category : [],
stairIndex : 0, stairIndex : 0,
secondIndex : 0 secondIndex : 0
}; };
}, },
created() { created() {
managesCategory().then(res => { managesCategory().then(res => {
this.loding = false this.loding = false
this.category = res this.category = res
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: err.message, title: err.message,
icon : 'none' icon : 'none'
}) })
}) })
}, },
methods:{ methods:{
// 选择分类 // 选择分类
onCategory(cid){ onCategory(cid){
this.$Router.push({name: 'goodsAdd', params: {cid, id: this.category[this.stairIndex].category_id}}) this.$Router.push({name: 'goodsAdd', params: {cid, id: this.category[this.stairIndex].category_id}})
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.content-flex{ .content-flex{
background-color: white; background-color: white;
height: 100vh; height: 100vh;
display: flex; display: flex;
font-size: $title-size-m; font-size: $title-size-m;
.stair{ .stair{
background: #F5F5F5; background: #F5F5F5;
width: 240rpx; width: 240rpx;
.stair-item{ .stair-item{
text-align: center; text-align: center;
padding: 0 $padding; padding: 0 $padding;
line-height: 90rpx; line-height: 90rpx;
color: $text-gray; color: $text-gray;
@extend .nowrap; @extend .nowrap;
&.show{ &.show{
position: relative; position: relative;
background: white; background: white;
color: $text-price; color: $text-price;
font-weight: bold; font-weight: bold;
&::before{ &::before{
position: absolute; position: absolute;
height: 40rpx; height: 40rpx;
width: 5rpx; width: 5rpx;
background: $text-price; background: $text-price;
content: " "; content: " ";
left: 0; left: 0;
top: 20rpx; top: 20rpx;
} }
} }
} }
} }
.second{ .second{
width: calc(100% - 240rpx); width: calc(100% - 240rpx);
.second-item{ .second-item{
position: relative; position: relative;
padding: 0 ($padding + 80) 0 $padding; padding: 0 ($padding + 80) 0 $padding;
line-height: 90rpx; line-height: 90rpx;
color: $text-gray; color: $text-gray;
.arrow-icon{ .arrow-icon{
position: absolute; position: absolute;
right: $padding; right: $padding;
} }
&::after{ &::after{
position: absolute; position: absolute;
height: 1rpx; height: 1rpx;
content: ' '; content: ' ';
background: $border-color; background: $border-color;
left: $padding; left: $padding;
right: 0; right: 0;
top: 0; top: 0;
} }
&:first-child::after{ &:first-child::after{
display: none; display: none;
} }
} }
} }
} }
</style> </style>

View File

@@ -77,7 +77,6 @@
}; };
}, },
created() { created() {
console.log(typeof this.$Route.query.edit)
if(this.$Route.query.edit === 'true' || this.$Route.query.edit ){ if(this.$Route.query.edit === 'true' || this.$Route.query.edit ){
managesGoodsExtends(this.$Route.query.id).then(res => { managesGoodsExtends(this.$Route.query.id).then(res => {
this.productedAt = res.producted_at this.productedAt = res.producted_at

View File

@@ -1,297 +1,323 @@
<template> <template>
<view class="content"> <view class="content">
<!-- 分类 --> <!-- 分类 -->
<view class="tabs"> <view class="tabs">
<view class="item" :class="{'show': status == '0'}" @click="onTabs('0')">已发布</view> <view class="item" :class="{'show': status == '0'}" @click="onTabs('0')">已发布</view>
<view class="item" :class="{'show': status == '1'}" @click="onTabs('1')">待认证</view> <view class="item" :class="{'show': status == '1'}" @click="onTabs('1')">待认证</view>
<view class="item" :class="{'show': status == '2'}" @click="onTabs('2')">审核中</view> <view class="item" :class="{'show': status == '2'}" @click="onTabs('2')">审核中</view>
<view class="item" :class="{'show': status == '3'}" @click="onTabs('3')">已驳回</view> <view class="item" :class="{'show': status == '3'}" @click="onTabs('3')">已驳回</view>
</view> </view>
<!-- 优选商品 --> <!-- 优选商品 -->
<goodsList :list="goods" priceType="CNY" :status='status' toast="暂无产品权证"> <goodsList :list="goods" priceType="CNY" :status='status' toast="暂无产品权证">
<template v-slot:statistics="goods"> <template v-slot:statistics="goods">
<view>库存{{goods.value.stock}}</view> <view>库存{{goods.value.stock}}</view>
</template> </template>
<template v-slot:footer="goods"> <template v-slot:footer="goods">
<view class="footer-btns"> <view class="footer-btns">
<block v-if="status == '0'"> <block v-if="status == '0'">
<button class="button-item" size="mini" @click="openLay(goods.value, 'goodsBurn')">燃烧</button> <button class="button-item" size="mini" @click="openLay(goods.value, 'goodsBurn')">燃烧</button>
<button class="button-item" size="mini" @click="openLay(goods.value, 'goodsMint')">增发</button> <button class="button-item" size="mini" @click="openLay(goods.value, 'goodsMint')">增发</button>
</block> </block>
<block v-if="status == '1'"> <block v-if="status == '1'">
<button class="button-item" size="mini" @click="goodsAuth(goods.value.goods_id)"> 认证</button> <button class="button-item" size="mini" @click="goodsAuth(goods.value.goods_id)"> 认证</button>
<button class="button-item" size="mini" @click="goodsRemove(goods.value.goods_id)">删除</button> <button class="button-item" size="mini" @click="goodsRemove(goods.value.goods_id)">删除</button>
</block> </block>
<block v-if="status == '2'"> <block v-if="status == '2'">
<button class="button-item" size="mini" @click="goodsRemove(goods.value.goods_id)">删除</button> <button class="button-item" size="mini" @click="goodsRemove(goods.value.goods_id)">删除</button>
</block> </block>
<block v-if="status == '3'"> <block v-if="status == '3'">
<button class="button-item" size="mini" @click="goodsPut(goods.value.goods_id, goods.value.reason)">驳回原因</button> <button class="button-item" size="mini" @click="goodsPut(goods.value.goods_id, goods.value.reason)">驳回原因</button>
<button class="button-item" size="mini" @click="goodsRemove(goods.value.goods_id)">删除</button> <button class="button-item" size="mini" @click="goodsRemove(goods.value.goods_id)">删除</button>
</block> </block>
</view> </view>
</template> </template>
</goodsList> </goodsList>
<!-- 燃烧 增发 弹窗 --> <!-- 燃烧 增发 弹窗 -->
<uni-popup ref="popupLay" :safe-area="true" background-color="#ffffff"> <uni-popup ref="popupLay" :safe-area="true" background-color="#ffffff">
<view class="popup"> <view class="popup">
<view class="title">库存{{stockType == 'goodsMint' ? '增发': '燃烧'}}</view> <view class="title">库存{{stockType == 'goodsMint' ? '增发': '燃烧'}}</view>
<view class="des"> <view class="des">
剩余库存 剩余库存
<text>{{itemGoods.stock}}</text> <text>{{itemGoods.stock}}</text>
</view> </view>
<view class="des"> <view class="des">
数量 数量
<uni-number-box v-model='stock' :min="1" :max="stockType == 'goodsBurn' ? itemGoods.stock : 9999"></uni-number-box> <uni-number-box v-model='stock' :min="1" :max="stockType == 'goodsBurn' ? itemGoods.stock : 9999"></uni-number-box>
</view> </view>
<view class="btn" @click="additionalOrBurning">确认</view> <view class="btn" @click="additionalOrBurning">确认</view>
</view> </view>
</uni-popup> </uni-popup>
</view> </view>
</template> </template>
<script> <script>
import { managesGoodsIndex, managesGoodsDelete, managesGoodsBurn, managesGoodsMint, managesGoodsCreateBefore } from '@/apis/interfaces/goods' import { managesGoodsIndex, managesGoodsDelete, managesGoodsBurn, managesGoodsMint, managesGoodsCreateBefore } from '@/apis/interfaces/goods'
import goodsList from '@/components/goods-list/goods-list' import goodsList from '@/components/goods-list/goods-list'
export default { export default {
components: { components: {
goodsList goodsList
}, },
data() { data() {
return { return {
status : 0, status : 0,
goods : [], goods : [],
pages : {}, pages : {},
itemGoods : {}, itemGoods : {},
stock : 1, stock : 1,
stockType : '' stockType : '',
}; page:1,
}, has_more :true,
onShow() { };
this.getList() },
}, onLoad() {
methods: { this.getList()
// tabs },
onTabs(value){ onShow() {
if(value == this.status) return if(uni.getStorageSync('refresh')){
this.goods = [] this.goods = []
this.status = value this.page = 1
this.getList() this.has_more = true
}, this.getList()
// 权证列表 }
getList(){ },
managesGoodsIndex({ onReachBottom() {
status: this.status if(this.has_more){
}).then(res => { this.page = this.page + 1
this.goods = res.data this.getList()
this.pages = res.page }else{
}).catch(err => { uni.showToast({
uni.showToast({ title:'我是有底线的~',
title: err.message, icon:'none'
icon : 'none' })
}) }
}) },
}, methods: {
// 修改产品 // tabs
goodsPut(id, text){ onTabs(value){
uni.showModal({ if(value == this.status) return
title : '驳回原因', this.goods = []
content : text, this.page =1,
confirmText : '编辑', this.has_more = true
cancelText : '确定', this.status = value
success : res => { this.getList()
if(res.confirm){ },
console.log(res.confirm) // 权证列表
this.$Router.push({name: 'goodsAdd', params: {type: 'edit', id}}) getList(){
} managesGoodsIndex({
} status: this.status,
}) page:this.page
}, }).then(res => {
// 商品认证 this.goods = this.goods.concat(res.data)
goodsAuth(id){ this.pages = res.page
this.$Router.push({name: 'goodsAddAuth', params: {id, type: 'magList'}}) this.has_more = res.page.has_more
}, uni.setStorageSync('refresh',false)
// 燃烧,增发 }).catch(err => {
openLay(item, type){ uni.showToast({
this.itemGoods = item title: err.message,
this.stockType = type icon : 'none'
this.stock = 1 })
this.$refs.popupLay.open('bottom') })
}, },
// 提交燃烧,增发 // 修改产品
additionalOrBurning(){ goodsPut(id, text){
let data = { uni.showModal({
id : this.itemGoods.goods_id, title : '驳回原因',
stock: this.stock content : text,
} confirmText : '编辑',
switch (this.stockType){ cancelText : '确定',
case 'goodsBurn': success : res => {
managesGoodsBurn({...data}).then(res => { if(res.confirm){
let goodsIndex = this.goods.findIndex(val => val.goods_id === this.itemGoods.goods_id) console.log(res.confirm)
this.itemGoods.stock -= data.stock this.$Router.push({name: 'goodsAdd', params: {type: 'edit', id}})
this.$refs.popupLay.close() }
}).catch(err => { }
uni.showToast({ })
title: err.message, },
icon : 'none' // 商品认证
}) goodsAuth(id){
}) this.$Router.push({name: 'goodsAddAuth', params: {id, type: 'magList'}})
break; },
case 'goodsMint': // 燃烧,增发
managesGoodsMint({...data}).then(res => { openLay(item, type){
let goodsIndex = this.goods.findIndex(val => val.goods_id === this.itemGoods.goods_id) this.itemGoods = item
this.itemGoods.stock += data.stock this.stockType = type
this.$refs.popupLay.close() this.stock = 1
}).catch(err => { this.$refs.popupLay.open('bottom')
uni.showToast({ },
title: err.message, // 提交燃烧,增发
icon : 'none' additionalOrBurning(){
}) let data = {
}) id : this.itemGoods.goods_id,
break; stock: this.stock
default: }
uni.showToast({ switch (this.stockType){
title: '类型错误', case 'goodsBurn':
icon : 'none' managesGoodsBurn({...data}).then(res => {
}) let goodsIndex = this.goods.findIndex(val => val.goods_id === this.itemGoods.goods_id)
break; this.itemGoods.stock -= data.stock
} this.$refs.popupLay.close()
}, }).catch(err => {
// 移出删除商品 uni.showToast({
goodsRemove(id){ title: err.message,
let index = this.goods.findIndex(val => val.goods_id == id) icon : 'none'
managesGoodsDelete(id).then(res => { })
this.goods.splice(index,1) })
if(this.goods.length === 0) this.getList() break;
uni.showToast({ case 'goodsMint':
title: '商品权证已删除', managesGoodsMint({...data}).then(res => {
icon : 'none' let goodsIndex = this.goods.findIndex(val => val.goods_id === this.itemGoods.goods_id)
}) this.itemGoods.stock += data.stock
}).catch(err => { this.$refs.popupLay.close()
uni.showToast({ }).catch(err => {
title: err.message, uni.showToast({
icon: 'none' title: err.message,
}) icon : 'none'
}) })
} })
}, break;
onNavigationBarButtonTap() { default:
this.$Router.push({name: 'goodsaddClassify'}) uni.showToast({
} title: '类型错误',
} icon : 'none'
</script> })
break;
<style lang="scss" scoped> }
.basics-content{ },
padding-bottom: ($padding*3) + 90; // 移出删除商品
} goodsRemove(id){
let index = this.goods.findIndex(val => val.goods_id == id)
// 按钮组 managesGoodsDelete(id).then(res => {
.basisc-btn{ this.goods.splice(index,1)
position: fixed; if(this.goods.length === 0) this.getList()
bottom: 0; uni.showToast({
left: 0; title: '商品权证已删除',
right: 0; icon : 'none'
padding: $padding; })
background: white; }).catch(err => {
box-shadow: 0 0 4rpx 4rpx rgba($color: #000000, $alpha: .02); uni.showToast({
.btn { title: err.message,
background: $mian-color; icon: 'none'
color: white; })
border-radius: 0; })
font-size: $title-size-lg; }
line-height: 88rpx; },
height: 88rpx; onNavigationBarButtonTap() {
&::after { this.$Router.push({name: 'goodsaddClassify'})
border: none; }
} }
&[disabled] { </script>
background: rgba($color: $mian-color, $alpha: .6);
} <style lang="scss" scoped>
} .basics-content{
} padding-bottom: ($padding*3) + 90;
}
.content{
padding-top: 90rpx; // 按钮组
} .basisc-btn{
// tabs position: fixed;
.tabs{ bottom: 0;
position: fixed; left: 0;
top: 0; right: 0;
//#ifdef H5 padding: $padding;
top: 90rpx; background: white;
// #endif box-shadow: 0 0 4rpx 4rpx rgba($color: #000000, $alpha: .02);
left: 0; .btn {
right: 0; background: $mian-color;
z-index: 99; color: white;
display: flex; border-radius: 0;
justify-content: space-around; font-size: $title-size-lg;
background: white; line-height: 88rpx;
padding: 15rpx 0; height: 88rpx;
font-size: $title-size-lg; &::after {
color: $text-gray; border: none;
.item{ }
height: 60rpx; &[disabled] {
line-height: 60rpx; background: rgba($color: $mian-color, $alpha: .6);
&.show{ }
color: $text-price; }
border-bottom: solid 4rpx $text-price; }
}
} .content{
} padding-top: 90rpx;
// 按钮组 }
.footer-btns{ // tabs
display: flex; .tabs{
justify-content: space-between; position: fixed;
padding-top: $padding/2; top: 0;
margin-left: -10rpx; //#ifdef H5
margin-right: -10rpx; top: 90rpx;
.button-item[size='mini']{ // #endif
padding: 0; left: 0;
margin: 0 10rpx; right: 0;
height: 60rpx; z-index: 99;
line-height: 60rpx; display: flex;
border-radius: 0; justify-content: space-around;
flex: 1; background: white;
background: $border-color-lg; padding: 15rpx 0;
color: $text-gray; font-size: $title-size-lg;
&::after{ color: $text-gray;
border: none; .item{
} height: 60rpx;
} line-height: 60rpx;
} &.show{
// 增发燃烧弹窗 color: $text-price;
.popup { border-bottom: solid 4rpx $text-price;
width: 100%; }
background-color: #fff; }
padding-bottom: $padding; }
.title { // 按钮组
font-size: 36rpx; .footer-btns{
text-align: center; display: flex;
padding: 50rpx 30rpx 30rpx 30rpx; justify-content: space-between;
font-weight: bold; padding-top: $padding/2;
} margin-left: -10rpx;
.btn { margin-right: -10rpx;
background-color: $text-price; .button-item[size='mini']{
height: 90rpx; padding: 0;
line-height: 90rpx; margin: 0 10rpx;
text-align: center; height: 60rpx;
color: #fff; line-height: 60rpx;
font-weight: bold; border-radius: 0;
font-size: $title-size; flex: 1;
margin: $padding * 2; background: $border-color-lg;
} color: $text-gray;
.des { &::after{
display: flex; border: none;
flex-direction: row; }
align-items: center; }
justify-content: space-between; }
box-sizing: border-box; // 增发燃烧弹窗
padding: $padding $padding * 2; .popup {
color: $text-gray; width: 100%;
text{ background-color: #fff;
color: $text-color; padding-bottom: $padding;
} .title {
} font-size: 36rpx;
} text-align: center;
</style> padding: 50rpx 30rpx 30rpx 30rpx;
font-weight: bold;
}
.btn {
background-color: $text-price;
height: 90rpx;
line-height: 90rpx;
text-align: center;
color: #fff;
font-weight: bold;
font-size: $title-size;
margin: $padding * 2;
}
.des {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: $padding $padding * 2;
color: $text-gray;
text{
color: $text-color;
}
}
}
</style>

View File

@@ -214,6 +214,7 @@
// 按钮组 // 按钮组
.basisc-btn{ .basisc-btn{
padding: $padding; padding: $padding;
display: flex;
.add-modules{ .add-modules{
line-height: 86rpx; line-height: 86rpx;
height: 88rpx; height: 88rpx;

View File

@@ -200,7 +200,7 @@
<view class="tool-label-name">员工管理</view> <view class="tool-label-name">员工管理</view>
</view> </view>
<view class="tool-label" v-if="permission.manageScan" @click="$Router.push({name: 'verificationIndex'})"> <view class="tool-label" v-if="permission.manageScan" @click="$Router.push({name: 'verificationIndex'})">
<image class="tool-label-img" src="/static/user/userTool-05.png" mode=""></image> <image class="tool-label-img" src="/static/user/userTool-06.png" mode=""></image>
<view class="tool-label-name">扫码核销</view> <view class="tool-label-name">扫码核销</view>
</view> </view>
</view> </view>

BIN
static/user/userTool-06.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB