首次提交:初始化项目

This commit is contained in:
vv 2026-03-12 14:47:46 +08:00
parent 22a1e993da
commit 2585b559a8
239 changed files with 12829 additions and 2 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View File

@ -1,3 +1,39 @@
# fireflysg-wxapp
# miniProject
萤火社贡微信小程序
#### 介绍
{**以下是 Gitee 平台说明,您可以替换此简介**
Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN。专为开发者提供稳定、高效、安全的云端软件开发协作平台
无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)}
#### 软件架构
软件架构说明
#### 安装教程
1. xxxx
2. xxxx
3. xxxx
#### 使用说明
1. xxxx
2. xxxx
3. xxxx
#### 参与贡献
1. Fork 本仓库
2. 新建 Feat_xxx 分支
3. 提交代码
4. 新建 Pull Request
#### 特技
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

39
app.js Normal file
View File

@ -0,0 +1,39 @@
//app.js
App({
onLaunch: function () {
// 展示本地存储能力
var logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
// 登录
wx.login({
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
}
})
// 获取用户信息
wx.getSetting({
success: res => {
if (res.authSetting['scope.userInfo']) {
// 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
wx.getUserInfo({
success: res => {
// 可以将 res 发送给后台解码出 unionId
this.globalData.userInfo = res.userInfo
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// 所以此处加入 callback 以防止这种情况
if (this.userInfoReadyCallback) {
this.userInfoReadyCallback(res)
}
}
})
}
}
})
},
globalData: {
userInfo: null
}
})

89
app.json Normal file
View File

@ -0,0 +1,89 @@
{
"usingComponents": {
"empty": "/component/empty/empty"
},
"pages": [
"pages/home/home",
"pages/my/login",
"pages/vedio/index",
"pages/vedio/detail",
"pages/article/publish3",
"pages/achieve/detail",
"pages/my/achievement",
"pages/buy/cart",
"pages/my/orderList",
"pages/buy/index",
"pages/my/addressList",
"pages/my/addressAdd",
"pages/my/publishList",
"pages/my/publish",
"pages/article/publish",
"pages/article/publish2",
"pages/article/publish1",
"pages/shopList/shopDetail",
"pages/shopList/businessDetail",
"pages/shopList/index",
"pages/my/index",
"pages/article/detail",
"pages/index/index",
"pages/shopList/success",
"pages/near/index",
"pages/logs/logs",
"component/upload/upload",
"pages/add/add",
"pages/category/category"
],
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
},
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "Weixin",
"navigationBarTextStyle": "black"
},
"style": "v2",
"sitemapLocation": "sitemap.json",
"requiredPrivateInfos": [
"chooseLocation",
"getLocation",
"choosePoi"
],
"tabBar": {
"color": "#999999",
"selectedColor": "#000000",
"list": [
{
"iconPath": "./images/bar/icon_home.png",
"selectedIconPath": "./images/bar/icon_home_cur.png",
"pagePath": "pages/home/home",
"text": "首页"
},
{
"iconPath": "./images/bar/icon_near.png",
"selectedIconPath": "./images/bar/icon_near_cur.png",
"pagePath": "pages/near/index",
"text": "商家福利"
},
{
"iconPath": "./images/bar/icon_add.png",
"selectedIconPath": "./images/bar/add_cur.png",
"pagePath": "pages/add/add"
},
{
"iconPath": "./images/bar/icon_list.png",
"selectedIconPath": "./images/bar/icon_list_cur.png",
"pagePath": "pages/shopList/index",
"text": "社贡商城"
},
{
"iconPath": "./images/bar/icon_center.png",
"selectedIconPath": "./images/bar/icon_center_cur.png",
"pagePath": "pages/my/index",
"text": "个人中心"
}
]
}
}

147
app.wxss Normal file
View File

