xiaoyi 7 months ago
parent
commit
b3244f70cc

+ 2 - 3
app.json

@@ -1,6 +1,5 @@
 {
   "pages": [
-    
     "pages/index/index",
     "pages/rank/rank",
     "pages/upload/upload",
@@ -38,8 +37,8 @@
     "pages/article/article",
     "pages/matchdetail/matchdetail",
     "pages/winloseRank/winloseRank",
-    "pages/avg/avg"
-    
+    "pages/avg/avg",
+    "pages/articleweb/articleweb"
   ],
   "window": {
     "backgroundTextStyle": "light",

+ 1 - 1
pages/article/article.wxml

@@ -1,6 +1,6 @@
 <scroll-view  scroll-y='{{true}}'  bindscrolltolower='next'>
 <view class="up-down">
-        <navigator wx:for="{{list}}"  hover-class="none" url="../detail/detail?id={{item.id}}" >
+        <navigator wx:for="{{list}}"  hover-class="none" url="../articleweb/articleweb?id={{item.id}}" >
           <view class="article-name">
           {{item.name}}
           <text>{{item.ctime}}</text>

+ 90 - 0
pages/articleweb/articleweb.js

@@ -0,0 +1,90 @@
+// pages/articleweb/articleweb.js
+const $api = require('../../utils/api.js').API;
+
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    info:{},
+    name:'',
+    articleid:'',
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+    $api.getArticle({id:options.id}).then(res=>{
+      let data = res.data.data
+      this.setData({
+        info:data,
+        name:res.data.data.name,
+        articleid:options.id,
+      })
+      
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+    return {
+      title: this.data.info.name,
+      path: '/articleweb/articleweb?id='+this.data.articleid,
+      imageUrl:this.data.info.img,
+    }
+  },
+  onShareTimeline(){
+    return {
+      title: this.data.info.name,
+      path: '/articleweb/articleweb?id='+this.data.articleid,
+      imageUrl:this.data.info.img,
+    }
+
+  },
+})

+ 3 - 0
pages/articleweb/articleweb.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 2 - 0
pages/articleweb/articleweb.wxml

@@ -0,0 +1,2 @@
+<!--pages/articleweb/articleweb.wxml-->
+<web-view src="{{info.web}}"></web-view>

+ 1 - 0
pages/articleweb/articleweb.wxss

@@ -0,0 +1 @@
+/* pages/articleweb/articleweb.wxss */

+ 1 - 1
pages/baike/baike.wxml

@@ -1,7 +1,7 @@
 <wxs module="filters" src="../../utils/toFixed.wxs" />
 <view class="top_bg">
       <image mode="widthFix" src="../../xiao/titlebg@2x.png"></image>
-      <view class="top_title">短线百科 <text>吃瓜群众</text></view>
+      <view class="top_title">短 线  科 <text>吃瓜群众</text></view>
 </view>
 <view class="tab">
   <view wx:for="{{cat}}" bindtap="tab"   data-id='{{item.id}}' class="{{cur==item.id?'act':''}}">{{item.name}}</view>

+ 11 - 16
pages/detail/detail.js

@@ -95,23 +95,18 @@ Page({
    */
 
   onShareAppMessage() {
-    // const promise = new Promise(resolve => {
-    //   setTimeout(() => {
-    //     resolve({
-    //       title: this.data.name
-    //     })
-    //   }, 2000)
-    // }),
-    return{
-      title:this.data.name,
-      path:'/pages/detail/detail?id=' + this.data.articleid
+    return {
+      title: this.data.info.name,
+      path: '/articleweb/articleweb?id='+this.data.articleid,
+      imageUrl:this.data.info.img,
     }
   },
+  onShareTimeline(){
+    return {
+      title: this.data.info.name,
+      path: '/articleweb/articleweb?id='+this.data.articleid,
+      imageUrl:this.data.info.img,
+    }
 
-  // onShareTimeline: function() {
-  //   return {
-  //   title: this.data.name,
-  //   query: {'id':this.data.articleid}
-  //   }
-  // }
+  },
 })

+ 16 - 3
pages/index/index.js

@@ -61,8 +61,15 @@ Page({
         })
       })
       // 是否打分
