Commit 9eb534f6 by 李嘉林

麦贝思用户选择标签

parent 7061b54c
...@@ -45,5 +45,17 @@ console.log(process.env,'-----------------config------') ...@@ -45,5 +45,17 @@ console.log(process.env,'-----------------config------')
verifycode(data) { verifycode(data) {
return requestPOST(`${process.env.OLSHOP_URL}/common/send_mb_code`, data) return requestPOST(`${process.env.OLSHOP_URL}/common/send_mb_code`, data)
}, },
// 获取标签
getUserTagGroup(data) {
return requestGET(`${process.env.OLSHOP_URL}/user/getUserTagGroup`, data)
},
// 获取用户是否有身份标签
isThereALabel(data) {
return requestGET(`${process.env.OLSHOP_URL}/user/isThereALabel`, data)
},
// 用户新增标签
addCustomerRel(data) {
return requestGET(`${process.env.OLSHOP_URL}/user/addCustomerRel?tagId=${data}`)
},
} }
\ No newline at end of file
<template>
<!-- 麦贝思首页选择标签弹窗 -->
<div class="SWQUserSelectTag" v-show="show" catchtouchmove="ture">
<div class="SWQUserSelectTag__bg"></div>
<div class="SWQUserSelectTag__content">
<div class="close" @click="show = false">
<i class="iconfont icon-guanbi"></i>
</div>
<div class="title">HI~我是AI机器人小柒!</div>
<div class="info">
<div class="info__text">
<p>很高兴认识你,我是一个不断学习和进化的机器人,会根据用户的反馈和数据不断改进我的回答和服务质量,以更好地满足用户的需求。</p>
<p>我想更了解你,为你推荐更合适的内容。</p>
</div>
<div class="info__img">
<image
src="http://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/png/2bb11fbd-b6ad-402f-a280-f36c3bc17205.png"
alt=""></image>
</div>
</div>
<div class="select">
<div class="select__title">你是?</div>
<div class="select__list">
<div class="select__list__item" v-for="(item, index) in list" :key="index" @click="selectTag(item, index)">
<div class="select__list__item__val">{{ item.tagName }}</div>
<div class="select__list__item__flag">
<div class="select__list__item__flag__true" v-if="item.id == tagId">
<i class="iconfont icon-wancheng"></i>
</div>
<div class="select__list__item__flag__false" v-else></div>
</div>
</div>
</div>
</div>
<div class="confirm" @click="confirm">
<p>开启AI之旅</p>
</div>
</div>
</div>
</template>
<script type="text/ecmascript-6">
import login from "@/api/login"
export default {
name: "SWQUserSelectTag",
data() {
return {
show: false,
tagId: "",
list: [],
}
},
components: {},
computed: {
mixid() {
return this.$store.state.mixid;
}
},
created() {
if (["antgood", "SWQ"].indexOf(this.mixid) == -1) {
return;
}
this.getStatus();
},
mounted() { },
methods: {
open() {
this.getTageList();
this.show = true;
},
close() {
this.show = false;
},
selectTag(item, index) {
this.tagId = item.id;
},
async getStatus() {
try {
let res = await login.isThereALabel();
if (res.data.code == 200 && res.data.data == 'false') {
this.open();
}
} catch (error) {
}
},
async getTageList() {
try {
let res = await login.getUserTagGroup();
if (res.data.code == 200) {
this.list = res.data.data;
}
} catch (error) {
}
},
async confirm() {
try {
let res = await login.addCustomerRel(this.tagId);
if (res.data.data == "true") {
this.close();
} else {
wx.showToast({
title: res.data.msg,
icon: 'none',
})
}
} catch (error) {
}
}
}
}
</script>
<style lang="scss" scoped>
.SWQUserSelectTag {
z-index: 111;
position: fixed;
width: 100vw;
height: 100%;
left: 0;
bottom: 0;
margin: 0 auto;
padding: 0;
&__bg {
position: absolute;
top: 0;
left: 0;
width: 100vw;
height: 100%;
z-index: 6;
background: rgba(0, 0, 0, 0.4);
opacity: 0.8;
}
&__content {
box-sizing: border-box;
position: absolute;
bottom: 0;
left: 0;
width: 100vw;
height: 80vh;
border-radius: 8px 8px 0 0;
overflow: hidden;
z-index: 11;
background: linear-gradient(170.03deg, #8BCCFB 5.22%, #DFFFEC 35.23%, #FFFFFF 91.16%);
padding: 30px 20px;
.close {
position: absolute;
right: 20px;
top: 20px;
}
.title {
font-size: 18px;
color: #333;
font-weight: bold;
}
.info {
margin-top: 16px;
display: flex;
&__text {
font-size: 14px;
color: #666;
line-height: 24px;
p:not(:first-child) {
margin-top: 10px;
}
}
&__img {
flex-shrink: 0;
image {
width: 130px;
height: 166px;
}
}
}
.select {
&__title {
font-size: 16px;
color: #333;
font-weight: 500;
}
&__list {
max-height: 20vh;
overflow-y: auto;
margin-top: 10px;
&__item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px;
border-radius: 8px;
margin-bottom: 10px;
background: #fff;
&__val {
font-size: 14px;
color: #333;
font-weight: 500;
line-height: 22px;
}
&__flag {
width: 20px;
height: 20px;
&__true{
i{
font-size: 20px;
}
color: #EC5D41;
}
&__false{
width: 20px;
height: 20px;
border-radius: 50%;
border: 1px solid #DCDCDC;
}
}
}
}
}
.confirm {
width: 208px;
height: 78px;
margin-top: 30px;
background: url("http://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/png/a309b0c7-a1d8-4f62-843a-643d5c45f359.png") no-repeat;
background-size: 100% 100%;
margin: 0 auto;
overflow: hidden;
p {
font-size: 16px;
color: #fff;
text-align: center;
margin-top: 20px;
}
}
}
}
</style>
...@@ -148,6 +148,8 @@ ...@@ -148,6 +148,8 @@
<SelectGoods></SelectGoods> <SelectGoods></SelectGoods>
<!-- 选规格(开启了企业要货) --> <!-- 选规格(开启了企业要货) -->
<TwoBAddCart></TwoBAddCart> <TwoBAddCart></TwoBAddCart>
<!-- 麦贝思-客户选择标签 -->
<SWQUserSelectTag ref="SWQUserSelectTag"></SWQUserSelectTag>
</div> </div>
</template> </template>
...@@ -183,6 +185,7 @@ import memberInfo from "../../components/basicTool/member-info"; ...@@ -183,6 +185,7 @@ import memberInfo from "../../components/basicTool/member-info";
import GoodsFliters from "../../components/common/GoodsFliters"; import GoodsFliters from "../../components/common/GoodsFliters";
import SelectGoods from "../../components/common/SelectGoods"; import SelectGoods from "../../components/common/SelectGoods";
import TwoBAddCart from "../../components/common/TwoBAddCart"; import TwoBAddCart from "../../components/common/TwoBAddCart";
import SWQUserSelectTag from "../../components/common/SWQUserSelectTag";
import { setTabBarActive, checkTabbarPage,themeColor, checkShowConditionIds, setStoreInfo, getStoreInfo } from "../../utils/mayi.js"; import { setTabBarActive, checkTabbarPage,themeColor, checkShowConditionIds, setStoreInfo, getStoreInfo } from "../../utils/mayi.js";
import indexApi from "@/api/index.js"; import indexApi from "@/api/index.js";
import { throttle, concatUrl } from "../../utils/index.js" import { throttle, concatUrl } from "../../utils/index.js"
...@@ -260,7 +263,8 @@ export default { ...@@ -260,7 +263,8 @@ export default {
brandList, brandList,
StoreAddr, StoreAddr,
pageLoading, pageLoading,
CustomNav CustomNav,
SWQUserSelectTag
}, },
computed: { computed: {
applySucessEntryFlag() { applySucessEntryFlag() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment