店铺详情下拉刷新优化,下载邀请图片功能添加
@@ -11,7 +11,7 @@ import router from '../router'
|
|||||||
// 基础配置
|
// 基础配置
|
||||||
const config = {
|
const config = {
|
||||||
apiUrl : 'https://api.gongli.vip/api/', // 正式环境
|
apiUrl : 'https://api.gongli.vip/api/', // 正式环境
|
||||||
// apiUrl : 'http://api.zh.shangkelian.cn/api/', // 大健康调试环境,目前没有任何数据无法正常显示,所以需要使用该环境,最后会删除
|
// apiUrl : 'http://api.gl.shangkelian.cn/api/', // 测试
|
||||||
timeout : 60000
|
timeout : 60000
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ const dt = (data) =>{
|
|||||||
|
|
||||||
// 充值
|
// 充值
|
||||||
const recharge = (data) => {
|
const recharge = (data) => {
|
||||||
console.log(data)
|
|
||||||
return request({
|
return request({
|
||||||
url: "user/transaction/recharge",
|
url: "user/transaction/recharge",
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
|||||||
29
apis/interfaces/app.js
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* Web唐明明
|
||||||
|
* 匆匆数载恍如梦,岁月迢迢华发增。
|
||||||
|
* 碌碌无为枉半生,一朝惊醒万事空。
|
||||||
|
* moduleName: 数据看板
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { request } from '../index'
|
||||||
|
|
||||||
|
// 初始化
|
||||||
|
const getAppdata = () =>{
|
||||||
|
return request({
|
||||||
|
url: "appdata/index"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取分类数据
|
||||||
|
const getData = (data) =>{
|
||||||
|
return request({
|
||||||
|
url: "appdata/get_data",
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export {
|
||||||
|
getAppdata,
|
||||||
|
getData
|
||||||
|
}
|
||||||
@@ -58,11 +58,21 @@ const secretService = (name) =>{
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 一键登录
|
||||||
|
const keyAuth = (data) => {
|
||||||
|
return request({
|
||||||
|
url: 'user/socialite/login/unicloud/app',
|
||||||
|
method: 'POST',
|
||||||
|
data: data
|
||||||
|
}, true)
|
||||||
|
}
|
||||||
|
|
||||||
export {
|
export {
|
||||||
smsAuth,
|
smsAuth,
|
||||||
getInvitationSms,
|
getInvitationSms,
|
||||||
getSms,
|
getSms,
|
||||||
userFigure,
|
userFigure,
|
||||||
createUser,
|
createUser,
|
||||||
secretService
|
secretService,
|
||||||
|
keyAuth
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,13 +40,13 @@ const shopsDetail = (shopId) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 店铺商品
|
// 店铺商品
|
||||||
const shopsGoods = (shop_id, category_id,page) => {
|
const shopsGoods = (shopId, categoryId,page) => {
|
||||||
return request({
|
return request({
|
||||||
url: 'mall/goods',
|
url: 'mall/goods',
|
||||||
data: {
|
data: {
|
||||||
shop_id,
|
shop_id:shopId,
|
||||||
category_id,
|
category_id:categoryId,
|
||||||
page,
|
page:page,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
72
common/image.js
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
/**
|
||||||
|
* 使用plus.zip.compressImage压缩,目前仅支持App端
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
let images = [];//压缩后的图片集合
|
||||||
|
let max_width = 500;//若宽度大于此尺寸,触发压缩,否则使用原图,可自行修改
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接收图片集合
|
||||||
|
*/
|
||||||
|
async function compress(_images, _fun) {
|
||||||
|
for (let i = 0; i < _images.length; i++) {//循环单张压缩
|
||||||
|
var compressd_image = await _compress(_images[i])
|
||||||
|
images.push(compressd_image);
|
||||||
|
}
|
||||||
|
_fun && _fun(images);
|
||||||
|
images = [];//压缩结束重置images,准备下次压缩
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 菜鸟请大神教我如何优化QAQ~
|
||||||
|
*/
|
||||||
|
async function _compress(_image) {
|
||||||
|
|
||||||
|
var last4chars = _image.slice(-4);
|
||||||
|
if (plus.os.name == 'Android') { //安卓下plus.zip.compressImage只支持jpeg/jpg/png
|
||||||
|
if (!~last4chars.indexOf('jpg') && !~last4chars.indexOf('png') && !~last4chars.indexOf('jpeg')) {
|
||||||
|
return _image;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var image_info = await get_image_info(_image);
|
||||||
|
if (image_info.width < max_width) { //小于800不压缩
|
||||||
|
return _image;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
plus.zip.compressImage({
|
||||||
|
src: _image,//原始图片的路径
|
||||||
|
dst: _image,//压缩转换目标图片的路径(为了省事这里使用原路径)
|
||||||
|
overwrite: true,//使用原文件名并覆盖,如果想将原文件保留,并和压缩后图片同时上传,需要改为false,并修改dst
|
||||||
|
quality: 100,//1-100,压缩后质量,越低图片占用空间越小,越模糊
|
||||||
|
width: max_width+'px',//这里先写死800;height默认为auto,即根据width与源图宽的缩放比例计算
|
||||||
|
},
|
||||||
|
(res) => {
|
||||||
|
resolve(res.target)
|
||||||
|
},
|
||||||
|
(e) => {
|
||||||
|
reject(e);
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_image_info(_image) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
uni.getImageInfo({
|
||||||
|
src: _image,
|
||||||
|
success: res => {
|
||||||
|
resolve(res);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
compress
|
||||||
|
}
|
||||||
247
common/index/index.css
Normal file
118
common/index/index.post.data.js
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
export default [{
|
||||||
|
"post_id": '1',
|
||||||
|
"uid": 1,
|
||||||
|
"username": "龙葵",
|
||||||
|
"header_image": "/static/chat/index/test/header03.jpg",
|
||||||
|
"content": {
|
||||||
|
"text": "内裤上百条,晒不干一条;衣服晾不干,亲人泪两行",
|
||||||
|
"images": ["/static/chat/index/test/test2.jpg"]
|
||||||
|
},
|
||||||
|
"islike": 0,
|
||||||
|
"like": [{
|
||||||
|
"uid": 2,
|
||||||
|
"username": "小李子,"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uid": 3,
|
||||||
|
"username": "小张子"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"comments": {
|
||||||
|
"total": 2,
|
||||||
|
"comment": [{
|
||||||
|
"uid": 2,
|
||||||
|
"username": '小爱',
|
||||||
|
"content": "加个微信吧!基金基金基金基金基金基金基金基金基金基金基金基金基金基金基金基金基金基金"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uid": 3,
|
||||||
|
"username": '小虎',
|
||||||
|
"content": "一起出去好吗?"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"timestamp": "5分钟前"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"post_id": 2,
|
||||||
|
"uid": 1,
|
||||||
|
"username": "菁英公寓-打造属于你的私密空间 小吴",
|
||||||
|
"header_image": "/static/chat/index/test/header04.jpg",
|
||||||
|
"content": {
|
||||||
|
"text": "租房:东环朝南\n\r2室大衣柜\n\r燃气热水器\n\r5楼采光充足\n\r随时入住",
|
||||||
|
"images": [
|
||||||
|
"/static/chat/index/test/pig-01.jpg",
|
||||||
|
"/static/chat/index/test/pig-02.jpg",
|
||||||
|
"/static/chat/index/test/pig-03.jpg",
|
||||||
|
"/static/chat/index/test/pig-04.jpg",
|
||||||
|
"/static/chat/index/test/pig-05.jpg",
|
||||||
|
"/static/chat/index/test/pig-06.jpg",
|
||||||
|
"/static/chat/index/test/pig-07.jpg",
|
||||||
|
"/static/chat/index/test/pig-08.jpg",
|
||||||
|
"/static/chat/index/test/pig-09.jpg"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"islike": 0,
|
||||||
|
"like": [{
|
||||||
|
"uid": 2,
|
||||||
|
"username": "小王子,"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uid": 3,
|
||||||
|
"username": "张大大"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"comments": {
|
||||||
|
"total": 2,
|
||||||
|
"comment": [{
|
||||||
|
"uid": 2,
|
||||||
|
"username": '小虎',
|
||||||
|
"content": "吃错药了!"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uid": 3,
|
||||||
|
"username": '小狼',
|
||||||
|
"content": "霍霍霍霍霍霍霍霍霍霍霍霍霍霍霍霍霍霍霍霍霍霍!"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"timestamp": "1小时前"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"post_id": 2,
|
||||||
|
"uid": 1,
|
||||||
|
"username": "BSK 必胜客新苏 小乐",
|
||||||
|
"header_image": "/static/chat/index/test/header05.jpg",
|
||||||
|
"content": {
|
||||||
|
"text": "美食花样多,诱人如北北;迎来小宇宙,幸福两行泪[喵喵]这可是小必的心声啊~",
|
||||||
|
"images": ["/static/chat/index/test/header01.jpg", "/static/chat/index/test/header01.jpg",
|
||||||
|
"/static/chat/index/test/header01.jpg", "/static/chat/index/test/header01.jpg"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"islike": 0,
|
||||||
|
"like": [{
|
||||||
|
"uid": 2,
|
||||||
|
"username": "小王子,"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uid": 3,
|
||||||
|
"username": "张大大"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"comments": {
|
||||||
|
"total": 2,
|
||||||
|
"comment": [{
|
||||||
|
"uid": 2,
|
||||||
|
"username": '小虎',
|
||||||
|
"content": "吃错药了!"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uid": 3,
|
||||||
|
"username": '小狼',
|
||||||
|
"content": "霍霍霍霍霍霍霍霍霍霍霍霍霍霍霍霍霍霍霍霍霍霍!"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"timestamp": "7小时前"
|
||||||
|
}
|
||||||
|
]
|
||||||
1433
common/uni.css
Normal file
127
components/im-chat/chatinput.vue
Normal file
@@ -0,0 +1,127 @@
|
|||||||
|
<template>
|
||||||
|
<view class="footer">
|
||||||
|
<!-- <view class="footer-left">
|
||||||
|
<view class="uni-icon uni-icon-mic" @tap="startRecognize"> </view>
|
||||||
|
</view> -->
|
||||||
|
<view class="footer-center">
|
||||||
|
<input class="input-text" type="text" @confirm="sendMessge" v-model="inputValue" :focus="focus" @blur="blur" :placeholder="placeholder"></input>
|
||||||
|
</view>
|
||||||
|
<view class="footer-right">
|
||||||
|
<view id='msg-type' class="send-comment" @tap="sendMessge">发送</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "chat-input",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
inputValue: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props:{
|
||||||
|
placeholder: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
focus: {
|
||||||
|
type:Boolean,
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
blur: function() {//失焦触发通知父组件
|
||||||
|
var that = this;
|
||||||
|
this.$emit('blur')
|
||||||
|
},
|
||||||
|
startRecognize: function () {
|
||||||
|
var options = {};
|
||||||
|
var that = this;
|
||||||
|
options.engine = 'iFly';
|
||||||
|
that.inputValue = "";
|
||||||
|
plus.speech.startRecognize(options, function (s) {
|
||||||
|
console.log(s);
|
||||||
|
that.inputValue += s;
|
||||||
|
}, function (e) {
|
||||||
|
console.log("语音识别失败:" + e.message);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
sendMessge: function () {
|
||||||
|
if (!this.inputValue) {
|
||||||
|
uni.showModal({
|
||||||
|
content:"还没有输入内容哦!",
|
||||||
|
showCancel:false
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var that = this;
|
||||||
|
//点击发送按钮时,通知父组件用户输入的内容
|
||||||
|
this.$emit('send-message', {
|
||||||
|
type: 'text',
|
||||||
|
content: that.inputValue
|
||||||
|
});
|
||||||
|
that.inputValue = '';//清空上次输入的内容
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.footer {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
width: 100%;
|
||||||
|
height: 80upx;
|
||||||
|
min-height: 80upx;
|
||||||
|
border-top: solid 1px #bbb;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 5upx;
|
||||||
|
background-color: #F4F5F6;
|
||||||
|
}
|
||||||
|
.footer-left {
|
||||||
|
|
||||||
|
width: 80upx;
|
||||||
|
height: 80upx;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.footer-right {
|
||||||
|
width: 120upx;
|
||||||
|
height: 80upx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
color: #1482D1;
|
||||||
|
}
|
||||||
|
.footer-center {
|
||||||
|
flex: 1;
|
||||||
|
padding-left: 20upx;
|
||||||
|
height: 80upx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.footer-center .input-text {
|
||||||
|
flex: 1;
|
||||||
|
background: #fff;
|
||||||
|
/* border: solid 1upx #ddd; */
|
||||||
|
padding: 10upx !important;
|
||||||
|
font-family: verdana !important;
|
||||||
|
overflow: hidden;
|
||||||
|
border-radius: 15upx;
|
||||||
|
}
|
||||||
|
.footer-right .send-comment{
|
||||||
|
background-color: #007AFF;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 60upx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
width: 80upx;
|
||||||
|
height: 60upx;
|
||||||
|
border-radius: 5px;
|
||||||
|
font-size: 10px;
|
||||||
|
/* height: 60upx; */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
92
components/im-chat/messageshow.vue
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
<template>
|
||||||
|
<view class="m-item" :id="'message'+id">
|
||||||
|
<view class="m-left">
|
||||||
|
<image class="head_icon" src="https://img-cdn-qiniu.dcloud.net.cn/uniapp/app/homeHL.png" v-if="message.user=='home'"></image>
|
||||||
|
</view>
|
||||||
|
<view class="m-content">
|
||||||
|
<view class="m-content-head" :class="{'m-content-head-right':message.user=='customer'}">
|
||||||
|
<view :class="'m-content-head-'+message.user">{{message.content}} </view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="m-right">
|
||||||
|
<image class="head_icon" src="https://img-cdn-qiniu.dcloud.net.cn/uniapp/app/customerHL.png" v-if="message.user=='customer'"></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: ['message', 'id']
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.m-item {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
padding-top: 40upx;
|
||||||
|
}
|
||||||
|
.m-left {
|
||||||
|
display: flex;
|
||||||
|
width: 120upx;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
.m-content {
|
||||||
|
display: flex;
|
||||||
|
flex: 1;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
.m-right {
|
||||||
|
display: flex;
|
||||||
|
width: 120upx;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
.head_icon {
|
||||||
|
width: 80upx;
|
||||||
|
height: 80upx;
|
||||||
|
}
|
||||||
|
.m-content-head {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.m-content-head-right {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
.m-content-head-home {
|
||||||
|
text-align: left;
|
||||||
|
background: #1482d1;
|
||||||
|
border: 1px #1482d1 solid;
|
||||||
|
border-radius: 20upx;
|
||||||
|
padding: 20upx;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
.m-content-head-home:before {
|
||||||
|
border: 15upx solid transparent;
|
||||||
|
border-right: 15upx solid #1482d1;
|
||||||
|
left: -26upx;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
position: absolute;
|
||||||
|
content: ' '
|
||||||
|
}
|
||||||
|
.m-content-head-customer {
|
||||||
|
border: 1upx white solid;
|
||||||
|
background: white;
|
||||||
|
border-radius: 20upx;
|
||||||
|
padding: 20upx;
|
||||||
|
}
|
||||||
|
.m-content-head-customer:after {
|
||||||
|
border: 15upx solid transparent;
|
||||||
|
border-left: 15upx solid white;
|
||||||
|
top: 20upx;
|
||||||
|
right: -26upx;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
position: absolute;
|
||||||
|
content: ' '
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -106,13 +106,8 @@
|
|||||||
|
|
||||||
let passwordInput = this.passwordInput
|
let passwordInput = this.passwordInput
|
||||||
this.passwordInput = passwordInput + id + '|'
|
this.passwordInput = passwordInput + id + '|'
|
||||||
|
|
||||||
console.log(this.passwordInput);
|
|
||||||
this.initPass()
|
this.initPass()
|
||||||
|
|
||||||
|
|
||||||
if(this.passwordInput.length === 12){ // 输入完毕
|
if(this.passwordInput.length === 12){ // 输入完毕
|
||||||
console.log(this.passwordInput);
|
|
||||||
this.testPassword()
|
this.testPassword()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -131,8 +126,6 @@
|
|||||||
initPass() {
|
initPass() {
|
||||||
let arr = this.passwordInput.split('|');
|
let arr = this.passwordInput.split('|');
|
||||||
arr.pop()
|
arr.pop()
|
||||||
console.log(arr);
|
|
||||||
|
|
||||||
let arr_ = []
|
let arr_ = []
|
||||||
for(let i = 0; i< 6; i++){
|
for(let i = 0; i< 6; i++){
|
||||||
if(i < arr.length){
|
if(i < arr.length){
|
||||||
|
|||||||
@@ -1,208 +0,0 @@
|
|||||||
|
|
||||||
<!--
|
|
||||||
* @Description:运动列表
|
|
||||||
* @Author: Aimee·Zhang
|
|
||||||
* @Date: 2022-01-19 15:07:02
|
|
||||||
* @LastEditors: Aimee·Zhang
|
|
||||||
* @LastEditTime: 2022-01-20 09:09:59
|
|
||||||
-->
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<view class="foods--lists">
|
|
||||||
<u-popup
|
|
||||||
:show="addSportsShow"
|
|
||||||
:round="4"
|
|
||||||
mode="center"
|
|
||||||
>
|
|
||||||
<view class="popup">
|
|
||||||
<view class="popup-title">
|
|
||||||
<span @click="cancleSport">取消</span>
|
|
||||||
<span class="title">{{selectSports.title || '新增运动'}}</span>
|
|
||||||
<span @click="comfirmSport">确认</span>
|
|
||||||
</view>
|
|
||||||
<view class="popup-item">
|
|
||||||
<u-image
|
|
||||||
:lazy-load="true"
|
|
||||||
:src="selectSports.cover?selectSports.cover:require('../../static/imgs/apple.png')"
|
|
||||||
radius="10"
|
|
||||||
width="140rpx"
|
|
||||||
height="140rpx"
|
|
||||||
class="goods-img"
|
|
||||||
/>
|
|
||||||
<view class="popup-item-title">
|
|
||||||
{{selectSports.name}}
|
|
||||||
<view class="des"><span>{{selectSports.calory || '0.0'}}</span> 千卡/60分钟</view>
|
|
||||||
</view>
|
|
||||||
<u-icon
|
|
||||||
v-if="selectSports.title === '编辑运动'"
|
|
||||||
name="trash"
|
|
||||||
color="#ddd"
|
|
||||||
size="16"
|
|
||||||
label="删除这条数据"
|
|
||||||
labelColor="#ddd"
|
|
||||||
:bold="true"
|
|
||||||
@click="delSport"
|
|
||||||
style="padding-top: 30rpx;"
|
|
||||||
/>
|
|
||||||
</view>
|
|
||||||
<u-input
|
|
||||||
placeholder="60"
|
|
||||||
class="select-time"
|
|
||||||
v-model="duration"
|
|
||||||
type="number"
|
|
||||||
>
|
|
||||||
<u--text
|
|
||||||
text="运动时间:"
|
|
||||||
slot="prefix"
|
|
||||||
margin="0 3px 0 0"
|
|
||||||
type="tips"
|
|
||||||
/>
|
|
||||||
<u--text
|
|
||||||
text="分钟"
|
|
||||||
slot="suffix"
|
|
||||||
margin="0 3px 0 0"
|
|
||||||
type="tips"
|
|
||||||
/>
|
|
||||||
</u-input>
|
|
||||||
<view class="all-calory"> ≈ <span> {{total}} </span> 千卡</view>
|
|
||||||
</view>
|
|
||||||
</u-popup>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
duration: 60,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
selectSports: {
|
|
||||||
type: Object,
|
|
||||||
default: {},
|
|
||||||
},
|
|
||||||
addSportsShow: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
total() {
|
|
||||||
return ((this.selectSports.calory * this.duration) / 60).toFixed(0);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
addSportsShow() {
|
|
||||||
this.duration = 60;
|
|
||||||
},
|
|
||||||
selectSports(val) {
|
|
||||||
console.log(val);
|
|
||||||
this.duration = val.duration;
|
|
||||||
console.log("监听传过来的参数");
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 弹窗确认和取消功能
|
|
||||||
comfirmSport() {
|
|
||||||
this.$emit("comfirmSport", true, this.duration);
|
|
||||||
},
|
|
||||||
// 取消按钮触发事件
|
|
||||||
cancleSport() {
|
|
||||||
this.$emit("cancleSport", false);
|
|
||||||
},
|
|
||||||
// 删除按钮触发事件
|
|
||||||
delSport() {
|
|
||||||
this.$emit("delSport");
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
// 列表
|
|
||||||
.foods--lists {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
box-sizing: border-box;
|
|
||||||
margin-top: $margin;
|
|
||||||
// 弹窗样式
|
|
||||||
.popup {
|
|
||||||
width: 600rpx;
|
|
||||||
// min-height: 700rpx;
|
|
||||||
position: relative;
|
|
||||||
.popup-title {
|
|
||||||
color: $main-color;
|
|
||||||
font-size: $title-size-m;
|
|
||||||
border-bottom: solid 1rpx #f9f9f9;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
box-sizing: border-box;
|
|
||||||
span {
|
|
||||||
padding: $padding + 10 $padding;
|
|
||||||
}
|
|
||||||
.title {
|
|
||||||
color: $text-color;
|
|
||||||
font-size: $title-size;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.popup-item {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding: $padding * 2 $padding $padding $padding;
|
|
||||||
font-size: $title-size-m;
|
|
||||||
color: $text-color;
|
|
||||||
border-bottom: solid 1rpx #f9f9f9;
|
|
||||||
.popup-item-title {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding-top: $padding;
|
|
||||||
.des {
|
|
||||||
padding-top: $padding * 0.4;
|
|
||||||
span {
|
|
||||||
color: $text-price;
|
|
||||||
padding-right: $padding * 0.3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.select-time {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding: $padding 0;
|
|
||||||
// background: $main-color;
|
|
||||||
color: #fff;
|
|
||||||
margin: $margin * 3 0 $margin * 2 0;
|
|
||||||
width: 90%;
|
|
||||||
border-radius: 10rpx;
|
|
||||||
margin-left: 5%;
|
|
||||||
}
|
|
||||||
.all-calory {
|
|
||||||
position: absolute;
|
|
||||||
bottom: $padding * 6;
|
|
||||||
right: $padding;
|
|
||||||
font-size: $title-size-m;
|
|
||||||
color: $text-gray-m;
|
|
||||||
span {
|
|
||||||
padding: 0 $padding * 0.4;
|
|
||||||
font-size: $title-size + 10;
|
|
||||||
color: $main-color;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,212 +0,0 @@
|
|||||||
|
|
||||||
<!--
|
|
||||||
* @Description:运动列表
|
|
||||||
* @Author: Aimee·Zhang
|
|
||||||
* @Date: 2022-01-19 15:07:02
|
|
||||||
* @LastEditors: Aimee·Zhang
|
|
||||||
* @LastEditTime: 2022-01-20 10:03:27
|
|
||||||
-->
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<view class="foods--lists">
|
|
||||||
<view
|
|
||||||
class="foods-lists"
|
|
||||||
v-for="sportItem in lists"
|
|
||||||
:key="sportItem.sport_id"
|
|
||||||
>
|
|
||||||
<view class="lists-left">
|
|
||||||
<u-image
|
|
||||||
:src="sportItem.cover?sportItem.cover:require('../../static/imgs/apple.png')"
|
|
||||||
:lazy-load="true"
|
|
||||||
v-if="type === 'add'"
|
|
||||||
radius="10rpx"
|
|
||||||
width="100rpx"
|
|
||||||
height="100rpx"
|
|
||||||
class="goods-img"
|
|
||||||
/>
|
|
||||||
<!-- 新增-->
|
|
||||||
<view
|
|
||||||
class="lists-right"
|
|
||||||
v-if="type === 'add'"
|
|
||||||
@click="addSport(sportItem)"
|
|
||||||
>
|
|
||||||
<view class="lists-title">
|
|
||||||
{{sportItem.name}}
|
|
||||||
<view class="des"><span>{{sportItem.calory}}</span> 千卡/60分钟</view>
|
|
||||||
</view>
|
|
||||||
<u-icon
|
|
||||||
name="arrow-right"
|
|
||||||
color="#ddd"
|
|
||||||
size="13"
|
|
||||||
:bold="true"
|
|
||||||
/>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 显示结果 -->
|
|
||||||
<u-image
|
|
||||||
:src="sportItem.sport.cover?sportItem.sport.cover:require('../../static/imgs/apple.png')"
|
|
||||||
:lazy-load="true"
|
|
||||||
v-if="type === 'edit'"
|
|
||||||
radius="10rpx"
|
|
||||||
width="100rpx"
|
|
||||||
height="100rpx"
|
|
||||||
class="goods-img"
|
|
||||||
/>
|
|
||||||
<view
|
|
||||||
class="lists-right"
|
|
||||||
v-if="type==='edit'"
|
|
||||||
@click.stop="editSport(sportItem)"
|
|
||||||
@longpress.stop="longClick(sportItem)"
|
|
||||||
>
|
|
||||||
<view class="lists-title">
|
|
||||||
{{sportItem.sport.name}}
|
|
||||||
<view class="des">{{sportItem.duration}}分钟</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="lists-right1">
|
|
||||||
{{sportItem.calory}}<span class="dw">千卡</span>
|
|
||||||
<u-icon
|
|
||||||
name="arrow-right"
|
|
||||||
color="#ddd"
|
|
||||||
size="13"
|
|
||||||
:bold="true"
|
|
||||||
/>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
lists: {
|
|
||||||
type: Array,
|
|
||||||
default: [],
|
|
||||||
},
|
|
||||||
type: {
|
|
||||||
type: String,
|
|
||||||
default: "add",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 添加运动模块
|
|
||||||
addSport(item) {
|
|
||||||
this.$emit("addSport", item);
|
|
||||||
},
|
|
||||||
// 编辑运动
|
|
||||||
editSport(item) {
|
|
||||||
this.$emit("editSport", item);
|
|
||||||
},
|
|
||||||
// 长按删除触发事件
|
|
||||||
longClick(item) {
|
|
||||||
this.$emit("longClick", item);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
// 列表
|
|
||||||
.foods-lists {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
box-sizing: border-box;
|
|
||||||
margin-top: $margin;
|
|
||||||
.lists-right {
|
|
||||||
flex: 1;
|
|
||||||
font-size: $title-size-m - 6;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
box-sizing: border-box;
|
|
||||||
color: $text-gray-m;
|
|
||||||
border-bottom: solid 1rpx #f7f7f7;
|
|
||||||
margin-left: $margin * 0.8;
|
|
||||||
padding: $padding 0;
|
|
||||||
.dw {
|
|
||||||
margin: 0 $margin * 0.6 0 $margin * 0.4;
|
|
||||||
}
|
|
||||||
.lists-right1 {
|
|
||||||
font-size: $title-size-m - 6;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
box-sizing: border-box;
|
|
||||||
color: $text-gray-m;
|
|
||||||
font-weight: normal;
|
|
||||||
.dw {
|
|
||||||
margin: 0 $margin * 0.6 0 $margin * 0.4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-img {
|
|
||||||
box-shadow: 0 0 10rpx 4rpx rgba($color: $main-color, $alpha: 0.1);
|
|
||||||
border-radius: 20rpx;
|
|
||||||
opacity: 0.4;
|
|
||||||
}
|
|
||||||
.lists-left {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: flex-start;
|
|
||||||
align-items: center;
|
|
||||||
box-sizing: border-box;
|
|
||||||
font-size: $title-size - 2;
|
|
||||||
color: $text-color;
|
|
||||||
font-weight: bold;
|
|
||||||
flex: 1;
|
|
||||||
.lists-title {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: flex-start;
|
|
||||||
justify-content: center;
|
|
||||||
box-sizing: border-box;
|
|
||||||
font-size: $title-size-m;
|
|
||||||
color: $text-color;
|
|
||||||
.des {
|
|
||||||
margin-top: 10rpx;
|
|
||||||
}
|
|
||||||
span {
|
|
||||||
color: $text-price;
|
|
||||||
font-size: $title-size-m - 6;
|
|
||||||
font-weight: normal;
|
|
||||||
padding-right: $padding * 0.3;
|
|
||||||
}
|
|
||||||
.des {
|
|
||||||
color: $text-gray-m;
|
|
||||||
font-size: $title-size-m - 6;
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.dian {
|
|
||||||
width: 20rpx;
|
|
||||||
height: 20rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
margin-right: $margin;
|
|
||||||
}
|
|
||||||
.dian1 {
|
|
||||||
background: #fbbf0f;
|
|
||||||
}
|
|
||||||
.dian2 {
|
|
||||||
background: #fa624d;
|
|
||||||
}
|
|
||||||
.dian3 {
|
|
||||||
background: #02c7bd;
|
|
||||||
}
|
|
||||||
.dianlists {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-end;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,188 +0,0 @@
|
|||||||
<template xlang="wxml" minapp="mpvue">
|
|
||||||
<view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'tki-file-manager',
|
|
||||||
props: {},
|
|
||||||
data() {
|
|
||||||
return {}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
_openFile() {
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
if (plus.os.name.toLowerCase() != "android") {
|
|
||||||
uni.showModal({
|
|
||||||
title: '提示',
|
|
||||||
content: '仅支持Android平台',
|
|
||||||
success: function(res) {}
|
|
||||||
});
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
let that = this
|
|
||||||
// java 代码来自 http://www.cnblogs.com/panhouye/archive/2017/04/23/6751710.html
|
|
||||||
let main = plus.android.runtimeMainActivity();
|
|
||||||
let Intent = plus.android.importClass("android.content.Intent");
|
|
||||||
|
|
||||||
//
|
|
||||||
let fileIntent = new Intent(Intent.ACTION_GET_CONTENT)
|
|
||||||
//fileIntent.setType(“image/*”);//选择图片
|
|
||||||
//fileIntent.setType(“audio/*”); //选择音频
|
|
||||||
//fileIntent.setType(“video/*”); //选择视频 (mp4 3gp 是android支持的视频格式)
|
|
||||||
//fileIntent.setType(“video/*;image/*”);//同时选择视频和图片
|
|
||||||
fileIntent.setType("*/*"); //无类型限制
|
|
||||||
fileIntent.addCategory(Intent.CATEGORY_OPENABLE);
|
|
||||||
main.startActivityForResult(fileIntent, 1);
|
|
||||||
// 获取回调
|
|
||||||
main.onActivityResult = function(requestCode, resultCode, data) {
|
|
||||||
let Activity = plus.android.importClass("android.app.Activity");
|
|
||||||
let ContentUris = plus.android.importClass("android.content.ContentUris");
|
|
||||||
let Cursor = plus.android.importClass("android.database.Cursor");
|
|
||||||
let Uri = plus.android.importClass("android.net.Uri");
|
|
||||||
let Build = plus.android.importClass("android.os.Build");
|
|
||||||
let Environment = plus.android.importClass("android.os.Environment");
|
|
||||||
let DocumentsContract = plus.android.importClass("android.provider.DocumentsContract");
|
|
||||||
let MediaStore = plus.android.importClass("android.provider.MediaStore");
|
|
||||||
// 给系统导入 contentResolver
|
|
||||||
let contentResolver = main.getContentResolver()
|
|
||||||
plus.android.importClass(contentResolver);
|
|
||||||
// 返回路径
|
|
||||||
let path = '';
|
|
||||||
if (resultCode == Activity.RESULT_OK) {
|
|
||||||
let uri = data.getData()
|
|
||||||
|
|
||||||
if ("file" == uri.getScheme().toLowerCase()) { //使用第三方应用打开
|
|
||||||
path = uri.getPath();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT) { //4.4以后
|
|
||||||
path = getPath(this, uri);
|
|
||||||
} else { //4.4以下下系统调用方法
|
|
||||||
path = getRealPathFromURI(uri)
|
|
||||||
}
|
|
||||||
// 回调
|
|
||||||
that.$emit('result', path)
|
|
||||||
}
|
|
||||||
// 4.4 以上 从Uri 获取文件绝对路径
|
|
||||||
function getPath(context, uri) {
|
|
||||||
let isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
|
|
||||||
let scheme = uri.getScheme().toLowerCase()
|
|
||||||
|
|
||||||
if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) {
|
|
||||||
// ExternalStorageProvider
|
|
||||||
if (isExternalStorageDocument(uri)) {
|
|
||||||
let docId = DocumentsContract.getDocumentId(uri);
|
|
||||||
let split = docId.split(":");
|
|
||||||
let type = split[0];
|
|
||||||
// 如果是手机内部存储
|
|
||||||
if ("primary" == type.toLowerCase()) {
|
|
||||||
return Environment.getExternalStorageDirectory() + "/" + split[1];
|
|
||||||
} else {
|
|
||||||
return '/storage/' + type + "/" + split[1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// DownloadsProvider
|
|
||||||
else if (isDownloadsDocument(uri)) {
|
|
||||||
let docId = DocumentsContract.getDocumentId(uri);
|
|
||||||
let split = docId.split(":");
|
|
||||||
return split[1]
|
|
||||||
// console.log(id)
|
|
||||||
// let contentUri = ContentUris.withAppendedId(Uri.parse("content://downloads/public_downloads"), id);
|
|
||||||
// return getDataColumn(context, contentUri, null, null);
|
|
||||||
}
|
|
||||||
// MediaProvider
|
|
||||||
else if (isMediaDocument(uri)) {
|
|
||||||
let docId = DocumentsContract.getDocumentId(uri);
|
|
||||||
let split = docId.split(":");
|
|
||||||
let type = split[0];
|
|
||||||
let contentUri = null;
|
|
||||||
if ("image" == type.toLowerCase()) {
|
|
||||||
contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
|
|
||||||
} else if ("video" == type.toLowerCase()) {
|
|
||||||
contentUri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
|
|
||||||
} else if ("audio" == type.toLowerCase()) {
|
|
||||||
contentUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
|
|
||||||
}
|
|
||||||
let selection = "_id=?";
|
|
||||||
let selectionArgs = [split[1]];
|
|
||||||
return getDataColumn(context, contentUri, selection, selectionArgs);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// MediaStore (and general)
|
|
||||||
else if ("content" == scheme) {
|
|
||||||
return getDataColumn(context, uri, null, null);
|
|
||||||
}
|
|
||||||
// File
|
|
||||||
else if ("file" == scheme) {
|
|
||||||
return uri.getPath();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 4.4 以下 获取 绝对路径
|
|
||||||
function getRealPathFromURI(uri) {
|
|
||||||
let res = null
|
|
||||||
let proj = [MediaStore.Images.Media.DATA]
|
|
||||||
let cursor = contentResolver.query(uri, proj, null, null, null);
|
|
||||||
if (null != cursor && cursor.moveToFirst()) {
|
|
||||||
;
|
|
||||||
let column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
|
|
||||||
res = cursor.getString(column_index);
|
|
||||||
cursor.close();
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
// 通过uri 查找出绝对路径
|
|
||||||
function getDataColumn(context, uri, selection, selectionArgs) {
|
|
||||||
let cursor = null;
|
|
||||||
let column = "_data";
|
|
||||||
let projection = [column];
|
|
||||||
// let contentResolver = context.getContentResolver()
|
|
||||||
// plus.android.importClass(contentResolver);
|
|
||||||
cursor = contentResolver.query(uri, projection, selection, selectionArgs, null);
|
|
||||||
if (cursor != null && cursor.moveToFirst()) {
|
|
||||||
let column_index = cursor.getColumnIndexOrThrow(column);
|
|
||||||
return cursor.getString(column_index);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function isExternalStorageDocument(uri) {
|
|
||||||
return "com.android.externalstorage.documents" == uri.getAuthority() ? true : false
|
|
||||||
}
|
|
||||||
|
|
||||||
function isDownloadsDocument(uri) {
|
|
||||||
return "com.android.providers.downloads.documents" == uri.getAuthority() ? true : false
|
|
||||||
}
|
|
||||||
|
|
||||||
function isMediaDocument(uri) {
|
|
||||||
return "com.android.providers.media.documents" == uri.getAuthority() ? true : false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// #endif
|
|
||||||
// #ifndef APP-PLUS
|
|
||||||
uni.showModal({
|
|
||||||
title: '提示',
|
|
||||||
content: '仅支持Android平台',
|
|
||||||
success: function(res) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
// plus.io.resolveLocalFileSystemURL( '/storage/emulated/0', function(fs) {
|
|
||||||
// var directoryReader = fs.createReader();
|
|
||||||
// directoryReader.readEntries(function(entries) {
|
|
||||||
// var i;
|
|
||||||
// for (i = 0; i < entries.length; i++) {
|
|
||||||
// console.log(entries[i].name);
|
|
||||||
// }
|
|
||||||
// }, function(e) {
|
|
||||||
// console.log("Read entries failed: " + e.message);
|
|
||||||
// });
|
|
||||||
// }, function(e) {
|
|
||||||
// console.log("Request file system failed: " + e.message);
|
|
||||||
// });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
"name" : "共力生态",
|
"name" : "共力生态",
|
||||||
"appid" : "__UNI__DE7B0E6",
|
"appid" : "__UNI__DE7B0E6",
|
||||||
"description" : "共力生态",
|
"description" : "共力生态",
|
||||||
"versionName" : "1.0.27",
|
"versionName" : "1.0.29",
|
||||||
"versionCode" : 100,
|
"versionCode" : 100,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
@@ -29,7 +29,8 @@
|
|||||||
"VideoPlayer" : {},
|
"VideoPlayer" : {},
|
||||||
"Geolocation" : {},
|
"Geolocation" : {},
|
||||||
"Fingerprint" : {},
|
"Fingerprint" : {},
|
||||||
"Push" : {}
|
"Push" : {},
|
||||||
|
"OAuth" : {}
|
||||||
},
|
},
|
||||||
/* 应用发布信息 */
|
/* 应用发布信息 */
|
||||||
"distribute" : {
|
"distribute" : {
|
||||||
@@ -74,7 +75,9 @@
|
|||||||
},
|
},
|
||||||
/* SDK配置 */
|
/* SDK配置 */
|
||||||
"sdkConfigs" : {
|
"sdkConfigs" : {
|
||||||
"oauth" : {},
|
"oauth" : {
|
||||||
|
"univerify" : {}
|
||||||
|
},
|
||||||
"payment" : {
|
"payment" : {
|
||||||
"weixin" : {
|
"weixin" : {
|
||||||
"__platform__" : [ "android" ],
|
"__platform__" : [ "android" ],
|
||||||
|
|||||||
19
package.json
@@ -1,18 +1,13 @@
|
|||||||
{
|
{
|
||||||
"id": "mi-payKeyboard",
|
"name": "dtx_store",
|
||||||
"name": "支付密码输入安全模拟键盘",
|
"version": "1.0.0",
|
||||||
"version": "1.1.0",
|
"description": "共力生态",
|
||||||
"description": "支付密码输入模拟键盘,代码简单,拿来即用。可以作为一个弹出层在任何需要输入密码的页面进行使用。",
|
"main": "main.js",
|
||||||
"keywords": [
|
|
||||||
"支付",
|
|
||||||
"密码输入",
|
|
||||||
"模拟键盘",
|
|
||||||
"6位数字密码",
|
|
||||||
"安全键盘"
|
|
||||||
],
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"uni-read-pages": "^1.0.5",
|
"uni-read-pages": "^1.0.5",
|
||||||
"uni-simple-router": "^2.0.8-beta.4",
|
"uni-simple-router": "^2.0.8-beta.4",
|
||||||
"uview-ui": "^2.0.31"
|
"uview-ui": "^2.0.31"
|
||||||
}
|
},
|
||||||
|
"author": "唐明明",
|
||||||
|
"license": "ISC"
|
||||||
}
|
}
|
||||||
|
|||||||
50
pages.json
@@ -381,7 +381,7 @@
|
|||||||
"type": "default",
|
"type": "default",
|
||||||
"buttons": [{
|
"buttons": [{
|
||||||
"float": "right",
|
"float": "right",
|
||||||
"text": "电话反馈",
|
"text": "微信客服",
|
||||||
"width": "80px",
|
"width": "80px",
|
||||||
"fontSize": "14px",
|
"fontSize": "14px",
|
||||||
"color": "#34CE98"
|
"color": "#34CE98"
|
||||||
@@ -406,6 +406,42 @@
|
|||||||
"navigationBarBackgroundColor": "#201f48",
|
"navigationBarBackgroundColor": "#201f48",
|
||||||
"navigationBarTextStyle": "white"
|
"navigationBarTextStyle": "white"
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
"path": "pages/board/board",
|
||||||
|
"name": "DataBoard",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "平台数据看板",
|
||||||
|
"enablePullDownRefresh": true,
|
||||||
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "pages/chat/index",
|
||||||
|
"style" : {
|
||||||
|
"navigationBarTitleText" : "我的圈子",
|
||||||
|
"enablePullDownRefresh" : true,
|
||||||
|
"app-plus" : {
|
||||||
|
"bounce" : "none",
|
||||||
|
"titleNView" : {
|
||||||
|
"type" : "transparent",
|
||||||
|
"buttons" : [
|
||||||
|
{
|
||||||
|
"background" : "rgba(255,255,255,0.2)",
|
||||||
|
"color" : "#696969",
|
||||||
|
"type" : "none",
|
||||||
|
"fontSrc" : "/static/fonts/iconfont1.ttf",
|
||||||
|
"text" : "\ue608" //小相机
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "pages/chat/publish",
|
||||||
|
"style" : {
|
||||||
|
"navigationBarTitleText" : "发布"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"tabBar": {
|
"tabBar": {
|
||||||
@@ -421,7 +457,14 @@
|
|||||||
"selectedIconPath": "static/tabBar/tabBar_show_02.png",
|
"selectedIconPath": "static/tabBar/tabBar_show_02.png",
|
||||||
"pagePath": "pages/store/index",
|
"pagePath": "pages/store/index",
|
||||||
"text": "DT商城"
|
"text": "DT商城"
|
||||||
}, {
|
},
|
||||||
|
// {
|
||||||
|
// "iconPath": "static/tabBar/tabBar_02.png",
|
||||||
|
// "selectedIconPath": "static/tabBar/tabBar_show_02.png",
|
||||||
|
// "pagePath": "pages/chat/index",
|
||||||
|
// "text": "DT圈子"
|
||||||
|
// },
|
||||||
|
{
|
||||||
"iconPath": "static/tabBar/tabBar_03.png",
|
"iconPath": "static/tabBar/tabBar_03.png",
|
||||||
"selectedIconPath": "static/tabBar/tabBar_show_03.png",
|
"selectedIconPath": "static/tabBar/tabBar_show_03.png",
|
||||||
"pagePath": "pages/user/index",
|
"pagePath": "pages/user/index",
|
||||||
@@ -437,8 +480,5 @@
|
|||||||
},
|
},
|
||||||
"easycom": {
|
"easycom": {
|
||||||
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
|
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
|
||||||
},
|
|
||||||
"condition": { //模式配置,仅开发期间生效
|
|
||||||
"current": 0 //当前激活的模式(list 的索引项)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,11 +20,12 @@
|
|||||||
<button @click="login('code')">登录</button>
|
<button @click="login('code')">登录</button>
|
||||||
</view>
|
</view>
|
||||||
<view class="auth-agreement">
|
<view class="auth-agreement">
|
||||||
登录即表示同意<navigator hover-class="none" url="/pages/vip/agreement?id=3">用户协议</navigator>和<navigator hover-class="none" url="/pages/vip/agreement?id=4">隐私政策</navigator>
|
登录即表示同意<navigator hover-class="none" url="/pages/vip/agreement?id=3">用户协议</navigator>和<navigator
|
||||||
|
hover-class="none" url="/pages/vip/agreement?id=4">隐私政策</navigator>
|
||||||
|
</view>
|
||||||
|
<view class="auth-other" v-if="isKeyAuth">
|
||||||
|
<button @click="login('Akey')">使用本机号码一键登录</button>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="auth-other">
|
|
||||||
<button @click="login('mnemonic')">使用助记词登录</button>
|
|
||||||
</view> -->
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -32,28 +33,44 @@
|
|||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
smsAuth,
|
smsAuth,
|
||||||
getInvitationSms
|
getInvitationSms,
|
||||||
|
keyAuth
|
||||||
} from '@/apis/interfaces/auth.js'
|
} from '@/apis/interfaces/auth.js'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
phone : '',
|
phone: '',
|
||||||
code : '',
|
code: '',
|
||||||
parentId : '',
|
parentId: '',
|
||||||
getSms : false,
|
getSms: false,
|
||||||
sendCode : '获取验证码',
|
sendCode: '获取验证码',
|
||||||
isShowParent: false
|
isShowParent: false,
|
||||||
|
isKeyAuth: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
onShow() {
|
||||||
this.$store.commit('setToken', '')
|
// uni.showLoading({
|
||||||
|
// title: '加载中...',
|
||||||
|
// mask: true
|
||||||
|
// })
|
||||||
|
// // 预登录
|
||||||
|
// uni.preLogin({
|
||||||
|
// provider: 'univerify',
|
||||||
|
// success: res => {
|
||||||
|
// this.isKeyAuth = true
|
||||||
|
// uni.hideLoading()
|
||||||
|
// },
|
||||||
|
// fail: err => {
|
||||||
|
// console.log(err)
|
||||||
|
// }
|
||||||
|
// })
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取验证码
|
// 获取验证码
|
||||||
getPhoneCode() {
|
getPhoneCode() {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title : '加载中...',
|
title: '加载中...',
|
||||||
mask :true
|
mask: true
|
||||||
})
|
})
|
||||||
let outTime;
|
let outTime;
|
||||||
let smsTime = 60;
|
let smsTime = 60;
|
||||||
@@ -91,18 +108,11 @@
|
|||||||
title: '登录中'
|
title: '登录中'
|
||||||
})
|
})
|
||||||
smsAuth({
|
smsAuth({
|
||||||
mobileNo : this.phone,
|
mobileNo: this.phone,
|
||||||
code : this.code,
|
code: this.code,
|
||||||
parent_id : this.parentId
|
parent_id: this.parentId
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
this.$store.commit('setToken', res.token_type + ' ' + res.access_token);
|
this.setAuthToken(res.token_type + ' ' + res.access_token, res.is_new)
|
||||||
if(res.is_new){
|
|
||||||
uni.setStorageSync('isnew', 0)
|
|
||||||
this.$Router.replace({name: 'AuthRole'})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
uni.setStorageSync('isnew', 1)
|
|
||||||
this.$Router.pushTab({name: 'Life'})
|
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -112,12 +122,73 @@
|
|||||||
});
|
});
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (type === 'mnemonic') {
|
if (type === 'Akey') {
|
||||||
|
this.onKeyLogin()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 一键登录
|
||||||
|
onKeyLogin() {
|
||||||
|
uni.login({
|
||||||
|
provider: 'univerify',
|
||||||
|
univerifyStyle: {
|
||||||
|
icon: {
|
||||||
|
path: require('@/static/logo.png')
|
||||||
|
},
|
||||||
|
authButton: {
|
||||||
|
normalColor: '#34CE98',
|
||||||
|
highlightColor: '#25b381',
|
||||||
|
disabledColor: '#25b381'
|
||||||
|
},
|
||||||
|
otherLoginButton: {
|
||||||
|
visible: false
|
||||||
|
},
|
||||||
|
privacyTerms: {
|
||||||
|
termsColor: '#34CE98',
|
||||||
|
uncheckedImage: require('@/static/icon/unchecked-icon.png'),
|
||||||
|
checkedImage: require('@/static/icon/checked-icon.png')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
success: Result => {
|
||||||
|
if (Result.errMsg === 'login:ok') {
|
||||||
|
let {
|
||||||
|
access_token,
|
||||||
|
openid
|
||||||
|
} = Result.authResult
|
||||||
|
keyAuth({
|
||||||
|
access_token,
|
||||||
|
openid
|
||||||
|
}).then(res => {
|
||||||
|
this.setAuthToken(res.token_type + ' ' + res.access_token, res
|
||||||
|
.is_new)
|
||||||
|
uni.closeAuthView()
|
||||||
|
}).catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '助记词登录暂未开放,敬请期待~',
|
title: '登录失败:' + err.message,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
|
uni.closeAuthView()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
fail: err => {
|
||||||
|
console.log(err)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// setToken
|
||||||
|
setAuthToken(token, isNew) {
|
||||||
|
this.$store.commit('setToken', token);
|
||||||
|
if (isNew) {
|
||||||
|
uni.setStorageSync('isnew', 0)
|
||||||
|
this.$Router.replace({
|
||||||
|
name: 'AuthRole'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
uni.setStorageSync('isnew', 1)
|
||||||
|
this.$Router.pushTab({
|
||||||
|
name: 'Life'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -178,9 +249,11 @@
|
|||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
color: $main-color;
|
color: $main-color;
|
||||||
background: white;
|
background: white;
|
||||||
&[disabled]{
|
|
||||||
|
&[disabled] {
|
||||||
color: gray;
|
color: gray;
|
||||||
}
|
}
|
||||||
|
|
||||||
&::after {
|
&::after {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@@ -211,7 +284,7 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
color: white;
|
color: white;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
padding: 30rpx 0 100rpx 0;
|
padding: 30rpx 0 60rpx 0;
|
||||||
|
|
||||||
navigator {
|
navigator {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|||||||
@@ -53,7 +53,6 @@
|
|||||||
this.male = res.male
|
this.male = res.male
|
||||||
this.storageId = res.male[0].storage_id
|
this.storageId = res.male[0].storage_id
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err)
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.status_code + ':' + err.message,
|
title: err.status_code + ':' + err.message,
|
||||||
icon : 'none'
|
icon : 'none'
|
||||||
@@ -91,7 +90,6 @@
|
|||||||
success : e => {
|
success : e => {
|
||||||
if(e.confirm){
|
if(e.confirm){
|
||||||
this.$store.commit('setToken', '');
|
this.$store.commit('setToken', '');
|
||||||
this.$store.commit('setIsNew', 0);
|
|
||||||
this.$Router.replaceAll({name: 'Auth'});
|
this.$Router.replaceAll({name: 'Auth'});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
158
pages/board/board.vue
Normal file
@@ -0,0 +1,158 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<!-- tabs -->
|
||||||
|
<u-sticky bgColor="white">
|
||||||
|
<u-tabs
|
||||||
|
:list="types"
|
||||||
|
keyName="title"
|
||||||
|
:scrollable="types.length > 4"
|
||||||
|
lineColor="#34CE98"
|
||||||
|
@click="setData('type', $event)"
|
||||||
|
></u-tabs>
|
||||||
|
</u-sticky>
|
||||||
|
<view class="board">
|
||||||
|
<!-- screening -->
|
||||||
|
<view class="screening">
|
||||||
|
<view class="item" v-for="(item,index) in dateBetween" :key="index" :class="{'show': item.key === date}" @click="setData('date', item)">{{item.title}}</view>
|
||||||
|
</view>
|
||||||
|
<!-- 数据看板 -->
|
||||||
|
<block v-if="boardData.length > 0">
|
||||||
|
<view class="block-flex" v-for="(item,index) in boardData" :key="index">
|
||||||
|
<view class="block-title">{{item.title}}</view>
|
||||||
|
<view class="block-number">{{item.number}}<text>{{item.units}}</text></view>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
<block v-else>
|
||||||
|
<view class="null vertical">
|
||||||
|
<u-empty
|
||||||
|
mode="data"
|
||||||
|
icon="http://cdn.uviewui.com/uview/empty/data.png"
|
||||||
|
text="暂无相关数据"
|
||||||
|
>
|
||||||
|
</u-empty>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getAppdata, getData } from '@/apis/interfaces/app.js'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
types : [],
|
||||||
|
dateBetween : [],
|
||||||
|
boardData : [],
|
||||||
|
type : '',
|
||||||
|
date : ''
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
uni.showLoading({
|
||||||
|
title: '初始化...',
|
||||||
|
})
|
||||||
|
getAppdata().then(res => {
|
||||||
|
this.types = res.types
|
||||||
|
this.dateBetween= res.date_between
|
||||||
|
this.boardData = res.data
|
||||||
|
this.type = res.type
|
||||||
|
this.date = res.date
|
||||||
|
}).catch(err => {
|
||||||
|
uni.showToast({
|
||||||
|
title: err.message,
|
||||||
|
icon : 'none'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
setData(type, e){
|
||||||
|
if(this[type] === e.key) return
|
||||||
|
this[type] = e.key
|
||||||
|
this.boardData = []
|
||||||
|
this.getData()
|
||||||
|
},
|
||||||
|
getData(){
|
||||||
|
uni.showLoading({
|
||||||
|
title: '加载中...'
|
||||||
|
})
|
||||||
|
getData({
|
||||||
|
type: this.type,
|
||||||
|
date: this.date
|
||||||
|
}).then(res => {
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.stopPullDownRefresh()
|
||||||
|
this.boardData = res.data
|
||||||
|
}).catch(err => {
|
||||||
|
uni.stopPullDownRefresh()
|
||||||
|
uni.showToast({
|
||||||
|
title: err.message,
|
||||||
|
icon : 'none'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
|
this.getData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.null{
|
||||||
|
height: 60vh;
|
||||||
|
}
|
||||||
|
.board {
|
||||||
|
background: $window-color;
|
||||||
|
min-height: calc(100vh - 44px);
|
||||||
|
overflow: hidden;
|
||||||
|
padding-bottom: $padding;
|
||||||
|
box-sizing: border-box;
|
||||||
|
// 数据筛选
|
||||||
|
.screening{
|
||||||
|
padding: $padding 20rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
.item{
|
||||||
|
background: white;
|
||||||
|
height: 50rpx;
|
||||||
|
line-height: 50rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
width: calc(20% - 20rpx);
|
||||||
|
margin: 0 10rpx;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 25rpx;
|
||||||
|
color: #555;
|
||||||
|
&.show{
|
||||||
|
background: $main-color;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 数据看板
|
||||||
|
.block-flex{
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
background: white;
|
||||||
|
border-radius: $radius;
|
||||||
|
margin: 0 $margin;
|
||||||
|
padding: $padding;
|
||||||
|
margin-bottom: $margin - 10;
|
||||||
|
font-size: 30rpx;
|
||||||
|
.block-title{
|
||||||
|
font-weight: bold;
|
||||||
|
color: #555;
|
||||||
|
}
|
||||||
|
.block-number{
|
||||||
|
color: $text-price;
|
||||||
|
font-weight: bold;
|
||||||
|
text{
|
||||||
|
color: gray;
|
||||||
|
font-size: 80%;
|
||||||
|
padding-left: 5rpx;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
277
pages/chat/index.vue
Normal file
@@ -0,0 +1,277 @@
|
|||||||
|
<template>
|
||||||
|
<view id="moments">
|
||||||
|
|
||||||
|
<view class="home-pic">
|
||||||
|
<view class="home-pic-base">
|
||||||
|
<view class="top-pic">
|
||||||
|
<image class="header" src="../../static/chat/index/test/header06.jpg" @tap="test"></image>
|
||||||
|
</view>
|
||||||
|
<view class="top-name">Liuxy</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="moments__post" v-for="(post,index) in posts" :key="index" :id="'post-'+index">
|
||||||
|
<view class="post-left">
|
||||||
|
<image class="post_header" :src="post.header_image"></image>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="post_right">
|
||||||
|
<text class="post-username">{{post.username}}</text>
|
||||||
|
<view id="paragraph" class="paragraph">{{post.content.text}}</view>
|
||||||
|
<!-- 相册 -->
|
||||||
|
<view class="thumbnails">
|
||||||
|
<view :class="post.content.images.length === 1?'my-gallery':'thumbnail'"
|
||||||
|
v-for="(image, index_images) in post.content.images" :key="index_images">
|
||||||
|
<image class="gallery_img" lazy-load mode="aspectFill" :src="image" :data-src="image"
|
||||||
|
@tap="previewImage(post.content.images,index_images)"></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 资料条 -->
|
||||||
|
<view class="toolbar">
|
||||||
|
<view class="timestamp">{{post.timestamp}}</view>
|
||||||
|
<view class="like" @tap="like(index)">
|
||||||
|
<image
|
||||||
|
:src="post.islike===0?'../../static/chat/index/islike.png':'../../static/chat/index/like.png'">
|
||||||
|
</image>
|
||||||
|
</view>
|
||||||
|
<view class="comment" @tap="comment(index)">
|
||||||
|
<image src="../../static/chat/index/comment.png"></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 赞/评论区 -->
|
||||||
|
<view class="post-footer">
|
||||||
|
<view class="footer_content">
|
||||||
|
<image class="liked" src="../../static/chat/index/liked.png"></image>
|
||||||
|
<text class="nickname" v-for="(user,index_like) in post.like"
|
||||||
|
:key="index_like">{{user.username}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="footer_content" v-for="(comment,comment_index) in post.comments.comment"
|
||||||
|
:key="comment_index" @tap="reply(index,comment_index)">
|
||||||
|
<text class="comment-nickname">{{comment.username}}: <text
|
||||||
|
class="comment-content">{{comment.content}}</text></text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 结束 post -->
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="foot" v-show="showInput">
|
||||||
|
<chat-input @send-message="send_comment" @blur="blur" :focus="focus" :placeholder="input_placeholder">
|
||||||
|
</chat-input>
|
||||||
|
<!-- <chat-input @send-message="send_comment" @blur="blur" :placeholder="input_placeholder"></chat-input> -->
|
||||||
|
</view>
|
||||||
|
<view class="uni-loadmore" v-if="showLoadMore">{{loadMoreText}}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import chatInput from '../../components/im-chat/chatinput.vue'; //input框
|
||||||
|
import postData from '../../common/index/index.post.data.js'; //朋友圈数据
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
chatInput
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
posts: postData, //模拟数据
|
||||||
|
user_id: 4,
|
||||||
|
username: 'Liuxy',
|
||||||
|
|
||||||
|
index: '',
|
||||||
|
comment_index: '',
|
||||||
|
|
||||||
|
input_placeholder: '评论', //占位内容
|
||||||
|
focus: false, //是否自动聚焦输入框
|
||||||
|
is_reply: false, //回复还是评论
|
||||||
|
showInput: false, //评论输入框
|
||||||
|
|
||||||
|
screenHeight: '', //屏幕高度(系统)
|
||||||
|
platform: '',
|
||||||
|
windowHeight: '', //可用窗口高度(不计入软键盘)
|
||||||
|
|
||||||
|
loadMoreText: "加载中...",
|
||||||
|
showLoadMore: false,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
|
||||||
|
uni.getStorage({
|
||||||
|
key: 'posts',
|
||||||
|
success: function(res) {
|
||||||
|
console.log(res.data);
|
||||||
|
this.posts = res.data;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
uni.getSystemInfo({ //获取设备信息
|
||||||
|
success: (res) => {
|
||||||
|
this.screenHeight = res.screenHeight;
|
||||||
|
this.platform = res.platform;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
uni.startPullDownRefresh();
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
uni.onWindowResize((res) => { //监听窗口尺寸变化,窗口尺寸不包括底部导航栏
|
||||||
|
if (this.platform === 'ios') {
|
||||||
|
this.windowHeight = res.size.windowHeight;
|
||||||
|
this.adjust();
|
||||||
|
} else {
|
||||||
|
if (this.screenHeight - res.size.windowHeight > 60 && this.windowHeight <= res.size
|
||||||
|
.windowHeight) {
|
||||||
|
this.windowHeight = res.size.windowHeight;
|
||||||
|
this.adjust();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onHide() {
|
||||||
|
// uni.offWindowResize(); //取消监听窗口尺寸变化
|
||||||
|
},
|
||||||
|
onUnload() {
|
||||||
|
this.max = 0,
|
||||||
|
this.data = [],
|
||||||
|
this.loadMoreText = "加载更多",
|
||||||
|
this.showLoadMore = false;
|
||||||
|
},
|
||||||
|
onReachBottom() { //监听上拉触底事件
|
||||||
|
console.log('onReachBottom');
|
||||||
|
this.showLoadMore = true;
|
||||||
|
setTimeout(() => {
|
||||||
|
//获取数据
|
||||||
|
if (this.posts.length < 20) { //测试数据
|
||||||
|
this.posts = this.posts.concat(this.posts);
|
||||||
|
} else {
|
||||||
|
this.loadMoreText = "暂无更多";
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
},
|
||||||
|
onPullDownRefresh() { //监听下拉刷新动作
|
||||||
|
console.log('onPullDownRefresh');
|
||||||
|
// 这里获取数据
|
||||||
|
setTimeout(function() {
|
||||||
|
//初始化数据
|
||||||
|
uni.stopPullDownRefresh(); //停止下拉刷新
|
||||||
|
}, 1000);
|
||||||
|
},
|
||||||
|
onNavigationBarButtonTap(e) { //监听标题栏点击事件
|
||||||
|
if (e.index == 0) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/chat/publish'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
test() {
|
||||||
|
this.navigateTo('../test/test');
|
||||||
|
},
|
||||||
|
navigateTo(url) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: url
|
||||||
|
});
|
||||||
|
},
|
||||||
|
like(index) {
|
||||||
|
if (this.posts[index].islike === 0) {
|
||||||
|
this.posts[index].islike = 1;
|
||||||
|
this.posts[index].like.push({
|
||||||
|
"uid": this.user_id,
|
||||||
|
"username": "," + this.username
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.posts[index].islike = 0;
|
||||||
|
this.posts[index].like.splice(this.posts[index].like.indexOf({
|
||||||
|
"uid": this.user_id,
|
||||||
|
"username": "," + this.username
|
||||||
|
}), 1);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
comment(index) {
|
||||||
|
this.showInput = true; //调起input框
|
||||||
|
this.focus = true;
|
||||||
|
this.index = index;
|
||||||
|
},
|
||||||
|
adjust() { //当弹出软键盘发生评论动作时,调整页面位置pageScrollTo
|
||||||
|
return;
|
||||||
|
uni.createSelectorQuery().selectViewport().scrollOffset(res => {
|
||||||
|
var scrollTop = res.scrollTop;
|
||||||
|
let view = uni.createSelectorQuery().select("#post-" + this.index);
|
||||||
|
view.boundingClientRect(data => {
|
||||||
|
console.log("data:" + JSON.stringify(data));
|
||||||
|
console.log("手机屏幕高度:" + this.screenHeight);
|
||||||
|
console.log("竖直滚动位置" + scrollTop);
|
||||||
|
console.log("节点离页面顶部的距离为" + data.top);
|
||||||
|
console.log("节点高度为" + data.height);
|
||||||
|
console.log("窗口高度为" + this.windowHeight);
|
||||||
|
|
||||||
|
uni.pageScrollTo({
|
||||||
|
scrollTop: scrollTop - (this.windowHeight - (data.height + data
|
||||||
|
.top + 45)), //一顿乱算
|
||||||
|
// scrollTop: 50,
|
||||||
|
duration: 300
|
||||||
|
});
|
||||||
|
}).exec();
|
||||||
|
}).exec();
|
||||||
|
},
|
||||||
|
reply(index, comment_index) {
|
||||||
|
this.is_reply = true; //回复中
|
||||||
|
this.showInput = true; //调起input框
|
||||||
|
let replyTo = this.posts[index].comments.comment[comment_index].username;
|
||||||
|
this.input_placeholder = '回复' + replyTo;
|
||||||
|
this.index = index; //post索引
|
||||||
|
this.comment_index = comment_index; //评论索引
|
||||||
|
this.focus = true;
|
||||||
|
},
|
||||||
|
blur: function() {
|
||||||
|
this.init_input();
|
||||||
|
},
|
||||||
|
send_comment: function(message) {
|
||||||
|
|
||||||
|
if (this.is_reply) {
|
||||||
|
var reply_username = this.posts[this.index].comments.comment[this.comment_index].username;
|
||||||
|
var comment_content = '回复' + reply_username + ':' + message.content;
|
||||||
|
} else {
|
||||||
|
var comment_content = message.content;
|
||||||
|
}
|
||||||
|
this.posts[this.index].comments.total += 1;
|
||||||
|
this.posts[this.index].comments.comment.push({
|
||||||
|
"uid": this.user_id,
|
||||||
|
"username": this.username,
|
||||||
|
"content": comment_content //直接获取input中的值
|
||||||
|
});
|
||||||
|
this.init_input();
|
||||||
|
},
|
||||||
|
init_input() {
|
||||||
|
this.showInput = false;
|
||||||
|
this.focus = false;
|
||||||
|
this.input_placeholder = '评论';
|
||||||
|
this.is_reply = false;
|
||||||
|
},
|
||||||
|
previewImage(imageList, image_index) {
|
||||||
|
var current = imageList[image_index];
|
||||||
|
uni.previewImage({
|
||||||
|
current: current,
|
||||||
|
urls: imageList
|
||||||
|
});
|
||||||
|
},
|
||||||
|
goPublish() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: './publish/publish',
|
||||||
|
success: res => {},
|
||||||
|
fail: () => {},
|
||||||
|
complete: () => {}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
@import url("../../common/index/index.css");
|
||||||
|
</style>
|
||||||
273
pages/chat/publish.vue
Normal file
@@ -0,0 +1,273 @@
|
|||||||
|
<template>
|
||||||
|
<view class="page" @touchstart="touchStart" @touchend="touchEnd">
|
||||||
|
<form>
|
||||||
|
<view class="uni-textarea">
|
||||||
|
<textarea placeholder="这一刻的想法..." v-model="input_content" />
|
||||||
|
</view>
|
||||||
|
<view class="uni-list list-pd">
|
||||||
|
<view class="uni-list-cell cell-pd">
|
||||||
|
<view class="uni-uploader">
|
||||||
|
<view class="uni-uploader-head">
|
||||||
|
<view class="uni-uploader-title"></view>
|
||||||
|
<view class="uni-uploader-info">{{imageList.length}}/9</view>
|
||||||
|
</view>
|
||||||
|
<view class="uni-uploader-body">
|
||||||
|
<view class="uni-uploader__files">
|
||||||
|
<block v-for="(image,index) in imageList" :key="index">
|
||||||
|
<view class="uni-uploader__file" style="position: relative;">
|
||||||
|
<image class="uni-uploader__img" mode="aspectFill" :src="image"
|
||||||
|
:data-src="image" @tap="previewImage"></image>
|
||||||
|
<view class="close-view" @click="close(index)">×</view>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
<view class="uni-uploader__input-box" v-show="imageList.length < 9">
|
||||||
|
<view class="uni-uploader__input" @tap="chooseImage"></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="footer">
|
||||||
|
<button type="default" class="feedback-submit" @click="publish">提交</button>
|
||||||
|
</view>
|
||||||
|
</form>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import image from '@/common/image.js';
|
||||||
|
|
||||||
|
var sourceType = [
|
||||||
|
['camera'],
|
||||||
|
['album'],
|
||||||
|
['camera', 'album']
|
||||||
|
]
|
||||||
|
var sizeType = [
|
||||||
|
['compressed'],
|
||||||
|
['original'],
|
||||||
|
['compressed', 'original']
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// title: 'choose/previewImage',
|
||||||
|
input_content: '',
|
||||||
|
imageList: [],
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
sourceTypeIndex: 2,
|
||||||
|
sourceType: ['拍照', '相册', '拍照或相册'],
|
||||||
|
sizeTypeIndex: 2,
|
||||||
|
sizeType: ['压缩', '原图', '压缩或原图'],
|
||||||
|
countIndex: 8,
|
||||||
|
count: [1, 2, 3, 4, 5, 6, 7, 8, 9],
|
||||||
|
|
||||||
|
//侧滑返回start
|
||||||
|
startX: 0, //点击屏幕起始位置
|
||||||
|
movedX: 0, //横向移动的距离
|
||||||
|
endX: 0, //接触屏幕后移开时的位置
|
||||||
|
//end
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onUnload() {
|
||||||
|
this.imageList = [],
|
||||||
|
this.sourceTypeIndex = 2,
|
||||||
|
this.sourceType = ['拍照', '相册', '拍照或相册'],
|
||||||
|
this.sizeTypeIndex = 2,
|
||||||
|
this.sizeType = ['压缩', '原图', '压缩或原图'],
|
||||||
|
this.countIndex = 8;
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
async publish() {
|
||||||
|
if (!this.input_content) {
|
||||||
|
uni.showModal({
|
||||||
|
content: '内容不能为空',
|
||||||
|
showCancel: false,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
uni.showLoading({
|
||||||
|
title: '发布中'
|
||||||
|
});
|
||||||
|
|
||||||
|
var location = await this.getLocation(); //位置信息,可删除,主要想记录一下异步转同步处理
|
||||||
|
var images = [];
|
||||||
|
for (var i = 0, len = this.imageList.length; i < len; i++) {
|
||||||
|
var image_obj = {
|
||||||
|
name: 'image-' + i,
|
||||||
|
uri: this.imageList[i]
|
||||||
|
};
|
||||||
|
images.push(image_obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
uni.uploadFile({ //该上传仅为示例,可根据自己业务修改或封装,注意:统一上传可能会导致服务器压力过大
|
||||||
|
url: 'moment/moments', //仅为示例,非真实的接口地址
|
||||||
|
files: images, //有files时,会忽略filePath和name
|
||||||
|
filePath: '',
|
||||||
|
name: '',
|
||||||
|
formData: { //后台以post方式接收
|
||||||
|
'user_id': '1', //自己系统中的用户id
|
||||||
|
'text': this.input_content, //moment文字部分
|
||||||
|
'longitude': location.longitude, //经度
|
||||||
|
'latitude': location.latitude //纬度
|
||||||
|
},
|
||||||
|
success: (uploadFileRes) => {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'success',
|
||||||
|
title: "发布成功"
|
||||||
|
})
|
||||||
|
uni.navigateBack({ //可根据实际情况使用其他路由方式
|
||||||
|
delta: 1
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fail: (e) => {
|
||||||
|
console.log("e: " + JSON.stringify(e));
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: "发布失败,请检查网络"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
getLocation() { //h5中可能不支持,自己选择
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
uni.getLocation({
|
||||||
|
type: 'wgs84',
|
||||||
|
success: function(res) {
|
||||||
|
resolve(res);
|
||||||
|
},
|
||||||
|
fail: (e) => {
|
||||||
|
reject(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
close(e) {
|
||||||
|
this.imageList.splice(e, 1);
|
||||||
|
},
|
||||||
|
chooseImage: async function() {
|
||||||
|
if (this.imageList.length === 9) {
|
||||||
|
let isContinue = await this.isFullImg();
|
||||||
|
console.log("是否继续?", isContinue);
|
||||||
|
if (!isContinue) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
uni.chooseImage({
|
||||||
|
sourceType: sourceType[this.sourceTypeIndex],
|
||||||
|
sizeType: sizeType[this.sizeTypeIndex],
|
||||||
|
count: this.imageList.length + this.count[this.countIndex] > 9 ? 9 - this.imageList
|
||||||
|
.length : this.count[this.countIndex],
|
||||||
|
success: (res) => {
|
||||||
|
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
//提交压缩,因为使用了H5+ Api,所以自定义压缩目前仅支持APP平台
|
||||||
|
var compressd = cp_images => {
|
||||||
|
this.imageList = this.imageList.concat(cp_images) //压缩后的图片路径
|
||||||
|
}
|
||||||
|
image.compress(res.tempFilePaths, compressd);
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifndef APP-PLUS
|
||||||
|
this.imageList = this.imageList.concat(res
|
||||||
|
.tempFilePaths) //非APP平台不支持自定义压缩,暂时没有处理,可通过uni-app上传组件的sizeType属性压缩
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
isFullImg: function() {
|
||||||
|
return new Promise((res) => {
|
||||||
|
uni.showModal({
|
||||||
|
content: "已经有9张图片了,是否清空现有图片?",
|
||||||
|
success: (e) => {
|
||||||
|
if (e.confirm) {
|
||||||
|
this.imageList = [];
|
||||||
|
res(true);
|
||||||
|
} else {
|
||||||
|
res(false)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: () => {
|
||||||
|
res(false)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
previewImage: function(e) {
|
||||||
|
var current = e.target.dataset.src
|
||||||
|
uni.previewImage({
|
||||||
|
current: current,
|
||||||
|
urls: this.imageList
|
||||||
|
})
|
||||||
|
},
|
||||||
|
touchStart: function(e) {
|
||||||
|
this.startX = e.mp.changedTouches[0].pageX;
|
||||||
|
},
|
||||||
|
|
||||||
|
touchEnd: function(e) {
|
||||||
|
this.endX = e.mp.changedTouches[0].pageX;
|
||||||
|
if (this.endX - this.startX > 200) {
|
||||||
|
uni.navigateBack();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.footer {
|
||||||
|
margin-top: 80upx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cell-pd {
|
||||||
|
padding: 20upx 30upx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-textarea {
|
||||||
|
width: auto;
|
||||||
|
padding: 20upx 25upx;
|
||||||
|
line-height: 1.6;
|
||||||
|
height: 150upx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-list::before {
|
||||||
|
height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-list:after {
|
||||||
|
height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-pd {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.close-view {
|
||||||
|
text-align: center;
|
||||||
|
line-height: 30upx;
|
||||||
|
height: 35upx;
|
||||||
|
width: 35upx;
|
||||||
|
background: #ef5350;
|
||||||
|
color: #FFFFFF;
|
||||||
|
position: absolute;
|
||||||
|
top: 1upx;
|
||||||
|
right: 1upx;
|
||||||
|
font-size: 35upx;
|
||||||
|
border-radius: 8upx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page {
|
||||||
|
width: 750upx;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view class="feedback">
|
||||||
<view class="feedback-block">
|
<view class="feedback-block">
|
||||||
<view class="feedback-title">您有任何意见与建议</view>
|
<view class="feedback-title">您有任何意见与建议</view>
|
||||||
<view class="feedback-radiobox">
|
<view class="feedback-radiobox">
|
||||||
@@ -39,6 +39,24 @@
|
|||||||
<view class="btn">
|
<view class="btn">
|
||||||
<button type="default" @click="subFeedback">提交</button>
|
<button type="default" @click="subFeedback">提交</button>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 微信客服 -->
|
||||||
|
<u-modal
|
||||||
|
:show="wechatCode"
|
||||||
|
title="微信客服"
|
||||||
|
confirmColor="#34CE98"
|
||||||
|
:showCancelButton="true"
|
||||||
|
cancelText="关闭"
|
||||||
|
confirmText="保存二维码"
|
||||||
|
@cancel="wechatCode = false"
|
||||||
|
@confirm="dowQrCode"
|
||||||
|
>
|
||||||
|
<slot>
|
||||||
|
<view class="wechat-content">
|
||||||
|
<image class="wechat-qrcode" :src="require('@/static/user/qrCode.jpeg')" mode="widthFix"></image>
|
||||||
|
<view class="wechat-text">扫描企业微信二维码,添加微信客服</view>
|
||||||
|
</view>
|
||||||
|
</slot>
|
||||||
|
</u-modal>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -52,7 +70,8 @@
|
|||||||
description: "",
|
description: "",
|
||||||
mobile : "",
|
mobile : "",
|
||||||
systemInfo : {},
|
systemInfo : {},
|
||||||
feedbackImg: []
|
feedbackImg: [],
|
||||||
|
wechatCode : false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(){
|
onLoad(){
|
||||||
@@ -73,11 +92,26 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
onNavigationBarButtonTap() {
|
onNavigationBarButtonTap() {
|
||||||
uni.makePhoneCall({
|
this.wechatCode = true
|
||||||
phoneNumber: '18704601568'
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
dowQrCode(){
|
||||||
|
uni.saveImageToPhotosAlbum({
|
||||||
|
filePath: require('@/static/user/qrCode.jpeg'),
|
||||||
|
success(res) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '二维码已保存到系统相册',
|
||||||
|
icon : 'none'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail(err) {
|
||||||
|
uni.showToast({
|
||||||
|
title: err.message,
|
||||||
|
icon : 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
changeRadio(e){
|
changeRadio(e){
|
||||||
if(this.radioValue === e) return
|
if(this.radioValue === e) return
|
||||||
this.radioValue = e
|
this.radioValue = e
|
||||||
@@ -260,4 +294,20 @@
|
|||||||
.btn button:after{
|
.btn button:after{
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 弹出层 */
|
||||||
|
.wechat-content{
|
||||||
|
text-align: center;
|
||||||
|
padding: 30rpx 0;
|
||||||
|
}
|
||||||
|
.wechat-qrcode{
|
||||||
|
width: 248rpx;
|
||||||
|
height: 248rpx;
|
||||||
|
}
|
||||||
|
.wechat-text{
|
||||||
|
text-align: center;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: gray;
|
||||||
|
padding-top: 30rpx;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<view class="invitation">
|
<view class="invitation">
|
||||||
<view class="invitation-refund">
|
<view class="invitation-refund" v-if="!canSave">
|
||||||
<view class="invitation-refund-btn" @click="onBack">
|
<view class="invitation-refund-btn" @click="onBack">
|
||||||
<uni-icons type="back" color="white" size="24"></uni-icons>
|
<uni-icons type="back" color="white" size="24"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
@@ -16,7 +15,7 @@
|
|||||||
<view class="invitation-text-sub">邀请好友增加共力分增长</view>
|
<view class="invitation-text-sub">邀请好友增加共力分增长</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<button class="invitation-btn" @click="onShare">分享邀请</button>
|
<button class="invitation-btn" @click="onShare" v-if="!canSave">分享邀请</button>
|
||||||
</view>
|
</view>
|
||||||
<!-- 分享 -->
|
<!-- 分享 -->
|
||||||
<uni-popup ref="popupShare" type="share" background-color="#fff">
|
<uni-popup ref="popupShare" type="share" background-color="#fff">
|
||||||
@@ -26,12 +25,15 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { invitationCode } from '@/apis/interfaces/user.js'
|
import {
|
||||||
|
invitationCode
|
||||||
|
} from '@/apis/interfaces/user.js'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
invite: '',
|
invite: '',
|
||||||
code : '',
|
code: '',
|
||||||
|
canSave: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -42,41 +44,41 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 返回
|
// 返回
|
||||||
onBack(){
|
onBack() {
|
||||||
this.$Router.back()
|
this.$Router.back()
|
||||||
},
|
},
|
||||||
// 复制邀请码
|
// 复制邀请码
|
||||||
copyInvite(){
|
copyInvite() {
|
||||||
uni.setClipboardData({
|
uni.setClipboardData({
|
||||||
data: this.invite,
|
data: this.invite,
|
||||||
success() {
|
success() {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '邀请码已复制',
|
title: '邀请码已复制',
|
||||||
icon : 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 分享
|
// 分享
|
||||||
onShare(){
|
onShare() {
|
||||||
this.$refs.popupShare.open();
|
this.$refs.popupShare.open();
|
||||||
},
|
},
|
||||||
// 分享选项
|
// 分享选项
|
||||||
select(e){
|
select(e) {
|
||||||
switch(e.item.name){
|
switch (e.item.name) {
|
||||||
case 'wxchum':
|
case 'wxchum':
|
||||||
uni.share({
|
uni.share({
|
||||||
provider: 'weixin',
|
provider: 'weixin',
|
||||||
scene : 'WXSceneSession',
|
scene: 'WXSceneSession',
|
||||||
type : 0,
|
type: 0,
|
||||||
href : 'https://invite.gongli.vip?invitation_code=' + this.invite,
|
href: 'https://invite.gongli.vip?invitation_code=' + this.invite,
|
||||||
title : '共力生态',
|
title: '共力生态',
|
||||||
summary : '共商 共建 共享 共赢 带您进入Web 3.0!推动全体成员共同富裕',
|
summary: '共商 共建 共享 共赢 带您进入Web 3.0!推动全体成员共同富裕',
|
||||||
imageUrl: 'https://gl-ecological.oss-cn-zhangjiakou.aliyuncs.com/images/2022/06/11/3b7e6e330f465ecbf136d15def1039fd.jpg',
|
imageUrl: 'https://gl-ecological.oss-cn-zhangjiakou.aliyuncs.com/images/2022/06/11/3b7e6e330f465ecbf136d15def1039fd.jpg',
|
||||||
fail(err) {
|
fail(err) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.errMsg,
|
title: err.errMsg,
|
||||||
icon : 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -84,43 +86,125 @@
|
|||||||
case 'wxcircle':
|
case 'wxcircle':
|
||||||
uni.share({
|
uni.share({
|
||||||
provider: 'weixin',
|
provider: 'weixin',
|
||||||
scene : 'WXSceneTimeline',
|
scene: 'WXSceneTimeline',
|
||||||
type : 0,
|
type: 0,
|
||||||
href : 'https://invite.gongli.vip?invitation_code=' + this.invite,
|
href: 'https://invite.gongli.vip?invitation_code=' + this.invite,
|
||||||
summary : '共商 共建 共享 共赢 带您进入Web 3.0!推动全体成员共同富裕',
|
summary: '共商 共建 共享 共赢 带您进入Web 3.0!推动全体成员共同富裕',
|
||||||
imageUrl: 'https://gl-ecological.oss-cn-zhangjiakou.aliyuncs.com/images/2022/06/11/3b7e6e330f465ecbf136d15def1039fd.jpg',
|
imageUrl: 'https://gl-ecological.oss-cn-zhangjiakou.aliyuncs.com/images/2022/06/11/3b7e6e330f465ecbf136d15def1039fd.jpg',
|
||||||
fail(err) {
|
fail(err) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.errMsg,
|
title: err.errMsg,
|
||||||
icon : 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
break;
|
break;
|
||||||
case 'qq':
|
case 'download':
|
||||||
uni.showToast({
|
this.canSave = true
|
||||||
title: 'qq好友分享近期开放,敬请期待',
|
uni.showLoading({
|
||||||
icon : 'none'
|
title: '保存中'
|
||||||
})
|
})
|
||||||
|
this.down()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
down() {
|
||||||
|
setTimeout(() => {
|
||||||
|
let pages = getCurrentPages();
|
||||||
|
let page = pages[pages.length - 1];
|
||||||
|
let ws = page.$getAppWebview();
|
||||||
|
let bitmap = new plus.nativeObj.Bitmap('drawScreen');
|
||||||
|
// 将webview内容绘制到Bitmap对象中
|
||||||
|
ws.draw(bitmap, () => {
|
||||||
|
// 保存图片到本地
|
||||||
|
bitmap.save("_doc/drawScreen.jpg", {
|
||||||
|
overwrite: true
|
||||||
|
}, res => {
|
||||||
|
console.log(res.target); // 图片地址
|
||||||
|
|
||||||
|
uni.saveImageToPhotosAlbum({ //保存图片到系统相册。
|
||||||
|
filePath: res.target, //图片文件路径
|
||||||
|
success: () => {
|
||||||
|
uni.showModal({
|
||||||
|
title: '温馨提示',
|
||||||
|
content: '保存图片成功,赶紧去转发给好友吧~',
|
||||||
|
showCancel: false,
|
||||||
|
confirmColor: "#34CE98",
|
||||||
|
confirmText: '知道了',
|
||||||
|
success: () => {
|
||||||
|
this.canSave = false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
uni.hideLoading()
|
||||||
|
},
|
||||||
|
fail: function(e) {
|
||||||
|
uni.showModal({
|
||||||
|
title: '温馨提示',
|
||||||
|
content: '保存图片失败,重新再试试~',
|
||||||
|
showCancel: false,
|
||||||
|
confirmColor: "#34CE98",
|
||||||
|
confirmText: '知道了',
|
||||||
|
success: () => {
|
||||||
|
this.canSave = false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
bitmap.clear(); // 清除Bitmap对象
|
||||||
|
}, error => {
|
||||||
|
console.log(JSON.stringify(error)); // 保存失败信息
|
||||||
|
uni.showModal({
|
||||||
|
title: '温馨提示',
|
||||||
|
content: '保存图片失败,重新再试试~',
|
||||||
|
showCancel: false,
|
||||||
|
confirmColor: "#34CE98",
|
||||||
|
confirmText: '知道了',
|
||||||
|
success: () => {
|
||||||
|
this.canSave = false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
uni.hideLoading()
|
||||||
|
bitmap.clear(); // 清除Bitmap对象
|
||||||
|
});
|
||||||
|
// bitmap.clear(); // 清除Bitmap对象
|
||||||
|
}, error => {
|
||||||
|
uni.showModal({
|
||||||
|
title: '温馨提示',
|
||||||
|
content: '保存图片失败,重新再试试~',
|
||||||
|
showCancel: false,
|
||||||
|
confirmColor: "#34CE98",
|
||||||
|
confirmText: '知道了',
|
||||||
|
success: () => {
|
||||||
|
this.canSave = false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
uni.hideLoading()
|
||||||
|
console.log(JSON.stringify(error)); // 绘制失败
|
||||||
|
}, {
|
||||||
|
check: true, // 设置为检测白屏
|
||||||
|
});
|
||||||
|
}, 2000)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.invitation{
|
.invitation {
|
||||||
position: relative;
|
position: relative;
|
||||||
background: #1c2472;
|
background: #1c2472;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
.invitation-refund{
|
|
||||||
|
.invitation-refund {
|
||||||
@extend .ios-top;
|
@extend .ios-top;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 30rpx;
|
top: 30rpx;
|
||||||
left: $margin*2;
|
left: $margin*2;
|
||||||
z-index: 9;
|
z-index: 9;
|
||||||
.invitation-refund-btn{
|
|
||||||
|
.invitation-refund-btn {
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
line-height: 58rpx;
|
line-height: 58rpx;
|
||||||
width: 58rpx;
|
width: 58rpx;
|
||||||
@@ -130,7 +214,8 @@
|
|||||||
background: rgba(0, 0, 0, .5);
|
background: rgba(0, 0, 0, .5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.invitation-back{
|
|
||||||
|
.invitation-back {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
@@ -138,13 +223,15 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.invitation-content{
|
|
||||||
|
.invitation-content {
|
||||||
padding: $padding*2;
|
padding: $padding*2;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 5vh;
|
bottom: 5vh;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
.invitation-lay{
|
|
||||||
|
.invitation-lay {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
@@ -154,30 +241,36 @@
|
|||||||
padding: $padding;
|
padding: $padding;
|
||||||
margin-bottom: $margin;
|
margin-bottom: $margin;
|
||||||
color: white;
|
color: white;
|
||||||
.invitation-code{
|
|
||||||
|
.invitation-code {
|
||||||
width: 168rpx;
|
width: 168rpx;
|
||||||
height: 168rpx;
|
height: 168rpx;
|
||||||
background: white;
|
background: white;
|
||||||
}
|
}
|
||||||
.invitation-text{
|
|
||||||
|
.invitation-text {
|
||||||
width: calc(100% - 198rpx);
|
width: calc(100% - 198rpx);
|
||||||
.invitation-text-code{
|
|
||||||
|
.invitation-text-code {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
line-height: 50rpx;
|
line-height: 50rpx;
|
||||||
text{
|
|
||||||
|
text {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 40rpx;
|
font-size: 40rpx;
|
||||||
margin-right: 10rpx;
|
margin-right: 10rpx;
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.invitation-text-sub{
|
|
||||||
|
.invitation-text-sub {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
line-height: 50rpx;
|
line-height: 50rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.invitation-btn{
|
|
||||||
|
.invitation-btn {
|
||||||
height: 90rpx;
|
height: 90rpx;
|
||||||
line-height: 90rpx;
|
line-height: 90rpx;
|
||||||
border-radius: 45rpx;
|
border-radius: 45rpx;
|
||||||
@@ -185,7 +278,8 @@
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
background: #5a0399;
|
background: #5a0399;
|
||||||
color: white;
|
color: white;
|
||||||
&::after{
|
|
||||||
|
&::after {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,7 +87,7 @@
|
|||||||
<image src="../../static/life/icon_04.png" mode="widthFix"></image>
|
<image src="../../static/life/icon_04.png" mode="widthFix"></image>
|
||||||
我的订单
|
我的订单
|
||||||
</view>
|
</view>
|
||||||
<view class="other-subtitle">{{order.all || '暂无订单'}}</view>
|
<view class="other-subtitle">{{order.all === 0 ? '暂无订单': '订单数量' + order.all}}</view>
|
||||||
<image class="other-back" src="../../static/life/icon_09.png"></image>
|
<image class="other-back" src="../../static/life/icon_09.png"></image>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="life-flex-item other" @click="onToast('共力好友暂未开放尽情期待')">
|
<!-- <view class="life-flex-item other" @click="onToast('共力好友暂未开放尽情期待')">
|
||||||
|
|||||||
@@ -73,7 +73,6 @@
|
|||||||
this.getOrder()
|
this.getOrder()
|
||||||
eventBus.$on('paySuccess', function(data) {
|
eventBus.$on('paySuccess', function(data) {
|
||||||
let index = this.array.findIndex((item) => item.no === data);
|
let index = this.array.findIndex((item) => item.no === data);
|
||||||
console.log(typeof this.index, this.index)
|
|
||||||
if (this.index == '0') {
|
if (this.index == '0') {
|
||||||
this.array[index].stateText = '待发货'
|
this.array[index].stateText = '待发货'
|
||||||
this.array[index].cans = {
|
this.array[index].cans = {
|
||||||
@@ -92,7 +91,6 @@
|
|||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
||||||
eventBus.$on('applyRefundMoney', (data)=> {
|
eventBus.$on('applyRefundMoney', (data)=> {
|
||||||
console.log(data,'data....');
|
|
||||||
let index = this.array.findIndex((item) => item.no === data);
|
let index = this.array.findIndex((item) => item.no === data);
|
||||||
this.array.splice(index, 1);
|
this.array.splice(index, 1);
|
||||||
});
|
});
|
||||||
@@ -264,8 +262,6 @@
|
|||||||
}
|
}
|
||||||
if (!onFount) return
|
if (!onFount) return
|
||||||
onFount.then(res => {
|
onFount.then(res => {
|
||||||
console.log(res)
|
|
||||||
|
|
||||||
let orderIndex = this.array.findIndex(val => val.no === e.order.no)
|
let orderIndex = this.array.findIndex(val => val.no === e.order.no)
|
||||||
if (e.type === 'delete' || e.type === 'sign') {
|
if (e.type === 'delete' || e.type === 'sign') {
|
||||||
this.array.splice(orderIndex, 1)
|
this.array.splice(orderIndex, 1)
|
||||||
|
|||||||
@@ -73,7 +73,6 @@
|
|||||||
|
|
||||||
payIndex() {
|
payIndex() {
|
||||||
payIndex().then(res => {
|
payIndex().then(res => {
|
||||||
console.log(res);
|
|
||||||
this.has_transfer_password = res.has_transfer_password;
|
this.has_transfer_password = res.has_transfer_password;
|
||||||
this.coins = res.score
|
this.coins = res.score
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
@@ -112,7 +111,6 @@
|
|||||||
|
|
||||||
// 输入正确的回调
|
// 输入正确的回调
|
||||||
enterSuccess(password) {
|
enterSuccess(password) {
|
||||||
console.log(password) // 输入的密码
|
|
||||||
this.password = password
|
this.password = password
|
||||||
this.showKeyBoard = false
|
this.showKeyBoard = false
|
||||||
this.getDTPAY();
|
this.getDTPAY();
|
||||||
@@ -125,10 +123,8 @@
|
|||||||
|
|
||||||
// 调用 dt 支付
|
// 调用 dt 支付
|
||||||
getDTPAY() {
|
getDTPAY() {
|
||||||
console.log('dt 支付。。。')
|
|
||||||
if (this.canpay) {
|
if (this.canpay) {
|
||||||
this.canpay = false
|
this.canpay = false
|
||||||
console.log(this.password,this.payNo,'//////////')
|
|
||||||
dtPAY(this.payNo, this.password).then(res => {
|
dtPAY(this.payNo, this.password).then(res => {
|
||||||
if (res.state === 'warning') {
|
if (res.state === 'warning') {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
|
|||||||
@@ -68,14 +68,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
console.log(this.$Route.query.id);
|
|
||||||
this.id = this.$Route.query.id;
|
this.id = this.$Route.query.id;
|
||||||
this.getBaseInfo();
|
this.getBaseInfo();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getBaseInfo(){
|
getBaseInfo(){
|
||||||
refundpre(this.id).then(res=>{
|
refundpre(this.id).then(res=>{
|
||||||
console.log(res)
|
|
||||||
this.goodsInfo = res.order.items[0].sku;
|
this.goodsInfo = res.order.items[0].sku;
|
||||||
this.goodsInfo.shop =res.order.shop;
|
this.goodsInfo.shop =res.order.shop;
|
||||||
this.refundTime = res.refundTime;
|
this.refundTime = res.refundTime;
|
||||||
|
|||||||
@@ -59,10 +59,12 @@
|
|||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
deliverpre().then(res=>{
|
deliverpre().then(res=>{
|
||||||
console.log(res)
|
|
||||||
this.state.array = res.expresses
|
this.state.array = res.expresses
|
||||||
}).catch(err=>{
|
}).catch(err=>{
|
||||||
console.log(err);
|
uni.showToast({
|
||||||
|
title: err.message,
|
||||||
|
icon : 'none'
|
||||||
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -120,7 +120,6 @@
|
|||||||
methods: {
|
methods: {
|
||||||
refund() {
|
refund() {
|
||||||
refundsInfo(this.$Route.query.id).then(res => {
|
refundsInfo(this.$Route.query.id).then(res => {
|
||||||
console.log(res);
|
|
||||||
this.goodsInfo = res.items[0];
|
this.goodsInfo = res.items[0];
|
||||||
this.refundInfo = res;
|
this.refundInfo = res;
|
||||||
this.type = res.type.state;
|
this.type = res.type.state;
|
||||||
|
|||||||
@@ -78,7 +78,6 @@
|
|||||||
this.getOrder()
|
this.getOrder()
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
console.log('onPullDownRefresh.....')
|
|
||||||
this.page = 1;
|
this.page = 1;
|
||||||
this.getOrder();
|
this.getOrder();
|
||||||
},
|
},
|
||||||
@@ -87,21 +86,9 @@
|
|||||||
refunds({
|
refunds({
|
||||||
page: this.page
|
page: this.page
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log(res)
|
|
||||||
if (res.page.current === 1) {
|
if (res.page.current === 1) {
|
||||||
this.array = []
|
this.array = []
|
||||||
}
|
}
|
||||||
// let ordersArr = res.data.map(val => {
|
|
||||||
// return {
|
|
||||||
// no: val.order_no,
|
|
||||||
// cover: val.items[0].sku.cover,
|
|
||||||
// name: val.items[0].sku.goods_name,
|
|
||||||
// price: val.total,
|
|
||||||
// sum: val.items[0].qty,
|
|
||||||
// stateText: val.state,
|
|
||||||
// cans: val.can
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
uni.stopPullDownRefresh();
|
uni.stopPullDownRefresh();
|
||||||
this.array = this.array.concat(res.data);
|
this.array = this.array.concat(res.data);
|
||||||
this.status = res.page.has_more ? 'loadmore' : 'nomore';
|
this.status = res.page.has_more ? 'loadmore' : 'nomore';
|
||||||
|
|||||||
@@ -45,7 +45,6 @@
|
|||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
refundsLogs(this.$Route.query.id).then(res => {
|
refundsLogs(this.$Route.query.id).then(res => {
|
||||||
console.log(res)
|
|
||||||
this.logs = res.logs
|
this.logs = res.logs
|
||||||
this.goodsInfo = res.refund.items[0]
|
this.goodsInfo = res.refund.items[0]
|
||||||
this.refund_total = res.refund.refund_total
|
this.refund_total = res.refund.refund_total
|
||||||
|
|||||||
@@ -71,7 +71,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
console.log(this.$Route.query.id)
|
|
||||||
this.id = this.$Route.query.id;
|
this.id = this.$Route.query.id;
|
||||||
this.refund(this.id, 'get');
|
this.refund(this.id, 'get');
|
||||||
},
|
},
|
||||||
@@ -131,9 +130,6 @@
|
|||||||
itemList: this.title,
|
itemList: this.title,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
this.ttext = this.title[res.tapIndex]
|
this.ttext = this.title[res.tapIndex]
|
||||||
},
|
|
||||||
fail: (res) => {
|
|
||||||
console.log(res.errMsg);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -154,9 +154,6 @@
|
|||||||
itemList: this.title,
|
itemList: this.title,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
this.ttext = this.title[res.tapIndex]
|
this.ttext = this.title[res.tapIndex]
|
||||||
},
|
|
||||||
fail: (res) => {
|
|
||||||
console.log(res.errMsg);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -120,7 +120,6 @@
|
|||||||
address_id : this.address.address_id,
|
address_id : this.address.address_id,
|
||||||
remark : this.remark || ''
|
remark : this.remark || ''
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log(res);
|
|
||||||
this.$store.commit('setAddress', {})
|
this.$store.commit('setAddress', {})
|
||||||
this.$Router.replace({
|
this.$Router.replace({
|
||||||
name: 'Pay',
|
name: 'Pay',
|
||||||
|
|||||||
@@ -36,7 +36,6 @@
|
|||||||
<view class="shopInfo-title-right" >全部商品 {{goods.shop.goods_count || 0}} <uni-icons type="right" color="grey"/></view>
|
<view class="shopInfo-title-right" >全部商品 {{goods.shop.goods_count || 0}} <uni-icons type="right" color="grey"/></view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<view class="imgs">
|
<view class="imgs">
|
||||||
<block v-for="(item, index) in goods.content" :key="index">
|
<block v-for="(item, index) in goods.content" :key="index">
|
||||||
<image :src="item" mode="widthFix"></image>
|
<image :src="item" mode="widthFix"></image>
|
||||||
@@ -74,8 +73,7 @@
|
|||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
getGoods(){
|
getGoods(){
|
||||||
goods(this.$Route.query.id || 55).then(res => {
|
goods(this.$Route.query.id).then(res => {
|
||||||
console.log(res);
|
|
||||||
this.goods = res
|
this.goods = res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -34,7 +34,6 @@
|
|||||||
methods:{
|
methods:{
|
||||||
getMeals(){
|
getMeals(){
|
||||||
meals(this.$Route.query.id, this.categoryId).then(res => {
|
meals(this.$Route.query.id, this.categoryId).then(res => {
|
||||||
console.log(res)
|
|
||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
title: res.meal.subtitle
|
title: res.meal.subtitle
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -46,8 +46,6 @@
|
|||||||
name: this.searchVlaue,
|
name: this.searchVlaue,
|
||||||
page: this.page
|
page: this.page
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log(res.page)
|
|
||||||
|
|
||||||
if(res.page.current === 1){
|
if(res.page.current === 1){
|
||||||
this.goodsArr = []
|
this.goodsArr = []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,12 +72,12 @@
|
|||||||
goods : [],
|
goods : [],
|
||||||
has_more:true,
|
has_more:true,
|
||||||
page:1,
|
page:1,
|
||||||
|
ShopId:'',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
this.ShopId = this.$Route.query.ShopId
|
this.ShopId = this.$Route.query.ShopId
|
||||||
shopsDetail(this.ShopId).then(res => {
|
shopsDetail(this.ShopId).then(res => {
|
||||||
console.log(res);
|
|
||||||
this.classify = [{
|
this.classify = [{
|
||||||
category_id: '',
|
category_id: '',
|
||||||
name: '全部商品',
|
name: '全部商品',
|
||||||
@@ -95,20 +95,19 @@
|
|||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
this.has_more = true;
|
this.has_more = true;
|
||||||
this.page = 1;
|
this.page = 1;
|
||||||
|
this.goods = [];
|
||||||
this.getGoods()
|
this.getGoods()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getGoods() {
|
getGoods() {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '加载中...'
|
title:'请求中~',
|
||||||
|
mask:true,
|
||||||
})
|
})
|
||||||
shopsGoods(this.ShopId, this.category_id,this.page).then(res => {
|
shopsGoods(this.ShopId, this.category_id,this.page).then(res => {
|
||||||
if(this.page = 1){
|
|
||||||
this.goods = [];
|
|
||||||
}
|
|
||||||
this.goods = this.goods.concat(res.data);
|
this.goods = this.goods.concat(res.data);
|
||||||
this.has_more = res.page.has_more;
|
this.has_more = res.page.has_more;
|
||||||
uni.hideLoading()
|
uni.hideLoading();
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.message,
|
title: err.message,
|
||||||
@@ -118,9 +117,14 @@
|
|||||||
},
|
},
|
||||||
lower(){
|
lower(){
|
||||||
if(this.has_more){
|
if(this.has_more){
|
||||||
this.page = this.page + 1;
|
this.page = this.page + 1
|
||||||
this.has_more = true;
|
this.getGoods();
|
||||||
this.getGoods()
|
}else{
|
||||||
|
uni.showToast({
|
||||||
|
title:'没有更多~',
|
||||||
|
icon:"none",
|
||||||
|
mask:true,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
selectClassify(id) {
|
selectClassify(id) {
|
||||||
|
|||||||
@@ -56,7 +56,6 @@
|
|||||||
methods: {
|
methods: {
|
||||||
getShops() {
|
getShops() {
|
||||||
shops(this.categoryId, this.page).then(res => {
|
shops(this.categoryId, this.page).then(res => {
|
||||||
console.log(res)
|
|
||||||
if (this.page == 1) {
|
if (this.page == 1) {
|
||||||
this.shopsArr = [];
|
this.shopsArr = [];
|
||||||
this.classify = [{
|
this.classify = [{
|
||||||
|
|||||||
@@ -92,6 +92,13 @@
|
|||||||
导出助记词
|
导出助记词
|
||||||
<uni-icons class="forward" type="forward" color="#999" />
|
<uni-icons class="forward" type="forward" color="#999" />
|
||||||
</view>
|
</view>
|
||||||
|
<block v-if="canSeeData">
|
||||||
|
<view class="btns-box-item" @click="onBtn('DataBoard', {})">
|
||||||
|
<image class="icon" src="@/static/user/userIcon_12.png" mode="widthFix" />
|
||||||
|
平台数据看板
|
||||||
|
<uni-icons class="forward" type="forward" color="#999" />
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
</view>
|
</view>
|
||||||
<view class="btns-box">
|
<view class="btns-box">
|
||||||
<view class="btns-box-item" @click="onBtn('Address', { type: 'edit' })">
|
<view class="btns-box-item" @click="onBtn('Address', { type: 'edit' })">
|
||||||
@@ -148,7 +155,7 @@
|
|||||||
@confirm="validationIv" @cancel="()=>{ this.showIv = false, this.iv = '' }">
|
@confirm="validationIv" @cancel="()=>{ this.showIv = false, this.iv = '' }">
|
||||||
<slot name="default">
|
<slot name="default">
|
||||||
<view class="mnemonic-pwass">
|
<view class="mnemonic-pwass">
|
||||||
<input class="iv-input" :focus="true" type="password" v-model="iv" maxlength="10"
|
<input class="iv-input" :focus="true" type="number" password v-model="iv" maxlength="10"
|
||||||
placeholder="输入支付密码" />
|
placeholder="输入支付密码" />
|
||||||
</view>
|
</view>
|
||||||
</slot>
|
</slot>
|
||||||
@@ -200,7 +207,9 @@
|
|||||||
iv : '',
|
iv : '',
|
||||||
// 是否显示钱包
|
// 是否显示钱包
|
||||||
isWallet : false,
|
isWallet : false,
|
||||||
walletNum : 0
|
walletNum : 0,
|
||||||
|
// 数据看板权限
|
||||||
|
canSeeData : false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
@@ -215,6 +224,7 @@
|
|||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
title: res.nickname
|
title: res.nickname
|
||||||
});
|
});
|
||||||
|
this.canSeeData = res.can_see_data
|
||||||
this.order = res.order
|
this.order = res.order
|
||||||
this.cardText = res.identity_array
|
this.cardText = res.identity_array
|
||||||
this.userInfo = {
|
this.userInfo = {
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
console.log(e.id);
|
|
||||||
agreement(e.id).then(res => {
|
agreement(e.id).then(res => {
|
||||||
this.content = res.content
|
this.content = res.content
|
||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
|
|||||||
BIN
static/.DS_Store
vendored
Normal file
BIN
static/chat/194566519415950980.png
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
static/chat/223427836980650199.jpg
Normal file
|
After Width: | Height: | Size: 165 KiB |
BIN
static/chat/274292070323481760.jpg
Normal file
|
After Width: | Height: | Size: 152 KiB |
BIN
static/chat/286155930458879544.jpg
Normal file
|
After Width: | Height: | Size: 166 KiB |
BIN
static/chat/29795045527088873.jpg
Normal file
|
After Width: | Height: | Size: 179 KiB |
BIN
static/chat/367274203196161533.jpg
Normal file
|
After Width: | Height: | Size: 90 KiB |
BIN
static/chat/808967468752110033.jpg
Normal file
|
After Width: | Height: | Size: 228 KiB |
BIN
static/chat/fonts/HYQiHeiX1-45W.ttf
Normal file
BIN
static/chat/fonts/HYQiHeiX1-55W.ttf
Normal file
BIN
static/chat/fonts/fontawesome-webfont.eot
Normal file
BIN
static/chat/fonts/fontawesome-webfont.ttf
Normal file
BIN
static/chat/fonts/fontawesome-webfont.woff
Normal file
BIN
static/chat/fonts/fontawesome-webfont.woff2
Normal file
BIN
static/chat/fonts/iconfont.ttf
Normal file
BIN
static/chat/fonts/taobao_global.ttf
Normal file
BIN
static/chat/index/60x60.png
Normal file
|
After Width: | Height: | Size: 774 B |
BIN
static/chat/index/camera.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
static/chat/index/comment.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
static/chat/index/find-album-reflash-icon.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
static/chat/index/islike.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
static/chat/index/like.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
static/chat/index/liked.png
Normal file
|
After Width: | Height: | Size: 7.8 KiB |
BIN
static/chat/index/test/bear.jpg
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
static/chat/index/test/bgi.jpg
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
static/chat/index/test/bgi02.jpg
Normal file
|
After Width: | Height: | Size: 95 KiB |
BIN
static/chat/index/test/header01.jpg
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
static/chat/index/test/header02.jpg
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
static/chat/index/test/header03.jpg
Normal file
|
After Width: | Height: | Size: 210 KiB |
BIN
static/chat/index/test/header04.jpg
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
static/chat/index/test/header05.jpg
Normal file
|
After Width: | Height: | Size: 834 KiB |
BIN
static/chat/index/test/header06.jpg
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
static/chat/index/test/pig-01.jpg
Normal file
|
After Width: | Height: | Size: 96 KiB |
BIN
static/chat/index/test/pig-02.jpg
Normal file
|
After Width: | Height: | Size: 68 KiB |
BIN
static/chat/index/test/pig-03.jpg
Normal file
|
After Width: | Height: | Size: 95 KiB |
BIN
static/chat/index/test/pig-04.jpg
Normal file
|
After Width: | Height: | Size: 74 KiB |
BIN
static/chat/index/test/pig-05.jpg
Normal file
|
After Width: | Height: | Size: 83 KiB |
BIN
static/chat/index/test/pig-06.jpg
Normal file
|
After Width: | Height: | Size: 81 KiB |
BIN
static/chat/index/test/pig-07.jpg
Normal file
|
After Width: | Height: | Size: 102 KiB |
BIN
static/chat/index/test/pig-08.jpg
Normal file
|
After Width: | Height: | Size: 81 KiB |
BIN
static/chat/index/test/pig-09.jpg
Normal file
|
After Width: | Height: | Size: 83 KiB |
BIN
static/chat/index/test/test1.jpg
Normal file
|
After Width: | Height: | Size: 194 KiB |
BIN
static/chat/index/test/test2.jpg
Normal file
|
After Width: | Height: | Size: 346 KiB |
BIN
static/chat/logo.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 7.8 KiB |
BIN
static/iconfont1.ttf
Normal file
BIN
static/logo.png
Normal file
|
After Width: | Height: | Size: 66 KiB |
BIN
static/user/qrCode.jpeg
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
static/user/userIcon_12.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
37
uniCloud-aliyun/cloudfunctions/gl-key-login/index.js
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
const crypto = require('crypto')
|
||||||
|
|
||||||
|
exports.main = async (event) => {
|
||||||
|
const secret = 'glDao2022.'
|
||||||
|
const hmac = crypto.createHmac('sha256', secret);
|
||||||
|
|
||||||
|
let params = event.queryStringParameters
|
||||||
|
const sign = params.sign
|
||||||
|
delete params.sign
|
||||||
|
|
||||||
|
const signStr = Object.keys(params).sort().map(key => {
|
||||||
|
return `${key}=${params[key]}`
|
||||||
|
}).join('&')
|
||||||
|
|
||||||
|
hmac.update(signStr);
|
||||||
|
|
||||||
|
if (sign !== hmac.digest('hex')) {
|
||||||
|
throw new Error('非法访问')
|
||||||
|
}
|
||||||
|
|
||||||
|
const {
|
||||||
|
access_token,
|
||||||
|
openid
|
||||||
|
} = params
|
||||||
|
|
||||||
|
return await uniCloud.getPhoneNumber({
|
||||||
|
appid: '__UNI__DE7B0E6',
|
||||||
|
provider: 'univerify',
|
||||||
|
apiKey: '16fa20236696596869759d3a81541901',
|
||||||
|
apiSecret: 'fca97287360c2e8f8259d8877a601887',
|
||||||
|
access_token: access_token,
|
||||||
|
openid: openid,
|
||||||
|
})
|
||||||
|
};
|
||||||
7
uniCloud-aliyun/cloudfunctions/gl-key-login/package.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"name": "gl-key-login",
|
||||||
|
"dependencies": {},
|
||||||
|
"extensions": {
|
||||||
|
"uni-cloud-jql": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,7 +11,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="uni-share-button-box">
|
<view class="uni-share-button-box">
|
||||||
<button class="uni-share-button" @click="close">{{cancelText}}</button>
|
<!-- <button class="uni-share-button" @click="close">{{cancelText}}</button> -->
|
||||||
|
<button class="uni-share-button" @click="close">再想想</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -50,9 +51,9 @@
|
|||||||
name: 'wxcircle'
|
name: 'wxcircle'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: 'QQ',
|
text: '下载图片',
|
||||||
icon: require('@/static/icon/share_icon_02.png'),
|
icon: require('@/static/icon/share_icon_02.png'),
|
||||||
name: 'qq'
|
name: 'download'
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// text: '新浪',
|
// text: '新浪',
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
exports.main = async (event, context) => {
|
exports.main = async (event, context) => {
|
||||||
//event为客户端上传的参数
|
|
||||||
console.log('event : ', event)
|
|
||||||
|
|
||||||
let res = {};
|
let res = {};
|
||||||
let data = event.data;
|
let data = event.data;
|
||||||
|
|
||||||
|
|||||||
1
unpackage/debug/.roid.ins
Normal file
@@ -0,0 +1 @@
|
|||||||
|
installed
|
||||||