選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

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