Эх сурвалжийг харах

feat: 新增移动端附件下载包列表页面

zhangyuhan 3 жил өмнө
parent
commit
2850fa3388

+ 65 - 53
src/jfw/modules/app/src/web/templates/frontRouter/fileRecord/sess/index.html

@@ -13,6 +13,57 @@
       .pro-log .on{
         color: #2ABED1!important;
       }
+      .file-list-item {
+          display: flex;
+          flex-direction: row;
+          align-items: flex-start;
+          padding: 0.32rem;
+          box-sizing: border-box;
+          margin-bottom: 0.16rem;
+          background: #FFFFFF;
+      }
+      .file-list-item .file-icon {
+          width: 0.48rem;
+          height: 0.48rem;
+          margin-right: 0.16rem;
+      }
+      .file-info-group {
+          display: flex;
+          flex-direction: column;
+      }
+      .file-list-item .file-title {
+          font-size: 0.3rem;
+          font-weight: 500;
+          color: #171826;
+          line-height: 0.44rem;
+          margin-bottom: 0.16rem;
+      }
+      .file-list-item a {
+          width: 6.22rem;
+          text-decoration: underline;
+          overflow: hidden;
+          white-space: nowrap;
+          text-overflow: ellipsis;
+          font-size: 0.26rem;
+          font-weight: 500;
+          color: #2ABED1;
+          line-height: 0.4rem;
+          margin-bottom: 0.24rem;
+      }
+      .file-list-item .file-info img {
+          width: 0.32rem;
+          height: 0.32rem;
+      }
+      .file-list-item .file-info {
+          display: flex;
+          flex-direction: row;
+          justify-content: space-between;
+          align-items: center;
+          font-size: 0.22rem;
+          font-weight: 500;
+          color: #9B9CA3;
+          line-height: 0.4rem;
+      }
     </style>
 </head>
 <body>
@@ -23,13 +74,12 @@
         <div class="j-main">
           <div class="t-bg flex" style="min-height:3.28rem;">
             <div class="nums">
-              <span>{points.total - points.usage}</span>个
+              <span v-if="points.total">{points.total - points.usage}</span>个
               <img src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/portraitRecord/image/help-p.png?v={{Msg "seo" "version"}}' @click="helpTiped" alt="">
             </div>
             <div class="btns flex">
               <span>当月附件下载余额</span>
-              <van-button round type="primary" @click="contractPerson" v-if="contracted">联系客服</van-button>
-              <van-button round type="primary" v-else @click="setBook">立即充值</van-button>
+              <van-button round type="primary"  @click="setBook">立即充值</van-button>
             </div>
           </div>
           <div class="p1-date">
@@ -62,58 +112,20 @@
               finished-text=""
               @load="onLoad"
             >
-                <div v-if="ptype==''" class="ent-search-item" v-for="(item, i) in list" :key="item._id" @click="detailed(item._id)">
-                    <div class="ent-info-top">
-                        <div class="ent-info-head" :style="{'background-color': item.color}">{item.abbr}</div>
-                        <div class="ent-info-keep">
-                            <div class="ent-row">
-                                <div class="ent-name van-ellipsis">{item.name}</div>
-                                <div class="fill-icon-box" style="display: none">
-                                    <i class="j-icon base-icon icon-no-favorite"></i>
-                                </div>
-                            </div>
-                            <div class="ent-more">
-                                <div v-if="item.legal">法定代表人: <span>{item.legal}</span></div>
-                                <div v-if="item.money">注册资本: <span>{item.money}万元</span></div>
-                            </div>
-                            <div class="ent-line-box"></div>
-                        </div>
-                    </div>
-                    <div class="ent-info-bottom ent-row" v-show="item.status >= 0 || item.address">
-                        <div class="ent-info-status-box">
-                            <span class="ent-info-status" v-show="item.status >= 0" :class="'status-' + item.status">{statusEnum[item.status]}</span>
-                        </div>
-                        <div  class="ent-row ent-address"  v-show="item.address">
-                            <div class="van-multi-ellipsis--l2">{item.address}</div>
-                            <i class="j-icon base-icon icon-address"></i>
-                        </div>
+                <div  class="file-list-item" v-for="(item, i) in list" :key="i">
+                    <div class="file-icon">
+                        <img v-if="item.icon === 'doc'"  src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/file-pack/images/icon-word.png?v={{Msg "seo" "version"}}" :alt="item.icon">
+                        <img v-else  src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/file-pack/images/icon-rar.png?v={{Msg "seo" "version"}}" :alt="item.icon">
                     </div>
