Authored by Tao

modify news && newsDetail last pages2

... ... @@ -54,9 +54,6 @@ export default {
data() {
return {
options: {
// bounce: {
// top: false
// },
scrollbar: true,
pullUpLoad: true,
pullDownRefresh: true,
... ... @@ -90,7 +87,7 @@ export default {
searchParams: {
type: 0, // type:0,推荐;1,热销;2,即将发售; 3,品类; 4,品牌;5,系列;6,搜索 7, 收藏
order: '', // 指定排序
productPool: null, // 商品池id
productPool: null, // 商品池idfetchList
sort: null, // 品类id
brand: null, // 品牌id
series: null, // 系列id
... ... @@ -178,7 +175,7 @@ export default {
return;
}
if (typeof params === 'object' && Object.keys(params)) {
searchParams ={...params};
searchParams = {...params};
this.searchParams = searchParams;
}
... ... @@ -198,7 +195,7 @@ export default {
if (result.code === 200) {
data.endReached = (data.page === data.page_total) && (data.page_size !== 1);
data.endReached = (data.page === data.page_total) && (data.page_size !== 1) || !data.page_total;
}
if (typeof data === 'object' && Object.keys(data).length) {
... ...
... ... @@ -10,14 +10,9 @@
</template>
<script>
import Vue from 'vue'
import { Style, ScrollNavBar } from 'cube-ui';
import { createNamespacedHelpers } from 'vuex';
import queryString from 'query-string';
// const { mapState, mapActions } = createNamespacedHelpers('list/channel');
const {mapState, mapActions} = createNamespacedHelpers('list');
export default {
name: 'slide',
props: {
... ... @@ -28,39 +23,38 @@ export default {
current: {
type: Number,
default: true
}
},
},
data() {
return {
index: 0,
// current: this.list[0].title,
labels: [],
}
};
},
components: {
Style,
ScrollNavBar
},
computed: {
...mapState(['productList']),
},
mounted() {
this.list.map((res) => { this.labels.push(res.title) });
this.list.map((res) => {
this.labels.push(res.title);
});
},
created() {
},
methods: {
...mapActions(['fetchProductList']),
changeHandler(cur) {
let index = this.$refs[`getindex${cur}`].innerText;
let url = this.list[index].url.split("?");
let url = this.list[index].url.split('?');
let urlParams = queryString.parse(url[1]);
let params = urlParams;
params.isReset = true;
this.fetchProductList(params);
this.$emit('transfer',index);
console.log(params)
console.log(this.$parent);
this.$parent.$parent.$parent.fetchList && this.$parent.$parent.$parent.fetchList(params);
this.$emit('transfer', index);
}
}
};
... ...
... ... @@ -156,7 +156,7 @@ export default {
if (result.code === 200) {
data.endReached = (data.page === data.page_total) && (data.page_size !== 1);
data.endReached = (data.page === data.page_total) && (data.page_size !== 1) || !data.page_total;
}
if (typeof data === 'object' && Object.keys(data).length) {
... ...
... ... @@ -14,9 +14,15 @@
<div class="productPrice">
<span class="size">{{sizeInfo}}</span>
<div class="pricedetail">
<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>
<div class="inputView">
... ... @@ -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: '有货买家协议'
};
},
... ... @@ -128,14 +134,24 @@ export default {
},
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,7 +274,7 @@ export default {
}).show();
} else {
this.publishProduct()
this.publishProduct();
}
},
... ... @@ -265,8 +289,17 @@ export default {
});
},
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 {
... ...
... ... @@ -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,
}
}
};
... ...
... ... @@ -55,6 +55,7 @@
v-for="(imgUrl, i) in miniFaultConfirm.imageUrls"
:key="i"
>
<ImageFormat
:data-secc="imgUrl"
:src="imgUrl"
... ...
... ... @@ -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">
¥
... ...
... ... @@ -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', ''),
... ...
... ... @@ -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({
... ...
... ... @@ -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) {
... ...
... ... @@ -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({
... ...