Commit 4fe74fa2 by 程智春

底部栏样式

parent 4ac35289
const app = getApp(); const app = getApp();
console.log(app, "apppppppppp"); console.log(app, "apppppppppp");
...@@ -65,7 +66,34 @@ Component({ ...@@ -65,7 +66,34 @@ Component({
], ],
mm:false, mm:false,
componentData: {}, componentData: {},
show: true show: true,
mmm : false,
mainColor : ''
},
ready(){
if (app.themeColor['--main-color'] != '#ffffff') {
this.setData({
mainColor: app.themeColor['--main-color']
})
} else {
app.themeColorCallBack = (res) => {
this.setData({
mainColor: res['--main-color']
})
}
}
console.log(this.data.themeColor,'themeColor')
if (typeof this.getTabBar === "function" && this.getTabBar()) {
this.getTabBar().setData({
selected: 1
});
}
this.setData({
mmm: Math.ceil(app.globalData.footerVal.componentData.list.length / 2 - 1)
})
console.log(Math.ceil(app.globalData.footerVal.componentData.list.length / 2 - 1), this.data.selected)
console.log(this.data.mmm,'ready')
}, },
attached() { attached() {
let that = this; let that = this;
...@@ -78,6 +106,7 @@ Component({ ...@@ -78,6 +106,7 @@ Component({
list: app.globalData.footerVal.componentData.list, list: app.globalData.footerVal.componentData.list,
mm:mm mm:mm
}); });
console.log('777777',Math.ceil(this.data.list.length/2-1),this.data.selected,this.data.componentData['styleSelectionNum']) console.log('777777',Math.ceil(this.data.list.length/2-1),this.data.selected,this.data.componentData['styleSelectionNum'])
} else { } else {
console.log(73333381) console.log(73333381)
......
<!--miniprogram/custom-tab-bar/index.wxml--> <!--miniprogram/custom-tab-bar/index.wxml-->
<view class="tab-bar {{show?'':'hide'}}"> <view class="tab-bar {{show?'':'hide'}}" style="--main-color : {{mainColor}}">
<!-- <view class="antt ant-daipinglun"></view> --> <!-- <view class="antt ant-daipinglun"></view> -->
<!-- <view class="iconfont icon-fenzhi">3</view> --> <!-- <view class="iconfont icon-fenzhi">3</view> -->
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<view <view
wx:for="{{list}}" wx:for="{{list}}"
wx:key="index" wx:key="index"
class="tab-bar-item {{(Math.ceil(list.length/2-1)==selected&&componentData['styleSelectionNum']==1)?isItem:''}}" class="tab-bar-item {{(mmm==index&&componentData['styleSelectionNum']==1)?'isItem':''}}"
data-path="{{item.link}}" data-path="{{item.link}}"
data-index="{{index}}" data-index="{{index}}"
bindtap="switchTab" bindtap="switchTab"
......
...@@ -1411,6 +1411,16 @@ ...@@ -1411,6 +1411,16 @@
.isItem { .isItem {
transform: translateY(-30%) transform: translateY(-30%)
} }
.isItem .antt{
width:50px;
height: 50px;
background: var(--main-color);
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
border: 8rpx solid #fff;
}
.icons { .icons {
width: 50px; width: 50px;
height: 50px; height: 50px;
......
{ {
"description": "项目配置文件。", "description": "项目配置文件。",
"setting": { "setting": {
"urlCheck": false, "urlCheck": false,
"es6": true, "es6": true,
"enhance": true, "enhance": true,
"postcss": true, "postcss": true,
"minified": true, "minified": true,
"newFeature": true, "newFeature": true,
"coverView": true, "coverView": true,
"nodeModules": true, "nodeModules": true,
"autoAudits": true, "autoAudits": true,
"showShadowRootInWxmlPanel": false, "showShadowRootInWxmlPanel": false,
"scopeDataCheck": false, "scopeDataCheck": false,
"uglifyFileName": true, "uglifyFileName": true,
"checkInvalidKey": true, "checkInvalidKey": true,
"checkSiteMap": true, "checkSiteMap": true,
"uploadWithSourceMap": true, "uploadWithSourceMap": true,
"useMultiFrameRuntime": true, "useMultiFrameRuntime": true,
"useApiHook": true, "useApiHook": true,
"useApiHostProcess": true, "useApiHostProcess": true,
"babelSetting": { "babelSetting": {
"ignore": [], "ignore": [],
"disablePlugins": [], "disablePlugins": [],
"outputPath": "" "outputPath": ""
}, },
"bundle": false, "bundle": false,
"useIsolateContext": true, "useIsolateContext": true,
"useCompilerModule": true, "useCompilerModule": true,
"userConfirmedUseCompilerModuleSwitch": false, "userConfirmedUseCompilerModuleSwitch": false,
"userConfirmedBundleSwitch": false, "userConfirmedBundleSwitch": false,
"packNpmManually": false, "packNpmManually": false,
"packNpmRelationList": [], "packNpmRelationList": [],
"minifyWXSS": true "minifyWXSS": true
}, },
"miniprogramRoot": "dist/wx/", "miniprogramRoot": "dist/wx/",
"compileType": "miniprogram", "compileType": "miniprogram",
"appid": "wx8a509d2f2ac15903", "appid": "wx8a509d2f2ac15903",
"projectname": "mayi-mp-shop", "projectname": "mayi-mp-shop",
"simulatorType": "wechat", "simulatorType": "wechat",
"simulatorPluginLibVersion": {}, "simulatorPluginLibVersion": {},
"libVersion": "2.15.0", "libVersion": "2.15.0",
"condition": { "condition": {
"search": { "search": {
"list": [] "list": []
}, },
"conversation": { "conversation": {
"list": [] "list": []
}, },
"plugin": { "plugin": {
"list": [] "list": []
}, },
"game": { "game": {
"currentL": -1, "currentL": -1,
"list": [] "list": []
}, },
"gamePlugin": { "gamePlugin": {
"list": [] "list": []
}, },
"miniprogram": { "miniprogram": {
"list": [ "list": [
{ {
"id": 0, "id": 0,
"name": "pages/index/main", "name": "pages/index/main",
"pathName": "pages/index/main", "pathName": "pages/index/main",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"id": -1, "id": -1,
"name": "pages/login/main", "name": "pages/login/main",
"pathName": "pages/login/main", "pathName": "pages/login/main",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"id": 2, "id": 2,
"name": "pages/index/main", "name": "pages/index/main",
"pathName": "pages/index/main", "pathName": "pages/index/main",
"query": "scene=pid_6141", "query": "scene=pid_6141",
"scene": 1047 "scene": 1047
} }
] ]
} }
} }
} }
\ No newline at end of file
...@@ -168,6 +168,7 @@ export default { ...@@ -168,6 +168,7 @@ export default {
themeColor["--main-color"] = val.themeColor.mainColor; themeColor["--main-color"] = val.themeColor.mainColor;
themeColor["--minor-color"] = val.themeColor.minorColor; themeColor["--minor-color"] = val.themeColor.minorColor;
mpApp.themeColorCallBack(themeColor); mpApp.themeColorCallBack(themeColor);
mpApp.themeColor = themeColor
// //
console.log(this.mpApp, "mmmmm74", themeColor); console.log(this.mpApp, "mmmmm74", themeColor);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment