Browse Source

测试 完成

feature/feature-compatible
fengchengzhi 7 years ago
parent
commit
c9f20a6ab4
13 changed files with 146 additions and 69 deletions
  1. 2
      src/api/poster.js
  2. BIN
      src/assets/images/icon/home-s.png
  3. BIN
      src/assets/images/icon/home.png
  4. BIN
      src/assets/images/icon/my-s.png
  5. BIN
      src/assets/images/icon/my.png
  6. BIN
      src/assets/images/icon/server-s.png
  7. BIN
      src/assets/images/icon/server.png
  8. 57
      src/components/nav-bottom.vue
  9. 3
      src/router/index.js
  10. 68
      src/view/home.vue
  11. 39
      src/view/month-card.vue
  12. 45
      src/view/poster.vue
  13. 1
      src/view/service-evaluation.vue

2
src/api/poster.js

@ -3,7 +3,7 @@ export default {
//获取海报信息
getPoster: {
method: 'GET',
url: '/mall/web/consumer_add/:merchantNo',
url: '/mall/web/recommend/:merchantNo/coupon',
},
//生成海报
createPoster:{

BIN
src/assets/images/icon/home-s.png

Before After
Width: 69  |  Height: 66  |  Size: 2.2 KiB

BIN
src/assets/images/icon/home.png

Before After
Width: 69  |  Height: 66  |  Size: 1.9 KiB

BIN
src/assets/images/icon/my-s.png

Before After
Width: 54  |  Height: 69  |  Size: 2.6 KiB

BIN
src/assets/images/icon/my.png

Before After
Width: 54  |  Height: 69  |  Size: 2.3 KiB

BIN
src/assets/images/icon/server-s.png

Before After
Width: 69  |  Height: 59  |  Size: 2.6 KiB

BIN
src/assets/images/icon/server.png

Before After
Width: 69  |  Height: 59  |  Size: 2.3 KiB

57
src/components/nav-bottom.vue

@ -0,0 +1,57 @@
<template>
<div class="router-bottom">
<router-link :class="{active:$route.name=='首页'}" to="/home">
<img v-if="$route.name!='首页'" src="../assets/images/icon/home.png" />
<img v-else src="../assets/images/icon/home-s.png">
<span>首页</span>
</router-link>
<a href="http://test.1hjz.cn/mall/web/appoint_index">
<img src="../assets/images/icon/server.png" />
<span>服务</span>
</a>
<a href="http://test.1hjz.cn/mall/web/owner" >
<img src="../assets/images/icon/my.png" />
<span>我的</span>
</a>
</div>
</template>
<script>
export default {
methods: {
}
}
</script>
<style>
.router-bottom {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 1rem;
box-sizing: border-box;
border-top: 1px solid #ddd;
}
.router-bottom a {
list-style: none;
color: #999999;
}
.router-bottom a img {
width: 0.4rem;
height: 0.4rem;
display: block;
margin-bottom: 0.1rem;
}
.router-bottom a span {
height:0.2rem;
font-size:0.2rem;
font-weight:400;
display: block;
}
a.active {
color: #29B079;
}
</style>

3
src/router/index.js

@ -55,6 +55,9 @@ let router = new Router({
path: '/demo',
name: 'demo',
component: demo
},{
path:"/",
redirect:"/home"
}
]
})

68
src/view/home.vue

@ -1,19 +1,15 @@
<template>
<div class="home">
<!--<input type="hidden" id="openedDistrict" th:value="${openedDistrict}"/>-->
<input type="hidden" id="merchantNo" th:value="${merchantNo}"/> <!--商户标号-->
<input type="hidden" id="districtId" th:value="${districtId}"/> <!--选定区县id-->
<div class="page-top">
<div ref="test" class="page-top">
<i class="position" @click="show = true"><img src="../assets/images/icon/position.png"/>{{defaultCity}}</i>
<i class="logo"><img src="../assets/images/icon/logo.png" /></i>
<i class="text"><a href="tel:400-6080100">联系客服</a></i>
</div>
<div class="page-content">
<div class="banner">
<div class="banner" v-if="bannerImgList.length > 0">
<swiper :options="swiperOption">
<swiper-slide v-for="(item,index) in bannerImgList" v-if="bannerImgList.length > 0" :key="index">
<swiper-slide v-for="(item,index) in bannerImgList" :key="index">
<div class="swiper-img" :style="{backgroundImage:'url('+item.imgUrl+')'}"></div>
<!--<img src="../../dist/static/img/slider-img.21dc32f.png"/>-->
</swiper-slide>
@ -24,8 +20,8 @@
</swiper>
</div>
<div class="coupon" >
<a v-if="promotionImgList != {}" :href="promotionImgList.linkUrl || ''"><img :src="promotionImgList.imgUrl"/></a>
<div class="coupon" v-if="promotionImgList == {}">
<a :href="promotionImgList.linkUrl || ''"><img :src="promotionImgList.imgUrl"/></a>
</div>
<div class="new-card" v-for="item in goodsList">
<div class="new-card-top">
@ -52,6 +48,10 @@
</div>
</div>
<div class="page-bottom">
<routerFooter></routerFooter>
</div>
<popup v-model="show">
<div class="picke-address">
<div class="status-btn">
@ -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<goodsList.length;i++){
@ -166,14 +167,15 @@
},
//
getdefaultAddress (){
console.log(123)
homeApi.getdefaultAddress().then(res => {
//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()
}
};
</script>
@ -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;

39
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()
}
}
</script>

45
src/view/poster.vue

@ -1,15 +1,15 @@
<template>
<div class="poster">
<!--<img class="weixin" src="../assets/images/poster/weixin.png" v-show="ImgFix" @click="ImgFix = false" />-->
<input type="hidden" id="merchantNo" th:value="${merchantNo}"/>
<img class="weixin" src="../assets/images/poster/weixin.png" v-show="ImgFix" @click="ImgFix = false" />
<!--<input type="hidden" id="merchantNo" th:value="${merchantNo}"/>-->
<div class="page-top">
<a @click="goBack()"><img src="../assets/images/my-money/left.png" /></a>
<i class="name">分销海报</i>
<i class="text" @click="show = true">{{defaultCity}}</i>
</div>
<div class="page-content">
<img class="poster-img" :src="imghost + imgSrc">
<img class="poster-img" v-if="imgSrc != ''" :src="imghost + imgSrc">
<button class="create-poster" @click="createPoster(1)">重新生成海报</button>
</div>
@ -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()
}
};
</script>
@ -210,10 +223,10 @@
display: block;
margin-top: 0.5rem;
}
/*.weixin {
.weixin {
width: 100%;
position: fixed;
z-index: 100;
}*/
}
</style>

1
src/view/service-evaluation.vue

@ -44,6 +44,7 @@
<textarea v-model="content" name="" id="" class="message" placeholder="您的宝贵意见,将帮助我们提升服务"></textarea>
<button @click="submit" class="submitBtn">提交</button>
</div>
<!--问题弹出框-->
<!-- <div id="popup-question" class="popup-box" style="display:block">

Loading…
Cancel
Save