日常修改像素

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

View File

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

9
app.js
View File

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

View File

@ -1,8 +1,8 @@
{
"pages": [
"pages/help/index/index",
"pages/my/promation/activities/index",
"pages/login/login",
"pages/my/promation/activities/index",
"pages/help/success/index",
"pages/shop/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: {
statusBarHeight:0,
navBarHeight:44
navBarHeight:44,
canBack:true
},
lifetimes:{
attached(){
const windowInfo = wx.getWindowInfo();
this.setData({
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(){
wx.navigateBack();
},
backHome(){
wx.reLaunch({
url: '/pages/help/index/index',
})
},
share(){
},
getHeight(){

View File

@ -2,7 +2,10 @@
<view class="nav-bar-content" style="height:{{navBarHeight}}px;">
<view class="left">
<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>
<image src="/assets/icon/navbar/share@2x.png" class="share" wx:if="{{share}}" bind:tap="share"/>
</view>

View File

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

View File

@ -39,7 +39,6 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log('page onload',new Date().getTime());
let height = this.selectComponent("#navBar").getHeight();
this.setData({
navBarHeight:height
@ -65,14 +64,11 @@ Page({
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
console.log('page onReady',new Date().getTime());
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
console.log('page onShow',new Date().getTime());
wx.getStorage({
key:'pre-order',
success:(res)=>{
@ -324,5 +320,17 @@ Page({
}else{
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="sub-title">使用流程</view>
</view>
<navigator class="item"
url="/pages/my/promation/wx-group/index?communityId={{currentCommunity.id}}">
<view class="item" bind:tap="navToWXGroup">
<image src="/assets/icon/help/join-group.png" class="icon"/>
<view class="title">加福利群</view>
<view class="sub-title">领优惠券</view>
</navigator>
<view class="title">{{appConfig.join_group_title}}</view>
<view class="sub-title">{{appConfig.join_group_desc}}</view>
</view>
<button class="item right share" open-type="share">
<image src="/assets/icon/help/share.png" class="icon"/>
<view class="title">{{appConfig.share_button_title}}</view>
<view class="sub-title">赠送鸡蛋</view>
<view class="sub-title">{{appConfig.share_button_mini_desc}}</view>
</button>
</view>
<!-- <navigator url="/pages/my/promation/wx-group/index?communityId={{currentCommunity.id}}"

View File

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

View File

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

View File

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

View File

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

View File

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