发布管理界面 完成列表 、删除、编辑、拒绝、同意、等功能 ,交易大厅界面优化及调整

This commit is contained in:
jia 2023-08-18 18:05:33 +08:00
parent 10e260bbcc
commit 29153eeb59
12 changed files with 607 additions and 267 deletions

43
api/release.js Normal file
View File

@ -0,0 +1,43 @@
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
import request from "@/utils/request.js";
/**
* 获取发布管理转售商品列表
* @param numType boolean true 购物车数量,false=购物车产品数量
*/
export function getResale(data) {
return request.get("community/resale/lst", data);
}
/**
* 清除发布管理转售商品
* @param object ids
*/
export function getResaledelete(id) {
return request.post('community/resale/delete/'+ id);
}
/**
* 用户是否同意转售商品折扣价
* @param object ids
*/
export function getResalecheck(id,data) {
return request.post('community/resale/check/'+ id,data);
}
/**
* 获取转售商品详情
* @param object ids
*/
export function getResaleid(id) {
return request.get('community/resale/' + id);
}

View File

@ -9,6 +9,7 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
import request from "@/utils/request.js"; import request from "@/utils/request.js";
/** /**
* 调货列表 * 调货列表
* *
@ -71,7 +72,17 @@ export function getCommunityaddCart(data) {
//商品宝贝详情 //商品宝贝详情
export function getProductDetail(id) { export function getProductDetail(id) {
return request.get('store/product/detail/' + id, { return request.get('store/product/detail/' + id,
noAuth: true );
}); }
//获取转售商品详情
export function getresaleDetail(id) {
return request.get('community/resale/' + id,
);
}
//编辑转售商品
export function getresaleEdit(id,data) {
return request.post('community/resale/edit/' + id,data
);
} }

View File

@ -55,19 +55,19 @@
<view class="price"> <view class="price">
<span>出售价格</span> <span>出售价格</span>
<input type="text" :value="item.price" placeholder="输入出售价格" <input type="text" :value="item.price" placeholder="输入出售价格"
@input="producrprice($event,i)" adjust-position="" @input="producrprice($event,i,item)" adjust-position=""
placeholder-style="color: #CCCCCC;" /> placeholder-style="color: #CCCCCC;" />
</view> </view>
<view class="price_num"> <view class="price_num">
<span>出售数量</span> <span>出售数量</span>
<subtractive v-if='item.num==0' style="margin-top: 10rpx;margin-left: 20rpx;" <subtractive v-if='item.number==0' style="margin-top: 10rpx;margin-left: 20rpx;"
class="step" :min="1" :max="item.attrValue[index].stock" :value="peicenumber" class="step" :min="1" :max="item.attrValue[index].stock" :value="peicenumber"
:isMax="true" :isMin="true" index="11" @eventChange="numberChange($event,i)"> :isMax="true" :isMin="true" index="11" @eventChange="numberChange($event,i)" >
</subtractive> </subtractive>
<subtractive v-else style="margin-top: 10rpx;margin-left: 20rpx;" class="step" <subtractive v-else style="margin-top: 10rpx;margin-left: 20rpx;" class="step"
:min="1" :max="item.attrValue[index].stock" :value="item.num" :isMax="true" :min="1" :max="item.attrValue[index].stock" :value="item.number" :isMax="true"
:isMin="true" index="11" @eventChange="numberChange($event,i)"></subtractive> :isMin="true" index="11" @eventChange="numberChange($event,i)" ></subtractive>
</view> </view>
</view> </view>
</view> </view>
@ -169,9 +169,10 @@
}, },
methods: { methods: {
// //
producrprice(e, i) { producrprice(e, i,item) {
this.bought[i].price = e.detail.value
this.bought[i].price = e.detail.value
this.$set(item, 'check',false);
}, },
// picker // picker
bindPickerChange: function(e, storage, num) { bindPickerChange: function(e, storage, num) {
@ -193,9 +194,10 @@
}, },
numberChange(data, i) { numberChange(data, i) {
this.peicenumber = data.number; this.peicenumber = data.number;
this.bought[i].num = data.number this.bought[i].number = data.number
}, },
tabs(index) { tabs(index) {
this.isActive = index this.isActive = index
this.$set(this.whereb, 'keyword', ''); this.$set(this.whereb, 'keyword', '');
@ -255,7 +257,7 @@
that.checkedArr.forEach((val, i) => { that.checkedArr.forEach((val, i) => {
if (item.product_id == val.product_id) { if (item.product_id == val.product_id) {
that.$set(item, 'check', true); that.$set(item, 'check', true);
that.$set(item, 'num', val.num); that.$set(item, 'number', val.number);
that.$set(item, 'price', val.price); that.$set(item, 'price', val.price);
} }
}) })
@ -274,7 +276,7 @@
this.$set(item, 'check', !item.check); this.$set(item, 'check', !item.check);
if (item.check) { if (item.check) {
if (this.peicenumber == 0) { if (this.peicenumber == 0) {
item.num = 1 item.number = 1
} }
if (!item.product_attr_unique) { if (!item.product_attr_unique) {
@ -291,6 +293,7 @@
}, },
/*确定提交*/ /*确定提交*/
submit() { submit() {
this.$emit('getProduct', this.checkedArr); this.$emit('getProduct', this.checkedArr);
}, },

