作者 lihongjuan

111

... ... @@ -208,6 +208,12 @@
border-radius: 32rpx;
padding: 0 20rpx;
}
.navmiddlek{
width: 580rpx;
background: rgba(249, 249, 249, 1);
border-radius: 32rpx;
padding: 0 20rpx;
}
.middleleft {
width: 32rpx;
... ... @@ -655,7 +661,7 @@
height: 4rpx;
background: #C29445;
position: absolute;
bottom: -20rpx;
bottom: -30rpx;
left: 50%;
transform: translateX(-50%);
... ...
... ... @@ -43,12 +43,13 @@
selectgood(e){
let id=e.currentTarget.dataset.id;
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2]; //上一个页面
// let pages = getCurrentPages();
// let prevPage = pages[pages.length - 2]; //上一个页面
//直接调用上一个页面的setData()方法,把数据存到上一个页面中去
prevPage.setData({
selectId: id,
});
uni.setStorageSync("selectId",id)
// prevPage.setData({
// selectId: id,
// });
uni.navigateBack({
checked:true
})
... ...
... ... @@ -21,8 +21,6 @@
<view class="cartnum">16</view>
</view>
</view>
<view class="homehead">
<view class="headtopimg">
<image src="../../static/headtop.png" mode=""></image>
... ... @@ -68,7 +66,6 @@
<image src="../../static/miaosha.png" mode=""></image>
</view>
<view class="homename">秒杀专区</view>
</view>
<view class="homeboxitem flexfour">
<view class="homeitemimg">
... ...
... ... @@ -11,7 +11,7 @@
<view class="tapnav flextwo">
<view class="tapnavitem" :class="order==0?'tapnavactive':''" @click="kindlist" :data-id="0">分类</view>
<view class="tapnavitem" :class="order==1?'tapnavactive':''" @click="orderrange" :data-id="1">综合</view>
<view class="tapnavitem" :class="order==3?'tapnavactive':''" @click="orderrange" :data-id="2">销量</view>
<view class="tapnavitem" :class="order==2?'tapnavactive':''" @click="orderrange" :data-id="2">销量</view>
<view class="tapnavitem flexone" :class="order==3||order==4?'tapnavactive':''" @click="selprice">
<view class="tapprice">价格</view>
<view class="tapbox flexfour">
... ... @@ -23,6 +23,8 @@
</view>
</view>
</view>
</view>
<view class="nodata" v-if="show">暂无数据</view>
<view class="homeshoplist flexone goodboxlist" v-else>
... ... @@ -54,7 +56,7 @@
page: 1,
keyword: '',
shoplist: [],
order: '',
order: -1,
score_category_id:'',
show:false
... ... @@ -78,6 +80,7 @@
// 分类
kindlist(e){
this.order=e.currentTarget.dataset.id;
uni.setStorageSync("selectId","")
uni.navigateTo({
url:'/pages/homepage/goodkind'
})
... ... @@ -131,21 +134,15 @@
url: '/pages/nearshop/goodtail?id=' + id + '&type=' + 2
})
}
},
onShow:function(){
let pages = getCurrentPages();
let currPage = pages[pages.length - 1]; //当前页面
this.score_category_id = currPage.data.selectId==undefined?'':currPage.data.selectId;
// let pages = getCurrentPages();
// let currPage = pages[pages.length - 1]; //当前页面
// this.score_category_id = currPage.data.selectId==undefined?'':currPage.data.selectId;
this.score_category_id=uni.getStorageSync("selectId")!=''?uni.getStorageSync("selectId"):''
this.shoplist=[];
this.page=1
this.page=1;
this.getfoodlist();
}
}
... ...
... ... @@ -29,14 +29,8 @@
<view class="huiyuanprice dikou">会员价:¥{{item.vip_price}}</view>
<view class="goodshou">已售{{item.sales}}</view>
</view>
</view>
</view>
</view>
</template>
... ...
<template>
<view class="content">
<view class="editcart" @click="editcart">{{editsel==true?'编辑':'完成'}}</view>
<!-- <view class="editcart" @click="finishedit" v-else>完成</view> -->
<view class="sureshop">
<!-- 店铺商品-->
<view v-if="data1.length!=0">
... ... @@ -7,30 +10,30 @@
<view class="sureimg">
<image src="../../static/nearshop.png" mode=""></image>
</view>
<view class="sureshopname">红大地面品厂</view>
<view class="sureshopname">{{data1[0].name}}</view>
</view>
<view class='cartlist'>
<view class="sureorderitem flexone">
<view class="cartselimg">
<image src="../../static/cartsel.png" mode=""></image>
<view class="sureorderitem flexone" v-for="(item,index) in data1[0].list" :key="index">
<view class="cartselimg" @click="selectcart(item,index)">
<image src="../../static/cartnosel.png" mode="" v-if="item.sel==false"></image>
<image src="../../static/cartsel.png" mode="" v-else></image>
</view>
<view class="sureorderitemleft">
<image src="../../static/goodtailtop.png" mode=""></image>
<image :src="item.store_goods.store_goods_spec.spec_image" mode=""></image>
</view>
<view class='shuright'>
<view class="suregoodnamek">商品名称商品名称商品名称商
品名称商品名称商品名称商品名称商品名称
<view class="suregoodnamek">{{item.store_goods.name}}
</view>
<view class="surebot flextwo">
<view class="saleprice">¥288</view>
<view class="saleprice">¥{{item.store_goods.price}}</view>
<view class="weightnumk flexone">
<view class="weightnumkleft leftk">
<image src="../../static/addimg.png" mode=""></image>
</view>
<view class="detailnum">1</view>
<view class="weightnumkleft rightk">
<view class="weightnumkleft rightk" @click="reducecart(item)">
<image src="../../static/reduceimg.png" mode=""></image>
</view>
<view class="detailnum">{{item.number}}</view>
<view class="weightnumkleft leftk" @click="addcart(item)">
<image src="../../static/addimg.png" mode=""></image>
</view>
</view>
</view>
</view>
... ... @@ -126,7 +129,7 @@
</view>
</view>
</view>
<view class="cartbottom flextwo">
<view class="cartbottom flextwo" v-if="editsel==true">
<view class="cartbotleft flexone" @click="selectall">
<view class="cartselimg">
<image src="../../static/cartsel.png" mode="" v-if="selall"></image>
... ... @@ -137,6 +140,18 @@
</view>
<view class='jiesuan' @click="jiesuan">去结算({{arr.length}}件)</view>
</view>
<view class="cartbottom flextwo" v-else>
<view class="flexone">
<view class="cartselimg" @click="selshan">
<image src="../../static/cartsel.png" mode="" v-if="seldelall"></image>
<image src="../../static/cartnosel.png" mode="" v-else></image>
</view>
<view class="quanname">全选</view>
</view>
<view class="delgoodname" @click="delgood">删除商品</view>
</view>
</view>
</view>
</template>
... ... @@ -151,7 +166,10 @@
selall: false,
total: 0,
arr:[],
data:[]
data:[],
seldelall:false,
cartid:[],
editsel:true
}
},
onLoad() {
... ... @@ -160,6 +178,85 @@
console.log(uni.getStorageSync("token"))
},
methods: {
editcart(){
this.editsel=!this.editsel;
},
// 删除商品
selshan(){
let that=this;
this.seldelall=!this.seldelall;
if(this.seldelall==true){
this.data3.forEach(function(value, index, array) {
value.sel = true;
that.$forceUpdate()
newcartid.push(value.id)
})
this.data2.forEach(function(value, index, array){
value.sel = true;
that.$forceUpdate()
newcartid.push(value.id)
})
this.data1[0].list.forEach(function(value, index, array){
value.sel = true;
that.$forceUpdate()
newcartid.push(value.id)
})
} else {
this.data3.forEach(function(value, index, array) {
value.sel = false;
})
this.data2.forEach(function(value, index, array){
value.sel =false
})
this.data1[0].list.forEach(function(value, index, array){
value.sel =false
})
newcartid=[];
}
that.cartid=newcartid;
console.log(that.cartid)
},
delgood(){
let that = this;
console.log(that.cartid)
uni.showModal({
title: '提示',
content: '是否删除该商品',
success: function (res) {
if (res.confirm) {
var url = 'car/batch_delete';
var params = {
car_ids:that.cartid.join(",")
}
console.log(params)
app.post(url, params).then((res) => {
console.log(res);
uni.showToast({
title:'删除成功',
icon:"none"
})
that.getcartlist()
}).catch((err) => {
console.log(err)
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
// 积分商品
jifenshop() {
uni.navigateTo({
... ... @@ -185,6 +282,11 @@
that.data1 = res.data.data.data3;
that.data2 = res.data.data.data1;
that.data3 = res.data.data.data2;
// 店铺商品
that.data1[0].list.forEach(function(value,index,array){
value.sel = false;
})
that.data1=that.data1;
// 面坊商品
that.data2.forEach(function(value, index, array) {
value.sel = false;
... ... @@ -201,19 +303,24 @@
})
},
//面坊商品选择购物车
//选择购物车
selectcart(item, index) {
console.log(item, index)
let that = this;
let newcartid=[]
let obj={}
if (item.type == 2) {
that.data3.forEach(function(value, index, array) {
if (value.id == item.id) {
value.sel = !value.sel;
that.$forceUpdate()
if (value.sel == true) {
that.arr.push(1)
that.total = that.total * 100 / 100 + value.score_goods.price * 100 / 100 * value.number;
console.log(6666);
newcartid.push(value.id);
console.log(3838944900)
console.log(newcartid);
that.cartid=newcartid
obj.type=item.type;
obj.goods_id=item.goods_id;
obj.spec_sku_id=item.spec_sku_id;
... ... @@ -231,19 +338,27 @@
that.data.splice(index,1)
}
})
newcartid.forEach(function(value,index,array){
if(value.id==item.id){
newcartid.splice(index,1)
}
})
}
that.data=that.data;
console.log(that.data)
}
})
that.data3 = that.data3
} else if (item.type == 1) {
console.log(88888)
that.data2.forEach(function(value, index, array) {
if (value.id == item.id) {
value.sel = !value.sel;
that.$forceUpdate()
if (value.sel == true) {
that.arr.push(1)
that.arr.push(1);
newcartid.push(value.id);
that.total = that.total * 100 / 100 + value.flour_goods.price * 100 / 100 * value.number;
obj.type=item.type;
obj.goods_id=item.goods_id;
... ... @@ -259,12 +374,60 @@
that.data.splice(index,1)
}
})
newcartid.forEach(function(value,index,array){
if(value.id==item.id){
newcartid.splice(index,1)
}
})
}
}
})
that.data2 = that.data2;
that.data=that.data;
console.log(that.data)
}else if(item.type==3){
console.log('999888',that.data1[0].list)
that.data1[0].list.forEach(function(value, index, array) {
if (value.id == item.id) {
console.log('383483',value.id)
value.sel = !value.sel;
that.$forceUpdate()
console.log(value.sel)
if (value.sel == true) {
console.log(value.sel)
that.arr.push(1);
newcartid.push(item.id);
that.total = that.total * 100 / 100 + value.store_goods.price * 100 / 100 * value.number;
obj.type=item.type;
obj.goods_id=item.goods_id;
obj.spec_sku_id=item.spec_sku_id;
obj.number=item.number;
that.data.push(obj)
} else {
that.total = that.total * 100 / 100 - value.store_goods.price * 100 / 100 * value.number;
that.arr.splice(0,1);
that.data.forEach(function(value,index,array){
if(item.goods_id==value.goods_id){
that.data.splice(index,1)
}
})
newcartid.forEach(function(value,index,array){
if(value.id==item.id){
newcartid.splice(index,1)
}
})
}
}
})
that.data1 = that.data1;
that.data=that.data;
that.cartid=newcartid;
console.log(that.data);
console.log(that.cartid)
}
},
... ... @@ -273,17 +436,27 @@
let that=this;
this.selall = !this.selall;
let newarr=[];
let newtotal=0
let newtotal=0;
let newcartid=[]
if (this.selall == true) {
this.data3.forEach(function(value, index, array) {
value.sel = true;
newarr.push(1);
newtotal=newtotal+value.score_goods.price * 100 / 100 * value.number
newtotal=newtotal+value.score_goods.price * 100 / 100 * value.number;
newcartid.push(value.id)
// this.total = this.total * 100 / 100 + value.score_goods.price * 100 / 100 * value.number
})
this.data2.forEach(function(value, index, array){
value.sel = true;
newtotal=newtotal+value.flour_goods.price * 100 / 100 * value.number
newtotal=newtotal+value.flour_goods.price * 100 / 100 * value.number;
newcartid.push(value.id)
// this.total = this.total * 100 / 100 + value.flour_goods.price * 100 / 100 * value.number;
newarr.push(1)
})
this.data1[0].list.forEach(function(value, index, array){
value.sel = true;
newtotal=newtotal+value.store_goods.price * 100 / 100 * value.number;
newcartid.push(value.id)
// this.total = this.total * 100 / 100 + value.flour_goods.price * 100 / 100 * value.number;
newarr.push(1)
})
... ... @@ -295,12 +468,17 @@
this.data2.forEach(function(value, index, array){
value.sel =false
})
this.data1[0].list.forEach(function(value, index, array){
value.sel =false
})
newarr=[];
newtotal=0
newtotal=0;
newcartid=[];
}
this.data3 = this.data3;
this.total=newtotal;
this.arr=newarr;
this.cartid=newcartid;
},
//购物车增加
... ... @@ -329,6 +507,19 @@
})
that.data2 = that.data2;
}else if(item.type==3){
that.data1[0].list.forEach(function(value, index, array) {
console.log('3787478',value)
if (value.id == item.id) {
console.log(value.id);
console.log(item.id)
value.number++;
if (item.sel == true) {
that.total = that.total * 100 / 100 + value.store_goods.price * 100 / 100 * 1;
}
}
})
that.data1 = that.data1;
}
that.addcartk(item.id)
... ... @@ -390,6 +581,24 @@
}
})
that.data2 = that.data2;
}else if(item.type==3){
that.data1[0].list.forEach(function(value, index, array) {
if (value.id == item.id) {
if (value.number > 1) {
value.number = value.number - 1;
that.reducecartk(item.id);
if (item.sel == true) {
that.total = that.total * 100 / 100 - value.store_goods.price * 100 / 100 * 1;
}
}else{
uni.showToast({
title: '不能再减少了~',
icon: 'none'
})
}
}
})
that.data1 = that.data1;
}
},
reducecartk(id) {
... ... @@ -427,10 +636,11 @@
console.log(params)
app.post(url, params,"post").then((res) => {
console.log(res);
console.log(res.data.data)
console.log(res.data.data);
let seldata=JSON.stringify(that.data)
uni.setStorageSync("goodinfo",res.data.data);
uni.navigateTo({
url:'/pages/nearshop/sureorder'
url:'/pages/nearshop/sureorder?seldata='+seldata
})
}).catch((err) => {
... ... @@ -450,6 +660,29 @@
page {
background: #F8F6F9;
}
.editcart{
color:#3D454C;
font-size: 28rpx;
width:750rpx;
background: #fff;
text-align: right;
padding: 0 32rpx;
box-sizing: border-box;
}
.quanname{
color:#3D454C;
font-size: 28rpx;
}
.delgoodname{
width:280rpx;
height:88rpx;
background:rgba(194,148,69,1);
border-radius:16rpx;
color:#fff;
font-size: 28rpx;
text-align: center;
line-height: 88rpx;
}
.cartlist {
/* padding-bottom: 120rpx; */
... ...
... ... @@ -3,22 +3,55 @@
<view class="goodtailtop">
<image :src="goodtail.image" mode=""></image>
</view>
<view class="tailbox boxsizing" v-if="type==1">
<view class="tailname">
{{goodtail.name}}
<view v-if="type==1">
<view class="tailbox boxsizing" v-if="goodtail.is_seckill==2">
<view class="tailname">
{{goodtail.name}}
</view>
<view class="tailhezi flextwo">
<view class="tailhezileft flexone">
<view class="saleprice">¥{{goodtail.goods_price}}</view>
<view class="huiyuanprice">会员价:¥{{goodtail.vip_price}}</view>
</view>
<view class="heziright flexone">
<!-- {{goodtail.flour_goods_spec.stock_num}} -->
<view class="heziprice stock">库存:件</view>
<view class="heziprice">已售{{goodtail.sales}}件</view>
</view>
</view>
</view>
<view class="tailhezi flextwo">
<view class="tailhezileft flexone">
<view class="saleprice">¥{{goodtail.goods_price}}</view>
<view class="huiyuanprice">会员价:¥{{goodtail.vip_price}}</view>
<view class="tailbox boxsizing" v-else>
<view class="tailname">
<text class='miaobox'>限时秒杀</text>
{{goodtail.name}}
</view>
<view class="heziright flexone">
<!-- {{goodtail.flour_goods_spec.stock_num}} -->
<view class="heziprice stock">库存:件</view>
<view class="heziprice">已售{{goodtail.sales}}件</view>
<view class="tailhezi flextwo">
<view class="tailhezileft flexone">
<view class="saleprice">¥{{item.seckill_price}}</view>
<view class="oldprice">¥{{item.goods_price}}</view>
</view>
</view>
<view class='miaodu flextwo'>
<view class="miaoduleft">
<view class="miaotiao">
已抢购60%
</view>
</view>
<view class="miaoright flexone">
<view class="distance">距离结束还剩</view>
<view class="remaintime">23</view>
<view class="dian">:</view>
<view class="remaintime">53</view>
<view class="dian">:</view>
<view class="remaintime">42</view>
</view>
</view>
</view>
</view>
<view class="tailbox boxsizing" v-else-if="type==2">
<view class="tailname">
{{goodtail.name}}
... ... @@ -34,34 +67,23 @@
</view>
</view>
</view>
<view class="tailbox boxsizing" v-else>
<view class="tailbox boxsizing" v-else-if="type==3">
<view class="tailname">
<text class='miaobox'>限时秒杀</text>
商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称
{{goodtail.name}}
</view>
<view class="tailhezi flextwo">
<view class="tailhezileft flexone">
<view class="saleprice">¥288</view>
<view class="oldprice">¥450</view>
</view>
</view>
<view class='miaodu flextwo'>
<view class="miaoduleft">
<view class="miaotiao">
已抢购60%
</view>
<view class="saleprice">¥{{goodtail.goods_price}}</view>
<!-- <view class="huiyuanprice">会员价:¥{{goodtail.vip_price}}</view> -->
</view>
<view class="miaoright flexone">
<view class="distance">距离结束还剩</view>
<view class="remaintime">23</view>
<view class="dian">:</view>
<view class="remaintime">53</view>
<view class="dian">:</view>
<view class="remaintime">42</view>
<view class="heziright flexone">
<!-- <view class="heziprice stock">库存:{{goodtail.score_goods_spec.stock_num}}件</view> -->
<view class="heziprice">已售{{goodtail.sales}}件</view>
</view>
</view>
</view>
<view class="send">
{{goodtail.postage}}
<!-- 包邮 店铺满100元包邮 -->
... ... @@ -76,12 +98,11 @@
</view>
<view class="goodcomment" v-else>
<view class="goodcommentop flexone">
<view class="topitem">全部(60万)</view>
<view class="topitem">好评(16万)</view>
<view class="topitem">中评(10万)</view>
<view class="topitem">差评(600)</view>
<view class="topitem" @click="commenttype" :data-id="0">全部(60万)</view>
<view class="topitem" @click="commenttype" :data-id="1">好评(16万)</view>
<view class="topitem" @click="commenttype" :data-id="2">中评(10万)</view>
<view class="topitem" @click="commenttype" :data-id="3">差评(600)</view>
</view>
<view class="commentlist">
<view class="jianintro photobox" bindtap="comdetail">
<view class="comtop flextwo">
... ... @@ -178,13 +199,14 @@
<view class="saleprice" v-if="type==2">¥{{goodtail.score_goods_spec.goods_price}}</view>
</view>
</view>
<view v-for="(item,parindex) in specarr" :key="parindex" >
<view v-for="(item,parindex) in specarr" :key="parindex">
<view class="weightbox">
<view class="weight">{{item.spec_name}}</view>
<view class="weightlsit flexone">
<!-- witemactive -->
<view class="weightlsititem" :class="item.selindex==childindex?'witemactive':''" v-for="(itemk,childindex) in item.spec_value" :key="childindex" @click.stop="selspec(parindex,childindex)" >{{itemk.spec_value}}</view>
<view class="weightlsititem" :class="item.selindex==childindex?'witemactive':''" v-for="(itemk,childindex) in item.spec_value"
:key="childindex" @click.stop="selspec(parindex,childindex)">{{itemk.spec_value}}</view>
</view>
</view>
</view>
... ... @@ -205,7 +227,7 @@
<view class="addcarbtnkright" @click="sure">确定</view>
</view>
</view>
</view>
</view>
</template>
... ... @@ -214,249 +236,308 @@
export default {
data() {
return {
footersel:1,
footersel: 1,
sel: 2,
shuwrap:false,
goodid:'',
type:"", //type 1 面访商城 2 积分商城
goodtail:'',
tapnavactive:'',
selnav:1,
shuwrap: false,
goodid: '',
type: "", //type 1 面访商城 2 积分商城
goodtail: '',
tapnavactive: '',
selnav: 1,
// 商品规格
specarr:[],
specarr: [],
// 商品规格id
spec_sku_id:[],
addtype:'',//1 加入购物车 2立即购买
cartnumber:1,
arr:[],
spec_sku_id: [],
addtype: '', //1 加入购物车 2立即购买
cartnumber: 1,
arr: [],
page:1,
star_type:'',
// 评论列表
commentlist:[]
}
},
onLoad(options) {
console.log(options)
this.goodid=options.id,
this.type=options.type;
if(this.type==1){
this.goodid = options.id,
this.type = options.type;
if (this.type == 1) {
this.getgoodtail();
}else{
} else if (this.type == 2) {
this.getjifengoodtail();
} else {
this.getshopgoodtail()
}
},
methods: {
hideshu(){
this.shuwrap=false
hideshu() {
this.shuwrap = false
},
// 评论切换
commenttype(e){
this.star_type=e.currentTarget.dataset.id;
},
// 顶部导航切换
navtap(e){
this.selnav=e.currentTarget.dataset.id
navtap(e) {
this.selnav = e.currentTarget.dataset.id;
if(this.selnav==1){
if (this.type == 1) {
this.getgoodtail();
} else if (this.type == 2) {
this.getjifengoodtail();
} else {
this.getshopgoodtail()
}
}else{
this.page=1;
this.commentlist=[];
this.getcommentlist();
}
},
// 数量加减
reducenum(){
this.cartnumber=this.cartnumber-1;
if(this.cartnumber==0){
reducenum() {
this.cartnumber = this.cartnumber - 1;
if (this.cartnumber == 0) {
uni.showToast({
title:'不能再减少了',
icon:"none"
title: '不能再减少了',
icon: "none"
})
this.cartnumber=1
}else{
this.cartnumber=this.cartnumber
this.cartnumber = 1
} else {
this.cartnumber = this.cartnumber
}
},
addnum(){
this.cartnumber=this.cartnumber+1;
addnum() {
this.cartnumber = this.cartnumber + 1;
console.log(this.cartnumber)
this.cartnumber=this.cartnumber
this.cartnumber = this.cartnumber
},
//获取面坊商品详情
getgoodtail(){
// 获取评论列表
getcommentlist(){
let that = this;
var url = 'flour_goods/get_flour_goods_detail';
var params = {
flour_goods_id: that.goodid,
}
app.post(url, params).then((res) => {
console.log(res);
that.goodtail=res.data.data
var url = 'goods_comments/get_list';
var params = {
type:that.type,
goods_id:that.goodid,
star_type:that.star_type,
page:that.page,
pageNum:10
}
app.post(url, params).then((res) => {
console.log(res);
that.commentlist=that.commentlist.concat(res.data.data)
}).catch((err) => {
}).catch((err) => {
})
})
},
//获取面坊商品详情
getgoodtail() {
let that = this;
var url = 'flour_goods/get_flour_goods_detail';
var params = {
flour_goods_id: that.goodid,
}
app.post(url, params).then((res) => {
console.log(res);
that.goodtail = res.data.data
}).catch((err) => {
})
},
// 获取积分商城商品详情
getjifengoodtail(){
getjifengoodtail() {
let that = this;
var url = 'score_goods/get_score_goods_detail';
var params = {
score_goods_id: that.goodid,
}
console.log(params)
app.post(url, params).then((res) => {
console.log(res);
that.goodtail=res.data.data
}).catch((err) => {
console.log(err)
})
var url = 'score_goods/get_score_goods_detail';
var params = {
score_goods_id: that.goodid,
}
console.log(params)
app.post(url, params).then((res) => {
console.log(res);
that.goodtail = res.data.data
}).catch((err) => {
console.log(err)
})
},
// 获取店铺商品详情
getshopgoodtail() {
let that = this;
var url = 'store_goods/get_store_goods_detail';
var params = {
store_goods_id: that.goodid,
}
console.log(params)
app.post(url, params).then((res) => {
console.log(res);
that.goodtail = res.data.data
}).catch((err) => {
console.log(err)
})
},
// 加入购物车
addcart(){
this.shuwrap=true;
addcart() {
this.shuwrap = true;
this.getspecs();
this.addtype=1
this.addtype = 1
},
// 立即购买
buynow(){
this.shuwrap=true;
buynow() {
this.shuwrap = true;
this.getspecs();
this.addtype=2
this.addtype = 2
},
//获取商品规格
getspecs(){
getspecs() {
let that = this;
var url = 'score_goods/get_spec_sku1';
var params = {
score_goods_id: that.goodid,
}
console.log(params)
app.post(url, params).then((res) => {
console.log(res);
that.specarr=res.data.data;
that.specarr.forEach(function(value,index,array){
value.selindex=0;
value.spec_value.forEach(function(valuek,indexk,arrayk){
if(indexk==0){
value.selid=valuek.id;
}
valuek.sel=false
})
})
that.specarr=that.specarr;
}).catch((err) => {
console.log(err)
})
var url = 'score_goods/get_spec_sku1';
var params = {
score_goods_id: that.goodid,
}
console.log(params)
app.post(url, params).then((res) => {
console.log(res);
that.specarr = res.data.data;
that.specarr.forEach(function(value, index, array) {
value.selindex = 0;
value.spec_value.forEach(function(valuek, indexk, arrayk) {
if (indexk == 0) {
value.selid = valuek.id;
}
valuek.sel = false
})
})
that.specarr = that.specarr;
}).catch((err) => {
console.log(err)
})
},
// 选择商品规格
selspec(parindex,childindex){
let newspecarr=this.specarr;
newspecarr[parindex].spec_value[childindex].sel=!newspecarr[parindex].spec_value[childindex].sel;
newspecarr[parindex].selindex=childindex;
newspecarr[parindex].selid=newspecarr[parindex].spec_value[childindex].id
selspec(parindex, childindex) {
let newspecarr = this.specarr;
newspecarr[parindex].spec_value[childindex].sel = !newspecarr[parindex].spec_value[childindex].sel;
newspecarr[parindex].selindex = childindex;
newspecarr[parindex].selid = newspecarr[parindex].spec_value[childindex].id
this.arr.push(newspecarr[parindex].spec_value[childindex].id);
// console.log(this.spec_sku_id)
this.specarr=newspecarr;
this.specarr = newspecarr;
// console.log(this.specarr[parindex].spec_value[childindex].sel)
console.log(JSON.stringify(this.specarr))
this.changspec()
},
// 更换商品的图片和价格
changspec(){
changspec() {
let that = this;
let newspec_sku_id=[]
that.specarr.forEach(function(value,index,array){
let newspec_sku_id = []
that.specarr.forEach(function(value, index, array) {
newspec_sku_id.push(value.selid)
})
that.spec_sku_id=newspec_sku_id
var url = 'score_goods/get_spec_sku2';
var params = {
score_goods_id:that.goodid,
spec_sku_id:that.spec_sku_id.join("_")
}
console.log(params)
app.post(url, params).then((res) => {
console.log(res);
if(that.type==1){
that.goodtail.flour_goods_spec=res.data.data;
that.goodtail.price=res.data.data.price;
}else if(that.type==2){
that.goodtail.score_goods_spec=res.data.data
}
that.goodtail=that.goodtail;
}).catch((err) => {
console.log(err)
})
that.spec_sku_id = newspec_sku_id
var url = 'score_goods/get_spec_sku2';
var params = {
score_goods_id: that.goodid,
spec_sku_id: that.spec_sku_id.join("_")
}
console.log(params)
app.post(url, params).then((res) => {
console.log(res);
if (that.type == 1) {
that.goodtail.flour_goods_spec = res.data.data;
that.goodtail.price = res.data.data.price;
} else if (that.type == 2) {
that.goodtail.score_goods_spec = res.data.data
}
that.goodtail = that.goodtail;
}).catch((err) => {
console.log(err)
})
},
sure(){
if(this.addtype==1){
sure() {
if (this.addtype == 1) {
this.addcartk();
}else{
} else {
this.buynowk()
}
},
// 加入购物车
addcartk(){
addcartk() {
let that = this;
let newspec_sku_id=[]
that.specarr.forEach(function(value,index,array){
let newspec_sku_id = []
that.specarr.forEach(function(value, index, array) {
newspec_sku_id.push(value.selid)
})
that.spec_sku_id=newspec_sku_id
var url = 'car/join_car';
var params = {
type:this.type,
goods_id:this.goodid,
spec_sku_id:that.spec_sku_id.join("_"),
number: that.cartnumber,
}
console.log(params)
app.post(url, params).then((res) => {
console.log(res);
uni.showToast({
title:"加入购物车成功",
icon:'none'
})
setTimeout(function(){
uni.navigateTo({
url:'/pages/nearshop/cartlist'
})
},1500)
}).catch((err) => {
console.log(err)
})
that.spec_sku_id = newspec_sku_id
var url = 'car/join_car';
var params = {
type: this.type,
goods_id: this.goodid,
spec_sku_id: that.spec_sku_id.join("_"),
number: that.cartnumber,
}
console.log(params)
app.post(url, params).then((res) => {
console.log(res);
uni.showToast({
title: "加入购物车成功",
icon: 'none'
})
setTimeout(function() {
uni.navigateTo({
url: '/pages/nearshop/cartlist'
})
}, 1500)
}).catch((err) => {
console.log(err)
})
},
// 立即购买
buynowk(){
buynowk() {
let that = this;
let newspec_sku_id=[]
that.specarr.forEach(function(value,index,array){
let newspec_sku_id = []
that.specarr.forEach(function(value, index, array) {
newspec_sku_id.push(value.selid)
})
that.spec_sku_id=newspec_sku_id
var url = 'car/join_car';
var params = {
type:this.type,
goods_id:this.goodid,
spec_sku_id:that.spec_sku_id.join(","),
number: that.cartnumber,
}
console.log(params)
app.post(url, params).then((res) => {
console.log(res);
}).catch((err) => {
console.log(err)
})
that.spec_sku_id = newspec_sku_id
var url = 'car/join_car';
var params = {
type: this.type,
goods_id: this.goodid,
spec_sku_id: that.spec_sku_id.join(","),
number: that.cartnumber,
}
console.log(params)
app.post(url, params).then((res) => {
console.log(res);
}).catch((err) => {
console.log(err)
})
}
}
... ...
... ... @@ -5,66 +5,74 @@
<view class="yourow">
<image src="../../static/zuorow.png" mode=""></image>
</view>
</view> -->
<view class="navmiddle flexone">
<view class="navmiddle navmiddlek flexone">
<view class="middleleft">
<image src="../../static/search.png" mode=""></image>
</view>
<view class="middleenter">
<input type="text" placeholder="请输入商品,店铺搜索" placeholder-class="enterk" />
<input type="text" placeholder="请输入商品,店铺搜索" placeholder-class="enterk" @input="enterword" />
</view>
</view>
<view class="souyou">
<view class="souyou" @click="search">
搜索
</view>
</view>
<view class="tapnav flexone">
<view class="tapnavitem nearactive">距离最近</view>
<view class="tapnavitem pingfen">评分最高</view>
<!-- :class="order==2?'nearactive':''" -->
<!-- :class="order==3?'nearactive':''" -->
<view class="tapnavitem" :class="order==2?'nearactive':''" @click="rangge" :data-id="2">距离最近</view>
<view class="tapnavitem pingfen" @click="rangge" :class="order==3?'nearactive':''" :data-id="3">评分最高</view>
</view>
<view class="searchshop commnonpadding">
<view class="searchgooditem flex boxsizing">
<view class="nodata" v-if="shoplist.length==0">暂无数据</view>
<view class="searchshop commnonpadding" v-else>
<!-- v-fo="(item,index) in shoplist" :key="" -->
<view class="searchgooditem flex boxsizing" v-for="(item,index) in shoplist" :key="index" @click="shopdetail" :data-id="item.id">
<view class="shopleftimg">
<image src="../../static/shop.png" mode=""></image>
<image :src="item.image" mode=""></image>
</view>
<view class="shopright">
<view class="shopname">湖北省南阳市南阳面粉厂</view>
<view class="shopname">{{item.name}}</view>
<view class="shopmiddle flexone">
<view class="shopmiddleleft">
8.2
{{item.score}}
</view>
<view class="shopmiddleright">
<view class="star flex">
<view class="starimg">
<image src="../../static/shixing.png" mode=""></image>
<image src="../../static/shixing.png" mode="" v-if="item.star>=2"></image>
<image src="../../static/kongxing.png" mode="" v-else></image>
</view>
<view class="starimg">
<image src="../../static/shixing.png" mode=""></image>
<image src="../../static/shixing.png" mode="" v-if="item.star>=4"></image>
<image src="../../static/kongxing.png" mode="" v-else></image>
</view>
<view class="starimg">
<image src="../../static/shixing.png" mode=""></image>
<image src="../../static/shixing.png" mode="" v-if="item.star>=6"></image>
<image src="../../static/kongxing.png" mode="" v-else></image>
</view>
<view class="starimg">
<image src="../../static/shixing.png" mode=""></image>
<image src="../../static/shixing.png" mode="" v-if="item.star>=8"></image>
<image src="../../static/kongxing.png" mode="" v-else></image>
</view>
<view class="starimg">
<image src="../../static/kongxing.png" mode=""></image>
<image src="../../static/shixing.png" mode="" v-if="item.star>=10"></image>
<image src="../../static/kongxing.png" mode="" v-else></image>
</view>
</view>
<view class="haoping">好评率96%</view>
<view class="haoping">好评率{{item.probability}}</view>
</view>
</view>
<view class="shopdizhi flexone">
<view class="shopdiimg">
<image src="../../static/shopaddress.png" mode=""></image>
</view>
<view class='shopli'>距离256km</view>
<view class='shopli'>距离{{item.distance}}km</view>
</view>
</view>
</view>
<view class="searchgooditem flex boxsizing">
<!-- <view class="searchgooditem flex boxsizing">
<view class="shopleftimg">
<image src="../../static/shop.png" mode=""></image>
</view>
... ... @@ -103,10 +111,9 @@
</view>
</view>
</view>
-->
</view>
<!-- 底部导航 -->
<view class="teacherfooter">
<view class="teacherfootitem" @click="selnav" :data-id="1">
... ... @@ -144,41 +151,86 @@
data() {
return {
showbanben: false,
footersel: 2
footersel: 2,
keyword: '',
order: '',
shoplist: []
}
},
onLoad() {
this.getshoplist()
},
methods: {
// 底部导航跳转
selnav(e){
console.log(e)
// 顶部切换
rangge(e) {
this.order = e.currentTarget.dataset.id;
this.shoplist = [];
this.page = 1;
this.getshoplist()
},
// 店铺详情
shopdetail(e){
let id=e.currentTarget.dataset.id;
uni.navigateTo({
url:'/pages/nearshop/shopdetail?shopid='+id
})
},
// 底部导航跳转
selnav(e) {
console.log(e)
let id = e.currentTarget.dataset.id;
console.log(id)
if(id==1){
if (id == 1) {
uni.navigateTo({
url:'../homepage/homepage'
url: '../homepage/homepage'
})
}else if(id==2){
} else if (id == 2) {
uni.navigateTo({
url:"../nearshop/nearshop"
url: "../nearshop/nearshop"
})
}else if(id==3){
} else if (id == 3) {
uni.navigateTo({
url:"../luntan/luntan"
url: "../luntan/luntan"
})
}else if(id==4){
} else if (id == 4) {
uni.navigateTo({
url:"../usercenter/my"
url: "../usercenter/my"
})
}
},
enterword(e) {
this.keyword = e.detail.value;
},
search() {
this.page = 1;
this.shoplist = [];
this.getshoplist()
},
//获取店铺列表
getshoplist() {
let that = this;
var url = 'store/get_store_list';
var params = {
keyword: that.keyword,
order: that.order,
page: that.page,
pageNum: 10
}
console.log('参数', params)
app.post(url, params, "post").then((res) => {
console.log(res);
that.shoplist = that.shoplist.concat(res.data.data)
}).catch((err) => {
console.log(err)
})
}
}
... ... @@ -187,4 +239,7 @@
<style>
@import url('../../base/homepage');
.nodata{
margin:150rpx auto 0;
}
</style>
... ...
... ... @@ -24,7 +24,6 @@
有效期至:{{item.pasttime}}
</view>
</view>
</view>
<!-- <view class="bitem borderactive flexone">
<view class="couponleft">
... ... @@ -48,7 +47,6 @@
</view>
-->
</view>
</view>
</view>
... ...
... ... @@ -30,7 +30,7 @@
<view class="neardoor">12℃</view>
</view>
</view>
<view class="detailgood boxsizing flexone">
<view class="detailgooditem">
<image src="../../static/shopdetailtop.png" mode=""></image>
... ... @@ -78,38 +78,38 @@
</view>
</view>
<view class="addressbox boxsizing">
<view class="addressname">湖北省南阳市南阳面粉厂</view>
<view class="addressname">{{shopdetail.name}}</view>
<view class="addressin">
<view class="addressimitem flextwo boxsizing">
<view class="addressinleft flexone">
<view class="addressimg">
<image src="../../static/userpeople.png" mode=""></image>
</view>
<view class="peoplename">李某某</view>
</view>
<view class="collect flexone">
<view class="peoplename">{{shopdetail.contact}}</view>
</view>
<view class="collect flexone" v-if="shopdetail.is_collect==2" @click="collet">
<view class="collectimg">
<image src="../../static/collect.png" mode=""></image>
</view>
<view class="collectname">收藏</view>
</view>
<view class="collect flexone yicollect">
<view class="collect flexone yicollect" v-else @click="collet">
<view class="collectimg">
<image src="../../static/yicollect.png" mode=""></image>
</view>
<view class="collectname yiname">收藏</view>
<view class="collectname yiname">取消收藏</view>
</view>
</view>
</view>
<view class="addressin">
<view class="addressimitem boxsizing flexone">
<view class="addressinleft flexone">
<view class="addressimg">
<image src="../../static/phonepeople.png" mode=""></image>
</view>
<view class="peoplename">15822185632</view>
</view>
<view class="peoplename mobilename">{{shopdetail.mobile}}</view>
</view>
<view class="phoneplay">拨号</view>
</view>
</view>
... ... @@ -119,20 +119,20 @@
<view class="addressimg">
<image src="../../static/addresspeope.png" mode=""></image>
</view>
<view class="peoplename">湖北省南阳市北洋区西湖一路产业园区5号402</view>
</view>
<view class="peoplename">{{shopdetail.province_name}}{{shopdetail.city_name}}{{shopdetail.county_name}}{{shopdetail.address}}</view>
</view>
</view>
</view>
</view>
<view class="tapnav flextwo">
<view class="tapnavitem tapnavactive">综合</view>
<view class="tapnavitem">最新</view>
<view class="tapnavitem">销量</view>
<view class="tapnavitem flexone">
<view class="tapnavitem" :class="order==0?'tapnavactive':''" @click="kindlist" :data-id="0">分类</view>
<view class="tapnavitem" :class="order==1?'tapnavactive':''" @click="orderrange" :data-id="1">综合</view>
<view class="tapnavitem" :class="order==2?'tapnavactive':''" @click="orderrange" :data-id="2">销量</view>
<view class="tapnavitem flexone" :class="order==3||order==4?'tapnavactive':''" @click="selprice">
<view class="tapprice">价格</view>
<view class="tapbox flexfour">
<view class="tapboxtop">
... ... @@ -143,78 +143,178 @@
</view>
</view>
</view>
</view>
<view class="homeshoplist flexone goodboxlist">
<view class="homeshopitem goodboxitem">
<view class="gooditemimg goodboximg">
<image src="../../static/goopic.png" mode=""></image>
<view class="sale boxsale">已售76件</view>
</view>
<view class="goodname hidden boxgoodname">三放热敏标签纸
40*30 50 </view>
<view class="saleprice">¥288</view>
<view class="flextwo">
<view class="huiyuanprice dikou">抵扣:¥200</view>
<view class="goodshou">已售76</view>
</view>
</view>
<view class="homeshopitem goodboxitem">
<view class="homeshopitem goodboxitem" v-for="(item,index) in goodlist" :key="index" @click="goodtail" :data-id="item.id">
<view class="gooditemimg goodboximg">
<image src="../../static/goopic.png" mode=""></image>
<view class="sale boxsale">已售76件</view>
<image :src="item.image" mode=""></image>
<view class="sale boxsale">已售{{item.sales}}件</view>
</view>
<view class="goodname hidden boxgoodname">三放热敏标签纸
40*30 50 </view>
<view class="saleprice">¥288</view>
<view class="flextwo">
<view class="goodname hidden boxgoodname">{{item.name}}</view>
<view class="saleprice">¥{{item.price}}</view>
<!-- <view class="flextwo">
<view class="huiyuanprice dikou">抵扣:¥200</view>
<view class="goodshou">已售76</view>
</view>
</view>
<view class="homeshopitem goodboxitem">
<view class="gooditemimg goodboximg">
<image src="../../static/goopic.png" mode=""></image>
<view class="sale boxsale">已售76件</view>
</view>
<view class="goodname hidden boxgoodname">三放热敏标签纸
40*30 50 </view>
<view class="saleprice">¥288</view>
<view class="flextwo">
<view class="huiyuanprice dikou">抵扣:¥200</view>
<view class="goodshou">已售76</view>
</view>
</view>
<view class="homeshopitem goodboxitem">
<view class="gooditemimg goodboximg">
<image src="../../static/goopic.png" mode=""></image>
<view class="sale boxsale">已售76件</view>
</view>
<view class="goodname hidden boxgoodname">三放热敏标签纸
40*30 50 </view>
<view class="saleprice">¥288</view>
<view class="flextwo">
<view class="huiyuanprice dikou">抵扣:¥200</view>
<view class="goodshou">已售76</view>
</view>
</view> -->
</view>
</view>
</view>
</template>
<script>
import app from "../../App.vue";
export default {
data() {
return {
showbanben: false,
store_id:'',
shopdetail:'',
order:'',
page:1,
score_category_id:'',
goodlist:[]
}
},
onLoad(options) {
console.log(options)
this.store_id=options.shopid,
// 获取店铺详情
this.getshopdetail();
// 获取店铺列表
this.getgoodlist()
},
methods: {
// 分类
kindlist(e){
this.order=e.currentTarget.dataset.id;
uni.setStorageSync("selectId","")
uni.navigateTo({
url:'/pages/homepage/goodkind'
})
},
// 排序
orderrange(e) {
this.order = e.currentTarget.dataset.id;
this.shoplist = [],
this.page = 1;
this.getgoodlist();
},
selprice() {
this.price = !this.price;
if (this.price == true) {
this.order = 4;
} else {
this.order = 5;
}
this.shoplist = [],
this.page = 1;
this.getgoodlist();
},
// 获取店铺详情
getshopdetail() {
let that = this;
var url = 'store/get_store_detail';
var params = {
store_id: that.store_id,
}
console.log('参数', params)
app.post(url, params, "post").then((res) => {
console.log(res);
that.shopdetail = res.data.data
}).catch((err) => {
console.log(err)
})
},
// 收藏和取消收藏
collet(){
let that = this;
var url = 'store/collect';
var params = {
store_id: that.store_id,
}
console.log('参数', params)
app.post(url, params, "post").then((res) => {
if(that.shopdetail.is_collect==2){
uni.showToast({
title:'收藏成功',
icon:"none"
})
that.shopdetail.is_collect=1
}else{
uni.showToast({
title:'取消收藏成功',
icon:"none"
})
that.shopdetail.is_collect=2
}
that.shopdetail=that.shopdetail;
console.log(res);
// that.shopdetail = res.data.data
}).catch((err) => {
console.log(err)
})
},
// 获取商品列表
getgoodlist(){
let that = this;
var url = 'store_goods/get_store_goods';
var params = {
store_id: that.store_id,
store_category_id:that.store_category_id,
order:that.order,
page:that.page,
pageNum:10
}
console.log('参数', params)
app.post(url, params, "post").then((res) => {
console.log(res);
that.goodlist=that.goodlist.concat(res.data.data);
console.log(that.goodlist)
}).catch((err) => {
console.log(err)
})
},
// 进入商品详情页
goodtail(e) {
let id = e.currentTarget.dataset.id;
// type 1 面访商品 2积分商城商品
uni.navigateTo({
url: '/pages/nearshop/goodtail?id=' + id + '&type=' + 3
})
}
},
onShow(){
this.score_category_id=uni.getStorageSync("selectId")!=''?uni.getStorageSync("selectId"):''
this.shoplist=[];
this.page=1;
}
}
</script>
<style>
@import url('../../base/nearshop');
@import url('../../base/homepage');
.mobilename{
margin-right:10rpx;
}
</style>
... ...
... ... @@ -20,38 +20,66 @@
</view>
<view class="sureshop sureshopk">
<!-- 店铺商品 -->
<view class="bigbox">
<view class="bigbox" v-if="goodinfo.data3[0].goods!=undefined">
<view class="sureorderbox flexone">
<view class="sureimg">
<image src="../../static/nearshop.png" mode=""></image>
</view>
<view class="sureshopname">红大地面品厂</view>
<view class="sureshopname">{{goodinfo.data3[0].name}}</view>
</view>
<view class="boxbox">
<view class="sureorderitem flex">
<view class="sureorderitem flex" v-for="(item,index) in goodinfo.data3[0].goods" :key="index">
<view class="sureorderitemleft">
<image src="../../static/goodtailtop.png" mode=""></image>
<image :src="item.store_goods_spec.spec_image" mode=""></image>
</view>
<view class='shuright'>
<view class="suregoodname">商品名称商品名称商品名称商
品名称商品名称商品名称商品名称商品名称
<view class="suregoodnamek">{{item.name}}
</view>
<view class="surebot flextwo">
<view class="saleprice">¥288</view>
<view class="weightnumk flexone">
<view class="weightnumkleft leftk">
<image src="../../static/addimg.png" mode=""></image>
</view>
<view class="detailnum">1</view>
<view class="weightnumkleft rightk">
<image src="../../static/reduceimg.png" mode=""></image>
</view>
</view>
<view v-if="item.spec.length!=0">
<view class="spec" v-for="(item,index) in item.spec" :key="index">{{item.spec_name}}:{{item.spec_value}}</view>
</view>
<view class="surebot flexone">
<view class="saleprice">¥{{item.price}}</view>
<view class="detailnum">x{{item.number}}</view>
</view>
</view>
</view>
</view>
<view class="delivery flextwo">
<view class="deliveryleft">配送服务</view>
<view class="deliveryright flexone">
<picker @change="bindgoodChange" :value="goodindex" :range="goodservicearr" range-key="name">
<view class="deliveryname">{{goodpeiname}}</view>
</picker>
<view class='yourow'>
<image src="../../static/yourowk.png" mode=""></image>
</view>
</view>
</view>
<view class="delivery markcontent">
<view class='markname'>店铺备注</view>
<view class="marktext">
<textarea value="" placeholder="选填,给商家留言" @input="entershopmessage" />
</view>
</view>
<view class="delivery markcontent markcontentk peibox">
<view class="deliveryitem flextwo">
<view class='deliveryitemname'>商品金额</view>
<view class='deliveryitemname moneyright'>¥{{goodinfo.data3[0].goods_total}}</view>
</view>
<view class="deliveryitem flextwo">
<view class='deliveryitemname'>运费</view>
<view class='deliveryitemname moneyright'>¥{{goodinfo.data3[0].postage_price}}</view>
</view>
</view>
<view class="delivery peidelivery markcontentk flextwo peiboxk">
<view class="deliveryleft">小计</view>
<view class="deliverymoney">¥{{goodinfo.data3[0].goods_total*100/100+goodinfo.data3[0].postage_price*100/100}}</view>
</view>
</view>
<div class="botbox" v-if="goodinfo.data1.flour_goods!=undefined"></div>
... ... @@ -96,7 +124,7 @@
<view class="delivery markcontent">
<view class='markname'>店铺备注</view>
<view class="marktext">
<textarea value="" placeholder="选填,给商家留言" />
<textarea value="" placeholder="选填,给商家留言" @input="entermianfangrmark"/>
</view>
</view>
<!-- <view class="delivery flextwo markcontent">
... ... @@ -117,6 +145,31 @@
</view>
<view class="deliveryname">{{couponname}}</view>
</view>
<view class="delivery markcontent markcontentk peibox">
<view class="deliveryitem flextwo">
<view class='deliveryitemname'>商品金额</view>
<view class='deliveryitemname moneyright'>¥{{goodinfo.data1.goods_total}}</view>
</view>
<!-- <view class="deliveryitem flextwo">
<view class='deliveryitemname'>积分抵扣</view>
<view class='deliveryitemname moneyright'>¥2600.00</view>
</view> -->
<view class="deliveryitem flextwo">
<view class='deliveryitemname'>优惠券</view>
<view class='deliveryitemname moneyright'>¥{{goodinfo.data1.discounts}}</view>
</view>
<view class="deliveryitem flextwo">
<view class='deliveryitemname'>运费</view>
<view class='deliveryitemname moneyright'>¥{{goodinfo.data1.postage_price}}</view>
</view>
</view>
<view class="delivery peidelivery markcontentk flextwo peiboxk">
<view class="deliveryleft">小计</view>
<view class="deliverymoney">¥{{goodinfo.data1.goods_total*100/100+goodinfo.data1.postage_price*100/100}}</view>
</view>
</view>
<div class="botbox" v-if="goodinfo.data2.score_goods!=undefined"></div>
<!-- 积分商品 -->
... ... @@ -151,7 +204,9 @@
<view class="delivery flextwo">
<view class="deliveryleft">配送服务</view>
<view class="deliveryright flexone">
<view class="deliveryname">快递配送</view>
<picker @change="bindjiChange" :value="jiindex" :range="jifenservicearr" range-key="name">
<view class="deliveryname">{{jifenpeiname}}</view>
</picker>
<view class='yourow'>
<image src="../../static/yourowk.png" mode=""></image>
</view>
... ... @@ -160,7 +215,7 @@
<view class="delivery markcontent">
<view class='markname'>店铺备注</view>
<view class="marktext">
<textarea value="" placeholder="选填,给商家留言" />
<textarea value="" placeholder="选填,给商家留言" @input="enterjifenremark"/>
</view>
</view>
<view class="delivery flextwo markcontent">
... ... @@ -174,44 +229,29 @@
<input type="text" value="" placeholder="请输入抵扣积分" placeholder-class="dikouinput" @input="enterjifen"/>
</view>
</view>
<!-- <view class="delivery flextwo markcontent">
<view class="deliveryleft flexone">
<view class='jifen'>优惠劵</view>
<view class="jifenimg">
<image src="../../static/gantan.png" mode=""></image>
</view>
</view>
<view class="deliveryname">满200减99优惠券</view>
</view> -->
</view>
</view>
<view class="delivery markcontent markcontentk peibox">
<view class="deliveryitem flextwo">
<view class='deliveryitemname'>商品金额</view>
<view class='deliveryitemname moneyright'>¥2600.00</view>
<view class='deliveryitemname moneyright'>¥{{goodinfo.data2.goods_total}}</view>
</view>
<view class="deliveryitem flextwo">
<view class='deliveryitemname'>积分抵扣</view>
<view class='deliveryitemname moneyright'>¥2600.00</view>
</view>
<view class="deliveryitem flextwo">
<view class='deliveryitemname'>优惠券</view>
<view class='deliveryitemname moneyright'>¥2600.00</view>
<view class='deliveryitemname moneyright'>¥{{goodinfo.data2.user_score}}</view>
</view>
<view class="deliveryitem flextwo">
<view class='deliveryitemname'>运费</view>
<view class='deliveryitemname moneyright'>¥2600.00</view>
<view class='deliveryitemname moneyright'>¥{{goodinfo.data2.postage_price}}</view>
</view>
</view>
<view class="delivery peidelivery markcontentk flextwo peiboxk">
<view class="deliveryleft">配送服务</view>
<view class="deliverymoney">¥2560.00</view>
<view class="deliveryleft">小计</view>
<view class="deliverymoney">¥{{goodinfo.data2.postage_price*100/100+goodinfo.data2.postage_price*100/100}}</view>
</view>
</view>
</view>
<view class="huiyuanbot boxsizing">
<view class="behuiyuanbtn">确认支付</view>
</view>
... ... @@ -267,7 +307,11 @@
</view>
</view>
</view>
<view class="buybtn">确认支付(¥2560.00)</view>
<view class="flextwo">
<view class="totalmoney">{{goodinfo.total}}</view>
<view class="buybtn btnk">确认支付(¥2560.00)</view>
</view>
</view>
</view>
<!-- 优惠券使用规则 -->
... ... @@ -296,7 +340,7 @@
goodinfo:'',
addressitem:'',
addresssel:'请选择地址',
mianindex:0,
mianindex:-1,
servicearr:[{
id:1,
name:'快递配送'
... ... @@ -309,6 +353,38 @@
mianpeiname:'请选择配送方式',
jifen:'',
couponname:'请选择优惠券',
// 面坊的配送方式
postage_type1:'',
// 积分商品配送方式
jifenservicearr:[{
id:1,
name:'快递配送'
},
{
id:2,
name:'上门自提'
},
],
jiindex:-1,
postage_type2:'',
jifenpeiname:'请选择配送方式',
//店铺商品
goodindex:-1,
goodservicearr:[{
id:1,
name:'快递配送'
},
{
id:2,
name:'上门自提'
}],
goodpeiname:'请选择配送方式',
// data1 面坊 data2 积分 data3 店铺
}
... ... @@ -317,6 +393,7 @@
console.log(38349403)
this.goodinfo=uni.getStorageSync("goodinfo");
this.seldata=JSON.parse(options.seldata)
console.log(this.goodinfo)
},
... ... @@ -324,12 +401,51 @@
// 面访商品配送方式
bindmianChange(e){
this.mianpeiname=this.servicearr[e.target.value].name;
this.mianindex=e.target.value
this.mianindex=e.target.value;
this.postage_type1=this.servicearr[e.target.value].id
},
// 积分商品的配送方式
bindjiChange(e){
this.jifenpeiname=this.servicearr[e.target.value].name;
this.jiindex=e.target.value;
this.postage_type2=this.servicearr[e.target.value].id
},
// 店铺商品的配送方式
bindgoodChange(e){
let that=this;
console.log(this.goodservicearr)
this.goodpeiname=this.goodservicearr[e.target.value].name;
this.goodindex=e.target.value;
this.seldata.forEach(function(value,index,array){
if(value.type==3){
value.postage_type=that.goodservicearr[e.target.value].id;
}
})
},
// 输入积分
enterjifen(e){
this.jifen=e.detail.vlaue
},
// 面坊商品备注
entermianfangrmark(){
this.remark1=e.detail.value
},
// 店铺商品备注
entershopmessage(e){
this.seldata.forEach(function(value,index,array){
if(value.type==3){
value.remark=e.detail.value
}
})
this.seldata=this.this.seldata;
},
// 积分商品备注
enterjifenremark(){
this.remark2=e.detail.value
},
// 选择优惠券
selectcoupon(){
uni.navigateTo({
... ... @@ -397,4 +513,12 @@
page{
background: #F8F6F9;
}
.totalmoney{
color:#C29445;
font-size: 30rpx;
}
.btnk{
width:200prx;
}
</style>
... ...