tanyanfei 3 lat temu
rodzic
commit
f1b6a5162f

+ 4 - 1
app.json

@@ -1,9 +1,12 @@
 {
   "pages": [
+    
+    "pages/index/index",
+    "pages/stock/stock",
     "pages/upload/upload",
     "pages/user/user",
     "pages/myMatchDetail/myMatchDetail",
-    "pages/index/index",
+    "pages/record/record",
     
     "pages/mymatch/mymatch",
     "pages/follow/follow",

+ 3 - 0
app.wxss

@@ -27,4 +27,7 @@ page,view,text,swiper,scroll-view{
   text-align: center;
   color: #999;
   padding: 10rpx 0;
+}
+.info{
+  width: 100%;
 }

+ 2 - 0
pages/day/day.wxml

@@ -1,5 +1,6 @@
 <scroll-view scroll-y='{{true}}' bindscrolltolower='next'>
   <view class="stock" wx:for='{{list}}'>
+  <navigator url="../record/record?id={{item.id}}" >
     <view class="info">
       <view>{{item.stock_date}}(收益 <text  class="{{item.today_income[0]=='-' ?'down':'up'}}">{{item.today_income}}</text>)</view>
     </view>
@@ -11,6 +12,7 @@
           {{i.name}}({{i.fund}}w)
         </block>
     </view></view>
+    </navigator>
     <view class="imgs">
           <image wx:for='{{item.today_stock_img}}' wx:for-item='i'  bindtap="preview" data-src='{{i}}' data-urls='{{item.today_stock_img}}'
                  class="img" src="{{i}}"></image>

+ 7 - 1
pages/detail/detail.js

@@ -1,4 +1,6 @@
 // pages/detail/detail.js
+// 29014
+const $api = require('../../utils/api.js').API;
 Page({
 
   /**
@@ -12,7 +14,11 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-
+    $api.getArticle({id:options.id}).then(res=>{
+      this.setData({
+        info:res.data.data
+      })
+    })
   },
 
   /**

+ 3 - 3
pages/detail/detail.wxml

@@ -1,5 +1,5 @@
-<view class='title'>第46届顽主杯千万组冠军-创梦930:持续锁仓</view>
-<view class="date">2021-12-18</view>
+<view class='title'>{{info.name}}</view>
+<view class="date">{{info.ctime}}</view>
 <view class="content">
-  北交所11月12日宣布,目前各项准备工作均已就绪,定于11月15日正式开市。截至11月12日,累计有210万户投资者预约开通北交所合格投资者权限,开市后合计可参与北交所交易的投资者超400万户。
+  {{info.content}}
 </view>

+ 5 - 5
pages/index/index.wxml

@@ -57,24 +57,24 @@
               </picker>
               <view class="hot">
                     <view class="tab1">热门持仓</view>
-                    <view class="gp" wx:for='{{hotbuyList}}'>
+                    <navigator url="../stock/stock?id={{item.id}}" class="gp" wx:for='{{hotbuyList}}'>
                         <image wx:if='{{index==0}}' mode="widthFix" src="../../images/1.png"></image>
                         <image wx:if='{{index==1}}' mode="widthFix" src="../../images/2.png"></image>
                         <image wx:if='{{index==2}}' mode="widthFix" src="../../images/3.png"></image>
                         <view class="gp-name">{{item.stock_name}}</view>
                         <view class="num">持仓 <text>{{item.count}}</text> 人</view>
-                    </view>
+                    </navigator>
                     <navigator class="more">查看更多 <image mode="widthFix" src="../../images/right_icon.png"></image></navigator>
               </view>
               <view class="hot">
                     <view class="tab2">热门清仓</view>
-                    <view class="gp" wx:for='{{hotsellList}}'>
+                    <navigator url="../stock/stock?id={{item.id}}" class="gp" wx:for='{{hotsellList}}'>
                         <image wx:if='{{index==0}}' mode="widthFix" src="../../images/1.png"></image>
                         <image wx:if='{{index==1}}' mode="widthFix" src="../../images/2.png"></image>
                         <image wx:if='{{index==2}}' mode="widthFix" src="../../images/3.png"></image>
                         <view class="gp-name">{{item.stock_name}}</view>
                         <view class="num">持仓 <text>{{item.count}}</text> 人</view>
-                    </view>
+                    </navigator>
                     <navigator class="more">查看更多 <image mode="widthFix" src="../../images/right_icon.png"></image></navigator>
               </view>
           </view>
@@ -135,7 +135,7 @@
   </swiper-item>
   <swiper-item>
       <scroll-view  scroll-y='{{true}}'>
-          <navigator class="list" wx:for='{{championList}}'>
+          <navigator url="../detail/detail?id={{item.id}}" class="list" wx:for='{{championList}}'>
              <view>
                 <view class="title">
                    {{item.name}}

+ 79 - 0
pages/record/record.js

@@ -0,0 +1,79 @@
+// pages/record/record.js
+const $api = require('../../utils/api.js').API;
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    options.id = 29014
+    $api.getRecord({ id: options.id}).then(res=>{
+      this.setData({
+        info:res.data.data
+      })
+    })
+  },
+  //预览
+  preview(e) {
+    wx.previewImage({
+      urls: e.target.dataset.urls,
+      current: e.target.dataset.src
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
pages/record/record.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "每日持仓详情"
+}

+ 27 - 0
pages/record/record.wxml

@@ -0,0 +1,27 @@
+<!--pages/record/record.wxml-->
+<view class="top">
+  <view class="info">
+                  日期: <view>{{info.stock_date}}</view>
+  </view>
+  <view class="info">
+                资产:<view><label>{{info.today_fund}}w</label>(今日收益 <text  class="{{info.today_income[0]=='-' ?'down':'up'}}">{{info.today_income}}%</text><text style="color:#F5F5F5;">  |  </text>总收益<text  class="{{info.total_income[0]=='-' ?'down':'up'}}">{{info.total_income}}%</text>)</view>
+  </view>
+  <view class="info">
+                持仓: <view>
+                <block wx:for='{{info.today_stock}}' wx:for-item='i'>
+                  {{i.name}}({{i.fund}}w)
+                </block>
+                </view>
+  </view>
+  <view class="imgs">
+          <image wx:for='{{info.today_stock_img}}' wx:for-item='i'  bindtap="preview" data-src='{{i}}' data-urls='{{info.today_stock_img}}'
+                 class="img" src="{{i}}"></image>
+  </view>
+</view>
+
+<view class="content">
+    <text>操盘总结</text>{{info.experience}}
+</view>
+<view class="content comment">
+    <text>顽主点评</text>{{info.wanzhu_comment}} 
+</view>

+ 108 - 0
pages/record/record.wxss

@@ -0,0 +1,108 @@
+/* pages/record/record.wxss */
+page{
+  background: #F7F7F7;
+}
+.top{
+  background: #fff;
+  padding: 30rpx;
+}
+.name{
+  font-size: 32rpx;
+  font-weight: 500;
+  margin-bottom: 20rpx;
+}
+.name>text{
+  color: #AAAAAA;
+  font-size: 22rpx;
+  border: 1px solid #AAAAAA;
+  border-radius: 4rpx;
+  font-weight: 400;
+  padding: 0 4rpx;
+  position: relative;
+  top: -3rpx;
+}
+.name view{
+  float: right;
+  color: #CE994F;
+  font-size: 22rpx;
+  text-align: center;
+  position: relative;
+  top: -5rpx;
+}
+.info{
+  font-size: 30rpx;
+  padding: 10rpx 0;
+  display: flex;
+}
+.info view{
+  color: #666;
+  width: 85%;
+  vertical-align: top;
+}
+.info label{
+  font-weight: 500;
+  color: #333;
+}
+.info .tag{
+  font-size: 28rpx;
+  color: #CE994F;
+  border: 1px solid #CE994F;
+  border-radius: 8rpx;
+  margin-right: 8rpx;
+  font-weight: 400;
+  padding: 0 8rpx;
+}
+.player{
+  border-bottom: 1px solid #F5F5F5;
+  padding: 30rpx 0;
+}
+.name view{
+  float: right;
+  color: #CE994F;
+  font-size: 22rpx;
+  text-align: center;
+  position: relative;
+  top: -5rpx;
+}
+.name view text{
+  display: block;
+  font-size: 32rpx;
+  color: #CE994F;
+  position: relative;
+  top: -8rpx;
+}
+.imgs{
+  margin-bottom: 20rpx;
+  background: #fff;
+  padding: 30rpx 0;
+}
+.img{
+  display: inline-block;
+  width: 224rpx;
+  height: 224rpx;
+  border-radius: 8rpx;
+  margin-right: 8rpx;
+  margin-bottom: 8rpx;
+}
+.content{
+  background: #fff;
+  padding: 30rpx;
+  margin-top: 20rpx;
+  font-size: 30rpx;
+  line-height: 48rpx;
+}
+.content text{
+  color: #D94B24;
+  width: 128rpx;
+  line-height: 48rpx;
+  display: inline-block;
+  text-align: center;
+  background: #FFF5F2;
+  margin-right: 20rpx;
+  font-size: 28rpx;
+  border-radius: 4rpx;
+}
+.comment text{
+  background: #F2F9FF;
+  color: #2383E5;
+}

+ 7 - 0
pages/search/search.js

@@ -32,6 +32,13 @@ Page({
     this.setData({
       id: options.id
     })
+    $api.getEnumList().then(res=>{
+      this.setData({
+        arr1:res.data.data.zq,
+        arr2: res.data.data.cw,
+        arr3: res.data.data.df
+      })
+    })
     this.getData();
   },
   next: function () {

+ 74 - 0
pages/stock/stock.js

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

+ 3 - 0
pages/stock/stock.json

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

+ 17 - 0
pages/stock/stock.wxml

@@ -0,0 +1,17 @@
+<!--pages/stock/stock.wxml-->
+<image mode="withFix" src="{{info.img}}"></image>
+<view class="desc">{{info.desc}}</view>
+<view class="player" wx:for='{{info.list}}'>
+    <view class="name">{{item.username}}  <text>选手</text> 
+    <view>TOP <text>{{item.match_group}}</text></view></view> 
+    <view class="info">
+                资产:<view><label>{{item.today_fund}}w</label>(今日收益 <text  class="{{item.today_income<0 ?'down':'up'}}">{{item.today_income}}%</text><text style="color:#F5F5F5;">  |  </text>总收益<text  class="{{item.total_income<0 ?'down':'up'}}">{{item.total_income}}%</text>)</view>
+    </view>
+    <view class="info">
+                持仓: <view>
+                <block wx:for='{{item.today_stock}}' wx:for-item='i'>
+                  {{i.name}}({{i.fund}}w)
+                </block>
+                </view>
+    </view>
+  </view>

+ 78 - 0
pages/stock/stock.wxss

@@ -0,0 +1,78 @@
+/* pages/stock/stock.wxss */
+page{
+  padding: 30rpx;
+}
+image{
+  width: 100%;
+  border-radius: 8rpx;
+}
+.desc{
+  font-size: 30rpx;
+  line-height: 48rpx;
+  margin: 30rpx 0;
+}
+.name{
+  font-size: 32rpx;
+  font-weight: 500;
+  margin-bottom: 20rpx;
+}
+.name>text{
+  color: #AAAAAA;
+  font-size: 22rpx;
+  border: 1px solid #AAAAAA;
+  border-radius: 4rpx;
+  font-weight: 400;
+  padding: 0 4rpx;
+  position: relative;
+  top: -3rpx;
+}
+.name view{
+  float: right;
+  color: #CE994F;
+  font-size: 22rpx;
+  text-align: center;
+  position: relative;
+  top: -5rpx;
+}
+.info{
+  font-size: 30rpx;
+  padding: 10rpx 0;
+  display: flex;
+}
+.info view{
+  color: #666;
+  width: 85%;
+  vertical-align: top;
+}
+.info label{
+  font-weight: 500;
+  color: #333;
+}
+.info .tag{
+  font-size: 28rpx;
+  color: #CE994F;
+  border: 1px solid #CE994F;
+  border-radius: 8rpx;
+  margin-right: 8rpx;
+  font-weight: 400;
+  padding: 0 8rpx;
+}
+.player{
+  border-bottom: 1px solid #F5F5F5;
+  padding: 30rpx 0;
+}
+.name view{
+  float: right;
+  color: #CE994F;
+  font-size: 22rpx;
+  text-align: center;
+  position: relative;
+  top: -5rpx;
+}
+.name view text{
+  display: block;
+  font-size: 32rpx;
+  color: #CE994F;
+  position: relative;
+  top: -8rpx;
+}

+ 8 - 0
pages/style/style.js

@@ -24,6 +24,14 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
+    $api.getEnumList().then(res => {
+      this.setData({
+        arr1: res.data.data.zq,
+        arr2: res.data.data.cw,
+        arr3: res.data.data.df,
+        arr4: res.data.data.pz
+      })
+    })
     $api.getMyStyle().then(res=>{
         this.setData({
           form:res.data.data

+ 14 - 12
pages/today/today.wxml

@@ -69,18 +69,20 @@
           查看更多  <image mode="widthFix" src="../../images/right_icon.png"></image>
     </navigator>
   </view>
-  <view class="stock" wx:for='{{stockList}}' wx:if="{{index<3}}">
-    <view class="info">
-      <view>{{item.stock_date}}(收益 <text  class="{{item.today_income[0]=='-' ?'down':'up'}}">{{item.today_income}}</text>)</view>
-    </view>
-    <view class="info">
-      资产:  <view><label>{{item.today_fund}}w</label> (收益 <text  class="{{item.total_income[0]=='-' ?'down':'up'}}">{{item.total_income}}</text>)</view>
-    </view>
-    <view class="info">持仓: <view>
-        <block wx:for='{{item.today_stock}}' wx:for-item='i'>
-          {{i.name}}({{i.fund}}w)
-        </block>
-    </view></view>
+  <view  class="stock" wx:for='{{stockList}}' wx:if="{{index<3}}">
+    <navigator url="../record/record?id={{item.id}}">
+      <view class="info">
+        <view>{{item.stock_date}}(收益 <text  class="{{item.today_income[0]=='-' ?'down':'up'}}">{{item.today_income}}</text>)</view>
+      </view>
+      <view class="info">
+        资产:  <view><label>{{item.today_fund}}w</label> (收益 <text  class="{{item.total_income[0]=='-' ?'down':'up'}}">{{item.total_income}}</text>)</view>
+      </view>
+      <view class="info">持仓: <view>
+          <block wx:for='{{item.today_stock}}' wx:for-item='i'>
+            {{i.name}}({{i.fund}}w)
+          </block>
+      </view></view>
+    </navigator>
     <view class="imgs">
           <image wx:for='{{item.today_stock_img}}' wx:for-item='i'  bindtap="preview" data-src='{{i}}' data-urls='{{item.today_stock_img}}'
                  class="img" src="{{i}}"></image>

+ 5 - 2
utils/api.js

@@ -95,6 +95,7 @@ const API = {
   getOpenid: (data) => request(GET, `/api/wx/openid`, data),
   login: (data) => request(POST, `/api/wx/login`, data),
   getAuthinfo: (data) => request(GET, `/api/wx/authinfo`, data),
+  getEnumList: (data) => request(GET, `/api/wx/v2/enum/list`, data),
   getIndex: (data) => request(GET, `/api/wx/index`, data),
   getRank: (data) => request(GET, `/api/wx/group/rank/list`, data),
   getRankList: (data) => request(GET, `/api/wx/group/rank`, data),
@@ -115,9 +116,11 @@ const API = {
   follow: (data) => request(POST, `/api/wx/v2/user/follow`, data),
   getPlayerList: (data) => request(GET, `/api/wx/v2/player/list`, data),
   updateRecord: (data) => request(POST, `/api/wx/player/record`, data),
+  getRecord: (data) => request(GET, `/api/wx/player/record`, data),
   getCurrecord: (data) => request(GET, `/api/wx/player/currecord`, data),
-  
-  
+  getArticle: (data) => request(GET, `/api/wx/article`, data),
+  getStock: (data) => request(GET, `/api/wx/v2/stock`, data),
+
 }; 
 module.exports = {
   API: API