diff --git a/api/common.js b/api/common.js index edb7e7f..8489a1b 100644 --- a/api/common.js +++ b/api/common.js @@ -3,8 +3,10 @@ let app = getApp(); const token = wx.getStorageSync('accessToken'); export default { + getConfig:()=>request.get('/api/config'), community:{ - list:(data)=>request.get('/api/community',data) + list:(data)=>request.get('/api/community',data), + detail:(community_id)=>request.get(`/api/community/${community_id}`) }, address:{ list(commityId){ @@ -25,10 +27,14 @@ export default { station:{ list:(community_id)=>request.get('/api/station',{community_id}) }, - uploadImg(file){ + activities:{ + detail:(activity_id)=>request.get(`/api/coupon-activities/${activity_id}`), + receive:(activity_id)=>request.post(`/api/coupon-activities/${activity_id}/receive`) + }, + uploadImg(file,progress){ if(!app)app = getApp(); return new Promise((rs,rj)=>{ - wx.uploadFile({ + const task = wx.uploadFile({ filePath: file.tempFilePath, name: 'file', header:{ @@ -43,6 +49,10 @@ export default { rj(res); } }) + if(progress){ + progress.task = task; + task.onProgressUpdate(progress); + } }); } } \ No newline at end of file diff --git a/api/request.js b/api/request.js index 2e02806..ff491b7 100644 --- a/api/request.js +++ b/api/request.js @@ -1,5 +1,13 @@ -const baseUrl = 'https://api-dev.beefast.co'; +const { miniProgram } = wx.getAccountInfoSync(); +const envVersion = miniProgram.envVersion; +let baseUrl = ''; +if(envVersion=='develop'){ + baseUrl = 'https://api-dev.beefast.co'; +}else{ + baseUrl = 'https://api.beefast.co' +} let app = getApp(); +let token = wx.getStorageSync('accessToken'); const sendRequest = (options)=>{ if(!app)app = getApp(); @@ -22,10 +30,21 @@ const sendRequest = (options)=>{ rj(result.data); } }else if(result.statusCode==401){ + const pages = getCurrentPages(); + const currentPages = pages[pages.length-1]; + if(currentPages&¤tPages.route.indexOf('pages/login')>-1){ + return; + } + if(app)app = getApp(); + const code = app?.globalData?.shared_user_code; wx.navigateTo({ - url: '/pages/login/login', + url: '/pages/login/login?shared_user_code='+code, }) }else{ + wx.showToast({ + icon:'error', + title: result.data.message||result.data.detail||'发生错误', + }) rj(result.data); } }, @@ -33,11 +52,11 @@ const sendRequest = (options)=>{ method:options.method, data:options.data, header:{ - Authorization: `Bearer ${app.globalData.accessToken}`, - "content-type":options.data&&options.data.file?'application/x-www-form-urlencoded':'application/json' + Authorization: `Bearer ${token||app?.globalData?.accessToken}` }, fail:(res)=>{ wx.showToast({ + icon:'error', title: 'Request Error', }) rj(res); diff --git a/api/user.js b/api/user.js index 487843f..98526a5 100644 --- a/api/user.js +++ b/api/user.js @@ -59,7 +59,8 @@ export default { status:{ unused:'UNUSED',used:'USED',expired:'EXPIRED' }, - list:(data)=>request.get('/api/coupon/user/list',data) + list:(data)=>request.get('/api/coupon/user/list',data), + use:(coupon_id)=>request.put(`/api/coupon/${coupon_id}/use`) }, point:{ list:(data)=>request.get('/api/point/records',data) diff --git a/app.js b/app.js index edfd2ce..abcf569 100644 --- a/app.js +++ b/app.js @@ -1,17 +1,43 @@ import userApi from './api/user'; import commonApi from './api/common'; let token = wx.getStorageSync('accessToken'); -console.log(12); App({ onLaunch(options) { - console.log(options); wx.getStorage({ key:'accessToken', success:(res)=>{ this.globalData.accessToken = res.data; } + }); + this.getAppConfig(); + wx.onAppRoute((res)=>{ + const page = getCurrentPages(); + const currentPage = page[page.length-1]; + if(currentPage){ + currentPage.onShareAppMessage = async()=>{ + console.log(this.globalData.userInfo.user_code); + if(!(this.globalData.appConfig&&this.globalData.appConfig.share_card_title)){ + await this.getAppConfig(); + } + if(!(this.globalData.userInfo&&this.globalData.userInfo.user_code)){ + await this.getUserInfo(); + } + return { + title:this.globalData.appConfig.share_card_title, + imageUrl:'/assets/imgs/login/share.jpg', + path:`/pages/help/index/index?shared_user_code=${this.globalData.userInfo.user_code}` + } + } + } }) }, + onShow(options){ + //shared_user_code 通过分享进来的 分享者 的user_code + //这里必须放到onshow 里 才能实时获取 code 先保存在这里,再跳转登录的时候通过 url 带过去,防止刷新丢失 code + if(options.query.shared_user_code){ + this.globalData.shared_user_code = options.query.shared_user_code; + } + }, navToLogin(){ wx.reLaunch({ url: '/pages/login/login', @@ -32,6 +58,16 @@ App({ this.globalData.userInfoGetTime = new Date(); return data; }, + async getAppConfig(){ + if(!this.globalData.appConfig){ + const data = await commonApi.getConfig(); + this.globalData.appConfig = {}; + data.map((item)=>{ + this.globalData.appConfig[item.key] = item.value; + }) + } + return this.globalData.appConfig; + }, getLocation(){ return new Promise((rs,rj)=>{ if(this.globalData.locationGetTime&& @@ -62,42 +98,7 @@ App({ globalData: { userInfo: null, accessToken:token, - community:{ - _list:[], - lastFetchTime:null, - getList(){ - let lft = this.lastFetchTime; - return new Promise((rs,rj)=>{ - if(!lft&&new Date()-lft>30){ - commonApi.community.list().then((data)=>{ - this.lastFetchTime = new Date(); - this._list = data; - rs(data) - }) - }else{ - rs(this._list); - } - }) - }, - }, - address:{ - _list:[], - lastFetchTime:null, - getList(){ - let lft = this.lastFetchTime; - return new Promise((rs,rj)=>{ - if(!lft&&new Date()-lft>30){ - commonApi.address.list().then((data)=>{ - this.lastFetchTime = new Date(); - this._list = data; - rs(data) - }) - }else{ - rs(this._list); - } - }) - }, - } + appConfig:null }, validateForm(rules,page){ const result = []; @@ -116,13 +117,19 @@ App({ valid = false; } }else if(item.type=='phone'){ + //验证电话号码 if(value.length!=11){ valid = false; } }else if(item.maxLength||item.minLength){ + //字符串长度 if(value.length>(item.maxLength||Infinity)||value.length{ + this.setData({ + show:false + }); + this.triggerEvent('cancel'); + } + }) }, okButtonTap(){ - this.setData({ - show:false + wx.showTabBar({ + complete:()=>{ + this.setData({ + show:false + }); + this.triggerEvent('ok'); + } }); - this.triggerEvent('ok'); + }, + enterPageContainer(){ + wx.hideTabBar(); + }, + leavePageContainer(){ + wx.showTabBar(); } }, lifetimes:{ - attached(){ - - const windowInfo = wx.getWindowInfo(); - const viewHeight = 50+96+32+48; - this.setData({ - dynamicsStyle:`top:${(windowInfo.windowHeight-viewHeight)/2}px;height:${viewHeight}px;` - }) + // attached(){ + // console.log(this); + // const windowInfo = wx.getWindowInfo(); + // this.createSelectorQuery().select('#modalViewMain').boundingClientRect((res)=>{ + // const viewHeight = res.height; + // console.log(res); + // this.setData({ + // dynamicsStyle:`top:${(windowInfo.screenHeight-viewHeight)/2}px;height:${viewHeight}px;` + // }) + // }).exec(); + // } + }, + observers:{ + show(show){ + if(show){ + const windowInfo = wx.getWindowInfo(); + this.createSelectorQuery().select('#modalViewMain').boundingClientRect((res)=>{ + const viewHeight = res.height; + this.setData({ + dynamicsStyle:`top:${(windowInfo.windowHeight-viewHeight)/2}px;height:${viewHeight}px;` + }) + }).exec(); + } } } }) \ No newline at end of file diff --git a/components/modalView/index.wxml b/components/modalView/index.wxml index 471ba55..31e04bd 100644 --- a/components/modalView/index.wxml +++ b/components/modalView/index.wxml @@ -1,15 +1,16 @@ - + custom-style="background-color:transparent;left:27px;width:calc(100vw - 54px);height:200px;{{dynamicsStyle}}" + bind:enter="enterPageContainer" bind:leave="leavePageContainer"> + {{titleText}} {{content}} - - + + \ No newline at end of file diff --git a/components/modalView/index.wxss b/components/modalView/index.wxss index 896bb11..c6cbecb 100644 --- a/components/modalView/index.wxss +++ b/components/modalView/index.wxss @@ -29,4 +29,13 @@ padding:32rpx; line-height: 1; font-weight: 500; + border-width: 2rpx; +} +.modal-view-main .btns .button.cancel{ + border-color:rgba(153, 153, 153, 0.5); + background-color: rgba(153, 153, 153, 0.1); + color:var(--main-font-color); +} +.modal-view-main .btns .button.confirm{ + font-weight: bold; } \ No newline at end of file diff --git a/components/navbar/index.wxss b/components/navbar/index.wxss index 3605b44..66008ad 100644 --- a/components/navbar/index.wxss +++ b/components/navbar/index.wxss @@ -1,5 +1,9 @@ /* components/navBar.wxss */ -.nav-bar{ +.nav-bar{} +.nav-bar .title{ + font-size: 32rpx; + font-weight: 500; + color: var(--main-font-color); } .nav-bar-content{ display: flex; diff --git a/pages/browser/index.js b/pages/browser/index.js new file mode 100644 index 0000000..cf5131c --- /dev/null +++ b/pages/browser/index.js @@ -0,0 +1,68 @@ +// pages/browser/index.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + webUrl:'' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + webUrl:options.url + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/browser/index.json b/pages/browser/index.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/browser/index.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/browser/index.wxml b/pages/browser/index.wxml new file mode 100644 index 0000000..87168c3 --- /dev/null +++ b/pages/browser/index.wxml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/pages/browser/index.wxss b/pages/browser/index.wxss new file mode 100644 index 0000000..e10bd99 --- /dev/null +++ b/pages/browser/index.wxss @@ -0,0 +1 @@ +/* pages/browser/index.wxss */ \ No newline at end of file diff --git a/pages/help/address/edit/index.wxml b/pages/help/address/edit/index.wxml index bed2e81..6600f49 100644 --- a/pages/help/address/edit/index.wxml +++ b/pages/help/address/edit/index.wxml @@ -63,5 +63,5 @@ class="button">删除 - + diff --git a/pages/help/address/edit/index.wxss b/pages/help/address/edit/index.wxss index 13d98de..883cc8a 100644 --- a/pages/help/address/edit/index.wxss +++ b/pages/help/address/edit/index.wxss @@ -14,7 +14,11 @@ .button{ margin:30rpx!important; } +.picker.cell-bd{ + position: relative; +} .picker input{ - width:100%; - flex: 1; + width:100%;height: 100%!important; + left:0;top:0; + position: absolute; } \ No newline at end of file diff --git a/pages/help/community/index.wxml b/pages/help/community/index.wxml index d26f9f4..7c9eec7 100644 --- a/pages/help/community/index.wxml +++ b/pages/help/community/index.wxml @@ -1,6 +1,5 @@ @@ -9,7 +8,7 @@ - + diff --git a/pages/help/community/index.wxss b/pages/help/community/index.wxss index 86bd698..0d2e033 100644 --- a/pages/help/community/index.wxss +++ b/pages/help/community/index.wxss @@ -35,7 +35,10 @@ .community-list .item .sub-title .key{ color: #888; flex: 1; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; } .community-list .item .sub-title .value{ - margin-left:10rpx; + margin-left:14rpx; } \ No newline at end of file diff --git a/pages/help/index/index.js b/pages/help/index/index.js index 2ecb9da..bf24cb3 100644 --- a/pages/help/index/index.js +++ b/pages/help/index/index.js @@ -30,7 +30,9 @@ Page({ genderKV:userApi.genderKV, navBarHeight:0, - isShowPayModal:false + isShowPayModal:false, + + appConfig:{} }, /** @@ -45,6 +47,18 @@ Page({ isLogin:!!app.globalData.accessToken }) // this.getAddress(); + app.getAppConfig().then((data)=>{ + this.setData({ + appConfig:data + }) + }) + + + // wx.login({ + // success: (res) => { + // console.log(res); + // }, + // }) }, /** @@ -60,8 +74,13 @@ Page({ wx.getStorage({ key:'pre-order', success:(res)=>{ + console.log(res); const name = []; let count = 0; + if(res.data.price_request.pickup_images){ + name.push('图片取件'); + count+=res.data.price_request.pickup_images_count; + } res.data.price_request.packages.map((item)=>{ name.push(item.station_name); count+=item.pickup_codes.split(',').length; @@ -82,7 +101,7 @@ Page({ }) } }); - console.log('manuallyChangedCommunity',this.data.manuallyChangedCommunity); + if(!this.data.manuallyChangedCommunity){ app.forceGetUserInfo().then((data)=>{ if(data.default_address){ @@ -157,13 +176,25 @@ Page({ key:'pre-order', success:(res)=>{ this.setData({preOrdering:true}); - userApi.order.pre({ - packages:res.data.price_request.packages - }).then((data)=>{ - this.setData({ - isShowOrderConfirm:true, - preOrdering:false, - preOrder:data + let params = { + community_id:this.data.currentCommunity.id + }; + if(res.data.price_request.packages&&res.data.price_request.packages.length>0){ + params.packages = res.data.price_request.packages; + } + if(res.data.price_request.pickup_images){ + params.pickup_images_count = res.data.price_request.pickup_images_count; + params.pickup_images = res.data.price_request.pickup_images; + } + userApi.order.pre(params).then((data)=>{ + wx.hideTabBar({ + success:()=>{ + this.setData({ + isShowOrderConfirm:true, + preOrdering:false, + preOrder:data + }); + } }); }).catch((data)=>{ if(data.code==400&&data.data&&data.data.orderid){ @@ -181,7 +212,7 @@ Page({ wx.showToast({ icon:'none', duration:1000, - title: '选择取件驿站' + title: '选择驿站取件' }) } }) @@ -198,6 +229,7 @@ Page({ key:'pre-order', success:(res)=>{ res.data.addressid = this.data.currentAddress.id; + res.data.community_id = this.data.currentCommunity.id; userApi.order.real(res.data).then((data)=>{ this.setData({ isShowOrderConfirm:false, @@ -219,7 +251,7 @@ Page({ }, enterPageContainer(){ console.log('enterPageContainer'); - wx.hideTabBar(); + // wx.hideTabBar(); }, leavePageContainer(){ console.log('leavePageContainer'); diff --git a/pages/help/index/index.wxml b/pages/help/index/index.wxml index dd71559..c1d3db7 100644 --- a/pages/help/index/index.wxml +++ b/pages/help/index/index.wxml @@ -3,7 +3,7 @@ - + @@ -43,7 +43,7 @@ 共计 {{package.count}} 个包裹 - 选择取件驿站 + 选择驿站取件 @@ -71,16 +71,16 @@ --> - - - 您有免费跑腿券待领取 - 先领券,再下单,立享免费跑腿 + + + {{appConfig.join_group_title}} - - + {{appConfig.join_group_desc}} + - - + @@ -100,7 +100,7 @@ {{preOrder.price_info.original_amount}} - 跑腿券 + 优惠券 - {{preOrder.price_info.coupon_discount_amount}} @@ -111,7 +111,7 @@ 应支付 - 先付后享 + 先享后付 {{preOrder.price_info.final_amount}} @@ -121,5 +121,4 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/pages/help/index/index.wxss b/pages/help/index/index.wxss index 5e7e512..b17fd14 100644 --- a/pages/help/index/index.wxss +++ b/pages/help/index/index.wxss @@ -14,8 +14,8 @@ padding-top:90rpx; } .nav-bar .logo{ - width:168rpx; - height:42rpx; + width:160rpx; + height:37rpx; } .choose-community{ padding:90rpx 40rpx 70rpx; @@ -113,36 +113,22 @@ } .promotion-panel{ - display: flex; - border: 1px solid rgba(26, 77, 235, 0.5); - margin:44rpx 20rpx; + border: 1rpx solid rgba(255, 195, 0, 0.5); + margin:40rpx 20rpx; border-radius: 20rpx; - padding:32rpx 32rpx 32rpx 40rpx; - align-items: center; + padding:36rpx 24rpx 36rpx 30rpx; + background-color: #fff; + box-shadow: 0px 2px 4px 2px rgba(0, 0, 0, 0.02); } -.promotion-panel .text{ - flex:1; -} - -.promotion-panel .text .title{ - font-size:34rpx; +.promotion-panel .title{ + font-size: 36rpx; + color:var(--main-color); font-weight: 500; } -.promotion-panel .text .title .spec{ - color:var(--main-color); -} - -.promotion-panel .text .sub-title{ - font-size: 28rpx; - color: #999999; - margin-top:26rpx; -} -.promotion-panel .button{ - width:100rpx; - height:100rpx; - border-radius: 50%; - padding:0; - line-height: 100rpx; +.promotion-panel .sub-title{ + font-size: 26rpx; + color: #777777; + margin-top:34rpx; } .login-panel{ diff --git a/pages/help/package/index.js b/pages/help/package/index.js index 4109670..c99d283 100644 --- a/pages/help/package/index.js +++ b/pages/help/package/index.js @@ -1,5 +1,6 @@ import commonApi from '../../../api/common'; import userApi from '../../../api/user'; +const app = getApp(); Page({ @@ -8,10 +9,38 @@ Page({ */ data: { stationList:[], - sendType:'DELIVERY_AT_DOORSTEP' + sendType:'DELIVERY_AT_DOORSTEP', + tempImgs:[], + imgUploading:false, + imgOrderCount:0, + maxChooseImgCount:10 + }, + validator:{ + imgOrderCount:{min:1,shake:true} }, - bottomBarButtonTap(){ + async bottomBarButtonTap(){ + if(this.data.tempImgs&&this.data.tempImgs.length>0){ + const valid = app.validateForm(this.validator,this); + console.log(this.validator,valid); + if(valid.length>0){ + wx.showToast({ + icon:'none', + title: '请选择包裹数量', + }) + return; + } + this.setData({ + imgUploading:true + }) + const rs = await this.uploadImages(); + this.setData({ + imgUploading:false + }) + if(rs instanceof Error){ + return; + } + } const data = []; this.data.stationList.map((item)=>{ if(item.package.length>0&&item.package[0]!=''){ @@ -22,13 +51,23 @@ Page({ }); } }) - if(data.length>0){ + //录入了有效取件码 或者 上传了取件图片 + if(data.length>0||this.data.tempImgs.length>0){ + let priceRequest = { + packages:data + }; + if(this.data.tempImgs.length>0){ + let imgs = []; + this.data.tempImgs.map((item)=>{ + imgs.push(item.serverUrl); + }); + priceRequest.pickup_images_count = this.data.imgOrderCount; + priceRequest.pickup_images = imgs.join(',') + } wx.setStorage({ key:'pre-order', data:{ - price_request:{ - packages:data - }, + price_request:priceRequest, delivery_method:this.data.sendType }, success(){ @@ -47,12 +86,26 @@ Page({ addPackage(event){ const index = event.currentTarget.dataset.index; - if(!this.data.stationList[index].package){ - this.data.stationList[index].package = []; + let packages = this.data.stationList[index].package; + if(!packages){ + packages = []; } - let hasEmptyInput = this.data.stationList[index].package.find((item)=>item=='')==undefined; - if(hasEmptyInput){ - this.data.stationList[index].package.push(''); + if(packages.length>1){ + if(packages.filter((item)=>item==packages[packages.length-1]).length>1){ + wx.showToast({ + icon:'none', + title: '取件码重复' + }) + this.data.stationList[index].focus = true; + this.setData({ + [`stationList[${index}].focus`]:true + }); + return; + } + } + let hasEmptyInput = packages.find((item)=>item=='')!=undefined; + if(!hasEmptyInput){ + packages.push(''); } this.data.stationList[index].focus = true; this.setData({ @@ -87,9 +140,23 @@ Page({ item.package = __item.pickup_codes.split(',')||[]; } }); + let tempImgs = [],imgOrderCount = 0; + if(res.data.price_request.pickup_images){ + const imgs = res.data.price_request.pickup_images.split(','); + imgs.map((item)=>{ + tempImgs.push({ + serverUrl:item, + uploaded:true + }) + }); + imgOrderCount = res.data.price_request.pickup_images_count||0; + } + console.log(tempImgs); this.setData({ sendType:res.data.delivery_method, - stationList:data.items + stationList:data.items, + tempImgs, + imgOrderCount }); } }); @@ -111,6 +178,78 @@ Page({ sendType:event.detail.value }); }, + chooseImage(){ + wx.chooseMedia({ + count:this.data.maxChooseImgCount - this.data.tempImgs.length, + mediaType:['image'], + success:(res)=>{ + this.setData({ + tempImgs:this.data.tempImgs.concat(res.tempFiles) + }); + wx.nextTick(()=>{ + this.uploadImages(); + }) + } + }) + }, + + async uploadImages(){ + let imgIndex = -1; + const file = this.data.tempImgs.find((item,index)=>{ + imgIndex = index; + return !item.uploaded; + }); + if(!file){ + return; + } + var onProgress = (res)=>{ + //进度 + this.setData({ + [`tempImgs[${imgIndex}].progress`]:res.progress + }) + } + //无奈之举,不大范围改动代码的同时,我需要获取到上传任务task,来中断上传操作,不然要出问题task在上传时被附加到了onProgress + this.data.tempImgs[imgIndex].onProgress = onProgress; + let uploadResult = {}; + try{ + uploadResult = await commonApi.uploadImg(file,onProgress); + }catch(e){ + await this.uploadImages(); + return; + } + if(uploadResult.url){ + this.setData({ + [`tempImgs[${imgIndex}].uploaded`]:true, + [`tempImgs[${imgIndex}].serverUrl`]:uploadResult.url + }) + await this.uploadImages(); + }else{ + //上传失败 + return new Error('失败') + } + }, + removeImage(event){ + const index = event.currentTarget.dataset.index; + if(this.data.tempImgs[index].onProgress&&this.data.tempImgs[index].onProgress.task){ + this.data.tempImgs[index].onProgress.task.abort(); + } + console.log('remove',new Date().getTime()); + this.data.tempImgs.splice(index,1); + this.setData({ + tempImgs:this.data.tempImgs + }); + }, + reduceImgOrderCount(){ + if(this.data.imgOrderCount<=1)return; + this.setData({ + imgOrderCount:this.data.imgOrderCount-1 + }) + }, + plusImgOrderCount(){ + this.setData({ + imgOrderCount:this.data.imgOrderCount+1 + }) + }, /** * 生命周期函数--监听页面初次渲染完成 */ diff --git a/pages/help/package/index.wxml b/pages/help/package/index.wxml index 55ca5d8..14e09c3 100644 --- a/pages/help/package/index.wxml +++ b/pages/help/package/index.wxml @@ -10,7 +10,31 @@ 上传取件信息图片时,图片需清晰显示取件位置信息 - + + + + + + + + + + + + + + + + + 请正确选择包裹数量 + + + {{imgOrderCount}} + + + + @@ -52,6 +76,6 @@ - + \ No newline at end of file diff --git a/pages/help/package/index.wxss b/pages/help/package/index.wxss index 151c31e..b031340 100644 --- a/pages/help/package/index.wxss +++ b/pages/help/package/index.wxss @@ -79,4 +79,117 @@ .img-area.page-container .head .sub-title{ padding-left:0; +} + +.img-area .photos{ + margin-top:26rpx; + display: flex; + flex-wrap: wrap; + gap: 26rpx; +} +.img-area .photos .item{ + text-align: center; + width:144rpx; + height:144rpx; + border-radius: 18rpx; + position: relative; +} +.img-area .photos .item .close-area{ + position: absolute; + right:-16rpx;top:-16rpx; + z-index: 2; + padding:5rpx; + display: flex; + align-items: center; +} +.img-area .photos .item .close-area .icon{ + width:28rpx;height:28rpx; +} +.img-area .photos .item .progress{ + position: absolute; + top:0;left:0; + width:100%; + z-index: 1; +} +.img-area .photos .item.loading::after{ + content: ''; + position: absolute; + width:100%;height:100%; + left:0;top:0; + background-color: rgba(0, 0, 0, 0.3); + z-index: 0; +} +.img-area .photos .item .image{ + width:100%;height:100%; + border-radius: 18rpx; +} +.img-area .photos .take-photo{ + border: 1.2rpx dashed rgba(124, 134, 149, 0.3); + border-radius: 18rpx; + display: flex; + align-items: center; + justify-content: center; +} +.img-area .photos .take-photo .icon{ + width:36rpx;height:36rpx; +} +.img-area .photos .take-photo .title{ + font-size: 24rpx; + color: #7C8695; + margin-top:16rpx; +} +.img-area .img-count{ + display: flex; + align-items: center; +} +.img-area .spliter{ + margin:30rpx 0; +} +.img-area .img-count .tips{ + flex:1; + font-size: 30rpx; + color: #555555; +} +.img-area .img-count .number-selector{ + display: flex; + align-items: center; +} +.number-selector .value{ + font-size: 36rpx; + padding:0 28rpx; +} +.number-selector .button{ + width:48rpx;height:48rpx; + line-height: 1; + padding:0; + text-align: center; + color: #fff; + position: relative; + background-color: var(--main-color); + border-radius: 50%; + border: 1rpx solid #FFC300; +} +.number-selector .button.disabled{ + background-color: #fff; +} +.number-selector .reduce::before, +.number-selector .plus::before, +.number-selector .plus::after{ + content: ''; + width:50%; + height:4rpx; + background-color: #fff; + position:absolute; + left:25%;top:22rpx; +} +.number-selector .reduce.disabled::before, +.number-selector .plus.disabled::before, +.number-selector .plus.disabled::after{ + background-color: var(--main-color); +} +.number-selector .plus::after{ + width:4rpx; + height:50%; + left:22rpx;top:25%; + z-index: 100; } \ No newline at end of file diff --git a/pages/help/success/index.js b/pages/help/success/index.js index e938abc..795f925 100644 --- a/pages/help/success/index.js +++ b/pages/help/success/index.js @@ -1,4 +1,4 @@ -// pages/help/success/index.js +const app = getApp(); Page({ /** @@ -6,7 +6,8 @@ Page({ */ data: { successText:'', - orderId:'' + orderId:'', + qrcodeUrl:'' }, /** @@ -17,6 +18,13 @@ Page({ successText:options.success_text, orderId:options.id }); + app.getAppConfig().then((data)=>{ + console.log(data); + this.setData({ + qrcodeUrl:data.mp_qr_code + }) + }) + app.globalData.needRefreshOrderList = true; }, navToOrderDetail(){ wx.redirectTo({ diff --git a/pages/help/success/index.wxml b/pages/help/success/index.wxml index 41fdf3d..cc0a25b 100644 --- a/pages/help/success/index.wxml +++ b/pages/help/success/index.wxml @@ -1,6 +1,16 @@ - - 恭喜下单成功 - {{successText}} - + + + + 恭喜下单成功 + {{successText}} + + + + + + + + 长按关注获取订单最新消息 + \ No newline at end of file diff --git a/pages/help/success/index.wxss b/pages/help/success/index.wxss index a4490b1..a8a2bde 100644 --- a/pages/help/success/index.wxss +++ b/pages/help/success/index.wxss @@ -4,10 +4,22 @@ page{ .page-success{ text-align: center; } +.page-success .top{ + height:56vh; + display: flex; + align-items: center; + padding-top:40px; + box-sizing: border-box; +} +.page-success .top-content{ + flex:1; +} +.page-success .bottom{ + height:44vh; +} .icon{ width:140rpx; height:140rpx; - margin-top:320rpx; } .title{ font-size: 44rpx; @@ -26,6 +38,29 @@ page{ font-weight: normal; border-radius: 60rpx; padding:19rpx!important; - margin:90rpx auto!important; - width:438rpx!important; + margin:90rpx 154rpx 0 154rpx!important; +} +.qrcode{ + border-radius: 30rpx; + width:360rpx; + height:360rpx; + margin:0 auto; + border:20rpx solid rgba(254, 196, 0, 0.15); +} +.qrcode .image{ + width:100%;height:100%; +} + +.tips{ + font-size: 32rpx; + margin-top: 40rpx; +} +.tips::after{ + content: ''; + display: block; + width:180rpx; + height:12rpx; + background-color: var(--main-color); + margin:30rpx auto; + border-radius: 6rpx; } \ No newline at end of file diff --git a/pages/login/login.js b/pages/login/login.js index 1a927ba..3164f60 100644 --- a/pages/login/login.js +++ b/pages/login/login.js @@ -5,7 +5,13 @@ Page({ data: { isAgree: false, loging:false, - animation:null + animation:null, + userCode:'' + }, + onLoad(options){ + this.setData({ + userCode:options.shared_user_code||'' + }); }, radioChange(event){ this.setData({ @@ -36,7 +42,7 @@ Page({ }) }, sendLogin(wxcode,phonecode){ - userApi.loginWithCode(wxcode,phonecode).then((data)=>{ + userApi.loginWithCode(wxcode,phonecode,this.data.userCode).then((data)=>{ this.setData({ loging:false }); @@ -45,10 +51,13 @@ Page({ key:"accessToken", data:data.access_token, success(){ - console.log(app.globalData); - wx.reLaunch({ - url: '/pages/help/index/index', - }) + wx.navigateBack({ + fail(){ + wx.reLaunch({ + url: '/pages/help/index/index', + }) + } + }); } }) }) diff --git a/pages/login/login.json b/pages/login/login.json index 3e34882..748461a 100644 --- a/pages/login/login.json +++ b/pages/login/login.json @@ -1,4 +1,7 @@ { "backgroundColor": "#4555FF", - "navigationBarTitleText": "登录" -} \ No newline at end of file + "usingComponents": { + "nav-bar":"/components/navbar" + }, + "navigationStyle": "custom" +} \ No newline at end of file diff --git a/pages/login/login.wxml b/pages/login/login.wxml index 9873c7e..ce34d5b 100644 --- a/pages/login/login.wxml +++ b/pages/login/login.wxml @@ -1,7 +1,10 @@ + + {{item.coupon_amount}} + - 暂无跑腿券 + 暂无优惠券 @@ -32,16 +38,22 @@ bind:loadMore="loadMore" refresher-triggered="{{pager.tab2.refreshTrigger}}" show-load-more="{{!(tab2List.length==0&&pager.tab2.loadAll)}}" loading="{{pager.tab2.loading}}" load-all="{{pager.tab2.loadAll}}"> - + {{item.coupon_name}} 有效期至 {{item.expire_time}} - {{item.coupon_amount}} + + + + + {{item.coupon_amount}} + - 暂无跑腿券 + 暂无优惠券 @@ -50,15 +62,21 @@ bind:loadMore="loadMore" refresher-triggered="{{pager.tab3.refreshTrigger}}" show-load-more="{{!(tab3List.length==0&&pager.tab3.loadAll)}}" loading="{{pager.tab3.loading}}" load-all="{{pager.tab3.loadAll}}"> - + {{item.coupon_name}} 有效期至 {{item.expire_time}} - {{item.coupon_amount}} + + + + {{item.coupon_amount}} - 暂无跑腿券 + 暂无优惠券 + + \ No newline at end of file diff --git a/pages/my/coupon/index.wxss b/pages/my/coupon/index.wxss index ada7f9e..d3ac05a 100644 --- a/pages/my/coupon/index.wxss +++ b/pages/my/coupon/index.wxss @@ -40,6 +40,24 @@ right:-12rpx; left:auto; } +.coupon-list .use-btn{ + font-size: 26rpx; + font-weight: 500; + line-height: 1; + padding:16rpx 22rpx; + border-radius: 60rpx; + box-shadow: 0px 2px 6px 2px rgba(255, 140, 18, 0.2); +} +.coupon-list .use-btn[disabled]{ + background: rgba(136, 136, 136, 0.5); + color:#fff; + font-weight: normal; + box-shadow: none; +} +.coupon-list .btn-area{ + display: flex; + align-items: center; +} .coupon-list .item.used .name{ color: #888888; diff --git a/pages/my/firend/index.js b/pages/my/firend/index.js index 90b86a6..2bcaca5 100644 --- a/pages/my/firend/index.js +++ b/pages/my/firend/index.js @@ -42,7 +42,7 @@ Page({ this.data.pager.loadAll = true; this.data.pager.refreshTrigger = false; this.setData({ - list:data, + list:data.items, pager:this.data.pager }) }) diff --git a/pages/my/firend/index.json b/pages/my/firend/index.json index 401bc40..10e4f68 100644 --- a/pages/my/firend/index.json +++ b/pages/my/firend/index.json @@ -2,5 +2,5 @@ "usingComponents": { "list-view":"/components/listView" }, - "navigationBarTitleText": "我的邻友" + "navigationBarTitleText": "我的蜜友" } \ No newline at end of file diff --git a/pages/my/firend/index.wxml b/pages/my/firend/index.wxml index 9e3e9c3..bb4ac6e 100644 --- a/pages/my/firend/index.wxml +++ b/pages/my/firend/index.wxml @@ -4,16 +4,18 @@ loading="{{pager.loading}}" load-all="{{pager.loadAll}}"> - 跑腿订单返现 - 134****6777 + {{item.nickname}} + {{item.phone}} - 待使用 - 2023.04.06 17:00 + + {{item.is_place_order?'已下单':'未下单'}} + + {{item.create_time}} - 暂无邻友 + 暂无蜜友 \ No newline at end of file diff --git a/pages/my/index/index.js b/pages/my/index/index.js index ef35d17..ac6ac8d 100644 --- a/pages/my/index/index.js +++ b/pages/my/index/index.js @@ -9,7 +9,8 @@ Page({ userInfo:{}, scrollViewHeight:0, refresherTriggered:true, - bgHeight:'100%' + bgHeight:'100%', + appConfig:{} }, goToCouponList(){ @@ -22,7 +23,6 @@ Page({ url: '/pages/my/money/index', }) }, - /** * 生命周期函数--监听页面加载 */ @@ -41,6 +41,9 @@ Page({ // this.setData({ // bgHeight:'100%' // }); + }, + shareFriend(){ + }, /** * 生命周期函数--监听页面初次渲染完成 @@ -62,6 +65,11 @@ Page({ refresherTriggered:false }); }) + app.getAppConfig().then((data)=>{ + this.setData({ + appConfig:data + }) + }) }, /** @@ -96,6 +104,6 @@ Page({ * 用户点击右上角分享 */ onShareAppMessage() { - + } }) \ No newline at end of file diff --git a/pages/my/index/index.wxml b/pages/my/index/index.wxml index 985dec1..afa947c 100644 --- a/pages/my/index/index.wxml +++ b/pages/my/index/index.wxml @@ -17,7 +17,7 @@ {{userInfo.coupon_count}} - 跑腿券(张) + 优惠券(张) {{userInfo.points}} @@ -39,14 +39,14 @@ --> - + diff --git a/pages/my/index/index.wxss b/pages/my/index/index.wxss index d62c719..d72d71f 100644 --- a/pages/my/index/index.wxss +++ b/pages/my/index/index.wxss @@ -62,10 +62,13 @@ } .invite-cell{ - padding:40rpx 40rpx 36rpx 40rpx; + padding:40rpx 40rpx 36rpx 40rpx!important; background-color: #fff; - margin:20rpx; + margin:20rpx!important; border-radius: 20rpx; + text-align: left; + font-weight: normal; + line-height: 1; } .invite-cell .title{ display: flex; @@ -73,14 +76,16 @@ } .invite-cell .title .text{ margin-left:20rpx; + font-size: 30rpx; flex:1; } .invite-cell .icon{ - width:40rpx;height:40rpx; + width:40rpx!important; + height:40rpx!important; } .invite-cell .sub-title{ - font-size: 26rpx; - color: #888888; + font-size: 29rpx; + color: #FF8C12; margin-top:30rpx; padding-left:60rpx; } diff --git a/pages/my/promation/activities/index.js b/pages/my/promation/activities/index.js new file mode 100644 index 0000000..49a580b --- /dev/null +++ b/pages/my/promation/activities/index.js @@ -0,0 +1,100 @@ +import commonApi from '../../../../api/common'; + +Page({ + + /** + * 页面的初始数据 + */ + data: { + detail:{}, + activityId:'', + detailLoading:false, + getting:true + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + activityId:options.id||2 + }); + this.getActivityDetail(); + }, + getActivityDetail(){ + this.setData({ + detailLoading:true + }) + commonApi.activities.detail(this.data.activityId).then((data)=>{ + this.setData({ + detailLoading:false, + getting:false + }) + this.setData({ + detail:data + }) + }) + }, + getActivity(){ + this.setData({ + getting:true + }) + commonApi.activities.receive(this.data.activityId).then((data)=>{ + wx.showToast({ + title: '领取成功', + }) + }).catch((e)=>{ + this.setData({ + getting:false + }) + }) + }, + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/my/promation/activities/index.json b/pages/my/promation/activities/index.json new file mode 100644 index 0000000..965b8e8 --- /dev/null +++ b/pages/my/promation/activities/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationStyle": "custom" +} \ No newline at end of file diff --git a/pages/my/promation/activities/index.wxml b/pages/my/promation/activities/index.wxml new file mode 100644 index 0000000..d898278 --- /dev/null +++ b/pages/my/promation/activities/index.wxml @@ -0,0 +1,26 @@ + + + + +领取时间:{{detail.daily_start_time}}-{{detail.daily_end_time}} + + + + {{item.name}} x {{item.count}} + {{item.amount}} + + 先领券,再下单,免费配送 + + + + + \ No newline at end of file diff --git a/pages/my/promation/activities/index.wxss b/pages/my/promation/activities/index.wxss new file mode 100644 index 0000000..46b31f5 --- /dev/null +++ b/pages/my/promation/activities/index.wxss @@ -0,0 +1,73 @@ +page{ + background-color: var(--main-color); + padding:160rpx 30rpx 70rpx 30rpx; + overflow: auto; +} +.loadings{ + height:100rpx; + text-align: center; +} +.time{ + background: linear-gradient(90deg, #FFC300 8%, #DFAB01 93%); + border-radius: 0px 60rpx 60rpx 0px; + display: inline-block; + padding:20rpx; +} +.coupon-list .item{ + background-color: #fff; + border-radius: 24rpx; + padding:32rpx 40rpx 40rpx; + margin-top:50rpx; + box-shadow: 0px 4px 10px 2px rgba(222, 169, 0, 0.5); + position: relative; + z-index: 1; +} +.coupon-list .item::before,.coupon-list .item::after{ + content: ''; + border-radius: 50%; + position: absolute; + left:-12rpx;top:88rpx; + width:24rpx;height:24rpx; + background-color: var(--main-color); +} +.coupon-list .item::after{ + right:-12rpx; + left: auto; +} +.coupon-list .item .name{ + font-size: 40rpx; + font-weight: 500; + display: flex; + align-items: center; + line-height: 54rpx; +} +.coupon-list .item .name .left{ + flex:1; +} +.coupon-list .item .money{ + font-size: 54rpx; + line-height: 1; +} +.coupon-list .item .tips{ + font-size: 26rpx; + color: #999999; + margin-top:44rpx; +} +.button{ + position: relative; + z-index: 1; + margin-top:60rpx; + background-color: var(--main-font-color)!important; + color:#fff!important; +} +.button.disabled{ + +} +.bottom-img{ + position: fixed; + bottom:0; + width:500rpx; + height:540rpx; + left:calc(50vw - 250rpx); + z-index: 0; +} \ No newline at end of file diff --git a/pages/my/promation/wx-group/index.js b/pages/my/promation/wx-group/index.js new file mode 100644 index 0000000..4eb7948 --- /dev/null +++ b/pages/my/promation/wx-group/index.js @@ -0,0 +1,76 @@ +import commonApi from '../../../../api/common'; +import {getStatusNavBarHeight} from '../../../../utils/util' +Page({ + + /** + * 页面的初始数据 + */ + data: { + detail:{}, + navbarHeight:getStatusNavBarHeight(), + test:'' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + navbarHeight:getStatusNavBarHeight() + }) + commonApi.community.detail(options.communityId).then((data)=>{ + this.setData({ + detail:data + }) + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/my/promation/wx-group/index.json b/pages/my/promation/wx-group/index.json new file mode 100644 index 0000000..e5c8349 --- /dev/null +++ b/pages/my/promation/wx-group/index.json @@ -0,0 +1,6 @@ +{ + "usingComponents": { + "nav-bar":"/components/navbar" + }, + "navigationStyle": "custom" +} \ No newline at end of file diff --git a/pages/my/promation/wx-group/index.wxml b/pages/my/promation/wx-group/index.wxml new file mode 100644 index 0000000..f06ab1d --- /dev/null +++ b/pages/my/promation/wx-group/index.wxml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + {{detail.name}} + + + + + + + + + 点击图中二维码识别 + + \ No newline at end of file diff --git a/pages/my/promation/wx-group/index.wxss b/pages/my/promation/wx-group/index.wxss new file mode 100644 index 0000000..48e5b32 --- /dev/null +++ b/pages/my/promation/wx-group/index.wxss @@ -0,0 +1,90 @@ +page{ + background-color: #fff; +} +.wx-group{ + display: flex; + flex-direction: column; + height:100vh; +} +.top-bg{ + background-color: var(--main-color); + text-align: center; + position: relative; +} +.top-bg .image{ + width:448rpx; + height:480rpx; + position: relative; + z-index: 1; +} +.community-info{ + background-color: #fff; + border-radius: 24rpx 24rpx 0 0; + margin-top:-16rpx; + position: relative; + z-index: 2; + padding:40rpx 40rpx 0 40rpx; + text-align: center; +} + +.community-info .head .title{ + display: inline-flex; + align-items: center; + color: #555555; +} +.community-info .head .icon{ + width:40rpx;height:40rpx; + margin-right:12rpx; +} +.community-info .head .name{ + font-size: 40rpx; + font-weight: 500; + margin-top:30rpx; +} + +.community-info .spliter{ + margin-top:30rpx; +} + +.wx-group .bottom{ + flex:1; + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; +} +.qrcode-area{ + width:400rpx;height:400rpx; + text-align: center; + border-radius: 30rpx; + border:20rpx solid rgba(254, 196, 0, 0.15); +} +.qrcode-area .image{ + width:100%;height:100%; +} +.bottom .tips{ + font-size: 36rpx; + font-weight: 500; + margin-top:70rpx; +} +.bottom .tips::after{ + content: ''; + width:180rpx;height:12rpx; + background-color: var(--main-color); + display: block; + margin:30rpx auto; + border-radius: 6rpx; +} + + + +.top-bg .hive{ + position: absolute; + bottom:0; + left:0; + height:140rpx; + width:100%; + color:red; + background-position-x: -26px; + background-image: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20fill%3D%22none%22%20version%3D%221.1%22%20width%3D%2270%22%20height%3D%2270%22%20viewBox%3D%220%200%2070%2070%22%3E%3Cdefs%3E%3CclipPath%20id%3D%22master_svg0_1324_21675%22%3E%3Crect%20x%3D%2270%22%20y%3D%220%22%20width%3D%2270%22%20height%3D%2270%22%20rx%3D%220%22/%3E%3C/clipPath%3E%3C/defs%3E%3Cg%20transform%3D%22matrix%28-1%2C0%2C0%2C1%2C140%2C0%29%22%20clip-path%3D%22url%28%23master_svg0_1324_21675%29%22%3E%3Cg%3E%3Cpath%20d%3D%22M77.845569265625%2C18.237163125L79.471022265625%2C17.298703125Q80.283752265625%2C16.829474125%2C80.752982265625%2C17.642202125L86.440042265625%2C27.492453125Q86.909272265625%2C28.305153125%2C86.096542265625%2C28.774453125L84.471082265625%2C29.712853125000002Q83.658352265625%2C30.182153125%2C83.189132265625%2C29.369353125L77.502072265625%2C19.519113125Q77.032843265625%2C18.706383125%2C77.845569265625%2C18.237163125Z%22%20fill%3D%22%23FFFFFF%22%20fill-opacity%3D%220.20000000298023224%22%20style%3D%22mix-blend-mode%3Apassthrough%22/%3E%3C/g%3E%3Cg%3E%3Cpath%20d%3D%22M139.6467%2C33.5923708984375L130.5869%2C17.9013708984375C130.0836%2C17.0296708984375%2C129.1533%2C16.4929708984375%2C128.14690000000002%2C16.4936708984375L112.088%2C16.4936708984375C111.4174%2C16.4936708984375%2C110.7978%2C16.1358708984375%2C110.46260000000001%2C15.5551708984375L102.4331%2C1.6453608984375C101.9299%2C0.7737178984375%2C100.9996%2C0.2370240314375%2C99.9931%2C0.2376708984375L81.8752%2C0.2376708984375C80.8688%2C0.2370255924375%2C79.9385%2C0.7737188984375%2C79.43526%2C1.6453608984375L70.37726%2C17.3382708984375C69.874342%2C18.2093708984375%2C69.874342%2C19.2825708984375%2C70.37726%2C20.1536708984375L78.40858%2C34.0615708984375C78.74386%2C34.6422708984375%2C78.74386%2C35.3577708984375%2C78.40858%2C35.9384708984375L70.37726%2C49.8464708984375C69.87434%2C50.7175708984375%2C69.87434%2C51.7907708984375%2C70.37726%2C52.6617708984375L79.43714%2C68.3546708984375C79.94038%2C69.2263708984375%2C80.8706%2C69.7630708984375%2C81.8771%2C69.7623708984375L99.9969%2C69.7623708984375C101.0034%2C69.7630708984375%2C101.9336%2C69.2263708984375%2C102.43690000000001%2C68.3546708984375L110.4551%2C54.4448708984375C110.7904%2C53.8641708984375%2C111.41%2C53.5064708984375%2C112.0805%2C53.5064708984375L128.1412%2C53.5064708984375C129.1477%2C53.5070708984375%2C130.078%2C52.9703708984375%2C130.5812%2C52.0987708984375L139.6411%2C36.4077708984375C140.1458%2C35.5376708984375%2C140.1479%2C34.4644708984375%2C139.6467%2C33.5923708984375ZM83.3768%2C4.7422708984375L98.4935%2C4.7422708984375C98.8189%2C4.7424808984375%2C99.1194%2C4.9163608984375%2C99.2818%2C5.1983608984375L106.8401%2C18.2954708984375C107.0035%2C18.5769708984375%2C107.0035%2C18.9243708984375%2C106.8401%2C19.2057708984375L99.2818%2C32.2991708984375C99.1192%2C32.5806708984375%2C98.8186%2C32.7539708984375%2C98.4935%2C32.7533708984375L83.3768%2C32.7533708984375C83.0517%2C32.7539708984375%2C82.751%2C32.5806708984375%2C82.5885%2C32.2991708984375L75.03014%2C19.2057708984375C74.86675%2C18.9243708984375%2C74.86675%2C18.5768708984375%2C75.03014%2C18.2954708984375L82.5885%2C5.2039908984375C82.7494%2C4.9198208984375%2C83.0502%2C4.7436308984375%2C83.3768%2C4.7422708984375ZM98.4935%2C65.2577708984375L83.3768%2C65.2577708984375C83.0514%2C65.2575708984375%2C82.7508%2C65.0836708984375%2C82.5885%2C64.8016708984375L75.03014%2C51.7045708984375C74.86675%2C51.4231708984375%2C74.86675%2C51.0756708984375%2C75.03014%2C50.7942708984375L82.5885%2C37.7008708984375C82.751%2C37.4193708984375%2C83.0517%2C37.2461708984375%2C83.3768%2C37.2466708984375L98.4935%2C37.2466708984375C98.8186%2C37.2461708984375%2C99.1192%2C37.4193708984375%2C99.2818%2C37.7008708984375L106.8401%2C50.7942708984375C107.0035%2C51.0756708984375%2C107.0035%2C51.4231708984375%2C106.8401%2C51.7045708984375L99.2818%2C64.7960708984375C99.1208%2C65.0802708984375%2C98.82%2C65.2564708984375%2C98.4935%2C65.2577708984375ZM111.5305%2C49.0018708984375C111.2054%2C49.0023708984375%2C110.9048%2C48.8291708984375%2C110.7422%2C48.5475708984375L103.1839%2C35.4542708984375C103.0204%2C35.1734708984375%2C103.0204%2C34.8265708984375%2C103.1839%2C34.5457708984375L110.7422%2C21.4524708984375C110.9048%2C21.1708708984375%2C111.2054%2C20.9976708984375%2C111.5305%2C20.9982708984375L126.6472%2C20.9982708984375C126.9724%2C20.9972708984375%2C127.2732%2C21.1705708984375%2C127.43549999999999%2C21.4524708984375L134.9939%2C34.5457708984375C135.15730000000002%2C34.8265708984375%2C135.15730000000002%2C35.1734708984375%2C134.9939%2C35.4542708984375L127.43549999999999%2C48.5475708984375C127.2732%2C48.8294708984375%2C126.9724%2C49.0027708984375%2C126.6472%2C49.0018708984375L111.5305%2C49.0018708984375Z%22%20fill%3D%22%23FFFFFF%22%20fill-opacity%3D%220.20000000298023224%22%20style%3D%22mix-blend-mode%3Apassthrough%22/%3E%3C/g%3E%3C/g%3E%3C/svg%3E); +} \ No newline at end of file diff --git a/pages/my/setting/index/index.js b/pages/my/setting/index/index.js index bde0b26..3240e8e 100644 --- a/pages/my/setting/index/index.js +++ b/pages/my/setting/index/index.js @@ -11,13 +11,21 @@ Page({ isShowPopup:false, name:'', inputName:'', - avatar:'' + avatar:'', + appConfig:{}, + uploading:false }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { + app.getAppConfig().then((data)=>{ + console.log(data); + this.setData({ + appConfig:data + }) + }) }, saveName(){ this.saveUser(); @@ -32,7 +40,8 @@ Page({ userApi.updateUser(data).then((data)=>{ this.setData({ name:data.nickname, - avatar:data.avatar + avatar:data.avatar, + uploading:false }); wx.showToast({ title: '更新成功', @@ -53,8 +62,15 @@ Page({ cropScale: '1:1', src: res.tempFiles[0].tempFilePath, success:(_res)=>{ + this.setData({ + uploading:true + }) commonApi.uploadImg(_res).then((data)=>{ this.saveUser(data.url); + }).catch(()=>{ + this.setData({ + uploading:false + }) }); } }) @@ -71,12 +87,24 @@ Page({ wx.removeStorage({ key: 'accessToken', success(){ + app.globalData.accessToken = ''; wx.reLaunch({ url: '/pages/login/login', }) } }) }, + + navToPrivacy(){ + wx.navigateTo({ + url: `/pages/browser/index?url=${this.data.appConfig.url_user_privacy}`, + }) + }, + navToAgreement(){ + wx.navigateTo({ + url: `/pages/browser/index?url=${this.data.appConfig.url_user_agreement}`, + }) + }, /** * 生命周期函数--监听页面初次渲染完成 */ diff --git a/pages/my/setting/index/index.wxml b/pages/my/setting/index/index.wxml index 23a8171..fdfceee 100644 --- a/pages/my/setting/index/index.wxml +++ b/pages/my/setting/index/index.wxml @@ -2,7 +2,8 @@ 修改头像 - + + @@ -14,11 +15,11 @@ - + 隐私政策 - + 用户协议 diff --git a/pages/my/setting/index/index.wxss b/pages/my/setting/index/index.wxss index 44c2efb..609bfa4 100644 --- a/pages/my/setting/index/index.wxss +++ b/pages/my/setting/index/index.wxss @@ -21,6 +21,9 @@ .cells .cell-ft .text{ color:var(--main-font-color); } +.cells .cell-ft .weui-loading{ + margin-right: 20rpx; +} .logout-btn{ margin:40rpx 20rpx 20rpx!important; diff --git a/pages/order/detail/index.js b/pages/order/detail/index.js index beaabf0..4dbf2a2 100644 --- a/pages/order/detail/index.js +++ b/pages/order/detail/index.js @@ -35,12 +35,8 @@ Page({ wx.showNavigationBarLoading(); userApi.order.detail(this.data.orderId).then((data)=>{ wx.hideNavigationBarLoading(); - let totalPackage = 0; - data.packages.map((item)=>{ - item.pickup_codes = item.pickup_codes.split(','); - totalPackage+=item.pickup_codes.length; - }); - data.totalPackage = totalPackage; + // let totalPackage = 0; + // data.totalPackage = totalPackage; this.setData({ orderDetail:data, refresherTriggered:false @@ -112,6 +108,13 @@ Page({ url: '/pages/help/index/index', }) }, + viewPackageImg(event){ + const img = event.currentTarget.dataset.item; + wx.previewImage({ + urls: this.data.orderDetail.pickup_images, + current:img + }) + }, /** * 生命周期函数--监听页面初次渲染完成 */ diff --git a/pages/order/detail/index.wxml b/pages/order/detail/index.wxml index 2bacaf1..9e2d76f 100644 --- a/pages/order/detail/index.wxml +++ b/pages/order/detail/index.wxml @@ -6,7 +6,7 @@ 配送员 - + {{orderDetail.deliveryman_nickname}} 已安全送达{{orderDetail.delivery_count}}件 @@ -34,11 +34,21 @@ 取件信息 - - - + + + + + + + 图片取件 共 {{orderDetail.pickup_images_count}} 件包裹 + + + + + @@ -81,16 +91,36 @@ 提交时间 {{orderDetail.create_time}} - + 取件数量 - {{orderDetail.totalPackage}} + {{orderDetail.package_count}} - 跑腿费用 + 订单金额 - - {{orderDetail.original_amount-orderDetail.coupon_discount_amount}} - + {{orderDetail.original_amount}} + + + + 蜂蜜抵扣 + + + + + + 优惠券抵扣 + + + + + + 支付金额 + + 先享后付 diff --git a/pages/order/detail/index.wxss b/pages/order/detail/index.wxss index 9ffda18..b6d4bf4 100644 --- a/pages/order/detail/index.wxss +++ b/pages/order/detail/index.wxss @@ -99,6 +99,15 @@ margin-top: 30rpx; font-weight: bold; } +.package-info .package .img-list{ + display: flex; + gap: 20rpx; + margin-top:30rpx; +} +.package-info .package .img-list .item{ + width:150rpx;height:150rpx; + border-radius: 10rpx; +} .package-info .package .item{ } @@ -107,6 +116,9 @@ align-items: center; height:32px; } +.order-info .kv.mt{ + margin-top:18rpx; +} .order-info .kv .key{ font-size: 30rpx; color: #888888; @@ -118,6 +130,10 @@ display:flex; align-items: center; } +.order-info .kv .value.bold{ + font-weight: 500; + font-size: 36rpx; +} .order-info .kv .copy{ font-size: 24rpx; border-radius: 8rpx; @@ -129,8 +145,8 @@ padding:10rpx; } .order-info .kv .tag{ - border: 1rpx solid #EB0000; - color: #EB0000; + border: 1rpx solid var(--main-color); + color: var(--main-color); font-size: 24rpx; border-radius: 8rpx; line-height: 40rpx; @@ -173,9 +189,9 @@ } .photos .imgs{ display: flex; - gap: 16rpx; + gap: 20rpx; } .photos .imgs .image{ - width:140rpx;height:140rpx; + width:150rpx;height:150rpx; border-radius: 10rpx; } \ No newline at end of file diff --git a/pages/order/index/index.js b/pages/order/index/index.js index dfa1de6..1d7ea08 100644 --- a/pages/order/index/index.js +++ b/pages/order/index/index.js @@ -1,5 +1,6 @@ import userApi from '../../../api/user'; import shopApi from '../../../api/shop'; +const app = getApp(); Page({ @@ -69,6 +70,7 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad(options) { + app.globalData.needRefreshOrderList = false; this.loadOrderList(); this.loadMerchantOrderList(); this.loadMerchantPayOrderList(); @@ -223,6 +225,10 @@ Page({ * 生命周期函数--监听页面显示 */ onShow() { + if(app.globalData.needRefreshOrderList){ + this.refreshList(); + app.globalData.needRefreshOrderList = false; + } }, /** diff --git a/pages/order/index/index.wxss b/pages/order/index/index.wxss index b46de85..38eccf5 100644 --- a/pages/order/index/index.wxss +++ b/pages/order/index/index.wxss @@ -2,9 +2,7 @@ background-color: #fff; } .order-list{ - position:absolute; - top:0;height:100vh; - width:100%; + height:100vh; } .order-list .item{ background-color: #fff; @@ -83,7 +81,7 @@ .list-empty{ text-align: center; - margin-top:380rpx; + padding-top:380rpx; } .list-empty .icon{ width:160rpx;height:160rpx; diff --git a/pages/order/success/index.js b/pages/order/success/index.js index cbd8e3f..c27ef38 100644 --- a/pages/order/success/index.js +++ b/pages/order/success/index.js @@ -1,4 +1,5 @@ -// pages/order/success/index.js +const app = getApp(); + Page({ /** @@ -16,7 +17,7 @@ Page({ this.setData({ name:options.name, price:options.price - }) + }); }, back(){ wx.navigateBack(); diff --git a/project.config.json b/project.config.json index 4e7d200..16d7a22 100644 --- a/project.config.json +++ b/project.config.json @@ -19,7 +19,27 @@ "outputPath": "" } }, - "condition": {}, + "condition": { + "miniprogram": { + "list": [ + { + "name": "开发环境", + "pathName": "pages/help/index/index", + "query": "env=dev" + }, + { + "name": "测试环境", + "pathName": "pages/help/index/index", + "query": "env=test" + }, + { + "name": "生产环境", + "pathName": "pages/help/index/index", + "query": "env=prod" + } + ] + } + }, "editorSetting": { "tabIndent": "auto", "tabSize": 2 diff --git a/project.private.config.json b/project.private.config.json index 5952680..cccaf2b 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -3,5 +3,33 @@ "projectname": "dm-wechat-mini", "setting": { "compileHotReLoad": true + }, + "condition": { + "miniprogram": { + "list": [ + { + "name": "pages/login/login", + "pathName": "pages/help/index/index", + "query": "shared_user_code=aaaa", + "launchMode": "default", + "scene": null + }, + { + "name": "开发环境", + "pathName": "pages/help/index/index", + "query": "env=dev" + }, + { + "name": "测试环境", + "pathName": "pages/help/index/index", + "query": "env=test" + }, + { + "name": "生产环境", + "pathName": "pages/help/index/index", + "query": "env=prod" + } + ] + } } } \ No newline at end of file diff --git a/utils/util.js b/utils/util.js index 764bc2c..fd606f3 100644 --- a/utils/util.js +++ b/utils/util.js @@ -13,7 +13,12 @@ const formatNumber = n => { n = n.toString() return n[1] ? n : `0${n}` } +const getStatusNavBarHeight = ()=>{ + const windowInfo = wx.getWindowInfo(); + return windowInfo.statusBarHeight+44; +} module.exports = { - formatTime + formatTime, + getStatusNavBarHeight }