diff --git a/app.json b/app.json
index cae3269..e9fa437 100644
--- a/app.json
+++ b/app.json
@@ -205,7 +205,8 @@
"feiyiNew/CGCTime/index",
"foodListNew/index",
"foodNew/index",
- "goods/memberCard/index"
+ "goods/memberCard/index",
+ "techanNew/selfPickPoint/index"
]
},
{
diff --git a/app.wxss b/app.wxss
index 5d7cb40..0963daa 100644
--- a/app.wxss
+++ b/app.wxss
@@ -45,7 +45,7 @@ page{
position: relative;
z-index: 1;
width: 80%;
- max-height: 1000rpx;
+ max-height: 1200rpx;
background: white;
border-radius: 12rpx;
overflow-y: auto;
diff --git a/pages/component/proRec/proRec.js b/pages/component/proRec/proRec.js
index cb14dc9..d2b7f87 100644
--- a/pages/component/proRec/proRec.js
+++ b/pages/component/proRec/proRec.js
@@ -31,8 +31,8 @@ Component({
},
observers:{
'ids': function(newVal,oldVal){
- console.log('newVal--------',newVal)
- console.log('oldVal--------',oldVal)
+ // console.log('newVal--------',newVal)
+ // console.log('oldVal--------',oldVal)
if (newVal && this.data.tjList.length<=0) {
this.getTj(newVal)
}
diff --git a/pages/info/postProductInfo/index.js b/pages/info/postProductInfo/index.js
index 43e1c90..02155f1 100644
--- a/pages/info/postProductInfo/index.js
+++ b/pages/info/postProductInfo/index.js
@@ -45,6 +45,8 @@ Page({
sku: {min:0,max:0}
},
otherInfoShow: 0,
+
+ user_type: null,
},
/**
@@ -351,9 +353,18 @@ Page({
let index = e.currentTarget.dataset.index;
this.setData({
skuIndex: index,
- swiperCurrent: index+this.data.swiperRange.picture.max+1
+ swiperCurrent: index+this.data.swiperRange.picture.max+1,
+ user_type: null,
+ })
+ },
+
+ changeSelectSkuPost: function(e) {
+ let value = e.currentTarget.dataset.value;
+ this.setData({
+ user_type: value,
})
},
+
showOrder: function () {
commonApi.user_post('wx/get_user_keep', {
jumpurl: '/pages/info/postProductInfo/index?id=' + this.data.id,
@@ -437,10 +448,20 @@ Page({
}else {
type = ''
}
+ // 非酒景 要选配送方式
+ if (this.data.info.is_package!=1 && ![0,1].includes(this.data.user_type)) {
+ wx.showToast({
+ title: "请选择配送方式",
+ icon:"none"
+ })
+ return
+ }
+
commonApi.user_post("cart/add_sku", {
sku_id: this.data.info.sku[this.data.skuIndex].id,
num: this.data.producNum,
- type:type
+ type:type,
+ delivery_method: this.data.user_type
}).then(res => {
if (res.code == 1) {
commonApi.user_post('cart/get_list', {}).then(res => {
diff --git a/pages/info/postProductInfo/index.wxml b/pages/info/postProductInfo/index.wxml
index 0082018..0e6aec5 100644
--- a/pages/info/postProductInfo/index.wxml
+++ b/pages/info/postProductInfo/index.wxml
@@ -301,6 +301,27 @@
{{item.sku_name}}
+
+
+ 配送方式
+
+
+
+
+
+
+ 邮寄
+
+
+
+
+
+
+ 自提
+
+
+
+
diff --git a/pages/info/postProductInfo/index.wxss b/pages/info/postProductInfo/index.wxss
index 74cd9b1..83d34dd 100644
--- a/pages/info/postProductInfo/index.wxss
+++ b/pages/info/postProductInfo/index.wxss
@@ -550,8 +550,7 @@ page {
flex-wrap: wrap;
margin-bottom: 20rpx;
justify-content: space-between;
- max-height: 800rpx;
- min-height: 400rpx;
+ height: 400rpx;
align-content: flex-start;
}
@@ -1264,4 +1263,46 @@ color: #010101;
font-weight: 500;
font-size: 27rpx;
color: #000000;
-}
\ No newline at end of file
+}
+
+.delivery-method{
+ font-weight: 400;
+ font-size: 29rpx;
+ color: #1E1E1E;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 0 25rpx 40rpx;
+}
+.delivery-method .select-cycle{
+ width: 32rpx;
+ height: 32rpx;
+ border-radius: 50%;
+ border: 1px solid #999999;
+ overflow: hidden;
+ flex-shrink: 0;
+
+}
+.delivery-method .select-cycle image{
+ width: 100%;
+ height: 100%;
+}
+.delivery-method .select-cycle.selected {
+ border: none;
+}
+.delivery-method .select-cycle.selected image{
+ width: 32rpx;
+ height: 32rpx;
+ border-radius: 50%;
+}
+.delivery-method .method-str{
+ padding-left: 10rpx;
+ flex-shrink: 0;
+}
+.delivery-method .flex-center{
+ width: 150rpx;
+ justify-content: flex-end;
+ display: flex;
+ align-items: center;
+}
+
diff --git a/pages/order/components/address/index.wxml b/pages/order/components/address/index.wxml
index 950f01c..ad0299e 100644
--- a/pages/order/components/address/index.wxml
+++ b/pages/order/components/address/index.wxml
@@ -1,4 +1,4 @@
-
+
收货地址
选择
diff --git a/pages/order/components/address/index.wxss b/pages/order/components/address/index.wxss
index 2065a88..41a4d12 100644
--- a/pages/order/components/address/index.wxss
+++ b/pages/order/components/address/index.wxss
@@ -49,8 +49,8 @@
flex-shrink: 0;
font-size: 37rpx;
}
-.box {
- margin: 30rpx 25rpx;
+.address-box {
+ margin: 30rpx 0rpx;
background: white;
border-radius: 9rpx;
}
diff --git a/pages/order/orderList/index.js b/pages/order/orderList/index.js
index 3fe0fed..72a50a2 100644
--- a/pages/order/orderList/index.js
+++ b/pages/order/orderList/index.js
@@ -9,7 +9,11 @@ Page({
data: {
goodsList: [],
ticketList: [],
- productPrice: 0,
+ // 仅展示用,区分邮寄自提
+ postList: [],
+ pickUpList: [],
+
+ productPrice: 0,
ticketPrice: 0,
product:"",
sku_id: '',
@@ -33,18 +37,18 @@ Page({
*/
onLoad: function (options) {
this.setData({
- goodsList: app.globalData.postProduct,
- ticketList: app.globalData.list,
+ goodsList: app.globalData.postProduct || [],
+ ticketList: app.globalData.list || [],
kjId: app.globalData.kjId,
gp_id: app.globalData.gp_id || app.globalData.team_id,
flag:options.flag,
// showCoupon: (app.globalData.list || []).length<=0,
// linkmanList: app.globalData.linkmanList
})
- console.log('-------------',this.data.ticketList);
+ console.log('-------------',this.data.ticketList, this.data.goodsList);
// debugger
let price = 0, sku_id = [] ,postFee= 0;
- app.globalData.postProduct.map(item => {
+ this.data.goodsList.map(item => {
try {
item.postFee = parseFloat(item.postFee)
} catch(e){
@@ -60,7 +64,7 @@ Page({
}
sku_id.push(item.sku.id)
})
- app.globalData.list.map(item => {
+ this.data.ticketList.map(item => {
// price = price + item.sku.price * item.linkmanList.length;
price = price + item.sku.price * item.num;
sku_id.push(item.sku.id)
@@ -70,10 +74,23 @@ Page({
postFee:postFee,
sku_id: sku_id.join(",")
})
+
+ this.handlePostData()
+
if (!this.data.kjId && !this.data.gp_id) {
this.couponCom = this.selectAllComponents("#coupon")[0];
}
},
+
+ handlePostData () {
+ let postList = this.data.goodsList.filter(x=>x.user_select_type === 0)
+ let pickUpList = this.data.goodsList.filter(x=>x.user_select_type === 1)
+ this.setData({
+ postList: postList,
+ pickUpList: pickUpList,
+ })
+ },
+
order: function (){
console.log(app.globalData.createDate);
diff --git a/pages/order/orderList/index.wxml b/pages/order/orderList/index.wxml
index 2245a77..ca4d072 100644
--- a/pages/order/orderList/index.wxml
+++ b/pages/order/orderList/index.wxml
@@ -1,6 +1,7 @@
-
-
+
+
+
{{item.product.title}}
¥{{item.sku.price/100}}
@@ -26,6 +27,31 @@
+
+
+
+
+ {{item.product.title}}
+ ¥{{item.sku.price/100}}
+
+
+ {{item.sku.sku_name}}
+ X{{item.productNum}}
+
+ 自提信息
+
+ 预留手机号:{{item.phone}}
+
+ 自提地址:
+
+ {{item.pickupAddress.title}}
+ {{item.pickupAddress.address}}
+
+
+
+
+
+
@@ -37,7 +63,7 @@
X{{item.num}}
出行人信息
-
+
姓名:{{items.name}}
@@ -46,7 +72,7 @@
-
+
手机号:{{item.phone}}
diff --git a/pages/order/orderList/index.wxss b/pages/order/orderList/index.wxss
index fdf5877..c9d8534 100644
--- a/pages/order/orderList/index.wxss
+++ b/pages/order/orderList/index.wxss
@@ -66,6 +66,9 @@ page{
font-size: 27rpx;
color: #666666;
}
+.text .text-left{
+ flex-shrink: 0;
+}
.goods-item{
diff --git a/pages/order/postOrder/index.js b/pages/order/postOrder/index.js
index 425694b..2e795bb 100644
--- a/pages/order/postOrder/index.js
+++ b/pages/order/postOrder/index.js
@@ -7,6 +7,9 @@ Page({
* 页面的初始数据
*/
data: {
+ pageUseType: 0, // 0 邮寄 1 自提 3邮寄或自提 购物车用 不考虑3
+ allProduct: [],
+
product: [],
showPrice: 0,
from: null,
@@ -23,7 +26,9 @@ Page({
showAllowance: false,
flag:null,
isCar:'single',
- showYhq:null
+ showYhq:null,
+
+ pickupIndex: null,
},
/**
@@ -39,28 +44,80 @@ Page({
isCar:options.isCar,
showYhq:app.globalData.listName?false:true
})
- let price = 0, sku_id = [];
- app.globalData.postProduct.map(item => {
- if (!app.globalData.kjId && !this.data.gp_id) {
- price = price + item.sku.price * item.productNum;
- }
- else if (this.data.gp_id) {
- price = price + item.sku.event_price * item.productNum;
- }
+ this.handleProduct()
+ },
+
+ handleProduct () {
+ app.globalData.postProduct.forEach((item,index) => {
+ item.keyIndex = index
item.sku.batch_shipment = item.sku.batch_shipment?item.sku.batch_shipment:0;
- sku_id.push(item.sku.id)
+ // 用户选择的配送方式
+ item.user_select_type = item.sku.use_type === 1 ? 1 : 0
+ })
+
+ this.setData({
+ allProduct: app.globalData.postProduct,
+ })
+
+ if (this.data.from == "cart") {
+ if (this.data.pageUseType == 0) {
+ let pageUseType = app.globalData.postProduct.some(x=>x.user_select_type==0)?0:1
+ let productList = app.globalData.postProduct.filter(x=>x.user_select_type == pageUseType)
+ this.setData({
+ product: productList,
+ pageUseType: pageUseType,
+ })
+ } else {
+ let productList = app.globalData.postProduct.filter(x=>x.user_select_type == 1)
+ this.setData({
+ product: productList,
+ pageUseType: 1,
+ })
+ }
+ } else {
+ this.setData({
+ product: app.globalData.postProduct,
+ })
+ }
+
+ console.log(this.data.product, "页面数据")
+
+ let price = 0, sku_id = [];
+ this.data.product.forEach(item=>{
+ if (!app.globalData.kjId && !this.data.gp_id) {
+ price = price + item.sku.price * item.productNum;
+ }
+ else if (this.data.gp_id) {
+ price = price + item.sku.event_price * item.productNum;
+ }
+ sku_id.push(item.sku.id)
})
+
this.setData({
- product: app.globalData.postProduct,
- showPrice: app.globalData.kjId ? 0 : price,
- sku_id: sku_id.join(",")
+ showPrice: app.globalData.kjId ? 0 : price,
+ sku_id: sku_id.join(","),
})
- console.log(this.data.product)
+
+
if (!this.data.kjId && !this.data.gp_id) {
- this.couponCom = this.selectAllComponents("#coupon")[0];
+ this.couponCom = this.selectAllComponents("#coupon")[0];
}
- console.log(this.data.showPrice)
+
},
+
+ changeUserPost (e) {
+ let item = e.currentTarget.dataset.item
+ let value = e.currentTarget.dataset.value
+ let index = e.currentTarget.dataset.index
+ item.user_select_type = value
+
+ this.data.product[index] = item
+
+ this.setData({
+ product: this.data.product
+ })
+ },
+
price() {
let allPrice
if (this.data.coupon) {
@@ -83,6 +140,23 @@ Page({
product: product
})
},
+
+ phoneInput: function (e) {
+ let index = e.currentTarget.dataset.index, product = this.data.product;
+ product[index].phone = e.detail.value;
+ this.setData({
+ product: product
+ })
+ },
+
+ delTel: function(e) {
+ let index = e.currentTarget.dataset.index, product = this.data.product;
+ product[index].phone = "";
+ this.setData({
+ product: product
+ })
+ },
+
setAddress: function (e) {
console.log('我触发了');
this.setData({
@@ -90,6 +164,31 @@ Page({
})
this.getPostFee()
},
+
+ changePickup:function (e) {
+ let index = e.currentTarget.dataset.index;
+ let item = e.currentTarget.dataset.item
+ this.setData({
+ pickupIndex: index
+ })
+
+ wx.navigateTo({
+ url:`/subPackages/techanNew/selfPickPoint/index?pickupId=null&goodsId=${item.product.id}&skuId=${item.sku.id}`
+ })
+
+ },
+
+ setPickUpPoint: function (data) {
+ console.log(data)
+ let goods = this.data.product[this.data.pickupIndex]
+ if (goods) {
+ goods.pickupAddress = data
+ }
+ this.setData({
+ product: this.data.product
+ })
+ },
+
minus: function (e) {
let index = e.currentTarget.dataset.index, product = this.data.product;
let productNum = product[index].productNum;
@@ -140,27 +239,80 @@ Page({
})
},
order: function () {
- if (!this.data.address) {
- wx.showToast({
- title: '请选择收货地址!',
- icon: 'none'
- })
- return;
+
+ for(let info of this.data.product) {
+ if (info.user_select_type == 0) {
+ if (!this.data.address) {
+ wx.showToast({title: '请选择收货地址',icon: 'none'});
+ return;
+ }
+ }
+ if (info.user_select_type == 1) {
+ if (!info.pickupAddress||!info.pickupAddress.id) {
+ wx.showToast({title: '请选择自提点',icon: 'none'});
+ return;
+ }
+ if (!info.phone) {
+ wx.showToast({title: '请输入预留手机号',icon: 'none'});
+ return;
+ }
+ }
+
+ let allProductIndex = this.data.allProduct.findIndex(x=>x.keyIndex == info.keyIndex)
+ if (allProductIndex>=0) {
+ this.data.allProduct[allProductIndex] = info
+ }
}
- let product = this.data.product, product_list = [];
- product.map(item => {
- let productItem = {
- type: item.product.type,
- product_id: item.product.id,
- sku_id: item.sku.id,
- post: this.data.address.id,
- product_num: item.productNum,
- remark: item.remark,
- is_batch_shipment: item.sku.batch_shipment,
- compose_sku_id: item.sku.compose_sku_id,
- }
- product_list.push(productItem)
- })
+
+
+
+ // 判断邮寄自提下单结束
+ let canEnd = this.data.from == "cart"?false:true;
+ if (!canEnd) {
+ // 还有自提的产品
+ if (this.data.pageUseType==0 && this.data.allProduct.some(x=>x.user_select_type==1)) {
+ canEnd = false
+ } else {
+ canEnd = true
+ }
+ }
+
+ if (!canEnd) {
+ this.setData({
+ pageUseType: 1
+ })
+ this.handleProduct()
+ return
+ }
+
+
+ // 真下单
+ let product_list = [];
+ for(let info of this.data.allProduct) {
+ let param = {
+ type: info.product.type,
+ product_id: info.product.id,
+ sku_id: info.sku.id,
+ // post: this.data.address.id,
+ product_num: info.productNum,
+ remark: info.remark,
+ is_batch_shipment: info.sku.batch_shipment,
+ compose_sku_id: info.sku.compose_sku_id,
+ supplier_id: info.product.supplier_id,
+ }
+ if (info.user_select_type == 0) {
+ param.use_type = 1
+ param.post = this.data.address.id
+ }
+ if (info.user_select_type == 1) {
+ param.use_type = 2
+ param.pickup_shop_id = info.pickupAddress.id
+ param.pickup_shop_info = info.pickupAddress
+
+ }
+ product_list.push(param)
+ }
+
let data = {
source: "WECHATXCX",
product_list: product_list,
@@ -189,8 +341,19 @@ Page({
data.partner_code = ZTPointProduct.product.ZTPoint
data.channel = ZTPointProduct.product.ZTPoint
}
- console.log(app.globalData.list)
+ console.log(app.globalData.list,this.data.flag)
if(!app.globalData.list || app.globalData.list.length == 0){
+ // 判断混合下单
+ let use_type = product_list[0].use_type
+ if (product_list.some(x=>x.use_type!=use_type)) {
+ app.globalData.productPrice = (this.data.showPrice + this.data.postFee - (this.data.coupon?this.data.coupon.activity.money:0))/100;
+ app.globalData.createDate = data
+ wx.redirectTo({
+ url: '/pages/order/orderList/index?flag=mix'
+ })
+ return
+ }
+
commonApi.user_post("order/create", {
data: JSON.stringify(data)
}).then(res => {
@@ -199,22 +362,22 @@ Page({
this.setData({
kjId: null
})
- this.onLoad({})
+ // this.onLoad({})
}
app.globalData.gp_id = null;
app.globalData.team_id = null;
this.setData({
gp_id: null
})
- this.onLoad({});
+ // this.onLoad({});
})
}else{
app.globalData.productPrice = (this.data.showPrice + this.data.postFee - (this.data.coupon?this.data.coupon.activity.money:0))/100;
app.globalData.createDate = data
- console.log(app.globalData.product)
- if (!app.globalData.product) {
- app.globalData.product = app.globalData.list[0]
- }
+ console.log(app.globalData.product)
+ if (!app.globalData.product) {
+ app.globalData.product = app.globalData.list[0]
+ }
wx.redirectTo({
url: '/pages/order/scene/index?flag='+this.data.flag+'&isCar='+this.data.isCar,
})
@@ -222,7 +385,39 @@ Page({
},
getPostFee: function () {
if (!this.data.address) return;
- let product = this.data.product, list = [], that = this;
+ let list = [], indexList = [],that = this;
+ let product = this.data.product.filter((x,i)=>{
+ if (x.user_select_type == 0) {
+ indexList.push(i)
+ return x
+ }
+ });
+
+ if (product.length<=0) {
+ let postFee = 0;
+ this.data.product.forEach(x=>{
+ x.postFee = 0;
+ })
+ if (this.data.coupon && this.data.postFee != postFee) {
+ wx.showToast({
+ title: '订单价格发生变化,请重新选择优惠券',
+ icon: 'none'
+ })
+ app.globalData.couponInfo = null;
+ if (!this.data.kjId && !this.data.gp_id) {
+ this.couponCom.setNullCoupon()
+ }
+ this.setData({
+ coupon: null
+ })
+ }
+ this.setData({
+ postFee: postFee,
+ product: this.data.product,
+ })
+ return
+ }
+
product.map(item => {
list.push(commonApi.user_post("order/get_post_price", {
sku_id: item.sku.id,
@@ -268,9 +463,13 @@ Page({
coupon: null
})
}
+ for(let i=0;i
-
-
-
-
-
-
-
- {{item.product.title}}
- ¥{{item.sku.price/100}}
-
-
- {{item.sku.sku_name}}
- x{{item.productNum}}
-
-
+
+
+
+
+ 邮寄
+ 自提
-
-
- 购票数量
-
- {{item.productNum}}
-
-
-
- 收货方式
-
-
-
-
- 一次性收货
-
-
-
-
- 分批收货(共{{item.sku.batch_count}}次)
+
+
+
+
+
+ 自提点
+
+ 选择提货地址
+ {{item.pickupAddress.title}}
+
+
- {{item.sku.batch_remark}}
+
+ 预留手机号
+
+
+
+
+
+
-
-
- 运费
-
-
- {{item.postFee?("¥"+(item.postFee/100)):"包邮"}}
-
- x{{item.sku.batch_count}}
- ¥{{(item.postFee/100)*item.sku.batch_count}}
+
+
+
+
+
+
+ {{item.product.title}}
+ ¥{{item.sku.price/100}}
+
+
+ {{item.sku.sku_name}}
+ x{{item.productNum}}
+
+
+
+
+
+ 购票数量
+
+ {{item.productNum}}
+
+
+
+ 收货方式
+
+
+
+
+ 一次性收货
+
+
+
+
+ 分批收货(共{{item.sku.batch_count}}次)
+
+
+ {{item.sku.batch_remark}}
+
+
+
+
+ 运费
+
+
+ {{item.postFee?("¥"+(item.postFee/100)):"包邮"}}
+
+ x{{item.sku.batch_count}}
+ ¥{{(item.postFee/100)*item.sku.batch_count}}
+
+
+
+
+ 订单备注:
+
+
+
+ 小计:¥
+ {{(item.sku.price * item.productNum + item.postFee*item.sku.batch_count || 0) /100}}
+ {{(item.sku.price * item.productNum + item.postFee || 0) /100}}
+
-
-
- 订单备注:
-
-
-
- 小计:¥
- {{(item.sku.price * item.productNum + item.postFee*item.sku.batch_count || 0) /100}}
- {{(item.sku.price * item.productNum + item.postFee || 0) /100}}
-
-
惠民补贴
diff --git a/pages/order/postOrder/index.wxss b/pages/order/postOrder/index.wxss
index b85f0ea..f391cfc 100644
--- a/pages/order/postOrder/index.wxss
+++ b/pages/order/postOrder/index.wxss
@@ -3,10 +3,34 @@ page {
background: #f6f6f6;
}
+.sendwayArea{
+ display: flex;
+ justify-content: space-between;
+ box-sizing: border-box;
+}
+.sendwayArea .sendway-item{
+ font-weight: 500;
+ font-size: 27rpx;
+ color: #111111;
+ width: 333rpx;
+ text-align: center;
+ height: 57rpx;
+ line-height: 57rpx;
+ background: #FFFFFF;
+ border-radius: 29rpx;
+}
+.sendwayArea .sendway-item.active{
+ border: 1px solid #0E8790;
+ color: #0E8790;
+}
+
+.sku-info-container{
+ background: #FFFFFF;
+ border-radius: 9rpx;
+}
+
.box {
margin: 30rpx 25rpx;
- background: white;
- border-radius: 9rpx;
}
.box-title {
@@ -19,6 +43,30 @@ page {
align-items: center;
}
+.sku-info-container .box-title{
+ border-bottom: 1px solid #CCCCCC;
+}
+
+.pickup-container .box-title{
+ justify-content: space-between;
+ background: #FFFFFF;
+ margin: 26rpx 0;
+ border-radius: 13rpx;
+ padding: 0 20rpx;
+}
+.pickup-container .flex-1{
+ display: flex;
+ align-items: center;
+ justify-content: flex-end;
+ padding-right: 34rpx;
+ text-align: right;
+}
+.cha {
+ width: 20rpx;
+ height: 20rpx;
+}
+
+
.allowance {
justify-content: space-between;
}
@@ -56,7 +104,6 @@ page {
display: flex;
justify-content: space-between;
padding: 30rpx 20rpx;
- margin-bottom: 30rpx;
}
.skuinfo image {
@@ -129,10 +176,6 @@ page {
height: 1rpx;
}
-.topbox .box-title {
- border-top: 1rpx solid #ccc;
-}
-
.box-title input {
flex: 1;
display: block;
@@ -187,7 +230,7 @@ page {
font-size: 27rpx;
height: 80rpx;
align-items: center;
- border-top: 1rpx solid #ccc;
+ /* border-top: 1rpx solid #ccc; */
color: #000;
}
diff --git a/pages/user/cartlist/list.js b/pages/user/cartlist/list.js
index cae4009..d9aae1a 100644
--- a/pages/user/cartlist/list.js
+++ b/pages/user/cartlist/list.js
@@ -67,6 +67,15 @@ Page({
limit:999,
}).then(res => {
let resData = this.data.list.concat((res.data || []))
+ resData.forEach(x=>{
+ if (x.product&&x.product.type == 'post'&&x.product.is_package===0&&x.delivery_method===null) {
+ if (x.sku.sku_model.use_type == 1) {
+ x.delivery_method = 1
+ } else {
+ x.delivery_method = 0
+ }
+ }
+ })
this.setData({
list: resData
})
@@ -143,7 +152,7 @@ Page({
},
changeNumber(item) {
commonApi.user_post("cart/update_sku", {
- sku_id: item.sku.id,
+ id: item.id,
num: item.num
}).then(res => { })
},
@@ -160,6 +169,8 @@ Page({
})
},
order: function () {
+
+
commonApi.user_post('wx/get_user_keep', {
jumpurl: '/pages/user/cartlist/list',
title: '购物车',
@@ -179,13 +190,15 @@ Page({
price = 0,
product = [],
product1 = []
- list.map(item => {
+ list.map((item,index) => {
if (item.checked) {
// item.product.type="post";
if (item.product.type == 'post') {
product.push({
product: item.product,
- sku: item.sku,
+ // todo
+ // sku: {...item.sku, use_type: item.sku.sku_model.use_type||index},
+ sku: {...item.sku, use_type: item.delivery_method||0},
productNum: item.num
})
} else {
@@ -205,14 +218,32 @@ Page({
return;
}
- this.setData({flag:''})
+ let postSkuIds = product.map(x=>x.sku.id)
+ if(postSkuIds.some(x=>postSkuIds.filter(v=>v==x).length>1)) {
+ wx.showToast({
+ title: '相同规格产品不可重复购买',
+ icon: "none"
+ })
+ return
+ }
+
+ this.setData({flag:''})
+ let use_type = product[0].sku.use_type
+ if (product.some(x=>x.sku.use_type!=use_type)) {
+ this.setData({
+ flag: 'mix',
+ isCar: 'multiple'
+ })
+ }
if (product.length > 0 && product1.length > 0) {
this.setData({
flag: 'mix',
isCar: 'multiple'
})
}
+
+
if (product1.length > 1) {
this.setData({
isCar: 'multiple'
@@ -330,7 +361,7 @@ Page({
let index = e.currentTarget.dataset.index,
list = this.data.list;
commonApi.user_post("cart/del_sku", {
- sku_id: list[index].sku_id
+ id: list[index].id
}).then(res => {
if (res.code == 1) {
wx.showToast({
@@ -350,7 +381,7 @@ Page({
let suid = []
arr.forEach(item => {
if (item.checked) {
- suid.push(item.sku_id)
+ suid.push(item.id)
}
});
let skuids = suid.join(',')
@@ -360,7 +391,7 @@ Page({
success: function (res) {
if (res.confirm) {
commonApi.user_post("cart/del_sku", {
- sku_id: skuids
+ id: skuids
}).then(res => {
if (res.code == 1) {
wx.showToast({
diff --git a/pages/user/cartlist/list.wxml b/pages/user/cartlist/list.wxml
index d05a364..085d857 100644
--- a/pages/user/cartlist/list.wxml
+++ b/pages/user/cartlist/list.wxml
@@ -5,7 +5,12 @@
-
+
+
+
+ {{item.delivery_method===1?"自提":"邮寄"}}
+
+
{{item.product.title}}
diff --git a/pages/user/cartlist/list.wxss b/pages/user/cartlist/list.wxss
index c5c40fd..82942ff 100644
--- a/pages/user/cartlist/list.wxss
+++ b/pages/user/cartlist/list.wxss
@@ -58,12 +58,34 @@ page {
flex-shrink: 0;
font-size: 40rpx;
}
-.item image {
+.item .img-container{
margin: 0 25rpx;
flex-shrink: 0;
width: 173rpx;
height: 173rpx;
border-radius: 7rpx;
+ overflow: hidden;
+ position: relative;
+}
+
+.item .img-container image {
+ width: 173rpx;
+ height: 173rpx;
+ border-radius: 7rpx;
+}
+.item .img-container .use-type{
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ width: 100%;
+ border-radius: 0rpx 0rpx 7rpx 7rpx;
+ height: 33rpx;
+ background: rgba(0,0,0,0.3);
+ font-weight: 400;
+ font-size: 24rpx;
+ color: #FFFFFF;
+ text-align: center;
+ line-height: 33rpx;
}
.item-info {
flex: 1;
diff --git a/pages/user/order/postOrderInfo/index.js b/pages/user/order/postOrderInfo/index.js
index 758a3e6..bce81f4 100644
--- a/pages/user/order/postOrderInfo/index.js
+++ b/pages/user/order/postOrderInfo/index.js
@@ -10,6 +10,8 @@ Page({
*/
data: {
info:null,
+ isPickup: false, // 是否自提
+
orderState:app.globalData.orderState,
productState:app.globalData.productState,
product_model:null,
@@ -17,6 +19,7 @@ Page({
feeInfoFlag:false,
codeIndex:0,
codeImgs:[],
+ imgLen: [],
minute:"",
second:"",
id:null,
@@ -99,26 +102,40 @@ Page({
})
},
getCodeImg:function(){
- let code = "111";
- let that = this,sys =wx.getSystemInfoSync(),radio = sys.screenWidth / 750,qrcode=this.data.info.order_product_list[0].qrcode,codeImgs=[];
- qrcode.map((item,index)=>{
- new QRCode('damocode'+index,{
- text: item.use_code,
- width: 300 * radio,
- height: 300 * radio,
- padding: 12, // 生成二维码四周自动留边宽度,不传入默认为0
- correctLevel: QRCode.CorrectLevel.L, // 二维码可辨识度
- callback: (res) => {
- codeImgs.push(res.path);
- if(codeImgs.length==qrcode.length){
+ let that = this,sys =wx.getSystemInfoSync(),radio = sys.screenWidth / 750,
+ qrcode=this.data.info.order_product_list[0].qrcode,codeImgs=[],codeId=0,arr = [];
+
+ this.data.info.order_product_list.forEach(qrcode=>{
+ qrcode.qrcode.map((item,index)=>{
+ console.log(qrcode.is_force_display_code);
+ item.is_force_display_code = qrcode.is_force_display_code
+ console.log(item.is_force_display_code);
+ arr.push(index)
+ this.setData({imgLen:arr})
+ if(item.use_url&&item.use_code){
+ codeImgs.push({img:item.use_url,code:item.use_code,text:item.use_code_display_text,state:item.stateText,is_force_display_code:item.is_force_display_code,flag:item.state});
that.setData({
codeImgs:codeImgs
})
}
- console.log(res)
- }
+ else {
+ new QRCode('damocode'+codeId,{
+ text: item.use_code,
+ width: 300 * radio,
+ height: 300 * radio,
+ padding:10, // 生成二维码四周自动留边宽度,不传入默认为0
+ correctLevel: QRCode.CorrectLevel.H, // 二维码可辨识度
+ callback: (res) => {
+ codeImgs.push({img:res.path,code:item.use_code,text:item.use_code_display_text,state:item.stateText,is_force_display_code:item.is_force_display_code,flag:item.state});
+ that.setData({
+ codeImgs:codeImgs
+ })
+ }
+ })
+ codeId = codeId + 1
+ }
+ })
})
- })
},
prevCodeImg:function(){
let qrcode=this.data.info.order_product_list[0].qrcode,codeIndex = this.data.codeIndex;
@@ -318,8 +335,28 @@ getInfo () {
order.consignee_info = order.consignee_info?JSON.parse(order.consignee_info):null;
state = state + order.state;
order.contacts_info = order.contacts_info?JSON.parse(order.contacts_info):[]
- })
+ if (order.pickup_shop_id>0) {
+ try {
+ order.pickupShop = JSON.parse(order.pickup_shop_info)
+ } catch(e) {
+ order.pickupShop = null
+ }
+ }
+
+ })
+
+ // 2025-7-21能否确认收货
+ res.data.is_all_confirm = true;
+ if (res.data.state=='PAID' && res.data.stateNums.WAIT_DELIVERY==res.data.order_product_list.length) {
+ res.data.order_product_list.forEach(v=>{
+ if (v.shipped_batch_count < v.batch_count ) {
+ res.data.is_all_confirm = false
+ }
+ })
+ } else {
+ res.data.is_all_confirm = false;
+ }
// 权益卡
let cardPostList = [];
let isCard= false;
@@ -331,18 +368,19 @@ getInfo () {
cardPostList.forEach(v=>{
console.log(v)
if (v.order_card_product) {
- v.order_card_product.month = new Date(v.order_card_product.delivery_start_date).getMonth()+1
- v.order_card_product.delivery_start_date = v.order_card_product.delivery_start_date.slice(0,10)
- v.order_card_product.delivery_end_date = v.order_card_product.delivery_end_date.slice(0,10)
+ v.order_card_product.month = new Date(v.order_card_product.delivery_start_date).getMonth()+1
+ v.order_card_product.delivery_start_date = v.order_card_product.delivery_start_date.slice(0,10)
+ v.order_card_product.delivery_end_date = v.order_card_product.delivery_end_date.slice(0,10)
}
if (['WAIT_DELIVERY', 'WAIT_COMMENT', 'COMPLETED'].includes(v.state)) {
- deliveryNum += 1
+ deliveryNum += 1
}
})
}
-
+ console.log(res.data, 'aaa')
this.setData({
isRefund:state.indexOf("REFUND")!=-1,
+ isPickup: res.data.order_product_list.some(v=>v.pickup_shop_id>0),
info:res.data,
product_model:res.data.order_product_list[0].product_model,
ids: proId.join(","),
@@ -372,78 +410,30 @@ getInfo () {
util.gotoDetail(item);
}
},
+
+ callPhone: function (e) {
+ let item = e.currentTarget.dataset.item
+ let phone = item.pickupShop.tel
+ wx.makePhoneCall({
+ phoneNumber: phone
+ })
+ },
+
+ gotolocation: function(e) {
+ let item = e.currentTarget.dataset.item
+ let info = item.pickupShop
+ wx.openLocation({
+ latitude: Number(info.lat),
+ longitude: Number(info.lon),
+ name:info.title,
+ address:info.address
+ })
+ },
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
- commonApi.user_post("order/query",{
- order_id:this.data.id
- }).then(res=>{
- if(res.data.create_time && res.data.auto_close_time && res.data.state=='UNPAID'){
- let time = (new Date(res.data.create_time.replace(/-/g,'/')).getTime() + Number(res.data.auto_close_time) * 1000);
- this.daojishi(time);
- }
- let proId = []
- res.data.order_product_list.forEach(item => {
- proId.push(item.product_id)
- })
- let state = "";
- res.data.stateNums = {}
- res.data.order_product_list.map(order=>{
- if(res.data.stateNums[order.state]){
- res.data.stateNums[order.state]++;
- }
- else {
- res.data.stateNums[order.state] = 1;
- }
- order.consignee_info = order.consignee_info?JSON.parse(order.consignee_info):null;
- state = state + order.state;
- order.contacts_info = order.contacts_info?JSON.parse(order.contacts_info):[]
- })
-
- // 2025-7-21能否确认收货
- res.data.is_all_confirm = true;
- if (res.data.state=='PAID' && res.data.stateNums.WAIT_DELIVERY==res.data.order_product_list.length) {
- res.data.order_product_list.forEach(v=>{
- if (v.shipped_batch_count < v.batch_count ) {
- res.data.is_all_confirm = false
- }
- })
- } else {
- res.data.is_all_confirm = false;
- }
- // 权益卡
- let cardPostList = [];
- let isCard= false;
- let deliveryNum = 0;
- if (res.data.order_product_list.some(v=>v.order_card_product)) {
- cardPostList = res.data.order_product_list.slice(1)
- res.data.order_product_list = [res.data.order_product_list[0]]
- isCard = true;
- cardPostList.forEach(v=>{
- console.log(v)
- if (v.order_card_product) {
- v.order_card_product.month = new Date(v.order_card_product.delivery_start_date).getMonth()+1
- v.order_card_product.delivery_start_date = v.order_card_product.delivery_start_date.slice(0,10)
- v.order_card_product.delivery_end_date = v.order_card_product.delivery_end_date.slice(0,10)
- }
- if (['WAIT_DELIVERY', 'WAIT_COMMENT', 'COMPLETED'].includes(v.state)) {
- deliveryNum += 1
- }
- })
- }
- console.log(res.data, 'aaa')
- this.setData({
- isRefund:state.indexOf("REFUND")!=-1,
- info:res.data,
- product_model:res.data.order_product_list[0].product_model,
- ids: proId.join(","),
- cardPostList: cardPostList,
- isCard: isCard,
- deliveryNum: deliveryNum
- })
- this.getCodeImg()
- })
+ this.getInfo()
},
/**
diff --git a/pages/user/order/postOrderInfo/index.wxml b/pages/user/order/postOrderInfo/index.wxml
index 563d837..f2845b8 100644
--- a/pages/user/order/postOrderInfo/index.wxml
+++ b/pages/user/order/postOrderInfo/index.wxml
@@ -2,8 +2,9 @@
+
{{info.state_text}}
-
+
您的退款已成功,退款金额预计在1-7个工作日内退还到您支付的账户
您已成功发起退款申请,请耐心等待
请在00:{{minute}}:{{second}}内支付,逾期订单将自动取消
@@ -13,6 +14,25 @@
{{info.order_product_list[0].consignee_info.address}}
+
+
+
+
+
+
+
+ {{item.state}}
+
+
+
+
+
+ 核销码:{{codeImgs[codeIndex].code}}
+
+
+
+
+
@@ -30,47 +50,96 @@
{{item.state_text}}
-
- 收货方式:
- 分批收货 (共{{item.batch_count}}次)
- 一次性收货
-
-
- 运费:
-
- ¥{{item.post_fee/item.batch_count/100}} x{{info.order_product_list[0].batch_count}}
- {{item.post_fee?("¥"+item.post_fee/100):"包邮"}}
-
-
-
- 小计:
- ¥{{item.paid_money/100}}
-
-
-
-
- 物流信息
-
- {{item.showMore?"收起":"展开"}}
-
+
+ 收货方式:自提
+
+
+ 收货方式:
+ 分批收货 (共{{item.batch_count}}次)
+ 一次性收货
-
-
-
- 当前已发:{{item.shipped_batch_count}}
+
+
+
+
+
+ 商品总价:
+ ¥{{info.total_money/100}}
+
+
+ 运费:
+
+ ¥{{info.total_post_fee/info.order_product_list[0].batch_count/100}} x{{info.order_product_list[0].batch_count}}
+ {{info.total_post_fee?("¥"+info.total_post_fee/100):"包邮"}}
-
- 物流备注:{{item.batch_remark}}
+
+
+ 优惠券:
+ -¥{{info.preference_money/100}}
+
+
+ 实付款
+ ¥{{info.paid_money/100}}
+
+
+
+
+
+ 物流信息
+
+ {{item.showMore?"收起":"展开"}}
+
+
+
+
+ 当前已发:{{item.shipped_batch_count}}
+
+
+ 当前待发:{{item.batch_count - item.shipped_batch_count}}
+
+
+ 物流备注:{{item.batch_remark}}
+
+
+
+
+ 快递{{shipIndex+1}}
+
+ 快递公司:{{shipment.express_name}}
+
+
+ 快递单号:
+
+ {{shipment.courier_number}} 复制
+
+
+
+ 发货时间:{{shipment.post_time}}
+
+
+
-
+
+
+
+
+
+
+
- 快递{{shipIndex+1}}
快递公司:{{shipment.express_name}}
@@ -81,45 +150,24 @@
- 发货时间:{{shipment.post_time}}
+ 发货时间:{{shipment.post_time}}
+
-
-
-
-
-
-
-
-
-
- 快递公司:{{shipment.express_name}}
-
-
- 快递单号:
-
- {{shipment.courier_number}} 复制
-
-
-
- 发货时间:{{shipment.post_time}}
-
+
+
+
+ 使用说明
+
+ {{item.showMsg?"收起":"展开"}}
+
-
+
-
-
- 使用说明
-
- {{item.showMsg?"收起":"展开"}}
-
-
-
-
@@ -174,29 +222,46 @@
-
- 订单信息
-
- 商品总价:
- ¥{{info.total_money/100}}
-
-
- 运费:
-
- ¥{{info.total_post_fee/info.order_product_list[0].batch_count/100}} x{{info.order_product_list[0].batch_count}}
- {{info.total_post_fee?("¥"+info.total_post_fee/100):"包邮"}}
+
+ 自提信息
+
+
+
+
+ 预留手机号:{{info.order_product_list[0].phone}}
+
+
+
+ {{info.order_product_list[0].pickupShop.title}}
+ {{info.order_product_list[0].pickupShop.address}}
+
+
+
+
+ 电话
+
+
+
+
+ 导航
+
+
+
+
-
- 优惠券:
- -¥{{info.preference_money/100}}
-
-
- 实付款
- ¥{{info.paid_money/100}}
-
-
+
+
+
+
+
+ 订单信息
+
+
+
订单编号:
diff --git a/pages/user/order/postOrderInfo/index.wxss b/pages/user/order/postOrderInfo/index.wxss
index e02e564..c1bd603 100644
--- a/pages/user/order/postOrderInfo/index.wxss
+++ b/pages/user/order/postOrderInfo/index.wxss
@@ -16,6 +16,18 @@ page {
color: #fff;
font-size: 48rpx;
}
+.copy-box {
+ width: 73rpx;
+ line-height: 35rpx;
+ border-radius: 7rpx;
+ border: 1rpx solid #09898C;
+ margin-left: 15rpx;
+ text-align: center;
+ font-weight: 500;
+ font-size: 23rpx;
+ color: #0E8790;
+ height: 40rpx;
+}
.box {
padding: 20rpx;
background: white;
@@ -202,8 +214,8 @@ page {
top: 30rpx;
}
.code-box {
- text-align: center;
- height: 530rpx;
+ text-align: center;
+ min-height: 340rpx;
position: relative;
}
.code-box .iconfont {
@@ -240,6 +252,8 @@ page {
font-size: 30rpx;
font-weight: 500;
margin: 25rpx;
+ display: flex;
+ justify-content: center;
}
.code-btn {
width: 220rpx;
@@ -439,4 +453,37 @@ color: #333333;
width: 100%;
height: 100%;
border-radius: 50%;
+}
+
+
+.mask-shop-info{
+ font-weight: 500;
+ font-size: 31rpx;
+ color: #000000;
+}
+.shop-info-item{
+ display: flex;
+ align-items: flex-start;
+ font-family: PingFang SC;
+ font-weight: bold;
+ font-size: 27rpx;
+ color: #000000;
+ padding: 20rpx 0;
+ word-wrap: break-all;
+}
+.shop-info-item .start-icon{
+ width: 33.33rpx;
+ height: 33.33rpx;
+ margin: 4rpx 17rpx 0 0;
+ flex-shrink: 0;
+}
+.shop-info-item .subtitle{
+ font-weight: 500;
+ font-size: 24rpx;
+ color: #666666;
+ margin-top: 26rpx;
+}
+.shop-info-item .icon-phone{
+ width: 56rpx;
+ height: 56rpx;
}
\ No newline at end of file
diff --git a/project.private.config.json b/project.private.config.json
index 7920a32..25fe308 100644
--- a/project.private.config.json
+++ b/project.private.config.json
@@ -6,12 +6,33 @@
"condition": {
"miniprogram": {
"list": [
+ {
+ "name": "pages/order/orderList/index",
+ "pathName": "pages/order/orderList/index",
+ "query": "flag=mix",
+ "scene": null,
+ "launchMode": "default"
+ },
+ {
+ "name": "subPackages/techanNew/selfPickPoint/index",
+ "pathName": "subPackages/techanNew/selfPickPoint/index",
+ "query": "pickupId=null&goodsId=457654&skuId=190836",
+ "launchMode": "default",
+ "scene": null
+ },
+ {
+ "name": "pages/info/postProductInfo/index",
+ "pathName": "pages/info/postProductInfo/index",
+ "query": "id=457654",
+ "launchMode": "default",
+ "scene": null
+ },
{
"name": "subPackages/goods/memberCard/index",
"pathName": "subPackages/goods/memberCard/index",
"query": "id=464704",
- "scene": null,
- "launchMode": "default"
+ "launchMode": "default",
+ "scene": null
},
{
"name": "subPackages/foodListNew/index",
diff --git a/subPackages/techanNew/index.js b/subPackages/techanNew/index.js
index ee85e0f..995f4b0 100644
--- a/subPackages/techanNew/index.js
+++ b/subPackages/techanNew/index.js
@@ -52,7 +52,9 @@ Page({
seachFlag:false, //搜索模式
totalPrice:0, //获取购物车总价--打开购物车后勾选的产品价格
name:'文创特产',
- nowAddListId:[]
+ nowAddListId:[],
+
+ user_type: null,
},
/**
@@ -87,10 +89,10 @@ Page({
delAll() {
let ids = []
this.data.gwcList.forEach(item => {
- ids.push(item.sku_id)
+ ids.push(item.id)
})
commonApi.user_post("cart_within/del_sku", {
- sku_id: ids+'',
+ id: ids+'',
type:'1'
}).then(res => {
if (res.code == 1) {
@@ -107,11 +109,12 @@ Page({
},
// 减少一个
del(e) {
- let item = e.currentTarget.dataset.item
- let gwcList = this.data.gwcList
+ let item = e.currentTarget.dataset.item;
+ let gwcList = this.data.gwcList;
+ let valueNum = e.currentTarget.dataset.value
commonApi.user_post("cart_within/update_sku", {
- num:item.num-1,
- sku_id: item.sku_id,
+ num:item.num + valueNum,
+ id: item.id,
type:'1'
}).then(res => {
if (res.code == 1) {
@@ -134,6 +137,9 @@ Page({
if (item.selected ==1) {
totalPrice += item.num*item.sku.price
}
+ if (item.delivery_method === null) {
+ item.delivery_method = item.sku.sku_model.use_type == 1?1:0
+ }
})
}
let status = res.data.every(el => el.selected === 1)
@@ -149,6 +155,14 @@ Page({
},
// 添加产品到购物车
addCart: function (e) {
+ if (![0,1].includes(this.data.user_type)) {
+ wx.showToast({
+ title: "请选择配送方式",
+ icon:"none"
+ })
+ return
+ }
+
let item = e.currentTarget.dataset.item
app.globalData.postProduct = []
app.globalData.list = []
@@ -161,7 +175,8 @@ Page({
commonApi.user_post("cart_within/add_sku", {
sku_id: this.data.showPopup ? item.sku.id :this.data.info.sku[this.data.skuIndex].id,
num: this.data.producNum,
- type:"1"
+ type:"1",
+ delivery_method: this.data.user_type
}).then(res => {
if (res.code == 1) {
let sku_id = this.data.showPopup ? item.sku.id :this.data.info.sku[this.data.skuIndex].id
@@ -195,6 +210,9 @@ Page({
if (element.selected == 1) {
totalPrice += Number(element.num*element.sku.price)
}
+ if (element.delivery_method === null) {
+ element.delivery_method = element.sku.sku_model.use_type == 1?1:0
+ }
})
console.log(res.data);
let status = res.data.every(el => el.selected === 1)
@@ -261,7 +279,7 @@ Page({
if (item.product.type == 'post') {
product.push({
product: item.product,
- sku: item.sku,
+ sku: {...item.sku, use_type: item.delivery_method||0},
productNum: item.num
})
} else {
@@ -280,21 +298,26 @@ Page({
// })
return;
}
- if (product.length > 0 && product1.length > 0) {
- this.setData({
- flag: 'mix',
- isCar: 'multiple'
- })
- }
- if (product1.length > 1) {
- this.setData({
- isCar: 'multiple'
- })
- } else {
- this.setData({
- isCar: 'single'
+ let postSkuIds = product.map(x=>x.sku.id)
+ if(postSkuIds.some(x=>postSkuIds.filter(v=>v==x).length>1)) {
+ wx.showToast({
+ title: '相同规格产品不可重复购买',
+ icon: "none"
})
+ return
+ }
+
+ let useType = product[0].sku.use_type
+ let flag = this.data.flag, isCar = "single";
+ if (product.some(x=>x.sku.use_type!=useType)) {
+ flag = "mix"
+ isCar = "multiple"
}
+ this.setData({
+ flag: flag,
+ isCar: isCar
+ })
+
console.log(product1);
app.globalData.postProduct = product;
if (app.globalData.list) {
@@ -414,14 +437,12 @@ Page({
},
// 获取历史购物车详情
getCount() {
- // debugger
commonApi.user_post('cart_within/get_list', {
type:'1'
}).then(res => {
let arr = res.data,totalPrice = 0,cartCount=0
if (arr.length>0) {
arr.forEach(item=> {
- // totalPrice += item.num*item.sku.price
cartCount += item.num
})
}
@@ -433,15 +454,17 @@ Page({
}
})
})
- // debugger
+
arr.forEach(item=> {
if(item.selected == 1) {
totalPrice += item.num*item.sku.price
}
+ if (item.delivery_method === null) {
+ item.delivery_method = item.sku.sku_model.use_type == 1?1:0
+ }
})
}
- // console.log(arr);
- // debugger
+
this.setData({
cartCount: cartCount, //1
gwcList:arr,
@@ -605,6 +628,10 @@ Page({
},
// 添加产品弹窗 1.首先获取到该产品下的规格
addBuyCart(e) {
+ this.setData({
+ user_type: null
+ })
+
let item = e.currentTarget.dataset.item
console.log(item);
commonApi._post("product/get_product_detail", {
@@ -661,9 +688,18 @@ Page({
selectSku: function (e) {
let index = e.currentTarget.dataset.index;
this.setData({
- skuIndex: index
+ skuIndex: index,
+ user_type: null,
})
},
+
+ changeSelectSkuPost: function(e) {
+ let value = e.currentTarget.dataset.value;
+ this.setData({
+ user_type: value,
+ })
+},
+
// 关闭弹窗
hideSku: function () {
this.setData({
diff --git a/subPackages/techanNew/index.wxml b/subPackages/techanNew/index.wxml
index 0a7fe57..dc8afb7 100644
--- a/subPackages/techanNew/index.wxml
+++ b/subPackages/techanNew/index.wxml
@@ -177,6 +177,27 @@
{{producNum}}
+
+
+ 配送方式
+
+
+
+
+
+
+ 邮寄
+
+
+
+
+
+
+ 自提
+
+
+
+
+ 地址:{{item.address}}
+
+
+
+
+
+
+ 去这里
+
+
+
+
+
+
+
+ 暂无自提点地址
+
+
+
+
+ 确定
+
+
+
+
+
\ No newline at end of file
diff --git a/subPackages/techanNew/selfPickPoint/index.wxss b/subPackages/techanNew/selfPickPoint/index.wxss
new file mode 100644
index 0000000..4fb3687
--- /dev/null
+++ b/subPackages/techanNew/selfPickPoint/index.wxss
@@ -0,0 +1,124 @@
+
+.bg {
+ /* position: relative; */
+ background: #F7F7F7;
+ padding-bottom: 170rpx;
+ box-sizing: border-box;
+ min-height: 100vh;
+ padding-top: 20rpx;
+}
+.flex-shrink-0{
+ flex-shrink: 0;
+}
+.item-bg{
+ width: 697rpx;
+ min-height: 160rpx;
+ height: 160rpx;
+ background: #FFFFFF;
+ border-radius: 13rpx;
+ margin: 0 auto;
+ margin-bottom: 28rpx;
+}
+.item-bg.active{
+ border:1px solid #0E8790;
+}
+
+.item {
+ padding: 24rpx;
+ padding-right: 0;
+ display: flex;
+ background: #FFFFFF;
+ border-radius: 13rpx;
+ width: 100%;
+ height: 100%;
+ box-sizing: border-box;
+}
+.item .item-point-title{
+ flex: 1;
+ width: 10rpx;
+ padding-right: 78rpx;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+ font-weight: 500;
+ font-size: 27rpx;
+ color: #999999;
+}
+.item .item-point-guide{
+ width:140rpx;
+ flex-shrink: 0;
+ border-left: 1px solid #D8D8D8;
+ color: #515150;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ font-size: 24rpx;
+}
+.item .mapPoint{
+ width: 33rpx;
+ height: 33rpx;
+}
+.name {
+ display: flex;
+ font-size: 31rpx;
+ font-weight: bold;
+ color: #333333;
+}
+
+
+.no-data {
+ width: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-direction: column;
+ padding: 300rpx 0;
+}
+.no-data view:nth-child(2) {
+ font-size: 30rpx;
+ font-family: PingFang SC;
+ font-weight: 500;
+ color: #333333;
+ margin-top: 25rpx;
+}
+
+.no-data image {
+ width: 160rpx;
+ height: 160rpx;
+}
+
+.btn-bottom{
+ position: fixed;
+ bottom: 0;
+ width: 750rpx;
+ height: 150rpx;
+ background: #FFFFFF;
+ box-shadow: 0rpx 0rpx 16rpx 0rpx rgba(6, 0, 1, 0.1);
+ display: flex;
+ justify-content: space-between;
+ padding: 30rpx 50rpx 30rpx 50rpx;
+ box-sizing: border-box;
+}
+
+.btn-bottom .addBox{
+ margin: 0 auto;
+ width: 697rpx;
+ height: 73rpx;
+ background: #D62828;
+ border-radius: 39rpx;
+ font-size: 36rpx;
+ font-family: PingFang SC;
+ font-weight: 500;
+ color: #FFFFFF;
+ line-height: 80rpx;
+ text-align: center;
+}
+.distance{
+ font-weight: 500;
+ font-size: 24rpx;
+ color: #0E8790;
+ text-align: center;
+ padding-top: 11rpx;
+ word-wrap: break-all;
+}
diff --git a/utils/https.js b/utils/https.js
index d55ab84..b0f9a8b 100644
--- a/utils/https.js
+++ b/utils/https.js
@@ -1,8 +1,8 @@
var app = getApp();
import util from "../utils/util"
// import userApi from "../utils/https/user.js";
-// const baseUrl = "https://test.api.cloud.sz-trip.com/api/";
-let baseUrl = "https://api.cloud.sz-trip.com/api/";
+const baseUrl = "https://test.api.cloud.sz-trip.com/api/";
+// let baseUrl = "https://api.cloud.sz-trip.com/api/";
const env = wx.getAccountInfoSync().miniProgram.envVersion
if (env == 'develop1') {
baseUrl = "https://test.api.cloud.sz-trip.com/api/"
diff --git a/utils/util.js b/utils/util.js
index 7a1dd16..688dcf1 100644
--- a/utils/util.js
+++ b/utils/util.js
@@ -569,7 +569,6 @@ const pagePointPostUrl = [
const detailPagePoint = function (url, res) {
try {
- console.log(res)
let pagePointRoute = pagePointPostUrl.find(v=>url.indexOf(v.url)>=0)
if (pagePointRoute) {
// 如果是产品详情的话 需要加埋点