作者 lihongjuan

111

@@ -208,6 +208,12 @@ @@ -208,6 +208,12 @@
208 border-radius: 32rpx; 208 border-radius: 32rpx;
209 padding: 0 20rpx; 209 padding: 0 20rpx;
210 } 210 }
  211 + .navmiddlek{
  212 + width: 580rpx;
  213 + background: rgba(249, 249, 249, 1);
  214 + border-radius: 32rpx;
  215 + padding: 0 20rpx;
  216 + }
211 217
212 .middleleft { 218 .middleleft {
213 width: 32rpx; 219 width: 32rpx;
@@ -655,7 +661,7 @@ @@ -655,7 +661,7 @@
655 height: 4rpx; 661 height: 4rpx;
656 background: #C29445; 662 background: #C29445;
657 position: absolute; 663 position: absolute;
658 - bottom: -20rpx; 664 + bottom: -30rpx;
659 left: 50%; 665 left: 50%;
660 transform: translateX(-50%); 666 transform: translateX(-50%);
661 667
@@ -43,12 +43,13 @@ @@ -43,12 +43,13 @@
43 selectgood(e){ 43 selectgood(e){
44 let id=e.currentTarget.dataset.id; 44 let id=e.currentTarget.dataset.id;
45 45
46 - let pages = getCurrentPages();  
47 - let prevPage = pages[pages.length - 2]; //上一个页面 46 + // let pages = getCurrentPages();
  47 + // let prevPage = pages[pages.length - 2]; //上一个页面
48 //直接调用上一个页面的setData()方法,把数据存到上一个页面中去 48 //直接调用上一个页面的setData()方法,把数据存到上一个页面中去
49 - prevPage.setData({  
50 - selectId: id,  
51 - }); 49 + uni.setStorageSync("selectId",id)
  50 + // prevPage.setData({
  51 + // selectId: id,
  52 + // });
52 uni.navigateBack({ 53 uni.navigateBack({
53 checked:true 54 checked:true
54 }) 55 })
@@ -21,8 +21,6 @@ @@ -21,8 +21,6 @@
21 <view class="cartnum">16</view> 21 <view class="cartnum">16</view>
22 </view> 22 </view>
23 </view> 23 </view>
24 -  
25 -  
26 <view class="homehead"> 24 <view class="homehead">
27 <view class="headtopimg"> 25 <view class="headtopimg">
28 <image src="../../static/headtop.png" mode=""></image> 26 <image src="../../static/headtop.png" mode=""></image>
@@ -68,7 +66,6 @@ @@ -68,7 +66,6 @@
68 <image src="../../static/miaosha.png" mode=""></image> 66 <image src="../../static/miaosha.png" mode=""></image>
69 </view> 67 </view>
70 <view class="homename">秒杀专区</view> 68 <view class="homename">秒杀专区</view>
71 -  
72 </view> 69 </view>
73 <view class="homeboxitem flexfour"> 70 <view class="homeboxitem flexfour">
74 <view class="homeitemimg"> 71 <view class="homeitemimg">
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 <view class="tapnav flextwo"> 11 <view class="tapnav flextwo">
12 <view class="tapnavitem" :class="order==0?'tapnavactive':''" @click="kindlist" :data-id="0">分类</view> 12 <view class="tapnavitem" :class="order==0?'tapnavactive':''" @click="kindlist" :data-id="0">分类</view>
13 <view class="tapnavitem" :class="order==1?'tapnavactive':''" @click="orderrange" :data-id="1">综合</view> 13 <view class="tapnavitem" :class="order==1?'tapnavactive':''" @click="orderrange" :data-id="1">综合</view>
14 - <view class="tapnavitem" :class="order==3?'tapnavactive':''" @click="orderrange" :data-id="2">销量</view> 14 + <view class="tapnavitem" :class="order==2?'tapnavactive':''" @click="orderrange" :data-id="2">销量</view>
15 <view class="tapnavitem flexone" :class="order==3||order==4?'tapnavactive':''" @click="selprice"> 15 <view class="tapnavitem flexone" :class="order==3||order==4?'tapnavactive':''" @click="selprice">
16 <view class="tapprice">价格</view> 16 <view class="tapprice">价格</view>
17 <view class="tapbox flexfour"> 17 <view class="tapbox flexfour">
@@ -23,6 +23,8 @@ @@ -23,6 +23,8 @@
23 </view> 23 </view>
24 </view> 24 </view>
25 </view> 25 </view>
  26 +
  27 +
26 </view> 28 </view>
27 <view class="nodata" v-if="show">暂无数据</view> 29 <view class="nodata" v-if="show">暂无数据</view>
28 <view class="homeshoplist flexone goodboxlist" v-else> 30 <view class="homeshoplist flexone goodboxlist" v-else>
@@ -54,7 +56,7 @@ @@ -54,7 +56,7 @@
54 page: 1, 56 page: 1,
55 keyword: '', 57 keyword: '',
56 shoplist: [], 58 shoplist: [],
57 - order: '', 59 + order: -1,
58 score_category_id:'', 60 score_category_id:'',
59 show:false 61 show:false
60 62
@@ -78,6 +80,7 @@ @@ -78,6 +80,7 @@
78 // 分类 80 // 分类
79 kindlist(e){ 81 kindlist(e){
80 this.order=e.currentTarget.dataset.id; 82 this.order=e.currentTarget.dataset.id;
  83 + uni.setStorageSync("selectId","")
81 uni.navigateTo({ 84 uni.navigateTo({
82 url:'/pages/homepage/goodkind' 85 url:'/pages/homepage/goodkind'
83 }) 86 })
@@ -131,21 +134,15 @@ @@ -131,21 +134,15 @@
131 url: '/pages/nearshop/goodtail?id=' + id + '&type=' + 2 134 url: '/pages/nearshop/goodtail?id=' + id + '&type=' + 2
132 }) 135 })
133 } 136 }
134 -  
135 -  
136 }, 137 },
137 onShow:function(){ 138 onShow:function(){
138 -  
139 - let pages = getCurrentPages();  
140 -  
141 - let currPage = pages[pages.length - 1]; //当前页面  
142 - this.score_category_id = currPage.data.selectId==undefined?'':currPage.data.selectId;  
143 - 139 + // let pages = getCurrentPages();
  140 + // let currPage = pages[pages.length - 1]; //当前页面
  141 + // this.score_category_id = currPage.data.selectId==undefined?'':currPage.data.selectId;
  142 + this.score_category_id=uni.getStorageSync("selectId")!=''?uni.getStorageSync("selectId"):''
144 this.shoplist=[]; 143 this.shoplist=[];
145 - this.page=1 144 + this.page=1;
146 this.getfoodlist(); 145 this.getfoodlist();
147 -  
148 -  
149 } 146 }
150 147
151 } 148 }
@@ -29,14 +29,8 @@ @@ -29,14 +29,8 @@
29 <view class="huiyuanprice dikou">会员价:¥{{item.vip_price}}</view> 29 <view class="huiyuanprice dikou">会员价:¥{{item.vip_price}}</view>
30 <view class="goodshou">已售{{item.sales}}</view> 30 <view class="goodshou">已售{{item.sales}}</view>
31 </view> 31 </view>
32 -  
33 </view> 32 </view>
34 -  
35 -  
36 </view> 33 </view>
37 -  
38 -  
39 -  
40 </view> 34 </view>
41 </template> 35 </template>
42 36
1 <template> 1 <template>
2 <view class="content"> 2 <view class="content">
  3 + <view class="editcart" @click="editcart">{{editsel==true?'编辑':'完成'}}</view>
  4 + <!-- <view class="editcart" @click="finishedit" v-else>完成</view> -->
  5 +
3 <view class="sureshop"> 6 <view class="sureshop">
4 <!-- 店铺商品--> 7 <!-- 店铺商品-->
5 <view v-if="data1.length!=0"> 8 <view v-if="data1.length!=0">
@@ -7,30 +10,30 @@ @@ -7,30 +10,30 @@
7 <view class="sureimg"> 10 <view class="sureimg">
8 <image src="../../static/nearshop.png" mode=""></image> 11 <image src="../../static/nearshop.png" mode=""></image>
9 </view> 12 </view>
10 - <view class="sureshopname">红大地面品厂</view> 13 + <view class="sureshopname">{{data1[0].name}}</view>
11 </view> 14 </view>
12 <view class='cartlist'> 15 <view class='cartlist'>
13 - <view class="sureorderitem flexone">  
14 - <view class="cartselimg">  
15 - <image src="../../static/cartsel.png" mode=""></image> 16 + <view class="sureorderitem flexone" v-for="(item,index) in data1[0].list" :key="index">
  17 + <view class="cartselimg" @click="selectcart(item,index)">
  18 + <image src="../../static/cartnosel.png" mode="" v-if="item.sel==false"></image>
  19 + <image src="../../static/cartsel.png" mode="" v-else></image>
16 </view> 20 </view>
17 <view class="sureorderitemleft"> 21 <view class="sureorderitemleft">
18 - <image src="../../static/goodtailtop.png" mode=""></image> 22 + <image :src="item.store_goods.store_goods_spec.spec_image" mode=""></image>
19 </view> 23 </view>
20 <view class='shuright'> 24 <view class='shuright'>
21 - <view class="suregoodnamek">商品名称商品名称商品名称商  
22 - 品名称商品名称商品名称商品名称商品名称 25 + <view class="suregoodnamek">{{item.store_goods.name}}
23 </view> 26 </view>
24 <view class="surebot flextwo"> 27 <view class="surebot flextwo">
25 - <view class="saleprice">¥288</view> 28 + <view class="saleprice">¥{{item.store_goods.price}}</view>
26 <view class="weightnumk flexone"> 29 <view class="weightnumk flexone">
27 - <view class="weightnumkleft leftk">  
28 - <image src="../../static/addimg.png" mode=""></image>  
29 - </view>  
30 - <view class="detailnum">1</view>  
31 - <view class="weightnumkleft rightk"> 30 + <view class="weightnumkleft rightk" @click="reducecart(item)">
32 <image src="../../static/reduceimg.png" mode=""></image> 31 <image src="../../static/reduceimg.png" mode=""></image>
33 </view> 32 </view>
  33 + <view class="detailnum">{{item.number}}</view>
  34 + <view class="weightnumkleft leftk" @click="addcart(item)">
  35 + <image src="../../static/addimg.png" mode=""></image>
  36 + </view>
34 </view> 37 </view>
35 </view> 38 </view>
36 </view> 39 </view>
@@ -126,7 +129,7 @@ @@ -126,7 +129,7 @@
126 </view> 129 </view>
127 </view> 130 </view>
128 </view> 131 </view>
129 - <view class="cartbottom flextwo"> 132 + <view class="cartbottom flextwo" v-if="editsel==true">
130 <view class="cartbotleft flexone" @click="selectall"> 133 <view class="cartbotleft flexone" @click="selectall">
131 <view class="cartselimg"> 134 <view class="cartselimg">
132 <image src="../../static/cartsel.png" mode="" v-if="selall"></image> 135 <image src="../../static/cartsel.png" mode="" v-if="selall"></image>
@@ -137,6 +140,18 @@ @@ -137,6 +140,18 @@
137 </view> 140 </view>
138 <view class='jiesuan' @click="jiesuan">去结算({{arr.length}}件)</view> 141 <view class='jiesuan' @click="jiesuan">去结算({{arr.length}}件)</view>
139 </view> 142 </view>
  143 +
  144 + <view class="cartbottom flextwo" v-else>
  145 + <view class="flexone">
  146 + <view class="cartselimg" @click="selshan">
  147 + <image src="../../static/cartsel.png" mode="" v-if="seldelall"></image>
  148 + <image src="../../static/cartnosel.png" mode="" v-else></image>
  149 + </view>
  150 + <view class="quanname">全选</view>
  151 + </view>
  152 +
  153 + <view class="delgoodname" @click="delgood">删除商品</view>
  154 + </view>
