作者 朱振飞

开放商城

<scroll-view scroll-y="true" style="height:100%" bindscroll="scroll" scroll-top="{{scrollTop}}" bindscrolltolower="loadMore">
<view class='page'>
<view class='top'>
<navigator class='search_box' url="/pages/search/search">
<navigator class='search_box' url="/packageA/pages/search/search">
<image src='/images/search.png' class='search_icon'></image>
<input class='real_search' placeholder='搜索您想要的商品'></input>
</navigator>
... ... @@ -57,7 +57,7 @@
<view class="active flexone">
<view wx:for="{{activity}}" class="actbox" wx:key="" bindtap="seeactive" data-id="{{item.id}}">
<view class="activeitem">
<image src="{{item.image}}"></image>
<image src="{{item.image}}" mode="widthFix"></image>
</view>
<view class="activename">{{item.name}}</view>
</view>
... ... @@ -130,7 +130,7 @@
</view>
<view class='select_item {{c_index == 2?"active":""}}' data-index="2" bindtap='reorder'>销量
<view class='select_img'>
<image src="{{c_index == 2?'/images/select_active.png':'/images/select.png'}}" class='select_img_no_choose' />
<image src="{{c_index == 2?'/images/select_active.png':'/images/select.png'}}" class='select_img_no_choose' />
</view>
</view>
</view>
... ...
... ... @@ -359,15 +359,15 @@ image {
}
.activeitem {
width: 215rpx;
height: 220rpx;
width: 220rpx;
/* height: 220rpx; */
font-size: 0;
display: flex;
justify-content: center;
align-items: center;
border-radius: 16rpx;
margin-right: 24rpx;
margin: 0 auto;
margin: 16rpx auto;
}
.activeitem image {
... ... @@ -375,13 +375,16 @@ image {
}
.actbox {
width: 218rpx;
/* width: 218rpx; */
flex: 1;
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
margin-right: 16rpx;
}
.actbox:last-child{
margin-right: 0;
}
image {
... ...
... ... @@ -7,6 +7,7 @@ Page({
data: {
info:[],
item:'',
detail:{},
sel:0
},
// 获取页面信息
... ... @@ -19,7 +20,8 @@ Page({
app.post(url,params).then((res)=>{
console.log(res)
this.setData({
info: res.msg.kuaidi
info: res.msg.kuaidi,
detail:res.msg
})
this.setData({
item: res.msg.kuaidi[0]
... ...
<!-- 商品 -->
<view class="block">
<view>
<!-- <view class="show_good">
<view>
<!-- <view class="show_good">
<image src="{{item.kuaidi.product_image}}" mode="aspectFill"/>
<view class="dai" wx:if="{{item.kuaidi.State==0}}">待取件</view>
<view class="dai" wx:if="{{item.kuaidi.State==1}}">已揽收</view>
... ... @@ -10,31 +10,38 @@
<view class="dai" wx:if="{{item.kuaidi.State==4}}">问题件</view>
</view> -->
<!-- 物流 -->
<view class="logistics">
<view class="info" >
<view class="right" wx:for="{{info}}" wx:key='' bindtap="selectinfo" data-index="{{index}}">
<view class="name {{sel==index?'selactive':''}}">{{item.kuaidi.name}}</view>
<view class="order_num {{sel==index?'selactive':''}}">快递单号:{{item.kuaidi.LogisticCode}}</view>
<!-- 物流 -->
<view class="logistics">
<view class="address_info" wx:if="{{info.length>1}}">【收获地址】{{detail.address_area}}{{detail.address_address}} {{detail.address_mobile}}
</view>
</view>
<view class="order_box">
<view class="order_item" wx:for="{{item.kuaidi.Traces}}" wx:key="index">
<view class="time_box">
<view class="date">{{item.AcceptTime}}</view>
</view>
<view class="status_img">
<image src="/images/icon_62.png" />
<view class="line" />
<view class="info" wx:for="{{info}}" wx:key='' bindtap="selectinfo" data-index="{{index}}">
<view class="right">
<view class="name">
<text>{{item.kuaidi.name}} {{item.kuaidi.LogisticCode}}</text>
<text class="copyAction" bindtap="copy" data-num="{{item.kuaidi.LogisticCode}}">复制</text>
</view>
<view class="pack">当前快递含有{{item.kuaidi.State}}个商品</view>
</view>
<view class="status_info">
<view class="status_word">{{item.Remark?item.Remark:''}}</view>
<view class="status_word">{{item.AcceptStation}}</view>
<view class="order_box">
<!-- <view class="order_item" wx:for="{{item.kuaidi.Traces}}" wx:key="index"> -->
<view class="order_item" >
<view class="time_box">
<view class="date">item.AcceptTime11111</view>
</view>
<view class="status_img">
<image src="/images/icon_62.png" />
<view class="line" />
</view>
<view class="status_info">
<!-- <view class="status_word">{{item.Remark?item.Remark:''}}111111</view>
<view class="status_word">{{item.AcceptStation}}11111111111</view> -->
<view class="status_word">111111</view>
<view class="status_word">11111111111</view>
</view>
</view>
</view>
<view class="look_more" wx:if="{{item.kuaidi.Traces.length>2}}" bindtap="lookMoreInfo" data-index='{{index}}'>点击查看更多物流详情</view>
</view>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -29,18 +29,17 @@ page {
.logistics {
width: 686rpx;
background: rgba(255, 255, 255, 1);
border-radius: 10px;
margin: 20rpx auto 0;
}
.info {
width: 100%;
background: #FFF;
padding: 30rpx 32rpx;
margin-bottom:20rpx;
box-sizing: border-box;
display: flex;
align-items: center;
border-bottom: 1px solid #ccc;
overflow-x: scroll
}
... ... @@ -51,14 +50,18 @@ page {
margin-right: 20rpx;
}
.right{
width:400rpx;
width:100%;
margin-right: 30rpx;
padding: 10px 0;
}
.name{
font-size: 30rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(19, 26, 46, 1);
display: flex;
justify-content: space-between;
}
/* .info .right {
... ... @@ -173,4 +176,22 @@ page {
}
.dai{
margin-left:20rpx;
}
.copyAction{
color: #a59696;
}
.address_info{
color: #666;
margin-bottom: 20px;
margin-top: 20px;
}
.look_more{
color: #a59696;
font-size: 24rpx;
text-align: center;
}
.pack{
color: #bdb7b7;
font-size: 24rpx;
margin-top: 8rpx;
}
\ No newline at end of file
... ...
... ... @@ -8,6 +8,7 @@ Page({
success: false,
fail: false,
name: '',
choudanNum:0,
addressId: 0,
tel: '',
area: '',
... ... @@ -35,35 +36,71 @@ Page({
let index = e.currentTarget.dataset.index
let id = e.currentTarget.dataset.id
let check = e.currentTarget.dataset.check
let coudan = this.data.coudan
let coudan_arr = this.data.coudan_arr
let coudan = this.data.coudan||[]
let coudan_arr = this.data.coudan_arr||[]
let price = e.currentTarget.dataset.price;
let price2 = e.currentTarget.dataset.price2;
if (type == 1) {
if(this.data.info.choudan*100<(price*100)){
wx.showToast({
title: '当前剩余积分不足,请重新挑选',
icon:'none'
})
return
}
num++
} else {
num--
if (num < 0) {
num = 0;
return
}
}
that.setData({
[`info.coudanProduct[${index}].num`]: num
})
if (check) {
if (num<1) {
coudan.forEach((item, index) => {
if (item.id == id) {
item.num = num
coudan_arr[index].num = num
coudan.splice(index, 1)
coudan_arr.splice(index, 1)
}
})
this.get_choudan()
} else {
if(type==1&&num==1){
//选中
coudan.push({
id: id,
num: num
})
coudan_arr.push({
id: id,
num: num,
price: Number(price),
price2:Number(price2)
})
}else{
coudan.forEach((item, index) => {
if (item.id == id) {
item.num = num
coudan_arr[index].num = num
}
})
}
}
that.setData({
coudan: coudan,
coudan_arr: coudan_arr,
[`info.coudanProduct[${index}].num`]: num
// [`info.coudanProduct[${index}].check`]: check
})
this.get_choudan()
},
// 计算凑单费用
get_choudan() {
let coudan_arr = this.data.coudan_arr
let choudan_money = 0;
let num = 0
for (let obj of coudan_arr) {
console.log(obj)
console.log(obj.price2)
... ... @@ -74,14 +111,13 @@ Page({
console.log(222)
choudan_money = (obj.price * 100 * obj.num) / 100 + choudan_money
}
num = num+obj.num
}
console.log(typeof (choudan_money))
console.log(choudan_money)
this.setData({
choudan_money: choudan_money*100
choudan_money: choudan_money*100,
choudanNum:num,
'info.choudan': this.data.info.syjf - choudan_money
// choudan_money: Math.floor(choudan_money* 100) / 100
})
},
... ... @@ -167,9 +203,11 @@ Page({
}
app.post(url, params).then((res) => {
console.log('99999', res, Number(res.msg.total))
res.msg.syjf = res.msg.choudan - res.msg.yunfei
res.msg.choudan = res.msg.choudan - res.msg.yunfei
res.msg.total = Number(res.msg.total * 100)
res.msg.yunfei = Number(res.msg.yunfei * 100)
let total = (res.msg.total + res.msg.yunfei).toFixed("1");
console.log(total)
... ...
... ... @@ -3,6 +3,7 @@
<view class="address_box" wx:if="{{info.address}}" bindtap="add_address">
<view class="name">{{info.address.name}}
<text>{{info.address.tel}}</text>
<text>{{info.address.b_tel||""}}</text>
</view>
<view class="address">
<image class="tips_img" src="/images/icon_54.png" />
... ... @@ -26,7 +27,7 @@
<view class='recommend' wx:if="{{info.coudanProduct.length>0}}">
<view class='re_one'>*您支付后还剩{{info.choudan}}积分为您推荐了以下凑单产品!</view>
<scroll-view class='re_goods' scroll-x scroll-left="0">
<view class='re_item' wx:for='{{info.coudanProduct}}' wx:key='index' bindtap='chooseGoods' data-index="{{index}}" data-id="{{item.id}}" data-num="{{item.num?item.num:1}}" data-check='{{item.check}}' data-price='{{item.price}}' data-price2="{{item.price2}}">
<view class='re_item' wx:for='{{info.coudanProduct}}' wx:key='index' data-index="{{index}}" data-id="{{item.id}}" data-num="{{item.num?item.num:1}}" data-check='{{item.check}}' data-price='{{item.price}}' data-price2="{{item.price2}}">
<view class='re_re_item {{item.check?"active":""}}'>
<view class='triangle' wx:if='{{item.check}}'>
<image src='/images/bingo.png' class='bingo'></image>
... ... @@ -42,9 +43,9 @@
<!-- 数量操作 -->
<view class="num_box">
<image class="num_btn" src="/images/reduce.png" data-check='{{item.check}}' wx:if="{{item.num}}" data-index="{{index}}" data-id="{{item.id}}" data-type="0" data-num="{{item.num?item.num:0}}" catchtap="num_change" />
<image class="num_btn" src="/images/reduce.png" data-check='{{item.check}}' wx:if="{{item.num}}" data-index="{{index}}" data-id="{{item.id}}" data-type="0" data-num="{{item.num?item.num:0}}" catchtap="num_change" data-price='{{item.price}}' data-price2="{{item.price2}}" />
<text wx:if="{{item.num}}" >{{item.num?item.num:0}}</text>
<image class="num_btn" src="/images/add.png" data-check='{{item.check}}' data-index="{{index}}" data-id="{{item.id}}" data-type="1" data-num="{{item.num?item.num:0}}" catchtap="num_change" />
<image class="num_btn" src="/images/add.png" data-check='{{item.check}}' data-index="{{index}}" data-id="{{item.id}}" data-type="1" data-num="{{item.num?item.num:0}}" catchtap="num_change" data-price='{{item.price}}' data-price2="{{item.price2}}" />
</view>
</view>
</view>
... ... @@ -76,7 +77,7 @@
<!-- <text>{{choudan_money?choudan_money + info.total + info.yunfei*100/100: info.total + info.yunfei*100/100}}积分</text> -->
<text>{{choudan_money?(choudan_money + info.total + info.yunfei)/100: (info.total + info.yunfei)/100}}积分</text>
</view>
<view class="num">共{{info.totalnum}}件</view>
<view class="num">共{{info.totalnum + choudanNum}}件</view>
</view>
<concat/>
... ...
... ... @@ -115,9 +115,9 @@ page {
}
.re_one {
font-size: 26rpx;
font-size: 30rpx;
font-family: PingFang SC;
font-weight: 400;
font-weight: 600;
line-height: 36rpx;
color: rgba(242, 0, 0, 1);
padding: 0 10rpx;
... ...
... ... @@ -43,7 +43,7 @@ Page({
//查看物流
look_logistics(e) {
wx.navigateTo({
url: '/pages/logistics/logistics?order=' + e.currentTarget.dataset.d
url: '/packageA/pages/logistics/logistics?order=' + e.currentTarget.dataset.d
})
},
//查看订单详情
... ...
... ... @@ -85,7 +85,7 @@ Page({
let type=e.currentTarget.dataset.type;
if(type==1){
wx.navigateTo({
url: '/pages/shop_detail/shop_detail?id=' + id
url: '/packageA/pages/shop_detail/shop_detail?id=' + id
})
}else{
wx.navigateTo({
... ... @@ -98,7 +98,7 @@ Page({
getmorelist(){
let that = this
let url = '/activity/get_detail';
let url = '/activity/get_product';
let data = {
activity_id:that.data.activeid,
page: that.data.page,
... ... @@ -106,7 +106,7 @@ Page({
order:that.data.order,
}
app.postk(url, data, "POST").then((r) => {
app.post(url, data, "POST").then((r) => {
console.log(r)
that.setData({
activelist: that.data.activelist.concat(r.msg)
... ...
... ... @@ -99,7 +99,7 @@ page {
}
.real_goods {
width: 750rpx;
margin: 0 auto;
margin: 50rpx auto 0;
background: #f9f9f9;
display: flex;
flex-wrap: wrap;
... ... @@ -134,6 +134,10 @@ page {
display: flex;
align-items: center;
justify-content: space-between;
position: fixed;
top: 0;
left: 0;
z-index: 15;
}
.select_item {
... ...