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.
 
 
 
 

555 lines
12 KiB

  1. <template>
  2. <view class="cented-box">
  3. <!-- 背景图 -->
  4. <image class="bg-img" src="@/static/images/screenCode/screen_bg.png" mode=""></image>
  5. <!-- 头部 -->
  6. <view class="header">
  7. <view class="lside">
  8. <text class="text top">访客入场</text>
  9. <text class="text">登记表</text>
  10. </view>
  11. <view class="rside">
  12. <image src="@/static/images/screenCode/screen_note.png" mode=""></image>
  13. </view>
  14. </view>
  15. <!-- 表单 -->
  16. <view class="container">
  17. <view class="chented">
  18. <view class="title">
  19. <view class="titletext">客户姓名</view>
  20. <view class="titletext2">
  21. <input maxlength="10" class="titletext-input" style="color: #333333;" v-model="parames.name"
  22. placeholder-class="titletext-input" placeholder-style="color:#B2B2B2;" type="text"
  23. placeholder="请输入客户姓名(必填)" />
  24. </view>
  25. <view class="titleimg"></view>
  26. </view>
  27. </view>
  28. <view class="chented">
  29. <view class="title">
  30. <view class="titletext">客户性别</view>
  31. <!-- <view class="titletext2 displayclick"
  32. style="display: flex;align-items: center;padding-left: 10rpx;">
  33. <view class="sexRadio" @click="changeSex(1)" :class="{active:parames.sex == 1}">男士</view>
  34. <view class="sexRadio" @click="changeSex(2)" :class="{active:parames.sex == 2}">女士</view>
  35. </view> -->
  36. <u-radio-group v-model="parames.sex">
  37. <view style="display: flex;align-items: center;">
  38. <u-radio :name="1" shape="circle">男士</u-radio>
  39. <u-radio :name="2" shape="circle">女士</u-radio>
  40. </view>
  41. </u-radio-group>
  42. </view>
  43. <view class="title">
  44. <view class="titletext">到访人数</view>
  45. <view class="titletext2" style="display: flex;align-items: center;justify-content: space-around;">
  46. <view class="num" v-for="i in 4" :key="i" :class="{active:parames.howMany == i+1}"
  47. @click="changeHowMany(i+1)">
  48. {{i + 1}}
  49. </view>
  50. </view>
  51. </view>
  52. <!-- <view class="title" @click="Buildingselection()">
  53. <view class="titletext">到访途径</view>
  54. <view class="titletext2"
  55. style="font-size: 30rpx;font-weight: 400;color: #B2B2B2;line-height: 110rpx;padding-left: 10rpx;">
  56. <text v-if="parames.sourceName" style="color: #333333;">{{parames.sourceName}}</text>
  57. <text v-else>请选择客户来源</text>
  58. </view>
  59. <view class="titleimg">
  60. <image class="titleimg1" src="../../static/images/arrow.png" mode=""></image>
  61. </view>
  62. </view> -->
  63. </view>
  64. <button class="clive" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber"
  65. v-if="verifyPass">提交</button>
  66. <view class="clive" @click="save" v-else>提交</view>
  67. <view class="dengji">
  68. <view class="d-lside">
  69. 入场登记
  70. </view>
  71. <view class="d-rside">
  72. <view class="top">
  73. <text class="t-time">{{$u.timeFormat(new Date(), 'hh:MM:ss')}}</text>
  74. <text class="date">{{$u.timeFormat(new Date(), 'yyyy/mm/dd')}}</text>
  75. </view>
  76. <view class="address" style="font-size: 36rpx;">{{pname}}</view>
  77. </view>
  78. </view>
  79. <view class="bottoms">
  80. <u-checkbox v-model="parames.checked">我已阅读并同意</u-checkbox>
  81. <text class="books" @click="openModel">《{{tit}}》</text>
  82. </view>
  83. </view>
  84. <u-modal class="aaa" v-model="modelShow" :title="tit" width="720rpx" :mask-close-able="true"
  85. :show-confirm-button="false">
  86. <view class="bbb">
  87. <u-icon class="close" @click="readOk" name="close-circle" color="#CCCCCC" size="60"></u-icon>
  88. </view>
  89. <view class="slot-content" style="padding:0 20rpx;height: 800rpx;overflow-y: auto;">
  90. <view class="cont">
  91. <scroll-view style="height: 800rpx;" scroll-y="true">
  92. <rich-text :nodes="content"></rich-text>
  93. </scroll-view>
  94. </view>
  95. </view>
  96. </u-modal>
  97. <view class="tips">
  98. 疫情防控 人人有责
  99. </view>
  100. <u-select :mask-close-able="false" v-model="Showhiddenunits" mode="single-column" :list="list" @cancel="cancel"
  101. @confirm="confirm"></u-select>
  102. </view>
  103. </template>
  104. <script>
  105. var app = getApp();
  106. var config = require("@/config");
  107. let domain = require("@/utils/domain")
  108. export default {
  109. data() {
  110. return {
  111. Showhiddenunits: false,
  112. list: [{
  113. label: '自然到访',
  114. value: '自然到访'
  115. },
  116. {
  117. label: '渠道推荐',
  118. value: '渠道推荐'
  119. },
  120. ],
  121. parames: {
  122. name: '',
  123. sex: 1,
  124. // sourceName: "自然到访",
  125. howMany: 1,
  126. projectId: '',
  127. phone: '',
  128. projectId: '',
  129. projectName: 'xxx',
  130. version: "",
  131. checked: true,
  132. },
  133. pname: "",
  134. daitiReceptionobj: {},
  135. verifyPass: false,
  136. qrCodeUrl: '',
  137. // 是否同意隐私协议
  138. content: "",
  139. modelShow: false,
  140. tit: "",
  141. };
  142. },
  143. onLoad(options) {
  144. console.log(options)
  145. const sceneStr = decodeURIComponent(options.scene);
  146. this.parames.projectId = sceneStr
  147. this.initFetch()
  148. },
  149. watch: {
  150. parames: {
  151. deep: true,
  152. handler(newV) {
  153. if (newV.checked) {
  154. if (newV.name.length != 0) {
  155. this.verifyPass = true;
  156. } else {
  157. this.verifyPass = false;
  158. }
  159. } else {
  160. this.verifyPass = false;
  161. }
  162. // if (newV.name.length == 0) {
  163. // this.verifyPass = false;
  164. // } else {
  165. // this.verifyPass = true;
  166. // }
  167. }
  168. }
  169. },
  170. methods: {
  171. initFetch() {
  172. let appid = uni.getAccountInfoSync().miniProgram.appId;
  173. uni.request({
  174. url: config.service.privacyAgr,
  175. method: "GET",
  176. data: {
  177. id: appid,
  178. projectId: this.parames.projectId
  179. },
  180. header: {
  181. 'content-type': 'application/json',
  182. 'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
  183. },
  184. success: (res) => {
  185. this.content = res.data.data.content
  186. this.tit = res.data.data.title
  187. this.parames.version = res.data.data.version
  188. this.pname = res.data.data.projectName
  189. }
  190. })
  191. },
  192. openModel() {
  193. this.modelShow = true;
  194. },
  195. readOk() {
  196. this.parames.checked = true;
  197. this.modelShow = false;
  198. },
  199. save() {
  200. if (this.parames.checked == false) {
  201. uni.showToast({
  202. icon: "none",
  203. title: "请阅读并同意用户隐私协议"
  204. })
  205. return;
  206. } else {
  207. if (this.parames.name.length == 0) {
  208. uni.showToast({
  209. icon: "none",
  210. title: "姓名不能为空"
  211. })
  212. return;
  213. }
  214. }
  215. },
  216. getPhoneNumber(e) {
  217. this.qrCodeUrl = domain.baseUrl
  218. if (e.detail.errMsg == "getPhoneNumber:ok") {
  219. let data = {
  220. code: e.detail.code,
  221. appid: uni.getAccountInfoSync().miniProgram.appId,
  222. }
  223. uni.request({
  224. url: this.qrCodeUrl + '/code/loginSessionKey',
  225. method: "GET",
  226. data,
  227. success: (res) => {
  228. console.log(res.data.data)
  229. let phoneNum = JSON.parse(res.data.data).phone_info.phoneNumber
  230. this.parames.phone = phoneNum
  231. if (this.parames.phone != null && this.parames.phone != "") {
  232. if (this.parames.name.length > 8) {
  233. uni.showToast({
  234. icon: "none",
  235. title: "不能超过8个汉字"
  236. })
  237. } else {
  238. uni.request({
  239. url: this.qrCodeUrl + '/customer/codeAdd',
  240. method: "POST",
  241. data: this.parames,
  242. header: {
  243. 'content-type': 'application/json',
  244. 'Authorization': 'Bearer ' + uni.getStorageSync(
  245. 'weapp_session_login_data').token
  246. },
  247. success: (addres) => {
  248. if (addres.data.code == 10000) {
  249. uni.reLaunch({
  250. url: '/pages/mine/registerResult'
  251. })
  252. } else {
  253. uni.showToast({
  254. icon: "none",
  255. title: addres.data.message
  256. })
  257. }
  258. }
  259. })
  260. }
  261. }
  262. }
  263. })
  264. } else {
  265. return;
  266. }
  267. },
  268. changeSex(sex) {
  269. this.parames.sex = sex;
  270. },
  271. changeHowMany(num) {
  272. this.parames.howMany = num;
  273. },
  274. Buildingselection() {
  275. this.Showhiddenunits = true;
  276. },
  277. cancel() {
  278. this.Showhiddenunits = false;
  279. },
  280. confirm(e) {
  281. this.parames.sourceName = e[0].value;
  282. this.Showhiddenunits = false;
  283. },
  284. }
  285. };
  286. </script>
  287. <style lang="scss" scoped>
  288. /deep/ .u-model-title {
  289. padding-top: 0px !important;
  290. padding: 48rpx 0 24rpx !important;
  291. }
  292. .aaa {
  293. position: relative;
  294. .bbb {
  295. position: absolute;
  296. top: 8rpx;
  297. right: 8rpx;
  298. }
  299. }
  300. .cented-box {
  301. position: relative;
  302. padding: 0 0 50rpx 0;
  303. width: 100vw;
  304. min-height: calc(100vh - var(--window-top));
  305. display: flex;
  306. flex-direction: column;
  307. .bg-img {
  308. width: 100%;
  309. height: 100%;
  310. z-index: -1;
  311. position: absolute;
  312. }
  313. .header {
  314. margin: 0 0 40rpx 0;
  315. width: 100%;
  316. display: flex;
  317. .lside {
  318. flex: 1;
  319. display: flex;
  320. flex-direction: column;
  321. justify-content: center;
  322. align-items: center;
  323. .text {
  324. color: #fff;
  325. font-size: 100rpx;
  326. font-weight: 800;
  327. }
  328. .top {
  329. font-size: 76rpx;
  330. }
  331. }
  332. .rside {
  333. flex: 1;
  334. display: flex;
  335. justify-content: center;
  336. align-items: center;
  337. image {
  338. width: 306rpx;
  339. height: 302rpx;
  340. }
  341. }
  342. }
  343. .container {
  344. position: relative;
  345. margin: 0 auto;
  346. width: 670rpx;
  347. height: 900rpx;
  348. background: #fff;
  349. border-radius: 16rpx;
  350. .chented {
  351. padding: 0 30rpx;
  352. width: 100%;
  353. .title {
  354. width: 100%;
  355. height: 110rpx;
  356. border-bottom: 1rpx solid #E0E0E0;
  357. display: flex;
  358. align-items: center;
  359. .titletext {
  360. width: 21%;
  361. font-size: 30rpx;
  362. font-weight: 400;
  363. color: #333333;
  364. }
  365. .titletext2 {
  366. width: 71%;
  367. }
  368. .titletext-input {
  369. width: 100%;
  370. height: 110rpx;
  371. font-size: 30rpx;
  372. font-weight: 400;
  373. color: #B2B2B2;
  374. line-height: 110rpx;
  375. padding-left: 10rpx;
  376. }
  377. .titleimg {
  378. width: 8%;
  379. text-align: right;
  380. .titleimg1 {
  381. width: 16rpx;
  382. height: 36rpx;
  383. }
  384. }
  385. }
  386. }
  387. .clive {
  388. margin: 100rpx auto 0;
  389. width: 610rpx;
  390. height: 88rpx;
  391. background: #2671E2;
  392. text-align: center;
  393. line-height: 88rpx;
  394. color: #FFFFFF;
  395. border-radius: 8rpx;
  396. font-size: 32rpx;
  397. }
  398. .dengji {
  399. margin: 60rpx 0 0 0;
  400. padding: 0 30rpx;
  401. width: 100%;
  402. display: flex;
  403. .d-lside {
  404. padding: 0 20rpx;
  405. height: 88rpx;
  406. display: flex;
  407. align-items: center;
  408. border-right: 1rpx solid #E0E0E0;
  409. font-size: 36rpx;
  410. font-weight: 500;
  411. }
  412. .d-rside {
  413. padding: 0 20rpx;
  414. height: 88rpx;
  415. display: flex;
  416. flex-direction: column;
  417. .top {
  418. display: flex;
  419. align-items: baseline;
  420. font-size: 24rpx;
  421. color: #333330;
  422. .t-time {
  423. margin-right: 20rpx;
  424. font-size: 36rpx;
  425. font-weight: 500;
  426. color: #333331;
  427. }
  428. }
  429. }
  430. }
  431. .bottoms {
  432. position: absolute;
  433. bottom: 30rpx;
  434. padding: 0 30rpx;
  435. width: 100%;
  436. .books {
  437. margin-left: -24rpx;
  438. color: #2671E2;
  439. font-size: 30rpx;
  440. }
  441. }
  442. }
  443. .tips {
  444. margin: 40rpx 0 0 0;
  445. width: 100%;
  446. text-align: center;
  447. color: #fff;
  448. font-size: 30rpx;
  449. }
  450. }
  451. .sexRadio {
  452. color: #BFBFBF;
  453. border: 1rpx solid #BFBFBF;
  454. font-size: 24upx;
  455. width: 120rpx;
  456. height: 60rpx;
  457. text-align: center;
  458. display: flex;
  459. align-items: center;
  460. justify-content: center;
  461. &:last-child {
  462. margin-left: 20rpx;
  463. }
  464. &.active {
  465. background: #2B6FFF;
  466. color: #fff;
  467. border-color: #2B6FFF;
  468. }
  469. }
  470. .num {
  471. width: 74rpx;
  472. height: 74rpx;
  473. border-radius: 8rpx;
  474. background: rgba(43, 110, 253, 0.1);
  475. color: #2B6EFD;
  476. font-size: 32rpx;
  477. display: flex;
  478. align-items: center;
  479. justify-content: center;
  480. &.active {
  481. background: #2B6EFD;
  482. color: #FFFFFF;
  483. }
  484. }
  485. .Pinspeak {
  486. width: 100%;
  487. height: 92rpx;
  488. border-bottom: 1rpx solid #E0E0E0;
  489. font-size: 32rpx;
  490. font-weight: bold;
  491. color: #333333;
  492. text-indent: 30rpx;
  493. line-height: 92rpx;
  494. background: #FFFFFF;
  495. margin-top: 20rpx;
  496. padding-left: 10rpx;
  497. }
  498. </style>