-                </div>
-                <div v-if="ptype=='1'" class="ent-search-item" v-for="(item, i) in list" :key="item._id" @click="detailed(item._id)">
-                    <div class="ent-info-top">
-                        <div class="ent-info-head" :style="{'background-color': item.color}">{item.abbr}</div>
-                        <div class="ent-info-keep">
-                            <div class="ent-row">
-                                <div class="ent-name van-ellipsis">{item.name}</div>
-                                <div class="fill-icon-box" style="display: none">
-                                    <i class="j-icon base-icon icon-no-favorite"></i>
-                                </div>
-                            </div>
-                            <div class="ent-more">
-                                <div>所在地:
-                                  <span v-if="item.province">{item.province}</span>
-                                  <span v-if="item.city"> {item.city}</span>
-                                  <span v-if="!item.province && !item.city">--</span>
-                                </div>
-                                <div>采购单位类型:
-                                  <span v-if="item.buyerClass">{item.buyerClass}</span>
-                                  <span v-else>--</span>
-                                </div>
-                            </div>
-                            <div class="ent-line-box"></div>
+                    <div class="file-info-group">
+                        <div class="file-title">{item.s_fileName}</div>
+                        <a :href="item.articleUrl">来源:{item.s_title}</a>
+                        <div class="file-info">
+                            <span>于{item.l_date}下载</span>
+                            <img @click="downFile(item)" src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/file-pack/images/icon-down.png?v={{Msg "seo" "version"}}" alt="down">
                         </div>
                     </div>
-                </div>
+               </div>
             </van-list>
           </div>
           <van-loading size="24px" vertical v-if="working">加载中...</van-loading>
@@ -136,7 +148,7 @@
   <!--E-当前页面的资源-->
   {{include "/big-member/commonjs.html"}}
   <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/public/js/china-map-data.js?v={{Msg "seo" "version"}}'></script>
-  <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/portraitRecord/js/index.js?v={{Msg "seo" "version"}}'></script>
+  <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/file-pack/js/index.js?v={{Msg "seo" "version"}}'></script>
   {{include "/common/baiducc.html"}}
 </body>
 

+ 316 - 0
src/web/staticres/common-module/file-pack/js/index-wx.js

