Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
xianyu-ufo-app-web
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
邱骏
5 years ago
Commit
5ca8fd613f86cb6afaf4642d5625c79e039616c0
2 parents
eb1fe5f7
946e5821
Merge branch 'develop' of
http://git.yoho.cn/fe/xianyu-ufo-app-web
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
223 additions
and
97 deletions
apps/common/xianyu.js
apps/components/order-pay-type/pay-type.vue
apps/pages/home/news/news.vue
apps/pages/home/news/newsDetail.vue
apps/pages/order/buyer-confirm.vue
apps/pages/order/components/confirm/product.vue
apps/pages/order/components/dialog-change-bid-price.vue
apps/pages/order/order-detail/seller-order-detail.vue
apps/pages/order/pay.vue
apps/pages/order/price-change/entry-detail.vue
apps/pages/order/seller-confirm.vue
apps/pages/product/product-detail.vue
apps/store/order/order-confirm.js
apps/store/order/price-change/actions.js
package.json
apps/common/xianyu.js
View file @
5ca8fd6
...
...
@@ -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
;
...
...
apps/components/order-pay-type/pay-type.vue
View file @
5ca8fd6
...
...
@@ -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
}
});
}
}
}
};
...
...
apps/pages/home/news/news.vue
View file @
5ca8fd6
...
...
@@ -30,17 +30,17 @@ export default {
data() {
return {
msg: '消息',
options: {
pullUpLoad: true,
// pullUpLoad: {
// threshold: 100,
// txt: {
// txt: '加载中...',
// noMore: '~ 已经到底啦 ~',
// visible: false,
// }
// }
},
// options: {
// pullUpLoad: true,
// // pullUpLoad: {
// // threshold: 100,
// // txt: {
// // txt: '加载中...',
// // noMore: '~ 已经到底啦 ~',
// // visible: false,
// // }
// // }
// },
newsList: {
list: [],
tabList: [],
...
...
@@ -63,6 +63,13 @@ export default {
mounted() {
},
computed: {
options: function() {
return {
pullUpLoad: this.newsList.list.length > 0 ? true : false,
}
}
},
created() {
},
...
...
apps/pages/home/news/newsDetail.vue
View file @
5ca8fd6
...
...
@@ -27,16 +27,6 @@ const { mapState, mapActions } = createNamespacedHelpers('home/news');
export default {
data() {
return {
options: {
pullUpLoad: true,
// pullUpLoad: {
// threshold: 100,
// txt: {
// more: '加载中...',
// noMore: '~ 已经到底啦 ~'
// }
// }
},
title: '',
type: '',
newsList: {
...
...
@@ -55,7 +45,20 @@ export default {
}
},
computed: {
options: function() {
return {
pullUpLoad: this.newsList.list.length > 0 ? true : false,
}
}
// options: {
// // pullUpLoad: {
// // threshold: 100,
// // txt: {
// // more: '加载中...',
// // noMore: '~ 已经到底啦 ~'
// // }
// // }
// },
},
activated() {
this.fetchList(this.params);
...
...
apps/pages/order/buyer-confirm.vue
View file @
5ca8fd6
<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
}
});
}
}
};
...
...
apps/pages/order/components/confirm/product.vue
View file @
5ca8fd6
...
...
@@ -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>
...
...
apps/pages/order/components/dialog-change-bid-price.vue
View file @
5ca8fd6
...
...
@@ -132,7 +132,7 @@ export default {
<style lang="scss" scoped>
.change-bid-price-wrapper {
font-size: 12px;
font-size: 12
*2
px;
color: #000;
padding: 0 38px;
letter-spacing: 0;
...
...
@@ -165,4 +165,4 @@ export default {
margin-top: 40px;
}
}
</style>
\ No newline at end of file
</style>
...
...
apps/pages/order/order-detail/seller-order-detail.vue
View file @
5ca8fd6
...
...
@@ -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>
...
...
apps/pages/order/pay.vue
View file @
5ca8fd6
...
...
@@ -71,7 +71,8 @@ export default {
}, 1000);
if (this.count % 5 === 0) {
this.check().catch(() => {});
this.check().catch(() => {
});
}
} else {
this.goOk();
...
...
@@ -81,7 +82,7 @@ export default {
return this.fetchOrderStatus({
orderCode: this.orderCode
}).then((result) => {
if (
result?.data?.statusDetail?.status === 1
) {
if (
[1, 7].includes(result?.data?.statusDetail?.status)
) {
this.$router.replace(this.page?.forward);
} else {
return Promise.reject(result);
...
...
apps/pages/order/price-change/entry-detail.vue
View file @
5ca8fd6
...
...
@@ -130,7 +130,12 @@ export default {
pageSize: this.pageSize,
refresh: true
});
// 全部下架后回到出售中列表
let data = get(result, 'data.data')
if(data.length === 0) {
this.$router.back()
}
if (isNoSale && !get(result, 'data.productInfo')) {
this.$yoho.finishPage({});
}
...
...
apps/pages/order/seller-confirm.vue
View file @
5ca8fd6
<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>
...
...
apps/pages/product/product-detail.vue
View file @
5ca8fd6
...
...
@@ -286,13 +286,7 @@ export default {
onSizeSelectSheetHidden() {
this.showSizeSelectSheet = false;
},
async buy() {
const userInfo = await this.auth();
if (!userInfo) {
return;
}
buy() {
this.resetSelectedSize();
this.selectSizeConfig = {
dest: 'OrderBuyConfirm',
...
...
apps/store/order/order-confirm.js
View file @
5ca8fd6
...
...
@@ -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
;
...
...
apps/store/order/price-change/actions.js
View file @
5ca8fd6
...
...
@@ -50,6 +50,7 @@ export default {
}
else
{
commit
(
Types
.
FETCH_ORDER_PRODUCT_FAILED
);
}
return
result
;
},
/**
...
...
package.json
View file @
5ca8fd6
{
"name"
:
"xianyu-ufo-app-web"
,
"version"
:
"0.0.2-beta-2
6
"
,
"version"
:
"0.0.2-beta-2
7
"
,
"private"
:
true
,
"description"
:
"Xianyu Project With Express"
,
"repository"
:
{
...
...
Please
register
or
login
to post a comment