Authored by ccbikai

Merge branch 'develop' of git.yoho.cn:fe/yohoblk-wap into develop

<template>
<div class="header" :class="class">
<div class="header-left">
<slot name="left">
<i class="icon icon-left" @click="goBack"></i>
</slot>
</div>
<div class="header-right">
<slot name="right"></slot>
</div>
<div class="header-main">
<span class="header-title">{{title}}</span>
<div class="header-wrap" :class="class">
<div class="header">
<div class="header-left">
<slot name="left">
<i class="icon icon-left" @click="goBack"></i>
</slot>
</div>
<div class="header-right">
<slot name="right"></slot>
</div>
<div class="header-main">
<span class="header-title">{{title}}</span>
</div>
</div>
<div class="header-gap"></div>
</div>
<div class="header-gap"></div>
</template>
<script>
const yoho = require('yoho');
... ... @@ -68,7 +70,7 @@
.header-gap {
height: 90px;
background-color: #fff;
background-color: transparent;
}
.app.ios {
... ...
... ... @@ -52,8 +52,8 @@
<button v-if="order.isSupportRefund == 'Y' || order.isSupportExchange == 'Y'" class="normal" @click="applyRefund()">申请售后</button>
</template>
</div>
<select id="cancel-reason" class="cancel-reason" v-on:change="reasonChange" v-model="selected">
<option v-for="option in options" v-bind:value="{id:option.id}">{{option.reason}}</option>
<select id="cancel-reason" class="cancel-reason" v-on:blur="reasonChange" v-model="selected">
<option v-for="option in options" v-bind:value="{id:option.id,reason:option.reason}">{{option.reason}}</option>
</select>
</template>
<script>
... ... @@ -71,7 +71,7 @@
return {
order: {},
options: [],
selected: null
selected: {}
};
},
ready() {
... ... @@ -121,7 +121,8 @@
reasonChange() {
this.orderDetail().cancel({
orderCode: this.order.orderCode,
reasonId: this.selected.id
reasonId: this.selected.id || this.options[0].id,
reason: this.selected.reason || this.options[0].reason
}, (result) => {
if (result.code === 200) {
location.reload();
... ... @@ -156,7 +157,11 @@
},
autoCancel(code) {
return () => {
this.orderDetail().cancel({orderCode: code}, (result) => {
this.orderDetail().cancel({
orderCode: code,
reasonId: this.options.length ? this.options[0].id : null,
reason: this.options.length ? this.options[0].reason : null
}, (result) => {
if (result.code === 200) {
location.reload();
}
... ...
... ... @@ -53,8 +53,8 @@
<p>Your do not have an order <br>for the time being</p>
<a href="/new">随便逛逛</a>
</div>
<select id="cancel-reason" class="cancel-reason" v-on:change="reasonChange" v-model="selected">
<option v-for="option in options" v-bind:value="{id:option.id}">{{option.reason}}</option>
<select id="cancel-reason" class="cancel-reason" v-on:blur="reasonChange" v-model="selected">
<option v-for="option in options" v-bind:value="{id:option.id,reason:option.reason}">{{option.reason}}</option>
</select>
</template>
... ... @@ -76,7 +76,7 @@
orderList: [],
busy: false,
emptybox: 'hide',
selected: null,
selected: {},
options: [],
currentCode: ''
};
... ... @@ -114,10 +114,11 @@
tip('网络错误');
});
},
reasonChange(){
reasonChange() {
this.order().cancel({
orderCode: this.currentCode,
reasonId: this.selected.id
reasonId: this.selected.id || this.options[0].id,
reason: this.selected.reason || this.options[0].reason
}, (result) => {
if (result.code === 200) {
location.reload();
... ... @@ -141,7 +142,11 @@
},
autoCancel(code) {
return () => {
this.order().cancel({orderCode: code}, (result) => {
this.order().cancel({
orderCode: code,
reasonId: this.options.length ? this.options[0].id : null,
reason: this.options.length ? this.options[0].reason : null
}, (result) => {
if (result.code === 200) {
location.reload();
}
... ...
<template>
<top-bar v-bind:share-data="shareData"></top-bar>
<shop-top v-bind:shop-info="shopInfo"></shop-top>
<div v-bind:class='{"shop-goods-top": !shopInfo.isBlkShop}'>
<goods-list v-bind:data="productList" :empty="empty"></goods-list>
</div>
<filter :config="filterConfig" v-ref:filter></filter>
<top-bar v-bind:share-data="shareData"></top-bar>
</template>
<style>
#shop {
... ... @@ -12,9 +12,6 @@
margin-top: 40px;
}
}
.shop-goods-top {
margin-top: 140px;
}
</style>
<script>
const $ = require('jquery');
... ...
<template>
<div class="top-box clearfix" v-bind:class='{"top-change" : topChange || !shareData.isBlkShop}' v-infinite-scroll="changeTopStatus()">
<span class="icon icon-back back" @click="goBack()"></span>
<span class="brand-name" v-if="!shareData.isBlkShop">{{shareData.brandName}}</span>
<div class="right">
<cheader :title="title" :class='topClass'>
<template slot="right">
<span v-if="shareData.isBlkShop" v-show="shareData.isFav" class="icon" @click="collectShop()">&#xe60d;</span>
<span v-if="shareData.isBlkShop" v-show="!shareData.isFav" class="icon" @click="collectShop()">&#xe60c;</span>
<span v-if="shareData.isBlkShop" class="icon" @click="goShare()">&#xe60e;</span>
<span class="icon" @click="showFilter()">&#xe60b;</span>
</div>
</div>
</template>
</cheader>
</template>
<style>
.top-box {
width: 100%;
height: 80px;
padding: 10px 20px;
position: fixed;
top: 0;
left: 0;
z-index: 99;
color: #fff;
font-size: 48px;
text-align: center;
.back {
width: 60px;
height: 60px;
float: left;
font-size: 52px;
}
.brand-name {
display: inline-block;
max-width: 78%;
height: 60px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
.header {
background-color: transparent;
color: #fff;
}
.right {
height: 60px;
float: right;
margin: 0;
padding: 0;
span {
width: 60px;
height: 60px;
margin: 0 5px;
}
.header-gap {
display: none;
}
}
.top-change {
background-color: #fff;
color: #000;
height: 80px;
top: 0;
padding: 5px 20px;
}
.app.ios {
.top-box {
top: 40px;
.header {
background-color: #fff;
color: #000;
}
.top-change {
top: 0;
height: 120px;
padding: 55px 20px 10px;
.header-gap {
display: block;
}
}
</style>
... ... @@ -78,6 +35,7 @@
<script>
const yoho = require('yoho');
const $ = require('jquery');
const cheader = require('component/header.vue');
module.exports = {
data() {
... ... @@ -90,6 +48,26 @@
type: Object
}
},
computed: {
topClass() {
return {
"top-change": this.topChange || !this.shareData.isBlkShop,
"top-box": true
};
},
title() {
let result = '';
if (this.shareData.isBlkShop) {
result = this.shareData.brandName
}
return result;
}
},
components: {
cheader
},
methods: {
goShare() {
... ... @@ -135,6 +113,7 @@
},
created() {
this.domain = this.shareData.domain;
window.onscroll = this.changeTopStatus.bind(this);
}
};
</script>
... ...