Browse Source

订单详情地址选择问题修复

地址管理删除修复
商品详情数据不显示修复
申请售后提交完成数据显示问题
master
杜叶春 2 years ago
parent
commit
7ff20ccd89
  1. 8
      app.js
  2. 14
      pages/address/index.js
  3. 13
      pages/address/index.wxml
  4. 5
      pages/address/index.wxss
  5. 5
      pages/address/upaddress.js
  6. 20
      pages/aftersales/aftersales.wxml
  7. 12
      pages/aftersales/apply.js
  8. 6
      pages/aftersales/apply.wxml
  9. 12
      pages/aftersales/apply.wxss
  10. 39
      pages/comment/comment.js
  11. 2
      pages/listdetail/listdetail.js
  12. 7
      pages/login/login.wxml
  13. 6
      pages/login/register.wxml
  14. 32
      pages/login/register.wxss
  15. 10
      pages/order/order.js
  16. 7
      pages/order/pay.js
  17. 2
      pages/order/pay.wxml
  18. 5
      pages/order/payment.js
  19. 19
      pages/product/detail.js
  20. 4
      pages/product/detail.wxml
  21. 2
      pages/product/detail.wxss
  22. 2
      utils/server.js

8
app.js

@ -158,6 +158,14 @@ App({
}); });
} }
}, },
//提示弹窗
toast: function (msg) {
wx.showToast({
title: msg,
icon: 'none',
duration: 2000
})
},
globalData: { globalData: {
userInfo: {}, userInfo: {},
isLogin: false, isLogin: false,

14
pages/address/index.js

@ -8,7 +8,8 @@ Page({
num: 0, num: 0,
flag: false, flag: false,
cartId: 0, cartId: 0,
numbers: "" numbers: "",
productStr: ""
}, },
// 下拉刷新 // 下拉刷新
onPullDownRefresh: function () { onPullDownRefresh: function () {
@ -71,7 +72,11 @@ Page({
onLoad: function (options) { onLoad: function (options) {
console.log(options)
var that = this; var that = this;
that.setData({
productStr: options.product,
})
// 页面初始化 options为页面跳转所带来的参数 // 页面初始化 options为页面跳转所带来的参数
// if (options.cartId) { // if (options.cartId) {
// var cartId = options.cartId; // var cartId = options.cartId;
@ -263,7 +268,12 @@ Page({
}); });
} }
}); });
},
// 返回结算页面
chooseBack: function (e) {
wx.navigateBack()
var addressId = e.currentTarget.dataset.id
wx.setStorageSync('addressId', addressId);
}, },
// 数据加载 // 数据加载
DataonLoad: function () { DataonLoad: function () {

13
pages/address/index.wxml

@ -1,9 +1,9 @@
<!--地址管理--> <!--地址管理-->
<view class='top-ql' wx:if="{{address !=''}}"> <!-- <view class='top-ql' wx:if="{{address !=''}}">
<view wx:if="{{!flag}}" bindtap="upflag" class='top-ql-1' style='color:#333;'>地址管理</view> <view wx:if="{{!flag}}" bindtap="upflag" class='top-ql-1' style='color:#333;'>地址管理</view>
<view wx:else class='top-ql-1' bindtap="uptrue" style='color:#f60;'>完成</view> <view wx:else class='top-ql-1' bindtap="uptrue" style='color:#f60;'>完成</view>
</view> </view> -->
<radio-group class="radio-group" wx:for="{{address}}" wx:key="key"> <radio-group class="radio-group" wx:for="{{address}}" wx:key="key" data-id="{{item.id}}" bindtap="chooseBack">
<view hidden="{{hiddenAddress}}" class="address"> <view hidden="{{hiddenAddress}}" class="address">
<view class="address-detail"> <view class="address-detail">
<view class='address_div'> <view class='address_div'>
@ -23,17 +23,12 @@
<text hidden="{{item.is_default==0?false:true}}"></text> <text hidden="{{item.is_default==0?false:true}}"></text>
</view> </view>
<view> <view>
<!-- <text hidden="{{item.is_default==0?false:true}}" bindtap="setDefault" data-id="{{item.id}}">设置默认</text> -->
<!-- <text hidden="{{item.is_default==0?false:true}}"> | </text> -->
<view class="address-icon"> <view class="address-icon">
<text class='address_text' wx:if="{{item.is_default==1}}">默认地址</text>
<view wx:if="{{flag}}" class='add_icon'> <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: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' /> <icon wx:else type="circle" size="26" bindtap="bindCheckbox" data-index="{{index}}" class='address_icon' />
</view> </view>
<text class='address_text' wx:if="{{item.is_default==1}}">默认地址</text>
</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}}&is_default={{item.is_default}}"> <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> <text style='margin:10px'>编辑</text>

