|
|
@@ -70,7 +70,8 @@
|
|
|
<view class="price">
|
|
|
<span style="font-size: 22rpx;margin: 0px;">¥</span>{{item.soldPrice}}
|
|
|
<span v-if="item.categoryId == 1945013773786701826 ">~</span>
|
|
|
- <span style="font-size: 22rpx;font-size: 30rpx;font-weight: 600;" v-if="item.categoryId == 1945013773786701826 ">¥{{item.price}}</span>
|
|
|
+ <span style="font-size: 22rpx;font-size: 30rpx;font-weight: 600;"
|
|
|
+ v-if="item.categoryId == 1945013773786701826 ">¥{{item.price}}</span>
|
|
|
<span style="color:#999 ;font-size: 22rpx; text-decoration: line-through;" v-else>¥{{item.price}}</span>
|
|
|
</view>
|
|
|
<image src="/static/product/ticket.png" mode="" class="ticket" v-if="item.isRights == 1"></image>
|
|
|
@@ -123,21 +124,66 @@
|
|
|
<view class="popup" v-if="isDelete">
|
|
|
<view class="content">
|
|
|
<view class="title">
|
|
|
- <span>删除商品</span>
|
|
|
+ <span>提示</span>
|
|
|
</view>
|
|
|
<view class="center">
|
|
|
- <image src="/static/index/close.png" mode="" v-if="canBeDelete"></image>
|
|
|
- <image src="/static/product/error.png" mode="" v-else></image>
|
|
|
<view class="error" v-if="canBeDelete">
|
|
|
- 确定要删除?
|
|
|
+ 是否将所选商品删除?<br />
|
|
|
+ <span style="font-size: 28rpx;color: #666666;margin-top: 16rpx;">删除后需要重新添加品牌标品</span>
|
|
|
+
|
|
|
</view>
|
|
|
<view class="error" v-else>
|
|
|
当前门店还存在有效服务券<br />
|
|
|
<span style="margin-top: 12rpx;">暂时无法关闭门店</span>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="sub" @click="isSuccess = false">
|
|
|
- <view class="button">
|
|
|
+ <view class="btn">
|
|
|
+ <view class="cancel" @click="isDelete = false,productHandleList = []">
|
|
|
+ 取消
|
|
|
+ </view>
|
|
|
+ <view class="button" @click="removeProduct">
|
|
|
+ 确定
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <!-- 下架弹窗 -->
|
|
|
+ <view class="popup" v-if="isDelist">
|
|
|
+ <view class="content">
|
|
|
+ <view class="title">
|
|
|
+ <span>提示</span>
|
|
|
+ </view>
|
|
|
+ <view class="center">
|
|
|
+ <view class="error">
|
|
|
+ 是否将所选商品下架?
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="btn">
|
|
|
+ <view class="cancel" @click="isDelist = false,delistList =[]">
|
|
|
+ 取消
|
|
|
+ </view>
|
|
|
+ <view class="button" @click="delistProduct">
|
|
|
+ 确定
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <!-- 上架弹窗 -->
|
|
|
+ <view class="popup" v-if="isSell">
|
|
|
+ <view class="content">
|
|
|
+ <view class="title">
|
|
|
+ <span>提示</span>
|
|
|
+ </view>
|
|
|
+ <view class="center">
|
|
|
+ <view class="error">
|
|
|
+ 是否将所选商品上架?
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="btn">
|
|
|
+ <view class="cancel" @click="isSell = false,sellProducts = []">
|
|
|
+ 取消
|
|
|
+ </view>
|
|
|
+ <view class="button" @click="sellProduct">
|
|
|
确定
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -177,7 +223,11 @@
|
|
|
productList: [],
|
|
|
merchantId: '',
|
|
|
productHandleList: [],
|
|
|
- tabIndex: 1
|
|
|
+ tabIndex: 1,
|
|
|
+ isDelist: false, //是否下架
|
|
|
+ isSell: false, //是否上架
|
|
|
+ sellProducts: [], //上架商品集合
|
|
|
+ delistList: [] //下架商品集合
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -241,79 +291,76 @@
|
|
|
item.select = !item.select
|
|
|
this.productHandleList.push(item.productId)
|
|
|
},
|
|
|
- //批量上下架status:0下级。1上架
|
|
|
+ //批量上下架status:0下架。1上架
|
|
|
deletes(status) {
|
|
|
- let shelves = []
|
|
|
- this.productList.forEach(item => {
|
|
|
- if (item.select) {
|
|
|
- shelves.push({
|
|
|
- productId: item.productId,
|
|
|
- productStatus: status
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- })
|
|
|
-
|
|
|
let that = this
|
|
|
- uni.showModal({
|
|
|
- title: this.productStatus == 0 ? '确定上架商品?' : '确定下架商品?',
|
|
|
- success: function(res) {
|
|
|
- if (res.confirm) {
|
|
|
-
|
|
|
- that.$http.post("/app/product/shelves", shelves)
|
|
|
- .then(res => {
|
|
|
- if (res.data.code == 200) {
|
|
|
- uni.showToast({
|
|
|
- title: status == 0 ? '下架成功' : '上架成功',
|
|
|
- duration: 2000,
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
- that.$router.go(0)
|
|
|
- that.isManage = false
|
|
|
- that.isAll = false
|
|
|
- }
|
|
|
- })
|
|
|
- } else if (res.cancel) {
|
|
|
- console.log('用户点击取消');
|
|
|
- that.isAll = false
|
|
|
- that.allSelect()
|
|
|
+ // this.productStatus == 0 ?this.isSell = true:this.isDelist = true
|
|
|
+ if (this.productStatus == 0) {
|
|
|
+ this.isSell = true
|
|
|
+ this.productList.forEach(item => {
|
|
|
+ if (item.select) {
|
|
|
+ this.sellProducts.push({
|
|
|
+ productId: item.productId,
|
|
|
+ productStatus: status
|
|
|
+ })
|
|
|
}
|
|
|
- }
|
|
|
- });
|
|
|
+
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.isDelist = true
|
|
|
+ this.productList.forEach(item => {
|
|
|
+ if (item.select) {
|
|
|
+ this.delistList.push({
|
|
|
+ productId: item.productId,
|
|
|
+ productStatus: status
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
//批量删除
|
|
|
remove() {
|
|
|
+ console.log(this.productList)
|
|
|
this.productList.forEach((item => {
|
|
|
- this.productHandleList.push(item.productId)
|
|
|
+ if(item.select){
|
|
|
+ this.productHandleList.push(item.productId)
|
|
|
+ }
|
|
|
+
|
|
|
}))
|
|
|
- let ids = this.productHandleList.join(',')
|
|
|
+ this.isDelete = true
|
|
|
+ },
|
|
|
+ removeProduct() {
|
|
|
+ let ids =[]
|
|
|
+ ids = this.productHandleList.join(',')
|
|
|
console.log(ids)
|
|
|
- let that = this
|
|
|
- uni.showModal({
|
|
|
- title: '确定删除商品?',
|
|
|
- success: function(res) {
|
|
|
- if (res.confirm) {
|
|
|
- that.$http.get("/app/product/deleteBatch?ids=" + ids, )
|
|
|
- .then(res => {
|
|
|
- if (res.data.code == 200) {
|
|
|
- console.log(res)
|
|
|
-
|
|
|
- uni.showToast({
|
|
|
- title: '删除成功',
|
|
|
- duration: 2000,
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
- that.$router.go(0)
|
|
|
- that.isManage = false
|
|
|
- that.isAll = false
|
|
|
- }
|
|
|
- })
|
|
|
- } else if (res.cancel) {
|
|
|
- console.log('用户点击取消');
|
|
|
+ this.$http.get("/app/product/deleteBatch?ids=" + ids, )
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ console.log(res)
|
|
|
+
|
|
|
+ uni.showToast({
|
|
|
+ title: '删除成功',
|
|
|
+ duration: 2000,
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ this.isDelete = false
|
|
|
+ this.productHandleList = []
|
|
|
+ this.$router.go(0)
|
|
|
+ this.isManage = false
|
|
|
+ this.isAll = false
|
|
|
+ } else {
|
|
|
+ this.isDelete = false
|
|
|
+ this.productHandleList = []
|
|
|
+ uni.showToast({
|
|
|
+ title: res.data.message,
|
|
|
+ duration: 2000,
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
}
|
|
|
- }
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
+
|
|
|
//全选
|
|
|
allSelect() {
|
|
|
if (this.isAll) {
|
|
|
@@ -353,66 +400,54 @@
|
|
|
// })
|
|
|
// },
|
|
|
delist(item) {
|
|
|
- let shelves = []
|
|
|
- shelves.push({
|
|
|
+
|
|
|
+ this.delistList.push({
|
|
|
productId: item.productId,
|
|
|
productStatus: 0
|
|
|
})
|
|
|
- let that = this
|
|
|
- uni.showModal({
|
|
|
- title: '确定下架商品',
|
|
|
- success: function(res) {
|
|
|
- if (res.confirm) {
|
|
|
- that.$http.post("/app/product/shelves", shelves)
|
|
|
- .then(res => {
|
|
|
- if (res.data.code == 200) {
|
|
|
- that.getProductList()
|
|
|
- that.getStatus()
|
|
|
- uni.showToast({
|
|
|
- title: '下架成功',
|
|
|
- duration: 2000,
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
-
|
|
|
- }
|
|
|
- })
|
|
|
- } else if (res.cancel) {
|
|
|
- console.log('用户点击取消');
|
|
|
+ this.isDelist = true
|
|
|
+ },
|
|
|
+ //下架商品
|
|
|
+ delistProduct() {
|
|
|
+ this.$http.post("/app/product/shelves", this.delistList)
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ this.getProductList()
|
|
|
+ this.getStatus()
|
|
|
+ uni.showToast({
|
|
|
+ title: '下架成功',
|
|
|
+ duration: 2000,
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ this.isDelist = false
|
|
|
+ this.delistList = []
|
|
|
}
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
+ })
|
|
|
},
|
|
|
//上架
|
|
|
sell(item) {
|
|
|
console.log(item)
|
|
|
- let shelves = []
|
|
|
- shelves.push({
|
|
|
+ this.sellProducts.push({
|
|
|
productId: item.productId,
|
|
|
productStatus: 1
|
|
|
})
|
|
|
- let that = this
|
|
|
- uni.showModal({
|
|
|
- title: '确定上架商品?',
|
|
|
- success: function(res) {
|
|
|
- if (res.confirm) {
|
|
|
- that.$http.post("/app/product/shelves", shelves)
|
|
|
- .then(res => {
|
|
|
- if (res.data.code == 200) {
|
|
|
- that.getProductList()
|
|
|
- that.getStatus()
|
|
|
- uni.showToast({
|
|
|
- title: '上架成功',
|
|
|
- duration: 2000,
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
- } else if (res.cancel) {
|
|
|
- console.log('用户点击取消');
|
|
|
+ this.isSell = true
|
|
|
+ },
|
|
|
+ sellProduct() {
|
|
|
+ this.$http.post("/app/product/shelves", this.sellProducts)
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ this.getProductList()
|
|
|
+ this.getStatus()
|
|
|
+ uni.showToast({
|
|
|
+ title: '上架成功',
|
|
|
+ duration: 2000,
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ this.isSell = false
|
|
|
+ this.sellProducts = []
|
|
|
}
|
|
|
- }
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
//跳转至选择检测站
|
|
|
goSelect(item) {
|
|
|
@@ -915,6 +950,7 @@
|
|
|
}
|
|
|
|
|
|
.center {
|
|
|
+ height: 190rpx;
|
|
|
font-size: 30rpx;
|
|
|
color: #333333;
|
|
|
line-height: 35rpx;
|
|
|
@@ -960,6 +996,40 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ .btn {
|
|
|
+ width: 100%;
|
|
|
+ height: 68rpx;
|
|
|
+ border-radius: 66rpx;
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #FFFFFF;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-around;
|
|
|
+ margin: 0rpx auto;
|
|
|
+
|
|
|
+ .cancel {
|
|
|
+ width: 241rpx;
|
|
|
+ height: 68rpx;
|
|
|
+ border-radius: 54rpx;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ border: 1px solid #cccccc;
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #999999;
|
|
|
+ }
|
|
|
+
|
|
|
+ .button {
|
|
|
+ width: 241rpx;
|
|
|
+ height: 68rpx;
|
|
|
+ background: #449AFF;
|
|
|
+ border-radius: 54rpx;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
.start {
|
|
|
background: #53CC48;
|
|
|
}
|