Showing 38 changed files with 662 additions and 205 deletions
... ... @@ -60,7 +60,6 @@ const xianyu = {
},
goXianyuNewPage(args) {
console.log(args);
if (!args.url) {
return;
}
... ... @@ -73,7 +72,14 @@ const xianyu = {
try {
pageParams = queryString.parse(urlSplit[1]);
let arr = [];
if (Object.keys(pageParams)[0] === 'openby:yohobuy') {
for (let key in pageParams) {
arr.push(pageParams[key]);
}
pageParams = JSON.parse(arr[0]).params;
}
// console.log(JSON.parse(arr[0]).params);
if (pageParams.pagename) {
switch (pageParams.pagename) {
case 'productList':
... ... @@ -82,19 +88,33 @@ const xianyu = {
case 'productDetail':
pageName = 'ProductDetail';
break;
case 'logisticsInfo':
pageName = 'orderLogisticsInfo';
break;
default:
break;
}
delete pageParams.pagename;
pageParams.owner = pageParams.logisticsType;
pageParams.code = pageParams.ordercode;
console.log(pageParams);
}
} catch (error) {
console.log(error);
}
if (pageName) {
let paramsV = {};
if (pageName === 'List') {
paramsV.query = pageParams;
} else {
paramsV.params = pageParams;
}
console.log(paramsV);
return this.$router.push({
name: pageName,
params: pageParams
...paramsV,
});
}
}
... ...
... ... @@ -144,4 +144,9 @@ export const orderActionsMap = {
name: 'MODIFY_ADDRESS',
text: '修改地址',
},
CHANGE_BID_PRICE: {
code: 'change_bid_price',
name: 'CHANGE_BID_PRICE',
text: '调价',
},
};
... ...
... ... @@ -102,10 +102,14 @@ export default {
}
}
let addressInfo = JSON.parse(item || "{}");
Object.assign(addressInfo, { isUpdate: !isAdd, orderCode: "" });
//编辑地址时保存item
if (!isAdd) {
let addressInfo = JSON.parse(item || "{}");
Object.assign(addressInfo, { isUpdate: !isAdd, orderCode: "" });
this.STORE_UPDATE_ADDRESS_INFO(addressInfo);
}
this.STORE_UPDATE_ADDRESS_INFO(addressInfo);
this.$router.push({
name: "addressEdit"
});
... ...
... ... @@ -334,7 +334,7 @@ export default {
<style lang="scss" scoped>
.pane-body {
height: 100%;
overflow-y: auto;
overflow-y: hidden;
padding-top: 12px;
padding-left: 40px;
padding-right: 40px;
... ...
... ... @@ -154,8 +154,8 @@ export default {
refreshProductList(index) {
let str = get(get(this.navList, `[${index}].url`, '').split('?'), '[1]', '');
this.params = Object.assign({}, queryString.parse(str), this.listBaseParams);
this.fetchList(this.params);
this.searchParams = Object.assign({}, queryString.parse(str), this.listBaseParams);
this.fetchList(this.searchParams);
},
async onPullingUp() {
... ... @@ -178,7 +178,7 @@ export default {
return;
}
if (typeof params === 'object' && Object.keys(params)) {
searchParams = Object.assign({...searchParams}, params);
searchParams ={...params};
this.searchParams = searchParams;
}
... ... @@ -214,8 +214,10 @@ export default {
},
onPullingDown() {
this.params.isReset = true;
this.fetchList(this.params);
let params = this.searchParams;
params.isReset = true;
this.fetchList(params);
},
},
components: {
... ...
<template>
<div class="hot" v-if="list.length > 0">
<ul>
<li v-for="(item, index) in list" :key="index" @click="goProduct(item)">
<div class="hot-image">
<ImageFormat :lazy="false" class="item-imge" :src="item.src" :alt="item.alt" :width="100" :height="100"></ImageFormat>
</div>
<div class="hot-name">{{item.title}}</div>
<li v-for="(item, index) in list" :key="index">
<LayoutLink :href="item.url" class="img-link">
<div class="hot-image">
<ImageFormat :lazy="false" class="item-imge" :src="item.src" :alt="item.alt" :width="100" :height="100"></ImageFormat>
</div>
<div class="hot-name">{{item.title}}</div>
</LayoutLink>
</li>
<li @click="goMore" class="goMore">
<div class="hot-image">更多</div>
... ... @@ -31,12 +33,14 @@ export default {
ImgSize,
},
methods: {
goProduct(item) {
this.$router.push({
path: 'List',
query: {series: item.series_id }
});
},
// goProduct(item) {
// console.log(item);
// return false;
// this.$router.push({
// name: 'List',
// query: {series: item.series_id }
// });
// },
goMore() {
this.$router.push({ path: 'category' });
... ...
... ... @@ -43,16 +43,16 @@ export default {
<style lang="scss" scoped>
.bind-alipay {
width: 100%;
text-align: center;
height: 88px;
line-height: 88px;
background-color: #fff;
color: #D0021B;
border-radius: 88px;
font-size: 32px;
margin-bottom: 20px;
margin-top: 60px;
border: solid 1px #eee;
text-align: center;
height: 88px;
line-height: 88px;
background-color: #fff;
color: #D0021B;
border-radius: 88px;
font-size: 32px;
margin-bottom: 20px;
margin-top: 60px;
border: solid 1px #eee;
}
.bind-tip {
margin: 0 40px;
... ...
... ... @@ -3,9 +3,9 @@
<div class="news-list-title" v-if="isTitle">最新消息</div>
<ul class="news-list-content">
<li v-for="(item, key) in list" :key="key">
<LayoutLink :href="item.action || ''" class="img-link">
<div class="news-list-name">{{ item.content }}</div>
<div class="news-list-time">{{ item.createTime }}</div>
<LayoutLink :href="item && item.action || ''" class="img-link">
<div class="news-list-name">{{ item && item.content }}</div>
<div class="news-list-time">{{ item && item.createTime }}</div>
</LayoutLink>
</li>
</ul>
... ...
... ... @@ -41,7 +41,7 @@ export default {
computed: {
...mapState(['newsList']),
},
mounted() {
activated() {
let params = {
type: '',
isPage: true
... ... @@ -64,6 +64,9 @@ export default {
this.$refs.scroll.forceUpdate();
}
},
watch:{
// '$route':["fetchNewsList","fetchNewsTabList"]
},
components: {
Style,
Scroll,
... ...
... ... @@ -8,7 +8,7 @@
:data="newsDeatilList.list">
<div class="news-content">
<Title :title="title"></Title>
<List v-if="newsDeatilList.list.length > 0" :list="newsDeatilList && newsDeatilList.list || []" :isTitle="false"></List>
<List v-if="newsDeatilList.list && newsDeatilList.list.length > 0" :list="newsDeatilList && newsDeatilList.list || []" :isTitle="false"></List>
<UfoNoItem v-else :tip="`暂无数据`"></UfoNoItem>
</div>
</Scroll>
... ... @@ -40,7 +40,7 @@ export default {
computed: {
...mapState(['newsList','newsDeatilList']),
},
mounted() {
activated() {
let params = {
type: this.type,
isPage: true
... ...
<template>
<div>
<LayoutApp :show-back="true">
<LayoutApp :show-back="true" :title="title">
<div class="filter">
<div class="filter-tab">
<div class="tab-item" :class="selectedType === 2 && 'selected-tab'" @click="pressType(2)">人气</div>
... ... @@ -62,7 +62,7 @@ export default {
arrowImage: '',
listType: 1,
type: 6,
title: '',
productList: {
showErrorPage: false,
isFetching: false,
... ... @@ -96,6 +96,12 @@ export default {
this.changeArrow();
let params = this.$route.query;
if (params.title) {
this.title = params.title;
delete params.title;
} else {
this.title = '商品列表';
}
if (Object.keys(params).length && params.listType) {
this.listType = params.listType;
delete params.listType;
... ...
<!--买家求购确认页-->
<template>
<LayoutApp :show-back="true">
<LayoutApp :show-back="true" title="出价求购">
<div class="body" ref="body">
<div class="topContainer">
<div class="topView">
... ... @@ -58,15 +58,13 @@
<div class="space"></div>
<div class="line"></div>
<div class="bottomContainer">
<OrderAgree :value="isAgreeTerms" @input="isAgreeTerms = !isAgreeTerms" class="agree-wrapper"></OrderAgree>
<div>
<Button :disabled="!isAgreeTerms" type="submit" @click="submitClick">提交</Button>
</div>
</div>
</div>
</div>
<div class="bottomContainer">
<OrderAgree :value="isAgreeTerms" @input="isAgreeTerms = !isAgreeTerms" class="agree-wrapper" :desc="agreeDesc" :url="url"></OrderAgree>
<div>
<Button :disabled="!isAgreeTerms" type="submit" @click="submitClick">提交</Button>
</div>
</div>
</LayoutApp>
</template>
... ... @@ -99,6 +97,8 @@ export default {
return {
inputPrice: '',
isAgreeTerms: false,
url: `http://m.yohobuy.com/activity/student/detail/renzhen?openby:yohobuy={\"action\":\"go.h5\",\"params\":{\"url\":\"https://activity.yoho.cn/feature/3189.html?title=买家协议&promiseV="}}`,
agreeDesc: '有货买家协议'
};
},
... ... @@ -129,6 +129,7 @@ export default {
},
mounted() {
this.BUYER_ASK_RESET_DATA();
this.BUYER_ASK_SET_STORAGEID(this.storageId);
this.fetchBuyerOrderCount({ tabType: 'buy'});
this.fetchConfig();
... ... @@ -158,6 +159,7 @@ export default {
'BUYER_ASK_SET_CHOOSEDAY',
'BUYER_ASK_SET_SHOWDIALOG',
'BUYER_ASK_SET_STORAGEID',
'BUYER_ASK_RESET_DATA',
]),
...mapActions([
'fetchConfig',
... ... @@ -297,15 +299,16 @@ export default {
<style lang="scss" scoped>
.body {
height: 100%;
position: relative;
/*position: relative;*/
padding-bottom: 200px;
overflow-y: auto;
}
.topContainer {
height: calc(100% - 100*2px);
/*height: calc(100% - 100*2px);*/
padding-left: 20*2px;
padding-right: 20*2px;
margin-bottom: 200px;
/*margin-bottom: 200px;*/
}
.topView {
... ... @@ -517,6 +520,7 @@ export default {
/*height: 100px;*/
width: 100%;
left: 0px;
z-index: 1;
}
.agree-wrapper {
... ...
... ... @@ -3,20 +3,20 @@
<template>
<div class="customSelectWrapper">
<div class="customSelectTextWrapper">
<div class="customSelectTextWrapper" @click="showPicker">
<span class="leftText">求购期限:</span>
<div class="rightWrapper">
<span class="rightText">{{value}}</span>
<i class="cubeic-arrow" ></i>
</div>
</div>
<Select
v-model="chooseday"
:title="title"
:options="options"
@change="change"
class="customSelect"
/>
<!--<Select-->
<!--v-model="chooseday"-->
<!--:title="title"-->
<!--:options="options"-->
<!--@change="change"-->
<!--class="customSelect"-->
<!--/>-->
</div>
</template>
... ... @@ -65,7 +65,22 @@ export default {
methods: {
change(value, index, text) {
console.log('change', value, index, text);
this.choose && this.choose(value);
this.choose && this.choose(value[0]);
},
showPicker() {
console.log(this.options)
this.$createPicker({
title: '选择求购时限',
data: [this.options],
onSelect: this.change,
selectedIndex: [2],
onCancel: () => {
}
}).show();
}
}
... ... @@ -113,7 +128,8 @@ export default {
.customSelect {
position: relative;
opacity: 0 !important;
opacity: 1 !important;
z-index: 1;
}
</style>
... ...
<template>
<div class="change-bid-price-wrapper"></div>
</template>
<script>
export default {};
</script>
<style scoped>
.change-bid-price-wrapper {
}
</style>
\ No newline at end of file
... ...
<template>
<div class="confirm-info-wrapper">
<p class="confrim-info" v-if="info.confirmDesc">{{ info.confirmDesc }}</p>
<div v-if="info.needPenalty || info.showPrice" class="price-info">
<div class="confrim-info" v-if="confirmDescList.length > 0">
<span v-for="(info, i) in confirmDescList" :key="i">{{ info }}</span>
</div>
<div v-if="info.showPrice" class="price-info">
<p class="price-item">
<span>{{ info.orderPriceDesc }}</span>
<span>{{ info.orderPrice }}</span>
... ... @@ -15,6 +17,20 @@
<span>{{ info.refundAmount }}</span>
</p>
</div>
<div v-if="isPlatformFee" class="price-info">
<p class="price-item">
<span>{{ info.orderPriceDesc }}</span>
<span>{{ info.orderPrice }}</span>
</p>
<p class="price-item">
<span>{{ info.penaltyDesc }}&nbsp;&nbsp;({{ info.penaltyRate }})</span>
<span>{{ info.penaltyAmount }}</span>
</p>
<p class="price-item">
<span>{{ info.refundDesc }}</span>
<span>{{ info.refundAmount }}</span>
</p>
</div>
</div>
</template>
... ... @@ -23,7 +39,30 @@ export default {
props: {
info: {
type: Object,
default: {}
default: function() {
return {};
}
},
isPlatformFee: {
type: Boolean,
default: false
},
platformFeeInfo: {
type: Object,
default: function() {
return {};
}
}
},
computed: {
confirmDescList() {
const { confirmDesc = "" } = this.info;
if (confirmDesc.includes("#*")) {
const regexp = /#\*(.*?)\*#/;
return confirmDesc.split(regexp);
} else {
return [confirmDesc];
}
}
}
};
... ... @@ -34,11 +73,27 @@ export default {
display: flex;
padding: 0 40px;
color: #000;
font-size: 24px;
.confrim-info {
font-size: 28px;
text-align: center;
flex: 1;
span {
color: #d0021b;
}
& > :first-child,
& > :last-child {
color: #000;
padding-left: 10px;
}
// p {
// display: inline-block;
// text-align: left;
// max-width: 100%;
// }
}
.price-info {
... ...
<template>
<div class="platform-fee-info-wrapper">
<div class="price-info">
<p class="price-item">
<span>{{ platformFeeInfo.appraiseFeeDesc }}</span>
<span>{{ platformFeeInfo.appraiseFee }}</span>
</p>
<p class="price-item">
<span>{{ platformFeeInfo.packageFeeDesc }}</span>
<span>{{ platformFeeInfo.packageFee }}</span>
</p>
<p class="price-item">
<span
>{{ platformFeeInfo.serviceFeeDesc }}&nbsp;&nbsp;({{
platformFeeInfo.payChannelPercentage
}})</span
>
<span>{{ platformFeeInfo.serviceFee }}</span>
</p>
</div>
</div>
</template>
<script>
export default {
props: {
platformFeeInfo: {
type: Object,
default: function() {
return {};
}
}
}
};
</script>
<style lang="scss" scoped>
.platform-fee-info-wrapper {
display: flex;
padding: 0 40px;
color: #000;
.confrim-info {
font-size: 28px;
text-align: center;
flex: 1;
span {
color: #d0021b;
}
& > :first-child,
& > :last-child {
color: #000;
padding-left: 10px;
}
// p {
// display: inline-block;
// text-align: left;
// max-width: 100%;
// }
}
.price-info {
flex: 1;
.price-item {
display: flex;
justify-content: space-between;
.penalty {
color: #d0021b;
}
}
}
}
</style>
... ...
<template>
<layout-app title="订单详情">
<layout-app>
<div class="order-detail-wrapper">
<div class="content">
<!-- 状态信息 -->
... ...
<template>
<div class="address-wrapper">
<i class="address-icon"></i>
<i
v-if="$route.params.owner === 'sell'"
class="address-icon back-address-icon"
></i>
<i v-else class="address-icon"></i>
<div>
<p class="consignee">{{ userAddress.consignee }}</p>
<p class="consignee">
{{
isSell ? `回寄地址: ${userAddress.consignee}` : userAddress.consignee
}}
</p>
<p class="area">{{ userAddress.area }}</p>
<p class="mobile">{{ userAddress.mobile }}</p>
</div>
... ... @@ -15,7 +23,11 @@ const { mapGetters } = createNamespacedHelpers("order/orderDetail");
export default {
computed: {
...mapGetters(["userAddress"])
...mapGetters(["userAddress"]),
isSell() {
const { owner } = this.$route.params;
return owner === "sell";
}
}
};
</script>
... ... @@ -46,7 +58,10 @@ export default {
display: block;
background-size: contain;
margin-right: 40px;
background-image: url("~statics/image/order/addr-icon@3x.png");
}
.back-address-icon {
background-image: url("~statics/image/order/blackAddress@3x.png");
}
}
</style>
\ No newline at end of file
... ...
<template>
<div class="order-item-wrapper">
<div class="item-img">
<image-format
alt=""
:src="goodsInfo.goodImg"
:width="180"
:height="180"
/>
</div>
<div class="item-info">
<div>
<div class="price-status">
<span class="price">¥{{ goodsInfo.goodPrice }}</span>
<router-link :to="toLinkParam" class="detial-item-wrapper">
<div class="order-item-wrapper">
<div class="item-img">
<image-format
alt=""
:src="goodsInfo.goodImg"
:width="180"
:height="180"
/>
</div>
<div class="item-info">
<div>
<div class="price-status">
<span class="price">¥{{ goodsInfo.goodPrice }}</span>
</div>
<p class="item-name">
{{ goodsInfo.productName }}
</p>
</div>
<p class="item-name">
{{ goodsInfo.productName }}
<p class="item-spec">
<span>{{ goodsInfo.colorName }},</span>
<span>{{ goodsInfo.sizeName }}码</span>
</p>
</div>
<p class="item-spec">
<span>{{ goodsInfo.colorName }},</span>
<span>{{ goodsInfo.sizeName }}码</span>
</p>
</div>
</div>
</router-link>
</template>
<script>
... ... @@ -32,12 +34,23 @@ const { mapGetters } = createNamespacedHelpers("order/orderDetail");
export default {
computed: {
...mapGetters(["goodsInfo"])
...mapGetters(["goodsInfo"]),
toLinkParam() {
const { productId, storageId } = this.goodsInfo;
return {
name: "ProductDetail",
params: { productId }
};
}
}
};
</script>
<style lang="scss" scoped>
.detial-item-wrapper {
display: block;
}
.order-item-wrapper {
display: flex;
... ...
/* eslint-disable operator-linebreak */
/* eslint-disable space-before-function-paren */
import { createNamespacedHelpers } from 'vuex';
const { mapActions } = createNamespacedHelpers('order/orderList');
... ... @@ -28,10 +29,14 @@ export default {
owner,
});
const confirmBtnText = confirmInfo.needPenalty
? '赔付并取消订单'
: '不卖了';
this.$createConfirmDialog(
{
confirmBtn: {
text: '不卖了',
text: confirmBtnText,
style: { color: '#D0021B' },
},
cancelBtn: { text: '继续出售', active: true },
... ... @@ -84,19 +89,39 @@ export default {
},
async onBuyerOrderAction({ action, order }) {
const { owner = ownType.SELL } = this.$route.params;
const { orderCode, priceInfo = {} } = order;
const { orderCode, priceInfo = {}, bidDepositInfo = {} } = order;
switch (action.name) {
case orderActionsMap.DEL_ORDER.name: {
this.deleteOrderConfirmDialog({ orderCode, owner });
break;
}
case orderActionsMap.PAY_DEPOSIT.name: {
this.$createOrderPayType({
orderCode,
price: parseFloat(bidDepositInfo.depositAmount),
desc: '保证金',
extra: JSON.stringify({
forward: {
name: 'OrderList',
params: {
owner: 'buy',
},
},
}),
}).show();
break;
}
case orderActionsMap.CANCEL_ORDER.name: {
const confirmInfo = await this.cancelTradeConfirmInfo({
let confirmInfo = await this.cancelTradeConfirmInfo({
orderCode,
owner,
});
if (Array.isArray(confirmInfo)) {
confirmInfo = { confirmDesc: '确定取消求购' };
}
this.$createConfirmDialog(
{
confirmBtn: { text: '取消订单', style: { color: '#D0021B' } },
... ... @@ -147,6 +172,9 @@ export default {
case orderActionsMap.CONFIRM_DELIVERY.name: {
this.$createConfirmDialog({
content: '确认收货?',
confirmBtn: { style: { color: '#D0021B' } },
cancelBtn: { active: true },
onConfirm: async () => {
const isOk = await this.confirmReceipt({
orderCode,
... ... @@ -160,7 +188,7 @@ export default {
// const txt = isOk ? "收货成功" : "收货失败";
// this.$createToast({ txt, type: "txt" }).show();
},
});
}).show();
break;
}
default:
... ...
<template>
<layout-app title="订单详情">
<layout-app>
<div class="order-detail-wrapper">
<div class="content">
<!-- 状态信息 -->
... ... @@ -27,7 +27,9 @@
<!-- 价格信息 -->
<div class="price-info item-wrapper">
<p>
<span class="label">平台费用:</span>
<span class="label platform-fee"
>平台费用:<i @click="onPlatformFee" class="tip"></i
></span>
<span>{{ platformFee.amount }}</span>
</p>
<p class="delivery-fee">
... ... @@ -107,6 +109,7 @@ import DetailFooter from "./components//detail-footer";
import OrderActions from "../components/order-actions";
import orderActionMixin from "./mixins/order-action";
import PlatformFeeInfo from "../components/platform-fee-info";
const STORE_PATH = "order/orderDetail";
... ... @@ -151,7 +154,35 @@ export default {
])
},
methods: {
...mapActions(["fetchOrderDetail"])
...mapActions(["fetchOrderDetail"]),
onPlatformFee() {
const { platformFee = {} } = this.orderDetail;
this.$createDialog(
{
type: "alert",
title: "平台费用",
confirmBtn: { text: "我知道了" }
},
createElement => {
return [
createElement(PlatformFeeInfo, {
props: {
platformFeeInfo: {
packageFee: platformFee.packageFee,
packageFeeDesc: "商品包装费",
payChannelPercentage: platformFee.payChannelPercentage,
serviceFee: platformFee.serviceFee,
serviceFeeDesc: "平台服务费",
appraiseFee: platformFee.appraiseFee,
appraiseFeeDesc: "商品鉴定费"
}
},
slot: "content"
})
];
}
).show();
}
}
};
</script>
... ... @@ -232,6 +263,21 @@ export default {
.price-info {
font-size: 28px;
.platform-fee {
line-height: 1;
display: flex;
align-items: center;
}
.tip {
width: 60px;
height: 30px;
display: inline-block;
background: url("~statics/image/order/tip@3x.png") no-repeat;
background-size: contain;
background-position: center;
}
& > p {
display: flex;
justify-content: space-between;
... ...
... ... @@ -4,9 +4,7 @@
<ul class="list-wrapper">
<li
:class="
currentStatus === statusInfo.value
? 'list-item active'
: 'list-item'
status === statusInfo.value ? 'list-item active' : 'list-item'
"
v-for="(statusInfo, i) in statusList"
:key="i"
... ... @@ -39,12 +37,15 @@ export default {
Scroll
},
computed: {
...mapState(["currentStatus"]),
...mapState(["currentStatus", "routeParamStatus"]),
statusList: function() {
const { owner } = this.$route.params;
return owner === ownType.BUY
? buyerOrderStatusList
: sellerOrderStatusList;
},
status() {
return this.currentStatus || this.routeParamStatus;
}
},
methods: {
... ...
/* eslint-disable operator-linebreak */
/* eslint-disable space-before-function-paren */
import { orderActionsMap, ownType } from 'constants/order-constants';
import { createNamespacedHelpers } from 'vuex';
... ... @@ -17,7 +18,7 @@ export default {
// 订单列表
async onAction({ action, order }) {
const { owner = ownType.SELL } = this.$route.params;
const { orderCode, realPrice = '' } = order;
const { orderCode, realPrice = '', bidDepositInfo = {} } = order;
switch (action.name) {
case orderActionsMap.DEL_ORDER.name:
... ... @@ -42,11 +43,14 @@ export default {
break;
case orderActionsMap.CANCEL_ORDER.name: {
const confirmInfo = await this.cancelTradeConfirmInfo({
let confirmInfo = await this.cancelTradeConfirmInfo({
orderCode,
owner,
});
if (Array.isArray(confirmInfo)) {
confirmInfo = { confirmDesc: '确定取消求购' };
}
this.$createConfirmDialog(
{
confirmBtn: { text: '取消订单', style: { color: '#D0021B' } },
... ... @@ -95,8 +99,28 @@ export default {
break;
}
case orderActionsMap.PAY_DEPOSIT.name: {
this.$createOrderPayType({
orderCode,
price: parseFloat(bidDepositInfo.depositAmount),
desc: '保证金',
extra: JSON.stringify({
forward: {
name: 'OrderList',
params: {
owner: 'buy',
},
},
}),
}).show();
break;
}
case orderActionsMap.CONFIRM_DELIVERY.name: {
this.$createConfirmDialog({
content: '确认收货?',
confirmBtn: { style: { color: '#D0021B' } },
cancelBtn: { active: true },
onConfirm: async () => {
const isOk = await this.confirmReceipt({
orderCode,
... ... @@ -111,7 +135,52 @@ export default {
// const txt = isOk ? "收货成功" : "收货失败";
// this.$createToast({ txt, type: "txt" }).show();
},
}).show();
break;
}
case orderActionsMap.CHANGE_BID_PRICE.name: {
this.$createDialog({ type: 'prompt' }).show();
break;
}
case orderActionsMap.NOT_SOLD.name: {
const confirmInfo = await this.cancelTradeConfirmInfo({
orderCode,
owner,
});
const confirmBtnText = confirmInfo.needPenalty
? '赔付并取消订单'
: '不卖了';
this.$createConfirmDialog(
{
confirmBtn: { text: confirmBtnText, style: { color: '#D0021B' } },
cancelBtn: { text: '继续出售', active: true },
onConfirm: async () => {
const isOk = await this.cancelTrade({
orderCode,
owner,
});
if (isOk) {
this.resetData();
this.fetchData(this.$route.params);
}
// const txt = isOk ? "取消成功" : "取消失败";
// this.$createToast({ txt, type: "txt" }).show();
},
},
createElement => {
return [
createElement(DialogConfirmInfo, {
props: { info: confirmInfo },
slot: 'content',
}),
];
},
).show();
break;
}
default:
... ... @@ -131,9 +200,13 @@ export default {
owner,
});
const confirmBtnText = confirmInfo.needPenalty
? '赔付并取消订单'
: '不卖了';
this.$createConfirmDialog(
{
confirmBtn: { text: '不卖了', style: { color: '#D0021B' } },
confirmBtn: { text: confirmBtnText, style: { color: '#D0021B' } },
cancelBtn: { text: '继续出售', active: true },
onConfirm: async () => {
const isOk = await this.cancelTrade({
... ...
... ... @@ -77,18 +77,18 @@ export default {
// 获取订单数据
asyncData({ store, router }) {
const { status } = router.params;
store.commit(`${STORE_PATH}/resetData`);
store.commit(`${STORE_PATH}/setOrderStatus`, router.params.status);
store.commit(`${STORE_PATH}/setRouteParamStatus`, status);
return store.dispatch(`${STORE_PATH}/fetchOrderList`, router.params);
},
methods: {
...mapActions(["fetchOrderList"]),
...mapActions(["fetchOrderList", "confirmReceipt"]),
fetchData() {
this.fetchOrderList(this.$route.params);
}
},
watch: {}
}
};
</script>
<style lang="scss" scoped>
... ...
... ... @@ -38,9 +38,12 @@
<template #content="{detail: {miniFaultConfirm} }">
<div class="judge-content-wrapper" v-if="miniFaultConfirm">
<p class="tip">
{{ miniFaultConfirm.text }},
<span>
请在<count-down
<span
:class="miniFaultConfirm.showBtn ? '' : 'tipTextGray'"
>{{ miniFaultConfirm.text }}</span
>
<span v-if="miniFaultConfirm.showBtn">
,请在<count-down
:leftTime="miniFaultConfirm.leftTime"
:isShowIcon="false"
class="judge-count-down"
... ... @@ -78,14 +81,14 @@
</template>
<script>
import { createNamespacedHelpers } from 'vuex';
import TimeLine from './components/time-line';
import { expressTypeEnum } from 'constants/logistics-constants';
import CountDown from './components/count-down';
import { Button } from 'cube-ui';
import Clipboard from 'clipboard';
import { createNamespacedHelpers } from "vuex";
import TimeLine from "./components/time-line";
import { expressTypeEnum } from "constants/logistics-constants";
import CountDown from "./components/count-down";
import { Button } from "cube-ui";
import Clipboard from "clipboard";
const STORE_PATH = 'order/logisticsInfo';
const STORE_PATH = "order/logisticsInfo";
const { mapActions, mapState } = createNamespacedHelpers(STORE_PATH);
... ... @@ -95,32 +98,30 @@ export default {
CountDown,
Button
},
data() {
return {
stageImgUrl: ""
};
},
computed: {
...mapState(['logisticInfo']),
...mapState(["logisticInfo"]),
platformName() {
const { expressType: type } = this.logisticInfo;
return expressTypeEnum[type];
},
stageImgUrl() {
const { stage } = this.logisticInfo;
return stage ?
require(`../../statics/image/order/logistics_progress_${stage}@3x.png`) :
'';
},
detailList() {
const {
// 物流信息
expressInfoDetailTitle = '',
expressInfoDetailTitle = "",
expressInfoDetailList = [],
// 鉴定信息
judgeExpressInfoDetailTitle = '',
judgeExpressInfoDetailTitle = "",
judgeExpressInfoDetailList = [],
// 卖家物流信息
supplementExpressInfoDetailTitle = '',
supplementExpressInfoDetailTitle = "",
supplementExpressInfoDetailList = []
} = this.logisticInfo;
... ... @@ -142,34 +143,29 @@ export default {
return store.dispatch(`${STORE_PATH}/fetchLogisticInfo`, router.params);
},
methods: {
...mapActions([
'fetchLogisticInfo',
'flawReject',
'flawAccept'
]),
...mapActions(["fetchLogisticInfo", "flawReject", "flawAccept"]),
flawAcceptDialog() {
this.$createDialog({
type: 'confirm',
title: '',
content: '您确定接受瑕疵吗?',
type: "confirm",
title: "",
content: "您确定接受瑕疵吗?",
confirmBtn: {
text: '接受',
text: "接受",
active: true,
disabled: false,
href: 'javascript:;',
href: "javascript:;"
},
cancelBtn: {
text: '我再想想',
text: "我再想想",
active: false,
disabled: false,
href: 'javascript:;'
href: "javascript:;"
},
onConfirm: () => {
const params = this.$route.params
const {code} = params;
const params = this.$route.params;
const { code } = params;
const that = this;
this.flawAccept({
... ... @@ -179,35 +175,32 @@ export default {
});
},
onCancel: () => {
}
onCancel: () => {}
}).show();
},
flawRejectDialog() {
this.$createDialog({
type: 'confirm',
title: '',
content: '您确定不接受瑕疵吗?',
type: "confirm",
title: "",
content: "您确定不接受瑕疵吗?",
confirmBtn: {
text: '拒绝',
text: "拒绝",
active: true,
disabled: false,
href: 'javascript:;',
href: "javascript:;"
},
cancelBtn: {
text: '我再想想',
text: "我再想想",
active: false,
disabled: false,
href: 'javascript:;'
href: "javascript:;"
},
onConfirm: () => {
const params = this.$route.params
const {code} = params;
const that=this
const params = this.$route.params;
const { code } = params;
const that = this;
this.flawReject({
orderCode: code
... ... @@ -216,25 +209,28 @@ export default {
});
},
onCancel: () => {
}
onCancel: () => {}
}).show();
}
},
activated() {
this.copyBtn = new Clipboard(this.$refs.copy, {
text: () => {
return this.logisticInfo.wayBillCode;
}
});
this.copyBtn.on('success', () => {
this.$createToast({
txt: '复制成功',
type: 'txt'
}).show();
this.$nextTick(() => {
const { stage } = this.logisticInfo;
this.stageImgUrl = require(`../../statics/image/order/logistics_progress_${stage}@3x.png`);
});
if (this.$refs.copy) {
this.copyBtn = new Clipboard(this.$refs.copy, {
text: () => {
return this.logisticInfo.wayBillCode;
}
});
this.copyBtn.on("success", () => {
this.$createToast({
txt: "复制成功",
type: "txt"
}).show();
});
}
}
};
</script>
... ... @@ -279,6 +275,10 @@ export default {
margin-bottom: 10px;
}
.tipTextGray {
color: #999;
}
.judge-count-down {
color: #d0021b;
font-size: 12px;
... ...
... ... @@ -15,7 +15,7 @@
<AddressInfo :data="addressInfo" class="order-item"></AddressInfo>
</div>
<div class="footer">
<OrderAgree :value="isAgreeTerms" @input="isAgreeTerms = !isAgreeTerms" class="agree-wrapper"></OrderAgree>
<OrderAgree :value="isAgreeTerms" @input="isAgreeTerms = !isAgreeTerms" class="agree-wrapper" :desc="agreeDesc" :url="url"></OrderAgree>
<div>
<Button :disabled="!isAgreeTerms" type="submit" @click="submitClick">提交</Button>
</div>
... ... @@ -59,6 +59,8 @@ export default {
data() {
return {
isAgreeTerms: false,
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=卖家协议\"}}`,
};
},
... ...
... ... @@ -4,7 +4,8 @@
:hasBorderRadius="false"
:emulateMask="true">
<div class="buy-sheet">
<div class="header">求购<i class="cubeic-question"></i></div>
<!-- 临时链接示例 -->
<a class="header" href="http://m.yohobuy.com">求购<i class="cubeic-question"></i></a>
<div class="title">
<div class="title-thumbnail">
<square-img :src="imageUrl" :width="300" :height="300"/>
... ... @@ -72,6 +73,7 @@ export default {
storage_id: info.storage_id,
available: info.storage_num > 0 && price !== '-',
skup: info.skup,
least_price: info.least_price,
};
});
},
... ... @@ -109,7 +111,7 @@ export default {
* storageId: number
*/
this.$store.commit('order/buyerAskOrder/BUYER_ASK_SET_PRODUCTINFO', {
least_price: this.productDetail.least_price,
least_price: get(product, 'least_price', '-'),
sizeName: product.name,
sizeId: get(data, 'sizeId', ''),
colorName: get(this.productDetail, 'goods_list[0].color_name', ''),
... ...
<template>
<div class="layout">
<LayoutHeader class="layout-header" :show-back="true" :key="productId">
<LayoutHeader class="layout-header" :show-back="true" :title="title" ref="header">
<transition name="fade">
<img-size v-show="headThumbnailVisible" class="title-thumbnail" :src="imageList && imageList[0] && imageList[0].image_url" :width="300" :height="300"/>
</transition>
... ... @@ -180,9 +180,21 @@ export default {
sizeList() {
return get(this.productDetail, 'goods_list[0].size_list', null);
},
title() {
return get(this.productDetail, 'product_name', '商品详情');
},
},
watch: {
title: {
handler() {
this.setTitle();
},
immediate: true,
},
},
mounted() {
this.imageHideThreadhold = -window.innerWidth * 0.693;
},
activated() {
if (this.productId !== this.productDetail.product_id) {
... ... @@ -191,6 +203,15 @@ export default {
},
methods: {
...mapActions(['fetchProductInfo', 'fetchTop3', 'fetchFav', 'toggleFav', 'updateTradeInfo', 'getSelectedTradeProduct', 'payment']),
setTitle() {
if (this.productId === this.productDetail.product_id) {
if (this.$refs.header && this.$refs.header.setTitle) {
this.$refs.header.setTitle(this.title);
} else if (document) {
document.title = this.title;
}
}
},
refresh() {
this.$refs.slide.refresh();
this.headThumbnailVisible = false;
... ... @@ -223,10 +244,32 @@ export default {
loading && loading.hide();
});
},
/**
* 登录|认证
* needCert: 需要实名认证
*/
async auth(needCert = false) {
if (needCert) {
const authInfo = await this.$yoho.authRealName();
if (authInfo && authInfo.code === 403) { // 此时已经异步登录,当前页面取消业务处理
return;
}
return authInfo;
}
return this.$yoho.auth();
},
async _toggleFav(isFav) {
await this.$yoho.auth();
const userInfo = await this.auth();
if (!userInfo) {
return;
}
this.toggleFav({ productId: this.productId, isFav }).then(() => {
this.toggleFav({productId: this.productId, isFav}).then(() => {
const txt = isFav ? '收藏成功' : '取消收藏成功';
this.$createToast({
... ... @@ -271,7 +314,11 @@ export default {
this.showSizeSelectSheet = false;
},
async buy() {
await this.$yoho.auth();
const userInfo = await this.auth();
if (!userInfo) {
return;
}
this.selectSizeConfig = {
dest: 'OrderBuyConfirm',
... ... @@ -284,7 +331,13 @@ export default {
this.showBuySheet = false;
},
async sell() {
await this.$yoho.auth();
// 出售需要实名认证
const userInfo = await this.auth(true);
if (!userInfo) {
return;
}
this.selectSizeConfig = {
dest: 'OrderSellConfirm',
type: 'sell',
... ...
... ... @@ -232,7 +232,7 @@ export default function() {
case 'buy':
state.buyNum = item.sum;
break;
case 'bid':
case 'biding':
state.askBuyNum = item.sum;
break;
default:
... ...
... ... @@ -24,7 +24,7 @@ export default function() {
},
mutations: {
[Types.FETCH_NEWS_LIST](state, { list }) {
state.newsList.list = state.newsList.list.concat(list.list);
state.newsList.list = list.page > 1 ? state.newsList.list.concat(list.list) : list.list;
state.newsList.page = list.page;
state.newsList.totalPage = list.totalPage;
list.page < list.totalPage ? state.newsList.isMoreData = true : state.newsList.isMoreData = false;
... ... @@ -45,23 +45,23 @@ export default function() {
async fetchNewsList({ commit, state }, obj) {
let page = state.newsList.page + 1;
let limit = state.newsList.limit;
let totalPage = state.newsList.totalPage;
let type = obj && obj.type;
let isPage = obj && obj.isPage;
// 页面跳转重置page页码
isPage ? page = 1 : state.newsList.page + 1;
const result = await this.$api.post('/api/ufo/home/newsList', {
page, type: type || '', limit, uid: 500031928
page, type: type || '', limit
});
if (result.code === 200) {
result.data.list && result.data.list.map((res) => {
res.createTime = moment(new Date(res.createTime * 1000)).format('YYYY.MM.DD HH:mm');
});
commit(Types.FETCH_NEWS_LIST, {list: result.data});
if (obj.type == 1 || obj.type == 2 || obj.type == 3) {
if (type) {
commit(Types.FETCH_NEWSDETAIL_LIST, {list: result.data});
} else {
commit(Types.FETCH_NEWS_LIST, {list: result.data});
}
}
},
... ...
... ... @@ -33,6 +33,7 @@ const {
BUYER_ASK_SET_SHOWDIALOG,
BUYER_ASK_SET_STORAGEID,
BUYER_ASK_SET_PRODUCTINFO,
BUYER_ASK_RESET_DATA,
} = Types;
const TIP = '请求失败';
... ... @@ -42,15 +43,15 @@ const DEFAULT_COMPUTE_INFO = {
promotionFormulaList: [
{
promotion: '商品金额',
promotionAmount: -'
promotionAmount: 0'
},
{
promotion: '运费',
promotionAmount: -'
promotionAmount: 0'
},
{
promotion: '实付金额',
promotionAmount: -'
promotionAmount: 0'
}
]
};
... ... @@ -129,7 +130,10 @@ export default function() {
let orginallist = get(state, ['configTip', 'timeLimit', 'items'], []);
return orginallist.map(item => {
return get(item, ['desc'], '');
return {
text: get(item, ['desc'], ''),
value: get(item, ['desc'], ''),
};
});
},
... ... @@ -152,6 +156,11 @@ export default function() {
mutations: {
[BUYER_ASK_RESET_DATA](state, payload) {
state.computeInfo = DEFAULT_COMPUTE_INFO;
state.configTip = DEFUALT_CONFIG_TIP;
},
[BUYER_ASK_SET_PRODUCTINFO](state, payload) {
state.originProductData = payload
},
... ...
... ... @@ -7,7 +7,8 @@ const initailData = () => ({
pullUpLoad: true,
// 当前查询订单状态
currentStatus: 1,
currentStatus: null,
routeParamStatus: null,
isShowEmpty: false,
});
... ... @@ -37,9 +38,10 @@ export default function() {
state.isShowEmpty = state.orderList.length === 0;
},
setOrderStatus(state, currentStatus) {
if (currentStatus) {
state.currentStatus = +currentStatus;
}
state.currentStatus = +currentStatus;
},
setRouteParamStatus(state, status = 1) {
state.routeParamStatus = +status;
},
resetPartialData(state) {
state.page = 1;
... ... @@ -48,7 +50,6 @@ export default function() {
state.pullUpLoad = true;
},
resetData(state) {
console.log('------------------', state);
const s = initailData();
Object.keys(s).forEach(key => {
... ... @@ -71,14 +72,14 @@ export default function() {
async fetchOrderList(
{
commit,
state: { page, currentStatus },
state: { page, currentStatus, routeParamStatus },
},
param = {},
) {
const { owner, status } = param;
const { owner } = param;
const res = await this.$api.get('/api/order/list', {
tabType: owner,
type: status || currentStatus,
type: currentStatus || routeParamStatus,
page,
});
... ...
... ... @@ -28,6 +28,7 @@ export const Types = {
BUYER_ASK_SET_SHOWDIALOG: 'BUYER_ASK_SET_SHOWDIALOG',
BUYER_ASK_SET_STORAGEID: 'BUYER_ASK_SET_STORAGEID',
BUYER_ASK_SET_PRODUCTINFO: 'BUYER_ASK_SET_PRODUCTINFO',
BUYER_ASK_RESET_DATA: 'BUYER_ASK_RESET_DATA',
SELLER_ORDERCOUNT_REQUEST: 'SELLER_ORDERCOUNT_REQUEST',
SELLER_ORDERCOUNT_SUCCESS: 'SELLER_ORDERCOUNT_SUCCESS',
... ...
... ... @@ -55,6 +55,9 @@ export function formatNumber(number) {
}
export function maskAccount(string) {
if (!string) {
return '';
}
if (/^1[3|4|5|7|8][0-9]{9}$/.test(string)) {
return string.substring(0, 3) + '****' + string.substring(7);
} else if (/^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(string.toLowerCase())) {
... ...
... ... @@ -98,9 +98,9 @@ module.exports = {
ufo: true,
api: 'ufo.users.listInboxs',
params: {
uid: {type: Number}
// uid: {type: Number}
},
// auth: true,
auth: true,
},
'/api/ufo/home/newsListTab': {
ufo: true,
... ...
{
"name": "xianyu-ufo-app-web",
"version": "0.0.2-beta-10",
"version": "0.0.2-beta-15",
"private": true,
"description": "Xianyu Project With Express",
"repository": {
... ...