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
huangyCode
5 years ago
Commit
48de1790cd9e8564cf3db7b48a7ed6bd04bc4959
2 parents
a1db97ad
48295756
Merge branch 'develop' of
http://git.yoho.cn/fe/xianyu-ufo-app-web
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
185 additions
and
101 deletions
apps/pages/address/address/addressEdit.vue
apps/pages/home/news/components/tab.vue
apps/pages/home/news/index.js
apps/pages/home/news/news.vue
apps/pages/home/news/newsDetail.vue
apps/pages/order/buyer-ask-order.vue
apps/pages/order/components/confirm/product.vue
apps/pages/order/order-logistics-info.vue
apps/pages/order/seller-ask-order.vue
apps/pages/product/components/buy-sheet.vue
apps/pages/product/components/size-select-sheet.vue
apps/store/order/buyer-ask-order.js
doraemon/models/passport.js
package.json
apps/pages/address/address/addressEdit.vue
View file @
48de179
<template>
<LayoutApp :title="title" :show-back="true">
<div class="pane-body">
<FormItem>
<CInput
label="收货人"
place-holder="请写姓名"
v-model="model.consignee"
:textValue="model.consignee"
type="text"
></CInput>
</FormItem>
<FormItem>
<CInput label="手机号" place-holder="请填写手机号" v-model="model.mobile" :textValue="model.mobile"></CInput>
</FormItem>
<template>
<Scroll ref="scroll" :options="scrollOpts">
<div class="pane-body">
<FormItem>
<div class="wrapper-area">
<label class="input-label">所在区域</label>
<div class="wrapper-arrow" @click="chooseArea">
<template v-if="model.area">
<label class="text-label">{{ model.area }}</label>
</template>
<template v-else>
<label class="choose-area">请选择</label>
</template>
<div class="arrow"></div>
<CInput
label="收货人"
place-holder="请写姓名"
v-model="model.consignee"
:textValue="model.consignee"
type="text"
></CInput>
</FormItem>
<FormItem>
<CInput
label="手机号"
place-holder="请填写手机号"
v-model="model.mobile"
:textValue="model.mobile"
></CInput>
</FormItem>
<template>
<FormItem>
<div class="wrapper-area">
<label class="input-label">所在区域</label>
<div class="wrapper-arrow" @click="chooseArea">
<template v-if="model.area">
<label class="text-label">{{ model.area }}</label>
</template>
<template v-else>
<label class="choose-area">请选择</label>
</template>
<div class="arrow"></div>
</div>
</div>
</div>
</FormItem>
</template>
<FormItem>
<CInput
label="详细地址"
place-holder="请输入详细地址"
v-model="model.address"
:textValue="model.address"
></CInput>
</FormItem>
</template>
<FormItem>
<CInput
label="详细地址"
place-holder="请输入详细地址"
v-model="model.address"
:textValue="model.address"
></CInput>
</FormItem>
<!-- 订单修改地址隐藏 -->
<div v-if="!orderCode" class="wrapper-tag">
<p class="tag-text">设置标签:</p>
<RadioGroup class="wrapper-radio">
<div v-for="(tag, index) in addressTags" :key="index">
<Radio
class="tag-radio"
:label="{ text: `${tag.name}`, value: `${tag.code}` }"
v-model="model.tag_code"
checked="tag.code === model.tag_code"
></Radio>
</div>
</RadioGroup>
</div>
<!-- 订单修改地址隐藏 -->
<div v-if="!orderCode" class="wrapper-del">
<Radio
class="radio"
:label="{ text: '设为默认地址', value: true }"
style="flex: 0 1 100%;"
checked="model.is_default"
v-model="model.is_default"
></Radio>
<div v-if="isUpdate" class="del-address" @click="delAddress">删除地址</div>
<!-- 订单修改地址隐藏 -->
<div v-if="!orderCode" class="wrapper-tag">
<p class="tag-text">设置标签:</p>
<RadioGroup class="wrapper-radio">
<div v-for="(tag, index) in addressTags" :key="index">
<Radio
class="tag-radio"
:label="{ text: `${tag.name}`, value: `${tag.code}` }"
v-model="model.tag_code"
checked="tag.code === model.tag_code"
></Radio>
</div>
</RadioGroup>
</div>
<!-- 订单修改地址隐藏 -->
<div v-if="!orderCode" class="wrapper-del">
<Radio
class="radio"
:label="{ text: '设为默认地址', value: true }"
style="flex: 0 1 100%;"
checked="model.is_default"
v-model="model.is_default"
></Radio>
<div v-if="isUpdate" class="del-address" @click="delAddress">删除地址</div>
</div>
</div>
<div :class="submitClass" @touchend="onSubmit">确 认</div>
</div>
</Scroll>
<AddressAct
class="address-act"
ref="addressAct"
v-show="isShowProvince"
@popHidden="popHidden"
...
...
@@ -84,6 +90,7 @@ import FormItem from "./components/form-item";
import Radio from "./components/radio";
import AddressAct from "./components/address-act";
import RadioGroup from "./components/radio-group";
import { Scroll } from "cube-ui";
import { createNamespacedHelpers } from "vuex";
const { mapState, mapMutations, mapActions } = createNamespacedHelpers(
...
...
@@ -98,10 +105,14 @@ export default {
FormItem,
Radio,
AddressAct,
RadioGroup
RadioGroup,
Scroll
},
data() {
return {
scrollOpts: {
bounce: false
},
isShowProvince: false,
isUpdate: false,
updateMobileNum: "",
...
...
@@ -332,9 +343,27 @@ export default {
</script>
<style lang="scss" scoped>
/deep/ {
.cube-scroll-content {
min-height: 100%;
}
.cube-scroll-list-wrapper {
overflow: auto;
}
.cube-loading-spinners {
margin: auto;
}
}
.address-act {
z-index: 99;
}
.pane-body {
height: 100%;
overflow-y:
hidden
;
overflow-y:
auto
;
padding-top: 12px;
padding-left: 40px;
padding-right: 40px;
...
...
apps/pages/home/news/components/tab.vue
View file @
48de179
...
...
@@ -26,8 +26,10 @@ export default {
},
methods: {
jump(item) {
const { type, description } = item;
console.log(item);
let { type, description } = item;
this.$router.push({name:'newsDetail',query: {type,description}})
this.$emit('clearStore',1);
}
}
};
...
...
apps/pages/home/news/index.js
View file @
48de179
...
...
@@ -2,7 +2,7 @@ export default [
{
name
:
'news'
,
path
:
'/xianyu/news'
,
component
:
()
=>
import
(
/* webpackChunkName: "news" */
'./news'
)
component
:
()
=>
import
(
/* webpackChunkName: "news" */
'./news'
)
,
},
{
name
:
'newsDetail'
,
...
...
apps/pages/home/news/news.vue
View file @
48de179
...
...
@@ -7,7 +7,9 @@
@pulling-up="onPullingUp"
:data="newsList.list">
<div class="news-content">
<Tab v-if="newsList.tabList.length > 0" :list="newsList.tabList"></Tab>
<Tab
v-if="newsList.tabList.length > 0" :list="newsList.tabList"
@clearStore="clearStoreData"></Tab>
<List v-if="newsList.list.length > 0" :list="newsList && newsList.list || []"></List>
<UfoNoItem v-else :tip="`暂无数据`"></UfoNoItem>
</div>
...
...
@@ -30,9 +32,6 @@ export default {
data() {
return {
options: {
// bounce: {
// top: false
// },
pullUpLoad: true
},
msg: '消息',
...
...
@@ -62,6 +61,10 @@ export default {
};
await this.fetchNewsList(params);
this.$refs.scroll.forceUpdate();
},
clearStoreData(index) {
console.log(index);
}
},
watch:{
...
...
apps/pages/home/news/newsDetail.vue
View file @
48de179
...
...
@@ -28,9 +28,6 @@ export default {
data() {
return {
options: {
// bounce: {
// top: false
// },
pullUpLoad: true
},
title: '',
...
...
@@ -41,6 +38,7 @@ export default {
...mapState(['newsList','newsDeatilList']),
},
activated() {
console.log('111');
let params = {
type: this.type,
isPage: true
...
...
@@ -51,9 +49,6 @@ export default {
this.title = this.$route.query.description;
this.type = this.$route.query.type;
},
activated() {
},
methods: {
...mapActions(['fetchNewsList']),
async onPullingUp() {
...
...
apps/pages/order/buyer-ask-order.vue
View file @
48de179
...
...
@@ -14,8 +14,14 @@
<div class="productPrice">
<span class="size">{{sizeInfo}}</span>
<div class="pricedetail">
<span class="priceTitle">最低售价: </span>
<span class="price">{{originProductData.least_price || '-'}}</span>
<div>
<span class="priceTitle">最低售价: </span>
<span class="price">{{originProductData.least_price || '-'}}</span>
</div>
<div>
<span class="priceTitle">最高求购价: </span>
<span class="price">{{originProductData.bid_moster_price || '-'}}</span>
</div>
</div>
</div>
</div>
...
...
@@ -97,7 +103,7 @@ export default {
return {
inputPrice: '',
isAgreeTerms: false,
url:
`http://m.yohobuy.com/activity/student/detail/renzhen?openby:yohobuy={\"action\":\"go.h5\",\"params\":{\"url\":\"https://activity.yoho.cn/feature/3189.html?title=买家协议&promiseV="}}`
,
url:
'http://m.yohobuy.com/activity/student/detail/renzhen?openby:yohobuy={\"action\":\"go.h5\",\"params\":{\"url\":\"https://activity.yoho.cn/feature/3189.html?title=买家协议&promiseV="}}'
,
agreeDesc: '有货买家协议'
};
},
...
...
@@ -123,19 +129,29 @@ export default {
sizeInfo: {
get() {
return this.originProductData.colorName + ', ' + this.originProductData.sizeName + '码';// '黑色, 48码';
}
}
},
},
beforeRouteEnter (to, from, next) {
next(vm => {
// 通过 `vm` 访问组件实例
vm.inputPrice = '';
vm.BUYER_ASK_RESET_DATA();
});
},
mounted() {
this.BUYER_ASK_RESET_DATA();
this.BUYER_ASK_SET_STORAGEID(this.storageId);
this.fetchBuyerOrderCount({ tabType: 'buy'});
this.fetchConfig();
this.$on("addressinfo", function (address) {
console.log(address)
})
this.$on('addressinfo', function(address) {
console.log(address);
});
},
watch: {
...
...
@@ -150,6 +166,14 @@ export default {
if (val) {
this.showDialog();
}
},
addressInfo(val) {
if (this.inputPrice && val) {
this.computePrice();
}
}
},
...
...
@@ -173,7 +197,7 @@ export default {
if (this.originProductData.least_price && this.originProductData.skup && this.originProductData.least_price <= this.inputPrice) {
this.showBuyDialog();
} else {
this.
buyerCompute({price: this.inputPrice, storage_id: this.storageId }
);
this.
computePrice(
);
}
}, 500, {leading: false, trailing: true}),
...
...
@@ -214,7 +238,7 @@ export default {
});
},
onCancel: () => {
this.
buyerCompute({price: this.inputPrice, storage_id: this.storageId }
);
this.
computePrice(
);
}
}).show();
},
...
...
@@ -241,7 +265,7 @@ export default {
},
onConfirm: () => {
this.publishProduct()
this.publishProduct();
},
onCancel: () => {
...
...
@@ -250,23 +274,32 @@ export default {
}).show();
} else {
this.publishProduct()
this.publishProduct()
;
}
},
submitClick() {
this.buyerPrePublish({price: this.inputPrice,
storage_id: this.storageId, address_id: this.addressInfo.address_id});
this.buyerPrePublish({price: this.inputPrice, storage_id: this.storageId, address_id: this.addressInfo.address_id});
},
publishProduct() {
this.buyerPublish({price: this.inputPrice,
storage_id: this.storageId, address_id: this.addressInfo.address_id, time_limit_id: this.chooseDayId}).then(() => {
this.buyerPublish({price: this.inputPrice, storage_id: this.storageId, address_id: this.addressInfo.address_id, time_limit_id: this.chooseDayId}).then(() => {
this.payOrder();
});
},
computePrice() {
if (!this.inputPrice) {
console.log('inputPrice is null')
return;
}
this.buyerCompute({price: this.inputPrice, storage_id: this.storageId, address_id: this.addressInfo.address_id || '' });
},
payOrder() {
let vm = this;
this.$createOrderPayType({
price: get(this.publishresult, 'depositAmount', ''),
desc: '保证金',
...
...
@@ -372,11 +405,8 @@ export default {
}
.pricedetail {
display: flex;
flex-direction: row;
height: 30*2px;
margin-top: 5*2px;
align-items: flex-end;
}
.priceTitle {
...
...
apps/pages/order/components/confirm/product.vue
View file @
48de179
...
...
@@ -5,7 +5,7 @@
<div class="product-price">
<div class="product-price-wrapper">
<div class="price">{{data.colorName}},{{data.sizeName}}</div>
<div class="tip">
最低售价:
<span class="price2">¥{{data.goodPrice}}</span></div>
<div class="tip">
{{ priceType || '最低售价:'}}
<span class="price2">¥{{data.goodPrice}}</span></div>
</div>
</div>
</div>
...
...
@@ -20,6 +20,9 @@ export default {
default() {
return {};
}
},
priceType: {
type: String,
}
}
};
...
...
apps/pages/order/order-logistics-info.vue
View file @
48de179
...
...
@@ -55,6 +55,7 @@
v-for="(imgUrl, i) in miniFaultConfirm.imageUrls"
:key="i"
>
<ImageFormat
:data-secc="imgUrl"
:src="imgUrl"
...
...
apps/pages/order/seller-ask-order.vue
View file @
48de179
...
...
@@ -3,7 +3,7 @@
<LayoutApp :show-back="true">
<div class="body">
<TitleComp txt="变现"></TitleComp>
<ProductInfo :data="originProductData" class="product-info"></ProductInfo>
<ProductInfo :data="originProductData" class="product-info"
:priceType="'最高求购价'"
></ProductInfo>
<div class="inputView">
<span class="inputViewIcon">
¥
...
...
apps/pages/product/components/buy-sheet.vue
View file @
48de179
...
...
@@ -74,6 +74,7 @@ export default {
available: info.storage_num > 0 && price !== '-',
skup: info.skup,
least_price: info.least_price,
bid_moster_price: info.bid_moster_price,
};
});
},
...
...
@@ -111,6 +112,7 @@ export default {
* storageId: number
*/
this.$store.commit('order/buyerAskOrder/BUYER_ASK_SET_PRODUCTINFO', {
bid_moster_price: get(product, 'bid_moster_price', '-'),
least_price: get(product, 'least_price', '-'),
sizeName: product.name,
sizeId: get(data, 'sizeId', ''),
...
...
apps/pages/product/components/size-select-sheet.vue
View file @
48de179
...
...
@@ -186,8 +186,9 @@ export default {
goodImg: get(this.product, 'goods_list[0].image_list[0].image_url', ''),
colorName: get(this.product, 'goods_list[0].color_name', ''),
sizeName: this.sizeName,
goodPrice: get(this.productDetail, 'least_price', 0),
productId: this.product.product_id
goodPrice: get(this.selectedSize, 'bid_moster_price', ''),
productId: this.product.product_id,
bid_moster_price: get(this.selectedSize, 'bid_moster_price', ''),
});
// 跳转变现
this.$router.push({
...
...
apps/store/order/buyer-ask-order.js
View file @
48de179
...
...
@@ -339,12 +339,13 @@ export default function() {
});
},
buyerCompute
({
commit
},
{
price
=
0
,
storage_id
=
0
,
uid
}
=
{})
{
buyerCompute
({
commit
},
{
price
=
0
,
storage_id
=
0
,
uid
,
address_id
=
''
}
=
{})
{
commit
(
BUYER_ASK_COMPUTE_REQUEST
);
this
.
$api
.
get
(
'/api/order/buyeraskcompute'
,
{
uid
,
price
,
storage_id
,
address_id
,
}).
then
(
result
=>
{
if
(
result
.
code
===
200
)
{
...
...
doraemon/models/passport.js
View file @
48de179
...
...
@@ -5,6 +5,7 @@ const uuid = require('uuid');
const
passport
=
require
(
'passport'
);
const
TaobaoStrategy
=
require
(
'./passport-taobao'
);
const
authcode
=
require
(
'../../utils/authcode'
);
const
redis
=
require
(
'../../utils/redis'
);
const
aes
=
require
(
'./aes'
);
const
log
=
global
.
yoho
.
logger
;
...
...
@@ -15,6 +16,7 @@ const loginPage = '//m.yohobuy.com/signin.html';
const
homePage
=
`
$
{
config
.
siteUrl
}
/xianyu/
channel
`
;
const
URL_BIND_KEY
=
'bind_code'
;
const
MAX_MSG_SEND_TIMES
=
20
;
// taobao 登录
passport
.
use
(
'taobao'
,
new
TaobaoStrategy
({
...
...
@@ -226,11 +228,26 @@ const bind = {
return
bindInfo
;
},
sendSms
(
req
,
res
,
next
)
{
async
sendSms
(
req
,
res
,
next
)
{
let
{
mobile
,
bindCode
}
=
req
.
body
||
{};
let
info
=
bind
.
getBindThirdInfo
(
bindCode
);
if
(
info
.
type
===
'taobao'
)
{
const
timeKey
=
`
$
{
config
.
app
}:
bindsms
:
taobao
:
$
{
info
.
openId
}
`
;
let
sendTimes
=
await
redis
.
getAsync
(
timeKey
);
sendTimes
=
(
sendTimes
||
0
)
+
1
;
if
(
sendTimes
>
MAX_MSG_SEND_TIMES
)
{
log
.
info
(
`
[
SMS
delivery
times
exceeded
]
type
:
taobao
|
openId
:
$
{
info
.
openId
}
|
mobile
:
$
{
mobile
}
|
ua
:
$
{
req
.
get
(
'user-agent'
)}
`
);
return
res
.
json
({
code
:
403
,
message
:
'操作频繁,请稍后重试'
});
}
redis
.
setex
(
timeKey
,
60
*
60
*
2
,
sendTimes
);
req
.
ctx
(
passportModel
).
sendTaobaoBindCode
(
mobile
,
req
.
yoho
.
isAliApp
?
'xianyu'
:
''
).
then
(
res
.
json
).
catch
(
next
);
}
else
{
res
.
json
({
...
...
package.json
View file @
48de179
{
"name"
:
"xianyu-ufo-app-web"
,
"version"
:
"0.0.2-beta-1
6
"
,
"version"
:
"0.0.2-beta-1
7
"
,
"private"
:
true
,
"description"
:
"Xianyu Project With Express"
,
"repository"
:
{
...
...
Please
register
or
login
to post a comment