123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275 |
- <template name="cm-parameter">
- <!-- 相关规格 -->
- <tui-bottom-popup :radius="false" :show="popupShow">
- <view class="tui-popup-box clearfix">
- <view class="tui-popup-close" @click.stop="hidePopup">
- <text class="iconfont icon-iconfontguanbi"></text>
- </view>
- <view class="tui-popup-mssg">
- <view class="tui-popup-mssg-img">
- <image src="https://img.caimei365.com/group1/M00/00/55/rB-lF2MMhUWAC7vAAAGQFrJJQrw679.jpg">
- </view>
- <view class="tui-popup-mssg-text">
- <view class="tui-popup-mssg-text-t">
- <view class="text">对西班牙Ross品牌感兴趣?</view>
- <view class="text">西班牙Ross商品</view>
- </view>
- <view class="tui-popup-mssg-text-b">
- <view class="text">
- <text class="iconfont icon-xiangxia1"></text>
- </view>
- <view class="text">请留下您的姓名和手机号,采美会安排咨询顾问联系您!</view>
- </view>
- </view>
- </view>
- <view class="tui-popup-main" :style="{ paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">
- <view class="tui-popup-from">
- <input
- class="input"
- type="text"
- v-model="consultParams.consultName"
- @input="handleInputName"
- placeholder="请输入名字"
- placeholder-style="color:#FFFFFF;"
- maxlength="10"
- cursor-spacing="40"
- />
- </view>
- <view class="tui-popup-from none">
- <input
- class="input"
- type="text"
- v-model="consultParams.consultMobile"
- @input="handleInputPhone"
- placeholder="请输入手机号"
- placeholder-style="color:#FFFFFF;"
- maxlength="11"
- cursor-spacing="40"
- />
- </view>
- </view>
- <view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">
- <view class="tui-modal-flex">
- <button class="tui-modal-button" :class="isDisabled ? 'disabled' : ''" @click="handleSubmit">
- 提交
- </button>
- </view>
- <view class="tui-modal-text">
- <view class="tui-modal-left" @click.stop="this.$api.navigateTo('/pages/login/register-select')">立即注册</view>
- <view class="tui-modal-right" @click.stop="this.$api.navigateTo('/pages/login/login')">登录</view>
- </view>
- </view>
- </view>
- </tui-bottom-popup>
- </template>
- <script>
- import { mapState, mapMutations } from 'vuex'
- export default {
- name: 'cm-ross-popup',
- props: {
- popupShow: {
- type: Boolean,
- default: true
- }
- },
- data() {
- return {
- userId: 0, // 用户Id
- consultParams: {
- ip:'',
- createTime:'',
- consultMobile: '',
- consultName: '',
- isClick:1
- },
- isDisabled: true
- }
- },
- created() {
- this.initData()
- },
- computed: {
- ...mapState(['hasLogin'])
- },
- methods: {
- async initData(data) {
- const userInfo = await this.$api.getStorage()
- this.userId = userInfo.userId ? userInfo.userId : 0
- },
- handleInputName(e) {
- this.consultParams.name = e.detail.value
- this.handldeCheckInput()
- },
- handleInputPhone(e) {
- this.consultParams.phone = e.detail.value
- this.handldeCheckInput()
- },
- handldeCheckInput() {
- if (this.consultParams.name !== '' && this.consultParams.phone !== '') {
- this.isDisabled = false
- } else {
- this.isDisabled = true
- }
- },
- handleSubmit() {
- // 提交联系人信息
- if (this.isDisabled) {
- return
- }
- const reg = RegExp(/^1\d{10}$/)
- if(!reg.test(this.consultParams.consultMobile)){
- this.$util.msg('请输入正确的手机号');
- return
- }
- this.userInformationInsertRoos(this.consultParams)
- },
- userInformationInsertRoos(params){
- // 游客关闭广告弹窗
- this.UserService.userInformationInsertRoos(params)
- .then(response => {
- this.$parent.showRossHtml = false
- })
- .catch(error => {
- console.log('游客关闭广告弹窗失败~')
- })
- },
- hidePopup() {
- this.userInformationInsertRoos(this.consultParams)
- }
- }
- }
- </script>
- <style lang="scss">
- .tui-popup-box {
- width: 100%;
- height: 852rpx;
- background: linear-gradient(0deg, #FFA86E, #FF5B00);
- padding:30rpx 30rpx 75rpx 30rpx;
- box-sizing: border-box;
- .tui-popup-close{
- width: 80rpx;
- height: 80rpx;
- line-height: 80rpx;
- text-align: center;
- position: absolute;
- top: 0;
- right: 0;
- .icon-iconfontguanbi{
- color: #ffffff;
- font-size: 40rpx;
- }
- }
- .tui-popup-mssg{
- width: 100%;
- height: 220rpx;
- margin-bottom: 75rpx;
- .tui-popup-mssg-img{
- width: 220rpx;
- height: 220rpx;
- float: left;
- image{
- width: 220rpx;
- height: 220rpx;
- display: block;
- }
- }
- .tui-popup-mssg-text{
- width: 470rpx;
- height: 100%;
- box-sizing: border-box;
- padding: 0 0 0 30rpx;
- float: left;
- .tui-popup-mssg-text-t{
- width: 100%;
- height: auto;
- margin-bottom: 30rpx;
- .text{
- font-size: 30rpx;
- height: 52rpx;
- line-height: 52rpx;
- color: #ffffff;
- }
- }
- .tui-popup-mssg-text-b{
- width: 100%;
- height: auto;
- .text{
- font-size: 18rpx;
- line-height: 40rpx;
- color: #ffffff;
- .icon-xiangxia1{
- color: rgba(255, 255, 255, .7);
- font-size: 36rpx;
- }
- }
- }
- }
- }
- .tui-popup-main{
- width: 100%;
- height: auto;
- .tui-popup-from{
- width: 100%;
- height: 80rpx;
- margin-bottom: 30rpx;
- &.none{
- margin-bottom: 0;
- }
- .input{
- width: 100%;
- height: 80rpx;
- box-sizing: border-box;
- line-height: 80rpx;
- font-size: 28rpx;
- color: #ffffff;
- border-bottom: 1px solid #ffffff;
- }
- }
- }
- }
- .tui-popup-btn {
- width: 100%;
- float: left;
- .tui-modal-flex {
- width: 100%;
- height: 84rpx;
- margin-top: 40rpx;
- display: flex;
- .tui-modal-button {
- flex: 1;
- line-height: 84rpx;
- font-size: $font-size-28;
- text-align: center;
- border-radius: 42rpx;
- padding: 0;
- margin: 0 15rpx;
- box-sizing: border-box;
- background: #202020;
- color: #ffffff;
- &.disabled {
- background: #cbcbcb;
- }
- }
- }
- .tui-modal-text{
- width: 100%;
- height: 68rpx;
- box-sizing: border-box;
- padding: 0 30rpx;
- .tui-modal-left{
- float: left;
- line-height: 68rpx;
- font-size: 28rpx;
- color: #ffffff;
- }
- .tui-modal-right{
- float: right;
- line-height: 68rpx;
- font-size: 28rpx;
- color: #ffffff;
- }
- }
- }
- </style>
|