@@ -0,0 +1,316 @@
+function getShortName (comName) {
+  var areaMap = chinaMapJSON || []
+  var shortname = comName
+  // 1. 循环省份城市进行替换
+  areaMap.forEach(function (item) {
+    var p = item.name.replace(/[省市]/, '')
+    if (shortname.indexOf(p) !== -1) {
+      shortname = shortname.replace(item.name, '').replace(p, '')
+      console.log(p + ' -> \'\'')
+    }
+    item.city.forEach(function (iitem) {
+      var c = iitem.name.replace(/[省市]/, '')
+      if (shortname.indexOf(c) !== -1) {
+        shortname = shortname.replace(iitem.name, '').replace(c, '')
+        console.log(c + ' -> \'\'')
+      }
+      iitem.area.forEach(function (iiitem) {
+        if (shortname.indexOf(iiitem) !== -1) {
+          shortname = shortname.replace(iiitem, '')
+          console.log(iiitem + ' -> \'\'')
+        }
+      })
+    })
+  })
+  var matchRes = shortname.match(/[\u4e00-\u9fa5]{4}/gm)
+  var shortname = matchRes ? matchRes[0] : shortname.slice(0, 4)
+  if (shortname.length < 4) {
+    shortname = shortname.slice(0, 4)
+  }
+  return shortname
+}
+
+var formatter11 = (type, val) => {
+  if (type === 'year') {
+    return `${val}年`;
+  }
+  if (type === 'month') {
+    return `${val}月`;
+  }
+  return val;
+}
+
+var vm = new Vue({
+  el: '#proRecord',
+  delimiters: ['{', '}'],
+  data: function () {
+    return {
+      dValue: '',
+      pShow: false,
+      working: false,
+      empty: false,
+      curDate: '',
+      minDate: '',
+      maxTime: '',
+      points: [],
+      years: '',
+      months: '',
+      contracted: false,
+      listInfo: {
+        value: '',
+        pageNum: 0,
+        pageSize: 10,
+        total: -1,
+        loading: true,
+        finished: false
+      },
+      statusEnum: ['存续', '吊销', '停业', '撤销'],
+      statusColors: ['#2CB7CA', '#F5AF5C', '#58A1E7', '#51CEA2'],
+      list: [],
+      ptype:""
+    }
+  },
+  created: function () {
+      this.getPType("type")
+      this.years = new Date().getFullYear()
+      this.months = parseInt(new Date().getMonth() + 1)
+      this.dValue = this.years + '年' + this.months + '月'
+      this.curDate = new Date()
+      this.minDate = new Date(2021, 0)
+      this.maxTime = new Date(this.years, this.months - 1)
+      this.subPoint()
+      this.onLoad()
+    	this.initHtml()
+  },
+  methods: {
+	initHtml(){
+		if(this.ptype=="1"){
+			document.title = '采购单位画像记录'
+            typeof setHeaderTitle === 'function' ? setHeaderTitle(document.title) : null
+			$(".btns span").text("当月采购单位画像剩余数")
+			$(".emptytext").text("暂无采购单位画像记录")
+		}
+	},
+	getPType(paraName){
+      	let _this = this
+		var url = document.location.toString();
+	   var arrObj = url.split("?");
+	   if (arrObj.length > 1) {
+      	var arrPara = arrObj[1].split("&");
+      	var arr;
+      	for (var i = 0; i < arrPara.length; i++) {
+        	arr = arrPara[i].split("=");
+        	if (arr != null && arr[0] == paraName) {
+          	_this.ptype =  arr[1];
+        	}
+      	}
+    	}
+	},
+    usedHised() {
+      let _this = this
+      _this.pShow = true
+    },
+    subPoint() {
+      $.ajax({
+        url: '/jypay/resourcePack/account',
+        type: 'POST',
+        contentType: 'application/x-www-form-urlencoded',
+        data: {
+          product: 'attachmentDownPack'
+        },
+        dataType: 'json'
+      }).done(res => {
+         res = {
+           "error_code": 0,
+           "error_msg": "",
+           "data": {
+             "code": 1,
+             "data": [
+               {
+                 "id": 393,
+                 "name": "附件下载包",
+                 "number": 25,
+                 "resourceType": "附件下载包",
+                 "thirtyNum": 0
+               }
+             ],
+             "message": "查询成功"
+           }
+         }
+          if (res.error_msg === '' && res.data && res.data.data) {
+            this.points = {
+              total: '',
+              usage: ''
+            }
+            try {
+              var tempInfo = res.data.data[0]
+              this.points = {
+                total: tempInfo.number,
+                usage: tempInfo.number
+          }
+              if (this.points.usage > tempInfo.thirtyNum) {
+                this.points.usage = tempInfo.thirtyNum
+              }
+            } catch (e) {
+              console.warn(e)
+            }
+          } else {
+            this.$toast(res.error_msg || '请稍后重试')
+        }
+      })
+    },
+    onLoad () {
+      this.ajaxEntList().done(this.doFormatList.bind(this))
+    },
+    doFormatList (r) {
+      r = {
+        "error_code": 0,
+        "error_msg": "",
+        "data": {
+          "list": [
+            {
+              "articleUrl": "/article/content/ABCY1wIfylYFjg4RHtzcE8sMDI%2FQTBgcUJ1PygoOSEgWXtwHBlUCdo%3D",
+              "l_date": "2022/01/07",
+              "s_downUrl": "https://jy-datafile.oss-cn-beijing.aliyuncs.com/c9b1ce564ef81a6e04506e93b7b576d1aaab933ae6dda728e4c7040a9fa537e4.docx",
+              "s_fileName": "空压机配件公告.docx",
+              "s_title": "中煤山西华昱能源有限公司空压机配件采购"
+            },
+            {
+              "articleUrl": "/article/content/ABCY1wIfykeJy87JFVzcE8sMDI%2FQTBgcUJ1PygoPT0wY3lwTwlUCcA%3D",
+              "l_date": "2022/01/07",
+              "s_downUrl": "https://jy-datafile.oss-cn-beijing.aliyuncs.com/aa6731849d5d6e16097abfcb2559674aa481948d4489688f947578d90e227242.pdf",
+              "s_fileName": "更正公告.pdf",
+              "s_title": "静宁县2021年古城镇基础设施(农村公路)建设项目更正公告"
+            }
+          ],
+          "total": 2
+        }
+      }
+      if (r && r.error_msg == '' && r.data) {
+        this.working = false
+        this.empty = true
+        this.listInfo.pageNum++
+        if (this.listInfo.pageNum === 1) {
+          if (r.data.total || r.data.total === 0) {
+            this.listInfo.total = r.data.total
+          } else {
+            this.listInfo.finished = true
+          }
+        }
+
+        if (Array.isArray(r.data.list) && r.data.list.length !== 0) {
+          this.list = this.list.concat(r.data.list.map(function (v) {
+            var isDoc = /.doc(x{0,})$/.test(v.s_fileName)
+            v.icon = isDoc ? 'doc' : 'rar'
+            return v
+          }))
+        } else {
+          this.listInfo.finished = true
+        }
+
+        this.listInfo.loading = false
+        if (this.listInfo.total !== -1 && this.listInfo.total <= this.list.length) {
+          this.listInfo.finished = true
+        }
+      }
+    },
+    getDatas() {
+      return {
+        queryTime: new Date(this.years, this.months, 1).pattern('yyyy-MM'),
+        platform: navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1 ? 'WX' : 'APP',
+        productName: '附件下载包',
+        pageSize: this.listInfo.pageSize,
+        pageNum: this.listInfo.pageNum
+      }
+    },
+    ajaxEntList() {
+      this.working = true
+      this.empty = false
+      return $.ajax({
+        url: '/jypay/resourcePack/recordList',
+        type: 'POST',
+        contentType: 'application/x-www-form-urlencoded',
+        data: this.getDatas(),
+        dataType: 'json'
+      })
+    },
+    downFile (item) {
+      location.href = item.s_downUrl
+    },
+    commonDialogFn (message, confirmText, callBack) {
+      if (this.ptype == "1") {
+        var curDay = new Date().pattern('yyyy/MM/dd')
+        localStorage.setItem('show-buyer-dialog', curDay)
+      } else {
+        var curDay = new Date().pattern('yyyy/MM/dd')
+        localStorage.setItem('show-ent-dialog', curDay)
+      }
+      this.$dialog.confirm({
+        message: message,
+        width: 303,
+        className: 'pro-log',
+        messageAlign: 'left',
+        showCancelButton: 'true',
+        confirmButtonColor: '#2ABED1',
+        confirmButtonText: confirmText,
+        showCancelButton: true
+      }).then(function () {
+        callBack && callBack()
+      }).catch(function () { })
+    },
+    usedDialog () {
+      this.commonDialogFn('超级订阅用户每月享有下载10个附件的权限,也可充值附件下载包増加当月附件下载个数,每月1号上月余额清零重新计算。', '我知道了')
+    },
+    helpTiped() {
+        this.$dialog.alert({
+          width: 303,
+        message: '超级订阅用户每月享有下载<span class="on">10</span>个附件的权限,也可充值附件下载包増加当月附件下载个数,每月1号上月余额清零重新计算。',
+          className: 'pro-log',
+          messageAlign: 'left',
+          confirmButtonColor: '#2ABED1',
+          confirmButtonText: '我知道了',
+        })
+    },
+    confirmed(val) {
+      this.years = val.getFullYear()
+      this.months = val.getMonth() + 1
+      this.listInfo.pageNum = 0
+      this.list = []
+      this.listInfo.total = -1
+      this.listInfo.finished = false
+      this.listInfo.loading = true
+      this.onLoad()
+      this.dValue = this.years + '年' + this.months + '月'
+      this.pShow = false
+    },
+    canceled() {
+      this.pShow = false
+    },
+    ChangeDate (time){
+        var d = new Date(time)
+        var Y = d.getFullYear() + '年'
+        var M = (d.getMonth()+1 < 10 ? '0'+(d.getMonth()+1) : d.getMonth()+1) + '月'
+        return (Y + M).replace(/^\s+|\s+$/g,"")
+    },
+    detailed(ids) {
+    	if(this.ptype==""){
+        	location.href = '/weixin/frontPage/collection/sess/ent_portrait?eId=' + ids + '&svip=1'
+        }else{
+			location.href='/big/wx/page/unit_portrayal?entName=' + ids + '&svip=1'
+		}
+    },
+    contractPerson() {
+      // location.href = '400-108-6670'
+      location.href = '/big/wx/page/customer'
+    },
+    setBook() {
+      var temp = {
+        wx: '/swordfish/filePack/createOrder',
+        app: '/jyapp/filePack/createOrder'
+      }
+      var isWeixin = navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1
+      location.href = temp[isWeixin ? 'wx' : 'app']
+    }
+  }
+})
+

