index.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. <template>
  2. <view class="content">
  3. <view class="notice_box">
  4. <u-notice-bar :text="text1" duration="7000" color="#000000" bgColor="#ffffff"></u-notice-bar>
  5. </view>
  6. <view class="box_platter">
  7. <input class="ter_input" :value="input" type="text" placeholder="请输入姓名" />
  8. <view class="tabs_card_ter">
  9. <x-tabs :current="current" :list="genderList" @change="change($event,1)"></x-tabs>
  10. <x-tabs :current="current1" :list="genderList1" @change="change($event,2)"></x-tabs>
  11. </view>
  12. <view class="box_date">{{solarTime}}</view>
  13. <view class="box_date">未知地区-即北京时间</view>
  14. <view class="space_between" style="margin-top: 20rpx;">
  15. <view class="same_row_in title_time">
  16. <span>真太阳时:</span>
  17. <span>{{solarTime}}</span>
  18. </view>
  19. <view class="same_row_in title_time">
  20. <span class="save_title">保存</span>
  21. <u-switch v-model="saveSummer" activeColor="#b2955d" inactiveColor="#e9e9eb" size="18"></u-switch>
  22. </view>
  23. </view>
  24. <view class="same_row_in title_time" style="margin-top: 10rpx;">
  25. <span>地址经纬:</span>
  26. <span>北纬39.93 东经116.42</span>
  27. </view>
  28. <view style="margin-top: 10rpx;">
  29. <span class="name_title">分类:</span>
  30. </view>
  31. <view class="same_row_in box_clock">
  32. <x-clock :size="160" :showSecond="true"></x-clock>
  33. <view class="card_clock_box">
  34. <view class="card_prin">
  35. <view class="cipal_box_flexil" v-for="(item,index) in principal" :key="index">
  36. {{item}}
  37. </view>
  38. </view>
  39. <view class="title_time marginTop_10">农历:2025年二月初一 巳时</view>
  40. <view class="title_time marginTop_10">公历:2025-02-28 09:55:34</view>
  41. </view>
  42. </view>
  43. <view class="btn_ter center_in" @click="getStartPlatting">开始排盘</view>
  44. <!-- <calendar :current="current1" @change="change($event,2)"></calendar> -->
  45. </view>
  46. <u-popup :show="timeShow" :round="10" closeOnClickOverlay @close="close">
  47. <view class="card_calendar">
  48. <calendar :current="current1" :principal="principal" :subpost="subpost" @cloudy="cloudy"
  49. @change="change($event,2)">
  50. </calendar>
  51. </view>
  52. <view class="card_four" v-if="eraData.length > 0 && eraFlag">
  53. <view class="card_column">
  54. <view class="card_era_ial">
  55. <view class="era_item center_in" :class="item == currentEra?'activate_title':''"
  56. v-for="(item,index) in eraData" :key="index" @click="selectEra(item,index)">
  57. {{item}}
  58. </view>
  59. </view>
  60. <!-- 90rpx 260rpx 440rpx 620rpx-->
  61. <view class="arrows_box" :style="{left: arrowLeft}"></view>
  62. </view>
  63. </view>
  64. </u-popup>
  65. </view>
  66. </template>
  67. <script>
  68. import calendar from './components/calendar.vue';
  69. export default {
  70. components: {
  71. calendar
  72. },
  73. data() {
  74. return {
  75. timeShow: false,
  76. input: '',
  77. current: '男',
  78. genderList: [{
  79. type: '男',
  80. title: '男',
  81. }, {
  82. type: '女',
  83. title: '女',
  84. }],
  85. current1: 'solar',
  86. genderList1: [{
  87. type: 'solar',
  88. title: '公历',
  89. }, {
  90. type: 'lunar',
  91. title: '农历',
  92. }, {
  93. type: 'four',
  94. title: '四柱',
  95. }],
  96. currentEra: '',
  97. eraFlag: false,
  98. eraData: [],
  99. eraData1: ['甲', '乙', '丙', '丁', '戊', '己', '庚', '辛', '壬', '癸'],
  100. eraData2: ['子', '寅', '辰', '午', '申', '戌'],
  101. eraData3: ['丑', '卯', '巳', '未', '酉', '亥'],
  102. principal: ['甲', '乙', '丙', '丁', '子', '丑', '寅', '卯'],
  103. currentland: 0,
  104. subpost: [],
  105. arrowLeft: '90rpx',
  106. text1: 'uView UI众多组件覆盖开发过程的各个需求,组件功能丰富,多端兼容。让您快速集成,开箱即用',
  107. solarTime: '1990年10月10日 10:30',
  108. saveSummer: true,
  109. }
  110. },
  111. onLoad() {
  112. },
  113. methods: {
  114. change(event, type) {
  115. if (type == 1) {
  116. this.current = event.type
  117. }
  118. if (type == 2) {
  119. uni.hideTabBar()
  120. this.timeShow = true
  121. this.current1 = event.type
  122. if(event.type != 'four'){
  123. this.eraFlag = false
  124. }
  125. }
  126. },
  127. // 选择
  128. cloudy(event, index) {
  129. this.currentland = index
  130. if (index == 0 || index == 4) {
  131. this.arrowLeft = '90rpx'
  132. } else if (index == 1 || index == 5) {
  133. this.arrowLeft = '260rpx'
  134. } else if (index == 2 || index == 6) {
  135. this.arrowLeft = '440rpx'
  136. } else if (index == 3 || index == 7) {
  137. this.arrowLeft = '620rpx'
  138. }
  139. if (index < 4) {
  140. this.eraFlag = true
  141. this.eraData = this.eraData1
  142. } else {
  143. var num = index - 4
  144. var title = this.principal[num]
  145. var array1 = ['甲', '丙', '戊', '庚', '壬']
  146. var array2 = ['乙', '丁', '己', '辛', '癸']
  147. var flag = array1.includes(title)
  148. var flag1 = array2.includes(title)
  149. if (flag) {
  150. this.eraData = this.eraData2
  151. }
  152. if (flag1) {
  153. this.eraData = this.eraData3
  154. }
  155. this.eraFlag = true
  156. }
  157. this.currentEra = event
  158. },
  159. // 选择天干地支
  160. selectEra(event, index) {
  161. this.$set(this.principal, this.currentland, event);
  162. this.$set(this.subpost, this.currentland, event);
  163. let num = 0
  164. if (this.currentland < 4) {
  165. num = this.currentland + 4
  166. } else {
  167. num = this.currentland - 3
  168. }
  169. if (this.currentland == 7) {
  170. this.eraFlag = false
  171. } else {
  172. this.cloudy(event, num)
  173. }
  174. },
  175. getStartPlatting(){
  176. uni.navigateTo({
  177. url: '/pages/index/horoscope'
  178. })
  179. },
  180. close() {
  181. setTimeout(() => {
  182. uni.showTabBar()
  183. }, 100)
  184. this.timeShow = false
  185. }
  186. }
  187. }
  188. </script>
  189. <style>
  190. .notice_box {
  191. width: calc(100% - 40rpx);
  192. padding: 20rpx;
  193. }
  194. .box_platter {
  195. margin: 0rpx 20rpx 20rpx 20rpx;
  196. padding: 50rpx;
  197. background-color: #fff;
  198. border-radius: 20rpx;
  199. }
  200. .ter_input {
  201. padding-bottom: 10rpx;
  202. border-bottom: 1rpx solid #f5f5f5;
  203. }
  204. .tabs_card_ter {
  205. display: flex;
  206. justify-content: space-between;
  207. align-items: center;
  208. margin-top: 20rpx;
  209. }
  210. .btn_ter {
  211. margin-top: 30rpx;
  212. width: 100%;
  213. padding: 26rpx 0rpx;
  214. border-radius: 50rpx;
  215. background-color: rgba(1, 1, 1, 1);
  216. color: rgba(213, 189, 157, 1);
  217. }
  218. .card_calendar {
  219. padding: 30rpx;
  220. // #ifdef APP-PLUS || MP-WEIXIN
  221. padding-bottom: 0 !important;
  222. padding-bottom: constant(safe-area-inset-bottom) !important;
  223. padding-bottom: env(safe-area-inset-bottom) !important;
  224. // #endif
  225. }
  226. .card_four {
  227. position: absolute;
  228. top: -60rpx;
  229. width: 100%;
  230. height: auto;
  231. }
  232. .card_column {
  233. position: absolute;
  234. bottom: 0;
  235. width: calc(100% - 40rpx);
  236. height: auto;
  237. border-radius: 20rpx;
  238. background-color: #fff;
  239. padding: 20rpx;
  240. }
  241. .card_era_ial {
  242. display: flex;
  243. flex-direction: row;
  244. flex-wrap: wrap;
  245. justify-content: space-between;
  246. }
  247. .era_item {
  248. color: #a3a3a3;
  249. font-size: 46rpx;
  250. width: 140rpx;
  251. padding: 10rpx 0rpx;
  252. border-radius: 40rpx;
  253. }
  254. .activate_title {
  255. color: #fff;
  256. background-color: #b2955d;
  257. }
  258. .arrows_box {
  259. position: absolute;
  260. bottom: -54rpx;
  261. border: 24rpx solid transparent;
  262. border-top: 36rpx solid #ffffff;
  263. }
  264. .box_date {
  265. font-size: 30rpx;
  266. padding: 20rpx 10rpx;
  267. border-bottom: 1rpx solid #f5f5f5;
  268. }
  269. .title_time {
  270. font-size: 22rpx;
  271. color: #9e9e9e;
  272. }
  273. .save_title {
  274. color: #333333;
  275. font-size: 28rpx;
  276. margin-right: 10rpx;
  277. }
  278. .marginTop_10 {
  279. margin-top: 10rpx;
  280. }
  281. .name_title {
  282. color: #333;
  283. margin-right: 10rpx;
  284. font-size: 30rpx;
  285. }
  286. .box_clock {
  287. padding: 20rpx 0rpx;
  288. }
  289. .card_clock_box {
  290. margin-left: 40rpx;
  291. }
  292. .card_prin {
  293. display: flex;
  294. align-items: center;
  295. justify-content: space-around;
  296. flex-wrap: wrap;
  297. }
  298. .cipal_box_flexil {
  299. flex: 0 0 25%;
  300. font-size: 32rpx;
  301. display: flex;
  302. justify-content: flex-start;
  303. align-items: center;
  304. }
  305. </style>