zhaoxiaohai před 4 roky
rodič
revize
d87f06e34d

+ 0 - 12
app.js

@@ -78,18 +78,6 @@ App({
             }
         })
     },
-    getUserProfile() {
-        if (wx.getStorageSync('getUserInfo')) return;
-        wx.getUserProfile({
-            desc: '用于完善客户信息资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
-            success: (res) => {
-                wx.setStorageSync('getUserInfo', true)
-            },
-            fail: (err) => {
-                wx.setStorageSync('getUserInfo', false)
-            }
-        })
-    },
     globalData: {
         myNavBorHeight: 0, //自定义头部导航高度
         safeAreaBottom: 0, //底部安全距离

+ 23 - 0
components/My_Search/index.js

@@ -0,0 +1,23 @@
+// components/My_Search/index.js
+Component({
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+
+    },
+
+    /**
+     * 组件的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+
+    }
+})

+ 6 - 0
components/My_Search/index.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+        "van-search": "@vant/weapp/search/index"
+    }
+}

+ 7 - 0
components/My_Search/index.wxml

@@ -0,0 +1,7 @@
+<!-- 搜索 -->
+<view class="home-search">
+    <view class="search-type">全部</view>
+    <view class="search-box">
+        <van-search field-class='search-class' input-class='inputClass' shape='round' value="{{ value }}" placeholder="请输入搜索关键词" />
+    </view>
+</view>

+ 32 - 0
components/My_Search/index.wxss

@@ -0,0 +1,32 @@
+/* 搜索 */
+.home-search {
+    display: flex;
+    align-items: center;
+    width: 100vw;
+    height: 100rpx;
+    background-color: #FFFFFF;
+    margin: 20rpx 0 10rpx 0;
+    padding: 0 24rpx;
+    box-sizing: border-box;
+}
+
+.search-type {
+    flex-shrink: 0;
+    font-size: 32rpx;
+}
+
+.search-box {
+    flex: 1;
+}
+
+.search-class {
+    flex: 1;
+    display: flex;
+    align-items: center;
+    height: 60rpx !important;
+    padding: 0 !important;
+}
+
+.inputClass {
+    width: 390rpx !important;
+}

+ 3 - 20
components/My_TwoDimensionalCode/analyze.js

@@ -1,32 +1,15 @@
-function showModel(data, content) {
-    wx.setStorageSync('qrCodeMsg', data);
-    wx.reLaunch({
-        url: '/pages/login/index',
-    })
-    /* wx.showModal({
-        title: '提示',
-        content: content,
-        showCancel: false,
-        success: (res => {
-            if (res.confirm) 
-        })
-    }); */
-}
 //解析二维码链接
-function setDataUrl(url, login) {
+function setDataUrl(url) {
     let q = url;
     const data = {
         type: q.slice(q.indexOf("type=") + 5, q.indexOf('&')),
         id: q.slice(q.lastIndexOf('=') + 1),
         name: q.slice(q.lastIndexOf('fbrand=') + 7, q.lastIndexOf('&'))
     }
-    if (!wx.getStorageSync('userData').token) {
-        return showModel(data, '当前未登录,请登录后进入!')
-    } else if (login) {
-        return showModel(data, '登录状态已过期,请重新登陆!')
-    };
+    wx.setStorageSync('qrCodeMsg', data);
     return data;
 }
+
 module.exports = {
     setDataUrl
 }

+ 0 - 31
components/My_inputPromptd/index.js

@@ -1,31 +0,0 @@
-// components/My_inputPromptd/index.js
-Component({
-    /**
-     * 组件的属性列表
-     */
-    properties: {
-        /* 是否显示 */
-        show:{
-            type:Boolean,
-            value:false
-        },
-        /* 提示文本 */
-        text: {
-            type: String
-        }
-    },
-
-    /**
-     * 组件的初始数据
-     */
-    data: {
-
-    },
-
-    /**
-     * 组件的方法列表
-     */
-    methods: {
-
-    }
-})

+ 0 - 4
components/My_inputPromptd/index.json

@@ -1,4 +0,0 @@
-{
-    "component": true,
-    "usingComponents": {}
-}

+ 0 - 3
components/My_inputPromptd/index.wxml

@@ -1,3 +0,0 @@
-<view wx:if="{{show}}" class="tips_box">
-    {{text}}
-</view>

+ 0 - 21
components/My_inputPromptd/index.wxss

@@ -1,21 +0,0 @@
-.tips_box {
-    position: relative;
-    padding: 10rpx;
-    width: 240rpx;
-    background-color: #ffffff;
-    border-radius: 20rpx;
-    opacity: .7;
-}
-
-.tips_box::after {
-    position: absolute;
-    content: '';
-    display: block;
-    border-top: 10px solid #ffffff;
-    border-left: 10px solid transparent;
-    border-right: 10px solid transparent;
-    border-bottom: 10px solid transparent;
-    bottom:-18px;
-    left: 50%;
-    transform: translate(-50%,0);
-}

+ 22 - 55
miniprogram_npm/@vant/weapp/tabs/index.wxml

@@ -2,62 +2,29 @@
 <wxs src="./index.wxs" module="computed" />
 
 <view class="custom-class {{ utils.bem('tabs', [type]) }}">
-  <van-sticky
-    disabled="{{ !sticky }}"
-    z-index="{{ zIndex }}"
-    offset-top="{{ offsetTop }}"
-    container="{{ container }}"
-    bind:scroll="onTouchScroll"
-  >
-    <view class="{{ utils.bem('tabs__wrap', { scrollable }) }} {{ type === 'line' && border ? 'van-hairline--top-bottom' : '' }}">
-      <slot name="nav-left" />
+    <van-sticky disabled="{{ !sticky }}" z-index="{{ zIndex }}" offset-top="{{ offsetTop }}" container="{{ container }}" bind:scroll="onTouchScroll">
+        <view class="{{ utils.bem('tabs__wrap', { scrollable }) }} {{ type === 'line' && border ? 'van-hairline--top-bottom' : '' }}">
+            <slot name="nav-left" />
 
-      <scroll-view
-        scroll-x="{{ scrollable }}"
-        scroll-with-animation="{{ scrollWithAnimation }}"
-        scroll-left="{{ scrollLeft }}"
-        class="{{ utils.bem('tabs__scroll', [type]) }}"
-        style="{{ color ? 'border-color: ' + color : '' }}"
-      >
-        <view class="{{ utils.bem('tabs__nav', [type, { complete: !ellipsis }]) }} nav-class" style="{{ computed.navStyle(color, type) }}">
-          <view wx:if="{{ type === 'line' }}" class="van-tabs__line" style="{{ computed.lineStyle({ color, lineOffsetLeft, lineHeight, skipTransition, duration, lineWidth }) }}" />
-          <view
-            wx:for="{{ tabs }}"
-            wx:key="index"
-            data-index="{{ index }}"
-            class="{{ computed.tabClass(index === currentIndex, ellipsis) }} {{ utils.bem('tab', { active: index === currentIndex, disabled: item.disabled, complete: !ellipsis }) }}"
-            style="{{ computed.tabStyle({ active: index === currentIndex, ellipsis, color, type, disabled: item.disabled, titleActiveColor, titleInactiveColor, swipeThreshold, scrollable }) }}"
-            bind:tap="onTap"
-          >
-            <view class="{{ ellipsis ? 'van-ellipsis' : '' }}" style="{{ item.titleStyle }}">
-              {{ item.title }}
-              <van-info
-                wx:if="{{ item.info !== null || item.dot }}"
-                info="{{ item.info }}"
-                dot="{{ item.dot }}"
-                custom-class="van-tab__title__info"
-              />
-            </view>
-          </view>
-        </view>
-      </scroll-view>
+            <scroll-view scroll-x="{{ scrollable }}" scroll-with-animation="{{ scrollWithAnimation }}" scroll-left="{{ scrollLeft }}" class="{{ utils.bem('tabs__scroll', [type]) }}" style="{{ color ? 'border-color: ' + color : '' }}">
+                <view class="{{ utils.bem('tabs__nav', [type, { complete: !ellipsis }]) }} nav-class" style="{{ computed.navStyle(color, type) }}">
+                    <view wx:if="{{ type === 'line' }}" class="van-tabs__line" style="{{ computed.lineStyle({ color, lineOffsetLeft, lineHeight, skipTransition, duration, lineWidth }) }}" />
+                    <view wx:for="{{ tabs }}" wx:key="index" data-index="{{ index }}" class="{{ computed.tabClass(index === currentIndex, ellipsis) }} {{ utils.bem('tab', { active: index === currentIndex, disabled: item.disabled, complete: !ellipsis }) }}" style="{{ computed.tabStyle({ active: index === currentIndex, ellipsis, color, type, disabled: item.disabled, titleActiveColor, titleInactiveColor, swipeThreshold, scrollable }) }}" bind:tap="onTap">
+                        <view class="{{ ellipsis ? 'van-ellipsis' : '' }}" style="{{ item.titleStyle }}">
+                            {{ item.title }}
+                            <van-info wx:if="{{ item.info !== null || item.dot }}" info="{{ item.info }}" dot="{{ item.dot }}" custom-class="van-tab__title__info" />
+                        </view>
+                    </view>
+                </view>
+            </scroll-view>
 
-      <slot name="nav-right" />
-    </view>
-  </van-sticky>
+            <slot name="nav-right" />
+        </view>
+    </van-sticky>
 
-  <view
-    class="van-tabs__content"
-    bind:touchstart="onTouchStart"
-    bind:touchmove="onTouchMove"
-    bind:touchend="onTouchEnd"
-    bind:touchcancel="onTouchEnd"
-  >
-    <view
-      class="{{ utils.bem('tabs__track', [{ animated }]) }} van-tabs__track"
-      style="{{ computed.trackStyle({ duration, currentIndex, animated }) }}"
-    >
-      <slot />
+    <view class="van-tabs__content" bind:touchstart="onTouchStart" bind:touchmove="onTouchMove" bind:touchend="onTouchEnd" bind:touchcancel="onTouchEnd">
+        <view class="{{ utils.bem('tabs__track', [{ animated }]) }} van-tabs__track" style="{{ computed.trackStyle({ duration, currentIndex, animated }) }}">
+            <slot />
+        </view>
     </view>
-  </view>
-</view>
+</view>

+ 0 - 1
pages/productManagement/change.json

@@ -2,7 +2,6 @@
     "usingComponents": {
         "van-switch": "@vant/weapp/switch/index",
         "My_UploadFiles": "/components/My_UploadFiles/index",
-        "My_inputPromptd": "/components/My_inputPromptd/index",
         "My_MultipleChoice": "/components/My_MultipleChoice/index"
     }
 }

+ 78 - 2
pages/tabbar-pages/home/analysis/index.js

@@ -1,18 +1,94 @@
-// pages/tabbar-pages/home/analysis/index.js
+import {
+    ApiModel
+} from '../../../../utils/api';
+const _Http = new ApiModel();
+const handleList = require("../../../../utils/processingData");
+
 Page({
 
     /**
      * 页面的初始数据
      */
     data: {
-        active:1
+        statistics: [], //统计
+        productList: [], //列表
+        line: 0, //显示列表下标
+        active: 0, //tabs下标
     },
 
     /**
      * 生命周期函数--监听页面加载
      */
     onLoad(options) {
+        /* 获取数据统计总数 */
+        _Http.basic({
+            "accesstoken": wx.getStorageSync('userData').token,
+            "classname": "customer.supplyanddemand.supplyanddemand",
+            "method": "getsupplyanddemandtimes",
+            "content": {
+                "tenterprise_userid": wx.getStorageSync('userData').userid
+            }
+        }).then(res => {
+            if (res.msg != '成功') return wx.showToast({
+                title: res.data
+            })
+            this.setData({
+                statistics: [{
+                    title: '分享总数',
+                    number: res.data.fsharetimes
+                }, {
+                    title: '电话总数',
+                    number: res.data.fphonetimes
+                }, {
+                    title: '浏览总数',
+                    number: res.data.freadtimes
+                }]
+            })
+        });
+        /* 获取我的供需 */
+        _Http.basic({
+            "accesstoken": wx.getStorageSync('userData').token,
+            "classname": "customer.supplyanddemand.supplyanddemand",
+            "method": "query_mysupplyanddemandList",
+            "content": {
+                "getdatafromdbanyway": true,
+                "pageNumber": 1,
+                "pageSize": 20,
+                "where": {
+                    "condition": '',
+                    "ftype": "",
+                    "fissupply": "0"
+                }
+            }
+        }).then(res => {
+            console.log(res)
+            if (res.msg != "成功") return wx.showToast({
+                title: res.data,
+            })
+            const data = handleList.getYTD(res.data);
+
+            this.setData({
+                productList: data
+            })
+        })
+    },
+
+    changeIndex(e) {
+        const {
+            line
+        } = e.currentTarget.dataset, {
+            index
+        } = e.target.dataset;
+        this.setData({
+            line,
+            active: index-0
+        })        
+    },
 
+    tabsOnChange(e) {
+        this.setData({
+            active: e.detail.index
+        })
     },
 
     /**

+ 3 - 1
pages/tabbar-pages/home/analysis/index.json

@@ -1,3 +1,5 @@
 {
-    "usingComponents": {}
+    "usingComponents": {
+        "My_Search":"/components/My_Search/index"
+    }
 }

+ 18 - 14
pages/tabbar-pages/home/analysis/index.wxml

@@ -1,35 +1,39 @@
 <!-- 数据展示 -->
 <view class="display">
     <view class="content">
-        <view class="rectangle" wx:for="{{3}}">
-            <view class="nub u-line-1">123456</view>
-            <view class="name u-line-1">分享总数</view>
+        <view class="rectangle" wx:for="{{statistics}}" wx:key="index">
+            <view class="nub u-line-1">{{item.number}}</view>
+            <view class="name u-line-1">{{item.title}}</view>
         </view>
     </view>
 </view>
 
 <!-- 搜索 -->
+<My_Search></My_Search>
 
 <!-- 列表 -->
-<view class="item-box">
+<view class="item-box" wx:for="{{productList}}" wx:key="index">
     <view class="head">
         <view style="display: flex;align-items: center;justify-content: space-between;">
             <view class="user-msg">
-                <van-image custom-class='user-img' round lazy-load width="32rpx" height="32rpx" src="https://img.yzcdn.cn/vant/cat.jpeg" />
-                <text class="name">用户名</text>
-                <text class="time">2022-03-22</text>
+                <van-image custom-class='user-img' round lazy-load width="32rpx" height="32rpx" src="{{item.headportraiturl}}" />
+                <text class="name u-line-1">{{item.checkby}}</text>
+                <text class="time">{{item.checkdate}}</text>
             </view>
             <van-button icon='share-o' open-type='share' custom-class='share-but'>分享</van-button>
         </view>
-        <view class="title">[供需分类]供需标题供需标题供4dffghfggser3qfds需标题供需标题供需标题供需标题供需标题供需标题6yjnfdgdgdf供需标题供需标题供需标题供需标题sdfdsfds
-        </view>
+        <view class="title">[{{item.ftype}}]{{item.ftitle}}</view>
     </view>
     <view class="tabs">
-        <van-tabs active="{{ active }}" bind:change="onChange">
-            <van-tab title="标签 1">内容 1</van-tab>
-            <van-tab title="标签 2">内容 2</van-tab>
-            <van-tab title="标签 3">内容 3</van-tab>
-            <van-tab title="标签 4">内容 4</van-tab>
+        <view class="fake-tabs" wx:if="{{line!=index}}" data-line="{{index}}" bindtap="changeIndex">
+            <view data-index="0">分享数{{item.fsharetimes}}</view>
+            <view data-index="1">电话数{{item.fphonetimes}}</view>
+            <view data-index="2">浏览数{{item.freadtimes}}</view>
+        </view>
+        <van-tabs wx:else active="{{ active }}" color='#00C1D2' title-active-color='#00C1D2' bind:change="tabsOnChange">
+            <van-tab title='分享数{{item.fsharetimes}}' />
+            <van-tab title='电话数{{item.fphonetimes}}' />
+            <van-tab title='浏览数{{item.freadtimes}}' />
         </van-tabs>
     </view>
 </view>

+ 17 - 1
pages/tabbar-pages/home/analysis/index.wxss

@@ -52,16 +52,17 @@
 }
 
 .user-msg {
+    display: flex;
     font-size: 28rpx;
     color: #333333;
 }
 
 .user-img {
     vertical-align: top;
-
 }
 
 .user-msg .name {
+    max-width: 320rpx;
     margin: 0 10rpx 0 8rpx;
 }
 
@@ -89,4 +90,19 @@
     margin-top: 14rpx;
     word-break: break-all;
     white-space: pre-line;
+}
+
+.fake-tabs{
+    display: flex;
+    height: 88rpx;
+    width: 100vw;
+}
+
+.fake-tabs>view{
+    flex: 1;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    color: #646566;
+    font-size: 28rpx;
 }

+ 10 - 18
pages/tabbar-pages/home/index.js

@@ -91,7 +91,6 @@ Page({
                 }
             }
         }).then(res => {
-            console.log("供需列表",res)
             if (res.msg != '成功') return wx.showToast({
                 title: res.data,
                 icon: "none"
@@ -108,27 +107,19 @@ Page({
      * 生命周期函数--监听页面加载
      */
     onLoad: function (query) {
+        const that = this;
         // 获取到二维码原始链接内容
         if (query.q) {
-            //有登录态直接加入
             this.ifQrCodeType(analyze.setDataUrl(decodeURIComponent(query.q)));
-            console.log('有登录态')
         } else if (wx.getStorageSync('qrCodeMsg')) {
-            //判断缓存中是否存在
             this.ifQrCodeType(wx.getStorageSync('qrCodeMsg'));
-            //返回数据后清空缓存
-            setTimeout(() => {
-                wx.removeStorageSync('qrCodeMsg');
-            }, 500)
         };
-        const that = this;
         /* 获取最新供需列表 */
         this.supplyanddemandList();
+
         /* 获取轮播图 */
         const getBan = setInterval(() => {
-            console.log('获取轮播图',wx.getStorageSync('bannerDataList'))
             if (wx.getStorageSync('bannerDataList')) {
-            console.log('轮播图',wx.getStorageSync('bannerDataList'))
                 const bannerList = wx.getStorageSync('bannerDataList').filter(value => value.flocation == 'home_head'),
                     portal_middle_1 = wx.getStorageSync('bannerDataList').filter(value => value.flocation == 'portal_middle_1');
                 this.setData({
@@ -146,6 +137,7 @@ Page({
                 'tabbarList[3].fcount': getApp().globalData.msgFcount
             })
         }, 500)
+        //判断是否有门户直播登录
         if (wx.getStorageSync('liveUrl')) {
             wx.navigateTo({
                 url: '/pages/webView/index?url=' + wx.getStorageSync('liveUrl'),
@@ -155,18 +147,17 @@ Page({
             })
         }
     },
-    /* 判断二维码类型 */
+    /* 二维码操作 */
     ifQrCodeType(data) {
-        let MyModelText = '';
-        let tagentsid = wx.getStorageSync('account_list')[0].tagentsid;
-        console.log(tagentsid, data.id)
+        if (!wx.getStorageSync('userData')) return;
+        let MyModelText = '',
+            tagentsid = wx.getStorageSync('userData').tagentsid;
         if (data.id == tagentsid) {
-            wx.showToast({
+            wx.removeStorageSync('qrCodeMsg');
+            return wx.showToast({
                 title: "您已经加入该团队",
                 icon: "none"
             })
-            wx.removeStorageSync('qrCodeMsg');
-            return;
         }
         if (data.type == 'partner') {
             //申请合作
@@ -180,6 +171,7 @@ Page({
             codeMsg: data,
             MyModelShow: true
         })
+
         wx.removeStorageSync('qrCodeMsg');
     },
     /* 首页模态框回调 */

+ 1 - 1
pages/tabbar-pages/home/index.json

@@ -3,6 +3,6 @@
   "usingComponents": {
     "CusTabBar": "/custom-tab-bar/index",
     "My_SupplyAndDemandList":"/components/My_SupplyAndDemandList/index",
-    "van-search": "@vant/weapp/search/index"
+    "My_Search":"/components/My_Search/index"
   }
 }

+ 1 - 6
pages/tabbar-pages/home/index.wxml

@@ -9,12 +9,7 @@
     </van-grid>
 </view>
 <!-- 搜索 -->
-<view class="home-search">
-    <view class="search-type">全部全部</view>
-    <view class="search-box">
-        <van-search field-class='search-class' input-class='inputClass' shape='round' value="{{ value }}" placeholder="请输入搜索关键词" />
-    </view>
-</view>
+<My_Search></My_Search>
 <!-- 供需列表 -->
 <My_SupplyAndDemandList list="{{productList}}" bind:shareCallBack='shareCallBack' />
 <!-- 占位 -->

+ 1 - 33
pages/tabbar-pages/home/index.wxss

@@ -22,39 +22,7 @@
     margin-left: 12rpx;
 }
 
-/* 搜索 */
-.home-search {
-    display: flex;
-    align-items: center;
-    width: 100vw;
-    height: 100rpx;
-    background-color: #FFFFFF;
-    margin: 20rpx 0 10rpx 0;
-    padding: 0 24rpx;
-    box-sizing: border-box;
-}
-
-.search-type {
-    flex-shrink: 0;
-    font-size: 32rpx;
-}
-
-.search-box {
-    flex: 1;
-}
-
-.search-class {
-    flex: 1;
-    display: flex;
-    align-items: center;
-    height: 60rpx !important;
-    padding: 0 !important;
-}
-
-.inputClass {
-    width: 470rpx !important;
-}
-
+ 
 /* 贴边按钮 */
 .welt {
     position: fixed;

+ 1 - 1
pages/tabbar-pages/home/sdDetalis.wxml

@@ -27,7 +27,7 @@
 <view class="footer">
     <view>
         <text style="margin-right: 30rpx;">浏览数{{detalis.freadtimes}}</text>
-        <text>分享数{{detalis.sharetimes}}</text>
+        <text>分享数{{detalis.fsharetimes}}</text>
     </view>
     <van-button round color="#F6F7F8" custom-class='deleteBut'>删除</van-button>
 </view>

+ 7 - 0
project.private.config.json

@@ -30,6 +30,13 @@
                     "query": "",
                     "launchMode": "default",
                     "scene": null
+                },
+                {
+                    "name": "数据统计",
+                    "pathName": "pages/tabbar-pages/home/analysis/index",
+                    "query": "",
+                    "launchMode": "default",
+                    "scene": null
                 }
             ]
         }