Authored by yyq

merge

... ... @@ -31,6 +31,22 @@ if (isYohoBuy && !$appLink) {
};
}
function getAppVersion(str, split) {
let res = '';
try {
const match = str.match(new RegExp('(^|)app_version=([^' + split + ']*)(' + split + '|$)'));
if (match) {
res = match.length ? match[2] : '';
}
} catch (e) {
console.log(e);
}
return res;
}
const yoho = {
/**
* 判断是否是 APP
... ... @@ -39,7 +55,11 @@ const yoho = {
isiOS: /\(i[^;]+;( U;)? CPU.+Mac OS X/i.test(navigator.userAgent || ''),
isAndroid: /Android/i.test(navigator.userAgent || ''),
isYohoBuy: isYohoBuy,
<<<<<<< HEAD
isLocal: window.location.protocol === 'yoho-protocol:' || /yoho-protocol/i.test(navigator.userAgent || ''),
=======
appVersion: getAppVersion(navigator.userAgent, ';') || getAppVersion(document.cookie, ';'),
>>>>>>> feature/0530
/**
* JS 与 APP 共享的对象
... ...
... ... @@ -13,9 +13,7 @@
<p class="product-name">{{product.productName}}</p>
<div class="price-wrap">
<div class="price-left">
<label v-if="product.collage_activity_id" class="collage-tag">
<span>拼团价</span>
</label>
<label v-if="priceTag" class="price-tag" :class="priceTag"></label>
<span class="price">¥{{salesPrice}}</span>
</div>
<div class="btn-right btn-buy hover-opacity" :class="{'btn-disable': !hasStock}">
... ... @@ -74,6 +72,17 @@ export default {
hasStock() {
return this.product.has_stock !== 'N';
},
priceTag() {
let className = '';
if (+this.product.productType === 2) {
className = 'ufo-tag';
} else if (this.product.collage_activity_id) {
className = 'collage-tag';
}
return className;
},
salesPrice() {
return this.product.collage_activity_id ? this.product.collage_price : this.product.salesPrice;
}
... ... @@ -215,22 +224,23 @@ export default {
align-items: center;
}
.collage-tag {
.price-tag {
width: 94px;
height: 28px;
margin-right: 16px;
background-color: #ff5660;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
background-size: 100%;
}
> * {
font-size: 24px;
font-weight: 300;
transform: scale(0.7, 0.7);
}
.collage-tag {
background-image: url('~statics/image/article/pt-price.png');
}
.ufo-tag {
background-image: url('~statics/image/article/ufo-price.png');
}
.price {
line-height: 1;
}
}
... ...
... ... @@ -17,6 +17,7 @@
</template>
<script>
import version from 'utils/version';
import {createNamespacedHelpers} from 'vuex';
const {mapState: mapArticleState, mapActions: mapArticleActions} = createNamespacedHelpers('article');
const {mapActions: mapUserActions} = createNamespacedHelpers('user');
... ... @@ -64,8 +65,9 @@ export default {
const authorState = this.authorStates[`${article.authorUid}-${article.authorType}`] || article;
this.list[0].hide = authorState.hasAttention !== 'Y';
this.list[2].href = `?openby:yohobuy={"action":"go.editPost","params":{"articleId":"${article.articleId}"}}`;
this.list[2].hide = article.isAuthor !== 'Y';
this.list[2].hide = version(this.$yoho.appVersion, '6.9.5') < 0 || article.isAuthor !== 'Y';
this.list[3].hide = article.isAuthor !== 'Y';
this.list = [...this.list];
... ...
... ... @@ -27,6 +27,7 @@
</template>
<script>
import version from 'utils/version';
import YAS from 'utils/yas-constants';
export default {
data() {
... ... @@ -61,7 +62,7 @@ export default {
actionUrl() {
if (this.data.sort === 3) {
return this.data.actionUrl;
} else if (+this.data.authStatus === 2) {
} else if (+this.data.authStatus === 2 && version(this.$yoho.appVersion, '6.9.5') >= 0) {
return `?openby:yohobuy={"action":"go.editPost","params":{"articleId":"${this.data.articleId}"}}`;
}
... ...
... ... @@ -618,23 +618,24 @@ export default {
.contant-list {
position: relative;
.empty-tip {
width: 100%;
display: flex;
justify-content: center;
align-items: center;
font-size: 28px;
color: #ddd;
position: absolute;
top: 0;
bottom: 240px;
}
}
.pannel-wrap {
background-color: #f7f7f7;
}
.empty-tip {
width: 100%;
display: flex;
justify-content: center;
align-items: center;
font-size: 28px;
color: #ddd;
position: absolute;
top: 0;
bottom: 240px;
}
.loading {
padding: 20px 0;
... ...
... ... @@ -613,7 +613,6 @@ ul {
img.lazy-img {
opacity: 0;
transition: opacity 800ms ease-in-out;
}
img[lazy=loading] {
... ...