5
pages/address/index.wxss

@ -8,8 +8,11 @@ page {
width: 100%; width: 100%;
overflow-x: hidden; overflow-x: hidden;
} }
.radio-group {
margin-top: 35rpx;
}
.address_text{ .address_text{
margin-left: 0rpx; margin-left: 10rpx;
color: #FF6347; color: #FF6347;
} }
.add_icon{ .add_icon{

5
pages/address/upaddress.js

@ -16,6 +16,11 @@ Page({
address: '', address: '',
check: false, check: false,
}, },
bindRegionChange: function (e) {
this.setData({
region: e.detail.value
})
},
// 设置默认地址 // 设置默认地址
switchChange: function (e) { switchChange: function (e) {
var that = this; var that = this;

20
pages/aftersales/aftersales.wxml

@ -52,23 +52,3 @@
</view> </view>
</view> </view>
</view> </view>
<!-- <view class="w100">
<view class="p_all">请填写售后信息</view>
<form bindsubmit="submitReturnData">
<view class="p_all01 mt10 bg" bindtap="actionSheetTap">
<view class="text">
<text class='t_3'>选择售后类型: </text>{{itemList_text}}
</view>
</view>
<view class="p_all01 mt10 bg">
<view >
<textarea class="min_60 inputStyle" auto-height name="remark" placeholder="请填写原因" value="{{remark}}"/>
</view>
</view>
<view class="p_all01 mtt0">
<view class="btnGreen">
<button style='background:{{bgcolor}};color:#fff;border-radius:5px;' id="btnPay" formType="submit">确定</button>
</view>
</view>
</form>
</view> -->

12
pages/aftersales/apply.js

@ -100,8 +100,12 @@ Page({
} }
}, },
remarkInput: function(e) { remarkInput: function(e) {
var remark = e.detail.value
if (remark.length > 100) {
return;
}
this.setData({ this.setData({
remark: e.detail.value remark: remark
}) })
}, },
confirmAct() { confirmAct() {
@ -128,7 +132,7 @@ Page({
} else { } else {
wx.uploadFile({ wx.uploadFile({
url: 'https://mall.gylservice.com/gw?api=app.order.ReturnData', url: 'https://mall.gylservice.com/gw?api=app.order.ReturnData',
filePath: this.data.srcList[0].tempFilePath, filePath: that.data.srcList[0].tempFilePath,
name: 'file', name: 'file',
header: { header: {
'content-type': 'multipart/form-data' 'content-type': 'multipart/form-data'
@ -146,11 +150,11 @@ Page({
refund_apply_money: that.data.re_price, refund_apply_money: that.data.re_price,
}, // HTTP 请求中其他额外的 form data }, // HTTP 请求中其他额外的 form data
success: function (res) { success: function (res) {
console.log(res);
var data = JSON.parse(res.data) var data = JSON.parse(res.data)
console.log(that.data.srcList);
that.setData({ that.setData({
return_suess: true, return_suess: true,
order: data order: data.data,
}); });
}, },
fail: function (res) { fail: function (res) {

6
pages/aftersales/apply.wxml

@ -114,8 +114,10 @@
</view> </view>
<view class="end_message"> <view class="end_message">
<view class="end_lef">上传凭证:</view> <view class="end_lef">上传凭证:</view>
<view class="evaluat_li" wx:for="{{srcList}}" wx:key="index"> <view class="flex">
<image class="evaluat_img" src="{{item}}" bindtap="touchstart" /> <view class="re_photo" wx:for="{{srcList}}" wx:key='index'>
<image src="{{item.tempFilePath}}" mode="" />
</view>
</view> </view>
</view> </view>
</view> </view>

12
pages/aftersales/apply.wxss

@ -295,7 +295,7 @@ yh-return_suess-view {
.end_lef { .end_lef {
text-align: justify; text-align: justify;
width: 150rpx; width: 160rpx;
height: 39rpx; height: 39rpx;
color: #666; color: #666;
} }
@ -308,3 +308,13 @@ yh-return_suess-view {
width: 100%; width: 100%;
background-color: #eee; background-color: #eee;
} }
.re_photo {
width: 120rpx;
height: 120rpx;
margin-right: 10rpx;
}
.re_photo image {
width: 100%;
height: 100%;
}

39
pages/comment/comment.js

@ -16,27 +16,26 @@ Page({
}, },
onLoad: function (options) { onLoad: function (options) {
that = this; that = this;
var orderId = options.ordersn; // 订单号 var orderId = options.id;
var user_id = app.globalData.userInfo.openid; // 微信id // var user_id = app.globalData.userInfo.openid; // 微信id
var pid = options.pid; // 商品id // var pid = options.pid; // 商品id
var attribute_id = options.attribute_id; // 属性id // var attribute_id = options.attribute_id; // 属性id
if (pid) { // if (pid) {
pid = pid; // pid = pid;
} else { // } else {
pid = ''; // pid = '';
} // }
if (attribute_id) { // if (attribute_id) {
attribute_id = attribute_id; // attribute_id = attribute_id;
} else { // } else {
attribute_id = ''; // attribute_id = '';
} // }
WXAPI.commentList({ WXAPI.commentInfo({
accessId: app.globalData.accessId, access_id: app.globalData.accessId,
storeId: 239, store_id: 239,
storeType: 1, storeType: 1,
order_id: orderId, // 订单号 language: '',
pid: pid, // 商品id order_details_id: orderId,
attribute_id: attribute_id, // 属性id
}).then(res => { }).then(res => {
if (res.code == 200) { if (res.code == 200) {
var data = res.data var data = res.data

2
pages/listdetail/listdetail.js

@ -89,7 +89,7 @@ Page({
storeId: 239, storeId: 239,
storeType: 1, storeType: 1,
cid: objectId, cid: objectId,
page: 1, page: page,
pro:'', pro:'',
keyword:'', keyword:'',
sort_criteria: sort, sort_criteria: sort,

7
pages/login/login.wxml

@ -25,15 +25,12 @@
<view class="registerView" bindtap="registerAct">注册</view> <view class="registerView" bindtap="registerAct">注册</view>
</view> </view>
<view class="other-content"> <!-- <view class="other-content">
<text class="text3">其他登陆方式</text> <text class="text3">其他登陆方式</text>
<!-- <view class="weixinBtn" bindtap="wxlogin">
<image src="/images/weixin.png" mode="aspectFill"></image>
</view> -->
<button class="weixinBtn" open-type="getPhoneNumber" bindgetphonenumber="bindPhoneNumber"> <button class="weixinBtn" open-type="getPhoneNumber" bindgetphonenumber="bindPhoneNumber">
<image src="/images/weixin.png" mode="aspectFill"></image> <image src="/images/weixin.png" mode="aspectFill"></image>
</button> </button>
<text class="text4">微信登录</text> <text class="text4">微信登录</text>
</view> </view> -->
</view> </view>

6
pages/login/register.wxml

@ -3,6 +3,10 @@
<image class="codeImage" src="/images/QR_code.png" mode="aspectFill"></image> <image class="codeImage" src="/images/QR_code.png" mode="aspectFill"></image>
<view class="title">请添加上方二维码或下方按钮联系客服注册账号</view> <view class="title">请添加上方二维码或下方按钮联系客服注册账号</view>
<view class="serviceView"> <view class="serviceView">
<view class="serviceBtn" bindtap="submitAct">联系客服</view> <view style='position: relative;'>
<contact-button class="service" type="default-light" session-from="product"></contact-button>
<image class="icon_kf" style='width:22px;height:22px;' src="/images/kefu.png"></image>
</view>
<view class="dbtext" style='margin-top: 5rpx;'>联系客服</view>
</view> </view>
</view> </view>

32
pages/login/register.wxss

@ -18,23 +18,33 @@ page{
line-height: 60rpx; line-height: 60rpx;
} }
.serviceView{ .serviceView{
display: flex;
align-items: center;
justify-content:center;
flex-direction: column;
padding-top: 25rpx; padding-top: 25rpx;
height: 100rpx; height: 100rpx;
width: 100%; width: 100%;
background-color: #F6F6FB; background-color: #F6F6FB;
} }
.serviceView .serviceBtn{ .service {
margin-top: 25rpx;
margin-left: 60rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content:center; justify-content:center;
height: 70rpx; position:absolute;
width: 630rpx; top:8rpx;
text-align: center; height: 50rpx;
line-height: 70rpx; width: 50rpx;
font-size: 28rpx; opacity:0;
color: white; }
background-color: #F53C45; .icon_kf{
border-radius: 35rpx; width: 50rpx;
height: 50rpx;
display: inline-block;
margin-top: 5px;
}
.dbtext{
line-height: 15px;
color: #333;
font-size: 12px;
} }

10
pages/order/order.js

@ -29,6 +29,7 @@ Page({
value: "拼团", value: "拼团",
otype: 'pay6' otype: 'pay6'
}], }],
isPay: 0,
}, },
switchTab: function(e) { switchTab: function(e) {
var dataset = e.currentTarget.dataset var dataset = e.currentTarget.dataset
@ -220,7 +221,8 @@ Page({
var that = this var that = this
that.setData({ that.setData({
currentIndex: options.index, currentIndex: options.index,
currentStatus: options.status currentStatus: options.status,
isPay: options.isPay
}) })
that.reloadData(); that.reloadData();
that.getWXTemplate() that.getWXTemplate()
@ -262,7 +264,11 @@ Page({
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload() { onUnload() {
if (this.data.isPay == 1) {
wx.navigateBack({
delta: 2
})
}
}, },
/** /**

7
pages/order/pay.js

@ -37,6 +37,7 @@ Page({
dz_stu: false, dz_stu: false,
productAry: '', productAry: '',
remark: '', remark: '',
options: '',
}, },
go: function (e) { go: function (e) {
console.log(e); console.log(e);
@ -89,6 +90,7 @@ Page({
plug_ins: plug_ins, // 插件 plug_ins: plug_ins, // 插件
coupon: coupon, // 优惠券状态 coupon: coupon, // 优惠券状态
wallet: wallet, // 钱包状态 wallet: wallet, // 钱包状态
options: options,
}); });
this.Settlement(options); this.Settlement(options);
this.getWXTemplate(); this.getWXTemplate();
@ -165,7 +167,7 @@ Page({
// that.Settlement(); // that.Settlement();
// }, 500); // }, 500);
// } // }
this.Settlement(that.data.options);
}, },
//单选支付方式 //单选支付方式
updataRadio:function(e){ updataRadio:function(e){
@ -176,6 +178,8 @@ Page({
// 进入结算页面 // 进入结算页面
Settlement: function (options) { Settlement: function (options) {
var that = this; var that = this;
//更新地址信息
var addressId = wx.getStorageSync('addressId')
WXAPI.settlement({ WXAPI.settlement({
accessId: app.globalData.accessId, accessId: app.globalData.accessId,
storeId: 239, storeId: 239,
@ -184,6 +188,7 @@ Page({
coupon_id: 0, coupon_id: 0,
vipSource: 0, vipSource: 0,
canshu: true, canshu: true,
address_id: addressId,
product: options.product, product: options.product,
}).then(res => { }).then(res => {
if (res.code == 200) { if (res.code == 200) {

2
pages/order/pay.wxml

@ -28,7 +28,7 @@
<view class="w100" style='padding-bottom:100px;'> <view class="w100" style='padding-bottom:100px;'>
<!-- 收货地址 --> <!-- 收货地址 -->
<view class="p_all bg_white mt10 font_14 top_xt" wx:if="{{addrId != ''}}"> <view class="p_all bg_white mt10 font_14 top_xt" wx:if="{{addrId != ''}}">
<view bindtap='go' data-url="../address/index?cartId={{cartId}}" hover-class="none"> <view bindtap='go' data-url="../address/index?product={{options.product}}" hover-class="none">
<view class="df"> <view class="df">
<view class='iconfont icon-dizhi' style='margin:auto 0;'></view> <view class='iconfont icon-dizhi' style='margin:auto 0;'></view>
<view class="df_1 c6"> <view class="df_1 c6">

5
pages/order/payment.js

@ -74,11 +74,8 @@ Page({
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload() { onUnload() {
wx.navigateBack({
delta: 3
})
wx.navigateTo({ wx.navigateTo({
url: '/pages/order/order?currentTab=0&otype=pay', url: '/pages/order/order?currentTab=0&otype=pay&isPay=1',
}) })
}, },

19
pages/product/detail.js

@ -166,6 +166,7 @@ Page({
var content = pro.content; var content = pro.content;
WxParse.wxParse('content', 'html', content, that, 5); WxParse.wxParse('content', 'html', content, that, 5);
that.setData({ that.setData({
itemData: pro,
shop_list: data.shop_list, shop_list: data.shop_list,
kucun: pro.num, kucun: pro.num,
bannerItem: pro.img_arr, bannerItem: pro.img_arr,
@ -503,9 +504,15 @@ Page({
this.onData(); this.onData();
}, },
/* 点击确定 */ /* 点击确定 */
submit: function (e) { submit: function (e) {
var isLogin = wx.getStorageSync('isLogin')
if (!isLogin) {
wx.navigateTo({
url: '/pages/login/login'
})
return;
}
var that = this; var that = this;
var type = e.currentTarget.dataset.type; var type = e.currentTarget.dataset.type;
if (type == 'buynow') { if (type == 'buynow') {
@ -557,13 +564,6 @@ Page({
}, },
//立即购买 //立即购买
buyNow: function (e) { buyNow: function (e) {
var isLogin = wx.getStorageSync('isLogin')
if (!isLogin) {
wx.navigateTo({
url: '/pages/login/login'
})
}
//添加到购物车
var that = this; var that = this;
var productArr = [] var productArr = []
productArr.push({pid: that.data.productId}) productArr.push({pid: that.data.productId})
@ -571,6 +571,9 @@ Page({
productArr.push({num: that.data.buynum}) productArr.push({num: that.data.buynum})
// productArr.push({}) // productArr.push({})
let jsonstr = JSON.stringify(productArr) let jsonstr = JSON.stringify(productArr)
this.setData({
showModalStatus: false
});
wx.navigateTo({ wx.navigateTo({
url: '../order/pay?product=' + jsonstr + '&cartId=', url: '../order/pay?product=' + jsonstr + '&cartId=',
}); });

4
pages/product/detail.wxml

@ -92,9 +92,9 @@
<view bindtap="go_cart"> <view bindtap="go_cart">
<image class="icon_kf" style='margin-right:20rpx;width:35px;height:35px;' src="/images/gw.png"></image> <image class="icon_kf" style='margin-right:20rpx;width:35px;height:35px;' src="/images/gw.png"></image>
</view> </view>
<view bindtap="set_share"> <!-- <view bindtap="set_share">
<image class="icon_kf" style='width:35px;height:35px;' src="/images/fx.png"></image> <image class="icon_kf" style='width:35px;height:35px;' src="/images/fx.png"></image>
</view> </view> -->
</view> </view>
</view> </view>
<!--弹窗--> <!--弹窗-->

2
pages/product/detail.wxss

@ -642,7 +642,7 @@ border: none;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
top: 20rpx; top: 20rpx;
right: 30rpx; right: 20rpx;
z-index:999; z-index:999;
} }
.comment_box{ .comment_box{

2
utils/server.js

@ -214,7 +214,7 @@ module.exports = {
messageList: (data) => { //查看店铺信息 messageList: (data) => { //查看店铺信息
return requestServer('app.message.index', 'post', data) return requestServer('app.message.index', 'post', data)
}, },
commentList: (data) => { //评价 commentInfo: (data) => { //评价
return requestServer('app.product.comment', 'post', data) return requestServer('app.product.comment', 'post', data)
}, },
returnMethod: (data) => { //申请售后 returnMethod: (data) => { //申请售后

Loading…
Cancel
Save