View File

@ -585,7 +585,7 @@
])), ])),
}, },
onLoad(options) { onLoad(options) {
console.log(options) // console.log(options)
this.referer = options.referer this.referer = options.referer
if (options.product_type) { if (options.product_type) {
this.product_type = options.product_type this.product_type = options.product_type

View File

@ -303,7 +303,8 @@
<navigator v-if="orderInfo.delivery_type == 1 || orderInfo.delivery_type == 4" class='bnt cancel' <navigator v-if="orderInfo.delivery_type == 1 || orderInfo.delivery_type == 4" class='bnt cancel'
hover-class='none' :url="'/pages/users/goods_logistics/index?orderId='+ orderInfo.order_id">查看物流 hover-class='none' :url="'/pages/users/goods_logistics/index?orderId='+ orderInfo.order_id">查看物流
</navigator> </navigator>
<view class='bnt b-color' @tap='confirmOrder(orderInfo)'>取件码</view> <!-- <view class='bnt b-color' @tap='confirmOrder(orderInfo)'>取件码</view> -->
<view class='bnt b-color' @tap='confirmOrder(orderInfo)'>已收货</view>
</block> </block>
<block v-if="orderInfo.status == 2"> <block v-if="orderInfo.status == 2">
<view class="bnt cancel" @click="allRefund" <view class="bnt cancel" @click="allRefund"
@ -914,33 +915,33 @@
}, },
queding() { queding() {
uni.showModal({ // uni.showModal({
title: '取件码', // title: '',
content: item.logistics_code, // content: item.logistics_code,
success: function(res) { // success: function(res) {
if (res.confirm) { // if (res.confirm) {
// console.log(''); // // console.log('');
} else if (res.cancel) { // } else if (res.cancel) {
// console.log(''); // // console.log('');
} // }
} // }
})
// let that = this;
// orderTake(that.order_id).then(res => {
// this.receivingshow = false
// return that.$util.Tips({
// title: '',
// icon: 'success'
// }, function() {
// that.getOrderInfo();
// });
// }).catch(err => {
// this.receivingshow = false
// return that.$util.Tips({
// title: err
// });
// }) // })
let that = this;
orderTake(that.order_id).then(res => {
this.receivingshow = false
return that.$util.Tips({
title: '成功收货',
icon: 'success'
}, function() {
that.getOrderInfo();
});
}).catch(err => {
this.receivingshow = false
return that.$util.Tips({
title: err
});
})
}, },
/** /**
* *

View File

@ -7,102 +7,36 @@
</view> </view>
<!-- 审核通过 打折的拒绝同意功能 调货不需要功能 --> <!-- 审核通过 打折的拒绝同意功能 调货不需要功能 -->
<view class="content-content"> <view class="content-content">
<view class="" v-if='tabTitle=="tabTwo"' v-for="(item,i) in orderList" :key='i'>
<view class="content-onea" v-if='this.tabTitle=="tabTwo"'> <view class="content-onea"
style="margin-bottom: 23rpx;background-color: #FFFFFF; padding: 28rpx 46rpx;">
<view class="content-one-img"> <view class="content-one-img">
<image src="@/static/images/bg2.png" mode="aspectFit"></image> <image :src="item.image" mode="aspectFit"></image>
</view> </view>
<view class="content-one-txt"> <view class="content-one-txt">
<view class="one-txt-a"> <view class="one-txt-a">
超级无敌一级棒乌龙山马龙尖茶... {{item.title}}
</view> </view>
<view class="one-txt-b"> <view class="one-txt-b">
<view class="txt-b-a"> <view class="txt-b-a">
100.00 {{item.discount_price}}
</view> </view>
<view class="txt-b-b"> <view class="txt-b-b" v-if="item.resale_type==1">
类型:调货 类型:调货
</view> </view>
<view class="txt-b-b" v-else>
类型:打折
</view> </view>
</view> </view>
</view> </view>
<view class="" v-else-if="this.tabTitle=='tabFive'">
<view class="content-one">
<view class="content-one-img">
<image src="@/static/images/bg2.png" mode="aspectFit"></image>
</view> </view>
<view class="content-one-txt"> <view class="content-two_one" v-if='tabTitle=="tabOne"'>
<view class="one-txt-a"> <view class="content-two-edit" @click="soldEdit(item) ">
超级无敌一级棒乌龙山马龙尖茶...
</view>
<view class="one-txt-b">
<view class="txt-b-a">
100.00
</view>
<view class="txt-b-b">
结算价:100.00
</view>
</view>
<view class="">
类型:调货
</view>
</view>
</view>
<!-- <view class="content-one">
<view class="content-one-img">
<image src="@/static/images/bg2.png" mode="aspectFit"></image>
</view>
<view class="content-one-txt">
<view class="one-txt-a">
超级无敌一级棒乌龙山马龙尖茶...
</view>
<view class="one-txt-b">
<view class="txt-b-a">
100.00
</view>
<view class="txt-b-b">
结算价:100.00
</view>
</view>
<view class="">
类型:调货
</view>
</view>
</view> -->
</view>
<view class="content-one" v-else>
<view class="content-one-img">
<image src="@/static/images/bg2.png" mode="aspectFit"></image>
</view>
<view class="content-one-txt">
<view class="one-txt-a">
超级无敌一级棒乌龙山马龙尖茶...
</view>
<view class="one-txt-b">
<view class="txt-b-a">
100.00
</view>
<view class="txt-b-b">
类型:调货
</view>
</view>
</view>
</view>
<view class="content-two_one" v-if='this.tabTitle=="tabOne"'>
<view class="content-two-edit" @click="soldEdit">
编辑 编辑
</view> </view>
</view> </view>
<view class="content-two-two" v-if='this.tabTitle=="tabTwo"'> <view class="content-two-two" v-if='tabTitle=="tabTwo"'>
<!-- <view class="content-two-delete"> <!-- <view class="content-two-delete">
删除 删除
</view> </view>
@ -111,36 +45,185 @@
</view> </view>
--> -->
</view> </view>
<view class="content-two-three" v-if='this.tabTitle=="tabThree"'> <view class="content-two-three" v-if='tabTitle=="tabThree"'>
<view class="content-two-delete" @click="pendingDeletion"> <view class="content-two-delete" @click="pendingDeletion(item)">
删除 删除
</view> </view>
<view class="content-two-edit" @click="editReviewe"> <view class="content-two-edit" @click="editReviewe(item)">
编辑 编辑
</view> </view>
</view> </view>
<view class="content-two-four" v-if='this.tabTitle=="tabFour"'> <view class="content-two-four" v-if='tabTitle=="tabFour"'>
<view class="content-two-delete" @click="auditDelete"> <view class="content-two-delete" @click="auditDelete(item)">
删除 删除
</view> </view>
<view class="content-two-edit" @click="auditEdit"> <view class="content-two-edit" @click="auditEdit(item)">
编辑 编辑
</view> </view>
</view> </view>
<view class="content-two-five" v-if='this.tabTitle=="tabFive"'> <view class="content-two-five" v-if='tabTitle=="tabFive"'>
<view class="content-two-delete" @click="passDlete"> <view class="content-two-delete" @click="passDelete(item)">
拒绝 拒绝
</view> </view>
<view class="content-two-agree" @click="passagree"> <view class="content-two-agree" @click="passagree(item)">
同意 同意
</view> </view>
</view> </view>
</view>
<view v-else-if="tabTitle=='tabFive'">
<view class="" v-for="(item,i) in orderList" :key='i'
style="margin-bottom: 23rpx;background-color: #FFFFFF; padding: 28rpx 46rpx;">
<view class="content-one">
<view class="content-one-img">
<image :src="item.image" mode="aspectFit"></image>
</view>
<view class="content-one-txt">
<view class="one-txt-a">
{{item.title}}
</view>
<view class="one-txt-b">
<view class="txt-b-a">
{{item.discount_price}}
</view>
<view class="txt-b-b">
结算价:{{item.discount_price}}
</view>
</view> </view>
<view v-if="orderList.length == 0 && this.where.page > 1"> <view v-if="item.resale_type==1">
类型:调货
</view>
<view v-else>
类型:打折
</view>
</view>
</view>
<view class="content-two_one" v-if='tabTitle=="tabOne"'>
<view class="content-two-edit" @click="soldEdit(item) ">
编辑
</view>
</view>
<view class="content-two-two" v-if='tabTitle=="tabTwo"'>
<!-- <view class="content-two-delete">
删除
</view>
<view class="content-two-edit">
编辑
</view>
-->
</view>
<view class="content-two-three" v-if='tabTitle=="tabThree"'>
<view class="content-two-delete" @click="pendingDeletion(item)">
删除
</view>
<view class="content-two-edit" @click="editReviewe(item)">
编辑
</view>
</view>
<view class="content-two-four" v-if='tabTitle=="tabFour"'>
<view class="content-two-delete" @click="auditDelete(item)">
删除
</view>
<view class="content-two-edit" @click="auditEdit(item)">
编辑
</view>
</view>
<view class="content-two-five" v-if='tabTitle=="tabFive"'>
<view class="content-two-delete" @click="passDelete(item)">
拒绝
</view>
<view class="content-two-agree" @click="passagree(item)">
同意
</view>
</view>
</view>
</view>
<view v-else>
<view class="" v-for="(item,i) in orderList" :key='i'
style="margin-bottom: 23rpx;background-color: #FFFFFF; padding: 28rpx 46rpx;">
<view class="content-one">
<view class="content-one-img">
<image :src="item.image" mode="aspectFit"></image>
</view>
<view class="content-one-txt">
<view class="one-txt-a">
{{item.title}}
</view>
<view class="one-txt-b">
<view class="txt-b-b" v-if="item.resale_type==1">
类型:调货
</view>
<view class="txt-b-b" v-else>
类型:打折
</view>
</view>
</view>
</view>
<view class="content-two_one" v-if='tabTitle=="tabOne"'>
<view class="content-two-edit" @click="soldEdit(item) ">
编辑
</view>
</view>
<view class="content-two-two" v-if='tabTitle=="tabTwo"'>
<!-- <view class="content-two-delete">
删除
</view>
<view class="content-two-edit">
编辑
</view>
-->
</view>
<view class="content-two-three" v-if='tabTitle=="tabThree"'>
<view class="content-two-delete" @click="pendingDeletion(item)">
删除
</view>
<view class="content-two-edit" @click="editReviewe(item)">
编辑
</view>
</view>
<view class="content-two-four" v-if='tabTitle=="tabFour"'>
<view class="content-two-delete" @click="auditDelete(item)">
删除
</view>
<view class="content-two-edit" @click="auditEdit(item)">
编辑
</view>
</view>
<view class="content-two-five" v-if='tabTitle=="tabFive"'>
<view class="content-two-delete" @click="passDelete(item)">
拒绝
</view>
<view class="content-two-agree" @click="passagree(item)">
同意
</view>
</view>
</view>
</view>
</view>
<view v-if="orderList.length == 0 ">
<emptyPage title="暂无订单~"></emptyPage> <emptyPage title="暂无订单~"></emptyPage>
</view> </view>
@ -150,6 +233,15 @@
<script> <script>
import cxNavTitle from '@/components/cx-navTitle.vue' import cxNavTitle from '@/components/cx-navTitle.vue'
import emptyPage from '@/components/emptyPage.vue'; import emptyPage from '@/components/emptyPage.vue';
import {
from
} from 'form-data';
import {
getResaleid,
getResalecheck,
getResaledelete,
getResale
} from '@/api/release.js'
export default { export default {
components: { components: {
cxNavTitle, cxNavTitle,
@ -160,29 +252,36 @@
activeItem: "tabOne", activeItem: "tabOne",
tabTitle: "", tabTitle: "",
orderList: [], orderList: [],
glist: [],
where: { where: {
page: 1, page: 1,
limit: 10 limit: 10,
status: 1
}, },
tabs: [{ tabs: [{
name: "tabOne", name: "tabOne",
label: '在售', label: '在售',
value: 1,
}, },
{ {
name: "tabTwo", name: "tabTwo",
label: '已售出', label: '已售出',
value: 2,
}, },
{ {
name: "tabThree", name: "tabThree",
label: '待审核', label: '待审核',
value: 3,
}, },
{ {
name: "tabFour", name: "tabFour",
label: '审核未通过', label: '审核未通过',
value: 4,
}, },
{ {
name: "tabFive", name: "tabFive",
label: '审核通过', label: '审核通过',
value: 5,
}, },
], ],
} }
@ -194,53 +293,118 @@
if (num.key == '2') { if (num.key == '2') {
this.activeItem = 'tabThree' this.activeItem = 'tabThree'
} }
this.list()
// -- : // -- :
// console.log(this.tabs[0]) // console.log(this.tabs[0])
}, },
methods: { methods: {
tabClick(e) { // tabClick(e) { //
this.orderList = []
this.activeItem = e.name; //class this.activeItem = e.name; //class
this.tabTitle = e.name; // this.tabTitle = e.name; //
this.where.status = e.value
this.list()
}, },
// list() {
soldEdit() { getResale(this.where).then(res => {
console.log('111111') if (res.status = 200) {
let data = { this.orderList.push(...res.data.list)
type: 2,
id: 260
} }
uni.navigateTo({
url: '/pages/trading_hall/product_details/index?key=' + encodeURIComponent(JSON.stringify(
data))
}) })
}, },
// //
pendingDeletion() { soldEdit(item) {
if (item.resale_type == 1) {
uni.navigateTo({
url: '/pages/trading_hall/transfer_goods/index?id=' + item.community_id +
'&gtype=' + 'edit'
})
} else {
uni.navigateTo({
url: '/pages/trading_hall/adddiscounts/index?id=' + item.community_id +
'&gtype=' + 'edit'
})
}
}, },
//
pendingDeletion(item) {
getResaledelete(item.community_id).then(res => {
this.$util.Tips({
title: res.message,
icon: 'success'
})
this.list()
this.tabTitle = 'tabThree'
})
},
// //
editReviewe() { editReviewe(item) {
if (item.resale_type == 1) {
uni.navigateTo({
url: '/pages/trading_hall/transfer_goods/index?id=' + item.community_id +
'&gtype=' + 'edit'
})
} else {
uni.navigateTo({
url: '/pages/trading_hall/adddiscounts/index?id=' + item.community_id +
'&gtype=' + 'edit'
})
}
}, },
// //
auditDelete() { auditDelete(item) {
getResaledelete(item.community_id).then(res => {
this.$util.Tips({
title: res.message,
icon: 'success'
})
this.list()
this.tabTitle = 'tabFour'
})
}, },
// //
auditEdit() { auditEdit(item) {
if (item.resale_type == 1) {
uni.navigateTo({
url: '/pages/trading_hall/transfer_goods/index?id=' + item.community_id +
'&gtype=' + 'edit'
})
} else {
uni.navigateTo({
url: '/pages/trading_hall/adddiscounts/index?id=' + item.community_id +
'&gtype=' + 'edit'
})
}
}, },
// //
passDelete() { passDelete(item) {
getResalecheck(item.community_id, {
"status": 2
}).then(res => {
this.$util.Tips({
title: res.message,
icon: 'success'
})
this.list()
this.tabTitle = 'tabFive'
})
}, },
// //
passagree() { passagree(item) {
getResalecheck(item.community_id, {
"status": 1
}).then(res => {
this.$util.Tips({
title: res.message,
icon: 'success'
})
this.list()
this.tabTitle = 'tabFive'
})
} }
} }
} }
@ -260,12 +424,12 @@
.content-content { .content-content {
margin-top: 21rpx; margin-top: 21rpx;
background: #FFFFFF;
margin-left: 28rpx; margin-left: 28rpx;
margin-right: 28rpx; margin-right: 28rpx;
padding: 0 46rpx;
padding-top: 28rpx; padding-top: 28rpx;
background: #FFFFFF;
border-radius: 14rpx 14rpx 14rpx 14rpx; border-radius: 14rpx 14rpx 14rpx 14rpx;
opacity: 1; opacity: 1;
position: relative; position: relative;
@ -275,12 +439,13 @@
padding-bottom: 23rpx; padding-bottom: 23rpx;
background-color: #FFFFFF;
.content-one-img { .content-one-img {
width: 148rpx; width: 148rpx;
height: 148rpx; height: 148rpx;
margin-right: 28rpx; margin-right: 28rpx;
border: 1px solid;
image { image {
@ -328,11 +493,12 @@
border-bottom: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;
padding-bottom: 23rpx; padding-bottom: 23rpx;
.content-one-img { .content-one-img {
width: 148rpx; width: 148rpx;
height: 148rpx; height: 148rpx;
margin-right: 28rpx; margin-right: 28rpx;
border: 1px solid;
image { image {
width: 100%; width: 100%;

View File

@ -113,7 +113,7 @@
}, },
onLoad() { onLoad() {
getHotBanner('good').then(res => { getHotBanner('good').then(res => {
console.log(res); // console.log(res);
this.bgData = res.data this.bgData = res.data
}) })
this.getArticle() this.getArticle()

View File

@ -210,12 +210,12 @@
configMap configMap
} from '@/utils'; } from '@/utils';
import { import {
getresaleEdit,
getCommunitycreate, getCommunitycreate,
getresaleDetail
} from '@/api/trading-floor.js' } from '@/api/trading-floor.js'
import { import {
getUserInfo getUserInfo
} from '@/api/user.js' } from '@/api/user.js'
import store from '@/store'; import store from '@/store';
@ -237,7 +237,7 @@
category_id: 0, category_id: 0,
video_link: '', video_link: '',
is_type: 3, is_type: 3,
resale_type:2, resale_type: 2,
product_info: [] product_info: []
}, },
price: 0, price: 0,
@ -289,7 +289,7 @@
merId: '', merId: '',
delivery_way: [], // 1 2 delivery_way: [], // 1 2
type: ''
}; };
}, },
computed: { computed: {
@ -319,7 +319,10 @@
onLoad(options) { onLoad(options) {
// uni.hideTabBar() // uni.hideTabBar()
this.id = options.id; this.id = options.id;
this.type = options.gtype
if (this.type) {
this.list()
}
this.tabActive = options.type || 1; this.tabActive = options.type || 1;
if (this.community_app_switch.length == 1) { if (this.community_app_switch.length == 1) {
this.tabActive = this.community_app_switch[0] this.tabActive = this.community_app_switch[0]
@ -346,6 +349,25 @@
}, },
methods: { methods: {
list() {
getresaleDetail(this.id).then(res => {
if (res.data.status = 200) {
this.formData = res.data
this.productList = res.data.resale
this.formData.product_info = []
for (let i in res.data.resale) {
this.price = Number(this.price) + (Number(res.data.resale[i].number) * Number(res.data
.resale[i].price))
this.delivery_way = res.data.resale[i].deliver_method.split('')
}
this.getProduct(res.data.resale)
if(res.data.video_link){
this.tabActive=2
}
}
})
},
getUserInfo: function() { getUserInfo: function() {
let that = this; let that = this;
getUserInfo().then(res => { getUserInfo().then(res => {
@ -369,11 +391,11 @@
// //
deliveryWayChange(obj) { deliveryWayChange(obj) {
this.delivery_way = obj.detail.value; this.delivery_way = obj.detail.value;
if(this.formData.product_info.length>0){ if (this.formData.product_info.length > 0) {
for(let i in this.formData.product_info){ for (let i in this.formData.product_info) {
this.formData.product_info[i].deliver_method = obj.detail.value.toString(); this.formData.product_info[i].deliver_method = obj.detail.value.toString();
} }
}else{ } else {
this.$util.Tips({ this.$util.Tips({
title: '请选择产品,再选择送货方式' title: '请选择产品,再选择送货方式'
}); });
@ -581,15 +603,15 @@
}, },
/*获取选中的宝贝*/ /*获取选中的宝贝*/
getProduct(data) { getProduct(data) {
this.productList=[] this.productList = []
this.price = 0 this.price = 0;
if (data.length > 0) { if (data.length > 0) {
this.productList = data; this.productList = data;
for (let i in data) { for (let i in data) {
this.price = Number(this.price) + (Number(data[i].num) * Number(data[i].price)) this.price = Number(this.price) + (Number(data[i].number) * Number(data[i].price))
this.formData.product_info.push({ this.formData.product_info.push({
product_attr_unique: data[i].product_attr_unique, product_attr_unique: data[i].product_attr_unique,
number: Number(data[i].num), number: Number(data[i].number),
price: data[i].price price: data[i].price
}) })
} }
@ -599,7 +621,6 @@
this.$refs.associated.close(); this.$refs.associated.close();
}, },
@ -631,7 +652,38 @@
title: '保存中', title: '保存中',
mask: true mask: true
}) })
getCommunitycreate(value).then(res => { that.type == 'edit' ? getresaleEdit(that.id, value).then(res => {
if (res.status == '200') {
uni.hideLoading()
that.$util.Tips({
title: '编辑成功',
icon: 'success'
});
that.formData = {
image: [],
content: "",
topic_id: 0,
category_id: 0,
video_link: '',
is_type: 3,
product_info: []
}
uni.navigateTo({
url: '/pages/releaseManagement/index?key=' + 2
})
} else {
that.$util.Tips({
title: res.messge,
icon: 'success'
});
}
}).catch(err => {
return that.$util.Tips({
title: err
});
}) : getCommunitycreate(value).then(res => {
if (res.status == '200') { if (res.status == '200') {
uni.hideLoading() uni.hideLoading()
that.$util.Tips({ that.$util.Tips({

View File

@ -34,10 +34,6 @@
</view> </view>
</view> </view>
</view> </view>
</view> </view>

View File

@ -109,7 +109,7 @@
</view> </view>
</view> --> </view> -->
</view> </view>
<view class="popup_group"> <view class="popup_group" v-if='this.formData.product_info'>
<view class="radio" v-if="this.formData.product_info.length>0"> <view class="radio" v-if="this.formData.product_info.length>0">
<view class="radio_label ">送货方式</view> <view class="radio_label ">送货方式</view>
<checkbox-group class="select_group flex_start" @change="deliveryWayChange"> <checkbox-group class="select_group flex_start" @change="deliveryWayChange">
@ -211,7 +211,8 @@
} from '@/utils'; } from '@/utils';
import { import {
getCommunitycreate, getCommunitycreate,
getresaleDetail,
getresaleEdit
} from '@/api/trading-floor.js' } from '@/api/trading-floor.js'
import { import {
@ -237,7 +238,7 @@
category_id: 0, category_id: 0,
video_link: '', video_link: '',
is_type: 3, is_type: 3,
resale_type:1, resale_type: 1,
product_info: [] product_info: []
}, },
price: 0, price: 0,
@ -288,7 +289,7 @@
}, },
merId: '', merId: '',
delivery_way: [], // 1 2 delivery_way: [], // 1 2
type: ''
}; };
}, },
@ -319,6 +320,7 @@
onLoad(options) { onLoad(options) {
// uni.hideTabBar() // uni.hideTabBar()
this.id = options.id; this.id = options.id;
this.type = options.gtype
this.tabActive = options.type || 1; this.tabActive = options.type || 1;
if (this.community_app_switch.length == 1) { if (this.community_app_switch.length == 1) {
@ -330,6 +332,9 @@
} else { } else {
}
if (this.type) {
this.list()
} }
this.videoContext = uni.createVideoContext("myvideo", this); this.videoContext = uni.createVideoContext("myvideo", this);
}, },
@ -338,20 +343,34 @@
this.formData.content = '' this.formData.content = ''
this.formData.image = [] this.formData.image = []
this.formData.topic_id = '' this.formData.topic_id = ''
this.formData.video_link = '' this.formData.video_link = ''
this.productList = [] this.productList = []
this.topicName = {} this.topicName = {}
}, },
methods: { methods: {
list() {
getresaleDetail(this.id).then(res => {
if (res.data.status = 200) {
this.formData = res.data
this.productList = res.data.resale
this.formData.product_info = []
for (let i in res.data.resale) {
this.price = Number(this.price) + (Number(res.data.resale[i].number) * Number(res.data
.resale[i].price))
this.delivery_way = res.data.resale[i].deliver_method.split('')
}
this.getProduct(res.data.resale)
if(res.data.video_link){
this.tabActive=2
}
}
})
},
getUserInfo: function() { getUserInfo: function() {
let that = this; let that = this;
getUserInfo().then(res => { getUserInfo().then(res => {
this.merId = res.data.service.mer_id this.merId = res.data.service.mer_id
}) })
@ -369,11 +388,11 @@
// //
deliveryWayChange(obj) { deliveryWayChange(obj) {
this.delivery_way = obj.detail.value; this.delivery_way = obj.detail.value;
if(this.formData.product_info.length>0){ if (this.formData.product_info.length > 0) {
for(let i in this.formData.product_info){ for (let i in this.formData.product_info) {
this.formData.product_info[i].deliver_method = obj.detail.value.toString(); this.formData.product_info[i].deliver_method = obj.detail.value.toString();
} }
}else{ } else {
this.$util.Tips({ this.$util.Tips({
title: '请选择产品,再选择送货方式' title: '请选择产品,再选择送货方式'
}); });
@ -581,17 +600,19 @@
}, },
/*获取选中的宝贝*/ /*获取选中的宝贝*/
getProduct(data) { getProduct(data) {
this.productList=[]
this.productList = []
this.price = 0; this.price = 0;
if (data.length > 0) { if (data.length > 0) {
this.productList = data; this.productList = data;
for (let i in data) { for (let i in data) {
console.log(Number(data[i].num) , Number(data[i].price),(Number(data[i].num) * Number(data[i].price)))
this.price = Number(this.price) + (Number(data[i].num) * Number(data[i].price)) this.price = Number(this.price) + (Number(data[i].number) * Number(data[i].price))
this.formData.product_info.push({ this.formData.product_info.push({
product_attr_unique: data[i].product_attr_unique, product_attr_unique: data[i].product_attr_unique,
number: Number(data[i].num), number: Number(data[i].number),
price: data[i].price price: data[i].price
}) })
} }
@ -609,11 +630,12 @@
* 提交数据 * 提交数据
*/ */
formSubmit: function(e) { formSubmit: function(e) {
// console.log(this.id)
let that = this, let that = this,
value = that.formData; value = that.formData;
if (value.image.length == 0) return that.$util.Tips({ if (value.image.length == 0) return that.$util.Tips({
title: '请添加图文图片' title: '请添加图文图片'
}); });
@ -628,12 +650,43 @@
title: '请添加话题视频' title: '请添加话题视频'
}); });
} }
uni.showLoading({ uni.showLoading({
title: '保存中', title: '保存中',
mask: true mask: true
}) })
getCommunitycreate(value).then(res => {
that.type == 'edit' ? getresaleEdit(that.id, value).then(res => {
if (res.status == '200') {
uni.hideLoading()
that.$util.Tips({
title: '编辑成功',
icon: 'success'
});
that.formData = {
image: [],
content: "",
topic_id: 0,
category_id: 0,
video_link: '',
is_type: 3,
product_info: []
}
uni.navigateTo({
url: '/pages/releaseManagement/index?key=' + 2
})
} else {
that.$util.Tips({
title: res.messge,
icon: 'success'
});
}
}).catch(err => {
return that.$util.Tips({
title: err
});
}) : getCommunitycreate(value).then(res => {
if (res.status == '200') { if (res.status == '200') {
uni.hideLoading() uni.hideLoading()
that.$util.Tips({ that.$util.Tips({

View File

@ -9,7 +9,7 @@
</view> </view>
<view> <view>
<text class='default t-color' <text class='default t-color'
v-if="addressInfo.is_default">[默认]</text>{{addressInfo.province}}{{addressInfo.city}}{{addressInfo.district}}{{addressInfo.street || ''}}{{addressInfo.detail}} v-if="addressInfo.is_default">[默认]</text>{{addressInfo.province}}{{addressInfo.city}}{{addressInfo.district}}{{addressInfo.street || ''}}{{addressInfo.detail}}{{addressInfo.brigade}}
</view> </view>
</view> </view>
<navigator v-else :url="'/pages/users/user_address/index?cartId='+cartId" hover-class="none" <navigator v-else :url="'/pages/users/user_address/index?cartId='+cartId" hover-class="none"

View File

@ -1,5 +1,6 @@
<template> <template>
<view> <view>
<view class="content-header">
<view class="header"> <view class="header">
<view class="top-header"> <view class="top-header">
<view class="search"> <view class="search">
@ -7,7 +8,8 @@
<text class="iconfont icon-sousuo"></text> <text class="iconfont icon-sousuo"></text>
<input v-model="where.keyword" confirm-type="search" placeholder="请输入关键字" class="input" /> <input v-model="where.keyword" confirm-type="search" placeholder="请输入关键字" class="input" />
<view class="search_btn"> <view class="search_btn">
<image src="@/static/images/serchbtn.png" mode="aspectFill" @click="handleSearch"></image> <image src="@/static/images/serchbtn.png" mode="aspectFill" @click="handleSearch">
</image>
</view> </view>
</view> </view>
@ -16,7 +18,8 @@
</view> </view>
<view class="recom"> <view class="recom">
<view class="recom_bnt"> <view class="recom_bnt">
<rudon-rowMenuDotDotDot :localdata="options" @change="menuAction($event)" style="color: #000000;"> <rudon-rowMenuDotDotDot :localdata="options" @change="menuAction($event)"
style="color: #000000;">
<view class="" style="color: #F84221;"> <view class="" style="color: #F84221;">
{{this.recomname}} {{this.recomname}}
</view> </view>
@ -35,6 +38,9 @@
<view :class="i==num?'tradline':''"></view> <view :class="i==num?'tradline':''"></view>
</view> </view>
</view> </view>
</view>
<view class="list"> <view class="list">
<view class="item" v-for='(item,index) in datatlist' :key='index' @click="shopping(item)"> <view class="item" v-for='(item,index) in datatlist' :key='index' @click="shopping(item)">
@ -65,11 +71,11 @@
<release :isShow='visible' :bottom='true' @close="closeMadle" @cancel="cancel" @confirm="confirm" <release :isShow='visible' :bottom='true' @close="closeMadle" @cancel="cancel" @confirm="confirm"
style="z-index: 999999!important;"></release> style="z-index: 999999!important;"></release>
<view v-if="datatlist.length == 0||datatlist.length == 0 && where.page > 1 ">
<emptyPage title="暂无商品信息"></emptyPage>
<view class="empty_wrapper" v-if="emptyShow">
<u-empty :show="emptyShow" mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png"></u-empty>
</view> </view>
<u-loadmore :status="status" /> <u-loadmore :status="status" />
</view> </view>
@ -119,18 +125,20 @@
], ],
datatlist: [], datatlist: [],
recomname: '', recomname: '',
emptyShow: false,
} }
}, },
onLoad() { onLoad() {
this.getlist() this.getlist()
}, },
methods: {
onReachBottom() { onReachBottom() {
if (this.status == 'nomore') return; if (this.status == 'nomore') return;
this.status = 'loading'; this.status = 'loading';
this.where.page = ++this.where.page; this.where.page = ++this.where.page;
this.getlist(this.num) this.getlist(this.num)
}, },
methods: {
// //
btntap(index) { btntap(index) {
@ -143,9 +151,7 @@
let data = { let data = {
type: item.resale_type, type: item.resale_type,
id: item.community_id id: item.community_id
} }
uni.navigateTo({ uni.navigateTo({
url: '/pages/trading_hall/product_details/index?key=' + encodeURIComponent(JSON.stringify( url: '/pages/trading_hall/product_details/index?key=' + encodeURIComponent(JSON.stringify(
data)) data))
@ -169,10 +175,9 @@
getCommunityList(this.where).then(res => { getCommunityList(this.where).then(res => {
if (res.status == 200) { if (res.status == 200) {
if (res.data.list.length < this.where.limit) { this.datatlist.push(...res.data.list)
this.status = 'nomore' if (res.data.list.length < this.where.limit) this.status = 'nomore'
} if (this.where.page == 1 && res.data.list.length <= 0) this.emptyShow = true
this.datatlist = res.data.list
} }
}) })
@ -182,17 +187,19 @@
getlist(index) { getlist(index) {
if (this.num == 0) { if (this.num == 0) {
this.where.resale_type = '' this.where.resale_type = ''
this.datatlist=[]
} else if (this.num == 1) { } else if (this.num == 1) {
this.where.resale_type = 1 this.where.resale_type = 1
this.datatlist=[]
} else { } else {
this.where.resale_type = 2 this.where.resale_type = 2
this.datatlist=[]
} }
getCommunityList(this.where).then(res => { getCommunityList(this.where).then(res => {
if (res.status == 200) { if (res.status == 200) {
if (res.data.list.length < this.where.limit) { this.datatlist.push(...res.data.list)
this.status = 'nomore' if (res.data.list.length < this.where.limit) this.status = 'nomore'
} if (this.where.page == 1 && res.data.list.length <= 0) this.emptyShow = true
this.datatlist = res.data.list
} }
}) })
@ -228,6 +235,13 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.content-header {
position: absolute;
position: fixed;
top: 0;
z-index: 8888;
}
.header { .header {
width: 100%; width: 100%;
display: flex; display: flex;
@ -362,6 +376,7 @@
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
flex-wrap: wrap; flex-wrap: wrap;
margin-top: 170rpx;
.item { .item {