|
@@ -1,560 +1,571 @@
|
|
|
-var tempStyleComponent = `<style>
|
|
|
-/*
|
|
|
-* Prefixed by https://autoprefixer.github.io
|
|
|
-* PostCSS: v7.0.29,
|
|
|
-* Autoprefixer: v9.7.6
|
|
|
-* Browsers: iOS >= 7,Android >= 4
|
|
|
-*/
|
|
|
-
|
|
|
-
|
|
|
- /* 对号角标 */
|
|
|
- .base-icon {
|
|
|
- background-color: transparent;
|
|
|
- background-repeat: no-repeat;
|
|
|
- background-position: center;
|
|
|
- background-size: contain;
|
|
|
- }
|
|
|
- .icon-corner-mark {
|
|
|
- background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAKUSURBVHgB7ZdPaxNBGIffmYS2aqBRKkWxur2lLWJy0HtbBY/6AfzTa3vQb6AeBA9CBbF4FLx4M54EQVZPCj3EeDF4MQepFkXXUqXYdqbzbrtlu53p7sxOsnvoc8lMZpY8eZN3frsA++yTXyovGw6BnIOStJe6uRYdfdWokiJ1OUCZQk6puM1rgSTOc1nREbd5g3B4EH4vdxUddZu3opJIriqKksDhtmwtN6Jj7sdZzvlN1Xrmos7zRvlguTALnF/fa1+mor5kP3XFsBq3NzPR4CAXQyfJ/kxEdSWRrouaSCJdFQ1HImjStQM/Gom6dKWiskjUpeMVVUWiLh2t6F6RqEvHROMiURfrokkjMUqldACW1tZhYeW/dL0AFglF4kWd62acQbg/dhKuDg3AspBtLv3btcdaM+FBLiQbkCC3ISI5PTy4PZ842i/dZ0XUNG2ikkj92y/p3tSiNiUftReh/v23dH+qZjKNRJXk3JdF5TXGzYSRSCl5hpLH+3rg4elTcHdkCIj46vPeX7ApaSyKkUg5PBbDPpxfOTEAl44d8dfOlktKWVNJgactuhWJ96LvB6Iq2RSSItzIey1RVSQurKz6r+cOl0Amm0Zyy/RF4mZKEonTQmgmIjTvLfvSxpICts7GY0V1I1Emm0ZSNGv708SZ4SLESWIkcp44bebamxIyWV1JX5SzO/iq/I/iQd5ziL7DIWgSNFH4P2skKarZmqxO4biokjRJmzBYWbwTwtPg9Y8/8PTrT9DE44SNBxPSCUkbrDF2+fP5Wj2Y78h6jMRCr38H5EB2eIyzqbAksi2a9inRBuKzPzDCaq3J2pPomv/T23hKTAM2DXa3TDCA2HwA08ATekKOv+UM6q0LtTdxF2wAr7U5snLQCTUAAAAASUVORK5CYII=);
|
|
|
- }
|
|
|
- .van-dialog.ent-search-dialog.add-close-after .van-dialog__content {
|
|
|
- position: relative;
|
|
|
- pointer-events: none;
|
|
|
- }
|
|
|
- .van-dialog.ent-search-dialog.add-close-after .van-dialog__content::after {
|
|
|
- content: "";
|
|
|
- background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAQzSURBVHgB7Zp/TtswFMefU9JJ+wtOsHACfiMhYCQn2G5AOUHHCQYnAE6wcoJ1J0g7YJW2AuUEy27Q/6Y1rb3nLNVQsZPYiftDykeqlNpJ7G/86/k9A5SUlJQsEAQM4nc6DoRV17JgjQFzMWkZGP4I/v4T8B8B0qNk9ASDUcvz9gIwROGCff9x2arSOmOshn8d0IN/gCYNB1dFiy9MsH/zwyWEfMRLFwqFNFg4OC9KeG7Bvt9xyJJ9gW96D0YpRnguwe1v3TobwdnEmDRJwAg99/Z3G6CJtuD27f0FTkQfYAbg+L48Otg6BQ2UBfNJidgjHy/XYbb0WFjxPG+jr/KQkuA5EjtGWbQFCsyZWM56XKfMZBbMxyzMl9gx63HdMpGpS/t39zXC2CeYY3ACPfUOdi7T7ksVHK2zts27jQPzTZ+F4UbaOp3apVEst54cmH+WSdVO7dqJLRy37k9YINCG97zDnZYsP7GF49ZVKAyuWCVc5eMJcoIW1Un0LnynynOxPS/Pl2XotK792nL2Nzd/Rc9//V4jlqU10XGxY/NRpx64Nq/I1mZ5Cy/Zymbj8A91x9fe290Go/QEFHkulmO9st+BKktDad2lggkB5YJwI9Fod7rH4/+qoifF8ncxCqlLzSTYs45leULBvBuB5sysK1ooFt8FOjDm3D08vBFliVu4WnUhB6qiCxUbM/g99ETpYsGU5TYhs4o2ITaCWkINQsE4ftegANJEGxMLkYYjUbps0nKgIGSiTYqNIETohRGuw63bLoOCIRWoHe1tX4vyChf7j757sL0ymai0H87DZEuPMSSWI2zhqQnmUEpf9CgaUqPBgElkgpX8RFmYHLNjdC0yXaYiWDRB5bHIMkFIIEo2Llg2G+c1Q9MLZoEo2RLfC20oosyUpcekaNTwJEq3JDXtQd4CM66zxkRbVKhBLHg0aEEOVI0KI6Ix7CpKli4JaHzwTbcDiuSxoCaNkxxOhACNjlVRhnQdRt/QNSgSuUpzmItFtTSO3y+yPLnhMVxS3nhXX1c+j691LagXFtlI3DUTGYbSuidaOdituT/ahYzwqB6tDK4ssI/ymouRI7AybFqjal0tSkka7sHWibyOCcRRfaXYzaxBZ/xqkjM+0ZaO/LsEmrAwkEbuyAMbhNzHXLhtbYCAH4lIuylVMP9iOIZSXzRroqMQGc5/ZNoe8qicagRgmvC6ZT33obQXxVn7EeYvRtxDI2Mj681KDgB+vIAXAPNDL65TZspDLVnxb7qX6AqtwwyIxuzhttaRKW2fFi+QEcItmgCmBcMoP7fXNcVyCjl6CJXKWVIAqxAYNNkwPJ3p0cPnGBTewp3beVJUXwUDx4dROMaW43CrA3oE0fYUd2yqk1IaZg+Ic/E8EonBuThe5cDzj4BjEmvABfUjPxp3LdmDlrdn7oB4SUlJyULxF7IOiI8q04KkAAAAAElFTkSuQmCC);
|
|
|
- background-color: transparent;
|
|
|
- background-repeat: no-repeat;
|
|
|
- background-position: center;
|
|
|
- background-size: contain;
|
|
|
- display: inline-block;
|
|
|
- width: 0.4rem;
|
|
|
- height: 0.4rem;
|
|
|
- position: absolute;
|
|
|
- right: 0.16rem;
|
|
|
- top: 0.16rem;
|
|
|
- pointer-events: auto;
|
|
|
- }
|
|
|
- .van-dialog.ent-search-dialog.max-54 {
|
|
|
- max-width: 5.4rem;
|
|
|
- }
|
|
|
- .van-dialog.ent-search-dialog {
|
|
|
- border-radius: 0.16rem;
|
|
|
- font-family: PingFang SC;
|
|
|
- font-style: normal;
|
|
|
- font-weight: 500;
|
|
|
- font-size: 0.32rem;
|
|
|
- line-height: 0.48rem;
|
|
|
- color: #171826;
|
|
|
- z-index: 2031 !important;
|
|
|
- }
|
|
|
-
|
|
|
- .z-2030 {
|
|
|
- z-index: 2030 !important;
|
|
|
- }
|
|
|
-
|
|
|
- .van-dialog.ent-search-dialog .van-dialog__content .van-dialog__message {
|
|
|
- text-align: left;
|
|
|
- }
|
|
|
-
|
|
|
- .van-dialog.ent-search-dialog .van-dialog__confirm,
|
|
|
- .van-dialog.ent-search-dialog .van-dialog__cancel {
|
|
|
- font-size: 0.36rem;
|
|
|
- line-height: 0.52rem;
|
|
|
- color: #171826;
|
|
|
- }
|
|
|
-
|
|
|
- .van-dialog.ent-search-dialog .van-dialog__confirm {
|
|
|
- color: #2ABED1;
|
|
|
- }
|
|
|
-
|
|
|
- #v-keep-component[v-cloak]{
|
|
|
- display: none;
|
|
|
- }
|
|
|
- #v-keep-component > .van-overlay {
|
|
|
- z-index: 100000 !important;
|
|
|
- }
|
|
|
- #v-keep-component > .popup-group {
|
|
|
- z-index: 100002 !important;
|
|
|
- }
|
|
|
- #v-keep-component .disabled-event {
|
|
|
- pointer-events: none;
|
|
|
- }
|
|
|
- #v-keep-component .keep-component-group {
|
|
|
- width: 6.54rem;
|
|
|
- background-color: #fff;
|
|
|
- padding: 16px;
|
|
|
- box-sizing: border-box;
|
|
|
- border-radius: 8px 8px 16px 16px;
|
|
|
- }
|
|
|
- #v-keep-component .popup-group {
|
|
|
- background-color: transparent;
|
|
|
- }
|
|
|
- #v-keep-component .icon-padding-box {
|
|
|
- padding: 0.12rem;
|
|
|
- padding-right: 0;
|
|
|
- box-sizing: border-box;
|
|
|
- }
|
|
|
- #v-keep-component .j-icon {
|
|
|
- width: 0.4rem;
|
|
|
- height: 0.4rem;
|
|
|
- }
|
|
|
- #v-keep-component .keep-component-title {
|
|
|
- padding-bottom: 0.12rem;
|
|
|
- display: -webkit-box;
|
|
|
- display: -webkit-flex;
|
|
|
- display: flex;
|
|
|
- -webkit-box-orient: horizontal;
|
|
|
- -webkit-box-direction: normal;
|
|
|
- -webkit-flex-direction: row;
|
|
|
- flex-direction: row;
|
|
|
- -webkit-box-align: center;
|
|
|
- -webkit-align-items: center;
|
|
|
- align-items: center;
|
|
|
- -webkit-box-pack: justify;
|
|
|
- -webkit-justify-content: space-between;
|
|
|
- justify-content: space-between;
|
|
|
- font-family: PingFang SC;
|
|
|
- font-style: normal;
|
|
|
- font-weight: 500;
|
|
|
- font-size: 0.4rem;
|
|
|
- line-height: 0.6rem;
|
|
|
- color: #171826;
|
|
|
- }
|
|
|
- #v-keep-component .keep-component-bottom {
|
|
|
- padding: 0.16rem;
|
|
|
- }
|
|
|
- #v-keep-component .keep-component-bottom .van-button {
|
|
|
- width: 100%;
|
|
|
- background: #2ABED1;
|
|
|
- border-radius: 0.16rem;
|
|
|
- font-family: PingFang SC;
|
|
|
- font-style: normal;
|
|
|
- font-weight: 500;
|
|
|
- font-size: 0.36rem;
|
|
|
- line-height: 0.52rem;
|
|
|
- color: #F7F9FA;
|
|
|
- border-color: #2ABED1;
|
|
|
- height: 0.92rem;
|
|
|
- }
|
|
|
- #v-keep-component .keep-component-bottom .van-button__loading {
|
|
|
- font-size: 0.32rem;
|
|
|
- width: 0.32rem;
|
|
|
- height: 0.32rem;
|
|
|
- }
|
|
|
- #v-keep-component .kee-component-content {
|
|
|
- padding-top: 0.24rem;
|
|
|
- }
|
|
|
- #v-keep-component .keep-component-tag-group {
|
|
|
- display: -webkit-box;
|
|
|
- display: -webkit-flex;
|
|
|
- display: flex;
|
|
|
- -webkit-box-orient: horizontal;
|
|
|
- -webkit-box-direction: normal;
|
|
|
- -webkit-flex-direction: row;
|
|
|
- flex-direction: row;
|
|
|
- -webkit-flex-wrap: wrap;
|
|
|
- flex-wrap: wrap;
|
|
|
- max-height: 30vh;
|
|
|
- overflow-x: hidden;
|
|
|
- overflow-y: scroll;
|
|
|
- }
|
|
|
-
|
|
|
- #v-keep-component .keep-component-tag i {
|
|
|
- position: absolute;
|
|
|
- width: 0.28rem;
|
|
|
- height: 0.28rem;
|
|
|
- bottom: 0;
|
|
|
- right: 0;
|
|
|
- opacity: 0;
|
|
|
- -webkit-transition: all 0.2s;
|
|
|
- transition: all 0.2s;
|
|
|
- }
|
|
|
- #v-keep-component .keep-component-tag {
|
|
|
- position: relative;
|
|
|
- max-width: 100%;
|
|
|
- background: #F5F6F7;
|
|
|
- border-radius: 0.08rem;
|
|
|
- font-family: PingFang SC;
|
|
|
- font-style: normal;
|
|
|
- font-weight: 500;
|
|
|
- font-size: 0.28rem;
|
|
|
- line-height: 0.4rem;
|
|
|
- color: #5F5E64;
|
|
|
- padding: 0.1rem 0.2rem;
|
|
|
- margin-bottom: 0.24rem;
|
|
|
- margin-right: 0.24rem;
|
|
|
- -webkit-transition: color 0.2s;
|
|
|
- transition: color 0.2s;
|
|
|
- }
|
|
|
- #v-keep-component .keep-component-tag.checked i {
|
|
|
- opacity: 1;
|
|
|
- }
|
|
|
- #v-keep-component .keep-component-tag.checked {
|
|
|
- background: #E8FAFD;
|
|
|
- color: #2ABED1;
|
|
|
- }
|
|
|
-
|
|
|
- #v-keep-component .keep-component-input-group .van-button {
|
|
|
- margin-left: 0.3rem;
|
|
|
- padding: 0.2rem;
|
|
|
- padding-right: 0;
|
|
|
- -webkit-flex-shrink: 0;
|
|
|
- flex-shrink: 0;
|
|
|
- background: transparent;
|
|
|
- border-color: transparent;
|
|
|
- color: inherit;
|
|
|
- }
|
|
|
- #v-keep-component .keep-component-input-group {
|
|
|
- width: 100%;
|
|
|
- display: -webkit-box;
|
|
|
- display: -webkit-flex;
|
|
|
- display: flex;
|
|
|
- -webkit-box-orient: horizontal;
|
|
|
- -webkit-box-direction: normal;
|
|
|
- -webkit-flex-direction: row;
|
|
|
- flex-direction: row;
|
|
|
- -webkit-box-align: center;
|
|
|
- -webkit-align-items: center;
|
|
|
- align-items: center;
|
|
|
- -webkit-box-pack: justify;
|
|
|
- -webkit-justify-content: space-between;
|
|
|
- justify-content: space-between;
|
|
|
- margin-bottom: 0.44rem;
|
|
|
- font-family: PingFang SC;
|
|
|
- font-style: normal;
|
|
|
- font-weight: 500;
|
|
|
- font-size: 0.28rem;
|
|
|
- line-height: 0.4rem;
|
|
|
- color: #2ABED1;
|
|
|
- }
|
|
|
- #v-keep-component .keep-component-input-group input:focus {
|
|
|
- border-color: #2ABED1;
|
|
|
- }
|
|
|
- #v-keep-component .keep-component-input-group input {
|
|
|
- width: 100%;
|
|
|
- -webkit-transition: width 0.2s;
|
|
|
- transition: width 0.2s;
|
|
|
- -webkit-box-flex: 1;
|
|
|
- -webkit-flex: 1;
|
|
|
- flex: 1;
|
|
|
- border: 1px solid rgba(0, 0, 0, 0.1);
|
|
|
- box-sizing: border-box;
|
|
|
- border-radius: 0.08rem;
|
|
|
- font-family: PingFang SC;
|
|
|
- font-style: normal;
|
|
|
- font-weight: 500;
|
|
|
- font-size: 0.3rem;
|
|
|
- line-height: 0.44rem;
|
|
|
- color: #5F5E64;
|
|
|
- padding: 0.26rem 0.32rem;
|
|
|
- }
|
|
|
-
|
|
|
- #v-keep-component .disabled-event .van-button{
|
|
|
- opacity: 0.5;
|
|
|
- cursor: not-allowed;
|
|
|
- }
|
|
|
-</style>`
|
|
|
-
|
|
|
-// 部分页面没有全局工具函数
|
|
|
-if (typeof utils !== 'object') {
|
|
|
- utils = {}
|
|
|
-}
|
|
|
-utils.isWeiXinBrowser = navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1
|
|
|
-
|
|
|
-Vue.component('keep-component', {
|
|
|
- delimiters: ['@@', '@@'],
|
|
|
- template: `
|
|
|
-<div id="v-keep-component" v-cloak>
|
|
|
- <van-popup v-model="showKeepDialog" class="popup-group" :close-on-click-overlay="!isLoading && !isAddLoading" :close-on-popstate="true">
|
|
|
- <div class="keep-component-group" v-bind:class="{'disabled-event': isLoading || isAddLoading}">
|
|
|
- <div class="keep-component-title">
|
|
|
- <h3>选择标签</h3>
|
|
|
- <div class="icon-padding-box" @click="togglePopStatus(false)">
|
|
|
- <i class="j-icon base-icon icon-delete-gray"></i>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="kee-component-content">
|
|
|
- <div class="keep-component-input-group">
|
|
|
- <input v-model.trim="tagInput" type="text" placeholder="请输入标签">
|
|
|
- <van-button v-show="isAddLoading || getOnlyStatus" @click="addTag" :loading="isAddLoading" type="primary">添加并使用</van-button>
|
|
|
- </div>
|
|
|
- <div v-show="!isGetTagsLoading" class="keep-component-tag-group">
|
|
|
- <div class="keep-component-tag" @click="toggleTagStatus(item)" v-for="item in tags" :key="item.title" :class="{'checked': item.checked}">
|
|
|
- <div class="van-ellipsis">@@item.title@@</div>
|
|
|
- <i class="j-icon base-icon icon-corner-mark"></i>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <van-loading v-show="isGetTagsLoading" />
|
|
|
- </div>
|
|
|
- <div class="keep-component-bottom">
|
|
|
- <van-button @click="submitSave" :loading="isLoading" loading-text="保存中..." type="primary">确定</van-button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </van-popup>
|
|
|
-</div>
|
|
|
- `,
|
|
|
- props: {
|
|
|
- baseAjaxURL: {
|
|
|
- type: String,
|
|
|
- default: ''
|
|
|
- },
|
|
|
- bid: {
|
|
|
- type: String,
|
|
|
- required: true,
|
|
|
- default: ''
|
|
|
- },
|
|
|
- // 是否首次打开时默认请求一次标签组
|
|
|
- first: {
|
|
|
- type: Boolean,
|
|
|
- default: false
|
|
|
- },
|
|
|
- // 是否每次打开这遮罩时都请求标签组
|
|
|
- every: {
|
|
|
- type: Boolean,
|
|
|
- default: true
|
|
|
- }
|
|
|
- },
|
|
|
- data: function () {
|
|
|
- return {
|
|
|
- showKeepDialog: false,
|
|
|
- isLoading: false,
|
|
|
- isAddLoading: false,
|
|
|
- isGetTagsLoading: true,
|
|
|
- tagInput: '',
|
|
|
- tags: []
|
|
|
- }
|
|
|
- } ,
|
|
|
- mounted () {
|
|
|
- $('head').append(tempStyleComponent)
|
|
|
- if (this.first) {
|
|
|
- this.ajaxGetAllTags()
|
|
|
- }
|
|
|
- },
|
|
|
- computed: {
|
|
|
- checkNowPower () {
|
|
|
- var tempPower = window.jyUserPower
|
|
|
- var resultPower = false
|
|
|
- if (tempPower) {
|
|
|
- resultPower = tempPower.entniche || tempPower.member || tempPower.vip !== 0
|
|
|
- }
|
|
|
- return resultPower
|
|
|
- },
|
|
|
- getLids () {
|
|
|
- return this.tags.filter(function (v) {
|
|
|
- return v.checked
|
|
|
- }).map(function (v) {
|
|
|
- return v.lid
|
|
|
- }).join(',')
|
|
|
- },
|
|
|
- getOnlyStatus () {
|
|
|
- var _this = this
|
|
|
- return this.tagInput !== '' && this.tags.filter(function (v) {
|
|
|
- return v.title === _this.tagInput
|
|
|
- }).length === 0
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
- checkAjaxFirst () {
|
|
|
- if (!this.first) {
|
|
|
- this.ajaxGetAllTags()
|
|
|
- }
|
|
|
- },
|
|
|
- ajaxFn: function (url, data, callback, type) {
|
|
|
- return $.ajax({
|
|
|
- type: 'post',
|
|
|
- url: this.baseAjaxURL + url,
|
|
|
- contentType: type ? 'application/x-www-form-urlencoded' : "application/json;charset=utf-8",
|
|
|
- data: type ? data : JSON.stringify(data),
|
|
|
- dataType: "json",
|
|
|
- success: typeof callback === 'function' ? callback.bind(this) : new Function()
|
|
|
- })
|
|
|
- },
|
|
|
- ajaxGetAllTags () {
|
|
|
- this.isGetTagsLoading = true
|
|
|
- this.ajaxFn('/publicapply/bidcoll/getLabel', {} , function (r) {
|
|
|
- this.isGetTagsLoading = false
|
|
|
- if (r && r.error_msg === '' && r.data) {
|
|
|
- this.tags = r.data.map(function (v) {
|
|
|
- return {
|
|
|
- lid: v.lid,
|
|
|
- title: v.lanme,
|
|
|
- checked: false
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- ajaxAddKeep (id, type) {
|
|
|
- var _this = this
|
|
|
- var tempFn = function () {
|
|
|
- _this.ajaxAddKeepFn(id, type)
|
|
|
- }
|
|
|
- if (type) {
|
|
|
- $.post('/salesLeads/retainedCapital', { source: 'article_collection' }).done(function (r) {
|
|
|
- if (r && r.error_msg === '' && r.data) {
|
|
|
- if (r.data.retainedCapital) {
|
|
|
- _this.$dialog.close()
|
|
|
- _this.$dialog.confirm({
|
|
|
- message: '重要项目一键创建标签收藏!请完善个人信息,为您匹配精准服务',
|
|
|
- className: 'ent-search-dialog max-54 add-close-after',
|
|
|
- overlayClass: 'z-2030',
|
|
|
- showCancelButton: false,
|
|
|
- confirmButtonText: '立即前往',
|
|
|
- }).then(function () {
|
|
|
- sessionStorage.setItem('salesBackData', JSON.stringify({
|
|
|
- type: 'article_collection',
|
|
|
- id: id,
|
|
|
- shoucang: type
|
|
|
- }))
|
|
|
- location.href = (utils.isWeiXinBrowser ? '/weixin' : '/jyapp') + '/frontPage/bigmember/free/perfect_info?origin=article_collection'
|
|
|
- }).catch(function () {});
|
|
|
- $("body").on('click', '.add-close-after .van-dialog__content', function (e) {
|
|
|
- _this.$dialog.close()
|
|
|
- })
|
|
|
- } else {
|
|
|
- tempFn()
|
|
|
- }
|
|
|
- } else {
|
|
|
- tempFn()
|
|
|
- }
|
|
|
- }).fail(function () {
|
|
|
- tempFn()
|
|
|
- })
|
|
|
- } else {
|
|
|
- tempFn()
|
|
|
- }
|
|
|
- },
|
|
|
- ajaxAddKeepFn (id, type) {
|
|
|
- try {
|
|
|
- var isContent = location.href.indexOf('/article/content') !== -1
|
|
|
- _hmt.push(['_trackEvent','超级订阅-' + (utils.isWeiXinBrowser ? 'wx' : 'app'), 'click', (isContent ? '详情页标讯收藏按钮' : '列表页标讯收藏-星标')]);
|
|
|
- } catch (e) {
|
|
|
- console.log('未初始化百度统计')
|
|
|
- }
|
|
|
- var t = this.$toast.loading({
|
|
|
- duration: 0, // 持续展示 toast
|
|
|
- forbidClick: true,
|
|
|
- message: '提交中',
|
|
|
- })
|
|
|
- this.ajaxFn('/publicapply/bidcoll/action', { baction: type ? 'C' : 'R', binfo: [{ bid: id }] }, function (r) {
|
|
|
- if (r && r.error_msg === '' && r.data) {
|
|
|
- t.clear()
|
|
|
- if (type) {
|
|
|
- this.togglePopStatus(true)
|
|
|
- this.$emit('on-change-keep', true)
|
|
|
- } else {
|
|
|
- this.$emit('on-change-keep', false)
|
|
|
- }
|
|
|
- } else {
|
|
|
- t.clear()
|
|
|
- var _this = this
|
|
|
- if (r.error_msg === '付费用户收藏已达上限') {
|
|
|
- this.$dialog.close()
|
|
|
- this.$dialog.confirm({
|
|
|
- message: '您的标讯收藏上限为5000条,请联系客服人员',
|
|
|
- className: 'ent-search-dialog',
|
|
|
- overlayClass: 'z-2030',
|
|
|
- showCancelButton: false,
|
|
|
- confirmButtonText: '我知道了',
|
|
|
- }).then(function () {}).catch(function () {});
|
|
|
- return
|
|
|
- }
|
|
|
- if (r.error_msg === '免费用户收藏已达上限') {
|
|
|
- this.$dialog.close()
|
|
|
- this.$dialog.confirm({
|
|
|
- message: '您的标讯收藏上限为100条,请升级为会员服务',
|
|
|
- className: 'ent-search-dialog',
|
|
|
- overlayClass: 'z-2030',
|
|
|
- confirmButtonText: '去升级'
|
|
|
- }).then(function () {
|
|
|
- _this.goUpBuyPage()
|
|
|
- }).catch(function () {});
|
|
|
- return
|
|
|
- }
|
|
|
- this.$toast(r.error_msg || '已取消收藏')
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- goUpBuyPage () {
|
|
|
- try {
|
|
|
- _hmt.push(['_trackEvent','超级订阅-' + (utils.isWeiXinBrowser ? 'wx' : 'app'), 'click', '标讯收藏满100条-去升级']);
|
|
|
- } catch (e) {
|
|
|
- console.log('未初始化百度统计')
|
|
|
- }
|
|
|
- window.location.href = (utils.isWeiXinBrowser ? '/front' : '/jyapp') + '/vipsubscribe/vipsubscribe_new'
|
|
|
- },
|
|
|
- togglePopStatus (type) {
|
|
|
- this.showKeepDialog = type
|
|
|
- if (type && this.every) {
|
|
|
- this.ajaxGetAllTags()
|
|
|
- }
|
|
|
- },
|
|
|
- toggleTagStatus (item) {
|
|
|
- item.checked = !item.checked
|
|
|
- },
|
|
|
- submitSave () {
|
|
|
- this.isLoading = true
|
|
|
- this.ajaxFn('/publicapply/bidcoll/label', {
|
|
|
- lids: this.getLids,
|
|
|
- laction: 'S',
|
|
|
- binfo: [
|
|
|
- {
|
|
|
- bid: this.bid
|
|
|
- }
|
|
|
- ]
|
|
|
- }, function (r) {
|
|
|
- if (r && r.error_msg === '' && r.data) {
|
|
|
- this.isLoading = false
|
|
|
- this.$toast(r.error_msg || '已收藏至“我的-标讯收藏”')
|
|
|
- this.togglePopStatus(false)
|
|
|
- } else {
|
|
|
- this.$toast(r.error_msg)
|
|
|
- this.isLoading = false
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- addTagInList (id) {
|
|
|
- var tempInput = this.tagInput
|
|
|
- this.tagInput = ''
|
|
|
- this.tags.push({
|
|
|
- lid: id,
|
|
|
- title: tempInput,
|
|
|
- checked: true
|
|
|
- })
|
|
|
- this.isAddLoading = false
|
|
|
- },
|
|
|
- addTag () {
|
|
|
- this.isAddLoading = true
|
|
|
- this.ajaxFn('/publicapply/bidcoll/addLabel', { name: this.tagInput }, function (r) {
|
|
|
- if (r && r.error_msg === '' && r.data) {
|
|
|
- this.addTagInList(r.data)
|
|
|
- } else {
|
|
|
- this.$toast(r.error_msg)
|
|
|
- this.isAddLoading = false
|
|
|
- }
|
|
|
- }, true)
|
|
|
- }
|
|
|
- }
|
|
|
-})
|
|
|
-// 检查返回是否需要继续下一步
|
|
|
-function checkBackSuccess () {
|
|
|
- var isBackSuccess = sessionStorage.getItem('salesBackStatus') || false
|
|
|
- if (isBackSuccess == 'true') {
|
|
|
- var sessionData = JSON.parse(sessionStorage.getItem('salesBackData') || '{}')
|
|
|
- if (sessionData.type === 'article_collection') {
|
|
|
- if (vKeepComponent) {
|
|
|
- vKeepComponent.changeBid(sessionData.id, sessionData.shoucang)
|
|
|
- }
|
|
|
- }
|
|
|
- if (sessionData.type === 'article_original') {
|
|
|
- JyObj.openExternalLink(sessionData.url,"查看原文");
|
|
|
- }
|
|
|
- }
|
|
|
- sessionStorage.removeItem('salesBackStatus')
|
|
|
- sessionStorage.removeItem('salesBackData')
|
|
|
-}
|
|
|
-$(function () {
|
|
|
- checkBackSuccess()
|
|
|
-})
|
|
|
+var tempStyleComponent = `<style>
|
|
|
+/*
|
|
|
+* Prefixed by https://autoprefixer.github.io
|
|
|
+* PostCSS: v7.0.29,
|
|
|
+* Autoprefixer: v9.7.6
|
|
|
+* Browsers: iOS >= 7,Android >= 4
|
|
|
+*/
|
|
|
+
|
|
|
+
|
|
|
+ /* 对号角标 */
|
|
|
+ .base-icon {
|
|
|
+ background-color: transparent;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-position: center;
|
|
|
+ background-size: contain;
|
|
|
+ }
|
|
|
+ .icon-corner-mark {
|
|
|
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAKUSURBVHgB7ZdPaxNBGIffmYS2aqBRKkWxur2lLWJy0HtbBY/6AfzTa3vQb6AeBA9CBbF4FLx4M54EQVZPCj3EeDF4MQepFkXXUqXYdqbzbrtlu53p7sxOsnvoc8lMZpY8eZN3frsA++yTXyovGw6BnIOStJe6uRYdfdWokiJ1OUCZQk6puM1rgSTOc1nREbd5g3B4EH4vdxUddZu3opJIriqKksDhtmwtN6Jj7sdZzvlN1Xrmos7zRvlguTALnF/fa1+mor5kP3XFsBq3NzPR4CAXQyfJ/kxEdSWRrouaSCJdFQ1HImjStQM/Gom6dKWiskjUpeMVVUWiLh2t6F6RqEvHROMiURfrokkjMUqldACW1tZhYeW/dL0AFglF4kWd62acQbg/dhKuDg3AspBtLv3btcdaM+FBLiQbkCC3ISI5PTy4PZ842i/dZ0XUNG2ikkj92y/p3tSiNiUftReh/v23dH+qZjKNRJXk3JdF5TXGzYSRSCl5hpLH+3rg4elTcHdkCIj46vPeX7ApaSyKkUg5PBbDPpxfOTEAl44d8dfOlktKWVNJgactuhWJ96LvB6Iq2RSSItzIey1RVSQurKz6r+cOl0Amm0Zyy/RF4mZKEonTQmgmIjTvLfvSxpICts7GY0V1I1Emm0ZSNGv708SZ4SLESWIkcp44bebamxIyWV1JX5SzO/iq/I/iQd5ziL7DIWgSNFH4P2skKarZmqxO4biokjRJmzBYWbwTwtPg9Y8/8PTrT9DE44SNBxPSCUkbrDF2+fP5Wj2Y78h6jMRCr38H5EB2eIyzqbAksi2a9inRBuKzPzDCaq3J2pPomv/T23hKTAM2DXa3TDCA2HwA08ATekKOv+UM6q0LtTdxF2wAr7U5snLQCTUAAAAASUVORK5CYII=);
|
|
|
+ }
|
|
|
+ .van-dialog.ent-search-dialog.add-close-after .van-dialog__content {
|
|
|
+ position: relative;
|
|
|
+ pointer-events: none;
|
|
|
+ }
|
|
|
+ .van-dialog.ent-search-dialog.add-close-after .van-dialog__content::after {
|
|
|
+ content: "";
|
|
|
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAQzSURBVHgB7Zp/TtswFMefU9JJ+wtOsHACfiMhYCQn2G5AOUHHCQYnAE6wcoJ1J0g7YJW2AuUEy27Q/6Y1rb3nLNVQsZPYiftDykeqlNpJ7G/86/k9A5SUlJQsEAQM4nc6DoRV17JgjQFzMWkZGP4I/v4T8B8B0qNk9ASDUcvz9gIwROGCff9x2arSOmOshn8d0IN/gCYNB1dFiy9MsH/zwyWEfMRLFwqFNFg4OC9KeG7Bvt9xyJJ9gW96D0YpRnguwe1v3TobwdnEmDRJwAg99/Z3G6CJtuD27f0FTkQfYAbg+L48Otg6BQ2UBfNJidgjHy/XYbb0WFjxPG+jr/KQkuA5EjtGWbQFCsyZWM56XKfMZBbMxyzMl9gx63HdMpGpS/t39zXC2CeYY3ACPfUOdi7T7ksVHK2zts27jQPzTZ+F4UbaOp3apVEst54cmH+WSdVO7dqJLRy37k9YINCG97zDnZYsP7GF49ZVKAyuWCVc5eMJcoIW1Un0LnynynOxPS/Pl2XotK792nL2Nzd/Rc9//V4jlqU10XGxY/NRpx64Nq/I1mZ5Cy/Zymbj8A91x9fe290Go/QEFHkulmO9st+BKktDad2lggkB5YJwI9Fod7rH4/+qoifF8ncxCqlLzSTYs45leULBvBuB5sysK1ooFt8FOjDm3D08vBFliVu4WnUhB6qiCxUbM/g99ETpYsGU5TYhs4o2ITaCWkINQsE4ftegANJEGxMLkYYjUbps0nKgIGSiTYqNIETohRGuw63bLoOCIRWoHe1tX4vyChf7j757sL0ymai0H87DZEuPMSSWI2zhqQnmUEpf9CgaUqPBgElkgpX8RFmYHLNjdC0yXaYiWDRB5bHIMkFIIEo2Llg2G+c1Q9MLZoEo2RLfC20oosyUpcekaNTwJEq3JDXtQd4CM66zxkRbVKhBLHg0aEEOVI0KI6Ix7CpKli4JaHzwTbcDiuSxoCaNkxxOhACNjlVRhnQdRt/QNSgSuUpzmItFtTSO3y+yPLnhMVxS3nhXX1c+j691LagXFtlI3DUTGYbSuidaOdituT/ahYzwqB6tDK4ssI/ymouRI7AybFqjal0tSkka7sHWibyOCcRRfaXYzaxBZ/xqkjM+0ZaO/LsEmrAwkEbuyAMbhNzHXLhtbYCAH4lIuylVMP9iOIZSXzRroqMQGc5/ZNoe8qicagRgmvC6ZT33obQXxVn7EeYvRtxDI2Mj681KDgB+vIAXAPNDL65TZspDLVnxb7qX6AqtwwyIxuzhttaRKW2fFi+QEcItmgCmBcMoP7fXNcVyCjl6CJXKWVIAqxAYNNkwPJ3p0cPnGBTewp3beVJUXwUDx4dROMaW43CrA3oE0fYUd2yqk1IaZg+Ic/E8EonBuThe5cDzj4BjEmvABfUjPxp3LdmDlrdn7oB4SUlJyULxF7IOiI8q04KkAAAAAElFTkSuQmCC);
|
|
|
+ background-color: transparent;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-position: center;
|
|
|
+ background-size: contain;
|
|
|
+ display: inline-block;
|
|
|
+ width: 0.4rem;
|
|
|
+ height: 0.4rem;
|
|
|
+ position: absolute;
|
|
|
+ right: 0.16rem;
|
|
|
+ top: 0.16rem;
|
|
|
+ pointer-events: auto;
|
|
|
+ }
|
|
|
+ .van-dialog.ent-search-dialog.max-54 {
|
|
|
+ max-width: 5.4rem;
|
|
|
+ }
|
|
|
+ .van-dialog.ent-search-dialog {
|
|
|
+ border-radius: 0.16rem;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-style: normal;
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 0.32rem;
|
|
|
+ line-height: 0.48rem;
|
|
|
+ color: #171826;
|
|
|
+ z-index: 2031 !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ .z-2030 {
|
|
|
+ z-index: 2030 !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ .van-dialog.ent-search-dialog .van-dialog__content .van-dialog__message {
|
|
|
+ text-align: left;
|
|
|
+ }
|
|
|
+
|
|
|
+ .van-dialog.ent-search-dialog .van-dialog__confirm,
|
|
|
+ .van-dialog.ent-search-dialog .van-dialog__cancel {
|
|
|
+ font-size: 0.36rem;
|
|
|
+ line-height: 0.52rem;
|
|
|
+ color: #171826;
|
|
|
+ }
|
|
|
+
|
|
|
+ .van-dialog.ent-search-dialog .van-dialog__confirm {
|
|
|
+ color: #2ABED1;
|
|
|
+ }
|
|
|
+
|
|
|
+ #v-keep-component[v-cloak]{
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+ #v-keep-component > .van-overlay {
|
|
|
+ z-index: 100000 !important;
|
|
|
+ }
|
|
|
+ #v-keep-component > .popup-group {
|
|
|
+ z-index: 100002 !important;
|
|
|
+ }
|
|
|
+ #v-keep-component .disabled-event {
|
|
|
+ pointer-events: none;
|
|
|
+ }
|
|
|
+ #v-keep-component .keep-component-group {
|
|
|
+ width: 6.54rem;
|
|
|
+ background-color: #fff;
|
|
|
+ padding: 16px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ border-radius: 8px 8px 16px 16px;
|
|
|
+ }
|
|
|
+ #v-keep-component .popup-group {
|
|
|
+ background-color: transparent;
|
|
|
+ }
|
|
|
+ #v-keep-component .icon-padding-box {
|
|
|
+ padding: 0.12rem;
|
|
|
+ padding-right: 0;
|
|
|
+ box-sizing: border-box;
|
|
|
+ }
|
|
|
+ #v-keep-component .j-icon {
|
|
|
+ width: 0.4rem;
|
|
|
+ height: 0.4rem;
|
|
|
+ }
|
|
|
+ #v-keep-component .keep-component-title {
|
|
|
+ padding-bottom: 0.12rem;
|
|
|
+ display: -webkit-box;
|
|
|
+ display: -webkit-flex;
|
|
|
+ display: flex;
|
|
|
+ -webkit-box-orient: horizontal;
|
|
|
+ -webkit-box-direction: normal;
|
|
|
+ -webkit-flex-direction: row;
|
|
|
+ flex-direction: row;
|
|
|
+ -webkit-box-align: center;
|
|
|
+ -webkit-align-items: center;
|
|
|
+ align-items: center;
|
|
|
+ -webkit-box-pack: justify;
|
|
|
+ -webkit-justify-content: space-between;
|
|
|
+ justify-content: space-between;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-style: normal;
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 0.4rem;
|
|
|
+ line-height: 0.6rem;
|
|
|
+ color: #171826;
|
|
|
+ }
|
|
|
+ #v-keep-component .keep-component-bottom {
|
|
|
+ padding: 0.16rem;
|
|
|
+ }
|
|
|
+ #v-keep-component .keep-component-bottom .van-button {
|
|
|
+ width: 100%;
|
|
|
+ background: #2ABED1;
|
|
|
+ border-radius: 0.16rem;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-style: normal;
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 0.36rem;
|
|
|
+ line-height: 0.52rem;
|
|
|
+ color: #F7F9FA;
|
|
|
+ border-color: #2ABED1;
|
|
|
+ height: 0.92rem;
|
|
|
+ }
|
|
|
+ #v-keep-component .keep-component-bottom .van-button__loading {
|
|
|
+ font-size: 0.32rem;
|
|
|
+ width: 0.32rem;
|
|
|
+ height: 0.32rem;
|
|
|
+ }
|
|
|
+ #v-keep-component .kee-component-content {
|
|
|
+ padding-top: 0.24rem;
|
|
|
+ }
|
|
|
+ #v-keep-component .keep-component-tag-group {
|
|
|
+ display: -webkit-box;
|
|
|
+ display: -webkit-flex;
|
|
|
+ display: flex;
|
|
|
+ -webkit-box-orient: horizontal;
|
|
|
+ -webkit-box-direction: normal;
|
|
|
+ -webkit-flex-direction: row;
|
|
|
+ flex-direction: row;
|
|
|
+ -webkit-flex-wrap: wrap;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ max-height: 30vh;
|
|
|
+ overflow-x: hidden;
|
|
|
+ overflow-y: scroll;
|
|
|
+ }
|
|
|
+
|
|
|
+ #v-keep-component .keep-component-tag i {
|
|
|
+ position: absolute;
|
|
|
+ width: 0.28rem;
|
|
|
+ height: 0.28rem;
|
|
|
+ bottom: 0;
|
|
|
+ right: 0;
|
|
|
+ opacity: 0;
|
|
|
+ -webkit-transition: all 0.2s;
|
|
|
+ transition: all 0.2s;
|
|
|
+ }
|
|
|
+ #v-keep-component .keep-component-tag {
|
|
|
+ position: relative;
|
|
|
+ max-width: 100%;
|
|
|
+ background: #F5F6F7;
|
|
|
+ border-radius: 0.08rem;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-style: normal;
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 0.28rem;
|
|
|
+ line-height: 0.4rem;
|
|
|
+ color: #5F5E64;
|
|
|
+ padding: 0.1rem 0.2rem;
|
|
|
+ margin-bottom: 0.24rem;
|
|
|
+ margin-right: 0.24rem;
|
|
|
+ -webkit-transition: color 0.2s;
|
|
|
+ transition: color 0.2s;
|
|
|
+ }
|
|
|
+ #v-keep-component .keep-component-tag.checked i {
|
|
|
+ opacity: 1;
|
|
|
+ }
|
|
|
+ #v-keep-component .keep-component-tag.checked {
|
|
|
+ background: #E8FAFD;
|
|
|
+ color: #2ABED1;
|
|
|
+ }
|
|
|
+
|
|
|
+ #v-keep-component .keep-component-input-group .van-button {
|
|
|
+ margin-left: 0.3rem;
|
|
|
+ padding: 0.2rem;
|
|
|
+ padding-right: 0;
|
|
|
+ -webkit-flex-shrink: 0;
|
|
|
+ flex-shrink: 0;
|
|
|
+ background: transparent;
|
|
|
+ border-color: transparent;
|
|
|
+ color: inherit;
|
|
|
+ }
|
|
|
+ #v-keep-component .keep-component-input-group {
|
|
|
+ width: 100%;
|
|
|
+ display: -webkit-box;
|
|
|
+ display: -webkit-flex;
|
|
|
+ display: flex;
|
|
|
+ -webkit-box-orient: horizontal;
|
|
|
+ -webkit-box-direction: normal;
|
|
|
+ -webkit-flex-direction: row;
|
|
|
+ flex-direction: row;
|
|
|
+ -webkit-box-align: center;
|
|
|
+ -webkit-align-items: center;
|
|
|
+ align-items: center;
|
|
|
+ -webkit-box-pack: justify;
|
|
|
+ -webkit-justify-content: space-between;
|
|
|
+ justify-content: space-between;
|
|
|
+ margin-bottom: 0.44rem;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-style: normal;
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 0.28rem;
|
|
|
+ line-height: 0.4rem;
|
|
|
+ color: #2ABED1;
|
|
|
+ }
|
|
|
+ #v-keep-component .keep-component-input-group input:focus {
|
|
|
+ border-color: #2ABED1;
|
|
|
+ }
|
|
|
+ #v-keep-component .keep-component-input-group input {
|
|
|
+ width: 100%;
|
|
|
+ -webkit-transition: width 0.2s;
|
|
|
+ transition: width 0.2s;
|
|
|
+ -webkit-box-flex: 1;
|
|
|
+ -webkit-flex: 1;
|
|
|
+ flex: 1;
|
|
|
+ border: 1px solid rgba(0, 0, 0, 0.1);
|
|
|
+ box-sizing: border-box;
|
|
|
+ border-radius: 0.08rem;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-style: normal;
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 0.3rem;
|
|
|
+ line-height: 0.44rem;
|
|
|
+ color: #5F5E64;
|
|
|
+ padding: 0.26rem 0.32rem;
|
|
|
+ }
|
|
|
+
|
|
|
+ #v-keep-component .disabled-event .van-button{
|
|
|
+ opacity: 0.5;
|
|
|
+ cursor: not-allowed;
|
|
|
+ }
|
|
|
+</style>`
|
|
|
+
|
|
|
+// 部分页面没有全局工具函数
|
|
|
+if (typeof utils !== 'object') {
|
|
|
+ utils = {}
|
|
|
+}
|
|
|
+utils.isWeiXinBrowser = navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1
|
|
|
+
|
|
|
+Vue.component('keep-component', {
|
|
|
+ delimiters: ['@@', '@@'],
|
|
|
+ template: `
|
|
|
+<div id="v-keep-component" v-cloak>
|
|
|
+ <van-popup v-model="showKeepDialog" class="popup-group" :close-on-click-overlay="!isLoading && !isAddLoading" :close-on-popstate="true">
|
|
|
+ <div class="keep-component-group" v-bind:class="{'disabled-event': isLoading || isAddLoading}">
|
|
|
+ <div class="keep-component-title">
|
|
|
+ <h3>选择标签</h3>
|
|
|
+ <div class="icon-padding-box" @click="togglePopStatus(false)">
|
|
|
+ <i class="j-icon base-icon icon-delete-gray"></i>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="kee-component-content">
|
|
|
+ <div class="keep-component-input-group">
|
|
|
+ <input v-model.trim="tagInput" type="text" placeholder="请输入标签">
|
|
|
+ <van-button v-show="isAddLoading || getOnlyStatus" @click="addTag" :loading="isAddLoading" type="primary">添加并使用</van-button>
|
|
|
+ </div>
|
|
|
+ <div v-show="!isGetTagsLoading" class="keep-component-tag-group">
|
|
|
+ <div class="keep-component-tag" @click="toggleTagStatus(item)" v-for="item in tags" :key="item.title" :class="{'checked': item.checked}">
|
|
|
+ <div class="van-ellipsis">@@item.title@@</div>
|
|
|
+ <i class="j-icon base-icon icon-corner-mark"></i>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <van-loading v-show="isGetTagsLoading" />
|
|
|
+ </div>
|
|
|
+ <div class="keep-component-bottom">
|
|
|
+ <van-button @click="submitSave" :loading="isLoading" loading-text="保存中..." type="primary">确定</van-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </van-popup>
|
|
|
+</div>
|
|
|
+ `,
|
|
|
+ props: {
|
|
|
+ baseAjaxURL: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
+ bid: {
|
|
|
+ type: String,
|
|
|
+ required: true,
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
+ // 是否首次打开时默认请求一次标签组
|
|
|
+ first: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ },
|
|
|
+ // 是否每次打开这遮罩时都请求标签组
|
|
|
+ every: {
|
|
|
+ type: Boolean,
|
|
|
+ default: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data: function () {
|
|
|
+ return {
|
|
|
+ showKeepDialog: false,
|
|
|
+ isLoading: false,
|
|
|
+ isAddLoading: false,
|
|
|
+ isGetTagsLoading: true,
|
|
|
+ tagInput: '',
|
|
|
+ tags: []
|
|
|
+ }
|
|
|
+ } ,
|
|
|
+ mounted () {
|
|
|
+ $('head').append(tempStyleComponent)
|
|
|
+ if (this.first) {
|
|
|
+ this.ajaxGetAllTags()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ checkNowPower () {
|
|
|
+ var tempPower = window.jyUserPower
|
|
|
+ var resultPower = false
|
|
|
+ if (tempPower) {
|
|
|
+ resultPower = tempPower.entniche || tempPower.member || tempPower.vip !== 0
|
|
|
+ }
|
|
|
+ return resultPower
|
|
|
+ },
|
|
|
+ getLids () {
|
|
|
+ return this.tags.filter(function (v) {
|
|
|
+ return v.checked
|
|
|
+ }).map(function (v) {
|
|
|
+ return v.lid
|
|
|
+ }).join(',')
|
|
|
+ },
|
|
|
+ getOnlyStatus () {
|
|
|
+ var _this = this
|
|
|
+ return this.tagInput !== '' && this.tags.filter(function (v) {
|
|
|
+ return v.title === _this.tagInput
|
|
|
+ }).length === 0
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ checkAjaxFirst () {
|
|
|
+ if (!this.first) {
|
|
|
+ this.ajaxGetAllTags()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ajaxFn: function (url, data, callback, type) {
|
|
|
+ return $.ajax({
|
|
|
+ type: 'post',
|
|
|
+ url: this.baseAjaxURL + url,
|
|
|
+ contentType: type ? 'application/x-www-form-urlencoded' : "application/json;charset=utf-8",
|
|
|
+ data: type ? data : JSON.stringify(data),
|
|
|
+ dataType: "json",
|
|
|
+ success: typeof callback === 'function' ? callback.bind(this) : new Function()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ ajaxGetAllTags () {
|
|
|
+ this.isGetTagsLoading = true
|
|
|
+ this.ajaxFn('/publicapply/bidcoll/getLabel', {} , function (r) {
|
|
|
+ this.isGetTagsLoading = false
|
|
|
+ if (r && r.error_msg === '' && r.data) {
|
|
|
+ this.tags = r.data.map(function (v) {
|
|
|
+ return {
|
|
|
+ lid: v.lid,
|
|
|
+ title: v.lanme,
|
|
|
+ checked: false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ ajaxAddKeep (id, type) {
|
|
|
+ var _this = this
|
|
|
+ var tempFn = function () {
|
|
|
+ _this.ajaxAddKeepFn(id, type)
|
|
|
+ }
|
|
|
+ if (type) {
|
|
|
+ $.post('/salesLeads/retainedCapital', { source: 'article_collection' }).done(function (r) {
|
|
|
+ if (r && r.error_msg === '' && r.data) {
|
|
|
+ if (r.data.retainedCapital) {
|
|
|
+ _this.$dialog.close()
|
|
|
+ _this.$dialog.confirm({
|
|
|
+ message: '重要项目一键创建标签收藏!请完善个人信息,为您匹配精准服务',
|
|
|
+ className: 'ent-search-dialog max-54 add-close-after',
|
|
|
+ overlayClass: 'z-2030',
|
|
|
+ showCancelButton: false,
|
|
|
+ confirmButtonText: '立即前往',
|
|
|
+ }).then(function () {
|
|
|
+ sessionStorage.setItem('salesBackData', JSON.stringify({
|
|
|
+ type: 'article_collection',
|
|
|
+ id: id,
|
|
|
+ shoucang: type
|
|
|
+ }))
|
|
|
+ try {
|
|
|
+ if (SuperSearch && typeof SuperSearch.setSessionStorage === 'function') {
|
|
|
+ SuperSearch.setSessionStorage();
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ console.log('no list')
|
|
|
+ }
|
|
|
+ location.href = (utils.isWeiXinBrowser ? '/weixin' : '/jyapp') + '/frontPage/bigmember/free/perfect_info?origin=article_collection'
|
|
|
+ }).catch(function () {});
|
|
|
+ $("body").on('click', '.add-close-after .van-dialog__content', function (e) {
|
|
|
+ _this.$dialog.close()
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ tempFn()
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ tempFn()
|
|
|
+ }
|
|
|
+ }).fail(function () {
|
|
|
+ tempFn()
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ tempFn()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ajaxAddKeepFn (id, type) {
|
|
|
+ try {
|
|
|
+ var isContent = location.href.indexOf('/article/content') !== -1
|
|
|
+ _hmt.push(['_trackEvent','超级订阅-' + (utils.isWeiXinBrowser ? 'wx' : 'app'), 'click', (isContent ? '详情页标讯收藏按钮' : '列表页标讯收藏-星标')]);
|
|
|
+ } catch (e) {
|
|
|
+ console.log('未初始化百度统计')
|
|
|
+ }
|
|
|
+ var t = this.$toast.loading({
|
|
|
+ duration: 0, // 持续展示 toast
|
|
|
+ forbidClick: true,
|
|
|
+ message: '提交中',
|
|
|
+ })
|
|
|
+ this.ajaxFn('/publicapply/bidcoll/action', { baction: type ? 'C' : 'R', binfo: [{ bid: id }] }, function (r) {
|
|
|
+ if (r && r.error_msg === '' && r.data) {
|
|
|
+ t.clear()
|
|
|
+ if (type) {
|
|
|
+ this.togglePopStatus(true)
|
|
|
+ this.$emit('on-change-keep', true)
|
|
|
+ } else {
|
|
|
+ this.$emit('on-change-keep', false)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ t.clear()
|
|
|
+ var _this = this
|
|
|
+ if (r.error_msg === '付费用户收藏已达上限') {
|
|
|
+ this.$dialog.close()
|
|
|
+ this.$dialog.confirm({
|
|
|
+ message: '您的标讯收藏上限为5000条,请联系客服人员',
|
|
|
+ className: 'ent-search-dialog',
|
|
|
+ overlayClass: 'z-2030',
|
|
|
+ showCancelButton: false,
|
|
|
+ confirmButtonText: '我知道了',
|
|
|
+ }).then(function () {}).catch(function () {});
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (r.error_msg === '免费用户收藏已达上限') {
|
|
|
+ this.$dialog.close()
|
|
|
+ this.$dialog.confirm({
|
|
|
+ message: '您的标讯收藏上限为100条,请升级为会员服务',
|
|
|
+ className: 'ent-search-dialog',
|
|
|
+ overlayClass: 'z-2030',
|
|
|
+ confirmButtonText: '去升级'
|
|
|
+ }).then(function () {
|
|
|
+ _this.goUpBuyPage()
|
|
|
+ }).catch(function () {});
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$toast(r.error_msg || '已取消收藏')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ goUpBuyPage () {
|
|
|
+ try {
|
|
|
+ _hmt.push(['_trackEvent','超级订阅-' + (utils.isWeiXinBrowser ? 'wx' : 'app'), 'click', '标讯收藏满100条-去升级']);
|
|
|
+ } catch (e) {
|
|
|
+ console.log('未初始化百度统计')
|
|
|
+ }
|
|
|
+ window.location.href = (utils.isWeiXinBrowser ? '/front' : '/jyapp') + '/vipsubscribe/vipsubscribe_new'
|
|
|
+ },
|
|
|
+ togglePopStatus (type) {
|
|
|
+ this.showKeepDialog = type
|
|
|
+ if (type && this.every) {
|
|
|
+ this.ajaxGetAllTags()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ toggleTagStatus (item) {
|
|
|
+ item.checked = !item.checked
|
|
|
+ },
|
|
|
+ submitSave () {
|
|
|
+ this.isLoading = true
|
|
|
+ this.ajaxFn('/publicapply/bidcoll/label', {
|
|
|
+ lids: this.getLids,
|
|
|
+ laction: 'S',
|
|
|
+ binfo: [
|
|
|
+ {
|
|
|
+ bid: this.bid
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }, function (r) {
|
|
|
+ if (r && r.error_msg === '' && r.data) {
|
|
|
+ this.isLoading = false
|
|
|
+ this.$toast(r.error_msg || '已收藏至“我的-标讯收藏”')
|
|
|
+ this.togglePopStatus(false)
|
|
|
+ } else {
|
|
|
+ this.$toast(r.error_msg)
|
|
|
+ this.isLoading = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ addTagInList (id) {
|
|
|
+ var tempInput = this.tagInput
|
|
|
+ this.tagInput = ''
|
|
|
+ this.tags.push({
|
|
|
+ lid: id,
|
|
|
+ title: tempInput,
|
|
|
+ checked: true
|
|
|
+ })
|
|
|
+ this.isAddLoading = false
|
|
|
+ },
|
|
|
+ addTag () {
|
|
|
+ this.isAddLoading = true
|
|
|
+ this.ajaxFn('/publicapply/bidcoll/addLabel', { name: this.tagInput }, function (r) {
|
|
|
+ if (r && r.error_msg === '' && r.data) {
|
|
|
+ this.addTagInList(r.data)
|
|
|
+ } else {
|
|
|
+ this.$toast(r.error_msg)
|
|
|
+ this.isAddLoading = false
|
|
|
+ }
|
|
|
+ }, true)
|
|
|
+ }
|
|
|
+ }
|
|
|
+})
|
|
|
+// 检查返回是否需要继续下一步
|
|
|
+function checkBackSuccess () {
|
|
|
+ var isBackSuccess = sessionStorage.getItem('salesBackStatus') || false
|
|
|
+ if (isBackSuccess == 'true') {
|
|
|
+ var sessionData = JSON.parse(sessionStorage.getItem('salesBackData') || '{}')
|
|
|
+ if (sessionData.type === 'article_collection') {
|
|
|
+ if (vKeepComponent) {
|
|
|
+ vKeepComponent.changeBid(sessionData.id, sessionData.shoucang)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (sessionData.type === 'article_original') {
|
|
|
+ if (utils.isWeiXinBrowser) {
|
|
|
+ location.href = sessionData.url
|
|
|
+ } else {
|
|
|
+ JyObj.openExternalLink(sessionData.url,"查看原文");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sessionStorage.removeItem('salesBackStatus')
|
|
|
+ sessionStorage.removeItem('salesBackData')
|
|
|
+}
|
|
|
+$(function () {
|
|
|
+ checkBackSuccess()
|
|
|
+})
|