+ 320 - 0
src/web/staticres/common-module/file-pack/js/index.js

@@ -0,0 +1,320 @@
+function getShortName (comName) {
+  var areaMap = chinaMapJSON || []
+  var shortname = comName
+  // 1. 循环省份城市进行替换
+  areaMap.forEach(function (item) {
+    var p = item.name.replace(/[省市]/, '')
+    if (shortname.indexOf(p) !== -1) {
+      shortname = shortname.replace(item.name, '').replace(p, '')
+      console.log(p + ' -> \'\'')
+    }
+    item.city.forEach(function (iitem) {
+      var c = iitem.name.replace(/[省市]/, '')
+      if (shortname.indexOf(c) !== -1) {
+        shortname = shortname.replace(iitem.name, '').replace(c, '')
+        console.log(c + ' -> \'\'')
+      }
+      iitem.area.forEach(function (iiitem) {
+        if (shortname.indexOf(iiitem) !== -1) {
+          shortname = shortname.replace(iiitem, '')
+          console.log(iiitem + ' -> \'\'')
+        }
+      })
+    })
+  })
+  var matchRes = shortname.match(/[\u4e00-\u9fa5]{4}/gm)
+  var shortname = matchRes ? matchRes[0] : shortname.slice(0, 4)
+  if (shortname.length < 4) {
+    shortname = shortname.slice(0, 4)
+  }
+  return shortname
+}
+
+var formatter11 = (type, val) => {
+  if (type === 'year') {
+    return `${val}年`;
+  }
+  if (type === 'month') {
+    return `${val}月`;
+  }
+  return val;
+}
+
+var vm = new Vue({
+  el: '#proRecord',
+  delimiters: ['{', '}'],
+  data: function () {
+    return {
+      dValue: '',
+      pShow: false,
+      working: false,
+      empty: false,
+      curDate: '',
+      minDate: '',
+      maxTime: '',
+      points: [],
+      years: '',
+      months: '',
+      contracted: false,
+      listInfo: {
+        value: '',
+        pageNum: 0,
+        pageSize: 10,
+        total: -1,
+        loading: true,
+        finished: false
+      },
+      statusEnum: ['存续', '吊销', '停业', '撤销'],
+      statusColors: ['#2CB7CA', '#F5AF5C', '#58A1E7', '#51CEA2'],
+      list: [],
+      ptype: ""
+    }
+  },
+  created: function () {
+    this.getPType("type")
+    this.years = new Date().getFullYear()
+    this.months = parseInt(new Date().getMonth() + 1)
+    this.dValue = this.years + '年' + this.months + '月'
+    this.curDate = new Date()
+    this.minDate = new Date(2021, 0)
+    this.maxTime = new Date(this.years, this.months - 1)
+    this.subPoint()
+    this.onLoad()
+    this.initHtml()
+  },
+  methods: {
+    initHtml () {
+      if (this.ptype == "1") {
+        document.title = '采购单位画像记录'
+        typeof setHeaderTitle === 'function' ? setHeaderTitle(document.title) : null
+        $(".btns span").text("当月采购单位画像剩余数")
+        $(".emptytext").text("暂无采购单位画像记录")
+      }
+    },
+    getPType (paraName) {
+      let _this = this
+      var url = document.location.toString();
+      var arrObj = url.split("?");
+      if (arrObj.length > 1) {
+        var arrPara = arrObj[1].split("&");
+        var arr;
+        for (var i = 0; i < arrPara.length; i++) {
+          arr = arrPara[i].split("=");
+          if (arr != null && arr[0] == paraName) {
+            _this.ptype = arr[1];
+          }
+        }
+      }
+    },
+    usedHised () {
+      let _this = this
+      _this.pShow = true
+    },
+    subPoint () {
+      $.ajax({
+        url: '/jypay/resourcePack/account',
+        type: 'POST',
+        contentType: 'application/x-www-form-urlencoded',
+        data: {
+          product: 'attachmentDownPack'
+        },
+        dataType: 'json'
+      }).done(res => {
+         res = {
+           "error_code": 0,
+           "error_msg": "",
+           "data": {
+             "code": 1,
+             "data": [
+               {
+                 "id": 393,
+                 "name": "附件下载包",
+                 "number": 25,
+                 "resourceType": "附件下载包",
+                 "thirtyNum": 0
+               }
+             ],
+             "message": "查询成功"
+           }
+         }
+          if (res.error_msg === '' && res.data && res.data.data) {
+            this.points = {
+              total: '',
+              usage: ''
+            }
+            try {
+              var tempInfo = res.data.data[0]
+              this.points = {
+                total: tempInfo.number,
+                usage: tempInfo.number
+              }
+              if (this.points.usage > tempInfo.thirtyNum) {
+                this.points.usage = tempInfo.thirtyNum
+              }
+            } catch (e) {
+              console.warn(e)
+            }
+          } else {
+            this.$toast(res.error_msg || '请稍后重试')
+          }
+      })
+    },
+    onLoad () {
+      this.ajaxEntList().done(this.doFormatList.bind(this))
+    },
+    doFormatList (r) {
+      r = {
+        "error_code": 0,
+        "error_msg": "",
+        "data": {
+          "list": [
+            {
+              "articleUrl": "/article/content/ABCY1wIfylYFjg4RHtzcE8sMDI%2FQTBgcUJ1PygoOSEgWXtwHBlUCdo%3D",
+              "l_date": "2022/01/07",
+              "s_downUrl": "https://jy-datafile.oss-cn-beijing.aliyuncs.com/c9b1ce564ef81a6e04506e93b7b576d1aaab933ae6dda728e4c7040a9fa537e4.docx",
+              "s_fileName": "空压机配件公告.docx",
+              "s_title": "中煤山西华昱能源有限公司空压机配件采购"
+            },
+            {
+              "articleUrl": "/article/content/ABCY1wIfykeJy87JFVzcE8sMDI%2FQTBgcUJ1PygoPT0wY3lwTwlUCcA%3D",
+              "l_date": "2022/01/07",
+              "s_downUrl": "https://jy-datafile.oss-cn-beijing.aliyuncs.com/aa6731849d5d6e16097abfcb2559674aa481948d4489688f947578d90e227242.pdf",
+              "s_fileName": "更正公告.pdf",
+              "s_title": "静宁县2021年古城镇基础设施(农村公路)建设项目更正公告"
+            }
+          ],
+          "total": 2
+        }
+      }
+      if (r && r.error_msg == '' && r.data) {
+        this.working = false
+        this.empty = true
+        this.listInfo.pageNum++
+        if (this.listInfo.pageNum === 1) {
+          if (r.data.total || r.data.total === 0) {
+            this.listInfo.total = r.data.total
+          } else {
+            this.listInfo.finished = true
+          }
+        }
+
+        if (Array.isArray(r.data.list) && r.data.list.length !== 0) {
+          this.list = this.list.concat(r.data.list.map(function (v) {
+            var isDoc = /.doc(x{0,})$/.test(v.s_fileName)
+            v.icon = isDoc ? 'doc' : 'rar'
+            return v
+          }))
+        } else {
+          this.listInfo.finished = true
+        }
+
+        this.listInfo.loading = false
+        if (this.listInfo.total !== -1 && this.listInfo.total <= this.list.length) {
+          this.listInfo.finished = true
+        }
+      }
+    },
+    getDatas () {
+      return {
+        queryTime: new Date(this.years, this.months, 1).pattern('yyyy-MM'),
+        platform: navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1 ? 'WX' : 'APP',
+        productName: '附件下载包',
+        pageSize: this.listInfo.pageSize,
+        pageNum: this.listInfo.pageNum
+      }
+    },
+    ajaxEntList () {
+      this.working = true
+      this.empty = false
+      return $.ajax({
+        url: '/jypay/resourcePack/recordList',
+        type: 'POST',
+        contentType: 'application/x-www-form-urlencoded',
+        data: this.getDatas(),
+        dataType: 'json'
+      })
+    },
+    downFile (item) {
+      location.href = item.s_downUrl
+    },
+    commonDialogFn (message, confirmText, callBack) {
+      if (this.ptype == "1") {
+        var curDay = new Date().pattern('yyyy/MM/dd')
+        localStorage.setItem('show-buyer-dialog', curDay)
+      } else {
+        var curDay = new Date().pattern('yyyy/MM/dd')
+        localStorage.setItem('show-ent-dialog', curDay)
+      }
+      this.$dialog.confirm({
+        message: message,
+        width: 303,
+        className: 'pro-log',
+        messageAlign: 'left',
+        showCancelButton: 'true',
+        confirmButtonColor: '#2ABED1',
+        confirmButtonText: confirmText,
+        showCancelButton: true
+      }).then(function () {
+        callBack && callBack()
+      }).catch(function () { })
+    },
+    usedDialog () {
+      this.commonDialogFn('超级订阅用户每月享有下载10个附件的权限,也可充值附件下载包増加当月附件下载个数,每月1号上月余额清零重新计算。', '我知道了')
+    },
+    helpTiped () {
+      this.$dialog.alert({
+        width: 303,
+        message: '超级订阅用户每月享有下载<span class="on">10</span>个附件的权限,也可充值附件下载包増加当月附件下载个数,每月1号上月余额清零重新计算。',
+        className: 'pro-log',
+        messageAlign: 'left',
+        confirmButtonColor: '#2ABED1',
+        confirmButtonText: '我知道了',
+      })
+    },
+    confirmed (val) {
+      this.years = val.getFullYear()
+      this.months = val.getMonth() + 1
+      this.listInfo.pageNum = 0
+      this.list = []
+      this.listInfo.total = -1
+      this.listInfo.finished = false
+      this.listInfo.loading = true
+      this.onLoad()
+      this.dValue = this.years + '年' + this.months + '月'
+      this.pShow = false
+    },
+    canceled () {
+      this.pShow = false
+    },
+    ChangeDate (time) {
+      var d = new Date(time)
+      var Y = d.getFullYear() + '年'
+      var M = (d.getMonth() + 1 < 10 ? '0' + (d.getMonth() + 1) : d.getMonth() + 1) + '月'
+      return (Y + M).replace(/^\s+|\s+$/g, "")
+    },
+    detailed (ids) {
+      if (this.ptype == "") {
+        location.href = '/jyapp/big/page/ent_portrait?eId=' + ids + '&svip=1'
+      } else {
+        location.href = '/jyapp/big/page/unit_portrayal?entName=' + ids + '&svip=1'
+      }
+    },
+    contractPerson () {
+      location.href = '/jyapp/free/customer'
+      // try {
+      //   JyObj.callPhone('400-108-6670')
+      // } catch (error) {
+      //   console.log(error)
+      // }
+    },
+    setBook() {
+      var temp = {
+        wx: '/swordfish/filePack/createOrder',
+        app: '/jyapp/filePack/createOrder'
+      }
+      var isWeixin = navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1
+      location.href = temp[isWeixin ? 'wx' : 'app']
+    }
+  }
+})
+

