AI营销辅助 普强使用
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 

330 строки
7.6 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. this.qrCodeUrl = domain.baseUrl
  126. if(e.detail.errMsg=="getPhoneNumber:ok"){
  127. let data = {
  128. code:e.detail.code,
  129. appid:uni.getAccountInfoSync().miniProgram.appId,
  130. }
  131. uni.request({
  132. url:this.qrCodeUrl + '/code/loginSessionKey',
  133. method:"GET",
  134. data,
  135. success:(res)=> {
  136. console.log(res.data.data)
  137. let phoneNum = JSON.parse(res.data.data).phone_info.phoneNumber
  138. this.parames.phone = phoneNum
  139. if(this.parames.phone!=null && this.parames.phone!=""){
  140. if(this.parames.name.length>8){
  141. uni.showToast({
  142. icon: "none",
  143. title: "不能超过8个汉字"
  144. })
  145. }else{
  146. uni.request({
  147. url:this.qrCodeUrl + '/customer/codeAdd',
  148. method:"POST",
  149. data:this.parames,
  150. header: {
  151. 'content-type': 'application/json',
  152. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  153. },
  154. success: (addres) => {
  155. if(addres.data.code == 10000){
  156. uni.reLaunch({
  157. url:'/pages/mine/registerResult'
  158. })
  159. }else{
  160. uni.showToast({
  161. icon: "none",
  162. title: addres.data.message
  163. })
  164. }
  165. }
  166. })
  167. }
  168. }
  169. }
  170. })
  171. }else{
  172. return;
  173. }
  174. },
  175. changeSex(sex) {
  176. this.parames.sex = sex;
  177. },
  178. changeHowMany(num) {
  179. this.parames.howMany = num;
  180. },
  181. Buildingselection() {
  182. this.Showhiddenunits = true;
  183. },
  184. cancel() {
  185. this.Showhiddenunits = false;
  186. },
  187. confirm(e) {
  188. this.parames.sourceName = e[0].value;
  189. this.Showhiddenunits = false;
  190. },
  191. }
  192. };
  193. </script>
  194. <style lang="scss" scoped>
  195. .sexRadio {
  196. color: #BFBFBF;
  197. border: 1rpx solid #BFBFBF;
  198. font-size: 24upx;
  199. width: 120rpx;
  200. height: 60rpx;
  201. text-align: center;
  202. display: flex;
  203. align-items: center;
  204. justify-content: center;
  205. &:last-child {
  206. margin-left: 20rpx;
  207. }
  208. &.active {
  209. background: #2B6FFF;
  210. color: #fff;
  211. border-color: #2B6FFF;
  212. }
  213. }
  214. .num {
  215. width: 50rpx;
  216. height: 50rpx;
  217. background: rgba(43, 110, 253, 0.1);
  218. color: #2B6EFD;
  219. font-size: 30rpx;
  220. display: flex;
  221. align-items: center;
  222. justify-content: center;
  223. &.active {
  224. background: #2B6EFD;
  225. color: #FFFFFF;
  226. }
  227. }
  228. .cented-box {
  229. background: #F8F8F8;
  230. width: 100%;
  231. height: 100vh;
  232. }
  233. .Pinspeak {
  234. width: 100%;
  235. height: 92rpx;
  236. border-bottom: 1rpx solid #E0E0E0;
  237. font-size: 32rpx;
  238. font-weight: bold;
  239. color: #333333;
  240. text-indent: 30rpx;
  241. line-height: 92rpx;
  242. background: #FFFFFF;
  243. margin-top: 20rpx;
  244. padding-left: 10rpx;
  245. }
  246. .chented {
  247. width: 100%;
  248. padding-left: 30rpx;
  249. padding-right: 30rpx;
  250. background-color: #FFFFFF;
  251. .title {
  252. width: 100%;
  253. height: 110rpx;
  254. border-bottom: 1rpx solid #E0E0E0;
  255. display: flex;
  256. align-items: center;
  257. .titletext {
  258. width: 21%;
  259. height: 110rpx;
  260. font-size: 30rpx;
  261. font-weight: 400;
  262. color: #333333;
  263. line-height: 110rpx;
  264. text-indent: 10rpx;
  265. }
  266. .titletext2 {
  267. width: 71%;
  268. height: 110rpx;
  269. }
  270. .titletext-input {
  271. width: 100%;
  272. height: 110rpx;
  273. font-size: 30rpx;
  274. font-weight: 400;
  275. color: #B2B2B2;
  276. line-height: 110rpx;
  277. padding-left: 10rpx;
  278. }
  279. .titleimg {
  280. width: 8%;
  281. text-align: right;
  282. .titleimg1 {
  283. width: 16rpx;
  284. height: 36rpx;
  285. }
  286. }
  287. }
  288. }
  289. .clive {
  290. position: absolute;
  291. bottom: 32rpx;
  292. left: 30rpx;
  293. right: 30rpx;
  294. width: 690rpx;
  295. height: 88rpx;
  296. background: #2671E2;
  297. text-align: center;
  298. line-height: 88rpx;
  299. color: #FFFFFF;
  300. border-radius: 8rpx;
  301. font-size: 32rpx;
  302. }
  303. </style>