+      var y=new Date().getFullYear() 
+      var m=Number(new Date().getMonth() + 1)
+      var d = new Date().getDate()
+      m=m>9?m:'0'+m;
+      d=d>9?d:'0'+d
+      var date = y+'-'+m+'-'+d
+
       if(!this.data.isWeek){
-        $api.checkMark({stock_date:this.data.date}).then(res=>{
+        $api.checkMark({stock_date:date}).then(res=>{
           if(res.data.data){
             this.setData({
               isScore:1
@@ -101,7 +108,6 @@ Page({
         })
     })
     
-
     function getYearWeek(endDate) {
         //本年的第一天
         endDate=new Date(endDate)
@@ -119,10 +125,17 @@ Page({
 
   },
   radioChange:function(e){
+    var y=new Date().getFullYear() 
+    var m=Number(new Date().getMonth() + 1)
+    var d = new Date().getDate()
+    m=m>9?m:'0'+m;
+    d=d>9?d:'0'+d
+    var date = y+'-'+m+'-'+d
+
     this.setData({
       s:e.detail.value
     })
-    $api.markScore({stock_date:this.data.date,score:e.detail.value}).then(res=>{
+    $api.markScore({stock_date:date,score:e.detail.value}).then(res=>{
       console.log(res)
       if(res.data.code == 0){
           wx.showToast({

+ 8 - 6
pages/index/index.wxml

@@ -55,7 +55,7 @@
 <swiper class="banner-list" 	indicator-active-color='#FF5800'	indicator-color='rgba(255,255,255,.6)'  indicator-dots='{{true}}'>
         <block wx:for="{{banners}}" wx:key="*this">
           <swiper-item>
-            <navigator url="../detail/detail?id={{item.id}}"><image mode="aspectFill" src="{{item.img}}"></image></navigator>
+            <navigator url="../articleweb/articleweb?id={{item.id}}"><image mode="aspectFill" src="{{item.img}}"></image></navigator>
             <view class="name">{{item.name}}</view>
           </swiper-item>
         </block>
@@ -78,7 +78,7 @@
     <text>公告:</text>
   </view>
   <view class="notice-list">
-        <navigator hover-class="none" url="../detail/detail?id={{item.id}}" wx:for="{{notices}}">{{item.name}}</navigator>
+        <navigator hover-class="none" url="../articleweb/articleweb?id={{item.id}}" wx:for="{{notices}}">{{item.name}}</navigator>
   </view>
 </view>
 <view class="up-down-view" style="padding: 0 25rpx;">
@@ -87,7 +87,9 @@
       <image class="more-image" mode="widthFix" src="../../images/right_icon.png"></image>
       </navigator>
       短线盈亏效应
+      <view style="font-size: 28rpx;">{{date}}</view>
   </view>
+  
     <view class="group_list" wx:if='{{groups.today_win_lose_avg}}'>
       <view class="g_list"  data-index='0'  bind:tap="tapGroup">
         <image mode="widthFix" wx:if="{{groups.today_win_lose_avg[0]=='-'}}" src="../../images/indexlose@2x.png"></image>
@@ -226,28 +228,28 @@
     <view class="content-list">
       <view class="up-down">
         <view class="article-title"> <navigator url="../article/article?type=每日点评">more<image class="more-image" mode="widthFix" src="../../images/right_icon.png"></image></navigator>每日点评</view>
-        <navigator wx:for="{{articleList1}}" wx:if="{{index<5}}" hover-class="none" url="../detail/detail?id={{item.id}}" >
+        <navigator wx:for="{{articleList1}}" wx:if="{{index<5}}" hover-class="none" url="../articleweb/articleweb?id={{item.id}}" >
           <text class="article-name">{{item.name}}</text>
           <image class="article-img" mode="aspectFill" src="{{item.img}}"></image>
         </navigator>
       </view>
       <view class="up-down">
         <view class="article-title"> <navigator url="../article/article?type=冠军交割">more<image class="more-image" mode="widthFix" src="../../images/right_icon.png"></image></navigator>冠军交割</view>
-        <navigator wx:for="{{articleList2}}" wx:if="{{index<5}}" hover-class="none" url="../detail/detail?id={{item.id}}" >
+        <navigator wx:for="{{articleList2}}" wx:if="{{index<5}}" hover-class="none" url="../articleweb/articleweb?id={{item.id}}" >
           <text class="article-name">{{item.name}}</text>
           <image class="article-img" mode="aspectFill" src="{{item.img}}"></image>
         </navigator>
       </view>
       <view class="up-down">
         <view class="article-title"> <navigator url="../article/article?type=牛人专场">more<image class="more-image" mode="widthFix" src="../../images/right_icon.png"></image></navigator>牛人专场</view>
-        <navigator wx:for="{{articleList3}}" wx:if="{{index<5}}" hover-class="none" url="../detail/detail?id={{item.id}}" >
+        <navigator wx:for="{{articleList3}}" wx:if="{{index<5}}" hover-class="none" url="../articleweb/articleweb?id={{item.id}}" >
           <text class="article-name">{{item.name}}</text>
           <image class="article-img" mode="aspectFill" src="{{item.img}}"></image>
         </navigator>
       </view>
       <view class="up-down">
         <view class="article-title"> <navigator url="../article/article?type=妖股列传">more<image class="more-image" mode="widthFix" src="../../images/right_icon.png"></image></navigator>妖股列传</view>
-        <navigator wx:for="{{articleList4}}" wx:if="{{index<5}}" hover-class="none" url="../detail/detail?id={{item.id}}" >
+        <navigator wx:for="{{articleList4}}" wx:if="{{index<5}}" hover-class="none" url="../articleweb/articleweb?id={{item.id}}" >
           <text class="article-name">{{item.name}}</text>
           <image class="article-img" mode="aspectFill" src="{{item.img}}"></image>
         </navigator>

+ 2 - 1
pages/index/index.wxss

@@ -180,7 +180,7 @@ image.number{
 }
 .article-title{
   font-size: 33rpx;
-  margin-bottom: 40rpx;
+  margin-bottom: 30rpx;
 }
 .article-title navigator{
   font-size: 30rpx;
@@ -711,6 +711,7 @@ scroll-view{
   justify-content: space-between;
   align-items: center;
   margin-bottom: 10rpx;
+  font-size: 28rpx;
 }
 
 .score>view{

+ 2 - 1
pages/login/user.js

@@ -228,7 +228,8 @@ Page({
     udata.unionid   = this.data.unionid;
     udata.nickName  = this.data.nickName;
     udata.avatarUrl = this.data.avatarUrl;
-
+    udata.logintype = 'xcx';
+    // console.log(udata)
     $api.login(udata)
     .then(res=>{
       //登录成功

+ 1 - 1
pages/rank/rank.wxml

@@ -64,7 +64,7 @@
         <image wx:if='{{i==1}}' mode="widthFix" src="../../images/2.png"></image>
         <image wx:if='{{i==2}}' mode="widthFix" src="../../images/3.png"></image>
         <text class="name">{{player.username}}</text>
-        <text>{{player.today_fund}}</text>
+        <text>{{player.today_fund}}w</text>
         <text  class="{{player.today_income[0]=='-'?'down':'up'}}">{{player.today_income}}</text>
         <text  class="{{player.total_income[0]=='-'?'down':'up'}}">{{player.total_income}}</text>
     </navigator>

+ 19 - 1
pages/stock/stock.js

@@ -25,6 +25,8 @@ Page({
     nbComments:[],
     todaynb:0,
     role:0,
+    paixu:'按人数/金额排序',
+    fund_rank:false,
   },
 
   /**
@@ -239,14 +241,17 @@ Page({
     wx.showNavigationBarLoading()
     var list = this.data.list;
     var data={}
+
     if(type == 'search'){
       data={ name: this.data.name, stock_date: this.data.stock_date}
       this.setData({
         searchList:[]
       })
     }else{
-      data={ name: this.data.name, stock_date: this.data.stock_date, page: this.data.page, page_size: 20}
+      data={stock_date: this.data.stock_date, page: this.data.page, page_size: 20,fund_rank:this.data.fund_rank ? 1:0}
     }
+    
+    console.log('param',data)
       $api.getHotbuyList(data).then(res => {
         res.data.data.list.forEach(item => {
           list.push(item)
@@ -267,6 +272,19 @@ Page({
       
     
   },
+  paixu(e){
+    var isrank = !this.data.fund_rank;
+
+    this.setData({
+      fund_rank:isrank,
+      // paixu:isrank ? "按持仓人数":"持仓金额排序",
+      list:[],
+      total:0,
+      page:1,
+    })
+
+    this.getData()
+  },
   pushToday(e){
     $push.pushToday(e.currentTarget.dataset)
   },

+ 10 - 2
pages/stock/stock.wxml

@@ -70,17 +70,25 @@
   <view wx:else class="hot_list">
     <view class="top_bg">
       <image mode="widthFix" src="../../xiao/titlehot@2x.png"></image>
-      <view class="top_title">顽主杯热榜
+      <view class="top_title">顽    
       <image bindtap="toSearch" class="search-img" mode="widthFix" src="../../xiao/search@2x.png"></image>
+      <view style="font-size: 22rpx; color: white; word-spacing: 50%;">短线人气金榜</view>
         <picker mode="date" value="{{stock_date}}"  bindchange="bindDateChange">
                     <view class="date-picker">
+                    
                       {{stock_date}}
                       <image style="width: 16rpx;" mode="widthFix" src="../../xiao/choosedown@2x.png"></image>
                     </view>
         </picker>
       </view>
     </view>
-    <scroll-view  scroll-y='{{true}}' bindscrolltolower='next' style="background: #fff;padding:0 30rpx;">
+    
+    <view class="paixu" bind:tap="paixu">
+      <label>{{paixu}}</label>
+      <image src="../../xiao/px.png"></image>
+    </view>
+
+    <scroll-view  scroll-y='{{true}}' bindscrolltolower='next' style="background: #fff;padding:0 20rpx;">
         <navigator hover-class="none" class="list" url="../stock/stock?id={{item.id}}&&stock_date={{stock_date}}&type=1" wx:for='{{list}}'>
           <image wx:if="{{index<3}}" class="number" mode="widthFix" src="../../xiao/{{index+1}}.png"></image>
           <text wx:else class="number">{{index+1}}</text>

+ 21 - 2
pages/stock/stock.wxss

@@ -16,7 +16,7 @@ page{
   margin: auto;
   color: #fff;
   text-align: center;
-  top: 20rpx;
+  top: 10rpx;
   font-size: 46rpx;
   font-weight: 600;
 }
@@ -42,9 +42,28 @@ page{
 .hot_list scroll-view{
   height: calc(100vh - 180rpx);
   position: relative;
-  top: -48rpx;
+  top: -38rpx;
   border-radius: 37rpx;
 }
+
+.paixu{
+  font-size: 32rpx;
+  display: flex;
+  position: relative;
+  top: -38rpx;
+}
+
+.paixu label{
+  margin-left: auto;
+}
+
+.paixu image{
+  width: 48rpx;
+  height: 48rpx;
+  margin-left: -10rpx;
+  margin-right: 10rpx;
+}
+
 .detail image{
   width: 100%;
   border-radius: 8rpx;

+ 1 - 1
pages/tlb/tlb.wxml

@@ -1,7 +1,7 @@
 <wxs module="filters" src="../../utils/toFixed.wxs" />
 <view class="top_bg">
       <image mode="widthFix" src="../../xiao/titlebg@2x.png"></image>
-      <view class="top_title">顽主杯屠龙榜</view>
+      <view class="top_title">顽     榜</view>
 </view>
 <view class="tab">
   <view bindtap="tab"   data-id='win' class="{{cur=='win'?'act':''}}">今日盈利榜</view>

+ 15 - 2
pages/today/today.js

@@ -22,7 +22,8 @@ Page({
     },
     ec1: {
       onInit: null
-    }
+    },
+    fund_inout:'',
   },
 
   /**
@@ -132,8 +133,20 @@ Page({
       })
       records = res.data.data.records
       today_stock = res.data.data.today_record.today_stock
+      var inout = '';
+      var fund_io = res.data.data.fund_inout;
+
+      if(fund_io.id){
+        if(fund_io.fundin - fund_io.fundout  > 0){
+          inout = ' (入金:' + (fund_io.fundin - fund_io.fundout) + 'w)';
+        } else{
+          inout = ' (出金:' + (fund_io.fundout - fund_io.fundin) + 'w)';
+        }
+      }
+
       this.setData({
-        today_stock:today_stock
+        today_stock:today_stock,
+        fund_inout:inout,
       })
       this.getDays()
       this.getzan()

+ 2 - 1
pages/today/today.wxml

@@ -19,6 +19,7 @@
     </view>
     <view class="today_income {{datas.today_record.today_income[0]=='-' ?'down':'up'}}">{{datas.today_record.today_income_fund}} 
       <text  class="{{datas.today_record.today_income[0]=='-' ?'down':'up'}}">{{datas.today_record.today_income}}</text>
+      <text>{{fund_inout}}</text>
     </view>
     <view class="label">今日收益</view>
     <view class="data" style="padding-right:30rpx;border-right: 1px solid rgba(245, 245, 245, 1);">
@@ -28,7 +29,7 @@
             开超市
       </view>
       <block wx:elif='{{datas.today_record.today_stock_total>0}}'>
-        <text class="label">今日持仓</text><text>{{datas.today_record.today_stock_total}}W</text>
+        <text class="label">初始资金</text><text>{{datas.today_record.init_fund}}W</text>
       </block>
       <view class="label"  wx:else>
             空仓

BIN
xiao/px.png