You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

328 lines
7.4 KiB

  1. <template>
  2. <view class="cented-box">
  3. <view class="chented" style="margin-bottom: 26rpx;">
  4. <view class="title" style="border: none;">
  5. <view class="titletext">姓名</view>
  6. <view class="titletext2">
  7. <input maxlength="10" class="titletext-input" style="color: #333333;" v-model="parames.name"
  8. placeholder-class="titletext-input" placeholder-style="color:#B2B2B2;" type="text"
  9. placeholder="请输入客户姓名(必填)" />
  10. </view>
  11. <view class="titleimg">
  12. <!-- <image class="titleimg1" src="../../../static/images/arrow.png" mode=""></image> -->
  13. </view>
  14. </view>
  15. </view>
  16. <view class="chented">
  17. <view class="title">
  18. <view class="titletext">性别</view>
  19. <view class="titletext2 displayclick" style="display: flex;align-items: center;padding-left: 10rpx;">
  20. <view class="sexRadio" @click="changeSex(1)" :class="{active:parames.sex == 1}">男士</view>
  21. <view class="sexRadio" @click="changeSex(2)" :class="{active:parames.sex == 2}">女士</view>
  22. </view>
  23. </view>
  24. <view class="title">
  25. <view class="titletext">到访人数</view>
  26. <view class="titletext2" style="display: flex;align-items: center;justify-content: space-around;">
  27. <view class="num" v-for="i in 6" :key="i" :class="{active:parames.howMany == i+1}"
  28. @click="changeHowMany(i+1)">
  29. {{i + 1}}
  30. </view>
  31. </view>
  32. </view>
  33. <view class="title" @click="Buildingselection()">
  34. <view class="titletext">到访途径</view>
  35. <view class="titletext2"
  36. style="font-size: 30rpx;font-weight: 400;color: #B2B2B2;line-height: 110rpx;padding-left: 10rpx;">
  37. <!-- {{parames.sourceName||'请选择客户来源'}} -->
  38. <text v-if="parames.sourceName" style="color: #333333;">{{parames.sourceName}}</text>
  39. <text v-else>请选择客户来源</text>
  40. </view>
  41. <view class="titleimg">
  42. <image class="titleimg1" src="../../static/images/arrow.png" mode=""></image>
  43. </view>
  44. </view>
  45. <!-- <view class="title" style="border: none;" @click="Buildingselection()">
  46. <view class="titletext">咨询业务</view>
  47. <view class="titletext2"
  48. style="font-size: 30rpx;font-weight: 400;color: #B2B2B2;line-height: 110rpx;padding-left: 10rpx;">
  49. <text v-if="parames.sourceName" style="color: #333333;">{{parames.sourceName}}</text>
  50. <text v-else>请选择咨询业务</text>
  51. </view>
  52. <view class="titleimg">
  53. <image class="titleimg1" src="../../static/images/arrow.png" mode=""></image>
  54. </view>
  55. </view> -->
  56. </view>
  57. <button class="clive" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" v-if="verifyPass">提交</button>
  58. <view class="clive" @click="save" v-else>提交</view>
  59. <view v-if="Showhiddenunits">
  60. <u-select :mask-close-able="false" v-model="Showhiddenunits" mode="single-column" :list="list"
  61. @cancel="cancel" @confirm="confirm"></u-select>
  62. </view>
  63. </view>
  64. </template>
  65. <script>
  66. var app = getApp();
  67. var config = require("@/config");
  68. let domain = require("@/utils/domain")
  69. export default {
  70. data() {
  71. return {
  72. Showhiddenunits: false,
  73. list: [{
  74. label: '自然到访',
  75. value: '自然到访'
  76. },
  77. {
  78. label: '渠道推荐',
  79. value: '渠道推荐'
  80. },
  81. ],
  82. parames: {
  83. name: '',
  84. sex: 1,
  85. sourceName: null,
  86. howMany: 1,
  87. projectId: '',
  88. phone:'',
  89. projectId:'',
  90. projectName:'xxx'
  91. },
  92. daitiReceptionobj: {},
  93. verifyPass:false,
  94. qrCodeUrl:''
  95. };
  96. },
  97. onLoad(options){
  98. const sceneStr = decodeURIComponent(options.scene);
  99. console.log(options)
  100. this.parames.projectId = sceneStr
  101. },
  102. watch:{
  103. parames:{
  104. deep:true,
  105. handler(newV){
  106. if (newV.name.length == 0) {
  107. this.verifyPass = false;
  108. }else{
  109. this.verifyPass = true;
  110. }
  111. }
  112. }
  113. },
  114. methods: {
  115. save() {
  116. if (this.parames.name.length == 0) {
  117. uni.showToast({
  118. icon: "none",
  119. title: "姓名不能为空"
  120. })
  121. return;
  122. }
  123. },
  124. getPhoneNumber(e){
  125. console.log(e)
  126. this.qrCodeUrl = domain.baseUrl
  127. if(e.detail.errMsg=="getPhoneNumber:ok"){
  128. let data = {
  129. code:e.detail.code,
  130. }
  131. uni.request({
  132. url:this.qrCodeUrl + '/code/loginSessionKey',
  133. method:"GET",
  134. data,
  135. success:(res)=> {
  136. let phoneNum = JSON.parse(res.data.data).phone_info.phoneNumber
  137. this.parames.phone = phoneNum
  138. if(this.parames.phone!=null && this.parames.phone!=""){
  139. if(this.parames.name.length>8){
  140. uni.showToast({
  141. icon: "none",
  142. title: "不能超过8个汉字"
  143. })
  144. }else{
  145. uni.request({
  146. url:this.qrCodeUrl + '/customer/codeAdd',
  147. method:"POST",
  148. data:this.parames,
  149. header: {
  150. 'content-type': 'application/json',
  151. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  152. },
  153. success: (addres) => {
  154. console.log(addres.data,111)
  155. if(addres.data.code == 10000){
  156. uni.reLaunch({
  157. url:'/pages/mine/registerResult'
  158. })
  159. }
  160. }
  161. })
  162. }
  163. }
  164. }
  165. })
  166. }else{
  167. return;
  168. }
  169. },
  170. changeSex(sex) {
  171. this.parames.sex = sex;
  172. },
  173. changeHowMany(num) {
  174. this.parames.howMany = num;
  175. },
  176. Buildingselection() {
  177. this.Showhiddenunits = true;
  178. },
  179. cancel() {
  180. this.Showhiddenunits = false;
  181. },
  182. confirm(e) {
  183. this.parames.sourceName = e[0].value;
  184. this.Showhiddenunits = false;
  185. },
  186. }
  187. };
  188. </script>
  189. <style lang="scss" scoped>
  190. .sexRadio {
  191. color: #BFBFBF;
  192. border: 1rpx solid #BFBFBF;
  193. font-size: 24upx;
  194. width: 120rpx;
  195. height: 60rpx;
  196. text-align: center;
  197. display: flex;
  198. align-items: center;
  199. justify-content: center;
  200. &:last-child {
  201. margin-left: 20rpx;
  202. }
  203. &.active {
  204. background: #2B6FFF;
  205. color: #fff;
  206. border-color: #2B6FFF;
  207. }
  208. }
  209. .num {
  210. width: 50rpx;
  211. height: 50rpx;
  212. background: rgba(43, 110, 253, 0.1);
  213. color: #2B6EFD;
  214. font-size: 30rpx;
  215. display: flex;
  216. align-items: center;
  217. justify-content: center;
  218. &.active {
  219. background: #2B6EFD;
  220. color: #FFFFFF;
  221. }
  222. }
  223. .cented-box {
  224. background: #F8F8F8;
  225. width: 100%;
  226. height: 100vh;
  227. }
  228. .Pinspeak {
  229. width: 100%;
  230. height: 92rpx;
  231. border-bottom: 1rpx solid #E0E0E0;
  232. font-size: 32rpx;
  233. font-weight: bold;
  234. color: #333333;
  235. text-indent: 30rpx;
  236. line-height: 92rpx;
  237. background: #FFFFFF;
  238. margin-top: 20rpx;
  239. padding-left: 10rpx;
  240. }
  241. .chented {
  242. width: 100%;
  243. padding-left: 30rpx;
  244. padding-right: 30rpx;
  245. background-color: #FFFFFF;
  246. .title {
  247. width: 100%;
  248. height: 110rpx;
  249. border-bottom: 1rpx solid #E0E0E0;
  250. display: flex;
  251. align-items: center;
  252. .titletext {
  253. width: 21%;
  254. height: 110rpx;
  255. font-size: 30rpx;
  256. font-weight: 400;
  257. color: #333333;
  258. line-height: 110rpx;
  259. text-indent: 10rpx;
  260. }
  261. .titletext2 {
  262. width: 71%;
  263. height: 110rpx;
  264. }
  265. .titletext-input {
  266. width: 100%;
  267. height: 110rpx;
  268. font-size: 30rpx;
  269. font-weight: 400;
  270. color: #B2B2B2;
  271. line-height: 110rpx;
  272. padding-left: 10rpx;
  273. }
  274. .titleimg {
  275. width: 8%;
  276. text-align: right;
  277. .titleimg1 {
  278. width: 16rpx;
  279. height: 36rpx;
  280. }
  281. }
  282. }
  283. }
  284. .clive {
  285. position: absolute;
  286. bottom: 32rpx;
  287. left: 30rpx;
  288. right: 30rpx;
  289. width: 690rpx;
  290. height: 88rpx;
  291. background: #2671E2;
  292. text-align: center;
  293. line-height: 88rpx;
  294. color: #FFFFFF;
  295. border-radius: 8rpx;
  296. font-size: 32rpx;
  297. }
  298. </style>