stylebook.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. <template>
  2. <view class="page">
  3. <view class="stylebookbox">
  4. <view class="apply">样书申请</view>
  5. <view class="stylebook">
  6. 欢迎您申请我们的国优、国规样书
  7. </view>
  8. <view class="dotted">
  9. <image src="/static/images/dotted.png" style="width: 654rpx;height: 4rpx;" mode=""></image>
  10. </view>
  11. <!-- 姓名 -->
  12. <view class="item">
  13. <view class="name">
  14. <text>*</text>
  15. <text style="color: rgba(34, 34, 34, 1);">您的姓名</text>
  16. </view>
  17. <view class="box u-flex">
  18. <input v-model="from.name" type="text" style="width: 100%;" />
  19. </view>
  20. </view>
  21. <!-- 电话 -->
  22. <view class="item">
  23. <view class="name">
  24. <text>*</text>
  25. <text style="color: rgba(34, 34, 34, 1);">您的电话</text>
  26. </view>
  27. <view class="box u-flex">
  28. <input v-model="from.phone" type="text" style="width: 100%;" />
  29. </view>
  30. </view>
  31. <!-- 邮箱 -->
  32. <view class="item">
  33. <view class="name">
  34. <text>*</text>
  35. <text style="color: rgba(34, 34, 34, 1);">您的邮箱</text>
  36. </view>
  37. <view class="box u-flex">
  38. <input v-model="from.email" type="text" style="width: 100%;" />
  39. </view>
  40. </view>
  41. <!-- 学校 -->
  42. <view class="item">
  43. <view class="name">
  44. <text>*</text>
  45. <text style="color: rgba(34, 34, 34, 1);">您所在的学校名称</text>
  46. </view>
  47. <view class="box u-flex">
  48. <input v-model="from.school" type="text" style="width: 100%;" />
  49. </view>
  50. </view>
  51. <!-- 样书 -->
  52. <view class="item">
  53. <view class="name">
  54. <text>*</text>
  55. <text style="color: rgba(34, 34, 34, 1);">样书用途</text>
  56. </view>
  57. <!-- <view class="box u-flex"> -->
  58. <view class="" style="margin-top: 38rpx;">
  59. <u-radio-group :wrap='true' @change='changeground'>
  60. <u-radio shape="square" active-color="rgba(6, 169, 113, 1)" v-for="(item, index) in list"
  61. :key="item.name" :name="index" @change="radioChange">
  62. {{item.name}}
  63. </u-radio>
  64. </u-radio-group>
  65. </view>
  66. <!-- </view> -->
  67. </view>
  68. <!-- 地址 -->
  69. <view class="item">
  70. <view class="name">
  71. <text>*</text>
  72. <text style="color: rgba(34, 34, 34, 1);">您的邮寄地址</text>
  73. </view>
  74. <view class="u-flex u-row-between" style="margin-top: 40rpx;">
  75. <view class="address">姓名:</view>
  76. <view class="box u-flex " style="margin-top: 0rpx;width: 500rpx;">
  77. <input v-model="from.mailing_name" type="text" style="width: 100%;" />
  78. </view>
  79. </view>
  80. <view class="u-flex u-row-between" style="margin-top: 40rpx;">
  81. <view class="address">所在地区:</view>
  82. <view class="box u-flex " style="margin-top: 0rpx;width: 500rpx;">
  83. <input v-model="from.mailing_area" type="text" style="width: 100%;" />
  84. </view>
  85. </view>
  86. <view class="u-flex u-row-between" style="margin-top: 40rpx;">
  87. <view class="address">详细地址:</view>
  88. <view class="box u-flex " style="margin-top: 0rpx;width: 500rpx;">
  89. <input v-model="from.mailing_address" type="text" style="width: 100%;" />
  90. </view>
  91. </view>
  92. <view class="u-flex u-row-between" style="margin-top: 40rpx;">
  93. <view class="address">手机号码:</view>
  94. <view class="box u-flex " style="margin-top: 0rpx;width: 500rpx;">
  95. <input v-model="from.mailing_phone" type="text" style="width: 100%;" />
  96. </view>
  97. </view>
  98. </view>
  99. <view class="btn" @click="toupload">
  100. 提交
  101. </view>
  102. </view>
  103. </view>
  104. </template>
  105. <script>
  106. import city from '../../common/city-data.js'
  107. export default {
  108. data() {
  109. return {
  110. list: [{
  111. name: '教材用书',
  112. disabled: false,
  113. id: 0
  114. },
  115. {
  116. name: '学习参考',
  117. disabled: false,
  118. id: 1
  119. },
  120. {
  121. name: '其他',
  122. disabled: false,
  123. id: 2
  124. }
  125. ],
  126. from: {
  127. name: '',
  128. phone: '',
  129. email: '',
  130. school: '',
  131. use_to: '',
  132. mailing_name: '',
  133. mailing_area: '',
  134. mailing_address: '',
  135. mailing_phone: '',
  136. books_id: ''
  137. }
  138. };
  139. },
  140. onLoad(options) {
  141. this.from.books_id = options.id
  142. },
  143. methods: {
  144. radioChange(e) {
  145. console.log(e);
  146. },
  147. changeground(e) {
  148. console.log(e);
  149. },
  150. toupload() {
  151. if (!this.from.name) {
  152. this.$u.toast('请输入您的姓名')
  153. return
  154. }
  155. if (!this.$u.test.mobile(this.from.phone)) {
  156. this.$u.toast("请输入正确的手机号")
  157. return
  158. }
  159. if (!this.$u.test.email(this.from.email)) {
  160. this.$u.toast("请输入正确的邮箱号")
  161. return
  162. }
  163. if (!this.from.school) {
  164. this.$u.toast('请输入您的学校')
  165. return
  166. }
  167. if (!this.from.use_to) {
  168. this.$u.toast('请选择图书用途')
  169. return
  170. }
  171. if (!this.from.mailing_name) {
  172. this.$u.toast('请输入您的收货姓名')
  173. return
  174. }
  175. if (!this.from.mailing_address) {
  176. this.$u.toast('请输入您的收货地址')
  177. return
  178. }
  179. if (!this.$u.test.mobile(this.from.mailing_phone)) {
  180. this.$u.toast("请输入正确的收货手机号")
  181. return
  182. }
  183. this.$u.post("api/books/addSampleApply", {
  184. ...this.from
  185. }).then(res => {
  186. })
  187. }
  188. }
  189. }
  190. </script>
  191. <style lang="scss">
  192. .btn {
  193. // width: 614rpx;
  194. height: 82rpx;
  195. background: #06A971;
  196. border-radius: 8rpx;
  197. font-size: 32rpx;
  198. font-family: PingFangSC, PingFang SC;
  199. font-weight: 500;
  200. color: #FFFFFF;
  201. margin-top: 48rpx;
  202. line-height: 82rpx;
  203. text-align: center;
  204. }
  205. .address {
  206. font-size: 26rpx;
  207. font-family: PingFangSC, PingFang SC;
  208. font-weight: 400;
  209. color: #222222;
  210. }
  211. .item {
  212. margin-top: 44rpx;
  213. .name {
  214. font-size: 26rpx;
  215. font-family: PingFangSC, PingFang SC;
  216. font-weight: 500;
  217. color: #CF1534;
  218. }
  219. .box {
  220. margin-top: 24rpx;
  221. height: 72rpx;
  222. border: 2rpx solid rgba(151, 151, 151, 0.3);
  223. }
  224. }
  225. .page {
  226. background-color: rgba(246, 246, 246, 1);
  227. width: 750rpx;
  228. min-height: 100vh;
  229. padding: 20rpx 28rpx 68rpx;
  230. }
  231. .stylebookbox {
  232. background: #FFFFFF;
  233. border-radius: 12rpx;
  234. padding: 38rpx 20rpx 44rpx;
  235. .apply {
  236. font-size: 32rpx;
  237. font-family: PingFangSC, PingFang SC;
  238. font-weight: 500;
  239. color: #222222;
  240. text-align: center;
  241. }
  242. .stylebook {
  243. font-size: 26rpx;
  244. font-family: PingFangSC, PingFang SC;
  245. font-weight: 400;
  246. color: #222222;
  247. margin-top: 50rpx;
  248. }
  249. .dotted {
  250. // margin-top: 30rpx;
  251. }
  252. }
  253. </style>