140 </view> 155 </view>
141 </view> 156 </view>
142 </template> 157 </template>
@@ -151,7 +166,10 @@ @@ -151,7 +166,10 @@
151 selall: false, 166 selall: false,
152 total: 0, 167 total: 0,
153 arr:[], 168 arr:[],
154 - data:[] 169 + data:[],
  170 + seldelall:false,
  171 + cartid:[],
  172 + editsel:true
155 } 173 }
156 }, 174 },
157 onLoad() { 175 onLoad() {
@@ -160,6 +178,85 @@ @@ -160,6 +178,85 @@
160 console.log(uni.getStorageSync("token")) 178 console.log(uni.getStorageSync("token"))
161 }, 179 },
162 methods: { 180 methods: {
  181 + editcart(){
  182 + this.editsel=!this.editsel;
  183 +
  184 + },
  185 +
  186 + // 删除商品
  187 + selshan(){
  188 + let that=this;
  189 + this.seldelall=!this.seldelall;
  190 + if(this.seldelall==true){
  191 + this.data3.forEach(function(value, index, array) {
  192 + value.sel = true;
  193 + that.$forceUpdate()
  194 + newcartid.push(value.id)
  195 +
  196 + })
  197 + this.data2.forEach(function(value, index, array){
  198 + value.sel = true;
  199 + that.$forceUpdate()
  200 + newcartid.push(value.id)
  201 +
  202 + })
  203 + this.data1[0].list.forEach(function(value, index, array){
  204 + value.sel = true;
  205 + that.$forceUpdate()
  206 + newcartid.push(value.id)
  207 +
  208 + })
  209 +
  210 + } else {
  211 + this.data3.forEach(function(value, index, array) {
  212 + value.sel = false;
  213 + })
  214 + this.data2.forEach(function(value, index, array){
  215 + value.sel =false
  216 + })
  217 + this.data1[0].list.forEach(function(value, index, array){
  218 + value.sel =false
  219 + })
  220 +
  221 + newcartid=[];
  222 + }
  223 + that.cartid=newcartid;
  224 + console.log(that.cartid)
  225 + },
  226 +
  227 + delgood(){
  228 + let that = this;
  229 + console.log(that.cartid)
  230 + uni.showModal({
  231 + title: '提示',
  232 + content: '是否删除该商品',
  233 + success: function (res) {
  234 + if (res.confirm) {
  235 +
  236 + var url = 'car/batch_delete';
  237 + var params = {
  238 + car_ids:that.cartid.join(",")
  239 + }
  240 + console.log(params)
  241 + app.post(url, params).then((res) => {
  242 + console.log(res);
  243 + uni.showToast({
  244 + title:'删除成功',
  245 + icon:"none"
  246 + })
  247 +
  248 + that.getcartlist()
  249 +
  250 + }).catch((err) => {
  251 + console.log(err)
  252 + })
  253 + } else if (res.cancel) {
  254 + console.log('用户点击取消');
  255 + }
  256 + }
  257 + });
  258 +
  259 + },
163 // 积分商品 260 // 积分商品
164 jifenshop() { 261 jifenshop() {
165 uni.navigateTo({ 262 uni.navigateTo({
@@ -185,6 +282,11 @@ @@ -185,6 +282,11 @@
185 that.data1 = res.data.data.data3; 282 that.data1 = res.data.data.data3;
186 that.data2 = res.data.data.data1; 283 that.data2 = res.data.data.data1;
187 that.data3 = res.data.data.data2; 284 that.data3 = res.data.data.data2;
  285 + // 店铺商品
  286 + that.data1[0].list.forEach(function(value,index,array){
  287 + value.sel = false;
  288 + })
  289 + that.data1=that.data1;
188 // 面坊商品 290 // 面坊商品
189 that.data2.forEach(function(value, index, array) { 291 that.data2.forEach(function(value, index, array) {
190 value.sel = false; 292 value.sel = false;
@@ -201,19 +303,24 @@ @@ -201,19 +303,24 @@
201 }) 303 })
202 }, 304 },
203 305
204 - //面坊商品选择购物车 306 + //选择购物车
205 selectcart(item, index) { 307 selectcart(item, index) {
206 console.log(item, index) 308 console.log(item, index)
207 let that = this; 309 let that = this;
  310 + let newcartid=[]
208 let obj={} 311 let obj={}
209 if (item.type == 2) { 312 if (item.type == 2) {
210 that.data3.forEach(function(value, index, array) { 313 that.data3.forEach(function(value, index, array) {
211 if (value.id == item.id) { 314 if (value.id == item.id) {
212 value.sel = !value.sel; 315 value.sel = !value.sel;
  316 + that.$forceUpdate()
213 if (value.sel == true) { 317 if (value.sel == true) {
214 that.arr.push(1) 318 that.arr.push(1)
215 that.total = that.total * 100 / 100 + value.score_goods.price * 100 / 100 * value.number; 319 that.total = that.total * 100 / 100 + value.score_goods.price * 100 / 100 * value.number;
216 - console.log(6666); 320 + newcartid.push(value.id);
  321 + console.log(3838944900)
  322 + console.log(newcartid);
  323 + that.cartid=newcartid
217 obj.type=item.type; 324 obj.type=item.type;
218 obj.goods_id=item.goods_id; 325 obj.goods_id=item.goods_id;
219 obj.spec_sku_id=item.spec_sku_id; 326 obj.spec_sku_id=item.spec_sku_id;
@@ -231,19 +338,27 @@ @@ -231,19 +338,27 @@
231 that.data.splice(index,1) 338 that.data.splice(index,1)
232 } 339 }
233 }) 340 })
  341 + newcartid.forEach(function(value,index,array){
  342 + if(value.id==item.id){
  343 + newcartid.splice(index,1)
  344 + }
  345 + })
234 } 346 }
235 that.data=that.data; 347 that.data=that.data;
236 - console.log(that.data) 348 +
237 } 349 }
238 }) 350 })
239 that.data3 = that.data3 351 that.data3 = that.data3
240 } else if (item.type == 1) { 352 } else if (item.type == 1) {
241 - console.log(88888) 353 +
242 that.data2.forEach(function(value, index, array) { 354 that.data2.forEach(function(value, index, array) {
243 if (value.id == item.id) { 355 if (value.id == item.id) {
244 value.sel = !value.sel; 356 value.sel = !value.sel;
  357 +
  358 + that.$forceUpdate()
245 if (value.sel == true) { 359 if (value.sel == true) {
246 - that.arr.push(1) 360 + that.arr.push(1);
  361 + newcartid.push(value.id);
247 that.total = that.total * 100 / 100 + value.flour_goods.price * 100 / 100 * value.number; 362 that.total = that.total * 100 / 100 + value.flour_goods.price * 100 / 100 * value.number;
248 obj.type=item.type; 363 obj.type=item.type;
249 obj.goods_id=item.goods_id; 364 obj.goods_id=item.goods_id;
@@ -259,12 +374,60 @@ @@ -259,12 +374,60 @@
259 that.data.splice(index,1) 374 that.data.splice(index,1)
260 } 375 }
261 }) 376 })
  377 + newcartid.forEach(function(value,index,array){
  378 + if(value.id==item.id){
  379 + newcartid.splice(index,1)
  380 + }
  381 + })
262 } 382 }
263 } 383 }
264 }) 384 })
265 that.data2 = that.data2; 385 that.data2 = that.data2;
266 that.data=that.data; 386 that.data=that.data;
267 console.log(that.data) 387 console.log(that.data)
  388 + }else if(item.type==3){
  389 +
  390 + console.log('999888',that.data1[0].list)
  391 + that.data1[0].list.forEach(function(value, index, array) {
  392 + if (value.id == item.id) {
  393 + console.log('383483',value.id)
  394 +
  395 + value.sel = !value.sel;
  396 +
  397 + that.$forceUpdate()
  398 + console.log(value.sel)
  399 + if (value.sel == true) {
  400 + console.log(value.sel)
  401 + that.arr.push(1);
  402 + newcartid.push(item.id);
  403 + that.total = that.total * 100 / 100 + value.store_goods.price * 100 / 100 * value.number;
  404 + obj.type=item.type;
  405 + obj.goods_id=item.goods_id;
  406 + obj.spec_sku_id=item.spec_sku_id;
  407 + obj.number=item.number;
  408 + that.data.push(obj)
  409 +
  410 + } else {
  411 + that.total = that.total * 100 / 100 - value.store_goods.price * 100 / 100 * value.number;
  412 + that.arr.splice(0,1);
  413 + that.data.forEach(function(value,index,array){
  414 + if(item.goods_id==value.goods_id){
  415 + that.data.splice(index,1)
  416 + }
  417 + })
  418 + newcartid.forEach(function(value,index,array){
  419 + if(value.id==item.id){
  420 + newcartid.splice(index,1)
  421 + }
  422 + })
  423 + }
  424 + }
  425 + })
  426 + that.data1 = that.data1;
  427 + that.data=that.data;
  428 + that.cartid=newcartid;
  429 + console.log(that.data);
  430 + console.log(that.cartid)
268 } 431 }
269 432
270 }, 433 },
@@ -273,17 +436,27 @@ @@ -273,17 +436,27 @@
273 let that=this; 436 let that=this;
274 this.selall = !this.selall; 437 this.selall = !this.selall;
275 let newarr=[]; 438 let newarr=[];
276 - let newtotal=0 439 + let newtotal=0;
  440 + let newcartid=[]
277 if (this.selall == true) { 441 if (this.selall == true) {
278 this.data3.forEach(function(value, index, array) { 442 this.data3.forEach(function(value, index, array) {
279 value.sel = true; 443 value.sel = true;
280 newarr.push(1); 444 newarr.push(1);
281 - newtotal=newtotal+value.score_goods.price * 100 / 100 * value.number 445 + newtotal=newtotal+value.score_goods.price * 100 / 100 * value.number;
  446 + newcartid.push(value.id)
282 // this.total = this.total * 100 / 100 + value.score_goods.price * 100 / 100 * value.number 447 // this.total = this.total * 100 / 100 + value.score_goods.price * 100 / 100 * value.number
283 }) 448 })
284 this.data2.forEach(function(value, index, array){ 449 this.data2.forEach(function(value, index, array){
285 value.sel = true; 450 value.sel = true;
286 - newtotal=newtotal+value.flour_goods.price * 100 / 100 * value.number 451 + newtotal=newtotal+value.flour_goods.price * 100 / 100 * value.number;
  452 + newcartid.push(value.id)
  453 + // this.total = this.total * 100 / 100 + value.flour_goods.price * 100 / 100 * value.number;
  454 + newarr.push(1)
  455 + })
  456 + this.data1[0].list.forEach(function(value, index, array){
  457 + value.sel = true;
  458 + newtotal=newtotal+value.store_goods.price * 100 / 100 * value.number;
  459 + newcartid.push(value.id)
287 // this.total = this.total * 100 / 100 + value.flour_goods.price * 100 / 100 * value.number; 460 // this.total = this.total * 100 / 100 + value.flour_goods.price * 100 / 100 * value.number;
288 newarr.push(1) 461 newarr.push(1)
289 }) 462 })
@@ -295,12 +468,17 @@ @@ -295,12 +468,17 @@
295 this.data2.forEach(function(value, index, array){ 468 this.data2.forEach(function(value, index, array){
296 value.sel =false 469 value.sel =false
297 }) 470 })
  471 + this.data1[0].list.forEach(function(value, index, array){
  472 + value.sel =false
  473 + })
298 newarr=[]; 474 newarr=[];
299 - newtotal=0 475 + newtotal=0;
  476 + newcartid=[];
300 } 477 }
301 this.data3 = this.data3; 478 this.data3 = this.data3;
302 this.total=newtotal; 479 this.total=newtotal;
303 this.arr=newarr; 480 this.arr=newarr;
  481 + this.cartid=newcartid;
