Authored by 邱骏

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

<template>
<LayoutApp :title="title" :show-back="true">
<Scroll ref="scroll" :options="scrollOpts">
<div class="pane-body">
<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>
<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>
<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 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>
</FormItem>
</template>
<FormItem>
<CInput
label="详细地址"
place-holder="请输入详细地址"
v-model="model.address"
:textValue="model.address"
></CInput>
</div>
</FormItem>
<!-- 订单修改地址隐藏 -->
<div v-if="!orderCode" class="wrapper-tag">
<p class="tag-text">设置标签:</p>
</template>
<FormItem>
<CInput
label="详细地址"
place-holder="请输入详细地址"
v-model="model.address"
:textValue="model.address"
></CInput>
</FormItem>
<!-- 订单修改地址隐藏 -->
<div v-if="!orderCode" class="wrapper-tag">
<p v-if="addressTags.length" class="tag-text">设置标签:</p>
<div class="radio-container">
<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>
<div class="radio-scroll" 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>
<!-- 订单修改地址隐藏 -->
<div v-if="!orderCode" class="wrapper-del">
<Radio
... ... @@ -70,8 +71,8 @@
></Radio>
</div>
</div>
<div :class="submitClass" @touchend="onSubmit">确 认</div>
</Scroll>
<div :class="submitClass" @touchend="onSubmit">确 认</div>
<AddressAct
class="address-act"
ref="addressAct"
... ... @@ -110,9 +111,6 @@ export default {
},
data() {
return {
scrollOpts: {
bounce: false
},
isShowProvince: false,
isUpdate: false,
updateMobileNum: '',
... ... @@ -343,23 +341,6 @@ 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%;
... ... @@ -425,19 +406,35 @@ export default {
.wrapper-tag {
margin: 30px 0;
.wrapper-radio {
margin: 30px 0 20px;
}
.tag-text {
font-size: 36px;
display: inline-block;
font-weight: bold;
}
}
.tag-radio {
margin-right: 30px;
}
.radio-container {
width: 100%;
margin-top: 30px;
overflow-y: hidden;
overflow-x: scroll;
}
.wrapper-radio {
display: inline-block;
white-space: nowrap;
.radio-scroll {
display: inline-block;
overflow-y: hidden;
overflow-x: scroll;
flex-shrink: 0;
.tag-radio {
margin-right: 30px;
height: 100%;
}
}
}
.radio {
... ...
... ... @@ -18,10 +18,9 @@
</Scroll>
</div>
<div class="right-content">
<Scroll ref="subScroll"
:scroll-events="scrollEvents"
@scroll-end="onScrollEndHandler"
>
<layoutScroll ref="subScroll"
@scroll-end="onScrollEndHandler"
>
<div v-for="(itemSub, index) in categorySubList" :key="index">
<CategoryTitle>{{itemSub.name}}</CategoryTitle>
<div class="category-sub-root" :class="'sub-type-' + itemSub.type">
... ... @@ -44,14 +43,13 @@
</div>
</div>
</div>
</Scroll>
</layoutScroll>
</div>
</div>
</LayoutApp>
</template>
<script>
import { Scroll } from 'cube-ui';
import { createNamespacedHelpers } from 'vuex';
import Vue from 'vue';
... ... @@ -63,7 +61,6 @@ export default {
name: 'category',
props: ['hideHeader'],
components: {
Scroll,
ImgSize,
CategoryTitle
},
... ...
... ... @@ -186,18 +186,29 @@ export default {
}
if(scrollY < (eleTop + eleHeight) && item.template_name !== 'guessLike') {
// console.log(item.template_name)
let reportMoreParams = {}
item.data.forEach((val, i) => {
reportParams = {...val.reportParams,PAGE_URL: this.PAGE_URL}
this.homeYasParams.push(reportParams)
if(item.template_name === 'image_list') {
reportMoreParams = Object.assign({},reportParams,{I_INDEX: 0})
}
})
Object.keys(reportMoreParams).length && this.homeYasParams.push(reportMoreParams)
}
} else { // 默认进入时
if(eleTop < scrollHeight) { // 获取每个元素距顶部高度 小于可视区高度即曝光
// console.log(item.template_name)
let reportMoreParams = {}
item.data.forEach((val, i) => {
reportParams = {...val.reportParams,PAGE_URL: this.PAGE_URL}
this.homeYasParams.push(reportParams)
if(item.template_name === 'image_list') {
reportMoreParams = Object.assign({},reportParams,{I_INDEX: 0})
}
})
Object.keys(reportMoreParams).length && this.homeYasParams.push(reportMoreParams)
}
}
})
... ... @@ -259,7 +270,7 @@ export default {
scrollEndHandler({y}) {
let scrollHeight = Math.abs(y)
this.$refs.product && this.$refs.product.yasShowEvent(scrollHeight+this.navTop);
if(scrollHeight === this.navTop) {
if(scrollHeight >= this.navTop) {
return
}
this.reportYas(scrollHeight)
... ...
... ... @@ -46,6 +46,15 @@ export default {
goMore() {
this.$router.push({ path: 'category' });
let reportMoreParams = {...this.list[0].reportParams, PAGE_URL: this.PAGE_URL}
reportMoreParams.I_INDEX = 0
console.log(reportMoreParams)
this.$store.dispatch('reportYas', {
params: {
appop: 'XY_UFO_MAIN_EVENT',
param:reportMoreParams
}
});
}
}
};
... ...
<template>
<LayoutApp :show-back="true" :title="title" class="favorite-wrapper">
<Scroll
<LayoutScroll
ref="scrolllist"
:scroll-events="['scroll-end', 'scroll']"
@scroll-end="fetchList(isMore)"
@pulling-up="fetchList(isMore)"
v-if="favoriteProductList.list.length"
class="fav-scroll-bg"
>
<ProductList :list="favoriteProductList.list"></ProductList>
</Scroll>
</LayoutScroll>
<!-- <empty-list v-show="!isShowEmpty" /> -->
<UfoNoItem class="empty" :tip="`暂无数据`" v-else></UfoNoItem>
</LayoutApp>
... ... @@ -124,6 +124,7 @@ export default {
.fav-scroll-bg {
background-color: #f5f5f5;
flex: 1;
}
</style>
... ...
<template>
<layout-app :title="'\u200E'" class="buyer-order-detail-wrapper">
<scroll>
<div>
<layout-app :title="'\u200E'" class="buyer-order-detail-wrapper">
<div class="order-detail-wrapper">
<div class="content">
<!-- 状态信息 -->
... ... @@ -102,7 +102,7 @@
</div>
</div>
</div>
</scroll>
</layout-app>
<div v-if="actionList.length > 0" class="footer-wrapper">
<div v-if="statusDetail.status === 0">
<p class="real-pay-price">¥{{ priceInfo.realPayPrice }}</p>
... ... @@ -116,7 +116,7 @@
"
/>
</div>
</layout-app>
</div>
</template>
<script>
... ... @@ -133,7 +133,6 @@ import OrderActions from "../components/order-actions";
import VideoPlayer from "../order-list/components/video-player";
import orderActionMixin from "../mixin/order-action";
import { Scroll } from "cube-ui";
const STORE_PATH = "order/orderDetail";
... ... @@ -150,8 +149,7 @@ export default {
OrderActions,
DetailHeader,
DetailFooter,
VideoPlayer,
Scroll
VideoPlayer
},
activated() {
this.copyBtn = new Clipboard(this.$refs.copy, {
... ... @@ -225,7 +223,7 @@ export default {
// footer高度120px
padding: 0 40px 120px 40px;
flex: 1 0 0;
overflow: hidden;
// overflow: hidden;
font-size: 24px;
.video-img {
... ... @@ -306,7 +304,7 @@ export default {
.pay-price {
color: #d0021b;
@include num
@include num;
}
}
... ...
<template>
<layout-app :title="'\u200E'" class="seller-order-detail-wrapper">
<scroll>
<div>
<layout-app :title="'\u200E'" class="seller-order-detail-wrapper">
<div class="order-detail-wrapper">
<div class="content">
<!-- 状态信息 -->
... ... @@ -73,8 +73,7 @@
</div>
</div>
</div>
</scroll>
</layout-app>
<div v-if="actionList.length > 0" class="footer-wrapper">
<div v-if="statusDetail.status === 0">
<p class="earnest-price">{{ orderDetail.earnestMoneyStr }}</p>
... ... @@ -95,7 +94,7 @@
"
/>
</div>
</layout-app>
</div>
</template>
<script>
... ... @@ -114,7 +113,6 @@ import orderActionMixin from "../mixin/order-action";
import orderInSaleActionMixin from "../mixin/order-in-sale-action";
import PlatformFeeInfo from "../components/platform-fee-info";
import { Scroll } from "cube-ui";
const STORE_PATH = "order/orderDetail";
... ... @@ -130,8 +128,7 @@ export default {
Button,
DetailHeader,
DetailFooter,
OrderActions,
Scroll
OrderActions
},
asyncData({ store, router }) {
return store.dispatch(`${STORE_PATH}/fetchOrderDetail`, router.params);
... ... @@ -230,7 +227,7 @@ export default {
// footer高度120px
padding: 0 40px 120px 40px;
flex: 1 0 0;
overflow: hidden;
// overflow: hidden;
font-size: 24px;
.item-wrapper {
... ...
... ... @@ -3,23 +3,28 @@
:title="$route.params.owner === 'sell' ? '我的出售' : '我的购买订单'"
class="list-page"
>
<status-nav :status="status" :owner="owner" @select="onStatusChange"/>
<status-nav
class="order-status-nav"
:status="status"
:owner="owner"
@select="onStatusChange"
/>
<div class="content-wrapper">
<scroll
<LayoutScroll
@scroll="scrollHandler"
@pulling-up="fetchData"
@pulling-down="onRefresh"
:options="options"
:data="viewOrderList"
:loading="loadingOptions"
class="order-list-scroll-wrap"
ref="scroll"
>
<ul class="list-wrapper">
<li v-for="order in viewOrderList" :key="order.orderCode">
<order-item-header :order="order"/>
<order-item :order="order"/>
<order-item-header :order="order" />
<order-item :order="order" />
<!-- 订单操作 -->
<div class="footer-wrapper">
<count-down :leftTime="order.leftTime"/>
<count-down :leftTime="order.leftTime" />
<order-actions
class="actions"
pageName="list"
... ... @@ -48,30 +53,29 @@
tip="这里什么都没有..."
v-show="orderStatus.isShowEmpty"
/>
</scroll>
</LayoutScroll>
</div>
</layout-app>
</template>
<script>
import { Scroll } from 'cube-ui';
import { createNamespacedHelpers } from 'vuex';
import { createNamespacedHelpers } from "vuex";
import OrderItem from './components/order-item';
import StatusNav from './components/status-nav';
import OrderItemHeader from './components/order-item-header';
import VideoPlayer from './components/video-player';
import OrderItem from "./components/order-item";
import StatusNav from "./components/status-nav";
import OrderItemHeader from "./components/order-item-header";
import VideoPlayer from "./components/video-player";
import EmptyList from 'components//ufo-no-item';
import EmptyList from "components//ufo-no-item";
import OrderActions from '../components/order-actions';
import CountDown from '../components/count-down';
import OrderActions from "../components/order-actions";
import CountDown from "../components/count-down";
import orderActionMixin from '../mixin/order-action';
import orderInSaleActionMixin from '../mixin/order-in-sale-action';
import { orderStatusKey, getOrderStatus } from 'constants/order-constants';
import orderActionMixin from "../mixin/order-action";
import orderInSaleActionMixin from "../mixin/order-in-sale-action";
import { orderStatusKey, getOrderStatus } from "constants/order-constants";
const STORE_PATH = 'order/orderList';
const STORE_PATH = "order/orderList";
const { mapActions, mapState, mapMutations } = createNamespacedHelpers(
STORE_PATH
... ... @@ -81,7 +85,6 @@ export default {
// 订单操作
mixins: [orderActionMixin, orderInSaleActionMixin],
components: {
Scroll,
OrderItem,
StatusNav,
OrderItemHeader,
... ... @@ -90,30 +93,33 @@ export default {
CountDown,
VideoPlayer
},
data() {
return {
scrollY: 0
};
},
props: {
owner: String,
status: Number
},
computed: {
...mapState(['orderListByType']),
...mapState(["orderListByType"]),
orderStatus() {
return this.orderListByType[orderStatusKey(this.owner, this.status)];
},
viewOrderList() {
return this.orderStatus.orderList;
},
options() {
const options = {
pullUpLoad: this.orderStatus.pullUpLoad,
bounce: !this.orderStatus.isShowEmpty
loadingOptions() {
return {
hide: !this.viewOrderList || !this.viewOrderList.length,
noMore: this.orderStatus.page >= this.orderStatus.pagetotal
};
// if (this.$refs.scroll && this.$refs.scroll.scroll) {
options.pullDownRefresh = this.orderStatus.isShowEmpty
? false
: { txt: '更新成功' };
// }
return options;
}
},
activated() {
if (this.$yoho.direction === "back") {
this.scrollY && this.$refs.scroll.scrollTo(this.scrollY);
}
},
... ... @@ -127,8 +133,11 @@ export default {
return store.dispatch(`${STORE_PATH}/fetchOrderList`, { owner, status });
},
methods: {
...mapActions(['fetchOrderList', 'confirmReceipt']),
...mapMutations(['resetData']),
...mapActions(["fetchOrderList", "confirmReceipt"]),
...mapMutations(["resetData"]),
scrollHandler({ y }) {
this.scrollY = -y;
},
fetchData() {
this.fetchOrderList({
owner: this.owner,
... ... @@ -170,9 +179,15 @@ export default {
flex-direction: column;
}
.order-status-nav {
position: absolute;
top: 0;
left: 0;
right: 0;
}
.content-wrapper {
flex: 1 0 0;
overflow: hidden;
.footer-wrapper {
display: flex;
... ... @@ -188,6 +203,13 @@ export default {
}
.order-list-scroll-wrap {
width: 100%;
padding-top: 100px;
box-sizing: border-box;
position: absolute;
top: 0;
bottom: 0;
.list-wrapper {
li {
padding: 40px 40px 0;
... ...
... ... @@ -9,7 +9,20 @@ export default {
[Types.FETCH_ADDRESS_TAGS](state, {
list
}) {
state.addressTags = list;
const tagList = list;
// 对重复标签去重
var result = [];
var obj = {};
for (var i = 0; i < tagList.length; i++) {
if (!obj[tagList[i].code]) {
result.push(tagList[i]);
obj[tagList[i].code] = true;
}
}
state.addressTags = result;
},
[Types.FETCH_ADDRESS_PROVINCES](state, {
list
... ...
... ... @@ -124,20 +124,20 @@
function isWeiXinAndIos() {
// window.navigator.userAgent属性包含了浏览器类型、版本、操作系统类型、浏览器引擎类型等信息,这个属性可以用来判断浏览器类型
let ua = '' + window.navigator.userAgent.toLowerCase()
var ua = '' + window.navigator.userAgent.toLowerCase()
// 通过正则表达式匹配ua中是否含有MicroMessenger字符串且是IOS系统
let isIos = /\(i[^;]+;( U;)? CPU.+Mac OS X/i.test(ua) // 是IOS系统
var isIos = /\(i[^;]+;( U;)? CPU.+Mac OS X/i.test(ua) // 是IOS系统
return isIos
}
(function() {
let myFunction
let isWXAndIos = isWeiXinAndIos()
var myFunction
var isWXAndIos = isWeiXinAndIos()
if (isWXAndIos) { // 既是微信浏览器 又是ios============(因为查到只有在微信环境下,ios手机上才会出现input失去焦点的时候页面被顶起)
document.body.addEventListener('focusin', () => { // 软键盘弹起事件
clearTimeout(myFunction);
document.body.addEventListener('focusin', function() { // 软键盘弹起事件
clearTimeout(myFunction);
});
document.body.addEventListener('focusout', () => { // 软键盘关闭事件
document.body.addEventListener('focusout', function() { // 软键盘关闭事件
clearTimeout(myFunction)
myFunction = setTimeout(function() {
window.scrollTo({top: 0, left: 0, behavior: 'smooth'})// 重点 =======当键盘收起的时候让页面回到原始位置
... ... @@ -145,6 +145,8 @@
});
}
})();
window.appBaseLogs = {events: [{}]};
}, 500);
</script>
... ...