日常修改像素

This commit is contained in:
2025-03-03 19:33:34 +08:00
parent 64e4387093
commit 858470cb47
16 changed files with 93 additions and 43 deletions

View File

@ -1,6 +1,5 @@
import request from './request' import request from './request'
let app = getApp(); let app = getApp();
const token = wx.getStorageSync('accessToken');
export default { export default {
getConfig:()=>request.get('/api/config'), getConfig:()=>request.get('/api/config'),
@ -42,7 +41,7 @@ export default {
filePath: file.tempFilePath, filePath: file.tempFilePath,
name: 'file', name: 'file',
header:{ header:{
Authorization: `Bearer ${token||app.globalData.accessToken}` Authorization: `Bearer ${app?.globalData?.accessToken}`
}, },
url: request.baseUrl+'/api/upload/image', url: request.baseUrl+'/api/upload/image',
success:(res)=>{ success:(res)=>{

View File

@ -7,7 +7,6 @@ if(envVersion=='develop'){
baseUrl = 'https://api.beefast.co' baseUrl = 'https://api.beefast.co'
} }
let app = getApp(); let app = getApp();
let token = wx.getStorageSync('accessToken');
const sendRequest = (options)=>{ const sendRequest = (options)=>{
@ -53,7 +52,7 @@ const sendRequest = (options)=>{
method:options.method, method:options.method,
data:options.data, data:options.data,
header:{ header:{
Authorization: `Bearer ${token||app?.globalData?.accessToken}` Authorization: `Bearer ${app?.globalData?.accessToken}`
}, },
fail:(res)=>{ fail:(res)=>{
wx.showToast({ wx.showToast({

9
app.js
View File

@ -3,6 +3,8 @@ import commonApi from './api/common';
let token = wx.getStorageSync('accessToken'); let token = wx.getStorageSync('accessToken');
App({ App({
async onLaunch(options){ async onLaunch(options){
// await this.aaa();
console.log(wx.router);
console.log('app onlaunch',new Date().getTime()); console.log('app onlaunch',new Date().getTime());
wx.getStorage({ wx.getStorage({
key:'accessToken', key:'accessToken',
@ -31,6 +33,13 @@ App({
} }
}) })
}, },
aaa(){
return new Promise((rs,rj)=>{
setTimeout(()=>{
rs();
},2000)
})
},
onShow(options){ onShow(options){
console.log('app onShow',new Date().getTime()); console.log('app onShow',new Date().getTime());
/** /**

View File

@ -1,8 +1,8 @@
{ {
"pages": [ "pages": [
"pages/help/index/index", "pages/help/index/index",
"pages/my/promation/activities/index",
"pages/login/login", "pages/login/login",
"pages/my/promation/activities/index",
"pages/help/success/index", "pages/help/success/index",
"pages/shop/index/index", "pages/shop/index/index",
"pages/order/index/index", "pages/order/index/index",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
assets/icon/navbar/home.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -28,15 +28,25 @@ Component({
*/ */
data: { data: {
statusBarHeight:0, statusBarHeight:0,
navBarHeight:44 navBarHeight:44,
canBack:true
}, },
lifetimes:{ lifetimes:{
attached(){ attached(){
const windowInfo = wx.getWindowInfo(); const windowInfo = wx.getWindowInfo();
this.setData({ this.setData({
statusBarHeight:windowInfo.statusBarHeight statusBarHeight:windowInfo.statusBarHeight
}) });
const pages = getCurrentPages();
if(pages.length>1){
this.setData({
canBack:true
})
}else{
this.setData({
canBack:false
})
}
} }
}, },
/** /**
@ -46,6 +56,11 @@ Component({
back(){ back(){
wx.navigateBack(); wx.navigateBack();
}, },
backHome(){
wx.reLaunch({
url: '/pages/help/index/index',
})
},
share(){ share(){
}, },
getHeight(){ getHeight(){

View File

@ -2,7 +2,10 @@
<view class="nav-bar-content" style="height:{{navBarHeight}}px;"> <view class="nav-bar-content" style="height:{{navBarHeight}}px;">
<view class="left"> <view class="left">
<view class="btns {{(back||backTitle)&&share?'border':''}}" wx:if="{{share||back||backTitle}}"> <view class="btns {{(back||backTitle)&&share?'border':''}}" wx:if="{{share||back||backTitle}}">
<image src="/assets/icon/navbar/back@2x.png" class="back" wx:if="{{back||backTitle}}" bind:tap="back"/> <block wx:if="{{back||backTitle}}">
<image src="/assets/icon/navbar/back@2x.png" class="back" bind:tap="back" wx:if="{{canBack}}"/>
<image wx:else src="/assets/icon/navbar/home.png" class="back home" bind:tap="backHome"/>
</block>
<view class="spliter" wx:if="{{share&&back}}"></view> <view class="spliter" wx:if="{{share&&back}}"></view>
<image src="/assets/icon/navbar/share@2x.png" class="share" wx:if="{{share}}" bind:tap="share"/> <image src="/assets/icon/navbar/share@2x.png" class="share" wx:if="{{share}}" bind:tap="share"/>
</view> </view>

View File

@ -31,6 +31,9 @@
width:40rpx;height:40rpx; width:40rpx;height:40rpx;
padding:12rpx 14rpx 12rpx 0; padding:12rpx 14rpx 12rpx 0;
} }
.nav-bar-content .back.home{
width:56rpx;height:56rpx;
}
.nav-bar-content .left .btns.border{ .nav-bar-content .left .btns.border{
border: 1.2px solid #D8D8D8; border: 1.2px solid #D8D8D8;
} }

View File

@ -39,7 +39,6 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
console.log('page onload',new Date().getTime());
let height = this.selectComponent("#navBar").getHeight(); let height = this.selectComponent("#navBar").getHeight();
this.setData({ this.setData({
navBarHeight:height navBarHeight:height
@ -65,14 +64,11 @@ Page({
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady() { onReady() {
console.log('page onReady',new Date().getTime());
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
console.log('page onShow',new Date().getTime());
wx.getStorage({ wx.getStorage({
key:'pre-order', key:'pre-order',
success:(res)=>{ success:(res)=>{
@ -324,5 +320,17 @@ Page({
}else{ }else{
app.navToLogin(); app.navToLogin();
} }
},
navToWXGroup(){
if(this.data.currentCommunity&&this.data.currentCommunity.id){
wx.navigateTo({
url: `/pages/my/promation/wx-group/index?communityId=${this.data.currentCommunity.id}`,
})
}else{
wx.showToast({
icon:'error',
title: '请先选择小区',
})
}
} }
}) })

View File

@ -77,16 +77,15 @@
<view class="title">新手指南</view> <view class="title">新手指南</view>
<view class="sub-title">使用流程</view> <view class="sub-title">使用流程</view>
</view> </view>
<navigator class="item" <view class="item" bind:tap="navToWXGroup">
url="/pages/my/promation/wx-group/index?communityId={{currentCommunity.id}}">
<image src="/assets/icon/help/join-group.png" class="icon"/> <image src="/assets/icon/help/join-group.png" class="icon"/>
<view class="title">加福利群</view> <view class="title">{{appConfig.join_group_title}}</view>
<view class="sub-title">领优惠券</view> <view class="sub-title">{{appConfig.join_group_desc}}</view>
</navigator> </view>
<button class="item right share" open-type="share"> <button class="item right share" open-type="share">
<image src="/assets/icon/help/share.png" class="icon"/> <image src="/assets/icon/help/share.png" class="icon"/>
<view class="title">{{appConfig.share_button_title}}</view> <view class="title">{{appConfig.share_button_title}}</view>
<view class="sub-title">赠送鸡蛋</view> <view class="sub-title">{{appConfig.share_button_mini_desc}}</view>
</button> </button>
</view> </view>
<!-- <navigator url="/pages/my/promation/wx-group/index?communityId={{currentCommunity.id}}" <!-- <navigator url="/pages/my/promation/wx-group/index?communityId={{currentCommunity.id}}"

View File

@ -120,7 +120,7 @@
} }
.action-bar .item{ .action-bar .item{
flex:1; flex:1;
padding:34rpx 40rpx 30rpx 40rpx; padding:30rpx 40rpx 30rpx 40rpx;
} }
.action-bar .share{ .action-bar .share{
background-color: #fff; background-color: #fff;
@ -130,8 +130,8 @@
.action-bar .title{ .action-bar .title{
font-size: 28rpx; font-size: 28rpx;
font-weight: 500; font-weight: 500;
margin-top:26rpx; margin-top:24rpx;
color: var(--main-font-color); color:#222222;
} }
.action-bar .sub-title{ .action-bar .sub-title{
font-size: 24rpx; font-size: 24rpx;

View File

@ -42,7 +42,15 @@ Page({
commonApi.activities.receive(this.data.activityId).then((data)=>{ commonApi.activities.receive(this.data.activityId).then((data)=>{
wx.showToast({ wx.showToast({
title: '领取成功', title: '领取成功',
}) });
const pages = getCurrentPages();
if(pages.length>1){
wx.navigateBack();
}else{
wx.reLaunch({
url: '/pages/help/index/index',
})
}
}).catch((e)=>{ }).catch((e)=>{
this.setData({ this.setData({
getting:false getting:false

View File

@ -1,4 +1,6 @@
{ {
"usingComponents": {}, "usingComponents": {
"nav-bar":"/components/navbar"
},
"navigationStyle": "custom" "navigationStyle": "custom"
} }

View File

@ -1,26 +1,29 @@
<nav-bar back/>
<view class="loadings"> <view class="loadings">
<view class="weui-loading" wx:if="{{detailLoading}}"></view> <view class="weui-loading" wx:if="{{detailLoading}}"></view>
</view> </view>
<view class="time">领取时间:{{detail.daily_start_time}}-{{detail.daily_end_time}}</view> <view class="promation-coupon">
<view class="coupon-list"> <view class="time">领取时间:{{detail.daily_start_time}}-{{detail.daily_end_time}}</view>
<view class="item" wx:for="{{detail.coupons}}" wx:key="index"> <view class="coupon-list">
<view class="name"> <view class="item" wx:for="{{detail.coupons}}" wx:key="index">
<view class="left">{{item.name}} <block wx:if="{{item.count>1}}">x {{item.count}}</block></view> <view class="name">
<view class="right money money-normal" wx:if="{{item.amount>0}}">{{item.amount}}</view> <view class="left">{{item.name}} <block wx:if="{{item.count>1}}">x {{item.count}}</block></view>
<view class="right money money-normal" wx:if="{{item.amount>0}}">{{item.amount}}</view>
</view>
<view class="tips">先领券,再下单,免费配送</view>
</view> </view>
<view class="tips">先领券,再下单,免费配送</view>
</view> </view>
</view> <button class="button diabled" disabled type="primary"
<button class="button diabled" disabled type="primary" wx:if="{{detail.is_end||!detail.is_active||!detail.can_receive}}">
wx:if="{{detail.is_end||!detail.is_active||!detail.can_receive}}"> {{
{{ detail.is_end?'活动已结束':
detail.is_end?'活动已结束': !detail.is_active?'活动已关闭':
!detail.is_active?'活动已关闭': !detail.can_receive?'无法领取':''
!detail.can_receive?'无法领取':'' }}
}} </button>
</button> <button disabled="{{getting}}"
<button disabled="{{getting}}"
loading="{{getting}}" type="primary" loading="{{getting}}" type="primary"
class="button" bind:tap="getActivity" wx:else>一键领取</button> class="button" bind:tap="getActivity" wx:else>一键领取</button>
</view>
<image src="/assets/imgs/login/main.png" class="bottom-img"/> <image src="/assets/imgs/login/main.png" class="bottom-img"/>

View File

@ -1,10 +1,12 @@
page{ page{
background-color: var(--main-color); background-color: var(--main-color);
padding:160rpx 30rpx 70rpx 30rpx; }
.promation-coupon{
padding:0 30rpx 70rpx 30rpx;
overflow: auto; overflow: auto;
} }
.loadings{ .loadings{
height:100rpx; height:80rpx;
text-align: center; text-align: center;
} }
.time{ .time{