create.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  1. <template>
  2. <view class="container">
  3. <view class="form-card">
  4. <view class="form-title">{{ isNew ? '创建活动' : '编辑活动' }}</view>
  5. <!-- 活动标题 -->
  6. <view class="form-item">
  7. <text class="form-label">活动标题 *</text>
  8. <input class="form-input" v-model="form.title" placeholder="请输入活动标题" maxlength="50" />
  9. </view>
  10. <!-- 活动维度 -->
  11. <view class="form-item">
  12. <text class="form-label">所属维度 *</text>
  13. <picker class="form-picker" :value="dimIdx" :range="dimensionOptions" range-key="label" @change="onDimChange">
  14. <text class="picker-text">{{ form.dimensionCode ? dimLabel(form.dimensionCode) : '请选择维度' }}</text>
  15. </picker>
  16. </view>
  17. <!-- 活动类型 -->
  18. <view class="form-item">
  19. <text class="form-label">活动类型 *</text>
  20. <picker class="form-picker" :value="typeIdx" :range="typeOptions" range-key="label" @change="onTypeChange">
  21. <text class="picker-text">{{ form.activityType ? typeLabel(form.activityType) : '请选择类型' }}</text>
  22. </picker>
  23. </view>
  24. <!-- 开始时间 -->
  25. <view class="form-item">
  26. <text class="form-label">开始时间 *</text>
  27. <picker class="form-picker" mode="date" :value="datePart" @change="onStartDateChange">
  28. <text class="picker-text">{{ datePart || '选择日期' }}</text>
  29. </picker>
  30. <picker class="form-picker" mode="time" :value="timePart" @change="onStartTimeChange" style="margin-top: 16rpx;">
  31. <text class="picker-text">{{ timePart || '选择时间' }}</text>
  32. </picker>
  33. </view>
  34. <!-- 结束时间 -->
  35. <view class="form-item">
  36. <text class="form-label">结束时间</text>
  37. <picker class="form-picker" mode="date" :value="endDatePart" @change="onEndDateChange">
  38. <text class="picker-text">{{ endDatePart || '选择日期(可选)' }}</text>
  39. </picker>
  40. <picker class="form-picker" mode="time" :value="endTimePart" @change="onEndTimeChange" style="margin-top: 16rpx;">
  41. <text class="picker-text">{{ endTimePart || '选择时间(可选)' }}</text>
  42. </picker>
  43. </view>
  44. <!-- 报名截止时间 -->
  45. <view class="form-item">
  46. <text class="form-label">报名截止时间</text>
  47. <picker class="form-picker" mode="date" :value="regDatePart" @change="onRegDateChange">
  48. <text class="picker-text">{{ regDatePart || '选择日期(不填=活动开始前)' }}</text>
  49. </picker>
  50. <picker class="form-picker" mode="time" :value="regTimePart" @change="onRegTimeChange" style="margin-top: 16rpx;">
  51. <text class="picker-text">{{ regTimePart || '选择时间' }}</text>
  52. </picker>
  53. </view>
  54. <!-- 活动地点 -->
  55. <view class="form-item">
  56. <text class="form-label">活动地点</text>
  57. <input class="form-input" v-model="form.location" placeholder="请输入活动地点" maxlength="100" />
  58. </view>
  59. <!-- 人数 + 价格 -->
  60. <view class="form-item-row">
  61. <view class="form-item half">
  62. <text class="form-label">最大人数</text>
  63. <input class="form-input" type="number" v-model="maxParticipantsStr" placeholder="0=不限" />
  64. </view>
  65. <view class="form-item half">
  66. <text class="form-label">孩子费用(元)</text>
  67. <input class="form-input" type="digit" v-model="childFeeYuan" placeholder="0=免费" />
  68. </view>
  69. </view>
  70. <view class="form-item-row">
  71. <view class="form-item half">
  72. <text class="form-label">孩子会员费(元)</text>
  73. <input class="form-input" type="digit" v-model="childMemberFeeYuan" placeholder="0=免费" />
  74. </view>
  75. <view class="form-item half">
  76. <text class="form-label">家长费用(元)</text>
  77. <input class="form-input" type="digit" v-model="parentFeeYuan" placeholder="0=免费" />
  78. </view>
  79. </view>
  80. <view class="form-item">
  81. <text class="form-label">家长会员费(元)</text>
  82. <input class="form-input" type="digit" v-model="parentMemberFeeYuan" placeholder="0=免费" />
  83. </view>
  84. <!-- 封面图片 -->
  85. <view class="form-item">
  86. <text class="form-label">封面图片</text>
  87. <input class="form-input" v-model="form.coverImage" placeholder="输入图片URL(可选)" />
  88. <view class="cover-preview" v-if="form.coverImage">
  89. <image class="preview-img" :src="form.coverImage" mode="aspectFill" @error="onImgError" />
  90. </view>
  91. </view>
  92. <!-- 活动描述 -->
  93. <view class="form-item">
  94. <text class="form-label">活动描述</text>
  95. <textarea class="form-textarea" v-model="form.description" placeholder="请输入活动详细介绍" maxlength="500"
  96. auto-height />
  97. </view>
  98. <!-- 操作按钮 -->
  99. <view class="form-actions">
  100. <view class="btn-save" @click="handleSave">
  101. <text>保存为草稿</text>
  102. </view>
  103. <view class="btn-publish" @click="handlePublish">
  104. <text>{{ isAdmin ? '保存并发布' : '保存并提交审核' }}</text>
  105. </view>
  106. </view>
  107. </view>
  108. <view class="loading" v-if="loading">
  109. <view class="loading-spinner"></view>
  110. <text>加载中...</text>
  111. </view>
  112. </view>
  113. </template>
  114. <script>
  115. import { adminCreateActivity, adminUpdateActivity, adminPublishActivity, submitActivityForReview, getActivityDetail } from '../../utils/api.js'
  116. import config from '../../config.js'
  117. import { parseDate } from '../../utils/format.js'
  118. var BASE_URL = config.api('')
  119. export default {
  120. computed: {
  121. isAdmin: function() {
  122. var userInfo = uni.getStorageSync('userInfo')
  123. return userInfo && (userInfo.role === 'admin' || userInfo.role === 'activity_admin' || (userInfo.roles && userInfo.roles.indexOf('activity_admin') >= 0))
  124. }
  125. },
  126. data() {
  127. return {
  128. isNew: true,
  129. activityId: null,
  130. loading: false,
  131. memberId: '',
  132. form: {
  133. title: '',
  134. description: '',
  135. coverImage: '',
  136. dimensionCode: '',
  137. activityType: '',
  138. status: 'draft',
  139. startTime: null,
  140. endTime: null,
  141. registrationDeadline: null,
  142. location: '',
  143. maxParticipants: 0,
  144. childFee: 0,
  145. childMemberFee: 0,
  146. parentFee: 0,
  147. parentMemberFee: 0,
  148. visibility: 'public',
  149. requireRegistration: 1,
  150. requireCheckinReview: 0,
  151. checkinPoints: 0
  152. },
  153. childFeeYuan: '0',
  154. childMemberFeeYuan: '0',
  155. parentFeeYuan: '0',
  156. parentMemberFeeYuan: '0',
  157. maxParticipantsStr: '0',
  158. datePart: '',
  159. timePart: '',
  160. endDatePart: '',
  161. endTimePart: '',
  162. regDatePart: '',
  163. regTimePart: '',
  164. dimIdx: 0,
  165. typeIdx: 0,
  166. dimensionOptions: [
  167. { key: 'body', label: '身 · 主动健康' },
  168. { key: 'mind', label: '心 · 情感丰盈' },
  169. { key: 'wisdom', label: '智 · 赋能未来' },
  170. { key: 'action', label: '行 · 知行合一' },
  171. { key: 'wealth', label: '富 · 物质精神' }
  172. ],
  173. typeOptions: [
  174. { key: 'offline', label: '线下活动' },
  175. { key: 'online', label: '线上活动' },
  176. { key: 'campaign', label: '营销活动' }
  177. ]
  178. }
  179. },
  180. onLoad(options) {
  181. if (options.id) {
  182. this.activityId = parseInt(options.id)
  183. this.isNew = false
  184. uni.setNavigationBarTitle({ title: '编辑活动' })
  185. this.loadDetail()
  186. } else {
  187. uni.setNavigationBarTitle({ title: '创建活动' })
  188. }
  189. },
  190. methods: {
  191. loadDetail() {
  192. var self = this
  193. self.loading = true
  194. getActivityDetail(self.activityId).then(function(res) {
  195. self.loading = false
  196. if (res && res.code === 200 && res.data) {
  197. var d = res.data
  198. self.form.title = d.title || ''
  199. self.form.description = d.description || ''
  200. self.form.coverImage = d.coverImage || ''
  201. self.form.dimensionCode = d.dimensionCode || ''
  202. self.form.activityType = d.activityType || ''
  203. self.form.location = d.location || ''
  204. self.form.maxParticipants = d.maxParticipants || 0
  205. self.form.childFee = d.childFee || 0
  206. self.form.childMemberFee = d.childMemberFee || 0
  207. self.form.parentFee = d.parentFee || 0
  208. self.form.parentMemberFee = d.parentMemberFee || 0
  209. self.form.status = d.status || 'draft'
  210. self.form.visibility = d.visibility || 'public'
  211. self.maxParticipantsStr = String(self.form.maxParticipants)
  212. self.childFeeYuan = self.form.childFee ? (self.form.childFee / 100).toString() : '0'
  213. self.childMemberFeeYuan = self.form.childMemberFee ? (self.form.childMemberFee / 100).toString() : '0'
  214. self.parentFeeYuan = self.form.parentFee ? (self.form.parentFee / 100).toString() : '0'
  215. self.parentMemberFeeYuan = self.form.parentMemberFee ? (self.form.parentMemberFee / 100).toString() : '0'
  216. if (d.startTime) {
  217. var sd = parseDate(d.startTime)
  218. if (sd) {
  219. self.datePart = self.fmtDate(sd)
  220. self.timePart = self.fmtTime(sd)
  221. self.form.startTime = sd.toISOString()
  222. }
  223. }
  224. if (d.endTime) {
  225. var ed = parseDate(d.endTime)
  226. if (ed) {
  227. self.endDatePart = self.fmtDate(ed)
  228. self.endTimePart = self.fmtTime(ed)
  229. self.form.endTime = ed.toISOString()
  230. }
  231. }
  232. if (d.registrationDeadline) {
  233. var rd = parseDate(d.registrationDeadline)
  234. if (rd) {
  235. self.regDatePart = self.fmtDate(rd)
  236. self.regTimePart = self.fmtTime(rd)
  237. self.form.registrationDeadline = rd.toISOString()
  238. }
  239. }
  240. // sync pickers
  241. for (var i = 0; i < self.dimensionOptions.length; i++) {
  242. if (self.dimensionOptions[i].key === self.form.dimensionCode) self.dimIdx = i
  243. }
  244. for (var j = 0; j < self.typeOptions.length; j++) {
  245. if (self.typeOptions[j].key === self.form.activityType) self.typeIdx = j
  246. }
  247. }
  248. }).catch(function() { self.loading = false })
  249. },
  250. onDimChange(e) {
  251. this.dimIdx = e.detail.value
  252. this.form.dimensionCode = this.dimensionOptions[this.dimIdx].key
  253. },
  254. onTypeChange(e) {
  255. this.typeIdx = e.detail.value
  256. this.form.activityType = this.typeOptions[this.typeIdx].key
  257. },
  258. onStartDateChange(e) {
  259. this.datePart = e.detail.value
  260. this.syncStartTime()
  261. },
  262. onStartTimeChange(e) {
  263. this.timePart = e.detail.value
  264. this.syncStartTime()
  265. },
  266. onEndDateChange(e) {
  267. this.endDatePart = e.detail.value
  268. this.syncEndTime()
  269. },
  270. onEndTimeChange(e) {
  271. this.endTimePart = e.detail.value
  272. this.syncEndTime()
  273. },
  274. onRegDateChange(e) {
  275. this.regDatePart = e.detail.value
  276. this.syncRegDeadline()
  277. },
  278. onRegTimeChange(e) {
  279. this.regTimePart = e.detail.value
  280. this.syncRegDeadline()
  281. },
  282. syncStartTime() {
  283. if (this.datePart && this.timePart) {
  284. this.form.startTime = this.datePart + 'T' + this.timePart + ':00'
  285. }
  286. },
  287. syncEndTime() {
  288. if (this.endDatePart && this.endTimePart) {
  289. this.form.endTime = this.endDatePart + 'T' + this.endTimePart + ':00'
  290. } else {
  291. this.form.endTime = null
  292. }
  293. },
  294. syncRegDeadline() {
  295. if (this.regDatePart && this.regTimePart) {
  296. this.form.registrationDeadline = this.regDatePart + 'T' + this.regTimePart + ':00'
  297. } else {
  298. this.form.registrationDeadline = null
  299. }
  300. },
  301. chooseImage() {
  302. var self = this
  303. uni.chooseImage({
  304. count: 1,
  305. sizeType: ['compressed'],
  306. success: function(res) {
  307. self.uploadCover(res.tempFilePaths[0])
  308. }
  309. })
  310. },
  311. uploadCover(filePath) {
  312. var self = this
  313. uni.uploadFile({
  314. url: BASE_URL + '/api/admin/articles/upload/image',
  315. filePath: filePath,
  316. name: 'file',
  317. header: { 'Authorization': 'Bearer ' + (uni.getStorageSync('token') || '') },
  318. success: function(res) {
  319. try {
  320. var data = JSON.parse(res.data)
  321. if (data.code === 200 && data.data) {
  322. self.form.coverImage = data.data
  323. } else {
  324. uni.showToast({ title: '上传失败', icon: 'none' })
  325. }
  326. } catch (e) {
  327. uni.showToast({ title: '上传失败', icon: 'none' })
  328. }
  329. },
  330. fail: function() {
  331. uni.showToast({ title: '上传失败', icon: 'none' })
  332. }
  333. })
  334. },
  335. onImgError() {
  336. this.form.coverImage = ''
  337. },
  338. validate() {
  339. if (!this.form.title) {
  340. uni.showToast({ title: '请输入活动标题', icon: 'none' })
  341. return false
  342. }
  343. if (!this.form.dimensionCode) {
  344. uni.showToast({ title: '请选择所属维度', icon: 'none' })
  345. return false
  346. }
  347. if (!this.form.activityType) {
  348. uni.showToast({ title: '请选择活动类型', icon: 'none' })
  349. return false
  350. }
  351. if (!this.datePart || !this.timePart) {
  352. uni.showToast({ title: '请选择开始时间', icon: 'none' })
  353. return false
  354. }
  355. return true
  356. },
  357. buildPayload() {
  358. var payload = Object.assign({}, this.form)
  359. payload.maxParticipants = parseInt(this.maxParticipantsStr) || 0
  360. payload.childFee = Math.round((parseFloat(this.childFeeYuan) || 0) * 100)
  361. payload.childMemberFee = Math.round((parseFloat(this.childMemberFeeYuan) || 0) * 100)
  362. payload.parentFee = Math.round((parseFloat(this.parentFeeYuan) || 0) * 100)
  363. payload.parentMemberFee = Math.round((parseFloat(this.parentMemberFeeYuan) || 0) * 100)
  364. if (this.activityId) payload.id = this.activityId
  365. return payload
  366. },
  367. handleSave() {
  368. if (!this.validate()) return
  369. this.submit(false)
  370. },
  371. handlePublish() {
  372. if (!this.validate()) return
  373. this.submit(true)
  374. },
  375. submit(publishAfter) {
  376. var self = this
  377. self.loading = true
  378. var payload = self.buildPayload()
  379. var userInfo = uni.getStorageSync('userInfo')
  380. var isAdmin = userInfo && (userInfo.role === 'admin' || userInfo.role === 'activity_admin' || (userInfo.roles && userInfo.roles.indexOf('activity_admin') >= 0))
  381. var doPublish = function(id) {
  382. if (isAdmin) {
  383. adminPublishActivity(id).then(function(r) {
  384. self.loading = false
  385. if (r && r.code === 200) {
  386. uni.showToast({ title: '已发布', icon: 'success' })
  387. setTimeout(function() {
  388. uni.navigateBack()
  389. }, 1200)
  390. } else {
  391. uni.showToast({ title: (r && r.message) || '发布失败', icon: 'none' })
  392. }
  393. }).catch(function() {
  394. self.loading = false
  395. uni.showToast({ title: '发布失败', icon: 'none' })
  396. })
  397. } else {
  398. submitActivityForReview(id).then(function(r) {
  399. self.loading = false
  400. if (r && r.code === 200) {
  401. uni.showToast({ title: '已提交审核', icon: 'success' })
  402. setTimeout(function() {
  403. uni.navigateBack()
  404. }, 1200)
  405. } else {
  406. uni.showToast({ title: (r && r.message) || '提交审核失败', icon: 'none' })
  407. }
  408. }).catch(function() {
  409. self.loading = false
  410. uni.showToast({ title: '提交审核失败', icon: 'none' })
  411. })
  412. }
  413. }
  414. if (self.isNew) {
  415. adminCreateActivity(payload).then(function(res) {
  416. if (res && res.code === 200) {
  417. var newId = res.data.id || res.data
  418. if (publishAfter) {
  419. doPublish(newId)
  420. } else {
  421. self.loading = false
  422. uni.showToast({ title: '已保存草稿', icon: 'success' })
  423. setTimeout(function() { uni.navigateBack() }, 1200)
  424. }
  425. } else {
  426. self.loading = false
  427. uni.showToast({ title: (res && res.message) || '保存失败', icon: 'none' })
  428. }
  429. }).catch(function() {
  430. self.loading = false
  431. uni.showToast({ title: '网络异常', icon: 'none' })
  432. })
  433. } else {
  434. adminUpdateActivity(payload).then(function(res) {
  435. if (res && res.code === 200) {
  436. if (publishAfter && (self.form.status === 'draft' || self.form.status === 'rejected')) {
  437. doPublish(self.activityId)
  438. } else {
  439. self.loading = false
  440. uni.showToast({ title: '已保存', icon: 'success' })
  441. setTimeout(function() { uni.navigateBack() }, 1200)
  442. }
  443. } else {
  444. self.loading = false
  445. uni.showToast({ title: (res && res.message) || '保存失败', icon: 'none' })
  446. }
  447. }).catch(function() {
  448. self.loading = false
  449. uni.showToast({ title: '网络异常', icon: 'none' })
  450. })
  451. }
  452. },
  453. dimLabel(key) {
  454. for (var i = 0; i < this.dimensionOptions.length; i++) {
  455. if (this.dimensionOptions[i].key === key) return this.dimensionOptions[i].label
  456. }
  457. return '请选择维度'
  458. },
  459. typeLabel(key) {
  460. for (var i = 0; i < this.typeOptions.length; i++) {
  461. if (this.typeOptions[i].key === key) return this.typeOptions[i].label
  462. }
  463. return '请选择类型'
  464. },
  465. fmtDate(d) {
  466. var y = d.getFullYear()
  467. var m = ('0' + (d.getMonth() + 1)).slice(-2)
  468. var day = ('0' + d.getDate()).slice(-2)
  469. return y + '-' + m + '-' + day
  470. },
  471. fmtTime(d) {
  472. var h = ('0' + d.getHours()).slice(-2)
  473. var mi = ('0' + d.getMinutes()).slice(-2)
  474. return h + ':' + mi
  475. }
  476. }
  477. }
  478. </script>
  479. <style scoped>
  480. .container {
  481. min-height: 100vh;
  482. background: #F5F7FA;
  483. padding: 24rpx;
  484. }
  485. .form-card {
  486. background: #fff;
  487. border-radius: 20rpx;
  488. padding: 32rpx 28rpx;
  489. box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04);
  490. }
  491. .form-title {
  492. font-size: 36rpx;
  493. font-weight: bold;
  494. color: #1E293B;
  495. margin-bottom: 24rpx;
  496. }
  497. .form-item {
  498. margin-bottom: 28rpx;
  499. }
  500. .form-item-row {
  501. display: flex;
  502. flex-direction: row;
  503. gap: 20rpx;
  504. margin-bottom: 28rpx;
  505. }
  506. .form-item.half {
  507. flex: 1;
  508. }
  509. .form-label {
  510. font-size: 26rpx;
  511. color: #475569;
  512. font-weight: 600;
  513. margin-bottom: 12rpx;
  514. display: block;
  515. }
  516. .form-input {
  517. width: 100%;
  518. height: 80rpx;
  519. border: 1rpx solid #E2E8F0;
  520. border-radius: 12rpx;
  521. padding: 0 20rpx;
  522. font-size: 28rpx;
  523. color: #1E293B;
  524. box-sizing: border-box;
  525. }
  526. .form-picker {
  527. width: 100%;
  528. height: 80rpx;
  529. border: 1rpx solid #E2E8F0;
  530. border-radius: 12rpx;
  531. padding: 0 20rpx;
  532. font-size: 28rpx;
  533. color: #1E293B;
  534. box-sizing: border-box;
  535. display: flex;
  536. align-items: center;
  537. }
  538. .picker-text {
  539. font-size: 28rpx;
  540. color: #1E293B;
  541. }
  542. .form-textarea {
  543. width: 100%;
  544. min-height: 160rpx;
  545. border: 1rpx solid #E2E8F0;
  546. border-radius: 12rpx;
  547. padding: 16rpx 20rpx;
  548. font-size: 28rpx;
  549. color: #1E293B;
  550. box-sizing: border-box;
  551. }
  552. .cover-upload {
  553. width: 100%;
  554. height: 320rpx;
  555. border: 2rpx dashed #CBD5E1;
  556. border-radius: 12rpx;
  557. display: flex;
  558. align-items: center;
  559. justify-content: center;
  560. overflow: hidden;
  561. }
  562. .preview-img {
  563. width: 100%;
  564. height: 100%;
  565. }
  566. .upload-placeholder {
  567. display: flex;
  568. flex-direction: column;
  569. align-items: center;
  570. }
  571. .upload-icon {
  572. font-size: 64rpx;
  573. color: #94A3B8;
  574. }
  575. .upload-text {
  576. font-size: 24rpx;
  577. color: #94A3B8;
  578. margin-top: 8rpx;
  579. }
  580. .form-actions {
  581. display: flex;
  582. flex-direction: row;
  583. gap: 20rpx;
  584. margin-top: 40rpx;
  585. }
  586. .btn-save,
  587. .btn-publish {
  588. flex: 1;
  589. height: 88rpx;
  590. border-radius: 44rpx;
  591. display: flex;
  592. align-items: center;
  593. justify-content: center;
  594. font-size: 30rpx;
  595. font-weight: 600;
  596. }
  597. .btn-save {
  598. background: #fff;
  599. color: #F97316;
  600. border: 2rpx solid #F97316;
  601. }
  602. .btn-publish {
  603. background: linear-gradient(135deg, #F97316, #FB923C);
  604. color: #fff;
  605. }
  606. .loading {
  607. position: fixed;
  608. top: 0;
  609. left: 0;
  610. right: 0;
  611. bottom: 0;
  612. background: rgba(255, 255, 255, 0.6);
  613. display: flex;
  614. flex-direction: column;
  615. align-items: center;
  616. justify-content: center;
  617. z-index: 999;
  618. }
  619. .loading-spinner {
  620. width: 60rpx;
  621. height: 60rpx;
  622. border: 4rpx solid #FED7AA;
  623. border-top: 4rpx solid #F97316;
  624. border-radius: 50%;
  625. animation: spin 0.8s linear infinite;
  626. margin-bottom: 16rpx;
  627. }
  628. @keyframes spin {
  629. to { transform: rotate(360deg); }
  630. }
  631. </style>