index.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. <template>
  2. <view class="app-page">
  3. <view class="top-box">
  4. <view class="top-bar"
  5. :style="'height:' + topData.height + 'px;' + 'padding-top:' + topData.top + 'px;padding-bottom:20rpx'">
  6. <u-icon name="arrow-left" color="#FFFFFF" size="34rpx" customStyle="padding: 16rpx" @click="toBack()">
  7. </u-icon>
  8. <text>推广合作</text>
  9. </view>
  10. <view class="top-view">
  11. <image class="img1" :src="`${$getImgBaseUrl()}ic-tghzb.png`" mode="heightFix"></image>
  12. <image class="img2" :src="`${$getImgBaseUrl()}ic-tghza.png`" mode="heightFix"></image>
  13. <view class="tips-box">
  14. <text>如果您需要个性化的推广定制服务,请填写表单,我们将尽快与您联系,提供专属定制服务。</text>
  15. </view>
  16. <view class="content-box">
  17. <view class="input-box">
  18. <text class="input-title">姓名</text>
  19. <u-textarea v-model="name" placeholder="请输入" type="text" border="none" height="67rpx"
  20. :auto-height="true" clearable customStyle="margin-right:20rpx;min-height:67rpx" />
  21. </view>
  22. <u-line color="#F4F4F4" length="100%"></u-line>
  23. <view class="input-box">
  24. <text class="input-title">品牌/公司</text>
  25. <u-textarea v-model="promotion" placeholder="请输入" type="text" border="none" height="67rpx"
  26. :auto-height="true" clearable customStyle="margin-right:20rpx;min-height:67rpx" />
  27. </view>
  28. <u-line color="#F4F4F4" length="100%"></u-line>
  29. <view class="input-box">
  30. <text class="input-title">手机号码</text>
  31. <u-textarea v-model="mobile" placeholder="请输入" type="text" border="none" height="67rpx"
  32. :auto-height="true" clearable customStyle="margin-right:20rpx;min-height:67rpx" />
  33. </view>
  34. <u-line color="#F4F4F4" length="100%"></u-line>
  35. <view class="input-box" @click="show = true">
  36. <text class="input-title">合作品类</text>
  37. <view v-if="!category" style="margin-right:20rpx;height:67rpx;color:#c0c4cc;">请选择</view>
  38. <view v-else style="margin-right:20rpx;height:67rpx">{{category}}</view>
  39. </view>
  40. <u-line color="#F4F4F4" length="100%"></u-line>
  41. <view class="input-box" style="align-items: flex-start;">
  42. <text class="input-title">合作需求</text>
  43. <u-textarea v-model="content" placeholder="请输入" type="text" border="none" height="197rpx"
  44. :auto-height="true" clearable customStyle="margin-right:20rpx; min-height:197rpx;" />
  45. </view>
  46. <u-line color="#F4F4F4" length="100%"></u-line>
  47. <view class="input-box">
  48. <text class="input-title" style="line-height:67rpx;">推广预算</text>
  49. <u-input v-model="budget" placeholder="请输入" type="digit" border="none" height="67rpx"
  50. :auto-height="true" clearable customStyle="margin-right:20rpx; min-height:67rpx;">
  51. <u--text text="¥" slot="prefix" margin="0 3px 0 0" color="#000000" size='28rpx'></u--text>
  52. </u-input>
  53. </view>
  54. <u-line color="#F4F4F4" length="100%"></u-line>
  55. <button class="primary-btn" @click="commit">提交</button>
  56. </view>
  57. <view class="content-title"></view>
  58. <image class="img3" :src="`${$getImgBaseUrl()}ic-tghzc.png`" mode="widthFix"></image>
  59. <view class="content-title-box">
  60. <text class="title">填写表单</text>
  61. </view>
  62. </view>
  63. </view>
  64. <u-picker :show="show" keyName="label" confirmColor="#815BFF" :columns="[list]" @confirm="confirm"
  65. @cancel="show = false"></u-picker>
  66. </view>
  67. </template>
  68. <script>
  69. import {
  70. addPeace,
  71. } from "@/common/api/task.js";
  72. export default {
  73. data() {
  74. return {
  75. show: false,
  76. list: [{
  77. value: '品牌种草',
  78. label: '品牌种草'
  79. },
  80. {
  81. value: '短视频带货',
  82. label: '短视频带货'
  83. },
  84. {
  85. value: '达人对接',
  86. label: '达人对接'
  87. },
  88. {
  89. value: '达人授权',
  90. label: '达人授权'
  91. }
  92. ],
  93. topData: {
  94. top: 0,
  95. height: 0
  96. },
  97. name: undefined,
  98. promotion: undefined,
  99. mobile: undefined,
  100. category: undefined,
  101. content: undefined,
  102. budget: undefined
  103. }
  104. },
  105. computed: {
  106. formData() {
  107. return {
  108. name: this.name,
  109. promotion: this.promotion,
  110. mobile: this.mobile,
  111. category: this.category,
  112. content: this.content,
  113. budget: this.budget
  114. }
  115. }
  116. },
  117. onLoad(options) {},
  118. onShow() {
  119. const topData = uni.getMenuButtonBoundingClientRect()
  120. this.topData.top = topData.top
  121. this.topData.height = topData.height
  122. },
  123. methods: {
  124. confirm(e) {
  125. this.category = e.value[0].value;
  126. console.log(e.value[0].label);
  127. this.show = false;
  128. },
  129. toBack() {
  130. uni.navigateBack()
  131. },
  132. commit() {
  133. const data = this.formData;
  134. addPeace(data)
  135. .then((res) => {
  136. console.log("addPeace==>", res.data)
  137. if (res.data) {
  138. uni.$u.toast('提交成功')
  139. setTimeout(() => {
  140. uni.navigateBack()
  141. }, 800);
  142. }
  143. });
  144. },
  145. }
  146. }
  147. </script>
  148. <style lang="scss" scoped>
  149. .app-page {
  150. width: 100%;
  151. display: flex;
  152. background: linear-gradient(180deg, #6B40FF 0%, #F5F6F8 100%);
  153. min-height: 100vh;
  154. align-items: center;
  155. flex-direction: column;
  156. }
  157. .top-box {
  158. width: 100%;
  159. display: flex;
  160. flex-direction: column;
  161. }
  162. .top-view {
  163. width: 100%;
  164. position: relative;
  165. display: flex;
  166. flex-direction: column;
  167. }
  168. .top-bar {
  169. display: flex;
  170. align-items: center;
  171. flex-direction: row;
  172. text {
  173. width: calc(100% - 132rpx);
  174. text-align: center;
  175. color: white;
  176. font-size: 34rpx;
  177. font-family: PingFang SC-Bold, PingFang SC;
  178. font-weight: bold;
  179. color: #FFFFFF;
  180. }
  181. }
  182. .img1 {
  183. position: absolute;
  184. top: 5rpx;
  185. right: 0;
  186. height: 423rpx;
  187. }
  188. .img2 {
  189. position: absolute;
  190. top: 50rpx;
  191. left: 25rpx;
  192. height: 99rpx;
  193. }
  194. .tips-box {
  195. position: absolute;
  196. top: 215rpx;
  197. left: 20rpx;
  198. width: 710rpx;
  199. min-height: 112rpx;
  200. background: rgba(196, 178, 255, 0.74);
  201. border-radius: 10rpx;
  202. border: 2rpx solid #ffffff;
  203. display: flex;
  204. flex-direction: column;
  205. justify-content: center;
  206. text {
  207. font-size: 24rpx;
  208. font-family: PingFang SC-Medium, PingFang SC;
  209. font-weight: 500;
  210. color: #FFFFFF;
  211. margin: 20rpx;
  212. }
  213. }
  214. .content-box {
  215. position: absolute;
  216. top: 360rpx;
  217. left: 20rpx;
  218. width: 710rpx;
  219. margin-bottom: 40rpx;
  220. display: flex;
  221. align-items: center;
  222. flex-direction: column;
  223. padding-top: 90rpx;
  224. background: #FFFFFF;
  225. border-radius: 15rpx;
  226. .primary-btn {
  227. width: 650rpx;
  228. margin-top: 49rpx;
  229. margin-bottom: 36rpx;
  230. height: 78rpx;
  231. line-height: 78rpx;
  232. background: #815BFF;
  233. border-radius: 40rpx;
  234. font-size: 32rpx;
  235. font-family: PingFang SC-Medium, PingFang SC;
  236. font-weight: 500;
  237. color: #FFFFFF;
  238. }
  239. button::after {
  240. height: 78rpx;
  241. line-height: 78rpx;
  242. }
  243. .primary-btn:active {
  244. opacity: 0.7;
  245. }
  246. }
  247. .content-title {
  248. position: absolute;
  249. top: 360rpx;
  250. left: 20rpx;
  251. width: 710rpx;
  252. height: 90rpx;
  253. background: linear-gradient(180deg, #D9CDFF 0%, rgba(255, 255, 255, 0) 100%);
  254. border-radius: 15rpx 15rpx 0 0;
  255. }
  256. .content-title-box {
  257. position: absolute;
  258. top: 348rpx;
  259. left: 154rpx;
  260. width: 446rpx;
  261. height: 90rpx;
  262. display: flex;
  263. flex-direction: column;
  264. align-items: center;
  265. justify-content: center;
  266. }
  267. .img3 {
  268. position: absolute;
  269. top: 348rpx;
  270. left: 154rpx;
  271. width: 446rpx;
  272. height: 90rpx;
  273. }
  274. .title {
  275. font-size: 36rpx;
  276. font-family: PingFang SC-Medium, PingFang SC;
  277. font-weight: 500;
  278. color: #893313;
  279. }
  280. .input-title {
  281. width: 170rpx;
  282. height: 67rpx;
  283. padding-left: 20rpx;
  284. font-size: 28rpx;
  285. font-family: PingFang SC-Medium, PingFang SC;
  286. font-weight: 500;
  287. color: #232323;
  288. }
  289. .input-box {
  290. width: 100%;
  291. padding-top: 40rpx;
  292. display: flex;
  293. flex-direction: row;
  294. align-items: center;
  295. }
  296. </style>