index.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. <template>
  2. <view class="content">
  3. <view class="header-box">
  4. <image src="/static/tips.png" mode="aspectFill"></image>
  5. <text>温馨提示:请填写以下信息,填写后信息不可修改</text>
  6. </view>
  7. <form @submit="formSubmit" style="width: 100%">
  8. <view class="self-title-box">
  9. <image src="/static/rect-icon.png" mode="aspectFill"></image>
  10. <text>登记信息</text>
  11. </view>
  12. <view class="info-box">
  13. <view class="info-title-box">
  14. <image src="/static/require-icon.png" mode="aspectFill"></image>
  15. <text>姓名</text>
  16. </view>
  17. <view class="info-value-box">
  18. <input type="text" placeholder="请输入姓名" name="selfName">
  19. </view>
  20. </view>
  21. <view class="info-box" style="height: 150rpx;">
  22. <view class="info-title-box">
  23. <image src="/static/require-icon.png" mode="aspectFill"></image>
  24. <text>性别</text>
  25. </view>
  26. <view class="info-gender-box">
  27. <radio-group @change="radioCheck" class="padding-left-2">
  28. <label class="radio margin-right-10"><radio value="0" :checked="userSex==='0'" color="#00A1B4" class="form-radio"/>男</label>
  29. <label class="radio"><radio value="1" :checked="userSex==='1'" color="#00A1B4" class="form-radio"/>女</label>
  30. </radio-group>
  31. </view>
  32. </view>
  33. <view class="info-box" style="height: 390rpx;">
  34. <view class="info-title-box">
  35. <image src="/static/require-icon.png" mode="aspectFill"></image>
  36. <text>所在城市</text>
  37. </view>
  38. <view class="info-value-box" style="margin: 2% auto;">
  39. <view class="uni-input picker-box">
  40. <pickerAddress @change="changeCity" style="width: 100%;color: #888;">
  41. {{txt}}
  42. <image src="/static/right-arrow.png" mode="aspectFill"></image>
  43. </pickerAddress>
  44. </view>
  45. <view class="textarea-box">
  46. <textarea auto-height placeholder="请输入详细地址" />
  47. </view>
  48. </view>
  49. </view>
  50. <view class="info-box">
  51. <view class="info-title-box">
  52. <image src="/static/require-icon.png" mode="aspectFill"></image>
  53. <text>行业</text>
  54. </view>
  55. <view class="info-value-box">
  56. <picker @change="bindPickerChange($event,'trade')" :range="tradeArray" class="select-box" name="trade">
  57. <view class="uni-input">{{tradeValue}}</view>
  58. </picker>
  59. </view>
  60. </view>
  61. <view class="info-box">
  62. <view class="info-title-box">
  63. <image src="/static/require-icon.png" mode="aspectFill"></image>
  64. <text>职业</text>
  65. </view>
  66. <view class="info-value-box">
  67. <picker @change="bindPickerChange($event,'profession')" :range="professionArray" class="select-box" name="profession">
  68. <view class="uni-input">{{professionValue}}</view>
  69. </picker>
  70. </view>
  71. </view>
  72. <view class="info-box">
  73. <view class="info-title-box">
  74. <image src="/static/require-icon.png" mode="aspectFill"></image>
  75. <text>参观目的</text>
  76. </view>
  77. <view class="info-value-box">
  78. <picker @change="bindPickerChange($event,'ends')" :range="endsArray" class="select-box" name="ends">
  79. <view class="uni-input">{{endsValue}}</view>
  80. </picker>
  81. </view>
  82. </view>
  83. <view class="info-box" style="border-bottom: none;">
  84. <view class="info-title-box">
  85. <text>您目前从事的家具品牌</text>
  86. </view>
  87. <view class="info-value-box">
  88. <input type="text" placeholder="请输入您目前从事的家具品牌">
  89. </view>
  90. </view>
  91. <view style="width: 100%;">
  92. <button type="primary" class="submit-bth" formType="submit">提交</button>
  93. </view>
  94. </form>
  95. </view>
  96. </template>
  97. <script>
  98. var md5 = require("../../../common/md5.js");
  99. import pickerAddress from '../../../components/wangding-pickerAddress/wangding-pickerAddress.vue';
  100. var graceChecker = require("../../../common/graceChecker.js");
  101. export default {
  102. components: {
  103. pickerAddress
  104. },
  105. data() {
  106. return {
  107. title: 'Hello',
  108. detailObj:{},
  109. shareContent:'',
  110. shareCode:'',
  111. storeImg:'',
  112. isAuthPhone:getApp().globalData.user_phone,
  113. userSex:'1',
  114. txt: '请选择',
  115. tradeValue:'请选择',
  116. tradeArray: ['品牌营销', '家具销售', '室内设计', '家装建材','生产制造'],
  117. professionValue:'请选择',
  118. professionArray:['室内设计师','高层管理','品牌方销售','个体经销商','工程师','家具设计师','生产技术员','品牌方设计师'],
  119. endsValue:'请选择',
  120. endsArray:['学习与交流','了解科尔卡诺','商业洽谈','寻找新的合作','意向加盟'],
  121. }
  122. },
  123. onLoad(option) {
  124. //this.getDetailInfo(option.detailId);
  125. },
  126. onShow() {
  127. },
  128. onShareAppMessage() {
  129. return {
  130. title: '分销小助手',
  131. path:'/pages/index/index?scene=' + getApp().globalData.user_id
  132. }
  133. },
  134. methods: {
  135. goRuleList(){
  136. uni.navigateTo({
  137. url: '/pages/index/ruleList/index',
  138. success: res => {},
  139. fail: () => {},
  140. complete: () => {}
  141. });
  142. },
  143. radioCheck(e){
  144. console.log(e.target.value)
  145. this.userSex = e.target.value;
  146. //this.gender = e.target.value == '0' ? '男' : '女';
  147. },
  148. changeCity(data) {
  149. this.txt = data.data.join('')
  150. console.log(data.data.join(''))
  151. },
  152. bindPickerChange(e,type) {
  153. console.log(e.target.value,type)
  154. let that = this;
  155. switch (type){
  156. case 'trade':
  157. that.tradeValue = that.tradeArray[e.target.value]
  158. break;
  159. case 'profession':
  160. console.log(that.professionValue)
  161. that.professionValue = that.professionArray[e.target.value]
  162. break;
  163. case 'ends':
  164. that.endsValue = that.endsArray[e.target.value]
  165. break;
  166. }
  167. },
  168. formSubmit(e) {
  169. //将下列代码加入到对应的检查位置
  170. //定义表单规则
  171. var rule = [
  172. {
  173. name: "selfName",
  174. checkType: "notnull",
  175. errorMsg: "姓名不能为空"
  176. },
  177. {
  178. name: "trade",
  179. checkType: "notnull",
  180. errorMsg: "行业不能为空"
  181. },
  182. {
  183. name: "profession",
  184. checkType: "notnull",
  185. errorMsg: "职业不能为空"
  186. },
  187. {
  188. name: "ends",
  189. checkType: "notnull",
  190. errorMsg: "参观目的不能为空"
  191. },
  192. ];
  193. //进行表单检查
  194. var formData = e.detail.value;
  195. console.log(formData)
  196. var checkRes = graceChecker.check(formData, rule);
  197. if (checkRes) {
  198. this.txt === '请选择' ?
  199. uni.showToast({
  200. title: '请选择地区',
  201. icon: "none"
  202. }):
  203. this.submitRequest();
  204. } else {
  205. uni.showToast({
  206. title: graceChecker.error,
  207. icon: "none"
  208. });
  209. }
  210. },
  211. submitRequest(){
  212. this.goCustomCardPage('0')
  213. },
  214. goCustomCardPage(type){
  215. type === '1' ?
  216. uni.redirectTo({
  217. url: '/pages/index/successPage/index?types='+'custom', //游客成功页面
  218. success: res => {},
  219. fail: () => {},
  220. complete: () => {}
  221. }):
  222. uni.redirectTo({
  223. url: '/pages/index/failPage/index', //失败页面
  224. success: res => {},
  225. fail: () => {},
  226. complete: () => {}
  227. });
  228. }
  229. }
  230. }
  231. </script>
  232. <style>
  233. .content {
  234. width: 100%;
  235. /* height: 100%; */
  236. display: flex;
  237. flex-direction: column;
  238. align-items: center;
  239. /* justify-content: center; */
  240. }
  241. .header-box {
  242. width: 85%;
  243. height:80rpx;
  244. border: .5px dotted #00A1B4;
  245. border-radius: 50rpx;
  246. display: flex;
  247. justify-content: center;
  248. align-items: center;
  249. font-size: 24rpx;
  250. color:#00A1B4 ;
  251. /* font-family: PingFangSC-Regular; */
  252. margin-top: 2%;
  253. }
  254. .header-box image {
  255. width: 36rpx;
  256. height: 36rpx;
  257. margin-right: 1%;
  258. }
  259. .self-title-box {
  260. width: 90%;
  261. display: flex;
  262. align-items: center;
  263. font-size: 32rpx;
  264. letter-spacing: 2rpx;
  265. color:#3C3C3C ;
  266. /* font-family: SimHei; */
  267. margin: 4% auto;
  268. font-weight: bold;
  269. height: 50rpx;
  270. line-height: 50rpx;
  271. }
  272. .self-title-box image {
  273. width: 6rpx;
  274. height: 32rpx;
  275. margin-right: 2%;
  276. }
  277. .info-box {
  278. width: 90%;
  279. margin: 3% auto;
  280. height: 180rpx;
  281. border-bottom: 1px solid #f7f7f7;
  282. }
  283. .info-title-box {
  284. width: 100%;
  285. display: flex;
  286. align-items: center;
  287. font-size: 28rpx;
  288. height: 50rpx;
  289. line-height: 50rpx;
  290. }
  291. .info-title-box image{
  292. width: 15rpx;
  293. height: 15rpx;
  294. margin-right: 2%;
  295. }
  296. .info-value-box input {
  297. height: 88rpx;
  298. background: #f7f7f7;
  299. font-size: 28rpx;
  300. padding-left: 4%;
  301. margin: 2% auto;
  302. }
  303. .select-box {
  304. height: 88rpx;
  305. background: #f7f7f7;
  306. font-size: 28rpx;
  307. padding-left: 4%;
  308. margin: 2% auto;
  309. color: #888;
  310. line-height: 88rpx;
  311. }
  312. .info-gender-box {
  313. margin: 3% auto;
  314. font-size: 28rpx;
  315. }
  316. .form-radio {
  317. transform: scale(0.6);
  318. }
  319. .padding-left-2 {
  320. padding-left: 2%;
  321. }
  322. .margin-right-10 {
  323. margin-right: 10%;
  324. }
  325. .border-line-box {
  326. width: 100%;
  327. height: 20rpx;
  328. background: #f7f7f7;
  329. }
  330. .picker-box{
  331. display: flex;
  332. align-items: center;
  333. justify-content: space-between;
  334. height: 60rpx;
  335. line-height: 60rpx;
  336. background: #f7f7f7;
  337. height: 88rpx;
  338. line-height: 88rpx;
  339. background: #f7f7f7;
  340. font-size: 28rpx;
  341. padding-left: 4%;
  342. }
  343. .uni-input image {
  344. width: 40rpx;
  345. height: 40rpx;
  346. margin-right: 2%;
  347. float: right;
  348. margin-top: 22rpx;
  349. }
  350. .textarea-box {
  351. background: #f7f7f7;
  352. min-height: 120rpx;
  353. font-size: 28rpx;
  354. margin: 5% auto;
  355. padding: 4%;
  356. margin-bottom: 8%;
  357. }
  358. .submit-bth {
  359. width: 80%;
  360. height: 80rpx;
  361. line-height: 80rpx;
  362. background: #00A1B4!important;
  363. -webkit-box-shadow: 0 2rpx 16rpx 0 rgba(60,120,109,0.20);
  364. box-shadow: 0 2rpx 16rpx 0 rgba(60,120,109,0.20);
  365. border-radius: 50rpx;
  366. margin-bottom: 10%;
  367. font-size: 30rpx;
  368. }
  369. </style>