Browse Source

自提

master
jiazhipeng 6 months ago
parent
commit
a6d3c00b92
  1. 3
      app.json
  2. 2
      app.wxss
  3. 4
      pages/component/proRec/proRec.js
  4. 25
      pages/info/postProductInfo/index.js
  5. 21
      pages/info/postProductInfo/index.wxml
  6. 45
      pages/info/postProductInfo/index.wxss
  7. 2
      pages/order/components/address/index.wxml
  8. 4
      pages/order/components/address/index.wxss
  9. 27
      pages/order/orderList/index.js
  10. 34
      pages/order/orderList/index.wxml
  11. 3
      pages/order/orderList/index.wxss
  12. 255
      pages/order/postOrder/index.js
  13. 43
      pages/order/postOrder/index.wxml
  14. 59
      pages/order/postOrder/index.wxss
  15. 45
      pages/user/cartlist/list.js
  16. 7
      pages/user/cartlist/list.wxml
  17. 24
      pages/user/cartlist/list.wxss
  18. 146
      pages/user/order/postOrderInfo/index.js
  19. 111
      pages/user/order/postOrderInfo/index.wxml
  20. 49
      pages/user/order/postOrderInfo/index.wxss
  21. 25
      project.private.config.json
  22. 88
      subPackages/techanNew/index.js
  23. 30
      subPackages/techanNew/index.wxml
  24. 56
      subPackages/techanNew/index.wxss
  25. 152
      subPackages/techanNew/selfPickPoint/index.js
  26. 5
      subPackages/techanNew/selfPickPoint/index.json
  27. 35
      subPackages/techanNew/selfPickPoint/index.wxml
  28. 124
      subPackages/techanNew/selfPickPoint/index.wxss
  29. 4
      utils/https.js
  30. 1
      utils/util.js

3
app.json