@ -0,0 +1,147 @@
/**app.wxss**/
page {
font-family: PingFangSC-Regular;
background-color: #f3f6fa;
}
.yellow {
color: #ffc44f;
}
.red {
color: #ff1616;
}
.blue {
color: #194f82;
}
.light-blue {
color: #5cbaea;
}
.white {
color: #fff;
}
.red-bg {
background-color: #ff1616;
}
.gray-bg {
background-color: #f3f6fa;
}
.white-bg {
background-color: #fff;
}
.yellow-bg {
background-color: #ffc44f;
}
.blue-bg {
background-color: #194f82;
}
.light-blue-bg {
background-color: #5cbaea;
}
.light-orange-bg {
background-color: #ff6925;
}
/*theme color end*/
.flex-row {
display: flex;
}
.box-center {
-webkit-box-align: center;
}
.flex-col {
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1;
width: 100%;
text-align: left;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: left;
-webkit-box-align: left;
}
.flex-right {
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1;
width: 100%;
text-align: right;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: right;
-webkit-box-align: right;
}
.flex-center {
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1;
width: 100%;
text-align: center;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: center;
-webkit-box-align: center;
}
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 200rpx 0;
box-sizing: border-box;
}
.tc{
text-align: center;
}
button::after{
border:none;
}
.fs0{
font-size: 0;
}
.space{
padding-left: 30rpx;
padding-right: 30rpx;
}
.box-wrap{
padding: 30rpx;
}
.pub-btn{
width: 90%;
/* height: 88rpx; */
margin: 0 auto;
border-radius: 10rpx;
background: #3D98FF;
font-size: 32rpx;
color: #fff;
}
.text-left{
text-align: left;
}
.arrow {
width: 10rpx;
height: 16rpx;
margin-left: 12rpx;
}
.mt10{
margin-top: 10rpx;
}
.mt20{
margin-top: 20rpx;
}

11
bash.exe.stackdump Normal file
View File

@ -0,0 +1,11 @@
Stack trace:
Frame Function Args
00800000010 001800638AE (00180272F10, 00180263FD1, 00800000010, 000FFFFBA10)
00800000010 0018004973A (00100002000, 000FFFFCBB0, 001803480C8, 00000000002)
00800000010 00180049772 (00000000002, 001803483D8, 00800000010, 00000000008)
00800000010 0018005CBDD (000FFFFCCE0, 000FFFFCC45, 00000000000, 205C745C615C635C)
000FFFFCBBC 0018005CD4F (635C655C205C265C, 3E5C205C6F5C685C, 765C655C645C2F5C, 795C745C745C2F5C)
000FFFFCCE0 00180049EE8 (00000000000, 00000000000, 00000000000, 00000000000)
000FFFFFFF0 00180048846 (00000000000, 00000000000, 00000000000, 00000000000)
000FFFFFFF0 001800488F4 (00000000000, 00000000000, 00000000000, 00000000000)
End of stack trace

View File

@ -0,0 +1,23 @@
// component/articleList/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,56 @@
<!--component/articleList/index.wxml-->
<view class="art-list-wrap">
<view class="art-list-con flex-row">
<view class="art-list flex-col">
<view class="list-title">社会新闻社会新闻社会新闻社会新闻</view>
<view class="list-intro">今天我们来讲讲社会新闻的重要性,目前春节将至,回家的人越来越多......</view>
<view class="flex-row list-bot">
<view class="flex-col list-left">2020.12.21</view>
<view class="list-right">公开</view>
</view>
</view>
<view class="list-img">
<image class="pic" src="/images/buy/pic.png"></image>
</view>
</view>
<view class="art-list-con flex-row">
<view class="art-list flex-col">
<view class="list-title">社会新闻社会新闻社会新闻社会新闻</view>
<view class="list-intro">今天我们来讲讲社会新闻的重要性,目前春节将至,回家的人越来越多......</view>
<view class="flex-row list-bot">
<view class="flex-col list-left">2020.12.21</view>
<view class="list-right">仅自己可见</view>
</view>
</view>
<view class="list-img">
<image class="pic" src="/images/buy/pic.png"></image>
</view>
</view>
<view class="art-list-con flex-row">
<view class="art-list flex-col">
<view class="list-title">社会新闻社会新闻社会新闻社会新闻</view>
<view class="list-intro">今天我们来讲讲社会新闻的重要性,目前春节将至,回家的人越来越多......</view>
<view class="flex-row list-bot">
<view class="flex-col list-left">2020.12.21</view>
<view class="list-right">公开</view>
</view>
</view>
<view class="list-img">
<image class="pic" src="/images/buy/pic.png"></image>
</view>
</view>
<view class="art-list-con flex-row">
<view class="art-list flex-col">
<view class="list-title">社会新闻社会新闻社会新闻社会新闻</view>
<view class="list-intro">今天我们来讲讲社会新闻的重要性,目前春节将至,回家的人越来越多......</view>
<view class="flex-row list-bot">
<view class="flex-col list-left">2020.12.21</view>
<view class="list-right">公开</view>
</view>
</view>
<view class="list-img">
<image class="pic" src="/images/buy/pic.png"></image>
</view>
</view>
<view class="no-more">没有更多了......</view>
</view>

