Sfoglia il codice sorgente

预测结果接口接入

JXDS18FUJT 1 anno fa
parent
commit
ef9fa61acb

+ 4 - 0
js-calendar-converter.d.ts

@@ -0,0 +1,4 @@
+declare module 'calendar'{
+    
+    
+} 

+ 5 - 0
package-lock.json

@@ -10940,6 +10940,11 @@
         "@sideway/pinpoint": "^2.0.0"
       }
     },
+    "js-calendar-converter": {
+      "version": "0.0.6",
+      "resolved": "https://registry.npmmirror.com/js-calendar-converter/-/js-calendar-converter-0.0.6.tgz",
+      "integrity": "sha512-0TRHm2jaGRAbXd1sKvzHSW3hB+oqo2h6EAHMAPpuEj0WYic+KWgsA+41PnNx03ggyGTAHx29diDqFxqHFctAGg=="
+    },
     "js-message": {
       "version": "1.0.7",
       "resolved": "https://registry.npmjs.org/js-message/-/js-message-1.0.7.tgz",

+ 1 - 0
package.json

@@ -74,6 +74,7 @@
     "axios-miniprogram-adapter": "^0.3.5",
     "core-js": "^3.8.3",
     "flyio": "^0.6.2",
+    "js-calendar-converter": "0.0.6",
     "less": "^4.2.0",
     "less-loader": "^7.3.0",
     "miniprogram-api-typings": "^3.12.1",

+ 29 - 15
src/api/openApi/index.ts

@@ -2,32 +2,46 @@ import { Axios, AxiosPromise } from "axios";
 import request from "../request";
 import { openApiRes } from "./type";
 export default {
-    openApiGanZhiList(params:{
-        color?:string
-        five?:string
-        name:string
+    openApiGanZhiList(params: {
+        color?: string
+        five?: string
+        name: string
 
-    }):AxiosPromise<openApiRes.openApiGanZhiGet8ziByDate>{
+    }): AxiosPromise<openApiRes.openApiGanZhiGet8ziByDate> {
         return request({
             params,
             method: 'GET',
             url: "/open-api/gan/zhi/list",
-           
+
         })
     },
-    openApiGanZhiGet8ziByDate(params:{
-        birthDay:string,
-        isSave:number,
-        sex:number,
-        username:string
-      
+    openApiGanZhiGet8ziByDate(params: {
+        birthDay: string,
+        isSave: number,
+        sex: number,
+        username: string
+
 
-    }):AxiosPromise<openApiRes.openApiGanZhiGet8ziByDate>{
+    }): AxiosPromise<openApiRes.openApiGanZhiGet8ziByDate> {
         return request({
             params,
             method: 'GET',
             url: "/open-api/gan/zhi/get8ziByDate",
-          
+
+        })
+    },
+    openApiBirthdayLog(data: {
+        "birthday": string,
+        "isPay"?: number,
+        "name": string,
+        "sex": number,
+    }):AxiosPromise<openApiRes.openApiBirthdayLog> {
+        return request({
+            data,
+            method: 'post',
+            url: "/student/birthday/log",
+
         })
     }
-}
+}
+

+ 41 - 23
src/api/openApi/type.d.ts

@@ -7,37 +7,55 @@ export declare namespace openApiRes {
     interface openApiGanZhiGet8ziByDate extends commonRes {
         data: {
             username: string
-            sex:0|1
-            birthDay:string
-            nongDay:string
-            score:number
-            riYuan:string
-            ganZhiRowVoList:{
-                gongWei:string
-                xi:string
-                ji:string 
-                name:string
-                five:string
-                color:string
-                shiShen1:string
-                shiShen2:string
-                shiShen3:string
-                textColor?:string
+            sex: 0 | 1
+            birthDay: string
+            nongDay: string
+            score: number
+            riYuan: string
+            ganZhiRowVoList: {
+                gongWei: string
+                xi: string
+                ji: string
+                name: string
+                five: string
+                color: string
+                shiShen1: string
+                shiShen2: string
+                shiShen3: string
+                textColor?: string
 
             }[]
-            ganZhiNaYinVoList:{
-                naYin:string
-                zhu:string
+            ganZhiNaYinVoList: {
+                naYin: string
+                zhu: string
 
             }[]
-            ganZhiKongWangVoList:{
-                kongWang:string 
-                zhu:string
+            ganZhiKongWangVoList: {
+                kongWang: string
+                zhu: string
             }[]
-            
+            diseasePartList: {
+                degree: string,
+                id: number,
+                part: string,
+                sex: number,
+                symp: string
+            }[]
+            numberYunMap: {
+                numberYuns: string
+                numberYunList: {
+                    caiYun: string
+                    id: string
+                    taoHua: string
+                }[]
+            }
+
 
         }
 
+    }
+    interface openApiBirthdayLog extends commonRes {
+
     }
 }
 

+ 2 - 2
src/api/request.ts

@@ -2,7 +2,7 @@ import axios, { AxiosRequestConfig, AxiosResponse } from "axios";
 import axiosAdapterUniapp from 'axios-adapter-uniapp'
 import { config } from "vue/types/umd";
 const request = axios.create({
-    baseURL: process.env.NODE_ENV === "production" ? "https://xpgx.zzxcx.net/prod-api/" : "https://xpgx1.zzxcx.net/xpgx-admin/",
+    baseURL: process.env.NODE_ENV === "production" ? "https://xpgx.zzxcx.net/prod-api/" : "https://xpgx1.zzxcx.net/stage-api/",
 
 });
 axios.defaults.adapter = axiosAdapterUniapp
@@ -14,7 +14,7 @@ request.interceptors.request.use<AxiosRequestConfig<any>>(config => {
     }
     else {
 
-        config.headers ? config.headers["Authorization"] = "Bearer " + token : ''
+        config.headers ? config.headers["Authorization"] = ("Bearer " + token) : ''
         return config
     }
 

+ 6 - 0
src/pages.json

@@ -11,6 +11,12 @@
 			"style": {
 				"navigationBarTitleText": "预测结果"
 			}
+		},
+		{
+			"path":"pages/forecastHistory/index",
+			"style": {
+				"navigationBarTitleText": "预测结果历史"
+			}
 		}
 	],
 	"globalStyle": {

+ 94 - 9
src/pages/forecast/index.vue

@@ -43,24 +43,28 @@
                     <view style="color: #333;" class="body">
                         <view class="row">十神</view>
                         <view class="row">{{
-                            userData.ganZhiProRowVoList[0][0].shiShen1 || '' + userData.ganZhiProRowVoList[0][0].shiShen2 || '' + userData.ganZhiProRowVoList[0][0].shiShen3 || ''
+                            userData.ganZhiProRowVoList[0][0].shiShen1 || '' + userData.ganZhiProRowVoList[0][0].shiShen2 ||
+                            '' + userData.ganZhiProRowVoList[0][0].shiShen3 || ''
                         }}</view>
                         <view class="row">{{
-                            userData.ganZhiProRowVoList[1][0].shiShen1 || '' + userData.ganZhiProRowVoList[1][0].shiShen2 || '' + userData.ganZhiProRowVoList[1][0].shiShen3 || ''
+                            userData.ganZhiProRowVoList[1][0].shiShen1 || '' + userData.ganZhiProRowVoList[1][0].shiShen2 ||
+                            '' + userData.ganZhiProRowVoList[1][0].shiShen3 || ''
                         }}</view>
                         <view style="color: #006494;" class="row">{{ userData.ganZhiProRowVoList[2][0].shiShen1 || '' +
-                            userData.ganZhiProRowVoList[2][0].shiShen2 || '' + userData.ganZhiProRowVoList[2][0].shiShen3 || '' }}
+                            userData.ganZhiProRowVoList[2][0].shiShen2 || '' + userData.ganZhiProRowVoList[2][0].shiShen3 ||
+                            '' }}
                         </view>
                         <view class="row">{{
-                            userData.ganZhiProRowVoList[3][0].shiShen1 || '' + userData.ganZhiProRowVoList[3][0].shiShen2 || '' + userData.ganZhiProRowVoList[3][0].shiShen3 || ''
+                            userData.ganZhiProRowVoList[3][0].shiShen1 || '' + userData.ganZhiProRowVoList[3][0].shiShen2 ||
+                            '' + userData.ganZhiProRowVoList[3][0].shiShen3 || ''
                         }}</view>
 
                     </view>
                     <view class="body">
                         <view class="row">天干</view>
                         <view :style="{
-                            color: userData.ganZhiProRowVoList[0][0].textColor
-                        }" class="row">{{ userData.ganZhiProRowVoList[0][0].name }}</view>
+                                    color: userData.ganZhiProRowVoList[0][0].textColor
+                                }" class="row">{{ userData.ganZhiProRowVoList[0][0].name }}</view>
                         <view :style="{
                             color: userData.ganZhiProRowVoList[1][0].textColor
                         }" class="row">{{ userData.ganZhiProRowVoList[1][0].name }}</view>