+ 69 - 55
src/web/templates/frontRouter/wx/fileRecord/sess/index.html

@@ -36,6 +36,61 @@
       .ent-info-status-box{
         display: flex;
       }
+      .file-list-item {
+          display: flex;
+          flex-direction: row;
+          align-items: flex-start;
+          padding: 0.32rem;
+          box-sizing: border-box;
+          margin-bottom: 0.16rem;
+          background: #FFFFFF;
+      }
+      .file-list-item .file-icon img {
+          width: 0.48rem;
+          height: 0.48rem;
+          display: inline-block;
+      }
+      .file-list-item .file-icon {
+          line-height: 0;
+          margin-right: 0.16rem;
+      }
+      .file-info-group {
+          display: flex;
+          flex-direction: column;
+      }
+      .file-list-item .file-title {
+          font-size: 0.3rem;
+          font-weight: 500;
+          color: #171826;
+          line-height: 0.44rem;
+          margin-bottom: 0.16rem;
+      }
+      .file-list-item a {
+          width: 6.22rem;
+          text-decoration: underline;
+          overflow: hidden;
+          white-space: nowrap;
+          text-overflow: ellipsis;
+          font-size: 0.26rem;
+          font-weight: 500;
+          color: #2ABED1;
+          line-height: 0.4rem;
+          margin-bottom: 0.24rem;
+      }
+      .file-list-item .file-info img {
+          width: 0.32rem;
+          height: 0.32rem;
+      }
+      .file-list-item .file-info {
+          display: flex;
+          flex-direction: row;
+          justify-content: space-between;
+          align-items: center;
+          font-size: 0.22rem;
+          font-weight: 500;
+          color: #9B9CA3;
+          line-height: 0.4rem;
+      }
     </style>
 </head>
 <body>