View File

@ -0,0 +1,82 @@
.art-list-wrap {
padding: 0 30rpx 50rpx 30rpx;
background: #fff;
}
.art-list-con {
margin-top: 20rpx;
background: #F8F8F8;
border-radius: 10rpx;
padding: 15rpx 30rpx;
}
.list-title {
font-size: 26rpx;
color: #333;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
}
.list-intro {
padding-top: 12rpx;
font-size: 20rpx;
color: #666;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.list-img {
width: 165rpx;
height: 159rpx;
}
.flex-col {
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1;
width: 100%;
text-align: left;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: left;
-webkit-box-align: left;
}
.flex-row {
display: flex;
}
.list-img {
font-size: 0;
margin-left: 45rpx;
}
.pic {
width: 165rpx;
height: 159rpx;
}
.list-bot {
padding-top: 28rpx;
}
.list-left {
color: #A0A0A0;
font-size: 18rpx;
}
.list-right {
color: #3D98FF;
font-size: 18rpx;
}
.no-more {
padding-top: 80rpx;
text-align: center;
color: #A0A0A0;
font-size: 20rpx;
}

34
component/empty/empty.js Normal file
View File

@ -0,0 +1,34 @@
// components/empty/empty.js
Component({
/**
* 组件的属性列表
*/
properties: {
emptyImg: {
type: String,
value: 'https://img01.yzcdn.cn/vant/empty-image-default.png'
},
emptyDes: {
type: String,
value: '暂无数据'
},
arrowShow: {
type: Boolean,
value: false
},
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,5 @@
<!--components/empty/empty.wxml-->
<view class='empty-con'>
<image class='img-sty' src='{{emptyImg}}' mode="widthFix"></image>
<text class='des-sty'>{{emptyDes}}</text>
</view>

View File

@ -0,0 +1,28 @@
/* components/empty/empty.wxss */
.empty-con {
/* text-align: center;
position: fixed;
width: 320rpx;
height: 294rpx;
left: 50%;
top: 60%;
margin-left: -160rpx;
margin-top: -147rpx; */
text-align: center;
width: 100%;
}
.img-sty {
/* width: 240rpx;
height: 240rpx; */
width: 50%;
margin:0 auto;
}
.des-sty {
padding-top: 6rpx;
display: block;
font-size: 28rpx;
color: #a4a8bc;
}

View File

@ -0,0 +1,23 @@
// component/goodsList/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,36 @@
<!--component/goodsList/index.wxml-->
<view class="goods-wrap">
<view class="goods-list">
<view class="goods-img">
<image class="pic" src="/images/buy/pic.png"></image>
</view>
<view class="goods-intro">
前排出二手摄像机九成新Nikon/尼康型号co olpix
</view>
<view class="list-price">
¥<text>2580</text>积分
</view>
</view>
<view class="goods-list">
<view class="goods-img">
<image class="pic" src="/images/buy/pic.png"></image>
</view>
<view class="goods-intro">
前排出二手摄像机九成新Nikon/尼康型号co olpix
</view>
<view class="list-price">
¥<text class="price">2580</text>积分
</view>
</view>
<view class="goods-list">
<view class="goods-img">
<image class="pic" src="/images/buy/pic.png"></image>
</view>
<view class="goods-intro">
前排出二手摄像机九成新Nikon/尼康型号co olpix
</view>
<view class="list-price">
¥<text class="price">2580</text>积分
</view>
</view>
</view>

View File

@ -0,0 +1,45 @@
/* component/goodsList/index.wxss */
.goods-wrap{
padding: 0 30rpx;
clear: both;
overflow: hidden;
}
.goods-list{
margin-top: 30rpx;
width: 48%;
background: #fff;
border-radius: 10rpx;
float: left;
padding-bottom: 19rpx;
}
.goods-list:nth-child(odd){
margin-right: 4%;
}
.goods-img{
font-size: 0;
}
.pic{
width: 100%;
height: 230rpx;
}
.goods-intro{
margin-top: 13rpx;
padding: 0 12rpx;
font-size: 24rpx;
color: #333333;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.list-price{
margin-top: 14rpx;
color: #F31717;
padding: 0 12rpx;
font-size: 20rpx;
}
.price{
display: inline-block;
font-size: 26rpx;
margin: 0 6rpx;
}

View File

@ -0,0 +1,27 @@
// component/payLayer/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
tapEvent(){
console.log('1111')
const et = 'hide'
this.triggerEvent('callSomeFun', et)
}
}
})

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,20 @@
<!--component/payLayer/index.wxml-->
<view class="mask-layer">
<view class="layer-con">
<view class="layer-title flex-row fs0">
<view class="title-con flex-col">支付方式</view>
<image src="/images/buy/close.png" bindtap="tapEvent" class="close-img"></image>
</view>
<view class="pay-list-wrap">
<view class="pay-list flex-row pay-list1">
<view class="flex-col">
<image src="/images/buy/jifen.png" class="jifen"></image><text>11111</text>
</view>
<image src="/images/buy/right.png" class="right"></image>
</view>
</view>
<view class="btn-con">
<button class="sum-btn" bindtap="tapEvent">确定</button>
</view>
</view>
</view>

