YGSNHS.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  1. <template>
  2. <view class="box">
  3. <view class="imgBox" v-if='user!=""'>
  4. <view class="img1Border">
  5. <!-- 外层红圈 -->
  6. </view>
  7. <!-- 底图 -->
  8. <image class="img1" src="@/static/jieqi/huaShenDi.png" mode=""></image>
  9. <!-- <image class="img1" :src="user.user_solar_term_img_url" mode=""></image> -->
  10. <!-- 缺失图 -->
  11. <image v-if="user!=''" class="img2"
  12. :style="{transform:`translate(-50%,-50%) rotate(${(jq(user.receive_solar_term_name)*15)+45}deg)`}"
  13. src="@/static/jieqi/huaShenTouMing.png" mode=""></image>
  14. <!-- 文本图 -->
  15. <image class="img3" src="@/static/jieqi/wenBen.png" mode=""></image>
  16. <!-- 中心花神图 -->
  17. <view class="texBox" style="font-size: 0;">
  18. <img style="width:176rpx ;height: 176rpx;" :src="jqImg()" mode=""></img>
  19. </view>
  20. <!-- 外圈太阳图列表 -->
  21. <view class="taiYang" v-for="(v,i) in list" :key="i"
  22. :style="{transform:`translate(-50%,-50%) rotate(${(jq(v.solar_term_name)*15)+30}deg)`}">
  23. <!-- 我祝福的部分 -->
  24. <view class="" v-if="v.user_id===v.noble_person_user_id&&v.is_send_convergence!==0">
  25. <image v-if="v.pay_num==1" class="img" src="@/static/jieqi/woZhuFu1.png" mode=""></image>
  26. <image v-else-if="v.pay_num==2" class="img" src="@/static/jieqi/woZhuFu2.png" mode=""></image>
  27. <image v-else-if="v.pay_num==3" class="img" src="@/static/jieqi/woZhuFu3.png" mode=""></image>
  28. <image v-else class="img" src="@/static/jieqi/wuZhuFu.png" mode=""></image>
  29. </view>
  30. <!-- 贵人祝福的部分 -->
  31. <view class="" v-if="v.user_id!==v.noble_person_user_id&&v.is_send_convergence!==0">
  32. <image v-if="v.pay_num==1" class="img" src="@/static/jieqi/guiRen1.png" mode=""></image>
  33. <image v-else-if="v.pay_num==2" class="img" src="@/static/jieqi/guiRen2.png" mode=""></image>
  34. <image v-else-if="v.pay_num==3" class="img" src="@/static/jieqi/guiRen3.png" mode=""></image>
  35. <image v-else class="img" src="@/static/jieqi/guiRen.png" mode=""></image>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="my">
  40. <view class="" style="display: flex;">
  41. 我的花神
  42. <view class="">
  43. <image class="img" src="@/static/jieqi/wuZhuFu.png" mode=""></image>
  44. </view>
  45. </view>
  46. <view class="" style="display: flex;" v-if="guiRen.length!=0">
  47. 贵人帮助的花神
  48. <view class="">
  49. <image class="img" src="@/static/jieqi/guiRen.png" mode=""></image>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. <!-- 我是贵人 -->
  55. <view class="guiRenBox" v-if="guiRen.length!=0">
  56. <view class="guiRnIC">
  57. 贵人
  58. </view>
  59. <view class="userBox">
  60. <view class="">
  61. <image class="img" :src="guiRen.avatar" mode=""></image>
  62. </view>
  63. <view class="name">
  64. {{HTTP.name(guiRen.user_name)}}
  65. <view style="display: flex;
  66. border-radius: 6rpx;
  67. padding: 0 8rpx;
  68. margin-top: 4rpx;
  69. margin-left: 16rpx;
  70. text-align: center;
  71. justify-content: center;
  72. height: 36rpx;
  73. color: #fff;font-size: 20rpx;line-height: 36rpx;" :style="jieqiFn(guiRen.solar_term_name,1)">
  74. <view class="">
  75. {{guiRen.eight_year}}
  76. </view>
  77. <span style="display: inline-block;width: 4rpx;margin: 0 8rpx;;margin-top: 14rpx;
  78. height: 4rpx;border-radius: 50%;background: #fff;"></span>
  79. <view class="">
  80. {{guiRen.solar_term_name}}({{guiRen.flower}})
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. <!-- 模拟分割线 -->
  86. <view class="fenGe">
  87. </view>
  88. <!-- 祝福信息 -->
  89. <view class="zhuFuTEX">
  90. 祝福了{{guiRen.bless_flower}}
  91. </view>
  92. </view>
  93. </template>
  94. <script setup>
  95. import {
  96. ref
  97. } from 'vue'
  98. import {
  99. jieqiFn,
  100. BASE_URL
  101. } from '@/config'
  102. import {
  103. HTTP
  104. } from "@/api/http.js"
  105. import {
  106. onShow,
  107. onLoad
  108. } from "@dcloudio/uni-app"
  109. const list = ref([])
  110. const data = ref('')
  111. const user = ref('')
  112. const guiRen=ref("")
  113. const dataFn = (e) => {
  114. console.log(e, '数据传来了吗')
  115. list.value=e.pool_list
  116. user.value = e.receiveUser
  117. guiRen.value=e.noble_person
  118. }
  119. defineExpose({
  120. dataFn
  121. })
  122. // 获取我的花神列表
  123. // const userFloraList = async () => {
  124. // let res = await HTTP.HZ.userFloraList({})
  125. // if (res.code == 200) {
  126. // list.value = res.data.list
  127. // data.value = res.data
  128. // } else {
  129. // uni.showToast({
  130. // duration: 2000,
  131. // icon: 'none',
  132. // title: res.msg
  133. // })
  134. // }
  135. // }
  136. // const userUserinfo = async () => { //获取个人信息
  137. // let res = await HTTP.MY.userUserinfo({})
  138. // if (res.code == 200) {
  139. // user.value = res.data
  140. // uni.setStorageSync("user", HTTP.jsonf(user.value))
  141. // }
  142. // console.log(res, '我是个人信息啊')
  143. // }
  144. // 节气花神
  145. const jqImg = (e) => {
  146. let a = `../../../static/jieqi/${jq(user.value.receive_solar_term_name)}.png`
  147. console.log(a, '////')
  148. return a
  149. }
  150. // 节气图
  151. const jq = (v) => {
  152. if (v == "立春") {
  153. return 1
  154. }
  155. if (v == "雨水") {
  156. return 2
  157. }
  158. if (v == "惊蛰") {
  159. return 3
  160. }
  161. if (v == "春分") {
  162. return 4
  163. }
  164. if (v == "清明") {
  165. return 5
  166. }
  167. if (v == "谷雨") {
  168. return 6
  169. }
  170. if (v == "立夏") {
  171. return 7
  172. }
  173. if (v == "小满") {
  174. return 8
  175. }
  176. if (v == "芒种") {
  177. return 9
  178. }
  179. if (v == "夏至") {
  180. return 10
  181. }
  182. if (v == "小暑") {
  183. return 11
  184. }
  185. if (v == "大暑") {
  186. return 12
  187. }
  188. if (v == "立秋") {
  189. return 13
  190. }
  191. if (v == "处暑") {
  192. return 14
  193. }
  194. if (v == "白露") {
  195. return 15
  196. }
  197. if (v == "秋分") {
  198. return 16
  199. }
  200. if (v == "寒露") {
  201. return 17
  202. }
  203. if (v == "霜降") {
  204. return 18
  205. }
  206. if (v == "立冬") {
  207. return 19
  208. }
  209. if (v == "小雪") {
  210. return 20
  211. }
  212. if (v == "大雪") {
  213. return 21
  214. }
  215. if (v == "冬至") {
  216. return 22
  217. }
  218. if (v == "小寒") {
  219. return 23
  220. }
  221. if (v == "大寒") {
  222. return 24
  223. }
  224. }
  225. // onShow(() => {
  226. // // userFloraList()
  227. // let a = uni.getStorageSync("user")
  228. // if (a) {
  229. // user.value = HTTP.jsonp(a)
  230. // } else {
  231. // userUserinfo()
  232. // }
  233. // })
  234. </script>
  235. <style lang="scss" scoped>
  236. view {
  237. box-sizing: border-box;
  238. }
  239. .box {
  240. width: 686rpx;
  241. background: #fff;
  242. border-radius: 16rpx;
  243. margin: 0 auto;
  244. .my {
  245. font-weight: 400;
  246. font-size: 28rpx;
  247. color: #353844;
  248. padding: 20rpx;
  249. display: flex;
  250. justify-content: space-between;
  251. .img {
  252. width: 36rpx;
  253. height: 36rpx;
  254. margin-left: 8rpx;
  255. }
  256. }
  257. }
  258. .imgBox {
  259. width: 686rpx;
  260. height: 640rpx;
  261. background: #fff;
  262. border-radius: 16rpx;
  263. text-align: center;
  264. position: relative;
  265. margin: 0 auto;
  266. }
  267. // 圆盘边框
  268. .img1Border {
  269. position: absolute;
  270. width: 530rpx;
  271. height: 528rpx;
  272. z-index: 1;
  273. top: 50%;
  274. left: 50%;
  275. transform: translate(-50%, -50%);
  276. border: 10rpx solid #CC1312;
  277. border-radius: 50%;
  278. }
  279. // 圆盘
  280. .img1 {
  281. position: absolute;
  282. width: 520rpx;
  283. height: 520rpx;
  284. z-index: 1;
  285. top: 50%;
  286. left: 50%;
  287. transform: translate(-50%, -50%);
  288. }
  289. .img2 {
  290. position: absolute;
  291. top: 50%;
  292. width: 520rpx;
  293. height: 520rpx;
  294. left: 50%;
  295. // opacity: 0.7;
  296. // transform: translateX(-50%) rotate(146deg);
  297. z-index: 2;
  298. }
  299. .img3 {
  300. position: absolute;
  301. top: 50%;
  302. width: 520rpx;
  303. height: 520rpx;
  304. left: 50%;
  305. // opacity: 0.7;
  306. transform: translate(-50%,-50%);
  307. z-index: 3;
  308. }
  309. // 圆盘内的文字
  310. .texBox {
  311. position: absolute;
  312. width: 180rpx;
  313. height: 180rpx;
  314. // background: #353844;
  315. z-index: 3;
  316. top: 50%;
  317. left: 50%;
  318. transform: translate(-50%,-50%);
  319. }
  320. //外圈太阳图
  321. .taiYang {
  322. position: absolute;
  323. top: 50%;
  324. left: 50%;
  325. // transform: translate(-50%,-50%) rotate(90deg);
  326. z-index: 10;
  327. width: 36rpx;
  328. height: 600rpx;
  329. font-size: 0;
  330. // background: #CC1312;
  331. // display: flex;
  332. // justify-content: flex-end;
  333. .img {
  334. width: 36rpx;
  335. height: 36rpx;
  336. }
  337. }
  338. // 贵人
  339. .guiRenBox{
  340. width: 686rpx;
  341. // height: 260rpx;
  342. background: #FFFFFF;
  343. border-radius: 16rpx;
  344. margin: 0 auto;
  345. margin-top: 20rpx ;
  346. padding: 32rpx;
  347. position: relative;
  348. .guiRnIC{
  349. position: absolute;
  350. top: 0;
  351. right: 0;
  352. width: 80rpx;
  353. height: 38rpx;
  354. background: #FF2424;
  355. border-radius: 0rpx 16rpx 0rpx 16rpx;
  356. font-weight: 600;
  357. font-size: 24rpx;
  358. color: #FFEA55;
  359. text-align: center;
  360. line-height: 38rpx;
  361. }
  362. .userBox{
  363. display: flex;
  364. .img{
  365. width: 80rpx;
  366. height: 80rpx;
  367. border-radius: 50%;
  368. }
  369. .name{
  370. display: flex;
  371. font-weight: 600;
  372. font-size: 28rpx;
  373. color: #353844;
  374. padding-top: 20rpx;
  375. margin-left: 16rpx;
  376. }
  377. }
  378. }
  379. // 模拟分割
  380. .fenGe{
  381. height: 4rpx;
  382. background: #f5f5f5;
  383. margin-top: 32rpx;
  384. margin-bottom: 32rpx;
  385. }
  386. .zhuFuTEX{
  387. font-weight: 400;
  388. font-size: 28rpx;
  389. color: #353844;
  390. }
  391. </style>