[fix]全局主题配置

main
huyuanxiang 2 years ago
parent 8eb059753f
commit 4bed9058d6

@ -6,6 +6,9 @@ import {setTabBarBadge } from'./utils/util.js'
uni.$ajax = request; // uni.$ajax = request; //
export default { export default {
onShow() {
},
onLaunch: function () { onLaunch: function () {
//#ifdef H5 //#ifdef H5
@ -138,10 +141,22 @@ $black: #333333;
} }
} }
&.order { &.order {
.goods_btns .btns {
&.btn-item1 {
border-color: $color;
color: $color;
}
}
.bottom_btn .btns, .bottom_btn .btns,
.morelist .title .quan { .morelist .title .quan {
background: $color; background: $color;
&.shouhou {
color: #fff;
background-color: $color;
}
} }
.iconfont,
.weizhi_icon .icon-dizhi, .weizhi_icon .icon-dizhi,
.goods_title .price .t1, .goods_title .price .t1,
.morelist .right_title, .morelist .right_title,
@ -158,6 +173,63 @@ $black: #333333;
background: $color; background: $color;
} }
} }
&.cart {
.bottom_all .left .delAll {
border-color: $color;
}
.text-green, .line-green, .lines-green,
.bottom_all .left .delAll,
.empty,
.nocart .iconfont {
color: $color;
}
.bottom_all .rights .jiesuan {
background: $color;
}
}
&.jieguo {
background-color: $color;
.wancheng {
color: $color;
border-color: $color;
}
.icon-chenggong {
color: $color;
}
}
&.userbox {
.iconfont {
color: $color;
}
}
&.order_list {
.iconfont,
.order_type,
.tabs_list.active-item {
color: $color;
font-weight: bold;
.active {
background-color: $color;
}
}
.list_box .bottom .btns .pay{
color: $color;
border-color: $color;
&.shouhou {
color: #fff;
background-color: $color;
}
}
}
&.evaluate {
.goods_price .price-text {
color: $color;
}
}
} }

