Commit 854bacf6 authored by Menethil's avatar Menethil
Browse files

添加Renard小程序

parent a50998e6
......@@ -9,6 +9,7 @@ import java.util.Map;
* 配置基类,该类实际持有所有的配置,子类只是提供代理访问方法
*/
abstract class BaseConfig {
//所有的配置均保存在该 HashMap 中
protected static Map<String, String> configs = new HashMap<>();
......
package org.linlinjava.litemall.db.dao;
import org.apache.ibatis.annotations.Param;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......
package org.linlinjava.litemall.db.service;
import com.github.pagehelper.PageHelper;
import org.linlinjava.litemall.db.dao.LitemallUserMapper;
import org.linlinjava.litemall.db.dao.StatMapper;
import org.linlinjava.litemall.db.domain.LitemallUser;
import org.linlinjava.litemall.db.domain.LitemallUserExample;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.util.List;
......
var util = require('./utils/util.js');
var api = require('./config/api.js');
var user = require('./utils/user.js');
App({
onLaunch: function() {
const updateManager = wx.getUpdateManager();
wx.getUpdateManager().onUpdateReady(function() {
wx.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success: function(res) {
if (res.confirm) {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate()
}
}
})
})
},
onShow: function(options) {
user.checkLogin().then(res => {
this.globalData.hasLogin = true;
}).catch(() => {
this.globalData.hasLogin = false;
});
},
globalData: {
hasLogin: false
}
})
\ No newline at end of file
{
"pages": [
"pages/index/index",
"pages/catalog/catalog",
"pages/newGoods/newGoods",
"pages/hotGoods/hotGoods",
"pages/ucenter/index/index",
"pages/ucenter/address/address",
"pages/ucenter/addressAdd/addressAdd",
"pages/ucenter/footprint/footprint",
"pages/ucenter/order/order",
"pages/ucenter/orderDetail/orderDetail",
"pages/ucenter/coupon/coupon",
"pages/ucenter/collect/collect",
"pages/auth/login/login",
"pages/auth/register/register",
"pages/auth/reset/reset",
"pages/payResult/payResult",
"pages/comment/comment",
"pages/commentPost/commentPost",
"pages/topic/topic",
"pages/topicComment/topicComment",
"pages/topicDetail/topicDetail",
"pages/topicCommentPost/topicCommentPost",
"pages/brand/brand",
"pages/brandDetail/brandDetail",
"pages/search/search",
"pages/category/category",
"pages/cart/cart",
"pages/shopping/checkout/checkout",
"pages/goods/goods",
"pages/groupon/myGroupon/myGroupon",
"pages/groupon/grouponDetail/grouponDetail"
],
"window": {
"navigationBarTitleText": "Renard",
"enablePullDownRefresh": true,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black"
},
"tabBar": {
"color": "#6e6d6b",
"selectedColor": "#e64340",
"borderStyle": "white",
"backgroundColor": "#fff",
"box-shadow": "0 0 6px 0",
"list": [
{
"pagePath": "pages/index/index",
"iconPath": "images/tabbar/like-f.png",
"selectedIconPath": "images/tabbar/like-o.png"
},
{
"pagePath": "pages/catalog/catalog",
"iconPath": "images/tabbar/menu-f.png",
"selectedIconPath": "images/tabbar/menu-o.png"
},
{
"pagePath": "pages/cart/cart",
"iconPath": "images/tabbar/cart-f.png",
"selectedIconPath": "images/tabbar/cart-o.png"
},
{
"pagePath": "pages/ucenter/index/index",
"iconPath": "images/tabbar/user-f.png",
"selectedIconPath": "images/tabbar/user-o.png"
}
]
},
"networkTimeout": {
"request": 10000,
"connectSocket": 10000,
"uploadFile": 10000,
"downloadFile": 10000
},
"debug": true
}
\ No newline at end of file
/**app.wxss**/
.container {
box-sizing: border-box;
font-family: PingFangSC-Light,helvetica,'Heiti SC';
width: 100%;
height: 100%;
}
view,image,text,navigator{
box-sizing: border-box;
padding:0;
margin:0;
}
view,text{
font-family: PingFangSC-Light,helvetica,'Heiti SC';
font-size: 29rpx;
color: #a78845;
}
.wxParse-img {
display: block !important;
}
\ No newline at end of file
'use strict';
Component({
externalClasses: ['custom-class'],
/**
* 组件的属性列表
* 用于组件自定义设置
*/
properties: {
// 颜色状态
type: {
type: String,
value: ''
},
// 自定义颜色
color: {
type: String,
value: ''
},
// 左侧内容
leftText: {
type: String,
value: ''
},
// 右侧内容
rightText: {
type: String,
value: ''
}
}
});
\ No newline at end of file
<view class="custom-class zan-capsule zan-capsule--{{type}}">
<block wx:if="{{color}}">
<view class="zan-capsule__left" style="background: {{ color }}; border-color: {{ color }}">{{ leftText }}</view>
<view class="zan-capsule__right" style="color: {{ color }}; border-color: {{ color }}">{{ rightText }}</view>
</block>
<block wx:else>
<view class="zan-capsule__left">{{ leftText }}</view>
<view class="zan-capsule__right">{{ rightText }}</view>
</block>
</view>
\ No newline at end of file
.zan-capsule {
display: inline-block;
font-size: 12px;
vertical-align: middle;
line-height: 19px;
-webkit-transform: scale(0.83);
transform: scale(0.83);
}
.zan-capsule__left, .zan-capsule__right {
display: inline-block;
line-height: 17px;
height: 19px;
vertical-align: middle;
box-sizing: border-box;
}
.zan-capsule__left {
padding: 0 2px;
color: #fff;
background: #999;
border-radius: 2px 0 0 2px;
border: 1rpx solid #999;
}
.zan-capsule__right {
padding: 0 5px;
color: #999;
border-radius: 0 2px 2px 0;
border: 1rpx solid #999;
}
.zan-capsule--danger .zan-capsule__left {
color: #fff;
background: #f24544;
border-color: #f24544;
}
.zan-capsule--danger .zan-capsule__right {
color: #f24544;
border-color: #f24544;
}
// components/good/good.js
Component({
/**
* 组件的属性列表
*/
properties: {
title: { // 属性名
type: String, // 类型(必填),目前接受的类型包括:String, Number, Boolean, Object, Array, null(表示任意类型)
value: '标题' // 属性初始值(可选),如果未指定则会根据类型选择一个
},
imageUrl: {
type: String,
value: ''
},
counterPrice: {
type: Number,
value: 0
},
retailPrice: {
type: Number,
value: 0
},
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="good">
<image class="img" src="{{imageUrl}}" background-size="cover"></image>
<view class="name">{{title}}</view>
<view class="price">
<view class="counterPrice" wx:if="{{counterPrice > retailPrice}}">原价:¥{{counterPrice}}</view>
<view class="retailPrice">现价:¥{{retailPrice}}</view>
</view>
</view>
\ No newline at end of file
.good {
height: 480rpx;
width: 372rpx;
align-content: center;
}
.good .img {
width: 302rpx;
height: 302rpx;
z-index: 1;
}
.good .name {
text-align: center;
/* display: block; */
width: 372rpx;
height: 35rpx;
margin-bottom: 14rpx;
overflow: hidden;
font-size: 28rpx;
color: #333;
}
.good .price {
/* display: block; */
text-align: center;
line-height: 30rpx;
font-size: 28rpx;
color: #a78845;
}
.good .counterPrice {
text-decoration: line-through;
font-size: 24rpx;
color: #999;
}
.good .retailPrice {
font-size: 24rpx;
color: #a78845;
}
\ No newline at end of file
// components/goodList/goodList.js
Component({
/**
* 组件的属性列表
*/
properties: {
goods: { // 属性名
type: Array, // 类型(必填),目前接受的类型包括:String, Number, Boolean, Object, Array, null(表示任意类型)
value: [] // 属性初始值(可选),如果未指定则会根据类型选择一个
},
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {
"good": "../good/good"
}
}
\ No newline at end of file
<view class="b" wx:if="{{goods.length > 0}}">
<block wx:for="{{goods}}" wx:for-index="iindex" wx:for-item="iitem" wx:key="id">
<view class="item {{iindex % 2 == 0 ? '' : 'item-b'}}">
<navigator url="../goods/goods?id={{iitem.id}}" class="a">
<good imageUrl='{{iitem.picUrl}}' title='{{iitem.name}}' retailPrice='{{iitem.retailPrice}}' counterPrice='{{iitem.counterPrice}}'></good>
</navigator>
</view>
</block>
</view>
\ No newline at end of file
.b {
width: 750rpx;
padding: 0 6.25rpx;
height: auto;
overflow: hidden;
z-index: 1;
}
.b .good {
z-index: 1;
}
.b .item {
float: left;
background: #fff;
width: 365rpx;
margin-bottom: 6.25rpx;
height: 482rpx;
overflow: hidden;
text-align: center;
z-index: 1;
}
.b .item .a {
height: 452rpx;
width: 100%;
z-index: 1;
}
.b .item-b {
margin-left: 6.25rpx;
z-index: 1;
}
Component({
externalClasses: ['custom-class'],
properties: {
info: null,
name: String,
size: String,
color: String
},
methods: {
onClick() {
this.triggerEvent('click');
}
}
});
Supports Markdown
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