304 482
305 }, 483 },
306 //购物车增加 484 //购物车增加
@@ -329,6 +507,19 @@ @@ -329,6 +507,19 @@
329 }) 507 })
330 that.data2 = that.data2; 508 that.data2 = that.data2;
331 509
  510 + }else if(item.type==3){
  511 + that.data1[0].list.forEach(function(value, index, array) {
  512 + console.log('3787478',value)
  513 + if (value.id == item.id) {
  514 + console.log(value.id);
  515 + console.log(item.id)
  516 + value.number++;
  517 + if (item.sel == true) {
  518 + that.total = that.total * 100 / 100 + value.store_goods.price * 100 / 100 * 1;
  519 + }
  520 + }
  521 + })
  522 + that.data1 = that.data1;
332 } 523 }
333 that.addcartk(item.id) 524 that.addcartk(item.id)
334 525
@@ -390,6 +581,24 @@ @@ -390,6 +581,24 @@
390 } 581 }
391 }) 582 })
392 that.data2 = that.data2; 583 that.data2 = that.data2;
  584 + }else if(item.type==3){
  585 + that.data1[0].list.forEach(function(value, index, array) {
  586 + if (value.id == item.id) {
  587 + if (value.number > 1) {
  588 + value.number = value.number - 1;
  589 + that.reducecartk(item.id);
  590 + if (item.sel == true) {
  591 + that.total = that.total * 100 / 100 - value.store_goods.price * 100 / 100 * 1;
  592 + }
  593 + }else{
  594 + uni.showToast({
  595 + title: '不能再减少了~',
  596 + icon: 'none'
  597 + })
  598 + }
  599 + }
  600 + })
  601 + that.data1 = that.data1;
393 } 602 }
394 }, 603 },
395 reducecartk(id) { 604 reducecartk(id) {
@@ -427,10 +636,11 @@ @@ -427,10 +636,11 @@
427 console.log(params) 636 console.log(params)
428 app.post(url, params,"post").then((res) => { 637 app.post(url, params,"post").then((res) => {
429 console.log(res); 638 console.log(res);
430 - console.log(res.data.data) 639 + console.log(res.data.data);
  640 + let seldata=JSON.stringify(that.data)
431 uni.setStorageSync("goodinfo",res.data.data); 641 uni.setStorageSync("goodinfo",res.data.data);
432 uni.navigateTo({ 642 uni.navigateTo({
433 - url:'/pages/nearshop/sureorder' 643 + url:'/pages/nearshop/sureorder?seldata='+seldata
434 }) 644 })
435 645
436 }).catch((err) => { 646 }).catch((err) => {
@@ -450,6 +660,29 @@ @@ -450,6 +660,29 @@
450 page { 660 page {
451 background: #F8F6F9; 661 background: #F8F6F9;
452 } 662 }
  663 + .editcart{
  664 + color:#3D454C;
  665 + font-size: 28rpx;
  666 + width:750rpx;
  667 + background: #fff;
  668 + text-align: right;
  669 + padding: 0 32rpx;
  670 + box-sizing: border-box;
  671 + }
  672 + .quanname{
  673 + color:#3D454C;
  674 + font-size: 28rpx;
  675 + }
  676 + .delgoodname{
  677 + width:280rpx;
  678 + height:88rpx;
  679 + background:rgba(194,148,69,1);
  680 + border-radius:16rpx;
  681 + color:#fff;
  682 + font-size: 28rpx;
  683 + text-align: center;
  684 + line-height: 88rpx;
  685 + }
453 686
454 .cartlist { 687 .cartlist {
455 /* padding-bottom: 120rpx; */ 688 /* padding-bottom: 120rpx; */
@@ -3,22 +3,55 @@ @@ -3,22 +3,55 @@
3 <view class="goodtailtop"> 3 <view class="goodtailtop">
4 <image :src="goodtail.image" mode=""></image> 4 <image :src="goodtail.image" mode=""></image>
5 </view> 5 </view>
6 - <view class="tailbox boxsizing" v-if="type==1">  
7 - <view class="tailname">  
8 - {{goodtail.name}} 6 + <view v-if="type==1">
  7 + <view class="tailbox boxsizing" v-if="goodtail.is_seckill==2">
  8 + <view class="tailname">
  9 + {{goodtail.name}}
  10 + </view>
  11 + <view class="tailhezi flextwo">
  12 + <view class="tailhezileft flexone">
  13 + <view class="saleprice">¥{{goodtail.goods_price}}</view>
  14 + <view class="huiyuanprice">会员价:¥{{goodtail.vip_price}}</view>
  15 + </view>
  16 + <view class="heziright flexone">
  17 + <!-- {{goodtail.flour_goods_spec.stock_num}} -->
  18 + <view class="heziprice stock">库存:件</view>
  19 + <view class="heziprice">已售{{goodtail.sales}}件</view>
  20 + </view>
  21 + </view>
9 </view> 22 </view>
10 - <view class="tailhezi flextwo">  
11 - <view class="tailhezileft flexone">  
12 - <view class="saleprice">¥{{goodtail.goods_price}}</view>  
13 - <view class="huiyuanprice">会员价:¥{{goodtail.vip_price}}</view> 23 +
  24 + <view class="tailbox boxsizing" v-else>
  25 + <view class="tailname">
  26 + <text class='miaobox'>限时秒杀</text>
  27 + {{goodtail.name}}
14 </view> 28 </view>
15 - <view class="heziright flexone">  
16 - <!-- {{goodtail.flour_goods_spec.stock_num}} -->  
17 - <view class="heziprice stock">库存:件</view>  
18 - <view class="heziprice">已售{{goodtail.sales}}件</view> 29 + <view class="tailhezi flextwo">
  30 + <view class="tailhezileft flexone">
  31 + <view class="saleprice">¥{{item.seckill_price}}</view>
  32 + <view class="oldprice">¥{{item.goods_price}}</view>
  33 + </view>
  34 + </view>
  35 + <view class='miaodu flextwo'>
  36 + <view class="miaoduleft">
  37 + <view class="miaotiao">
  38 + 已抢购60%
  39 + </view>
  40 + </view>
  41 + <view class="miaoright flexone">
  42 + <view class="distance">距离结束还剩</view>
  43 + <view class="remaintime">23</view>
  44 + <view class="dian">:</view>
  45 + <view class="remaintime">53</view>
  46 + <view class="dian">:</view>
  47 + <view class="remaintime">42</view>
  48 + </view>
19 </view> 49 </view>
20 </view> 50 </view>
  51 +
21 </view> 52 </view>
  53 +
  54 +
22 <view class="tailbox boxsizing" v-else-if="type==2"> 55 <view class="tailbox boxsizing" v-else-if="type==2">
23 <view class="tailname"> 56 <view class="tailname">
24 {{goodtail.name}} 57 {{goodtail.name}}
@@ -34,34 +67,23 @@ @@ -34,34 +67,23 @@
34 </view> 67 </view>
35 </view> 68 </view>
36 </view> 69 </view>
37 - <view class="tailbox boxsizing" v-else> 70 +
  71 + <view class="tailbox boxsizing" v-else-if="type==3">
38 <view class="tailname"> 72 <view class="tailname">
39 - <text class='miaobox'>限时秒杀</text>  
40 - 商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称 73 + {{goodtail.name}}
41 </view> 74 </view>
42 <view class="tailhezi flextwo"> 75 <view class="tailhezi flextwo">
43 <view class="tailhezileft flexone"> 76 <view class="tailhezileft flexone">
44 - <view class="saleprice">¥288</view>  
45 - <view class="oldprice">¥450</view>  
46 - </view>  
47 - </view>  
48 - <view class='miaodu flextwo'>  
49 - <view class="miaoduleft">  
50 - <view class="miaotiao">  
51 - 已抢购60%  
52 - </view> 77 + <view class="saleprice">¥{{goodtail.goods_price}}</view>
  78 + <!-- <view class="huiyuanprice">会员价:¥{{goodtail.vip_price}}</view> -->
53 </view> 79 </view>
54 - <view class="miaoright flexone">  
55 - <view class="distance">距离结束还剩</view>  
56 - <view class="remaintime">23</view>  
57 - <view class="dian">:</view>  
58 - <view class="remaintime">53</view>  
59 - <view class="dian">:</view>  
60 - <view class="remaintime">42</view> 80 + <view class="heziright flexone">
  81 + <!-- <view class="heziprice stock">库存:{{goodtail.score_goods_spec.stock_num}}件</view> -->
  82 + <view class="heziprice">已售{{goodtail.sales}}件</view>
61 </view> 83 </view>
62 </view> 84 </view>
63 </view> 85 </view>
64 - 86 +
65 <view class="send"> 87 <view class="send">
66 {{goodtail.postage}} 88 {{goodtail.postage}}
67 <!-- 包邮 店铺满100元包邮 --> 89 <!-- 包邮 店铺满100元包邮 -->
@@ -76,12 +98,11 @@ @@ -76,12 +98,11 @@
76 </view> 98 </view>
77 <view class="goodcomment" v-else> 99 <view class="goodcomment" v-else>
78 <view class="goodcommentop flexone"> 100 <view class="goodcommentop flexone">
79 - <view class="topitem">全部(60万)</view>  
80 - <view class="topitem">好评(16万)</view>  
81 - <view class="topitem">中评(10万)</view>  
82 - <view class="topitem">差评(600)</view> 101 + <view class="topitem" @click="commenttype" :data-id="0">全部(60万)</view>
  102 + <view class="topitem" @click="commenttype" :data-id="1">好评(16万)</view>
  103 + <view class="topitem" @click="commenttype" :data-id="2">中评(10万)</view>
  104 + <view class="topitem" @click="commenttype" :data-id="3">差评(600)</view>
83 </view> 105 </view>
84 -  
85 <view class="commentlist"> 106 <view class="commentlist">
86 <view class="jianintro photobox" bindtap="comdetail"> 107 <view class="jianintro photobox" bindtap="comdetail">
87 <view class="comtop flextwo"> 108 <view class="comtop flextwo">
@@ -178,13 +199,14 @@ @@ -178,13 +199,14 @@
178 <view class="saleprice" v-if="type==2">¥{{goodtail.score_goods_spec.goods_price}}</view> 199 <view class="saleprice" v-if="type==2">¥{{goodtail.score_goods_spec.goods_price}}</view>
179 </view> 200 </view>
180 </view> 201 </view>
181 - <view v-for="(item,parindex) in specarr" :key="parindex" > 202 + <view v-for="(item,parindex) in specarr" :key="parindex">
182 <view class="weightbox"> 203 <view class="weightbox">
183 <view class="weight">{{item.spec_name}}</view> 204 <view class="weight">{{item.spec_name}}</view>
184 <view class="weightlsit flexone"> 205 <view class="weightlsit flexone">
185 <!-- witemactive --> 206 <!-- witemactive -->
186 - <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>  
187 - 207 + <view class="weightlsititem" :class="item.selindex==childindex?'witemactive':''" v-for="(itemk,childindex) in item.spec_value"
  208 + :key="childindex" @click.stop="selspec(parindex,childindex)">{{itemk.spec_value}}</view>
  209 +
188 </view> 210 </view>
189 </view> 211 </view>
190 </view> 212 </view>
@@ -205,7 +227,7 @@ @@ -205,7 +227,7 @@
205 <view class="addcarbtnkright" @click="sure">确定</view> 227 <view class="addcarbtnkright" @click="sure">确定</view>
206 </view> 228 </view>
207 </view> 229 </view>
208 - 230 +
209 </view> 231 </view>
210 </view> 232 </view>
211 </template> 233 </template>
@@ -214,249 +236,308 @@ @@ -214,249 +236,308 @@
214 export default { 236 export default {
215 data() { 237 data() {
216 return { 238 return {
217 - footersel:1, 239 + footersel: 1,
218 sel: 2, 240 sel: 2,
219 - shuwrap:false,  
220 - goodid:'',  
221 - type:"", //type 1 面访商城 2 积分商城  
222 - goodtail:'',  
223 - tapnavactive:'',  
224 - selnav:1,  
225 - 241 + shuwrap: false,
  242 + goodid: '',
  243 + type: "", //type 1 面访商城 2 积分商城
  244 + goodtail: '',
  245 + tapnavactive: '',
  246 + selnav: 1,
  247 +
226 // 商品规格 248 // 商品规格
227 - specarr:[], 249 + specarr: [],
228 // 商品规格id 250 // 商品规格id
229 - spec_sku_id:[],  
230 - addtype:'',//1 加入购物车 2立即购买  
231 - cartnumber:1,  
232 - arr:[],  
233 - 251 + spec_sku_id: [],
  252 + addtype: '', //1 加入购物车 2立即购买
  253 + cartnumber: 1,
  254 + arr: [],
  255 + page:1,
  256 + star_type:'',
  257 + // 评论列表
  258 + commentlist:[]
  259 +
234 } 260 }
235 }, 261 },
236 onLoad(options) { 262 onLoad(options) {
237 console.log(options) 263 console.log(options)
238 - this.goodid=options.id,  
239 - this.type=options.type;  
240 - if(this.type==1){ 264 + this.goodid = options.id,
  265 + this.type = options.type;
  266 + if (this.type == 1) {
241 this.getgoodtail(); 267 this.getgoodtail();
242 - }else{ 268 + } else if (this.type == 2) {
243 this.getjifengoodtail(); 269 this.getjifengoodtail();
  270 + } else {
  271 + this.getshopgoodtail()
244 } 272 }
245 - 273 +
246 }, 274 },
247 methods: { 275 methods: {
248 - hideshu(){  
249 - this.shuwrap=false 276 + hideshu() {
  277 + this.shuwrap = false
  278 + },
  279 + // 评论切换
  280 + commenttype(e){
  281 + this.star_type=e.currentTarget.dataset.id;
250 }, 282 },
251 // 顶部导航切换 283 // 顶部导航切换
252 - navtap(e){  
253 - this.selnav=e.currentTarget.dataset.id 284 + navtap(e) {
  285 + this.selnav = e.currentTarget.dataset.id;
  286 + if(this.selnav==1){
  287 + if (this.type == 1) {
  288 + this.getgoodtail();
  289 + } else if (this.type == 2) {
  290 + this.getjifengoodtail();
  291 + } else {
  292 + this.getshopgoodtail()
  293 + }
  294 + }else{
  295 + this.page=1;
  296 + this.commentlist=[];
  297 + this.getcommentlist();
  298 + }
254 }, 299 },
255 // 数量加减 300 // 数量加减
256 - reducenum(){  
257 - this.cartnumber=this.cartnumber-1;  
258 - if(this.cartnumber==0){ 301 + reducenum() {
  302 + this.cartnumber = this.cartnumber - 1;
  303 + if (this.cartnumber == 0) {
259 uni.showToast({ 304 uni.showToast({
260 - title:'不能再减少了',  
261 - icon:"none" 305 + title: '不能再减少了',
  306 + icon: "none"
262 }) 307 })
263 - this.cartnumber=1  
264 - }else{  
265 - this.cartnumber=this.cartnumber 308 + this.cartnumber = 1
  309 + } else {
  310 + this.cartnumber = this.cartnumber
266 } 311 }
267 - 312 +
268 }, 313 },
269 - addnum(){  
270 - this.cartnumber=this.cartnumber+1; 314 + addnum() {
  315 + this.cartnumber = this.cartnumber + 1;
271 console.log(this.cartnumber) 316 console.log(this.cartnumber)
272 - this.cartnumber=this.cartnumber 317 + this.cartnumber = this.cartnumber
273 }, 318 },
274 - //获取面坊商品详情  
275 - getgoodtail(){ 319 +
  320 + // 获取评论列表
  321 + getcommentlist(){
276 let that = this; 322 let that = this;
277 - var url = 'flour_goods/get_flour_goods_detail';  
278 - var params = {  
279 - flour_goods_id: that.goodid,  
280 - }  
281 - app.post(url, params).then((res) => {  
282 - console.log(res);  
283 - that.goodtail=res.data.data 323 + var url = 'goods_comments/get_list';
  324 + var params = {
  325 + type:that.type,
  326 + goods_id:that.goodid,
  327 + star_type:that.star_type,
  328 + page:that.page,
  329 + pageNum:10
  330 + }
  331 + app.post(url, params).then((res) => {
  332 + console.log(res);
  333 + that.commentlist=that.commentlist.concat(res.data.data)
  334 +
284 335
285 - }).catch((err) => { 336 + }).catch((err) => {
286 337
287 - }) 338 + })
  339 + },
  340 + //获取面坊商品详情
  341 + getgoodtail() {
  342 + let that = this;
  343 + var url = 'flour_goods/get_flour_goods_detail';
  344 + var params = {
  345 + flour_goods_id: that.goodid,
  346 + }
  347 + app.post(url, params).then((res) => {
  348 + console.log(res);
  349 + that.goodtail = res.data.data
  350 +
  351 + }).catch((err) => {
  352 +
  353 + })
288 }, 354 },
289 // 获取积分商城商品详情 355 // 获取积分商城商品详情
290 - getjifengoodtail(){  
291 - 356 + getjifengoodtail() {
292 let that = this; 357 let that = this;
293 - var url = 'score_goods/get_score_goods_detail';  
294 - var params = {  
295 - score_goods_id: that.goodid,  
296 - }  
297 - console.log(params)  
298 - app.post(url, params).then((res) => {  
299 - console.log(res);  
300 - that.goodtail=res.data.data  
301 -  
302 - }).catch((err) => {  
303 - console.log(err)  
304 -  
305 - }) 358 + var url = 'score_goods/get_score_goods_detail';
  359 + var params = {
  360 + score_goods_id: that.goodid,
  361 + }
  362 + console.log(params)
  363 + app.post(url, params).then((res) => {
  364 + console.log(res);
  365 + that.goodtail = res.data.data
  366 +
  367 + }).catch((err) => {
  368 + console.log(err)
  369 +
  370 + })
  371 + },
  372 + // 获取店铺商品详情
  373 + getshopgoodtail() {
  374 + let that = this;
  375 + var url = 'store_goods/get_store_goods_detail';
  376 + var params = {
  377 + store_goods_id: that.goodid,
  378 + }
  379 + console.log(params)
  380 + app.post(url, params).then((res) => {
  381 + console.log(res);
  382 + that.goodtail = res.data.data
  383 +
  384 + }).catch((err) => {
  385 + console.log(err)
  386 + })
306 }, 387 },
307 // 加入购物车 388 // 加入购物车
308 - addcart(){  
309 - this.shuwrap=true; 389 + addcart() {
  390 + this.shuwrap = true;
310 this.getspecs(); 391 this.getspecs();
311 - this.addtype=1 392 + this.addtype = 1
312 }, 393 },
313 // 立即购买 394 // 立即购买
314 - buynow(){  
315 - this.shuwrap=true; 395 + buynow() {
  396 + this.shuwrap = true;
316 this.getspecs(); 397 this.getspecs();
317 - this.addtype=2 398 + this.addtype = 2
318 }, 399 },
319 //获取商品规格 400 //获取商品规格
320 - getspecs(){ 401 + getspecs() {
321 let that = this; 402 let that = this;
322 - var url = 'score_goods/get_spec_sku1';  
323 - var params = {  
324 - score_goods_id: that.goodid,  
325 - }  
326 - console.log(params)  
327 - app.post(url, params).then((res) => {  
328 - console.log(res);  
329 - that.specarr=res.data.data;  
330 - that.specarr.forEach(function(value,index,array){  
331 - value.selindex=0;  
332 -  
333 - value.spec_value.forEach(function(valuek,indexk,arrayk){  
334 - if(indexk==0){  
335 - value.selid=valuek.id;  
336 - }  
337 - valuek.sel=false  
338 - })  
339 - })  
340 -  
341 - that.specarr=that.specarr;  
342 -  
343 - }).catch((err) => {  
344 - console.log(err)  
345 - }) 403 + var url = 'score_goods/get_spec_sku1';
  404 + var params = {
  405 + score_goods_id: that.goodid,
  406 + }
  407 + console.log(params)
  408 + app.post(url, params).then((res) => {
  409 + console.log(res);
  410 + that.specarr = res.data.data;
  411 + that.specarr.forEach(function(value, index, array) {
  412 + value.selindex = 0;
  413 +
  414 + value.spec_value.forEach(function(valuek, indexk, arrayk) {
  415 + if (indexk == 0) {
  416 + value.selid = valuek.id;
  417 + }
  418 + valuek.sel = false
  419 + })
  420 + })
  421 +
  422 + that.specarr = that.specarr;
  423 +
  424 + }).catch((err) => {
  425 + console.log(err)
  426 + })
346 }, 427 },
347 // 选择商品规格 428 // 选择商品规格
348 - selspec(parindex,childindex){  
349 - let newspecarr=this.specarr;  
350 -  
351 - newspecarr[parindex].spec_value[childindex].sel=!newspecarr[parindex].spec_value[childindex].sel;  
352 - newspecarr[parindex].selindex=childindex;  
353 - newspecarr[parindex].selid=newspecarr[parindex].spec_value[childindex].id 429 + selspec(parindex, childindex) {
  430 + let newspecarr = this.specarr;
  431 +
  432 + newspecarr[parindex].spec_value[childindex].sel = !newspecarr[parindex].spec_value[childindex].sel;
  433 + newspecarr[parindex].selindex = childindex;
  434 + newspecarr[parindex].selid = newspecarr[parindex].spec_value[childindex].id
354 this.arr.push(newspecarr[parindex].spec_value[childindex].id); 435 this.arr.push(newspecarr[parindex].spec_value[childindex].id);
355 // console.log(this.spec_sku_id) 436 // console.log(this.spec_sku_id)
356 - this.specarr=newspecarr;  
357 - 437 + this.specarr = newspecarr;
  438 +
358 // console.log(this.specarr[parindex].spec_value[childindex].sel) 439 // console.log(this.specarr[parindex].spec_value[childindex].sel)
359 console.log(JSON.stringify(this.specarr)) 440 console.log(JSON.stringify(this.specarr))
360 this.changspec() 441 this.changspec()
361 }, 442 },
362 // 更换商品的图片和价格 443 // 更换商品的图片和价格
363 - changspec(){ 444 + changspec() {
364 let that = this; 445 let that = this;
365 - let newspec_sku_id=[]  
366 -  
367 - that.specarr.forEach(function(value,index,array){ 446 + let newspec_sku_id = []
  447 +
  448 + that.specarr.forEach(function(value, index, array) {
368 newspec_sku_id.push(value.selid) 449 newspec_sku_id.push(value.selid)
369 }) 450 })
370 - that.spec_sku_id=newspec_sku_id  
371 - var url = 'score_goods/get_spec_sku2';  
372 - var params = {  
373 - score_goods_id:that.goodid,  
374 - spec_sku_id:that.spec_sku_id.join("_")  
375 - }  
376 - console.log(params)  
377 - app.post(url, params).then((res) => {  
378 - console.log(res);  
379 - if(that.type==1){  
380 - that.goodtail.flour_goods_spec=res.data.data;  
381 - that.goodtail.price=res.data.data.price;  
382 - }else if(that.type==2){  
383 - that.goodtail.score_goods_spec=res.data.data  
384 - }  
385 - that.goodtail=that.goodtail;  
386 - }).catch((err) => {  
387 - console.log(err)  
388 -  
389 - }) 451 + that.spec_sku_id = newspec_sku_id
  452 + var url = 'score_goods/get_spec_sku2';
  453 + var params = {
  454 + score_goods_id: that.goodid,
  455 + spec_sku_id: that.spec_sku_id.join("_")
  456 + }
  457 + console.log(params)
  458 + app.post(url, params).then((res) => {
  459 + console.log(res);
  460 + if (that.type == 1) {
  461 + that.goodtail.flour_goods_spec = res.data.data;
  462 + that.goodtail.price = res.data.data.price;
  463 + } else if (that.type == 2) {
  464 + that.goodtail.score_goods_spec = res.data.data
  465 + }
  466 + that.goodtail = that.goodtail;
  467 + }).catch((err) => {
  468 + console.log(err)
  469 +
  470 + })
390 }, 471 },
391 - sure(){  
392 - if(this.addtype==1){ 472 + sure() {
  473 + if (this.addtype == 1) {
393 this.addcartk(); 474 this.addcartk();
394 - }else{ 475 + } else {
395 this.buynowk() 476 this.buynowk()
396 } 477 }
397 }, 478 },
398 // 加入购物车 479 // 加入购物车
399 - addcartk(){ 480 + addcartk() {
400 let that = this; 481 let that = this;
401 - let newspec_sku_id=[]  
402 -  
403 - that.specarr.forEach(function(value,index,array){ 482 + let newspec_sku_id = []
  483 +
  484 + that.specarr.forEach(function(value, index, array) {
404 newspec_sku_id.push(value.selid) 485 newspec_sku_id.push(value.selid)
405 }) 486 })
406 - that.spec_sku_id=newspec_sku_id  
407 - var url = 'car/join_car';  
408 - var params = {  
409 - type:this.type,  
410 - goods_id:this.goodid,  
411 - spec_sku_id:that.spec_sku_id.join("_"),  
412 - number: that.cartnumber,  
413 - }  
414 - console.log(params)  
415 - app.post(url, params).then((res) => {  
416 - console.log(res);  
417 - uni.showToast({  
418 - title:"加入购物车成功",  
419 - icon:'none'  
420 - })  
421 -  
422 - setTimeout(function(){  
423 - uni.navigateTo({  
424 - url:'/pages/nearshop/cartlist'  
425 - })  
426 - },1500)  
427 -  
428 -  
429 - }).catch((err) => {  
430 - console.log(err)  
431 -  
432 - }) 487 + that.spec_sku_id = newspec_sku_id
  488 + var url = 'car/join_car';
  489 + var params = {
  490 + type: this.type,
  491 + goods_id: this.goodid,
  492 + spec_sku_id: that.spec_sku_id.join("_"),
  493 + number: that.cartnumber,
  494 + }
  495 + console.log(params)
  496 + app.post(url, params).then((res) => {
  497 + console.log(res);
  498 + uni.showToast({
  499 + title: "加入购物车成功",
  500 + icon: 'none'
  501 + })
  502 +
  503 + setTimeout(function() {
  504 + uni.navigateTo({
  505 + url: '/pages/nearshop/cartlist'
  506 + })
  507 + }, 1500)
  508 +
  509 +
  510 + }).catch((err) => {
  511 + console.log(err)
  512 +
  513 + })
433 }, 514 },
434 // 立即购买 515 // 立即购买
435 - buynowk(){ 516 + buynowk() {
436 let that = this; 517 let that = this;
437 - let newspec_sku_id=[]  
438 -  
439 - that.specarr.forEach(function(value,index,array){ 518 + let newspec_sku_id = []
  519 +
  520 + that.specarr.forEach(function(value, index, array) {
440 newspec_sku_id.push(value.selid) 521 newspec_sku_id.push(value.selid)
441 }) 522 })
442 - that.spec_sku_id=newspec_sku_id  
443 -  
444 - var url = 'car/join_car';  
445 - var params = {  
446 - type:this.type,  
447 - goods_id:this.goodid,  
448 - spec_sku_id:that.spec_sku_id.join(","),  
449 - number: that.cartnumber,  
450 - }  
451 - console.log(params)  
452 - app.post(url, params).then((res) => {  
453 - console.log(res);  
454 -  
455 -  
456 - }).catch((err) => {  
457 - console.log(err)  
458 -  
459 - }) 523 + that.spec_sku_id = newspec_sku_id
  524 +
  525 + var url = 'car/join_car';
  526 + var params = {
  527 + type: this.type,
  528 + goods_id: this.goodid,
  529 + spec_sku_id: that.spec_sku_id.join(","),
  530 + number: that.cartnumber,
  531 + }
  532 + console.log(params)
  533 + app.post(url, params).then((res) => {
  534 + console.log(res);
  535 +
  536 +
  537 + }).catch((err) => {
  538 + console.log(err)
  539 +
  540 + })
460 } 541 }
461 } 542 }
462 543
@@ -5,66 +5,74 @@ @@ -5,66 +5,74 @@
5 <view class="yourow"> 5 <view class="yourow">
6 <image src="../../static/zuorow.png" mode=""></image> 6 <image src="../../static/zuorow.png" mode=""></image>
7 </view> 7 </view>
8 -  
9 </view> --> 8 </view> -->
10 - <view class="navmiddle flexone"> 9 + <view class="navmiddle navmiddlek flexone">
11 <view class="middleleft"> 10 <view class="middleleft">
12 <image src="../../static/search.png" mode=""></image> 11 <image src="../../static/search.png" mode=""></image>
13 </view> 12 </view>
14 <view class="middleenter"> 13 <view class="middleenter">
15 - <input type="text" placeholder="请输入商品,店铺搜索" placeholder-class="enterk" /> 14 + <input type="text" placeholder="请输入商品,店铺搜索" placeholder-class="enterk" @input="enterword" />
16 </view> 15 </view>
17 </view> 16 </view>
18 - <view class="souyou"> 17 + <view class="souyou" @click="search">
19 搜索 18 搜索
20 </view> 19 </view>
21 </view> 20 </view>
22 <view class="tapnav flexone"> 21 <view class="tapnav flexone">
23 - <view class="tapnavitem nearactive">距离最近</view>  
24 - <view class="tapnavitem pingfen">评分最高</view>  
25 - 22 + <!-- :class="order==2?'nearactive':''" -->
  23 + <!-- :class="order==3?'nearactive':''" -->
  24 + <view class="tapnavitem" :class="order==2?'nearactive':''" @click="rangge" :data-id="2">距离最近</view>
  25 + <view class="tapnavitem pingfen" @click="rangge" :class="order==3?'nearactive':''" :data-id="3">评分最高</view>
26 </view> 26 </view>
27 - <view class="searchshop commnonpadding">  
28 - <view class="searchgooditem flex boxsizing"> 27 +
  28 + <view class="nodata" v-if="shoplist.length==0">暂无数据</view>
  29 + <view class="searchshop commnonpadding" v-else>
  30 + <!-- v-fo="(item,index) in shoplist" :key="" -->
  31 + <view class="searchgooditem flex boxsizing" v-for="(item,index) in shoplist" :key="index" @click="shopdetail" :data-id="item.id">
29 <view class="shopleftimg"> 32 <view class="shopleftimg">
30 - <image src="../../static/shop.png" mode=""></image> 33 + <image :src="item.image" mode=""></image>
31 </view> 34 </view>
32 <view class="shopright"> 35 <view class="shopright">
33 - <view class="shopname">湖北省南阳市南阳面粉厂</view> 36 + <view class="shopname">{{item.name}}</view>
34 <view class="shopmiddle flexone"> 37 <view class="shopmiddle flexone">
35 <view class="shopmiddleleft"> 38 <view class="shopmiddleleft">
36 - 8.2 39 + {{item.score}}
37 </view> 40 </view>
38 <view class="shopmiddleright"> 41 <view class="shopmiddleright">
39 <view class="star flex"> 42 <view class="star flex">
40 <view class="starimg"> 43 <view class="starimg">
41 - <image src="../../static/shixing.png" mode=""></image> 44 + <image src="../../static/shixing.png" mode="" v-if="item.star>=2"></image>
  45 + <image src="../../static/kongxing.png" mode="" v-else></image>
42 </view> 46 </view>
43 <view class="starimg"> 47 <view class="starimg">
44 - <image src="../../static/shixing.png" mode=""></image> 48 + <image src="../../static/shixing.png" mode="" v-if="item.star>=4"></image>
  49 + <image src="../../static/kongxing.png" mode="" v-else></image>
45 </view> 50 </view>
46 <view class="starimg"> 51 <view class="starimg">
47 - <image src="../../static/shixing.png" mode=""></image> 52 + <image src="../../static/shixing.png" mode="" v-if="item.star>=6"></image>
  53 + <image src="../../static/kongxing.png" mode="" v-else></image>
48 </view> 54 </view>
49 <view class="starimg"> 55 <view class="starimg">
50 - <image src="../../static/shixing.png" mode=""></image> 56 + <image src="../../static/shixing.png" mode="" v-if="item.star>=8"></image>
  57 + <image src="../../static/kongxing.png" mode="" v-else></image>
51 </view> 58 </view>
52 <view class="starimg"> 59 <view class="starimg">
53 - <image src="../../static/kongxing.png" mode=""></image> 60 + <image src="../../static/shixing.png" mode="" v-if="item.star>=10"></image>
  61 + <image src="../../static/kongxing.png" mode="" v-else></image>
54 </view> 62 </view>
55 </view> 63 </view>
56 - <view class="haoping">好评率96%</view> 64 + <view class="haoping">好评率{{item.probability}}</view>
57 </view> 65 </view>
58 </view> 66 </view>
59 <view class="shopdizhi flexone"> 67 <view class="shopdizhi flexone">
60 <view class="shopdiimg"> 68 <view class="shopdiimg">
61 <image src="../../static/shopaddress.png" mode=""></image> 69 <image src="../../static/shopaddress.png" mode=""></image>
62 </view> 70 </view>
63 - <view class='shopli'>距离256km</view> 71 + <view class='shopli'>距离{{item.distance}}km</view>
64 </view> 72 </view>
65 </view> 73 </view>
66 </view> 74 </view>
67 - <view class="searchgooditem flex boxsizing"> 75 + <!-- <view class="searchgooditem flex boxsizing">
68 <view class="shopleftimg"> 76 <view class="shopleftimg">
69 <image src="../../static/shop.png" mode=""></image> 77 <image src="../../static/shop.png" mode=""></image>
70 </view> 78 </view>
@@ -103,10 +111,9 @@ @@ -103,10 +111,9 @@
103 </view> 111 </view>
104 </view> 112 </view>
105 </view> 113 </view>
106 - 114 + -->
107 </view> 115 </view>
108 116
109 -  
110 <!-- 底部导航 --> 117 <!-- 底部导航 -->
111 <view class="teacherfooter"> 118 <view class="teacherfooter">
112 <view class="teacherfootitem" @click="selnav" :data-id="1"> 119 <view class="teacherfootitem" @click="selnav" :data-id="1">
@@ -144,41 +151,86 @@ @@ -144,41 +151,86 @@
144 data() { 151 data() {
145 return { 152 return {
146 showbanben: false, 153 showbanben: false,
147 - footersel: 2 154 + footersel: 2,
  155 + keyword: '',
  156 + order: '',
  157 + shoplist: []
148 } 158 }
149 }, 159 },
150 onLoad() { 160 onLoad() {
151 -  
152 -  
153 - 161 + this.getshoplist()
154 }, 162 },
155 methods: { 163 methods: {
156 -// 底部导航跳转  
157 - selnav(e){  
158 - console.log(e)  
159 - 164 +
  165 + // 顶部切换
  166 + rangge(e) {
  167 + this.order = e.currentTarget.dataset.id;
  168 + this.shoplist = [];
  169 + this.page = 1;
  170 + this.getshoplist()
  171 + },
  172 + // 店铺详情
  173 + shopdetail(e){
160 let id=e.currentTarget.dataset.id; 174 let id=e.currentTarget.dataset.id;
  175 + uni.navigateTo({
  176 + url:'/pages/nearshop/shopdetail?shopid='+id
  177 + })
  178 + },
  179 + // 底部导航跳转
  180 + selnav(e) {
  181 + console.log(e)
  182 +
  183 + let id = e.currentTarget.dataset.id;
161 console.log(id) 184 console.log(id)
162 - if(id==1){ 185 + if (id == 1) {
163 uni.navigateTo({ 186 uni.navigateTo({
164 - url:'../homepage/homepage' 187 + url: '../homepage/homepage'
165 }) 188 })
166 - }else if(id==2){ 189 + } else if (id == 2) {
167 uni.navigateTo({ 190 uni.navigateTo({
168 - url:"../nearshop/nearshop" 191 + url: "../nearshop/nearshop"
169 }) 192 })
170 - }else if(id==3){ 193 + } else if (id == 3) {
171 uni.navigateTo({ 194 uni.navigateTo({
172 - url:"../luntan/luntan" 195 + url: "../luntan/luntan"
173 }) 196 })
174 - }else if(id==4){ 197 + } else if (id == 4) {
175 uni.navigateTo({ 198 uni.navigateTo({
176 - url:"../usercenter/my" 199 + url: "../usercenter/my"
177 }) 200 })
178 } 201 }
179 }, 202 },
180 -  
181 - 203 + enterword(e) {
  204 + this.keyword = e.detail.value;
  205 + },
  206 +
  207 + search() {
  208 + this.page = 1;
  209 + this.shoplist = [];
  210 + this.getshoplist()
  211 + },
  212 + //获取店铺列表
  213 + getshoplist() {
  214 + let that = this;
  215 + var url = 'store/get_store_list';
  216 + var params = {
  217 + keyword: that.keyword,
  218 + order: that.order,
  219 + page: that.page,
  220 + pageNum: 10
  221 + }
  222 + console.log('参数', params)
  223 + app.post(url, params, "post").then((res) => {
  224 + console.log(res);
  225 + that.shoplist = that.shoplist.concat(res.data.data)
  226 +
  227 + }).catch((err) => {
  228 + console.log(err)
  229 +
  230 + })
  231 + }
  232 +
  233 +
182 234
183 } 235 }
184 236
@@ -187,4 +239,7 @@ @@ -187,4 +239,7 @@
187 239
188 <style> 240 <style>
189 @import url('../../base/homepage'); 241 @import url('../../base/homepage');
  242 + .nodata{
  243 + margin:150rpx auto 0;
  244 + }
190 </style> 245 </style>
@@ -24,7 +24,6 @@ @@ -24,7 +24,6 @@
24 有效期至:{{item.pasttime}} 24 有效期至:{{item.pasttime}}
25 </view> 25 </view>
26 </view> 26 </view>
27 -  
28 </view> 27 </view>
29 <!-- <view class="bitem borderactive flexone"> 28 <!-- <view class="bitem borderactive flexone">
30 <view class="couponleft"> 29 <view class="couponleft">
@@ -48,7 +47,6 @@ @@ -48,7 +47,6 @@
48 47
49 </view> 48 </view>
50 --> 49 -->
51 -  
52 </view> 50 </view>
53 </view> 51 </view>
54 </view> 52 </view>
@@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
30 <view class="neardoor">12℃</view> 30 <view class="neardoor">12℃</view>
31 </view> 31 </view>
32 </view> 32 </view>
33 - 33 +
34 <view class="detailgood boxsizing flexone"> 34 <view class="detailgood boxsizing flexone">
35 <view class="detailgooditem"> 35 <view class="detailgooditem">
36 <image src="../../static/shopdetailtop.png" mode=""></image> 36 <image src="../../static/shopdetailtop.png" mode=""></image>
@@ -78,38 +78,38 @@ @@ -78,38 +78,38 @@
78 </view> 78 </view>
79 </view> 79 </view>
80 <view class="addressbox boxsizing"> 80 <view class="addressbox boxsizing">
81 - <view class="addressname">湖北省南阳市南阳面粉厂</view> 81 + <view class="addressname">{{shopdetail.name}}</view>
82 <view class="addressin"> 82 <view class="addressin">
83 <view class="addressimitem flextwo boxsizing"> 83 <view class="addressimitem flextwo boxsizing">
84 <view class="addressinleft flexone"> 84 <view class="addressinleft flexone">
85 <view class="addressimg"> 85 <view class="addressimg">
86 <image src="../../static/userpeople.png" mode=""></image> 86 <image src="../../static/userpeople.png" mode=""></image>
87 </view> 87 </view>
88 - <view class="peoplename">李某某</view>  
89 - </view>  
90 - <view class="collect flexone"> 88 + <view class="peoplename">{{shopdetail.contact}}</view>
  89 + </view>
  90 + <view class="collect flexone" v-if="shopdetail.is_collect==2" @click="collet">
91 <view class="collectimg"> 91 <view class="collectimg">
92 <image src="../../static/collect.png" mode=""></image> 92 <image src="../../static/collect.png" mode=""></image>
93 </view> 93 </view>
94 <view class="collectname">收藏</view> 94 <view class="collectname">收藏</view>
95 </view> 95 </view>
96 - <view class="collect flexone yicollect"> 96 + <view class="collect flexone yicollect" v-else @click="collet">
97 <view class="collectimg"> 97 <view class="collectimg">
98 <image src="../../static/yicollect.png" mode=""></image> 98 <image src="../../static/yicollect.png" mode=""></image>
99 </view> 99 </view>
100 - <view class="collectname yiname">收藏</view> 100 + <view class="collectname yiname">取消收藏</view>
101 </view> 101 </view>
102 </view> 102 </view>
103 </view> 103 </view>
104 - 104 +
105 <view class="addressin"> 105 <view class="addressin">
106 <view class="addressimitem boxsizing flexone"> 106 <view class="addressimitem boxsizing flexone">
107 <view class="addressinleft flexone"> 107 <view class="addressinleft flexone">
108 <view class="addressimg"> 108 <view class="addressimg">
109 <image src="../../static/phonepeople.png" mode=""></image> 109 <image src="../../static/phonepeople.png" mode=""></image>
110 </view> 110 </view>
111 - <view class="peoplename">15822185632</view>  
112 - </view> 111 + <view class="peoplename mobilename">{{shopdetail.mobile}}</view>
  112 + </view>
113 <view class="phoneplay">拨号</view> 113 <view class="phoneplay">拨号</view>
114 </view> 114 </view>
115 </view> 115 </view>
@@ -119,20 +119,20 @@ @@ -119,20 +119,20 @@
119 <view class="addressimg"> 119 <view class="addressimg">
120 <image src="../../static/addresspeope.png" mode=""></image> 120 <image src="../../static/addresspeope.png" mode=""></image>
121 </view> 121 </view>
122 - <view class="peoplename">湖北省南阳市北洋区西湖一路产业园区5号402</view>  
123 - </view>  
124 - 122 + <view class="peoplename">{{shopdetail.province_name}}{{shopdetail.city_name}}{{shopdetail.county_name}}{{shopdetail.address}}</view>
  123 + </view>
  124 +
125 </view> 125 </view>
126 </view> 126 </view>
127 -  
128 - 127 +
  128 +
129 </view> 129 </view>
130 - 130 +
131 <view class="tapnav flextwo"> 131 <view class="tapnav flextwo">
132 - <view class="tapnavitem tapnavactive">综合</view>  
133 - <view class="tapnavitem">最新</view>  
134 - <view class="tapnavitem">销量</view>  
135 - <view class="tapnavitem flexone"> 132 + <view class="tapnavitem" :class="order==0?'tapnavactive':''" @click="kindlist" :data-id="0">分类</view>
  133 + <view class="tapnavitem" :class="order==1?'tapnavactive':''" @click="orderrange" :data-id="1">综合</view>
  134 + <view class="tapnavitem" :class="order==2?'tapnavactive':''" @click="orderrange" :data-id="2">销量</view>
  135 + <view class="tapnavitem flexone" :class="order==3||order==4?'tapnavactive':''" @click="selprice">
136 <view class="tapprice">价格</view> 136 <view class="tapprice">价格</view>
137 <view class="tapbox flexfour"> 137 <view class="tapbox flexfour">
138 <view class="tapboxtop"> 138 <view class="tapboxtop">
@@ -143,78 +143,178 @@ @@ -143,78 +143,178 @@
143 </view> 143 </view>
144 </view> 144 </view>
145 </view> 145 </view>
  146 +
  147 +
146 </view> 148 </view>
147 - 149 +
148 <view class="homeshoplist flexone goodboxlist"> 150 <view class="homeshoplist flexone goodboxlist">
149 - <view class="homeshopitem goodboxitem">  
150 - <view class="gooditemimg goodboximg">  
151 - <image src="../../static/goopic.png" mode=""></image>  
152 - <view class="sale boxsale">已售76件</view>  
153 - </view>  
154 - <view class="goodname hidden boxgoodname">三放热敏标签纸  
155 - 40*30 50 </view>  
156 - <view class="saleprice">¥288</view>  
157 - <view class="flextwo">  
158 - <view class="huiyuanprice dikou">抵扣:¥200</view>  
159 - <view class="goodshou">已售76</view>  
160 - </view>  
161 -  
162 - </view>  
163 -  
164 - <view class="homeshopitem goodboxitem"> 151 + <view class="homeshopitem goodboxitem" v-for="(item,index) in goodlist" :key="index" @click="goodtail" :data-id="item.id">
165 <view class="gooditemimg goodboximg"> 152 <view class="gooditemimg goodboximg">
166 - <image src="../../static/goopic.png" mode=""></image>  
167 - <view class="sale boxsale">已售76件</view> 153 + <image :src="item.image" mode=""></image>
  154 + <view class="sale boxsale">已售{{item.sales}}件</view>
168 </view> 155 </view>
169 - <view class="goodname hidden boxgoodname">三放热敏标签纸  
170 - 40*30 50 </view>  
171 - <view class="saleprice">¥288</view>  
172 - <view class="flextwo"> 156 + <view class="goodname hidden boxgoodname">{{item.name}}</view>
  157 + <view class="saleprice">¥{{item.price}}</view>
  158 + <!-- <view class="flextwo">
173 <view class="huiyuanprice dikou">抵扣:¥200</view> 159 <view class="huiyuanprice dikou">抵扣:¥200</view>
174 <view class="goodshou">已售76</view> 160 <view class="goodshou">已售76</view>
175 - </view>  
176 -  
177 - </view>  
178 - <view class="homeshopitem goodboxitem">  
179 - <view class="gooditemimg goodboximg">  
180 - <image src="../../static/goopic.png" mode=""></image>  
181 - <view class="sale boxsale">已售76件</view>  
182 - </view>  
183 - <view class="goodname hidden boxgoodname">三放热敏标签纸  
184 - 40*30 50 </view>  
185 - <view class="saleprice">¥288</view>  
186 - <view class="flextwo">  
187 - <view class="huiyuanprice dikou">抵扣:¥200</view>  
188 - <view class="goodshou">已售76</view>  
189 - </view>  
190 -  
191 - </view>  
192 - <view class="homeshopitem goodboxitem">  
193 - <view class="gooditemimg goodboximg">  
194 - <image src="../../static/goopic.png" mode=""></image>  
195 - <view class="sale boxsale">已售76件</view>  
196 - </view>  
197 - <view class="goodname hidden boxgoodname">三放热敏标签纸  
198 - 40*30 50 </view>  
199 - <view class="saleprice">¥288</view>  
200 - <view class="flextwo">  
201 - <view class="huiyuanprice dikou">抵扣:¥200</view>  
202 - <view class="goodshou">已售76</view>  
203 - </view>  
204 - 161 + </view> -->
  162 +
205 </view> 163 </view>
206 -  
207 </view> 164 </view>
208 -  
209 -  
210 -  
211 </view> 165 </view>
212 </template> 166 </template>
213 167
214 <script> 168 <script>
  169 + import app from "../../App.vue";
  170 + export default {
  171 + data() {
  172 + return {
  173 + showbanben: false,
  174 + store_id:'',
  175 + shopdetail:'',
  176 + order:'',
  177 + page:1,
  178 + score_category_id:'',
  179 + goodlist:[]
  180 + }
  181 + },
  182 + onLoad(options) {
  183 + console.log(options)
  184 + this.store_id=options.shopid,
  185 +
  186 + // 获取店铺详情
  187 + this.getshopdetail();
  188 + // 获取店铺列表
  189 + this.getgoodlist()
  190 +
  191 +
  192 +
  193 + },
  194 + methods: {
  195 +
  196 + // 分类
  197 + kindlist(e){
  198 + this.order=e.currentTarget.dataset.id;
  199 + uni.setStorageSync("selectId","")
  200 + uni.navigateTo({
  201 + url:'/pages/homepage/goodkind'
  202 + })
  203 + },
  204 + // 排序
  205 + orderrange(e) {
  206 + this.order = e.currentTarget.dataset.id;
  207 + this.shoplist = [],
  208 + this.page = 1;
  209 + this.getgoodlist();
  210 + },
  211 + selprice() {
  212 + this.price = !this.price;
  213 + if (this.price == true) {
  214 + this.order = 4;
  215 + } else {
  216 + this.order = 5;
  217 + }
  218 + this.shoplist = [],
  219 + this.page = 1;
  220 + this.getgoodlist();
  221 + },
  222 + // 获取店铺详情
  223 + getshopdetail() {
  224 + let that = this;
  225 + var url = 'store/get_store_detail';
  226 + var params = {
  227 + store_id: that.store_id,
  228 +
  229 + }
  230 + console.log('参数', params)
  231 + app.post(url, params, "post").then((res) => {
  232 + console.log(res);
  233 + that.shopdetail = res.data.data
  234 +
  235 + }).catch((err) => {
  236 + console.log(err)
  237 +
  238 + })
  239 + },
  240 + // 收藏和取消收藏
  241 + collet(){
  242 + let that = this;
  243 + var url = 'store/collect';
  244 + var params = {
  245 + store_id: that.store_id,
  246 +
  247 + }
  248 + console.log('参数', params)
  249 + app.post(url, params, "post").then((res) => {
  250 + if(that.shopdetail.is_collect==2){
  251 + uni.showToast({
  252 + title:'收藏成功',
  253 + icon:"none"
  254 + })
  255 +
  256 + that.shopdetail.is_collect=1
  257 + }else{
  258 + uni.showToast({
  259 + title:'取消收藏成功',
  260 + icon:"none"
  261 + })
  262 +
  263 + that.shopdetail.is_collect=2
  264 + }
  265 + that.shopdetail=that.shopdetail;
  266 +
  267 + console.log(res);
  268 + // that.shopdetail = res.data.data
  269 +
  270 + }).catch((err) => {
  271 + console.log(err)
  272 +
  273 + })
  274 + },
  275 + // 获取商品列表
  276 + getgoodlist(){
  277 + let that = this;
  278 + var url = 'store_goods/get_store_goods';
  279 + var params = {
  280 + store_id: that.store_id,
  281 + store_category_id:that.store_category_id,
  282 + order:that.order,
  283 + page:that.page,
  284 + pageNum:10
  285 + }
  286 + console.log('参数', params)
  287 + app.post(url, params, "post").then((res) => {
  288 + console.log(res);
  289 + that.goodlist=that.goodlist.concat(res.data.data);
  290 + console.log(that.goodlist)
  291 + }).catch((err) => {
  292 + console.log(err)
  293 +
  294 + })
  295 + },
  296 + // 进入商品详情页
  297 + goodtail(e) {
  298 + let id = e.currentTarget.dataset.id;
  299 + // type 1 面访商品 2积分商城商品
  300 + uni.navigateTo({
  301 + url: '/pages/nearshop/goodtail?id=' + id + '&type=' + 3
  302 + })
  303 + }
  304 + },
  305 + onShow(){
  306 + this.score_category_id=uni.getStorageSync("selectId")!=''?uni.getStorageSync("selectId"):''
  307 + this.shoplist=[];
  308 + this.page=1;
  309 + }
  310 +
  311 + }
215 </script> 312 </script>
216 313
217 <style> 314 <style>
218 @import url('../../base/nearshop'); 315 @import url('../../base/nearshop');
219 @import url('../../base/homepage'); 316 @import url('../../base/homepage');
  317 + .mobilename{
  318 + margin-right:10rpx;
  319 + }
220 </style> 320 </style>
@@ -20,38 +20,66 @@ @@ -20,38 +20,66 @@
20 </view> 20 </view>
21 <view class="sureshop sureshopk"> 21 <view class="sureshop sureshopk">
22 <!-- 店铺商品 --> 22 <!-- 店铺商品 -->
23 - <view class="bigbox"> 23 + <view class="bigbox" v-if="goodinfo.data3[0].goods!=undefined">
24 <view class="sureorderbox flexone"> 24 <view class="sureorderbox flexone">
25 <view class="sureimg"> 25 <view class="sureimg">
26 <image src="../../static/nearshop.png" mode=""></image> 26 <image src="../../static/nearshop.png" mode=""></image>
27 </view> 27 </view>
28 - <view class="sureshopname">红大地面品厂</view> 28 + <view class="sureshopname">{{goodinfo.data3[0].name}}</view>
29 </view> 29 </view>
30 <view class="boxbox"> 30 <view class="boxbox">
31 - <view class="sureorderitem flex"> 31 + <view class="sureorderitem flex" v-for="(item,index) in goodinfo.data3[0].goods" :key="index">
32 <view class="sureorderitemleft"> 32 <view class="sureorderitemleft">
33 - <image src="../../static/goodtailtop.png" mode=""></image> 33 + <image :src="item.store_goods_spec.spec_image" mode=""></image>
34 </view> 34 </view>
35 <view class='shuright'> 35 <view class='shuright'>
36 - <view class="suregoodname">商品名称商品名称商品名称商  
37 - 品名称商品名称商品名称商品名称商品名称 36 + <view class="suregoodnamek">{{item.name}}
38 </view> 37 </view>
39 - <view class="surebot flextwo">  
40 - <view class="saleprice">¥288</view>  
41 - <view class="weightnumk flexone">  
42 - <view class="weightnumkleft leftk">  
43 - <image src="../../static/addimg.png" mode=""></image>  
44 - </view>  
45 - <view class="detailnum">1</view>  
46 - <view class="weightnumkleft rightk">  
47 - <image src="../../static/reduceimg.png" mode=""></image>  
48 - </view>  
49 - </view> 38 + <view v-if="item.spec.length!=0">
  39 + <view class="spec" v-for="(item,index) in item.spec" :key="index">{{item.spec_name}}:{{item.spec_value}}</view>
  40 + </view>
  41 + <view class="surebot flexone">
  42 + <view class="saleprice">¥{{item.price}}</view>
  43 + <view class="detailnum">x{{item.number}}</view>
50 </view> 44 </view>
51 </view> 45 </view>
52 </view> 46 </view>
53 </view> 47 </view>
54 48
  49 + <view class="delivery flextwo">
  50 + <view class="deliveryleft">配送服务</view>
  51 + <view class="deliveryright flexone">
  52 + <picker @change="bindgoodChange" :value="goodindex" :range="goodservicearr" range-key="name">
  53 + <view class="deliveryname">{{goodpeiname}}</view>
  54 + </picker>
  55 +
  56 + <view class='yourow'>
  57 + <image src="../../static/yourowk.png" mode=""></image>
  58 + </view>
  59 + </view>
  60 + </view>
  61 + <view class="delivery markcontent">
  62 + <view class='markname'>店铺备注</view>
  63 + <view class="marktext">
  64 + <textarea value="" placeholder="选填,给商家留言" @input="entershopmessage" />
  65 + </view>
  66 + </view>
  67 + <view class="delivery markcontent markcontentk peibox">
  68 + <view class="deliveryitem flextwo">
  69 + <view class='deliveryitemname'>商品金额</view>
  70 + <view class='deliveryitemname moneyright'>¥{{goodinfo.data3[0].goods_total}}</view>
  71 + </view>
  72 +
  73 +
  74 + <view class="deliveryitem flextwo">
  75 + <view class='deliveryitemname'>运费</view>
  76 + <view class='deliveryitemname moneyright'>¥{{goodinfo.data3[0].postage_price}}</view>
  77 + </view>
  78 + </view>
  79 + <view class="delivery peidelivery markcontentk flextwo peiboxk">
  80 + <view class="deliveryleft">小计</view>
  81 + <view class="deliverymoney">¥{{goodinfo.data3[0].goods_total*100/100+goodinfo.data3[0].postage_price*100/100}}</view>
  82 + </view>
55 </view> 83 </view>
56 84
57 <div class="botbox" v-if="goodinfo.data1.flour_goods!=undefined"></div> 85 <div class="botbox" v-if="goodinfo.data1.flour_goods!=undefined"></div>
@@ -96,7 +124,7 @@ @@ -96,7 +124,7 @@
96 <view class="delivery markcontent"> 124 <view class="delivery markcontent">
97 <view class='markname'>店铺备注</view> 125 <view class='markname'>店铺备注</view>
98 <view class="marktext"> 126 <view class="marktext">
99 - <textarea value="" placeholder="选填,给商家留言" /> 127 + <textarea value="" placeholder="选填,给商家留言" @input="entermianfangrmark"/>
100 </view> 128 </view>
101 </view> 129 </view>
102 <!-- <view class="delivery flextwo markcontent"> 130 <!-- <view class="delivery flextwo markcontent">
@@ -117,6 +145,31 @@ @@ -117,6 +145,31 @@
117 </view> 145 </view>
118 <view class="deliveryname">{{couponname}}</view> 146 <view class="deliveryname">{{couponname}}</view>
119 </view> 147 </view>
  148 +
  149 + <view class="delivery markcontent markcontentk peibox">
  150 + <view class="deliveryitem flextwo">
  151 + <view class='deliveryitemname'>商品金额</view>
  152 + <view class='deliveryitemname moneyright'>¥{{goodinfo.data1.goods_total}}</view>
  153 + </view>
  154 + <!-- <view class="deliveryitem flextwo">
  155 + <view class='deliveryitemname'>积分抵扣</view>
  156 + <view class='deliveryitemname moneyright'>¥2600.00</view>
  157 + </view> -->
  158 + <view class="deliveryitem flextwo">
  159 + <view class='deliveryitemname'>优惠券</view>
  160 + <view class='deliveryitemname moneyright'>¥{{goodinfo.data1.discounts}}</view>
  161 + </view>
  162 + <view class="deliveryitem flextwo">
  163 + <view class='deliveryitemname'>运费</view>
  164 + <view class='deliveryitemname moneyright'>¥{{goodinfo.data1.postage_price}}</view>
  165 + </view>
  166 + </view>
  167 + <view class="delivery peidelivery markcontentk flextwo peiboxk">
  168 + <view class="deliveryleft">小计</view>
  169 + <view class="deliverymoney">¥{{goodinfo.data1.goods_total*100/100+goodinfo.data1.postage_price*100/100}}</view>
  170 + </view>
  171 +
  172 +
120 </view> 173 </view>
121 <div class="botbox" v-if="goodinfo.data2.score_goods!=undefined"></div> 174 <div class="botbox" v-if="goodinfo.data2.score_goods!=undefined"></div>
122 <!-- 积分商品 --> 175 <!-- 积分商品 -->
@@ -151,7 +204,9 @@ @@ -151,7 +204,9 @@
151 <view class="delivery flextwo"> 204 <view class="delivery flextwo">
152 <view class="deliveryleft">配送服务</view> 205 <view class="deliveryleft">配送服务</view>
153 <view class="deliveryright flexone"> 206 <view class="deliveryright flexone">
154 - <view class="deliveryname">快递配送</view> 207 + <picker @change="bindjiChange" :value="jiindex" :range="jifenservicearr" range-key="name">
  208 + <view class="deliveryname">{{jifenpeiname}}</view>
  209 + </picker>
155 <view class='yourow'> 210 <view class='yourow'>
156 <image src="../../static/yourowk.png" mode=""></image> 211 <image src="../../static/yourowk.png" mode=""></image>
157 </view> 212 </view>
@@ -160,7 +215,7 @@ @@ -160,7 +215,7 @@
160 <view class="delivery markcontent"> 215 <view class="delivery markcontent">
161 <view class='markname'>店铺备注</view> 216 <view class='markname'>店铺备注</view>
162 <view class="marktext"> 217 <view class="marktext">
163 - <textarea value="" placeholder="选填,给商家留言" /> 218 + <textarea value="" placeholder="选填,给商家留言" @input="enterjifenremark"/>
164 </view> 219 </view>
165 </view> 220 </view>
166 <view class="delivery flextwo markcontent"> 221 <view class="delivery flextwo markcontent">
@@ -174,44 +229,29 @@ @@ -174,44 +229,29 @@
174 <input type="text" value="" placeholder="请输入抵扣积分" placeholder-class="dikouinput" @input="enterjifen"/> 229 <input type="text" value="" placeholder="请输入抵扣积分" placeholder-class="dikouinput" @input="enterjifen"/>
175 </view> 230 </view>
176 </view> 231 </view>
177 - <!-- <view class="delivery flextwo markcontent">  
178 - <view class="deliveryleft flexone">  
179 - <view class='jifen'>优惠劵</view>  
180 - <view class="jifenimg">  
181 - <image src="../../static/gantan.png" mode=""></image>  
182 - </view>  
183 - </view>  
184 - <view class="deliveryname">满200减99优惠券</view>  
185 - </view> -->  
186 - </view>  
187 - </view>  
188 -  
189 <view class="delivery markcontent markcontentk peibox"> 232 <view class="delivery markcontent markcontentk peibox">
190 <view class="deliveryitem flextwo"> 233 <view class="deliveryitem flextwo">
191 <view class='deliveryitemname'>商品金额</view> 234 <view class='deliveryitemname'>商品金额</view>
192 - <view class='deliveryitemname moneyright'>¥2600.00</view> 235 + <view class='deliveryitemname moneyright'>¥{{goodinfo.data2.goods_total}}</view>
193 </view> 236 </view>
194 <view class="deliveryitem flextwo"> 237 <view class="deliveryitem flextwo">
195 <view class='deliveryitemname'>积分抵扣</view> 238 <view class='deliveryitemname'>积分抵扣</view>
196 - <view class='deliveryitemname moneyright'>¥2600.00</view>  
197 - </view>  
198 - <view class="deliveryitem flextwo">  
199 - <view class='deliveryitemname'>优惠券</view>  
200 - <view class='deliveryitemname moneyright'>¥2600.00</view> 239 + <view class='deliveryitemname moneyright'>¥{{goodinfo.data2.user_score}}</view>
201 </view> 240 </view>
  241 +
202 <view class="deliveryitem flextwo"> 242 <view class="deliveryitem flextwo">
203 <view class='deliveryitemname'>运费</view> 243 <view class='deliveryitemname'>运费</view>
204 - <view class='deliveryitemname moneyright'>¥2600.00</view> 244 + <view class='deliveryitemname moneyright'>¥{{goodinfo.data2.postage_price}}</view>
205 </view> 245 </view>
206 </view> 246 </view>
207 <view class="delivery peidelivery markcontentk flextwo peiboxk"> 247 <view class="delivery peidelivery markcontentk flextwo peiboxk">
208 - <view class="deliveryleft">配送服务</view>  
209 - <view class="deliverymoney">¥2560.00</view> 248 + <view class="deliveryleft">小计</view>
  249 + <view class="deliverymoney">¥{{goodinfo.data2.postage_price*100/100+goodinfo.data2.postage_price*100/100}}</view>
  250 + </view>
  251 +
210 </view> 252 </view>
  253 + </view>
211 254
212 -  
213 -  
214 -  
215 <view class="huiyuanbot boxsizing"> 255 <view class="huiyuanbot boxsizing">
216 <view class="behuiyuanbtn">确认支付</view> 256 <view class="behuiyuanbtn">确认支付</view>
217 </view> 257 </view>
@@ -267,7 +307,11 @@ @@ -267,7 +307,11 @@
267 </view> 307 </view>
268 </view> 308 </view>
269 </view> 309 </view>
270 - <view class="buybtn">确认支付(¥2560.00)</view> 310 + <view class="flextwo">
  311 + <view class="totalmoney">{{goodinfo.total}}</view>
  312 + <view class="buybtn btnk">确认支付(¥2560.00)</view>
  313 + </view>
  314 +
271 </view> 315 </view>
272 </view> 316 </view>
273 <!-- 优惠券使用规则 --> 317 <!-- 优惠券使用规则 -->
@@ -296,7 +340,7 @@ @@ -296,7 +340,7 @@
296 goodinfo:'', 340 goodinfo:'',
297 addressitem:'', 341 addressitem:'',
298 addresssel:'请选择地址', 342 addresssel:'请选择地址',
299 - mianindex:0, 343 + mianindex:-1,
300 servicearr:[{ 344 servicearr:[{
301 id:1, 345 id:1,
302 name:'快递配送' 346 name:'快递配送'
@@ -309,6 +353,38 @@ @@ -309,6 +353,38 @@
309 mianpeiname:'请选择配送方式', 353 mianpeiname:'请选择配送方式',
310 jifen:'', 354 jifen:'',
311 couponname:'请选择优惠券', 355 couponname:'请选择优惠券',
  356 + // 面坊的配送方式
  357 + postage_type1:'',
  358 + // 积分商品配送方式
  359 + jifenservicearr:[{
  360 + id:1,
  361 + name:'快递配送'
  362 + },
  363 + {
  364 + id:2,
  365 + name:'上门自提'
  366 + },
  367 + ],
  368 + jiindex:-1,
  369 + postage_type2:'',
  370 + jifenpeiname:'请选择配送方式',
  371 +
  372 + //店铺商品
  373 +
  374 + goodindex:-1,
  375 + goodservicearr:[{
  376 + id:1,
  377 + name:'快递配送'
  378 + },
  379 + {
  380 + id:2,
  381 + name:'上门自提'
  382 + }],
  383 + goodpeiname:'请选择配送方式',
  384 +
  385 +
  386 +
  387 +
312 388
313 // data1 面坊 data2 积分 data3 店铺 389 // data1 面坊 data2 积分 data3 店铺
314 } 390 }
@@ -317,6 +393,7 @@ @@ -317,6 +393,7 @@
317 console.log(38349403) 393 console.log(38349403)
318 this.goodinfo=uni.getStorageSync("goodinfo"); 394 this.goodinfo=uni.getStorageSync("goodinfo");
319 395
  396 + this.seldata=JSON.parse(options.seldata)
320 console.log(this.goodinfo) 397 console.log(this.goodinfo)
321 }, 398 },
322 399
@@ -324,12 +401,51 @@ @@ -324,12 +401,51 @@
324 // 面访商品配送方式 401 // 面访商品配送方式
325 bindmianChange(e){ 402 bindmianChange(e){
326 this.mianpeiname=this.servicearr[e.target.value].name; 403 this.mianpeiname=this.servicearr[e.target.value].name;
327 - this.mianindex=e.target.value 404 + this.mianindex=e.target.value;
  405 + this.postage_type1=this.servicearr[e.target.value].id
  406 + },
  407 + // 积分商品的配送方式
  408 + bindjiChange(e){
  409 + this.jifenpeiname=this.servicearr[e.target.value].name;
  410 +
  411 + this.jiindex=e.target.value;
  412 + this.postage_type2=this.servicearr[e.target.value].id
  413 + },
  414 + // 店铺商品的配送方式
  415 + bindgoodChange(e){
  416 + let that=this;
  417 + console.log(this.goodservicearr)
  418 + this.goodpeiname=this.goodservicearr[e.target.value].name;
  419 + this.goodindex=e.target.value;
  420 + this.seldata.forEach(function(value,index,array){
  421 + if(value.type==3){
  422 + value.postage_type=that.goodservicearr[e.target.value].id;
  423 + }
  424 + })
  425 +
328 }, 426 },
329 // 输入积分 427 // 输入积分
330 enterjifen(e){ 428 enterjifen(e){
331 this.jifen=e.detail.vlaue 429 this.jifen=e.detail.vlaue
332 }, 430 },
  431 +
  432 + // 面坊商品备注
  433 + entermianfangrmark(){
  434 + this.remark1=e.detail.value
  435 + },
  436 + // 店铺商品备注
  437 + entershopmessage(e){
  438 + this.seldata.forEach(function(value,index,array){
  439 + if(value.type==3){
  440 + value.remark=e.detail.value
  441 + }
  442 + })
  443 + this.seldata=this.this.seldata;
  444 + },
  445 + // 积分商品备注
  446 + enterjifenremark(){
  447 + this.remark2=e.detail.value
  448 + },
333 // 选择优惠券 449 // 选择优惠券
334 selectcoupon(){ 450 selectcoupon(){
335 uni.navigateTo({ 451 uni.navigateTo({
@@ -397,4 +513,12 @@ @@ -397,4 +513,12 @@
397 page{ 513 page{
398 background: #F8F6F9; 514 background: #F8F6F9;
399 } 515 }
  516 + .totalmoney{
  517 + color:#C29445;
  518 + font-size: 30rpx;
  519 + }
  520 + .btnk{
  521 + width:200prx;
  522 +
  523 + }
400 </style> 524 </style>