Authored by lea guo

Merge branch 'develop' of git.yoho.cn:fe/xianyu-ufo-app-web into develop

@@ -53,10 +53,12 @@ export default { @@ -53,10 +53,12 @@ export default {
53 default: '' 53 default: ''
54 }, 54 },
55 extra: { 55 extra: {
56 - type: Object,  
57 - default() {  
58 - return {};  
59 - } 56 + type: String,
  57 + default: '{}'
  58 + },
  59 + replace: {
  60 + type: Boolean,
  61 + default: false
60 } 62 }
61 }, 63 },
62 components: { 64 components: {
@@ -125,11 +127,12 @@ export default { @@ -125,11 +127,12 @@ export default {
125 this.hide(); 127 this.hide();
126 this.$emit('paySuccess'); 128 this.$emit('paySuccess');
127 129
128 - this.$router.push({ 130 + this.$router.replace({
129 name: 'OrderPay', 131 name: 'OrderPay',
130 query: { 132 query: {
131 orderCode: this.orderCode, 133 orderCode: this.orderCode,
132 - payParams: result.data.payParams 134 + payParams: result.data.payParams,
  135 + extra: this.extra
133 } 136 }
134 }); 137 });
135 } 138 }
@@ -3,11 +3,13 @@ const config = { @@ -3,11 +3,13 @@ const config = {
3 axiosBaseUrl: '/xianyu', 3 axiosBaseUrl: '/xianyu',
4 axiosResponseType: 'json', 4 axiosResponseType: 'json',
5 reportUrl: '//badjs.yoho.cn/apm/yas2.gif', 5 reportUrl: '//badjs.yoho.cn/apm/yas2.gif',
  6 + alipayUrl: 'https://openapi.alipaydev.com/gateway.do',
6 }, 7 },
7 production: { 8 production: {
8 axiosBaseUrl: '/xianyu', 9 axiosBaseUrl: '/xianyu',
9 axiosResponseType: 'json', 10 axiosResponseType: 'json',
10 reportUrl: '//badjs.yoho.cn/apm/yas2.gif', 11 reportUrl: '//badjs.yoho.cn/apm/yas2.gif',
  12 + alipayUrl: 'https://openapi.alipay.com/gateway.do'
11 }, 13 },
12 }; 14 };
13 15
@@ -19,6 +19,7 @@ export default [ @@ -19,6 +19,7 @@ export default [
19 props: route => ({ 19 props: route => ({
20 orderCode: route.query.orderCode, 20 orderCode: route.query.orderCode,
21 payParams: route.query.payParams, 21 payParams: route.query.payParams,
  22 + extra: route.query.extra
22 }), 23 }),
23 }, 24 },
24 { 25 {
1 <template> 1 <template>
2 -<div>  
3 -{{orderCode}} <====>  
4 - {{payParams}}  
5 -</div> 2 + <LayoutApp :show-back="true">
  3 + <div>{{count}} 秒</div>
  4 + <div>支付成功跳转成功页</div>
  5 + <div>支付失败返回上一层</div>
  6 + </LayoutApp>
6 </template> 7 </template>
7 8
8 <script> 9 <script>
9 10
10 -const ALIPAY_DOMAIN = 'https://openapi.alipay.com/gateway.do'; 11 +import config from 'config';
11 12
12 export default { 13 export default {
13 name: 'PayPage', 14 name: 'PayPage',
14 props: ['orderCode', 'payParams', 'extra'], 15 props: ['orderCode', 'payParams', 'extra'],
  16 + data() {
  17 + return {
  18 + count: 60
  19 + };
  20 + },
15 mounted() { 21 mounted() {
16 if (this.payParams) { 22 if (this.payParams) {
17 - const url = ALIPAY_DOMAIN + '?' + this.payParams; 23 + const url = config.alipayUrl + '?' + this.payParams;
18 24
19 window.location.href = url; 25 window.location.href = url;
20 } 26 }
  27 +
  28 + this.setCount();
21 }, 29 },
22 - methods: {} 30 + methods: {
  31 + setCount() {
  32 + if (this.count > 0) {
  33 + setTimeout(() => {
  34 + this.count = this.count - 1;
  35 + this.setCount();
  36 + }, 1000);
  37 + }
  38 + }
  39 + }
23 }; 40 };
24 </script> 41 </script>
25 42
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 @on-change-price="onChangePrice" 6 @on-change-price="onChangePrice"
7 @on-no-sale="onNoSale"></ProductItem> 7 @on-no-sale="onNoSale"></ProductItem>
8 </div> 8 </div>
9 - <UfoNoItem :tip="`暂无数据`" v-else></UfoNoItem> 9 + <UfoNoItem :tip="`暂无数据`" class="no-item-margin" v-else></UfoNoItem>
10 </template> 10 </template>
11 11
12 <script> 12 <script>
@@ -41,4 +41,8 @@ export default { @@ -41,4 +41,8 @@ export default {
41 overflow: hidden; 41 overflow: hidden;
42 } 42 }
43 43
  44 + .no-item-margin {
  45 + margin-top: 30%;
  46 + }
  47 +
44 </style> 48 </style>
@@ -50,30 +50,32 @@ @@ -50,30 +50,32 @@
50 </div> 50 </div>
51 <div class="submit-container"> 51 <div class="submit-container">
52 <div class="agree-container"> 52 <div class="agree-container">
53 - <div class="checkbox"> 53 + <!--<div class="checkbox">
54 <Checkbox :option="labelOption" shape="square" v-model="isAgree"></Checkbox> 54 <Checkbox :option="labelOption" shape="square" v-model="isAgree"></Checkbox>
55 </div> 55 </div>
56 - <a @click="showAgreement">卖家协议</a> 56 + <a @click="showAgreement">卖家协议</a>-->
  57 + <OrderCheck v-model="isAgree" :desc="`卖家协议`" :url="agreementURL"></OrderCheck>
57 </div> 58 </div>
58 59
59 <div :class="['submit-button', (isAgree && calced) ? 'active' : '']"> 60 <div :class="['submit-button', (isAgree && calced) ? 'active' : '']">
60 <button @click="changePrice">提交</button> 61 <button @click="changePrice">提交</button>
61 </div> 62 </div>
62 </div> 63 </div>
  64 + <!--平台费用问号点击弹框-->
63 <Modal v-model="platformFeeModalVisible" :transfer="true" cancel-text="我知道了"> 65 <Modal v-model="platformFeeModalVisible" :transfer="true" cancel-text="我知道了">
64 <div class="fee-dialog-container"> 66 <div class="fee-dialog-container">
65 <p class="modal-title">平台费用</p> 67 <p class="modal-title">平台费用</p>
66 68
67 <p class="fee-line"> 69 <p class="fee-line">
68 - <span class="fee-title">商品鉴定费</span> 70 + <span class="fee-title">商品鉴定费</span>
69 <span class="fee-price">{{platformFee.appraiseFee}}</span> 71 <span class="fee-price">{{platformFee.appraiseFee}}</span>
70 </p> 72 </p>
71 <p class="fee-line"> 73 <p class="fee-line">
72 - <span class="fee-title">商品包装费</span> 74 + <span class="fee-title">商品包装费</span>
73 <span class="fee-price">{{platformFee.packageFee}}</span> 75 <span class="fee-price">{{platformFee.packageFee}}</span>
74 </p> 76 </p>
75 <p class="fee-line total"> 77 <p class="fee-line total">
76 - <span class="fee-title">平台服务费</span> 78 + <span class="fee-title">平台服务费({{platformFee.goodsPaymentRatePercent}})</span>
77 <span class="fee-price">{{platformFee.serviceFee}}</span> 79 <span class="fee-price">{{platformFee.serviceFee}}</span>
78 </p> 80 </p>
79 </div> 81 </div>
@@ -90,21 +92,25 @@ import InputUfo from './components/input-ufo'; @@ -90,21 +92,25 @@ import InputUfo from './components/input-ufo';
90 import {Checkbox} from 'cube-ui'; 92 import {Checkbox} from 'cube-ui';
91 import {get} from 'lodash'; 93 import {get} from 'lodash';
92 import Modal from './components/modal'; 94 import Modal from './components/modal';
  95 +import OrderCheck from '../components/confirm/agree';
93 96
94 const {mapState, mapActions} = createNamespacedHelpers('order/priceChange'); 97 const {mapState, mapActions} = createNamespacedHelpers('order/priceChange');
95 98
96 export default { 99 export default {
97 name: 'noEntryDetail', 100 name: 'noEntryDetail',
98 - components: {Modal, InputUfo, ScrollView, LayoutApp, ImgSize, Checkbox}, 101 + components: {OrderCheck, Modal, InputUfo, ScrollView, LayoutApp, ImgSize, Checkbox},
99 data() { 102 data() {
100 return { 103 return {
101 title: '调价', 104 title: '调价',
  105 + agreementURL: 'https://activity.yoho.cn/feature/3187.html?share_id=5851&title=ufo-%E5%8D%96%E5%AE%B6%E5%8D%8F%E8%AE%AE',
102 platformFeeModalVisible: false, 106 platformFeeModalVisible: false,
103 platformFee: { 107 platformFee: {
104 amount: '-¥0', 108 amount: '-¥0',
105 appraiseFee: '¥0.00', 109 appraiseFee: '¥0.00',
106 packageFee: '¥0.00', 110 packageFee: '¥0.00',
107 - serviceFee: '¥0.00' 111 + serviceFee: '¥0.00',
  112 + goodsPaymentRatePercent: '0.00%',
  113 + payChannelPercentage: '0.00%'
108 }, 114 },
109 bankTransferFee: '-¥0', 115 bankTransferFee: '-¥0',
110 income: '¥0', 116 income: '¥0',
@@ -126,19 +132,24 @@ export default { @@ -126,19 +132,24 @@ export default {
126 // this.inputChange = debounce(this.onChange.bind(this), 500); 132 // this.inputChange = debounce(this.onChange.bind(this), 500);
127 }, 133 },
128 computed: { 134 computed: {
129 - ...mapState(['noEntryOrderInfo', 'fetching']),  
130 - postLoading() {  
131 - return this.fetchingChangePrice || !this.calced;  
132 - } 135 + ...mapState(['noEntryOrderInfo'])
133 }, 136 },
134 watch: { 137 watch: {
135 chgPrice() { 138 chgPrice() {
136 this.calced = false; 139 this.calced = false;
137 - this.platformFee = '-¥0'; 140 + this.platformFee = {
  141 + amount: '-¥0',
  142 + appraiseFee: '¥0.00',
  143 + packageFee: '¥0.00',
  144 + serviceFee: '¥0.00',
  145 + goodsPaymentRatePercent: '0.00%',
  146 + payChannelPercentage: '0.00%'
  147 + };
138 this.bankTransferFee = '-¥0'; 148 this.bankTransferFee = '-¥0';
139 this.income = '¥0'; 149 this.income = '¥0';
140 this.earnestMoney = '¥0'; 150 this.earnestMoney = '¥0';
141 } 151 }
  152 +
142 }, 153 },
143 methods: { 154 methods: {
144 ...mapActions(['fetchOrder', 'postNoEntryCalcPrice', 'postNoEntryChangePrice']), 155 ...mapActions(['fetchOrder', 'postNoEntryCalcPrice', 'postNoEntryChangePrice']),
@@ -226,9 +237,7 @@ export default { @@ -226,9 +237,7 @@ export default {
226 237
227 showEarnestQuestion() { // 跳转保证金页面 238 showEarnestQuestion() { // 跳转保证金页面
228 console.log('showEarnest'); 239 console.log('showEarnest');
229 - },  
230 - showAgreement() { // 跳转卖家协议  
231 - console.log('showAgreement'); 240 +
232 }, 241 },
233 242
234 /** 243 /**
@@ -498,11 +507,11 @@ export default { @@ -498,11 +507,11 @@ export default {
498 display: flex; 507 display: flex;
499 508
500 .fee-title { 509 .fee-title {
501 - width: 50%; 510 + width: 55%;
502 } 511 }
503 512
504 .fee-price { 513 .fee-price {
505 - width: 50%; 514 + width: 45%;
506 text-align: right; 515 text-align: right;
507 } 516 }
508 } 517 }
@@ -517,9 +526,9 @@ export default { @@ -517,9 +526,9 @@ export default {
517 526
518 .agree-container { 527 .agree-container {
519 width: 100%; 528 width: 100%;
520 - height: 80px;  
521 border-top: 1px solid #f0f0f0; 529 border-top: 1px solid #f0f0f0;
522 background-color: #fff; 530 background-color: #fff;
  531 + padding: 20px 48px;
523 532
524 a { 533 a {
525 display: inline-block; 534 display: inline-block;
@@ -145,6 +145,21 @@ export default { @@ -145,6 +145,21 @@ export default {
145 price: this.fee.earnestMoneyStr, 145 price: this.fee.earnestMoneyStr,
146 desc: '保证金', 146 desc: '保证金',
147 orderCode: orderResult.data.orderCode, 147 orderCode: orderResult.data.orderCode,
  148 + extra: JSON.stringify({
  149 + type: UserType.sell,
  150 + back: {
  151 + name: 'ProductDetail',
  152 + params: {
  153 + productId: this.productId
  154 + }
  155 + },
  156 + forward: {
  157 + name: 'SellPayOk',
  158 + query: {
  159 + orderCode: orderResult.data.orderCode
  160 + }
  161 + }
  162 + }),
148 onCloseAction() { 163 onCloseAction() {
149 vm.onClose(orderResult.data.orderCode); 164 vm.onClose(orderResult.data.orderCode);
150 } 165 }
@@ -64,7 +64,7 @@ export default { @@ -64,7 +64,7 @@ export default {
64 orderCode, 64 orderCode,
65 tabType: 'sell' 65 tabType: 'sell'
66 }); 66 });
67 - console.log('fetchOrder= ', result); 67 + console.log('fetchOrder= ', result.data);
68 68
69 if (result && result.code === 200) { 69 if (result && result.code === 200) {
70 commit(Types.FETCH_NOENTRY_ORDER_PRODUCT_SUCCESS, { 70 commit(Types.FETCH_NOENTRY_ORDER_PRODUCT_SUCCESS, {
@@ -132,6 +132,7 @@ export default { @@ -132,6 +132,7 @@ export default {
132 zipCode: '' } }, 132 zipCode: '' } },
133 md5: '6ae15b6dee1a7ac6ba39244894671ad5', 133 md5: '6ae15b6dee1a7ac6ba39244894671ad5',
134 message: '订单详情' }; 134 message: '订单详情' };
  135 +
135 commit(Types.FETCH_NOENTRY_ORDER_PRODUCT_SUCCESS, { 136 commit(Types.FETCH_NOENTRY_ORDER_PRODUCT_SUCCESS, {
136 order: result 137 order: result
137 }); 138 });