Authored by baoss

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

... ... @@ -7,7 +7,7 @@
</template>
<script>
import {mapState} from 'vuex';
import {mapState, mapMutations} from 'vuex';
export default {
name: 'App',
... ... @@ -29,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) {
... ... @@ -40,6 +48,9 @@ export default {
this.$yoho.auth({ needLogin: newVal });
}
},
},
methods: {
...mapMutations(['SET_LOGIN_INFO'])
}
};
</script>
... ...
... ... @@ -105,6 +105,11 @@ export default {
this.sendBindSms({
mobile: this.phone,
bindCode: this.bindCode
}).then(res => {
if (res.code !== 200) {
this.clearSendTimer();
this.toast(res.message || '发送失败');
}
});
},
clearSendTimer() {
... ...
... ... @@ -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);
... ...
... ... @@ -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" />
... ...
... ... @@ -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);
... ...
<!--买家求购确认页-->
<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">
... ... @@ -440,10 +440,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;
... ...
... ... @@ -96,6 +96,13 @@ export default {
}
},
deep: true
},
watch: {
'yoho.context.isLogin': function(newVal) {
if (newVal) {
this.init();
}
},
}
},
methods: {
... ... @@ -309,6 +316,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 {
... ...
<!--卖家求购变现-->
<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;
}
... ...
... ... @@ -2,7 +2,7 @@
<LayoutApp :show-back="true" title="出售" :back-action="backAction">
<div class="body">
<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"
... ... @@ -110,9 +110,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 +151,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 +387,11 @@ export default {
padding: 0 50px;
}
.product-info {
height: 240px;
margin-bottom: 20px;
}
.submit-btn {
height: 80px;
line-height: 80px;
... ...
... ... @@ -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);
... ...
... ... @@ -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) {
... ...
... ... @@ -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 {
... ...
... ... @@ -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 {
... ... @@ -252,7 +259,7 @@ const bind = {
} else {
res.json({
code: 200,
message: `${info.type || ''} not found`
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": {
... ...