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