View File

@ -0,0 +1,84 @@
.mask-layer{
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: rgb(0, 0, 0, 0.6);
z-index: 99;
}
.flex-col {
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1;
width: 100%;
text-align: left;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: left;
-webkit-box-align: left;
}
.flex-row {
display: flex;
}
.layer-title{
padding: 20rpx;
font-size: 0;
}
.layer-con{
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background: #fff;
border-radius: 40rpx 40rpx 0px 0px;
overflow: hidden;
}
.title-con{
text-align: center;
color: #333333;
font-size: 30rpx;
}
.close-img{
margin-top: 10rpx;
width: 24rpx;
height: 24rpx;
}
.pay-list-wrap{
margin-top: 40rpx;
padding: 0 30rpx;
height: 300rpx;
}
.pay-list1:first-child{
border-top: 1px solid #e8e8e8;
}
.pay-list{
padding: 24rpx 0;
font-size: 0;
border-bottom: 1px solid #E8E8E8;
}
.right{
width: 27rpx;
height: 18rpx;
}
.jifen{
width: 30rpx;
height: 30rpx;
}
.list-text{
vertical-align: 4rpx;
font-size: 28rpx;
color: #333;
margin-left: 12rpx;
}
.btn-con{
padding: 29rpx 54rpx;
}
.sum-btn{
width: 100%;
background: #3D98FF;
border-radius: 10rpx;
font-size: 32rpx;
color: 32rpx;
color: #fff;
}

103
component/stepper/index.js Normal file
View File

@ -0,0 +1,103 @@
Component({
properties: {
value: {
type: Number,
value: 1,
},
min: {
type: Number,
value: 1,
},
max: {
type: Number,
value: 10000,
},
step: {
type: Number,
value: 1
},
disabled: {
type: Boolean,
value: false
},
index: {
type: Number,
value: 0
},
},
data: {
},
methods: {
//通过step属性设置每次点击增加或减少按钮时变化的值默认为1
getScale() {
let scale = 1;
if (this.data.step != parseInt(this.data.step)) {
//微信小程序的小数计算会出现偏差导致产生很长的无限循环的数,在这块处理一下。
scale = Math.pow(10, (this.data.step + '').split('.')[1].length)
}
return scale;
},
//输入操作处理
blur: function (e) {
let value = e.detail.value
if (value) {
value = +value
if (value > this.data.max) {
value = this.data.max
} else if (value < this.data.min) {
value = this.data.min
}
} else {
value = this.data.min
}
if (value != this.data.value) {
this.setData({
value: value
})
}
this.handleChange(value, "blur")
},
calcNum: function (type) {
if (this.data.disabled) {
return
}
const scale = this.getScale()
let num = this.data.value * scale
let step = this.data.step * scale
if (type === 'reduce') {
num -= step
} else if (type === 'plus') {
num += step
}
let value = num / scale
if (type === "plus" && value < this.data.min) {
value = this.data.min
} else if (type === "reduce" && value > this.data.max) {
value = this.data.max
}
if (value < this.data.min || value > this.data.max) {
return
}
this.handleChange(value, type)
},
//增加按钮处理
plus: function () {
this.calcNum("plus")
},
//减少按钮处理
reduce: function () {
this.calcNum("reduce")
},
//事件绑定返回值有三个value:值 type:类型(输入,增加,减少) index当前组件的索引
handleChange(value, type) {
if (this.data.disabled) {
return
}
this.triggerEvent('change', {
value: value,
type: type,
index: this.data.index
})
}
}
})

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,5 @@
<view class="cl-stepper" data-index="{{index}}">
<view class="cl-stepper__minus {{disabled || min>=value?'cl-stepper__minus--disabled':''}}" bindtap="reduce"></view>
<input type="number" disabled="{{disabled}}" class="cl-stepper__input" bindblur="blur" value="{{value}}"></input>
<view class="cl-stepper__plus {{disabled || value>=max?'cl-stepper__minus--disabled':''}}" bindtap="plus"></view>
</view>

