From 7ff20ccd89a58b7abfa5638b928aa73ad5612a6b Mon Sep 17 00:00:00 2001 From: initwithout Date: Mon, 8 May 2023 15:00:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E9=80=89=E6=8B=A9=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=20=E5=9C=B0=E5=9D=80=E7=AE=A1=E7=90=86=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E5=95=86=E5=93=81=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=B8=8D=E6=98=BE=E7=A4=BA=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=20=E7=94=B3=E8=AF=B7=E5=94=AE=E5=90=8E=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=95=B0=E6=8D=AE=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 8 +++++++ pages/address/index.js | 14 ++++++++++-- pages/address/index.wxml | 13 ++++------- pages/address/index.wxss | 5 +++- pages/address/upaddress.js | 5 ++++ pages/aftersales/aftersales.wxml | 20 ---------------- pages/aftersales/apply.js | 12 ++++++---- pages/aftersales/apply.wxml | 6 +++-- pages/aftersales/apply.wxss | 12 +++++++++- pages/comment/comment.js | 39 ++++++++++++++++---------------- pages/listdetail/listdetail.js | 2 +- pages/login/login.wxml | 7 ++---- pages/login/register.wxml | 6 ++++- pages/login/register.wxss | 34 ++++++++++++++++++---------- pages/order/order.js | 10 ++++++-- pages/order/pay.js | 7 +++++- pages/order/pay.wxml | 2 +- pages/order/payment.js | 5 +--- pages/product/detail.js | 19 +++++++++------- pages/product/detail.wxml | 4 ++-- pages/product/detail.wxss | 2 +- utils/server.js | 2 +- 22 files changed, 136 insertions(+), 98 deletions(-) diff --git a/app.js b/app.js index f2c4a53..16902a2 100644 --- a/app.js +++ b/app.js @@ -158,6 +158,14 @@ App({ }); } }, + //提示弹窗 + toast: function (msg) { + wx.showToast({ + title: msg, + icon: 'none', + duration: 2000 + }) + }, globalData: { userInfo: {}, isLogin: false, diff --git a/pages/address/index.js b/pages/address/index.js index cb6edf0..e048c05 100644 --- a/pages/address/index.js +++ b/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 () { diff --git a/pages/address/index.wxml b/pages/address/index.wxml index bb345a6..55e03ea 100644 --- a/pages/address/index.wxml +++ b/pages/address/index.wxml @@ -1,9 +1,9 @@ - + + - \ No newline at end of file diff --git a/pages/aftersales/apply.js b/pages/aftersales/apply.js index 47267ce..d5163fd 100644 --- a/pages/aftersales/apply.js +++ b/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) { diff --git a/pages/aftersales/apply.wxml b/pages/aftersales/apply.wxml index adebdb4..a7b17c6 100644 --- a/pages/aftersales/apply.wxml +++ b/pages/aftersales/apply.wxml @@ -114,8 +114,10 @@ 上传凭证: - - + + + + diff --git a/pages/aftersales/apply.wxss b/pages/aftersales/apply.wxss index f5efd6c..bb558ab 100644 --- a/pages/aftersales/apply.wxss +++ b/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%; } \ No newline at end of file diff --git a/pages/comment/comment.js b/pages/comment/comment.js index 601909f..8cb6f45 100644 --- a/pages/comment/comment.js +++ b/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 diff --git a/pages/listdetail/listdetail.js b/pages/listdetail/listdetail.js index de58594..71e3355 100644 --- a/pages/listdetail/listdetail.js +++ b/pages/listdetail/listdetail.js @@ -89,7 +89,7 @@ Page({ storeId: 239, storeType: 1, cid: objectId, - page: 1, + page: page, pro:'', keyword:'', sort_criteria: sort, diff --git a/pages/login/login.wxml b/pages/login/login.wxml index eb533a0..85c03b9 100644 --- a/pages/login/login.wxml +++ b/pages/login/login.wxml @@ -25,15 +25,12 @@ 注册 - + 微信登录 - + --> \ No newline at end of file diff --git a/pages/login/register.wxml b/pages/login/register.wxml index 1cd6fc3..0db04ff 100644 --- a/pages/login/register.wxml +++ b/pages/login/register.wxml @@ -3,6 +3,10 @@ 请添加上方二维码或下方按钮联系客服注册账号 - 联系客服 + + + + + 联系客服 \ No newline at end of file diff --git a/pages/login/register.wxss b/pages/login/register.wxss index 7235c61..3c6f0ef 100644 --- a/pages/login/register.wxss +++ b/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; } \ No newline at end of file diff --git a/pages/order/order.js b/pages/order/order.js index f1af316..bd593b7 100644 --- a/pages/order/order.js +++ b/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 + }) + } }, /** diff --git a/pages/order/pay.js b/pages/order/pay.js index 6d87819..e220856 100644 --- a/pages/order/pay.js +++ b/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) { diff --git a/pages/order/pay.wxml b/pages/order/pay.wxml index 5c36481..a000cac 100644 --- a/pages/order/pay.wxml +++ b/pages/order/pay.wxml @@ -28,7 +28,7 @@ - + diff --git a/pages/order/payment.js b/pages/order/payment.js index 295bc56..85a0825 100644 --- a/pages/order/payment.js +++ b/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', }) }, diff --git a/pages/product/detail.js b/pages/product/detail.js index c8dd61e..cb8a183 100644 --- a/pages/product/detail.js +++ b/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=', }); diff --git a/pages/product/detail.wxml b/pages/product/detail.wxml index ff697f1..90a8295 100644 --- a/pages/product/detail.wxml +++ b/pages/product/detail.wxml @@ -92,9 +92,9 @@ - + diff --git a/pages/product/detail.wxss b/pages/product/detail.wxss index 1adee03..5dc1d25 100644 --- a/pages/product/detail.wxss +++ b/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{ diff --git a/utils/server.js b/utils/server.js index 159d593..9595120 100644 --- a/utils/server.js +++ b/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) => { //申请售后