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. 34
      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: {
userInfo: {},
isLogin: false,

14
pages/address/index.js

@ -8,7 +8,8 @@ Page({
num: 0,
flag: false,
cartId: 0,
numbers: ""
numbers: "",
productStr: ""
},
// 下拉刷新
onPullDownRefresh: function () {
@ -71,7 +72,11 @@ Page({
onLoad: function (options) {
console.log(options)
var that = this;
that.setData({
productStr: options.product,
})
// 页面初始化 options为页面跳转所带来的参数
// if (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 () {

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:else class='top-ql-1' bindtap="uptrue" style='color:#f60;'>完成</view>
</view>
<radio-group class="radio-group" wx:for="{{address}}" wx:key="key">
</view> -->
<radio-group class="radio-group" wx:for="{{address}}" wx:key="key" data-id="{{item.id}}" bindtap="chooseBack">
<view hidden="{{hiddenAddress}}" class="address">
<view class="address-detail">
<view class='address_div'>
@ -23,17 +23,12 @@
<text hidden="{{item.is_default==0?false:true}}"></text>
</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">
<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>
<text class='address_text' wx:if="{{item.is_default==1}}">默认地址</text>
</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}}">
<text style='margin:10px'>编辑</text>

5
pages/address/index.wxss

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

5
pages/address/upaddress.js

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

20
pages/aftersales/aftersales.wxml

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

6
pages/aftersales/apply.wxml

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

12
pages/aftersales/apply.wxss

@ -295,7 +295,7 @@ yh-return_suess-view {
.end_lef {
text-align: justify;
width: 150rpx;
width: 160rpx;
height: 39rpx;
color: #666;
}
@ -307,4 +307,14 @@ yh-return_suess-view {
height: 30rpx;
width: 100%;
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) {
that = this;
var orderId = options.ordersn; // 订单号
var user_id = app.globalData.userInfo.openid; // 微信id
var pid = options.pid; // 商品id
var attribute_id = options.attribute_id; // 属性id
if (pid) {
pid = pid;
} else {
pid = '';
}
if (attribute_id) {
attribute_id = attribute_id;
} else {
attribute_id = '';
}
WXAPI.commentList({
accessId: app.globalData.accessId,
storeId: 239,
var orderId = options.id;
// var user_id = app.globalData.userInfo.openid; // 微信id
// var pid = options.pid; // 商品id
// var attribute_id = options.attribute_id; // 属性id
// if (pid) {
// pid = pid;
// } else {
// pid = '';
// }
// if (attribute_id) {
// attribute_id = attribute_id;
// } else {
// attribute_id = '';
// }
WXAPI.commentInfo({
access_id: app.globalData.accessId,
store_id: 239,
storeType: 1,
order_id: orderId, // 订单号
pid: pid, // 商品id
attribute_id: attribute_id, // 属性id
language: '',
order_details_id: orderId,
}).then(res => {
if (res.code == 200) {
var data = res.data

2
pages/listdetail/listdetail.js

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

7
pages/login/login.wxml

@ -25,15 +25,12 @@
<view class="registerView" bindtap="registerAct">注册</view>
</view>
<view class="other-content">
<!-- <view class="other-content">
<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">
<image src="/images/weixin.png" mode="aspectFill"></image>
</button>
<text class="text4">微信登录</text>
</view>
</view> -->
</view>

6
pages/login/register.wxml

@ -3,6 +3,10 @@
<image class="codeImage" src="/images/QR_code.png" mode="aspectFill"></image>
<view class="title">请添加上方二维码或下方按钮联系客服注册账号</view>
<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>

34
pages/login/register.wxss

@ -18,23 +18,33 @@ page{
line-height: 60rpx;
}
.serviceView{
display: flex;
align-items: center;
justify-content:center;
flex-direction: column;
padding-top: 25rpx;
height: 100rpx;
width: 100%;
background-color: #F6F6FB;
}
.serviceView .serviceBtn{
margin-top: 25rpx;
margin-left: 60rpx;
.service {
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;
justify-content:center;
position:absolute;
top:8rpx;
height: 50rpx;
width: 50rpx;
opacity:0;
}
.icon_kf{
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: "拼团",
otype: 'pay6'
}],
isPay: 0,
},
switchTab: function(e) {
var dataset = e.currentTarget.dataset
@ -220,7 +221,8 @@ Page({
var that = this
that.setData({
currentIndex: options.index,
currentStatus: options.status
currentStatus: options.status,
isPay: options.isPay
})
that.reloadData();
that.getWXTemplate()
@ -262,7 +264,11 @@ Page({
* 生命周期函数--监听页面卸载
*/
onUnload() {
if (this.data.isPay == 1) {
wx.navigateBack({
delta: 2
})
}
},
/**

7
pages/order/pay.js

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

2
pages/order/pay.wxml

@ -28,7 +28,7 @@
<view class="w100" style='padding-bottom:100px;'>
<!-- 收货地址 -->
<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='iconfont icon-dizhi' style='margin:auto 0;'></view>
<view class="df_1 c6">

5
pages/order/payment.js

@ -74,11 +74,8 @@ Page({
* 生命周期函数--监听页面卸载
*/
onUnload() {
wx.navigateBack({
delta: 3
})
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;
WxParse.wxParse('content', 'html', content, that, 5);
that.setData({
itemData: pro,
shop_list: data.shop_list,
kucun: pro.num,
bannerItem: pro.img_arr,
@ -503,9 +504,15 @@ Page({
this.onData();
},
/* 点击确定 */
submit: function (e) {
var isLogin = wx.getStorageSync('isLogin')
if (!isLogin) {
wx.navigateTo({
url: '/pages/login/login'
})
return;
}
var that = this;
var type = e.currentTarget.dataset.type;
if (type == 'buynow') {
@ -557,13 +564,6 @@ Page({
},
//立即购买
buyNow: function (e) {
var isLogin = wx.getStorageSync('isLogin')
if (!isLogin) {
wx.navigateTo({
url: '/pages/login/login'
})
}
//添加到购物车
var that = this;
var productArr = []
productArr.push({pid: that.data.productId})
@ -571,6 +571,9 @@ Page({
productArr.push({num: that.data.buynum})
// productArr.push({})
let jsonstr = JSON.stringify(productArr)
this.setData({
showModalStatus: false
});
wx.navigateTo({
url: '../order/pay?product=' + jsonstr + '&cartId=',
});

4
pages/product/detail.wxml

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

2
pages/product/detail.wxss

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

2
utils/server.js

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

Loading…
Cancel
Save