xq_page.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. <template>
  2. <view class="box">
  3. <u-navbar title="厦门文物跑活动报名" autoBack :placeholder="true" bgColor="#fee1b9"></u-navbar>
  4. <view class="ban">
  5. <view class="hdjs_box">
  6. <view class="hdjs_tit">活动介绍</view>
  7. <view class="hdjs_xq" style="overflow: scroll">厦门文物跑活动旨在打造一场具有文化认同感的跑步之旅,号召公众关注及保护珍贵文物古迹,用脚步.</view>
  8. </view>
  9. <!-- -->
  10. <view class="ld">报名资料填写</view>
  11. <!-- 动态表单 -->
  12. <block v-for="(item,index) in configItems" :key="item.id">
  13. <view class="" style="margin-top: 30rpx;">
  14. <text >{{ item.title }}</text>
  15. <!-- <text v-if="item.tip" class="tip">{{ item.tip }}</text> -->
  16. <!-- 根据 type 属性决定渲染哪种类型的输入 -->
  17. <u--input v-if="item.type === 'string'"
  18. v-model="item.value"
  19. border="surround"
  20. @change="onInput"
  21. :placeholder="item.tip" />
  22. <u-radio-group v-if="item.type === 'radio'" placement>
  23. <u-radio v-for="(fruitName, fruitId) in item.content" :key="fruitId"
  24. :label="item.content[fruitId]"
  25. :name="fruitId"
  26. @change="radioChange"
  27. :customStyle="{ marginBottom: '8px', height: '30px' }"
  28. >
  29. {{ fruitName }}
  30. </u-radio>
  31. </u-radio-group>
  32. <!-- 其他类型可以根据需要添加 -->
  33. </view>
  34. </block>
  35. <view class="bm_btn" @click="tjcyBtn">添加家庭成员</view>
  36. <view class="cy_box" v-for="item in cyList" :key="index">
  37. <view class="icon_box">
  38. <u-icon name="account" color="#000000" size="20"></u-icon>
  39. </view>
  40. <view style="margin-left: 20rpx">
  41. <view class="cy_name">{{item.name}}</view>
  42. <view class="cy_age">年龄:{{item.age}}</view>
  43. </view>
  44. </view>
  45. <!-- -->
  46. <view class="tjbm_btn">提交报名</view>
  47. <!-- 阅读协议 -->
  48. <view class="ydxy">
  49. <u-checkbox-group @change="xyShow=!xyShow" >
  50. <u-checkbox v-model="xyShow" shape="circle" ></u-checkbox>
  51. </u-checkbox-group>
  52. <view class="" @click="volhow=true">
  53. 阅读并同意《隐私政策》和《用户协议》
  54. </view>
  55. </view>
  56. </view>
  57. <!-- 协议弹层 -->
  58. <u-popup bgColor="#f2c8a2" :show="volhow" mode="center" customStyle="width:600rpx;padding: 30rpx;" round="20rpx">
  59. <view style="text-align: center; font-size: 30rpx">请阅读以下协议</view>
  60. <view style="margin-top: 20rpx"></view>
  61. <view class="bt_box">
  62. <view @click="volhow=false" class="bt2">我已知悉</view>
  63. </view>
  64. </u-popup>
  65. </view>
  66. </view>
  67. </template>
  68. <script>
  69. export default {
  70. data() {
  71. return {
  72. configItems : [
  73. {
  74. id: 1,
  75. name: "fruit",
  76. group: "basic",
  77. title: "请选择参赛类型",
  78. tip: "请选择一款水果",
  79. type: "radio",
  80. value: "",
  81. content: { 1: "1.5公里线路(适合家庭及儿童)", 2: "3公里线路(适合初学者)", 3: "5公里线路(适合跑步爱好者)" },
  82. rule: "required"
  83. },
  84. {
  85. id: 2,
  86. name: "name",
  87. group: "basic",
  88. title: "姓名",
  89. tip: "请填写姓名",
  90. type: "string",
  91. value: "张宁",
  92. rule: "required"
  93. },
  94. {
  95. id: 3,
  96. name: "name",
  97. group: "basic",
  98. title: "年龄",
  99. tip: "请填写年龄",
  100. type: "string",
  101. value: "18",
  102. rule: "required"
  103. },
  104. {
  105. id: 4,
  106. name: "name",
  107. group: "basic",
  108. title: "手机",
  109. tip: "请填写手机号",
  110. type: "string",
  111. value: "1866166265",
  112. rule: "required"
  113. },
  114. ],
  115. volhow:false,
  116. xyShow:false,
  117. mobile: '',
  118. mailbox: '',
  119. // 家庭成员
  120. cyList:[],
  121. ydxyShow:false,
  122. // 默认选中第一个
  123. radiovalue: 1,
  124. radioList: [
  125. {
  126. name: '1.5公里线路(适合家庭及儿童)',
  127. id: 1
  128. },
  129. {
  130. name: '3公里线路(适合初学者)',
  131. id: 2
  132. },
  133. {
  134. name: '5公里线路(适合跑步爱好者)',
  135. id: 3
  136. }
  137. ]
  138. };
  139. },
  140. onShow() {
  141. // 从本地存储中获取乘客信息
  142. const storedPassengers = uni.getStorageSync('passengers');
  143. if (storedPassengers) {
  144. console.log(storedPassengers,'storedPassengers')
  145. this.cyList = storedPassengers;
  146. }
  147. },
  148. methods: {
  149. radioChange(n) {
  150. // 拿到的content对应的key
  151. console.log('radioChange', n,);
  152. },
  153. onInput(e) {
  154. // 更新字符串值
  155. console.log(e)
  156. },
  157. tjcyBtn(){
  158. uni.navigateTo({
  159. url: '/index_fenbao/XuanJiangYuan/ck_page'
  160. });
  161. }
  162. }
  163. };
  164. </script>
  165. <style>
  166. .box {
  167. min-height: 100%;
  168. height: auto;
  169. width: 100%;
  170. padding-bottom: 50rpx;
  171. background-image: url('https://huli-app.wenlvti.net/app_static/minnanhun/image/gj_bg.png');
  172. background-repeat: repeat-y;
  173. background-size: 100%;
  174. }
  175. .ban {
  176. width: 92%;
  177. margin: auto;
  178. }
  179. .top_tit {
  180. width: 100%;
  181. height: 60rpx;
  182. color: black;
  183. line-height: 60rpx;
  184. text-align: center;
  185. font-size: 30rpx;
  186. background-color: #fee1b9;
  187. }
  188. .hdjs_box {
  189. height: 200rpx;
  190. color: black;
  191. margin-top: 10rpx;
  192. border-radius: 10rpx;
  193. padding: 20rpx;
  194. background-color: #fff0e3;
  195. }
  196. .hdjs_box2 {
  197. color: black;
  198. margin-top: 10rpx;
  199. border-radius: 10rpx;
  200. margin-bottom: 30rpx;
  201. padding: 20rpx;
  202. background-color: #fff0e3;
  203. }
  204. .hdjs_tit {
  205. font-size: 30rpx;
  206. }
  207. .hdjs_xq {
  208. margin-top: 10rpx;
  209. font-size: 26rpx;
  210. }
  211. .ld {
  212. font-size: 30rpx;
  213. font-weight: 700;
  214. margin-bottom: 20rpx;
  215. }
  216. .u-input.data-v-113bc24f {
  217. background-color: #fee1b9 !important ;
  218. margin-top: 20rpx;
  219. }
  220. .bm_btn {
  221. width: 100%;
  222. height: 80rpx;
  223. font-size: 30rpx;
  224. line-height: 80rpx;
  225. text-align: center;
  226. color: black;
  227. border-radius: 10rpx;
  228. background-color: #fee1b9;
  229. margin-top: 20rpx;
  230. }.bt2 {
  231. width: 244rpx;
  232. height: 78rpx;
  233. background: #ca5642;
  234. border-radius: 39rpx;
  235. text-align: center;
  236. line-height: 78rpx;
  237. color: #ffffff;
  238. }
  239. .cy_box {
  240. display: flex;
  241. margin-top: 20rpx;
  242. }
  243. .icon_box {
  244. width: 90rpx;
  245. height: 90rpx;
  246. display: flex;
  247. justify-content: center;
  248. background-color: #fee1b9;
  249. border-radius: 10rpx;
  250. }
  251. .cy_name {
  252. color: black;
  253. font-size: 28rpx;
  254. line-height: 50rpx;
  255. }
  256. .cy_age {
  257. font-size: 24rpx;
  258. color: #858789;
  259. }
  260. .bt_box {
  261. display: flex;
  262. margin-top: 50rpx;
  263. justify-content: space-around;
  264. }
  265. .tjbm_btn {
  266. width: 100%;
  267. height: 80rpx;
  268. font-size: 30rpx;
  269. line-height: 80rpx;
  270. text-align: center;
  271. color: #ffffff;
  272. border-radius: 10rpx;
  273. background-color: #fb5a02;
  274. margin-top: 50rpx;
  275. }
  276. .ydxy{
  277. display: flex;
  278. align-items: center;
  279. margin-top: 20rpx;
  280. height: 50rpx;
  281. font-size: 24rpx;
  282. color:#03A9F4;
  283. }
  284. </style>