index.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  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">
  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">
  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">
  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="请输入您目前从事的家具品牌" name="selfName">
  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: "dealerName",
  179. checkType: "notnull",
  180. errorMsg: "经销商姓名不能为空"
  181. },
  182. ];
  183. //进行表单检查
  184. var formData = e.detail.value;
  185. var checkRes = graceChecker.check(formData, rule);
  186. if (checkRes) {
  187. this.txt === '请选择' ?
  188. uni.showToast({
  189. title: '请选择地区',
  190. icon: "none"
  191. }):
  192. console.log('pass')
  193. } else {
  194. uni.showToast({
  195. title: graceChecker.error,
  196. icon: "none"
  197. });
  198. }
  199. },
  200. }
  201. }
  202. </script>
  203. <style>
  204. .content {
  205. width: 100%;
  206. /* height: 100%; */
  207. display: flex;
  208. flex-direction: column;
  209. align-items: center;
  210. /* justify-content: center; */
  211. }
  212. .header-box {
  213. width: 85%;
  214. height:80rpx;
  215. border: .5px dotted #00A1B4;
  216. border-radius: 50rpx;
  217. display: flex;
  218. justify-content: center;
  219. align-items: center;
  220. font-size: 24rpx;
  221. color:#00A1B4 ;
  222. /* font-family: PingFangSC-Regular; */
  223. margin-top: 2%;
  224. }
  225. .header-box image {
  226. width: 36rpx;
  227. height: 36rpx;
  228. margin-right: 1%;
  229. }
  230. .self-title-box {
  231. width: 90%;
  232. display: flex;
  233. align-items: center;
  234. font-size: 32rpx;
  235. letter-spacing: 2rpx;
  236. color:#3C3C3C ;
  237. /* font-family: SimHei; */
  238. margin: 4% auto;
  239. font-weight: bold;
  240. height: 50rpx;
  241. line-height: 50rpx;
  242. }
  243. .self-title-box image {
  244. width: 6rpx;
  245. height: 32rpx;
  246. margin-right: 2%;
  247. }
  248. .info-box {
  249. width: 90%;
  250. margin: 3% auto;
  251. height: 180rpx;
  252. border-bottom: 1px solid #f7f7f7;
  253. }
  254. .info-title-box {
  255. width: 100%;
  256. display: flex;
  257. align-items: center;
  258. font-size: 28rpx;
  259. height: 50rpx;
  260. line-height: 50rpx;
  261. }
  262. .info-title-box image{
  263. width: 15rpx;
  264. height: 15rpx;
  265. margin-right: 2%;
  266. }
  267. .info-value-box input {
  268. height: 88rpx;
  269. background: #f7f7f7;
  270. font-size: 28rpx;
  271. padding-left: 4%;
  272. margin: 2% auto;
  273. }
  274. .select-box {
  275. height: 88rpx;
  276. background: #f7f7f7;
  277. font-size: 28rpx;
  278. padding-left: 4%;
  279. margin: 2% auto;
  280. color: #888;
  281. line-height: 88rpx;
  282. }
  283. .info-gender-box {
  284. margin: 3% auto;
  285. font-size: 28rpx;
  286. }
  287. .form-radio {
  288. transform: scale(0.6);
  289. }
  290. .padding-left-2 {
  291. padding-left: 2%;
  292. }
  293. .margin-right-10 {
  294. margin-right: 10%;
  295. }
  296. .border-line-box {
  297. width: 100%;
  298. height: 20rpx;
  299. background: #f7f7f7;
  300. }
  301. .picker-box{
  302. display: flex;
  303. align-items: center;
  304. justify-content: space-between;
  305. height: 60rpx;
  306. line-height: 60rpx;
  307. background: #f7f7f7;
  308. height: 88rpx;
  309. line-height: 88rpx;
  310. background: #f7f7f7;
  311. font-size: 28rpx;
  312. padding-left: 4%;
  313. }
  314. .uni-input image {
  315. width: 40rpx;
  316. height: 40rpx;
  317. margin-right: 2%;
  318. float: right;
  319. margin-top: 22rpx;
  320. }
  321. .textarea-box {
  322. background: #f7f7f7;
  323. min-height: 120rpx;
  324. font-size: 28rpx;
  325. margin: 5% auto;
  326. padding: 4%;
  327. margin-bottom: 8%;
  328. }
  329. .submit-bth {
  330. width: 80%;
  331. height: 80rpx;
  332. line-height: 80rpx;
  333. background: #00A1B4!important;
  334. -webkit-box-shadow: 0 2rpx 16rpx 0 rgba(60,120,109,0.20);
  335. box-shadow: 0 2rpx 16rpx 0 rgba(60,120,109,0.20);
  336. border-radius: 50rpx;
  337. margin-bottom: 10%;
  338. font-size: 30rpx;
  339. }
  340. </style>