jwyu 2 lat temu
rodzic
commit
669084e50c

+ 13 - 0
pages.json

@@ -93,6 +93,19 @@
 				"navigationBarTitleText": "我的图库",
 				"enablePullDownRefresh": true
 			}
+		},
+		{
+			"path":"pages/positionAnalysis/index",
+			"style": {
+				"navigationBarTitleText": "持仓分析",
+				"enablePullDownRefresh": true
+			}
+		},
+		{
+			"path":"pages/positionAnalysis/detail",
+			"style": {
+				"navigationBarTitleText": "持仓分析"
+			}
 		}
 	],
 	"subPackages":[

+ 59 - 0
pages/positionAnalysis/components/indexContent.vue

@@ -0,0 +1,59 @@
+<template>
+    <view class="list-content-wrap">
+        <view class="top-box">
+            <text style="margin-right:20rpx">4品种</text>
+            <text>2023-2-06 13:30:30</text>
+        </view>
+        <view class="list-wrap">
+            <view class="flex item" v-for="item in 4" :key="item">
+                <view class="label">动力煤</view>
+                <view style="flex:1">
+                    <view class="opt">zc</view>
+                    <view class="opt">zcccccc</view>
+                    <view class="opt">zc</view>
+                    <view class="opt">zcccccc</view>
+                </view>
+            </view>
+        </view>
+    </view>
+      
+</template>
+
+<script>
+const dayjs=require('@/utils/dayjs.min')
+export default {
+    name:'IndexContent',
+    
+}
+</script>
+
+<style lang="scss" scoped>
+.list-content-wrap{
+    .top-box{
+        background: rgba(207, 192, 159, 0.1);
+        padding: 15rpx 45rpx;
+    }
+    .list-wrap{
+        padding: 34rpx 0 34rpx 34rpx;
+        .item{
+            margin-bottom: 40rpx;
+
+            .label{
+                color: #666;
+                width: 150rpx;
+                padding-top: 15rpx;
+            }
+            .opt{
+                padding: 15rpx 10rpx;
+                width: 28%;
+                text-align: center;
+                display: inline-block;
+                margin-right: 20rpx;
+                margin-bottom: 20rpx;
+                background: #F5EFE2;
+                font-size: 24rpx;
+            }
+        }
+    }
+}
+</style>

+ 35 - 0
pages/positionAnalysis/detail.vue

@@ -0,0 +1,35 @@
+<template>
+    <web-view :src="url"></web-view>
+</template>
+
+<script>
+import {h5BaseUrl} from '@/utils/config'
+export default {
+    data () {
+        return {
+            url:''
+        }
+    },
+    onLoad(options){
+        const queryObj={
+            id:0,
+            token:this.$store.state.user.token||uni.getStorageSync("token"),
+            timestamp:new Date().getTime(),//防止缓存
+        }
+        let queryObjStr=''
+        for (const key in queryObj) {
+            if(!queryObjStr){
+                    queryObjStr=`${key}=${queryObj[key]}`
+            }else{
+                queryObjStr=`${queryObjStr}&${key}=${queryObj[key]}`
+            }
+        }
+        console.log('拼接字符串:',queryObjStr);
+        this.url=`${h5BaseUrl}/hzyb/chart/positionanalysis?${queryObjStr}#wechat_redirect`
+    }
+}
+</script>
+
+<style>
+
+</style>

+ 68 - 0
pages/positionAnalysis/index.vue

@@ -0,0 +1,68 @@
+<template>
+    <view class="position-analysis-page">
+        <van-tabs 
+            :active="activeType" 
+            sticky 
+            animated 
+            swipeable 
+            color="#E3B377"
+        >
+            <van-tab 
+                :title="item.title" 
+                v-for="item in opts" 
+                :key="item.val"
+            ><indexContent/></van-tab>
+        </van-tabs>
+    </view>
+      
+</template>
+
+<script>
+import indexContent from './components/indexContent.vue'
+export default {
+    components:{indexContent},
+    data() {
+        return {
+            opts:[
+                {
+                    title:'郑商所',
+                    val:'1'
+                },
+                {
+                    title:'大商所',
+                    val:'2'
+                },
+                {
+                    title:'上期所',
+                    val:'3'
+                },
+                {
+                    title:'中金所',
+                    val:'4'
+                },
+                {
+                    title:'能源所',
+                    val:'5'
+                }
+            ]
+        }
+    },
+    onPullDownRefresh() {
+		setTimeout(() => {
+			uni.stopPullDownRefresh()
+		}, 1500);
+	},
+	//转发分享
+	onShareAppMessage(){
+		return{
+			title:'持仓分析',
+		}
+	},
+}
+</script>
+
+<style lang="scss">
+.van-sticky-wrap--fixed{
+    box-shadow: 0px 4px 4px rgba(198, 198, 198, 0.25);
+}
+</style>