瀏覽代碼

新增干支

JXDS18FUJT 1 年之前
父節點
當前提交
b085521e6c

File diff suppressed because it is too large
+ 415 - 175
package-lock.json


+ 3 - 2
package.json

@@ -65,9 +65,11 @@
     "crypto-js": "^4.1.1",
     "dayjs": "^1.10.5",
     "flyio": "^0.6.2",
+    "js-calendar-converter": "^0.0.6",
     "jsencrypt": "^3.2.1",
     "jsrsasign": "^10.5.20",
     "jsrsasign-util": "^1.0.5",
+    "miniprogram-api-typings": "^3.12.1",
     "mockjs": "^1.1.0",
     "node-sass": "^4.14.1",
     "qrcode": "^1.4.4",
@@ -76,8 +78,7 @@
     "sass-loader": "^7.3.1",
     "vant-weapp-convert-uniapp": "0.1.0-alpha.17",
     "vue": "^2.6.11",
-    "vuex": "^3.2.0",
-    "miniprogram-api-typings": "^3.12.1"
+    "vuex": "^3.2.0"
   },
   "devDependencies": {
     "@babel/runtime": "~7.12.0",

+ 15 - 0
src/api/modules/open.js

@@ -66,6 +66,21 @@ const open = {
             url: "open-api/system/dict/data/type/" + dictType
         })
 
+    },
+    //八字结果
+    openApiGanZhiGet8ziByDate(params) {
+        // console.log('params',params)
+        // params.birthday = encodeURIComponent(params.birthday)
+        return request({
+            url: "https://xpgx1.zzxcx.net/xpgx-admin/open-api/gan/zhi/get8ziByDate",
+            method: 'get',
+            params,
+            headers: {
+                'Content-Type': 'text/plain;charset=UTF-8'
+
+            },
+        })
+
     }
 }
 export default open

+ 19 - 0
src/api/modules/order.js

@@ -130,7 +130,26 @@ const order = {
 		res.data = jsonMap.get(res.data.goodsType)(res.data)
 
 		return res
+	},
+
+	//新增查询记录(天干地支)
+	studentBirthdayLog(data){
+		return request({
+			url:"/student/birthday/log",
+			method:'post',
+			data
+		})
+	},
+	//新增
+	//student/birthday/log/list
+	studentBirthdayLogList(params){
+		return request({
+			url:"/student/birthday/log/list",
+			method:'GET',
+			params
+		})
 	}
+
 }
 
 export default order

+ 160 - 0
src/otherPages/forecastHistory/index.vue

@@ -0,0 +1,160 @@
+<template>
+    <view>
+        <view class="bg">
+            <view class="list">
+                <view class="content">
+                    <view v-for="(item, index) in list" :key="index" class="item">
+                        <view>
+                            {{ item.name }} {{ item.sex == '1' ? '男' : '女' }} {{ item.birthday }}
+                            <image v-if="item.isPay == 2" class="item-vip" mode="widthFix" src="/static/icon/gold_vip@2x.png">
+                            </image>
+                            <image v-if="item.isPay == 1" 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 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>
+import api from '@/api'
+export default {
+    data() {
+        return {
+            list: []
+
+        }
+    },
+    onLoad() {
+        api.order.studentBirthdayLogList({
+            pageNum: 1,
+            pageSize: 1000
+        }).then(res => {
+            this.list = res.rows
+        })
+    }
+}
+</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>

+ 31 - 24
src/pages.json

@@ -13,12 +13,10 @@
         // #endif
       }
     },
-
     {
       "path": "pages/teacherVideo/index",
       "style": {}
     },
-   
     {
       "path": "pages/carVideo/videoList",
       "style": {
@@ -75,8 +73,14 @@
       }
     },
     {
-      "path":"pages/fortune/index",
-      "style":{
+      "path": "pages/fortune/index",
+      "style": {
+        "navigationBarTitleText": "运势测算"
+      }
+    },
+    {
+      "path": "pages/forecast/index",
+      "style": {
         "navigationBarTitleText": "运势测算"
       }
     },
@@ -190,7 +194,6 @@
         "navigationBarTitleText": "用户信息"
       }
     },