@@ -46,21 +101,18 @@
         <div class="j-main">
           <div class="t-bg flex">
             <div class="nums">
-              <span>{points.total - points.usage}</span>个
+              <span v-if="points.total">{points.total - points.usage}</span>个
               <img src='{{Msg "seo" "cdn"}}/common-module/portraitRecord/image/help-p.png?v={{Msg "seo" "version"}}' @click="helpTiped" alt="">
             </div>
             <div class="btns flex">
               <span>当月附件下载余额</span>
-              <!-- <a href="tel:400-108-6670" v-if="contracted"> -->
-                <van-button round type="primary" v-if="contracted" @click="contractPerson">联系客服</van-button>
-              <!-- </a> -->
-              <van-button round type="primary" v-else @click="setBook">立即充值</van-button>
+              <van-button round type="primary"  @click="setBook">立即充值</van-button>
             </div>
           </div>
           <div class="p1-date" style="background: #F5F6F7;">
             <div class="d-box flex">
               使用记录
-              <van-field v-model="dValue" @click="usedHised" placeholder="显示图标" right-icon="play" readonly/>
+              <van-field v-model="dValue" @click="usedHised" placeholder="选择年月" right-icon="play" readonly/>
             </div>
             <div class="word-tips">
               当前已使用:<span>{points.usage}个</span>
