Browse Source

地址编辑优化

新增公对公支付
master
杜叶春 2 years ago
parent
commit
dc1d5241f1
  1. BIN
      images/公对公.png
  2. 10
      pages/address/address.js
  3. 5
      pages/address/address.wxml
  4. 13
      pages/address/address.wxss
  5. 11
      pages/address/index.wxml
  6. 4
      pages/address/index.wxss
  7. 15
      pages/address/upaddress.js
  8. 4
      pages/address/upaddress.wxml
  9. 12
      pages/address/upaddress.wxss
  10. 2
      pages/cart/cart.js
  11. 40
      pages/index/index.js
  12. 1
      pages/new/new.js
  13. 188
      pages/order/order.js
  14. 3
      pages/order/order.wxss
  15. 4
      pages/order/pay.js
  16. 9
      pages/order/payment.js
  17. 48
      pages/user/user.js
  18. 3
      pages/user/user.json
  19. 10
      pages/user/user.wxml
  20. 23
      pages/user/user.wxss

BIN
images/公对公.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

10
pages/address/address.js

@ -9,12 +9,20 @@ Page({
region: ['请选择','',''],
value: [0, 0, 0],
cartId: 0,
check: false,
},
bindRegionChange: function (e) {
this.setData({
region: e.detail.value
})
},
// 设置默认地址
switchChange: function (e) {
var that = this;
that.setData({
check: e.detail.value
});
},
/**
* 生命周期函数--监听页面加载
*/
@ -69,7 +77,7 @@ Page({
user_name: e.detail.value.user_name,
mobile: e.detail.value.mobile,
place: region[0]+'-'+region[1]+'-'+region[2],
is_default: 0,
is_default: this.data.check==true?1:0,
address: e.detail.value.address,
}).then(res => {
if (res.code == 200) {

5
pages/address/address.wxml

@ -24,6 +24,11 @@
<view class="section_title">详细地址:</view>
<input name="address" type="text" value="{{address}}" placeholder="详细地址"/>
</view>
<view class="section">
<view class="section_title">默认地址</view>
<switch class="section_switch" bindchange="switchChange" color="#FA5151" checked="{{check}}" />
</view>
<view class="btn-area">
<button formType="submit" style='background-color:#FF6347;'>保存</button>
</view>

13
pages/address/address.wxss

@ -3,10 +3,12 @@
padding: 10px;
border-bottom: 1px solid #dadada;
width:95%;
display: flex;
align-items: center;
}
.section_right{
float:right;
margin-top:-21px;
position: absolute;
right: 28rpx;
}
.xzdq{
width: 0;
@ -16,7 +18,11 @@ margin-top:-21px;
width: 10px;
height: 10px;
}
.section_switch{
position: absolute;
right: 8rpx;
transform: scale(0.7);
}
.section_1{
text-align: center;
padding: 10px;
@ -50,7 +56,6 @@ margin-left:16px;
.btn-area{
color:#ffffff !important;
}
.animation-element-wrapper {
display: flex;
position: fixed;

11
pages/address/index.wxml

@ -12,7 +12,7 @@
<text class="address-phone">{{item.tel}}</text>
</view>
<view class="address-info">{{item.address_xq}}</view>
<navigator class='address_img_div' url="../address/upaddress?addr_id={{item.id}}&name={{item.name}}&tel={{item.tel}}&sheng={{item.sheng}}&city={{item.city}}&quyu={{item.quyu}}&address={{item.address}}">
<navigator class='address_img_div' url="../address/upaddress?addr_id={{item.id}}&name={{item.name}}&tel={{item.tel}}&sheng={{item.sheng}}&city={{item.city}}&quyu={{item.quyu}}&address={{item.address}}&is_default={{item.is_default}}">
<image src='/images/x_right.png' class='address_img'></image>
</navigator>
</view>
@ -28,19 +28,14 @@
<!-- <text hidden="{{item.is_default==0?false:true}}"> | </text> -->
<view class="address-icon">
<view wx:if="{{!flag}}" bindtap="setDefault" data-id="{{item.id}}">
<radio checked="{{item.is_default==1?true:false}}" value="{{index}}" style='margin:auto' color='#FF6347' />
<text class='address_text'>设置默认地址</text>
</view>
<text class='address_text' wx:if="{{item.is_default==1}}">默认地址</text>
<view wx:if="{{flag}}" class='add_icon'>
<icon wx:if="{{item.selected}}" type="success_circle" size="26" bindtap="bindCheckbox" data-index="{{index}}" class='address_icon' />
<icon wx:else type="circle" size="26" bindtap="bindCheckbox" data-index="{{index}}" class='address_icon' />
</view>
</view>
<navigator style='display:inline-block;' url="../address/upaddress?addr_id={{item.id}}&name={{item.name}}&tel={{item.tel}}&sheng={{item.sheng}}&city={{item.city}}&quyu={{item.quyu}}&address={{item.address}}">
<navigator style='display:inline-block;' url="../address/upaddress?addr_id={{item.id}}&name={{item.name}}&tel={{item.tel}}&sheng={{item.sheng}}&city={{item.city}}&quyu={{item.quyu}}&address={{item.address}}&is_default={{item.is_default}}">
<text style='margin:10px'>编辑</text>
</navigator>
<text data-id="{{item.id}}" bindtap="delAddress">删除</text>

4
pages/address/index.wxss

@ -9,9 +9,7 @@ page {
overflow-x: hidden;
}
.address_text{
position: absolute;
top: 2px;
left:30px;
margin-left: 0rpx;
color: #FF6347;
}
.add_icon{

15
pages/address/upaddress.js

@ -13,7 +13,15 @@ Page({
data: {
region: ['请选择','',''],
value: [0, 0, 0],
address: ''
address: '',
check: false,
},
// 设置默认地址
switchChange: function (e) {
var that = this;
that.setData({
check: e.detail.value
});
},
// 下拉刷新
onPullDownRefresh: function () {
@ -42,7 +50,8 @@ Page({
region.push(options.quyu)
this.setData({
address: options,
region: region
region: region,
check: options.is_default==0?false:true
});
},
/**
@ -82,7 +91,7 @@ Page({
user_name: e.detail.value.user_name,
mobile: e.detail.value.mobile,
place: region[0]+'-'+region[1]+'-'+region[2],
is_default: 0,
is_default: that.data.check==true?1:0,
address: e.detail.value.address,
addr_id: that.data.address.addr_id,
}).then(res => {

4
pages/address/upaddress.wxml

@ -22,6 +22,10 @@
<view class="section">
<view class="section_title">详细地址:</view>
<input name="address" type="text" value="{{address.address}}" placeholder="详细地址"/>
</view>
<view class="section">
<view class="section_title">默认地址</view>
<switch class="section_switch" bindchange="switchChange" color="#FA5151" checked="{{check}}" />
</view>
<view class="btn-area">
<button formType="submit" style='background-color:#FE6347;'>保存</button>

12
pages/address/upaddress.wxss

@ -3,10 +3,12 @@
padding: 10px;
border-bottom: 1px solid #dadada;
width:95%;
display: flex;
align-items: center;
}
.section_right{
float:right;
margin-top:-21px;
position: absolute;
right: 28rpx;
}
.xzdq{
width: 0;
@ -16,7 +18,11 @@
width: 10px;
height: 10px;
}
.section_switch{
position: absolute;
right: 8rpx;
transform: scale(0.7);
}
.section_1{
text-align: center;
padding: 10px;

2
pages/cart/cart.js

@ -388,7 +388,7 @@ Page({
if (res.code == 200) {
var data = res.data;
that.setData({
carts: data.list,
carts: data.data,
selectedAllStatus: false,
total: '¥0.00',
remind: ''

40
pages/index/index.js

@ -476,26 +476,26 @@ Page({
});
},
onShareAppMessage: function (res) {
var that = this;
var id = that.data.productId;
var type1 = that.data.type1;
var uname = app.globalData.userInfo.nickName ? app.globalData.userInfo.nickName : '';
var title = uname + '邀请你来' + that.data.mch_name;
var user_id = app.globalData.userInfo.user_id;
if (res.from === 'button') {
// 来自页面内转发按钮
}
return {
title: title,
imageUrl: that.data.logo,
path: 'pages/index/index?userid=' + user_id,
success: function (_res) {
console.log('转发成功');
},
fail: function (_res) {
console.log('转发失败')
}
}
// var that = this;
// var id = that.data.productId;
// var type1 = that.data.type1;
// var uname = app.globalData.userInfo.nickName ? app.globalData.userInfo.nickName : '';
// var title = uname + '邀请你来' + that.data.mch_name;
// var user_id = app.globalData.userInfo.user_id;
// if (res.from === 'button') {
// // 来自页面内转发按钮
// }
// return {
// title: title,
// imageUrl: that.data.logo,
// path: 'pages/index/index?userid=' + user_id,
// success: function (_res) {
// console.log('转发成功');
// },
// fail: function (_res) {
// console.log('转发失败')
// }
// }
},
});

1
pages/new/new.js

@ -164,6 +164,7 @@ Page({
accessId: app.globalData.accessId,
storeId: 239,
storeType: 1,
// page: page,
}).then(res => {
if (res.code == 200) {
var data = res.data;

188
pages/order/order.js

@ -8,7 +8,7 @@ Page({
// tab切换
currentTab: 0,
isStatus: 'payment', //1待付款,2待发货,3待收货 4、5已完成
page: 0,
page: 1,
refundpage: 0,
ordert0: [],
ordert1: [],
@ -143,6 +143,8 @@ Page({
storeId: 239,
storeType: 1,
queryOrderType: that.data.isStatus,
page: 1,
pagesize: 100,
}).then(res => {
if (res.code == 200) {
var data = res.data;
@ -193,67 +195,87 @@ Page({
}
}
});
// wx.request({
// url: app.d.ceshiUrl + '&action=order&m=index',
// method: 'post',
// data: {
// openid: app.globalData.userInfo.openid,
// order_type: that.data.isStatus,
// otype: that.data.otype,
// },
// header: {
// 'Content-Type': 'application/x-www-form-urlencoded'
// },
// success: function (res) {
// var status = res.data.status;
// var order = res.data.order;
// switch (that.data.currentTab) {
// case 0:
// that.setData({
// ordert0: order,
// });
// break;
// case 5:
// that.setData({
// ordert0: order,
// });
// break;
// case 6:
// that.setData({
// ordert0: order,
// });
// break;
// case 1:
// that.setData({
// ordert1: order,
// });
// break;
// case 2:
// that.setData({
// ordert2: order,
// });
// break;
// case 3:
// that.setData({
// ordert3: order,
// });
// break;
// case 4:
// that.setData({
// ordert4: order,
// });
// break;
// }
// //console.log(that.data.ordert0)
// },
// fail: function () {
// // fail
// wx.showToast({
// title: '网络异常!',
// duration: 2000
// });
// }
// });
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
// this.getMore();
},
// 点击加载更多
getMore: function (e) {
var that = this;
var page = that.data.page+1;
WXAPI.orderList({
accessId: app.globalData.accessId,
storeId: 239,
storeType: 1,
queryOrderType: that.data.isStatus,
page: page,
}).then(res => {
if (res.code == 200) {
var data = res.data;
//成功返回设置数据
if (data == '') {
that.setData({
loading: false,
});
return;
} else {
switch (that.data.currentTab) {
case 0:
var orderList = that.data.ordert0;
orderList.push(...data.order)
that.setData({
ordert0: orderList,
});
break;
case 5:
var orderList = that.data.ordert0;
orderList.push(...data.order)
that.setData({
ordert0: orderList,
});
break;
case 6:
var orderList = that.data.ordert0;
orderList.push(...data.order)
that.setData({
ordert0: orderList,
});
break;
case 1:
var orderList = that.data.ordert1;
orderList.push(...data.order)
that.setData({
ordert1: orderList,
});
break;
case 2:
var orderList = that.data.ordert2;
orderList.push(...data.order)
that.setData({
ordert2: orderList,
});
break;
case 3:
var orderList = that.data.ordert3;
orderList.push(...data.order)
that.setData({
ordert3: orderList,
});
break;
case 4:
var orderList = that.data.ordert4;
orderList.push(...data.order)
that.setData({
ordert4: orderList,
});
break;
}
}
}
});
},
// 确认收货
recOrder: function (e) {
@ -464,7 +486,7 @@ Page({
var orderId = res.data.sNo; // 订单号
var oid = res.data.id; // 订单id
//发送信息到客户
that.notice(oid, order_sn, price, user_id, form_id, f_pname);
// that.notice(oid, order_sn, price, user_id, form_id, f_pname);
wx.showModal({
content: "支付成功!",
showCancel: false,
@ -500,26 +522,26 @@ Page({
})
},
//发送数据到客户微信上
notice: function (order_id, order_sn, price, user_id, form_id, f_pname) {
wx.request({
url: app.d.ceshiUrl + '&action=getcode&m=Send_Prompt',
method: 'post',
data: {
page: 'pages/order/detail?orderId=' + order_id,
order_sn: order_sn,
price: price,
user_id: user_id,
form_id: form_id,
f_pname: f_pname
},
header: {
'Content-Type': 'application/x-www-form-urlencoded'
},
success: function (res) {
console.log(res)
}
})
},
// notice: function (order_id, order_sn, price, user_id, form_id, f_pname) {
// wx.request({
// url: app.d.ceshiUrl + '&action=getcode&m=Send_Prompt',
// method: 'post',
// data: {
// page: 'pages/order/detail?orderId=' + order_id,
// order_sn: order_sn,
// price: price,
// user_id: user_id,
// form_id: form_id,
// f_pname: f_pname
// },
// header: {
// 'Content-Type': 'application/x-www-form-urlencoded'
// },
// success: function (res) {
// console.log(res)
// }
// })
// },
escOrder: function (e) {
var that = this,
id = e.target.dataset.orderId;

3
pages/order/order.wxss

@ -32,7 +32,8 @@ page{
height: 100%;
width: 100%;
overflow: hidden;
/* margin-top: 20px */
/* iPhoneX底部适配 */
padding-bottom: env(safe-area-inset-bottom);
}
.clearbutton{

4
pages/order/pay.js

@ -186,7 +186,7 @@ Page({
}
var pays = []
if (data.payment.bank_pay == 1) {
pays.push({'name':'银行转账','icon':'/images/order_success.png'})
pays.push({'name':'公对公支付','icon':'/images/公对公.png'})
}
// if (data.payment.wallet_pay == 1) {
// pays.push({'name':'余额支付','icon':'/images/wx.png'})
@ -536,7 +536,7 @@ Page({
remarks: '',
vipSource: 0,
product: that.data.productAry,
pay_type: '',
pay_type: 'bank_pay',
}).then(res => {
if (res.code == 200) {
var data = res.data

9
pages/order/payment.js

@ -60,7 +60,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
// wx.hideHomeButton(); //隐藏返回主页按钮
},
/**
@ -74,7 +74,12 @@ Page({
* 生命周期函数--监听页面卸载
*/
onUnload() {
wx.navigateBack({
delta: 3
})
wx.navigateTo({
url: '/pages/order/order?currentTab=0&otype=pay',
})
},
/**

48
pages/user/user.js

@ -5,35 +5,35 @@ Page({
data: {
pop: null,
list: [
{
icon: 'icon-user-bangding.png',
text: '完善资料',
url: 'bangding/bangding'
}, {
icon: 'wdsc.png',
text: '我的收藏',
url: 'collection/collection'
},
{
icon: 'zj.png',
text: '历史记录',
url: 'footprint/footprint'
},
// {
// icon: 'icon-user-bangding.png',
// text: '完善资料',
// url: 'bangding/bangding'
// }, {
// icon: 'wdsc.png',
// text: '我的收藏',
// url: 'collection/collection'
// },
// {
// icon: 'zj.png',
// text: '历史记录',
// url: 'footprint/footprint'
// },
{
icon: 'dz.png',
text: '地址管理',
url: 'address/index'
},
{
icon: 'gg.png',
text: '公告管理',
url: 'notice/notice'
},
{
icon: 'sz.png',
text: '设置',
url: 'set/set'
}
// {
// icon: 'gg.png',
// text: '公告管理',
// url: 'notice/notice'
// },
// {
// icon: 'sz.png',
// text: '设置',
// url: 'set/set'
// }
],
cont: 1,
remind: '加载中',

3
pages/user/user.json

@ -1,4 +1,5 @@
{
"usingComponents": {},
"navigationBarTitleText": "个人中心"
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#eeeeee"
}

10
pages/user/user.wxml

@ -27,16 +27,13 @@
<view style='width:100%;height:100%'>
<!-- 用户基本信息 -->
<view class='user_top' style="background-color:{{bgcolor}}">
<view class='user_top_two'>
<image style='display:block;' class='user_top_image' src="{{user.headimgurl ? user.headimgurl:'/images/heads.png'}}" />
<block wx:if="{{user.mobile}}">
<view class='user_mc' bindtap="copyText" data-text="{{user.user_id}}" style='display:block;'>
<view>{{user.user_name}}</view>
<text class='username_font'>用户ID:{{user.user_id}}</text>
<text class='username_font' wx:if="{{tjr}}" style="margin-left: 16px;">{{tjr}}</text>
<view class='user_name'>{{user.user_name}}</view>
<text class='userid_font'>用户ID:{{user.user_id}}</text>
<text class='userid_font' wx:if="{{tjr}}" style="margin-left: 16px;">{{tjr}}</text>
</view>
</block>
<block wx:else>
@ -112,7 +109,6 @@
</view>
<!-- </navigator> -->
</view>
</view>
<!-- 功能列表 -->

23
pages/user/user.wxss

@ -12,15 +12,17 @@ page{
text{
font-size: 16px;
}
.username_font{
.userid_font{
font-size: 13px;
}
.user_mc{
/* margin-top:-35px; */
font-size:32px;
margin-left:35px;
/* margin-top:8px; */
margin-left:20px;
color: #333333;
}
.user_name{
font-size:28px;
}
.user_top{
height:420rpx;
}
@ -29,6 +31,7 @@ text{
display:flex;
flex-direction:row;
justify-content:flex-start;
align-items: center;
padding-left:20px;
padding-bottom:20px;
padding-top:10px;
@ -53,10 +56,10 @@ margin-bottom:10px;
border-radius:5px;
}
.user_top_image{
width:80px;
height: 80px;
border-radius:100px;
border:2px solid #fff;
width: 75px;
height: 75px;
border-radius:50%;
border:1px solid #fff;
}
@ -127,8 +130,8 @@ border-radius:5px;
color:#fff;
background:red;
border-radius:50%;
right:2px;
top:4px;
right:6px;
top:6px;
font-size:12px;
width:40rpx;
height:40rpx;

Loading…
Cancel
Save