-    
     {
       "path": "pages/carVideo/shortVideoPaly",
       "style": {
@@ -224,7 +227,12 @@
           "path": "joinBusiness/index",
           "style": {}
         },
-      
+        {
+          "path": "forecastHistory/index",
+          "style": {
+            "navigationBarTitleText": "历史列表"
+          }
+        },
         {
           "path": "careEveryDay/index",
           "style": {}
@@ -261,18 +269,16 @@
             "navigationBarTitleText": "播放视频"
           }
         },
-
         {
           "path": "examRoadVideo/index",
           "style": {
-      
-            "navigationBarTitleText":"科目三真实考场"
+            "navigationBarTitleText": "科目三真实考场"
           }
         },
         {
           "path": "myExamRoadVideo/index",
           "style": {
-            "navigationBarTitleText":"我的考场",
+            "navigationBarTitleText": "我的考场",
             "navigationStyle": "custom"
           }
         },
@@ -290,16 +296,12 @@
           }
         },
         {
-          "path":"threeExamScore/index",
+          "path": "threeExamScore/index",
           "style": {
             "navigationBarTitleText": "三力测试结果",
             "navigationStyle": "default",
-            "usingComponents":{
-             
-            }
-            
+            "usingComponents": {}
           }
-
         },
         {
           "path": "courseCatalog/index",
@@ -464,8 +466,8 @@
           }
         },
         {
-          "path":"createReferCode/index",
-          "style":{
+          "path": "createReferCode/index",
+          "style": {
             "navigationBarTitleText": "生成推荐码",
             "enablePullDownRefresh": false
           }
@@ -556,8 +558,8 @@
       "van-grid": "wxcomponents/vant/grid/index",
       "van-grid-item": "wxcomponents/vant/grid-item/index",
       "van-nav-bar": "wxcomponents/vant/nav-bar/index",
-      "van-action-sheet":"wxcomponents/vant/action-sheet/index",
-      "van-uploader":"wxcomponents/vant/uploader/index"
+      "van-action-sheet": "wxcomponents/vant/action-sheet/index",
+      "van-uploader": "wxcomponents/vant/uploader/index"
     }
   },
   "condition": {
@@ -565,15 +567,15 @@
     "current": 0, //当前激活的模式(list 的索引项)
     "list": [
       {
-        "path":"otherPages/joinBusiness/index",
+        "path": "otherPages/joinBusiness/index",
         "name": "招商加盟"
       },
       {
-        "path":"otherPages/userAdvise/index",
+        "path": "otherPages/userAdvise/index",
         "name": "反馈建议"
       },
       {
-        "path":"otherPages/myExamRoadVideo/index",
+        "path": "otherPages/myExamRoadVideo/index",
         "name": "我的考场"
       },
       {
@@ -594,7 +596,7 @@
       {
         "path": "otherPages/threeExamScore/index",
         "name": "三力测试结果页",
-        "query":"score=90"
+        "query": "score=90"
       },
       {
         "path": "otherPages/beforeThreeExam/index",
@@ -703,6 +705,11 @@
         "name": "运势",
         "path": "pages/fortune/index",
         "query": ""
+      },
+      {
+        "name": "运势历史",
+        "path": "otherPages/forecastHistory/index",
+        "query": ""
       }
     ]
   }

File diff suppressed because it is too large
+ 719 - 96
src/pages/forecast/index.vue


+ 20 - 14
src/pages/fortune/index.vue

@@ -9,7 +9,7 @@
 					<view class="content-inputs-row">
 						<view class="content-inputs-row-label">命主姓名</view>
 						<view>
-							<input v-model="form.name" class="content-inputs-row-input" />
+							<input v-model="form.username" class="content-inputs-row-input" />
 						</view>
 					</view>
 					<view class="content-inputs-row">
@@ -112,8 +112,10 @@
 </template>
 
 <script>
+import Vue from 'vue';
+import calendar from 'js-calendar-converter'
 export default {
-    data() {
+	data() {
 		return {
 			title: '国学',
 			yearsRange: [2020, 2021, 2022],
@@ -139,7 +141,7 @@ export default {
 				birthChinaHour: '子时',
 				isSave: 0, //是否保存 0:不保存 1保存
 				sex: 1, //性别 1:男 2:女
-				name: "",
+				username: "",
 				type: '公历'
 			}
 		}
@@ -164,11 +166,15 @@ export default {
 	},
 	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
+			let that =this
+			// api.openApi.openApiBirthdayLog({
+			// 	name:this.form.name,
+			// 	sex:this.form.sex,
+			// 	birthday:this.form.birthday+' '+this.form.birthHour+':00',
+			// 	isPay:this.form.isPay
+			// })
+			uni.navigateTo({
+				url:`/pages/forecast/index?birthday=${that.form.birthday+' '+this.form.birthHour+':00'}&sex=${that.form.sex}&username=${that.form.username}`
 			})
 
 
@@ -193,19 +199,19 @@ export default {
 		},
 		changeFormBirthDay(e) {
 			console.log(e.detail)
-			this.form.birthday = e.detail.value
+			this.form.birthday = e.detail.value 
 			if (this.form.type == '农历') {
-				let birthDays = this.form.birthday.split('-')
-				let c = calendar.lunar2solar(birthDays[0], birthDays[1], birthDays[2])
+				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}`
 			}
 
 		}
 	}
-}
+};
 </script>
 
-<style lang="scss" scoped>
+<style lang="less">
 .content {
 	display: flex;
 	flex-direction: row;
@@ -401,4 +407,4 @@ export default {
 	font-size: 36rpx;
 	color: #8f8f94;
 }
-</style>
+</style>

二進制
src/static/icon/blue_xysz_rect@2x.png


二進制
src/static/icon/brown_xysz_rect@2x.png


二進制
src/static/icon/del@2x.png


二進制
src/static/icon/gold_vip@2x.png


二進制
src/static/icon/gray_vip@2x.png


二進制
src/static/icon/green_xysz_rect@2x.png


二進制
src/static/icon/red_xysz_rect@2x.png


二進制
src/static/icon/yellow_xysz_rect@2x.png


+ 31 - 4
src/utils/responseDecorator.js

@@ -1,12 +1,12 @@
 
+// import { openApiRes } from '@/api/openApi/type'
 
-// 
 // type openApiGanZhiGet8ziByDate = openApiRes.openApiGanZhiGet8ziByDate["data"]
 // interface ganZhiGet8ziByDate extends openApiGanZhiGet8ziByDate {
 //     ganZhiProRowVoList: openApiGanZhiGet8ziByDate["ganZhiRowVoList"][]
 // }
 
-const textSwitchColor = (text) => {
+const switchTextToHexColor = (text) => {
     let color = '#333'
     switch (text) {
         case '棕':
@@ -28,6 +28,29 @@ const textSwitchColor = (text) => {
             color = '#333'
     }
     return color
+}
+const switchTextToEnColor = (text) => {
+    let color = ''
+    switch (text) {
+        case '棕':
+            color = 'brown'
+            break;
+        case '红':
+            color = 'red'
+            break;
+        case '绿':
+            color = 'green'
+            break;
+        case '蓝':
+            color = 'blue'
+            break;
+        case '黄':
+            color = 'yellow'
+            break;
+        default:
+            color = ''
+    }
+    return color
 
 
 }
@@ -40,8 +63,12 @@ const get8ziByDateDecorator = function (responseData) {
     for (let index = 0; index < (respData.ganZhiRowVoList.length / 2); index++) {
         const element1 = respData.ganZhiRowVoList[index * 2];
         const element2 = respData.ganZhiRowVoList[index * 2 + 1];
-        element1.textColor = textSwitchColor(element1.color)
-        element2.textColor = textSwitchColor(element2.color)
+        element1.hexColor = switchTextToHexColor(element1.color)
+        element2.hexColor = switchTextToHexColor(element2.color)
+
+        element1.enColor = switchTextToEnColor(element1.color)
+        element2.enColor = switchTextToEnColor(element2.color)
+
         respData.ganZhiProRowVoList.push([element1, element2])
 
 

+ 5 - 0
tsconfig.json

@@ -1,4 +1,9 @@
 {
+  "paths": {
+    "@/*": [
+      "./src/*"
+    ]
+  },
   "compilerOptions": {
     "types": ["@dcloudio/types", "miniprogram-api-typings", "mini-types"]
   }

Some files were not shown because too many files changed in this diff