Browse Source

订单详情修改以及对接数据

master
杜叶春 2 years ago
parent
commit
82101db8a7
  1. BIN
      images/orderDetailsBg.png
  2. 2
      pages/address/upaddress.js
  3. 137
      pages/cart/cart.js
  4. 186
      pages/cart/cart.wxml
  5. 22
      pages/cart/cart.wxss
  6. 7
      pages/login/register.wxml
  7. 21
      pages/login/register.wxss
  8. 5
      pages/logistics/logistics.js
  9. 1
      pages/logistics/logistics.wxml
  10. 221
      pages/order/detail.js
  11. 249
      pages/order/detail.wxml
  12. 127
      pages/order/detail.wxss
  13. 67
      pages/order/pay.js
  14. 10
      pages/order/payment.wxml
  15. 31
      pages/order/payment.wxss
  16. 7
      pages/product/detail.js
  17. 10
      pages/user/user.wxss
  18. 36
      utils/server.js

BIN
images/orderDetailsBg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

2
pages/address/upaddress.js

@ -26,8 +26,6 @@ Page({
// 下拉刷新
onPullDownRefresh: function () {
wx.showNavigationBarLoading() //在标题栏中显示加载
this.AddressManagement();
wx.hideNavigationBarLoading() //完成停止加载
wx.stopPullDownRefresh() //停止下拉刷新
},

137
pages/cart/cart.js

@ -10,6 +10,8 @@ Page({
cont: 1,
upstatus: false,
remind: '加载中',
productData: '',
shop: '',
},
//页面加载完成函数 remind: '加载中',
onReady: function () {
@ -33,7 +35,6 @@ Page({
if (num > 1) {
num--;
}
if (num < 1) {
wx.showToast({
title: '数量不能小于1!',
@ -41,10 +42,14 @@ Page({
duration: 2000
});
} else {
WXAPI.productUpcart({
user_id: that.data.user_id,
num: num,
cart_id: cart_id
//编辑商品信息
var productArr = [{num: num,cart_id: cart_id}]
let jsonstr = JSON.stringify(productArr)
WXAPI.productUpNum({
accessId: app.globalData.accessId,
storeId: 239,
storeType: 1,
goods: jsonstr
}).then(res => {
if (res.code == 200) {
// util.getUesrBgplus(that, app, false)
@ -80,6 +85,9 @@ Page({
success: function (res) {
if (res.confirm) {
WXAPI.productDelAllCart({
accessId: app.globalData.accessId,
storeId: 239,
storeType: 1,
user_id: that.data.user_id,
}).then(res => {
if (res.code == 200) {
@ -126,48 +134,47 @@ Page({
//删除
delarr: function () {
var that = this;
// 初始化toastStr字符串
var toastStr = '';
var selectArr = []
// 遍历取出已勾选的cid
for (var i = 0; i < this.data.carts.length; i++) {
if (this.data.carts[i].selected) {
toastStr += this.data.carts[i].id;
toastStr += ',';
selectArr.push(this.data.carts[i].id)
}
}
if (toastStr == '') {
if (selectArr.length == 0) {
wx.showToast({
title: '请选择要删除的商品!',
duration: 2000
});
return false;
}
that.removeShopCard(toastStr);
var selectStr = selectArr.join(','); //将数组转换成string串
that.removeShopCard(selectStr);
},
//移至收藏
shouc: function () {
var that = this;
// 初始化toastStr字符串
var toastStr = '';
var selectArr = []
// 遍历取出已勾选的cid
for (var i = 0; i < this.data.carts.length; i++) {
if (this.data.carts[i].selected) {
toastStr += this.data.carts[i].id;
toastStr += ',';
selectArr.push(this.data.carts[i].id)
}
}
if (toastStr == '') {
if (selectArr.length == 0) {
wx.showToast({
title: '请选择要收藏的商品!',
duration: 2000
});
return false;
}
var selectStr = selectArr.join(','); //将数组转换成string串
WXAPI.productToCollection({
user_id: that.data.user_id,
carts: toastStr,
accessId: app.globalData.accessId,
storeId: 239,
storeType: 1,
carts: selectStr,
}).then(res => {
// util.getUesrBgplus(that, app, false)
if (res.code == 200) {
@ -191,14 +198,18 @@ Page({
var num = that.data.carts[index].num;
// 自增
num++;
var pnum = that.data.carts[index].pnum;
var stock = that.data.carts[index].stock;
var cart_id = e.currentTarget.dataset.cartid;
console.log(pnum)
if (pnum > num) {
WXAPI.productUpcart({
user_id: that.data.user_id,
num: num,
cart_id: cart_id
//编辑商品信息
var productArr = [{num: num,cart_id: cart_id}]
let jsonstr = JSON.stringify(productArr)
if (stock > num) {
WXAPI.productUpNum({
accessId: app.globalData.accessId,
storeId: 239,
storeType: 1,
goods: jsonstr
}).then(res => {
if (res.code == 200) {
// util.getUesrBgplus(that, app, false)
@ -224,7 +235,6 @@ Page({
duration: 2000
});
}
},
bindCheckbox: function (e) {
@ -262,25 +272,24 @@ Page({
},
bindCheckout: function () {
// 初始化toastStr字符串
var toastStr = '';
var selectArr = []
// 遍历取出已勾选的cid
for (var i = 0; i < this.data.carts.length; i++) {
if (this.data.carts[i].selected) {
toastStr += this.data.carts[i].id;
toastStr += ',';
selectArr.push(this.data.carts[i].id)
}
}
if (toastStr == '') {
if (selectArr.length == 0) {
wx.showToast({
title: '请选择要结算的商品!',
duration: 2000
});
return false;
}
var selectStr = selectArr.join(','); //将数组转换成string串
//存回data
wx.navigateTo({
url: '../order/pay?cartId=' + toastStr,
url: '../order/pay?cartId=' + selectStr + '&product=',
})
},
@ -321,35 +330,36 @@ Page({
},
onLoad: function (options) {
this.setData({
bgcolor: app.d.bgcolor,
user_id: app.globalData.userInfo.openid
});
this.loadProductData();
this.sum();
// this.loadProductData();
// this.sum();
},
onShow: function () {
var cont = this.data.cont;
var carts = this.data.carts;
var purchase = app.d.purchase;
var that = this;
if (cont > 1 && purchase == 1) {
that.loadProductData();
} else {
that.setData({
carts: carts,
cont: cont + 1
});
}
this.loadProductData();
this.sum();
// var cont = this.data.cont;
// var carts = this.data.carts;
// var purchase = app.d.purchase;
// var that = this;
// if (cont > 1 && purchase == 1) {
// that.loadProductData();
// } else {
// that.setData({
// carts: carts,
// cont: cont + 1
// });
// }
},
removeShopCard: function (carts) {
var that = this;
wx.showModal({
title: '提示',
content: '你确认移除吗',
content: '你确认要删除选中的商品吗',
success: function (res) {
res.confirm && WXAPI.productDelcart({
carts: carts,
accessId: app.globalData.accessId,
storeId: 239,
storeType: 1,
cart_id: carts,
}).then(res => {
// util.getUesrBgplus(that, app, false)
if (res.code == 200) {
@ -387,7 +397,8 @@ Page({
carts: data.data,
selectedAllStatus: false,
total: '¥0.00',
remind: ''
remind: '',
shop: data.mch_list[0]
});
} else {
wx.showToast({
@ -405,14 +416,18 @@ Page({
var index = parseInt(e.currentTarget.dataset.index);
var cat_num = that.data.carts[index].num;
var cart_id = e.currentTarget.dataset.cartid;
var pnum = that.data.carts[index].pnum;
console.log(num, cat_num, pnum)
var stock = that.data.carts[index].stock;
// console.log(num, cat_num, stock)
if (Number(num) > 0) {
if (Number(num) <= Number(pnum)) {
WXAPI.productUpcart({
user_id: that.data.user_id,
num: num,
cart_id: carid
if (Number(num) <= Number(stock)) {
//编辑商品信息
var productArr = [{num: num,cart_id: cart_id}]
let jsonstr = JSON.stringify(productArr)
WXAPI.productUpNum({
accessId: app.globalData.accessId,
storeId: 239,
storeType: 1,
goods: jsonstr
}).then(res => {
if (res.code == 200) {
// 只有大于一件的时候,才能normal状态,否则disable状态

186
pages/cart/cart.wxml

@ -1,105 +1,111 @@
<!--pages/cart/cart.wxml-->
<view class="body" wx:if="{{remind}}">
<view class='zong'>
<view class="spinner" >
<view class="spinner-container container1">
<view class="circle1"></view>
<view class="circle2"></view>
<view class="circle3"></view>
<view class="circle4"></view>
</view>
<view class="spinner-container container2">
<view class="circle1"></view>
<view class="circle2"></view>
<view class="circle3"></view>
<view class="circle4"></view>
</view>
<view class="spinner-container container3">
<view class="circle1"></view>
<view class="circle2"></view>
<view class="circle3"></view>
<view class="circle4"></view>
</view>
</view>
<view class="body" wx:if="{{remind}}">
<view class='zong'>
<view class="spinner">
<view class="spinner-container container1">
<view class="circle1"></view>
<view class="circle2"></view>
<view class="circle3"></view>
<view class="circle4"></view>
</view>
<view class="spinner-container container2">
<view class="circle1"></view>
<view class="circle2"></view>
<view class="circle3"></view>
<view class="circle4"></view>
</view>
<view class="spinner-container container3">
<view class="circle1"></view>
<view class="circle2"></view>
<view class="circle3"></view>
<view class="circle4"></view>
</view>
</view>
</view>
</view>
<!-- 加载页面结束 -->
<block wx:else>
<view class="page">
<view class='top-ql' wx:if="{{carts !=''}}">
<view wx:if="{{!upstatus}}" bindtap="updata" class='top-ql-1' style='color:#333;'>编辑商品</view>
<view wx:else bindtap="ok" class='top-ql-1' style='color:#f60;'>完成</view>
<view wx:if="{{upstatus}}" bindtap="delall" class='top-ql-1 iconfont icon-icon-test' style='color:#f60;'>快速清理</view>
<view class="page">
<view class='top-ql' wx:if="{{carts !=''}}">
<view wx:if="{{!upstatus}}" bindtap="updata" class='top-ql-1' style='color:#333;'>编辑商品</view>
<view wx:else bindtap="ok" class='top-ql-1' style='color:#f60;'>完成</view>
<view wx:if="{{upstatus}}" bindtap="delall" class='top-ql-1 iconfont icon-icon-test' style='color:#f60;'>快速清理</view>
</view>
<!-- productData -->
<view class="shop df" wx:for="{{productData}}" wx:key="key">
<image class="sh_slt" src="{{item.imgurl}}"></image>
<view class="df_1">
<view class="sp_text">
<navigator url="../index/detail?productId={{item.ProID}}">
<view class="sp_tit ovh1">{{item.ProductName}}</view>
</navigator>
<view class="sp_neb">数量:×{{item.BuyCount}}</view>
<view class="sp_jg">¥:{{item.Price}}</view>
<button class="dle" data-card-id="{{item.CartID}}" bindtap="removeShopCard">删除</button>
<navigator class="dle" url="../order/pay?productId={{item.ProID}}&cartId={{item.CartID}}&buyCount={{item.BuyCount}}">下单</navigator>
</view>
</view>
<view class="shop df" wx:for="{{productData}}" wx:key="key">
<image class="sh_slt" src="{{item.imgurl}}"></image>
<view class="df_1">
<view class="sp_text">
<navigator url="../index/detail?productId={{item.ProID}}">
<view class="sp_tit ovh1">{{item.ProductName}}</view>
</navigator>
<view class="sp_neb">数量:×{{item.BuyCount}}</view>
<view class="sp_jg">¥:{{item.Price}}</view>
<button class="dle" data-card-id="{{item.CartID}}" bindtap="removeShopCard">删除</button>
<navigator class="dle" url="../order/pay?productId={{item.ProID}}&cartId={{item.CartID}}&buyCount={{item.BuyCount}}">下单</navigator>
</view>
</view>
</view>
<!--样式-->
<view class="container carts-list" wx:if="{{carts==''}}">
<view class="pp">
<image class="kong" src="../../images/cart.png" mode="aspectFill"/>
<view class="cla">购物车空空如也</view>
<view class="cla" style='padding:5px;background:{{bgcolor}};border-radius:5px;margin:6px;color:#fff;' bindtap='go_index'>去逛逛</view>
</view>
</view>
<!--样式-->
<view class="container carts-list" wx:if="{{carts==''}}">
<view class="pp">
<image class="kong" src="../../images/cart.png" mode="aspectFill" />
<view class="cla">购物车空空如也</view>
<view class="cla" style='padding:5px;background:{{bgcolor}};border-radius:5px;margin:6px;color:#fff;' bindtap='go_index'>去逛逛</view>
</view>
<view class="container carts-list">
</view>
<view class="shopView">
<image src="https://cz-hl-shop.oss-cn-shanghai.aliyuncs.com/239/1/20230227/{{shop.logo}}" mode="aspectFill"></image>
<text class="left">{{shop.name}}</text>
<image class="jiantou-img" src="/images/x_right.png" mode="aspectFill"></image>
</view>
<view class="container carts-list">
<!--勾-->
<view wx:for="{{carts}}" wx:key="key" class="carts-item" data-title="{{item.pro_name}}" id="{{item.id}}">
<icon wx:if="{{item.selected}}" type="success_circle" size="20" bindtap="bindCheckbox" data-index="{{index}}"/>
<icon wx:else type="circle" size="20" bindtap="bindCheckbox" data-index="{{index}}"/>
<!--img-->
<navigator style='align-content:center;' url="../product/detail?productId={{item.pid}}&size={{item.sizeid}}">
<view >
<image class="carts-image" src="{{item.imgurl}}" mode="aspectFill"/>
</view>
</navigator>
<view class="carts-text">
<navigator style='width:100%;height:120rpx;overflow: hidden;' url="../product/detail?productId={{item.pid}}&size={{item.sizeid}}">
<view wx:for="{{carts}}" wx:key="key" class="carts-item" data-title="{{item.pro_name}}" id="{{item.id}}">
<icon wx:if="{{item.selected}}" type="success_circle" size="20" bindtap="bindCheckbox" data-index="{{index}}" />
<icon wx:else type="circle" size="20" bindtap="bindCheckbox" data-index="{{index}}" />
<!--img-->
<navigator style='align-content:center;' url="../product/detail?productId={{item.pid}}&size={{item.sizeid}}">
<view>
<image class="carts-image" src="{{item.imgurl}}" mode="aspectFill" />
</view>
</navigator>
<view class="carts-text">
<navigator style='width:100%;height:120rpx;overflow: hidden;' url="../product/detail?productId={{item.pid}}&size={{item.Size_id}}">
<text class="carts-title">{{item.pro_name}}</text>
<text class="carts-title" style='font-size:28rpx;color:#CCCCCC;margin:0;' wx:if="{{item.size}}">[{{item.size}}]</text>
</navigator>
<view class="title">
<text class="carts-price">¥ {{item.price}}</text>
<view class="stepper">
<!-- 减号 -->
<text class="{{minusStatuses[index]}}" data-index="{{index}}" bindtap="bindMinus" data-cartid="{{item.id}}">-</text>
<!-- 数值 -->
<input type="number" data-cartid="{{item.id}}" data-index="{{index}}" bindblur="bindManual" value="{{item.num}}" class='cart_number'/>
<!-- 加号 -->
<text class="normal" data-index="{{index}}" bindtap="bindPlus" data-cartid="{{item.id}}">+</text>
</view>
<text class="carts-title" style='font-size:28rpx;color:#CCCCCC;margin-top:25rpx;' wx:if="{{item.attrList}}">[{{item.skuBeanList[0].name}}]</text>
</navigator>
<view class="title">
<text class="carts-price">¥ {{item.price}}</text>
<view class="stepper">
<!-- 减号 -->
<text class="{{minusStatuses[index]}}" data-index="{{index}}" bindtap="bindMinus" data-cartid="{{item.id}}">-</text>
<!-- 数值 -->
<input type="number" data-cartid="{{item.id}}" data-index="{{index}}" bindblur="bindManual" value="{{item.num}}" class='cart_number' />
<!-- 加号 -->
<text class="normal" data-index="{{index}}" bindtap="bindPlus" data-cartid="{{item.id}}">+</text>
</view>
</view>
</view>
</view>
</view>
<!--右边-->
</view>
<!--底部-->
<view class="carts-footer" wx:if="{{carts.length >= 1}}">
<view bindtap="bindSelectAll" class='heji'>
<icon wx:if="{{selectedAllStatus}}" type="success_circle" size="24" />
<icon wx:else type="circle" size="24" />
<text>全选</text>
<text wx:if="{{!upstatus}}" class="reds">{{total}}</text>
</view>
<!--底部-->
<view class="carts-footer" wx:if="{{carts.length >= 1}}">
<view bindtap="bindSelectAll" class='heji'>
<icon wx:if="{{selectedAllStatus}}" type="success_circle" size="24" />
<icon wx:else type="circle" size="24" />
<text>全选</text>
<text wx:if="{{!upstatus}}" class="reds">{{total}}</text>
</view>
<view wx:if="{{upstatus}}" class="bottom_1">
<view class="button_1_1" bindtap='shouc'>移至收藏</view>
<view class="button_1_2" style='background:#f60;border:1px solid #f60;' bindtap='delarr'>删除</view>
</view>
<view wx:else class="button" style='background:#f60;' bindtap='bindCheckout'>立即结算 </view>
<view wx:if="{{upstatus}}" class="bottom_1">
<view class="button_1_2" style='background:#f60;border:1px solid #f60;' bindtap='delarr'>删除</view>
</view>
</view>
</block>
<view wx:else class="button" style='background:#f60;' bindtap='bindCheckout'>立即结算</view>
</view>
</view>
</block>

22
pages/cart/cart.wxss

@ -165,7 +165,7 @@ page{
.carts-title {
margin-top: 1px;
margin-bottom: 10rpx;
font-size: 28rpx;
font-size: 30rpx;
line-height:34rpx;
overflow: hidden;
text-overflow: ellipsis;
@ -362,4 +362,24 @@ padding-right:16px;
margin-left: 5px;
color:#fff;
padding:0 18px;
}
.shopView {
display:flex;
align-items: center;
height: 85rpx;
}
.shopView image {
width: 40rpx;
height: 40rpx;
margin-left: 25rpx;
}
.shopView text{
margin-left: 12rpx;
font-size: 32rpx;
color: #333333;
}
.shopView .jiantou-img {
width: 25rpx;
height: 25rpx;
margin-left: 20rpx;
}

7
pages/login/register.wxml

@ -1,5 +1,8 @@
<!--pages/login/register.wxml-->
<view class="container">
<image class="codeImage" src="/images/QR_code.png" mode="aspectFill"></image>
<view class="title">请添加上方二维码联系客服注册账号</view>
</view>
<view class="title">请添加上方二维码或下方按钮联系客服注册账号</view>
<view class="serviceView">
<view class="serviceBtn" bindtap="submitAct">联系客服</view>
</view>
</view>

21
pages/login/register.wxss

@ -16,4 +16,25 @@ page{
margin-top: 30rpx;
height: 60rpx;
line-height: 60rpx;
}
.serviceView{
padding-top: 25rpx;
height: 100rpx;
width: 100%;
background-color: #F6F6FB;
}
.serviceView .serviceBtn{
margin-top: 25rpx;
margin-left: 60rpx;
display: flex;
align-items: center;
justify-content: center;
height: 70rpx;
width: 630rpx;
text-align: center;
line-height: 70rpx;
font-size: 28rpx;
color: white;
background-color: #F53C45;
border-radius: 35rpx;
}

5
pages/logistics/logistics.js

@ -101,6 +101,11 @@ Page({
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

1
pages/logistics/logistics.wxml

@ -43,7 +43,6 @@
<view class='dot {{index==0?"in":"no_in"}}'></view>
<view class="line" wx:if="{{index==wuliuList.length-1}}" hidden="{{true}}"></view>
<view class="line" wx:else hidden="{{false}}"></view>
<!-- <view class="line" style="background-color:{{index==wuliuList.length-1?'red':'blue'}}"></view> -->
<view class='logistics_centent' style="color:{{index==0?'#FA5151':'#9d9d9d'}};">
<view class='centent'>{{item.context}}</view>
<text>{{item.time}}</text>

221
pages/order/detail.js

@ -295,8 +295,7 @@ Page({
},
onLoad: function (options) {
console.log(options)
this.get_plug();
// this.get_plug();
this.loadProductDetail(options);
},
onReady: function () {
@ -349,9 +348,9 @@ Page({
})
},
// 订单详情
loadProductDetail: function () {
loadProductDetail: function (options) {
var that = this;
var orderId = options.orderId;
var orderId = options.id;
WXAPI.orderDetails({
accessId: app.globalData.accessId,
storeId: 239,
@ -360,16 +359,40 @@ Page({
}).then(res => {
if (res.code == 200) {
var data = res.data;
// var address = data.adds;
// that.numbers = data.adds;
// if (address == '') {
// var address = []
// }
var list = data.list;
var z_price = Number(data.z_price).toFixed(2);
var pro_price = 0;
var freight = data.z_freight ? data.z_freight : 0;
var red_packet = data.red_packet;
for (var i = 0; i < list.length; i++) {
pro_price = (Number(pro_price) + Number(list[i].p_price) * Number(list[i].num)).toFixed(2);
}
that.setData({
wuliu: data.res_1.data,
// address: address,
// selectedAllStatus: false
})
orderData: data,
pro_price: pro_price,
freight: freight,
id: data.id,
sNo: data.sNo,
z_price: Number(z_price).toFixed(2),
add_time: data.add_time,
rstatus: data.status,
list: data.list,
address: data.address,
mobile: data.mobile,
name: data.name,
dr: data.dr,
title: data.title,
p_id: data.p_id,
coupon_money: data.coupon_price,
consumer_money: data.consumer_money,
user_money: data.user_money,
status_pid: data.pid,
ptcode: data.ptcode,
man_num: data.man_num,
groupid: data.pid,
payment: z_price,
order_failure: data.order_failure,
});
}
});
// var type1 = that.data.type1;
@ -458,95 +481,106 @@ Page({
// promise.then(() => countdown(this));
},
// 取消订单
removeOrder: function (e) {
removeOrder: function(e) {
var that = this;
var orderId = e.currentTarget.dataset.orderId;
var info = e.currentTarget.dataset.info
wx.showModal({
title: '提示',
content: '你确定要取消订单吗?',
success: function (res) {
res.confirm && wx.request({
url: app.d.ceshiUrl + '&action=order&m=removeOrder',
method: 'post',
data: {
openid: app.globalData.userInfo.openid,
id: orderId,
},
header: {
'Content-Type': 'application/x-www-form-urlencoded'
},
success: function (res) {
var status = res.data.status;
if (status == 1) {
wx.showToast({
title: res.data.err,
success: 2000
});
wx.navigateBack({
delta: 2
})
} else {
wx.showToast({
title: res.data.err,
duration: 2000
});
}
},
fail: function () {
wx.showToast({
title: '网络异常!',
duration: 2000
});
WXAPI.removeOrder({
accessId: app.globalData.accessId,
storeId: 239,
storeType: 1,
order_id: info.id,
}).then(res => {
if (res.code == 200) {
that.reloadData();
}
});
})
}
});
},
//立即支付
payNow: function(e) {
var data = e.currentTarget.dataset.info
wx.navigateTo({
url: "/pages/order/payment?orderId="+data.sNo+"&price="+data.z_price,
})
},
//提醒发货
orderRemind: function(e) {
var that = this;
var info = e.currentTarget.dataset.info
WXAPI.orderRemind({
accessId: app.globalData.accessId,
storeId: 239,
storeType: 1,
order_id: info.id,
}).then(res => {
if (res.code == 200) {
that.reloadData();
}
})
},
// 确认收货
recOrder: function (e) {
confirmOrder: function(e) {
var that = this;
var orderId = e.currentTarget.dataset.orderId;
var info = e.currentTarget.dataset.info
wx.showModal({
title: '提示',
content: '你确定已收到宝贝吗?',
content: '请确认你已收到货物',
success: function (res) {
res.confirm && wx.request({
url: app.d.ceshiUrl + '&action=order&m=recOrder',
method: 'post',
data: {
id: orderId,
},
header: {
'Content-Type': 'application/x-www-form-urlencoded'
},
success: function (res) {
//--init data
var status = res.data.status;
if (status == 1) {
wx.showToast({
title: '操作成功!',
duration: 2000
});
that.loadProductDetail();
} else {
wx.showToast({
title: res.data.err,
duration: 2000
});
}
},
fail: function () {
// fail
wx.showToast({
title: '网络异常!',
duration: 2000
});
WXAPI.confirmOrder({
accessId: app.globalData.accessId,
storeId: 239,
storeType: 1,
order_id: info.id,
}).then(res => {
if (res.code == 200) {
that.reloadData();
}
});
})
}
});
},
//删除订单
deleteOrder: function(e) {
var that = this;
var info = e.currentTarget.dataset.info
wx.showModal({
title: '提示',
content: '确定要删除订单吗',
success: function (res) {
WXAPI.deleteOrder({
accessId: app.globalData.accessId,
storeId: 239,
storeType: 1,
order_id: info.id,
}).then(res => {
if (res.code == 200) {
that.reloadData();
}
})
}
});
},
//查看物流
orderLogistics: function(e) {
var info = e.currentTarget.dataset.info
wx.navigateTo({
url:"/pages/logistics/logistics?orderId="+info.sNo
})
},
//去评价
evaluateOrder: function(e) {
var that = this;
var info = e.currentTarget.dataset.info
wx.navigateTo({
url:"/pages/order/detail?id="+info.id
})
},
//触发支付
payOrder: function (e) {
@ -897,24 +931,7 @@ Page({
}
})
},
add_fromid: function (e) {
var that = this;
var formId = e.detail.formId;
if (formId != 'the formId is a mock one') {
var page = 'pages/product/detail'
app.request.wxRequest({
url: '&action=product&m=save_formid',
data: { from_id: formId, userid: app.globalData.userInfo.openid },
method: 'post',
success: function (res) {
console.log(res)
}
})
}
wx.switchTab({
url: '../index/index'
})
},
//跳转index
t_index: function () {
wx.switchTab({

249
pages/order/detail.wxml

@ -1,6 +1,6 @@
<view class="body" wx:if="{{remind}}">
<view class='zong'>
<view class="spinner" >
<view class="spinner">
<view class="spinner-container container1">
<view class="circle1"></view>
<view class="circle2"></view>
@ -24,14 +24,33 @@
</view>
<!-- 加载页面结束 -->
<block wx:else>
<view style="padding-bottom: 60px;">
<view class="djs" wx:if="{{rstatus == 0}}">
<text >支付关闭: {{clock}}</text>
<text>{{micro_second}}</text>
</view>
<view class="top_1" style="border-bottom: 1px solid #eee;">
<view class="df">
<view class='iconfont icon-dizhi' style='margin:auto 0;'></view>
<view style="padding-bottom: 60px;">
<!-- <view class="djs" wx:if="{{rstatus == 0}}">
<text>支付关闭: {{clock}}</text>
<text>{{micro_second}}</text>
</view> -->
<view class="status-view">
<block wx:if="{{rstatus == 0}}">
<view class="statusLabel">待付款</view>
<view class='statusDesc'></view>
</block>
<block wx:elif="{{rstatus == 1}}">
<view class="statusLabel">已付款</view>
<view class='statusDesc'>等待发货</view>
</block>
<block wx:elif="{{rstatus == 2}}">
<view class="statusLabel">已发货</view>
<view class='statusDesc'>商家已发货,请及时关注物流信息</view>
</block>
<block wx:elif="{{rstatus == 5}}">
<view class="statusLabel">交易成功</view>
<view class='statusDesc'>您的商品已发送给你了,下次再来哦~</view>
</block>
<image src="/images/orderDetailsBg.png" mode="scaleToFill"></image>
</view>
<view class="top_1" style="border-bottom: 20rpx solid#F4F5F6;">
<view class="df">
<view class='iconfont icon-dizhi' style='margin:auto 0;'></view>
<view class="df_1 c6">
<view class="l_h20 pay_xt" style='color:#333333;font-size:16px;'><text style='color:#333333;font-size:18px;'>{{name}}</text> {{mobile}}</view>
<view class="l_h20 mt5 pay_xt" style='color:#333333;'>地址:{{address}}</view>
@ -39,143 +58,123 @@
</view>
</view>
<view class="shop df" wx:for="{{list}}" wx:key="key" >
<navigator url="../product/detail?productId={{item.p_id}}&size={{item.sid}}" hover-class="changestyle">
<view class="shopView">
<image src="{{list[0].shop_logo}}" mode="aspectFill"></image>
<text class="left">{{list[0].shop_name}}</text>
<image class="jiantou-img" src="/images/x_right.png" mode="aspectFill"></image>
</view>
<view class="shop df" wx:for="{{list}}" wx:key="key">
<navigator url="../product/detail?productId={{item.p_id}}&size={{item.sid}}" hover-class="changestyle">
<image class="sh_slt" src="{{item.imgurl}}"></image>
</navigator>
<view class="df_1" style='padding-left:7px;'>
<view class="sp_text">
<navigator style='width:70%;' url="../product/detail?productId={{item.p_id}}&size={{item.sid}}" hover-class="changestyle">
<view class="sp_tit ovh1" style="color: #000;">{{item.p_name}} </view>
<view class="sp_tit ovh1" style='color:#808080'>[{{item.size}}]</view>
</navigator>
<view class="sp_jg">
<view class='guige'>¥ {{item.p_price}} </view>
<view class="df_1" style='padding-left:7px;'>
<view class="sp_text">
<navigator style='width:70%;' url="../product/detail?productId={{item.p_id}}&size={{item.sid}}" hover-class="changestyle">
<view class="sp_tit ovh1" style="color: #000;">{{item.p_name}} </view>
<view class="sp_tit ovh1" style='color:#999'>[{{item.size}}]</view>
<view class='price'>¥ {{item.p_price}} </view>
</navigator>
<view class='guige'>x{{item.num}}</view>
</view>
<view style="width: 100%;">
<navigator class="font_12 red fl_r mr_5" url="../logistics/logistics?orderId={{item.sNo}}&&courier_num={{item.courier_num}}&&express_id={{item.express_id}}" style='border:1px solid #8a8a8a;color:#8a8a8a;'wx:if="{{item.express_id}}" data-order-id="{{item.id}}">查看物流</navigator>
<view wx:if="{{item.r_status > 0 && item.r_status < 4 && item.otype =='' && item.r_status != 3}}" bindtap='return_goods' data-order-id="{{item.id}}" style='border:1px solid #8a8a8a;color:#8a8a8a;' class="font_12 red fl_r mr_5">申请售后</view>
</view>
</view>
<view style='clear:both;'></view>
<view style='margin-top: 5px;'>
</view>
<view style='clear:both'></view>
</view>
<view style='clear:both'></view>
</view>
<view class="top_1">
<view class='ddlb'>
<view class='ddlb_v'>
<text class="ddlb_v-lift">订单号:</text>
<text class='fright'>{{sNo}}</text>
</view>
<view style='height:20rpx;background-color:#F4F5F6;'></view>
<view class="top_1">
<view class='ddlb'>
<view class='ddlb_v'>
<text class="ddlb_v-lift">订单号:</text>
<text class='fright'>{{sNo}}</text>
</view>
<view class='ddlb_v'>
<text class="ddlb_v-lift">时间:</text>
<text class='fright'>{{add_time}}</text>
</view>
<view class='ddlb_v'>
<text class="ddlb_v-lift">下单时间:</text>
<text class='fright'>{{add_time}}</text>
</view>
<view class='ddlb_v'>
<text class="ddlb_v-lift">商品总价:</text>
<text class='fright'>¥{{pro_price}}</text>
</view>
<view class='ddlb_v'>
<text class="ddlb_v-lift">商品总价:</text>
<text class='fright'>¥{{pro_price}}</text>
</view>
<view class='ddlb_v' wx:if="{{coupon_money != 0}}">
<text class="ddlb_v-lift">优惠券:</text>
<text class='fright'>-¥{{coupon_money}}</text>
</view>
<view class='ddlb_v' wx:if="{{coupon_money != 0}}">
<text class="ddlb_v-lift">优惠券:</text>
<text class='fright'>-¥{{coupon_money}}</text>
</view>
<view class='ddlb_v'>
<text class="ddlb_v-lift">运费:</text>
<text class='fright'>¥{{freight}}</text>
</view>
<view class='ddlb_v'>
<text class="ddlb_v-lift">运费:</text>
<text class='fright'>¥{{freight}}</text>
</view>
<view class='ddlb_v'>
<text class="ddlb_v-lift">订单总价:</text>
<text class='fright'>¥{{z_price}}</text>
<view class='ddlb_v'>
<text class="ddlb_v-lift">订单总价:</text>
<text class='fright'>¥{{z_price}}</text>
</view>
</view>
</view>
<view style='clear:both'></view>
</view>
<view class="top" style='border-top:0;'>
<view class='ddlb'>
<view class='ddlb_v' style='font-size:18px;'>实付款<text class='fright' style='color:#f85654;'>¥{{z_price}}</text></view>
<view class="top">
<view class='ddlb'>
<view class='ddlb_v' style='font-size:32rpx;'>实付款<text class='fright' style='color:#f85654;'>¥{{z_price}}</text></view>
</view>
</view>
</view>
<view wx:if="{{rstatus == 0}}" style='margin:15px 0 0 0;border-bottom:1px solid #eee;padding-bottom:15px'>
<view class="pay_zf pd" >
<text class="left" style='font-size:15px;'>选择支付方式</text>
</view>
<view class="pay_zf pd" style='border-bottom:none'>
<checkbox-group class="radio-group left" >
<label class="radio" wx:for-items="{{pays}}" wx:key="key" style='border-bottom:1px solid #eee;'>
<view style='width:100%;padding:13px 0;'>
<image class='img' src='{{item.icon}}' style='width:20px;height:20px;vertical-align:-5px;'></image> {{item.name}}
<switch bindchange="switchChange" checked="{{item.checked}}" data-index="{{index}}" data-check="{{item.value}}" class="right" style='vertical-align:2px;float:right;margin-bottom:15px;' />
</view>
</label>
</checkbox-group>
</view>
</view>
<view class='pay_bottom' wx:if="{{rstatus == 0}}" style='padding-top: 8px'>
<view class="font_12 red fl_r mr_5" style='border:0;height: 60px;width:100%;padding:0;' >
<form bindsubmit="payOrder" report-submit="true" style='width: 90px;height: 50px;float: right;padding-right:12px;'>
<button class="pay_foot" style='color:{{bgcolor}};border:1px solid {{bgcolor}};border-radius:30px;margin: 12px 0!important;font-size:14px;padding:0;width:90px;height:32px;line-height:32px;float:right' wx:if="{{rstatus == 0}}" data-pay="{{paytype}}" data-orderId="{{id}}" data-price="{{payment}}" data-ordersn="{{sNo}}" formType="submit" wx:if="{{rstatus == 0}}">立即支付</button>
</form>
<button class="pay_foot" style='color: #808080;height: 50px;border: 1px solid #808080;border-radius: 3px;margin-left: 10px;font-size: 13px;padding: 0;width: 90px;height: 30px;line-height: 30px;float:left' bindtap="t_index" data-order-id="{{id}}" >返回首页</button>
<view style='color:#808080;border-color:#808080;font-size:14px;width:60px;height:30px;line-height:30px;border-radius:30px;margin:12px 10px;float:right' class="font_12 red fl_r mr_5 " bindtap="removeOrder" wx:if="{{rstatus == 0}}" data-order-id="{{id}}">取消订单</view>
</view>
</view>
<view class='pay_bottom' wx:if="{{rstatus == 1}}" style='padding-top: 8px'>
<view class="font_12 red fl_r mr_5" style='border: 0;height: 60px;display: flex;justify-content: flex-end ;width: 100%;padding: 0;' >
<form bindsubmit="add_fromid" report-submit="true" >
<button class="pay_foot" style='color: #808080;height: 50px;border: 1px solid #808080;border-radius: 3px;margin: 0;font-size: 13px;padding: 0;width: 90px;height: 30px;line-height: 30px;' bindtap="t_index" data-order-id="{{id}}" >返回首页</button>
</form>
<button class="pay_foot" style='color: #fff;background: #FF6347;border-radius: 3px;margin: 0;font-size: 13px;padding: 0;width: 90px;height: 30px;line-height: 30px;' data-orderId="{{id}}" data-ordersn="{{sNo}}" open-type="contact" >联系客服</button>
</view>
<!-- <view wx:if="{{rstatus == 0}}" style='margin:15px 0 0 0;border-bottom:1px solid #eee;padding-bottom:15px'>
<view class="pay_zf pd">
<text class="left" style='font-size:15px;'>选择支付方式</text>
</view>
<view class="pay_zf pd" style='border-bottom:none'>
<checkbox-group class="radio-group left">
<label class="radio" wx:for-items="{{pays}}" wx:key="key" style='border-bottom:1px solid #eee;'>
<view style='width:100%;padding:13px 0;'>
<image class='img' src='{{item.icon}}' style='width:20px;height:20px;vertical-align:-5px;'></image> {{item.name}}
<switch bindchange="switchChange" checked="{{item.checked}}" data-index="{{index}}" data-check="{{item.value}}" class="right" style='vertical-align:2px;float:right;margin-bottom:15px;' />
</view>
</label>
</checkbox-group>
</view>
</view> -->
<view class='pay_bottom'>
<block wx:if="{{rstatus == 0}}">
<view class="normalBtn" bindtap="removeOrder" data-info="{{orderData}}">取消订单</view>
<view class="confirmBtn" bindtap="payNow" data-info="{{orderData}}">立即付款</view>
</block>
<block wx:elif="{{rstatus == 1}}">
<view class="confirmBtn" wx:if="{{orderData.delivery_status == 1}}" style="background-color:#ccc;color:white;border:0px;">提醒发货</view>
<view class="confirmBtn" wx:else bindtap="orderRemind" data-info="{{orderData}}">提醒发货</view>
</block>
<block wx:elif="{{rstatus == 2}}">
<view class="normalBtn" bindtap="orderLogistics" data-info="{{orderData}}">查看物流</view>
<view class="confirmBtn" bindtap="confirmOrder" data-info="{{orderData}}">确认收货</view>
</block>
<block wx:elif="{{rstatus == 5}}">
<view class="deleteBtn" bindtap="deleteOrder" data-info="{{orderData}}">删除订单</view>
<view class="normalBtn" bindtap="orderLogistics" data-info="{{orderData}}">查看物流</view>
<view class="confirmBtn" bindtap="evaluateOrder" data-info="{{orderData}}">立即评价</view>
</block>
</view>
<view class='pay_bottom' wx:if="{{rstatus != 0 && type1 == 11 && dr != 11}}" style='padding-top: 8px'>
<view class="font_12 red fl_r mr_5" style='border: 0;height: 60px;display: flex;justify-content: flex-end ;width: 100%;padding: 0;' >
<form bindsubmit="getUserformid" report-submit="true" >
<button class="pay_foot" style='color: #808080;border: 1px solid #808080;border-radius: 3px;margin: 0;font-size: 13px;padding: 0;width: 90px;height: 30px;line-height: 30px;' data-orderId="{{id}}" data-ordersn="{{sNo}}" formType="submit" >拼单详情</button>
<!-- <view class='pay_bottom' wx:if="{{rstatus != 0 && type1 == 11 && dr != 11}}" style='padding-top: 8px'>
<view class="font_12 red fl_r mr_5" style='border: 0;height: 60px;display: flex;justify-content: flex-end ;width: 100%;padding: 0;'>
<form bindsubmit="getUserformid" report-submit="true">
<button class="pay_foot" style='color: #808080;border: 1px solid #808080;border-radius: 3px;margin: 0;font-size: 13px;padding: 0;width: 90px;height: 30px;line-height: 30px;' data-orderId="{{id}}" data-ordersn="{{sNo}}" formType="submit">拼单详情</button>
</form>
<form bindsubmit="getUserformid" report-submit="true" >
<button class="pay_foot" style='color: #fff;background: #FF6347;border-radius: 3px;margin: 0;font-size: 13px;padding: 0;width: 90px;height: 30px;line-height: 30px;' data-orderId="{{id}}" data-ordersn="{{sNo}}" formType="submit" >分享好友</button>
<form bindsubmit="getUserformid" report-submit="true">
<button class="pay_foot" style='color: #fff;background: #FF6347;border-radius: 3px;margin: 0;font-size: 13px;padding: 0;width: 90px;height: 30px;line-height: 30px;' data-orderId="{{id}}" data-ordersn="{{sNo}}" formType="submit">分享好友</button>
</form>
</view>
</view>
</view>
</view> -->
<view class='pay_bottom' wx:if="{{rstatus != 0 && otype == 'pt'}}" style='padding-top: 8px'>
<view class="font_12 red fl_r mr_5" style='border: 0;height: 60px;display: flex;justify-content: flex-end ;width: 100%;padding: 0;' >
<navigator url="../group_buy/cantuan?id={{ptcode}}&groupid={{groupid}}&pro_id={{p_id}}&man_num={{man_num}}" >
<view style='color: #808080;border: 1px solid #808080;border-radius: 3px;margin: 0;font-size: 13px;padding: 0;width: 90px;height: 30px;line-height: 30px;' class="pay_foot">拼单详情</view>
</navigator>
<navigator url="../group_buy/cantuan?id={{ptcode}}&groupid={{groupid}}&pro_id={{p_id}}&man_num={{man_num}}" >
<view style='color: #fff;background: #FF6347;border-radius: 3px;margin: 0;font-size: 13px;padding: 0;width: 90px;height: 30px;line-height: 30px;' class="pay_foot">分享好友</view>
</navigator>
</view>
</view>
<!-- <view class='pay_bottom' wx:if="{{rstatus != 0 && otype == 'pt'}}" style='padding-top: 8px'>
<view class="font_12 red fl_r mr_5" style='border: 0;height: 60px;display: flex;justify-content: flex-end ;width: 100%;padding: 0;'>
<navigator url="../group_buy/cantuan?id={{ptcode}}&groupid={{groupid}}&pro_id={{p_id}}&man_num={{man_num}}">
<view style='color: #808080;border: 1px solid #808080;border-radius: 3px;margin: 0;font-size: 13px;padding: 0;width: 90px;height: 30px;line-height: 30px;' class="pay_foot">拼单详情</view>
</navigator>
<navigator url="../group_buy/cantuan?id={{ptcode}}&groupid={{groupid}}&pro_id={{p_id}}&man_num={{man_num}}">
<view style='color: #fff;background: #FF6347;border-radius: 3px;margin: 0;font-size: 13px;padding: 0;width: 90px;height: 30px;line-height: 30px;' class="pay_foot">分享好友</view>
</navigator>
</view>
</view> -->
</view>
</block>

127
pages/order/detail.wxss

@ -6,20 +6,50 @@ page{
width:95%;
margin:0 auto;
}
.status-view{
width: 100%;
position: relative;
}
.status-view image{
width: 100%;
height: 200rpx;
}
.statusLabel{
position: absolute;
margin-top: 50rpx;
margin-left: 40rpx;
color: white;
font-size: 40rpx;
font-weight: bold;
}
.statusDesc{
position: absolute;
margin-top: 120rpx;
margin-left: 40rpx;
color: white;
font-size: 28rpx;
}
.pay_foot{
margin:12px;
background:#fff;
border-radius:30px;
}
.pay_bottom{
height:60px;
position: fixed;
display: flex;
align-items: center;
bottom: 0;
height:70rpx;
width:100%;
background:#fff;
padding-bottom: env(safe-area-inset-bottom);
}
.sqsh{
color: #333;
}
.pay_bottom .pay_foot{margin:15px 12px 0 0;}
/* .pay_bottom .pay_foot{
margin:15px 12px 0 0;
} */
.swiper-tab{
width: 100%;
@ -60,35 +90,42 @@ page{
.shop{
background: #fff;
padding:4% 4% 4% 10px;
border-bottom: 1px solid #eee;
border-bottom: 2rpx solid #F4F5F6;
}
.shop checkbox{
margin-top: 27px;
}
.sh_slt{
width: 65px;
height: 65px;
width: 150rpx;
height: 150rpx;
overflow: hidden;
margin-right: 4%;
float: left;
}
.sp_text{
display:flex;
line-height: 20px;
align-items: center;
width: 100%;
text-align: left;
flex-wrap: wrap;
}
.sp_tit{
width: 100%;
height: 60rpx;
overflow: hidden;
font-size: 12px;
font-size: 15px;
-webkit-line-clamp:2;
}
.price{
font-size:16px;
color:#fc0628;
}
.guige{
font-size:12px;
color:#808080;
text-align:right;
position:absolute;
right: 35rpx;
font-size:12px;
color:#999;
text-align:right;
}
.sp_neb{
width: 100%;
@ -96,12 +133,6 @@ page{
font-size: 12px;
color: #999;
}
.sp_jg{
width: 30%;
font-size: 13px;
color: #fc0628;
height:120rpx;
}
.dle{
color: #999;
font-size: 12px;
@ -184,11 +215,13 @@ page{
/* border-top: 1px solid #eee; */
}
.top{
padding: 15px 4% 15px 10px;
/* margin-top:20rpx; */
padding: 15px 10px 5px 10px;
font-size:12px;
display: flex;
justify-content:space-between;
border-bottom: 1px solid #eee;
height: 60rpx;
}
.btn {
width: 50%;
@ -511,9 +544,11 @@ width:100%;
color: #808080;
}
.ddlb_v{
font-size: 28rpx;
color: #000;
display: flex;
justify-content: space-between;
height: 60rpx;
}
.anniu{
@ -556,6 +591,58 @@ button{
font-size: 10px;
}
.ddlb_v-lift {
width: 130rpx;
text-align: end;
}
width: 160rpx;
}
.shopView {
display:flex;
align-items: center;
height: 85rpx;
}
.shopView image {
width: 40rpx;
height: 40rpx;
margin-left: 25rpx;
}
.shopView text{
margin-left: 12rpx;
font-size: 32rpx;
color: #333333;
}
.shopView .jiantou-img {
width: 25rpx;
height: 25rpx;
margin-left: 20rpx;
}
.normalBtn{
position: absolute;
right: 225rpx;
padding: 5rpx 22rpx;
font-size: 28rpx;
color: #999999;
border: 1px solid #FA5151;
height: 50rpx;
line-height: 50rpx;
border-radius: 50rpx;
}
.confirmBtn{
position: absolute;
right: 45rpx;
padding: 5rpx 22rpx;
font-size: 28rpx;
color: #FA5151;
border: 1px solid #FA5151;
height: 50rpx;
line-height: 50rpx;
border-radius: 50rpx;
}
.deleteBtn{
position: absolute;
right: 410rpx;
padding: 5rpx 22rpx;
font-size: 28rpx;
color: #999999;
border: 1px solid #FA5151;
height: 50rpx;
line-height: 50rpx;
border-radius: 50rpx;
}

67
pages/order/pay.js

@ -73,10 +73,9 @@ Page({
},
onLoad: function (options) {
console.log(app.globalData)
console.log(options)
var that = this;
that.get_plug();
// that.get_plug();
var uid = app.globalData.userInfo.openid; // 微信id
var plug_ins = app.globalData.userInfo.plug_ins; // 插件
@ -104,38 +103,38 @@ Page({
// util.getUesrBgplus(that, app, false) //刷新显示购物车数量
var cartid = that.data.cartId
var type = that.data.type
if (type == 1) { //直接结算离开页面清除购物车数量
wx.request({
url: app.d.ceshiUrl + '&action=product&m=delcart',
method: 'post',
data: {
carts: that.data.cartId, // 购物车id
},
header: {
'Content-Type': 'application/x-www-form-urlencoded'
},
success: function (res) {
var status = res.data.status;
if (status == 1) {
that.setData({
remind: false
});
} else {
that.setData({
remind: true
});
// if (type == 1) { //直接结算离开页面清除购物车数量
// wx.request({
// url: app.d.ceshiUrl + '&action=product&m=delcart',
// method: 'post',
// data: {
// carts: that.data.cartId, // 购物车id
// },
// header: {
// 'Content-Type': 'application/x-www-form-urlencoded'
// },
// success: function (res) {
// var status = res.data.status;
// if (status == 1) {
// that.setData({
// remind: false
// });
// } else {
// that.setData({
// remind: true
// });
}
},
error: function (e) {
wx.showToast({
title: '网络异常!',
duration: 2000
});
}
});
}
// }
// },
// error: function (e) {
// wx.showToast({
// title: '网络异常!',
// duration: 2000
// });
// }
// });
// }
},
onShow: function () {
@ -164,7 +163,7 @@ Page({
WXAPI.settlement({
accessId: app.globalData.accessId,
storeId: 239,
cart_id: '',
cart_id: that.data.cartId,
coupon_id: 0,
vipSource: 0,
canshu: true,
@ -526,7 +525,7 @@ Page({
accessId: app.globalData.accessId,
storeId: 239,
storeType: 1,
cart_id: '',
cart_id: that.data.cartId,
address_id: that.data.addrId,
coupon_id: 0,
remarks: '',

10
pages/order/payment.wxml

@ -1,5 +1,5 @@
<!--pages/order/payment.wxml-->
<view class="container">
<view class="container">
<view class="codeView">
<text class="name">订单编号:</text>
<text class="order">{{orderId}}</text>
@ -35,5 +35,9 @@
<view class="title">如有其他问题,请联系客服</view>
<image src="/images/QR_code.png" mode="aspectFill"></image>
</view>
</view>
<view class="serviceView">
<view class="serviceBtn">联系客服</view>
<button class="service" open-type="contact" session-from="wxapp" ></button>
</view>
</view>

31
pages/order/payment.wxss

@ -113,4 +113,35 @@ page {
margin-top: 30rpx;
width: 320rpx;
height: 320rpx;
}
.serviceView{
padding-top: 25rpx;
height: 100rpx;
width: 100%;
background-color: #F6F6FB;
position:relative;
}
.service{
opacity:0;
margin-top: 25rpx;
margin-left: 60rpx;
position:absolute;
height: 70rpx;
width: 630rpx;
}
.serviceView .serviceBtn{
position:absolute;
margin-top: 25rpx;
margin-left: 60rpx;
display: flex;
align-items: center;
justify-content: center;
height: 70rpx;
width: 630rpx;
text-align: center;
line-height: 70rpx;
font-size: 28rpx;
color: white;
background-color: #F53C45;
border-radius: 35rpx;
}

7
pages/product/detail.js

@ -152,10 +152,6 @@ Page({
var that = this;
var choujiangid = that.data.choujiangid;
var openid = app.globalData.userInfo.openid;
// console.log(app.globalData.userInfo, 'openid')
// if (openid) {
var bgcolor = app.d.bgcolor;
WXAPI.productIndex({
accessId: app.globalData.accessId,
storeId: 239,
@ -168,7 +164,6 @@ Page({
var content = pro.content;
WxParse.wxParse('content', 'html', content, that, 5);
that.setData({
bgcolor: bgcolor,
itemData: pro,
kucun: pro.num,
bannerItem: pro.img_arr,
@ -578,7 +573,7 @@ Page({
// productArr.push({})
let jsonstr = JSON.stringify(productArr)
wx.navigateTo({
url: '../order/pay?product=' + jsonstr + '&cart_id=' + that.data.cart_id,
url: '../order/pay?product=' + jsonstr + '&cartId=',
});
},
bindChange: function (e) {//滑动切换tab

10
pages/user/user.wxss

@ -130,13 +130,13 @@ border-radius:5px;
color:#fff;
background:red;
border-radius:50%;
right:6px;
top:6px;
right:15px;
top:8px;
font-size:12px;
width:40rpx;
height:40rpx;
width:38rpx;
height:38rpx;
text-align:center;
line-height:40rpx;
line-height:38rpx;
opacity:0.8;
}
.function_left{

36
utils/server.js

@ -82,6 +82,18 @@ module.exports = {
cartIndex: (data) => { //购物车
return requestServer('&action=cart&app=index', 'post', data)
},
productAddCart: (data) => { //加入购物车
return requestServer('&action=product&app=add_cart', 'post', data)
},
productUpNum: (data) => { //购物车商品添加数量
return requestServer('&action=cart&app=up_cart', 'post', data)
},
productDelcart: (data) => { //删除购物车
return requestServer('&action=cart&app=delcart', 'post', data)
},
productDelAllCart: (data) => { //清空购物车
return requestServer('&action=cart&app=delAll_cart', 'post', data)
},
/* 我的 */
userIndex: (data) => { //个人中心
return requestServer('&action=user&app=index', 'post', data)
@ -99,11 +111,7 @@ module.exports = {
settlement: (data) => { //确认订单信息
return requestServer('&action=order&app=Settlement', 'post', data)
},
productAddCart: (data) => { //加入购物车
return requestServer('&action=product&app=add_cart', 'post', data)
},
//确认订单 payment
orderPayment: (data) => {
orderPayment: (data) => { //确认订单 payment
return requestServer('&action=order&app=payment', 'post', data)
},
leaveSettlement: (data) => {
@ -124,8 +132,7 @@ module.exports = {
getLocation: (data) => { //获取地址信息
return requestServer('&action=index&app=get_location', 'post', data)
},
//确认订单 payment
orderList: (data) => {
orderList: (data) => { //订单列表
return requestServer('&action=order&app=index', 'post', data)
},
orderDetails: (data) => { //订单详情
@ -162,21 +169,12 @@ module.exports = {
return requestServer('&action=product&m=to_Collection', 'post', data)
},
productUpcart: (data) => {
return requestServer('&action=product&m=up_cart', 'post', data)
},
productDelAllCart: (data) => { //清空
return requestServer('&action=product&m=delAll_cart', 'post', data)
},
// productShopping: (data) => {
// return requestServer('&action=product&m=Shopping', 'post', data)
// },
productDelcart: (data) => { //删除
return requestServer('&action=product&m=delcart', 'post', data)
},
addressManagement: (data) => { //添加地址
return requestServer('&action=user&app=AddressManagement', 'post', data)
},
preservation: (data) => {
return requestServer('&action=user&m=Preservation', 'post', data)
},

Loading…
Cancel
Save