@ -1,9 +1,9 @@
{ {
"name" : "商城模板", "name" : "商城模板",
"appid" : "__UNI__8A51802", "appid" : "__UNI__1EEA1F7",
"description" : "", "description" : "",
"versionName" : "1.0.0", "versionName" : "1.0.0",
"versionCode" : "100", "versionCode" : 1,
"transformPx" : false, "transformPx" : false,
"app-plus" : { "app-plus" : {
"usingComponents" : true, "usingComponents" : true,
@ -74,19 +74,17 @@
"h5" : { "h5" : {
"devServer" : { "devServer" : {
"disableHostCheck" : true, "disableHostCheck" : true,
"proxy" : "https://mall.meituan.com" "proxy" : "https://mall.meituan.com",
"port" : 8081,
"https" : false
}, },
"router" : { "router" : {
"mode" : "history", "mode" : "history",
"base" : "./" "base" : ""
}, },
"sdkConfigs" : { "sdkConfigs" : {
"maps" : { "maps" : {}
"qqmap" : {
"key" : "BIUBZ-UWKW3-FK53E-YIPVT-R4KG5-3DBA3"
}
}
}, },
"title" : "jiahui-yang商城模板" "title" : "能辉在线订货商城"
} }
} }

@ -1,6 +1,6 @@
<template> <template>
<view class="nodata"> <view class="nodata">
<text class="iconfont icon-zanwushuju" :style="'color:' + colors"></text> <text class="iconfont icon-zanwushuju"></text>
<view class="texts"> <view class="texts">
{{title}} {{title}}
</view> </view>

@ -1,9 +1,13 @@
<template> <template>
<view class="tabs"> <view class="tabs">
<view v-for="(item, index) in tabList" :key="index" class="tabs_list" @tap="setTabs(item,index)" <view v-for="(item, index) in tabList"
:style="'color:' + (active == index ?colors :'') + ';font-weight:' + (active == index ?'bold' : '500')"> :key="index"
class="tabs_list"
:class="[active == index ? 'active-item' :' ']"
@tap="setTabs(item,index)"
>
{{item.name}} {{item.name}}
<view class="active" :style="'background:' + colors" v-if="active == index"></view> <view class="active" v-show="active == index"></view>
</view> </view>
</view> </view>
</template> </template>

@ -1,6 +1,6 @@
<template> <template>
<view class="top_nav" @tap="jumpNext"> <view class="top_nav" @tap="jumpNext">
<text :class="'iconfont ' + icons + ' icon'" :style="'color:' + colors"></text> <text :class="'iconfont ' + icons + ' icon'" ></text>
<text class="name"><slot></slot></text> <text class="name"><slot></slot></text>
<image src="/static/images/home/right.png" class="right_icon" v-if="rightshow == true"></image> <image src="/static/images/home/right.png" class="right_icon" v-if="rightshow == true"></image>
</view> </view>
@ -31,7 +31,6 @@ export default {
}, },
methods: { methods: {
jumpNext() { jumpNext() {
console.log(this.linkUrl);
if (this.linkUrl && this.linkUrl !== '') { if (this.linkUrl && this.linkUrl !== '') {
uni.navigateTo({ uni.navigateTo({
url: this.linkUrl url: this.linkUrl

@ -4,7 +4,7 @@
<view class="footprint_box"> <view class="footprint_box">
<view class="nodata" v-if="logList.length == 0"> <view class="nodata" v-if="logList.length == 0">
<view> <view>
<text class="iconfont icon-zanwu1" :style="'color:' + colors"></text> <text class="iconfont icon-zanwu1" ></text>
</view> </view>
<view class="tips">先去浏览一些吧</view> <view class="tips">先去浏览一些吧</view>
</view> </view>

@ -4,7 +4,7 @@
<view class="order_btnbox"> <view class="order_btnbox">
<view v-for="(item, index) in orderText" :key="index" class="order_btns" @tap="jumpOrder(item,index)"> <view v-for="(item, index) in orderText" :key="index" class="order_btns" @tap="jumpOrder(item,index)">
<view> <view>
<text :class="'iconfont ' + item.icon" :style="'color:' + colors"></text> <text :class="'iconfont ' + item.icon" ></text>
</view> </view>
<view style="color:#666">{{item.name}}</view> <view style="color:#666">{{item.name}}</view>
<view class="pos2" v-if="item._num > 0"> {{item._num}}</view> <view class="pos2" v-if="item._num > 0"> {{item._num}}</view>

@ -1,10 +1,10 @@
<template> <template>
<view class="my_server"> <view class="my_server">
<list-cell :icons="'iconfont ' + icons" :colors="colors" :rightshow="false">{{titles}}</list-cell> <list-cell :icons="'iconfont ' + icons" :rightshow="false">{{titles}}</list-cell>
<view class="server_box"> <view class="server_box">
<view v-for="(item, index) in serverList" :key="index" class="server_list" @tap="jumpLink(item)"> <view v-for="(item, index) in serverList" :key="index" class="server_list" @tap="jumpLink(item)">
<view> <view>
<text :class="'iconfont ' + item.icon" :style="'color:' + colors"></text> <text :class="'iconfont ' + item.icon"></text>
</view> </view>
<view class="server_text"> <view class="server_text">
{{item.name}} {{item.name}}

@ -25,7 +25,6 @@
</view> </view>
<view class="goods_price" v-else> <view class="goods_price" v-else>
<text class="money text-lg">客服询价</text> <text class="money text-lg">客服询价</text>
</view> </view>
<!-- <view class="shoucang"> <!-- <view class="shoucang">
<view class="sc_icons" @tap="setisColl"> <view class="sc_icons" @tap="setisColl">

@ -1,6 +1,6 @@
<template> <template>
<view> <view>
<view class="evaluate"> <view class="evaluate" :class="['theme', themeObj.name]">
<view class="goods_data"> <view class="goods_data">
<image :src="goodData.url" mode=""></image> <image :src="goodData.url" mode=""></image>
<view class="right"> <view class="right">
@ -8,7 +8,7 @@
<p class="goods_sku">{{goodData.specs}}</p> <p class="goods_sku">{{goodData.specs}}</p>
<p class="goods_price"> <p class="goods_price">
<text :style="{color:colors}">{{goodData.price}}</text> <text class="price-text" >{{goodData.price}}</text>
<text style="font-size: 28upx;">x{{goodData.goodsNo}} /{{ goodData.unit }}</text> <text style="font-size: 28upx;">x{{goodData.goodsNo}} /{{ goodData.unit }}</text>
</p> </p>
</view> </view>
@ -71,6 +71,7 @@ export default {
return { return {
content:'', content:'',
colors:'', colors:'',
themeObj: app.globalData.themeObj,
goodData:{}, goodData:{},
imgUrl:[],// imgUrl:[],//
starNoImg:'/static/images/home/star-no.png', starNoImg:'/static/images/home/star-no.png',

@ -1,12 +1,12 @@
<template> <template>
<view> <view>
<view class="order"> <view class="order" :class="['theme', themeObj.name]">
<!-- 收货地址 --> <!-- 收货地址 -->
<view class="order_address"> <view class="order_address">
<image src="/static/images/home/bottom.png"></image> <image src="/static/images/home/bottom.png"></image>
<view class="address_box"> <view class="address_box">
<view class="weizhi_icon"> <view class="weizhi_icon">
<text class="iconfont icon-dizhi" :style="'color:' + colors"></text> <text class="iconfont icon-dizhi" ></text>
</view> </view>
<block> <block>
<view class="center"> <view class="center">
@ -31,7 +31,7 @@
规格: {{item.specs}} 规格: {{item.specs}}
</view> </view>
<view class="price"> <view class="price">
<view class="t1" :style="'color:' + colors">{{item.price}}</view> <view class="t1">{{item.price}}</view>
<view class="t3"> <view class="t3">
x{{item.goodsNo}}{{item.unit}} x{{item.goodsNo}}{{item.unit}}
</view> </view>
@ -52,9 +52,9 @@
<view class="btns" style="margin-right: 40upx;" @click="onafterSale(item)"> <view class="btns" style="margin-right: 40upx;" @click="onafterSale(item)">
申请售后 申请售后
</view> </view>
<view class="btns" <view class="btns btn-item1"
@click="onevaluate(item)" :style="{borderColor:colors,color:colors}"> @click="onevaluate(item)">
{{ item.commitId ? '查看评价' : '去评价'}} {{ item.commitId ? '查看评价' : '去评价'}}
</view> </view>
</view> </view>
@ -76,7 +76,7 @@
</view> </view>
<view class="morelist"> <view class="morelist">
<view class="title"> <view class="title">
<text class="quan" :style="'background:' + colors"></text> <text class="quan" ></text>
<text>运费</text> <text>运费</text>
</view> </view>
<view class="right_title"> <view class="right_title">
@ -85,7 +85,7 @@
</view> </view>
<view class="morelist"> <view class="morelist">
<text class="title">实付款</text> <text class="title">实付款</text>
<view class="right_title" :style="'color:' + colors + ';'"> <view class="right_title" >
{{goods.totalAmount}} {{goods.totalAmount}}
</view> </view>
</view> </view>
@ -135,7 +135,7 @@
<view class="bottom_btn" > <view class="bottom_btn" >
<block v-if="goods.state == 0"> <block v-if="goods.state == 0">
<view class="moneys"> <view class="moneys">
合计: <text :style="'color:' + colors + ';'">{{goods.totalAmount}}</text> 合计: <text >{{goods.totalAmount}}</text>
</view> </view>
<view class="btns" <view class="btns"
:style="'color:' + colors + ';border:1upx solid ' + colors + ';margin-right:20upx'" :style="'color:' + colors + ';border:1upx solid ' + colors + ';margin-right:20upx'"
@ -184,7 +184,8 @@ import loading from "../../commponent/public/loading";
export default { export default {
data() { data() {
return { return {
colors: '', colors: app.globalData.newColor,
themeObj: app.globalData.themeObj,
status: 0, status: 0,
// //
isShow: true, isShow: true,
@ -232,14 +233,8 @@ export default {
onLoad: function (options) { onLoad: function (options) {
let status = 0; let status = 0;
if (options.status) { if (options.status) {
status = options.status; this.status = options.status;
} }
this.setData({
colors: app.globalData.newColor,
status: status
});
setTimeout(() => { setTimeout(() => {
this.setData({ this.setData({
isShow: false isShow: false
@ -885,7 +880,6 @@ page {
} }
.shouhou { .shouhou {
border: 1upx solid #ddd; border: 1upx solid #ddd;
color: #999!important; color: #999;
font-weight: normal!important;
} }
</style> </style>

@ -1,13 +1,13 @@
<template> <template>
<view> <view>
<view class="order_list"> <view class="order_list" :class="['theme', themeObj.name]">
<view class="top_nav"> <view class="top_nav">
<view style="background-color: #FFFFFF;"> <view style="background-color: #FFFFFF;">
<navBar :showLeft="true" navTitle="订单列表" textcolor="#000" :leftBg="false"></navBar> <navBar :showLeft="true" navTitle="订单列表" textcolor="#000" :leftBg="false"></navBar>
</view> </view>
<!-- 顶部tab --> <!-- 顶部tab -->
<view class="nav_top" style="border-bottom: 1upx solid #F8F8F8;"> <view class="nav_top" style="border-bottom: 1upx solid #F8F8F8;">
<tabs :colors="colors" :tabList="tabList" :active="active" @setTabs="setTabs"></tabs> <tabs :tabList="tabList" :active="active" @setTabs="setTabs"></tabs>
</view> </view>
</view> </view>
<!-- 占位 --> <!-- 占位 -->
@ -16,7 +16,7 @@
<view v-for="(item, index) in orderList" :key="index" class="lists"> <view v-for="(item, index) in orderList" :key="index" class="lists">
<view class="type"> <view class="type">
<text class="order_id">订单编号:{{item.id}}</text> <text class="order_id">订单编号:{{item.id}}</text>
<text class="order_type" :style="'color:' + colors"> <text class="order_type">
{{ item.state | setStatus }} {{ item.state | setStatus }}
</text> </text>
</view> </view>
@ -40,7 +40,7 @@
<view class="btns"> <view class="btns">
<block v-if="item.state == 0"> <block v-if="item.state == 0">
<!-- <view class="pay" :style="'color:#fff;background:' + colors+ ';border-color:' + colors" @tap="jumpDetails(item)"></view> --> <!-- <view class="pay" :style="'color:#fff;background:' + colors+ ';border-color:' + colors" @tap="jumpDetails(item)"></view> -->
<view class="pay shouhou" :style="'color:' + colors + ';border-color:' + colors" @tap="cencalOrder(item)"></view> <view class="pay shouhou" @tap="cencalOrder(item)"></view>
</block> </block>
<block v-if="item.state == 1"> <block v-if="item.state == 1">
<!-- <view class="pay shouhou" @tap="onRefund(item)"></view> --> <!-- <view class="pay shouhou" @tap="onRefund(item)"></view> -->
@ -50,7 +50,7 @@
<!-- <view class="pay shouhou" @tap="onRefund(item)">退</view> --> <!-- <view class="pay shouhou" @tap="onRefund(item)">退</view> -->
</block> </block>
<block v-if="item.state == 3"> <block v-if="item.state == 3">
<view class="pay shouhou" :style="'color:' + colors + ';border-color:' + colors" @tap="jumpDetails(item)"></view> <view class="pay shouhou" @tap="jumpDetails(item)"></view>
<view class="pay shouhou" @tap="jumpDetails(item)"></view> <view class="pay shouhou" @tap="jumpDetails(item)"></view>
</block> </block>
<!-- <view class="pay shouhou" v-if="item.state == 4" @click="delOrder(item)"></view> --> <!-- <view class="pay shouhou" v-if="item.state == 4" @click="delOrder(item)"></view> -->
@ -68,12 +68,13 @@
<script> <script>
import { getOrderList, editOrder } from '@/api/index.js' import { getOrderList, editOrder } from '@/api/index.js'
var app = getApp();
import tabs from "../../commponent/public/tabs"; import tabs from "../../commponent/public/tabs";
import loading from "../../commponent/public/loading"; import loading from "../../commponent/public/loading";
import navBar from '../../commponent/public/navBar.vue' import navBar from '../../commponent/public/navBar.vue'
import { ORDER_NAVS } from '@/config/order.js' import { ORDER_NAVS } from '@/config/order.js'
import { getUserInfo, setSalesGoods } from '@/utils/auth'; import { getUserInfo, setSalesGoods } from '@/utils/auth';
const app = getApp();
export default { export default {
data() { data() {
return { return {
@ -83,7 +84,8 @@ import { getUserInfo, setSalesGoods } from '@/utils/auth';
active: 0, active: 0,
orderList: [], orderList: [],
isShow: true, isShow: true,
colors: "" colors: "",
themeObj: app.globalData.themeObj
}; };
}, },
filters: { filters: {

@ -1,17 +1,17 @@
<template> <template>
<view class="jieguo" :style="{background: colors}"> <view class="jieguo" :class="['theme', themeObj.name]">
<view class="place"> <view class="place">
</view> </view>
<view class="jieguo_box"> <view class="jieguo_box">
<view class="success"> <view class="success">
<text class="iconfont icon-chenggong" :style="'color:' + colors"></text> <text class="iconfont icon-chenggong" ></text>
</view> </view>
<view class="texts"> <view class="texts">
<!-- 支付成功 --> <!-- 支付成功 -->
订单创建成功 订单创建成功
</view> </view>
<!-- <view class="moneys">35.9</view> --> <!-- <view class="moneys">35.9</view> -->
<view class="wancheng" @tap="onsuccess" :style="'color:' + colors + ';border-color:' + colors"></view> <view class="wancheng" @tap="onsuccess"></view>
<view class="ewm" @tap="jumpUser">>>></view> <view class="ewm" @tap="jumpUser">>>></view>
</view> </view>
</view> </view>
@ -19,12 +19,13 @@
<script> <script>
var app = getApp(); const app = getApp();
export default { export default {
data() { data() {
return { return {
colors: ""
themeObj: app.globalData.themeObj
}; };
}, },
@ -35,9 +36,7 @@ export default {
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
this.setData({
colors: app.globalData.newColor
});
}, },
/** /**

@ -1,5 +1,5 @@
<template> <template>
<view class="setting"> <view class="setting" :class="['theme', themeColor.name]">
<view class="cell_box" @tap="goItem"> <view class="cell_box" @tap="goItem">
<item-cell cellname="关于商城" ></item-cell> <item-cell cellname="关于商城" ></item-cell>
<item-cell cellname="站点帮助" ></item-cell> <item-cell cellname="站点帮助" ></item-cell>
@ -136,6 +136,7 @@ export default {
}); });
app.globalData.newColor = item.color; app.globalData.newColor = item.color;
app.globalData.themeObj = item app.globalData.themeObj = item
}, },
onexit() { onexit() {
//退 //退

@ -1,5 +1,5 @@
<template> <template>
<view class="cart" style="background-color: #5f6f7;min-height: 100vh;"> <view class="cart" :class="['theme', themeObj.name]" style="background-color: #5f6f7;min-height: 100vh;">
<!-- #ifdef APP-PLUS --> <!-- #ifdef APP-PLUS -->
<div class="status-bar" :style="{height:statusBarHeight+'px'}"></div> <div class="status-bar" :style="{height:statusBarHeight+'px'}"></div>
<!-- #endif --> <!-- #endif -->
@ -80,18 +80,18 @@
</view> </view>
<view class="text" style="margin-left: 8upx;">全选</view> <view class="text" style="margin-left: 8upx;">全选</view>
</view> </view>
<view class="delAll" @click="delectAll" :style="'border-color:' + colors + ';color:' + colors" v-if="allCurrent == true"></view> <view class="delAll" @click="delectAll" v-if="allCurrent == true"></view>
</view> </view>
<view class="rights"> <view class="rights">
<view class="jiesuan" :style="'background-color:' + colors" @click="settlement">({{sum}})</view> <view class="jiesuan" @click="settlement">({{sum}})</view>
<view class="sum">合计<text style="font-size: 30upx;">{{sumPrice || 0}}</text></view> <view class="sum">合计<text style="font-size: 30upx;">{{sumPrice || 0}}</text></view>
</view> </view>
</view> </view>
</block> </block>
<!-- 如果购物车没有数据 --> <!-- 如果购物车没有数据 -->
<view class="nocart" v-if="cartList.length == 0"> <view class="nocart" v-if="cartList.length == 0">
<text class="iconfont icon-gouwuche1" :style="'color:' + colors"></text> <text class="iconfont icon-gouwuche1" ></text>
<view>空空如也,<text :style="'color:' + colors" @tap="onStroll">便 ></text></view> <view>空空如也,<text class="empty" @tap="onStroll">便 ></text></view>
</view> </view>
</view> </view>
</template> </template>
@ -120,7 +120,8 @@
sumPrice: 0, sumPrice: 0,
lock: false, lock: false,
bottomShow: '', bottomShow: '',
showHeader: false showHeader: false,
themeObj: app.globalData.themeObj
}; };
}, },
@ -162,6 +163,7 @@
return return
} }
const cartList = getCart() || [] const cartList = getCart() || []
this.themeObj = app.globalData.themeObj
this.setData({ this.setData({
colors: app.globalData.newColor, colors: app.globalData.newColor,
current: '99999', current: '99999',

@ -1,5 +1,5 @@
<template> <template>
<view class="userbox"> <view class="userbox" :class="['theme', themeObj.name]">
<!-- 头部个人信息 不变--> <!-- 头部个人信息 不变-->
<view class="userHeader" :style="{background:colors}"> <view class="userHeader" :style="{background:colors}">
<image src="/static/images/user/user-bg.png" class="user_bg"></image> <image src="/static/images/user/user-bg.png" class="user_bg"></image>
@ -70,6 +70,7 @@ export default {
data() { data() {
return { return {
colors: '', colors: '',
themeObj: app.globalData.themeObj,
startY: 0, startY: 0,
// //
moving: false, moving: false,
@ -147,6 +148,17 @@ export default {
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
this.themeObj = app.globalData.themeObj
uni.setTabBarStyle({
selectedColor: this.themeObj .color
});
this.themeObj .tabList.forEach((v, index) => {
uni.setTabBarItem({
//tabBar
index: index,
selectedIconPath: v
});
})
if (!getToken()) { if (!getToken()) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/login/index1' url: '/pages/login/index1'
@ -155,31 +167,13 @@ export default {
} }
this.logList = getGoodsHistory() this.logList = getGoodsHistory()
let colors = app.globalData.newColor; let colors = app.globalData.newColor;
let oldcolor = this.colors; let oldcolor = this.colors;
let userdata = getUserInfo() || {}; let userdata = getUserInfo() || {};
this.userdata = userdata
this.getOrderStatus() this.getOrderStatus()
this.setData({
colors: colors,
userdata: userdata
});
if (oldcolor !== colors) {
//
let config = getConfig();
let tabList = config.tabList || [];
uni.setTabBarStyle({
selectedColor: colors
});
if(tabList){
for (var i = 0; i < tabList.length; i++) {
let img = tabList[i];
uni.setTabBarItem({
//tabBar
index: i,
selectedIconPath: img
});
}
}
}
}, },
/** /**

Loading…
Cancel
Save