@@ -86,55 +138,17 @@
               finished-text=""
               @load="onLoad"
             >
-                <div v-if="ptype==''" class="ent-search-item" v-for="(item, i) in list" :key="item._id" @click="detailed(item._id)">
-                    <div class="ent-info-top">
-                        <div class="ent-info-head" :style="{'background-color': item.color}">{item.abbr}</div>
-                        <div class="ent-info-keep">
-                            <div class="ent-row">
-                                <div class="ent-name van-ellipsis">{item.name}</div>
-                                <div class="fill-icon-box" style="display: none">
-                                    <i class="j-icon base-icon icon-no-favorite"></i>
-                                </div>
-                            </div>
-                            <div class="ent-more">
-                                <div v-if="item.legal">法定代表人: <span>{item.legal}</span></div>
-                                <div v-if="item.money">注册资本: <span>{item.money}万元</span></div>
-                            </div>
-                            <div class="ent-line-box"></div>
-                        </div>
-                    </div>
-                    <div class="ent-info-bottom ent-row" v-show="item.status >= 0 || item.address">
-                        <div class="ent-info-status-box">
-                            <span class="ent-info-status" v-show="item.status >= 0" :class="'status-' + item.status">{statusEnum[item.status]}</span>
-                        </div>
-                        <div  class="ent-row ent-address"  v-show="item.address">
-                            <div class="van-multi-ellipsis--l2">{item.address}</div>
-                            <i class="j-icon base-icon icon-address"></i>
-                        </div>
-                    </div>
-                </div>
-                <div v-if="ptype=='1'" class="ent-search-item" v-for="(item, i) in list" :key="item._id" @click="detailed(item._id)">
-                    <div class="ent-info-top">
-                        <div class="ent-info-head" :style="{'background-color': item.color}">{item.abbr}</div>
-                        <div class="ent-info-keep">
-                            <div class="ent-row">
-                                <div class="ent-name van-ellipsis">{item.name}</div>
-                                <div class="fill-icon-box" style="display: none">
-                                    <i class="j-icon base-icon icon-no-favorite"></i>
+                <div  class="file-list-item" v-for="(item, i) in list" :key="i">
+                    <div class="file-icon">
+                        <img v-if="item.icon === 'doc'"  src="{{Msg "seo" "cdn"}}/common-module/file-pack/images/icon-word.png?v={{Msg "seo" "version"}}" :alt="item.icon">
+                        <img v-else  src="{{Msg "seo" "cdn"}}/common-module/file-pack/images/icon-rar.png?v={{Msg "seo" "version"}}" :alt="item.icon">
                                 </div>