@@ -122,12 +126,43 @@
             </view>
             <view class="result">
                 <img mode="widthFix" class="imgCircle" src="https://ndata.zzxcx.net/xpgx-xcx/forecast/circle.png">
-                <view class="imgTitle"><text>甲</text><text>辰</text><text>日</text><text>柱</text></view>
+                <view class="imgTitle"><text>喜</text><text>用</text><text>数</text><text>字</text></view>
                 <img mode="widthFix" class="imgHeader" src="https://ndata.zzxcx.net/xpgx-xcx/forecast/bg_top.png" />
                 <view class="result-content">
-                    <view class="">
+                    <view class="result-desc result-desc_limit">
+                        尊敬的朋友,请在手机号、门牌号、工号等。尽可能多选用以下数字:
+                        您手握着一个神奇的喜用数字:1, 2, 3, 4, 5, 6, 7, 8, 9, 0!这不仅仅是一串数字,更是您个人财运和桃花运的精彩密码。让我们一同揭示这些数字所蕴含的神秘能量吧!
 
                     </view>
+                    <view class="result-pay">开通会员立即查看</view>
+                    <!-- <img  mode="widthFix" src="https://ndata.zzxcx.net/xpgx-xcx/forecast/bg_middle.png" /> -->
+                    <!-- <view class="result-content-border1">
+                        <view class="result-content-border2">
+                        </view>
+                    </view> -->
+                </view>
+                <img mode="widthFix" class="imgFooter" src="https://ndata.zzxcx.net/xpgx-xcx/forecast/bg_bottom.png" />
+            </view>
+            <view style="width: 100%;height: 55rpx;"></view>
+            <view class="result">
+                <img mode="widthFix" class="imgCircle" src="https://ndata.zzxcx.net/xpgx-xcx/forecast/circle.png">
+                <view class="imgTitle"><text>易</text><text>发</text><text>疾</text><text>病</text></view>
+                <img mode="widthFix" class="imgHeader" src="https://ndata.zzxcx.net/xpgx-xcx/forecast/bg_top.png" />
+                <view class="result-content ">
+                    <view class="result-desc">
+                        当我们关注身体健康时,了解各宫位的能量分布可以帮助我们判断可能出现的疾病。请特别留意以下身体部位可能存在的问题,并在早期进行检查,以便及时预防。
+
+
+                    </view>
+                    <view class="result-disease">
+                        <view v-for="item in userData.diseasePartList" class="">
+                            <text style="color: #006494;"> {{ item.part }}:</text>
+                            <text>({{ item.degree }}) {{ item.symp }}</text>
+                        </view>
+                    </view>
+
+                    <view class="result-pay">开通会员立即查看</view>
+                    <!-- <view class="result-pay">开通会员立即查看</view> -->
                     <!-- <img  mode="widthFix" src="https://ndata.zzxcx.net/xpgx-xcx/forecast/bg_middle.png" /> -->
                     <!-- <view class="result-content-border1">
                         <view class="result-content-border2">
