Authored by Tao

modify channel

Showing 43 changed files with 390 additions and 218 deletions
<template>
<div id="app">
<transition
:name="`route-view-${yoho.direction}`">
<keep-alive :max="20">
<router-view :key="routerViewKey"></router-view>
</keep-alive>
</transition>
<keep-alive :max="20">
<router-view :key="routerViewKey"></router-view>
</keep-alive>
</div>
</template>
<script>
import {mapState} from 'vuex';
import {mapState, mapMutations} from 'vuex';
export default {
name: 'App',
... ... @@ -32,10 +29,18 @@ export default {
// this.$xianyu.setXianyuWebview();
this.$xianyu.setXianyuNav();
// queryString中携带bind_code,则弹出绑定弹框
if (this.$route.query.bind_code) {
this.$root.$createThirdBind().open();
}
this.$sdk.getUser().then(user => {
if (user && user.uid) {
this.SET_LOGIN_INFO(user);
} else {
// queryString中携带bind_code,则弹出绑定弹框
if (this.$route.query.bind_code) {
this.$root.$createThirdBind().open();
}
}
});
},
watch: {
'yoho.context.needLogin': function(newVal) {
... ... @@ -43,6 +48,9 @@ export default {
this.$yoho.auth({ needLogin: newVal });
}
},
},
methods: {
...mapMutations(['SET_LOGIN_INFO'])
}
};
</script>
... ...
... ... @@ -3,6 +3,7 @@
<transition name="action-sheet-mask">
<div
class="yoho-popup-mask"
@touchmove.prevent
@click="maskClick"
v-if="mask && isVisible"
></div>
... ... @@ -21,9 +22,10 @@
</template>
<script>
import { mapState } from "vuex";
import { mapState } from 'vuex';
export default {
name: "YohoActionSheet",
name: 'YohoActionSheet',
props: {
maskClosable: {
type: Boolean,
... ... @@ -56,7 +58,7 @@ export default {
mounted() {
this.maxHeight = document.documentElement.clientHeight;
this.$watch(
"visible",
'visible',
newVal => {
if (newVal) {
this.show();
... ... @@ -70,9 +72,9 @@ export default {
);
},
computed: {
...mapState(["yoho"]),
...mapState(['yoho']),
actionCls() {
return [{ "yoho-action-sheet": this.full }];
return [{ 'yoho-action-sheet': this.full }];
},
contentHeight() {
let { statusBarHeight, statusBarStatus } = this.yoho.window || {};
... ... @@ -81,7 +83,7 @@ export default {
statusBarHeight = 0;
}
return this.full ? `${this.maxHeight - 20 - statusBarHeight}px` : "auto";
return this.full ? `${this.maxHeight - 20 - statusBarHeight}px` : 'auto';
}
},
methods: {
... ... @@ -91,7 +93,7 @@ export default {
cancel() {
this.hide();
this.$emit("cancel");
this.$emit('cancel');
},
show() {
... ...
<template>
<div v-if="dialogEnable" class="third-bind-wrapper">
<CubeScroll v-if="dialogEnable" class="third-bind-wrapper">
<div class="bind-dialog">
<p class="bind-title">关联有货UFO账户</p>
<div class="under-row">
... ... @@ -20,13 +20,13 @@
<CubeButton class="bind-btn" :disabled="submitDisable" @click="bindSubmit">登录</CubeButton>
</div>
</div>
</div>
</CubeScroll>
</template>
<script>
import { Button, Input } from 'cube-ui';
import { mapActions, mapState } from 'vuex';
import { Button, Scroll, Input } from 'cube-ui';
import { mapActions, mapState, mapMutations } from 'vuex';
export default {
name: 'ThirdBind',
... ... @@ -48,8 +48,21 @@ export default {
return !(this.phone && this.smsCode);
}
},
watch: {
smsCode(newVal, oldVal) {
// 解决ios自动填充验证码输入两遍的问题
if (this.$yoho.isiOS && newVal.length > 4 && newVal.length - oldVal.length > 1 && newVal.length % 2 === 0) {
let half = newVal.length / 2;
if (newVal.substring(0, half) === newVal.substring(half)) {
this.smsCode = newVal.substring(0, half);
}
}
}
},
methods: {
...mapActions(['sendBindSms', 'submitThirdBind']),
...mapMutations(['SET_LOGIN_INFO']),
open() {
this.bindCode = this.$route.query.bind_code;
this.phone = '';
... ... @@ -93,6 +106,11 @@ export default {
this.sendBindSms({
mobile: this.phone,
bindCode: this.bindCode
}).then(res => {
if (res.code !== 200) {
this.clearSendTimer();
this.toast(res.message || '发送失败');
}
});
},
clearSendTimer() {
... ... @@ -109,6 +127,7 @@ export default {
if (res.code === 200) {
this.binded = true;
this.close();
this.SET_LOGIN_INFO({ uid: 999999999999 }); // 设置登录状态
} else {
this.toast(res.message);
}
... ... @@ -119,6 +138,7 @@ export default {
}
},
components: {
CubeScroll: Scroll,
CubeInput: Input,
CubeButton: Button
}
... ... @@ -137,6 +157,7 @@ export default {
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
}
.bind-dialog {
... ...
... ... @@ -18,10 +18,6 @@ export default {
console.log(newVal);
}
},
// activated() {
// console.log(this.report);
// console.log("this.report");
// },
methods: {
jumpTo() {
if (!this.href) {
... ...
... ... @@ -8,7 +8,7 @@
<slot name="price">
<div class="price-info">
<div class="desc">{{desc}}</div>
<div class="price">{{price }}</div>
<div class="price">{{price }}</div>
</div>
</slot>
<slot name="content">
... ... @@ -106,7 +106,8 @@ export default {
await this.delay(1500);
this.payAction({
orderCode: this.orderCode
orderCode: this.orderCode,
payment: this.$xianyu.isAliApp ? 2 : 9
}).then((result) => {
toast.hide();
this.onSuccess(result);
... ... @@ -127,39 +128,39 @@ 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.$router.replace({
name: 'OrderPay',
query: {
orderCode: this.orderCode,
payParams: result.data.payParams,
extra: 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
}
});
}
// 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
// }
// });
// }
}
}
};
... ...
... ... @@ -92,7 +92,12 @@ yoho.auth = async (args) => {
if (user && user.uid) {
return user;
} else {
cookie.set('third_backurl', refer || location.href, {
let ck = {
s: refer || location.href,
b: location.href
};
cookie.set('ali_backurl', JSON.stringify(ck), {
domain: '.yohobuy.com',
path: '/',
});
... ...
... ... @@ -7,7 +7,7 @@
<meta name="description" content="" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"
content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, viewport-fit=cover"
/>
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta content="yes" name="apple-mobile-web-app-capable" />
... ...
<template>
<div class="swiper" v-if="list.data && list.data.length > 0">
<div class="swiper-item swiper-item-left">
<LayoutLink :href="list.data[0].url" class="img-link" :report="{...params, I_INDEX: 1}">
<LayoutLink :href="list.data[0].url" class="img-link" :report="{...params, I_INDEX: 1, F_URL: list.data[0].url}">
<ImageFormat :lazy="false" class="item-imge" :src="list.data[0].src" :width="310" :height="402"></ImageFormat>
</LayoutLink>
</div>
<div class="swiper-item swiper-item-right">
<LayoutLink :href="list.data[1].url" class="img-link" :report="{...params, I_INDEX: 2}">
<LayoutLink :href="list.data[1].url" class="img-link" :report="{...params, I_INDEX: 2, F_URL: list.data[1].url}">
<ImageFormat :lazy="false" class="item-imge" :src="list.data[1].src" :width="380" :height="196"></ImageFormat>
</LayoutLink>
<LayoutLink :href="list.data[2].url" class="img-link" :report="{...params, I_INDEX: 3}">
<LayoutLink :href="list.data[2].url" class="img-link" :report="{...params, I_INDEX: 3, F_URL: list.data[2].url}">
<ImageFormat :lazy="false" class="item-imge" :src="list.data[2].src" :width="380" :height="196"></ImageFormat>
</LayoutLink>
</div>
... ... @@ -33,7 +33,7 @@ export default {
}
},
mounted() {
// console.log(this.list)
console.log(this.list)
},
activated() {
let { template_id, template_name } = this.list;
... ... @@ -46,12 +46,11 @@ export default {
PAGE_URL,
F_INDEX,
F_NAME: template_name,
F_URL: 'F_URL',
}
this.params = params;
},
methods: {
},
};
</script>
... ...
... ... @@ -107,7 +107,7 @@ export default {
}
.grey {
background-color: #F2F2F2;
margin: 0 -40px;
// margin: 0 -40px;
padding: 0 40px;
}
... ... @@ -136,6 +136,6 @@ export default {
.cubeic-arrow {
color: #999;
margin-left: 10px;
font-size: 32px;
font-size: 20px;
}
</style>
... ...
<template>
<LayoutApp :show-back="true" title="我的" :hideHeader="hideHeader">
<div class="body" ref="body">
<Scroll>
<div v-for="(value, key) in getMineList" :key="key">
<tab-item v-if="key === 'board'" :data="value" noLine icon="cubeic-notification" small grey>
<scroll></scroll>
<niticelScroll></niticelScroll>
</tab-item>
<template v-else-if="key === 'resource1' || key === 'resource2'">
<div v-if="value.data.template_name ==='single_image'">
<div v-if="value.data.template_name ==='single_image'" class="marg">
<singleImage :data="value.data.data[0]"></singleImage>
</div>
</template>
<div v-else-if="key === 'order'" class="bg-bottom">
<div v-else-if="key === 'order'" class="bg-bottom marg">
<order></order>
</div>
<div v-else-if="key === 'sale'" class="bg-top">
<div v-else-if="key === 'sale'" class="bg-top marg">
<tab-item :data="value" noLine titleBold titleSmall></tab-item>
</div>
<bind v-else-if="key === 'bindAccount'" :data="value"></bind>
<tab-item v-else :data="value"></tab-item>
<bind class="marg" v-else-if="key === 'bindAccount'" :data="value"></bind>
<tab-item class="marg" v-else :data="value"></tab-item>
</div>
</Scroll>
</div>
</LayoutApp>
</template>
... ... @@ -30,6 +31,7 @@ import order from './components/order';
import scroll from './components/scroll';
import singleImage from './components/singleImage';
import bind from './components/bind';
import {Style, Scroll} from 'cube-ui';
import { createNamespacedHelpers } from 'vuex';
const { mapGetters, mapActions } = createNamespacedHelpers('home/mine');
... ... @@ -68,9 +70,12 @@ export default {
components: {
tabItem,
order,
scroll,
niticelScroll: scroll,
singleImage,
bind
bind,
Style,
Scroll
}
};
</script>
... ... @@ -78,9 +83,12 @@ export default {
<style lang="scss" scoped>
.body {
height: 100%;
overflow-y: auto;
// overflow-y: auto;
background-color: white;
padding: 0 40px;
// padding: 0 40px;
}
.marg {
margin: 0 40px;
}
.bg-top,
... ...
... ... @@ -61,7 +61,7 @@ export default {
this.fetchTabList();
},
mounted() {
},
computed: {
options: function() {
... ... @@ -71,14 +71,14 @@ export default {
}
},
created() {
},
methods: {
...mapActions(['fetchNewsList', 'fetchNewsTabList']),
async fetchList() {
let result = await this.fetchNewsList({ ...this.params });
if (result.code && result.code == 200) {
if (result && 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;
... ... @@ -94,13 +94,13 @@ export default {
async fetchTabList() {
let result = await this.fetchNewsTabList();
if (result.code && result.code == 200) {
if (result && result.code && result.code == 200) {
this.newsList.tabList = result.data;
}
},
async onPullingUp() {
if (!this.newsList.isMoreData) {
this.$refs.scroll.forceUpdate()
this.$refs.scroll.forceUpdate();
return;
}
this.fetchList(this.params);
... ...
... ... @@ -13,6 +13,7 @@
font-size: 36px;
color: #000;
padding: 15px;
font-weight: bold;
border-bottom: solid 1px #eee;
}
.no-data {
... ...
... ... @@ -55,7 +55,6 @@
height: 48px;
}
.assets-record-code-txt {
font-family: PingFang-SC-Regular;
font-size: 28px;
color: #000000;
display: -webkit-box;
... ... @@ -68,19 +67,16 @@
display: inline-block;
}
.assets-record-time-txt {
font-family: SFProText-Regular;
font-size: 22px;
color: #999999;
margin-top: 12px;
}
.assets-record-income-txt {
font-family: SFProText-Medium;
font-weight: bold;
font-size: 28px;
color: #65AB85;
color: #000;
}
.assets-record-income-tip-txt {
font-family: PingFang-SC-Regular;
font-size: 20px;
color: #D0021B;
display: inline-block;
... ...
<!--买家求购确认页-->
<template>
<LayoutApp :show-back="true" title="">
<LayoutApp :show-back="true" title="出价求购">
<div class="body" ref="body">
<div class="topContainer">
<div class="topView">
<div class="title">出价求购</div>
</div>
<!--<div class="topView">-->
<!--<div class="title"></div>-->
<!--</div>-->
<!--商品信息-->
<div class="productDetail">
<div class="productImageWrapper">
... ... @@ -340,7 +340,7 @@ export default {
}
}),
onCloseAction() {
// vm.onClose(orderResult.data.orderCode);
vm.onClose(get(vm.publishresult, 'orderCode', ''));
}
}).show();
},
... ... @@ -361,6 +361,18 @@ export default {
}).show();
},
onClose(orderCode) {
if (orderCode) {
this.$router.replace({
name: 'buyOrderDetail',
params: {
owner: 'buy',
code: orderCode
}
});
}
}
}
};
</script>
... ... @@ -440,10 +452,12 @@ export default {
width: calc(100% - 120*2px - 10*2px);
height: 120*2px;
margin-left: 10*2px;
justify-content: center;
display: flex;
flex-direction: column;
}
.size {
margin-top: 37*2px;
font-family: "PingFang SC";
font-size: 12*2px;
color: #999;
... ... @@ -617,4 +631,13 @@ export default {
padding: 0 40px 40px;
background-color: white;
}
.cube-picker-panel {
height: 273px;
text-align: center;
font-size: 14px;
background: #fff;
border-top-left-radius: 15px !important;
border-top-right-radius: 15px !important;
}
</style>
... ...
<template>
<LayoutApp :show-back="true" title="确认订单" :back-action="backAction">
<div class="body">
<Scroll :options="scrollOption">
<AddressInfo :data="address" class="order-item" :show-tip="false"></AddressInfo>
<ProductInfo :data="productDetail" class="product-info order-item"></ProductInfo>
<Coupon class="order-item" v-if="couponList.length > 0" :data="orderDetail.recommendedCouponInfo"
... ... @@ -13,6 +14,7 @@
<div class="tip order-item" v-if="orderDetail.damagesDesc" v-html="replaceBr(orderDetail.damagesDesc)"></div>
<OrderInfo class="order-item" v-if="orderDetail.paymentWay" :pay-way="orderDetail.paymentWay"
:delivery-way="orderDetail.deliveryWay"></OrderInfo>
</Scroll>
</div>
<OrderFooter class="footer" :amount="orderDetail.amount" @click="onPayAction"></OrderFooter>
... ... @@ -30,6 +32,7 @@ import OrderFooter from './components/confirm/buyer-order-footer';
import Coupon from './components/confirm/buyer-coupon';
import Promotion from './components/confirm/buyer-promotion';
import { Types, UserType } from 'store/order/order-confirm';
import { Scroll } from 'cube-ui';
import { get } from 'lodash';
import { createNamespacedHelpers, mapState } from 'vuex';
... ... @@ -41,7 +44,10 @@ export default {
props: ['productId', 'storageId'],
data() {
return {
isActive: false
isActive: false,
scrollOption: {
bounce: false
}
};
},
components: {
... ... @@ -52,7 +58,8 @@ export default {
OrderInfo,
OrderFooter,
Coupon,
Promotion
Promotion,
Scroll
},
activated() {
this.init();
... ... @@ -96,6 +103,13 @@ export default {
}
},
deep: true
},
watch: {
'yoho.context.isLogin': function(newVal) {
if (newVal) {
this.init();
}
},
}
},
methods: {
... ... @@ -309,6 +323,7 @@ export default {
.product-info {
height: 260px;
display: flex;
}
.tip {
... ...
... ... @@ -39,7 +39,7 @@ export default {
.desc {
font-size: 24px;
color: #3f3f3f;
color: #999;
margin-left: 10px;
}
... ...
... ... @@ -2,7 +2,7 @@
<div class="input-comp">
<div class="input-wrapper">
<div class="price-symbol">¥</div>
<input ref="input" :value="value" class="cube-input-field" type="text" placeholder="定价需以9结尾,例如¥1299" @blur="onBlur"
<input ref="input" :value="value" class="tip" type="text" placeholder="定价需以9结尾,例如¥1299" @blur="onBlur"
@change="onChange"></input>
</div>
<div class="num-wrapper" v-if="superSell">
... ... @@ -91,7 +91,7 @@ export default {
flex: 1;
font-size: 56px;
font-weight: 500;
line-height: 120px;
line-height: 80px;
background: #f5f5f5;
}
... ... @@ -119,7 +119,6 @@ export default {
.count {
color: black;
}
}
</style>
... ...
... ... @@ -28,16 +28,16 @@ export default {
<style lang="scss" scoped>
.product-wrapper {
display: flex;
height: 240px;
overflow: hidden;
}
.product-price {
display: inline-block;
vertical-align: top;
display: flex;
height: 100%;
margin-left: 20px;
padding-top: 3%;
align-items: center;
}
.price {
... ...
... ... @@ -24,7 +24,7 @@ export default {
...mapMutations(['filterOrderList', 'resetData']),
async onAction({ action, order, isDetail = false } = {}) {
const { owner = ownType.SELL } = this.$route.params;
const { owner = ownType.SELL, status } = this.$route.params;
const {
orderCode,
realPrice = '',
... ... @@ -52,7 +52,7 @@ export default {
this.filterOrderList({
orderCode,
owner,
status: this.status,
status,
});
}
}
... ... @@ -123,8 +123,8 @@ export default {
}
this.$createOrderPayType({
orderCode,
price: parseFloat(price || ''),
desc: '',
price: parseFloat(price || '').toFixed(2),
desc: '金额',
extra: JSON.stringify({
back: {
name: pageBackName,
... ... @@ -141,7 +141,7 @@ export default {
case orderActionsMap.PAY_DEPOSIT.name: {
this.$createOrderPayType({
orderCode,
price: parseFloat(bidDepositInfo.depositAmount),
price: parseFloat(bidDepositInfo.depositAmount).toFixed(2),
desc: '支付定金',
extra: JSON.stringify({
forward: {
... ...
... ... @@ -63,7 +63,7 @@ export default {
this.$createOrderPayType({
orderCode,
price: earnestMoney,
price: parseFloat(`${earnestMoney}`).toFixed(2),
desc: '保证金',
// 支付成功会跳route
... ...
... ... @@ -3,7 +3,7 @@
:title="$route.params.owner === 'sell' ? '我的出售' : '我的订单'"
class="list-page"
>
<status-nav :status="status" :owner="owner" @select="onStatusChange" />
<status-nav :status="status" :owner="owner" @select="onStatusChange"/>
<div class="content-wrapper">
<scroll
@pulling-up="fetchData"
... ... @@ -15,11 +15,11 @@
>
<ul class="list-wrapper">
<li v-for="order in viewOrderList" :key="order.orderCode">
<order-item-header :order="order" />
<order-item :order="order" />
<order-item-header :order="order"/>
<order-item :order="order"/>
<!-- 订单操作 -->
<div class="footer-wrapper">
<count-down :leftTime="order.leftTime" />
<count-down :leftTime="order.leftTime"/>
<order-actions
class="actions"
pageName="list"
... ... @@ -54,24 +54,24 @@
</template>
<script>
import { Scroll } from "cube-ui";
import { createNamespacedHelpers } from "vuex";
import { Scroll } from 'cube-ui';
import { createNamespacedHelpers } from 'vuex';
import OrderItem from "./components/order-item";
import StatusNav from "./components/status-nav";
import OrderItemHeader from "./components/order-item-header";
import VideoPlayer from "./components/video-player";
import OrderItem from './components/order-item';
import StatusNav from './components/status-nav';
import OrderItemHeader from './components/order-item-header';
import VideoPlayer from './components/video-player';
import EmptyList from "components//ufo-no-item";
import EmptyList from 'components//ufo-no-item';
import OrderActions from "../components/order-actions";
import CountDown from "../components/count-down";
import OrderActions from '../components/order-actions';
import CountDown from '../components/count-down';
import orderActionMixin from "../mixin/order-action";
import orderInSaleActionMixin from "../mixin/order-in-sale-action";
import { orderStatusKey, getOrderStatus } from "constants/order-constants";
import orderActionMixin from '../mixin/order-action';
import orderInSaleActionMixin from '../mixin/order-in-sale-action';
import { orderStatusKey, getOrderStatus } from 'constants/order-constants';
const STORE_PATH = "order/orderList";
const STORE_PATH = 'order/orderList';
const { mapActions, mapState, mapMutations } = createNamespacedHelpers(
STORE_PATH
... ... @@ -95,7 +95,7 @@ export default {
status: Number
},
computed: {
...mapState(["orderListByType"]),
...mapState(['orderListByType']),
orderStatus() {
return this.orderListByType[orderStatusKey(this.owner, this.status)];
},
... ... @@ -110,7 +110,7 @@ export default {
// if (this.$refs.scroll && this.$refs.scroll.scroll) {
options.pullDownRefresh = this.orderStatus.isShowEmpty
? false
: { txt: "更新成功" };
: { txt: '更新成功' };
// }
return options;
... ... @@ -119,7 +119,7 @@ export default {
// 获取订单数据
asyncData({ store, router }) {
let { owner, status } = router.params;
let { owner, status } = router.params;
status = getOrderStatus(owner, status);
... ... @@ -127,8 +127,8 @@ export default {
return store.dispatch(`${STORE_PATH}/fetchOrderList`, { owner, status });
},
methods: {
...mapActions(["fetchOrderList", "confirmReceipt"]),
...mapMutations(["resetData"]),
...mapActions(['fetchOrderList', 'confirmReceipt']),
...mapMutations(['resetData']),
fetchData() {
this.fetchOrderList({
owner: this.owner,
... ... @@ -203,6 +203,7 @@ export default {
.video-wrapper {
overflow: hidden;
}
.video-player {
display: block;
height: 40px;
... ...
... ... @@ -348,7 +348,7 @@ export default {
.judge-count-down {
color: #d0021b;
font-size: 12px;
font-size: 12*2px;
display: inline-block;
}
... ...
... ... @@ -57,11 +57,25 @@ export default {
methods: {
...mapOrderAction(['fetchOrderStatus']),
openPay() {
const url = config.alipayUrl + '?' + this.payParams;
if (this.$xianyu.isAliApp) {
this.$xianyu.setXianyuPay({
payURL: this.payParams
}, () => {
if (this.page.forward) {
this.$router.replace(this.page.forward);
}
}, () => {
if (this.page.back) {
this.$router.replace(this.page.back);
}
});
} else {
const url = config.alipayUrl + '?' + this.payParams;
this.$xianyu.goXianyuNewPage({
url
});
this.$xianyu.goXianyuNewPage({
url
});
}
},
backAction() {
const page = JSON.parse(this.extra || '{}');
... ...
<!--卖家求购变现-->
<template>
<LayoutApp :show-back="true">
<LayoutApp :show-back="true" title="变现">
<div class="body">
<TitleComp txt="变现"></TitleComp>
<!--<TitleComp txt="变现"></TitleComp>-->
<ProductInfo :data="originProductData" class="product-info" :priceType="'现货最高求购价:'"></ProductInfo>
<div class="inputView">
<span class="inputViewIcon">
... ... @@ -88,7 +88,6 @@ export default {
this.isEntry = false;
this.fetchSellerEntryStatus({})
.then((res)=> {
console.log(res);
if (res) {
this.isEntry = get(res, 'entrySellerType', 0) !== 0;
}
... ... @@ -184,7 +183,7 @@ export default {
},
payOrder() {
let vm = this;
this.$createOrderPayType({
price: get(this.computeTip, 'earnestMoney', 0),
desc: '保证金',
... ... @@ -205,7 +204,7 @@ export default {
}
}),
onCloseAction() {
// vm.onClose(orderResult.data.orderCode);
vm.onClose(get(this.publishinfo, 'orderCode', ''));
}
}).show();
},
... ... @@ -217,6 +216,19 @@ export default {
type: 'txt',
txt: this.toastMessage
}).show();
},
onClose(orderCode) {
if (orderCode) {
this.$router.replace({
name: 'sellOrderDetail',
params: {
owner: 'sell',
code: orderCode
}
});
}
}
}
... ...
<template>
<LayoutApp :show-back="true" title="出售" :back-action="backAction">
<div class="body">
<Scroll :options="scrollOption">
<ProductInfo :data="productDetail" class="product-info"></ProductInfo>
<InputPrice @input="changePrice" class="input-price"
<InputPrice @input="changePrice"
:num="num" :value="price"
@on-blur="compute" :super-sell="superSell"
@on-num-change="onNumChange"
>
</InputPrice>
<OrderMargin class="order-item order-margin" :data="fee" :super-sell="superSell"></OrderMargin>
<OrderMargin class="order-item order-margin" :data="fee" :super-sell="superSell" :url="tipUrl"></OrderMargin>
<OrderFee class="order-item" :data="fee"></OrderFee>
<AddressInfo :data="address" class="order-item"></AddressInfo>
</Scroll>
</div>
<div class="footer">
<OrderAgree :value="agree" @input="changeAgree" class="agree-wrapper" :desc="agreeDesc" :url="url"></OrderAgree>
... ... @@ -31,6 +33,7 @@ import OrderMargin from './components/confirm/order-margin';
import OrderFee from './components/confirm/order-fee';
import OrderAgree from './components/confirm/agree';
import { Types, UserType } from 'store/order/order-confirm';
import { Scroll } from 'cube-ui';
import { get } from 'lodash';
import { createNamespacedHelpers, mapState } from 'vuex';
... ... @@ -41,6 +44,7 @@ export default {
name: 'SellOrderConfirm',
props: ['productId', 'storageId'],
components: {
Scroll,
ProductInfo,
AddressInfo,
InputPrice,
... ... @@ -56,7 +60,11 @@ export default {
agreeDesc: '有货卖家协议',
url: 'https://activity.yoho.cn/feature/6773.html?share_id=9479&title=%E9%97%B2%E9%B1%BC%E6%BD%AE%E5%8D%96%E5%AE%B6%E5%8D%8F%E8%AE%AE',
superSell: false,
addNumError: false
addNumError: false,
scrollOption: {
bounce: false
},
tipUrl: 'https://activity.yoho.cn/feature/6773.html?share_id=9479&title=%E9%97%B2%E9%B1%BC%E6%BD%AE%E5%8D%96%E5%AE%B6%E5%8D%8F%E8%AE%AE'
};
},
activated() {
... ... @@ -110,9 +118,11 @@ export default {
return {
goodImg: get(state.product.selectedProductInfo, 'product.goods_list[0].image_list[0].image_url', ''),
productName: get(state.product.selectedProductInfo, 'product.product_name', ''),
productId: get(state.product.selectedProductInfo, 'product.product_id', ''),
colorName: get(state.product.selectedProductInfo, 'product.goods_list[0].color_name', ''),
sizeName: get(state.product.selectedProductInfo, 'size.size_name', ''),
skup: get(state.product.selectedProductInfo, 'size.skup', ''),
bidSkup: get(state.product.selectedProductInfo, 'size.bid_skup', ''),
goodPrice,
priceType,
goodBidPrice,
... ... @@ -149,11 +159,21 @@ export default {
disabled: false
},
onCancel: () => {
this.$router.replace({
this.$store.commit('order/sellerAskOrder/SELLER_ASK_SET_PRODUCTINFO', {
goodImg: this.productDetail.goodImg,
colorName: this.productDetail.colorName,
sizeName: this.productDetail.sizeName,
goodPrice: this.productDetail.bidPrice,
productId: this.productDetail.productId,
bid_moster_price: this.productDetail.bidPrice,
});
// 跳转变现
this.$router.push({
name: 'sellAskOrder',
query: {
skup: this.productDetail.skup,
price: this.productDetail.bidPrice
skup: this.productDetail.bidSkup,
price: this.productDetail.bidPrice,
}
});
}
... ... @@ -375,6 +395,11 @@ export default {
padding: 0 50px;
}
.product-info {
height: 240px;
margin-bottom: 20px;
}
.submit-btn {
height: 80px;
line-height: 80px;
... ...
... ... @@ -92,6 +92,13 @@ export default {
},
methods: {
...mapActions(['userRealCertification']),
toast(msg) {
this.$createToast && this.$createToast({
txt: msg,
type: 'txt',
time: 1000
}).show();
},
clearInfo(arr) {
if (arr && arr.length) {
arr.forEach(val => {
... ... @@ -122,25 +129,29 @@ export default {
},
addedHandler() {
this.uploading = true;
this.uploadToast = this.$createToast({
txt: '上传中',
mask: true
}).show();
},
successHandler(file) {
this.uploading = false;
this.uploadToast.hide();
if (get(file, 'response.code') === 200) {
this.uploadCallback && this.uploadCallback(get(file, 'response.data.imagesList[0]'), file.url);
} else {
this.$createToast && this.$createToast({
txt: res.message || '上传失败',
type: 'txt',
time: 1000
}).show();
this.toast(res.message || '上传失败');
}
this.uploading = false;
setTimeout(() => {
this.$refs.upload.removeFile(file);
}, 1000);
},
errorHandler() {
this.uploading = false;
this.uploadToast.hide();
this.toast('上传失败');
},
submitCert() {
this.userRealCertification({
... ...
... ... @@ -211,6 +211,7 @@ export default {
.size-info,
.size-price {
font-family: "Alte DIN 1451 Mittelschrift";
color: #fff;
}
}
... ... @@ -218,6 +219,7 @@ export default {
&.disabled {
.size-info,
.size-price {
font-family: "Alte DIN 1451 Mittelschrift";
color: #ccc;
}
}
... ...
... ... @@ -221,6 +221,7 @@ export default {
.title {
font-size: 40px;
line-height: 96px;
font-weight: bold;
i {
float: right;
... ... @@ -253,6 +254,7 @@ export default {
padding-top: 30px;
font-size: 32px;
color: #000;
font-family: "Alte DIN 1451 Mittelschrift";
}
}
}
... ... @@ -344,6 +346,7 @@ export default {
font-size: 28px;
i {
font-family: "Alte DIN 1451 Mittelschrift";
font-size: 20px;
font-style: normal;
}
... ...
... ... @@ -178,9 +178,9 @@ export default {
},
},
mounted() {
if (this.isQiugouEnabled === null) {
this.$store.dispatch('getSysConfigQiugou');
}
// if (this.isQiugouEnabled === null) {
this.$store.dispatch('getSysConfigQiugou');
// }
},
activated() {
this.loadData(this.productId);
... ...
... ... @@ -51,7 +51,7 @@ export default function() {
},
async fetchChannelList({ commit }) {
const result = await this.$api.get('/api/ufo/channel/channelList', {
content_code: 'f788335b57b67c1711f255648c744dab',
content_code: 'cfcd8de156d3edc26c84091804c43e23',
});
if (result.code === 200) {
commit(Types.FETCH_CHANNEL, { list: result.data });
... ...
... ... @@ -89,7 +89,7 @@ const DEFUALT_CONFIG_TIP = {
};
const TEST_PRODUCT_INFO = {
least_price: 1119.00,
least_price: 0,
max_price: 20000.00,
max_sort_id: 10,
min_price: 0.01,
... ... @@ -98,7 +98,9 @@ const TEST_PRODUCT_INFO = {
product_id: 10000068,
product_name: 'Timberland 红色女靴',
sale_time: '2016.01.01',
image: 'http://img11.static.yhbimg.com/goodsimg/2018/10/18/17/0124eed582cab20be7047c796c314cbc76.jpg?imageMogr2/thumbnail/{width}x{height}/background/d2hpdGU=/position/center/quality/80'
image: 'http://img11.static.yhbimg.com/goodsimg/2018/10/18/17/0124eed582cab20be7047c796c314cbc76.jpg?imageMogr2/thumbnail/{width}x{height}/background/d2hpdGU=/position/center/quality/80',
sizeName: '',
colorName: '',
};
export default function() {
... ...
... ... @@ -84,7 +84,7 @@ export default function() {
actions: {
async fetchEntryOrderList({ dispatch, commit, state: { entryOrder } }) {
const { page } = entryOrder;
const res = await this.$api.get('/api/ufo/seller/entryPrdList', {
const res = await this.$api.post('/api/ufo/seller/entryPrdList', {
page,
// TODO 注释type含义
... ... @@ -104,7 +104,7 @@ export default function() {
},
async fetchNotEntryOrderList({ commit, state: { notEntryOrder } }) {
const { page } = notEntryOrder;
const res = await this.$api.get('/api/ufo/seller/notEntryPrdList', {
const res = await this.$api.post('/api/ufo/seller/notEntryPrdList', {
page,
type: 1,
});
... ...
... ... @@ -264,10 +264,10 @@ export default function() {
return order;
},
async payAction(ctx, { orderCode }) {
async payAction(ctx, { orderCode, payment = 2 }) {
const payResult = await this.$api.post('/api/order/pay', {
orderCode,
payment: 2
payment
});
if (payResult.code !== 200) {
... ...
... ... @@ -30,7 +30,7 @@ export default function() {
* }
*/
async fetchOrderDetail({ commit }, { owner, code } = {}) {
const res = await this.$api.get('/api/order/detail', {
const res = await this.$api.post('/api/order/detail', {
tabType: owner,
orderCode: +code,
});
... ...
... ... @@ -55,15 +55,40 @@ export default function() {
orderState.pullUpLoad = false;
}
},
filterOrderList(state, { orderCode, owner, status }) {
const orderState = state.orderListByType[orderStatusKey(owner, status)];
filterOrderList(state, {
orderCode,
owner = ownType.SELL,
status = 1
}) {
let orderState = state.orderListByType[orderStatusKey(owner, status)];
orderState.orderList = orderState.orderList.filter(
order => order.orderCode !== orderCode,
);
orderState.isShowEmpty = orderState.orderList.length === 0;
},
resetData(state, { owner, status } = {}) {
setOrderStatus(state, currentStatus) {
state.currentStatus = +currentStatus;
},
setRouteParamStatus(state, status = 1) {
state.routeParamStatus = +status;
},
resetPartialData(state, {
owner = ownType.SELL,
status = 1
}) {
Object.assign(state.orderListByType[orderStatusKey(owner, status)], {
page: 1,
orderList: [],
pagetotal: 0,
pullUpLoad: true,
});
},
resetData(state, {
owner = ownType.SELL,
status = 1
}) {
const orderListState = initialOrderState();
state.orderListByType[orderStatusKey(owner, status)] = orderListState;
... ... @@ -79,10 +104,16 @@ export default function() {
* }
* r
*/
async fetchOrderList({ commit, state }, { owner, status }) {
async fetchOrderList({
commit,
state
}, {
owner = ownType.SELL,
status = 1
}) {
const { page } = state.orderListByType[orderStatusKey(owner, status)];
const res = await this.$api.get('/api/order/list', {
const res = await this.$api.post('/api/order/list', {
tabType: owner,
type: status,
page,
... ... @@ -180,7 +211,7 @@ export default function() {
});
if (res.code === 200) {
return { errMsg: '', isOk: true, bidData: res.data };
return { errMsg: '', isOk: true, bidData: res.data};
} else {
return { errMsg: res.message, isOk: false };
}
... ...
... ... @@ -18,7 +18,7 @@ export default function() {
* @returns ts ILogisticsInfo
*/
async fetchLogisticInfo({ commit }, { owner, code } = {}) {
const res = await this.$api.get('/api/order/express', {
const res = await this.$api.post('/api/order/express', {
tabType: owner,
orderCode: +code,
});
... ... @@ -27,17 +27,17 @@ export default function() {
commit('initData', res.data);
}
},
async flawReject({commit}, {orderCode} = {}) {
return this.$api.get('/api/order/flawreject', {
orderCode
})
async flawReject(_, { orderCode } = {}) {
return this.$api.get('/api/order/flawreject', {
orderCode,
});
},
async flawAccept({commit}, {orderCode} = {}) {
async flawAccept(_, { orderCode } = {}) {
return this.$api.get('/api/order/flawaccept', {
orderCode
})
}
orderCode,
});
},
},
};
}
... ...
... ... @@ -30,7 +30,7 @@ const {
} = Types;
const TEST_PRODUCT_INFO = {
least_price: 1119.00,
least_price: 0,
max_price: 20000.00,
max_sort_id: 10,
min_price: 0.01,
... ... @@ -40,9 +40,9 @@ const TEST_PRODUCT_INFO = {
product_name: 'Timberland 红色女靴',
sale_time: '2016.01.01',
goodImg: 'http://img11.static.yhbimg.com/goodsimg/2018/10/18/17/0124eed582cab20be7047c796c314cbc76.jpg?imageMogr2/thumbnail/{width}x{height}/background/d2hpdGU=/position/center/quality/80',
colorName: '黑色',
sizeName: '42码',
goodPrice: 1119.00,
colorName: '',
sizeName: '',
goodPrice: 0,
priceType: '现货最高求购价:',
};
... ...
... ... @@ -15,7 +15,7 @@ export default {
content_code: '05e4f5782dfc3a5e10d39b8f04a7dcb9',
};
}
return this.$api.get(`/api/ufo/product${path}`, params).then(result => {
return this.$api.post(`/api/ufo/product${path}`, params).then(result => {
if (result.code === 200) {
return result.data;
} else {
... ... @@ -35,7 +35,7 @@ export default {
}));
},
async fetchRecommendProduct({ commit }, { productId }) {
const result = await this.$api.get('/api/ufo/product/recommend', { product_id: productId })
const result = await this.$api.post('/api/ufo/product/recommend', { product_id: productId })
return result?.data?.product_list ?? []
},
... ... @@ -52,7 +52,7 @@ export default {
return false;
}
const isFav = await this.$api.get('/api/ufo/product/fav', { productId }).then(result => {
const isFav = await this.$api.post('/api/ufo/product/fav', { productId }).then(result => {
if (result.code === 200) {
return result.data;
} else {
... ... @@ -63,7 +63,7 @@ export default {
commit(Types.UPDATE_PRODUCT_FAV, { productId, isFav });
},
async fetchTop3({ commit }, { productId }) {
const result = await this.$api.get('/api/ufo/product/top', { product_id: productId });
const result = await this.$api.post('/api/ufo/product/top', { product_id: productId });
if (result.code === 200) {
const productList = result.data.product_list || [];
... ... @@ -72,7 +72,7 @@ export default {
}
},
async toggleFav({ commit }, { productId, isFav }) {
const result = await this.$api.get(`/api/ufo/product/favorite/${isFav ? 'add' : 'cancel'}`, { productId });
const result = await this.$api.post(`/api/ufo/product/favorite/${isFav ? 'add' : 'cancel'}`, { productId });
if (result && result.code === 200) {
commit(Types.UPDATE_PRODUCT_FAV, { productId, isFav });
... ... @@ -106,7 +106,7 @@ export default {
async requestSize({ state }, { product_id, goods_id, size_ids }) {
const selectedProduct = state.selectedProductInfo;
await this.$api.get('/api/ufo/product/addsize', {
await this.$api.post('/api/ufo/product/addsize', {
product_id,
goods_id,
size_ids,
... ...
... ... @@ -24,6 +24,7 @@ export default function(mergeState = {}) {
isLogin: false,
userHeadIco: '',
userName: '',
enableQiugou: null, // 是否启用求购,默认不启用, null: 初始状态标识,需要请求api, false: 不启用, true: 启用
},
window: {
statusBarStatus: false,
... ... @@ -39,11 +40,6 @@ export default function(mergeState = {}) {
direction: 'forword',
homePage: true,
user: {},
// 系统配置
sysConfig: {
enableQiugou: null, // 是否启用求购,默认不启用, null: 初始状态标识,需要请求api, false: 不启用, true: 启用
}
},
mergeState,
),
... ... @@ -139,7 +135,7 @@ export default function(mergeState = {}) {
state.user.sellerInfo = sellerInfo || {};
},
[Types.UPDATE_SYSTEM_CONFIG_QIUGOU](state, { enabled }) {
state.sysConfig.enableQiugou = enabled;
state.context.enableQiugou = enabled;
},
},
getters: {
... ... @@ -147,7 +143,7 @@ export default function(mergeState = {}) {
return state.context.isLogin;
},
isQiugouEnabled(state) {
return state.sysConfig.enableQiugou;
return state.context.enableQiugou;
},
},
actions: {
... ... @@ -229,10 +225,10 @@ export default function(mergeState = {}) {
// /ufo-gateway/?method=ufo.resource.getConfigTypeContent&code=bid_switch_h5
// {"alg":"SALT_MD5","code":200,"data":"1","md5":"c13a1ace2c5883be18643551bd17ebcd","message":"操作成功"}
// H5是否打开求购 1代表打开
let isEnabled = !!state.sysConfig.enableQiugou;
let isEnabled = !!state.context.enableQiugou;
if (state.sysConfig.enableQiugou === null) {
const resp = await this.$api.get('/api/sys/config', {
if (state.context.enableQiugou === null) {
const resp = await this.$api.post('/api/sys/config', {
code: 'bid_switch_h5',
});
... ...
... ... @@ -34,12 +34,6 @@ const initClient = (store) => {
}
};
img.src = 'data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA';
Vue.$sdk.getUser().then(user => {
if (user && user.uid) {
store.commit('SET_LOGIN_INFO', user);
}
});
};
export {
... ...
... ... @@ -58,14 +58,14 @@ module.exports = {
'/api/ufo/mine/order/summary': {
ufo: true,
auth: true,
path: '/ufo-gateway/shopping',
path: 'shopping',
api: 'ufo.order.summary',
params: {},
},
'/api/ufo/mine/coupon': {
ufo: true,
auth: true,
path: '/ufo-gateway/coupon',
path: 'coupon',
api: 'ufo.coupons.cnt',
params: {},
},
... ...
... ... @@ -13,7 +13,7 @@ const sign = global.yoho.sign;
const config = global.yoho.config;
const loginPage = '//m.yohobuy.com/signin.html';
const homePage = `${config.siteUrl}/xianyu/channel`;
const homePage = `${config.siteUrl}/xianyu/index/channel`;
const URL_BIND_KEY = 'bind_code';
const MAX_MSG_SEND_TIMES = 20;
... ... @@ -179,14 +179,21 @@ const login = {
sourceTypeSecond: req.yoho.isAliApp ? 'xianyu' : ''
}).then(result => {
let redirectUrl = loginPage;
let referUrl = {};
if (req.cookies.third_backurl) {
redirectUrl += '?refer=' + encodeURIComponent(handleReferUrl(req.cookies.third_backurl));
if (req.cookies.ali_backurl) {
try {
referUrl = JSON.parse(req.cookies.ali_backurl);
} catch(e) {
log.debug(JSON.stringify(e));
}
redirectUrl += '?refer=' + encodeURIComponent(handleReferUrl(referUrl.b || ''));
}
if (result.code === 200) {
if (_.get(result, 'data.is_bind') === 'N') {
redirectUrl = req.cookies.third_backurl ? req.cookies.third_backurl : homePage;
redirectUrl = referUrl.b ? referUrl.b : homePage;
redirectUrl += redirectUrl.indexOf('?') > 0 ? '&' : '?';
redirectUrl += URL_BIND_KEY + '=' + encodeURIComponent(aes.dynamicEncryption(`taobao::${user.open_uid}`));
} else if (+_.get(result, 'data.uid') > 0) {
... ... @@ -199,7 +206,7 @@ const login = {
res.cookie('third_backurl', '', {
domain: 'yohobuy.com'
});
return res.redirect(handleReferUrl(req.cookies.third_backurl ? req.cookies.third_backurl : homePage));
return res.redirect(handleReferUrl(referUrl.s ? referUrl.s : homePage));
});
}
} else {
... ... @@ -251,8 +258,8 @@ const bind = {
req.ctx(passportModel).sendTaobaoBindCode(mobile, req.yoho.isAliApp ? 'xianyu' : '').then(res.json).catch(next);
} else {
res.json({
code: 200,
message: `${info.type || ''} not found`
code: 403,
message: '关联信息异常'
});
}
},
... ...
{
"name": "xianyu-ufo-app-web",
"version": "0.0.2-beta-31",
"version": "0.0.2-beta-33",
"private": true,
"description": "Xianyu Project With Express",
"repository": {
... ...