cm-ross-popup.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. <template name="cm-parameter">
  2. <!-- 相关规格 -->
  3. <tui-bottom-popup :radius="false" :show="popupShow">
  4. <view class="tui-popup-box clearfix">
  5. <view class="tui-popup-close" @click.stop="hidePopup">
  6. <text class="iconfont icon-iconfontguanbi"></text>
  7. </view>
  8. <view class="tui-popup-mssg">
  9. <view class="tui-popup-mssg-img">
  10. <image src="https://img.caimei365.com/group1/M00/00/55/rB-lF2MMhUWAC7vAAAGQFrJJQrw679.jpg">
  11. </view>
  12. <view class="tui-popup-mssg-text">
  13. <view class="tui-popup-mssg-text-t">
  14. <view class="text">对西班牙Ross品牌感兴趣?</view>
  15. <view class="text">西班牙Ross商品</view>
  16. </view>
  17. <view class="tui-popup-mssg-text-b">
  18. <view class="text">
  19. <text class="iconfont icon-xiangxia1"></text>
  20. </view>
  21. <view class="text">请留下您的姓名和手机号,采美会安排咨询顾问联系您!</view>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="tui-popup-main" :style="{ paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">
  26. <view class="tui-popup-from">
  27. <input
  28. class="input"
  29. type="text"
  30. v-model="consultParams.consultName"
  31. @input="handleInputName"
  32. placeholder="请输入名字"
  33. placeholder-style="color:#FFFFFF;"
  34. maxlength="10"
  35. cursor-spacing="40"
  36. />
  37. </view>
  38. <view class="tui-popup-from none">
  39. <input
  40. class="input"
  41. type="text"
  42. v-model="consultParams.consultMobile"
  43. @input="handleInputPhone"
  44. placeholder="请输入手机号"
  45. placeholder-style="color:#FFFFFF;"
  46. maxlength="11"
  47. cursor-spacing="40"
  48. />
  49. </view>
  50. </view>
  51. <view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">
  52. <view class="tui-modal-flex">
  53. <button class="tui-modal-button" :class="isDisabled ? 'disabled' : ''" @click="handleSubmit">
  54. 提交
  55. </button>
  56. </view>
  57. <view class="tui-modal-text">
  58. <view class="tui-modal-left" @click.stop="this.$api.navigateTo('/pages/login/register-select')">立即注册</view>
  59. <view class="tui-modal-right" @click.stop="this.$api.navigateTo('/pages/login/login')">登录</view>
  60. </view>
  61. </view>
  62. </view>
  63. </tui-bottom-popup>
  64. </template>
  65. <script>
  66. import { mapState, mapMutations } from 'vuex'
  67. export default {
  68. name: 'cm-ross-popup',
  69. props: {
  70. popupShow: {
  71. type: Boolean,
  72. default: true
  73. }
  74. },
  75. data() {
  76. return {
  77. userId: 0, // 用户Id
  78. consultParams: {
  79. ip:'',
  80. createTime:'',
  81. consultMobile: '',
  82. consultName: '',
  83. isClick:1
  84. },
  85. isDisabled: true
  86. }
  87. },
  88. created() {
  89. this.initData()
  90. },
  91. computed: {
  92. ...mapState(['hasLogin'])
  93. },
  94. methods: {
  95. async initData(data) {
  96. const userInfo = await this.$api.getStorage()
  97. this.userId = userInfo.userId ? userInfo.userId : 0
  98. },
  99. handleInputName(e) {
  100. this.consultParams.name = e.detail.value
  101. this.handldeCheckInput()
  102. },
  103. handleInputPhone(e) {
  104. this.consultParams.phone = e.detail.value
  105. this.handldeCheckInput()
  106. },
  107. handldeCheckInput() {
  108. if (this.consultParams.name !== '' && this.consultParams.phone !== '') {
  109. this.isDisabled = false
  110. } else {
  111. this.isDisabled = true
  112. }
  113. },
  114. handleSubmit() {
  115. // 提交联系人信息
  116. if (this.isDisabled) {
  117. return
  118. }
  119. const reg = RegExp(/^1\d{10}$/)
  120. if(!reg.test(this.consultParams.consultMobile)){
  121. this.$util.msg('请输入正确的手机号');
  122. return
  123. }
  124. this.userInformationInsertRoos(this.consultParams)
  125. },
  126. userInformationInsertRoos(params){
  127. // 游客关闭广告弹窗
  128. this.UserService.userInformationInsertRoos(params)
  129. .then(response => {
  130. this.$parent.showRossHtml = false
  131. })
  132. .catch(error => {
  133. console.log('游客关闭广告弹窗失败~')
  134. })
  135. },
  136. hidePopup() {
  137. this.userInformationInsertRoos(this.consultParams)
  138. }
  139. }
  140. }
  141. </script>
  142. <style lang="scss">
  143. .tui-popup-box {
  144. width: 100%;
  145. height: 852rpx;
  146. background: linear-gradient(0deg, #FFA86E, #FF5B00);
  147. padding:30rpx 30rpx 75rpx 30rpx;
  148. box-sizing: border-box;
  149. .tui-popup-close{
  150. width: 80rpx;
  151. height: 80rpx;
  152. line-height: 80rpx;
  153. text-align: center;
  154. position: absolute;
  155. top: 0;
  156. right: 0;
  157. .icon-iconfontguanbi{
  158. color: #ffffff;
  159. font-size: 40rpx;
  160. }
  161. }
  162. .tui-popup-mssg{
  163. width: 100%;
  164. height: 220rpx;
  165. margin-bottom: 75rpx;
  166. .tui-popup-mssg-img{
  167. width: 220rpx;
  168. height: 220rpx;
  169. float: left;
  170. image{
  171. width: 220rpx;
  172. height: 220rpx;
  173. display: block;
  174. }
  175. }
  176. .tui-popup-mssg-text{
  177. width: 470rpx;
  178. height: 100%;
  179. box-sizing: border-box;
  180. padding: 0 0 0 30rpx;
  181. float: left;
  182. .tui-popup-mssg-text-t{
  183. width: 100%;
  184. height: auto;
  185. margin-bottom: 30rpx;
  186. .text{
  187. font-size: 30rpx;
  188. height: 52rpx;
  189. line-height: 52rpx;
  190. color: #ffffff;
  191. }
  192. }
  193. .tui-popup-mssg-text-b{
  194. width: 100%;
  195. height: auto;
  196. .text{
  197. font-size: 18rpx;
  198. line-height: 40rpx;
  199. color: #ffffff;
  200. .icon-xiangxia1{
  201. color: rgba(255, 255, 255, .7);
  202. font-size: 36rpx;
  203. }
  204. }
  205. }
  206. }
  207. }
  208. .tui-popup-main{
  209. width: 100%;
  210. height: auto;
  211. .tui-popup-from{
  212. width: 100%;
  213. height: 80rpx;
  214. margin-bottom: 30rpx;
  215. &.none{
  216. margin-bottom: 0;
  217. }
  218. .input{
  219. width: 100%;
  220. height: 80rpx;
  221. box-sizing: border-box;
  222. line-height: 80rpx;
  223. font-size: 28rpx;
  224. color: #ffffff;
  225. border-bottom: 1px solid #ffffff;
  226. }
  227. }
  228. }
  229. }
  230. .tui-popup-btn {
  231. width: 100%;
  232. float: left;
  233. .tui-modal-flex {
  234. width: 100%;
  235. height: 84rpx;
  236. margin-top: 40rpx;
  237. display: flex;
  238. .tui-modal-button {
  239. flex: 1;
  240. line-height: 84rpx;
  241. font-size: $font-size-28;
  242. text-align: center;
  243. border-radius: 42rpx;
  244. padding: 0;
  245. margin: 0 15rpx;
  246. box-sizing: border-box;
  247. background: #202020;
  248. color: #ffffff;
  249. &.disabled {
  250. background: #cbcbcb;
  251. }
  252. }
  253. }
  254. .tui-modal-text{
  255. width: 100%;
  256. height: 68rpx;
  257. box-sizing: border-box;
  258. padding: 0 30rpx;
  259. .tui-modal-left{
  260. float: left;
  261. line-height: 68rpx;
  262. font-size: 28rpx;
  263. color: #ffffff;
  264. }
  265. .tui-modal-right{
  266. float: right;
  267. line-height: 68rpx;
  268. font-size: 28rpx;
  269. color: #ffffff;
  270. }
  271. }
  272. }
  273. </style>