@@ -350,6 +385,21 @@ export default Vue.extend({
                     naYin: '',
                     zhu: ''
                 }],
+                diseasePartList: [{
+                    degree: "轻症",
+                    id: 9,
+                    part: "腹部",
+                    sex: 3,
+                    symp: "腹部胀气、腹部痉挛"
+                }],
+                numberYunMap: {
+                    numberYuns: '',
+                    numberYunList: [{
+                        caiYun: "数字1 带来独立和领导力,启示您在财务决策中追求卓越。",
+                        id: "1",
+                        taoHua: "1的活力能量,可能吸引到与您个性契合的人。"
+                    }]
+                },
                 ganZhiKongWangVoList: [{ kongWang: '', zhu: '' }, { kongWang: '', zhu: '' }, { kongWang: '', zhu: '' }, { kongWang: '', zhu: '' }]
 
 
@@ -451,11 +501,45 @@ export default Vue.extend({
         flex-wrap: wrap;
         position: relative;
 
+
+
         .result-content {
             width: 100%;
             min-height: 200rpx;
             background-image: url("https://ndata.zzxcx.net/xpgx-xcx/forecast/bg_middle.png");
             background-size: 100%;
+            font-size: 30rpx;
+            padding: 0 120rpx;
+
+            .result-desc {
+                width: 100%;
+            }
+
+            .result-desc_limit {
+               
+                display: -webkit-box;
+                -webkit-box-orient: vertical;
+                -webkit-line-clamp: 3;
+                overflow: hidden;
+                text-overflow: ellipsis
+            }
+
+            .result-pay {
+                margin: 0 auto;
+                margin-top: 40rpx;
+                width: 400rpx;
+                text-align: center;
+                height: 80rpx;
+                line-height: 80rpx;
+                color: #F5EC5A;
+                border-radius: 40px;
+                border: 4rpx solid #333333;
+                background: #E74D26;
+            }
+
+            .result-disease {
+                color: #000;
+            }
 
 
 
@@ -493,4 +577,5 @@ export default Vue.extend({
             width: 100%;
         }
     }
-}</style>
+}
+</style>

+ 145 - 0
src/pages/forecastHistory/index.vue

@@ -0,0 +1,145 @@
+<template>
+    <view>
+        <view class="bg">
+            <view class="list">
+                <view class="content">
+                    <view class="item">
+                        <view>
+                            阮琳琳 女 1993年4月21日
+                            <image class="item-vip" mode="widthFix" src="/static/icon/gold_vip@2x.png"></image>
+
+                        </view>
+                        <view>
+                            <image mode="widthFix" class="item-del" src="/static/icon/del@2x.png"></image>
+                        </view>
+
+                    </view>
+                    <view class="item">
+                        <view>
+                            夏初 女 1993年4月21日
+                            <image class="item-vip" mode="widthFix" src="/static/icon/gold_vip@2x.png"></image>
+                            <image class="item-vip" mode="widthFix" src="/static/icon/gray_vip@2x.png"></image>
+                        </view>
+                        <view>
+                            <image mode="widthFix" class="item-del" src="/static/icon/del@2x.png"></image>
+                        </view>
+
+                    </view>
+                </view>
+            </view>
+            <view class="buttons">
+                <view class="pre">
+                    上一页
+                </view>
+                <view class="mid">
+                    1/1
+                </view>
+                <view class="next">
+                    下一页
+                </view>
+            </view>
+        </view>
+    </view>
+</template>
+
+<script lang="ts">
+import Vue from 'vue';
+export default Vue.extend({
+    data() {
+        return {
+
+        }
+    },
+})
+</script>
+
+<style lang="less" scoped>
+.bg {
+    width: 100%;
+    min-height: 100vh;
+    background-color: #F6ECDB;
+    padding-bottom: 90rpx;
+}
+
+.list {
+    padding: 0 30rpx;
+    padding-top: 50rpx;
+    margin-bottom: 45rpx;
+
+    .content {
+        width: 100%;
+        background-color: #fff;
+        height: 160vw;
+        padding: 0 30rpx;
+
+        .item {
+            height: 80rpx;
+            width: 100%;
+            line-height: 80rpx;
+            font-size: 28rpx;
+            color: #333333;
+            border-bottom: 1rpx solid #E3E3E3;
+            display: flex;
+            align-items: center;
+            align-content: center;
+            justify-content: space-between;
+            view{
+                display: flex;
+                align-items: center;
+                align-content: center;
+            }
+            .item-vip {
+                width: 40rpx;
+                margin-left: 20rpx;
+            }
+
+            .item-del {
+                width: 40rpx;
+            }
+        }
+    }
+
+
+}
+
+.buttons {
+    width: 690rpx;
+    margin: 0 auto;
+    border: 4rpx solid #FDE575;
+    height: 12vw;
+    overflow: hidden;
+    border-radius: 10rpx;
+    display: flex;
+
+    .pre {
+        font-size: 34rpx;
+        background: linear-gradient(0deg, #D68D13, #EEBB65);
+        width: 230rpx;
+        line-height: 12vw;
+        color: #66271B;
+        text-align: center;
+
+    }
+
+    .mid {
+        font-size: 34rpx;
+        background: linear-gradient(0deg, #E79F26, #FACA7B);
+        width: 230rpx;
+        line-height: 12vw;
+        color: #66271B;
+        text-align: center;
+
+    }
+
+    .next {
+        font-size: 34rpx;
+        background: linear-gradient(0deg, #D68D13, #EEBB65);
+        width: 230rpx;
+        line-height: 12vw;
+        color: #66271B;
+        text-align: center;
+
+    }
+
+
+}</style>

+ 36 - 16
src/pages/index/index.vue

@@ -29,23 +29,23 @@
 					<view style="height: auto;" class="content-inputs-row">
 						<view class="content-inputs-row-label">出生时间</view>
 						<view style="display: flex;flex-wrap: wrap;justify-content: space-between;" class="">
-							<picker @change="changeFormBirthDay" :value="form.birthDay" fields="day" mode="date">
+							<picker @change="changeFormBirthDay" :value="form.birthday" fields="day" mode="date">
 								<view class="content-inputs-row-menu">
-									{{ form.birthDay.split('-')[0] }}年 <text
+									{{ form.birthday.split('-')[0] }}年 <text
 										style="font-weight: normal;text-indent: 0.5em;">
 										V</text>
 								</view>
 							</picker>
 							<picker @change="changeFormBirthDay" fields="day" mode="date">
 								<view class="content-inputs-row-menu">
-									{{ form.birthDay.split('-')[1] }}月 <text
+									{{ form.birthday.split('-')[1] }}月 <text
 										style="font-weight: normal;text-indent:  0.5em;">
 										V</text>
 								</view>
 							</picker>
 							<picker @change="changeFormBirthDay" fields="day" mode="date">
 								<view class="content-inputs-row-menu">
-									{{ form.birthDay.split('-')[2] }}日 <text
+									{{ form.birthday.split('-')[2] }}日 <text
 										style="font-weight: normal;text-indent:  0.5em;">
 										V</text>
 								</view>
@@ -73,7 +73,8 @@
 
 
 						</view>
-						<view style="color: red;text-align: right;width: 100%;font-size: 24rpx;padding-right: 90rpx;">排盘结果男女有别,请正确选择</view>
+						<view style="color: red;text-align: right;width: 100%;font-size: 24rpx;padding-right: 90rpx;">
+							排盘结果男女有别,请正确选择</view>
 					</view>
 					<view class="content-inputs-row">
 						<view class="content-inputs-row-label">是否保存</view>
@@ -92,10 +93,10 @@
 						</view>
 					</view>
 					<view class="content-button">
-						<navigator url="/pages/forecast/index">
-							<view class="content-button-submit">开始排盘</view>
-						</navigator>
-						
+						<!-- <navigator url="/pages/forecast/index"> -->
+							<view @click="submitForm" class="content-button-submit">开始排盘</view>
+						<!-- </navigator> -->
+
 					</view>
 				</view>
 
@@ -113,6 +114,7 @@
 <script lang="ts">
 import Vue from 'vue';
 import api from '@/api/index';
+import calendar from 'js-calendar-converter'
 export default Vue.extend({
 	data() {
 		return {
@@ -134,7 +136,8 @@ export default Vue.extend({
 				'亥时 21:00-23:00'
 			],
 			form: {
-				birthDay: '2023-11-01',
+				isPay:0,
+				birthday: '2023-11-01',
 				birthHour: '23:00',
 				birthChinaHour: '子时',
 				isSave: 0, //是否保存 0:不保存 1保存
@@ -147,13 +150,14 @@ export default Vue.extend({
 	onLoad() {
 		uni.login({
 			success: res => {
-				api.login.loginJscode({
-					jscode: res.code
-				}).then(result => {
-					uni.setStorageSync("token", result.data.data.token)
+				console.log(res)
+				// api.login.loginJscode({
+				// 	jscode: res.code
+				// }).then(result => {
+				// 	uni.setStorageSync("token", result.data.data.token)
 
 
-				})
+				// })
 
 			}
 
@@ -162,6 +166,16 @@ export default Vue.extend({
 
 	},
 	methods: {
+		submitForm(){
+			api.openApi.openApiBirthdayLog({
+				name:this.form.name,
+				sex:this.form.sex,
+				birthday:this.form.birthday+' '+this.form.birthHour+':00',
+				isPay:this.form.isPay
+			})
+
+
+		},
 		selectRadioByForm(e: WechatMiniprogram.TouchEvent) {
 			let field = String(e.target.dataset.field)
 			switch (field) {
@@ -181,7 +195,13 @@ export default Vue.extend({
 			this.form.birthHour = this.chinaHours[Number(e.detail.value)].split(' ')[1].split('-')[0]
 		},
 		changeFormBirthDay(e: WechatMiniprogram.PickerChange) {
-			this.form.birthDay = e.detail.value as string
+			console.log(e.detail)
+			this.form.birthday = e.detail.value as string
+			if (this.form.type == '农历') {
+				let birthDays = this.form.birthday.split('-')
+				let c = calendar.lunar2solar(birthDays[0], birthDays[1], birthDays[2])
+				this.form.birthday = `${c.cYear}-${c.cMonth}-${c.cDay}`
+			}
 
 		}
 	}

BIN
src/static/icon/del@2x.png


BIN
src/static/icon/gold_vip@2x.png


BIN
src/static/icon/gray_vip@2x.png


+ 1 - 0
tmp/build-errors.log

@@ -0,0 +1 @@
+exit status 1