对接首页列表数据,添加购物车接口
parent
d9a876a4ce
commit
4f36f99210
3
App.vue
3
App.vue
|
@ -14,7 +14,7 @@
|
|||
url: this.globalData.hostapi +'/api/user/login',
|
||||
data:{code:res.code},
|
||||
success: (result) => {
|
||||
console.log(result);
|
||||
if(result.data.data.is_active) {
|
||||
uni.setStorageSync('userId',result.data.account_id);
|
||||
uni.setStorageSync('token',result.data.data.token);//缓存token
|
||||
uni.setStorageSync('openid',result.data.data.openid);//缓存openid
|
||||
|
@ -23,6 +23,7 @@
|
|||
uni.setStorageSync('is_active',result.data.data.is_active);//是否授权头像和昵称
|
||||
uni.setStorageSync('invite_code',result.data.data.invite_code);//缓存邀请码
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
<view class="disac fw" :style="{paddingBottom:itemTop,backgroundColor: backc}">
|
||||
<block v-for="(item,index) in list" :key="index">
|
||||
<view @tap="chooseGe(item.url,index)" class="disjcac fc pad-s30" :style="{width:['50%','50%','50%','33.3%','25%','20%'][rowNum],paddingTop:itemTop}">
|
||||
<view class="disjcac icon-box" :style="{width:iconwh,height:iconwh}" :class="ifShadow ? 'haveShadow' : ''">
|
||||
<view class="disjcac icon-box posir" :style="{width:iconwh,height:iconwh}" :class="ifShadow ? 'haveShadow' : ''">
|
||||
<image :src="item.iconsrc" mode="aspectFill" :style="{width: item.iconWidth +'rpx',height: item.iconHeight +'rpx'}"></image>
|
||||
<view class="posia fon24 textc bacf" v-if="item.num" style="right: -20rpx;top: -20rpx;border-radius: 100%;">{{item.num}}</view>
|
||||
</view>
|
||||
<view class="clips1" :style="{color:titlec,fontSize:fonts,marginTop:titleTop}">{{item.title}}</view>
|
||||
</view>
|
||||
|
@ -18,13 +19,13 @@
|
|||
type:Array,
|
||||
default:()=>{
|
||||
return [
|
||||
{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题一'},
|
||||
{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题二'},
|
||||
{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题三'},
|
||||
{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题四'},
|
||||
{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题五'},
|
||||
{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题五'},
|
||||
{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题五'},
|
||||
{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题一',num:0},
|
||||
{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题二',num:0},
|
||||
{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题三',num:0},
|
||||
{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题四',num:0},
|
||||
{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题五',num:0},
|
||||
{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题五',num:0},
|
||||
{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题五',num:0},
|
||||
]
|
||||
}
|
||||
},
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<view>
|
||||
<view class="fon36 colb bold mar-x40" v-if="ifTitle">{{title}}</view>
|
||||
<view class="disjbac fw">
|
||||
<view class="width48_5 fon30 mar-x30" @tap="goDetail(index)" v-for="(item,index) in dataList" :key="index">
|
||||
<view class="width48_5 fon30 mar-x30" @tap="goDetail(item.id)" v-for="(item,index) in dataList" :key="index">
|
||||
<view class="" style="height: 342rpx;">
|
||||
<image class="radius30 width100" :src="item.imgsrc" mode="aspectFill" style="height: 342rpx;"></image>
|
||||
</view>
|
||||
|
@ -10,7 +10,7 @@
|
|||
<view class="line-h50 mar-sx25 clips2" style="height: 90rpx;">{{item.title}}</view>
|
||||
<view class="textc disjbac">
|
||||
<view class="">¥{{item.price}}</view>
|
||||
<i @tap.stop="addCartEv(index)" class="icon icon-shop-cart" style="font-size: 40rpx;"></i>
|
||||
<i @tap.stop="addCartEv(item.skuId)" class="icon icon-shop-cart" style="font-size: 40rpx;"></i>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -46,22 +46,25 @@
|
|||
data() {
|
||||
return {
|
||||
dataList:[
|
||||
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖入海盐太妃糖入海盐太妃糖入海盐太妃糖入海盐太妃糖',price:'2,000'},
|
||||
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'},
|
||||
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'},
|
||||
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'},
|
||||
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'},
|
||||
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'},
|
||||
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'},
|
||||
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'},
|
||||
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'},
|
||||
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'},
|
||||
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'},
|
||||
{id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖入海盐太妃糖入海盐太妃糖入海盐太妃糖入海盐太妃糖',price:'2,000'},
|
||||
{id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'},
|
||||
{id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'},
|
||||
{id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'},
|
||||
{id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'},
|
||||
{id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'},
|
||||
{id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'},
|
||||
{id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'},
|
||||
{id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'},
|
||||
{id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'},
|
||||
{id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'},
|
||||
],
|
||||
ifLoading:false,
|
||||
total:0
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getList();
|
||||
},
|
||||
methods:{
|
||||
moreEv() {
|
||||
this.ifLoading = true;
|
||||
|
@ -70,16 +73,42 @@
|
|||
this.ifLoading = false;
|
||||
console.log(this.total);
|
||||
},2000)
|
||||
console.log('触底了');
|
||||
},
|
||||
// 列表查询
|
||||
getList(){
|
||||
this.$requst.post('/api/spu/home').then(res=>{
|
||||
if(res.code) {
|
||||
if(res.data.list.length) {
|
||||
res.data.list.forEach(item=>{
|
||||
let obj = {
|
||||
id:item.id,
|
||||
skuId:item.skuId,
|
||||
imgsrc:item.cover,
|
||||
title:item.name,
|
||||
price:this.$toolAll.tools.changeNum(parseInt(item.original_price)+'')
|
||||
}
|
||||
this.dataList.push(obj);
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 加入购物车
|
||||
addCartEv(id) {
|
||||
if(this.$toolAll.tools.judgeAuth()) {
|
||||
this.$requst.post('/api/order/shopping-cart-add',{sku_id:id,num:1}).then(res=>{
|
||||
if(res.code==0) {
|
||||
this.$toolAll.tools.showToast('加入购物车成功(*^▽^*)')
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
// 去详情
|
||||
goDetail(id) {
|
||||
uni.navigateTo({
|
||||
url:'/pagesB/shop-detail/shop-detail'
|
||||
url:`/pagesB/shop-detail/shop-detail?id=${id}`
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -383,7 +383,6 @@ const tools = {
|
|||
judgeAuth(){
|
||||
let auth = false;
|
||||
clearTimeout(this.authTimer);
|
||||
console.log(uni.getStorageSync('token'),1234);
|
||||
if(!uni.getStorageSync('token')) {
|
||||
this.showToast('请授权登录');
|
||||
this.authTimer = setTimeout(()=>{
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<scroll-view scroll-y :style="{height: scrollHeight +'px'}" class="bacf">
|
||||
<view class="pad-x160">
|
||||
<view class="flexs clips1 pad-z20 fon24"
|
||||
@tap="chooseCate(index)" :style="{backgroundColor: current==index ? '#ff3673' : '#FFFFFF',color: current==index ? '#FFFFFF' : '#000000'}"
|
||||
@tap="chooseCate(index,item.id)" :style="{backgroundColor: current==index ? '#ff3673' : '#FFFFFF',color: current==index ? '#FFFFFF' : '#000000'}"
|
||||
v-for="(item,index) in cateList" :key="index" style="min-width: 160rpx;height: 86rpx;line-height: 86rpx;box-sizing: border-box;" >{{item.title}}</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
@ -23,8 +23,8 @@
|
|||
<view class="width100 disjb fc mar-z20" style="height: 240rpx;">
|
||||
<view class="fon30 colb clips2">{{item.title}}</view>
|
||||
<view class="">
|
||||
<view class="fon36 textc mar-x36">¥{{$toolAll.tools.changeNum(item.price)}}</view>
|
||||
<view @tap.stop="addCartEv(index)" class="colf disjcac fon24 radius30 cate-btn">
|
||||
<view class="fon36 textc mar-x36">¥{{item.price}}</view>
|
||||
<view @tap.stop="addCartEv(item.id)" class="colf disjcac fon24 radius30 cate-btn">
|
||||
<i class="icon icon-shop-cart mar-y10" style="font-size: 36rpx;"></i>
|
||||
立即选购
|
||||
</view>
|
||||
|
@ -52,7 +52,7 @@
|
|||
import swiperTabJl from '@/components/swiper-tab/swiper-tab-jl.vue';
|
||||
// 底部组件
|
||||
import footTab from '@/components/foot-tabs/foot-tab.vue';
|
||||
import { mapState,mapGetters,mapMutations } from 'vuex'//引入mapState
|
||||
import { mapState } from 'vuex'//引入mapState
|
||||
export default {
|
||||
components:{
|
||||
'foot-tab' :footTab,
|
||||
|
@ -66,16 +66,16 @@
|
|||
scrollHeight:uni.getSystemInfoSync().windowHeight - uni.getSystemInfoSync().statusBarHeight - 50,
|
||||
newWidth:uni.getSystemInfoSync().windowWidth,
|
||||
cateList:[
|
||||
{id:1,title:'推荐套装'},
|
||||
{id:1,title:'推荐套装'},
|
||||
{id:1,title:'推荐套装'},
|
||||
{id:1,title:'推荐套装'},
|
||||
{id:1,title:'推荐套装'},
|
||||
{id:1,title:'推荐套装'},
|
||||
{id:1,title:'推荐套装'},
|
||||
{id:1,title:'推荐套装'},
|
||||
{id:1,title:'推荐套装'},
|
||||
{id:1,title:'推荐套装'},
|
||||
// {id:1,title:'推荐套装'},
|
||||
// {id:1,title:'推荐套装'},
|
||||
// {id:1,title:'推荐套装'},
|
||||
// {id:1,title:'推荐套装'},
|
||||
// {id:1,title:'推荐套装'},
|
||||
// {id:1,title:'推荐套装'},
|
||||
// {id:1,title:'推荐套装'},
|
||||
// {id:1,title:'推荐套装'},
|
||||
// {id:1,title:'推荐套装'},
|
||||
// {id:1,title:'推荐套装'},
|
||||
],
|
||||
secendCateList:[
|
||||
{title:'标题一'},
|
||||
|
@ -90,22 +90,25 @@
|
|||
],
|
||||
activeIndex:0,
|
||||
dataList:[
|
||||
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题',price:199},
|
||||
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
||||
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
||||
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
||||
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
||||
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
||||
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
||||
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
||||
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
||||
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
||||
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
||||
{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
||||
// {imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题',price:199},
|
||||
// {imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
||||
// {imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
||||
// {imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
||||
// {imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
||||
// {imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
||||
// {imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
||||
// {imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
||||
// {imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
||||
// {imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
||||
// {imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
||||
// {imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000},
|
||||
],
|
||||
page:1,
|
||||
size:10,
|
||||
total:0,
|
||||
flag:true,
|
||||
ifLoading:false
|
||||
ifLoading:false,
|
||||
pid:''//分类id
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
|
@ -114,29 +117,71 @@
|
|||
}),
|
||||
},
|
||||
onLoad(op) {
|
||||
// 获取元素宽
|
||||
const query = wx.createSelectorQuery().in(this)
|
||||
query.select('.cate-left-box').boundingClientRect((rect) => {
|
||||
this.newWidth = this.newWidth - rect.width - 20;
|
||||
}).exec()
|
||||
console.log(this.footHeight);
|
||||
this.scrollHeight = this.scrollHeight - this.footHeight;
|
||||
if(op.index) {
|
||||
this.current = op.index;
|
||||
}
|
||||
this.checkShopCate();
|
||||
},
|
||||
methods: {
|
||||
// 查询商品列表
|
||||
checkShopList(id){
|
||||
this.ifLoading = true;
|
||||
let params = {
|
||||
page:this.page,// query 否 1 页数
|
||||
size:this.size,// query 否 10 每页数量
|
||||
pid:id
|
||||
}
|
||||
this.$requst.post('/api/spu/list',params).then(res=>{
|
||||
if(res.code==0) {
|
||||
this.total = res.data.total;
|
||||
if(this.page==1) this.dataList = [];
|
||||
if(res.data.list.length) {
|
||||
res.data.list.forEach(item=>{
|
||||
let obj = {
|
||||
id:item.id,
|
||||
imgsrc:item.cover,
|
||||
title:item.name,
|
||||
price:this.$toolAll.tools.changeNum(parseInt(item.price)+'')
|
||||
}
|
||||
this.dataList.push(obj);
|
||||
})
|
||||
}
|
||||
}
|
||||
this.ifLoading = false;
|
||||
})
|
||||
},
|
||||
// 查询左侧分类列表
|
||||
checkShopCate(){
|
||||
this.$requst.post('/api/spu/category').then(res=>{
|
||||
if(res.code==0) {
|
||||
this.cateList = res.data;
|
||||
setTimeout(()=>{
|
||||
// 获取元素宽
|
||||
const query = wx.createSelectorQuery().in(this)
|
||||
query.select('.cate-left-box').boundingClientRect((rect) => {
|
||||
this.newWidth = this.newWidth - rect.width - 20;
|
||||
}).exec()
|
||||
},200)
|
||||
this.pid = this.cateList[0].id;
|
||||
this.checkShopList(this.cateList[0].id);
|
||||
}
|
||||
})
|
||||
},
|
||||
scrollBottomEv(){
|
||||
console.log('触底了');
|
||||
this.ifLoading = true;
|
||||
setTimeout(()=>{
|
||||
this.total = this.dataList.length;
|
||||
this.ifLoading = false;
|
||||
},2000)
|
||||
if(this.total!=this.dataList.length) {
|
||||
this.page++;
|
||||
this.checkShopList(this.pid);
|
||||
}
|
||||
},
|
||||
// 一级分类选择
|
||||
chooseCate(index) {
|
||||
chooseCate(index,id) {
|
||||
this.current = index;
|
||||
this.page = 1;
|
||||
this.pid = id;
|
||||
this.checkShopList(id);
|
||||
},
|
||||
goDetail(id) {
|
||||
uni.navigateTo({
|
||||
|
@ -144,7 +189,13 @@
|
|||
})
|
||||
},
|
||||
addCartEv(id) {
|
||||
this.$requst.post('/api/order/shopping-cart-add',{sku_id:id,num:1}).then(res=>{
|
||||
if(res.code==0) {
|
||||
this.$toolAll.tools.showToast('加入购物车成功(*^▽^*)')
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(res.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
// tab点击事件
|
||||
clickTab(index){
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
<status-nav :ifReturn="false" titleColor="#FFFFFF" navBarTitle="个人中心" backgroudColor="transparent"></status-nav>
|
||||
<view class="head-box" :style="{paddingTop: padt+'px'}" style="background: linear-gradient( to top, #ff3574 0%, #fd5646 100%);position: fixed;top: 0;left: 0;right: 0;z-index: 2;">
|
||||
<view class="mar-zy40 mar-s20 mar-x90 disac colf fon36">
|
||||
<image src="https://s6.jpg.cm/2022/02/14/L4oDhy.jpg" mode="aspectFill" style="width: 126rpx;height: 126rpx;border-radius: 100%;border: 6rpx solid #FFFFFF;"></image>
|
||||
<view class="mar-z30">Anita Rose</view>
|
||||
<image :src="userImg" mode="aspectFill" style="width: 126rpx;height: 126rpx;border-radius: 100%;border: 6rpx solid #FFFFFF;"></image>
|
||||
<view class="mar-z30">{{userName}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pad-zy40" :style="{paddingTop: headHeight+'px'}" style="position: relative;z-index: 3;">
|
||||
|
@ -27,9 +27,10 @@
|
|||
<image :src="imgsrc" style="width: 380rpx;height: 380rpx;" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="colf line-h56 mar30">
|
||||
<view class="fon36">请扫描二维码添加微信告知您的订单号并支付定金 ,发货前请支付尾款。</view>
|
||||
<!-- <view class="fon36">请扫描二维码添加微信告知您的订单号并支付定金 ,发货前请支付尾款。</view>
|
||||
<view class="fon24 tcenter">(支付定金后,我们才会开始制作哦,如您有特别的要求可以在微信上提出哦!)</view>
|
||||
<view class="fon36 tcenter">祝您幸福美满!</view>
|
||||
<view class="fon36 tcenter">祝您幸福美满!</view> -->
|
||||
<rich-text :nodes="addwxcontent"></rich-text>
|
||||
</view>
|
||||
<view @tap.stop="saveImg" class="navigate-to-where radius30 colf fon36 tcenter mar-s50 bold mar-zy30">保存二维码</view>
|
||||
</view>
|
||||
|
@ -59,10 +60,10 @@
|
|||
padt:uni.getSystemInfoSync().statusBarHeight + 50,
|
||||
headHeight:'',//头部导航高
|
||||
list:[
|
||||
{url:'',iconsrc:'/static/public/icon-payment.png',iconWidth:50,iconHeight:44,title:'已下单'},
|
||||
{url:'',iconsrc:'/static/public/icon-send-goods.png',iconWidth:46,iconHeight:40,title:'制作中'},
|
||||
{url:'',iconsrc:'/static/public/icon-take.png',iconWidth:48,iconHeight:42,title:'已发货'},
|
||||
{url:'',iconsrc:'/static/public/icon-finish.png',iconWidth:49,iconHeight:44,title:'已完成'},
|
||||
{url:'',iconsrc:'/static/public/icon-payment.png',iconWidth:50,iconHeight:44,title:'已下单',num:0},
|
||||
{url:'',iconsrc:'/static/public/icon-send-goods.png',iconWidth:46,iconHeight:40,title:'制作中',num:0},
|
||||
{url:'',iconsrc:'/static/public/icon-take.png',iconWidth:48,iconHeight:42,title:'已发货',num:0},
|
||||
{url:'',iconsrc:'/static/public/icon-finish.png',iconWidth:49,iconHeight:44,title:'已完成',num:0},
|
||||
],
|
||||
list1: [
|
||||
{url:'/pagesA/order-list/order-list',iconsrc:'',iconWidth:60,iconHeight:60,title:'我的订单',content:'全部订单',contentColor:'#999999',ifNext:true},
|
||||
|
@ -74,7 +75,10 @@
|
|||
{url:'/pagesB/business-profile/business-profile',iconsrc:'/static/public/icon-aboutus.png',iconWidth:34,iconHeight:32,title:'商家简介',content:'',contentColor:'#999999',ifNext:true},
|
||||
],
|
||||
ifWx:false,
|
||||
imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg'
|
||||
imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',
|
||||
userImg:'',
|
||||
userName:'',
|
||||
addwxcontent:''
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
|
@ -83,14 +87,35 @@
|
|||
onHide() {
|
||||
this.ifWx = false;
|
||||
},
|
||||
onShow() {
|
||||
this.getUserInfo();
|
||||
},
|
||||
onLoad() {
|
||||
// 缓存状态栏+标题栏的高度
|
||||
const query = wx.createSelectorQuery().in(this)
|
||||
query.select('.head-box').boundingClientRect((rect) => {
|
||||
this.headHeight = rect.height - this.padt;
|
||||
}).exec()
|
||||
}).exec();
|
||||
this.$requst.get('/api/index/add-wechat').then(res=>{
|
||||
if(res.code==0) {
|
||||
this.addwxcontent = this.$toolAll.tools.escape2Html(res.data.content);
|
||||
this.imgsrc = getApp().globalData.hostapi + res.data.wechat;
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
getUserInfo(){
|
||||
this.$requst.get('/api/user/info').then(res=>{
|
||||
if(res.code==0) {
|
||||
this.userImg = res.data.headimgurl;
|
||||
this.userName = res.data.nickname;
|
||||
this.list[0].num = res.data.order_count.paid;
|
||||
this.list[1].num = res.data.order_count.waiting;
|
||||
this.list[2].num = res.data.order_count.shipped;
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
chooseEv(obj) {
|
||||
if(obj.url) {
|
||||
uni.navigateTo({
|
||||
|
|
|
@ -62,7 +62,6 @@
|
|||
}
|
||||
},
|
||||
onReachBottom(e) {
|
||||
console.log(e);
|
||||
this.$refs.listhome.moreEv();
|
||||
},
|
||||
onHide() {
|
||||
|
@ -82,6 +81,7 @@
|
|||
},
|
||||
methods: {
|
||||
chooseGe(obj) {
|
||||
if(this.$toolAll.tools.judgeAuth()) {
|
||||
let exist = obj.url.slice(0,18);
|
||||
if(exist=='/pages/tabbar/cate') {
|
||||
uni.reLaunch({
|
||||
|
@ -92,6 +92,7 @@
|
|||
url:obj.url
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
goSearch(){
|
||||
uni.navigateTo({
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
<status-container titlet="关于我们" :ifCustomer='false'>
|
||||
<view slot="content">
|
||||
<view class="pad20">
|
||||
<view class="radius30 bacf pad-sx40 pad-zy40 mar-x30" v-if="username">
|
||||
<view class="fon36 colb">{{name}}</view>
|
||||
<view class="radius30 bacf pad-sx40 pad-zy40 mar-x30" v-if="company_name">
|
||||
<view class="fon36 colb">{{company_name}}</view>
|
||||
<view class="fon30 colb mar-s20 mar-x10">{{phone}}({{username}})</view>
|
||||
<view class="fon24" style="color: #8c8c9b;">{{address}}</view>
|
||||
</view>
|
||||
|
@ -27,26 +27,33 @@
|
|||
richText:'',
|
||||
lat:'',
|
||||
lng:'',
|
||||
name:'',
|
||||
company_name:'',
|
||||
address:''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.checkAboutUs();
|
||||
},
|
||||
methods: {
|
||||
// 查询关于我们信息
|
||||
checkAboutUs(){
|
||||
this.$requst.post('/api/index/about').then(res=>{
|
||||
if(res.code==0){
|
||||
this.lat = res.data.lat;
|
||||
this.lng = res.data.lon;
|
||||
this.richText = this.$toolAll.tools.escape2Html(res.data.content);
|
||||
this.address = res.data.address;
|
||||
let obj = res.data;
|
||||
this.lat = obj.lat;
|
||||
this.lng = obj.lon;
|
||||
this.phone = obj.phone
|
||||
this.username = obj.contacts;
|
||||
this.richText = this.$toolAll.tools.escape2Html(obj.content);
|
||||
this.address = obj.address;
|
||||
this.company_name = obj.company_name;
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
}
|
||||
})
|
||||
},
|
||||
goThere(){
|
||||
this.$toolAll.tools.goThere(this.lat,this.lng,this.name,this.address);
|
||||
this.$toolAll.tools.goThere(this.lat,this.lng,this.company_name,this.address);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<view>
|
||||
<status-container titlet="购买须知" :ifCustomer='false'>
|
||||
<view slot="content">
|
||||
<rich-text :nodes="content"></rich-text>
|
||||
<rich-text :nodes="richText" class="fon24 colpeili line-h46"></rich-text>
|
||||
</view>
|
||||
</status-container>
|
||||
</view>
|
||||
|
@ -12,11 +12,17 @@
|
|||
export default {
|
||||
data(){
|
||||
return {
|
||||
|
||||
richText:''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
this.$requst.post('/api/index/purchaseinstructions').then(res=>{
|
||||
if(res.code==0){
|
||||
this.richText = this.$toolAll.tools.escape2Html(res.data.content);
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
this.checkDisclaimerEv();
|
||||
},
|
||||
methods: {
|
||||
// 查询免责声明信息
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
</view>
|
||||
<view class="login-box">
|
||||
<button class='login-btn' :style="{background:publicColor || 'linear-gradient(to right, #ff3772 0%,#fd5548 100%)'}" type='primary' @click="bindGetUserInfo">微信授权</button>
|
||||
<view class="xie-box">登录代表您已同意<text @tap="goXie" class="xieCon">《用户服务协议》</text></view>
|
||||
<view class="xie-box">登录代表您已同意<text @tap="goXie" class="xieCon" style="color: #ff3772;">《用户服务协议》</text></view>
|
||||
</view>
|
||||
<!-- <view v-if="isShowP" class="disjcac posAll">
|
||||
<view class="bacf radius20 width100 tank-box">
|
||||
|
|
Loading…
Reference in New Issue