ipaotui mall
30
app/app.js
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
//app.js
|
||||||
|
App({
|
||||||
|
onLaunch: function () {
|
||||||
|
//调用API从本地缓存中获取数据
|
||||||
|
var logs = wx.getStorageSync('logs') || []
|
||||||
|
logs.unshift(Date.now())
|
||||||
|
wx.setStorageSync('logs', logs)
|
||||||
|
},
|
||||||
|
getUserInfo:function(cb){
|
||||||
|
var that = this
|
||||||
|
if(this.globalData.userInfo){
|
||||||
|
typeof cb == "function" && cb(this.globalData.userInfo)
|
||||||
|
}else{
|
||||||
|
//调用登录接口
|
||||||
|
wx.login({
|
||||||
|
success: function () {
|
||||||
|
wx.getUserInfo({
|
||||||
|
success: function (res) {
|
||||||
|
that.globalData.userInfo = res.userInfo
|
||||||
|
typeof cb == "function" && cb(that.globalData.userInfo)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
globalData:{
|
||||||
|
userInfo:null
|
||||||
|
}
|
||||||
|
})
|
46
app/app.json
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"pages": [
|
||||||
|
"pages/shop/show",
|
||||||
|
"pages/index/index",
|
||||||
|
"pages/order/list",
|
||||||
|
"pages/mine/mine",
|
||||||
|
"pages/index/address",
|
||||||
|
"pages/order/show",
|
||||||
|
"pages/order/quasi",
|
||||||
|
"pages/shop/category",
|
||||||
|
"pages/shop/search",
|
||||||
|
"pages/address/list",
|
||||||
|
"pages/address/add",
|
||||||
|
"pages/address/select"
|
||||||
|
],
|
||||||
|
"window": {
|
||||||
|
"backgroundColor": "#f8f8f8",
|
||||||
|
"backgroundTextStyle": "light",
|
||||||
|
"navigationBarBackgroundColor": "#ff5801",
|
||||||
|
"navigationBarTitleText": "爱跑腿外卖",
|
||||||
|
"navigationBarTextStyle": "light"
|
||||||
|
},
|
||||||
|
"tabBar": {
|
||||||
|
"selectedColor": "#ff5801",
|
||||||
|
"list": [
|
||||||
|
{
|
||||||
|
"pagePath": "pages/index/index",
|
||||||
|
"iconPath": "images/Shop_Tabbar_TakeOut_Empty@2x.png",
|
||||||
|
"selectedIconPath": "images/Shop_Tabbar_TakeOut_Full@2x.png",
|
||||||
|
"text": "首页"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pagePath": "pages/order/list",
|
||||||
|
"iconPath": "images/Shop_Tabbar_Order_Empty@2x.png",
|
||||||
|
"selectedIconPath": "images/Shop_Tabbar_Order_Full@2x.png",
|
||||||
|
"text": "订单"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pagePath": "pages/mine/mine",
|
||||||
|
"iconPath": "images/Shop_Tabbar_My_Empty@2x.png",
|
||||||
|
"selectedIconPath": "images/Shop_Tabbar_My_Full@2x.png",
|
||||||
|
"text": "我的"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
74
app/app.wxss
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
/**app.wxss**/
|
||||||
|
@import './weui.wxss';
|
||||||
|
|
||||||
|
page {
|
||||||
|
font-size: 16px;
|
||||||
|
background-color: #f8f8f8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.primary-color {
|
||||||
|
color: #ff5801 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grey-color {
|
||||||
|
color: #999 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.trangle::after {
|
||||||
|
content: "";
|
||||||
|
margin-top: -4px;
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
right: 5px;
|
||||||
|
height: 6px;
|
||||||
|
width: 6px;
|
||||||
|
border-width: 2rpx 2rpx 0 0;
|
||||||
|
border-style: solid;
|
||||||
|
transform: rotate(45deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
button[type=primary], .weui-btn_primary {
|
||||||
|
position: relative;
|
||||||
|
display: block;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
padding-left: 14px;
|
||||||
|
padding-right: 14px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-size: 18px;
|
||||||
|
text-align: center;
|
||||||
|
text-decoration: none;
|
||||||
|
line-height: 2.55555556;
|
||||||
|
border-radius: 5px;
|
||||||
|
-webkit-tap-highlight-color: transparent;
|
||||||
|
color: #fff;
|
||||||
|
background-color: #ff5801;
|
||||||
|
}
|
||||||
|
|
||||||
|
.weui-btn_mini {
|
||||||
|
display: inline-block;
|
||||||
|
line-height: 2.3;
|
||||||
|
font-size: 13px;
|
||||||
|
padding: 0 1.34em;
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
button[type="primary"][plain] {
|
||||||
|
color: #ff5801;
|
||||||
|
border-color: #ff5801;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-hover[type=primary], .button-hover.weui-btn_primary {
|
||||||
|
color: rgba(255, 255, 255, 0.8);
|
||||||
|
background-color: #ee5200;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-hover[type=primary][plain] {
|
||||||
|
color: #ee5200;
|
||||||
|
border-color: #ee5200;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-sp-area {
|
||||||
|
margin-top: 15px;
|
||||||
|
padding: 0 15px;
|
||||||
|
}
|
BIN
app/images/Shop_Tabbar_My_Empty@2x.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
app/images/Shop_Tabbar_My_Full@2x.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
app/images/Shop_Tabbar_Order_Empty@2x.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
app/images/Shop_Tabbar_Order_Full@2x.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
app/images/Shop_Tabbar_TakeOut_Empty@2x.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
app/images/Shop_Tabbar_TakeOut_Full@2x.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
app/images/category/1.png
Normal file
After Width: | Height: | Size: 4.4 KiB |
BIN
app/images/category/2.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
app/images/category/3.png
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
app/images/category/4.png
Normal file
After Width: | Height: | Size: 8.1 KiB |
BIN
app/images/category/5.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
app/images/category/6.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
app/images/category/7.png
Normal file
After Width: | Height: | Size: 4.1 KiB |
BIN
app/images/category/8.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
app/images/default.jpg
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
app/images/logo.png
Normal file
After Width: | Height: | Size: 9.5 KiB |
BIN
app/images/map-marker.png
Normal file
After Width: | Height: | Size: 695 B |
BIN
app/images/order-logout@2x.png
Normal file
After Width: | Height: | Size: 22 KiB |
19
app/pages/address/add.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// pages/address/add.js
|
||||||
|
Page({
|
||||||
|
data:{},
|
||||||
|
onLoad:function(options){
|
||||||
|
// 页面初始化 options为页面跳转所带来的参数
|
||||||
|
},
|
||||||
|
onReady:function(){
|
||||||
|
// 页面渲染完成
|
||||||
|
},
|
||||||
|
onShow:function(){
|
||||||
|
// 页面显示
|
||||||
|
},
|
||||||
|
onHide:function(){
|
||||||
|
// 页面隐藏
|
||||||
|
},
|
||||||
|
onUnload:function(){
|
||||||
|
// 页面关闭
|
||||||
|
}
|
||||||
|
})
|
1
app/pages/address/add.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{}
|
2
app/pages/address/add.wxml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<!--pages/address/add.wxml-->
|
||||||
|
<text>pages/address/add.wxml</text>
|
1
app/pages/address/add.wxss
Normal file
@ -0,0 +1 @@
|
|||||||
|
/* pages/address/add.wxss */
|
19
app/pages/address/list.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// pages/address/list.js
|
||||||
|
Page({
|
||||||
|
data:{},
|
||||||
|
onLoad:function(options){
|
||||||
|
// 页面初始化 options为页面跳转所带来的参数
|
||||||
|
},
|
||||||
|
onReady:function(){
|
||||||
|
// 页面渲染完成
|
||||||
|
},
|
||||||
|
onShow:function(){
|
||||||
|
// 页面显示
|
||||||
|
},
|
||||||
|
onHide:function(){
|
||||||
|
// 页面隐藏
|
||||||
|
},
|
||||||
|
onUnload:function(){
|
||||||
|
// 页面关闭
|
||||||
|
}
|
||||||
|
})
|
1
app/pages/address/list.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{}
|
2
app/pages/address/list.wxml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<!--pages/address/list.wxml-->
|
||||||
|
<text>pages/address/list.wxml</text>
|
1
app/pages/address/list.wxss
Normal file
@ -0,0 +1 @@
|
|||||||
|
/* pages/address/list.wxss */
|
19
app/pages/address/select.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// pages/address/select.js
|
||||||
|
Page({
|
||||||
|
data:{},
|
||||||
|
onLoad:function(options){
|
||||||
|
// 页面初始化 options为页面跳转所带来的参数
|
||||||
|
},
|
||||||
|
onReady:function(){
|
||||||
|
// 页面渲染完成
|
||||||
|
},
|
||||||
|
onShow:function(){
|
||||||
|
// 页面显示
|
||||||
|
},
|
||||||
|
onHide:function(){
|
||||||
|
// 页面隐藏
|
||||||
|
},
|
||||||
|
onUnload:function(){
|
||||||
|
// 页面关闭
|
||||||
|
}
|
||||||
|
})
|
1
app/pages/address/select.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{}
|
2
app/pages/address/select.wxml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<!--pages/address/select.wxml-->
|
||||||
|
<text>pages/address/select.wxml</text>
|
1
app/pages/address/select.wxss
Normal file
@ -0,0 +1 @@
|
|||||||
|
/* pages/address/select.wxss */
|
19
app/pages/index/address.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// pages/index/address.js
|
||||||
|
Page({
|
||||||
|
data:{},
|
||||||
|
onLoad:function(options){
|
||||||
|
// 页面初始化 options为页面跳转所带来的参数
|
||||||
|
},
|
||||||
|
onReady:function(){
|
||||||
|
// 页面渲染完成
|
||||||
|
},
|
||||||
|
onShow:function(){
|
||||||
|
// 页面显示
|
||||||
|
},
|
||||||
|
onHide:function(){
|
||||||
|
// 页面隐藏
|
||||||
|
},
|
||||||
|
onUnload:function(){
|
||||||
|
// 页面关闭
|
||||||
|
}
|
||||||
|
})
|
1
app/pages/index/address.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{}
|
2
app/pages/index/address.wxml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<!--pages/index/address.wxml-->
|
||||||
|
<text>pages/index/address.wxml</text>
|
1
app/pages/index/address.wxss
Normal file
@ -0,0 +1 @@
|
|||||||
|
/* pages/index/address.wxss */
|
139
app/pages/index/index.js
Normal file
@ -0,0 +1,139 @@
|
|||||||
|
//index.js
|
||||||
|
//获取应用实例
|
||||||
|
|
||||||
|
function countdown(that) {
|
||||||
|
var second = that.data.second
|
||||||
|
if (second <= 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var time = setTimeout(function () {
|
||||||
|
console.log(second)
|
||||||
|
that.setData({
|
||||||
|
second: second - 1
|
||||||
|
});
|
||||||
|
countdown(that);
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
var app = getApp()
|
||||||
|
Page({
|
||||||
|
data: {
|
||||||
|
category: [
|
||||||
|
{
|
||||||
|
"category_id": "1",
|
||||||
|
"title": "本地特产",
|
||||||
|
"icon": "/images/category/1.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"category_id": "2",
|
||||||
|
"title": "美食外卖",
|
||||||
|
"icon": "/images/category/2.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"category_id": "3",
|
||||||
|
"title": "甜品蛋糕",
|
||||||
|
"icon": "/images/category/3.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"category_id": "4",
|
||||||
|
"title": "果蔬生鲜",
|
||||||
|
"icon": "/images/category/4.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"category_id": "5",
|
||||||
|
"title": "超市便利",
|
||||||
|
"icon": "/images/category/5.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"category_id": "6",
|
||||||
|
"title": "进口产品",
|
||||||
|
"icon": "/images/category/6.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"category_id": "7",
|
||||||
|
"title": "优惠活动",
|
||||||
|
"icon": "/images/category/7.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"category_id": "8",
|
||||||
|
"title": "全部分类",
|
||||||
|
"icon": "/images/category/8.png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
shop: [
|
||||||
|
{
|
||||||
|
"seller_id": "2",
|
||||||
|
"seller_name": "鲜极道",
|
||||||
|
"state": "1",
|
||||||
|
"city_id": "330300",
|
||||||
|
"address": "温州龙湾区衢江路2011号",
|
||||||
|
"pic_url": "http://mtest.ipaotui.com/Uploadfile/Img/seller/20170314/1489479032148947903230424.png",
|
||||||
|
"pic_hd": "http://mtest.ipaotui.com/Uploadfile/Img/seller/20170314/hd_1489479032148947903230424.png",
|
||||||
|
"longitude": "120.748973",
|
||||||
|
"latitude": "27.984401",
|
||||||
|
"phone": "88888888",
|
||||||
|
"start_sell_time": "08:00:00",
|
||||||
|
"end_sell_time": "09:00:00",
|
||||||
|
"sell_time": "08:00-20:00,08:00-20:00",
|
||||||
|
"is_rest": "0",
|
||||||
|
"notice": "东池便当,好吃西",
|
||||||
|
"reach_time": "30",
|
||||||
|
"reserve_day": "0",
|
||||||
|
"min_price": "5",
|
||||||
|
"sales": "73",
|
||||||
|
"service": "0.0",
|
||||||
|
"quality": "0.0",
|
||||||
|
"overall": "0.0",
|
||||||
|
"distance": "11",
|
||||||
|
"favorite": "0",
|
||||||
|
"promotion": [
|
||||||
|
{
|
||||||
|
"pic_url": "http://mtest.ipaotui.com/Uploadfile/Img/seller_promotion/first_cut.png",
|
||||||
|
"info": "新用户在线支付满15元减10元,满20元减13元"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pic_url": "http://mtest.ipaotui.com/Uploadfile/Img/seller_promotion/cut.png",
|
||||||
|
"info": "在线支付满15元减5元,满20元减8元"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"seller_id": "24",
|
||||||
|
"seller_name": "测试",
|
||||||
|
"state": "1",
|
||||||
|
"city_id": "330300",
|
||||||
|
"address": "skldfjhkls",
|
||||||
|
"pic_url": "http://mtest.ipaotui.com/Uploadfile/Img/seller/1468462647146846264750782.jpg",
|
||||||
|
"pic_hd": "http://mtest.ipaotui.com/Uploadfile/Img/seller/hd_1468462647146846264750782.jpg",
|
||||||
|
"longitude": "120.70507",
|
||||||
|
"latitude": "28.003041",
|
||||||
|
"phone": "13900000000",
|
||||||
|
"start_sell_time": "08:00:00",
|
||||||
|
"end_sell_time": "22:00:00",
|
||||||
|
"sell_time": "08:00-22:00",
|
||||||
|
"is_rest": "0",
|
||||||
|
"notice": null,
|
||||||
|
"reach_time": "30",
|
||||||
|
"reserve_day": "0",
|
||||||
|
"min_price": "5",
|
||||||
|
"sales": "0",
|
||||||
|
"service": "0.0",
|
||||||
|
"quality": "0.0",
|
||||||
|
"overall": "0.0",
|
||||||
|
"distance": "4784",
|
||||||
|
"favorite": "0",
|
||||||
|
"promotion": []
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
onLoad: function () {
|
||||||
|
console.log('onLoad')
|
||||||
|
var that = this
|
||||||
|
//调用应用实例的方法获取全局数据
|
||||||
|
app.getUserInfo(function (userInfo) {
|
||||||
|
//更新数据
|
||||||
|
that.setData({
|
||||||
|
userInfo: userInfo
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
3
app/pages/index/index.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
|
||||||
|
}
|
55
app/pages/index/index.wxml
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
<import src="/templates/star-rate.wxml" />
|
||||||
|
|
||||||
|
<!--index.wxml-->
|
||||||
|
<view class="topbar">
|
||||||
|
<view class="address trangle">
|
||||||
|
<image class="address__icon" src="/images/map-marker.png"></image>
|
||||||
|
电商大厦电商大厦(兴区路)
|
||||||
|
</view>
|
||||||
|
<view class="search">
|
||||||
|
<icon type="search" size="20" /> 搜索
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="category">
|
||||||
|
<navigator class="category__item" url="" wx:for="{{category}}" wx:key="category_id">
|
||||||
|
<view>
|
||||||
|
<image src="{{item.icon}}" class="category__icon"></image>
|
||||||
|
</view>
|
||||||
|
{{item.title}}
|
||||||
|
</navigator>
|
||||||
|
</view>
|
||||||
|
<view class="weui-panel weui-panel_access">
|
||||||
|
<view class="weui-panel__hd">推荐商家</view>
|
||||||
|
<view class="weui-panel__bd shop__list">
|
||||||
|
<navigator url="" wx:for="{{shop}}" wx:key="{{seller_id}}" class="weui-media-box weui-media-box_appmsg shop__item" hover-class="weui-cell_active">
|
||||||
|
<view class="weui-media-box__hd weui-media-box__hd_in-appmsg">
|
||||||
|
<image class="weui-media-box__thumb" src="{{item.pic_url}}" />
|
||||||
|
</view>
|
||||||
|
<view class="weui-media-box__bd weui-media-box__bd_in-appmsg">
|
||||||
|
<view class="weui-media-box__title">{{item.seller_name}}</view>
|
||||||
|
<view class="weui-media-box__desc shop__desc">
|
||||||
|
<view class="shop__sales">
|
||||||
|
<view class="shop__star">
|
||||||
|
<template is="star-rate" data="{{value: item.overall}}" />
|
||||||
|
</view>
|
||||||
|
<view>月售 {{item.sales}} 单</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="shop__misc weui-flex">
|
||||||
|
<view class="shop__fee weui-flex__item">
|
||||||
|
起送 ¥{{item.min_price}}
|
||||||
|
</view>
|
||||||
|
<text class="shop__reach-time grey-color">{{item.distance/1000}}km</text> |
|
||||||
|
<text class="shop__reach-time primary-color">{{item.reach_time}}分钟</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view wx:if="{{item.promotion.length > 0}}" class="shop__promotion">
|
||||||
|
<view wx:for="{{item.promotion}}" wx:key="index" class="shop__promotion-item">
|
||||||
|
<image class="shop__promotion-icon" src="{{item.pic_url}}"></image>
|
||||||
|
{{item.info}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</navigator>
|
||||||
|
</view>
|
||||||
|
</view>
|
61
app/pages/index/index.wxss
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
/**index.wxss**/
|
||||||
|
|
||||||
|
@import './shop.wxss';
|
||||||
|
@import '/templates/star-rate.wxss';
|
||||||
|
|
||||||
|
.topbar {
|
||||||
|
display: flex;
|
||||||
|
padding: 10px;
|
||||||
|
background-color: #ff5801;
|
||||||
|
}
|
||||||
|
|
||||||
|
.address {
|
||||||
|
position: relative;
|
||||||
|
padding: 3px 5px;
|
||||||
|
min-width: 40%;
|
||||||
|
max-width: 50%;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #fff;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
background-color: rgba(0, 0, 0, 0.2);
|
||||||
|
border-radius: 15px/50%;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.address__icon {
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search {
|
||||||
|
flex: 1;
|
||||||
|
margin-left: 15px;
|
||||||
|
padding: 3px 5px;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #999;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 15px/50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.category {
|
||||||
|
padding: 0 10px 10px;
|
||||||
|
font-size: 14px;
|
||||||
|
text-align: center;
|
||||||
|
background-color: #fff;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.category__item {
|
||||||
|
float: left;
|
||||||
|
margin-top: 10px;
|
||||||
|
width: 25%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.category__icon {
|
||||||
|
height: 36px;
|
||||||
|
width: 36px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
39
app/pages/index/shop.wxss
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
.shop__item {
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shop__sales {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shop__star {
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.shop__misc {
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shop__promotion {
|
||||||
|
margin-top: 5px;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #999;
|
||||||
|
border-top: 1rpx dashed #E5E5E5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shop__promotion-item {
|
||||||
|
margin-top: 5px;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shop__promotion-icon {
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
14
app/pages/logs/logs.js
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
//logs.js
|
||||||
|
var util = require('../../utils/util.js')
|
||||||
|
Page({
|
||||||
|
data: {
|
||||||
|
logs: []
|
||||||
|
},
|
||||||
|
onLoad: function () {
|
||||||
|
this.setData({
|
||||||
|
logs: (wx.getStorageSync('logs') || []).map(function (log) {
|
||||||
|
return util.formatTime(new Date(log))
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
3
app/pages/logs/logs.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"navigationBarTitleText": "查看启动日志"
|
||||||
|
}
|
6
app/pages/logs/logs.wxml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<!--logs.wxml-->
|
||||||
|
<view class="container log-list">
|
||||||
|
<block wx:for="{{logs}}" wx:for-item="log" wx:key="*this">
|
||||||
|
<text class="log-item">{{index + 1}}. {{log}}</text>
|
||||||
|
</block>
|
||||||
|
</view>
|
8
app/pages/logs/logs.wxss
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
.log-list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 40rpx;
|
||||||
|
}
|
||||||
|
.log-item {
|
||||||
|
margin: 10rpx;
|
||||||
|
}
|
19
app/pages/mine/mine.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// pages/mine/mine.js
|
||||||
|
Page({
|
||||||
|
data:{},
|
||||||
|
onLoad:function(options){
|
||||||
|
// 页面初始化 options为页面跳转所带来的参数
|
||||||
|
},
|
||||||
|
onReady:function(){
|
||||||
|
// 页面渲染完成
|
||||||
|
},
|
||||||
|
onShow:function(){
|
||||||
|
// 页面显示
|
||||||
|
},
|
||||||
|
onHide:function(){
|
||||||
|
// 页面隐藏
|
||||||
|
},
|
||||||
|
onUnload:function(){
|
||||||
|
// 页面关闭
|
||||||
|
}
|
||||||
|
})
|
3
app/pages/mine/mine.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"navigationBarTitleText": "我的"
|
||||||
|
}
|
25
app/pages/mine/mine.wxml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
|
||||||
|
<!--pages/mine/mine.wxml-->
|
||||||
|
<view class="header">
|
||||||
|
<view>
|
||||||
|
<image class="avatar" src="/images/default.jpg"></image>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
未登录
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="weui-cells">
|
||||||
|
<navigator url="" class="weui-cell weui-cell_access" hover-class="weui-cell_active">
|
||||||
|
<view class="weui-cell__bd">收货地址</view>
|
||||||
|
<view class="weui-cell__ft weui-cell__ft_in-access"></view>
|
||||||
|
</navigator>
|
||||||
|
<navigator url="" class="weui-cell weui-cell_access" hover-class="weui-cell_active">
|
||||||
|
<view class="weui-cell__bd">客服热线</view>
|
||||||
|
<view class="weui-cell__ft weui-cell__ft_in-access">400-926-2108</view>
|
||||||
|
</navigator>
|
||||||
|
</view>
|
||||||
|
<view class="button-sp-area">
|
||||||
|
<button class="weui-btn" type="primary">
|
||||||
|
立即登录
|
||||||
|
</button>
|
||||||
|
</view>
|
16
app/pages/mine/mine.wxss
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
/* pages/mine/mine.wxss */
|
||||||
|
|
||||||
|
.header {
|
||||||
|
padding: 15px 0;
|
||||||
|
text-align: center;
|
||||||
|
background-color: #ff5801;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.avatar {
|
||||||
|
display: inline-block;
|
||||||
|
width: 80px;
|
||||||
|
height: 80px;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 5rpx solid rgba(255, 255, 255, 0.6);
|
||||||
|
}
|
19
app/pages/order/list.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// pages/order/list.js
|
||||||
|
Page({
|
||||||
|
data:{},
|
||||||
|
onLoad:function(options){
|
||||||
|
// 页面初始化 options为页面跳转所带来的参数
|
||||||
|
},
|
||||||
|
onReady:function(){
|
||||||
|
// 页面渲染完成
|
||||||
|
},
|
||||||
|
onShow:function(){
|
||||||
|
// 页面显示
|
||||||
|
},
|
||||||
|
onHide:function(){
|
||||||
|
// 页面隐藏
|
||||||
|
},
|
||||||
|
onUnload:function(){
|
||||||
|
// 页面关闭
|
||||||
|
}
|
||||||
|
})
|
3
app/pages/order/list.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"navigationBarTitleText": "我的订单"
|
||||||
|
}
|
10
app/pages/order/list.wxml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
<!--pages/order/list.wxml-->
|
||||||
|
<view wx:if="{{login}}" class="order-list"></view>
|
||||||
|
<view wx:else class="order-logout">
|
||||||
|
<image class="order-logout__bg" src="/images/order-logout@2x.png"></image>
|
||||||
|
<view class="order-logout__tip">
|
||||||
|
您还没有登录, 登录后查看订单
|
||||||
|
</view>
|
||||||
|
<navigator url="url" class="weui-btn weui-btn_primary weui-btn_mini" hover-class="button-hover">登录</navigator>
|
||||||
|
</view>
|
15
app/pages/order/list.wxss
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
/* pages/order/list.wxss */
|
||||||
|
|
||||||
|
.order-logout {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-logout__bg {
|
||||||
|
margin-top: 100px;
|
||||||
|
width: 176px;
|
||||||
|
height: 126px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-logout__tip {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
19
app/pages/order/quasi.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// pages/order/quasi.js
|
||||||
|
Page({
|
||||||
|
data:{},
|
||||||
|
onLoad:function(options){
|
||||||
|
// 页面初始化 options为页面跳转所带来的参数
|
||||||
|
},
|
||||||
|
onReady:function(){
|
||||||
|
// 页面渲染完成
|
||||||
|
},
|
||||||
|
onShow:function(){
|
||||||
|
// 页面显示
|
||||||
|
},
|
||||||
|
onHide:function(){
|
||||||
|
// 页面隐藏
|
||||||
|
},
|
||||||
|
onUnload:function(){
|
||||||
|
// 页面关闭
|
||||||
|
}
|
||||||
|
})
|
1
app/pages/order/quasi.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{}
|
2
app/pages/order/quasi.wxml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<!--pages/order/quasi.wxml-->
|
||||||
|
<text>pages/order/quasi.wxml</text>
|
1
app/pages/order/quasi.wxss
Normal file
@ -0,0 +1 @@
|
|||||||
|
/* pages/order/quasi.wxss */
|
19
app/pages/order/show.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// pages/order/show.js
|
||||||
|
Page({
|
||||||
|
data:{},
|
||||||
|
onLoad:function(options){
|
||||||
|
// 页面初始化 options为页面跳转所带来的参数
|
||||||
|
},
|
||||||
|
onReady:function(){
|
||||||
|
// 页面渲染完成
|
||||||
|
},
|
||||||
|
onShow:function(){
|
||||||
|
// 页面显示
|
||||||
|
},
|
||||||
|
onHide:function(){
|
||||||
|
// 页面隐藏
|
||||||
|
},
|
||||||
|
onUnload:function(){
|
||||||
|
// 页面关闭
|
||||||
|
}
|
||||||
|
})
|
1
app/pages/order/show.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{}
|
4
app/pages/order/show.wxml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<!--pages/order/show.wxml-->
|
||||||
|
<view class="header weui-flex">
|
||||||
|
<image src="src"></image>
|
||||||
|
</view>
|
1
app/pages/order/show.wxss
Normal file
@ -0,0 +1 @@
|
|||||||
|
/* pages/order/show.wxss */
|
19
app/pages/shop/category.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// pages/shop/category.js
|
||||||
|
Page({
|
||||||
|
data:{},
|
||||||
|
onLoad:function(options){
|
||||||
|
// 页面初始化 options为页面跳转所带来的参数
|
||||||
|
},
|
||||||
|
onReady:function(){
|
||||||
|
// 页面渲染完成
|
||||||
|
},
|
||||||
|
onShow:function(){
|
||||||
|
// 页面显示
|
||||||
|
},
|
||||||
|
onHide:function(){
|
||||||
|
// 页面隐藏
|
||||||
|
},
|
||||||
|
onUnload:function(){
|
||||||
|
// 页面关闭
|
||||||
|
}
|
||||||
|
})
|
1
app/pages/shop/category.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{}
|
2
app/pages/shop/category.wxml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<!--pages/shop/category.wxml-->
|
||||||
|
<text>pages/shop/category.wxml</text>
|
1
app/pages/shop/category.wxss
Normal file
@ -0,0 +1 @@
|
|||||||
|
/* pages/shop/category.wxss */
|
19
app/pages/shop/search.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// pages/shop/search.js
|
||||||
|
Page({
|
||||||
|
data:{},
|
||||||
|
onLoad:function(options){
|
||||||
|
// 页面初始化 options为页面跳转所带来的参数
|
||||||
|
},
|
||||||
|
onReady:function(){
|
||||||
|
// 页面渲染完成
|
||||||
|
},
|
||||||
|
onShow:function(){
|
||||||
|
// 页面显示
|
||||||
|
},
|
||||||
|
onHide:function(){
|
||||||
|
// 页面隐藏
|
||||||
|
},
|
||||||
|
onUnload:function(){
|
||||||
|
// 页面关闭
|
||||||
|
}
|
||||||
|
})
|
1
app/pages/shop/search.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{}
|
2
app/pages/shop/search.wxml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<!--pages/shop/search.wxml-->
|
||||||
|
<text>pages/shop/search.wxml</text>
|
1
app/pages/shop/search.wxss
Normal file
@ -0,0 +1 @@
|
|||||||
|
/* pages/shop/search.wxss */
|
57
app/pages/shop/show.js
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
// pages/shop/show.js
|
||||||
|
Page({
|
||||||
|
data: {
|
||||||
|
info: {
|
||||||
|
"seller_id": "2",
|
||||||
|
"seller_name": "鲜极道",
|
||||||
|
"state": "1",
|
||||||
|
"city_id": "330300",
|
||||||
|
"address": "温州龙湾区衢江路2011号",
|
||||||
|
"pic_url": "http://mtest.ipaotui.com/Uploadfile/Img/seller/20170314/1489479032148947903230424.png",
|
||||||
|
"pic_hd": "http://mtest.ipaotui.com/Uploadfile/Img/seller/20170314/hd_1489479032148947903230424.png",
|
||||||
|
"longitude": "120.748973",
|
||||||
|
"latitude": "27.984401",
|
||||||
|
"phone": "88888888",
|
||||||
|
"start_sell_time": "08:00:00",
|
||||||
|
"end_sell_time": "09:00:00",
|
||||||
|
"sell_time": "08:00-20:00,08:00-20:00",
|
||||||
|
"is_rest": "0",
|
||||||
|
"notice": "东池便当,好吃西",
|
||||||
|
"reach_time": "30",
|
||||||
|
"reserve_day": "0",
|
||||||
|
"min_price": "5",
|
||||||
|
"sales": "74",
|
||||||
|
"service": "0.0",
|
||||||
|
"quality": "0.0",
|
||||||
|
"overall": "0.0",
|
||||||
|
"distance": "20434",
|
||||||
|
"delivery_fee": 45,
|
||||||
|
"favorite": "0",
|
||||||
|
"promotion": [
|
||||||
|
{
|
||||||
|
"pic_url": "http://mtest.ipaotui.com/Uploadfile/Img/seller_promotion/first_cut.png",
|
||||||
|
"info": "新用户在线支付满15元减10元,满20元减13元"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pic_url": "http://mtest.ipaotui.com/Uploadfile/Img/seller_promotion/cut.png",
|
||||||
|
"info": "在线支付满15元减5元,满20元减8元"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad: function (options) {
|
||||||
|
// 页面初始化 options为页面跳转所带来的参数
|
||||||
|
},
|
||||||
|
onReady: function () {
|
||||||
|
// 页面渲染完成
|
||||||
|
},
|
||||||
|
onShow: function () {
|
||||||
|
// 页面显示
|
||||||
|
},
|
||||||
|
onHide: function () {
|
||||||
|
// 页面隐藏
|
||||||
|
},
|
||||||
|
onUnload: function () {
|
||||||
|
// 页面关闭
|
||||||
|
}
|
||||||
|
})
|
1
app/pages/shop/show.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{}
|
22
app/pages/shop/show.wxml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
<!--pages/shop/show.wxml-->
|
||||||
|
<view class="shop-info weui-panel weui-panel_access">
|
||||||
|
<view class="weui-panel__bd">
|
||||||
|
<navigator url="" class="weui-media-box weui-media-box_appmsg" hover-class="shop-info_active">
|
||||||
|
<view class="weui-media-box__hd weui-media-box__hd_in-appmsg">
|
||||||
|
<image class="weui-media-box__thumb shop-info__pic" src="{{info.pic_url}}" />
|
||||||
|
</view>
|
||||||
|
<view class="weui-media-box__bd weui-media-box__bd_in-appmsg weui-cell__ft_in-access">
|
||||||
|
<view class="weui-media-box__title">{{info.seller_name}}</view>
|
||||||
|
<view class="weui-media-box__desc shop-info__desc">
|
||||||
|
{{info.min_price}}元起送 | {{info.delivery_fee}}元配送费 | {{info.reach_time}}分钟到达
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</navigator>
|
||||||
|
<view wx:if="{{info.promotion && info.promotion.length > 0}}" class="promotion">
|
||||||
|
<view wx:for="{{info.promotion}}" wx:key="index" class="promotion-item">
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
25
app/pages/shop/show.wxss
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
/* pages/shop/show.wxss */
|
||||||
|
|
||||||
|
.shop-info {
|
||||||
|
color: #fff;
|
||||||
|
background-color: #ff5801;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shop-info::before {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shop-info__desc {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shop-info__pic {
|
||||||
|
margin-right: 10px;
|
||||||
|
height: 60px;
|
||||||
|
width: 60px;
|
||||||
|
border: 5rpx solid #fff;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
.weui-cell__ft_in-access::after {
|
||||||
|
border-color: #fff;
|
||||||
|
}
|
5
app/templates/star-rate.wxml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<template name="star-rate">
|
||||||
|
<view class="star-rate">
|
||||||
|
<view wx:for="{{count || 5}}" wx:key="item" class="star-rate__item {{value > item ? 'star-rate__item_active': ''}}">★</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
9
app/templates/star-rate.wxss
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
.star-rate {
|
||||||
|
display: flex;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.star-rate__item_active {
|
||||||
|
color: #ffd700;
|
||||||
|
}
|
21
app/utils/util.js
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
function formatTime(date) {
|
||||||
|
var year = date.getFullYear()
|
||||||
|
var month = date.getMonth() + 1
|
||||||
|
var day = date.getDate()
|
||||||
|
|
||||||
|
var hour = date.getHours()
|
||||||
|
var minute = date.getMinutes()
|
||||||
|
var second = date.getSeconds()
|
||||||
|
|
||||||
|
|
||||||
|
return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatNumber(n) {
|
||||||
|
n = n.toString()
|
||||||
|
return n[1] ? n : '0' + n
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
formatTime: formatTime
|
||||||
|
}
|