Răsfoiți Sursa

Merge remote-tracking branch 'origin/dev4.6.2.15' into dev4.6.2.15

wangkaiyue 3 ani în urmă
părinte
comite
500250f55b

+ 1 - 1
src/jfw/front/frontRouter.go

@@ -175,7 +175,7 @@ func (this *CommonRouter) doPcBigPage(pageSign string) error {
 		if array := strings.Split(pageSign, "/"); len(array) > 0 {
 		if array := strings.Split(pageSign, "/"); len(array) > 0 {
 			pageSign = array[0]
 			pageSign = array[0]
 		}
 		}
-		log.Println(bigVipFreePageReg.MatchString(pageSign), pageSign)
+		log.Println(bigVipFreePageReg.MatchString(pageSign), "+++", pageSign)
 		if !bigVipFreePageReg.MatchString(pageSign) {
 		if !bigVipFreePageReg.MatchString(pageSign) {
 			bigBaseMsg := jy.GetBigVipUserBaseMsg(userid, public.Mysql, public.MQFW)
 			bigBaseMsg := jy.GetBigVipUserBaseMsg(userid, public.Mysql, public.MQFW)
 			if bigBaseMsg.Status <= 0 && bigBaseMsg.Vip_BuySet.Upgrade != 1 {
 			if bigBaseMsg.Status <= 0 && bigBaseMsg.Vip_BuySet.Upgrade != 1 {

+ 1 - 1
src/jfw/modules/bigmember/src/service/analysis/decision.go

@@ -605,7 +605,7 @@ func getDecInfo(decQuery, buyer_buyerClass string, dec *DecParam) map[string]int
 						var entId = ""
 						var entId = ""
 						if group_entidlist != nil && group_entidlist["buckets"] != nil {
 						if group_entidlist != nil && group_entidlist["buckets"] != nil {
 							buckets := qutil.ObjArrToMapArr(group_entidlist["buckets"].([]interface{}))
 							buckets := qutil.ObjArrToMapArr(group_entidlist["buckets"].([]interface{}))
-							if buckets == nil || len(buckets) == 0 {
+							if buckets == nil || len(buckets) == 0 || (buckets[0]["key"] != nil && len(qutil.ObjToString(buckets[0]["key"])) < 10) {
 								continue
 								continue
 							}
 							}
 							entId = util.EncodeId(qutil.ObjToString(buckets[0]["key"]))
 							entId = util.EncodeId(qutil.ObjToString(buckets[0]["key"]))

+ 9 - 2
src/jfw/modules/bigmember/src/service/use/use.go

@@ -601,6 +601,13 @@ func (u *Use) IsAdd() {
 		if userid == "" {
 		if userid == "" {
 			return Result{Data: nil, Error_msg: "未登录"}
 			return Result{Data: nil, Error_msg: "未登录"}
 		}
 		}
+		var hasKey bool
+		user, ok := db.Mgo.FindById("user", userid, `{"o_jy":1,"i_vip_status":1,"l_vip_endtime":1,"o_vipjy":1,"o_member_jy":1}`)
+		if ok && user != nil {
+			o_jy, _ := (*user)["o_jy"].(map[string]interface{})
+			a_key, _ := o_jy["a_key"].([]interface{})
+			hasKey = len(a_key) > 0
+		}
 		//获取用户权限详情
 		//获取用户权限详情
 		power := []int{} //GetNewPower(userid)
 		power := []int{} //GetNewPower(userid)
 		bigPower := jy.GetBigVipUserBaseMsg(userid, db.Mysql, db.Mgo)
 		bigPower := jy.GetBigVipUserBaseMsg(userid, db.Mysql, db.Mgo)
@@ -626,8 +633,8 @@ func (u *Use) IsAdd() {
 		uk := qu.If(notBigFileBool && bigPower.VipStatus > 0 && bigPower.Vip_BuySet.Upgrade == 1, "v", "f").(string)
 		uk := qu.If(notBigFileBool && bigPower.VipStatus > 0 && bigPower.Vip_BuySet.Upgrade == 1, "v", "f").(string)
 		// log.Println(uk, "-----", config.Config.FileUploadNum[uk])
 		// log.Println(uk, "-----", config.Config.FileUploadNum[uk])
 		d["fileNum"] = config.Config.FileUploadNum[uk] - redis.GetInt(jy.PowerCacheDb, fmt.Sprintf(jy.VipFileUploadNumKey, userid, fmt.Sprint(time.Now().Month())))
 		d["fileNum"] = config.Config.FileUploadNum[uk] - redis.GetInt(jy.PowerCacheDb, fmt.Sprintf(jy.VipFileUploadNumKey, userid, fmt.Sprint(time.Now().Month())))
-		//新用户->新订阅设置页面
-		if config.Config.NewFreeUser < bigPower.Registedate {
+		//新用户->新订阅设置页面||老用户无关键词
+		if config.Config.NewFreeUser < bigPower.Registedate || !hasKey {
 			d["isUpgrade"] = true
 			d["isUpgrade"] = true
 		}
 		}
 		uid := userid
 		uid := userid

+ 67 - 0
src/web/staticres/diy-report/css/report-list.css

@@ -0,0 +1,67 @@
+.info-card-group {
+    padding: 20px;
+    box-sizing: border-box;
+    background: #F4F5F7;
+    font-family: -apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif;
+
+}
+.info-card-group .info-card-item + .info-card-item {
+    margin-top: 17px;
+}
+.info-card-group .info-card-item {
+    background: #FFFFFF;
+    box-shadow: 0px 2px 8px 1px rgba(54, 147, 179, 0.05);
+    border-radius: 8px;
+    padding: 16px 12px;
+    box-sizing: border-box;
+    font-size: 13px;
+    font-weight: 500;
+    color: #5E5E64;
+    line-height: 20px;
+}
+.info-card-item .text-title {
+    font-size: 15px;
+    font-weight: 500;
+    color: #161826;
+    line-height: 22px;
+}
+.info-flex-r-box {
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    justify-content: space-between;
+}
+.info-card-item .info-content-group {
+    margin-top: 8px;
+}
+.info-card-item .info-content-group .info-content-label {
+    flex-shrink: 0;
+}
+.info-card-item .info-content-group .info-flex-r-box {
+    margin-top: 4px;
+    align-items: flex-start;
+    justify-content: flex-start;
+}
+.info-card-item button {
+    display: block;
+    margin: 0 auto;
+    margin-top: 12px;
+    width: 271px;
+    height: 36px;
+    background: #2CB7CA;
+    border-radius: 6px;
+    font-size: 16px;
+    font-weight: 400;
+    color: #FFFFFF;
+    border: none;
+}
+.info-card-item .toggle-row-box i {
+    font-size: 16px;
+    margin-left: 2px;
+}
+.info-card-item .toggle-row-box {
+    color: #2ABDD1;
+}
+[v-cloak] {
+    opacity: 0;
+}

+ 243 - 0
src/web/staticres/diy-report/js/report-list.js

@@ -0,0 +1,243 @@
+if (typeof Date.prototype.pattern !== 'function') {
+    Date.prototype.pattern = function (fmt) {
+        var o = {
+            'y+': this.getFullYear(),
+            'M+': this.getMonth() + 1, //月份
+            'd+': this.getDate(), //日
+            'h+': this.getHours() % 12 == 0 ? 12 : this.getHours() % 12, //小时
+            'H+': this.getHours(), //小时
+            'm+': this.getMinutes(), //分
+            's+': this.getSeconds(), //秒
+            'q+': Math.floor((this.getMonth() + 3) / 3), //季度
+            'S': this.getMilliseconds(), //毫秒
+            'E+': this.getDay(), // 周
+        };
+        var week = {
+            '0': '日',
+            '1': '一',
+            '2': '二',
+            '3': '三',
+            '4': '四',
+            '5': '五',
+            '6': '六'
+        };
+        if (/(y+)/.test(fmt)) {
+            fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length));
+        }
+        if (/(E+)/.test(fmt)) {
+            fmt = fmt.replace(RegExp.$1, ((RegExp.$1.length > 1) ? (RegExp.$1.length > 2 ? '星期' : '周') : '') + week[
+            this.getDay() + '']);
+        }
+        for (var k in o) {
+            if (new RegExp('(' + k + ')').test(fmt)) {
+                fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k])
+                    .length)));
+            }
+        }
+        return fmt;
+    }
+}
+var reportListTemplate = `
+    <div id="reportList" class="info-card-group" v-cloak>
+        <van-list
+                v-model="listState.loading"
+                :finished="listState.finished"
+                finished-text="没有更多了"
+                @load="getList"
+        >
+            <div class="info-card-item" v-for="(item, i) in reportList" :key="item.id">
+            <div class="info-flex-r-box">
+                <div class="text-title">报告&nbsp;@@(item.createTime * 1000)|FormatTime('yyyy-MM-dd HH:mm:ss')@@</div>
+                <div class="info-flex-r-box toggle-row-box" @click="item.open = !item.open">
+                    <span>@@item.open ? '收起' : '展开'@@条件</span>
+                    <transition name="van-fade">
+                        <i class="van-icon" :class="{'van-icon-arrow-down': !item.open, 'van-icon-arrow-up': item.open}"></i>
+                    </transition>
+                </div>
+            </div>
+            <div class="info-content-group">
+                <div class="info-flex-r-box">
+                    <span class="info-content-label">分析内容:</span>
+                    <div class="info-content-box" :class="{'van-ellipsis': !item.open}">
+                        @@item.keysItems|FormatKeys@@
+                    </div>
+                </div>
+                <div class="info-flex-r-box">
+                    <span class="info-content-label">时间:</span>
+                    <div class="info-content-box" :class="{'van-ellipsis': !item.open}">
+                        @@(item.startTime * 1000)|FormatTime('yyyy-MM-dd')@@-@@(item.endTime * 1000)|FormatTime('yyyy-MM-dd')@@
+                    </div>
+                </div>
+                <div class="info-flex-r-box">
+                    <span class="info-content-label">地区:</span>
+                    <div class="info-content-box" :class="{'van-ellipsis': !item.open}">
+                        @@item.area|FormatComma@@
+                        @@item.city|FormatComma@@
+                    </div>
+                </div>
+                <div class="info-flex-r-box">
+                    <span class="info-content-label">行业:</span>
+                    <div class="info-content-box" :class="{'van-ellipsis': !item.open}">
+                        @@item.industry|FormatComma@@
+                    </div>
+                </div>
+                <div class="info-flex-r-box">
+                    <span class="info-content-label">采购单位类型:</span>
+                    <div class="info-content-box" :class="{'van-ellipsis': !item.open}">
+                        @@item.buyerclass|FormatComma@@
+                    </div>
+                </div>
+            </div>
+            <button @click="goReport(item.id)">查看报告</button>
+        </div>
+        </van-list>
+    </div>
+</div>
+`
+var reportListMobileComponent = {
+    name: 'report-list',
+    template: reportListTemplate,
+    delimiters: ['@@', '@@'],
+    data: function () {
+        return {
+            queryId: 'xxx',
+            listState: {
+                loading: true,
+                finished: false,
+                pageNum: 0,
+                pageSize: 5
+            },
+            reportList: []
+        }
+    },
+    filters: {
+        FormatTime: function (value, fmt) {
+            return new Date(value).pattern(fmt)
+        },
+        FormatComma: function (value) {
+            return value.replace(/,/g, ',')
+        },
+        FormatKeys: function (keys) {
+            var tempStr = ''
+            try {
+                var tempResult= []
+                var tempList = JSON.parse(keys)
+                tempList.forEach(function (v) {
+                    v.a_key.forEach(function (k) {
+                        tempResult.push({
+                            key: [].concat(k.key, k.appendkey),
+                            type: k.matchway === 1 ? '精准' : '模糊'
+                        })
+                    })
+                })
+                tempStr = tempResult.map(function (v) {
+                    return '[' + v.key.join(' ') + ']' + '-' + v.type
+                }).join('、')
+            } catch (e) {
+
+            }
+            return tempStr
+        }
+    },
+    mounted: function () {
+        this.getList()
+    },
+    methods: {
+        goReport: function (id) {
+            console.log(id)
+            this.$emit('go-report', id)
+        },
+        getList: function () {
+            var tempRes = {
+                "error_code": 0,
+                "error_msg": "",
+                "data": {
+                    "list": [
+                        {
+                            "area": "北京",
+                            "buyerclass": "传媒,检察院,民政,农业",
+                            "city": "郑州,开封,商丘",
+                            "industry": "行政办公_办公用品,能源化工_化工产品,机械设备_矿山机械",
+                            "keysItems": "[{\"a_key\":[{\"appendkey\":[\"引擎\"],\"key\":[\"软件\"],\"matchway\":1,\"notkey\":[\"网站\"],\"updatetime\":1640657393},{\"appendkey\":[\"人工\"],\"key\":[\"智能\"],\"matchway\":0,\"notkey\":[\"报告\"],\"updatetime\":1640657384}],\"s_item\":\"科技\",\"updatetime\":1640657329},{\"a_key\":[{\"appendkey\":[\"绿化\"],\"key\":[\"道路\"],\"matchway\":0,\"notkey\":[\"路面\"],\"updatetime\":1640657384}],\"s_item\":\"建筑\",\"updatetime\":1640657329}]",
+                            "rangeTime": "-3year"
+                        },
+                        {
+                            "area": "北京",
+                            "buyerclass": "传媒,检察院,民政,农业",
+                            "city": "郑州,开封,商丘",
+                            "industry": "行政办公_办公用品,能源化工_化工产品,机械设备_矿山机械",
+                            "keysItems": "[{\"a_key\":[{\"appendkey\":[\"引擎\"],\"key\":[\"软件\"],\"matchway\":1,\"notkey\":[\"网站\"],\"updatetime\":1640657393},{\"appendkey\":[\"人工\"],\"key\":[\"智能\"],\"matchway\":0,\"notkey\":[\"报告\"],\"updatetime\":1640657384}],\"s_item\":\"科技\",\"updatetime\":1640657329},{\"a_key\":[{\"appendkey\":[\"绿化\"],\"key\":[\"道路\"],\"matchway\":0,\"notkey\":[\"路面\"],\"updatetime\":1640657384}],\"s_item\":\"建筑\",\"updatetime\":1640657329}]",
+                            "rangeTime": "-3year"
+                        },
+                        {
+                            "area": "北京",
+                            "buyerclass": "传媒,检察院,民政,农业",
+                            "city": "郑州,开封,商丘",
+                            "industry": "行政办公_办公用品,能源化工_化工产品,机械设备_矿山机械",
+                            "keysItems": "[{\"a_key\":[{\"appendkey\":[\"引擎\"],\"key\":[\"软件\"],\"matchway\":1,\"notkey\":[\"网站\"],\"updatetime\":1640657393},{\"appendkey\":[\"人工\"],\"key\":[\"智能\"],\"matchway\":0,\"notkey\":[\"报告\"],\"updatetime\":1640657384}],\"s_item\":\"科技\",\"updatetime\":1640657329},{\"a_key\":[{\"appendkey\":[\"绿化\"],\"key\":[\"道路\"],\"matchway\":0,\"notkey\":[\"路面\"],\"updatetime\":1640657384}],\"s_item\":\"建筑\",\"updatetime\":1640657329}]",
+                            "rangeTime": "-3year"
+                        },
+                        {
+                            "area": "北京",
+                            "buyerclass": "传媒,检察院,民政,农业",
+                            "city": "郑州,开封,商丘",
+                            "industry": "行政办公_办公用品,能源化工_化工产品,机械设备_矿山机械",
+                            "keysItems": "[{\"a_key\":[{\"appendkey\":[\"引擎\"],\"key\":[\"软件\"],\"matchway\":1,\"notkey\":[\"网站\"],\"updatetime\":1640657393},{\"appendkey\":[\"人工\"],\"key\":[\"智能\"],\"matchway\":0,\"notkey\":[\"报告\"],\"updatetime\":1640657384}],\"s_item\":\"科技\",\"updatetime\":1640657329},{\"a_key\":[{\"appendkey\":[\"绿化\"],\"key\":[\"道路\"],\"matchway\":0,\"notkey\":[\"路面\"],\"updatetime\":1640657384}],\"s_item\":\"建筑\",\"updatetime\":1640657329}]",
+                            "rangeTime": "-3year"
+                        },
+                        {
+                            "area": "北京",
+                            "buyerclass": "传媒,检察院,民政,农业",
+                            "city": "郑州,开封,商丘",
+                            "industry": "行政办公_办公用品,能源化工_化工产品,机械设备_矿山机械",
+                            "keysItems": "[{\"a_key\":[{\"appendkey\":[\"引擎\"],\"key\":[\"软件\"],\"matchway\":1,\"notkey\":[\"网站\"],\"updatetime\":1640657393},{\"appendkey\":[\"人工\"],\"key\":[\"智能\"],\"matchway\":0,\"notkey\":[\"报告\"],\"updatetime\":1640657384}],\"s_item\":\"科技\",\"updatetime\":1640657329},{\"a_key\":[{\"appendkey\":[\"绿化\"],\"key\":[\"道路\"],\"matchway\":0,\"notkey\":[\"路面\"],\"updatetime\":1640657384}],\"s_item\":\"建筑\",\"updatetime\":1640657329}]",
+                            "rangeTime": "-3year"
+                        }
+                    ],
+                    "total": 5
+                }
+            }
+            $.ajax({
+                // url: '/bigmember/marketAnalysis/analysisHistory',
+                url: '/test',
+                type: 'GET',
+                data: {
+                    id: this.queryId,
+                    pageNum: this.listState.pageNum,
+                    pageSize: this.listState.pageSize
+                },
+                success: function (res) {
+                    res = tempRes
+                    if (res && res.data && res.error_msg === '') {
+                        var tempList = res.data.list.map(function (v) {
+                            v.open = false
+                            // TODO 下列接口数据待处理
+                            v.id = new Date().getTime() + Math.random()
+                            v.createTime = new Date().getTime() / 1000
+                            v.startTime = new Date().getTime() / 1000
+                            v.endTime = new Date().getTime() / 1000
+                            return v
+                        })
+                        this.listState.pageNum++
+                        // 本地测试
+                        if (this.listState.pageNum > 2) {
+                            tempList.pop()
+                        }
+                        this.reportList = this.reportList.concat(tempList)
+                        if (tempList.length < this.listState.pageSize) {
+                            this.listState.finished = true
+                        }
+                        this.listState.loading = false
+                    } else {
+                        this.listState.finished = true
+                        this.listState.loading = false
+                    }
+                }.bind(this),
+                error: function (err) {
+                    this.listState.finished = true
+                    this.listState.loading = false
+                }.bind(this)
+            })
+        }
+    }
+}