Authored by lea guo

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

... ... @@ -113,8 +113,10 @@ export default {
beforeRouteEnter(to, from, next) {
next(vm => {
// 通过 `vm` 访问组件实例
vm.query = from.query;
vm.pageName = from.name;
if (from.name !== "addressEdit") {
vm.query = from.query;
vm.pageName = from.name;
}
});
}
};
... ...
<template>
<LayoutApp>
<div class="tab">
<div class="item right-line" :class="type ==='unused' ? 'item-selected' : 'item-default'"
@click="onChangeList('unused')">未使用{{unused.length && '('+ unused.length + ')'}}
</div>
<div class="item right-line" :class="type ==='used' ? 'item-selected' : 'item-default'"
@click="onChangeList('used')">已使用{{used.length && '('+ used.length + ')'}}
</div>
<div class="item" :class="type ==='overtime' ? 'item-selected' : 'item-default'"
@click="onChangeList('overtime')">已失效{{overtime.length && '('+ overtime.length + ')'}}
</div>
</div>
<Scroll class="coupon-list"
:options="scrollOptions"
:data="list"
@pulling-up="onPullingUp">
<div class="item" v-for="(item,index) in list">
<div :class="type === 'unused' ? 'item-bg' : 'item-gray-bg'">
<div class="item-left">
<div class="item-price" :class="type !== 'unused' && 'gray'">{{item.coupon_value}}</div>
<div class="item-rule" v-if="item.use_rule" :class="type !== 'unused' && 'gray'">{{item.use_rule}}</div>
</div>
<div class="item-right">
<div class="item-name" :class="type !== 'unused' && 'gray'">
<span class="item-type" :class="type !== 'unused' && 'gray'">[{{item.coupon_type_name}}]</span>
{{item.coupon_name}}
</div>
<div class="item-time" :class="type !== 'unused' && 'gray'">{{item.coupon_validity}}</div>
<div class="item-desc-btn" :class="type !== 'unused' && 'gray'">使用说明</div>
<div class="time-up" v-if="item.is_expired_soon === 'Y'"></div>
<div class="item-used-flag" v-if="type === 'used'"></div>
<div class="item-overtime-flag" v-if="type === 'overtime'"></div>
</div>
</div>
</div>
</Scroll>
</LayoutApp>
</template>
<script>
export default {
name: "list"
}
import {Scroll} from 'cube-ui';
import {createNamespacedHelpers} from 'vuex';
const {mapState, mapActions} = createNamespacedHelpers('home/coupon');
export default {
name: 'Coupon',
components: {Scroll},
activated: function() {
this.fetchCouponList({type: 'unused', isReset: true}).then(r => {
this.list = r;
});
this.fetchCouponList({type: 'used', isReset: true});
this.fetchCouponList({type: 'overtime', isReset: true});
},
data() {
return {
scrollOptions: {
bounce: {
top: false
},
pullUpLoad: true
},
type: 'unused',
list: []
};
},
methods: {
...mapActions(['fetchCouponList']),
onChangeList(type) {
// 切换tab
this.type = type;
// 切换list
this.list = this[type].list;
},
async onPullingUp() {
this.list = await this.fetchCouponList({type: this.type});
},
},
computed: {
...mapState(['unused', 'used', 'overtime']),
},
};
</script>
<style scoped>
<style lang="scss" scoped>
.tab {
display: flex;
width: 100%;
height: 88px;
padding: 14px 0;
align-items: center;
.item {
font-size: 28px;
flex: 1;
height: 60px;
text-align: center;
line-height: 60px;
}
.right-line {
border-left: 1px solid #E0E0E0;
}
.item-default {
color: #B0B0B0;
}
.item-selected {
color: #444444;
}
}
.coupon-list {
background: #f5f5f5;
.item {
width: 100%;
margin-top: 20px;
}
.item-bg {
background: url(~statics/image/coupon/bg@3x.png) no-repeat;
width: 710px;
height: 200px;
background-size: cover;
margin: 0 auto;
display: flex;
position: relative;
}
.item-left {
width: 230px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.item-price {
font-size: 72px;
color: #002B47;
}
.item-rule {
font-size: 24px;
margin-top: 4px;
color: #002B47;
}
}
.item-right {
margin-left: 6px;
.item-name {
font-size: 24px;
color: #222;
margin-top: 22px;
}
.item-type {
color: #002B47;
}
.item-time {
margin-top: 36px;
font-size: 22px;
color: #999;
}
.item-desc-btn{
margin-top: 26px;
font-size: 22px;
color: #999;
}
.time-up {
background: url(~statics/image/coupon/time-up@3x.png) no-repeat;
background-size: cover;
position: absolute;
top: 0;
right: 0;
width: 80px;
height: 80px;
}
.item-used-flag {
background: url(~statics/image/coupon/used@3x.png) no-repeat;
background-size: cover;
position: absolute;
right: 30px;
width: 130px;
height: 130px;
top: 30px;
}
.item-overtime-flag {
background: url(~statics/image/coupon/overtime@3x.png) no-repeat;
background-size: cover;
position: absolute;
right: 30px;
width: 130px;
height: 130px;
top: 30px;
}
}
.gray {
color: #ccc;
}
.item-gray-bg {
background: url(~statics/image/coupon/bg-gray@3x.png) no-repeat;
width: 710px;
height: 200px;
background-size: cover;
margin: 0 auto;
display: flex;
position: relative;
}
}
</style>
... ...
... ... @@ -3,78 +3,10 @@ import Trade from './tradeIncome';
import Favorite from './favorite';
import news from './news';
import Income from './income';
import Coupon from './coupon';
export default [
{
name: 'IndexPage',
path: '/xianyu/index',
component: () => import(/* webpackChunkName: "index" */ './indexPage/index-page'),
redirect: { name: 'ChannelPage' },
props: (route) => {
switch (route.name) {
case 'ChannelPage': {
return {
tabIndex: 0
};
}
case 'CategoryPage': {
return {
tabIndex: 1
};
}
case 'NewsPage': {
return {
tabIndex: 2
};
}
case 'MinePage': {
return {
tabIndex: 3
};
}
default: {
return {
tabIndex: 0
};
}
}
},
children: [
{
name: 'ChannelPage',
path: 'channel',
component: () => import(/* webpackChunkName: "index" */ './channel/channel'),
props: () => ({
hideHeader: true,
}),
},
{
name: 'CategoryPage',
path: 'category',
component: () => import(/* webpackChunkName: "index" */ '../category/category'),
props: () => ({
hideHeader: true,
}),
},
{
name: 'NewsPage',
path: 'news',
component: () => import(/* webpackChunkName: "index" */ './news/news'),
props: () => ({
hideHeader: true,
}),
},
{
name: 'MinePage',
path: 'mine',
component: () => import(/* webpackChunkName: "index" */ './mine/mine'),
props: () => ({
hideHeader: true,
}),
},
]
},
{
name: 'channel',
path: '/xianyu/channel',
component: () => import(/* webpackChunkName: "channel" */ './channel/channel')
... ... @@ -83,5 +15,6 @@ export default [
...Mine,
...Trade,
...Favorite,
...Income
...Income,
...Coupon
];
... ...
... ... @@ -33,11 +33,19 @@ export default {
break;
}
case 2: {
this.go('NewsPage');
this.$yoho.auth().then((res) => {
if(res) {
this.go('NewsPage');
}
})
break;
}
case 3: {
this.go('MinePage');
this.$yoho.auth().then((res) => {
if(res) {
this.go('MinePage');
}
})
break;
}
default: {
... ...
... ... @@ -11,7 +11,7 @@
<div class="pro-info">
<p class="pro-name">{{productInfo.productName}}</p>
<p class="stock-info">
<Logo :text="`有货UFO`" class="logo-wrapper"></Logo>
<!-- <Logo :text="`有货UFO`" class="logo-wrapper"></Logo>-->
<p class="stock-text">{{productInfo.colorName}}, {{productInfo.sizeNum}}个尺码, {{productInfo.storageNum}}个商品库存<p>
</p>
</div>
... ... @@ -255,7 +255,7 @@ export default {
}
.stock-text {
text-indent: 128px;
/*text-indent: 128px;*/
font-size: 28px;
font-weight: 600;
line-height: 44px;
... ...
... ... @@ -2,10 +2,10 @@
<LayoutApp :title="title">
<div class="order-page">
<div class="product">
<ImgSize class="pro-img" :src="noEntryOrderInfo.goodsInfo.goodImg || ''" :width="200" :height="200"></ImgSize>
<ImgSize class="pro-img" :src="goodsInfo.goodImg || ''" :width="200" :height="200"></ImgSize>
<div class="pro-info">
<p class="pro-name">{{noEntryOrderInfo.goodsInfo.colorName}}, {{noEntryOrderInfo.goodsInfo.sizeName}}码</p>
<p class="stock-info ufo-font">最低售价: ¥{{noEntryOrderInfo.goodsInfo.leastPrice || noEntryOrderInfo.goodsInfo.price}}</p>
<p class="pro-name">{{goodsInfo.colorName}}, {{goodsInfo.sizeName}}码</p>
<p class="stock-info ufo-font">最低售价: ¥{{goodsInfo.leastPrice || '-'}}</p>
</div>
</div>
<div class="input-container">
... ... @@ -37,12 +37,12 @@
<i class="iconfont iconaddress"></i>
</div>
<div class="address-info">
<p class="user-name">{{noEntryOrderInfo.userAddress.consignee}}</p>
<p class="user-name">{{userAddress.consignee}}</p>
<p class="user-address">
{{noEntryOrderInfo.userAddress.area}} {{noEntryOrderInfo.userAddress.address}}
{{userAddress.area}} {{userAddress.address}}
</p>
<p class="user-phone">
{{noEntryOrderInfo.userAddress.mobile}}
{{userAddress.mobile}}
</p>
</div>
</div>
... ... @@ -95,7 +95,7 @@ import Modal from './components/modal';
import OrderCheck from '../components/confirm/agree';
const {mapState, mapActions} = createNamespacedHelpers('order/priceChange');
// orderCode = 1233499619151
export default {
name: 'noEntryDetail',
components: {OrderCheck, Modal, InputUfo, ScrollView, LayoutApp, ImgSize, Checkbox},
... ... @@ -132,7 +132,13 @@ export default {
// this.inputChange = debounce(this.onChange.bind(this), 500);
},
computed: {
...mapState(['noEntryOrderInfo'])
...mapState(['noEntryOrderInfo']),
goodsInfo() {
return this.noEntryOrderInfo.goodsInfo || {};
},
userAddress() {
return this.noEntryOrderInfo.userAddress || {};
}
},
watch: {
chgPrice() {
... ... @@ -188,7 +194,7 @@ export default {
onCancel: () => {
this.onPriceChangeConfirm({
price: this.chgPrice,
skup: this.noEntryOrderInfo.goodsInfo.skup
skup: this.goodsInfo.skup
});
}
... ... @@ -198,7 +204,7 @@ export default {
async calcPrice(price) {
const result = await this.postNoEntryCalcPrice({
price: price,
skup: this.noEntryOrderInfo.goodsInfo.skup
skup: this.goodsInfo.skup
});
console.log(result);
... ... @@ -259,6 +265,18 @@ export default {
orderCode: result.data.orderCode,
price: price,
desc: '保证金',
extra: JSON.stringify({
type: 'sell',
back: {
name: 'InSaleOrderList'
},
forward: {
name: 'SellPayOk',
query: {
orderCode: result.data.orderCode
}
}
}),
onCloseAction() {
that.clearData();
that.$router.replace({
... ... @@ -279,6 +297,7 @@ export default {
// console.log(result);
},
clearData() { // 清空数据状态
console.log(this.$router);
this.platformFeeModalVisible = false;
this.platformFee = {
amount: '-¥0',
... ...
... ... @@ -54,7 +54,7 @@ export default function() {
let params = {
page: couponData.page,
limit: couponData.limit,
type: couponData.limit,
type: couponData.type,
};
if (param.isReset) {
... ... @@ -63,7 +63,7 @@ export default function() {
params.page += 1;
}
params.uid = uid;
let result = await this.$api.get('api/ufo/coupon/list', {...params});
let result = await this.$api.get('/api/ufo/coupon/list', {...params});
if (result.code === 200) {
let data = result.data;
... ... @@ -82,7 +82,7 @@ export default function() {
commit('addList', { data: couponData });
}
}
return result.data || [];
return couponData.list || [];
},
},
};
... ...
... ... @@ -5,7 +5,7 @@ import moment from 'moment';
import { sellerOrderStatus, ownType } from '../../../constants/order-constants';
// const uid = '600046428';
const uid = '500031424';
// const uid = '500031424';
const MINE_RESOURCE_CODE1 = '11a73219a63b50067d88e75c0fe04d10';
const MINE_RESOURCE_CODE2 = 'dc2731fbbebcba6329c74a379e9c41ec';
... ... @@ -296,11 +296,9 @@ export default function() {
async fetchResource({ commit }) {
const result = await this.$api.get('/api/ufo/mine/resource', {
content_code: MINE_RESOURCE_CODE1,
uid,
});
const result1 = await this.$api.get('/api/ufo/mine/resource', {
content_code: MINE_RESOURCE_CODE2,
uid,
});
if (result.code === 200) {
... ... @@ -327,7 +325,6 @@ export default function() {
async fetchSellerOrder({ commit }) {
const result = await this.$api.get(
'/api/ufo/mine/seller/orderSummary',
{ uid },
);
if (result.code === 200) {
... ... @@ -335,9 +332,7 @@ export default function() {
}
},
async fetchFavoriteNum({ commit }) {
const result = await this.$api.get('/api/ufo/mine/favoriteNum', {
uid,
});
const result = await this.$api.get('/api/ufo/mine/favoriteNum');
if (result.code === 200) {
commit('addFavoriteNum', {
... ... @@ -346,16 +341,14 @@ export default function() {
}
},
async fetchOrderSummary({ commit }) {
const result = await this.$api.get('/api/ufo/mine/order/summary', {
uid,
});
const result = await this.$api.get('/api/ufo/mine/order/summary');
if (result.code === 200) {
commit('addOrderSummary', { data: result.data });
}
},
async fetchCoupon({commit}) {
const result = await this.$api.get('/api/ufo/mine/coupon', {uid});
const result = await this.$api.get('/api/ufo/mine/coupon');
if (result.code === 200) {
commit('addCouponSummary', { count: result.data});
... ... @@ -380,7 +373,6 @@ export default function() {
const result = await this.$api.get('/api/ufo/mine/assets', {
page,
limit: pageSize,
uid,
});
// commit('assetFetching', {isFetching: false});
... ... @@ -421,7 +413,6 @@ export default function() {
const result = await this.$api.get('/api/ufo/mine/wallet', {
page,
limit: pageSize,
uid,
tradeType,
startTime,
endTime,
... ... @@ -441,18 +432,14 @@ export default function() {
},
async fetchUserWalletInfo({ commit }) {
const result = await this.$api.get('/api/ufo/mine/userWalletInfo', {
uid,
});
const result = await this.$api.get('/api/ufo/mine/userWalletInfo');
if (result.code === 200) {
commit('addUserWalletInfo', result.data);
}
},
async fetchWalletFilter({ commit }) {
const result = await this.$api.get('/api/ufo/mine/walletFilter', {
uid,
});
const result = await this.$api.get('/api/ufo/mine/walletFilter');
if (result.code === 200) {
commit('addfilterData', result.data);
... ...
... ... @@ -71,88 +71,11 @@ export default {
order: result
});
} else {
result = {
"alg": "SALT_MD5",
"code": 200,
"data": {
"attributes": 1,
"bankTransferFee": "-¥0.19",
"bidType": 0,
"buttons": [{
"code": "not_sold",
"confirmTips": "您确定不卖此商品么?取消后保证金将原路退还至您的账户",
"name": "NOT_SOLD",
"text": "不卖了"
}, {
"code": "not_entry_change_price",
"name": "NOT_ENTRY_CHANGE_PRICE",
"text": "调价"
}],
"createTime": "2019-10-09 18:01:23",
"earnestMoney": 0.76,
"earnestMoneyStr": "¥0.76",
"goodsInfo": {
"batchNo": 1233499619151,
"bidType": 0,
"colorName": "黑色",
"entryFlag": false,
"goodImg": "http://img11.static.yhbimg.com/goodsimg/2019/02/25/10/018b0d26a7e4bc0b39a93c329dd8c13d8e.jpg?imageMogr2/thumbnail/{width}x{height}/background/d2hpdGU=/position/center/quality/80",
"goodPrice": "19.00",
"leastPrice": 19.00,
"leastPriceOfSkuTips": "最低现货价¥19",
"price": 19.00,
"productId": 10001266,
"productName": "Air Jordan 1 复刻黑绿脚趾 范闲",
"sizeName": "37",
"skup": 19466,
"storageId": 10090816
},
"income": "¥18.79",
"isAdvance": "N",
"isPaid": 1,
"orderCode": 1233499619151,
"payStartTime": 1570615283,
"payment": 9,
"paymentStr": "手机网站支付宝",
"platformFee": {
"amount": "-¥0.02",
"appraiseFee": "¥0.01",
"goodsPaymentRatePercent": "0.00%",
"packageFee": "¥0.01",
"payChannelPercentage": "1.00%",
"serviceFee": "¥0.00"
},
"secendLevelCreateTime": 1570615283,
"statusDetail": {
"detailDesc": "商品出售中,待买家购买",
"expressShow": false,
"paymentTips": "交易成功后自动退还",
"statuStr": "出售中",
"status": 1
},
"submitOrderTimeStr": "2019-10-09 18:01:23",
"uid": 349709,
"userAddress": {
"address": "嘉陵江东街18号南京国家广告产****17楼",
"address_id": 2396242,
"area": "江苏省 南京市 建邺区 建邺区新城科技园",
"areaCode": "320105400",
"consignee": "*骏",
"isUpdate": "N",
"mobile": "138****0257",
"phone": "",
"zipCode": ""
}
},
"md5": "ab14db14196b6213d05d288179ecf9e2",
"message": "订单详情"
};
commit(Types.FETCH_NOENTRY_ORDER_PRODUCT_SUCCESS, {
/*commit(Types.FETCH_NOENTRY_ORDER_PRODUCT_SUCCESS, {
order: result
});
});*/
// commit(Types.FETCH_NOENTRY_ORDER_PRODUCT_FAILED);
commit(Types.FETCH_NOENTRY_ORDER_PRODUCT_FAILED);
}
},
... ...
... ... @@ -13,7 +13,9 @@ export default function() {
productInfo: {}, // 商品详情
skcs: [], // 商品下包含的出售尺码相关信息
noEntryOrderInfo: {
goodsInfo: {}
goodsInfo: {
goodImg: ''
}
},
},
actions,
... ...
module.exports = {
'/api/address/gethidden': {
auth: true,
api: 'app.address.gethidden',
params: {}
},
'/api/address/getTags': {
auth: true,
api: 'app.address.getTags',
params: {}
},
'/api/address/getProvinces': {
auth: true,
api: 'app.address.provinces',
params: {}
},
'/api/address/addAddress': {
auth: true,
api: 'app.address.add',
params: {}
},
'/api/address/updateAddress': {
auth: true,
api: 'app.address.update',
params: {}
},
'/api/address/delAddress': {
auth: true,
api: 'app.address.del',
params: {}
},
'/api/address/setDefaultAddress': {
auth: true,
api: 'app.address.setdefault',
params: {}
},
... ...
... ... @@ -107,16 +107,15 @@ module.exports = {
uid: { type: Number },
},
},
'api/ufo/coupon/list': {
'/api/ufo/coupon/list': {
ufo: true,
// auth: true,
path: '/ufo-gateway/coupon',
api: 'ufo.coupons.list',
param: {
uid: { type: Number },
page: {type: Number},
limit: {type: Number},
type: {type: Number}
type: {type: String},
uid: { type: Number },
}
},
};
... ...
... ... @@ -44,7 +44,8 @@ module.exports = (req, res, next) => {
};
}
// Todo 删除 600032996
// Todo 删除 600032996 调价: 500031170 购买: 600043484
// req.user.uid = 600043484;
res.locals.isLogin = Boolean(req.user.uid); // 用户是否登录
if (_.get(req, 'user.appSessionType') === 'miniapp') {
... ...