-                            </div>
-                            <div class="ent-more">
-                              <div>所在地:
-                                <span v-if="item.province">{item.province}</span>
-                                <span v-if="item.city"> {item.city}</span>
-                                <span v-if="!item.province && !item.city">--</span>
-                              </div>
-                              <div>采购单位类型:
-                                <span v-if="item.buyerClass">{item.buyerClass}</span>
-                                <span v-else>--</span>
-                              </div>
-                            </div>
-                            <div class="ent-line-box"></div>
+                    <div class="file-info-group">
+                        <div class="file-title">{item.s_fileName}</div>
+                        <a :href="item.articleUrl">来源:{item.s_title}</a>
+                        <div class="file-info">
+                            <span>于{item.l_date}下载</span>
+                            <img @click="downFile(item)" src="{{Msg "seo" "cdn"}}/common-module/file-pack/images/icon-down.png?v={{Msg "seo" "version"}}" alt="down">
                         </div>
                     </div>
                 </div>
@@ -161,7 +175,7 @@
   {{include "/big-member/commonjs.html"}}
   <script src='{{Msg "seo" "cdn"}}/common-module/public/js/utils.js'></script>
   <script src='{{Msg "seo" "cdn"}}/common-module/public/js/china-map-data.js?v={{Msg "seo" "version"}}'></script>
-  <script src='{{Msg "seo" "cdn"}}/common-module/portraitRecord/js/index-wx.js?v={{Msg "seo" "version"}}'></script>
+  <script src='{{Msg "seo" "cdn"}}/common-module/file-pack/js/index-wx.js?v={{Msg "seo" "version"}}'></script>
   {{include "/common/baiducc.html"}}
 </body>