-
+
-
+
@@ -24,8 +20,8 @@
-
-
+
+
@@ -52,6 +48,10 @@
+
+
+
@@ -68,11 +68,14 @@
import homeApi from "../models/home-model.js";
import Swiper from '@/common/swiper';
import { Alert, Toast,Popup,Picker } from "vux";
+ import routerFooter from "../components/nav-bottom";
export default {
data() {
return {
show: false,
defaultCity: '天河区',
+ merchantNo: '', //商户编号
+ districtId: '', //区id
addressData: [],
addressValue: [],
bannerImgList:[], //轮播图
@@ -88,17 +91,17 @@
components: {
Toast,
Popup,
- Picker
+ Picker,
+ routerFooter
},
watch: {
},
methods: {
getName (){
- let arr = this.addressValue[2].split('&')
- console.log(arr)
- $("#districtId").val(arr[0])
- $("#merchantNo").val(arr[2])
+ let arr = this.addressValue[2].split('&') || ''
+ this.districtId = arr[0]
+ this.merchantNo = arr[2]
this.getGoodsList()
this.defaultCity = arr[1]
this.show = false
@@ -111,16 +114,14 @@
getGoodsList (){
var params = {
- "merchantNo": $("#merchantNo").val(),
- "selectedDistrictId": $("#districtId").val()
+ "merchantNo": this.merchantNo,
+ "selectedDistrictId": this.districtId
}
- console.log(params)
+ // console.log(params)
homeApi.getGoods(params).then(res => {
- //console.log(res)
if ( res.code == 0 ){
this.bannerImgList = res.response.bannerImgList
this.promotionImgList = res.response.promotionImgList[0] || {};
- // console.log('11',this.promotionImgList)
let goodsList = res.response.goodsList
let arr = [];
for(let i=0;i {
- //console.log('默认地址信息',res)
+ // console.log('默认地址信息',res)
if ( res.code == 0 ){
if ( !res.data ){
this.show = true
} else {
- this.defaultCity = res.data.districtName
+ this.defaultCity = res.data.districtName || ''
+ this.districtId = res.data.districtId || ''
+ this.merchantNo = res.data.merchantNo || ''
this.addressValue = []
this.addressValue.push(res.data.provinceId)
this.addressValue.push(res.data.cityId)
@@ -191,7 +193,6 @@
this.getdefaultAddress()
this.getGoodsList()
this.getAddress()
-
}
};
@@ -237,12 +238,14 @@
}
.home .page-content {
background:rgba(255,255,255,1);
+ padding-bottom: 1rem;
}
.home .page-content .banner {
- height: 2.56rem;
+ max-height: 2.56rem;
+ margin-bottom: 0.3rem;
}
.home .page-content .banner > div {
- height: 2.56rem;
+ max-height: 2.56rem;
}
.home .page-content .banner a {
display: block;
@@ -255,11 +258,11 @@
.swiper-img {
width: 100%;
height: 2.56rem;
- background-size: cover;
- background-position: center center;
+ background-size: 100% 100%;
}
.home .page-content .coupon {
margin-top: 0.3rem;
+ margin-bottom: 0.4rem;
}
.home .page-content .coupon img {
width:6.8rem;
@@ -267,10 +270,10 @@
margin: auto;
}
.home .page-content .new-card {
- padding-bottom: 0.5rem;
+ /*padding-bottom: 0.5rem;*/
}
.home .page-content .new-card .new-card-top {
- padding: 0.4rem 0 0.3rem;
+ padding: 0rem 0 0.3rem;
}
.home .page-content .new-card .new-card-top img {
width:7.1rem;
@@ -359,6 +362,13 @@
align-items: center;
justify-content: center;
}
+.home .page-bottom {
+ width: 100%;
+ height: 1rem;
+ position: fixed;
+ bottom: 0;
+ background:rgba(255,255,255,1);
+}
.picke-address .status-btn {
display: flex;
height: 0.8rem;
diff --git a/src/view/month-card.vue b/src/view/month-card.vue
index 7af7b71..84e51ce 100644
--- a/src/view/month-card.vue
+++ b/src/view/month-card.vue
@@ -95,7 +95,7 @@
'2': '满减券',
'3': '折扣券',
},
- batchNo: this.$route.query.batchNo,
+ batchNo: this.$route.query.batchNo || "CB180914060305419101",
};
},
components: {
@@ -112,20 +112,17 @@
// 回去优惠券信息
couponModel.getCouponInfo(that.batchNo, token).then(function (result) {
-
- console.log(result.response);
-
- that.loading = false;
-
- if (result.code == 0) {
-
- that.getData = result.response
-
- } else {
-
- console.log(result.msg);
-
- }
+ // console.log("xx",result.response);
+ that.loading = false;
+ if ( result.code == 0 ) {
+ if ( result.response.isLogin ){
+ that.sourceUser()
+ }
+ that.getData = result.response
+
+ } else {
+ console.log(result.msg);
+ }
});
},
@@ -150,14 +147,11 @@
couponModel.giveCoupon(params,token).then(function (result) {
that.loading = false;
- console.log(result)
+ console.log("信息",result)
if (result.code === 0 || result.code === 3) {
-
window.history.go(0);
-// hide_layer(1);
} else if (result.code === 666) {
- alert("您还没登录,请先登录!");
-
+ that.$vux.toast.text("您还没登录,请先登录!","middle");
setTimeout(function () {
window.location.href = locationUrl + '/mall/web/user/login?callback=' + encodeURIComponent(window.location.href);
}, 1000);
@@ -169,10 +163,9 @@
}
});
- },
+ },
sourceUser (){
var sourceUserId = this.$route.query.sourceUserId
- console.log("22",sourceUserId)
if ( sourceUserId ){
couponModel.sourceUser(sourceUserId).then(res => {
@@ -194,7 +187,7 @@
// 初始化
this.handleInit();
- this.sourceUser()
+
}
}
diff --git a/src/view/poster.vue b/src/view/poster.vue
index a79ce8c..2f0f891 100644
--- a/src/view/poster.vue
+++ b/src/view/poster.vue
@@ -1,15 +1,15 @@
-
-
+
+
+
+
-
+
@@ -35,7 +35,10 @@
return {
show: false,
imgSrc: "",
- // ImgFix: false,
+ merchantNo: "", //商户编号
+ isAuthorize: false,
+ authorizeSrc : '',
+ ImgFix: true,
defaultCity: '天河区',
addressData: [],
addressValue: [],
@@ -53,6 +56,7 @@
methods: {
getCityName (){
let name = localStorage.getItem("cityName")||''
+ console.log(name)
if(!name){
return
}
@@ -61,12 +65,19 @@
let cityNameArr = arr[2].split('&')
let cityName = cityNameArr[1]
this.defaultCity = cityName
+ this.merchantNo = cityNameArr[2]
},
getPoster (){
- var merchantNo = $("#merchantNo").val()
+ var merchantNo = this.merchantNo
+ //console.log(merchantNo)
posterApi.getPoster(merchantNo).then(res => {
+ console.log("res",res)
if ( res.code == 0 ){
+ this.authorizeSrc = res.data.oauthUrl || ''
+ if ( res.data.hasOAuth == 1 ){
+ this.isAuthorize = true
+ }
if ( res.data.imageUrl ){
this.imgSrc = res.data.imageUrl
@@ -74,7 +85,7 @@
if ( res.data.hasOAuth == 0 ){
location.href = res.data.oauthUrl
return
- } else {
+ } else {
createPoster()
}
@@ -90,7 +101,12 @@
})
},
createPoster (status){
- var merchantNo = $("#merchantNo").val()
+ console.log(111,this.authorizeSrc)
+ if ( !this.isAuthorize ){
+ location.href = this.authorizeSrc
+ return;
+ }
+ var merchantNo = this.merchantNo
posterApi.createPoster({"merchantNo":merchantNo}).then(res => {
if ( res.code == 0 ){
if ( status ){
@@ -111,11 +127,10 @@
let arr = this.addressValue[2].split('&')
this.defaultCity = arr[1]
this.show = false
- $("#merchantNo").val(arr[2])
+ this.merchantNo = arr[2]
},
change (name) {
this.addressValue = name
-
},
getAddress (){
homeApi.getAddress().then(res => {
@@ -132,11 +147,9 @@
}
},
mounted() {
- window.onload=()=>{
- this.getPoster();
- this.getAddress()
- this.getCityName()
- }
+ this.getCityName()
+ this.getPoster();
+ this.getAddress()
}
};
@@ -210,10 +223,10 @@
display: block;
margin-top: 0.5rem;
}
-/*.weixin {
+.weixin {
width: 100%;
position: fixed;
z-index: 100;
-}*/
+}
\ No newline at end of file
diff --git a/src/view/service-evaluation.vue b/src/view/service-evaluation.vue
index 41ecd09..f04bd51 100644
--- a/src/view/service-evaluation.vue
+++ b/src/view/service-evaluation.vue
@@ -44,6 +44,7 @@