View File

@ -0,0 +1,89 @@
.cl-stepper {
font-size: 0
}
.cl-stepper__minus,
.cl-stepper__plus {
position: relative;
display: inline-block;
box-sizing: border-box;
margin: 0;
padding: 0;
vertical-align: middle;
border: 0;
background-color: #f7f8fa;
color: #666;
width: 42rpx;
height: 42rpx;
border-radius: 10rpx;
}
.cl-stepper__minus:before,
.cl-stepper__plus:before {
width: 10px;
height: 2px
}
.cl-stepper__minus:after,
.cl-stepper__plus:after {
width: 2px;
height: 10px
}
.cl-stepper__minus:after,
.cl-stepper__minus:before,
.cl-stepper__plus:after,
.cl-stepper__plus:before {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
margin: auto;
background-color: currentColor;
content: ""
}
.cl-stepper__minus:active,
.cl-stepper__plus:active {
background-color: #e5e5e5;
}
.cl-stepper__minus--disabled,
.cl-stepper__plus--disabled {
color: #b2b2b2;
background-color: #f7f8fa;
}
.cl-stepper__minus--disabled,
.cl-stepper__minus--disabled.cl-stepper__minus--hover,
.cl-stepper__minus--disabled.cl-stepper__plus--hover,
.cl-stepper__plus--disabled,
.cl-stepper__plus--disabled.cl-stepper__minus--hover,
.cl-stepper__plus--disabled.cl-stepper__plus--hover {
background-color: #f7f8fa;
}
.cl-stepper__minus:after {
display: none
}
.cl-stepper__input {
display: inline-block;
box-sizing: border-box;
min-height: 0;
margin: 1px;
padding: 1px;
text-align: center;
vertical-align: middle;
border: 0;
border-width: 1px 0;
border-radius: 0;
-webkit-appearance: none;
font-size: 14px;
color: #333333;
width: 32px;
height: 28px;
}
.cl-stepper__input--disabled {
color: #c8c9cc;
background-color: #f2f3f5;
}

View File

@ -0,0 +1,123 @@
// components/swiper.js
var request = require('../../utils/request.js')
Component({
/**
* 组件的属性列表
*/
properties: {
source: {
type: Number,
value: 0
},
},
lifetimes:{
attached: function() {
// this.getData()
}
},
/**
* 组件的初始数据
*/
data: {
itemList:[],
imgList:["https://mmbiz.qpic.cn/mmbiz_png/jJtBNByXZuHuxiaoUr9CGcn4ibGpJxeNXRTG4Du0I2QqibHvDcwaDWcmqvN7cRROYoIO3k4V5ok8SsH5ABTfMAjnw/0?wx_fmt=png"],
testurl:'https://mmbiz.qpic.cn/mmbiz_png/jJtBNByXZuHuxiaoUr9CGcn4ibGpJxeNXRTG4Du0I2QqibHvDcwaDWcmqvN7cRROYoIO3k4V5ok8SsH5ABTfMAjnw/0?wx_fmt=png'
},
/**
* 组件的方法列表
*/
methods: {
getData(){
request._get('/guest/finals/image',{target:this.data.source},
(res=>{
if(res.result == 0){
this.setData({
itemList:res.data
})
console.log(res.data)
}
})
)
},
Authorization(e){
let imgUrl=e.currentTarget.dataset.imgurl
this.setData({
testurl:imgUrl
})
wx.getSetting({
success:(res)=>{
if (!res.authSetting['scope.writePhotosAlbum']) {
wx.authorize({
scope: 'scope.writePhotosAlbum',
success:()=> {
// 同意授权
this.saveImg();
},
fail: (res) =>{
console.log(res);
}
})
}else{
// 已经授权了
this.saveImg();
}
},
fail:(res)=>{
console.log(res)
}
})
},
saveImg(){
console.log(this.data.testurl)
wx.getImageInfo({
src: this.data.testurl,
success:(res)=> {
let path = res.path;
wx.saveImageToPhotosAlbum({
filePath:path,
success:(res)=> {
wx.hideLoading();
setTimeout(() => {
wx.showToast({
title: '图片保存成功',
icon: 'success',
duration:3000
})
}, 200);
},
fail:(res)=>{
wx.hideLoading();
setTimeout(() => {
wx.showToast({
title: '图片保存失败',
icon: 'error',
duration:3000
})
}, 200);
}
})
},
fail:(res)=> {
console.log(res);
}
})
},
jumpTarget(e){
let imghref=e.currentTarget.dataset.imghref
if(imghref == 0){
wx.switchTab({
url: `/pages/baoming/geren`
})
}else if(imghref == 1){
wx.navigateTo({
url: `/pages/home/jpkc`
})
}else if(imghref == 2){
wx.navigateTo({
url: `/pages/baoming/erweima`
})
}
}
}
})

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,9 @@
<!--components/swiper.wxml-->
<view>
<swiper indicator-dots="{{true}}"
autoplay="{{true}}" interval="2000" duration="500">
<swiper-item wx:for='{{itemList}}'>
<image src="{{item.imgUrl}}" class="banner" data-imghref="{{item.imgHref}}" data-imgurl="{{item.imgUrl}}" mode="widthFix" bindlongpress="Authorization" bindtap="jumpTarget"></image>
</swiper-item>
</swiper>
</view>

