鸿宇研学生前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

277 lines
5.6 KiB

  1. <template>
  2. <view class="page__view">
  3. <navbar title="绑定申请" leftClick @leftClick="$utils.navigateBack" color="#191919" bgColor="#FFFFFF" />
  4. <view class="main">
  5. <view class="card">
  6. <view class="card-header">绑定申请</view>
  7. <view class="form">
  8. <uv-form
  9. ref="form"
  10. :model="form"
  11. :rules="rules"
  12. errorType="toast"
  13. >
  14. <view class="form-item">
  15. <uv-form-item prop="id" :customStyle="formItemStyle">
  16. <view class="form-item-label">绑定人ID</view>
  17. <view class="form-item-content">
  18. <view class="flex search">
  19. <uv-search
  20. v-model="keyword"
  21. placeholder="请输入"
  22. color="#181818"
  23. bgColor="transparent"
  24. :showAction="true"
  25. @custom="search"
  26. @search="search"
  27. >
  28. </uv-search>
  29. </view>
  30. </view>
  31. </uv-form-item>
  32. </view>
  33. <view class="form-item" v-for="item in list" :key="item.id">
  34. <view
  35. :class="['flex', 'list-item', item.id === form.id ? 'is-active' : '']"
  36. @click="onSelect"
  37. >
  38. <view class="avatar">
  39. <image class="img" :src="item.avatar" mode="scaleToFill"></image>
  40. </view>
  41. <view>
  42. <view class="title">{{ item.name }}</view>
  43. <view class="desc">{{ `ID:${item.id}` }}</view>
  44. </view>
  45. </view>
  46. </view>
  47. </uv-form>
  48. </view>
  49. </view>
  50. </view>
  51. <view class="bottom">
  52. <button class="btn" @click="onSubmit">提现</button>
  53. </view>
  54. </view>
  55. </template>
  56. <script>
  57. import mixinsList from '@/mixins/list.js'
  58. import formInput from '@/pages_order/components/formInput.vue'
  59. export default {
  60. mixins: [mixinsList],
  61. components: {
  62. formInput,
  63. },
  64. data() {
  65. return {
  66. keyword: '',
  67. queryParams: {
  68. pageNo: 1,
  69. pageSize: 1000,
  70. title: '',
  71. },
  72. // todo
  73. mixinsListApi: '',
  74. form: {
  75. id: null,
  76. },
  77. rules: {
  78. 'id': {
  79. type: 'string',
  80. required: true,
  81. message: '请选择绑定人',
  82. },
  83. },
  84. formItemStyle: { padding: 0 },
  85. }
  86. },
  87. methods: {
  88. search() {
  89. this.queryParams.title = this.keyword
  90. this.getData()
  91. },
  92. onSelect(id) {
  93. this.form.id = id
  94. },
  95. async onSubmit() {
  96. try {
  97. await this.$refs.form.validate()
  98. const {
  99. } = this.form
  100. const params = {
  101. }
  102. // todo: fetch
  103. // await this.$fetch('updateAddress', params)
  104. uni.showToast({
  105. icon: 'success',
  106. title: '提交成功',
  107. });
  108. setTimeout(() => {
  109. this.$utils.navigateBack()
  110. }, 800)
  111. } catch (err) {
  112. console.log('onSave err', err)
  113. }
  114. },
  115. },
  116. }
  117. </script>
  118. <style lang="scss" scoped>
  119. .page__view {
  120. width: 100vw;
  121. min-height: 100vh;
  122. background: $uni-bg-color;
  123. position: relative;
  124. /deep/ .nav-bar__view {
  125. position: fixed;
  126. top: 0;
  127. left: 0;
  128. }
  129. }
  130. .main {
  131. padding: calc(var(--status-bar-height) + 160rpx) 32rpx calc(env(safe-area-inset-bottom) + 198rpx) 32rpx;
  132. }
  133. .card {
  134. min-height: calc(100vh - (var(--status-bar-height) + 160rpx) - calc(env(safe-area-inset-bottom) + 198rpx));
  135. padding: 40rpx 32rpx;
  136. box-sizing: border-box;
  137. background: #FFFFFF;
  138. border: 2rpx solid #FFFFFF;
  139. border-radius: 32rpx;
  140. &-header {
  141. font-family: PingFang SC;
  142. font-weight: 500;
  143. font-size: 36rpx;
  144. line-height: 1.4;
  145. color: #252545;
  146. }
  147. }
  148. .form {
  149. padding: 8rpx 0 0 0;
  150. &-item {
  151. margin-top: 40rpx;
  152. border-bottom: 2rpx solid #EEEEEE;
  153. &:last-child {
  154. border: none;
  155. }
  156. &-label {
  157. font-family: PingFang SC;
  158. font-weight: 400;
  159. font-size: 26rpx;
  160. line-height: 1.4;
  161. color: #181818;
  162. }
  163. &-content {
  164. }
  165. }
  166. }
  167. .search {
  168. padding: 16rpx 0 8rpx 0;
  169. border-bottom: 2rpx solid #EEEEEE;
  170. /deep/ .uv-search__content {
  171. padding: 0;
  172. }
  173. /deep/ .uv-search__content__icon {
  174. display: none;
  175. }
  176. /deep/ .uv-search__content__input {
  177. margin: 0;
  178. }
  179. /deep/ .uv-search__action {
  180. color: #00A9FF;
  181. }
  182. }
  183. .list-item {
  184. justify-content: flex-start;
  185. column-gap: 24rpx;
  186. padding: 10rpx;
  187. border: 2rpx solid #EEEEEE;
  188. border-radius: 24rpx;
  189. .avatar {
  190. width: 96rpx;
  191. height: 96rpx;
  192. border-radius: 50%;
  193. .img {
  194. width: 100%;
  195. height: 100%;
  196. }
  197. }
  198. .title {
  199. font-size: 32rpx;
  200. font-weight: 600;
  201. color: #000000;
  202. }
  203. .desc {
  204. margin-top: 8rpx;
  205. font-size: 24rpx;
  206. color: #939393;
  207. }
  208. &.is-active {
  209. background: #E9F8FF;
  210. border-color: #00A9FF;
  211. }
  212. }
  213. .bottom {
  214. position: fixed;
  215. left: 0;
  216. bottom: 0;
  217. width: 100vw;
  218. // height: 200rpx;
  219. padding: 32rpx 40rpx;
  220. padding-bottom: calc(env(safe-area-inset-bottom) + 32rpx);
  221. background: #FFFFFF;
  222. box-sizing: border-box;
  223. .btn {
  224. width: 100%;
  225. padding: 14rpx 0;
  226. box-sizing: border-box;
  227. font-family: PingFang SC;
  228. font-weight: 500;
  229. font-size: 36rpx;
  230. line-height: 1.4;
  231. color: #FFFFFF;
  232. background: linear-gradient(to right, #21FEEC, #019AF9);
  233. border: 2rpx solid #00A9FF;
  234. border-radius: 41rpx;
  235. }
  236. }
  237. </style>