Authored by TaoHuang

fix by TaoHuang

... ... @@ -59,6 +59,22 @@ const xianyu = {
}
},
/**
*
* @param args payURL
* @param okAction
* @param errorAction
*/
setXianyuPay(args, okAction, errorAction) {
if (this.isAliApp && window.WindVane) {
window.WindVane.call('WVIdleFishApi', 'payAlipay', args, (data) => {
okAction && okAction(data);
}, (error) => {
errorAction && errorAction(error);
});
}
},
goXianyuNewPage(args) {
if (!args.url) {
return;
... ... @@ -130,7 +146,7 @@ const xianyu = {
window.open(args.url, '_blank');
}
}
},
}
};
export default xianyu;
... ...
... ... @@ -127,14 +127,30 @@ export default {
this.hide();
this.$emit('paySuccess');
this.$router.replace({
name: 'OrderPay',
query: {
orderCode: this.orderCode,
payParams: result.data.payParams,
extra: this.extra
}
});
if (this.$xianyu.isAliApp) {
const page = JSON.parse(this.extra || '{}');
this.$xianyu.setXianyuPay({
payURL: result.data.payParams
}, () => {
if (page.forward) {
this.$router.replace(page.forward);
}
}, () => {
if (page.back) {
this.$router.replace(page.back);
}
});
} else {
this.$router.replace({
name: 'OrderPay',
query: {
orderCode: this.orderCode,
payParams: result.data.payParams,
extra: this.extra
}
});
}
}
}
};
... ...
<template>
<LayoutApp :show-back="true" title="确认订单">
<LayoutApp :show-back="true" title="确认订单" :back-action="backAction">
<div class="body">
<AddressInfo :data="address" class="order-item" :show-tip="false"></AddressInfo>
<ProductInfo :data="productDetail" class="product-info order-item"></ProductInfo>
... ... @@ -40,7 +40,9 @@ export default {
name: 'OrderConfirm',
props: ['productId', 'storageId'],
data() {
return {};
return {
leave: false
};
},
components: {
ProductInfo,
... ... @@ -80,6 +82,7 @@ export default {
},
beforeRouteLeave(to, from, next) {
if (to.name !== 'address') {
this.leave = true;
this[Types.CLEAR_BUY_STATUS]();
}
next();
... ... @@ -108,7 +111,9 @@ export default {
watch: {
address: {
handler() {
this.compute();
if (!this.leave) {
this.compute();
}
},
deep: true
}
... ... @@ -256,6 +261,14 @@ export default {
code: orderCode
}
});
},
backAction() {
this.$router.replace({
name: 'ProductDetail',
params: {
productId: this.productId
}
});
}
}
};
... ...
... ... @@ -5,7 +5,7 @@
<div class="product-price">
<div class="product-price-wrapper">
<div class="price">{{data.colorName}},{{data.sizeName}}</div>
<div class="tip">{{ priceType || '最低售价:'}} <span class="price2">¥{{data.goodPrice || '-'}}</span></div>
<div class="tip">{{ data.priceType || '最低售价:'}} <span class="price2">{{data.goodPrice || '-'}}</span></div>
</div>
</div>
</div>
... ...
... ... @@ -3,7 +3,7 @@
<div class="order-detail-wrapper">
<div class="content">
<!-- 状态信息 -->
<detail-header />
<detail-header/>
<!-- 物流信息 -->
<router-link
v-if="lastExpressInfo"
... ... @@ -21,21 +21,21 @@
</div>
</router-link>
<!-- 地址信息 -->
<address-info class="item-wrapper" />
<address-info class="item-wrapper"/>
<!-- 商品信息 -->
<order-item-info class="item-wrapper" />
<order-item-info class="item-wrapper"/>
<!-- 价格信息 -->
<div class="price-info item-wrapper">
<p>
<span class="label platform-fee"
>平台费用:<i @click="onPlatformFee" class="tip"></i
>平台费用:<i @click="onPlatformFee" class="tip"></i
></span>
<span>{{ platformFee.amount }}</span>
</p>
<p class="delivery-fee">
<span class="label"
>银行转账费({{
parseInt(platformFee.goodsPaymentRatePercent || 0)
>银行转账费({{
parseInt(platformFee.payChannelPercentage || 0)
}}%):</span
>
<span>{{ orderDetail.bankTransferFee }}</span>
... ... @@ -94,23 +94,23 @@
</template>
<script>
import { createNamespacedHelpers } from "vuex";
import { Button } from "cube-ui";
import Clipboard from "clipboard";
import { createNamespacedHelpers } from 'vuex';
import { Button } from 'cube-ui';
import Clipboard from 'clipboard';
import AddressInfo from "./components/sell-order-address-info";
import OrderItemInfo from "./components/order-detail-item";
import DetailHeader from "./components/header";
import DetailFooter from "./components//detail-footer";
import AddressInfo from './components/sell-order-address-info';
import OrderItemInfo from './components/order-detail-item';
import DetailHeader from './components/header';
import DetailFooter from './components//detail-footer';
import OrderActions from "../components/order-actions";
import OrderActions from '../components/order-actions';
import orderActionMixin from "../mixin/order-action";
import orderInSaleActionMixin from "../mixin/order-in-sale-action";
import orderActionMixin from '../mixin/order-action';
import orderInSaleActionMixin from '../mixin/order-in-sale-action';
import PlatformFeeInfo from "../components/platform-fee-info";
import PlatformFeeInfo from '../components/platform-fee-info';
const STORE_PATH = "order/orderDetail";
const STORE_PATH = 'order/orderDetail';
const { mapActions, mapState, mapGetters } = createNamespacedHelpers(
STORE_PATH
... ... @@ -136,33 +136,33 @@ export default {
return this.orderDetail.orderCode;
}
});
this.copyBtn.on("success", () => {
this.copyBtn.on('success', () => {
this.$createToast({
txt: "复制成功",
type: "txt"
txt: '复制成功',
type: 'txt'
}).show();
});
});
},
computed: {
...mapState(["orderDetail"]),
...mapState(['orderDetail']),
...mapGetters([
"lastExpressInfo",
"priceInfo",
"statusDetail",
"platformFee",
"actionList"
'lastExpressInfo',
'priceInfo',
'statusDetail',
'platformFee',
'actionList'
])
},
methods: {
...mapActions(["fetchOrderDetail"]),
...mapActions(['fetchOrderDetail']),
onPlatformFee() {
const { platformFee = {} } = this.orderDetail;
this.$createDialog(
{
type: "alert",
title: "平台费用",
confirmBtn: { text: "我知道了" }
type: 'alert',
title: '平台费用',
confirmBtn: { text: '我知道了' }
},
createElement => {
return [
... ... @@ -170,15 +170,15 @@ export default {
props: {
platformFeeInfo: {
packageFee: platformFee.packageFee,
packageFeeDesc: "商品包装费",
payChannelPercentage: platformFee.payChannelPercentage,
packageFeeDesc: '商品包装费',
payChannelPercentage: platformFee.goodsPaymentRatePercent,
serviceFee: platformFee.serviceFee,
serviceFeeDesc: "平台服务费",
serviceFeeDesc: '平台服务费',
appraiseFee: platformFee.appraiseFee,
appraiseFeeDesc: "商品鉴定费"
appraiseFeeDesc: '商品鉴定费'
}
},
slot: "content"
slot: 'content'
})
];
}
... ... @@ -334,4 +334,4 @@ export default {
margin-right: 12px;
}
}
</style>
\ No newline at end of file
</style>
... ...
<template>
<LayoutApp :show-back="true" title="出售">
<LayoutApp :show-back="true" title="出售" :back-action="backAction">
<div class="body">
<ProductInfo :data="productDetail" class="product-info"></ProductInfo>
<InputPrice @input="changePrice" class="input-price"
... ... @@ -55,7 +55,7 @@ export default {
error: false,
agreeDesc: '有货卖家协议',
url: 'https://activity.yoho.cn/feature/3187.html?share_id=5851&title=ufo-%E5%8D%96%E5%AE%B6%E5%8D%8F%E8%AE%AE',
superSell: false
superSell: false,
};
},
mounted() {
... ... @@ -78,24 +78,39 @@ export default {
...mapOrderState(['address', 'fee', 'price', 'agree', 'num']),
...mapState({
productDetail: state => {
const leastPrice = get(state.product.selectedProductInfo, 'size.least_price', 0);
const storageNum = get(state.product.selectedProductInfo, 'size.storage_num', 0);
const suggestHighPrice = get(state.product.selectedProductInfo, 'size.suggest_high_price', 0);
const suggestLowPrice = get(state.product.selectedProductInfo, 'size.suggest_low_price', 0);
let priceType = '最低售价';
let goodPrice = '';
if (!storageNum) {
if (suggestHighPrice && suggestLowPrice) {
priceType = '建议价';
goodPrice = `¥${suggestLowPrice}-¥${suggestHighPrice}`;
} else {
goodPrice = '¥-';
}
} else {
goodPrice = `¥${leastPrice}`;
}
return {
goodImg: get(state.product.selectedProductInfo, 'product.goods_list[0].image_list[0].image_url', ''),
productName: get(state.product.selectedProductInfo, 'product.product_name', ''),
colorName: get(state.product.selectedProductInfo, 'product.goods_list[0].color_name', ''),
sizeName: get(state.product.selectedProductInfo, 'size.size_name', ''),
goodPrice: get(state.product.selectedProductInfo, 'size.least_price', ''),
goodPrice,
priceType,
isSuggest: suggestHighPrice && suggestLowPrice,
suggestHighPrice,
suggestLowPrice
};
}
})
},
watch: {
address: {
handler() {
this.compute();
},
deep: true
}
},
methods: {
...mapOrderAction(['fetchOrderAddress', 'fetchUserStatus', 'fetchOrderPrice', 'submitOrder', 'fetchPayList']),
...mapOrderMutations([Types.CHANGE_PRICE, Types.CHANGE_AGREE, Types.CLEAR_SELL_STATUS, Types.CHANGE_SELL_NUM]),
... ... @@ -140,7 +155,35 @@ export default {
changeAgree(val) {
this[Types.CHANGE_AGREE](val);
},
async submit() {
submit() {
if (this.productDetail.isSuggest) {
if (Number(this.price) > this.productDetail.suggestHighPrice) {
this.$createDialog({
type: 'confirm',
content: '超出建议售价将被限制展示,建议下调至合理价格区间',
confirmBtn: {
text: '修改价格',
active: true,
disabled: false,
},
cancelBtn: {
text: '仍要上架',
active: false,
disabled: false
},
onCancel: () => {
this.submitHandler();
}
}).show();
} else {
this.submitHandler();
}
} else {
this.submitHandler();
}
},
async submitHandler() {
const vm = this;
if (!this.checkAddress()) {
... ... @@ -174,6 +217,7 @@ export default {
this.$createToast({
time: 1500,
txt: orderResult.message,
mask: true,
type: 'txt'
}).show();
... ... @@ -223,12 +267,21 @@ export default {
},
onNumChange(count) {
this[Types.CHANGE_SELL_NUM](count);
this.compute();
},
delay(ns) {
return new Promise(resolve => {
setTimeout(resolve, ns);
});
},
backAction() {
this.$router.replace({
name: 'ProductDetail',
params: {
productId: this.productId
}
});
}
}
};
</script>
... ...
... ... @@ -81,12 +81,29 @@ export default function() {
state.agree = false;
state.price = '';
state.num = 1;
state.address = null;
state.fee = {
income: '',
bankTransferFee: '',
platformFee: {
amount: '',
appraiseFee: '',
goodsPaymentRatePercent: '',
packageFee: '',
payChannelPercentage: '',
serviceFee: ''
}
};
},
[Types.CHANGE_SELL_NUM](state, data) {
state.num = data;
},
[Types.CLEAR_BUY_STATUS](state) {
state.buyAgree = false;
state.orderDetail = {};
state.selectedCouponList = [];
state.selectedPromotion = null;
state.couponList = [];
},
[Types.UPDATE_ORDER](state, { amount, couponInfo, couponList, promotionFormulaList, promotionList, promotionTips }) {
state.orderDetail.amount = amount;
... ...