View File

@ -0,0 +1,7 @@
/* components/swiper.wxss */
.banner{
width: 100%;
}
swiper{
height: 420rpx;
}

View File

@ -0,0 +1,36 @@
// component/tabList/test.js
Component({
/**
* 组件的属性列表
*/
properties: {
step:{
type:Number,
value: '2'
}
},
/**
* 组件的初始数据
*/
data: {
addShow: false
},
/**
* 组件的方法列表
*/
methods: {
jumpUrl(param){
wx.navigateTo({
url: param.currentTarget.dataset.url
})
},
pubEvent(){
this.setData({
addShow: !this.data.addShow
})
console.log('发多少简历开放电视剧偶尔')
}
}
})

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"component": true
}

View File

@ -0,0 +1,31 @@
<!--component/tabList/index.wxml-->
<view class="tab-list flex-row">
<view class="list-item flex-col tc {{step==1?'list-cur':''}}" data-url="/pages/home/home" bindtap="jumpUrl">
<image src="/images/bar/icon_home.png" class="tab-img1"></image>
<image src="/images/bar/icon_home_cur.png" class="tab-img2"></image>
<view class="list-name">首页</view>
</view>
<view class="list-item flex-col tc {{step==2?'list-cur':''}}" data-url="/pages/index/index" bindtap="jumpUrl">
<image src="/images/bar/icon_near.png" class="tab-img1"></image>
<image src="/images/bar/icon_near_cur.png" class="tab-img2"></image>
<view class="list-name">附近商家</view>
</view>
<view class="pub-con">
<image src="{{addShow?'/images/bar/add_cur.png':'/images/bar/icon_add.png'}}" bindtap="pubEvent" class="pub-img"></image>
</view>
<view class="list-item flex-col tc">
<image src="/images/bar/icon_list.png" class="tab-img1"></image>
<image src="/images/bar/icon_list_cur.png" class="tab-img2"></image>
<view class="list-name">商品列表</view>
</view>
<view class="list-item flex-col tc">
<image src="/images/bar/icon_center.png" class="tab-img1"></image>
<image src="/images/bar/icon_center_cur.png" class="tab-img2"></image>
<view class="list-name">个人中心</view>
</view>
</view>
<view class="mask" wx:if="{{addShow}}"></view>
<view class="pub-list" wx:if="{{addShow}}">
<image src="/images/bar/pub.png" class="plist pub"></image>
<image src="/images/bar/pub1.png" class="plist"></image>
</view>

View File

@ -0,0 +1,82 @@
/* component/tabList/index.wxss */
.mask{
position: fixed;
width: 100%;
height: 100%;
left: 0;
top: 0;
background: rgba(0, 0, 0, 0.6);
}
.mask-z{
z-index: 99;
}
.pub-con{
position: relative;
z-index: 9999;
}
.tab-list{
position: fixed;
width: 100%;
left: 0;
bottom: 0;
padding: 11rpx 0;
background: #FFFFFF;
z-index: 11;
}
.flex-col {
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1;
width: 100%;
text-align: left;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: left;
-webkit-box-align: left;
}
.flex-row {
display: flex;
}
.tc{
text-align: center;
}
.list-item .tab-img1,.list-item .tab-img2{
margin: 0 auto;
display: block;
width: 45rpx;
height: 35rpx;
}
.list-name{
margin-top: 6rpx;
color: #707070;
font-size: 20rpx;
}
.list-cur .list-name{
color: #3D98FF;
}
.list-item .tab-img2,.list-cur .tab-img1{
display: none;
}
.list-cur .tab-img2{
display: block;
}
.pub-img{
width: 76rpx;
height: 69rpx;
}
.pub-list{
position: fixed;
width: 100%;
left: 0;
bottom: 150rpx;
z-index: 11;
text-align: center;
z-index: 9999;
}
.plist{
width: 100rpx;
height: 100rpx;
}
.pub{
margin-right: 100rpx;
}

