Authored by baoss

fix conflict

... ... @@ -68,7 +68,7 @@
checked="model.is_default"
v-model="model.is_default"
></Radio>
<div v-if="isUpdate" class="del-address" @click="delAddress">删除地址</div>
<div v-if="isUpdate && !isSeller" class="del-address" @click="delAddress">删除地址</div>
</div>
</div>
<div :class="submitClass" @touchend="onSubmit">确 认</div>
... ... @@ -116,6 +116,7 @@ export default {
},
isShowProvince: false,
isUpdate: false,
isSeller: false,
updateMobileNum: '',
isMobileNumEdit: false,
title: '',
... ... @@ -317,8 +318,10 @@ export default {
activated() {
let addressInfo = this.updateAddressInfo;
this.isUpdate =
addressInfo.isUpdate && this.$route.query.fromPage !== 'OrderSellConfirm';
//判断是否是出售订单,出售订单不显示“删除地址”
this.isSeller = this.$route.query.fromPage === 'OrderSellConfirm' ? true : false;
this.isUpdate = addressInfo.isUpdate;
this.orderCode = addressInfo.orderCode;
this.title = addressInfo.isUpdate ? '编辑地址' : '添加地址';
... ...
... ... @@ -9,7 +9,6 @@
@scroll="scrollHandler"
:options="options"
@pulling-up="onPullingUp"
@pulling-down="onPullingDown"
:data="productList.list">
<div class="channel-body" ref="body">
<div ref="topSource" class="channel-html">
... ... @@ -57,9 +56,9 @@ export default {
scrollbar: true,
pullUpLoad: true,
// pullDownRefresh: true,
pullDownRefresh: {
txt: '刷新成功',
}
// pullDownRefresh: {
// txt: '刷新成功',
// }
},
scrollEvents: ['scroll'],
scrollY: 0,
... ... @@ -217,12 +216,12 @@ export default {
}
},
onPullingDown() {
let params = this.searchParams;
// onPullingDown() {
// let params = this.searchParams;
params.isReset = true;
this.fetchList(params);
},
// params.isReset = true;
// this.fetchList(params);
// },
},
components: {
Swiper,
... ...
... ... @@ -7,10 +7,9 @@
@pulling-up="onPullingUp"
:data="newsList.list">
<div class="news-content">
<Tab
v-if="newsList.tabList.length > 0" :list="newsList.tabList"></Tab>
<List v-if="newsList.list.length > 0" :list="newsList && newsList.list || []"></List>
<UfoNoItem v-else :tip="`暂无数据`" style="margin-6op: 50px"></UfoNoItem>
<Tab v-if="newsList.tabList.length > 0" :list="newsList.tabList || []"></Tab>
<List v-if="newsList.list && newsList.list.length > 0" :list="newsList.list || []"></List>
<UfoNoItem v-else :tip="`暂无数据`" style="margin-top: 60px"></UfoNoItem>
</div>
</Scroll>
</div>
... ... @@ -30,38 +29,72 @@ export default {
props: ['hideHeader'],
data() {
return {
options: {
pullUpLoad: true
},
msg: '消息',
};
options: {
pullUpLoad: {
threshold: 100,
txt: {
txt: '加载中...',
noMore: '~ 已经到底啦 ~'
}
}
},
computed: {
...mapState(['newsList']),
newsList: {
list: [],
tabList: [],
page: 0,
totalPage: 0,
isMoreData: true,
},
activated() {
let params = {
params: {
type: '',
isPage: true
isResetPage: true,
page: 1,
limit: 10,
},
};
this.fetchNewsList(params);
this.fetchNewsTabList();
},
activated() {
this.fetchList();
this.fetchTabList();
},
mounted() {
},
created() {
},
methods: {
...mapActions(['fetchNewsList', 'fetchNewsTabList']),
async fetchList() {
let result = await this.fetchNewsList({ ...this.params });
if (result.code && result.code == 200) {
if (!this.newsList.isMoreData) return;
this.newsList.list = this.newsList.list.concat(result.data.list);
this.params.page = this.params.page + 1;
this.newsList.page = result.data.page;
this.newsList.totalPage = result.data.totalPage;
if (this.newsList.page < this.newsList.totalPage) {
this.newsList.isMoreData = true;
} else {
this.newsList.isMoreData = false;
}
}
},
async fetchTabList() {
let result = await this.fetchNewsTabList();
if (result.code && result.code == 200) {
this.newsList.tabList = result.data;
}
},
async onPullingUp() {
if (!this.newsList.isMoreData) {
this.$refs.scroll.forceUpdate();
return false
this.$refs.scroll.forceUpdate()
return;
}
let params = {
type: '',
isPage: false
};
await this.fetchNewsList(params);
this.fetchList(this.params);
this.$refs.scroll.forceUpdate();
},
},
... ...
... ... @@ -5,10 +5,10 @@
ref="scroll"
:options="options"
@pulling-up="onPullingUp"
:data="newsDeatilList.list">
:data="newsList.list">
<div class="news-content">
<Title :title="title"></Title>
<List v-if="newsDeatilList.list && newsDeatilList.list.length > 0" :list="newsDeatilList && newsDeatilList.list || []" :isTitle="false"></List>
<List v-if="newsList.list && newsList.list.length > 0" :list="newsList.list || []"></List>
<UfoNoItem v-else :tip="`暂无数据`" style="margin-top: 60px"></UfoNoItem>
</div>
</Scroll>
... ... @@ -28,38 +28,67 @@ export default {
data() {
return {
options: {
pullUpLoad: true
pullUpLoad: {
threshold: 100,
txt: {
more: '加载中...',
noMore: '~ 已经到底啦 ~'
}
}
},
title: '',
type: '',
newsList: {
list: [],
tabList: [],
page: 0,
totalPage: 0,
isMoreData: true,
},
params: {
type: '',
isResetPage: true,
page: 1,
limit: 10,
},
}
},
computed: {
...mapState(['newsList','newsDeatilList']),
},
activated() {
let params = {
type: this.type,
isPage: true
}
this.fetchNewsList(params);
this.fetchList(this.params);
},
created() {
// this.fetchList(this.params);
this.title = this.$route.query.description;
this.type = this.$route.query.type;
this.params.type = this.$route.query.type;
},
methods: {
...mapActions(['fetchNewsList']),
async fetchList() {
let result = await this.fetchNewsList({ ...this.params });
if (result.code && result.code == 200) {
if (!this.newsList.isMoreData) return;
this.newsList.list = result.data.totalPage == 0 ? this.newsList.list : this.newsList.list.concat(result.data.list);
this.params.page = this.params.page + 1;
this.newsList.page = result.data.page;
this.newsList.totalPage = result.data.totalPage;
if (this.newsList.page < this.newsList.totalPage) {
this.newsList.isMoreData = true;
} else {
this.newsList.isMoreData = false;
}
}
},
async onPullingUp() {
if (!this.newsDeatilList.isMoreData ) {
this.$refs.scroll.forceUpdate();
return false
};
let params = {
type: this.type,
isPage: false
if (!this.newsList.isMoreData) {
this.$refs.scroll.forceUpdate()
return;
}
await this.fetchNewsList(params);
this.fetchList(this.params);
this.$refs.scroll.forceUpdate();
}
},
... ...
... ... @@ -28,10 +28,17 @@ export default {
default() {
return false;
}
},
url: {
type: String,
default: ''
}
},
methods: {
onClick() {
if (this.url) {
this.$xianyu.goXianyuNewPage({url: this.url});
}
}
}
};
... ...
... ... @@ -43,7 +43,7 @@ import { createNamespacedHelpers } from "vuex";
import InputUfo from "../price-change/components/input-ufo";
import { debounce } from "lodash";
const { mapActions, mapMutations } = createNamespacedHelpers("order/orderList");
const { mapActions } = createNamespacedHelpers("order/orderList");
export default {
components: { InputUfo },
props: {
... ... @@ -58,6 +58,10 @@ export default {
orderCode: {
type: Number,
default: 0
},
onChangePrice: {
type: Function,
default: () => {}
}
},
data() {
... ... @@ -81,8 +85,7 @@ export default {
this.inputChange = debounce(this.onChange.bind(this), 500);
},
methods: {
...mapActions(["computeChangePrice", "changePrice"]),
...mapMutations(["setChangePrice"]),
...mapActions(["computeChangePrice"]),
async onChange(price) {
if (this.checkPrice(price)) {
const res = await this.computeChangePrice({
... ... @@ -91,13 +94,13 @@ export default {
});
if (typeof res === "string") {
this.errorTip = res;
this.setChangePrice(0);
this.onChangePrice(0);
} else {
this.computePrice = res;
this.setChangePrice(price);
this.onChangePrice(price);
}
} else {
this.setChangePrice(0);
this.onChangePrice(0);
}
},
checkPrice(price) {
... ...
... ... @@ -135,7 +135,7 @@ export default {
this.$router.push({
name: 'addressEdit',
query: {
fromPage: 'order-list'
fromPage: 'OrderList'
}
});
break;
... ...
... ... @@ -5,13 +5,14 @@ import { createNamespacedHelpers } from 'vuex';
import DialogConfirmInfo from '../components/dialog-confirm-info';
import DialogChangeBidPrice from '../components/dialog-change-bid-price';
const { mapActions, mapMutations, mapState } = createNamespacedHelpers(
'order/orderList',
);
const { mapActions, mapMutations } = createNamespacedHelpers('order/orderList');
export default {
computed: {
...mapState(['changePrice']),
data() {
return {
// 求购调价
changePrice: 0,
};
},
methods: {
...mapActions([
... ... @@ -199,7 +200,7 @@ export default {
if (!this.changePrice) {
return;
}
const isOk = await this.confirmChangePrice({
const { isOk, errMsg = '' } = await this.confirmChangePrice({
price: this.changePrice,
orderCode,
});
... ... @@ -211,6 +212,13 @@ export default {
this.resetData();
this.fetchData(this.$route.params);
}
} else {
if (errMsg) {
this.$createToast({
type: 'alert',
txt: errMsg,
});
}
}
},
},
... ... @@ -221,6 +229,7 @@ export default {
computePriceInfo,
goodsInfo,
orderCode,
onChangePrice: v => (this.changePrice = v),
},
slot: 'content',
}),
... ...
... ... @@ -13,7 +13,7 @@ export default {
methods: {
...mapActions(['cancelTradeConfirmInfo', 'cancelTrade']),
...inSaleMapMutations(['filterInSaleOrderList']),
async onSaleOrderAction({ action, order, isDetail = false } = {}) {
async onInSaleOrderAction({ action, order, isDetail = false } = {}) {
const { owner = ownType.SELL } = this.$route.params;
const { orderCode, earnestMoney = 0 } = order;
... ...
... ... @@ -25,12 +25,8 @@
<!-- 商品信息 -->
<order-item-info class="item-wrapper" />
<!-- 鉴定视频 -->
<div
class="video-img"
v-if="orderDetail.appraiseVideoUrl"
@click="() => onVideoHandler()"
></div>
<div ref="videoWrapper" class="video-wrapper">
<div class="video-img" v-if="orderDetail.appraiseVideoUrl" @click="() => onVideoHandler()"></div>
<div class="video-wrapper">
<VideoPlayer
ref="videoPlayer"
class="video-player"
... ... @@ -97,17 +93,6 @@
</p>
</div>
</div>
<!-- 操作 -->
<!-- <detail-footer>
<template #tip="{orderDetail, statusDetail}">
<div v-if="statusDetail.status === 0">
<p class="real-pay-price">
¥{{ orderDetail.priceInfo.realPayPrice }}
</p>
<p>实付金额</p>
</div>
</template>
</detail-footer>-->
<div v-if="actionList.length > 0" class="footer-wrapper">
<div v-if="statusDetail.status === 0">
... ... @@ -139,7 +124,7 @@ import DetailFooter from "./components//detail-footer";
import OrderActions from "../components/order-actions";
import VideoPlayer from "../order-list/components/video-player";
import orderBuyActionMixin from "../mixin/order-buy";
import orderActionMixin from "../mixin/order-action";
const STORE_PATH = "order/orderDetail";
... ... @@ -148,7 +133,7 @@ const { mapActions, mapState, mapGetters } = createNamespacedHelpers(
);
export default {
mixins: [orderBuyActionMixin],
mixins: [orderActionMixin],
components: {
AddressInfo,
OrderItemInfo,
... ... @@ -226,12 +211,13 @@ export default {
}
.video-img {
display: block;
margin-top: 40px;
margin-left: -15px;
width: calc(100% + 20px);
width: 100%;
height: 378px;
background: url("~statics/image/order/video-big@3x.png");
background: url("~statics/image/order/video-big@3x.png") no-repeat;
background-size: cover;
background-position: center;
}
.video-wrapper {
... ... @@ -240,7 +226,7 @@ export default {
.video-player {
display: block;
height: 30px;
height: 40px;
opacity: 0;
}
... ...
... ... @@ -79,7 +79,11 @@
:order="orderDetail"
@on-action="
action => {
onSaleOrderAction({ action, order: orderDetail, isDetail: true });
onInSaleOrderAction({
action,
order: orderDetail,
isDetail: true
});
onAction({ action, order: orderDetail, isDetail: true });
}
"
... ... @@ -101,8 +105,8 @@ import DetailFooter from "./components//detail-footer";
import OrderActions from "../components/order-actions";
import orderBuyActionMixin from "../mixin/order-buy";
import orderSellActionMixin from "../mixin/order-sell";
import orderActionMixin from "../mixin/order-action";
import orderInSaleActionMixin from "../mixin/order-in-sale-action";
import PlatformFeeInfo from "../components/platform-fee-info";
... ... @@ -113,7 +117,7 @@ const { mapActions, mapState, mapGetters } = createNamespacedHelpers(
);
export default {
mixins: [orderBuyActionMixin, orderSellActionMixin],
mixins: [orderActionMixin, orderInSaleActionMixin],
components: {
AddressInfo,
OrderItemInfo,
... ...
... ... @@ -130,19 +130,26 @@ export default {
}
},
methods: {
parentHandleclick() {
this.showVideo = true;
async parentHandleclick() {
// await this.delay(1000);
this.player.play();
const timeId = setTimeout(() => {
this.player.requestFullscreen();
clearTimeout(timeId);
});
},
delay(ns) {
return new Promise(resolve => {
setTimeout(resolve, ns);
});
},
showPlayer() {
if (this.showVideo || !this.source) {
return;
}
this.showVideo = true;
this.$nextTick(() => {
this.initPlayer();
});
... ... @@ -187,14 +194,6 @@ export default {
this.voiceBtn.removeClass(noVioceClass);
}
});
// setTimeout(() => {
// this.$yoho.getNetStatus({}, res => {
// if (res && +res.wifi === 1) {
// this.player.autoplay("muted");
// }
// });
// }, 1000);
},
getTime() {
return new Date().getTime();
... ...
... ... @@ -3,6 +3,7 @@
<div class="content-wrapper">
<scroll
@pulling-up="fetchData"
@pulling-down="onRefresh"
:options="options"
:data="orderList"
class="order-list-scroll-wrap"
... ... @@ -17,7 +18,7 @@
<order-actions
class="actions"
:order="order"
@on-action="action => onSaleOrderAction({ action, order })"
@on-action="action => onInSaleOrderAction({ action, order })"
/>
</div>
</li>
... ... @@ -43,7 +44,7 @@ import EmptyList from "components//ufo-no-item";
import OrderActions from "../components/order-actions";
import CountDown from "../components/count-down";
import orderSellActionMixin from "../mixin/order-sell";
import orderInSaleActionMixin from "../mixin/order-in-sale-action";
const IN_SALE_STORE_PATH = "order/inSaleOrderList";
... ... @@ -56,7 +57,7 @@ const {
export default {
// 订单操作
mixins: [orderSellActionMixin],
mixins: [orderInSaleActionMixin],
components: {
Scroll,
OrderItem,
... ... @@ -88,6 +89,11 @@ export default {
},
methods: {
...mapActions(["fetchEntryOrderList", "fetchNotEntryOrderList"]),
...mapMutations(["resetData"]),
onRefresh() {
this.resetData();
this.fetchData();
},
fetchData() {
if (this.isFetchEntryOrder) {
this.fetchEntryOrderList();
... ...
... ... @@ -4,6 +4,7 @@
<div class="content-wrapper">
<scroll
@pulling-up="fetchData"
@pulling-down="onRefresh"
:options="options"
:data="orderList"
class="order-list-scroll-wrap"
... ... @@ -23,13 +24,13 @@
@on-action="
action => {
onAction({ action, order });
onSaleOrderAction({ action, order });
onInSaleOrderAction({ action, order });
}
"
@on-video="params => onVideoHandle(params)"
/>
</div>
<div ref="videoWrapper" class="video-wrapper">
<div class="video-wrapper">
<VideoPlayer
:ref="order.orderCode"
class="video-player"
... ... @@ -41,6 +42,7 @@
</scroll>
<empty-list
@touch.prevent
class="empty-wrapper"
tip="这里什么都没有..."
v-show="isShowEmpty"
... ... @@ -63,16 +65,18 @@ import EmptyList from "components//ufo-no-item";
import OrderActions from "../components/order-actions";
import CountDown from "../components/count-down";
import orderBuyActionMixin from "../mixin/order-buy";
import orderSellActionMixin from "../mixin/order-sell";
import orderActionMixin from "../mixin/order-action";
import orderInSaleActionMixin from "../mixin/order-in-sale-action";
const STORE_PATH = "order/orderList";
const { mapActions, mapState } = createNamespacedHelpers(STORE_PATH);
const { mapActions, mapState, mapMutations } = createNamespacedHelpers(
STORE_PATH
);
export default {
// 订单操作
mixins: [orderBuyActionMixin, orderSellActionMixin],
mixins: [orderActionMixin, orderInSaleActionMixin],
components: {
Scroll,
OrderItem,
... ... @@ -105,9 +109,14 @@ export default {
methods: {
...mapActions(["fetchOrderList", "confirmReceipt"]),
...mapMutations(["resetData"]),
fetchData() {
this.fetchOrderList(this.$route.params);
},
onRefresh() {
this.resetData();
this.fetchData();
},
onVideoHandle({ videoUrl, orderCode }) {
if (!videoUrl) {
return;
... ... @@ -117,15 +126,6 @@ export default {
$video.parentHandleclick();
}
}
},
mounted() {
if (this.$yoho.isAndroid) {
this.$refs.videoWrapper.forEach($vnode => {
$vnode.style.position = "absolute";
$vnode.style.top = "-1000px";
});
}
}
};
</script>
... ...
... ... @@ -10,7 +10,7 @@
</span>
<span class="wordText">{{price}}</span>
</div>
<OrderMargin class="order-item order-margin" :data="computeTip" :hiddenIcon="hiddenIcon"></OrderMargin>
<OrderMargin class="order-item order-margin" :data="computeTip" :url="url" :superSell="isEntry" ></OrderMargin>
<OrderFee class="order-item" :data="computeTip"></OrderFee>
<AddressInfo :data="addressInfo" class="order-item"></AddressInfo>
</div>
... ... @@ -32,7 +32,7 @@ import TitleComp from './components/confirm/title';
import OrderMargin from './components/confirm/order-margin';
import OrderFee from './components/confirm/order-fee';
import OrderAgree from './components/confirm/agree';
import {get} from 'lodash'
import {get} from 'lodash';
import { createNamespacedHelpers} from 'vuex';
const { mapState, mapActions, mapMutations, mapGetters} = createNamespacedHelpers(
... ... @@ -61,7 +61,7 @@ export default {
isAgreeTerms: false,
hiddenIcon: true,
agreeDesc: '有货卖家协议',
url: `http://m.yohobuy.com/activity/student/detail/renzhen?openby:yohobuy={\"action\":\"go.h5\",\"params\":{\"url\":\"https://activity.yoho.cn/feature/3187.html?title=卖家协议\"}}`,
url: 'http://m.yohobuy.com/activity/student/detail/renzhen?openby:yohobuy={\"action\":\"go.h5\",\"params\":{\"url\":\"https://activity.yoho.cn/feature/3187.html?title=卖家协议\"}}',
isEntry: false,
};
},
... ... @@ -84,14 +84,14 @@ export default {
},
mounted() {
this.isEntry = false
this.isEntry = false;
this.fetchSellerEntryStatus({})
.then((res)=> {
console.log(res)
console.log(res);
if (res) {
this.isEntry = get(res, 'entrySellerType', 0) !== 0
this.isEntry = get(res, 'entrySellerType', 0) !== 0;
}
})
});
this.fetchSellerOrderCount({tabType: 'sell'});// 19268
this.sellerCompute({price: this.price, skup: this.skup});
... ... @@ -101,7 +101,7 @@ export default {
isShowTip(val) {
if (val) {
this.showToast()
this.showToast();
}
}
},
... ... @@ -123,7 +123,7 @@ export default {
this.$createDialog({
type: 'confirm',
title: '',
content: `确定以${this.price}出售此商品`,
content: `确定以¥${this.price}立即出售此商品`,
confirmBtn: {
text: '确定出售',
active: true,
... ... @@ -138,7 +138,9 @@ export default {
},
onConfirm: () => {
this.sellerPublish({price: this.price, skup: this.skup, address_id: this.addressInfo.address_id})
.then(() => {
.then((res) => {
if (res && res.code && res.code == 200) {
this.$createToast({
time: 1000,
type: 'txt',
... ... @@ -146,6 +148,15 @@ export default {
}).show();
this.$router.go(-1);
} else {
this.$createToast({
time: 1000,
type: 'txt',
txt: res.message
}).show();
}
});
},
onCancel: () => {
... ... @@ -188,7 +199,7 @@ export default {
},
showToast() {
this.SELLER_ASK_SET_IS_SHOWTOAST(false)
this.SELLER_ASK_SET_IS_SHOWTOAST(false);
this.$createToast({
time: 1000,
type: 'txt',
... ...
... ... @@ -6,8 +6,7 @@
:hasBorderRadius="false"
:emulateMask="true">
<div class="buy-sheet">
<!-- 临时链接示例 -->
<a class="header" href="http://m.yohobuy.com">求购<i class="cubeic-question"></i></a>
<a class="header" href="https://activity.yoho.cn/feature/6761.html?share_id=9467&title=UFO求购功能说明">求购<i class="cubeic-question"></i></a>
<div class="title">
<div class="title-thumbnail">
<square-img :src="imageUrl" :width="300" :height="300"/>
... ...
... ... @@ -31,18 +31,16 @@ export default function() {
},
[Types.FETCH_NEWSDETAIL_LIST](state, { list }) {
console.log(list.page);
console.log("list.page");
state.newsDeatilList.list = list.page > 1 ? state.newsDeatilList.list.concat(list.list) : list.list;
state.newsDeatilList.page = list.page;
state.newsDeatilList.totalPage = list.totalPage;
list.page < list.totalPage ? state.newsDeatilList.isMoreData = true : state.newsDeatilList.isMoreData = false;
},
resPages(state, {page, isMoreData}) {
state.newsDeatilList.page = page;
state.newsDeatilList.isMoreData = isMoreData;
},
// resPages(state, {page, isMoreData}) {
// state.newsDeatilList.page = page;
// state.newsDeatilList.isMoreData = isMoreData;
// },
[Types.FETCH_NEWS_TAB_LIST](state, { list }) {
state.newsList.tabList = list;
... ... @@ -50,16 +48,8 @@ export default function() {
},
actions: {
async fetchNewsList({ commit, state }, obj) {
console.log(obj)
console.log("objobj")
let type = obj && obj.type;
let page = type ? state.newsDeatilList.page + 1 : state.newsList.page + 1;
let limit = state.newsList.limit;
let isPage = obj && obj.isPage;
if (isPage) {
page = 1;
}
console.log(obj);
let { isResetPage, limit, page, totalPage, type } = obj;
const result = await this.$api.post('/api/ufo/home/newsList', {
page, type: type || '', limit
});
... ... @@ -68,19 +58,19 @@ export default function() {
result.data.list && result.data.list.map((res) => {
res.createTime = moment(new Date(res.createTime * 1000)).format('YYYY.MM.DD HH:mm');
});
if (type) {
console.log('1');
commit(Types.FETCH_NEWSDETAIL_LIST, {list: result.data});
} else {
console.log('2');
commit(Types.FETCH_NEWS_LIST, {list: result.data});
}
// if (type) {
// commit(Types.FETCH_NEWSDETAIL_LIST, {list: result.data});
// } else {
// commit(Types.FETCH_NEWS_LIST, {list: result.data});
// }
return result;
}
},
async fetchNewsTabList({ commit }) {
const result = await this.$api.post('/api/ufo/home/newsListTab', {});
if (result.code === 200) {
commit(Types.FETCH_NEWS_TAB_LIST, {list: result.data});
return result;
}
},
},
... ...
... ... @@ -10,9 +10,6 @@ const initailData = () => ({
currentStatus: null,
routeParamStatus: null,
isShowEmpty: false,
// 求购调价
changePrice: 0,
});
export default function() {
... ... @@ -52,17 +49,16 @@ export default function() {
state.pagetotal = 0;
state.pullUpLoad = true;
},
setChangePrice(state, price) {
state.changePrice = price;
},
resetData(state) {
const s = initailData();
const keyList = Object.keys(s);
const keyBlackList = ['currentStatus', 'routeParamStatus'];
Object.keys(s).forEach(key => {
if (key !== 'currentStatus') {
for (const key of keyList) {
if (!keyBlackList.includes(key)) {
state[key] = s[key];
}
});
}
},
},
actions: {
... ... @@ -178,16 +174,17 @@ export default function() {
},
// 买家调价
async confirmChangePrice({ commit }, { orderCode, price }) {
async confirmChangePrice(_, { orderCode, price }) {
const res = await this.$api.post('/api/order/buyerask/changeprice', {
orderCode: `${orderCode}`,
price: +price,
});
if (res.code) {
commit('setChangePrice', 0);
if (res.code === 200) {
return { errMsg: '', isOk: true };
} else {
return { errMsg: res.message, isOk: false };
}
return res.code === 200 ? res.data : null;
},
},
getters: {},
... ...
... ... @@ -210,9 +210,14 @@ export default function() {
} else {
commit(SELLER_ASK_PUBLISH_FAILURE, result.message);
}
return result;
}, error => {
console.log(error);
commit(SELLER_ASK_PUBLISH_FAILURE, TIP);
return {
code: 400,
message: TIP
};
});
}
},
... ...
... ... @@ -47,7 +47,7 @@ module.exports = (req, res, next) => {
// Todo 删除 600032996 调价: 500031170 购买: 600043484
// 入住商家 50000638
// 梅 500031928
req.user.uid = 500031928;
// req.user.uid = 500031928;
res.locals.isLogin = Boolean(req.user.uid); // 用户是否登录
if (_.get(req, 'user.appSessionType') === 'miniapp') {
... ...
{
"name": "xianyu-ufo-app-web",
"version": "0.0.2-beta-23",
"version": "0.0.2-beta-25",
"private": true,
"description": "Xianyu Project With Express",
"repository": {
... ...