AI销管
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 

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