187
component/upload/index.js Normal file
View File

@ -0,0 +1,187 @@
// component/uploadImages/index.js
import request from '../../utils/request'
Component({
/**
* 组件的属性列表
*/
properties: {
count: { //最多选择图片的张数默认9张
type: Number,
value: 9
},
uploadUrl: { //图片上传的服务器路径
type: String,
value: ''
},
showUrl: { //图片的拼接路径
type: String,
value: ''
},
getListImg: { // 获取图片
type: Array,
value: ''
}
},
/**
* 组件的初始数据
*/
data: {
detailPics: [], //上传的结果图片集合
isShow: true
},
ready: function () {
console.log('富家大室咖啡机少的可怜', this.data.getListImg)
if (this.data.getListImg) {
this.setData({
detailPics: this.data.getListImg
})
}
console.log(this.data)
},
/**
* 组件的方法列表
*/
methods: {
bindlongpressimg(e) {
let index = e.currentTarget.dataset.id
let detailPics = this.data.detailPics
detailPics.splice(index, 1)
this.setData({
detailPics
})
console.log(this.data.detailPics)
var myEventDetail = {
picsList: this.data.detailPics
} // detail对象提供给事件监听函数
let show = (this.data.detailPics.length < this.data.count) ? true : false
this.setData({
isShow: show
})
this.triggerEvent('myevent', myEventDetail, {}) //结果返回调用的页面
},
uploadDetailImage: function (e) { //这里是选取图片的方法
var that = this;
var pics = [];
var detailPics = that.data.detailPics;
if (detailPics.length >= that.data.count) {
wx.showToast({
title: '最多选择' + that.data.count + '张!',
})
return;
}
wx.chooseMedia({
count: that.data.count, // 最多可以选择的图片张数默认9,
sizeType: ['original', 'compressed'], // original 原图compressed 压缩图,默认二者都有
mediaType: ['image'],
sourceType: ['album', 'camera'],
maxDuration: 15,
camera: 'back',
success(res) {
console.log(res.tempFiles)
var imgs = res.tempFiles;
for (var i = 0; i < imgs.length; i++) {
pics.push(imgs[i].tempFilePath)
}
console.log(pics)
let data = {
url: that.data.uploadUrl, //这里是你图片上传的接口
path: pics, //这里是选取的图片的地址数组
}
// that.imgSecCheck(pics)
that.uploadimg(data);
}
})
},
imgSecCheck(imgs, num = 0) {
let len = imgs.length
request._post('/firefly/wx/imgSecCheck', {
media: imgs[num]
},
res => {
if (res.retCode == 0) {
if (len == num) {
let data = {
url: this.data.uploadUrl, //这里是你图片上传的接口
path: imgs, //这里是选取的图片的地址数组
}
this.uploadimg(data);
} else {
++num
this.imgSecCheck(imgs, num)
}
}
})
},
//多张图片上传
uploadimg: function (data) {
console.log(data)
wx.showLoading({
title: '上传中...',
mask: true,
})
var that = this,
i = data.i ? data.i : 0,
success = data.success ? data.success : 0,
fail = data.fail ? data.fail : 0;
wx.uploadFile({
url: data.url,
filePath: data.path[i],
header: {
'content-type': 'multipart/form-data',
'terminal': 'MINI-PROGRAM',
'token': wx.getStorageSync("token") || '',
},
name: 'file',
formData: null,
success: (resp) => {
console.log(resp)
wx.hideLoading();
success++;
var str = resp.data //返回的结果,可能不同项目结果不一样
var pic = JSON.parse(str);
var pic_name = pic.body.mediaURL;
var detailPics = that.data.detailPics;
detailPics.push({
mediaId: pic.body.mediaId,
mediaPath: pic_name,
mediaURL: pic.body.mediaURL,
seq: 1
})
that.setData({
detailPics: detailPics
})
},
fail: (res) => {
fail++;
console.log('fail:' + i + "fail:" + fail);
},
complete: () => {
i++;
if (i == data.path.length) { //当图片传完时,停止调用
console.log('执行完毕');
console.log('成功:' + success + " 失败:" + fail);
var myEventDetail = {
picsList: that.data.detailPics
} // detail对象提供给事件监听函数
let show = (that.data.detailPics.length < that.data.count) ? true : false
that.setData({
isShow: show
})
var myEventOption = {} // 触发事件的选项
that.triggerEvent('myevent', myEventDetail, myEventOption) //结果返回调用的页面
} else { //若图片还没有传完,则继续调用函数
data.i = i;
data.success = success;
data.fail = fail;
that.uploadimg(data); //递归,回调自己
}
}
});
},
}
})

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,15 @@
<view class='content'>
<view class='img-box'>
<view class='img-list'>
<block wx:for="{{detailPics}}" wx:key="index">
<view class='img-item'>
<image src='{{item.mediaURL}}' bindlongpress="bindlongpressimg" data-id='{{index}}'></image>
</view>
</block>
<view class='chooseimg' bindtap='uploadDetailImage' wx:if="{{isShow}}">
<view class="weui-uploader__input-box"></view>
</view>
</view>
<view class='tips'>长按对应的图片即可删除</view>
</view>
</view>

