Authored by bevishuang

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

... ... @@ -5,9 +5,9 @@
:width="canvasWidth"
:height="canvasHeight"
:time="time"
:totalTime="totalTime"
:lineWidth="lineWidth"
></canvas>
<p>{{desc}}</p>
</div>
</template>
... ... @@ -16,30 +16,29 @@
/**
* 使用方法, 在对应页面引入CountCircle
* <CountCircle :line-width="6" :time="40000" @on-end="onTimeEnd" style="width: 70px; height: 70px; display: block;"></CountCircle>
* <CountCircle :line-width="6" :time="time" :total-time="totalTime" @on-end="onTimeEnd" style="width: 70px; height: 70px; display: block;"></CountCircle>
* 在自己的页面做定时器,修改time,
*/
export default { // 环形倒计时
name: 'count-circle',
name: 'CountCircle',
props: {
time: {
type: Number,
default: 60000
},
totalTime: {
type: Number,
default: 60000
},
lineWidth: {
type: Number,
default: 8
},
desc: {
type: String,
default: '正在支付中...'
}
},
data() {
return {
canvas: null,
context: null,
totalTime: 60000,
lastTime: 60000,
interval: 100,
circle: {
x: 0,
... ... @@ -62,8 +61,6 @@ export default { // 环形倒计时
},
methods: {
resetCanvas() {
this.totalTime = this.time;
this.lastTime = this.time;
this.canvas = this.$refs.countCanvas;
if (window.devicePixelRatio) {
this.pixelRatio = window.devicePixelRatio;
... ... @@ -78,7 +75,6 @@ export default { // 环形倒计时
y: this.canvasHeight / 2,
radius: this.canvasWidth / 2
};
console.log(this.canvas, this.circle);
},
drawCircle() {
if (this.canvas && this.context) {
... ... @@ -102,32 +98,33 @@ export default { // 环形倒计时
let ctx = this.context;
ctx.save();
ctx.strokeStyle = '#f0f0f0';
ctx.lineCap = 'square';
ctx.lineWidth = this.canvasLineWidth;
if (percent > 0) {
ctx.save();
ctx.strokeStyle = '#f0f0f0';
ctx.lineCap = 'square';
ctx.lineWidth = this.canvasLineWidth;
ctx.beginPath();
ctx.arc(this.circle.x, this.circle.y, (this.circle.radius - this.canvasLineWidth / 2), -Math.PI / 2, Math.PI * ( 2 * percent - 0.5), false);
ctx.stroke();
ctx.closePath();
ctx.restore();
ctx.beginPath();
ctx.arc(this.circle.x, this.circle.y, (this.circle.radius - this.canvasLineWidth / 2), -Math.PI / 2, Math.PI * ( 2 * percent - 0.5), false);
ctx.stroke();
ctx.closePath();
ctx.restore();
}
ctx.save();
ctx.font = 'bold ' + 20 * this.pixelRatio + 'px "ufofont"';
ctx.fillStyle = '#022A47';
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
ctx.fillText(Math.round(this.lastTime / 1000) + 's', this.circle.x, this.circle.y);
ctx.fillText(Math.round(this.time / 1000) + 's', this.circle.x, this.circle.y);
ctx.restore();
setTimeout(this.draw.bind(this), this.interval);
}
},
draw() {
if (this.lastTime > 0) {
this.lastTime -= this.interval;
let percent = 1 - this.lastTime / this.totalTime;
if (this.time > 0) {
let percent = 1 - this.time / this.totalTime;
this.strokeCircle(percent);
} else {
... ...
... ... @@ -2,7 +2,7 @@
<LayoutApp :show-back="true" :hide-header="hideHeader">
<div class="scroll-list-wrap">
<template v-if="isShow">
<div v-for="(item, index) in channelList.list" v-if="item.template_name == 'guessLike'">
<div v-for="(item, index) in channelList.list" :key="index" v-if="item.template_name == 'guessLike'">
<ScrollNav :list="item.data" :current="active"></ScrollNav>
</div>
</template>
... ...
... ... @@ -7,6 +7,6 @@ export default [
{
name: 'newsDetail',
path: '/xianyu/newsDetail',
component: () => import(/* webpackChunkName: "newsDetail" */ './newsDetail')
component: () => import(/* webpackChunkName: "newsDetail" */ './newsDetail'),
}
];
\ No newline at end of file
... ...
... ... @@ -5,10 +5,10 @@
ref="scroll"
:options="options"
@pulling-up="onPullingUp"
:data="newsList.list">
:data="newsDeatilList.list">
<div class="news-content">
<Title :title="title"></Title>
<List :list="newsList && newsList.list || []" :isTitle="false"></List>
<List :list="newsDeatilList && newsDeatilList.list || []" :isTitle="false"></List>
</div>
</Scroll>
</div>
... ... @@ -36,7 +36,7 @@ export default {
}
},
computed: {
...mapState(['newsList']),
...mapState(['newsList','newsDeatilList']),
},
mounted() {
let params = {
... ...
... ... @@ -2,7 +2,6 @@
<LayoutApp :title="title">
<div class="order-page">
<div class="product">
<ImgSize class="pro-img" :src="goodsInfo.goodImg || ''" :width="200" :height="200"></ImgSize>
<div class="pro-info">
<p class="pro-name">{{goodsInfo.colorName}}, {{goodsInfo.sizeName}}码</p>
... ... @@ -122,7 +121,8 @@ export default {
isAgree: false,
labelOption: {
label: '我已阅读并同意'
}
},
time: 15000
};
},
asyncData({store, router}) {
... ... @@ -281,8 +281,9 @@ export default {
onCloseAction() {
that.clearData();
that.$router.replace({
name: 'InSaleOrderList',
name: 'sellOrderDetail',
params: {
owner: 'sell',
code: result.data.orderCode
}
});
... ...
... ... @@ -13,6 +13,14 @@ export default function() {
totalPage: 0,
uid: '500031170',
},
newsDeatilList: {
list: [],
tabList: [],
page: 0,
limit: 10,
totalPage: 0,
uid: '500031170',
}
},
mutations: {
[Types.FETCH_NEWS_LIST](state, { list }) {
... ... @@ -21,12 +29,19 @@ export default function() {
state.newsList.totalPage = list.totalPage;
},
[Types.FETCH_NEWSDETAIL_LIST](state, { list }) {
state.newsDeatilList.list = list.page > 1 ? state.newsDeatilList.list.concat(list.list) : list.list;
state.newsDeatilList.page = list.page;
state.newsDeatilList.totalPage = list.totalPage;
},
[Types.FETCH_NEWS_TAB_LIST](state, { list }) {
state.newsList.tabList = list;
},
},
actions: {
async fetchNewsList({ commit, state }, obj) {
console.log(obj);
let page = state.newsList.page + 1;
let uid = state.newsList.uid;
let limit = state.newsList.limit;
... ... @@ -40,19 +55,22 @@ export default function() {
if (page === totalPage) {
return false;
}
const result = await this.$api.post('/api/ufo/home/newsList', {
page, uid, type, limit
});
if (result.code === 200) {
// 时间戳转换 moment
result.data.list.map((res) => {
res.createTime = moment(new Date(res.createTime * 1000)).format('YYYY.MM.DD HH:mm');
});
commit(Types.FETCH_NEWS_LIST, {list: result.data});
if (obj.type == 1 || obj.type == 2 || obj.type == 3) {
commit(Types.FETCH_NEWSDETAIL_LIST, {list: result.data});
}
}
},
async fetchNewsTabList({ commit, state }) {
async fetchNewsTabList({ commit }) {
let uid = '500031170';
const result = await this.$api.post('/api/ufo/home/newsListTab', { uid });
if (result.code === 200) {
... ...
... ... @@ -6,6 +6,7 @@ export const FETCH_CHANNEL = 'FETCH_CHANNEL';
export const FETCH_PRODUCT = 'FETCH_PRODUCT';
export const FETCH_NEWS_LIST = 'FETCH_NEWS_LIST';
export const FETCH_NEWS_TAB_LIST = 'FETCH_NEWS_TAB_LIST';
export const FETCH_NEWSDETAIL_LIST = 'FETCH_NEWSDETAIL_LIST';
export const FETCH_FAVORITE_LIST_REQUEST = 'FETCH_FAVORITE_LIST_REQUEST';
export const FETCH_FAVORITE_LIST_FAILD = 'FETCH_FAVORITE_LIST_FAILD';
... ...
... ... @@ -37,7 +37,7 @@ export default {
});
}
console.log(result);
// console.log(result);
if (result && result.code === 200) {
commit(Types.FETCH_ORDER_PRODUCT_SUCCESS, {
... ... @@ -64,7 +64,8 @@ export default {
orderCode,
tabType: 'sell'
});
console.log('fetchOrder= ', result.data);
// console.log('fetchOrder= ', result.data);
if (result && result.code === 200) {
commit(Types.FETCH_NOENTRY_ORDER_PRODUCT_SUCCESS, {
... ... @@ -89,7 +90,7 @@ export default {
commit(Types.POST_NOSALE_REQUEST);
const result = await this.$api.get('/api/ufo/sellerOrder/batchDownShelf', payload);
console.log('下架=', result);
// console.log('下架=', result);
if (result && result.code === 200) {
commit(Types.POST_NOSALE_SUCCESS, {
order: result.data
... ...