Commit 96280bca by 侯体倬

生日有礼弹窗及领取流程

parent 59239a74
...@@ -1514,6 +1514,15 @@ ...@@ -1514,6 +1514,15 @@
"unset-value": "^1.0.0" "unset-value": "^1.0.0"
} }
}, },
"call-bind": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
"integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
"requires": {
"function-bind": "^1.1.1",
"get-intrinsic": "^1.0.2"
}
},
"caller-callsite": { "caller-callsite": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz",
...@@ -4313,8 +4322,7 @@ ...@@ -4313,8 +4322,7 @@
"function-bind": { "function-bind": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
"dev": true
}, },
"gauge": { "gauge": {
"version": "2.7.4", "version": "2.7.4",
...@@ -4369,6 +4377,16 @@ ...@@ -4369,6 +4377,16 @@
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
"dev": true "dev": true
}, },
"get-intrinsic": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz",
"integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==",
"requires": {
"function-bind": "^1.1.1",
"has": "^1.0.3",
"has-symbols": "^1.0.1"
}
},
"get-stdin": { "get-stdin": {
"version": "4.0.1", "version": "4.0.1",
"resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz",
...@@ -4487,7 +4505,6 @@ ...@@ -4487,7 +4505,6 @@
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
"integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
"dev": true,
"requires": { "requires": {
"function-bind": "^1.1.1" "function-bind": "^1.1.1"
} }
...@@ -4510,8 +4527,7 @@ ...@@ -4510,8 +4527,7 @@
"has-symbols": { "has-symbols": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz",
"integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg=="
"dev": true
}, },
"has-unicode": { "has-unicode": {
"version": "2.0.1", "version": "2.0.1",
...@@ -5570,9 +5586,9 @@ ...@@ -5570,9 +5586,9 @@
"dev": true "dev": true
}, },
"mayi-analytics": { "mayi-analytics": {
"version": "1.1.14", "version": "1.1.24",
"resolved": "https://registry.npmjs.org/mayi-analytics/-/mayi-analytics-1.1.14.tgz", "resolved": "https://registry.npmjs.org/mayi-analytics/-/mayi-analytics-1.1.24.tgz",
"integrity": "sha512-hyKJv4lbEUPLJoR0DmO4Fi1/zYeOvHc1zQaEFXE0ebk18LOOFb9qPiVbEsQ6eDqGzyyMOWoklKWlZxqYmlhoNA==", "integrity": "sha512-pbJspryp05UuiodXfCFbeZkyM1BdPGC83XRJDo+LJhvfdyaiTXLykCfORRCDgTR0hIuINb8UjOc8/B6bkjWp8g==",
"requires": { "requires": {
"js-cookie": "^2.2.0", "js-cookie": "^2.2.0",
"qs": "^6.7.0", "qs": "^6.7.0",
...@@ -5580,9 +5596,12 @@ ...@@ -5580,9 +5596,12 @@
}, },
"dependencies": { "dependencies": {
"qs": { "qs": {
"version": "6.9.4", "version": "6.10.1",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz", "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.1.tgz",
"integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==" "integrity": "sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg==",
"requires": {
"side-channel": "^1.0.4"
}
} }
} }
}, },
...@@ -8650,6 +8669,23 @@ ...@@ -8650,6 +8669,23 @@
"rechoir": "^0.6.2" "rechoir": "^0.6.2"
} }
}, },
"side-channel": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
"integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
"requires": {
"call-bind": "^1.0.0",
"get-intrinsic": "^1.0.2",
"object-inspect": "^1.9.0"
},
"dependencies": {
"object-inspect": {
"version": "1.11.0",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz",
"integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg=="
}
}
},
"sigmund": { "sigmund": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz",
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
"checkInvalidKey": true, "checkInvalidKey": true,
"checkSiteMap": true, "checkSiteMap": true,
"uploadWithSourceMap": true, "uploadWithSourceMap": true,
"compileHotReLoad": false,
"useMultiFrameRuntime": true, "useMultiFrameRuntime": true,
"useApiHook": true, "useApiHook": true,
"useApiHostProcess": true, "useApiHostProcess": true,
...@@ -25,6 +26,7 @@ ...@@ -25,6 +26,7 @@
"disablePlugins": [], "disablePlugins": [],
"outputPath": "" "outputPath": ""
}, },
"enableEngineNative": false,
"useIsolateContext": true, "useIsolateContext": true,
"useCompilerModule": true, "useCompilerModule": true,
"userConfirmedUseCompilerModuleSwitch": false, "userConfirmedUseCompilerModuleSwitch": false,
...@@ -35,11 +37,11 @@ ...@@ -35,11 +37,11 @@
}, },
"miniprogramRoot": "dist/wx/", "miniprogramRoot": "dist/wx/",
"compileType": "miniprogram", "compileType": "miniprogram",
"appid": "wxae95a07ffdf11548", "appid": "wx8a509d2f2ac15903",
"projectname": "mayi-mp-shop", "projectname": "mayi-mp-shop",
"simulatorType": "wechat", "simulatorType": "wechat",
"simulatorPluginLibVersion": {}, "simulatorPluginLibVersion": {},
"libVersion": "2.15.0", "libVersion": "2.19.1",
"condition": { "condition": {
"plugin": { "plugin": {
"list": [] "list": []
......
...@@ -4,5 +4,9 @@ export default { ...@@ -4,5 +4,9 @@ export default {
ordercustomerinfo(options){ ordercustomerinfo(options){
return requestPOST(`${process.env.OLSHOP_URL}/order/place_order_customer_info`,options) return requestPOST(`${process.env.OLSHOP_URL}/order/place_order_customer_info`,options)
}, },
// 生日有礼确认订单
addOrderNowBuy(data) {
return requestPOST(`${process.env.OLSHOP_URL}/order/add_order`, data)
},
} }
\ No newline at end of file
import { requestPOST, requestGET } from "@/utils/request.js"
export default {
// 查询是否显示生日礼包
getQueryGift() {
return requestPOST(`${process.env.OLSHOP_URL}/grantRecordInfo/getQueryGift`);
}
};
<template>
<!-- catchtouchmove="ture" 防止触摸穿透 -->
<div v-show="isShow">
<div class="container" v-if="!showIcon && !state">
<div class="background" @click="showIcon = true"></div>
<div class="info">
<div class="info-item">
<p style="white-space: nowrap;">
尊敬的<span style="color: #000">
{{ nickName }} </span
>先生,
</p>
<div class="detail">
{{
month
}}月是您的生日月,现在为您送上专属生日大礼包一份,祝您生日快乐!
</div>
<img class="tleft" :src="imgList.tleft" alt="" />
<img class="bright" :src="imgList.bright" alt="" />
<div class="button" @click="receive()"><span>领取生日礼包</span></div>
</div>
</div>
<img class="bg" :src="imgList.background" alt="" />
<img class="crown" :src="imgList.crown" alt="" />
<img class="close" :src="imgList.close" @click.stop="closePopup()" alt="" />
<img class="head" :src="avatar" alt="" />
</div>
<div v-else class="present" @click="iconClick()">
<img :src="imgList.present" alt="" />
<span>生日有礼</span>
</div>
<birthInfo v-if="productArr" ref="giftpackage" :giftData="productArr" @suregiftopencard="suregiftopencard"></birthInfo>
</div>
</template>
<script>
import { DFSImg } from "@/utils/index";
import birthInfo from './index.vue';
import orderDown from "@/api/order";
export default {
name: 'birthPopup',
created() {
this.getBirth()
this.getUserInfo()
},
deactivated() {
this.state = true;
},
data() {
return {
showIcon: false,
imgList: {
// 左上角
tleft:
"http://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/png/b0161af3-ba7e-4792-9f19-3dc3feb4ba84.png",
// 右下角
bright:
"http://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/png/aa55219c-51e6-4d3d-a4f3-4388511f1e66.png",
// 皇冠
crown:
"http://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/png/970f0df4-be82-463c-b984-15650a358c15.png",
// 背景
background:
"http://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/png/0976526d-0e99-4620-9847-fa54ed23b6a8.png",
// 关闭
close:
"http://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/png/97d375b0-b434-4615-9048-51f4aaee5142.png",
// 小礼物
present:
"http://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/png/15e91d69-dd21-4ff2-8281-510fac2fb75a.png"
},
state: false,
nickName: '',
avatar: '',
productArr: [],
month: '',
isShow: false
};
},
props: {
birthGifts: {
type: Object,
default: {}
},
isShowBirth: {
type: Boolean,
default: false
}
},
watch: {
birthGifts() {
// 图片处理
for (let i = 0; i < this.birthGifts.gifts.length; i++) {
this.birthGifts.gifts[i].goodsSpecificationsUrl
= DFSImg(this.birthGifts.gifts[i].goodsSpecificationsUrl)
}
this.productArr = this.birthGifts.gifts
this.getBirth()
this.getUserInfo()
},
isShowBirth() {
this.isShow = this.isShowBirth
console.log('tztzt', this.isShowBirth);
}
},
methods: {
// 领取生日礼物,跳转订单页
receive() {
this.$refs.giftpackage.yhjCheck = true;
},
// icon 点击事件
iconClick() {
this.state = false;
this.showIcon = false;
},
// 关闭弹窗
closePopup() {
this.state = true;
this.showIcon = true;
},
// 获取用户信息
getUserInfo() {
if (this.$store.state.userInfo.nickName) { this.nickName = this.$store.state.userInfo.nickName }
if (this.$store.state.userInfo.avatarUrl) { this.avatar = this.$store.state.userInfo.avatarUrl }
else {
this.avatar = "http://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/jpg/02c0c235-daae-412d-bced-5fb315ad570e.jpg"
}
},
// 对生日月份的处理
getBirth() {
if (this.birthGifts.gifts) {
let birth = this.birthGifts.gifts[0].createDatetime.slice(5, 7)
if (birth.slice(0, 1) === '0') { this.month = birth.slice(1, 2) }
else { this.month = birth }
}
},
// 领取成功回调
suregiftopencard(val) {
this.isShow = false
wx.showLoading({
title: '领取中...',
mask: false
})
let orderItems = []
for (let i = 0; i< this.birthGifts.gifts.length; i++) {
orderItems.push({qty: 1, terminalProductGoodsId: this.birthGifts.gifts[i].grantGift, giftFlag: true})
}
const submitParam = {
orderItems
};
if(this.$refs.giftpackage) {
if(val) {
submitParam.consignee = val.consignee;
submitParam.telephone = val.mobilephone;
submitParam.address = val.address;
submitParam.provinceCode = val.provinceCode;
submitParam.provinceName = val.provinceName;
submitParam.cityCode = val.cityCode;
submitParam.cityName = val.cityName;
submitParam.regionCode = val.districtCode;
submitParam.regionName = val.districtName;
submitParam.marketingMode = 8;
submitParam.orderType = 21;
submitParam.marketingModeSourceId = this.birthGifts.id;
}
}
orderDown.addOrderNowBuy(submitParam).then(res => {
res = res.data
if (res.code == 200) {
wx.hideLoading()
wx.showModal({
title:'领取成功!',
content: '请在个人中心‘我的订单’中查看详情!',
showCancel: false
})
} else {
wx.hideLoading()
wx.showModal({
title: '错误',
content: `${res.msg}`,
showCancel: false
})
}
});
}
},
components: {
birthInfo
}
};
</script>
<style lang="scss" scoped>
.background {
position: absolute;
top: 0;
left: 0;
width: 750rpx;
height: 100vh;
z-index: 6;
background: rgba(0, 0, 0, 0.4);
opacity: 0.8;
}
.container {
z-index: 111;
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
margin: 0 auto;
padding: 0;
.bg {
position: absolute;
left: 0;
right: 0;
margin: 114px auto;
width: 263px;
height: 349px;
z-index: 6;
}
.crown {
position: absolute;
left: 0;
right: 0;
margin: 153px auto;
width: 40px;
height: 24px;
z-index: 11;
}
.close {
position: absolute;
left: 0;
right: 0;
margin: 477px auto 72px;
width: 32px;
height: 32px;
z-index: 6;
}
.head {
position: absolute;
left: 0;
right: 0;
margin: 172px auto 348px;
z-index: 11;
width: 60px;
height: 60px;
border-radius: 50%;
}
.info {
position: absolute;
left: 0;
right: 0;
margin: 287px auto;
width: 263px;
height: 176px;
background: #ffffff;
border-radius: 0px 0px 4px 4px;
z-index: 11;
.info-item {
margin: 20px 123px 135px 10px;
width: 130px;
height: 21px;
font-size: 15px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #a55223;
line-height: 21px;
.bright {
position: absolute;
left: 214px;
bottom: 54px;
width: 67px;
height: 84px;
z-index: 11;
}
.tleft {
position: absolute;
right: 217px;
bottom: 305px;
width: 71px;
height: 81px;
z-index: 11;
}
.detail {
position: relative;
z-index: 12;
margin-top: 14px;
text-align: left;
width: 243px;
height: 33px;
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
line-height: 17px;
}
.button {
position: absolute;
left: 0;
right: 0;
margin: 32px auto;
text-align: center;
width: 204px;
height: 40px;
background: linear-gradient(135deg, #dbb292 0%, #f8dfc4 100%);
border-radius: 21px;
span {
width: 90px;
height: 21px;
font-size: 15px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #643a23;
line-height: 40px;
}
}
}
}
}
.present {
position: fixed;
top: 474px;
right: 10px;
img {
display: block;
margin: 0 auto;
width: 49px;
height: 49px;
border-radius: 50%;
margin-bottom: -5px;
}
span {
width: 59px;
height: 20px;
background: #fd8f50;
border-radius: 10px;
border: 1px solid #611014;
}
}
</style>
<template>
<div class="sendPoints" v-if="yhjCheck">
<div @click="yhjCheck = false" class="testBackground"></div>
<div class="test" v-if="yhjCheck" position="bottom" custom-style="height: 40%">
<p class="couponTit">确认{{showAddr?'地址':''}}</p>
<div v-if="showAddr">
<div class="address_list-d flex" v-if="addressCur" @click="toChooseAddr()">
<div class="top">
<div class="name">{{addressCur.consignee}}</div>
<div class="default flex" v-if="addressCur.isDefaultShipping == 1">默认</div>
</div>
<div class="mid">
<div class="tel">
<span v-if="addressCur.mobilephone">{{addressCur.mobilephone}}</span>
<span v-else>{{addressCur.telephone}}</span>
</div>
<div
class="address"
>{{addressCur.provinceName}}{{addressCur.cityName}}{{addressCur.districtName}}{{addressCur.address}}</div>
<i class="iconfont icon-tubiao_jiyao-xiangyou"></i>
</div>
</div>
<div class="adr1" v-else @click="toAddAddr()">
<img class="adr1_img" src="https://cdn.mayi888.com/_nuxt/client/img/e547fe3.png?mixid=" alt="">
<p>请选择收货地址</p>
</div>
</div>
<div class="check_box" :style="{height: newdata.length > 1 ? '200px' : '100%'}">
<div class="gift_detail" v-for="(item,index) in newdata" :key="index">
<van-card
num="1"
price="0.00"
:title="item.grantName"
:thumb="item.goodsSpecificationsUrl"
/>
<div class="gift_list" v-for="(sitem,sindex) in item.giftGoodsRels" :key="sindex">
<span>{{sitem.productName}} </span>
<span>X{{Number(sitem.qty)}}</span>
</div>
</div>
</div>
<div class="sure_box">
<div class="sure_item" @click="suregift()">确定</div>
</div>
</div>
</div>
</template>
<script type="text/ecmascript-6">
import addres from "@/api/userAddress";
export default {
name: 'birthInfo',
data() {
return {
newdata:[],
yhjCheck:false,
addressList:[],
addressCur:null,
checked:true,
selectgift:[],
showAddr:true,//是否展示选择地址
};
},
props:{
giftData: {
type: Array,
default() {
return []
}
},
maxReceiveGift:{
type:String,
default() {
return ''
}
},
title:{
type:String,
default() {
return ''
}
}
},
watch:{
yhjCheck(val){
console.log('tztztz', val);
this.getUserAddr();
if(val) {
if(this.newdata.length == 1) {
this.$set(this.newdata[0],'ischange',true);
}
}
},
giftData() {
this.newdata = this.giftData;
}
},
async created(){
this.newdata = this.giftData;
this.getUserAddr();
},
methods: {
getData(val){
this.newdata = val;
},
getUserAddr(){
//获取地址
addres.getUserAddressList().then(res => {
if (res.data.code == 200) {
if (res.data.data.list.length > 0) {
this.addressList = res.data.data.list;
this.addressList.forEach(v => {
if (v.isDefaultShipping == "1"||v) {
return this.addressCur = v
}
});
return this.addressCur = this.addressList[0]
} else {
this.addressCur = null
}
}
});
},
// 去修改地址
toChooseAddr(){
wx.navigateTo({url: '/pages/index/main?from=home&backpath=%2Faddress%2FaddressList'});
this.yhjCheck = false
},
// 确定
suregift(){
if(this.showAddr && !this.addressCur) {
wx.showToast({
title:'请选择收货地址!',
icon: "error"
})
return false
}
this.yhjCheck = false;
this.$emit('suregiftopencard',this.addressCur,this.showAddr,this.selectgift)
},
// 新增地址
toAddAddr(){
wx.navigateTo({url: '/pages/index/main?from=home&backpath=%2Faddress%2FaddressList'});
this.yhjCheck = false
},
}
};
</script>
<style lang="scss" scoped>
.sendPoints {
position: fixed;
bottom: 0;
z-index: 99999;
width: 100%;
height: 100%;
margin-top: 14px;
.testBackground {
height: 100%;
width: 100%;
background-color: rgba(0,0,0,0.4);
opacity: .8;
z-index: 1;
}
.test {
position: fixed;
bottom: 0;
width: 100%;
z-index: 2;
}
.tit {
font-size: 16px;
color: #333;
align-items: center;
font-weight: bold;
}
.gift_wrap{
padding-top: 10px;
.gift_item{
display: flex;
margin-bottom: 10px;
.gift_index{
background-size: cover;
height: 61px;
width: 43.5px;
flex: none;
margin-right: 10px;
.num{
position: relative;
right: -7px;
top: -4px;
font-size: 29px;
font-weight: bold;
color: rgba(255,255,255,1);
}
}
.gift_product{
overflow: hidden;
.product_img{
display: flex;
overflow: auto;
padding-left: 10px;
img{
width: 47px;
height: 48px;
margin-right: 15px;
}
}
.product_text{
font-size: 12px;
font-family: Source Han Sans CN;
font-weight: 400;
color: rgba(46,46,46,1);
line-height: 18px;
margin-top: 5px;
}
}
}
.tips{
color: #666666;
font-weight:bold;
padding-bottom: 10px;
}
}
.couponTit{
text-align: center;
font-size: 16px;
padding: 10px 0 0 0;
border-bottom: 1px solid #e5e5e5;
width: 100%;
height: 100%;
background-color: #fff;
padding-bottom: 10px;
}
.adr1 {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin:0 auto;
padding:10px 0;
text-align:center;
width: 100%;
background-color: #fff;
border-bottom: 1px solid #e5e5e5;
.adr1_img{
width:36px;
height:33px;
margin: 0 auto;
}
p{
margin-top:10px;
font-size:14px;
color:#828282;
text-align:center;
}
}
.address_list-d {
position: relative;
width: 100%;
height: 100px;
background: rgba(255, 255, 255, 1);
border-bottom: 1px solid #e5e5e5;
.top{
text-align: center;
padding-left: 20px;
.name {
height: 15px;
font-size: 15px;
font-family: MicrosoftYaHei;
font-weight: 400;
color: rgba(39, 39, 39, 1);
margin-top: 25px;
}
.default {
width: 40px;
border: 1px solid var(--main-color);
border-radius: 3px;
font-size: 12px;
font-family: MicrosoftYaHei;
font-weight: 400;
color: var(--main-color);
justify-content: center;
align-items: center;
margin-top: 10px;
display: inline-block;
}
}
.mid {
width: 240px;
// margin-top: 6px;
margin-left: 20px;
span{
margin-top: 25px;
}
.tel {
// width: 100px;
height: 20px;
font-size: 15px;
font-family: MicrosoftYaHei;
font-weight: 400;
color: rgba(39, 39, 39, 1);
margin-top: 25px;
}
.address {
width: 240px;
height: 37px;
font-size: 13px;
font-family: MicrosoftYaHei;
font-weight: 400;
color: rgba(39, 39, 39, 1);
margin-top: 3px;
}
.iconfont {
position: absolute;
right: 15px;
top: 34px;
font-size: 18px;
// margin-left: 13px;
}
}
.top {
width: 20%;
}
}
.check_box{
/* height: 200px; */
overflow: auto;
font-size:16px;
.van-checkbox{
padding-top: 10px;
padding-left: 30px;
margin-bottom: 5px;
}
.gift_detail{
border-bottom: 1px solid #e5e5e5;
padding-bottom: 10px;
width: 100%;
background-color: #fff;
.gift_list{
font-size: 12px;
padding-left: 58px;
color: #999;
margin-bottom: 5px;
}
}
}
.sure_box{
display: flex;
justify-content: center;
background-color: #fff;
height: 100%;
width: 100%;
.sure_item{
width: 80%;
text-align: center;
border-radius: 20px;
height: 35px;
line-height: 35px;
margin-top: 10px;
margin-bottom: 10px;
font-size: 16px;
background: #c6b088;
color: #fff;
}
}
}
</style>
{
"usingComponents": {
"van-card": "/static/vant/card/index",
"van-popup": "/static/vant/popup/index",
"van-toast": "/static/vant/toast/index"
}
}
...@@ -109,6 +109,11 @@ ...@@ -109,6 +109,11 @@
<!-- 底部栏 --> <!-- 底部栏 -->
<custom-tab-bar class="custom-tab-bar" :selected="active"></custom-tab-bar> <custom-tab-bar class="custom-tab-bar" :selected="active"></custom-tab-bar>
<!-- 生日弹窗 -->
<keep-alive>
<birth-popup :birthGifts="birthGifts" :isShowBirth="isShowBirth" v-show="true"></birth-popup>
</keep-alive>
<couponPopup></couponPopup> <couponPopup></couponPopup>
</div> </div>
</template> </template>
...@@ -131,7 +136,8 @@ import imgText from '@/components/content/imgText' ...@@ -131,7 +136,8 @@ import imgText from '@/components/content/imgText'
import coupon from '@/components/activity/coupon' import coupon from '@/components/activity/coupon'
import integralTurntable from '@/components/activity/integralTurntable' import integralTurntable from '@/components/activity/integralTurntable'
import spellGroup from '@/components/activity/spellGroup' import spellGroup from '@/components/activity/spellGroup'
import birthPopup from '@/components/birthPopup/birthPopup.vue'
import birth from '@/api/popup'
import couponPopup from '@/components/couponPopup.vue' import couponPopup from '@/components/couponPopup.vue'
import NewUser from "../../components/newCustomer/newUser"; import NewUser from "../../components/newCustomer/newUser";
import NewPolite from "../../components/newCustomer/newPolite"; import NewPolite from "../../components/newCustomer/newPolite";
...@@ -165,6 +171,9 @@ export default { ...@@ -165,6 +171,9 @@ export default {
showNewUser: false, //新客有礼入口 showNewUser: false, //新客有礼入口
showgiftBag: false, //新客礼包弹框 showgiftBag: false, //新客礼包弹框
timer: null, timer: null,
isShowBirth: false, // 是否展示生日礼品
birthGifts: ""
}; };
}, },
components:{ components:{
...@@ -183,7 +192,8 @@ export default { ...@@ -183,7 +192,8 @@ export default {
spellGroup, spellGroup,
couponPopup, couponPopup,
NewUser, NewUser,
NewPolite NewPolite,
birthPopup
}, },
onShareAppMessage(res) { onShareAppMessage(res) {
let {shopCode} = app.globalData.shopInfo; let {shopCode} = app.globalData.shopInfo;
...@@ -229,6 +239,21 @@ export default { ...@@ -229,6 +239,21 @@ export default {
}) })
observer.observe({ entryTypes: ['render', 'script'] }) observer.observe({ entryTypes: ['render', 'script'] })
} }
// 查询是否展示生日礼品
// this.isShowBirth = true // 测试
wx.getStorage({
key: 'sessionid',
success: res => {
console.log('tz登录', res);
this.getBirthGift(this)
},
fail: err => {
this.isShowBirth = false
console.log('tz未登录', err, this.isShowBirth);
console.log('未登录状态=====================', err)
}
})
}, },
onLoad(options) { onLoad(options) {
//进页面存储需要绑定的信息 //进页面存储需要绑定的信息
...@@ -267,7 +292,7 @@ export default { ...@@ -267,7 +292,7 @@ export default {
} }
}).catch((err)=>{ }).catch((err)=>{
}) })
}); });
} }
Object.assign(this.$data, this.$options.data()); Object.assign(this.$data, this.$options.data());
...@@ -284,7 +309,7 @@ export default { ...@@ -284,7 +309,7 @@ export default {
this.changeLocation = options.changeLocation || '' this.changeLocation = options.changeLocation || ''
if(this.changeLocation == 1){ if(this.changeLocation == 1){
console.log('this.$store.state.extConfig',this.$store.state.extConfig) console.log('this.$store.state.extConfig',this.$store.state.extConfig)
app.getShopInfo(this.$store.state.extConfig); app.getShopInfo(this.$store.state.extConfig);
app.getThemePage(this.$store.state.extConfig); app.getThemePage(this.$store.state.extConfig);
} }
...@@ -309,7 +334,6 @@ export default { ...@@ -309,7 +334,6 @@ export default {
} }
// 获取页面数据 // 获取页面数据
if (this.mpApp.globalData.pageList) { if (this.mpApp.globalData.pageList) {
that.init(this.mpApp.globalData.pageList); that.init(this.mpApp.globalData.pageList);
} else { } else {
...@@ -323,12 +347,10 @@ export default { ...@@ -323,12 +347,10 @@ export default {
}else { }else {
this.mpApp.themeColorCallBack=(res)=>{ this.mpApp.themeColorCallBack=(res)=>{
this.themeColor = res this.themeColor = res
} }
} }
// 新人有礼弹窗 // 新人有礼弹窗
this.newUserFun(); this.newUserFun();
}, },
onShow() { onShow() {
//分销隔流 //分销隔流
...@@ -350,7 +372,6 @@ export default { ...@@ -350,7 +372,6 @@ export default {
}; };
}, },
methods: { methods: {
init(pageList) { init(pageList) {
this.getCartNum(); this.getCartNum();
this.active=checkTabbarPage('/'); this.active=checkTabbarPage('/');
...@@ -453,7 +474,7 @@ export default { ...@@ -453,7 +474,7 @@ export default {
} }
if( if(
res&& res&&
res.parentSpokesmanDistributionModel == '1'&& res.parentSpokesmanDistributionModel == '1'&&
res.distributorHomepage.id) { res.distributorHomepage.id) {
this.showSpokesManHome = true; this.showSpokesManHome = true;
}else { }else {
...@@ -503,7 +524,7 @@ export default { ...@@ -503,7 +524,7 @@ export default {
if( if(
Math.abs(delta) < 10 || Math.abs(delta) < 10 ||
afterScrollTop < 0 || afterScrollTop < 0 ||
this.beforeScrollTop < 0 || this.beforeScrollTop < 0 ||
(delta>0 && showFlag=='down') || (delta>0 && showFlag=='down') ||
(delta<0 && showFlag=='up') (delta<0 && showFlag=='up')
){ ){
...@@ -647,6 +668,34 @@ export default { ...@@ -647,6 +668,34 @@ export default {
this.showgiftBag = false; this.showgiftBag = false;
} }
}, },
getBirthGift(that) {
birth.getQueryGift().then(res => {
let result = res.data
console.log(JSON.stringify(result), that, 'tztztz初始化')
if (result.data.gifts !== null && result.data.gifts.length > 0) {
// 判断礼物是否领取完成
let showPopup = false;
let arr = [];
for (let i = 0; i < result.data.gifts.length; i++) {
// 未领取的礼物添加到数组中
if (result.data.gifts[i].executeStatus !== "1") {
showPopup = true;
arr.push(result.data.gifts[i]);
}
}
if (showPopup) {
// 替换原有数组
result.data.gifts = arr;
that.toggleData(result.data)
}
}
});
},
toggleData(res) {
this.isShowBirth = true;
console.log(this.isShowBirth, JSON.stringify(res) + 'tzToggleData')
this.birthGifts = res;
}
}, },
async onShareAppMessage(res){ async onShareAppMessage(res){
console.log(res) console.log(res)
...@@ -712,7 +761,7 @@ export default { ...@@ -712,7 +761,7 @@ export default {
app.getShopInfo(this.$store.state.extConfig); app.getShopInfo(this.$store.state.extConfig);
app.getThemePage(this.$store.state.extConfig); app.getThemePage(this.$store.state.extConfig);
} }
}; };
</script> </script>
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
"usingComponents": { "usingComponents": {
"van-tabs": "/static/vant/tabs/index", "van-tabs": "/static/vant/tabs/index",
"van-tab": "/static/vant/tab/index", "van-tab": "/static/vant/tab/index",
"van-card": "/static/vant/card/index",
"banner": "/static/nativeComponents/Banner/index", "banner": "/static/nativeComponents/Banner/index",
"goods-list": "/static/nativeComponents/GoodsList/index", "goods-list": "/static/nativeComponents/GoodsList/index",
"custom-tab-bar": "/static/nativeComponents/custom-tab-bar/index", "custom-tab-bar": "/static/nativeComponents/custom-tab-bar/index",
...@@ -29,4 +30,4 @@ ...@@ -29,4 +30,4 @@
}, },
"enablePullDownRefresh":true, "enablePullDownRefresh":true,
"backgroundColor":"#f5f5f5" "backgroundColor":"#f5f5f5"
} }
\ No newline at end of file
<!--miniprogram/custom-tab-bar/index.wxml--> <!-- miniprogram/custom-tab-bar/index.wxml -->
<view class="tab-bar {{show?'':'hide'}} {{(componentData.scrollHide) && showFlag=='down'?'down':'up'}}" style="--main-color : {{mainColor}}"> <view class="tab-bar {{show?'':'hide'}} {{(componentData.scrollHide) && showFlag=='down'?'down':'up'}}" style="--main-color : {{mainColor}}">
<!-- <view class="antt ant-daipinglun"></view> --> <!-- <view class="antt ant-daipinglun"></view> -->
<!-- <view class="iconfont icon-fenzhi">3</view> --> <!-- <view class="iconfont icon-fenzhi">3</view> -->
<view class="tab-bar-border"></view>
<view class="tab-bar-border"></view> <view wx:for="{{list}}" wx:if="{{item.show}}" wx:key="index" class="tab-bar-item {{(mid==index&&componentData['styleSelectionNum']==1)?'isItem':''}}" data-path="{{item.link}}" data-index="{{index}}" bindtap="switchTab">
<view <!-- 图标 -->
wx:for="{{list}}" <view class="item {{index == selected ? 'current' : ''}}">
wx:if="{{item.show}}" <view wx:if="{{componentData['contentFormNum']!=2}}">
wx:key="index" <view wx:if="{{item.iconType==0||!item.iconType}}">
class="tab-bar-item {{(mid==index&&componentData['styleSelectionNum']==1)?'isItem':''}}" <view class="{{item.isAntt ? 'antt' : 'iconfont'}} {{item.icon}}" style="font-size:{{componentData.defaultIcon==1 ? '36rpx' : (componentData.defaultIconSize*2 + 'rpx')}};color:{{index==selected?componentData.selectIconColor:componentData.defaultIconColor}}"></view>
data-path="{{item.link}}" </view>
data-index="{{index}}" <view wx:elif="{{item.iconType==1}}" class="img-view ">
bindtap="switchTab" <image style="width:{{(index==selected?componentData.selectionIconSize*2:componentData.defaultIconSize*2)+'rpx'}};height:{{(index==selected?componentData.selectionIconSize*2:componentData.defaultIconSize*2)+'rpx'}}" mode="aspectFit" src="{{selected === index ? item.selectImgUrl : item.imgUrl}}"></image>
> </view>
<!-- 图标 --> </view>
<view class="item {{index == selected ? 'current' : ''}}"> <!-- 名称 -->
<view wx:if="{{componentData['contentFormNum']!=2}}" > <view wx:if="{{componentData['contentFormNum']!=3}}" class="text" style="color: {{selected === index ? componentData.selectTextColor : componentData.defaultTextColor}};font-size:{{selected === index ? (componentData.selectText==1?10:componentData.selectionTextNum)*2 : (componentData.defaultText==1?10:componentData.defaultTextNum)*2}}rpx">
<view wx:if="{{item.iconType==0||!item.iconType}}"> {{item.title}}
<view class="{{item.isAntt ? 'antt' : 'iconfont'}} {{item.icon}}" style="font-size:{{componentData.defaultIcon==1 ? '36rpx' : (componentData.defaultIconSize*2 + 'rpx')}};color:{{index==selected?componentData.selectIconColor:componentData.defaultIconColor}}"></view> </view>
</view> <!-- 购物车商品数量 -->
<view <view class="isCart" wx:if="{{item.link&&item.link.link&&item.link.link=='/shopCart/shoppingCart'&&cartNum>0}}">
wx:elif="{{item.iconType==1}}" {{cartNum}}
class="img-view " </view>
</view>
> </view>
<image
style="width:{{(index==selected?componentData.selectionIconSize*2:componentData.defaultIconSize*2)+'rpx'}};height:{{(index==selected?componentData.selectionIconSize*2:componentData.defaultIconSize*2)+'rpx'}}"
mode="aspectFit" src="{{selected === index ? item.selectImgUrl : item.imgUrl}}">
</image>
</view>
</view>
<!-- 名称 -->
<view wx:if="{{componentData['contentFormNum']!=3}}" class="text" style="color: {{selected === index ? componentData.selectTextColor : componentData.defaultTextColor}};font-size:{{selected === index ? (componentData.selectText==1?10:componentData.selectionTextNum)*2 : (componentData.defaultText==1?10:componentData.defaultTextNum)*2}}rpx">
{{item.title}}</view>
<!-- 购物车商品数量 -->
<view class="isCart" wx:if="{{item.link&&item.link.link&&item.link.link=='/shopCart/shoppingCart'&&cartNum>0}}">
{{cartNum}}
</view>
</view>
</view>
</view> </view>
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