Skip to content

Commit

Permalink
update multiproj
Browse files Browse the repository at this point in the history
  • Loading branch information
3xxx committed Jun 28, 2020
1 parent b2d866f commit fb7a71f
Show file tree
Hide file tree
Showing 613 changed files with 18,095 additions and 4,420 deletions.
6 changes: 6 additions & 0 deletions about.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
如何使用相对路径和绝对路径
“../”代表当前文件所在目录的上一级目录。
“../../”代表当前文件所在目录的上上级目录。
“../../../”可以依次类推。
“/”代表根目录,也就是绝对路径。
“./”表示当前目录,HTML中,可以省略
94 changes: 90 additions & 4 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ App({
activity_location: null,
activity_lat: -1,
activity_lng: -1,
projectConfig:null,//全局项目配置
//pppid:null,
},
data: {
// haveLocation: false,
Expand All @@ -34,7 +36,8 @@ App({
// var logs = wx.getStorageSync('logs') || []
// logs.unshift(Date.now())
// wx.setStorageSync('logs', logs)
//开发者在session_key失效时,可以通过重新执行登录流程获取有效的session_key。使用接口wx.checkSession()可以校验session_key是否有效,从而避免小程序反复执行登录流程。
//开发者在session_key失效时,可以通过重新执行登录流程获取有效的session_key。
// 使用接口wx.checkSession()可以校验session_key是否有效,从而避免小程序反复执行登录流程。
let loginFlag = wx.getStorageSync('sessionId');
// console.log(loginFlag)
// wx.getStorage({
Expand Down Expand Up @@ -90,8 +93,9 @@ App({
that.globalData.hasRegist = wx.getStorageSync('hasRegist')
that.globalData.isAdmin = wx.getStorageSync('isAdmin')
that.globalData.photo = wx.getStorageSync('photo')
that.globalData.appreciationphoto = wx.getStorageSync('appreciationphoto')
// console.log(that.globalData.user_id)
that.globalData.appreciationphoto = wx.getStorageSync('appreciationphoto')//用户赞赏码
that.globalData.projectConfig = wx.getStorageSync('projectConfig')
//console.log(that.globalData.projectConfig)
// console.log(that.globalData.hasRegist)
// console.log(that.globalData.isAdmin)
} else {//ecms中session失效了
Expand Down Expand Up @@ -197,6 +201,88 @@ App({
}
})

//获取项目配置文件
//如果本机没有存储,则弹出跳转项目选择框
var value = wx.getStorageSync('projectConfig')
if (value) {
// Do something with return value
that.globalData.projectConfig =value
}else{
console.log('读取key发生错误')
wx.showModal({
title: '提示',
content: '未选定项目,是否前去选择?',
success (res) {
if (res.confirm) {
console.log('用户点击确定')
wx.navigateTo({
url: '/pages/projectlist/projectlist',
events: {
// 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
acceptDataFromOpenedPage: function(data) {
console.log(data)
},
someEvent: function(data) {
console.log(data)
}
},
success: function(res) {
// 通过eventChannel向被打开页面传送数据
res.eventChannel.emit('acceptDataFromOpenerPage', { data: 'test' })
}
})
} else if (res.cancel) {
console.log('用户点击取消')
wx.showToast({
title: '未选择项目!',
icon: 'none',
duration: 2000
});
}
}
})
}

// wx.getStorage({
// key: 'projectconfig',
// success(res) {
// console.log(res.data)
// that.globalData.pppid = "789789"
// that.globalData.projectConfig = wx.getStorageSync('projectConfig')
// console.log(that.globalData.pppid)
// },
// fail: function() {
// console.log('读取key发生错误')
// wx.showModal({
// title: '提示',
// content: '未选定项目,是否前去选择?',
// success (res) {
// if (res.confirm) {
// console.log('用户点击确定')
// wx.navigateTo({
// url: '/pages/projectlist/projectlist',
// events: {
// // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
// acceptDataFromOpenedPage: function(data) {
// console.log(data)
// },
// someEvent: function(data) {
// console.log(data)
// }
// },
// success: function(res) {
// // 通过eventChannel向被打开页面传送数据
// res.eventChannel.emit('acceptDataFromOpenerPage', { data: 'test' })
// }
// })
// } else if (res.cancel) {
// console.log('用户点击取消')
// }
// }
// })
// }
// })

// 获取位置_没必要在这里获取位置,需要的地方再获取
// wx.getLocation({
// type: 'wgs84',
Expand All @@ -217,7 +303,7 @@ App({
if (res.code) {
//发起网络请求
wx.request({
url: config.url + '/wx/wxlogin/4',//珠三角设代plus 1
url: config.url + '/wx/wxlogin/1',//珠三角设代plus 1
data: {
code: res.code
},
Expand Down
10 changes: 8 additions & 2 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@
"pages/diaryeditor/diaryeditor",
"pages/searchdraw/searchdraw",
"pages/calendar/calendar",
"pages/logs/logs"
"pages/logs/logs",
"pages/financelist/financelist",
"pages/addfinance/addfinance",
"pages/financedetail/financedetail",
"pages/financeeditor/financeeditor"
]
},
{
Expand All @@ -87,7 +91,9 @@
"pages/mypay/mypay",
"pages/myappreciation/myappreciation",
"pages/mycollect/mycollect",
"pages/adduser/adduser"
"pages/adduser/adduser",
"pages/myproject/myproject",
"pages/mybrand/mybrand"
]
}
],
Expand Down
24 changes: 20 additions & 4 deletions component/vant/miniprogram_npm/vant-weapp/action-sheet/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { VantComponent } from '../common/component';
import { safeArea } from '../mixins/safe-area';
VantComponent({
mixins: [safeArea()],
props: {
show: Boolean,
title: String,
cancelText: String,
customStyle: String,
overlayStyle: String,
description: String,
round: {
type: Boolean,
value: true
},
zIndex: {
type: Number,
value: 100
Expand All @@ -23,6 +24,14 @@ VantComponent({
closeOnClickOverlay: {
type: Boolean,
value: true
},
closeOnClickAction: {
type: Boolean,
value: true
},
safeAreaInsetBottom: {
type: Boolean,
value: true
}
},
methods: {
Expand All @@ -31,13 +40,20 @@ VantComponent({
const item = this.data.actions[index];
if (item && !item.disabled && !item.loading) {
this.$emit('select', item);
if (this.data.closeOnClickAction) {
this.onClose();
}
}
},
onCancel() {
this.$emit('cancel');
},
onClose() {
this.$emit('close');
},
onClickOverlay() {
this.$emit('click-overlay');
this.onClose();
}
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
<van-popup
show="{{ show }}"
position="bottom"
round="{{ round }}"
z-index="{{ zIndex }}"
overlay="{{ overlay }}"
custom-style="{{ customStyle }}"
overlay-style="{{ overlayStyle }}"
custom-class="van-action-sheet"
safe-area-inset-bottom="{{ safeAreaInsetBottom }}"
close-on-click-overlay="{{ closeOnClickOverlay }}"
bind:close="onClose"
bind:close="onClickOverlay"
>
<view wx:if="{{ title }}" class="van-hairline--bottom van-action-sheet__header">
{{ title }}
Expand All @@ -20,12 +19,16 @@
bind:click="onClose"
/>
</view>
<view wx:if="{{ description }}" class="van-action-sheet__description">
{{ description }}
</view>
<view wx:if="{{ actions && actions.length }}">
<!-- button外包一层view,防止actions动态变化,导致渲染时button被打散 -->
<button
wx:for="{{ actions }}"
wx:key="index"
open-type="{{ item.openType }}"
style="{{ item.color ? 'color: ' + item.color : '' }}"
class="{{ utils.bem('action-sheet__item', { disabled: item.disabled || item.loading }) }} van-hairline--top {{ item.className || '' }}"
hover-class="van-action-sheet__item--hover"
data-index="{{ index }}"
Expand All @@ -35,7 +38,7 @@
{{ item.name }}
<text wx:if="{{ item.subname }}" class="van-action-sheet__subname" >{{ item.subname }}</text>
</block>
<van-loading wx:else size="20px" />
<van-loading wx:else custom-class="van-action-sheet__loading" size="20px" />
</button>
</view>
<slot />
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@import '../common/index.wxss';.van-action-sheet{max-height:90%!important;color:#333}.van-action-sheet__cancel,.van-action-sheet__item{height:50px;font-size:16px;line-height:50px;text-align:center;background-color:#fff}.van-action-sheet__cancel--hover,.van-action-sheet__item--hover{background-color:#f2f3f5}.van-action-sheet__cancel{height:60px}.van-action-sheet__cancel:before{display:block;height:10px;background-color:#f8f8f8;content:" "}.van-action-sheet__item--disabled{color:#c9c9c9}.van-action-sheet__item--disabled.van-action-sheet__item--hover{background-color:#fff}.van-action-sheet__subname{margin-left:5px;font-size:12px;color:#7d7e80}.van-action-sheet__header{font-size:16px;font-weight:500;line-height:44px;text-align:center}.van-action-sheet__close{position:absolute!important;top:0;right:0;padding:0 15px;font-size:18px!important;line-height:inherit!important;color:#999}
@import '../common/index.wxss';.van-action-sheet{max-height:90%!important;max-height:var(--action-sheet-max-height,90%)!important;color:#323233;color:var(--action-sheet-item-text-color,#323233)}.van-action-sheet__cancel,.van-action-sheet__item{text-align:center;font-size:16px;font-size:var(--action-sheet-item-font-size,16px);line-height:50px;line-height:var(--action-sheet-item-height,50px);background-color:#fff;background-color:var(--action-sheet-item-background,#fff)}.van-action-sheet__cancel--hover,.van-action-sheet__item--hover{background-color:#f2f3f5;background-color:var(--active-color,#f2f3f5)}.van-action-sheet__cancel:before{display:block;content:" ";height:8px;height:var(--action-sheet-cancel-padding-top,8px);background-color:#f7f8fa;background-color:var(--action-sheet-cancel-padding-color,#f7f8fa)}.van-action-sheet__item--disabled{color:#c8c9cc;color:var(--action-sheet-item-disabled-text-color,#c8c9cc)}.van-action-sheet__item--disabled.van-action-sheet__item--hover{background-color:#fff;background-color:var(--action-sheet-item-background,#fff)}.van-action-sheet__subname{margin-left:4px;margin-left:var(--padding-base,4px);font-size:12px;font-size:var(--action-sheet-subname-font-size,12px);color:#646566;color:var(--action-sheet-subname-color,#646566)}.van-action-sheet__header{text-align:center;font-weight:500;font-weight:var(--font-weight-bold,500);font-size:16px;font-size:var(--action-sheet-header-font-size,16px);line-height:44px;line-height:var(--action-sheet-header-height,44px)}.van-action-sheet__description{text-align:center;padding:16px;padding:var(--padding-md,16px);color:#646566;color:var(--action-sheet-description-color,#646566);font-size:14px;font-size:var(--action-sheet-description-font-size,14px);line-height:20px;line-height:var(--action-sheet-description-line-height,20px)}.van-action-sheet__close{position:absolute!important;top:0;right:0;line-height:inherit!important;padding:0 12px;padding:var(--action-sheet-close-icon-padding,0 12px);font-size:18px!important;font-size:var(--action-sheet-close-icon-size,18px)!important;color:#969799;color:var(--action-sheet-close-icon-color,#969799)}.van-action-sheet__loading{display:-webkit-flex!important;display:flex!important;height:50px;height:var(--action-sheet-item-height,50px)}
32 changes: 31 additions & 1 deletion component/vant/miniprogram_npm/vant-weapp/button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import { openType } from '../mixins/open-type';
VantComponent({
mixins: [button, openType],
classes: ['hover-class', 'loading-class'],
data: {
style: ''
},
props: {
icon: String,
color: String,
plain: Boolean,
block: Boolean,
round: Boolean,
Expand All @@ -15,6 +17,11 @@ VantComponent({
hairline: Boolean,
disabled: Boolean,
loadingText: String,
customStyle: String,
loadingType: {
type: String,
value: 'circular'
},
type: {
type: String,
value: 'default'
Expand All @@ -26,6 +33,29 @@ VantComponent({
loadingSize: {
type: String,
value: '20px'
},
color: {
type: String,
observer(color) {
let style = '';
if (color) {
style += `color: ${this.data.plain ? color : 'white'};`;
if (!this.data.plain) {
// Use background instead of backgroundColor to make linear-gradient work
style += `background: ${color};`;
}
// hide border when color is linear-gradient
if (color.indexOf('gradient') !== -1) {
style += 'border: 0;';
}
else {
style += `border-color: ${color};`;
}
}
if (style !== this.data.style) {
this.setData({ style });
}
}
}
},
methods: {
Expand Down
7 changes: 4 additions & 3 deletions component/vant/miniprogram_npm/vant-weapp/button/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<button
id="{{ id }}"
class="custom-class {{ utils.bem('button', [type, size, { block, round, plain, square, loading, disabled, hairline, unclickable: disabled || loading }]) }} {{ hairline ? 'van-hairline--surround' : '' }}"
open-type="{{ openType }}"
hover-class="van-button--active hover-class"
style="{{ color ? 'border-color: ' + color + ';' + (plain ? 'color: ' + color : 'color: #fff; background-color: ' + color) : '' }}"
lang="{{ lang }}"
style="{{ style }} {{ customStyle }}"
open-type="{{ openType }}"
business-id="{{ businessId }}"
session-from="{{ sessionFrom }}"
send-message-title="{{ sendMessageTitle }}"
Expand All @@ -27,7 +27,8 @@
<van-loading
custom-class="loading-class"
size="{{ loadingSize }}"
color="{{ type === 'default' ? '#c9c9c9' : '' }}"
type="{{ loadingType }}"
color="{{ type === 'default' ? '#c9c9c9' : 'white' }}"
/>
<view
wx:if="{{ loadingText }}"
Expand Down
Loading

0 comments on commit fb7a71f

Please sign in to comment.