@ -205,7 +205,8 @@
"feiyiNew/CGCTime/index", "feiyiNew/CGCTime/index",
"foodListNew/index", "foodListNew/index",
"foodNew/index", "foodNew/index",
"goods/memberCard/index" "goods/memberCard/index",
"techanNew/selfPickPoint/index"
] ]
}, },
{ {

2
app.wxss

@ -45,7 +45,7 @@ page{
position: relative; position: relative;
z-index: 1; z-index: 1;
width: 80%; width: 80%;
max-height: 1000rpx; max-height: 1200rpx;
background: white; background: white;
border-radius: 12rpx; border-radius: 12rpx;
overflow-y: auto; overflow-y: auto;

4
pages/component/proRec/proRec.js

@ -31,8 +31,8 @@ Component({
}, },
observers:{ observers:{
'ids': function(newVal,oldVal){ 'ids': function(newVal,oldVal){
console.log('newVal--------',newVal) // console.log('newVal--------',newVal)
console.log('oldVal--------',oldVal) // console.log('oldVal--------',oldVal)
if (newVal && this.data.tjList.length<=0) { if (newVal && this.data.tjList.length<=0) {
this.getTj(newVal) this.getTj(newVal)
} }

25
pages/info/postProductInfo/index.js

@ -45,6 +45,8 @@ Page({
sku: {min:0,max:0} sku: {min:0,max:0}
}, },
otherInfoShow: 0, otherInfoShow: 0,
user_type: null,
}, },
/** /**
@ -351,9 +353,18 @@ Page({
let index = e.currentTarget.dataset.index; let index = e.currentTarget.dataset.index;
this.setData({ this.setData({
skuIndex: index, 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 () { showOrder: function () {
commonApi.user_post('wx/get_user_keep', { commonApi.user_post('wx/get_user_keep', {
jumpurl: '/pages/info/postProductInfo/index?id=' + this.data.id, jumpurl: '/pages/info/postProductInfo/index?id=' + this.data.id,
@ -437,10 +448,20 @@ Page({
}else { }else {
type = '' 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", { commonApi.user_post("cart/add_sku", {
sku_id: this.data.info.sku[this.data.skuIndex].id, sku_id: this.data.info.sku[this.data.skuIndex].id,
num: this.data.producNum, num: this.data.producNum,
type:type type:type,
delivery_method: this.data.user_type
}).then(res => { }).then(res => {
if (res.code == 1) { if (res.code == 1) {
commonApi.user_post('cart/get_list', {}).then(res => { commonApi.user_post('cart/get_list', {}).then(res => {

21
pages/info/postProductInfo/index.wxml

@ -302,6 +302,27 @@
</view> </view>
</view> </view>
<view class="delivery-method" wx:if="{{info.is_package!=1}}">
<view class="delivery-title">配送方式</view>
<view class="flex" style="display: flex;">
<view class="flex-center" wx:if="{{info.sku[skuIndex].use_type!=1}}" bind:tap="changeSelectSkuPost" data-value="{{0}}">
<view class="select-cycle" wx:if="{{user_type!==0}}"></view>
<view class="select-cycle selected" wx:else>
<image src="https://static.ticket.sz-trip.com/uploads/20240715/a961604bc708670cbdc76d1580eb3f3c.png"></image>
</view>
<view class="method-str">邮寄</view>
</view>
<view class="flex-center" wx:if="{{info.sku[skuIndex].use_type!=0}}" bind:tap="changeSelectSkuPost" data-value="{{1}}">
<view class="select-cycle" wx:if="{{user_type!==1}}"></view>
<view class="select-cycle selected" wx:else="">
<image src="https://static.ticket.sz-trip.com/uploads/20240715/a961604bc708670cbdc76d1580eb3f3c.png"></image>
</view>
<view class="method-str">自提</view>
</view>
</view>
</view>
<view style="height:138rpx"></view> <view style="height:138rpx"></view>
<view class="btn-box"> <view class="btn-box">

45
pages/info/postProductInfo/index.wxss

@ -550,8 +550,7 @@ page {
flex-wrap: wrap; flex-wrap: wrap;
margin-bottom: 20rpx; margin-bottom: 20rpx;
justify-content: space-between; justify-content: space-between;
max-height: 800rpx; height: 400rpx;
min-height: 400rpx;
align-content: flex-start; align-content: flex-start;
} }
@ -1265,3 +1264,45 @@ color: #010101;
font-size: 27rpx; font-size: 27rpx;
color: #000000; color: #000000;
} }
.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;
}

2
pages/order/components/address/index.wxml

@ -1,4 +1,4 @@
<view class="box"> <view class="address-box">
<view class="box-title"> <view class="box-title">
<view style="flex:1">收货地址</view> <view style="flex:1">收货地址</view>
<view class="contact-add" bindtap="showLinkman" wx:if="{{selectLinkman}}"><text class="iconfont icon-add-select"></text>选择</view> <view class="contact-add" bindtap="showLinkman" wx:if="{{selectLinkman}}"><text class="iconfont icon-add-select"></text>选择</view>

4
pages/order/components/address/index.wxss

@ -49,8 +49,8 @@
flex-shrink: 0; flex-shrink: 0;
font-size: 37rpx; font-size: 37rpx;
} }
.box { .address-box {
margin: 30rpx 25rpx; margin: 30rpx 0rpx;
background: white; background: white;
border-radius: 9rpx; border-radius: 9rpx;
} }

27
pages/order/orderList/index.js

@ -9,6 +9,10 @@ Page({
data: { data: {
goodsList: [], goodsList: [],
ticketList: [], ticketList: [],
// 仅展示用,区分邮寄自提
postList: [],
pickUpList: [],
productPrice: 0, productPrice: 0,
ticketPrice: 0, ticketPrice: 0,
product:"", product:"",
@ -33,18 +37,18 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
this.setData({ this.setData({
goodsList: app.globalData.postProduct, goodsList: app.globalData.postProduct || [],
ticketList: app.globalData.list, ticketList: app.globalData.list || [],
kjId: app.globalData.kjId, kjId: app.globalData.kjId,
gp_id: app.globalData.gp_id || app.globalData.team_id, gp_id: app.globalData.gp_id || app.globalData.team_id,
flag:options.flag, flag:options.flag,
// showCoupon: (app.globalData.list || []).length<=0, // showCoupon: (app.globalData.list || []).length<=0,
// linkmanList: app.globalData.linkmanList // linkmanList: app.globalData.linkmanList
}) })
console.log('-------------',this.data.ticketList); console.log('-------------',this.data.ticketList, this.data.goodsList);
// debugger // debugger
let price = 0, sku_id = [] ,postFee= 0; let price = 0, sku_id = [] ,postFee= 0;
app.globalData.postProduct.map(item => { this.data.goodsList.map(item => {
try { try {
item.postFee = parseFloat(item.postFee) item.postFee = parseFloat(item.postFee)
} catch(e){ } catch(e){
@ -60,7 +64,7 @@ Page({
} }
sku_id.push(item.sku.id) 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.linkmanList.length;
price = price + item.sku.price * item.num; price = price + item.sku.price * item.num;
sku_id.push(item.sku.id) sku_id.push(item.sku.id)
@ -70,10 +74,23 @@ Page({
postFee:postFee, postFee:postFee,
sku_id: sku_id.join(",") sku_id: sku_id.join(",")
}) })
this.handlePostData()
if (!this.data.kjId && !this.data.gp_id) { if (!this.data.kjId && !this.data.gp_id) {
this.couponCom = this.selectAllComponents("#coupon")[0]; 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 (){ order: function (){
console.log(app.globalData.createDate); console.log(app.globalData.createDate);

34
pages/order/orderList/index.wxml

@ -1,6 +1,7 @@
<title title="订单列表"></title> <title title="订单列表"></title>
<view class="box" wx:if="{{goodsList.length != 0}}"> <!-- 邮寄 -->
<view class="goods-item" wx:for="{{goodsList}}" wx:key="index"> <view class="box" wx:if="{{postList.length != 0}}">
<view class="goods-item" wx:for="{{postList}}" wx:key="index">
<view class="item-box item-title"> <view class="item-box item-title">
<view>{{item.product.title}}</view> <view>{{item.product.title}}</view>
<view class="price">¥{{item.sku.price/100}}</view> <view class="price">¥{{item.sku.price/100}}</view>
@ -26,6 +27,31 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 自提 -->
<view class="box" wx:if="{{pickUpList.length != 0}}">
<view class="goods-item" wx:for="{{pickUpList}}" wx:key="index">
<view class="item-box item-title">
<view>{{item.product.title}}</view>
<view class="price">¥{{item.sku.price/100}}</view>
</view>
<view class="item-box">
<view>{{item.sku.sku_name}}</view>
<view>X{{item.productNum}}</view>
</view>
<view class="item-box item-title" style="padding-top: 27rpx;">自提信息</view>
<view style="padding: 10rpx;">
<view class="text"><view class="text-left">预留手机号:</view>{{item.phone}}</view>
<view class="text">
<view class="text-left">自提地址:</view>
<view>
<view>{{item.pickupAddress.title}}</view>
<view style="padding-top: 20rpx;">{{item.pickupAddress.address}}</view>
</view>
</view>
</view>
</view>
</view>
<!-- 门票 -->
<view class="box" wx:if="{{ticketList.length != 0}}"> <view class="box" wx:if="{{ticketList.length != 0}}">
<view class="goods-item" wx:for="{{ticketList}}" wx:key="index"> <view class="goods-item" wx:for="{{ticketList}}" wx:key="index">
<view class="item-box item-title"> <view class="item-box item-title">
@ -37,7 +63,7 @@
<view>X{{item.num}}</view> <view>X{{item.num}}</view>
</view> </view>
<view class="item-box item-title" style="padding-top: 27rpx;">出行人信息</view> <view class="item-box item-title" style="padding-top: 27rpx;">出行人信息</view>
<view wx:if="{{item.sku.sku_model.is_authentication}}"> <view style="padding: 10rpx;" wx:if="{{item.sku.sku_model.is_authentication}}">
<view wx:for="{{item.linkmanList}}" style="padding-left: 10rpx;" wx:for-item="items"> <view wx:for="{{item.linkmanList}}" style="padding-left: 10rpx;" wx:for-item="items">
<view> <view>
<view class="text"><view class="text-left">姓名:</view>{{items.name}}</view> <view class="text"><view class="text-left">姓名:</view>{{items.name}}</view>
@ -46,7 +72,7 @@
</view> </view>
</view> </view>
</view> </view>
<view wx:else> <view style="padding: 10rpx;" wx:else>
<view class="text"><view class="text-left">手机号:</view>{{item.phone}}</view> <view class="text"><view class="text-left">手机号:</view>{{item.phone}}</view>
</view> </view>
</view> </view>

3
pages/order/orderList/index.wxss

@ -66,6 +66,9 @@ page{
font-size: 27rpx; font-size: 27rpx;
color: #666666; color: #666666;
} }
.text .text-left{
flex-shrink: 0;
}
.goods-item{ .goods-item{

255
pages/order/postOrder/index.js

@ -7,6 +7,9 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
pageUseType: 0, // 0 邮寄 1 自提 3邮寄或自提 购物车用 不考虑3
allProduct: [],
product: [], product: [],
showPrice: 0, showPrice: 0,
from: null, from: null,
@ -23,7 +26,9 @@ Page({
showAllowance: false, showAllowance: false,
flag:null, flag:null,
isCar:'single', isCar:'single',
showYhq:null showYhq:null,
pickupIndex: null,
}, },
/** /**
@ -39,28 +44,80 @@ Page({
isCar:options.isCar, isCar:options.isCar,
showYhq:app.globalData.listName?false:true showYhq:app.globalData.listName?false:true
}) })
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;
// 用户选择的配送方式
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 = []; let price = 0, sku_id = [];
app.globalData.postProduct.map(item => { this.data.product.forEach(item=>{
if (!app.globalData.kjId && !this.data.gp_id) { if (!app.globalData.kjId && !this.data.gp_id) {
price = price + item.sku.price * item.productNum; price = price + item.sku.price * item.productNum;
} }
else if (this.data.gp_id) { else if (this.data.gp_id) {
price = price + item.sku.event_price * item.productNum; price = price + item.sku.event_price * item.productNum;
} }
item.sku.batch_shipment = item.sku.batch_shipment?item.sku.batch_shipment:0;
sku_id.push(item.sku.id) sku_id.push(item.sku.id)
}) })
this.setData({ this.setData({
product: app.globalData.postProduct,
showPrice: app.globalData.kjId ? 0 : price, showPrice: app.globalData.kjId ? 0 : price,
sku_id: sku_id.join(",") sku_id: sku_id.join(","),
}) })
console.log(this.data.product)
if (!this.data.kjId && !this.data.gp_id) { 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() { price() {
let allPrice let allPrice
if (this.data.coupon) { if (this.data.coupon) {
@ -83,6 +140,23 @@ Page({
product: product 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) { setAddress: function (e) {
console.log('我触发了'); console.log('我触发了');
this.setData({ this.setData({
@ -90,6 +164,31 @@ Page({
}) })
this.getPostFee() 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) { minus: function (e) {
let index = e.currentTarget.dataset.index, product = this.data.product; let index = e.currentTarget.dataset.index, product = this.data.product;
let productNum = product[index].productNum; let productNum = product[index].productNum;
@ -140,27 +239,80 @@ Page({
}) })
}, },
order: function () { order: function () {
for(let info of this.data.product) {
if (info.user_select_type == 0) {
if (!this.data.address) { if (!this.data.address) {
wx.showToast({ wx.showToast({title: '请选择收货地址',icon: 'none'});
title: '请选择收货地址!',
icon: 'none'
})
return; return;
} }
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) 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 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 = { let data = {
source: "WECHATXCX", source: "WECHATXCX",
product_list: product_list, product_list: product_list,
@ -189,8 +341,19 @@ Page({
data.partner_code = ZTPointProduct.product.ZTPoint data.partner_code = ZTPointProduct.product.ZTPoint
data.channel = 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){ 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", { commonApi.user_post("order/create", {
data: JSON.stringify(data) data: JSON.stringify(data)
}).then(res => { }).then(res => {
@ -199,14 +362,14 @@ Page({
this.setData({ this.setData({
kjId: null kjId: null
}) })
this.onLoad({}) // this.onLoad({})
} }
app.globalData.gp_id = null; app.globalData.gp_id = null;
app.globalData.team_id = null; app.globalData.team_id = null;
this.setData({ this.setData({
gp_id: null gp_id: null
}) })
this.onLoad({}); // this.onLoad({});
}) })
}else{ }else{
app.globalData.productPrice = (this.data.showPrice + this.data.postFee - (this.data.coupon?this.data.coupon.activity.money:0))/100; app.globalData.productPrice = (this.data.showPrice + this.data.postFee - (this.data.coupon?this.data.coupon.activity.money:0))/100;
@ -222,7 +385,39 @@ Page({
}, },
getPostFee: function () { getPostFee: function () {
if (!this.data.address) return; 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 => { product.map(item => {
list.push(commonApi.user_post("order/get_post_price", { list.push(commonApi.user_post("order/get_post_price", {
sku_id: item.sku.id, sku_id: item.sku.id,
@ -268,9 +463,13 @@ Page({
coupon: null coupon: null
}) })
} }
for(let i=0;i<indexList.length;i++) {
this.data.product[indexList[i]] = product[i]
}
this.setData({ this.setData({
postFee: postFee, postFee: postFee,
product: product product: this.data.product
}) })
}) })
}, },

43
pages/order/postOrder/index.wxml

@ -1,7 +1,41 @@
<!--pages/order/post/index.wxml--> <!--pages/order/post/index.wxml-->
<title title="订单填写"></title> <title title="订单填写"></title>
<address bind:setAddress="setAddress"></address>
<view class="box topbox" wx:for="{{product}}"> <view class="box topbox" wx:for="{{product}}" wx:key="index">
<!-- 选择配送方式 -->
<view class="sendwayArea" wx:if="{{from!='cart'}}">
<view class="sendway-item {{item.user_select_type==0?'active':''}}" wx:if="{{item.sku.use_type==0||item.sku.use_type==3}}"
bind:tap="changeUserPost" data-item="{{item}}" data-value="{{0}}" data-index="{{index}}">邮寄</view>
<view class="sendway-item {{item.user_select_type==1?'active':''}}" wx:if="{{item.sku.use_type==1||item.sku.use_type==3}}"
bind:tap="changeUserPost" data-item="{{item}}" data-value="{{1}}" data-index="{{index}}">自提</view>
</view>
<address bind:setAddress="setAddress" wx:if="{{index==0&&item.user_select_type==0}}"></address>
<view class="pickup-container" wx:if="{{item.user_select_type==1}}">
<view bind:tap="changePickup" data-index="{{index}}" data-item="{{item}}" class="box-title">
<view style="flex-shrink:0" >自提点</view>
<view class="flex-1 textOver">
<text wx:if="{{!item.pickupAddress}}" style="color: #666666;">选择提货地址</text>
<text wx:else>{{item.pickupAddress.title}}</text>
</view>
<image lazy-load class="cha"
src="https://static.ticket.sz-trip.com/uploads/20251028/7b4c134eef979fb0540205d18e168ae1.png" mode=""/>
</view>
<view class="box-title">
<view style="flex-shrink:0" >预留手机号</view>
<view class="flex-1">
<input bindinput="phoneInput" type="number" value="{{item.phone}}" data-item="{{item}}"
data-index="{{index}}" class="weui-input" placeholder="请输入手机号" />
</view>
<image lazy-load class="cha" bindtap="delTel" wx:if="{{item.phone}}" data-index="{{index}}"
src="https://static.ticket.sz-trip.com/jundaosuzhou/images/scenicNew/cha.png" mode=""/>
<view class="cha" v-else></view>
</view>
</view>
<view class="sku-info-container">
<view class="header-title textOver" wx:if="{{from=='cart'}}"> <view class="header-title textOver" wx:if="{{from=='cart'}}">
供应商:{{item.product.supplier_name}} 供应商:{{item.product.supplier_name}}
</view> </view>
@ -44,7 +78,7 @@
</view> </view>
</view> </view>
<view class="box-title" style="height:auto;min-height:113rpx;"> <view class="box-title" style="height:auto;min-height:113rpx;" wx:if="{{item.user_select_type==0}}">
<view style="flex:1;white-space:nowrap;margin-right:20rpx;">运费</view> <view style="flex:1;white-space:nowrap;margin-right:20rpx;">运费</view>
<view style="display: flex;"> <view style="display: flex;">
<!-- <text>{{item.postFee?(item.postFee==0?'包邮':("¥"+(item.postFee/100))):item.sku.sku_model.post_template_name}}</text> --> <!-- <text>{{item.postFee?(item.postFee==0?'包邮':("¥"+(item.postFee/100))):item.sku.sku_model.post_template_name}}</text> -->
@ -55,7 +89,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="box-title" wx:if="{{flag!='mix'}}"> <view class="box-title" style="border-bottom: {{from=='cart'?1:0}}px solid #ccc;" wx:if="{{flag!='mix'}}">
<view style="flex-shrink:0" >订单备注:</view> <view style="flex-shrink:0" >订单备注:</view>
<input type="text" bindinput="inputRemark" data-index="{{index}}" placeholder="选填"></input> <input type="text" bindinput="inputRemark" data-index="{{index}}" placeholder="选填"></input>
</view> </view>
@ -65,6 +99,7 @@
<text class="s-price" wx:else>{{(item.sku.price * item.productNum + item.postFee || 0) /100}}</text> <text class="s-price" wx:else>{{(item.sku.price * item.productNum + item.postFee || 0) /100}}</text>
</view> </view>
</view>
<!-- 补贴 --> <!-- 补贴 -->
<view class="box-title allowance" wx:if="{{allowance_price}}"> <view class="box-title allowance" wx:if="{{allowance_price}}">
<view bindtap="changeAllowance">惠民补贴</view> <view bindtap="changeAllowance">惠民补贴</view>

59
pages/order/postOrder/index.wxss

@ -3,10 +3,34 @@ page {
background: #f6f6f6; 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 { .box {
margin: 30rpx 25rpx; margin: 30rpx 25rpx;
background: white;
border-radius: 9rpx;
} }
.box-title { .box-title {
@ -19,6 +43,30 @@ page {
align-items: center; 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 { .allowance {
justify-content: space-between; justify-content: space-between;
} }
@ -56,7 +104,6 @@ page {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding: 30rpx 20rpx; padding: 30rpx 20rpx;
margin-bottom: 30rpx;
} }
.skuinfo image { .skuinfo image {
@ -129,10 +176,6 @@ page {
height: 1rpx; height: 1rpx;
} }
.topbox .box-title {
border-top: 1rpx solid #ccc;
}
.box-title input { .box-title input {
flex: 1; flex: 1;
display: block; display: block;
@ -187,7 +230,7 @@ page {
font-size: 27rpx; font-size: 27rpx;
height: 80rpx; height: 80rpx;
align-items: center; align-items: center;
border-top: 1rpx solid #ccc; /* border-top: 1rpx solid #ccc; */
color: #000; color: #000;
} }

45
pages/user/cartlist/list.js

@ -67,6 +67,15 @@ Page({
limit:999, limit:999,
}).then(res => { }).then(res => {
let resData = this.data.list.concat((res.data || [])) 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({ this.setData({
list: resData list: resData
}) })
@ -143,7 +152,7 @@ Page({
}, },
changeNumber(item) { changeNumber(item) {
commonApi.user_post("cart/update_sku", { commonApi.user_post("cart/update_sku", {
sku_id: item.sku.id, id: item.id,
num: item.num num: item.num
}).then(res => { }) }).then(res => { })
}, },
@ -160,6 +169,8 @@ Page({
}) })
}, },
order: function () { order: function () {
commonApi.user_post('wx/get_user_keep', { commonApi.user_post('wx/get_user_keep', {
jumpurl: '/pages/user/cartlist/list', jumpurl: '/pages/user/cartlist/list',
title: '购物车', title: '购物车',
@ -179,13 +190,15 @@ Page({
price = 0, price = 0,
product = [], product = [],
product1 = [] product1 = []
list.map(item => { list.map((item,index) => {
if (item.checked) { if (item.checked) {
// item.product.type="post"; // item.product.type="post";
if (item.product.type == 'post') { if (item.product.type == 'post') {
product.push({ product.push({
product: item.product, 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 productNum: item.num
}) })
} else { } else {
@ -205,14 +218,32 @@ Page({
return; 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) { if (product.length > 0 && product1.length > 0) {
this.setData({ this.setData({
flag: 'mix', flag: 'mix',
isCar: 'multiple' isCar: 'multiple'
}) })
} }
if (product1.length > 1) { if (product1.length > 1) {
this.setData({ this.setData({
isCar: 'multiple' isCar: 'multiple'
@ -330,7 +361,7 @@ Page({
let index = e.currentTarget.dataset.index, let index = e.currentTarget.dataset.index,
list = this.data.list; list = this.data.list;
commonApi.user_post("cart/del_sku", { commonApi.user_post("cart/del_sku", {
sku_id: list[index].sku_id id: list[index].id
}).then(res => { }).then(res => {
if (res.code == 1) { if (res.code == 1) {
wx.showToast({ wx.showToast({
@ -350,7 +381,7 @@ Page({
let suid = [] let suid = []
arr.forEach(item => { arr.forEach(item => {
if (item.checked) { if (item.checked) {
suid.push(item.sku_id) suid.push(item.id)
} }
}); });
let skuids = suid.join(',') let skuids = suid.join(',')
@ -360,7 +391,7 @@ Page({
success: function (res) { success: function (res) {
if (res.confirm) { if (res.confirm) {
commonApi.user_post("cart/del_sku", { commonApi.user_post("cart/del_sku", {
sku_id: skuids id: skuids
}).then(res => { }).then(res => {
if (res.code == 1) { if (res.code == 1) {
wx.showToast({ wx.showToast({

7
pages/user/cartlist/list.wxml

@ -5,7 +5,12 @@
<view wx:for="{{list}}" class="goods-item {{item.isTouchMove ? 'touch-move-active' : ''}}" bindtouchstart='touchStart' bindtouchmove='touchmove' data-index="{{index}}"> <view wx:for="{{list}}" class="goods-item {{item.isTouchMove ? 'touch-move-active' : ''}}" bindtouchstart='touchStart' bindtouchmove='touchmove' data-index="{{index}}">
<view class="item{{(item.product.flag!=1 || item.sku.flag!='on')?' disable':''}}"> <view class="item{{(item.product.flag!=1 || item.sku.flag!='on')?' disable':''}}">
<view class="iconfont{{item.checked?' icon-gou':' icon-quan'}}" bindtap="select" data-index="{{index}}"></view> <view class="iconfont{{item.checked?' icon-gou':' icon-quan'}}" bindtap="select" data-index="{{index}}"></view>
<image lazy-load src="{{item.sku.headimg}}" mode="aspectFill" bindtap="gotoDetail" data-item="{{item}}"></image> <view class="img-container" bindtap="gotoDetail" data-item="{{item}}">
<image lazy-load src="{{item.sku.headimg}}" mode="aspectFill" ></image>
<view class="use-type" wx:if="{{item.delivery_method===0||item.delivery_method===1}}">
{{item.delivery_method===1?"自提":"邮寄"}}
</view>
</view>
<view class="item-info textOver"> <view class="item-info textOver">
<view class="title textOver">{{item.product.title}}</view> <view class="title textOver">{{item.product.title}}</view>
<view class="sku-title textOver"> <view class="sku-title textOver">

24
pages/user/cartlist/list.wxss

@ -58,12 +58,34 @@ page {
flex-shrink: 0; flex-shrink: 0;
font-size: 40rpx; font-size: 40rpx;
} }
.item image { .item .img-container{
margin: 0 25rpx; margin: 0 25rpx;
flex-shrink: 0; flex-shrink: 0;
width: 173rpx; width: 173rpx;
height: 173rpx; height: 173rpx;
border-radius: 7rpx; 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 { .item-info {
flex: 1; flex: 1;

146
pages/user/order/postOrderInfo/index.js

@ -10,6 +10,8 @@ Page({
*/ */
data: { data: {
info:null, info:null,
isPickup: false, // 是否自提
orderState:app.globalData.orderState, orderState:app.globalData.orderState,
productState:app.globalData.productState, productState:app.globalData.productState,
product_model:null, product_model:null,
@ -17,6 +19,7 @@ Page({
feeInfoFlag:false, feeInfoFlag:false,
codeIndex:0, codeIndex:0,
codeImgs:[], codeImgs:[],
imgLen: [],
minute:"", minute:"",
second:"", second:"",
id:null, id:null,
@ -99,23 +102,37 @@ Page({
}) })
}, },
getCodeImg:function(){ getCodeImg:function(){
let code = "111"; let that = this,sys =wx.getSystemInfoSync(),radio = sys.screenWidth / 750,
let that = this,sys =wx.getSystemInfoSync(),radio = sys.screenWidth / 750,qrcode=this.data.info.order_product_list[0].qrcode,codeImgs=[]; qrcode=this.data.info.order_product_list[0].qrcode,codeImgs=[],codeId=0,arr = [];
qrcode.map((item,index)=>{
new QRCode('damocode'+index,{ 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
})
}
else {
new QRCode('damocode'+codeId,{
text: item.use_code, text: item.use_code,
width: 300 * radio, width: 300 * radio,
height: 300 * radio, height: 300 * radio,
padding: 12, // 生成二维码四周自动留边宽度,不传入默认为0 padding:10, // 生成二维码四周自动留边宽度,不传入默认为0
correctLevel: QRCode.CorrectLevel.L, // 二维码可辨识度 correctLevel: QRCode.CorrectLevel.H, // 二维码可辨识度
callback: (res) => { callback: (res) => {
codeImgs.push(res.path); 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});
if(codeImgs.length==qrcode.length){
that.setData({ that.setData({
codeImgs:codeImgs codeImgs:codeImgs
}) })
} }
console.log(res) })
codeId = codeId + 1
} }
}) })
}) })
@ -318,8 +335,28 @@ getInfo () {
order.consignee_info = order.consignee_info?JSON.parse(order.consignee_info):null; order.consignee_info = order.consignee_info?JSON.parse(order.consignee_info):null;
state = state + order.state; state = state + order.state;
order.contacts_info = order.contacts_info?JSON.parse(order.contacts_info):[] 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 cardPostList = [];
let isCard= false; let isCard= false;
@ -340,9 +377,10 @@ getInfo () {
} }
}) })
} }
console.log(res.data, 'aaa')
this.setData({ this.setData({
isRefund:state.indexOf("REFUND")!=-1, isRefund:state.indexOf("REFUND")!=-1,
isPickup: res.data.order_product_list.some(v=>v.pickup_shop_id>0),
info:res.data, info:res.data,
product_model:res.data.order_product_list[0].product_model, product_model:res.data.order_product_list[0].product_model,
ids: proId.join(","), ids: proId.join(","),
@ -372,78 +410,30 @@ getInfo () {
util.gotoDetail(item); 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 () { onShow: function () {
commonApi.user_post("order/query",{ this.getInfo()
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()
})
}, },
/** /**

111
pages/user/order/postOrderInfo/index.wxml

@ -2,8 +2,9 @@
<wxs src="../../../../utils/filter.wxs" module="tool" /> <wxs src="../../../../utils/filter.wxs" module="tool" />
<title title="订单详情"></title> <title title="订单详情"></title>
<view class="top-bg"></view> <view class="top-bg"></view>
<canvas wx:for="{{imgLen}}" wx:key="index" class="code-img" style="position:absolute;z-index:-1;" canvas-id="damocode{{index}}"></canvas>
<view class="state-text" wx:if="{{info}}">{{info.state_text}}</view> <view class="state-text" wx:if="{{info}}">{{info.state_text}}</view>
<view class="box" wx:if="{{info}}" style="color:#333"> <view class="box" wx:if="{{info&&!isPickup}}" style="color:#333">
<view class="scene-box-left" wx:if="{{info.state=='REFUND'}}" style="width:100%">您的退款已成功,退款金额预计在1-7个工作日内退还到您支付的账户</view> <view class="scene-box-left" wx:if="{{info.state=='REFUND'}}" style="width:100%">您的退款已成功,退款金额预计在1-7个工作日内退还到您支付的账户</view>
<view class="scene-box-left" wx:elif="{{info.state=='WAIT_REFUND'}}" style="width:100%">您已成功发起退款申请,请耐心等待</view> <view class="scene-box-left" wx:elif="{{info.state=='WAIT_REFUND'}}" style="width:100%">您已成功发起退款申请,请耐心等待</view>
<view class="scene-box-left" wx:elif="{{info.state=='UNPAID'}}" style="width:100%">请在00:{{minute}}:{{second}}内支付,逾期订单将自动取消</view> <view class="scene-box-left" wx:elif="{{info.state=='UNPAID'}}" style="width:100%">请在00:{{minute}}:{{second}}内支付,逾期订单将自动取消</view>
@ -13,6 +14,25 @@
<view style="font-size:26rpx;color:#333;line-height:50rpx"><text style="color:#0B898E;margin-right:10rpx" class="iconfont icon-location"></text>{{info.order_product_list[0].consignee_info.address}}</view> <view style="font-size:26rpx;color:#333;line-height:50rpx"><text style="color:#0B898E;margin-right:10rpx" class="iconfont icon-location"></text>{{info.order_product_list[0].consignee_info.address}}</view>
</view> </view>
<view class="code-box box" wx:if="{{info && isPickup && codeImgs.length>0}}">
<!-- <view bindtap="prevCodeImg" class="iconfont icon-you-copy"></view> -->
<view wx:for="{{codeImgs}}" wx:if="{{index==codeIndex}}" style="position: relative;" wx:key="index">
<image lazy-load src="{{item.img}}" mode="widthFix" style="width:300rpx;height: 300rpx;"></image>
<!-- 代表核销后是否继续展示二维码(0否1是) -->
<view class="text-shadow" wx:if="{{item.is_force_display_code != 1 && item.flag != 0}}">
<view class="text-shadow-state">
{{item.state}}
</view>
</view>
</view>
<!-- <view bindtap="nextCodeImg" class="iconfont icon-you"></view> -->
<view class="code-text">
核销码:{{codeImgs[codeIndex].code}}
<!-- <view class="copy-box" data-num="{{codeImgs[codeIndex].code}}" bindtap="copy">复制</view> -->
</view>
<!-- <view class="code-state">{{codeImgs[codeIndex].state}} {{codeIndex+1}}/{{codeImgs.length}}</view> -->
</view>
<view class="box" wx:if="{{info && info.order_product_list && info.order_product_list.length>0}}" <view class="box" wx:if="{{info && info.order_product_list && info.order_product_list.length>0}}"
wx:for="{{info.order_product_list}}"> wx:for="{{info.order_product_list}}">
<view> <view>
@ -30,12 +50,16 @@
</view> </view>
<view class="product-state">{{item.state_text}}</view> <view class="product-state">{{item.state_text}}</view>
</view> </view>
<view class="detail-item">
<view >
<view wx:if="{{isPickup}}" class="detail-item"><text>收货方式:</text><text>自提</text></view>
<view wx:else class="detail-item">
<text>收货方式:</text> <text>收货方式:</text>
<text wx:if="{{item.is_batch_shipment==1}}">分批收货 (共{{item.batch_count}}次)</text> <text wx:if="{{item.is_batch_shipment==1}}">分批收货 (共{{item.batch_count}}次)</text>
<text wx:else>一次性收货</text> <text wx:else>一次性收货</text>
</view> </view>
<view class="detail-item"> <!-- <view class="detail-item">
<text>运费:</text> <text>运费:</text>
<view> <view>
<text style="padding-right: 56rpx;" wx:if="{{item.post_fee&&item.is_batch_shipment==1}}">¥{{item.post_fee/item.batch_count/100}} x{{info.order_product_list[0].batch_count}}</text> <text style="padding-right: 56rpx;" wx:if="{{item.post_fee&&item.is_batch_shipment==1}}">¥{{item.post_fee/item.batch_count/100}} x{{info.order_product_list[0].batch_count}}</text>
@ -45,9 +69,31 @@
<view class="detail-item"> <view class="detail-item">
<text>小计:</text> <text>小计:</text>
<text>¥{{item.paid_money/100}}</text> <text>¥{{item.paid_money/100}}</text>
</view> </view> -->
<!-- <view wx:if="{{item.post_detail_list.length>0}}"> --> <!-- <view wx:if="{{item.post_detail_list.length>0}}"> -->
<view class="detail-item">
<text>商品总价:</text>
<text>¥{{info.total_money/100}}</text>
</view>
<view class="detail-item" wx:if="{{!isPickup}}">
<text>运费:</text>
<view>
<text style="padding-right: 56rpx;" wx:if="{{info.total_post_fee&&info.order_product_list[0].is_batch_shipment==1}}">¥{{info.total_post_fee/info.order_product_list[0].batch_count/100}} x{{info.order_product_list[0].batch_count}}</text>
<text>{{info.total_post_fee?("¥"+info.total_post_fee/100):"包邮"}}</text>
</view>
</view>
<view class="detail-item" wx:if="{{info.preference_money}}" >
<text>优惠券:</text>
<text>-¥{{info.preference_money/100}}</text>
</view>
<view class="detail-item">
<text>实付款</text>
<view class="price">¥{{info.paid_money/100}}</view>
</view>
<view style="border-top: 1px solid #ccc;margin-top: 12rpx;padding-top: 12rpx;" <view style="border-top: 1px solid #ccc;margin-top: 12rpx;padding-top: 12rpx;"
wx:if="{{item.is_batch_shipment==1 || (item.is_batch_shipment==0&&item.post_detail_list.length>=1)}}"> wx:if="{{item.is_batch_shipment==1 || (item.is_batch_shipment==0&&item.post_detail_list.length>=1)}}">
<view class="box-title" style="position: relative;"> <view class="box-title" style="position: relative;">
@ -111,7 +157,7 @@
</view> </view>
</view> </view>
<view style="border-top: 1px solid #ccc;margin-top: 12rpx;padding-top: 12rpx;"> <view style="border-top: 1px solid #ccc;margin-top: 12rpx;padding-top: 12rpx;" wx:if="{{!isPickup}}">
<view class="box-title" style="position: relative;"> <view class="box-title" style="position: relative;">
使用说明 使用说明
<text bind:tap="expandMsg" data-index="{{index}}" class="expand-tip"> <text bind:tap="expandMsg" data-index="{{index}}" class="expand-tip">
@ -120,6 +166,8 @@
</view> </view>
<rich-text class="detail-item {{item.showMsg?'':'textOver2'}}" style="display:-webkit-box;padding-bottom: 0;height: auto;" nodes="{{tool.formateRichText(item.sku_model.bookinfo)}}"></rich-text> <rich-text class="detail-item {{item.showMsg?'':'textOver2'}}" style="display:-webkit-box;padding-bottom: 0;height: auto;" nodes="{{tool.formateRichText(item.sku_model.bookinfo)}}"></rich-text>
</view> </view>
</view>
<view style="border-top: 1px solid #ccc;margin-top: 12rpx;padding-top: 12rpx;" wx:if="{{isCard&&cardPostList.length>0}}"> <view style="border-top: 1px solid #ccc;margin-top: 12rpx;padding-top: 12rpx;" wx:if="{{isCard&&cardPostList.length>0}}">
<view class="box-title" style="position: relative;"> <view class="box-title" style="position: relative;">
@ -174,29 +222,46 @@
</view> </view>
</view> </view>
<view class="box" wx:if="{{info}}"> <view class="box" wx:if="{{info && isPickup}}">
<view class="box-title">订单信息</view> <view class="box-title">自提信息</view>
<view class="detail-item">
<text>商品总价:</text> <view class="mask-shop-info">
<text>¥{{info.total_money/100}}</text> <view class="shop-info-item">
</view> <image class="start-icon" src="https://static.ticket.sz-trip.com/uploads/20251029/c84b0c0c8d99504a059b7e41035da67c.png"></image>
<view class="detail-item"> <view>预留手机号:{{info.order_product_list[0].phone}}</view>
<text>运费:</text> </view>
<view> <view class="shop-info-item" style="justify-content: space-between;">
<text style="padding-right: 56rpx;" wx:if="{{info.total_post_fee&&info.order_product_list[0].is_batch_shipment==1}}">¥{{info.total_post_fee/info.order_product_list[0].batch_count/100}} x{{info.order_product_list[0].batch_count}}</text> <image class="start-icon" src="https://static.ticket.sz-trip.com/uploads/20251029/a49d29cb9ad295752f298d7240fea88b.png"></image>
<text>{{info.total_post_fee?("¥"+info.total_post_fee/100):"包邮"}}</text> <view style="flex: 1;width: 100rpx;">
<view>{{info.order_product_list[0].pickupShop.title}}</view>
<view class="subtitle">{{info.order_product_list[0].pickupShop.address}}</view>
<!-- <view class="subtitle" wx:if="{{info.order_product_list[0].supplier_info.distance>0}}">据您约{{info.order_product_list[0].supplier_info.distance}}km</view> -->
</view>
<view style="display: flex;flex-direction: column;align-items: center;padding-left: 40rpx;"
catch:tap="callPhone" data-item="{{info.order_product_list[0]}}">
<image class="icon-phone" src="https://static.ticket.sz-trip.com/uploads/20250926/6d69afa7a2f955f60fd7cd5475e2b119.png"></image>
<view style="font-size: 24rpx;color: #666666;margin-top: 14rpx;font-weight: 500;">电话</view>
</view> </view>
<view style="display: flex;flex-direction: column;align-items: center;padding-left: 40rpx;"
catch:tap="gotolocation" data-item="{{info.order_product_list[0]}}">
<image class="icon-phone" src="https://static.ticket.sz-trip.com/uploads/20250926/6ce5e0467e0745e5f1140b6757ada213.png"></image>
<view style="font-size: 24rpx;color: #666666;margin-top: 14rpx;font-weight: 500;">导航</view>
</view> </view>
<view class="detail-item" wx:if="{{info.preference_money}}" >
<text>优惠券:</text>
<text>-¥{{info.preference_money/100}}</text>
</view> </view>
<view class="detail-item">
<text>实付款</text>
<view class="price">¥{{info.paid_money/100}}</view>
</view> </view>
<view style="border-top:1rpx solid #ccc;margin: 12rpx 0;"></view> </view>
<view class="box" wx:if="{{info}}">
<view class="box-title">订单信息</view>
<!-- <view style="border-top:1rpx solid #ccc;margin: 12rpx 0;"></view> -->
<view class="detail-item"> <view class="detail-item">
<text>订单编号:</text> <text>订单编号:</text>

49
pages/user/order/postOrderInfo/index.wxss

@ -16,6 +16,18 @@ page {
color: #fff; color: #fff;
font-size: 48rpx; 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 { .box {
padding: 20rpx; padding: 20rpx;
background: white; background: white;
@ -203,7 +215,7 @@ page {
} }
.code-box { .code-box {
text-align: center; text-align: center;
height: 530rpx; min-height: 340rpx;
position: relative; position: relative;
} }
.code-box .iconfont { .code-box .iconfont {
@ -240,6 +252,8 @@ page {
font-size: 30rpx; font-size: 30rpx;
font-weight: 500; font-weight: 500;
margin: 25rpx; margin: 25rpx;
display: flex;
justify-content: center;
} }
.code-btn { .code-btn {
width: 220rpx; width: 220rpx;
@ -440,3 +454,36 @@ color: #333333;
height: 100%; height: 100%;
border-radius: 50%; 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;
}

25
project.private.config.json

@ -6,12 +6,33 @@
"condition": { "condition": {
"miniprogram": { "miniprogram": {
"list": [ "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", "name": "subPackages/goods/memberCard/index",
"pathName": "subPackages/goods/memberCard/index", "pathName": "subPackages/goods/memberCard/index",
"query": "id=464704", "query": "id=464704",
"scene": null, "launchMode": "default",
"launchMode": "default" "scene": null
}, },
{ {
"name": "subPackages/foodListNew/index", "name": "subPackages/foodListNew/index",

88
subPackages/techanNew/index.js

@ -52,7 +52,9 @@ Page({
seachFlag:false, //搜索模式 seachFlag:false, //搜索模式
totalPrice:0, //获取购物车总价--打开购物车后勾选的产品价格 totalPrice:0, //获取购物车总价--打开购物车后勾选的产品价格
name:'文创特产', name:'文创特产',
nowAddListId:[] nowAddListId:[],
user_type: null,
}, },
/** /**
@ -87,10 +89,10 @@ Page({
delAll() { delAll() {
let ids = [] let ids = []
this.data.gwcList.forEach(item => { this.data.gwcList.forEach(item => {
ids.push(item.sku_id) ids.push(item.id)
}) })
commonApi.user_post("cart_within/del_sku", { commonApi.user_post("cart_within/del_sku", {
sku_id: ids+'', id: ids+'',
type:'1' type:'1'
}).then(res => { }).then(res => {
if (res.code == 1) { if (res.code == 1) {
@ -107,11 +109,12 @@ Page({
}, },
// 减少一个 // 减少一个
del(e) { del(e) {
let item = e.currentTarget.dataset.item let item = e.currentTarget.dataset.item;
let gwcList = this.data.gwcList let gwcList = this.data.gwcList;
let valueNum = e.currentTarget.dataset.value
commonApi.user_post("cart_within/update_sku", { commonApi.user_post("cart_within/update_sku", {
num:item.num-1, num:item.num + valueNum,
sku_id: item.sku_id, id: item.id,
type:'1' type:'1'
}).then(res => { }).then(res => {
if (res.code == 1) { if (res.code == 1) {
@ -134,6 +137,9 @@ Page({
if (item.selected ==1) { if (item.selected ==1) {
totalPrice += item.num*item.sku.price 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) let status = res.data.every(el => el.selected === 1)
@ -149,6 +155,14 @@ Page({
}, },
// 添加产品到购物车 // 添加产品到购物车
addCart: function (e) { addCart: function (e) {
if (![0,1].includes(this.data.user_type)) {
wx.showToast({
title: "请选择配送方式",
icon:"none"
})
return
}
let item = e.currentTarget.dataset.item let item = e.currentTarget.dataset.item
app.globalData.postProduct = [] app.globalData.postProduct = []
app.globalData.list = [] app.globalData.list = []
@ -161,7 +175,8 @@ Page({
commonApi.user_post("cart_within/add_sku", { commonApi.user_post("cart_within/add_sku", {
sku_id: this.data.showPopup ? item.sku.id :this.data.info.sku[this.data.skuIndex].id, sku_id: this.data.showPopup ? item.sku.id :this.data.info.sku[this.data.skuIndex].id,
num: this.data.producNum, num: this.data.producNum,
type:"1" type:"1",
delivery_method: this.data.user_type
}).then(res => { }).then(res => {
if (res.code == 1) { if (res.code == 1) {
let sku_id = this.data.showPopup ? item.sku.id :this.data.info.sku[this.data.skuIndex].id 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) { if (element.selected == 1) {
totalPrice += Number(element.num*element.sku.price) 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); console.log(res.data);
let status = res.data.every(el => el.selected === 1) let status = res.data.every(el => el.selected === 1)
@ -261,7 +279,7 @@ Page({
if (item.product.type == 'post') { if (item.product.type == 'post') {
product.push({ product.push({
product: item.product, product: item.product,
sku: item.sku, sku: {...item.sku, use_type: item.delivery_method||0},
productNum: item.num productNum: item.num
}) })
} else { } else {
@ -280,21 +298,26 @@ Page({
// }) // })
return; return;
} }
if (product.length > 0 && product1.length > 0) { let postSkuIds = product.map(x=>x.sku.id)
this.setData({ if(postSkuIds.some(x=>postSkuIds.filter(v=>v==x).length>1)) {
flag: 'mix', wx.showToast({
isCar: 'multiple' 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"
} }
if (product1.length > 1) {
this.setData({
isCar: 'multiple'
})
} else {
this.setData({ this.setData({
isCar: 'single' flag: flag,
isCar: isCar
}) })
}
console.log(product1); console.log(product1);
app.globalData.postProduct = product; app.globalData.postProduct = product;
if (app.globalData.list) { if (app.globalData.list) {
@ -414,14 +437,12 @@ Page({
}, },
// 获取历史购物车详情 // 获取历史购物车详情
getCount() { getCount() {
// debugger
commonApi.user_post('cart_within/get_list', { commonApi.user_post('cart_within/get_list', {
type:'1' type:'1'
}).then(res => { }).then(res => {
let arr = res.data,totalPrice = 0,cartCount=0 let arr = res.data,totalPrice = 0,cartCount=0
if (arr.length>0) { if (arr.length>0) {
arr.forEach(item=> { arr.forEach(item=> {
// totalPrice += item.num*item.sku.price
cartCount += item.num cartCount += item.num
}) })
} }
@ -433,15 +454,17 @@ Page({
} }
}) })
}) })
// debugger
arr.forEach(item=> { arr.forEach(item=> {
if(item.selected == 1) { if(item.selected == 1) {
totalPrice += item.num*item.sku.price 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({ this.setData({
cartCount: cartCount, //1 cartCount: cartCount, //1
gwcList:arr, gwcList:arr,
@ -605,6 +628,10 @@ Page({
}, },
// 添加产品弹窗 1.首先获取到该产品下的规格 // 添加产品弹窗 1.首先获取到该产品下的规格
addBuyCart(e) { addBuyCart(e) {
this.setData({
user_type: null
})
let item = e.currentTarget.dataset.item let item = e.currentTarget.dataset.item
console.log(item); console.log(item);
commonApi._post("product/get_product_detail", { commonApi._post("product/get_product_detail", {
@ -661,9 +688,18 @@ Page({
selectSku: function (e) { selectSku: function (e) {
let index = e.currentTarget.dataset.index; let index = e.currentTarget.dataset.index;
this.setData({ 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 () { hideSku: function () {
this.setData({ this.setData({

30
subPackages/techanNew/index.wxml

@ -177,6 +177,27 @@
<view class="number">{{producNum}}</view> <view class="number">{{producNum}}</view>
<view class="iconfont icon-add-select" bindtap="add"></view> <view class="iconfont icon-add-select" bindtap="add"></view>
</view> </view>
<view class="delivery-method" wx:if="{{info.is_package!=1}}">
<view class="delivery-title">配送方式</view>
<view class="flex" style="display: flex;">
<view class="flex-center" wx:if="{{info.sku[skuIndex].use_type!=1}}" bind:tap="changeSelectSkuPost" data-value="{{0}}">
<view class="select-cycle" wx:if="{{user_type!==0}}"></view>
<view class="select-cycle selected" wx:else>
<image src="https://static.ticket.sz-trip.com/uploads/20240715/a961604bc708670cbdc76d1580eb3f3c.png"></image>
</view>
<view class="method-str">邮寄</view>
</view>
<view class="flex-center" wx:if="{{info.sku[skuIndex].use_type!=0}}" bind:tap="changeSelectSkuPost" data-value="{{1}}">
<view class="select-cycle" wx:if="{{user_type!==1}}"></view>
<view class="select-cycle selected" wx:else="">
<image src="https://static.ticket.sz-trip.com/uploads/20240715/a961604bc708670cbdc76d1580eb3f3c.png"></image>
</view>
<view class="method-str">自提</view>
</view>
</view>
</view>
<view style="height:138rpx"></view> <view style="height:138rpx"></view>
<view class="btn-box"> <view class="btn-box">
<!-- <view class="mask-btn" bindtap="addCart" wx:if="{{info.sku[skuIndex].flag=='on'}}">{{skuFlag=='cart'?'加入购物车':'立即购买'}} <!-- <view class="mask-btn" bindtap="addCart" wx:if="{{info.sku[skuIndex].flag=='on'}}">{{skuFlag=='cart'?'加入购物车':'立即购买'}}
@ -208,7 +229,10 @@
<image lazy-load wx:if="{{item.selected ==1}}" style="width: 43rpx;height: 43rpx;" src="https://static.ticket.sz-trip.com/uploads/20240715/a961604bc708670cbdc76d1580eb3f3c.png" mode="" /> <image lazy-load wx:if="{{item.selected ==1}}" style="width: 43rpx;height: 43rpx;" src="https://static.ticket.sz-trip.com/uploads/20240715/a961604bc708670cbdc76d1580eb3f3c.png" mode="" />
<view wx:else style="width: 40rpx;height: 40rpx;border-radius: 50%;border: 1px solid #999999;"></view> <view wx:else style="width: 40rpx;height: 40rpx;border-radius: 50%;border: 1px solid #999999;"></view>
</view> </view>
<image lazy-load style="width:179rpx;height: 179rpx;border-radius: 13rpx;flex-shrink: 0;margin-right: 26rpx;" src="{{item.sku.headimg}}" mode="" /> <view style="position: relative;height: 179rpx;border-radius: 13rpx;flex-shrink: 0;margin-right: 26rpx;">
<image lazy-load style="width:179rpx;height: 179rpx;border-radius: 13rpx;" src="{{item.sku.headimg}}" mode="" />
<view class="use-type">{{item.delivery_method==1?"自提":"邮寄"}}</view>
</view>
<view class="main"> <view class="main">
<view> <view>
<view class="title textOver">{{item.product.title}}</view> <view class="title textOver">{{item.product.title}}</view>
@ -217,9 +241,9 @@
<view class="main-bottom"> <view class="main-bottom">
<view class="price">{{item.sku.price/100}}</view> <view class="price">{{item.sku.price/100}}</view>
<view class="num-box"> <view class="num-box">
<image lazy-load class="reduce" catchtap="del" data-item="{{item}}" src="https://static.ticket.sz-trip.com/uploads/20240715/054627e5d3864a9a4a8b397cae47754e.png" mode="" /> <image lazy-load class="reduce" catchtap="del" data-item="{{item}}" data-value="{{-1}}" src="https://static.ticket.sz-trip.com/uploads/20240715/054627e5d3864a9a4a8b397cae47754e.png" mode="" />
<view style="margin: 0 25.33rpx;">{{item.num}}</view> <view style="margin: 0 25.33rpx;">{{item.num}}</view>
<image lazy-load class="grow" catchtap="addCart" data-item="{{item}}" src="https://static.ticket.sz-trip.com/uploads/20240715/3ad59eac0088d47ff4bc2fec6ffd8f56.png" mode="" /> <image lazy-load class="grow" catchtap="del" data-item="{{item}}" data-value="{{1}}" src="https://static.ticket.sz-trip.com/uploads/20240715/3ad59eac0088d47ff4bc2fec6ffd8f56.png" mode="" />
</view> </view>
</view> </view>
</view> </view>

56
subPackages/techanNew/index.wxss

@ -442,7 +442,7 @@ page {
display: flex; display: flex;
font-size: 29rpx; font-size: 29rpx;
color: #333; color: #333;
margin: 0 40rpx; margin: 0 30rpx;
text-align: center; text-align: center;
flex-wrap: wrap; flex-wrap: wrap;
margin-bottom: 20rpx; margin-bottom: 20rpx;
@ -740,3 +740,57 @@ page {
.phcolor { .phcolor {
color: #ccc; color: #ccc;
} }
.delivery-method{
font-weight: 400;
font-size: 29rpx;
color: #1E1E1E;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 40rpx 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;
}
.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;
}

152
subPackages/techanNew/selfPickPoint/index.js

@ -0,0 +1,152 @@
// subPackages/techanNew/selfPickPoint/index.js
import commonApi from "../../../utils/https/common"
let device = wx.getSystemInfoSync();
const ratio = device.windowWidth / 750;
let app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
list: [],
pickupId: null,
goodsId: null,
skuId: null,
selectIndex: null,
lat:23,
lon:113,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
goodsId: options.goodsId,
skuId: options.skuId,
})
let _this = this
wx.getLocation({
type: 'gcj02',
success: function (res) {
_this.getList()
},
fail: function(e) {
_this.getList()
},
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
getList() {
let param = {
product_id: this.data.goodsId,
lon: this.data.lon || '113',
lat: this.data.lat || '23',
}
commonApi.user_post("product/getDeliverShop", param).then(res => {
let resData = res.data || []
resData.forEach(x=>{
if (x.distance) {
x.distance = (x.distance / 1000).toFixed(2)
}
})
this.setData({
list: res.data || []
})
})
},
selectPoint (e) {
let index = e.currentTarget.dataset.index;
this.setData({
selectIndex: index
})
},
goMap (e) {
let item = e.currentTarget.dataset.item;
console.log(123)
wx.openLocation({
latitude: Number(item.lat),
longitude: Number(item.lon),
name:item.title,
address:item.address,
fail: function (e) {
console.log(e)
}
})
},
confirmPoint () {
if(this.data.selectIndex==null) {
wx.showToast({icon: "none",title: "请先选择自提点"})
return;
}
// 返回上一个页面并带回selectItem
let selectItem = this.data.list[this.data.selectIndex]
const pages = getCurrentPages();
const prevPage = pages[pages.length - 2];
if (prevPage && prevPage.setPickUpPoint) {
console.log(prevPage)
prevPage.setPickUpPoint(selectItem)
}
wx.navigateBack()
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

5
subPackages/techanNew/selfPickPoint/index.json

@ -0,0 +1,5 @@
{
"usingComponents": {
"title":"/pages/component/TitleHeader"
}
}

35
subPackages/techanNew/selfPickPoint/index.wxml

@ -0,0 +1,35 @@
<wxs src="../../../utils/filter.wxs" module="tool" />
<title title="选择自提点"></title>
<view class="bg">
<view class="item-bg'{{selectIndex==index?'active':''}}" wx:for="{{list}}"
wx:key="index" data-index="{{index}}" bind:tap="selectPoint" data-item="{{item}}">
<view class="item">
<view class="item-point-title">
<view class="name">{{item.title}}</view>
<!-- <view style="padding: 10rpx 0;">营业时间:{{item.remark}}</view> -->
<view >地址:{{item.address}}</view>
</view>
<view class="item-point-guide" catchtap="goMap" data-item="{{item}}">
<view>
<image src="https://static.ticket.sz-trip.com/uploads/20251028/071021313e5d04d98ca82f1f9e0678fd.png" mode="aspectFill" class="mapPoint"></image>
</view>
<!-- <view class="distance" wx:if="{{item.distance}}">距离{{item.distance}}km</view> -->
<view class="distance" >去这里</view>
</view>
</view>
</view>
<view class="no-data" wx:if="{{list.length==0}}">
<image src="https://static.ticket.sz-trip.com/dongtai/images/user/noAddress.png" mode="aspectFill" class="no-address"></image>
<view class="">
暂无自提点地址
</view>
</view>
<view class="btn-bottom">
<view class="addBox" bind:tap="confirmPoint">
确定
</view>
</view>
</view>

124
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;
}

4
utils/https.js

@ -1,8 +1,8 @@
var app = getApp(); var app = getApp();
import util from "../utils/util" import util from "../utils/util"
// import userApi from "../utils/https/user.js"; // import userApi from "../utils/https/user.js";
// const baseUrl = "https://test.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/"; // let baseUrl = "https://api.cloud.sz-trip.com/api/";
const env = wx.getAccountInfoSync().miniProgram.envVersion const env = wx.getAccountInfoSync().miniProgram.envVersion
if (env == 'develop1') { if (env == 'develop1') {
baseUrl = "https://test.api.cloud.sz-trip.com/api/" baseUrl = "https://test.api.cloud.sz-trip.com/api/"

1
utils/util.js

@ -569,7 +569,6 @@ const pagePointPostUrl = [
const detailPagePoint = function (url, res) { const detailPagePoint = function (url, res) {
try { try {
console.log(res)
let pagePointRoute = pagePointPostUrl.find(v=>url.indexOf(v.url)>=0) let pagePointRoute = pagePointPostUrl.find(v=>url.indexOf(v.url)>=0)
if (pagePointRoute) { if (pagePointRoute) {
// 如果是产品详情的话 需要加埋点 // 如果是产品详情的话 需要加埋点

Loading…
Cancel
Save