Merge branch 'master' of https://bdgit.educoder.net/pu6ej7yq9/git
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Eslint config file
|
||||
* Documentation: https://eslint.org/docs/user-guide/configuring/
|
||||
* Install the Eslint extension before using this feature.
|
||||
*/
|
||||
module.exports = {
|
||||
env: {
|
||||
es6: true,
|
||||
browser: true,
|
||||
node: true,
|
||||
},
|
||||
ecmaFeatures: {
|
||||
modules: true,
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaVersion: 2018,
|
||||
sourceType: 'module',
|
||||
},
|
||||
globals: {
|
||||
wx: true,
|
||||
App: true,
|
||||
Page: true,
|
||||
getCurrentPages: true,
|
||||
getApp: true,
|
||||
Component: true,
|
||||
requirePlugin: true,
|
||||
requireMiniProgram: true,
|
||||
},
|
||||
// extends: 'eslint:recommended',
|
||||
rules: {},
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
# 云开发 quickstart
|
||||
|
||||
这是云开发的快速启动指引,其中演示了如何上手使用云开发的三大基础能力:
|
||||
|
||||
- 数据库:一个既可在小程序前端操作,也能在云函数中读写的 JSON 文档型数据库
|
||||
- 文件存储:在小程序前端直接上传/下载云端文件,在云开发控制台可视化管理
|
||||
- 云函数:在云端运行的代码,微信私有协议天然鉴权,开发者只需编写业务逻辑代码
|
||||
|
||||
## 参考文档
|
||||
|
||||
- [云开发文档](https://developers.weixin.qq.com/miniprogram/dev/wxcloud/basis/getting-started.html)
|
||||
|
@ -0,0 +1,62 @@
|
||||
{
|
||||
"pages": [
|
||||
"pages/login/login",
|
||||
"pages/index/index",
|
||||
"pages/fourm/fourm",
|
||||
"pages/submit/submit",
|
||||
"pages/cart/cart",
|
||||
"pages/usercenter/usercenter",
|
||||
"pages/detail/detail",
|
||||
"pages/searchShow/searchShow",
|
||||
"pages/change/change",
|
||||
"pages/answer/answer"
|
||||
|
||||
],
|
||||
"tabBar": {
|
||||
"custom": false,
|
||||
|
||||
"backgroundColor": "#ffffff",
|
||||
"borderStyle": "black",
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/index/index",
|
||||
"text": "首页",
|
||||
"iconPath": "/images/home.png",
|
||||
"selectedIconPath": "/images/home-active.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/fourm/fourm",
|
||||
"text": "论坛",
|
||||
"iconPath": "/images/message.png",
|
||||
"selectedIconPath": "/images/message-active.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/cart/cart",
|
||||
"text": "购物车",
|
||||
"iconPath": "/images/message.png",
|
||||
"selectedIconPath": "/images/message-active.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/usercenter/usercenter",
|
||||
"text": "我的",
|
||||
"iconPath": "/images/message.png",
|
||||
"selectedIconPath": "/images/message-active.png"
|
||||
}
|
||||
]
|
||||
|
||||
},
|
||||
"window": {
|
||||
"backgroundColor": "#F6F6F6",
|
||||
"backgroundTextStyle": "light",
|
||||
"navigationBarBackgroundColor": "#F6F6F6",
|
||||
"navigationBarTitleText": "节时不节食",
|
||||
"navigationBarTextStyle": "black"
|
||||
},
|
||||
"networkTimeout": {
|
||||
"request": 10000,
|
||||
"downloadFile": 10000
|
||||
},
|
||||
"debug": true,
|
||||
"sitemapLocation": "sitemap.json",
|
||||
"style": "v2"
|
||||
}
|
@ -0,0 +1,160 @@
|
||||
/**app.wxss**/
|
||||
.container {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 200rpx 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
button {
|
||||
background: initial;
|
||||
}
|
||||
|
||||
button:focus{
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
button::after{
|
||||
border: none;
|
||||
}
|
||||
|
||||
|
||||
page {
|
||||
background: #f6f6f6;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**app.wxss**/
|
||||
/* .container {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
/*padding: 200rpx 0;*/
|
||||
/* box-sizing: border-box;
|
||||
background: #F0F4F3;
|
||||
} */
|
||||
|
||||
.container.withtab{
|
||||
margin: 105rpx 0 0 0;
|
||||
/*top: 105rpx;*/
|
||||
}
|
||||
.flex-wrp{
|
||||
display: flex;
|
||||
}
|
||||
.flex-tab{
|
||||
flex-flow: row nowrap;
|
||||
justify-content: space-around;
|
||||
align-items: stretch;
|
||||
}
|
||||
.flex-item{
|
||||
flex-grow: 1;
|
||||
text-align: center;
|
||||
}
|
||||
.top-tab{
|
||||
width: 750rpx;
|
||||
height: 100rpx;
|
||||
background: #298DE5;
|
||||
color: #8CCEFD;
|
||||
font-size: 28rpx;
|
||||
line-height: 100rpx;
|
||||
box-shadow: 0 2px 2px #bebebe;
|
||||
margin: 0 0 8rpx 0;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
z-index: 9999;
|
||||
}
|
||||
.toptab.active{
|
||||
color: #ffffff;
|
||||
border-bottom: solid 2px #ffffff;
|
||||
}
|
||||
.container{
|
||||
padding: 0;
|
||||
font-size: 14rpx;
|
||||
color: #000;
|
||||
}
|
||||
.container .feed-item{
|
||||
width: 690rpx;
|
||||
padding: 30rpx 30rpx 20rpx;
|
||||
margin: 7rpx 0 6rpx 0;
|
||||
background: #ffffff;
|
||||
border-top: 1px solid #eee;
|
||||
border-bottom: 1px solid #eee;
|
||||
box-shadow: 0 2px 5px #eeeeee;
|
||||
}
|
||||
.container .feed-item .feed-source{
|
||||
width: 690rpx;
|
||||
left: 0;
|
||||
height: 50rpx;
|
||||
}
|
||||
.container .feed-item .feed-source .avatar{
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
.container .feed-item .feed-source a{
|
||||
display: inline-block;
|
||||
height: 40rpx;
|
||||
}
|
||||
.container .feed-item .feed-source .avatar image{
|
||||
/*position: absolute;*/
|
||||
display: inline-block;
|
||||
width: 45rpx;
|
||||
height: 45rpx;
|
||||
border-radius: 45rpx;
|
||||
top: 10rpx;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.container .feed-item .feed-source text{
|
||||
/*position: absolute;*/
|
||||
display: inline-block;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
vertical-align: middle;
|
||||
margin: 0 0 0 15rpx;
|
||||
color: #a0acac;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
.container .feed-item .feed-source .item-more{
|
||||
display: inline-block;
|
||||
width: 40rpx;
|
||||
height: 45rpx;
|
||||
float: right;
|
||||
}
|
||||
.container .feed-item .feed-content{
|
||||
padding: 10rpx 0 0 0;
|
||||
}
|
||||
.container .feed-item .feed-content .question text{
|
||||
font-size: 28rpx;
|
||||
font-weight: 600px;
|
||||
line-height: 40rpx;
|
||||
word-spacing: 5rpx;
|
||||
}
|
||||
.container .feed-item .feed-content .answer-body{
|
||||
padding: 10rpx 0 0 0;
|
||||
/*height: 10rpx;*/
|
||||
font-size: 24rpx;
|
||||
line-height: 28rpx;
|
||||
color: #5b5b5b;
|
||||
}
|
||||
.container .feed-item .feed-content .answer-actions{
|
||||
width: 690rpx;
|
||||
padding: 10rpx 0 0;
|
||||
color: #a0acac;
|
||||
}
|
||||
.container .feed-item .feed-content .answer-actions view{
|
||||
display: inline-block;
|
||||
vertical-align: text-bottom;
|
||||
padding: 0 10rpx 0 0;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.container .feed-item .feed-content .answer-actions .dot ::after{
|
||||
content: "•";
|
||||
}
|
After Width: | Height: | Size: 95 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 82 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 58 KiB |
After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 7.9 KiB |
After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.5 KiB |
After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 715 B After Width: | Height: | Size: 715 B |
After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.2 KiB |
@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "回答"
|
||||
}
|
@ -0,0 +1,300 @@
|
||||
/**answer.wxss**/
|
||||
.mycontainer{
|
||||
margin-bottom: 200rpx;
|
||||
}
|
||||
|
||||
.a {
|
||||
padding: 0;
|
||||
font-size: 14rpx;
|
||||
background: #F0F4F3;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.question {
|
||||
position: relative;
|
||||
width: 650rpx;
|
||||
padding: 40rpx 50rpx 30rpx;
|
||||
background: #298DE5;
|
||||
color: #fff;
|
||||
font-size: 38rpx;
|
||||
line-height: 48rpx;
|
||||
}
|
||||
.answerer-wrp{
|
||||
position: relative;
|
||||
width: 750rpx;
|
||||
height: 150rpx;
|
||||
background: #fff;
|
||||
}
|
||||
.answerer-wrp .bg-half{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 750rpx;
|
||||
height: 75rpx;
|
||||
background: #298DE5;
|
||||
}
|
||||
.answerer {
|
||||
position: relative;
|
||||
margin: 0 auto;
|
||||
width: 630rpx;
|
||||
height: 90rpx;
|
||||
padding: 30rpx;
|
||||
background: #fff;
|
||||
border: solid 1px #ebebeb;
|
||||
border-radius: 3px;
|
||||
box-shadow: 0 1px 2px #bebebe;
|
||||
}
|
||||
.answerer .avatar {
|
||||
flex: 1;
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
}
|
||||
|
||||
.answerer .avatar image {
|
||||
display: inline-block;
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
border-radius: 90rpx;
|
||||
}
|
||||
.answerer .answerer-info{
|
||||
flex: 5;
|
||||
text-align: left;
|
||||
padding: 10rpx 20rpx;
|
||||
line-height: 38rpx;
|
||||
}
|
||||
.answerer .answerer-info text{
|
||||
display: block;
|
||||
}
|
||||
.answerer .answerer-info .answerer-name{
|
||||
font-size: 32rpx;
|
||||
}
|
||||
.answerer .answerer-info .answerer-des{
|
||||
font-size: 22rpx;
|
||||
color: #808080;
|
||||
line-height: 28rpx;
|
||||
}
|
||||
|
||||
.answerer .follow image{
|
||||
/* flex: 2;
|
||||
padding: 15rpx 0;
|
||||
font-size: 22rpx; */
|
||||
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
.answerer .follow text{
|
||||
/* display: inline-block;
|
||||
padding: 15rpx 20rpx;
|
||||
color: #40bcd0;
|
||||
border: solid 2px #40bcd0;
|
||||
border-radius: 6rpx; */
|
||||
display: block;
|
||||
font-size: 14rpx;
|
||||
color: #bebebe;
|
||||
}
|
||||
.answerer .follow .a3{
|
||||
/* flex: 2;
|
||||
padding: 15rpx 0;
|
||||
font-size: 22rpx; */
|
||||
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
width: 30rpx;
|
||||
height: 35rpx;
|
||||
margin-top: 9rpx;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.answer-content{
|
||||
padding: 30rpx 40rpx;
|
||||
background: #ffffff;
|
||||
|
||||
}
|
||||
.answer-content text{
|
||||
font-size: 32rpx;
|
||||
color: #454545;
|
||||
line-height: 44rpx;
|
||||
word-break: break-all;
|
||||
}
|
||||
.answer-content image{
|
||||
width: 100%;
|
||||
margin: 20rpx 0;
|
||||
}
|
||||
.answer-footer{
|
||||
width: 750rpx;
|
||||
height: 70rpx;
|
||||
|
||||
font-size: 28rpx;
|
||||
|
||||
box-shadow: 0 100px 7px #bebebe;
|
||||
margin: 0 200rpx 0 0;
|
||||
|
||||
position: sticky ;
|
||||
bottom: 0;
|
||||
z-index: 9999;
|
||||
}
|
||||
.answer-footer{
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
height: 70rpx;
|
||||
border-top: solid 1px #ebebeb;
|
||||
background: #ffffff;
|
||||
width: 670rpx;
|
||||
padding: 20rpx 40rpx;
|
||||
}
|
||||
.answer-footer .good{
|
||||
flex: 1;
|
||||
/*display: inline-block;*/
|
||||
height: 40rpx;
|
||||
border: solid 1px #d1d1d1;
|
||||
border-radius: 3px;
|
||||
padding: 10rpx 8rpx;
|
||||
margin: 10rpx 0;
|
||||
}
|
||||
.answer-footer .good .good-bad{
|
||||
display: inline-block;
|
||||
}
|
||||
.answer-footer .good image{
|
||||
display: inline-block;
|
||||
width: 38rpx;
|
||||
height: 38rpx;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.answer-footer .good .good-num{
|
||||
display: inline-block;
|
||||
padding: 10rpx 4rpx;
|
||||
/*font-size: 24rpx;*/
|
||||
}
|
||||
.answer-footer .operation-wrp{
|
||||
flex: 5;
|
||||
}
|
||||
.answer-footer .operation{
|
||||
justify-content: space-between;
|
||||
padding: 0 0 0 60rpx;
|
||||
}
|
||||
.answer-footer .operation-btn{
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
}
|
||||
.answer-footer .operation image{
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
.answer-footer .operation-btn text{
|
||||
display: block;
|
||||
font-size: 14rpx;
|
||||
color: #bebebe;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* .tip{
|
||||
position: relative;
|
||||
width: 650rpx;
|
||||
padding: 30rpx 50rpx 30rpx;
|
||||
/*background: #298DE5;*/
|
||||
/* color: rgb(0, 0, 0);
|
||||
font-size: 38rpx;
|
||||
line-height: 48rpx;
|
||||
|
||||
} */
|
||||
|
||||
.input{
|
||||
display:block;
|
||||
border:2px solid gainsboro;
|
||||
margin-top: 60rpx;
|
||||
margin-bottom: 60rpx;
|
||||
}
|
||||
.pinglunItem{
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
border-top: 2px solid gainsboro;
|
||||
margin-left: 0rpx;
|
||||
margin-top: 0rpx;
|
||||
|
||||
}
|
||||
|
||||
.pinglunItem .a1{
|
||||
margin-left: 30rpx;
|
||||
margin-right: 30rpx;
|
||||
margin-top: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
border-radius: 90rpx;
|
||||
}
|
||||
.pinglunItem .desc{
|
||||
font-size: 30rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
.pinglunItem .a2 {
|
||||
margin-left: 100rpx;
|
||||
margin-right: 30rpx;
|
||||
margin-top: -20rpx;
|
||||
width: 30rpx;
|
||||
height: 35rpx;
|
||||
position: absolute; /* 要约束所在位置的子元素的位置要设置成绝对 */
|
||||
right: 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.search{
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 735rpx;
|
||||
height: 65rpx;
|
||||
padding: 12.5rpx 0 12.5rpx 15rpx;
|
||||
background: #2A8CE5;
|
||||
}
|
||||
.search-left{
|
||||
flex: 8;
|
||||
background: #4EA3E7;
|
||||
text-align: left;
|
||||
}
|
||||
.search-left input{
|
||||
display: inline-block;
|
||||
height: 65rpx;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
.search-placeholder{
|
||||
color: #8CCEFD;
|
||||
line-height: 20rpx;
|
||||
}
|
||||
.search .search-left image{
|
||||
display: inline-block;
|
||||
width: 35rpx;
|
||||
height: 35rpx;
|
||||
padding: 15rpx 15rpx 15rpx 20rpx;
|
||||
}
|
||||
.search .search-right{
|
||||
flex: 1;
|
||||
}
|
||||
.search .search-right .desc{
|
||||
font-size: 25rpx;
|
||||
color: #ffffff;
|
||||
margin:15rpx
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* 解决底部导航栏遮挡的占位view的样式 */
|
||||
.standView{
|
||||
width: 100%;
|
||||
height: 100rpx; /* 自定义一下需要的高度 */
|
||||
/* background-color: black; */
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
// pages/forum/forum.js
|
||||
// pages/cart/cart.js
|
||||
Page({
|
||||
|
||||
/**
|
@ -0,0 +1,2 @@
|
||||
<!--pages/cart/cart.wxml-->
|
||||
<text>pages/cart/cart.wxml</text>
|
@ -0,0 +1 @@
|
||||
/* pages/cart/cart.wxss */
|
@ -0,0 +1,25 @@
|
||||
<!--pages/change/change.wxml-->
|
||||
<!-- 用户自行修改数据的页面 -->
|
||||
<view class="wall-item">
|
||||
<!-- 内容 -->
|
||||
<textarea class="title" bindinput="change1"placeholder="{{change1}}" decode="{{true}}" value="{{feed.title}}" style="height: 25px;"></textarea>
|
||||
<textarea bindinput="change" style="white-space:pre-wrap;" value="{{feed.content}}" placeholder="{{change}}" data-aid="{{feed._id}}" class="content"></textarea>
|
||||
<!--帖子的图片-->
|
||||
<view class="img_box">
|
||||
<view class="imgs" wx:for="{{tempFilePaths}}" wx:key="index">
|
||||
<image src='{{item}}' bindlongpress="DeleteImg" bindtap="listenerButtonPreviewImage" data-index="{{index}}" mode='widthFix' />
|
||||
</view>
|
||||
<view class="imgs" wx:if="{{feed.url.length<3}}">
|
||||
<view class="images" bindtap="chooseImage">
|
||||
<image src='../../images/upload.png' mode='widthFix' />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 确认修改 -->
|
||||
<button class="publish" bindtap="sure">确认修改</button>
|
@ -0,0 +1,73 @@
|
||||
/* pages/change/change.wxss */
|
||||
.title{
|
||||
font-size: 38rpx;
|
||||
display: flex;
|
||||
margin-top: 25rpx;
|
||||
|
||||
padding: 13px 0;
|
||||
margin-bottom: 30rpx;
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
.content{
|
||||
margin-bottom: 30rpx;
|
||||
border-bottom: 1px solid #ccc;
|
||||
padding-right: 50rpx;
|
||||
margin-top: 30rpx;
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 550rpx !important;
|
||||
box-sizing: border-box;
|
||||
font-size: 32rpx;
|
||||
color: #454545;
|
||||
line-height: 44rpx;
|
||||
/*word-break: break-all;*/
|
||||
}
|
||||
.picker{
|
||||
|
||||
display: flex;
|
||||
padding: 13px 0;
|
||||
margin-bottom: 35rpx;
|
||||
border-bottom: 1px solid #ccc;
|
||||
|
||||
}
|
||||
.img_box{
|
||||
position:relative;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin:0 auto;
|
||||
}
|
||||
.imgs{
|
||||
width:33.33333333%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-bottom:20rpx;
|
||||
}
|
||||
.imgs image{
|
||||
width:90%;
|
||||
max-height:212rpx;
|
||||
border:1px solid rgba(214, 212, 212, 0.1);
|
||||
/* box-shadow: 5rpx 5rpx 1rpx 3rpx #e2e0e0; */
|
||||
}
|
||||
.imgs .images{
|
||||
position:relative;
|
||||
}
|
||||
.images button{
|
||||
width:100%;
|
||||
height:100%;
|
||||
position:absolute;
|
||||
top:0;
|
||||
left:0;
|
||||
}
|
||||
.img_box .images{
|
||||
width:90%;
|
||||
height: 212rpx;
|
||||
border:1px solid #E8E8E8;
|
||||
border-radius:4rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.img_box .images>image{
|
||||
width:60rpx;
|
||||
height:60rpx;
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
<view class="container" >
|
||||
|
||||
<image src="{{detailObj.url}}"></image>
|
||||
<view class="detail" >
|
||||
<text class="title">{{detailObj.food_name}}</text>
|
||||
<text>{{detailObj.food_shop}}</text>
|
||||
<text class="price">¥{{detailObj.price}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="separate"></view>
|
||||
<!-- sku选择 -->
|
||||
<text bindtap="toggleDialog">请选择购买数量</text>
|
||||
<view class="separate"></view>
|
||||
<text>商品评价</text>
|
||||
<text class="text-remark">东西还可以,好评~</text>
|
||||
<view class="separate"></view>
|
||||
<view class="detail-nav" data-foodid="{{detailObj._id}}" >
|
||||
<button class="button-green" bindtap="addCar" formType="submit" >加入购物车</button>
|
||||
<button class="button-red" bindtap="immeBuy" formType="submit">立即购买</button>
|
||||
</view>
|
@ -0,0 +1,23 @@
|
||||
/* pages/detail/detail.wxss */
|
||||
page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
.detail {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-top: 15rpx;
|
||||
margin-bottom: 0rpx;
|
||||
}
|
||||
.detail .title {
|
||||
font-size: 40rpx;
|
||||
margin: 10rpx;
|
||||
color: black;
|
||||
text-align: justify;
|
||||
}
|
||||
.detail .price {
|
||||
color: red;
|
||||
font-size: 40rpx;
|
||||
margin: 10rpx;
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
<!--pages/fourm/fourm.wxml-->
|
||||
|
||||
<scroll-view scroll-y="true" class="container" bindscrolltoupper="upper" upper-threshold="10" lower-threshold="5" bindscrolltolower="lower" scroll-into-view="{{toView}}" scroll-top="{{scrollTop}}">
|
||||
<view class="search flex-wrp">
|
||||
<view class="search-left flex-item">
|
||||
|
||||
<input placeholder="点击右侧闪电发帖" placeholder-class="search-placeholder"/>
|
||||
</view>
|
||||
<view class="search-right flex-item" bindtap="goto">
|
||||
<image src="../../images/lighting.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="sousuokuang">
|
||||
<view class="sousuo">
|
||||
<view class="shurukuang">
|
||||
<input placeholder="搜索" value="{{inputValue}}" bindinput="GetSearchInput"></input>
|
||||
</view>
|
||||
<view class="sousuo_anniu" bindtap="ToSearch">
|
||||
<text>搜索</text>
|
||||
<icon type="search" size="20"></icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
<block wx:for="{{feed}}" wx:for-index="idx" wx:for-item="item" data-idx="{{idx}}">
|
||||
<view class="feed-item">
|
||||
<view class="feed-source">
|
||||
<a class="">
|
||||
<view class="avatar">
|
||||
<image src="{{item.feed_source_img}}"></image>
|
||||
<!--<open-data type="userAvatarUrl"></open-data>-->
|
||||
|
||||
</view>
|
||||
<text>{{item.feed_source_name}}</text>
|
||||
<!-- <open-data type="userNickName"></open-data>-->
|
||||
</a>
|
||||
<image class="item-more" mode="aspectFit" bindtap="delete_p" data-aid="{{item._id}}" src="../../images/more.png"></image>
|
||||
</view>
|
||||
<view class="feed-content">
|
||||
<view class="question" bindtap="bindItemTap" data-aid="{{item._id}}">
|
||||
<a class="question-link">
|
||||
<text>{{item.title}}</text>
|
||||
</a>
|
||||
</view>
|
||||
<view class="answer-body">
|
||||
<view >
|
||||
<text class="answer-txt" bindtap="bindItemTap" data-aid="{{item._id}}">{{item.content}}</text>
|
||||
</view>
|
||||
<view class="answer-actions" bindtap="bindItemTap">
|
||||
<view class="like dot">
|
||||
<a>{{item.good_num}} 赞同 </a>
|
||||
</view>
|
||||
<view class="follow-it">
|
||||
<text decode="{{true}}">  </text>
|
||||
</view>
|
||||
<view class="comments dot">
|
||||
<a>{{item.comment_num}} 评论 </a>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<view class="loading" hidden="{{!loadMore}}">正在载入更多...</view>
|
||||
<view class="loading" hidden="{{!loadAll}}">已加载全部</view>
|
||||
</scroll-view>
|
@ -0,0 +1,110 @@
|
||||
/* pages/fourm/fourm.wxss */
|
||||
/**index.wxss**/
|
||||
|
||||
.container{
|
||||
height: 1500rpx;
|
||||
}
|
||||
.container .search{
|
||||
width: 735rpx;
|
||||
height: 65rpx;
|
||||
padding: 12.5rpx 0 12.5rpx 15rpx;
|
||||
background: #2A8CE5;
|
||||
}
|
||||
.container .search-left{
|
||||
flex: 8;
|
||||
background: #4EA3E7;
|
||||
text-align: left;
|
||||
}
|
||||
.container .search-left input{
|
||||
display: inline-block;
|
||||
height: 65rpx;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
.search-placeholder{
|
||||
color: #8CCEFD;
|
||||
line-height: 20rpx;
|
||||
}
|
||||
.container .search .search-left image{
|
||||
display: inline-block;
|
||||
width: 35rpx;
|
||||
height: 35rpx;
|
||||
padding: 15rpx 15rpx 15rpx 20rpx;
|
||||
}
|
||||
.container .search .search-right{
|
||||
flex: 1;
|
||||
}
|
||||
.container .search .search-right image{
|
||||
width: 45rpx;
|
||||
height: 45rpx;
|
||||
padding: 10rpx;
|
||||
}
|
||||
|
||||
.container{
|
||||
padding: 0;
|
||||
font-size: 14rpx;
|
||||
background: #F0F4F3;
|
||||
color: #000;
|
||||
}
|
||||
/*feed-item part is in app.wxss for multiplexing*/
|
||||
.answer-txt{
|
||||
width:700rpx;
|
||||
height:49rpx;
|
||||
font-size:25rpx;
|
||||
overflow:hidden;
|
||||
text-overflow: ellipsis;
|
||||
display:-webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
.loading {
|
||||
font-size: 32rpx;
|
||||
position: relative;
|
||||
bottom: 5rpx;
|
||||
padding: 10rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.sousuokuang {
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
background-color: white;
|
||||
}
|
||||
.sousuo {
|
||||
width: 92%;
|
||||
height: 100rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-items: center;
|
||||
}
|
||||
.shurukuang {
|
||||
width: 80%;
|
||||
height: 64rpx;
|
||||
border-radius: 32rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #f6f6f6;
|
||||
}
|
||||
.shurukuang input {
|
||||
width: 90%;
|
||||
height: 100%;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
.sousuo_anniu {
|
||||
width: 20%;
|
||||
height: 64rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.sousuo_anniu text {
|
||||
font-size: 30rpx;
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,162 @@
|
||||
page {
|
||||
background: #ffffff;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/*分割线样式*/
|
||||
.divLine{
|
||||
background: #E0E3DA;
|
||||
width: 100%;
|
||||
height: 5rpx;
|
||||
}
|
||||
|
||||
.navbar {
|
||||
|
||||
width: 100%;
|
||||
height: 90rpx;
|
||||
/* 文本不换行 */
|
||||
white-space: nowrap;
|
||||
display: flex;
|
||||
box-sizing: border-box;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
background: #fff;
|
||||
align-items: center;
|
||||
/* 固定在顶部 */
|
||||
}
|
||||
.nav-item {
|
||||
line-height: 60rpx;
|
||||
background-color: #f7f7f7;
|
||||
padding-left: 25rpx;
|
||||
padding-right: 25rpx;
|
||||
height: 100%;
|
||||
display: inline-table;
|
||||
/* 普通文字大小 */
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.nav-text {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
letter-spacing: 4rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.tab-on {
|
||||
color: #000080;
|
||||
/* 选中放大 */
|
||||
font-size: 38rpx !important;
|
||||
font-weight: 600;
|
||||
border-bottom: 4rpx solid #000080 !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.P_input {
|
||||
position: relative;
|
||||
}
|
||||
.P_input input {
|
||||
background: white;
|
||||
border-radius: 40rpx;
|
||||
width: 90%;
|
||||
padding: 10rpx 0;
|
||||
padding-left: 40rpx;
|
||||
margin: 40rpx 0 5% 20rpx;
|
||||
}
|
||||
.P_input image {
|
||||
position: absolute;
|
||||
z-index: 999999;
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
padding: 6rpx 20rpx;
|
||||
right: 20rpx;
|
||||
top: 12rpx;
|
||||
}
|
||||
.imagesize {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 650rpx;
|
||||
margin-left: 50rpx;
|
||||
margin-right: 50rpx;
|
||||
|
||||
}
|
||||
|
||||
.imagesize select {
|
||||
|
||||
height: 50rpx;
|
||||
width: 350rpx;
|
||||
}
|
||||
|
||||
.imagesize select2 {
|
||||
height: 180rpx;
|
||||
width: 350rpx;
|
||||
}
|
||||
.foodist{
|
||||
margin-top:10px;
|
||||
}
|
||||
|
||||
.foodlist .a .img{
|
||||
float:left;
|
||||
width:40%;
|
||||
height:100%;
|
||||
}
|
||||
.foodlist .a .img image{
|
||||
width:200rpx;
|
||||
height:200rpx;
|
||||
}
|
||||
.foodlist .a .info{
|
||||
width:59%;
|
||||
float:right;
|
||||
height:100px;
|
||||
position:relative;
|
||||
}
|
||||
.foodlist .a .info .title{
|
||||
color:#333;
|
||||
margin-left:10px;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.foodlist .a .info .price{
|
||||
color:#FF2727;
|
||||
margin-left:10px;
|
||||
margin-top:10px;
|
||||
font-size:15px;
|
||||
}
|
||||
|
||||
.foodlist .a .info .num{
|
||||
position: absolute;
|
||||
left:0px;
|
||||
bottom:10px;
|
||||
color:#747474;
|
||||
margin-left:10px;
|
||||
font-size:15px;
|
||||
}
|
||||
.clear{
|
||||
clear: both;
|
||||
overflow: hidden;
|
||||
}
|
||||
navigator{
|
||||
display:inline;
|
||||
}
|
||||
|
||||
.nav {
|
||||
position: fixed;
|
||||
background: white;
|
||||
color: #353535;
|
||||
z-index: 999999;
|
||||
max-height: 94rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.scroll-view-containner{
|
||||
display: flex;
|
||||
text-align: center;
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
// pages/login/login.js
|
||||
Page({
|
||||
data:{
|
||||
userInfo:'',
|
||||
avatarUrl:'',
|
||||
nickName:''
|
||||
},
|
||||
onLoad(){
|
||||
/*
|
||||
let user=wx.getStorageSync('user')
|
||||
this.setData({
|
||||
userInfo:user
|
||||
})
|
||||
wx.switchTab({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
*/
|
||||
},
|
||||
login(){
|
||||
let that = this;
|
||||
console.log('点击事件执行了')
|
||||
wx.getUserProfile({
|
||||
desc: '必须授权才能使用',
|
||||
success:res=>{
|
||||
let user=res.userInfo
|
||||
let avatarUrl=res.userInfo.avatarUrl
|
||||
let nickName=res.userInfo.nickName
|
||||
|
||||
wx.setStorageSync('user', user)
|
||||
wx.setStorageSync('avatarUrl', avatarUrl)
|
||||
wx.setStorageSync('nickName', nickName)
|
||||
console.log('成功',res)
|
||||
wx.cloud.database().collection('user').where({
|
||||
nickName:nickName
|
||||
}).get().then(res => {
|
||||
if (!res.data.length) {
|
||||
// 没有存在同样的内容
|
||||
wx.cloud.database().collection('user').add({
|
||||
data: {
|
||||
userInfo:user,
|
||||
avatarUrl:user.avatarUrl,
|
||||
nickName:user.nickName
|
||||
}
|
||||
})
|
||||
}
|
||||
else{
|
||||
console.log('该用户已存在')
|
||||
}
|
||||
})
|
||||
// wx.cloud.database().collection('user').add({
|
||||
// data: {
|
||||
// userInfo:user,
|
||||
// avatarUrl:user.avatarUrl,
|
||||
// nickName:user.nickName
|
||||
// }
|
||||
// })
|
||||
},fall:res=>{
|
||||
console.log('失败',res)
|
||||
}
|
||||
})
|
||||
wx.switchTab({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
},
|
||||
nologin(){
|
||||
this.setData({
|
||||
userInfo:''
|
||||
})
|
||||
wx.setStorageSync('user', null)
|
||||
},
|
||||
})
|
@ -0,0 +1,13 @@
|
||||
<!--pages/login/login.wxml-->
|
||||
<!--登录-->
|
||||
<button wx:if="{{!userInfo}}" bindtap="login">登录</button>
|
||||
<view wx:else class="root">
|
||||
<image class="touxiang" src="{{userInfo.avatarUrl}}"></image>
|
||||
<text class="nicheng">{{userInfo.nickName}}</text>
|
||||
</view>
|
||||
<!--退出登录-->
|
||||
<view wx:if="{{userInfo}}">
|
||||
<button bindtap="nologin" >
|
||||
<text>退出登录</text>
|
||||
</button>
|
||||
</view>
|
@ -0,0 +1,17 @@
|
||||
/* pages/login/login.wxss */
|
||||
.button{
|
||||
display: flex;
|
||||
align-items:center;
|
||||
justify-content:center;
|
||||
}
|
||||
.touxiang {
|
||||
width: 150rpx;
|
||||
height: 150rpx;
|
||||
border-radius: 50%;
|
||||
margin-top: 20rpx;
|
||||
margin-bottom: 10rpx;
|
||||
margin-left: 40%;
|
||||
}
|
||||
.nicheng{
|
||||
color:white;
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
// pages/searchShow/searchShow.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
onLoad: function(options) {
|
||||
console.log("1")
|
||||
console.log(JSON.parse(options.re),"1")
|
||||
let re = JSON.parse(options.re);
|
||||
let that = this
|
||||
that.setData({
|
||||
re: re
|
||||
})
|
||||
console.log(re)
|
||||
},
|
||||
bindItemTap: function(event) {
|
||||
/*wx.navigateTo({
|
||||
url: '../answer/answer'
|
||||
})*/
|
||||
var aid=event.currentTarget.dataset.aid;
|
||||
console.log(aid)
|
||||
//console.log("1")
|
||||
wx.navigateTo({
|
||||
url: '../answer/answer?aid='+aid,//要跳转到的页面路径
|
||||
})
|
||||
}
|
||||
|
||||
})
|
@ -0,0 +1,45 @@
|
||||
<!--pages/searchShow/searchShow.wxml-->
|
||||
|
||||
<scroll-view scroll-y="true" class="container" bindscrolltoupper="upper" upper-threshold="10" lower-threshold="5" bindscrolltolower="lower" scroll-into-view="{{toView}}" scroll-top="{{scrollTop}}">
|
||||
<!-- 搜索结果展示 -->
|
||||
<block wx:for="{{re}}" wx:for-index="idx" wx:for-item="item" data-idx="{{idx}}">
|
||||
<view class="feed-item">
|
||||
<view class="feed-source">
|
||||
<a class="">
|
||||
<view class="avatar">
|
||||
<image src="{{item.feed_source_img}}"></image>
|
||||
<!--<open-data type="userAvatarUrl"></open-data>-->
|
||||
|
||||
</view>
|
||||
<text>{{item.feed_source_name}}</text>
|
||||
<!-- <open-data type="userNickName"></open-data>-->
|
||||
</a>
|
||||
<image class="item-more" mode="aspectFit" src="../../images/more.png"></image>
|
||||
</view>
|
||||
<view class="feed-content">
|
||||
<view class="question" bindtap="bindItemTap" data-aid="{{item._id}}">
|
||||
<a class="question-link">
|
||||
<text>{{item.title}}</text>
|
||||
</a>
|
||||
</view>
|
||||
<view class="answer-body">
|
||||
<view >
|
||||
<text class="answer-txt" bindtap="bindItemTap" data-aid="{{item._id}}">{{item.content}}</text>
|
||||
</view>
|
||||
<view class="answer-actions" bindtap="bindItemTap">
|
||||
<view class="like dot">
|
||||
<a>{{item.good_num}} 赞同 </a>
|
||||
</view>
|
||||
<view class="follow-it">
|
||||
<text decode="{{true}}">  </text>
|
||||
</view>
|
||||
<view class="comments dot">
|
||||
<a>{{item.comment_num}} 评论 </a>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</scroll-view>
|
@ -0,0 +1,10 @@
|
||||
.answer-txt{
|
||||
width:700rpx;
|
||||
height:49rpx;
|
||||
font-size:25rpx;
|
||||
overflow:hidden;
|
||||
text-overflow: ellipsis;
|
||||
display:-webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
<!--pages/usercenter/usercenter.wxml-->
|
||||
<view wx:if="{{isHide}}">
|
||||
<view wx:if="{{canIUse}}">
|
||||
<view class='header'>
|
||||
<image class="touxiang" src="{{userInfo.avatarUrl}}"></image>
|
||||
<text class="nicheng">{{userInfo.nickName}}</text>
|
||||
<image src='/static/images/weixin_1.png'></image>
|
||||
</view>
|
||||
|
||||
<view class='content'>
|
||||
<view>申请获取以下权限</view>
|
||||
<text>获得你的公开信息(昵称,头像等)</text>
|
||||
</view>
|
||||
|
||||
<button class='bottom' type='primary' open-type="getUserInfo" lang="zh_CN" bindgetuserinfo="bindGetUserInfo">
|
||||
授权登录
|
||||
</button>
|
||||
</view>
|
||||
<view wx:else>请升级微信版本</view>
|
||||
</view>
|
||||
|
||||
<view wx:else>
|
||||
<view class="userinfo">
|
||||
<image bindtap="bindViewTap" class="userinfo-avatar" src="{{avatarUrl}}" background-size="cover"></image>
|
||||
<text class="userinfo-nickname">{{nickName}}</text>
|
||||
</view>
|
||||
|
||||
<view class="hr"></view>
|
||||
<view class='item'>
|
||||
<view class="title">手机绑定</view>
|
||||
<view class="detail2">
|
||||
<text>></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
|
||||
<view class='item'>
|
||||
<view class="title">写博客</view>
|
||||
<view class="detail2">
|
||||
<text>></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="hr"></view>
|
||||
<view class='item'>
|
||||
<view class="title">我的博客</view>
|
||||
<view class="detail2">
|
||||
<text> ></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="item">
|
||||
<view class="title">我的收藏</view>
|
||||
<view class="detail2">
|
||||
<text> ></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="item">
|
||||
<view class="title">意见反馈</view>
|
||||
<view class="detail2">
|
||||
<text> ></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="item">
|
||||
<view class="title">设置</view>
|
||||
<view class="detail2">
|
||||
<text> ></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="hr"></view>
|
||||
</view>
|
@ -0,0 +1,83 @@
|
||||
/* pages/mine/mine.wxss */
|
||||
.userinfo {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
background: #eb6161;
|
||||
width: 100%;
|
||||
height: 300rpx;
|
||||
}
|
||||
|
||||
.userinfo-avatar {
|
||||
width: 128rpx;
|
||||
height: 128rpx;
|
||||
margin: 20rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.userinfo-nickname {
|
||||
color: black;
|
||||
}
|
||||
|
||||
.header {
|
||||
margin: 90rpx 0 90rpx 50rpx;
|
||||
border-bottom: 1px solid #ccc;
|
||||
text-align: center;
|
||||
width: 650rpx;
|
||||
height: 300rpx;
|
||||
line-height: 450rpx;
|
||||
}
|
||||
|
||||
.header image {
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
}
|
||||
|
||||
.content {
|
||||
margin-left: 50rpx;
|
||||
margin-bottom: 90rpx;
|
||||
}
|
||||
|
||||
.content text {
|
||||
display: block;
|
||||
color: #9d9d9d;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.bottom {
|
||||
border-radius: 80rpx;
|
||||
margin: 70rpx 50rpx;
|
||||
font-size: 35rpx;
|
||||
}
|
||||
|
||||
/* 用户中心 */
|
||||
|
||||
.hr {
|
||||
width: 100%;
|
||||
height: 15px;
|
||||
background-color: #f4f5f6;
|
||||
}
|
||||
.item {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
.title {
|
||||
padding-top: 15px;
|
||||
padding-bottom: 15px;
|
||||
padding-left: 15px;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.detail2 {
|
||||
font-size: 15px;
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.line {
|
||||
border: 1px solid #ccc;
|
||||
opacity: 0.2;
|
||||
}
|
@ -0,0 +1,81 @@
|
||||
{
|
||||
"miniprogramRoot": "",
|
||||
"cloudfunctionRoot": "cloudfunctions/",
|
||||
"setting": {
|
||||
"urlCheck": true,
|
||||
"es6": true,
|
||||
"enhance": true,
|
||||
"postcss": true,
|
||||
"preloadBackgroundData": false,
|
||||
"minified": true,
|
||||
"newFeature": true,
|
||||
"coverView": true,
|
||||
"nodeModules": false,
|
||||
"autoAudits": false,
|
||||
"showShadowRootInWxmlPanel": true,
|
||||
"scopeDataCheck": false,
|
||||
"uglifyFileName": false,
|
||||
"checkInvalidKey": true,
|
||||
"checkSiteMap": true,
|
||||
"uploadWithSourceMap": true,
|
||||
"compileHotReLoad": false,
|
||||
"lazyloadPlaceholderEnable": false,
|
||||
"useMultiFrameRuntime": true,
|
||||
"useApiHook": true,
|
||||
"useApiHostProcess": true,
|
||||
"babelSetting": {
|
||||
"ignore": [],
|
||||
"disablePlugins": [],
|
||||
"outputPath": ""
|
||||
},
|
||||
"enableEngineNative": false,
|
||||
"useIsolateContext": true,
|
||||
"userConfirmedBundleSwitch": false,
|
||||
"packNpmManually": false,
|
||||
"packNpmRelationList": [],
|
||||
"minifyWXSS": true,
|
||||
"disableUseStrict": false,
|
||||
"showES6CompileOption": false,
|
||||
"useCompilerPlugins": false,
|
||||
"minifyWXML": true,
|
||||
"ignoreDevUnusedFiles": false,
|
||||
"ignoreUploadUnusedFiles": false
|
||||
},
|
||||
"appid": "wxcc745ea897810e52",
|
||||
"projectname": "quickstart-wx-cloud",
|
||||
"libVersion": "2.14.1",
|
||||
"cloudfunctionTemplateRoot": "cloudfunctionTemplate/",
|
||||
"condition": {
|
||||
"search": {
|
||||
"list": []
|
||||
},
|
||||
"conversation": {
|
||||
"list": []
|
||||
},
|
||||
"plugin": {
|
||||
"list": []
|
||||
},
|
||||
"game": {
|
||||
"list": []
|
||||
},
|
||||
"miniprogram": {
|
||||
"list": [
|
||||
{
|
||||
"id": -1,
|
||||
"name": "db guide",
|
||||
"pathName": "pages/databaseGuide/databaseGuide"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"srcMiniprogramRoot": "miniprogram/",
|
||||
"compileType": "miniprogram",
|
||||
"packOptions": {
|
||||
"ignore": [],
|
||||
"include": []
|
||||
},
|
||||
"editorSetting": {
|
||||
"tabIndent": "insertSpaces",
|
||||
"tabSize": 2
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
|
||||
"rules": [{
|
||||
"action": "allow",
|
||||
"page": "*"
|
||||
"action": "allow",
|
||||
"page": "*"
|
||||
}]
|
||||
}
|
@ -0,0 +1 @@
|
||||
"D:\小程序\微信web开发者工具\cli.bat" cloud functions deploy --e cloud1-8g5wmepxce8a3b8a --n quickstartFunctions --r --project "D:\桌面\大三\软工课设\food" --report_first --report
|
@ -0,0 +1,67 @@
|
||||
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
|
||||
};
|
||||
/*
|
||||
var index = require('../data/data_index.js')
|
||||
var index_next = require('../data/data_index_next.js')
|
||||
|
||||
function getData(url){
|
||||
return new Promise(function(resolve, reject){
|
||||
wx.request({
|
||||
url: url,
|
||||
data: {},
|
||||
header: {
|
||||
//'Content-Type': 'application/json'
|
||||
},
|
||||
success: function(res) {
|
||||
console.log("success")
|
||||
resolve(res)
|
||||
},
|
||||
fail: function (res) {
|
||||
reject(res)
|
||||
console.log("failed")
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function getData2(){
|
||||
return index.index;
|
||||
}
|
||||
|
||||
function getNext(){
|
||||
return index_next.next;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
module.exports.getData = getData;
|
||||
module.exports.getData2 = getData2;
|
||||
module.exports.getNext = getNext;
|
||||
module.exports.getDiscovery = getDiscovery;
|
||||
module.exports.discoveryNext = discoveryNext;
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
@ -0,0 +1,51 @@
|
||||
# weapp-wechat-zhihu
|
||||
|
||||
微信中的知乎--微信小程序 demo // Zhihu in Wechat
|
||||
|
||||

|
||||
|
||||
### description
|
||||
- 界面及交互设计来自知乎 Android 版本
|
||||
- _工具_: [微信 web 开发者工具](https://mp.weixin.qq.com/debug/wxadoc/dev/devtools/download.html?t=1477579747265)
|
||||
- _数据_: 没有开放 API, 所以使用伪造本地数据
|
||||
|
||||
#### 功能及使用的组件等
|
||||
* 列表式渲染数据
|
||||
* 自定义顶部 tabbar
|
||||
* 下拉刷新
|
||||
* 上拉加载更多
|
||||
* 轮播图
|
||||
<br/>等...
|
||||
|
||||
### Setup
|
||||
|
||||
```
|
||||
git@github.com:RebeccaHanjw/weapp-wechat-zhihu.git
|
||||
```
|
||||
下载安装Wechat DEV Tools, 并导入项目
|
||||
|
||||
### 演示
|
||||
|
||||
首页下拉刷新等
|
||||
|
||||

|
||||
|
||||
底部 tab 切换
|
||||
|
||||

|
||||
|
||||
顶部自定义 tab 切换
|
||||
|
||||

|
||||
|
||||
页面跳转
|
||||
|
||||

|
||||
|
||||
|
||||
##### Demo 用于学习交流, 转载请注明出处
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,35 @@
|
||||
//app.js
|
||||
App({
|
||||
onLaunch: function () {
|
||||
wx.cloud.init({
|
||||
env:"cloud1-8g5wmepxce8a3b8a",
|
||||
traceUser:true//是否访问权限可见
|
||||
})}})
|
||||
/*
|
||||
//调用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
|
||||
}
|
||||
})*/
|
@ -0,0 +1,44 @@
|
||||
{
|
||||
"pages":[
|
||||
"pages/login/login",
|
||||
"pages/index/index",
|
||||
"pages/submit/submit",
|
||||
"pages/notify/notify",
|
||||
"pages/searchShow/searchShow",
|
||||
"pages/change/change",
|
||||
"pages/answer/answer"
|
||||
],
|
||||
"window":{
|
||||
"backgroundTextStyle":"light",
|
||||
"navigationBarBackgroundColor": "#0068C4",
|
||||
"navigationBarTitleText": "论坛",
|
||||
"navigationBarTextStyle":"white",
|
||||
"enablePullDownRefresh":true
|
||||
},
|
||||
"tabBar": {
|
||||
"color": "#626567",
|
||||
"selectedColor": "#2A8CE5",
|
||||
"backgroundColor": "#FBFBFB",
|
||||
"borderStyle": "white",
|
||||
"list": [{
|
||||
"pagePath": "pages/index/index",
|
||||
"text": "",
|
||||
"iconPath": "images/index.png",
|
||||
"selectedIconPath": "images/index_focus.png"
|
||||
},{
|
||||
"pagePath": "pages/notify/notify",
|
||||
"text": "",
|
||||
"iconPath": "images/ring.png",
|
||||
"selectedIconPath": "images/ring_focus.png"
|
||||
}
|
||||
|
||||
]
|
||||
},
|
||||
"networkTimeout": {
|
||||
"request": 10000,
|
||||
"downloadFile": 10000
|
||||
},
|
||||
"debug": true,
|
||||
"style": "v2",
|
||||
"sitemapLocation": "sitemap.json"
|
||||
}
|
@ -0,0 +1,127 @@
|
||||
/**app.wxss**/
|
||||
.container {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
/*padding: 200rpx 0;*/
|
||||
box-sizing: border-box;
|
||||
background: #F0F4F3;
|
||||
}
|
||||
|
||||
.container.withtab{
|
||||
margin: 105rpx 0 0 0;
|
||||
/*top: 105rpx;*/
|
||||
}
|
||||
.flex-wrp{
|
||||
display: flex;
|
||||
}
|
||||
.flex-tab{
|
||||
flex-flow: row nowrap;
|
||||
justify-content: space-around;
|
||||
align-items: stretch;
|
||||
}
|
||||
.flex-item{
|
||||
flex-grow: 1;
|
||||
text-align: center;
|
||||
}
|
||||
.top-tab{
|
||||
width: 750rpx;
|
||||
height: 100rpx;
|
||||
background: #298DE5;
|
||||
color: #8CCEFD;
|
||||
font-size: 28rpx;
|
||||
line-height: 100rpx;
|
||||
box-shadow: 0 2px 2px #bebebe;
|
||||
margin: 0 0 8rpx 0;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
z-index: 9999;
|
||||
}
|
||||
.toptab.active{
|
||||
color: #ffffff;
|
||||
border-bottom: solid 2px #ffffff;
|
||||
}
|
||||
.container{
|
||||
padding: 0;
|
||||
font-size: 14rpx;
|
||||
color: #000;
|
||||
}
|
||||
.container .feed-item{
|
||||
width: 690rpx;
|
||||
padding: 30rpx 30rpx 20rpx;
|
||||
margin: 7rpx 0 6rpx 0;
|
||||
background: #ffffff;
|
||||
border-top: 1px solid #eee;
|
||||
border-bottom: 1px solid #eee;
|
||||
box-shadow: 0 2px 5px #eeeeee;
|
||||
}
|
||||
.container .feed-item .feed-source{
|
||||
width: 690rpx;
|
||||
left: 0;
|
||||
height: 50rpx;
|
||||
}
|
||||
.container .feed-item .feed-source .avatar{
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
.container .feed-item .feed-source a{
|
||||
display: inline-block;
|
||||
height: 40rpx;
|
||||
}
|
||||
.container .feed-item .feed-source .avatar image{
|
||||
/*position: absolute;*/
|
||||
display: inline-block;
|
||||
width: 45rpx;
|
||||
height: 45rpx;
|
||||
border-radius: 45rpx;
|
||||
top: 10rpx;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.container .feed-item .feed-source text{
|
||||
/*position: absolute;*/
|
||||
display: inline-block;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
vertical-align: middle;
|
||||
margin: 0 0 0 15rpx;
|
||||
color: #a0acac;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
.container .feed-item .feed-source .item-more{
|
||||
display: inline-block;
|
||||
width: 40rpx;
|
||||
height: 45rpx;
|
||||
float: right;
|
||||
}
|
||||
.container .feed-item .feed-content{
|
||||
padding: 10rpx 0 0 0;
|
||||
}
|
||||
.container .feed-item .feed-content .question text{
|
||||
font-size: 28rpx;
|
||||
font-weight: 600px;
|
||||
line-height: 40rpx;
|
||||
word-spacing: 5rpx;
|
||||
}
|
||||
.container .feed-item .feed-content .answer-body{
|
||||
padding: 10rpx 0 0 0;
|
||||
/*height: 10rpx;*/
|
||||
font-size: 24rpx;
|
||||
line-height: 28rpx;
|
||||
color: #5b5b5b;
|
||||
}
|
||||
.container .feed-item .feed-content .answer-actions{
|
||||
width: 690rpx;
|
||||
padding: 10rpx 0 0;
|
||||
color: #a0acac;
|
||||
}
|
||||
.container .feed-item .feed-content .answer-actions view{
|
||||
display: inline-block;
|
||||
vertical-align: text-bottom;
|
||||
padding: 0 10rpx 0 0;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.container .feed-item .feed-content .answer-actions .dot ::after{
|
||||
content: "•";
|
||||
}
|
After Width: | Height: | Size: 103 KiB |
After Width: | Height: | Size: 141 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 95 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 230 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 473 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 82 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 58 KiB |
After Width: | Height: | Size: 3.3 KiB |