index.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  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="border-bottom: none;height: 170rpx;">
  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="border-line-box"></view>
  34. <view class="self-title-box">
  35. <image src="/static/rect-icon.png" mode="aspectFill"></image>
  36. <text>经销商信息</text>
  37. </view>
  38. <view class="info-box">
  39. <view class="info-title-box">
  40. <image src="/static/require-icon.png" mode="aspectFill"></image>
  41. <text>经销商姓名</text>
  42. </view>
  43. <view class="info-value-box">
  44. <input type="text" placeholder="请输入姓名" name="dealerName">
  45. </view>
  46. </view>
  47. <!-- <view class="info-box">
  48. <view class="info-title-box">
  49. <image src="/static/require-icon.png" mode="aspectFill"></image>
  50. <text>经销商手机号</text>
  51. </view>
  52. <view class="info-value-box">
  53. <input type="number" placeholder="请输入手机号" name="dealPhone">
  54. </view>
  55. </view> -->
  56. <view class="info-box" style="border-bottom: none;height: auto;">
  57. <view class="info-title-box">
  58. <image src="/static/require-icon.png" mode="aspectFill"></image>
  59. <text>经销商展厅所在地</text>
  60. </view>
  61. <view class="info-value-box" style="margin: 2% auto;">
  62. <view class="uni-input picker-box">
  63. <pickerAddress @change="changeCity" style="width: 100%;color: #888;">
  64. {{txt}}
  65. <image src="/static/right-arrow.png" mode="aspectFill"></image>
  66. </pickerAddress>
  67. </view>
  68. <view class="textarea-box">
  69. <textarea auto-height placeholder="请输入详细地址" />
  70. </view>
  71. </view>
  72. </view>
  73. <view style="width: 100%;">
  74. <button type="primary" class="submit-bth" formType="submit">提交</button>
  75. </view>
  76. </form>
  77. </view>
  78. </template>
  79. <script>
  80. var md5 = require("../../../common/md5.js");
  81. import pickerAddress from '../../../components/wangding-pickerAddress/wangding-pickerAddress.vue';
  82. var graceChecker = require("../../../common/graceChecker.js");
  83. export default {
  84. components: {
  85. pickerAddress
  86. },
  87. data() {
  88. return {
  89. title: 'Hello',
  90. detailObj:{},
  91. shareContent:'',
  92. shareCode:'',
  93. storeImg:'',
  94. isAuthPhone:getApp().globalData.user_phone,
  95. userSex:'1',
  96. txt: '请选择',
  97. }
  98. },
  99. onLoad(option) {
  100. //this.getDetailInfo(option.detailId);
  101. },
  102. onShow() {
  103. },
  104. onShareAppMessage() {
  105. return {
  106. title: '分销小助手',
  107. path:'/pages/index/index?scene=' + getApp().globalData.user_id
  108. }
  109. },
  110. methods: {
  111. goRuleList(){
  112. uni.navigateTo({
  113. url: '/pages/index/ruleList/index',
  114. success: res => {},
  115. fail: () => {},
  116. complete: () => {}
  117. });
  118. },
  119. radioCheck(e){
  120. console.log(e.target.value)
  121. this.userSex = e.target.value;
  122. //this.gender = e.target.value == '0' ? '男' : '女';
  123. },
  124. changeCity(data) {
  125. this.txt = data.data.join('')
  126. console.log(data.data.join(''))
  127. },
  128. formSubmit(e) {
  129. //将下列代码加入到对应的检查位置
  130. //定义表单规则
  131. var rule = [
  132. {
  133. name: "selfName",
  134. checkType: "notnull",
  135. errorMsg: "姓名不能为空"
  136. },
  137. {
  138. name: "dealerName",
  139. checkType: "notnull",
  140. errorMsg: "经销商姓名不能为空"
  141. },
  142. ];
  143. //进行表单检查
  144. var formData = e.detail.value;
  145. var checkRes = graceChecker.check(formData, rule);
  146. if (checkRes) {
  147. this.txt === '请选择' ?
  148. uni.showToast({
  149. title: '请选择地区',
  150. icon: "none"
  151. }):
  152. this.submitRequest();
  153. } else {
  154. uni.showToast({
  155. title: graceChecker.error,
  156. icon: "none"
  157. });
  158. }
  159. },
  160. submitRequest(){
  161. this.goCustomCardPage('1')
  162. },
  163. goCustomCardPage(type){
  164. type === '1' ?
  165. uni.redirectTo({
  166. url: '/pages/index/successPage/index?types='+'dealer', //游客成功页面
  167. success: res => {},
  168. fail: () => {},
  169. complete: () => {}
  170. }):
  171. uni.redirectTo({
  172. url: '/pages/index/failPage/index', //失败页面
  173. success: res => {},
  174. fail: () => {},
  175. complete: () => {}
  176. });
  177. }
  178. }
  179. }
  180. </script>
  181. <style>
  182. .content {
  183. width: 100%;
  184. /* height: 100%; */
  185. display: flex;
  186. flex-direction: column;
  187. align-items: center;
  188. /* justify-content: center; */
  189. }
  190. .header-box {
  191. width: 85%;
  192. height:80rpx;
  193. border: .5px dotted #00A1B4;
  194. border-radius: 50rpx;
  195. display: flex;
  196. justify-content: center;
  197. align-items: center;
  198. font-size: 24rpx;
  199. color:#00A1B4 ;
  200. /* font-family: PingFangSC-Regular; */
  201. margin-top: 2%;
  202. }
  203. .header-box image {
  204. width: 36rpx;
  205. height: 36rpx;
  206. margin-right: 1%;
  207. }
  208. .self-title-box {
  209. width: 90%;
  210. display: flex;
  211. align-items: center;
  212. font-size: 32rpx;
  213. letter-spacing: 2rpx;
  214. color:#3C3C3C ;
  215. /* font-family: SimHei; */
  216. margin: 4% auto;
  217. font-weight: bold;
  218. height: 50rpx;
  219. line-height: 50rpx;
  220. }
  221. .self-title-box image {
  222. width: 6rpx;
  223. height: 32rpx;
  224. margin-right: 2%;
  225. }
  226. .info-box {
  227. width: 90%;
  228. margin: 3% auto;
  229. height: 180rpx;
  230. border-bottom: 1px solid #f7f7f7;
  231. }
  232. .info-title-box {
  233. width: 100%;
  234. display: flex;
  235. align-items: center;
  236. font-size: 28rpx;
  237. height: 50rpx;
  238. line-height: 50rpx;
  239. }
  240. .info-title-box image{
  241. width: 15rpx;
  242. height: 15rpx;
  243. margin-right: 2%;
  244. }
  245. .info-value-box input {
  246. height: 88rpx;
  247. background: #f7f7f7;
  248. font-size: 28rpx;
  249. padding-left: 4%;
  250. margin: 2% auto;
  251. }
  252. .info-gender-box {
  253. margin: 3% auto;
  254. font-size: 28rpx;
  255. }
  256. .form-radio {
  257. transform: scale(0.6);
  258. }
  259. .padding-left-2 {
  260. padding-left: 2%;
  261. }
  262. .margin-right-10 {
  263. margin-right: 10%;
  264. }
  265. .border-line-box {
  266. width: 100%;
  267. height: 20rpx;
  268. background: #f7f7f7;
  269. }
  270. .picker-box{
  271. display: flex;
  272. align-items: center;
  273. justify-content: space-between;
  274. height: 60rpx;
  275. line-height: 60rpx;
  276. background: #f7f7f7;
  277. height: 88rpx;
  278. line-height: 88rpx;
  279. background: #f7f7f7;
  280. font-size: 28rpx;
  281. padding-left: 4%;
  282. }
  283. .uni-input image {
  284. width: 40rpx;
  285. height: 40rpx;
  286. margin-right: 2%;
  287. float: right;
  288. margin-top: 22rpx;
  289. }
  290. .textarea-box {
  291. background: #f7f7f7;
  292. min-height: 120rpx;
  293. font-size: 28rpx;
  294. margin: 5% auto;
  295. padding: 4%;
  296. margin-bottom: 8%;
  297. }
  298. .submit-bth {
  299. width: 80%;
  300. height: 80rpx;
  301. line-height: 80rpx;
  302. background: #00A1B4!important;
  303. -webkit-box-shadow: 0 2rpx 16rpx 0 rgba(60,120,109,0.20);
  304. box-shadow: 0 2rpx 16rpx 0 rgba(60,120,109,0.20);
  305. border-radius: 50rpx;
  306. margin-bottom: 10%;
  307. font-size: 30rpx;
  308. }
  309. </style>