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.
 
 
 

326 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. projectName:'xxx'
  90. },
  91. daitiReceptionobj: {},
  92. verifyPass:false,
  93. qrCodeUrl:''
  94. };
  95. },
  96. onLoad(options){
  97. const sceneStr = decodeURIComponent(options.scene);
  98. console.log(options)
  99. this.parames.projectId = sceneStr
  100. },
  101. watch:{
  102. parames:{
  103. deep:true,
  104. handler(newV){
  105. if (newV.name.length == 0) {
  106. this.verifyPass = false;
  107. }else{
  108. this.verifyPass = true;
  109. }
  110. }
  111. }
  112. },
  113. methods: {
  114. save() {
  115. if (this.parames.name.length == 0) {
  116. uni.showToast({
  117. icon: "none",
  118. title: "姓名不能为空"
  119. })
  120. return;
  121. }
  122. },
  123. getPhoneNumber(e){
  124. console.log(e)
  125. this.qrCodeUrl = domain.baseUrl
  126. if(e.detail.errMsg=="getPhoneNumber:ok"){
  127. let data = {
  128. code:e.detail.code,
  129. }
  130. uni.request({
  131. url:this.qrCodeUrl + '/code/loginSessionKey',
  132. method:"GET",
  133. data,
  134. success:(res)=> {
  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. console.log(addres.data,111)
  154. if(addres.data.code == 10000){
  155. uni.reLaunch({
  156. url:'/pages/mine/registerResult'
  157. })
  158. }
  159. }
  160. })
  161. }
  162. }
  163. }
  164. })
  165. }else{
  166. return;
  167. }
  168. },
  169. changeSex(sex) {
  170. this.parames.sex = sex;
  171. },
  172. changeHowMany(num) {
  173. this.parames.howMany = num;
  174. },
  175. Buildingselection() {
  176. this.Showhiddenunits = true;
  177. },
  178. cancel() {
  179. this.Showhiddenunits = false;
  180. },
  181. confirm(e) {
  182. this.parames.sourceName = e[0].value;
  183. this.Showhiddenunits = false;
  184. },
  185. }
  186. };
  187. </script>
  188. <style lang="scss" scoped>
  189. .sexRadio {
  190. color: #BFBFBF;
  191. border: 1rpx solid #BFBFBF;
  192. font-size: 24upx;
  193. width: 120rpx;
  194. height: 60rpx;
  195. text-align: center;
  196. display: flex;
  197. align-items: center;
  198. justify-content: center;
  199. &:last-child {
  200. margin-left: 20rpx;
  201. }
  202. &.active {
  203. background: #2B6FFF;
  204. color: #fff;
  205. border-color: #2B6FFF;
  206. }
  207. }
  208. .num {
  209. width: 50rpx;
  210. height: 50rpx;
  211. background: rgba(43, 110, 253, 0.1);
  212. color: #2B6EFD;
  213. font-size: 30rpx;
  214. display: flex;
  215. align-items: center;
  216. justify-content: center;
  217. &.active {
  218. background: #2B6EFD;
  219. color: #FFFFFF;
  220. }
  221. }
  222. .cented-box {
  223. background: #F8F8F8;
  224. width: 100%;
  225. height: 100vh;
  226. }
  227. .Pinspeak {
  228. width: 100%;
  229. height: 92rpx;
  230. border-bottom: 1rpx solid #E0E0E0;
  231. font-size: 32rpx;
  232. font-weight: bold;
  233. color: #333333;
  234. text-indent: 30rpx;
  235. line-height: 92rpx;
  236. background: #FFFFFF;
  237. margin-top: 20rpx;
  238. padding-left: 10rpx;
  239. }
  240. .chented {
  241. width: 100%;
  242. padding-left: 30rpx;
  243. padding-right: 30rpx;
  244. background-color: #FFFFFF;
  245. .title {
  246. width: 100%;
  247. height: 110rpx;
  248. border-bottom: 1rpx solid #E0E0E0;
  249. display: flex;
  250. align-items: center;
  251. .titletext {
  252. width: 21%;
  253. height: 110rpx;
  254. font-size: 30rpx;
  255. font-weight: 400;
  256. color: #333333;
  257. line-height: 110rpx;
  258. text-indent: 10rpx;
  259. }
  260. .titletext2 {
  261. width: 71%;
  262. height: 110rpx;
  263. }
  264. .titletext-input {
  265. width: 100%;
  266. height: 110rpx;
  267. font-size: 30rpx;
  268. font-weight: 400;
  269. color: #B2B2B2;
  270. line-height: 110rpx;
  271. padding-left: 10rpx;
  272. }
  273. .titleimg {
  274. width: 8%;
  275. text-align: right;
  276. .titleimg1 {
  277. width: 16rpx;
  278. height: 36rpx;
  279. }
  280. }
  281. }
  282. }
  283. .clive {
  284. position: absolute;
  285. bottom: 32rpx;
  286. left: 30rpx;
  287. right: 30rpx;
  288. width: 690rpx;
  289. height: 88rpx;
  290. background: #2671E2;
  291. text-align: center;
  292. line-height: 88rpx;
  293. color: #FFFFFF;
  294. border-radius: 8rpx;
  295. font-size: 32rpx;
  296. }
  297. </style>