├── component
├── bottomLoadMore
│ ├── loading.json
│ ├── loading.wxss
│ ├── loading.wxml
│ └── loading.js
├── auth
│ ├── auth.json
│ ├── auth.wxss
│ ├── auth.wxml
│ └── auth.js
├── rich-parse
│ ├── image-loader
│ │ ├── image-loader.json
│ │ ├── image-loader.wxml
│ │ └── image-loader.js
│ ├── rich-parse.json
│ ├── rich-parse.wxss
│ ├── rich-render
│ │ ├── rich-render.json
│ │ ├── render-children.wxml
│ │ ├── rich-render.js
│ │ ├── rich-render.wxml
│ │ └── rich-render.wxss
│ ├── rich-parse.wxml
│ ├── rich-parse.js
│ └── helper
│ │ ├── htmlparser.js
│ │ ├── wx-discode.js
│ │ └── html2json.js
└── image-loader
│ ├── image-loader.json
│ ├── prevImage.png
│ ├── image-loader.wxss
│ ├── image-loader.wxml
│ └── image-loader.js
├── pages
├── shophelper
│ ├── shophelper.json
│ ├── shophelper.wxml
│ ├── shophelper.wxss
│ └── shophelper.js
├── me
│ ├── me.json
│ ├── me.wxml
│ ├── me.wxss
│ └── me.js
├── logs
│ ├── logs.json
│ ├── logs.wxss
│ ├── logs.wxml
│ └── logs.js
├── index
│ ├── index.json
│ ├── index.js
│ ├── index.wxml
│ └── index.wxss
├── secondhandstore
│ ├── detail
│ │ ├── detail.json
│ │ ├── chat
│ │ │ ├── chat.json
│ │ │ ├── chat.wxml
│ │ │ ├── chat.js
│ │ │ └── chat.wxss
│ │ ├── detail.wxml
│ │ ├── detail.js
│ │ └── detail.wxss
│ ├── secondhandstore.json
│ ├── secondhandstore.wxml
│ ├── secondhandstore.js
│ └── secondhandstore.wxss
└── foundthing
│ ├── foundthing.json
│ ├── foundthing.wxml
│ ├── foundthing.wxss
│ └── foundthing.js
├── img
├── +.png
├── add.png
├── addr.png
├── back.jpg
├── call.png
├── key.jpg
├── sale.png
├── goods.png
├── person.png
└── toast
│ └── warn.png
├── app.wxss
├── README.md
├── app.json
├── utils
├── util.js
├── web.js
└── config.js
├── app.js
└── project.config.json
/component/bottomLoadMore/loading.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/pages/shophelper/shophelper.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {}
3 | }
--------------------------------------------------------------------------------
/img/+.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tangzhangss/wx_campus_helper/HEAD/img/+.png
--------------------------------------------------------------------------------
/component/auth/auth.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/component/rich-parse/image-loader/image-loader.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
4 |
--------------------------------------------------------------------------------
/img/add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tangzhangss/wx_campus_helper/HEAD/img/add.png
--------------------------------------------------------------------------------
/img/addr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tangzhangss/wx_campus_helper/HEAD/img/addr.png
--------------------------------------------------------------------------------
/img/back.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tangzhangss/wx_campus_helper/HEAD/img/back.jpg
--------------------------------------------------------------------------------
/img/call.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tangzhangss/wx_campus_helper/HEAD/img/call.png
--------------------------------------------------------------------------------
/img/key.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tangzhangss/wx_campus_helper/HEAD/img/key.jpg
--------------------------------------------------------------------------------
/img/sale.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tangzhangss/wx_campus_helper/HEAD/img/sale.png
--------------------------------------------------------------------------------
/img/goods.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tangzhangss/wx_campus_helper/HEAD/img/goods.png
--------------------------------------------------------------------------------
/img/person.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tangzhangss/wx_campus_helper/HEAD/img/person.png
--------------------------------------------------------------------------------
/pages/me/me.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {},
3 | "navigationBarTitleText": "个人中心"
4 | }
--------------------------------------------------------------------------------
/pages/logs/logs.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "查看启动日志",
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/component/image-loader/image-loader.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/img/toast/warn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tangzhangss/wx_campus_helper/HEAD/img/toast/warn.png
--------------------------------------------------------------------------------
/pages/index/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "auth": "/component/auth/auth"
4 | }
5 | }
--------------------------------------------------------------------------------
/app.wxss:
--------------------------------------------------------------------------------
1 | /**app.wxss**/
2 | .container {
3 | box-sizing: border-box;
4 | overflow: hidden;
5 | }
6 |
--------------------------------------------------------------------------------
/pages/secondhandstore/detail/detail.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {},
3 | "navigationBarTitleText": "物品详情页"
4 | }
--------------------------------------------------------------------------------
/pages/secondhandstore/detail/chat/chat.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 |
4 | },
5 | "navigationBarTitleText": "微聊"
6 | }
--------------------------------------------------------------------------------
/component/image-loader/prevImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tangzhangss/wx_campus_helper/HEAD/component/image-loader/prevImage.png
--------------------------------------------------------------------------------
/pages/logs/logs.wxss:
--------------------------------------------------------------------------------
1 | .log-list {
2 | display: flex;
3 | flex-direction: column;
4 | padding: 40rpx;
5 | }
6 | .log-item {
7 | margin: 10rpx;
8 | }
9 |
--------------------------------------------------------------------------------
/component/rich-parse/rich-parse.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "rich-render": "./rich-render/rich-render"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/component/rich-parse/rich-parse.wxss:
--------------------------------------------------------------------------------
1 | .rich-parse {
2 | font-family: Helvetica, sans-serif;
3 | font-size: 28rpx;
4 | color: #666;
5 | line-height: 1.8;
6 | }
7 |
--------------------------------------------------------------------------------
/pages/foundthing/foundthing.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {},
3 | "navigationBarBackgroundColor": "#DC143C",
4 | "navigationBarTitleText": "失物招领",
5 | "navigationBarTextStyle": "white"
6 | }
--------------------------------------------------------------------------------
/component/rich-parse/rich-render/rich-render.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "rich-render": "./rich-render",
5 | "image-loader": "../image-loader/image-loader"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/pages/logs/logs.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{index + 1}}. {{log}}
5 |
6 |
7 |
--------------------------------------------------------------------------------
/component/rich-parse/image-loader/image-loader.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/component/rich-parse/rich-parse.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/pages/secondhandstore/secondhandstore.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | },
4 | "navigationBarBackgroundColor": "#ee0000",
5 | "navigationBarTitleText": "二手商城",
6 | "navigationBarTextStyle": "white"
7 |
8 |
9 | }
--------------------------------------------------------------------------------
/component/rich-parse/rich-render/render-children.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/component/bottomLoadMore/loading.wxss:
--------------------------------------------------------------------------------
1 | /* pages/component/loading.wxss */
2 | button{
3 | background: none;
4 | }
5 | button::after{
6 | border: none;
7 | }
8 | .loading,.more{
9 | color: rgba(0, 0, 0, 0.4);
10 | font-size: 25rpx;
11 | margin: 20rpx 0;
12 | text-align: center;
13 | }
--------------------------------------------------------------------------------
/component/image-loader/image-loader.wxss:
--------------------------------------------------------------------------------
1 | /* pages/component/imagePrevLoad/imagePrevLoad.wxss */
2 | @keyframes fadeIn {
3 | 0% { opacity: 0; }
4 | 50% { opacity: 0.5; }
5 | 100% { opacity: 1; }
6 | }
7 | .fade_in {
8 | animation: fadeIn 1s ease;
9 | width: 100%;
10 | height: 100%;
11 | display:block;
12 | }
--------------------------------------------------------------------------------
/pages/logs/logs.js:
--------------------------------------------------------------------------------
1 | //logs.js
2 | const util = require('../../utils/util.js')
3 |
4 | Page({
5 | data: {
6 | logs: []
7 | },
8 | onLoad: function () {
9 | this.setData({
10 | logs: (wx.getStorageSync('logs') || []).map(log => {
11 | return util.formatTime(new Date(log))
12 | })
13 | })
14 | }
15 | })
16 |
--------------------------------------------------------------------------------
/component/bottomLoadMore/loading.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 | ~~ 上划加载更多 ~~
4 | ~~ 没有更多了 ~~
5 |
--------------------------------------------------------------------------------
/pages/index/index.js:
--------------------------------------------------------------------------------
1 | //index.js
2 | //获取应用实例
3 | const app = getApp();
4 | const config = require("../../utils/config.js");
5 |
6 | Page({
7 | data:{
8 | userInfo:{},
9 | notice: config.getIndex().notice
10 | },
11 | authCallback:function(){
12 | console.log("用户回调用完成.....");
13 | },
14 | onLoad:function () {
15 |
16 | }
17 | })
18 |
--------------------------------------------------------------------------------
/component/rich-parse/image-loader/image-loader.js:
--------------------------------------------------------------------------------
1 | Component({
2 | properties: {
3 | src: {
4 | type: String,
5 | value: '',
6 | observer() {
7 | this.setData({ displayImg: false })
8 | }
9 | }
10 | },
11 |
12 | data: {
13 | displayImg: false,
14 | },
15 |
16 | methods: {
17 | onImgLoad() {
18 | this.setData({ displayImg: true })
19 | }
20 | }
21 | })
22 |
--------------------------------------------------------------------------------
/component/image-loader/image-loader.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # wx_campus_helper
2 | 微信小程序 毕业设计 校园助手 二手 跑腿 商城...
3 |
4 | #### 首页展示
5 |
6 | 
7 |
8 | ####程序说明
9 |
10 | 这是一个单机版的小程序....
11 |
12 | 利用缓存实现动态数据储存交互
13 |
14 | /utils/config.js 为初始化配置和一个默认全局配置,初始化数据自己按照格式更改即可
15 | /utils/web.js 是工具库
16 |
17 | ###### 2019-3-20 complete clone前请star 尊重作者的劳动成果!!!
18 |
19 |
--------------------------------------------------------------------------------
/component/bottomLoadMore/loading.js:
--------------------------------------------------------------------------------
1 | // pages/component/loading.js
2 | Component({
3 | /**
4 | * 组件的属性列表
5 | */
6 | properties: {
7 | loading:{
8 | type: String,
9 | value:"false"
10 | },
11 | haveMore:{
12 | type: String,
13 | value: "false"
14 | }
15 | },
16 |
17 | /**
18 | * 组件的初始数据
19 | */
20 | data: {
21 |
22 | },
23 |
24 | /**
25 | * 组件的方法列表
26 | */
27 | methods: {
28 |
29 | }
30 | })
31 |
--------------------------------------------------------------------------------
/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "pages": [
3 | "pages/index/index",
4 | "pages/logs/logs",
5 | "pages/foundthing/foundthing",
6 | "pages/shophelper/shophelper",
7 | "pages/secondhandstore/secondhandstore",
8 | "pages/me/me",
9 | "pages/secondhandstore/detail/detail",
10 | "pages/secondhandstore/detail/chat/chat"
11 | ],
12 | "window": {
13 | "backgroundTextStyle": "light",
14 | "navigationBarBackgroundColor": "#ee0000",
15 | "navigationBarTitleText": "校园助手",
16 | "navigationBarTextStyle": "white"
17 | }
18 | }
--------------------------------------------------------------------------------
/utils/util.js:
--------------------------------------------------------------------------------
1 | const formatTime = date => {
2 | const year = date.getFullYear()
3 | const month = date.getMonth() + 1
4 | const day = date.getDate()
5 | const hour = date.getHours()
6 | const minute = date.getMinutes()
7 | const second = date.getSeconds()
8 |
9 | return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
10 | }
11 |
12 | const formatNumber = n => {
13 | n = n.toString()
14 | return n[1] ? n : '0' + n
15 | }
16 |
17 | module.exports = {
18 | formatTime: formatTime
19 | }
20 |
--------------------------------------------------------------------------------
/component/auth/auth.wxss:
--------------------------------------------------------------------------------
1 | /* pages/component/auth/auth.wxss */
2 | .accredit{
3 | width:100%;
4 | height: 100%;
5 | position: fixed;
6 | top: 0;
7 | left: 0;
8 | z-index: 99999;
9 | display: flex;
10 | align-items: center;
11 | justify-content: center;
12 | }
13 | .accredit-view{
14 | width: 400rpx;
15 | height: 400rpx;
16 | background: #fff;
17 | border: 2rpx solid #eee;
18 | border-radius: 10rpx;
19 | position: relative;
20 | }
21 | .accredit-btn{
22 |
23 | color: #fff;
24 | width:80%;
25 | font-size: 32rpx;
26 | line-height: 80rpx;
27 | position: absolute;
28 | left: 10%;
29 | bottom: 20rpx;
30 | }
31 |
--------------------------------------------------------------------------------
/component/auth/auth.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 微信授权
5 |
6 | ●
7 |
8 | 获取你的公开信息
9 | (昵称、头像)
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/pages/index/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | {{notice}}
7 |
8 |
9 |
23 |
24 |
--------------------------------------------------------------------------------
/component/rich-parse/rich-render/rich-render.js:
--------------------------------------------------------------------------------
1 | Component({
2 | options: {
3 | addGlobalClass: true,
4 | },
5 |
6 | properties: {
7 | item: {
8 | type: Object,
9 | value: {},
10 | },
11 | images: {
12 | type: Array,
13 | value: [],
14 | },
15 | parse_id: {
16 | type: String,
17 | value: '',
18 | }
19 | },
20 |
21 | data: {
22 | imageWidths: {}
23 | },
24 |
25 | methods: {
26 | onImgTap(e) {
27 | global.richParses[this.data.parse_id].onImgTap(e)
28 | },
29 |
30 | onLinkTap(e) {
31 | global.richParses[this.data.parse_id].onLinkTap(e)
32 | },
33 |
34 | onImgLoad(e) {
35 | this.data.imageWidths[e.target.dataset.src] = e.detail.width + 'px'
36 | this.setData({ imageWidths: this.data.imageWidths })
37 | }
38 | }
39 | })
40 |
--------------------------------------------------------------------------------
/pages/secondhandstore/detail/detail.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | ...
9 |
10 |
11 |
12 | {{detail.desc}}
13 |
14 |
15 |
16 |
17 | {{detail.name}}
18 |
19 |
20 | 微聊
21 | 电话
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/component/auth/auth.js:
--------------------------------------------------------------------------------
1 | // pages/component/auth/auth.js
2 | const app = getApp();
3 |
4 | Component({
5 | /**
6 | * 组件的属性列表
7 | */
8 | properties: {
9 | //主要按钮背景色 可随着整体背景色改变 自定义
10 | color: {
11 | type: String,
12 | value: "#02c6dc"
13 | },
14 | },
15 |
16 | /**
17 | * 组件的初始数据
18 | */
19 | data: {
20 | userInfo:null
21 | },
22 | attached:function(e){
23 |
24 | this.setData({
25 | userInfo: app.globalData.userInfo
26 | })
27 |
28 | },
29 | /**
30 | * 组件的方法列表
31 | */
32 | methods: {
33 | _bindgetuserinfo:function(e){
34 |
35 | console.log("用户绑定完成下面回调....",e);
36 |
37 | if (e.detail.userInfo != undefined){
38 | this.setData({
39 | userInfo: e.detail.userInfo
40 | })
41 | console.log("用户授权...");
42 | wx.setStorageSync("userInfo", e.detail.userInfo);
43 | app.globalData.userInfo = e.detail.userInfo;
44 | }
45 |
46 | this.triggerEvent("authCallback", e.detail);
47 | }
48 | }
49 | })
50 |
--------------------------------------------------------------------------------
/component/image-loader/image-loader.js:
--------------------------------------------------------------------------------
1 | // pages/component/imagePrevLoad/imagePrevLoad.js
2 | Component({
3 | /**
4 | * 组件的属性列表
5 | */
6 | properties: {
7 | //占位图片
8 | prevImage:{
9 | type: String,
10 | value: "./prevImage.png",
11 | },
12 | //图片的地址,必须
13 | src:{
14 | type:String,
15 | value:""
16 | },
17 | mode:{
18 | type: String,
19 | value: "widthFix"
20 | },
21 | imageStyle:{
22 | type: String,
23 | value: ""
24 | },
25 | loaded:{
26 | type: String,
27 | value: "false" //"true" 非true
28 | },
29 | index:{
30 | type: Number,
31 | value: 0
32 | }
33 | },
34 | /**
35 | * 组件的初始数据
36 | */
37 | data:{
38 |
39 | },
40 | attached:function(){},
41 | /**
42 | * 组件的方法列表
43 | */
44 | methods: {
45 | _loadComplete:function(e){
46 |
47 | this.setData({
48 | loaded:"true"
49 | })
50 |
51 | this.triggerEvent('bindload',e);
52 | }
53 | }
54 | })
55 |
--------------------------------------------------------------------------------
/pages/secondhandstore/detail/detail.js:
--------------------------------------------------------------------------------
1 | // pages/secondhandstore/detail/detail.js
2 | const app = getApp();
3 | Page({
4 |
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 |
10 | },
11 | chat:function(e){
12 | wx.navigateTo({
13 | url: './chat/chat?url='+this.data.detail.avatars,
14 | })
15 | },
16 | call:function(e){
17 | wx.makePhoneCall({
18 | phoneNumber: e.currentTarget.dataset.num,
19 | })
20 | },
21 | /**
22 | * 生命周期函数--监听页面加载
23 | */
24 | onLoad: function (options) {
25 | this.setData({
26 | detail:app.globalData.goodsdetail
27 | })
28 | },
29 |
30 | /**
31 | * 生命周期函数--监听页面初次渲染完成
32 | */
33 | onReady: function () {
34 |
35 | },
36 |
37 | /**
38 | * 生命周期函数--监听页面显示
39 | */
40 | onShow: function () {
41 |
42 | },
43 |
44 | /**
45 | * 生命周期函数--监听页面隐藏
46 | */
47 | onHide: function () {
48 |
49 | },
50 |
51 | /**
52 | * 生命周期函数--监听页面卸载
53 | */
54 | onUnload: function () {
55 |
56 | },
57 |
58 | /**
59 | * 页面相关事件处理函数--监听用户下拉动作
60 | */
61 | onPullDownRefresh: function () {
62 |
63 | },
64 |
65 | /**
66 | * 页面上拉触底事件的处理函数
67 | */
68 | onReachBottom: function () {
69 |
70 | },
71 |
72 | /**
73 | * 用户点击右上角分享
74 | */
75 | onShareAppMessage: function () {
76 |
77 | }
78 | })
--------------------------------------------------------------------------------
/pages/index/index.wxss:
--------------------------------------------------------------------------------
1 | /**index.wxss**/
2 | auth{
3 |
4 | }
5 | .backimg{
6 | position: absolute;
7 | top: 0;
8 | bottom: 0;
9 | left: 0;
10 | right: 0;
11 | width: 100%;
12 | height: 100%;
13 | z-index: 50;
14 | }
15 | .container{
16 | height:100vh;
17 | position: relative;
18 | z-index: 100;
19 | overflow: hidden;
20 | color: white;
21 | }
22 | .container >view{
23 | opacity: 0.8;
24 | }
25 | .notice{
26 | width: 90%;
27 | height: 300rpx;
28 | background-color: rgba(255,255,255,1);
29 | border-radius: 20rpx;
30 | padding:20rpx;
31 | box-sizing: border-box;
32 | margin:50rpx auto;
33 | color: rgba(233, 55, 55, 0.548);
34 | box-shadow: 1px 1px 5px 1px rgb(247, 69, 38);
35 | }
36 | .menu-box{
37 | position: absolute;
38 | bottom: 5vh;
39 | width:90vw;
40 | left: 5vw;
41 | display: flex;
42 | justify-content: space-around;
43 | align-items: center;
44 | }
45 | .menu-box .one{
46 | border-radius: 10rpx;
47 | height: 100rpx;
48 | width: 20vw;
49 | font-size: 25rpx;
50 | line-height: 100rpx;
51 | text-align: center;
52 | }
53 | .menu-box .a{
54 | background-color: rgb(231, 47, 47);
55 | }
56 | .menu-box .b{
57 | background-color: rgb(74, 211, 19);
58 | }
59 | .menu-box .c{
60 | background-color: rgb(65, 124, 235);
61 | }
62 | .menu-box .d{
63 | background-color: rgb(233, 132, 49);
64 | }
--------------------------------------------------------------------------------
/app.js:
--------------------------------------------------------------------------------
1 | //app.js
2 | const config = require("./utils/config.js");
3 | const webUtil = require("./utils/web.js");
4 | App({
5 | onLaunch: function () {
6 | // 展示本地存储能力
7 | var logs = wx.getStorageSync('logs') || []
8 |
9 | //配置中取出初始化数据
10 |
11 | //1.二手商品
12 | let goodsList = wx.getStorageSync("goodsList");
13 | if(goodsList){
14 | console.log("二手商品数据不为空,不需要读取配置");
15 | }else{
16 | console.log("二手商品数据为空,需要读取配置");
17 | goodsList = config.getFoundthing().goodsList;
18 | //更新缓存
19 | wx.setStorageSync("goodsList", goodsList);
20 | }
21 |
22 | //2.个人信息
23 | this.globalData.userInfo = wx.getStorageSync("userInfo") || null;
24 | //console.log(wx.getStorageSync("userInfo"));
25 |
26 | //3.南北校区跑腿代购。。。。转换时间
27 | let shophelper0 = wx.getStorageSync("shophelper0");
28 | let shophelper1 = wx.getStorageSync("shophelper1");
29 | this.globalData.shophelper0 = shophelper0 || config.getShopHelper().shophelper0;
30 | this.globalData.shophelper1 = shophelper1 || config.getShopHelper().shophelper1;
31 |
32 | //4.失物招领
33 | let lostGoods = wx.getStorageSync("lostGoods");
34 | if (!lostGoods){
35 | lostGoods = config.lostAndFound().goods;
36 | wx.setStorageSync("lostGoods", lostGoods);
37 | }
38 |
39 | },
40 | globalData: {
41 | userInfo: null,
42 | shophelper0:null,
43 | shophelper1:null,
44 |
45 | goodsdetail:{},//商品详情信息
46 | }
47 | })
--------------------------------------------------------------------------------
/project.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "description": "项目配置文件",
3 | "packOptions": {
4 | "ignore": []
5 | },
6 | "setting": {
7 | "urlCheck": true,
8 | "es6": true,
9 | "postcss": true,
10 | "minified": true,
11 | "newFeature": true,
12 | "autoAudits": false
13 | },
14 | "compileType": "miniprogram",
15 | "libVersion": "2.6.2",
16 | "appid": "wx666d9a39d2780738",
17 | "projectname": "wx_campus_help",
18 | "debugOptions": {
19 | "hidedInDevtools": []
20 | },
21 | "isGameTourist": false,
22 | "condition": {
23 | "search": {
24 | "current": -1,
25 | "list": []
26 | },
27 | "conversation": {
28 | "current": -1,
29 | "list": []
30 | },
31 | "plugin": {
32 | "current": -1,
33 | "list": []
34 | },
35 | "game": {
36 | "currentL": -1,
37 | "list": []
38 | },
39 | "miniprogram": {
40 | "current": 3,
41 | "list": [
42 | {
43 | "id": -1,
44 | "name": "shop",
45 | "pathName": "pages/secondhandstore/secondhandstore",
46 | "query": "",
47 | "scene": null
48 | },
49 | {
50 | "id": -1,
51 | "name": "失物招领",
52 | "pathName": "pages/foundthing/foundthing",
53 | "query": ""
54 | },
55 | {
56 | "id": -1,
57 | "name": "跑腿代购",
58 | "pathName": "pages/shophelper/shophelper",
59 | "query": "",
60 | "scene": null
61 | },
62 | {
63 | "id": -1,
64 | "name": "me",
65 | "pathName": "pages/me/me",
66 | "query": ""
67 | }
68 | ]
69 | }
70 | }
71 | }
--------------------------------------------------------------------------------
/pages/secondhandstore/detail/detail.wxss:
--------------------------------------------------------------------------------
1 | /* pages/secondhandstore/detail/detail.wxss */
2 | .container{
3 | width: 100vw;
4 | }
5 | .show{
6 | width: 95vw;
7 | margin: 20rpx auto;
8 | display: block;
9 | border-radius: 20rpx;
10 |
11 | }
12 | .bottom{
13 | position: fixed;
14 | height: 18vh;
15 | bottom: 0;
16 | width: 100vw;
17 | background-color: white;
18 | padding:20rpx 0;
19 | box-sizing: border-box;
20 | }
21 | .bottom image{
22 | margin-left: 20rpx;
23 | width: 60rpx;
24 | border-radius: 60rpx;
25 | height: 60rpx;
26 | }
27 | .bottom .desc{
28 | border-bottom: 1rpx solid #eee;
29 | padding-bottom: 10rpx;
30 | height: 8vh;
31 | margin-left: 20rpx;
32 | line-height: 4vh;
33 | font-size: 30rpx;
34 |
35 | }
36 | .base .user{
37 | display: flex;
38 | justify-content: flex-start;
39 | align-items: center;
40 | }
41 | .base{
42 | height: 8vh;
43 | color: #777;
44 | display: flex;
45 | justify-content: space-between;
46 | align-items:center;
47 | }
48 | .base .op{
49 | display: flex;
50 | justify-content: space-around;
51 | }
52 | .base .op .l{
53 | width: 150rpx;
54 | background-color: rgb(69, 226, 69);
55 | color: white;
56 | height: 8vh;
57 | line-height: 8vh;
58 | text-align: center;
59 | }
60 | .base .op .r{
61 | height: 8vh;
62 | line-height: 8vh;
63 | width: 150rpx;
64 | background-color: rgb(245, 173, 18);
65 | color: white;
66 | text-align: center;
67 | }
68 |
--------------------------------------------------------------------------------
/component/rich-parse/rich-parse.js:
--------------------------------------------------------------------------------
1 | import showdown from './helper/showdown.js'
2 | import { html2json } from './helper/html2json.js'
3 |
4 | global.richParses = {}
5 |
6 | Component({
7 | options: {
8 | addGlobalClass: true,
9 | },
10 |
11 | properties: {
12 | content: {
13 | type: String,
14 | value: '',
15 | observer(newVal) {
16 | this.parse(newVal)
17 | }
18 | },
19 | type: {
20 | type: String,
21 | value: 'html',
22 | }
23 | },
24 |
25 | data: {
26 | rich: null,
27 | parse_id: null,
28 | },
29 |
30 | attached() {
31 | // 把组件实例放到全局上,让 rich-render 里面可以访问
32 | global.richParses[this.__wxExparserNodeId__] = this
33 | this.setData({ parse_id: this.__wxExparserNodeId__ })
34 | },
35 |
36 | ready() {
37 | this.parse(this.data.content)
38 | },
39 |
40 | detached() {
41 | delete global.richParses[this.__wxExparserNodeId__]
42 | },
43 |
44 | methods: {
45 | parse(content) {
46 | const { type } = this.data
47 | if (type === 'md' || type === 'markdown') {
48 | const converter = new showdown.Converter()
49 | content = converter.makeHtml(content)
50 | }
51 | const transData = html2json(content, 'rich')
52 | this.setData({ rich: transData })
53 | },
54 |
55 | onImgTap(e) {
56 | wx.previewImage({
57 | current: e.target.dataset.src, // 当前显示图片的http链接
58 | urls: this.data.rich.imageUrls, // 需要预览的图片http链接列表
59 | })
60 | },
61 |
62 | onLinkTap(e) {
63 | const { href } = e.currentTarget.dataset
64 | this.triggerEvent('linkTo', { href })
65 | }
66 | }
67 | })
68 |
--------------------------------------------------------------------------------
/pages/secondhandstore/detail/chat/chat.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 温馨提示:网络诈骗常存在,切莫傻逼一小时
5 |
6 |
7 |
8 |
9 |
10 |
11 | 离开
12 |
13 |
14 |
15 |
16 |
17 | ...
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | {{item.message}}
26 |
27 |
28 |
29 |
30 |
31 | {{item.replytimeshow}}
32 |
33 |
34 |
35 | ---到底了---
36 |
37 |
38 |
39 |
40 |
41 |
42 | 发送
43 |
44 |
45 |
--------------------------------------------------------------------------------
/pages/foundthing/foundthing.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 如发现你丢失的物品,请联系我们!
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | ...
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | 物品名称:{{item.goods}}
22 |
23 |
24 | {{item.name}}
25 |
26 | 联系方式:{{item.mobile}}
27 | 丢失地址:{{item.addr}}
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | 物品名称:{{item.goods}}
39 |
40 |
41 | {{item.name}}
42 |
43 | 联系方式:{{item.mobile}}
44 | 丢失地址:{{item.addr}}
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 | 提交
67 |
68 |
--------------------------------------------------------------------------------
/pages/shophelper/shophelper.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 南校区
6 |
7 |
8 | 北校区
9 |
10 |
11 | 我是上面nav的补位块
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | {{item.name}}{{item.sex}}
22 |
23 |
24 | 跑腿费:¥{{item.money}}{{item.friendly_time}}
25 |
26 |
27 |
28 |
29 | {{item.goods}}
30 |
31 |
32 | {{item.addr}}
33 |
34 |
35 | 快来帮帮我吧^_^帮忙
36 |
37 |
38 | 已经不需要帮助了^_^已处理
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 | 提交
61 |
62 |
--------------------------------------------------------------------------------
/pages/me/me.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {{userInfo.nickName}}
6 |
7 |
8 |
9 |
10 | 代购
11 | 我的跑腿代购
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | {{item.name}}{{item.sex}}
21 |
22 |
23 | 跑腿费:¥{{item.money}}{{item.friendly_time}}
24 |
25 |
26 |
27 |
28 | {{item.goods}}
29 |
30 |
31 | {{item.addr}}
32 |
33 |
34 | 已经不需要帮助了^_^已处理
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 | 招领
44 | 我发布的食物招领_长按删除
45 |
46 |
47 |
48 |
49 |
50 |
51 | 物品名称:{{item.goods}}
52 |
53 |
54 | {{item.name}}
55 |
56 | 联系方式:{{item.mobile}}
57 | 丢失地址:{{item.addr}}
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | 二手
70 | 我发布的二手商品
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 | {{item.desc}}
79 |
80 | 已处理
81 |
82 |
83 |
84 |
85 |
86 |
--------------------------------------------------------------------------------
/pages/foundthing/foundthing.wxss:
--------------------------------------------------------------------------------
1 | /* pages/foundthing/foundthing.wxss */
2 |
3 | .left{
4 | width: 48%;
5 |
6 | }
7 | .one:hover{
8 | border: 1px solid#ee0000;
9 | }
10 | .one{
11 | border: 1px solid #ddd;
12 | box-shadow: 1px 1px 10px 1px #ddd;
13 | margin-bottom: 20rpx;
14 |
15 | }
16 | .right{
17 | width: 48%;
18 | }
19 |
20 | .box{
21 | display: flex;
22 | justify-content: space-between;
23 | padding:1rpx 10rpx;
24 | flex-wrap: wrap;
25 | }
26 |
27 | .mark{
28 | width: 100%;
29 | text-align: center;
30 | height: 70rpx;
31 | line-height: 70rpx;
32 | color: hsl(300, 33%, 99%);
33 | background-color:#ddd;
34 | }
35 |
36 | .find{
37 | padding:20rpx 2.5vw;
38 | display: flex;
39 | width: 100vw;
40 | height: 120rpx;
41 | align-items: center;
42 | justify-content: space-between;
43 | }
44 |
45 | .find input{
46 | width: 70%;
47 | border: 1rpx solid #ddd;
48 | height: 80rpx;
49 | line-height: 80rpx;
50 | border-radius: 10rpx;
51 | padding-left: 10rpx;
52 | }
53 |
54 | .find button{
55 | width:20%;
56 | height: 80rpx;
57 | line-height: 80rpx;
58 | font-size: 30rpx;
59 | background-color:#DC143C;
60 | color: white;
61 | padding: 0;
62 | }
63 |
64 | .logo{
65 | width: 100%;
66 | height: 40vw;
67 | }
68 |
69 | .things{
70 | font-size: 27rpx;
71 | }
72 |
73 | .user{
74 | width:5vw;
75 | height:5vw;
76 | border-radius: 20rpx;
77 | }
78 |
79 | .name{
80 | font-size: 27rpx;
81 | padding: 0rpx 90rpx;
82 | }
83 |
84 | .person{
85 | display: flex;
86 | font-size: 27rpx;
87 | }
88 |
89 | .contact{
90 | font-size: 27rpx;
91 | }
92 |
93 | .address{
94 | font-size: 27rpx;
95 | }
96 |
97 | .add{
98 | position: fixed;
99 | bottom: 1vw;
100 | right:2vw;
101 | }
102 | .top{
103 | width: 100vw;
104 | height:210rpx;
105 | position: fixed;
106 | background-color: white;
107 | }
108 | .add:hover{
109 | filter: brightness(0.3);
110 | }
111 |
112 | .add image{
113 | width: 15vw;
114 | height: 15vw;
115 | background-color: white;
116 | border-radius: 15vw;
117 | }
118 |
119 |
120 | .form-back{
121 | position: fixed;
122 | top: 0;
123 | left: 0;
124 | right: 0;
125 | bottom: 0;
126 | background-color: rgba(0, 0, 0, 0.7);
127 | z-index: 199;
128 | overflow: hidden;
129 | }
130 | .form-box{
131 | position: fixed;
132 | top: 10vh;
133 | left: 5vw;
134 | width: 90vw;
135 | box-sizing: border-box;
136 | padding: 50rpx 20rpx;
137 | background-color: white;
138 | border-radius: 20rpx;
139 | z-index: 299;
140 | box-shadow: 1px 1px 3px 1px #eee;
141 | }
142 | .form-box .logo{
143 | width: 60vw;
144 | height: 60vw;
145 | margin: 0 auto;
146 | display: block;
147 | }
148 | .form-box input{
149 | height: 80rpx;
150 | line-height: 80rpx;
151 | border-radius: 10rpx;
152 | box-shadow: 1px 1px 2px 1px #DC143C;
153 | padding-left: 10rpx;
154 | margin-top: 20rpx;
155 | }
156 | .form-box .submit{
157 | height: 80rpx;
158 | line-height: 80rpx;
159 | width: 50vw;
160 | margin:20rpx auto;
161 | border-radius: 20rpx;
162 | background-color: #DC143C;
163 | color: white;
164 | text-align: center;
165 | }
166 |
--------------------------------------------------------------------------------
/pages/secondhandstore/secondhandstore.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 如需购买,请拨打卖家电话联系交易
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | ...
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | {{item.name}}
23 |
24 | 已处理
25 |
26 |
27 | ¥{{item.price}}{{item.area==1?'南':'北'}}校区
28 |
29 |
30 | {{item.desc}}
31 |
32 |
35 | 查看详情
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 | 南校区
67 | 北校区
68 |
69 |
70 |
71 |
72 |
73 | 提交
74 |
75 |
76 |
77 |
78 |
79 |
80 |
--------------------------------------------------------------------------------
/pages/foundthing/foundthing.js:
--------------------------------------------------------------------------------
1 | // pages/foundthing/foundthing.js
2 | Page({
3 |
4 | /**
5 | * 页面的初始数据
6 | */
7 | data: {
8 | list:[],
9 | inputContent:'',
10 | info:{
11 | logo:"/img/key.jpg"
12 | }
13 | },
14 | chooseImage: function () {
15 | var that = this;
16 | wx.chooseImage({
17 | success: function (res) {
18 | that.setData({
19 | 'info.logo': res.tempFilePaths[0]
20 | })
21 | },
22 | })
23 | },
24 | infomodify: function (e) {
25 | let val = e.detail.value;
26 | let col = e.currentTarget.dataset.col;
27 |
28 | let data = "{\"info." + col + "\":\"" + val + "\"}";
29 | console.log(data);
30 | data = JSON.parse(data);
31 | this.setData(data);
32 | },
33 | saveFormboxcontent:function(e){
34 | let info = this.data.info;
35 | console.log(info);
36 | //1.改变缓存
37 | let goods = wx.getStorageSync("lostGoods") || [];
38 |
39 | let id = goods.length;
40 | goods.forEach(function (val, index) {
41 | if (val.id == id) {
42 | id++;
43 | }
44 | })
45 | info.id = id;
46 | goods.unshift(info);
47 |
48 | wx.setStorageSync("lostGoods",goods);
49 |
50 | //2.改变当前列表
51 | this.setData({
52 | list:goods
53 | })
54 |
55 | //3.改变我的失物招领
56 | let myLostGoods = wx.getStorageSync("myLostGoods") || [];
57 | myLostGoods.unshift(info);
58 | wx.setStorageSync("myLostGoods", myLostGoods);
59 |
60 | //4.隐藏box
61 | this.setData({
62 | form:false
63 | })
64 | },
65 | seekChange:function(e){
66 | this.data.inputContent = e.detail.value;
67 | },
68 | seekThings:function(){
69 |
70 | let like = this.data.inputContent;
71 | let goods = wx.getStorageSync("lostGoods") || [];
72 |
73 | let tempArr = [];
74 | goods.forEach(function(val,index){
75 | if(val.goods.indexOf(like) < 0){
76 | }else{
77 | tempArr.push(val);
78 | }
79 | })
80 |
81 |
82 | this.setData({
83 | list: tempArr
84 | })
85 |
86 | },
87 |
88 | toggleFormBox(e) {
89 | console.log(e);
90 | let val = e.currentTarget.dataset.val;
91 | this.setData({
92 | form: val == 1 ? true : false
93 | })
94 | },
95 |
96 |
97 |
98 | /**
99 | * 生命周期函数--监听页面加载
100 | */
101 | onLoad: function (options) {
102 | this.setData({
103 | list:wx.getStorageSync("lostGoods")
104 | })
105 | },
106 |
107 | /**
108 | * 生命周期函数--监听页面初次渲染完成
109 | */
110 | onReady: function () {
111 |
112 | },
113 |
114 | /**
115 | * 生命周期函数--监听页面显示
116 | */
117 | onShow: function () {
118 |
119 | },
120 |
121 | /**
122 | * 生命周期函数--监听页面隐藏
123 | */
124 | onHide: function () {
125 |
126 | },
127 |
128 | /**
129 | * 生命周期函数--监听页面卸载
130 | */
131 | onUnload: function () {
132 |
133 | },
134 |
135 | /**
136 | * 页面相关事件处理函数--监听用户下拉动作
137 | */
138 | onPullDownRefresh: function () {
139 |
140 | },
141 |
142 | /**
143 | * 页面上拉触底事件的处理函数
144 | */
145 | onReachBottom: function () {
146 |
147 | },
148 |
149 | /**
150 | * 用户点击右上角分享
151 | */
152 | onShareAppMessage: function () {
153 |
154 | }
155 | })
--------------------------------------------------------------------------------
/pages/secondhandstore/detail/chat/chat.js:
--------------------------------------------------------------------------------
1 | // pages/consult/chat/chat.js
2 |
3 | const app =getApp();
4 | const webUtil = require("../../../../utils/web.js");
5 | var timer;
6 | var exit = 0;//是否离开页面 离开了就不在刷新消息
7 |
8 | Page({
9 |
10 | /**
11 | * 页面的初始数据
12 | */
13 | data: {
14 | userInfo:{},
15 | detailHide:true,
16 | avatars:"",
17 | scroll_bottom:"",//直接下滑到最底下
18 | messageinput:"",//发送文本框
19 | },
20 | sendMessage:function(){
21 | let msg = this.data.messageinput;
22 | let that = this;
23 | if(msg == ''){
24 | webUtil.showToastWithWarnIcon("请输入内容");
25 | return false;
26 | }
27 | //发送文字消息
28 | var logs = this.data.logs;
29 | logs.push({
30 | message:msg,
31 | ctype: 1,
32 | replytime: new Date(),
33 | replytimeshow: webUtil.friendly_time(new Date())
34 | })
35 | this.setData({
36 | logs: logs,
37 | messageinput:'',
38 | scroll_bottom: "scroll_bottom",//直接下滑到最底下
39 | })
40 | wx.setStorageSync("logs", logs);
41 | },
42 | setMessageinput:function(e){
43 | this.setData({
44 | messageinput:e.detail.value
45 | })
46 | },
47 | setAssessinput: function (e) {
48 | this.setData({
49 | 'consult.assessDecode': e.detail.value
50 | })
51 | },
52 | //发送图片
53 | sendImage:function(){
54 | var that = this;
55 |
56 | wx.chooseImage({
57 | success: function (res) {
58 | var logs = that.data.logs;
59 | logs.push({
60 | image: res.tempFilePaths[0],
61 | ctype: 2,
62 | replytime: new Date(),
63 | replytimeshow: webUtil.friendly_time(new Date())
64 | })
65 | that.setData({
66 | logs: logs,
67 | scroll_bottom: "scroll_bottom",//直接下滑到最底下
68 |
69 | })
70 | wx.setStorageSync("logs", logs);
71 | },
72 | })
73 | },
74 |
75 | /**
76 | * 生命周期函数--监听页面加载
77 | */
78 | onLoad: function (options) {
79 |
80 | let avatars = options.url;
81 | let logs = wx.getStorageSync("logs") || [];
82 | logs = this.formatDateTime(logs);
83 | //获取聊天信息
84 | this.setData({
85 | avatars:avatars,
86 | userInfo:app.globalData.userInfo,
87 | logs: logs,
88 | scroll_bottom: "scroll_bottom",//直接下滑到最底下
89 | })
90 | },
91 | //预览图片
92 | prevImage:function(e){
93 | wx.previewImage({
94 | urls: [e.currentTarget.dataset.image],
95 | current: e.currentTarget.dataset.image
96 | })
97 | },
98 | //格式化时间_本页渲染数据
99 | formatDateTime: function (obj) {
100 | obj.forEach((val, index) => {
101 | obj[index].replytimeshow = webUtil.friendly_time(obj[index].replytime);
102 | })
103 | return obj;
104 | },
105 | /**
106 | * 生命周期函数--监听页面显示
107 | */
108 | onShow: function () {
109 |
110 | },
111 |
112 | /**
113 | * 生命周期函数--监听页面隐藏
114 | */
115 | onHide: function () {
116 |
117 | },
118 |
119 | /**
120 | * 生命周期函数--监听页面卸载
121 | */
122 | onUnload: function () {
123 |
124 | },
125 |
126 | /**
127 | * 页面相关事件处理函数--监听用户下拉动作
128 | */
129 | onPullDownRefresh: function () {
130 |
131 | },
132 |
133 | /**
134 | * 页面上拉触底事件的处理函数
135 | */
136 | onReachBottom: function () {
137 |
138 | },
139 |
140 | /**
141 | * 用户点击右上角分享
142 | */
143 | onShareAppMessage: function () {
144 |
145 | }
146 | })
--------------------------------------------------------------------------------
/pages/shophelper/shophelper.wxss:
--------------------------------------------------------------------------------
1 | .nav{
2 | position: fixed;
3 | height: 80rpx;
4 | top: 0;
5 | left: 0;
6 | width:100vw;
7 | display: flex;
8 | justify-content: space-around;
9 | align-items: center;
10 | border-bottom: 1px solid #ccc;
11 | box-shadow: 1rpx 1rpx 1rpx 10rpx #f7f7f7;
12 | background-color: white;
13 | }
14 | .nav .one{
15 | height: 80rpx;
16 | line-height: 80rpx;
17 | padding: 0 50rpx;
18 | }
19 | .bound{
20 | height: 100rpx;
21 | color: white;
22 | }
23 | .selected{
24 | color: #ee0000;
25 | border-bottom: 5rpx solid #ee0000;
26 | }
27 | .list{
28 | padding-bottom: 150rpx;
29 | }
30 | .list .one{
31 | padding: 20rpx 0;
32 | display: flex;
33 | flex-direction: column;
34 | margin-top: 20rpx;
35 | border-bottom: 1px solid #eee;
36 | width: 95vw;
37 | margin: 0 auto;
38 | }
39 | .list .one .user image{
40 | height: 12vw;
41 | width: 12vw;
42 | border-radius: 12vw;
43 | }
44 | .list .one .user{
45 | display: flex;
46 | flex-direction: row;
47 | width:100%;
48 | }
49 | .list .one .user .info{
50 | width: 83vw;
51 | margin-left: 20rpx;
52 | }
53 | .list .one .user .a{
54 | display: flex;
55 | }
56 | .list .one .user .a text{
57 | margin-right: 20rpx;
58 | }
59 | .list .one .user .b{
60 | display: flex;
61 | font-size: 26rpx;
62 | line-height: 50rpx;
63 | justify-content: space-between;
64 | }
65 | .list .one .user .b .money{
66 | color: rgb(17, 148, 35);
67 | }
68 | .list .one .user .b .time{
69 | color: #999;
70 | }
71 | .list .one .col{
72 | color: #777;
73 | margin: 5rpx 0;
74 | display: flex;
75 | align-items: center;
76 | font-size: 32rpx;
77 | }
78 | .list .one .col image{
79 | width: 30rpx;
80 | height: 30rpx;
81 | margin-right: 10rpx;
82 | }
83 | .sure{
84 | display: flex;
85 | justify-content: space-between;
86 | align-items: flex-end;
87 | font-size: 25rpx;
88 | color: rgb(182, 177, 177);
89 | }
90 | .sure .help{
91 | background-color: #ee0000;
92 | height: 50rpx;
93 | line-height: 50rpx;
94 | border-radius: 10rpx;
95 | text-align: center;
96 | color: white;
97 | width: 120rpx;
98 | font-weight: bold;
99 | }
100 | .sure .help1{
101 | background-color: #3eca13;
102 | height: 50rpx;
103 | line-height: 50rpx;
104 | border-radius: 10rpx;
105 | text-align: center;
106 | color: white;
107 | width: 120rpx;
108 | font-weight: bold;
109 | }
110 | .add{
111 | position: fixed;
112 | bottom: 1vh;
113 | right: 2vw;
114 | }
115 | .add image{
116 | height: 120rpx;
117 | width: 120rpx;
118 | border-radius: 100rpx;
119 | background-color: white;
120 | }
121 | .add:Hover{
122 | filter: brightness(0.7);
123 | }
124 | .form-back{
125 | position: fixed;
126 | top: 0;
127 | left: 0;
128 | right: 0;
129 | bottom: 0;
130 | background-color: rgba(0, 0, 0, 0.7);
131 | z-index: 199;
132 | overflow: hidden;
133 | }
134 | .form-box{
135 | position: fixed;
136 | top: 20vh;
137 | left: 5vw;
138 | width: 90vw;
139 | box-sizing: border-box;
140 | padding:20rpx 20rpx;
141 | background-color: white;
142 | border-radius: 20rpx;
143 | z-index: 299;
144 | box-shadow: 1px 1px 3px 1px #eee;
145 | }
146 | .form-box .logo{
147 | width: 60vw;
148 | height: 60vw;
149 | margin: 0 auto;
150 | display: block;
151 | }
152 | .form-box input{
153 | height: 80rpx;
154 | line-height: 80rpx;
155 | border-radius: 10rpx;
156 | box-shadow: 1px 1px 2px 1px rgb(63, 159, 214);
157 | padding-left: 10rpx;
158 | margin-top: 20rpx;
159 | }
160 | .form-box .submit{
161 | height: 80rpx;
162 | line-height: 80rpx;
163 | width: 60vw;
164 | margin:20rpx auto;
165 | border-radius: 20rpx;
166 | background-color: rgb(53, 173, 243);
167 | color: white;
168 | text-align: center;
169 | }
170 |
171 |
172 |
--------------------------------------------------------------------------------
/component/rich-parse/rich-render/rich-render.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
98 |
99 |
100 |
101 |
102 |
103 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 | {{ item.text }}
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 | \n
126 |
127 |
--------------------------------------------------------------------------------
/pages/shophelper/shophelper.js:
--------------------------------------------------------------------------------
1 | // pages/shophelper/shophelper.js
2 | const app = getApp();
3 | const webUtil = require("../../utils/web.js");
4 | Page({
5 |
6 | /**
7 | * 页面的初始数据
8 | */
9 | data: {
10 | navSelectIndex:0,
11 | shophelper0: [],
12 | shophelper1: [],
13 | list:[],
14 | info: {
15 | id: 0,
16 | goods: "",
17 | addr: "",
18 | sex: "男",
19 | name: "",
20 | avatarurl: "",
21 | contact: "",
22 | money: 3,
23 | time: "",
24 | status: 0,
25 | }
26 | },
27 | formatTime(e){
28 | e.forEach((val,index)=>{
29 | //友好时间
30 | val.friendly_time = webUtil.friendly_time(e[index].time);
31 | })
32 | return e;
33 | },
34 | /**
35 | * 生命周期函数--监听页面加载
36 | */
37 | onLoad: function (options) {
38 | //将时间变成友好时间显示
39 | let shophelper0 = this.formatTime(app.globalData.shophelper0);
40 | let shophelper1 = this.formatTime(app.globalData.shophelper1);
41 | this.setData({
42 | shophelper0: shophelper0,
43 | shophelper1: shophelper1,
44 | list: shophelper0,
45 | })
46 | },
47 | selectNav: function (e) {
48 | var that = this;
49 | let index = e.currentTarget.dataset.index;
50 | //进行list改变....
51 | this.setData({
52 | list: index == 0 ? this.data.shophelper0 : this.data.shophelper1,
53 | navSelectIndex:index
54 | })
55 | },
56 | toggleFormBox(e) {
57 | console.log(e);
58 | let val = e.currentTarget.dataset.val;
59 | this.setData({
60 | showformbox: val == 1 ? true : false
61 | })
62 | },
63 | saveFormboxcontent: function (e) {
64 | let index = this.data.navSelectIndex;
65 | let info = this.data.info;
66 | //设置当前时间
67 | info.time = Date.parse(new Date());
68 | info.name = app.globalData.userInfo.nickName;
69 | info.avatarurl = app.globalData.userInfo.avatarUrl;
70 | info.sex = app.globalData.userInfo.gender==1?'男':'女';
71 | info.index=index;//区分南北校区
72 | let list = [];
73 |
74 | if (index == 0) { //南校区
75 | list = this.data.shophelper0;
76 | } else {//北校区
77 | list = this.data.shophelper1;
78 | }
79 | let id = list.length;
80 | list.forEach((val, index) => {
81 | if (val.id == id) {
82 | id++;
83 | }
84 | })
85 |
86 | info.id = id;
87 | info.friendly_time = webUtil.friendly_time(info.time);
88 | console.log(info);
89 |
90 | //加入到头部
91 | list.unshift(info);
92 |
93 | if(index==0){
94 | //更新数据 更新缓存
95 | this.setData({
96 | list: list,
97 | shophelper0: list
98 | })
99 |
100 | wx.setStorageSync("shophelper0", list);
101 | app.globalData.shophelper0 = list;
102 |
103 | }else{
104 | //更新数据 更新缓存
105 | this.setData({
106 | list: list,
107 | shophelper1: list
108 | })
109 |
110 | wx.setStorageSync("shophelper1", list);
111 | app.globalData.shophelper1 = list;
112 | }
113 | console.log(list);
114 |
115 | this.setData({
116 | showformbox:false
117 | })
118 |
119 | //____________________________
120 | //更改我的跑腿代购
121 | let myShophelp = wx.getStorageSync("myShophelp") || [];
122 | myShophelp.unshift(info);
123 | wx.setStorageSync("myShophelp", myShophelp);
124 | },
125 | infomodify: function (e) {
126 | let val = e.detail.value;
127 | let col = e.currentTarget.dataset.col;
128 |
129 | let data = "{\"info." + col + "\":\"" + val + "\"}";
130 | console.log(data);
131 |
132 | data = JSON.parse(data);
133 |
134 | this.setData(data);
135 | },
136 | /**
137 | * 生命周期函数--监听页面初次渲染完成
138 | */
139 | onReady: function () {
140 |
141 | },
142 | callphone:function(e){
143 | wx.makePhoneCall({
144 | phoneNumber: e.currentTarget.dataset.num,
145 | })
146 | },
147 | /**
148 | * 生命周期函数--监听页面显示
149 | */
150 | onShow: function () {
151 |
152 | },
153 |
154 | /**
155 | * 生命周期函数--监听页面隐藏
156 | */
157 | onHide: function () {
158 |
159 | },
160 |
161 | /**
162 | * 生命周期函数--监听页面卸载
163 | */
164 | onUnload: function () {
165 |
166 | },
167 |
168 | /**
169 | * 页面相关事件处理函数--监听用户下拉动作
170 | */
171 | onPullDownRefresh: function () {
172 |
173 | },
174 |
175 | /**
176 | * 页面上拉触底事件的处理函数
177 | */
178 | onReachBottom: function () {
179 |
180 | },
181 |
182 | /**
183 | * 用户点击右上角分享
184 | */
185 | onShareAppMessage: function () {
186 |
187 | }
188 | })
--------------------------------------------------------------------------------
/utils/web.js:
--------------------------------------------------------------------------------
1 | /*
2 | * 功能:实现VBScript的DateAdd功能.
3 | * 参数:interval,字符串表达式,表示要添加的时间间隔.
4 | * 参数:number,数值表达式,表示要添加的时间间隔的个数.
5 | * 参数:date,Date对象.
6 | * 返回:新的时间对象.
7 | * var now = new Date();
8 | * var newDate = dateAdd( "d", 5, now);
9 | *--------------- dateAdd(interval,number,date) -----------------
10 | */
11 | function dateAdd(interval, number, date) {
12 | switch (interval) {
13 | case "y": {
14 | date.setFullYear(date.getFullYear() + number);
15 | return date;
16 | break;
17 | }
18 | case "q": {
19 | date.setMonth(date.getMonth() + number * 3);
20 | return date;
21 | break;
22 | }
23 | case "m": {
24 | date.setMonth(date.getMonth() + number);
25 | return date;
26 | break;
27 | }
28 | case "w": {
29 | date.setDate(date.getDate() + number * 7);
30 | return date;
31 | break;
32 | }
33 | case "d": {
34 | date.setDate(date.getDate() + number);
35 | return date;
36 | break;
37 | }
38 | case "h": {
39 | date.setHours(date.getHours() + number);
40 | return date;
41 | break;
42 | }
43 | case "m": {
44 | date.setMinutes(date.getMinutes() + number);
45 | return date;
46 | break;
47 | }
48 | case "s": {
49 | date.setSeconds(date.getSeconds() + number);
50 | return date;
51 | break;
52 | }
53 | default: {
54 | date.setDate(date.getDate() + number);
55 | return date;
56 | break;
57 | }
58 | }
59 | }
60 |
61 | function showToastWithNoneIcon(title, duration) {
62 | duration = duration == undefined ? 1500 : duration;
63 | wx.showToast({
64 | title: title,
65 | icon: "none",
66 | duration: duration
67 | })
68 | }
69 | function showToastWithWarnIcon(title, duration) {
70 | duration = duration == undefined ? 1500 : duration;
71 | wx.showToast({
72 | title: title,
73 | icon: "none",
74 | image: "/img/toast/warn.png",
75 | duration: duration
76 | })
77 | }
78 | function showToastWithSuccessIcon(title, duration) {
79 | duration = duration == undefined ? 1500 : duration;
80 | wx.showToast({
81 | title: title,
82 | icon: "success",
83 | duration: duration
84 | })
85 | }
86 |
87 | function clearEmoji(str) {
88 | return str.replace(/\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F]/g, "");
89 | }
90 |
91 | function friendly_time(time1) {
92 |
93 | var time1 = new Date(time1);//需要转换的时间
94 |
95 | var time2 = new Date();//当前时间
96 | var time = 0;//时间差
97 | //需要转换的不可能比当前时间大..如果有 自行添加判断
98 | time = time2 - time1;
99 | if (time < 1000) return "刚刚";
100 | time = parseInt(time / 1000);
101 | if (time > 86400) {
102 | var day = parseInt(time / (24 * 60 * 60));
103 | if (day == 1) {
104 | let min = time1.getMinutes();
105 | min = min > 9 ? min : '0' + min;
106 | return "昨天(" + time1.getHours() + ":" + min + ")";
107 | } else if (day < 30) {
108 | return day + "天前";
109 | } else if (day < 360) {
110 | var moth = parseInt(day / 30);
111 | return moth + "个月前";
112 | } else {
113 | var year = parseInt(day / 360);
114 | return year + "年前";
115 | };
116 | } else if (time > 3600) {
117 | var hour = parseInt(time / (60 * 60));
118 | return hour + "小时前";
119 | } else if (time > 60) {
120 | var hour = parseInt(time / 60);
121 | return hour + "分钟前";
122 | } else {
123 | return time + "秒前";
124 | }
125 | }
126 | /**
127 | * 时间 格式化
128 | * usedDay String
129 | * 时间格式与PHP格式 一致....仅一部分
130 | * return String类型
131 | */
132 | function format(usedDay, fmt) {
133 | var usedDate = new Date(usedDay);
134 | var o = {
135 | "m+": usedDate.getMonth() + 1, //月份
136 | "d+": usedDate.getDate(), //日
137 | "h+": usedDate.getHours(), //小时
138 | "i+": usedDate.getMinutes(), //分
139 | "s+": usedDate.getSeconds(), //秒
140 | "q+": Math.floor((usedDate.getMonth() + 3) / 3), //季度
141 | "S": usedDate.getMilliseconds() //毫秒
142 | };
143 | if (/([y|Y]+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (usedDate.getFullYear() + "").substr(4 - RegExp.$1.length));
144 | for (var k in o)
145 | if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
146 | return fmt;
147 | }
148 | module.exports = {
149 | showToastWithNoneIcon: showToastWithNoneIcon,
150 | showToastWithWarnIcon: showToastWithWarnIcon,
151 | showToastWithSuccessIcon: showToastWithSuccessIcon,
152 | friendly_time: friendly_time,
153 | clearEmoji: clearEmoji,
154 | format: format,
155 | dateAdd: dateAdd
156 | }
157 |
--------------------------------------------------------------------------------
/pages/me/me.wxss:
--------------------------------------------------------------------------------
1 | /* pages/me/me.wxss */
2 | .head{
3 | width: 100vw;
4 | padding:50rpx 20rpx;
5 | background-color:#ee0000;
6 | display: flex;
7 | justify-content: flex-start;
8 | align-items: center;
9 | box-sizing: border-box;
10 | color: white;
11 | }
12 | .head image{
13 | width: 200rpx;
14 | height: 200rpx;
15 | border-radius: 200rpx;
16 | margin-right: 20rpx;
17 | }
18 | .head{
19 | font-size: 50rpx;
20 | }
21 | .box{
22 | width: 100%;
23 | padding: 20rrpx;
24 | margin: 20rpx 0;
25 | }
26 | .box .title{
27 | width: 95%;
28 | margin: 0 auto;
29 | line-height: 80rpx;
30 | border-bottom: 1px solid #ccc;
31 | display: flex;
32 | justify-content: space-between;
33 | }
34 | .box .title .r{
35 | font-size: 30rpx;
36 | color: #ccc;
37 | }
38 |
39 | .list1 .one{
40 | padding: 20rpx 0;
41 | display: flex;
42 | flex-direction: column;
43 | margin-top: 20rpx;
44 | border-bottom: 1px solid #eee;
45 | width: 95vw;
46 | margin: 0 auto;
47 | }
48 | .list1 .one .user image{
49 | height: 12vw;
50 | width: 12vw;
51 | border-radius: 12vw;
52 | }
53 | .list1 .one .user{
54 | display: flex;
55 | flex-direction: row;
56 | width:100%;
57 | }
58 | .list1 .one .user .info{
59 | width: 83vw;
60 | margin-left: 20rpx;
61 | }
62 | .list1 .one .user .a{
63 | display: flex;
64 | }
65 | .list1 .one .user .a text{
66 | margin-right: 20rpx;
67 | }
68 | .list1 .one .user .b{
69 | display: flex;
70 | font-size: 26rpx;
71 | line-height: 50rpx;
72 | justify-content: space-between;
73 | }
74 | .list1 .one .user .b .money{
75 | color: rgb(17, 148, 35);
76 | }
77 | .list1 .one .user .b .time{
78 | color: #999;
79 | }
80 | .list1 .one .col{
81 | color: #777;
82 | margin: 5rpx 0;
83 | display: flex;
84 | align-items: center;
85 | font-size: 32rpx;
86 | }
87 | .list1 .one .col image{
88 | width: 30rpx;
89 | height: 30rpx;
90 | margin-right: 10rpx;
91 | }
92 | .sure{
93 | display: flex;
94 | justify-content: space-between;
95 | align-items: flex-end;
96 | font-size: 25rpx;
97 | color: rgb(182, 177, 177);
98 | }
99 | .sure .help{
100 | background-color: #ee0000;
101 | height: 50rpx;
102 | line-height: 50rpx;
103 | border-radius: 10rpx;
104 | text-align: center;
105 | color: white;
106 | width: 120rpx;
107 | font-weight: bold;
108 | }
109 | .sure .help1{
110 | background-color: #3eca13;
111 | height: 50rpx;
112 | line-height: 50rpx;
113 | border-radius: 10rpx;
114 | text-align: center;
115 | color: white;
116 | width: 120rpx;
117 | font-weight: bold;
118 | }
119 | .thing-box{
120 | margin: 20rpx auto;
121 | width: 100%;
122 | display: flex;
123 | justify-content: space-between;
124 | flex-wrap: wrap;
125 |
126 | }
127 | .thing-box .one{
128 | padding:20rpx;
129 | width: 41vw;
130 | margin-bottom: 10rpx;
131 | background-color: white;
132 | display: flex;
133 | flex-direction: column;
134 | align-items: center;
135 | border: 1rpx solid white;
136 | box-shadow: 1px 1px 10px 1px #eee;
137 | }
138 |
139 | .thing-box .one .logo{
140 | width: 40vw;
141 | height: 40vw;
142 | }
143 | .thing-box .one .desc{
144 | margin: 10rpx 0;
145 | width: 100%;
146 | color: black;
147 | font-size: 30rpx;
148 | }
149 | .goodsdeal{
150 | background-color: #3eca13;
151 | height: 50rpx;
152 | line-height: 50rpx;
153 | border-radius: 10rpx;
154 | text-align: center;
155 | color: white;
156 | width: 120rpx;
157 | font-weight: bold;
158 | font-size: 28rpx;
159 | }
160 | .lost{
161 | display: flex;
162 | flex-wrap: wrap;
163 | justify-content: space-around;
164 |
165 |
166 | }
167 | .lost .one{
168 | width: 46%;
169 | border: 1px solid #ddd;
170 | box-shadow: 1px 1px 10px 1px #ddd;
171 | margin: 20rpx auto;
172 |
173 | }
174 |
175 | .lost .mark{
176 | width: 100%;
177 | text-align: center;
178 | height: 70rpx;
179 | line-height: 70rpx;
180 | color: hsl(300, 33%, 99%);
181 | background-color:#ddd;
182 | }
183 |
184 | .lost .find{
185 | padding:20rpx 2.5vw;
186 | display: flex;
187 | width: 100vw;
188 | height: 120rpx;
189 | align-items: center;
190 | justify-content: space-between;
191 | }
192 |
193 | .lost .find input{
194 | width: 70%;
195 | border: 1rpx solid #ddd;
196 | height: 80rpx;
197 | line-height: 80rpx;
198 | border-radius: 10rpx;
199 | padding-left: 10rpx;
200 | }
201 |
202 | .lost .find button{
203 | width:20%;
204 | height: 80rpx;
205 | line-height: 80rpx;
206 | font-size: 30rpx;
207 | background-color:#DC143C;
208 | color: white;
209 | padding: 0;
210 | }
211 |
212 | .lost .logo{
213 | width: 100%;
214 | height: 40vw;
215 | }
216 |
217 | .lost .things{
218 | font-size: 27rpx;
219 | }
220 |
221 | .lost .user{
222 | width:5vw;
223 | height:5vw;
224 | border-radius: 20rpx;
225 | }
226 |
227 | .lost .name{
228 | font-size: 27rpx;
229 | padding: 0rpx 90rpx;
230 | }
231 |
232 | .lost .person{
233 | display: flex;
234 | font-size: 27rpx;
235 | }
236 |
237 | .lost .contact{
238 | font-size: 27rpx;
239 | }
240 |
241 | .lost .address{
242 | font-size: 27rpx;
243 | }
244 |
--------------------------------------------------------------------------------
/pages/secondhandstore/secondhandstore.js:
--------------------------------------------------------------------------------
1 | // pages/secondhandstore/secondhandstore.js
2 | const webUtil = require("../../utils/web.js");
3 | const app = getApp();
4 | Page({
5 |
6 | /**
7 | * 页面的初始数据
8 | */
9 | data: {
10 | goodsList:[],
11 | inputValue:"",
12 | info:{
13 | logo:'http://img0.imgtn.bdimg.com/it/u=1131526118,647367586&fm=26&gp=0.jpg',
14 | contact:'',
15 | desc:'',
16 | picdesc:[],
17 | price:0,
18 | status:0,
19 | }
20 | },
21 | showDetail:function(e){
22 | let index = e.currentTarget.dataset.index;
23 | let goods = this.data.goodsList[index];
24 | app.globalData.goodsdetail = goods;
25 | wx.navigateTo({
26 | url: './detail/detail',
27 | })
28 | },
29 | choosePic:function(e){
30 | let index = e.currentTarget.dataset.index;
31 | var that = this;
32 | let info = this.data.info;
33 | wx.chooseImage({
34 | success: function (res) {
35 | info.picdesc[index] = res.tempFilePaths[0];
36 | that.setData({
37 | info: info
38 | })
39 | },
40 | })
41 | },
42 | chooseImage: function () {
43 | var that = this;
44 | wx.chooseImage({
45 | success: function (res) {
46 | that.setData({
47 | 'info.logo': res.tempFilePaths[0]
48 | })
49 | },
50 | })
51 | },
52 | radioChange:function(e){
53 | this.data.info.area = e.detail.value;
54 | },
55 | infomodify: function (e) {
56 | let val = e.detail.value;
57 | let col = e.currentTarget.dataset.col;
58 |
59 | let data = "{\"info." + col + "\":\"" + val + "\"}";
60 | console.log(data);
61 |
62 | data = JSON.parse(data);
63 |
64 | this.setData(data);
65 | },
66 | toggleFormBox(e){
67 | console.log(e);
68 | let val = e.currentTarget.dataset.val;
69 | this.setData({
70 | showformbox: val==1?true:false
71 | })
72 | },
73 | chooseImage:function(){
74 | var that = this;
75 | wx.chooseImage({
76 | success: function(res) {
77 | that.setData({
78 | 'info.logo': res.tempFilePaths[0]
79 | })
80 | },
81 | })
82 | },
83 | infomodify:function(e){
84 | let val =e.detail.value;
85 | let col = e.currentTarget.dataset.col;
86 |
87 | let data = "{\"info."+col+"\":\""+val+"\"}";
88 | console.log(data);
89 |
90 | data = JSON.parse(data);
91 |
92 | this.setData(data);
93 | },
94 | seekChange:function(e){
95 | this.data.inputValue = e.detail.value
96 | },
97 | saveFormboxcontent:function(e){
98 | let goodsList = wx.getStorageSync("goodsList") || [];
99 |
100 | let info = this.data.info;
101 |
102 | //格式校验
103 | if(!(info.contact && info.price && info.desc)){
104 |
105 | webUtil.showToastWithWarnIcon("请全部填写");
106 |
107 | return false;
108 | }
109 |
110 |
111 | let id = goodsList.length;
112 | goodsList.forEach((val,index)=>{
113 | if(val.id == id){
114 | id++;
115 | }
116 | })
117 | info.id = id;
118 | info.avatars = app.globalData.userInfo.avatarUrl;
119 | info.name = app.globalData.userInfo.nickName;
120 |
121 | console.log(info);
122 |
123 | goodsList.unshift(info);
124 |
125 | this.setData({
126 | goodsList: goodsList,
127 | showformbox:false
128 | })
129 |
130 | //更新缓存
131 | wx.setStorageSync("goodsList", goodsList);
132 |
133 | //个人商品数据改变
134 | let myGoodsList = wx.getStorageSync("myGoodsList") || [];
135 | myGoodsList.unshift(info);
136 | wx.setStorageSync("myGoodsList", myGoodsList);
137 |
138 | },
139 | seekGoods:function(e){
140 | let goodsList = wx.getStorageSync("goodsList");
141 | let key = this.data.inputValue;
142 | console.log("搜索关键字:",key);
143 |
144 | if(key == ''){
145 | this.setData({
146 | goodsList: goodsList
147 | })
148 | return false;
149 | }
150 |
151 | //查找
152 | let temps = [];
153 | goodsList.forEach(function(val,index){
154 | let i = val.desc.indexOf(key);
155 | console.log("配置索引:结果 ",index,i)
156 | if (i >= 0){
157 | console.log("匹配成功,添加..."+val.id)
158 | temps.push(val);
159 | }
160 | })
161 |
162 | this.setData({
163 | goodsList: temps
164 | })
165 |
166 |
167 |
168 | },
169 | /**
170 | * 生命周期函数--监听页面加载
171 | */
172 | onLoad: function (options) {
173 | this.setData({
174 | goodsList: wx.getStorageSync("goodsList")
175 | })
176 | },
177 |
178 | /**
179 | * 生命周期函数--监听页面初次渲染完成
180 | */
181 | onReady: function () {
182 |
183 | },
184 | call(e){
185 | let num = e.currentTarget.dataset.num;
186 | wx.makePhoneCall({
187 | phoneNumber: num,
188 | })
189 | },
190 | /**
191 | * 生命周期函数--监听页面显示
192 | */
193 | onShow: function () {
194 |
195 | },
196 |
197 | /**
198 | * 生命周期函数--监听页面隐藏
199 | */
200 | onHide: function () {
201 |
202 | },
203 |
204 | /**
205 | * 生命周期函数--监听页面卸载
206 | */
207 | onUnload: function () {
208 |
209 | },
210 |
211 | /**
212 | * 页面相关事件处理函数--监听用户下拉动作
213 | */
214 | onPullDownRefresh: function () {
215 |
216 | },
217 |
218 | /**
219 | * 页面上拉触底事件的处理函数
220 | */
221 | onReachBottom: function () {
222 |
223 | },
224 |
225 | /**
226 | * 用户点击右上角分享
227 | */
228 | onShareAppMessage: function () {
229 |
230 | }
231 | })
--------------------------------------------------------------------------------
/pages/secondhandstore/secondhandstore.wxss:
--------------------------------------------------------------------------------
1 | /* pages/secondhandstore/secondhandstore.wxss */
2 | page{
3 | background-color: #f7f7f7;
4 | }
5 |
6 | .container >view{
7 | box-sizing: border-box;
8 | }
9 | .top{
10 | width: 100vw;
11 | height:210rpx;
12 | position: fixed
13 | }
14 |
15 |
16 | .mark{
17 | width: 100%;
18 | text-align: center;
19 | height: 70rpx;
20 | line-height: 70rpx;
21 | color: white;
22 | background-color:#ddd;
23 | }
24 | .find{
25 | padding: 20rpx 2.5vw;
26 | background-color: white;
27 | width: 100vw;
28 | display: flex;
29 | justify-content: space-between;
30 | height:120rpx;
31 | align-items: center;
32 | }
33 | .find input{
34 | width:75%;
35 | border: 1rpx solid #ddd;
36 | height: 80rpx;
37 | line-height: 80rpx;
38 | border-radius: 10rpx;
39 | padding-left: 10rpx;
40 | }
41 | .find button{
42 | width:20%;
43 | height: 80rpx;
44 | line-height: 80rpx;
45 | font-size: 30rpx;
46 | background-color: #ee0000;
47 | color: white;
48 | padding: 0;
49 | }
50 | .thing-box{
51 | margin: 20rpx auto;
52 | width: 96vw;
53 | display: flex;
54 | justify-content: space-between;
55 | flex-wrap: wrap;
56 |
57 | }
58 | .thing-box .one{
59 | padding:20rpx;
60 | width: 41vw;
61 | margin-bottom: 10rpx;
62 | background-color: white;
63 | display: flex;
64 | flex-direction: column;
65 | align-items: center;
66 | border: 1rpx solid white;
67 | box-shadow: 1px 1px 10px 1px #eee;
68 | }
69 | .thing-box .one:hover{
70 | border: 1px solid #ee0000;
71 | }
72 | .thing-box .one .logo{
73 | width: 40vw;
74 | height: 40vw;
75 | }
76 | .thing-box .one .price{
77 | color: red;
78 | text-align: left;
79 | width: 100%;
80 | }
81 | .thing-box .one .price .area1{
82 | display: inline-block;
83 | padding: 10rpx 20rpx;
84 | color: white;
85 | background-color: rgb(224, 29, 250);
86 | border-radius: 10rpx;
87 | margin-left:25rpx;
88 | font-size: 20rpx;
89 | }
90 | .thing-box .one .price .area2{
91 | display: inline-block;
92 | padding: 10rpx 20rpx;
93 | color: white;
94 | margin-left:20rpx;
95 | background-color: rgb(99, 146, 248);
96 | border-radius: 10rpx;
97 | font-size: 20rpx;
98 | }
99 | .radio-group{
100 | margin: 20rpx;
101 | text-align: center;
102 | }
103 | .radio-group >view{
104 | margin-right: 40rpx;
105 | display: inline-block
106 | }
107 | .thing-box .one .call{
108 | width: 40rpx;
109 | height:40rpx;
110 | }
111 | .thing-box .one .base{
112 | display: flex;
113 | justify-content: space-between;
114 | align-items: center;
115 | }
116 | .thing-box .one .base{
117 | width: 100%;
118 | margin-top: 10rpx;
119 | display: flex;
120 | justify-content: space-between;
121 | font-size: 35rpx;
122 | }
123 | .thing-box .one .base .userinfo{
124 | display: flex;
125 | align-items: center;
126 | color: orange;
127 | }
128 | .thing-box .one .base .userinfo text{
129 | margin-left:10rpx;
130 | }
131 | .thing-box .one .base .status{
132 | color: hsl(118, 85%, 47%);
133 | font-size: 25rpx;
134 | }
135 | .thing-box .one .base .userinfo .avatars{
136 | width: 60rpx;
137 | height: 60rpx;
138 | border-radius: 60rpx;
139 | }
140 | .thing-box .one .contact{
141 | width: 100%;
142 | display: flex;
143 | justify-content: space-between;
144 | align-items: center;
145 | color: #999;
146 | font-size: 30rpx;
147 | }
148 | .detail{
149 | height: 50rpx;
150 | line-height: 50rpx;
151 | text-align: center;
152 | background-color: rgb(243, 234, 234);
153 | color: rgb(235, 48, 23);
154 | width: 100%;
155 | font-size: 25rpx;
156 | }
157 | .thing-box .one .desc{
158 | margin: 10rpx 0;
159 | display: -webkit-box;
160 | text-overflow: ellipsis;
161 | overflow : hidden;
162 | -webkit-line-clamp: 2;
163 | -webkit-box-orient: vertical;
164 | width: 100%;
165 | height: 60rpx;
166 | line-height: 30rpx;
167 | color: black;
168 | font-size: 30rpx;
169 | }
170 | .add{
171 | position: fixed;
172 | bottom: 1vh;
173 | right: 2vw;
174 | }
175 | .add image{
176 | height: 120rpx;
177 | width: 120rpx;
178 | border-radius: 100rpx;
179 | }
180 | .add:Hover{
181 | filter: brightness(0.7);
182 | }
183 | .form-back{
184 | position: fixed;
185 | top: 0;
186 | left: 0;
187 | right: 0;
188 | bottom: 0;
189 | background-color: rgba(0, 0, 0, 0.7);
190 | z-index: 199;
191 | overflow: hidden;
192 | }
193 | .form-box{
194 | position: fixed;
195 | top: 1vh;
196 | left: 5vw;
197 | width: 90vw;
198 | box-sizing: border-box;
199 | padding: 30rpx 20rpx;
200 | background-color: white;
201 | border-radius: 20rpx;
202 | z-index: 299;
203 | box-shadow: 1px 1px 3px 1px #eee;
204 | }
205 | .form-box .logo{
206 | width: 60vw;
207 | height: 60vw;
208 | margin: 0 auto;
209 | display: block;
210 | }
211 | .form-box input{
212 | height: 80rpx;
213 | line-height: 80rpx;
214 | border-radius: 10rpx;
215 | box-shadow: 1px 1px 2px 1px #ee0000;
216 | padding-left: 10rpx;
217 | margin-top: 20rpx;
218 | }
219 | .form-box .submit{
220 | height: 80rpx;
221 | line-height: 80rpx;
222 | width: 60vw;
223 | margin:20rpx auto;
224 | border-radius: 20rpx;
225 | background-color: rgb(53, 173, 243);
226 | color: white;
227 | text-align: center;
228 | }
229 | .picbox{
230 | display: flex;
231 | margin-top: 10rpx;
232 | justify-content: space-around;
233 | }
234 | .picbox .pic{
235 | width: 20vw;
236 | height: 20vw;
237 | background-color: #eee;
238 | }
--------------------------------------------------------------------------------
/component/rich-parse/rich-render/rich-render.wxss:
--------------------------------------------------------------------------------
1 | view {
2 | word-break: break-all;
3 | overflow: auto;
4 | }
5 | .rich-parse-inline {
6 | display: inline;
7 | margin: 0;
8 | padding: 0;
9 | }
10 | .rich-parse-div {
11 | margin: 0;
12 | padding: 0;
13 | }
14 | .rich-parse-h1 {
15 | font-size: 2em;
16 | margin: 0.67em 0;
17 | }
18 | .rich-parse-h2 {
19 | font-size: 1.5em;
20 | margin: 0.75em 0;
21 | }
22 | .rich-parse-h3 {
23 | font-size: 1.17em;
24 | margin: 0.83em 0;
25 | }
26 | .rich-parse-h4 {
27 | margin: 1.12em 0;
28 | }
29 | .rich-parse-h5 {
30 | font-size: .83em;
31 | margin: 1.5em 0;
32 | }
33 | .rich-parse-h6 {
34 | font-size: .75em;
35 | margin: 1.67em 0;
36 | }
37 | .rich-parse-h1 {
38 | font-size: 36rpx;
39 | font-weight: 400;
40 | margin-bottom: .9em;
41 | }
42 | .rich-parse-h2 {
43 | font-size: 32rpx;
44 | font-weight: 400;
45 | margin-bottom: .34em;
46 | }
47 | .rich-parse-h3 {
48 | font-weight: 400;
49 | font-size: 30rpx;
50 | margin-bottom: .34em;
51 | }
52 | .rich-parse-h4 {
53 | font-weight: 400;
54 | font-size: 28rpx;
55 | margin-bottom: .24em;
56 | }
57 | .rich-parse-h5 {
58 | font-weight: 400;
59 | font-size: 26rpx;
60 | margin-bottom: .14em;
61 | }
62 | .rich-parse-h6 {
63 | font-weight: 400;
64 | font-size: 24rpx;
65 | margin-bottom: .04em;
66 | }
67 | .rich-parse-h1,
68 | .rich-parse-h2,
69 | .rich-parse-h3,
70 | .rich-parse-h4,
71 | .rich-parse-h5,
72 | .rich-parse-h6,
73 | .rich-parse-b,
74 | .rich-parse-strong {
75 | font-weight: bolder;
76 | }
77 | .rich-parse-i,
78 | .rich-parse-cite,
79 | .rich-parse-em,
80 | .rich-parse-var,
81 | .rich-parse-address {
82 | font-style: italic;
83 | }
84 | .rich-parse-pre,
85 | .rich-parse-tt,
86 | .rich-parse-code,
87 | .rich-parse-kbd,
88 | .rich-parse-samp {
89 | font-family: monospace;
90 | }
91 | .rich-parse-pre {
92 | white-space: pre;
93 | }
94 | .rich-parse-big {
95 | font-size: 1.17em;
96 | }
97 | .rich-parse-small,
98 | .rich-parse-sub,
99 | .rich-parse-sup {
100 | font-size: 0.83em;
101 | }
102 | .rich-parse-sub {
103 | vertical-align: sub;
104 | }
105 | .rich-parse-sup {
106 | vertical-align: super;
107 | }
108 | .rich-parse-s,
109 | .rich-parse-strike,
110 | .rich-parse-del {
111 | text-decoration: line-through;
112 | }
113 | /*rich-parse-自定义个性化的css样式*/
114 | /*增加video的css样式*/
115 | .rich-parse-strong,
116 | .rich-parse-s {
117 | display: inline;
118 | }
119 | .rich-parse-a {
120 | color: deepskyblue;
121 | word-break: break-all;
122 | overflow: auto;
123 | }
124 | .rich-parse-video-view {
125 | text-align: center;
126 | margin: 20rpx 0;
127 | }
128 | .rich-parse-video {
129 | width: 100%;
130 | }
131 | .rich-parse-audio-view {
132 | display: -webkit-box;
133 | display: -webkit-flex;
134 | display: flex;
135 | -webkit-box-pack: center;
136 | -webkit-justify-content: center;
137 | justify-content: center;
138 | overflow: hidden;
139 | }
140 | .rich-parse-img {
141 | overflow: hidden;
142 | max-width: 100%;
143 | }
144 | .rich-parse-blockquote {
145 | margin: 0;
146 | padding: 20rpx 0 20rpx 10rpx;
147 | font-family: Courier, Calibri, "宋体";
148 | background: #f5f5f5;
149 | border-left: 6rpx solid #dbdbdb;
150 | }
151 | .rich-parse-code {
152 | display: inline;
153 | background: #f5f5f5;
154 | }
155 | .rich-parse-ul {
156 | margin: 20rpx 10rpx;
157 | }
158 | .rich-parse-li,
159 | .rich-parse-li-inner {
160 | display: -webkit-box;
161 | display: -webkit-flex;
162 | display: flex;
163 | -webkit-box-align: baseline;
164 | -webkit-align-items: baseline;
165 | align-items: baseline;
166 | margin: 10rpx 0;
167 | }
168 | .rich-parse-li-text {
169 | -webkit-box-align: center;
170 | -webkit-align-items: center;
171 | align-items: center;
172 | line-height: 40rpx;
173 | }
174 | .rich-parse-li-circle {
175 | display: -webkit-inline-box;
176 | display: -webkit-inline-flex;
177 | display: inline-flex;
178 | width: 10rpx;
179 | height: 10rpx;
180 | background-color: #333;
181 | margin-right: 10rpx;
182 | }
183 | .rich-parse-li-square {
184 | display: -webkit-inline-box;
185 | display: -webkit-inline-flex;
186 | display: inline-flex;
187 | width: 10rpx;
188 | height: 10rpx;
189 | background-color: #333;
190 | margin-right: 10rpx;
191 | }
192 | .rich-parse-li-ring {
193 | display: -webkit-inline-box;
194 | display: -webkit-inline-flex;
195 | display: inline-flex;
196 | width: 10rpx;
197 | height: 10rpx;
198 | border: 1PX solid #333;
199 | border-radius: 50%;
200 | background-color: #fff;
201 | margin-right: 10rpx;
202 | }
203 | .rich-parse-table {
204 | width: 100%;
205 | height: 800rpx;
206 | }
207 | .rich-parse-thead,
208 | .rich-parse-tfoot,
209 | .rich-parse-tr {
210 | display: -webkit-box;
211 | display: -webkit-flex;
212 | display: flex;
213 | -webkit-box-orient: horizontal;
214 | -webkit-box-direction: normal;
215 | -webkit-flex-direction: row;
216 | flex-direction: row;
217 | }
218 | .rich-parse-th,
219 | .rich-parse-td {
220 | display: -webkit-box;
221 | display: -webkit-flex;
222 | display: flex;
223 | width: 1160rpx;
224 | overflow: auto;
225 | }
226 | .rich-parse-u {
227 | text-decoration: underline;
228 | }
229 | .rich-parse-hide {
230 | display: none;
231 | }
232 | .rich-emoji-view {
233 | -webkit-box-align: center;
234 | -webkit-align-items: center;
235 | align-items: center;
236 | }
237 | .rich-emoji {
238 | width: 32rpx;
239 | height: 32rpx;
240 | }
241 | .rich-parse-tr {
242 | display: -webkit-box;
243 | display: -webkit-flex;
244 | display: flex;
245 | border-right: 1PX solid #e0e0e0;
246 | border-bottom: 1PX solid #e0e0e0;
247 | border-top: 1PX solid #e0e0e0;
248 | }
249 | .rich-parse-th,
250 | .rich-parse-td {
251 | -webkit-box-flex: 1;
252 | -webkit-flex: 1;
253 | flex: 1;
254 | padding: 10rpx;
255 | border-left: 1PX solid #e0e0e0;
256 | word-break: break-all;
257 | }
258 | .rich-parse-td:last-child {
259 | border-top: 1PX solid #e0e0e0;
260 | }
261 | .rich-parse-th {
262 | background: #f0f0f0;
263 | border-top: 1PX solid #e0e0e0;
264 | }
265 | .rich-parse-del {
266 | display: inline;
267 | }
268 | .rich-parse-figure {
269 | overflow: hidden;
270 | }
271 |
--------------------------------------------------------------------------------
/pages/me/me.js:
--------------------------------------------------------------------------------
1 | // pages/me/me.js
2 | const app = getApp();
3 | Page({
4 |
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 | userInfo:app.globalData.userInfo,
10 | myShophelp:[],
11 | myFoundthing:[],
12 | myGoodsList:[]
13 | },
14 | dellostgood(e) {
15 | var that = this;
16 | let index = e.currentTarget.dataset.index;
17 | wx.showModal({
18 | title: '提示',
19 | content: '确认已经有人认领或取消,并删除此项么?',
20 | success(res) {
21 | if (res.confirm) {
22 |
23 | //1.更新缓存。。。我的
24 | let myLostGoods = wx.getStorageSync("myLostGoods");
25 |
26 | let indx = null;
27 | myLostGoods.forEach(function (val, i) {
28 | if (val.id == myLostGoods[index].id) {
29 | console.log("找到了....index:" + i);
30 | indx = i;
31 | }
32 | })
33 |
34 | if (indx != null) {
35 | //在我的 ——缓存中 删除此项
36 | myLostGoods.splice(indx, 1);
37 |
38 | //更新
39 | wx.setStorageSync("myLostGoods", myLostGoods);
40 | }
41 |
42 | //1.更新缓存。。。主要
43 | let lostGoods = wx.getStorageSync("lostGoods");
44 |
45 | let indxx = null;
46 | lostGoods.forEach(function (val, i) {
47 | if (val.id == lostGoods[index].id) {
48 | console.log("找到了....index:" + i);
49 | indxx = i;
50 | }
51 | })
52 |
53 | if (indxx != null) {
54 | //在主要 ——缓存中 删除此项
55 | lostGoods.splice(indxx, 1);
56 | //更新
57 | wx.setStorageSync("lostGoods", lostGoods);
58 | }
59 | //----------------------------------------------------------------
60 |
61 |
62 | //更新渲染
63 | that.setData({
64 | myLostGoods: myLostGoods
65 | })
66 | }
67 | }
68 | })
69 | },
70 |
71 | delShophelp(e){
72 | var that = this;
73 | let index = e.currentTarget.dataset.index;
74 | wx.showModal({
75 | title: '提示',
76 | content: '确认已经有人帮助跑腿或取消,并删除此项么?',
77 | success(res){
78 | if(res.confirm){
79 |
80 | let myShophelp = that.data.myShophelp;
81 | //更新跑腿代购库
82 | //---------------------------------------------------
83 | let shophelp = [];
84 | if (myShophelp[index].index==0){
85 | //南校区
86 | shophelp = wx.getStorageSync("shophelper0");
87 | }else{
88 | //北校区
89 | shophelp = wx.getStorageSync("shophelper1");
90 | }
91 |
92 | shophelp.forEach(function(val,i){
93 | if (val.id == myShophelp[index].id){
94 | console.log("找到了....index:" + i);
95 | val.status = 1;
96 | }
97 | })
98 |
99 | if (myShophelp[index].index == 0) {
100 | //南校区
101 | console.log("更新南校区代购库", shophelp)
102 | wx.setStorageSync("shophelper0", shophelp);
103 | app.globalData.shophelper0 = shophelp
104 | } else {
105 | //北校区
106 | console.log("更新北校区代购库", shophelp)
107 | wx.setStorageSync("shophelper1", shophelp);
108 | app.globalData.shophelper1= shophelp
109 | }
110 | //----------------------------------------------------------------
111 | //执行删除操作
112 | myShophelp.splice(index,1);
113 |
114 | //更新储存
115 | wx.setStorageSync("myShophelp", myShophelp);
116 | //更新渲染
117 | that.setData({
118 | myShophelp: myShophelp
119 | })
120 |
121 |
122 |
123 |
124 | }
125 | }
126 | })
127 | },
128 |
129 | delGoods(e) {
130 | var that = this;
131 | let index = e.currentTarget.dataset.index;
132 | wx.showModal({
133 | title: '提示',
134 | content: '确认已经有人购买或取消,并删除此项么?',
135 | success(res) {
136 | if (res.confirm) {
137 | let myGoodsList = that.data.myGoodsList;
138 | //---------------------------------------------------
139 |
140 | let goodsList = wx.getStorageSync("goodsList");
141 |
142 |
143 | goodsList.forEach(function (val, i) {
144 | if (val.id == myGoodsList[index].id) {
145 | console.log("找到了....index:" + i);
146 | val.status = 1;
147 | }
148 | })
149 | wx.setStorageSync("goodsList", goodsList);
150 | //----------------------------------------------------------------
151 | //执行删除操作
152 | myGoodsList.splice(index, 1);
153 | //更新储存
154 | wx.setStorageSync("myGoodsList", myGoodsList);
155 | //更新渲染
156 | that.setData({
157 | myGoodsList: myGoodsList
158 | })
159 | }
160 | }
161 | })
162 | },
163 | /**
164 | * 生命周期函数--监听页面加载
165 | */
166 | onLoad: function (options) {
167 | let myShophelp = wx.getStorageSync("myShophelp") || [];
168 | let myLostGoods = wx.getStorageSync("myLostGoods") || [];
169 | let myGoodsList = wx.getStorageSync("myGoodsList") || [];
170 | console.log("我的跑腿代购",myShophelp);
171 | console.log("我的失物招领", myLostGoods);
172 | console.log("我的二手商品", myGoodsList);
173 | this.setData({
174 | myShophelp: myShophelp,
175 | myLostGoods: myLostGoods,
176 | myGoodsList: myGoodsList
177 | })
178 | },
179 |
180 | /**
181 | * 生命周期函数--监听页面初次渲染完成
182 | */
183 | onReady: function () {
184 |
185 | },
186 |
187 | /**
188 | * 生命周期函数--监听页面显示
189 | */
190 | onShow: function () {
191 |
192 | },
193 |
194 | /**
195 | * 生命周期函数--监听页面隐藏
196 | */
197 | onHide: function () {
198 |
199 | },
200 |
201 | /**
202 | * 生命周期函数--监听页面卸载
203 | */
204 | onUnload: function () {
205 |
206 | },
207 |
208 | /**
209 | * 页面相关事件处理函数--监听用户下拉动作
210 | */
211 | onPullDownRefresh: function () {
212 |
213 | },
214 |
215 | /**
216 | * 页面上拉触底事件的处理函数
217 | */
218 | onReachBottom: function () {
219 |
220 | },
221 |
222 | /**
223 | * 用户点击右上角分享
224 | */
225 | onShareAppMessage: function () {
226 |
227 | }
228 | })
--------------------------------------------------------------------------------
/component/rich-parse/helper/htmlparser.js:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * htmlParser改造自: https://github.com/blowsie/Pure-JavaScript-HTML5-Parser
4 | *
5 | * author: Di (微信小程序开发工程师)
6 | * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
7 | * 垂直微信小程序开发交流社区
8 | *
9 | * github地址: https://github.com/icindy/wxParse
10 | *
11 | * for: 微信小程序富文本解析
12 | * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
13 | */
14 | // Regular Expressions for parsing tags and attributes
15 | /* eslint-disable */
16 |
17 | var startTag = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,
18 | endTag = /^<\/([-A-Za-z0-9_]+)[^>]*>/,
19 | attr = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;
20 |
21 | // Empty Elements - HTML 5
22 | var empty = makeMap("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr");
23 |
24 | // Block Elements - HTML 5
25 | var block = makeMap("a,address,code,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video");
26 |
27 | // Inline Elements - HTML 5
28 | var inline = makeMap("abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var");
29 |
30 | // Elements that you can, intentionally, leave open
31 | // (and which close themselves)
32 | var closeSelf = makeMap("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");
33 |
34 | // Attributes that have their values filled in disabled="disabled"
35 | var fillAttrs = makeMap("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected");
36 |
37 | // Special Elements (can contain anything)
38 | var special = makeMap("wxxxcode-style,script,style,view,scroll-view,block");
39 |
40 | function HTMLParser(html, handler) {
41 | var index, chars, match, stack = [], last = html;
42 | stack.last = function () {
43 | return this[this.length - 1];
44 | };
45 |
46 | while (html) {
47 | chars = true;
48 |
49 | // Make sure we're not in a script or style element
50 | if (!stack.last() || !special[stack.last()]) {
51 |
52 | // Comment
53 | if (html.indexOf("");
55 |
56 | if (index >= 0) {
57 | if (handler.comment)
58 | handler.comment(html.substring(4, index));
59 | html = html.substring(index + 3);
60 | chars = false;
61 | }
62 |
63 | // end tag
64 | } else if (html.indexOf("") == 0) {
65 | match = html.match(endTag);
66 |
67 | if (match) {
68 | html = html.substring(match[0].length);
69 | match[0].replace(endTag, parseEndTag);
70 | chars = false;
71 | }
72 |
73 | // start tag
74 | } else if (html.indexOf("<") == 0) {
75 | match = html.match(startTag);
76 |
77 | if (match) {
78 | html = html.substring(match[0].length);
79 | match[0].replace(startTag, parseStartTag);
80 | chars = false;
81 | }
82 | }
83 |
84 | if (chars) {
85 | index = html.indexOf("<");
86 | var text = ''
87 | while (index === 0) {
88 | text += "<";
89 | html = html.substring(1);
90 | index = html.indexOf("<");
91 | }
92 | text += index < 0 ? html : html.substring(0, index);
93 | html = index < 0 ? "" : html.substring(index);
94 |
95 | if (handler.chars)
96 | handler.chars(text);
97 | }
98 |
99 | } else {
100 |
101 | html = html.replace(new RegExp("([\\s\\S]*?)<\/" + stack.last() + "[^>]*>"), function (all, text) {
102 | text = text.replace(/|/g, "$1$2");
103 | if (handler.chars)
104 | handler.chars(text);
105 |
106 | return "";
107 | });
108 |
109 |
110 | parseEndTag("", stack.last());
111 | }
112 |
113 | if (html == last)
114 | throw "Parse Error: " + html;
115 | last = html;
116 | }
117 |
118 | // Clean up any remaining tags
119 | parseEndTag();
120 |
121 | function parseStartTag(tag, tagName, rest, unary) {
122 | tagName = tagName.toLowerCase();
123 |
124 | if (block[tagName]) {
125 | while (stack.last() && inline[stack.last()]) {
126 | parseEndTag("", stack.last());
127 | }
128 | }
129 |
130 | if (closeSelf[tagName] && stack.last() == tagName) {
131 | parseEndTag("", tagName);
132 | }
133 |
134 | unary = empty[tagName] || !!unary;
135 |
136 | if (!unary)
137 | stack.push(tagName);
138 |
139 | if (handler.start) {
140 | var attrs = [];
141 |
142 | rest.replace(attr, function (match, name) {
143 | var value = arguments[2] ? arguments[2] :
144 | arguments[3] ? arguments[3] :
145 | arguments[4] ? arguments[4] :
146 | fillAttrs[name] ? name : "";
147 |
148 | attrs.push({
149 | name: name,
150 | value: value,
151 | escaped: value.replace(/(^|[^\\])"/g, '$1\\\"') //"
152 | });
153 | });
154 |
155 | if (handler.start) {
156 | handler.start(tagName, attrs, unary);
157 | }
158 |
159 | }
160 | }
161 |
162 | function parseEndTag(tag, tagName) {
163 | // If no tag name is provided, clean shop
164 | if (!tagName)
165 | var pos = 0;
166 |
167 | // Find the closest opened tag of the same type
168 | else {
169 | tagName = tagName.toLowerCase();
170 | for (var pos = stack.length - 1; pos >= 0; pos--)
171 | if (stack[pos] == tagName)
172 | break;
173 | }
174 | if (pos >= 0) {
175 | // Close all the open elements, up the stack
176 | for (var i = stack.length - 1; i >= pos; i--)
177 | if (handler.end)
178 | handler.end(stack[i]);
179 |
180 | // Remove the open elements from the stack
181 | stack.length = pos;
182 | }
183 | }
184 | };
185 |
186 |
187 | function makeMap(str) {
188 | var obj = {}, items = str.split(",");
189 | for (var i = 0; i < items.length; i++)
190 | obj[items[i]] = true;
191 | return obj;
192 | }
193 |
194 | module.exports = HTMLParser;
195 |
--------------------------------------------------------------------------------
/component/rich-parse/helper/wx-discode.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 |
3 | // HTML 支持的数学符号
4 | function strNumDiscode(str){
5 | str = str.replace(/∀/g, '∀');
6 | str = str.replace(/∂/g, '∂');
7 | str = str.replace(/&exists;/g, '∃');
8 | str = str.replace(/∅/g, '∅');
9 | str = str.replace(/∇/g, '∇');
10 | str = str.replace(/∈/g, '∈');
11 | str = str.replace(/∉/g, '∉');
12 | str = str.replace(/∋/g, '∋');
13 | str = str.replace(/∏/g, '∏');
14 | str = str.replace(/∑/g, '∑');
15 | str = str.replace(/−/g, '−');
16 | str = str.replace(/∗/g, '∗');
17 | str = str.replace(/√/g, '√');
18 | str = str.replace(/∝/g, '∝');
19 | str = str.replace(/∞/g, '∞');
20 | str = str.replace(/∠/g, '∠');
21 | str = str.replace(/∧/g, '∧');
22 | str = str.replace(/∨/g, '∨');
23 | str = str.replace(/∩/g, '∩');
24 | str = str.replace(/∩/g, '∪');
25 | str = str.replace(/∫/g, '∫');
26 | str = str.replace(/∴/g, '∴');
27 | str = str.replace(/∼/g, '∼');
28 | str = str.replace(/≅/g, '≅');
29 | str = str.replace(/≈/g, '≈');
30 | str = str.replace(/≠/g, '≠');
31 | str = str.replace(/≤/g, '≤');
32 | str = str.replace(/≥/g, '≥');
33 | str = str.replace(/⊂/g, '⊂');
34 | str = str.replace(/⊃/g, '⊃');
35 | str = str.replace(/⊄/g, '⊄');
36 | str = str.replace(/⊆/g, '⊆');
37 | str = str.replace(/⊇/g, '⊇');
38 | str = str.replace(/⊕/g, '⊕');
39 | str = str.replace(/⊗/g, '⊗');
40 | str = str.replace(/⊥/g, '⊥');
41 | str = str.replace(/⋅/g, '⋅');
42 | return str;
43 | }
44 |
45 | //HTML 支持的希腊字母
46 | function strGreeceDiscode(str){
47 | str = str.replace(/Α/g, 'Α');
48 | str = str.replace(/Β/g, 'Β');
49 | str = str.replace(/Γ/g, 'Γ');
50 | str = str.replace(/Δ/g, 'Δ');
51 | str = str.replace(/Ε/g, 'Ε');
52 | str = str.replace(/Ζ/g, 'Ζ');
53 | str = str.replace(/Η/g, 'Η');
54 | str = str.replace(/Θ/g, 'Θ');
55 | str = str.replace(/Ι/g, 'Ι');
56 | str = str.replace(/Κ/g, 'Κ');
57 | str = str.replace(/Λ/g, 'Λ');
58 | str = str.replace(/Μ/g, 'Μ');
59 | str = str.replace(/Ν/g, 'Ν');
60 | str = str.replace(/Ξ/g, 'Ν');
61 | str = str.replace(/Ο/g, 'Ο');
62 | str = str.replace(/Π/g, 'Π');
63 | str = str.replace(/Ρ/g, 'Ρ');
64 | str = str.replace(/Σ/g, 'Σ');
65 | str = str.replace(/Τ/g, 'Τ');
66 | str = str.replace(/Υ/g, 'Υ');
67 | str = str.replace(/Φ/g, 'Φ');
68 | str = str.replace(/Χ/g, 'Χ');
69 | str = str.replace(/Ψ/g, 'Ψ');
70 | str = str.replace(/Ω/g, 'Ω');
71 |
72 | str = str.replace(/α/g, 'α');
73 | str = str.replace(/β/g, 'β');
74 | str = str.replace(/γ/g, 'γ');
75 | str = str.replace(/δ/g, 'δ');
76 | str = str.replace(/ε/g, 'ε');
77 | str = str.replace(/ζ/g, 'ζ');
78 | str = str.replace(/η/g, 'η');
79 | str = str.replace(/θ/g, 'θ');
80 | str = str.replace(/ι/g, 'ι');
81 | str = str.replace(/κ/g, 'κ');
82 | str = str.replace(/λ/g, 'λ');
83 | str = str.replace(/μ/g, 'μ');
84 | str = str.replace(/ν/g, 'ν');
85 | str = str.replace(/ξ/g, 'ξ');
86 | str = str.replace(/ο/g, 'ο');
87 | str = str.replace(/π/g, 'π');
88 | str = str.replace(/ρ/g, 'ρ');
89 | str = str.replace(/ς/g, 'ς');
90 | str = str.replace(/σ/g, 'σ');
91 | str = str.replace(/τ/g, 'τ');
92 | str = str.replace(/υ/g, 'υ');
93 | str = str.replace(/φ/g, 'φ');
94 | str = str.replace(/χ/g, 'χ');
95 | str = str.replace(/ψ/g, 'ψ');
96 | str = str.replace(/ω/g, 'ω');
97 | str = str.replace(/ϑ/g, 'ϑ');
98 | str = str.replace(/ϒ/g, 'ϒ');
99 | str = str.replace(/ϖ/g, 'ϖ');
100 | str = str.replace(/·/g, '·');
101 | return str;
102 | }
103 |
104 | //
105 |
106 | function strcharacterDiscode(str){
107 | // 加入常用解析
108 | str = str.replace(/ /g, '\xa0');
109 | str = str.replace(/"/g, "'");
110 | str = str.replace(/&/g, '&');
111 | // str = str.replace(/</g, '‹');
112 | // str = str.replace(/>/g, '›');
113 |
114 | str = str.replace(/</g, '<');
115 | str = str.replace(/>/g, '>');
116 | str = str.replace(/•/g, '•');
117 |
118 | return str;
119 | }
120 |
121 | // HTML 支持的其他实体
122 | function strOtherDiscode(str){
123 | str = str.replace(/Œ/g, 'Œ');
124 | str = str.replace(/œ/g, 'œ');
125 | str = str.replace(/Š/g, 'Š');
126 | str = str.replace(/š/g, 'š');
127 | str = str.replace(/Ÿ/g, 'Ÿ');
128 | str = str.replace(/ƒ/g, 'ƒ');
129 | str = str.replace(/ˆ/g, 'ˆ');
130 | str = str.replace(/˜/g, '˜');
131 | str = str.replace(/ /g, '');
132 | str = str.replace(/ /g, '');
133 | str = str.replace(/ /g, '');
134 | str = str.replace(//g, '');
135 | str = str.replace(//g, '');
136 | str = str.replace(//g, '');
137 | str = str.replace(//g, '');
138 | str = str.replace(/–/g, '–');
139 | str = str.replace(/—/g, '—');
140 | str = str.replace(/‘/g, '‘');
141 | str = str.replace(/’/g, '’');
142 | str = str.replace(/‚/g, '‚');
143 | str = str.replace(/“/g, '“');
144 | str = str.replace(/”/g, '”');
145 | str = str.replace(/„/g, '„');
146 | str = str.replace(/†/g, '†');
147 | str = str.replace(/‡/g, '‡');
148 | str = str.replace(/•/g, '•');
149 | str = str.replace(/…/g, '…');
150 | str = str.replace(/‰/g, '‰');
151 | str = str.replace(/′/g, '′');
152 | str = str.replace(/″/g, '″');
153 | str = str.replace(/‹/g, '‹');
154 | str = str.replace(/›/g, '›');
155 | str = str.replace(/‾/g, '‾');
156 | str = str.replace(/€/g, '€');
157 | str = str.replace(/™/g, '™');
158 |
159 | str = str.replace(/←/g, '←');
160 | str = str.replace(/↑/g, '↑');
161 | str = str.replace(/→/g, '→');
162 | str = str.replace(/↓/g, '↓');
163 | str = str.replace(/↔/g, '↔');
164 | str = str.replace(/↵/g, '↵');
165 | str = str.replace(/⌈/g, '⌈');
166 | str = str.replace(/⌉/g, '⌉');
167 |
168 | str = str.replace(/⌊/g, '⌊');
169 | str = str.replace(/⌋/g, '⌋');
170 | str = str.replace(/◊/g, '◊');
171 | str = str.replace(/♠/g, '♠');
172 | str = str.replace(/♣/g, '♣');
173 | str = str.replace(/♥/g, '♥');
174 |
175 | str = str.replace(/♦/g, '♦');
176 | str = str.replace(/'/g, '\'');
177 | return str;
178 | }
179 |
180 | function strMoreDiscode(str){
181 | str = str.replace(/\r\n/g,"");
182 | str = str.replace(/\n/g,"");
183 |
184 | // str = str.replace(/code/g,"wxxxcode-style");
185 | return str;
186 | }
187 |
188 | function strDiscode(str){
189 | str = strNumDiscode(str);
190 | str = strGreeceDiscode(str);
191 | str = strcharacterDiscode(str);
192 | str = strOtherDiscode(str);
193 | str = strMoreDiscode(str);
194 | return str;
195 | }
196 | function urlToHttpUrl(url,rep){
197 |
198 | var patt1 = new RegExp("^//");
199 | var result = patt1.test(url);
200 | if(result){
201 | url = rep+":"+url;
202 | }
203 | return url;
204 | }
205 |
206 | module.exports = {
207 | strDiscode:strDiscode,
208 | urlToHttpUrl:urlToHttpUrl
209 | }
210 |
--------------------------------------------------------------------------------
/pages/secondhandstore/detail/chat/chat.wxss:
--------------------------------------------------------------------------------
1 | /* pages/consult/chat/chat.wxss */
2 | page{
3 | background-color: #eee;
4 | position: relative;
5 | }
6 | .top{
7 | position: absolute;
8 | top: 0;
9 | width: 100vw;
10 | z-index: 100;
11 | }
12 | .bound{
13 | color: white;
14 | }
15 | .bound1{
16 | height:35vh;
17 | }
18 | .bound2{
19 | height:20vh;
20 | }
21 | .prompt{
22 | width:100%;
23 | font-size: 30rpx;
24 | color: white;
25 | height: 5vh;
26 | background-color: #ddd;
27 | padding: 10rpx;
28 | box-sizing: border-box;
29 | text-align: center;
30 | }
31 | .head{
32 | width: 100%;
33 | padding:0 20rpx;
34 | box-sizing: border-box;
35 | background-color: white;
36 | font-size: 32rpx;
37 | }
38 | .head1{
39 | height: 15vh;
40 | }
41 | .head2{
42 | height: 30vh;
43 | }
44 |
45 | .head .title{
46 | display: flex;
47 | justify-content: space-between;
48 | align-items: center;
49 | height: 10vh;
50 | border-bottom: 1rpx solid #eee;
51 | }
52 |
53 | .head .title .info{
54 | display: flex;
55 | justify-content: center;
56 | align-items: center;
57 | }
58 | .head .status{
59 | font-size: 26rpx;
60 | }
61 | .head .online{
62 | color: #02dc81;
63 | }
64 | .head .leave{
65 | color: #f11010;
66 | }
67 | .head .title .info image{
68 | width: 80rpx;
69 | height: 80rpx;
70 | border-radius: 80rpx;
71 | margin-right: 20rpx;
72 | background-color: #f7f7f7;
73 | }
74 | .logimg{
75 | width: 200rpx;
76 | }
77 | .head .title .complete{
78 | color: white;
79 | background-color: red;
80 | height: 60rpx;
81 | line-height: 60rpx;
82 | display: flex;
83 | justify-content: center;
84 | align-items: center;
85 | border-radius: 10rpx;
86 | padding: 0 10rpx;
87 | font-size: 20rpx;
88 | font-weight: bold;
89 | }
90 | .head .title .complete image{
91 | width: 30rpx;
92 | height: 30rpx;
93 | }
94 |
95 | .opbox{
96 | display: flex;
97 | justify-content: flex-start;
98 | align-items: center;
99 | color: #999;
100 | height:15vh;
101 | }
102 |
103 | .opbox .one{
104 | display: flex;
105 | flex-direction: column;
106 | align-items: center;
107 | justify-content: space-around;
108 | height: 160rpx;
109 | width: 33%;
110 | }
111 | .opbox .one image{
112 | width: 80rpx;
113 | height: 80rpx;
114 | }
115 | .arrow{
116 | display: flex;
117 | justify-content: flex-end;
118 | align-items: center;
119 | height: 5vh;
120 | }
121 | .arrow image{
122 | width: 50rpx;
123 | height: 50rpx;
124 | }
125 |
126 | .container{
127 | position: relative;
128 | width: 95vw;
129 | margin: 0 auto;
130 | overflow:auto;
131 | }
132 | .msgbox{
133 | width: 100%;
134 | box-sizing: border-box;
135 | }
136 | .msgbox1{
137 | height:55vh;
138 | }
139 | .msgbox2{
140 | height:70vh;
141 | }
142 | .msgbox .one{
143 | display: flex;
144 | justify-content: flex-start;
145 | align-items: flex-start;
146 | margin: 20rpx 0;
147 | width: 100%;
148 | flex-wrap: wrap;
149 | }
150 | .msgbox .one .logo{
151 | width: 12vw;
152 | height: 12vw;
153 | margin-right: 2vw;
154 | border-radius: 12vw;
155 | background-color: white;
156 | }
157 | .msgbox .one .content{
158 | width:80vw;
159 | margin-top: 10rpx;
160 | }
161 | .msgbox .one .content view{
162 | display: inline-block;
163 | background-color: white;
164 | border-radius: 20rpx;
165 | word-break: break-all;
166 | padding: 20rpx;
167 | box-sizing: border-box;
168 | }
169 | .msgbox .one .img{
170 | width: 30vw;
171 | margin-top: 10rpx;
172 | }
173 | .msgbox .one .right{
174 | text-align: right;
175 | }
176 | .msgbox .one .imgright{
177 | margin-right: 0;
178 | margin-left: 2vw;
179 | }
180 | .time{
181 | width: 100%;
182 | margin: 20rpx 0;
183 | }
184 | .time text{
185 | background-color:#ddd;
186 | color: white;
187 | padding: 5rpx 20rpx;
188 | font-size: 25rpx;
189 | border-radius: 10rpx;
190 |
191 | }
192 |
193 | .sendbox{
194 | position: fixed;
195 | bottom: 0rpx;
196 | width: 100vw;
197 | height: 10vh;
198 | padding: 10rpx 2.5vw;
199 | background-color: #f7f7f7;
200 | display: flex;
201 | justify-content: space-between;
202 | align-items: center;
203 | box-sizing: border-box;
204 | }
205 | .sendbox image{
206 | width: 70rpx;
207 | height: 70rpx;
208 | }
209 | .sendbox input{
210 | width: 70vw;
211 | background-color: white;
212 | border-radius: 5rpx;
213 | height: 80rpx;
214 | line-height: 80rpx;
215 | border: 1rpx solid #eee;
216 | padding-left: 10rpx;
217 | }
218 | .sendbox .btn{
219 | width:30vw;
220 | display: flex;
221 | justify-content: space-around;
222 | align-items: center;
223 | }
224 | .sendbox .btn .send{
225 | padding:0 20rpx;
226 | background-color: #02c6dc;
227 | color: white;
228 | border-radius: 6rpx;
229 | height:70rpx;
230 | line-height:70rpx;
231 | }
232 | .scroll_bottom{
233 | color: #aaa;
234 | font-size:28rpx;
235 | text-align:center;
236 | line-height: 50rpx;
237 | padding-top: 50rpx;
238 | }
239 |
240 | .consult_detail_box{
241 | position: fixed;
242 | top: 0;
243 | left: 0;
244 | right: 0;
245 | bottom: 0;
246 | z-index: 200;
247 | }
248 | .consult_detail_box .backbox{
249 | position: absolute;
250 | top: 0;
251 | left: 0;
252 | right: 0;
253 | bottom: 0;
254 | background-color: black;
255 | opacity: 0.4;
256 | z-index: 300;
257 | }
258 | .consult_detail_box .cbox{
259 | position: relative;
260 | width: 95vw;
261 | background-color: white;
262 | border-radius: 20rpx;
263 | z-index: 400;
264 | box-sizing: border-box;
265 | margin: 50rpx auto 0 auto;
266 | overflow: hidden;
267 | font-size: 35rpx;
268 | }
269 | .consult_detail_box .cbox .consult_head{
270 | padding: 30rpx;
271 | color: white;
272 | background-color: rgb(57, 192, 57);
273 | }
274 | .consult_detail_box .cbox .consult_head .cmark{
275 | font-size: 50rpx;
276 | line-height: 70rpx;
277 | }
278 | .consult_detail_box .cbox .consult_head .ccontent{
279 | font-size: 28rpx;
280 | margin: 20rpx 0;
281 | color: #f7f7f7;
282 | }
283 | .consult_detail_box .cbox .consult_head .ccontent text{
284 | margin: 0 20rpx;
285 | }
286 |
287 | .consult_detail_box .cbox .ctitle{
288 | margin: 30rpx;
289 | font-size: 40rpx;
290 | }
291 | .consult_detail_box .cbox .ctitle text{
292 | color:rgb(57, 192, 57);
293 | }
294 | .consult_detail_box .cbox .ctext{
295 | color:#777;
296 | margin: 30rpx;
297 | }
298 | .consult_detail_box .cbox .cimage{
299 | margin: 20rpx;
300 | }
301 | .consult_detail_box .cbox .cimage image{
302 | width: 20%;
303 | height: 200rpx;
304 | margin: 10rpx 2%;
305 | }
306 | .consult_detail_box .del{
307 | width: 100%;
308 | text-align: center;
309 | }
310 | .consult_detail_box .del image{
311 | position: relative;
312 | width: 80rpx;
313 | height: 80rpx;
314 | margin-top: 20rpx;
315 | z-index: 400;
316 | }
317 |
318 | .assessbox{
319 | width: 100%;
320 | height: 10vh;
321 | padding: 10rpx 2.5vw;
322 | background-color: #f7f7f7;
323 | display: flex;
324 | justify-content: space-between;
325 | align-items: center;
326 | box-sizing: border-box;
327 | }
328 | .assessbox input{
329 | width: 80%;
330 | background-color: white;
331 | border-radius: 5rpx;
332 | height: 80rpx;
333 | line-height: 80rpx;
334 | border: 1rpx solid #eee;
335 | padding-left: 10rpx;
336 | }
337 | .assessbox .btn{
338 | width:20%;
339 | display: flex;
340 | justify-content: center;
341 | align-items: center;
342 | }
343 | .assessbox .btn .send{
344 | padding:0 20rpx;
345 | background-color: #02c6dc;
346 | color: white;
347 | border-radius: 6rpx;
348 | height:70rpx;
349 | line-height:70rpx;
350 | }
--------------------------------------------------------------------------------
/component/rich-parse/helper/html2json.js:
--------------------------------------------------------------------------------
1 | /**
2 | * html2Json 改造来自: https://github.com/Jxck/html2json
3 | *
4 | *
5 | * author: Di (微信小程序开发工程师)
6 | * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
7 | * 垂直微信小程序开发交流社区
8 | *
9 | * github地址: https://github.com/icindy/wxParse
10 | *
11 | * for: 微信小程序富文本解析
12 | * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
13 | */
14 |
15 | /* eslint-disable */
16 |
17 | var __placeImgeUrlHttps = "https";
18 | var __emojisReg = '';
19 | var __emojisBaseSrc = '';
20 | var __emojis = {};
21 | var wxDiscode = require('./wx-discode.js');
22 | var HTMLParser = require('./htmlparser.js');
23 | // Empty Elements - HTML 5
24 | var empty = makeMap("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr");
25 | // Block Elements - HTML 5
26 | var block = makeMap("br,a,code,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video");
27 |
28 | // Inline Elements - HTML 5
29 | var inline = makeMap("abbr,acronym,applet,b,basefont,bdo,big,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var");
30 |
31 | // Elements that you can, intentionally, leave open
32 | // (and which close themselves)
33 | var closeSelf = makeMap("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");
34 |
35 | // Attributes that have their values filled in disabled="disabled"
36 | var fillAttrs = makeMap("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected");
37 |
38 | // Special Elements (can contain anything)
39 | var special = makeMap("wxxxcode-style,script,style,view,scroll-view,block");
40 | function makeMap(str) {
41 | var obj = {}, items = str.split(",");
42 | for (var i = 0; i < items.length; i++)
43 | obj[items[i]] = true;
44 | return obj;
45 | }
46 |
47 | function q(v) {
48 | return '"' + v + '"';
49 | }
50 |
51 | function removeDOCTYPE(html) {
52 | return html
53 | .replace(/<\?xml.*\?>\n/, '')
54 | .replace(/<.*!doctype.*\>\n/, '')
55 | .replace(/<.*!DOCTYPE.*\>\n/, '');
56 | }
57 |
58 | function trimHtml(html) {
59 | return html
60 | .replace(/\r?\n+/g, '')
61 | .replace(//ig, '')
62 | .replace(/\/\*.*?\*\//ig, '')
63 | .replace(/[ ]+/g;
70 | html = html.replace(regex,"");
71 | while ((str = html.match(regex)) != null){
72 | console.log("又匹配到了...", str);
73 | html = html.replace(regex, "");
74 | }
75 |
76 |
77 | return html;
78 | }
79 |
80 | // ios 图片查询字符串有tp=webpIOS渲染不了
81 | function replacewebp(html) {
82 | return html.replace(/tp=webp/ig, '')
83 | }
84 |
85 | function html2json(html, bindName) {
86 | //处理字符串
87 | html = removeDOCTYPE(html);
88 | html = trimHtml(html);
89 | html = replacewebp(html);
90 | html = wxDiscode.strDiscode(html);
91 | html = removeMultiSpan(html);
92 | //生成node节点
93 | var bufArray = [];
94 | var results = {
95 | node: bindName,
96 | nodes: [],
97 | images:[],
98 | imageUrls:[]
99 | };
100 | var index = 0;
101 | HTMLParser(html, {
102 | start: function (tag, attrs, unary) {
103 | //debug(tag, attrs, unary);
104 | // node for this element
105 | var node = {
106 | node: 'element',
107 | tag: tag,
108 | };
109 |
110 | if (bufArray.length === 0) {
111 | node.index = index.toString()
112 | index += 1
113 | } else {
114 | var parent = bufArray[0];
115 | if (parent.nodes === undefined) {
116 | parent.nodes = [];
117 | }
118 | node.index = parent.index + '.' + parent.nodes.length
119 | }
120 |
121 | if (block[tag]) {
122 | node.tagType = "block";
123 | } else if (inline[tag]) {
124 | node.tagType = "inline";
125 | } else if (closeSelf[tag]) {
126 | node.tagType = "closeSelf";
127 | }
128 |
129 | if (attrs.length !== 0) {
130 | node.attr = attrs.reduce(function (pre, attr) {
131 | var name = attr.name;
132 | var value = attr.value;
133 | if (name == 'class') {
134 | // console.dir(value);
135 | // value = value.join("")
136 | node.classStr = value;
137 | }
138 | // has multi attibutes
139 | // make it array of attribute
140 | if (name == 'style') {
141 | // console.dir(value);
142 | // value = value.join("")
143 | node.styleStr = value +";font-size:25rpx";
144 | }
145 | if (value.match(/ /)) {
146 | value = value.split(' ');
147 | }
148 |
149 |
150 | // if attr already exists
151 | // merge it
152 | if (pre[name]) {
153 | if (Array.isArray(pre[name])) {
154 | // already array, push to last
155 | pre[name].push(value);
156 | } else {
157 | // single value, make it array
158 | pre[name] = [pre[name], value];
159 | }
160 | } else {
161 | // not exist, put it
162 | pre[name] = value;
163 | }
164 |
165 | return pre;
166 | }, {});
167 | }
168 |
169 | //对img添加额外数据
170 | if (node.tag === 'img') {
171 | node.imgIndex = results.images.length;
172 |
173 | var imgUrl;
174 |
175 | if (/\.\.\/.*/.test(node.attr.src)){
176 | imgUrl = "http://www.zyrs.xyz/" + node.attr.src;
177 | }else{
178 | imgUrl = node.attr.src;
179 | }
180 |
181 |
182 | if (imgUrl[0] == '') {
183 | imgUrl.splice(0, 1);
184 | }
185 | imgUrl = wxDiscode.urlToHttpUrl(imgUrl, __placeImgeUrlHttps);
186 | imgUrl=imgUrl.replace(/,/g," ");
187 | node.attr.src = imgUrl;
188 | node.from = bindName;
189 | results.images.push(node);
190 | results.imageUrls.push(imgUrl);
191 | }
192 |
193 | // 处理font标签样式属性
194 | if (node.tag === 'font') {
195 | var fontSize = ['x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', '-webkit-xxx-large'];
196 | var styleAttrs = {
197 | 'color': 'color',
198 | 'face': 'font-family',
199 | 'size': 'font-size'
200 | };
201 | if (!node.attr.style) node.attr.style = [];
202 | if (!node.styleStr) node.styleStr = '';
203 | for (var key in styleAttrs) {
204 | if (node.attr[key]) {
205 | var value = key === 'size' ? fontSize[node.attr[key]-1] : node.attr[key];
206 | node.attr.style.push(styleAttrs[key]);
207 | node.attr.style.push(value);
208 | node.styleStr += styleAttrs[key] + ': ' + value + ';';
209 | }
210 | }
211 | }
212 |
213 | //临时记录source资源
214 | if(node.tag === 'source'){
215 | results.source = node.attr.src;
216 | }
217 |
218 | if (unary) {
219 | // if this tag doesn't have end tag
220 | // like
221 | // add to parents
222 | var parent = bufArray[0] || results;
223 | if (parent.nodes === undefined) {
224 | parent.nodes = [];
225 | }
226 | parent.nodes.push(node);
227 | } else {
228 | bufArray.unshift(node);
229 | }
230 | },
231 | end: function (tag) {
232 | //debug(tag);
233 | // merge into parent tag
234 | var node = bufArray.shift();
235 | if (node.tag !== tag) console.error('invalid state: mismatch end tag');
236 |
237 | //当有缓存source资源时于于video补上src资源
238 | if(node.tag === 'video' && results.source){
239 | node.attr.src = results.source;
240 | delete results.source;
241 | }
242 |
243 | if (bufArray.length === 0) {
244 | results.nodes.push(node);
245 | } else {
246 | var parent = bufArray[0];
247 | if (parent.nodes === undefined) {
248 | parent.nodes = [];
249 | }
250 | parent.nodes.push(node);
251 | }
252 | },
253 | chars: function (text) {
254 | //debug(text);
255 | text = text.replace(/<\/span>/g, "");
256 | text = text.replace(/<\/div>/g, "");
257 | text = text.replace(//g,"");
258 | text = text.replace(//g, "");
259 |
260 | var node = {
261 | node: 'text',
262 | text: text,
263 | textArray:transEmojiStr(text)
264 | };
265 |
266 | if (bufArray.length === 0) {
267 | node.index = index.toString()
268 | index += 1
269 | results.nodes.push(node);
270 | } else {
271 | var parent = bufArray[0];
272 | if (parent.nodes === undefined) {
273 | parent.nodes = [];
274 | }
275 | node.index = parent.index + '.' + parent.nodes.length
276 | parent.nodes.push(node);
277 | }
278 | },
279 | comment: function (text) {
280 | //debug(text);
281 | // var node = {
282 | // node: 'comment',
283 | // text: text,
284 | // };
285 | // var parent = bufArray[0];
286 | // if (parent.nodes === undefined) {
287 | // parent.nodes = [];
288 | // }
289 | // parent.nodes.push(node);
290 | },
291 | });
292 | return results;
293 | };
294 |
295 | function transEmojiStr(str){
296 | // var eReg = new RegExp("["+__reg+' '+"]");
297 | // str = str.replace(/\[([^\[\]]+)\]/g,':$1:')
298 |
299 | var emojiObjs = [];
300 | //如果正则表达式为空
301 | if(__emojisReg.length == 0 || !__emojis){
302 | var emojiObj = {}
303 | emojiObj.node = "text";
304 | emojiObj.text = str;
305 | array = [emojiObj];
306 | return array;
307 | }
308 | //这个地方需要调整
309 | str = str.replace(/\[([^\[\]]+)\]/g,':$1:')
310 | var eReg = new RegExp("[:]");
311 | var array = str.split(eReg);
312 | for(var i = 0; i < array.length; i++){
313 | var ele = array[i];
314 | var emojiObj = {};
315 | if(__emojis[ele]){
316 | emojiObj.node = "element";
317 | emojiObj.tag = "emoji";
318 | emojiObj.text = __emojis[ele];
319 | emojiObj.baseSrc= __emojisBaseSrc;
320 | }else{
321 | emojiObj.node = "text";
322 | emojiObj.text = ele;
323 | }
324 | emojiObjs.push(emojiObj);
325 | }
326 |
327 | return emojiObjs;
328 | }
329 |
330 | function emojisInit(reg='',baseSrc="/wxParse/emojis/",emojis){
331 | __emojisReg = reg;
332 | __emojisBaseSrc=baseSrc;
333 | __emojis=emojis;
334 | }
335 |
336 | module.exports = {
337 | html2json: html2json,
338 | emojisInit:emojisInit
339 | };
340 |
341 |
--------------------------------------------------------------------------------
/utils/config.js:
--------------------------------------------------------------------------------
1 | /**首页公告 */
2 | function getIndex() {
3 | return {
4 | "notice": "我的校园助手的公告!"
5 | }
6 | }
7 | //失物招领
8 | function lostAndFound(){
9 | return {
10 | goods:[
11 | {
12 | id: 1,
13 | logo: "/img/key.jpg",
14 | goods: "书1包",
15 | name: "andy",
16 | mobile: "1234567890",
17 | addr: "四川省成都市成都七中A5 605教室"
18 | },
19 | {
20 | id: 2,
21 | logo: "/img/key.jpg",
22 | goods: "书2包",
23 | name: "andy",
24 | mobile: "1234567890",
25 | addr: ".四川省成都市成都七中A5 605教室"
26 | },
27 | {
28 | id: 3,
29 | logo: "/img/key.jpg",
30 | goods: "书3包",
31 | name: "andy",
32 | mobile: "1234567890",
33 | addr: "................................."
34 | },
35 | {
36 | id: 4,
37 | logo: "/img/key.jpg",
38 | goods: "书包4",
39 | name: "andy",
40 | mobile: "1234567890",
41 | addr: "................................."
42 | },
43 | {
44 | id: 5,
45 | logo: "/img/key.jpg",
46 | goods: "书5包",
47 | name: "andy",
48 | mobile: "1234567890",
49 | addr: "................................."
50 | },
51 | {
52 | id: 6,
53 | logo: "/img/key.jpg",
54 | goods: "书6包",
55 | name: "andy",
56 | mobile: "1234567890",
57 | addr: "................................."
58 | }
59 | ]
60 | }
61 | }
62 |
63 | //二手商品配置
64 | function getFoundthing() {
65 | return {
66 | goodsList: [
67 | {
68 | "id":1,
69 | "logo": "http://img0.imgtn.bdimg.com/it/u=1131526118,647367586&fm=26&gp=0.jpg",
70 | //辅助图片描述 4张
71 | "picdesc":[
72 | "https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3316419459,29192861&fm=27&gp=0.jpg",
73 | "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=1005384713,2963361968&fm=27&gp=0.jpg",
74 | "https://ss0.baidu.com/73x1bjeh1BF3odCf/it/u=3006455014,3110469038&fm=85&s=75102D3B170269434CF1BDCE0300E024",
75 | "https://ss0.baidu.com/73x1bjeh1BF3odCf/it/u=272289460,1872214664&fm=85&s=9F104D8568B3AA8CA4B035A70300C000"
76 | ],
77 | "avatars": "http://img1.imgtn.bdimg.com/it/u=2278739224,3680254183&fm=26&gp=0.jpg",
78 | "name": "学生一",
79 | "status": 0,
80 | "desc": "我商品描述一哦^_^",
81 | "contact": "10086",
82 | "price": "99",
83 | area: 1 //1表示南校区 2表示北校区
84 | },
85 | {
86 | "id": 2,
87 | "logo": "http://img0.imgtn.bdimg.com/it/u=1131526118,647367586&fm=26&gp=0.jpg",
88 | "picdesc": [
89 | "https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3316419459,29192861&fm=27&gp=0.jpg",
90 | "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=1005384713,2963361968&fm=27&gp=0.jpg",
91 | "https://ss0.baidu.com/73x1bjeh1BF3odCf/it/u=3006455014,3110469038&fm=85&s=75102D3B170269434CF1BDCE0300E024",
92 | "https://ss0.baidu.com/73x1bjeh1BF3odCf/it/u=272289460,1872214664&fm=85&s=9F104D8568B3AA8CA4B035A70300C000"
93 | ],
94 | "avatars": "http://img1.imgtn.bdimg.com/it/u=2278739224,3680254183&fm=26&gp=0.jpg",
95 | "name": "学生二",
96 | "status": 1,
97 | "desc": "我商品描述二哦^_^我商品描述2哦^_^",
98 | "contact": "10086",
99 | "price": "99", area: 1 //1表示南校区 2表示北校区
100 | },
101 | {
102 | "id": 3,
103 | "logo": "http://img0.imgtn.bdimg.com/it/u=1131526118,647367586&fm=26&gp=0.jpg",
104 | "picdesc": [
105 | "https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3316419459,29192861&fm=27&gp=0.jpg",
106 | "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=1005384713,2963361968&fm=27&gp=0.jpg",
107 | "https://ss0.baidu.com/73x1bjeh1BF3odCf/it/u=3006455014,3110469038&fm=85&s=75102D3B170269434CF1BDCE0300E024",
108 | "https://ss0.baidu.com/73x1bjeh1BF3odCf/it/u=272289460,1872214664&fm=85&s=9F104D8568B3AA8CA4B035A70300C000"
109 | ],
110 | "avatars": "http://img1.imgtn.bdimg.com/it/u=2278739224,3680254183&fm=26&gp=0.jpg",
111 | "name": "学生三",
112 | "status": 1,
113 | "desc": "我商品描述三哦^_^我商品描述3哦^_^我商品描述3哦^_^",
114 | "contact": "10086",
115 | "price": "99", area: 1 //1表示南校区 2表示北校区
116 | },
117 | {
118 | "id": 10,
119 | "logo": "http://img0.imgtn.bdimg.com/it/u=1131526118,647367586&fm=26&gp=0.jpg",
120 | "picdesc": [
121 | "https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3316419459,29192861&fm=27&gp=0.jpg",
122 | "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=1005384713,2963361968&fm=27&gp=0.jpg",
123 | "https://ss0.baidu.com/73x1bjeh1BF3odCf/it/u=3006455014,3110469038&fm=85&s=75102D3B170269434CF1BDCE0300E024",
124 | "https://ss0.baidu.com/73x1bjeh1BF3odCf/it/u=272289460,1872214664&fm=85&s=9F104D8568B3AA8CA4B035A70300C000"
125 | ],
126 | "avatars": "http://img1.imgtn.bdimg.com/it/u=2278739224,3680254183&fm=26&gp=0.jpg",
127 | "name": "学生四",
128 | "status": 0,
129 | "desc": "我商品描述四哦^_^我商品描述4哦^_^",
130 | "contact": "10086",
131 | "price": "99", area: 1 //1表示南校区 2表示北校区
132 | },
133 | {
134 | "id": 4,
135 | "logo": "http://img0.imgtn.bdimg.com/it/u=1131526118,647367586&fm=26&gp=0.jpg",
136 | "picdesc": [
137 | "https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3316419459,29192861&fm=27&gp=0.jpg",
138 | "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=1005384713,2963361968&fm=27&gp=0.jpg",
139 | "https://ss0.baidu.com/73x1bjeh1BF3odCf/it/u=3006455014,3110469038&fm=85&s=75102D3B170269434CF1BDCE0300E024",
140 | "https://ss0.baidu.com/73x1bjeh1BF3odCf/it/u=272289460,1872214664&fm=85&s=9F104D8568B3AA8CA4B035A70300C000"
141 | ],
142 | "avatars": "http://img1.imgtn.bdimg.com/it/u=2278739224,3680254183&fm=26&gp=0.jpg",
143 | "name": "学生五",
144 | "status": 0,
145 | "desc": "我商品描述哦5^_^",
146 | "contact": "10086",
147 | "price": "99", area: 1 //1表示南校区 2表示北校区
148 | },
149 | {
150 | "id": 5,
151 | "logo": "http://img0.imgtn.bdimg.com/it/u=1131526118,647367586&fm=26&gp=0.jpg",
152 | "picdesc": [
153 | "https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3316419459,29192861&fm=27&gp=0.jpg",
154 | "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=1005384713,2963361968&fm=27&gp=0.jpg",
155 | "https://ss0.baidu.com/73x1bjeh1BF3odCf/it/u=3006455014,3110469038&fm=85&s=75102D3B170269434CF1BDCE0300E024",
156 | "https://ss0.baidu.com/73x1bjeh1BF3odCf/it/u=272289460,1872214664&fm=85&s=9F104D8568B3AA8CA4B035A70300C000"
157 | ],
158 | "avatars": "http://img1.imgtn.bdimg.com/it/u=2278739224,3680254183&fm=26&gp=0.jpg",
159 | "name": "学生六",
160 | "status": 0,
161 | "desc": "我商品描述5哦^_^",
162 | "contact": "10086",
163 | "price": "99", area: 2 //1表示南校区 2表示北校区
164 | },
165 | {
166 | "id": 6,
167 | "logo": "http://img0.imgtn.bdimg.com/it/u=1131526118,647367586&fm=26&gp=0.jpg",
168 | "picdesc": [
169 | "https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3316419459,29192861&fm=27&gp=0.jpg",
170 | "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=1005384713,2963361968&fm=27&gp=0.jpg",
171 | "https://ss0.baidu.com/73x1bjeh1BF3odCf/it/u=3006455014,3110469038&fm=85&s=75102D3B170269434CF1BDCE0300E024",
172 | "https://ss0.baidu.com/73x1bjeh1BF3odCf/it/u=272289460,1872214664&fm=85&s=9F104D8568B3AA8CA4B035A70300C000"
173 | ],
174 | "avatars": "http://img1.imgtn.bdimg.com/it/u=2278739224,3680254183&fm=26&gp=0.jpg",
175 | "name": "学生七",
176 | "status": 0,
177 | "desc": "我商品描述6哦^_^",
178 | "contact": "10086",
179 | "price": "99", area: 1 //1表示南校区 2表示北校区
180 | },
181 | {
182 | "id":7,
183 | "logo": "http://img0.imgtn.bdimg.com/it/u=1131526118,647367586&fm=26&gp=0.jpg",
184 | "picdesc": [
185 | "https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3316419459,29192861&fm=27&gp=0.jpg",
186 | "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=1005384713,2963361968&fm=27&gp=0.jpg",
187 | "https://ss0.baidu.com/73x1bjeh1BF3odCf/it/u=3006455014,3110469038&fm=85&s=75102D3B170269434CF1BDCE0300E024",
188 | "https://ss0.baidu.com/73x1bjeh1BF3odCf/it/u=272289460,1872214664&fm=85&s=9F104D8568B3AA8CA4B035A70300C000"
189 | ],
190 | "avatars": "http://img1.imgtn.bdimg.com/it/u=2278739224,3680254183&fm=26&gp=0.jpg",
191 | "name": "学生八",
192 | "status":0,
193 | "desc": "我商品描述7哦^_^",
194 | "contact": "10086",
195 | "price": "99", area: 2//1表示南校区 2表示北校区
196 | },
197 | {
198 | "id": 8,
199 | "logo": "http://img0.imgtn.bdimg.com/it/u=1131526118,647367586&fm=26&gp=0.jpg",
200 | "picdesc": [
201 | "https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3316419459,29192861&fm=27&gp=0.jpg",
202 | "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=1005384713,2963361968&fm=27&gp=0.jpg",
203 | "https://ss0.baidu.com/73x1bjeh1BF3odCf/it/u=3006455014,3110469038&fm=85&s=75102D3B170269434CF1BDCE0300E024",
204 | "https://ss0.baidu.com/73x1bjeh1BF3odCf/it/u=272289460,1872214664&fm=85&s=9F104D8568B3AA8CA4B035A70300C000"
205 | ],
206 | "avatars": "http://img1.imgtn.bdimg.com/it/u=2278739224,3680254183&fm=26&gp=0.jpg",
207 | "name": "学生九",
208 | "status":0,
209 | "desc": "我商品描述8哦^_^",
210 | "contact": "10086",
211 | "price": "99", area: 1 //1表示南校区 2表示北校区
212 | },
213 | {
214 | "id": 9,
215 | "logo": "http://img0.imgtn.bdimg.com/it/u=1131526118,647367586&fm=26&gp=0.jpg",
216 | "picdesc": [
217 | "https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3316419459,29192861&fm=27&gp=0.jpg",
218 | "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=1005384713,2963361968&fm=27&gp=0.jpg",
219 | "https://ss0.baidu.com/73x1bjeh1BF3odCf/it/u=3006455014,3110469038&fm=85&s=75102D3B170269434CF1BDCE0300E024",
220 | "https://ss0.baidu.com/73x1bjeh1BF3odCf/it/u=272289460,1872214664&fm=85&s=9F104D8568B3AA8CA4B035A70300C000"
221 | ],
222 | "avatars": "http://img1.imgtn.bdimg.com/it/u=2278739224,3680254183&fm=26&gp=0.jpg",
223 | "name": "学生十",
224 | "status": 0,
225 | "desc": "我商品描述9哦^_^",
226 | "contact": "10086",
227 | "price": "99", area:2 //1表示南校区 2表示北校区
228 | }
229 | ]
230 | }
231 | }
232 | //跑腿代购配置
233 | function getShopHelper(){
234 | return {
235 | //南校区
236 | shophelper0:[
237 | {
238 | id:1,
239 | goods:"火腿肠",
240 | addr:"6舍一栋",
241 | sex:"男",
242 | name:"唐一",
243 | avatarurl:"https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=274612981,3403090092&fm=27&gp=0.jpg",
244 | contact:"15520449931",
245 | money:3,
246 | time:"2019-3-19 16:35:25",
247 | status:0,
248 | },
249 | {
250 | id: 2,
251 | goods: "矿泉水",
252 | addr: "6舍一栋",
253 | sex: "女",
254 | name: "梅花",
255 | avatarurl: "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=274612981,3403090092&fm=27&gp=0.jpg",
256 | contact: "15520449931",
257 | money: 3,
258 | time: "2019-3-19 13:35:25",
259 | status: 1
260 | },
261 | {
262 | id: 3,
263 | goods: "辣条",
264 | addr: "6舍一栋",
265 | sex: "女",
266 | name: "梅花",
267 | avatarurl: "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=274612981,3403090092&fm=27&gp=0.jpg",
268 | contact: "15520449931",
269 | money: 3,
270 | time: "2019-3-19 09:35:25",
271 | status: 0
272 | },
273 | {
274 | id: 4,
275 | goods: "辣条",
276 | addr: "6舍一栋",
277 | sex: "女",
278 | name: "梅花",
279 | avatarurl: "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=274612981,3403090092&fm=27&gp=0.jpg",
280 | contact: "15520449931",
281 | money: 3,
282 | time: "2019-3-19 09:35:25",
283 | status: 0
284 | },
285 | {
286 | id: 5,
287 | goods: "辣条",
288 | addr: "6舍一栋",
289 | sex: "女",
290 | name: "梅花",
291 | avatarurl: "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=274612981,3403090092&fm=27&gp=0.jpg",
292 | contact: "15520449931",
293 | money: 3,
294 | time: "2019-3-19 09:35:25",
295 | status: 0
296 | },
297 | {
298 | id: 6,
299 | goods: "辣条",
300 | addr: "6舍一栋",
301 | sex: "女",
302 | name: "梅花",
303 | avatarurl: "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=274612981,3403090092&fm=27&gp=0.jpg",
304 | contact: "15520449931",
305 | money: 3,
306 | time: "2019-3-19 09:35:25",
307 | status: 0
308 | }
309 | ],
310 | //北校区
311 | shophelper1: [
312 | {
313 | id: 1,
314 | goods: "小辣棒",
315 | addr: "5舍一栋",
316 | sex: "男",
317 | name: "唐一",
318 | avatarurl: "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=274612981,3403090092&fm=27&gp=0.jpg",
319 | contact: "15520449931",
320 | money: 3,
321 | time: "2019-3-19 16:35:25",
322 | status: 1
323 | },
324 | {
325 | id: 2,
326 | goods: "大辣条",
327 | addr: "6舍一栋",
328 | sex: "女",
329 | name: "梅花",
330 | avatarurl: "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=274612981,3403090092&fm=27&gp=0.jpg",
331 | contact: "15520449931",
332 | money: 3,
333 | time: "2019-3-19 13:35:25",
334 | status: 0
335 |
336 | },
337 | {
338 | id: 3,
339 | goods: "大面筋",
340 | addr: "6舍一栋",
341 | sex: "女",
342 | name: "梅花",
343 | avatarurl: "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=274612981,3403090092&fm=27&gp=0.jpg",
344 | contact: "15520449931",
345 | money: 3,
346 | time: "2019-3-19 09:35:25",
347 | status: 0
348 | }
349 | ],
350 | }
351 | }
352 |
353 |
354 | module.exports={
355 | getIndex: getIndex,
356 | getFoundthing: getFoundthing,
357 | getShopHelper: getShopHelper,
358 | lostAndFound: lostAndFound
359 | }
--------------------------------------------------------------------------------