View File

@ -0,0 +1,92 @@
.content {
width: 100%;
background-color: #fff;
}
.img-list {
display: flex;
display: -webkit-flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
flex-wrap: wrap;
}
.img-item {
width: 30%;
text-align: left;
margin-right: 20rpx;
margin-bottom: 10rpx;
}
.img-item image {
width: 180rpx;
height: 180rpx;
}
.submit-btn {
width: 100%;
background-color: #fff;
height: 80rpx;
text-align: center;
line-height: 80rpx;
font-size: 30rpx;
position: fixed;
bottom: 100rpx;
}
.chooseimg {
background-color: #fff;
}
.weui-uploader__input-box {
float: left;
position: relative;
margin-right: 9px;
margin-bottom: 9px;
width: 180rpx;
height: 180rpx;
border: 1px solid #d9d9d9;
}
.weui-uploader__input-box:before {
width: 2px;
height: 39.5px;
}
.weui-uploader__input-box:after, .weui-uploader__input-box:before {
content: " ";
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
background-color: #d9d9d9;
}
.weui-uploader__input-box:after {
width: 39.5px;
height: 2px;
}
.weui-uploader__input-box:after, .weui-uploader__input-box:before {
content: " ";
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
background-color: #d9d9d9;
}
.tips {
color: #666;
font-size: 24rpx;
padding-bottom: 20rpx;
}
.img-box {
width: 92%;
margin: auto;
padding-top: 20rpx;
}

View File

@ -0,0 +1,66 @@
// component/upload/upload.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,2 @@
<!--component/upload/upload.wxml-->
<text>component/upload/upload.wxml</text>

View File

@ -0,0 +1 @@
/* component/upload/upload.wxss */

BIN
images/arrow_right.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 772 B

BIN
images/article/good.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
images/article/good_cur.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
images/article/money.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
images/article/share.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
images/back1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
images/bar/add_cur.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
images/bar/icon_add.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
images/bar/icon_center.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
images/bar/icon_home.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

BIN
images/bar/icon_list.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
images/bar/icon_near.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
images/bar/pub.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
images/bar/pub1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

BIN
images/bar/pub2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
images/buy/add.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

BIN
images/buy/address.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
images/buy/close.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 644 B

BIN
images/buy/jifen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
images/buy/reduce.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

BIN
images/buy/right.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
images/buy/select.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

BIN
images/buy/selected.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

BIN
images/group.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
images/home/code.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
images/home/icon_chen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
images/home/icon_love.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
images/home/icon_menu1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
images/home/icon_menu3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
images/home/icon_menu4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
images/home/icon_pocket.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
images/home/icon_search.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 820 B

BIN
images/home/icon_shake.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
images/home/msg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
images/home/search.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
images/login_title.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
images/my/bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 KiB

BIN
images/my/clear.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 B

BIN
images/my/crown.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
images/my/head.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
images/my/head1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
images/my/icon_right1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

BIN
images/my/icon_right2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

BIN
images/my/icon_right3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

BIN
images/my/icon_right4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

BIN
images/near/position.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
images/near/star1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 735 B

BIN
images/near/star2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
images/near/success.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
images/play.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
images/select.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Some files were not shown because too many files have changed in this diff Show More