No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 

506 líneas
11 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">望京SOHO</view>
  77. </view>
  78. </view>
  79. <view class="bottoms">
  80. <u-checkbox v-model="checked">我已阅读并同意</u-checkbox>
  81. <text class="books" @click="openModel">《用户隐私协议》</text>
  82. </view>
  83. </view>
  84. <u-modal v-model="modelShow" @confirm="readOk">
  85. <view class="slot-content">
  86. <rich-text :nodes="content"></rich-text>
  87. </view>
  88. </u-modal>
  89. <view class="tips">
  90. 疫情防控 人人有责
  91. </view>
  92. <u-select :mask-close-able="false" v-model="Showhiddenunits" mode="single-column" :list="list" @cancel="cancel"
  93. @confirm="confirm"></u-select>
  94. </view>
  95. </template>
  96. <script>
  97. var util = require("../../utils/util.js");
  98. var config = require("../../config");
  99. var app = getApp();
  100. var config = require("@/config");
  101. let domain = require("@/utils/domain")
  102. export default {
  103. data() {
  104. return {
  105. Showhiddenunits: false,
  106. list: [{
  107. label: '自然到访',
  108. value: '自然到访'
  109. },
  110. {
  111. label: '渠道推荐',
  112. value: '渠道推荐'
  113. },
  114. ],
  115. parames: {
  116. name: '',
  117. sex: 1,
  118. sourceName: null,
  119. howMany: 1,
  120. projectId: '',
  121. phone: '',
  122. projectId: '',
  123. projectName: 'xxx'
  124. },
  125. daitiReceptionobj: {},
  126. verifyPass: false,
  127. qrCodeUrl: '',
  128. checked: false, // 是否同意隐私协议
  129. content:"",
  130. modelShow:false,
  131. };
  132. },
  133. onLoad(options) {
  134. const sceneStr = decodeURIComponent(options.scene);
  135. console.log(options)
  136. this.parames.projectId = sceneStr
  137. this.initFetch()
  138. },
  139. watch: {
  140. parames: {
  141. deep: true,
  142. handler(newV) {
  143. if (newV.name.length == 0) {
  144. this.verifyPass = false;
  145. } else {
  146. this.verifyPass = true;
  147. }
  148. }
  149. }
  150. },
  151. methods: {
  152. initFetch(){
  153. let appid = uni.getAccountInfoSync().miniProgram.appId;
  154. uni.request({
  155. url: config.service.privacyAgr,
  156. method: "GET",
  157. data:{
  158. id:appid
  159. },
  160. header: {
  161. 'content-type': 'application/json',
  162. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  163. },
  164. success: (res) => {
  165. console.log(res)
  166. }
  167. })
  168. },
  169. openModel(){
  170. this.modelShow = true;
  171. },
  172. readOk(){
  173. this.checked = true;
  174. },
  175. save() {
  176. if (this.parames.name.length == 0) {
  177. uni.showToast({
  178. icon: "none",
  179. title: "姓名不能为空"
  180. })
  181. return;
  182. }
  183. },
  184. getPhoneNumber(e) {
  185. this.qrCodeUrl = domain.baseUrl
  186. if (e.detail.errMsg == "getPhoneNumber:ok") {
  187. let data = {
  188. code: e.detail.code,
  189. appid: uni.getAccountInfoSync().miniProgram.appId,
  190. }
  191. uni.request({
  192. url: this.qrCodeUrl + '/code/loginSessionKey',
  193. method: "GET",
  194. data,
  195. success: (res) => {
  196. console.log(res.data.data)
  197. let phoneNum = JSON.parse(res.data.data).phone_info.phoneNumber
  198. this.parames.phone = phoneNum
  199. if (this.parames.phone != null && this.parames.phone != "") {
  200. if (this.parames.name.length > 8) {
  201. uni.showToast({
  202. icon: "none",
  203. title: "不能超过8个汉字"
  204. })
  205. } else {
  206. uni.request({
  207. url: this.qrCodeUrl + '/customer/codeAdd',
  208. method: "POST",
  209. data: this.parames,
  210. header: {
  211. 'content-type': 'application/json',
  212. 'Access-Token': uni.getStorageSync(
  213. 'weapp_session_login_data').token
  214. },
  215. success: (addres) => {
  216. if (addres.data.code == 10000) {
  217. uni.reLaunch({
  218. url: '/pages/mine/registerResult'
  219. })
  220. } else {
  221. uni.showToast({
  222. icon: "none",
  223. title: addres.data.message
  224. })
  225. }
  226. }
  227. })
  228. }
  229. }
  230. }
  231. })
  232. } else {
  233. return;
  234. }
  235. },
  236. changeSex(sex) {
  237. this.parames.sex = sex;
  238. },
  239. changeHowMany(num) {
  240. this.parames.howMany = num;
  241. },
  242. Buildingselection() {
  243. this.Showhiddenunits = true;
  244. },
  245. cancel() {
  246. this.Showhiddenunits = false;
  247. },
  248. confirm(e) {
  249. this.parames.sourceName = e[0].value;
  250. this.Showhiddenunits = false;
  251. },
  252. }
  253. };
  254. </script>
  255. <style lang="scss" scoped>
  256. .cented-box {
  257. position: relative;
  258. padding: 0 0 50rpx 0;
  259. width: 100vw;
  260. min-height: calc(100vh - var(--window-top));
  261. display: flex;
  262. flex-direction: column;
  263. .bg-img {
  264. width: 100%;
  265. height: 100%;
  266. z-index: -1;
  267. position: absolute;
  268. }
  269. .header {
  270. margin: 0 0 40rpx 0;
  271. width: 100%;
  272. display: flex;
  273. .lside {
  274. flex: 1;
  275. display: flex;
  276. flex-direction: column;
  277. justify-content: center;
  278. align-items: center;
  279. .text {
  280. color: #fff;
  281. font-size: 100rpx;
  282. font-weight: 800;
  283. }
  284. .top {
  285. font-size: 76rpx;
  286. }
  287. }
  288. .rside {
  289. flex: 1;
  290. display: flex;
  291. justify-content: center;
  292. align-items: center;
  293. image {
  294. width: 306rpx;
  295. height: 302rpx;
  296. }
  297. }
  298. }
  299. .container {
  300. position: relative;
  301. margin: 0 auto;
  302. width: 670rpx;
  303. height: 900rpx;
  304. background: #fff;
  305. border-radius: 16rpx;
  306. .chented {
  307. padding: 0 30rpx;
  308. width: 100%;
  309. .title {
  310. width: 100%;
  311. height: 110rpx;
  312. border-bottom: 1rpx solid #E0E0E0;
  313. display: flex;
  314. align-items: center;
  315. .titletext {
  316. width: 21%;
  317. font-size: 30rpx;
  318. font-weight: 400;
  319. color: #333333;
  320. }
  321. .titletext2 {
  322. width: 71%;
  323. }
  324. .titletext-input {
  325. width: 100%;
  326. height: 110rpx;
  327. font-size: 30rpx;
  328. font-weight: 400;
  329. color: #B2B2B2;
  330. line-height: 110rpx;
  331. padding-left: 10rpx;
  332. }
  333. .titleimg {
  334. width: 8%;
  335. text-align: right;
  336. .titleimg1 {
  337. width: 16rpx;
  338. height: 36rpx;
  339. }
  340. }
  341. }
  342. }
  343. .clive {
  344. margin: 100rpx auto 0;
  345. width: 610rpx;
  346. height: 88rpx;
  347. background: #2671E2;
  348. text-align: center;
  349. line-height: 88rpx;
  350. color: #FFFFFF;
  351. border-radius: 8rpx;
  352. font-size: 32rpx;
  353. }
  354. .dengji {
  355. margin: 60rpx 0 0 0;
  356. padding: 0 30rpx;
  357. width: 100%;
  358. display: flex;
  359. .d-lside {
  360. padding: 0 20rpx;
  361. height: 88rpx;
  362. display: flex;
  363. align-items: center;
  364. border-right: 1rpx solid #E0E0E0;
  365. font-size: 36rpx;
  366. font-weight: 500;
  367. }
  368. .d-rside {
  369. padding: 0 20rpx;
  370. height: 88rpx;
  371. display: flex;
  372. flex-direction: column;
  373. .top {
  374. display: flex;
  375. align-items: baseline;
  376. font-size: 24rpx;
  377. color: #333330;
  378. .t-time {
  379. margin-right: 20rpx;
  380. font-size: 36rpx;
  381. font-weight: 500;
  382. color: #333331;
  383. }
  384. }
  385. }
  386. }
  387. .bottoms {
  388. position: absolute;
  389. bottom: 30rpx;
  390. padding: 0 30rpx;
  391. width: 100%;
  392. .books {
  393. margin-left: -24rpx;
  394. color: #2671E2;
  395. font-size: 30rpx;
  396. }
  397. }
  398. }
  399. .tips {
  400. margin: 40rpx 0 0 0;
  401. width: 100%;
  402. text-align: center;
  403. color: #fff;
  404. font-size: 30rpx;
  405. }
  406. }
  407. .sexRadio {
  408. color: #BFBFBF;
  409. border: 1rpx solid #BFBFBF;
  410. font-size: 24upx;
  411. width: 120rpx;
  412. height: 60rpx;
  413. text-align: center;
  414. display: flex;
  415. align-items: center;
  416. justify-content: center;
  417. &:last-child {
  418. margin-left: 20rpx;
  419. }
  420. &.active {
  421. background: #2B6FFF;
  422. color: #fff;
  423. border-color: #2B6FFF;
  424. }
  425. }
  426. .num {
  427. width: 74rpx;
  428. height: 74rpx;
  429. border-radius: 8rpx;
  430. background: rgba(43, 110, 253, 0.1);
  431. color: #2B6EFD;
  432. font-size: 32rpx;
  433. display: flex;
  434. align-items: center;
  435. justify-content: center;
  436. &.active {
  437. background: #2B6EFD;
  438. color: #FFFFFF;
  439. }
  440. }
  441. .Pinspeak {
  442. width: 100%;
  443. height: 92rpx;
  444. border-bottom: 1rpx solid #E0E0E0;
  445. font-size: 32rpx;
  446. font-weight: bold;
  447. color: #333333;
  448. text-indent: 30rpx;
  449. line-height: 92rpx;
  450. background: #FFFFFF;
  451. margin-top: 20rpx;
  452. padding-left: 10rpx;
  453. }
  454. </style>