From b2ba4b0a48f0ff9d72f5aa6e0e2c4ec1d5e57bff Mon Sep 17 00:00:00 2001 From: chenshengle <954534408@qq.com> Date: Wed, 22 Sep 2021 15:54:12 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=BA=BF=E4=B8=8A=E8=B4=AD=E7=89=A9?= =?UTF-8?q?=20=E5=88=B8=E5=8C=85=E3=80=91=E3=80=90=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 5 +- config/config.js | 10 +- index/passCar.js | 3 +- index/passCar.wxml | 8 + index/user.wxml | 6 + pages/bargain/bargain.js | 7 +- pages/bargain/bargain.wxml | 4 +- pages/bargain/bargainDatail/bargainDatail.js | 23 +- .../bargain/bargainDatail/bargainDatail.wxml | 2 +- pages/cardListDetail/cardListDetail.js | 4 +- pages/coupon/detail/index.js | 31 +-- pages/edit/edit.js | 19 +- pages/edit/edit.wxml | 12 + pages/index/index.js | 2 +- .../payIntegcoupondetail/index.js | 4 +- pages/joinFrDpell/index.js | 12 +- pages/order/detail/index.js | 9 +- pages/order/index/index.wxml | 78 ++++++ pages/order/index/index.wxss | 53 +++- pages/site/site.js | 74 ++++++ pages/site/site.json | 5 + pages/site/site.wxml | 10 + pages/site/site.wxss | 19 ++ pages/siteAdd/siteAdd.js | 226 ++++++++++++++++++ pages/siteAdd/siteAdd.json | 5 + pages/siteAdd/siteAdd.wxml | 40 ++++ pages/siteAdd/siteAdd.wxss | 67 ++++++ pages/siteUser/siteUser.js | 108 +++++++++ pages/siteUser/siteUser.json | 5 + pages/siteUser/siteUser.wxml | 12 + pages/siteUser/siteUser.wxss | 47 ++++ pages/spellDetail/index.js | 2 +- pages/spellGroup/mySpellGroup/index.js | 31 +-- pages/spellGroup/paySpellGroup/index.js | 7 +- pages/spellGroup/spellGroup.js | 2 +- project.config.json | 11 +- 36 files changed, 897 insertions(+), 66 deletions(-) create mode 100644 pages/site/site.js create mode 100644 pages/site/site.json create mode 100644 pages/site/site.wxml create mode 100644 pages/site/site.wxss create mode 100644 pages/siteAdd/siteAdd.js create mode 100644 pages/siteAdd/siteAdd.json create mode 100644 pages/siteAdd/siteAdd.wxml create mode 100644 pages/siteAdd/siteAdd.wxss create mode 100644 pages/siteUser/siteUser.js create mode 100644 pages/siteUser/siteUser.json create mode 100644 pages/siteUser/siteUser.wxml create mode 100644 pages/siteUser/siteUser.wxss diff --git a/app.json b/app.json index 0ca8a0a..d533d18 100644 --- a/app.json +++ b/app.json @@ -72,7 +72,10 @@ "pages/activityCalendar/activityCalendar", "pages/complaint/complaint", "pages/questionnaire/questionnaire", - "pages/questionnaire/questionnaireLsit/questionnaireLsit" + "pages/questionnaire/questionnaireLsit/questionnaireLsit", + "pages/site/site", + "pages/siteUser/siteUser", + "pages/siteAdd/siteAdd" ], "subpackages": [ { diff --git a/config/config.js b/config/config.js index d1b2bb8..e18d385 100755 --- a/config/config.js +++ b/config/config.js @@ -6,7 +6,7 @@ var config = { url: configUrls, wsurl: sockUrls, api: { - /* + /* *记录微信订阅 */ activityDey:"/wxActivity/listStatus",//活动日历日期 @@ -359,6 +359,14 @@ var config = { ifFengMap:'/fengniaomap/getConfig', //分享小程序二维码 getQrcodeFx:"/user/userinfoQrCode", + //添加收货地址 + collectSite:"/userBasicInfoAddress/saveOrUpdate", + //收货地址列表 + siteList: "/userBasicInfoAddress/list", + //查询收货地址 + siteCheck: "/userBasicInfoAddress/findById", + //删除收获地址 + siteDel: "/userBasicInfoAddress/del", }, weapp: { AppId: weappId diff --git a/index/passCar.js b/index/passCar.js index 85fe744..3423547 100644 --- a/index/passCar.js +++ b/index/passCar.js @@ -905,7 +905,8 @@ Page({ generalAppId:res.data.appId, generalPayPath: res.data.payPath, generalExtraData: res.data.extraData, - extraDataFlag: JSON.stringify(res.data.extraData) + extraDataFlag: JSON.stringify(res.data.extraData), + }); console.log( that.data.extraDataFlag,"123456789") } diff --git a/index/passCar.wxml b/index/passCar.wxml index 576abf3..7a1f0ad 100644 --- a/index/passCar.wxml +++ b/index/passCar.wxml @@ -50,6 +50,14 @@ 备注: {{remark}} + + + 系统提示: + {{stopFees.sysNotice}} + + diff --git a/index/user.wxml b/index/user.wxml index 5d3ef03..976d78d 100644 --- a/index/user.wxml +++ b/index/user.wxml @@ -130,6 +130,12 @@ > + + + 个人信息 + > + + 投诉建议 diff --git a/pages/bargain/bargain.js b/pages/bargain/bargain.js index 4faa694..f5ed57a 100644 --- a/pages/bargain/bargain.js +++ b/pages/bargain/bargain.js @@ -202,7 +202,7 @@ Page({ .then(res => { console.log(res) wx.navigateTo({ - url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${res.data.orderNumber}` + url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${res.data.mainOrderId}` }) }) .catch(err => { @@ -213,11 +213,14 @@ Page({ }) }, inviteFriend: function (e) { + + let data = e.currentTarget.dataset.data + console.log(data) /** * 添加标识 */ wx.navigateTo({ - url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${e.currentTarget.dataset.id}` + url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${data.id}&composeOrderType=${data.composeOrderType}` }) }, barginAgain: function (e) { diff --git a/pages/bargain/bargain.wxml b/pages/bargain/bargain.wxml index cf6b9b9..c62abd7 100644 --- a/pages/bargain/bargain.wxml +++ b/pages/bargain/bargain.wxml @@ -45,11 +45,11 @@ 原价{{item.price/100}} 已砍价到底价:{{item.salePrice/100}}元 - + 邀请好友 - + 立即付款 diff --git a/pages/bargain/bargainDatail/bargainDatail.js b/pages/bargain/bargainDatail/bargainDatail.js index 7b57d7b..3789912 100644 --- a/pages/bargain/bargainDatail/bargainDatail.js +++ b/pages/bargain/bargainDatail/bargainDatail.js @@ -45,14 +45,18 @@ Page({ }).then(res => { let that = this; if (options.orderId || options.orderId && options.from == 'discount') { + console.log(options, "options") if (options.from) { + that.setData({ orderId: options.orderId, + composeOrderType: options.composeOrderType, from: "discount" }) } else { that.setData({ - orderId: options.orderId + orderId: options.orderId, + composeOrderType: options.composeOrderType, }) } app.globalData.wmorder = options.orderId @@ -277,7 +281,7 @@ Page({ url: config.api.payOrderUpdate, data: { payOrderId: payOrderId, - orderId: orderId, + composeOrderId: orderId, status: status, reason: reason } @@ -562,7 +566,8 @@ Page({ Http.post({ url: config.api.payOrderCreate, data: { - orderId: orderId + orderId: orderId, + composeOrderType: that.data.composeOrderType } }) .then(res => { @@ -778,9 +783,10 @@ Page({ onShareAppMessage: function(options) { app.globalData.previewFlag = true var that = this; - var shareObj = { + console.log(`/pages/index/index?orderId=${that.data.orderId}&from=${"discount"}&composeOrderType=${that.data.composeOrderType}`) + var shareObj = { title: that.data.nickName + '邀请您帮砍' + that.data.data.title, - path: `/pages/index/index?orderId=${that.data.data.id}&from=${"discount"}`, + path: `/pages/index/index?orderId=${that.data.orderId}&from=${"discount"}&composeOrderType=${that.data.composeOrderType}`, success: function(res) { if (res.errMsg == 'shareAppMessage:ok') {} }, @@ -790,11 +796,12 @@ Page({ }; // 来自页面内的按钮的转发 if (options.from == 'button') { - var orderId = options.target.dataset.orderid; - shareObj.path = `/pages/index/index?orderId=${orderId}&from=${"discount"}`; + // var orderId = options.target.dataset.orderid; + shareObj.path = `/pages/index/index?orderId=${that.data.orderId}&from=${"discount"}&composeOrderType=${that.data.composeOrderType}`; } + console.log(shareObj) // 返回shareObj - return shareObj; + // return shareObj; }, }) diff --git a/pages/bargain/bargainDatail/bargainDatail.wxml b/pages/bargain/bargainDatail/bargainDatail.wxml index 25bff57..3df8e00 100644 --- a/pages/bargain/bargainDatail/bargainDatail.wxml +++ b/pages/bargain/bargainDatail/bargainDatail.wxml @@ -75,7 +75,7 @@ {{data.price/100}}元 立即购买 --> - + diff --git a/pages/cardListDetail/cardListDetail.js b/pages/cardListDetail/cardListDetail.js index 4fb5803..100a928 100644 --- a/pages/cardListDetail/cardListDetail.js +++ b/pages/cardListDetail/cardListDetail.js @@ -278,7 +278,7 @@ Page({ url: config.api.payOrderUpdate, data: { payOrderId: payOrderId, - orderId: orderId, + composeOrderId: orderId, status: status, reason: reason } @@ -440,7 +440,7 @@ Page({ }) .then(res => { if (typeof (res) != "undefined") { - let orderId = "" + res.data.id; + let orderId = "" + res.data.mainOrderId; that.setData({ orderId: orderId }); diff --git a/pages/coupon/detail/index.js b/pages/coupon/detail/index.js index 05e3148..93a2e9b 100644 --- a/pages/coupon/detail/index.js +++ b/pages/coupon/detail/index.js @@ -378,7 +378,7 @@ Page({ queueData: null, showbutton: true, formId: formId - }) + }) Http.get({ url: config.api.getQuestion, data: { @@ -712,7 +712,7 @@ Page({ /** * 支付订单更新 */ - payOrderUpdate: (orderId, payOrderId, status, reason, type, _this) => { + payOrderUpdate: (orderId, payOrderId, status, reason, type, _this, composeOrderType) => { console.log("*-----------------") let that = this; // 支付成功 @@ -720,7 +720,7 @@ Page({ url: config.api.payOrderUpdate, data: { payOrderId: payOrderId, - orderId: orderId, + composeOrderId: orderId, status: status, reason: reason } @@ -732,13 +732,13 @@ Page({ wx.navigateTo({ url: `/pages/order/detail/index?orderId=${ orderId - }&cardIf=true&contentType=${_this.data.contentType}` + }&cardIf=true&contentType=${_this.data.contentType}&composeOrderType=${composeOrderType}` }); } else if (type == 'free') { wx.navigateTo({ url: `/pages/order/detail/index?orderId=${ orderId - }&contentType=${_this.data.contentType}` + }&contentType=${_this.data.contentType}&composeOrderType=${composeOrderType}` }); } }) @@ -746,7 +746,7 @@ Page({ console.log(err); if (!type) { setTimeout(function() { - _this.payOrderUpdate(orderId, payOrderId, status, reason, type, _this); + _this.payOrderUpdate(orderId, payOrderId, status, reason, type, _this, composeOrderType); }, 2000) } }) @@ -925,11 +925,13 @@ Page({ } }) .then(res => { + console.log(res,"res123") if (discount != 'discount') { if (typeof(res) != "undefined") { - let orderId = "" + res.data.id; + let orderId = "" + res.data.mainOrderId; that.setData({ - orderId: orderId + orderId: orderId, + composeOrderType: res.data.composeOrderType }); if (res.data.payment > 0) { // 支付金额不为0 @@ -939,7 +941,8 @@ Page({ Http.post({ url: config.api.payOrderCreate, data: { - orderId: orderId + orderId: orderId, + composeOrderType: res.data.composeOrderType } }) .then(res => { @@ -955,7 +958,7 @@ Page({ wx.showLoading({ title: '订单正在处理中...', }) - that.payOrderUpdate(that.data.orderId, payOrderId, 1, '', '', that); + that.payOrderUpdate(that.data.orderId, payOrderId, 1, '', '', that, that.data.composeOrderType); if (res.errMsg == "requestPayment:ok") { /** * 用户支付成功以后跳转到券包列表 @@ -978,7 +981,7 @@ Page({ /** * 支付失败,需要更新订单的状态 */ - that.payOrderUpdate(that.data.orderId, payOrderId, 2, '', 'fail', that); + that.payOrderUpdate(that.data.orderId, payOrderId, 2, '', 'fail', that, that.data.composeOrderType); that.setData({ showbutton: false }) @@ -999,7 +1002,7 @@ Page({ }) } else { // 免费券 - that.payOrderUpdate(orderId, "0", 1, '', 'free', that); + that.payOrderUpdate(orderId, "0", 1, '', 'free', that, that.data.composeOrderType); if (that.data.cardType == 100) { wx.setStorage({ key: 'couponNum2', @@ -1016,7 +1019,7 @@ Page({ } else { if (res) { wx.navigateTo({ - url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${res.data.id}`, + url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${res.data.mainOrderId}&composeOrderType=${res.data.composeOrderType}`, }) } } @@ -1078,7 +1081,7 @@ Page({ success: function(res) { if (res.confirm) { wx.navigateTo({ - url: `/pages/order/detail/index?orderId=${that.data.disOrderNumber}&contentType=${that.data.contentType}`, + url: `/pages/order/detail/index?orderId=${that.data.disOrderNumber}&contentType=${that.data.contentType}&composeOrderType=${that.data.composeOrderType}`, }) } } diff --git a/pages/edit/edit.js b/pages/edit/edit.js index 3971ed6..d2c63fa 100644 --- a/pages/edit/edit.js +++ b/pages/edit/edit.js @@ -16,6 +16,8 @@ Page({ dateEnd:'', flag: 1, flagsex: 0, + height:"", + weight:"", items: [ { name: 1, value: '男', checked: false }, { name: 2, value: '女', checked: false }, @@ -63,12 +65,13 @@ Page({ }, fail: function (error) { console.log(error) - }, + }, complete: function (data) { } }) }, formSubmit: function (e) { + console.log(e.detail,"formSubmit") let that = this; // console.log(that.data.childArr) /** @@ -122,7 +125,9 @@ Page({ address: address, name: username, birthdate: birthdate, - childrenList: tmeparr + childrenList: tmeparr, + height: e.detail.value.height, + weight: e.detail.value.weight, } }) .then(res => { @@ -205,6 +210,16 @@ Page({ .then(res => {res.data console.log(res); if(res.code == 200){ + if (res.data.weight){ + this.setData({ + weight: res.data.weight + }) + } + if (res.data.height) { + this.setData({ + height: res.data.height + }) + } if (res.data.childrenList){ let tmpeArr = res.data.childrenList diff --git a/pages/edit/edit.wxml b/pages/edit/edit.wxml index b64822c..4d7cedb 100644 --- a/pages/edit/edit.wxml +++ b/pages/edit/edit.wxml @@ -14,6 +14,16 @@ + + 身高 + + + + + 体重 + + + 性别 @@ -22,6 +32,8 @@ + + 住址 {{address}} diff --git a/pages/index/index.js b/pages/index/index.js index ea49476..1497943 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -235,7 +235,7 @@ Page({ // 参与砍价 else if (options && options.orderId) { wx.redirectTo({ - url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${options.orderId}&from=${"discount"}`, + url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${options.orderId}&from=${"discount"}&composeOrderType=${options.composeOrderType}`, }) } // 我的 diff --git a/pages/integralmall/payIntegcoupondetail/index.js b/pages/integralmall/payIntegcoupondetail/index.js index 6af8587..52f7888 100644 --- a/pages/integralmall/payIntegcoupondetail/index.js +++ b/pages/integralmall/payIntegcoupondetail/index.js @@ -200,7 +200,7 @@ Page({ .then(res => { console.log(res) if (typeof (res) != "undefined") { - let orderId = "" + res.data.id; + let orderId = "" + res.data.mainOrderId; that.setData({ orderId: orderId }); @@ -232,7 +232,7 @@ Page({ url: config.api.payOrderUpdate, data: { payOrderId: payOrderId, - orderId: orderId, + composeOrderId: orderId, status: status, reason: reason } diff --git a/pages/joinFrDpell/index.js b/pages/joinFrDpell/index.js index da14a83..91f0ea2 100644 --- a/pages/joinFrDpell/index.js +++ b/pages/joinFrDpell/index.js @@ -264,7 +264,7 @@ Page({ url: config.api.payOrderUpdate, data: { payOrderId: payOrderId, - orderId: orderId, + composeOrderId: orderId, status: status, reason: reason } @@ -282,7 +282,7 @@ Page({ url: '/pages/order/detail/index?orderId=' + res.data.id, }) } else { - _this.goToOrderGroup(orderId, res.data.orderGroupId, _this) + _this.goToOrderGroup(orderId, res.data.singleOrder.orderGroupId, _this) } }) .catch(err => { @@ -417,10 +417,13 @@ Page({ }) .then(res => { console.log(res) + that.setData({aa:res}) + if (typeof(res) != "undefined") { - let orderId = "" + res.data.id; + let orderId = "" + res.data.mainOrderId; that.setData({ orderId: orderId, + composeOrderType: res.data.composeOrderType, canSpell: false, canBuyIf: true }); @@ -431,7 +434,8 @@ Page({ Http.post({ url: config.api.payOrderCreate, data: { - orderId: orderId + orderId: orderId, + composeOrderType: that.data.composeOrderType } }) .then(res => { diff --git a/pages/order/detail/index.js b/pages/order/detail/index.js index 9af3f45..4cb0a51 100644 --- a/pages/order/detail/index.js +++ b/pages/order/detail/index.js @@ -159,6 +159,7 @@ Page({ that.setData({ orderId: options.orderId, contentType: options.contentType, + composeOrderType: options.composeOrderType }); wx.hideShareMenu() if(options.cardIf){ @@ -180,7 +181,8 @@ Page({ if(res.code == 200){ that.getUserInfo() that.setData({ - showPage:true + showPage:true, + composeOrderType: res.data.composeOrderType }) } that.setData({ @@ -251,7 +253,8 @@ Page({ Http.post({ url: config.api.payOrderCreate, data: { - orderId: orderId + orderId: orderId, + composeOrderType: that.data.composeOrderType } }).then(res => { var payOrderId = "" + res.data.payOrderId; @@ -333,7 +336,7 @@ Page({ url: config.api.payOrderUpdate, data: { payOrderId: payOrderId, - orderId: orderId, + composeOrderId: orderId, status: status, reason: reason } diff --git a/pages/order/index/index.wxml b/pages/order/index/index.wxml index 51bf9d8..b4bc40d 100644 --- a/pages/order/index/index.wxml +++ b/pages/order/index/index.wxml @@ -75,6 +75,84 @@ --> + + + + + + + 您还没有相关订单 diff --git a/pages/order/index/index.wxss b/pages/order/index/index.wxss index 5f7eed0..3ab9cb9 100644 --- a/pages/order/index/index.wxss +++ b/pages/order/index/index.wxss @@ -23,6 +23,7 @@ } .section{ background: #FFFFFF; + overflow: hidden; } .detail_msg { position: relative; @@ -32,7 +33,7 @@ margin: 0 30rpx; padding-bottom: 20rpx; padding-top: 20rpx; - border-bottom: 1rpx solid #eee; + /* border-bottom: 1rpx solid #eee; */ } .sendImg{ position: absolute; @@ -175,6 +176,8 @@ display: flex; justify-content: space-between; border-bottom: 8rpx solid #eee; + border-top: 1rpx solid #eee; + } .payment view:nth-child(1) text:nth-child(1) { @@ -317,3 +320,51 @@ button::after{ border: none; } bottom: 0; margin: auto; } +.itemBox{ + overflow: hidden; + margin: 20rpx 60rpx; +} +.itemImg{ + float: left; + display: block; + width: 120rpx; + height: 120rpx; + border: 1px solid #f8f8f8; + border-radius: 20rpx; +} +.itemImg image { + display: block; + width: 120rpx; + height: 120rpx; + border-radius: 20rpx; +} +.itemContent{ + float: left; + width: 70%; + + +} +.face{ + font-size: 24rpx; + color: #999; + letter-spacing: 0; + padding-left: 4%; + line-height: 33rpx; +} +.face text{ + font-size: 24rpx; + color: #333; + letter-spacing: 0; + line-height: 33rpx; + +} +.date{ + margin-top: 16rpx; + font-size: 24rpx; + color: #999; + letter-spacing: 0; + padding-left: 4%; + line-height: 33rpx; + +} + diff --git a/pages/site/site.js b/pages/site/site.js new file mode 100644 index 0000000..8b9e24a --- /dev/null +++ b/pages/site/site.js @@ -0,0 +1,74 @@ +var app = getApp(); +const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px' +const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {} +Page({ + + /** + * 页面的初始数据 + */ + data: { + navigationBarHeight, + }, + go(e){ + let url = e.currentTarget.dataset.url + wx.navigateTo({ + url: url, + }) + console.log(url) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/site/site.json b/pages/site/site.json new file mode 100644 index 0000000..cedc479 --- /dev/null +++ b/pages/site/site.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "navbar": "../components/navbar/navbar" + } +} \ No newline at end of file diff --git a/pages/site/site.wxml b/pages/site/site.wxml new file mode 100644 index 0000000..24c7a46 --- /dev/null +++ b/pages/site/site.wxml @@ -0,0 +1,10 @@ + + + + 我的个人信息 + + + + 我的收货地址 + + \ No newline at end of file diff --git a/pages/site/site.wxss b/pages/site/site.wxss new file mode 100644 index 0000000..490cac6 --- /dev/null +++ b/pages/site/site.wxss @@ -0,0 +1,19 @@ +/* pages/site/site.wxss */ +.item{ + position: relative; + text-align: center; + width: 88%; + height: 80rpx; + line-height: 80rpx; + border-radius: 16rpx; + border: 1rpx #333 solid; + margin: 20rpx auto +} +.logo{ + width: 50rpx; + position: absolute; + right: 10rpx; + top: 0rpx; + font-size: 36rpx; + color: rgba(0, 0, 0, 0.8); +} \ No newline at end of file diff --git a/pages/siteAdd/siteAdd.js b/pages/siteAdd/siteAdd.js new file mode 100644 index 0000000..6d619dd --- /dev/null +++ b/pages/siteAdd/siteAdd.js @@ -0,0 +1,226 @@ +var app = getApp(); +const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px' +const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {} +const Http = require("../../utils/HttpBasics"); +const config = require("../../config/config.js"); +Page({ + + /** + * 页面的初始数据 + */ + data: { + navigationBarHeight, + userName: "", + userPhone: "", + // region:"", + detail: "", + switch1Checked: false, + region: ['北京市', '北京市', '东城区'], + id: "", + }, + go(e) { + let url = e.currentTarget.dataset.url + wx.navigateTo({ + url: url, + }) + }, + setUserName(e) { + this.setData({ + userName: e.detail.value + }) + }, + setUserPhone(e) { + this.setData({ + userPhone: e.detail.value + }) + }, + setRegion(e) { + this.setData({ + region: e.detail.value + }) + }, + setDetail(e) { + this.setData({ + detail: e.detail.value + }) + }, + switch1Change(e) { + this.setData({ + switch1Checked: e.detail.value + }) + }, + dleSite() { + Http.get({ + url: config.api.siteDel, + data: { + id: this.data.id + } + }).then(res => { + wx.showToast({ + title: '删除成功', + icon: 'none', + duration: 2000, + }) + wx.navigateBack({ + delta:1 + }) + }).catch(err => { + wx.showToast({ + title: err.message ? err.message : err.data, + icon: 'none', + duration: 2000, + }) + }) + }, + addSite() { + let myreg = /^[1][3,4,5,7,8][0-9]{9}$/; + if (this.data.userName == "") { + wx.showToast({ + title: '请输入收货人', + icon: 'none', + duration: 2000, + }) + return + } + + if (!myreg.test(this.data.userPhone)) { + // this.redata.Phone = ''; + wx.showToast({ + title: '请输入正确手机号', + icon: 'none', + duration: 2000, + }) + return + } + + if (this.data.detail == "") { + wx.showToast({ + title: '请输入详细地址', + icon: 'none', + duration: 2000, + }) + return + } + + let data = { + consignee: this.data.userName, + mobile: this.data.userPhone, + address: this.data.detail, + region: JSON.stringify(this.data.region), + isDefault: this.data.switch1Checked ? 1 : 0, + } + if (this.data.id && this.data.id != "") { + data.id = this.data.id + } + Http.post({ + url: config.api.collectSite, + data: data, + }).then(res => { + wx.showToast({ + title: '保存成功!', + icon: 'none', + duration: 2000, + }) + wx.navigateBack({ + delta: 1 + }) + }).catch(err => { + wx.showToast({ + title: err.message ? err.message : err.data, + icon: 'none', + duration: 2000, + }) + }) + }, + + bindRegionChange(e) { + this.setData({ + region: e.detail.value, + obj: {}, + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function(options) { + if (options.id) { + this.setData({ + id: options.id + }) + this.siteCheck(options.id) + } + }, + siteCheck(id) { + Http.get({ + url: config.api.siteCheck, + data: { + id + } + }).then(res => { + let obj = res.data + + this.setData({ + userName: obj.consignee, + userPhone: obj.mobile, + detail: obj.address, + region: JSON.parse(obj.region), + switch1Checked: obj.isDefault == 0 ? false : true, + }) + }).catch(err => { + wx.showToast({ + title: err.message ? err.message : err.data, + icon: 'none', + duration: 2000, + }) + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function() { + + } +}) \ No newline at end of file diff --git a/pages/siteAdd/siteAdd.json b/pages/siteAdd/siteAdd.json new file mode 100644 index 0000000..cedc479 --- /dev/null +++ b/pages/siteAdd/siteAdd.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "navbar": "../components/navbar/navbar" + } +} \ No newline at end of file diff --git a/pages/siteAdd/siteAdd.wxml b/pages/siteAdd/siteAdd.wxml new file mode 100644 index 0000000..ea4f697 --- /dev/null +++ b/pages/siteAdd/siteAdd.wxml @@ -0,0 +1,40 @@ + + + + 收货人 + + + + + + 手机号码 + + + + + + 所在地区 + + + + {{region[0]}},{{region[1]}},{{region[2]}} + + + + + + + 详细地址 + + + + + + + 设为默认地址 + + + + +保存 +删除 \ No newline at end of file diff --git a/pages/siteAdd/siteAdd.wxss b/pages/siteAdd/siteAdd.wxss new file mode 100644 index 0000000..53f1c2f --- /dev/null +++ b/pages/siteAdd/siteAdd.wxss @@ -0,0 +1,67 @@ +/* pages/siteAdd/siteAdd.wxss */ +.itemBox{ + overflow: hidden; + width: 96%; + margin: 20rpx auto; +} +.title{ + float: left; + height: 80rpx; + width: 20%; + line-height: 80rpx; +} +.inputBox{ + float: left; + height: 70rpx; + width: 70%; + border: rgba(0, 0, 0, 0.3) 1rpx solid; + border-radius: 10rpx; + margin: 5rpx 10rpx; +} +.text{ + width: 80%; + height: 70rpx; + line-height: 70rpx; + margin: 0 auto; +} +.tacitly{ + width: 90%; + height: 80rpx; + line-height: 80rpx; + /* border: rgba(0, 0, 0, 0.3) 1rpx solid; */ + /* border-radius: 10rpx; */ + margin: 50rpx auto; + overflow: hidden; +} +.sez{ + line-height: 80rpx; + float: left; + margin-left: 20rpx; +} +.switchBox{ + float: right; +} +.add{ + width: 80%; + height: 60rpx; + text-align: center; + line-height: 60rpx; + background-color: #FD832D; + color: #fff; + margin-top: 200rpx; + margin-left: auto; + margin-right: auto; + border-radius: 12rpx; +} +.dle{ + width: 80%; + height: 60rpx; + text-align: center; + line-height: 60rpx; + background-color: red; + color: #fff; + margin-top: 40rpx; + margin-left: auto; + margin-right: auto; + border-radius: 12rpx; +} \ No newline at end of file diff --git a/pages/siteUser/siteUser.js b/pages/siteUser/siteUser.js new file mode 100644 index 0000000..9ba6d81 --- /dev/null +++ b/pages/siteUser/siteUser.js @@ -0,0 +1,108 @@ +var app = getApp(); +const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px' +const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {} +const Http = require("../../utils/HttpBasics"); +const config = require("../../config/config.js"); +Page({ + + /** + * 页面的初始数据 + */ + data: { + navigationBarHeight, + list:[], + pageNum:1, + }, + goAdd(e) { + let url = '/pages/siteAdd/siteAdd' + wx.navigateTo({ + url: url, + }) + console.log(url) + }, + gitLsit(){ + Http.get({ + url: config.api.siteList, + data:{ + pageNum: this.data.pageNum, + pageSize:5, + } + }).then(res=>{ + let tempLsit = res.data.list + tempLsit.map(item=>{ + let regionSty = "" + if (JSON.parse(item.region)[0] == JSON.parse(item.region)[1]){ + regionSty = JSON.parse(item.region)[1] + JSON.parse(item.region)[2] + }else{ + regionSty = JSON.parse(item.region)[0]+JSON.parse(item.region)[1] + JSON.parse(item.region)[2] + } + item.regionSty = regionSty + }) + console.log(tempLsit) + this.setData({ + + list: tempLsit + }) + }) + }, + dutu(e){ + wx.navigateTo({ + url: `/pages/siteAdd/siteAdd?id=${e.currentTarget.dataset.id}`, + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + this.gitLsit() + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/siteUser/siteUser.json b/pages/siteUser/siteUser.json new file mode 100644 index 0000000..cedc479 --- /dev/null +++ b/pages/siteUser/siteUser.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "navbar": "../components/navbar/navbar" + } +} \ No newline at end of file diff --git a/pages/siteUser/siteUser.wxml b/pages/siteUser/siteUser.wxml new file mode 100644 index 0000000..8a8bd5e --- /dev/null +++ b/pages/siteUser/siteUser.wxml @@ -0,0 +1,12 @@ + + + + + {{item.regionSty}} + {{item.address}} + {{item.consignee}} {{item.mobile}} + + + + ++新建收货地址 \ No newline at end of file diff --git a/pages/siteUser/siteUser.wxss b/pages/siteUser/siteUser.wxss new file mode 100644 index 0000000..0501782 --- /dev/null +++ b/pages/siteUser/siteUser.wxss @@ -0,0 +1,47 @@ +/* pages/siteUser/siteUser.wxss */ +page{ + background-color: #eee; + +} +.siteItem{ + width: 88%; + margin: 20rpx auto; + border-radius: 10rpx; + border: 1rpx #fff solid; + overflow: hidden; + background-color: #fff; +} +.siteBox{ + float: left; + width: 90%; +} +.region{ + padding: 10rpx; +} +.detail{ + color: #999; + font-size: 26rpx +} +.phone{ + color: #999; + font-size: 26rpx +} +.updataImg{ + + float: right; + width: 60rpx; + height: 60rpx; + background-color: #fac; + margin-top: 50rpx; + margin-right: 2rpx +} +.addSite{ + background-color: #FD832D; + color: #fff; + width: 90%; + text-align: center; + height: 60rpx; + border-radius: 100rpx; + margin: 20rpx auto; + line-height: 60rpx; +} \ No newline at end of file diff --git a/pages/spellDetail/index.js b/pages/spellDetail/index.js index f096cc4..4e69166 100644 --- a/pages/spellDetail/index.js +++ b/pages/spellDetail/index.js @@ -263,7 +263,7 @@ Page({ * 用户点击右上角分享 */ // paramData - onShareAppMessage: function (res) { + onShareAppMessage: function (res) { app.globalData.previewFlag = true if (res.from === 'button') { console.log(res, this.data.nickName, this.data.avatarUrl, 3333333333333333333333) diff --git a/pages/spellGroup/mySpellGroup/index.js b/pages/spellGroup/mySpellGroup/index.js index 2c2c5ce..d7dc1ac 100644 --- a/pages/spellGroup/mySpellGroup/index.js +++ b/pages/spellGroup/mySpellGroup/index.js @@ -154,7 +154,7 @@ Page({ }, /** * 直接购买 - */ + */ gotoBuy(e) { let that = this; this.setData({ @@ -326,11 +326,12 @@ Page({ data: { couponId: couponId } - }).then(res => { + }).then(res => { that.setData({ disOrderNumber: res.data.orderNumber, couponChannelId: res.data.couponChannelId, - orderGroupId: res.data.orderGroupId + orderGroupId: res.data.orderGroupId, + composeOrderType: res.data.composeOrderType }) // 拼团订单 @@ -352,7 +353,7 @@ Page({ success: function (res) { if (res.confirm) { wx.navigateTo({ - url: `/pages/spellGroup/paySpellGroup/index?orderId=${that.data.disOrderNumber}&couponChannelId=${that.data.couponChannelId}&couponId=${couponId}&orderGroupId={that.data.orderGroupId}`, + url: `/pages/spellGroup/paySpellGroup/index?orderId=${that.data.disOrderNumber}&couponChannelId=${that.data.couponChannelId}&couponId=${couponId}&orderGroupId={that.data.orderGroupId}&composeOrderType=${that.data.composeOrderType}`, }) } @@ -366,7 +367,7 @@ Page({ success: function (res) { if (res.confirm) { wx.navigateTo({ - url: `/pages/order/detail/index?orderId=${that.data.disOrderNumber}`, + url: `/pages/order/detail/index?orderId=${that.data.disOrderNumber}&composeOrderType=${that.data.composeOrderType}`, }) } } @@ -470,7 +471,7 @@ Page({ }); }, /** - * 去拼团 + * 去拼团 */ goToOrderGroup(orderId, orderGroupId, _this) { let that = this; @@ -504,7 +505,7 @@ Page({ url: config.api.payOrderUpdate, data: { payOrderId: payOrderId, - orderId: orderId, + composeOrderId: orderId, status: status, reason: reason } @@ -513,10 +514,10 @@ Page({ wx.hideLoading() if (orderGroupId !== 0) { wx.navigateTo({ - url: '/pages/order/detail/index?orderId=' + res.data.id, + url: '/pages/order/detail/index?orderId=' + res.data.mainOrderId, }) } else { - _this.goToOrderGroup(orderId, res.data.orderGroupId, _this) + _this.goToOrderGroup(orderId, res.data.mainOrderId, _this) } }) .catch(err => { @@ -563,7 +564,7 @@ Page({ data: {} }).then(res => { /** - * orderSave 下单 + * orderSave 下单 */ return Http.post({ url: config.api.orderSave, @@ -661,11 +662,12 @@ Page({ }); } }).then(res => { - console.log(res) + console.log(res,"123") if (typeof (res) != "undefined") { - let orderId = "" + res.data.id; + let orderId = "" + res.data.mainOrderId; that.setData({ orderId: orderId, + composeOrderType: res.data.composeOrderType, canSpell: false, canBuyIf: true }); @@ -676,7 +678,8 @@ Page({ Http.post({ url: config.api.payOrderCreate, data: { - orderId: orderId + orderId: orderId, + composeOrderType: that.data.composeOrderType } }).then(res => { var payOrderId = "" + res.data.payOrderId; @@ -722,7 +725,7 @@ Page({ }) .catch(err => { that.setData({ - canSpell: true, + canSpell: true, canBuyIf: true }) wx.showToast({ diff --git a/pages/spellGroup/paySpellGroup/index.js b/pages/spellGroup/paySpellGroup/index.js index 1c919d7..3c76291 100644 --- a/pages/spellGroup/paySpellGroup/index.js +++ b/pages/spellGroup/paySpellGroup/index.js @@ -137,7 +137,7 @@ Page({ url: config.api.payOrderUpdate, data: { payOrderId: payOrderId, - orderId: orderId, + composeOrderId: orderId, status: status, reason: reason } @@ -158,7 +158,7 @@ Page({ url: '/pages/order/detail/index?orderId=' + res.data.id, }) } else { - _this.goToOrderGroup(orderId, res.data.orderGroupId, _this) + _this.goToOrderGroup(orderId, res.data.mainOrderId, _this) } }) .catch(err => { @@ -184,7 +184,8 @@ Page({ Http.post({ url: config.api.payOrderCreate, data: { - orderId: that.data.paramData.orderId + orderId: that.data.paramData.orderId, + composeOrderType: that.data.paramData.composeOrderType, } }) .then(res => { diff --git a/pages/spellGroup/spellGroup.js b/pages/spellGroup/spellGroup.js index 9b28c46..878ebff 100644 --- a/pages/spellGroup/spellGroup.js +++ b/pages/spellGroup/spellGroup.js @@ -167,7 +167,7 @@ Page({ }) let data = e.currentTarget.dataset.data wx.navigateTo({ - url: `/pages/spellGroup/paySpellGroup/index?orderId=${data.orderId}&couponId=${data.couponId}&orderGroupId=${data.orderGroupId}&couponChannelId=${data.couponChannelId}`, + url: `/pages/spellGroup/paySpellGroup/index?orderId=${data.orderId}&couponId=${data.couponId}&orderGroupId=${data.orderGroupId}&couponChannelId=${data.couponChannelId}&composeOrderType=${data.composeOrderType}`, }) }, gotoEdit(e){ diff --git a/project.config.json b/project.config.json index 423a046..ba0a972 100644 --- a/project.config.json +++ b/project.config.json @@ -120,8 +120,15 @@ }, { "id": 8, - "name": "pages2/fengMap/fengMap", - "pathName": "pages2/fengMap/fengMap", + "name": "个人信息", + "pathName": "pages/site/site", + "query": "", + "scene": null + }, + { + "id": -1, + "name": "pages/siteUser/siteUser", + "pathName": "pages/siteUser/siteUser", "query": "", "scene": null }