merge
This commit is contained in:
@@ -10,7 +10,8 @@ import router from '../router'
|
||||
|
||||
// 基础配置
|
||||
const config = {
|
||||
apiUrl : 'http://api.zh.shangkelian.cn/api/', // 正式环境
|
||||
// apiUrl : 'http://api.gl.shangkelian.cn/api/', // 正式环境
|
||||
apiUrl : 'http://api.zh.shangkelian.cn/api/', // 大健康调试环境,目前没有任何数据无法正常显示,所以需要使用该环境,最后会删除
|
||||
timeout : 60000
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,22 @@ const getSms = (data) =>{
|
||||
})
|
||||
}
|
||||
|
||||
// 获取角色标签信息
|
||||
const userFigure = () => {
|
||||
return request({
|
||||
url: "cms/storages/tags?tags=figure",
|
||||
})
|
||||
}
|
||||
|
||||
// 创建角色
|
||||
const createUser = (data) => {
|
||||
return request({
|
||||
url: "user/fill_all",
|
||||
method: 'POST',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 用户隐私,用户服务协议
|
||||
const secretService = (name) =>{
|
||||
return request({
|
||||
@@ -33,18 +49,10 @@ const secretService = (name) =>{
|
||||
})
|
||||
}
|
||||
|
||||
// 一键登录
|
||||
const keyAuth = (data) => {
|
||||
return request({
|
||||
url: 'user/socialite/login/unicloud/app',
|
||||
method: 'POST',
|
||||
data: data
|
||||
}, true)
|
||||
}
|
||||
|
||||
export {
|
||||
smsAuth,
|
||||
getSms,
|
||||
secretService,
|
||||
keyAuth
|
||||
userFigure,
|
||||
createUser,
|
||||
secretService
|
||||
}
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
/*
|
||||
* @Description:饮水记录模块
|
||||
* @Author: Aimee·Zhang
|
||||
* @Date: 2022-01-12 11:07:06
|
||||
* @LastEditors: Aimee·Zhang
|
||||
* @LastEditTime: 2022-01-12 15:57:48
|
||||
*/
|
||||
import { request } from '../index'
|
||||
/**
|
||||
* @description:饮水记录首页
|
||||
*/
|
||||
const waters = (data) => {
|
||||
return request({
|
||||
url: 'health/waters',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
/**
|
||||
* @description:设定喝水目标
|
||||
* @Date: 2022-01-12 15:33:39
|
||||
*/
|
||||
const setWaters = (data) => {
|
||||
return request({
|
||||
url: 'health/waters',
|
||||
method: 'POST',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
/**
|
||||
* @description:喝水
|
||||
* @Date: 2022-01-12 12:56:00
|
||||
*/
|
||||
const drinkWater = (data) => {
|
||||
return request({
|
||||
url: 'health/waters/drink',
|
||||
method: 'POST',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
/**
|
||||
* @description:删除喝水记录
|
||||
* @Date: 2022-01-20 15点08分
|
||||
*/
|
||||
const delDrinkWater = (id) => {
|
||||
return request({
|
||||
url: `health/waters/${id}`,
|
||||
method: 'DELETE',
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @description:饮食运动日历
|
||||
* @params {日期}
|
||||
* @method {get}
|
||||
* @Date: 2022-02-08 11点18分
|
||||
*/
|
||||
const dateList = (data) => {
|
||||
return request({
|
||||
url: 'health/calendar/water',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export {
|
||||
waters,
|
||||
setWaters,
|
||||
drinkWater,
|
||||
delDrinkWater,
|
||||
dateList
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
|
||||
/*
|
||||
* @Description:创建档案模块
|
||||
* @Author: Aimee·Zhang
|
||||
* @Date: 2022-01-12 13:27:31
|
||||
* @LastEditors: Aimee·Zhang
|
||||
* @LastEditTime: 2022-01-12 14:32:11
|
||||
*/
|
||||
|
||||
import { request } from '../index'
|
||||
/**
|
||||
* @description:新建健康档案
|
||||
* @params {age,sex,height,weight,exercise,goal_weight,days}
|
||||
* @return {*}
|
||||
* @method {post}
|
||||
* @Date: 2022-01-12 11:08:11
|
||||
*/
|
||||
const recordsHealth = (data) => {
|
||||
return request({
|
||||
url: 'health/records',
|
||||
method: "POST",
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @description:编辑健康档案前置
|
||||
* @params {id}档案id
|
||||
* @return {}
|
||||
* @method {get}
|
||||
* @Date: 2022-01-12 13:39:56
|
||||
*/
|
||||
const editHealthBefore = (id) => {
|
||||
return request({
|
||||
url: `health/records/${id}/edit`
|
||||
})
|
||||
}
|
||||
/**
|
||||
* @description:修改健康档案
|
||||
* @params {record_id:档案id,data:参数}
|
||||
* @return {*}
|
||||
* @Date: 2022-01-12 13:49:29
|
||||
*/
|
||||
const editHealth = (record_id, data) => {
|
||||
console.log(data,'data............')
|
||||
return request({
|
||||
url: `health/records/${record_id}`,
|
||||
method: "PUT",
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
recordsHealth,
|
||||
editHealthBefore,
|
||||
editHealth
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
/*
|
||||
* @Description:
|
||||
* @Author: Aimee·Zhang
|
||||
* @Date: 2022-01-13 13:17:14
|
||||
* @LastEditors: Aimee·Zhang
|
||||
* @LastEditTime: 2022-01-14 08:38:02
|
||||
*/
|
||||
/**
|
||||
* @description:健康测评模块接口
|
||||
* @params {*}
|
||||
* @return {*}
|
||||
* @Date: 2022-01-13 13:17:33
|
||||
*/
|
||||
import { request } from '../index'
|
||||
/**
|
||||
* @description:健康测评接口
|
||||
*/
|
||||
const evaluations = () => {
|
||||
return request({
|
||||
url: 'evaluations'
|
||||
})
|
||||
}
|
||||
/**
|
||||
* @description:测试介绍页面
|
||||
* @Date: 2022-01-13 15:04:47
|
||||
*/
|
||||
const evaluationsInfo = (evaluation_id) => {
|
||||
return request({
|
||||
url: `evaluations/${evaluation_id}`
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @description:试题列表
|
||||
* @Date: 2022-01-13 15:12:31
|
||||
*/
|
||||
|
||||
const evaluationsQuestion = (evaluation_id, page) => {
|
||||
return request({
|
||||
url: `evaluations/${evaluation_id}/questions`,
|
||||
data: {
|
||||
page: page
|
||||
}
|
||||
})
|
||||
}
|
||||
/**
|
||||
* @description:提交答案
|
||||
* @Date: 2022-01-13 16:06:26
|
||||
*/
|
||||
const evaluationsAnswers = (data) => {
|
||||
return request({
|
||||
url: `evaluations/${data.id}/answers`,
|
||||
data: data,
|
||||
method: 'POST'
|
||||
})
|
||||
}
|
||||
/**
|
||||
* @description:获取测评结果
|
||||
* @Date: 2022-01-13 16:28:02
|
||||
*/
|
||||
const evaluationsAnswersInfo = (id) => {
|
||||
return request({
|
||||
url: `evaluations/${id}/result`,
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
evaluations,
|
||||
evaluationsInfo,
|
||||
evaluationsQuestion,
|
||||
evaluationsAnswers,
|
||||
evaluationsAnswersInfo
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
/*
|
||||
* @Description:vip健康食谱
|
||||
* @Author: Aimee·Zhang
|
||||
* @Date: 2022-01-12 17:48:28
|
||||
* @LastEditors: Aimee·Zhang
|
||||
* @LastEditTime: 2022-01-14 09:16:28
|
||||
*/
|
||||
import { request } from '../index'
|
||||
/**
|
||||
* @description:称量体重模块首页
|
||||
*/
|
||||
const positions = (page) => {
|
||||
return request({
|
||||
url: 'health/recipe/positions',
|
||||
data: { page: page }
|
||||
})
|
||||
}
|
||||
/**
|
||||
* @description:饮食和运动首页信息
|
||||
* @params {日期}
|
||||
* @method {get}
|
||||
* @Date: 2022-01-13 08:55:04
|
||||
*/
|
||||
const plans = (date) => {
|
||||
return request({
|
||||
url: 'health/plans',
|
||||
data: {
|
||||
date: date
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @description:食品列表可翻页
|
||||
* @params {食品名称}
|
||||
* @return {}
|
||||
* @Date: 2022-01-13 09:37:26
|
||||
*/
|
||||
|
||||
const healthFoods = (data) => {
|
||||
return request({
|
||||
url: 'health/foods',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @description:添加食物
|
||||
* @Date: 2022-01-13 10:57:52
|
||||
*/
|
||||
const addHealthFoods = (data) => {
|
||||
return request({
|
||||
url: 'health/intakes',
|
||||
method: 'POST',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @description:编辑食品
|
||||
* @Date: 2022-01-13 11:37:37
|
||||
*/
|
||||
const editHealthFoods = (data) => {
|
||||
return request({
|
||||
url: `health/intakes/${data.intake_id}`,
|
||||
method: 'PUT',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
/**
|
||||
* @description:删除添加食品
|
||||
* @Date: 2022-01-14 09:15:38
|
||||
*/
|
||||
const delHealthFoods = (intake_id) => {
|
||||
return request({
|
||||
url: `health/intakes/${intake_id}`,
|
||||
method: 'DELETE'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @description:饮食运动日历
|
||||
* @params {日期}
|
||||
* @method {get}
|
||||
* @Date: 2022-02-07 15点18分
|
||||
*/
|
||||
const dateList = (data) => {
|
||||
return request({
|
||||
url: 'health/calendar/intake',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
export {
|
||||
positions,
|
||||
plans,
|
||||
healthFoods,
|
||||
addHealthFoods,
|
||||
editHealthFoods,
|
||||
delHealthFoods,
|
||||
dateList
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
|
||||
/*
|
||||
* @Description:健康记录模块
|
||||
* @Author: Aimee·Zhang
|
||||
* @Date: 2022-01-12 10:11:43
|
||||
* @LastEditors: Aimee·Zhang
|
||||
* @LastEditTime: 2022-01-13 08:56:03
|
||||
*/
|
||||
|
||||
import { request } from '../index'
|
||||
/**
|
||||
* @description:记录首页
|
||||
* @params {null}
|
||||
* @return {}
|
||||
* @Date: 2022-01-12 10:17:21
|
||||
*/
|
||||
const logs = () => {
|
||||
return request({
|
||||
url: 'health/logs',
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
logs
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
/**
|
||||
* Web唐明明
|
||||
* 匆匆数载恍如梦,岁月迢迢华发增。
|
||||
* 碌碌无为枉半生,一朝惊醒万事空。
|
||||
* moduleName: 话题
|
||||
*/
|
||||
|
||||
import { request } from '../index'
|
||||
|
||||
// 分类
|
||||
const categories = () =>{
|
||||
return request({
|
||||
url: 'notifications'
|
||||
})
|
||||
}
|
||||
|
||||
// 列表
|
||||
const lists = (type, data) =>{
|
||||
return request({
|
||||
url: 'notifications/' + type + '/list',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
// 详情
|
||||
const noticeDet = (notification_id) =>{
|
||||
return request({
|
||||
url: 'notifications/' + notification_id
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
categories,
|
||||
lists,
|
||||
noticeDet
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
/**
|
||||
* Web唐明明
|
||||
* 匆匆数载恍如梦,岁月迢迢华发增。
|
||||
* 碌碌无为枉半生,一朝惊醒万事空。
|
||||
* moduleName: 食物排行
|
||||
*/
|
||||
|
||||
import { request } from '../index'
|
||||
|
||||
// 食物分类
|
||||
const categories = (data) =>{
|
||||
return request({
|
||||
url: 'health/foods/categories',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 食物排行
|
||||
const foods = (data) =>{
|
||||
return request({
|
||||
url: 'health/foods',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 食物详情
|
||||
const foodDet = (food) =>{
|
||||
return request({
|
||||
url: 'health/foods/' + food
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
categories,
|
||||
foods,
|
||||
foodDet
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
/**
|
||||
* Web唐明明
|
||||
* 匆匆数载恍如梦,岁月迢迢华发增。
|
||||
* 碌碌无为枉半生,一朝惊醒万事空。
|
||||
* moduleName: 服务
|
||||
*/
|
||||
|
||||
import { request } from '../index'
|
||||
|
||||
// 首页
|
||||
const index = (data) =>{
|
||||
return request({
|
||||
url: 'health/halls',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
// 详情
|
||||
const hallsDet = (hall) =>{
|
||||
return request({
|
||||
url: 'health/halls/' + hall
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
index,
|
||||
hallsDet
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
/**
|
||||
* Web唐明明
|
||||
* 匆匆数载恍如梦,岁月迢迢华发增。
|
||||
* 碌碌无为枉半生,一朝惊醒万事空。
|
||||
* moduleName: 签到
|
||||
*/
|
||||
|
||||
import { request } from '../index'
|
||||
|
||||
// 日历
|
||||
const date = () =>{
|
||||
return request({
|
||||
url: 'user/sign'
|
||||
})
|
||||
}
|
||||
|
||||
// 签到
|
||||
const sign = () =>{
|
||||
return request({
|
||||
url: 'user/sign',
|
||||
method: 'POST'
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
date,
|
||||
sign
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
/*
|
||||
* @Description:运动模块
|
||||
* @Author: Aimee·Zhang
|
||||
* @Date: 2022-01-19 13:20:39
|
||||
* @LastEditors: Aimee·Zhang
|
||||
* @LastEditTime: 2022-01-20 09:12:34
|
||||
*/
|
||||
import { request } from '../index'
|
||||
/**
|
||||
* @description:动列表
|
||||
* @params {*} 可翻页 按名称筛选
|
||||
* @Date: 2022-01-19 13:21:35
|
||||
*/
|
||||
|
||||
const healthSports = (data) => {
|
||||
return request({
|
||||
url: 'health/sports',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @description:添加运动
|
||||
* @Date: 2022-01-19 13点27分
|
||||
*/
|
||||
const addHealthSports = (data) => {
|
||||
return request({
|
||||
url: 'health/exercises',
|
||||
method: 'POST',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
/**
|
||||
* @description:编辑运动
|
||||
* @Date: 2022-01-19 17:15:31
|
||||
*/
|
||||
const editHealthSports = (data) => {
|
||||
return request({
|
||||
url: `health/exercises/${data.exercise_id}`,
|
||||
method: 'PUT',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 删除运动
|
||||
* @Date: 2022-01-20 09:12:35
|
||||
*/
|
||||
const delHealthSports = (data) => {
|
||||
return request({
|
||||
url: `health/exercises/${data.exercise_id}`,
|
||||
method: 'DELETE'
|
||||
})
|
||||
}
|
||||
export {
|
||||
healthSports,
|
||||
addHealthSports,
|
||||
editHealthSports,
|
||||
delHealthSports
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
/**
|
||||
* Web唐明明
|
||||
* 匆匆数载恍如梦,岁月迢迢华发增。
|
||||
* 碌碌无为枉半生,一朝惊醒万事空。
|
||||
* moduleName: 话题
|
||||
*/
|
||||
|
||||
import { request } from '../index'
|
||||
|
||||
// 首页
|
||||
const index = () =>{
|
||||
return request({
|
||||
url: 'health/discover'
|
||||
})
|
||||
}
|
||||
|
||||
// 列表
|
||||
const lists = (data) =>{
|
||||
return request({
|
||||
url: 'health/topics',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 分类
|
||||
const categories = () =>{
|
||||
return request({
|
||||
url: 'health/topics/categories'
|
||||
})
|
||||
}
|
||||
|
||||
// 详情
|
||||
const topicDet = (topic) =>{
|
||||
return request({
|
||||
url: 'health/topics/' + topic
|
||||
})
|
||||
}
|
||||
|
||||
// 点赞
|
||||
const topicThumb = (topic) =>{
|
||||
return request({
|
||||
url: 'health/topics/' + topic + '/favorite',
|
||||
method: 'POST'
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
index,
|
||||
lists,
|
||||
categories,
|
||||
topicDet,
|
||||
topicThumb
|
||||
}
|
||||
@@ -14,14 +14,7 @@ const info = () =>{
|
||||
})
|
||||
}
|
||||
|
||||
// 我的档案
|
||||
const records = () =>{
|
||||
return request({
|
||||
url: 'health/records'
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
info,
|
||||
records
|
||||
info
|
||||
}
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
/**
|
||||
* Web唐明明
|
||||
* 匆匆数载恍如梦,岁月迢迢华发增。
|
||||
* 碌碌无为枉半生,一朝惊醒万事空。
|
||||
* moduleName: 钱包
|
||||
*/
|
||||
|
||||
import { request } from '../index'
|
||||
|
||||
// 设置密码
|
||||
const security = data => {
|
||||
return request({
|
||||
url: 'chain/safe/security',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 获取助记词
|
||||
const seed = data => {
|
||||
return request({
|
||||
url: 'chain/safe/seed',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 余额
|
||||
const sum = () => {
|
||||
return request({
|
||||
url: 'chain/account/balance'
|
||||
})
|
||||
}
|
||||
|
||||
// 账户记录
|
||||
const logs = data => {
|
||||
return request({
|
||||
url: 'chain/account/logs',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 验证密码
|
||||
const securityCheck = (password) => {
|
||||
return request({
|
||||
url : "chain/safe/security/check",
|
||||
method: 'POST',
|
||||
data:{
|
||||
code : password,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 钱包私钥
|
||||
const privatekey = (code) => {
|
||||
return request({
|
||||
url : "chain/safe/private_key",
|
||||
data: {
|
||||
code
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 私钥规则
|
||||
const keyrules = () => {
|
||||
return request({
|
||||
url: 'cms/keyrules'
|
||||
})
|
||||
}
|
||||
|
||||
// 修改密码
|
||||
const securityReset = (data) => {
|
||||
return request({
|
||||
url : "chain/safe/security",
|
||||
method: 'PUT',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
security,
|
||||
seed,
|
||||
sum,
|
||||
logs,
|
||||
securityCheck,
|
||||
privatekey,
|
||||
keyrules,
|
||||
securityReset
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
* @Description:称体重模块
|
||||
* @Author: Aimee·Zhang
|
||||
* @Date: 2022-01-12 16:24:28
|
||||
* @LastEditors: Aimee·Zhang
|
||||
* @LastEditTime: 2022-01-12 17:13:45
|
||||
*/
|
||||
import { request } from '../index'
|
||||
|
||||
/**
|
||||
* @description:称量体重模块首页
|
||||
*/
|
||||
const weights = (page) => {
|
||||
return request({
|
||||
url: 'health/weights',
|
||||
data: { page: page }
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @description:获取曲线进度
|
||||
*/
|
||||
const curves = () => {
|
||||
return request({
|
||||
url: 'health/weights/bight'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @description:记录体重
|
||||
* @Date: 2022-01-12 16:46:19
|
||||
*/
|
||||
const addWeight = (data) => {
|
||||
return request({
|
||||
url: 'health/weights',
|
||||
method: 'POST',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
weights,
|
||||
addWeight,
|
||||
curves
|
||||
}
|
||||
@@ -16,6 +16,11 @@
|
||||
"autoclose" : true,
|
||||
"delay" : 0
|
||||
},
|
||||
"safearea" : {
|
||||
"bottom" : {
|
||||
"offset" : "none"
|
||||
}
|
||||
},
|
||||
/* 模块配置 */
|
||||
"modules" : {
|
||||
"OAuth" : {},
|
||||
@@ -25,7 +30,6 @@
|
||||
"VideoPlayer" : {},
|
||||
"Geolocation" : {},
|
||||
"Fingerprint" : {},
|
||||
"Maps" : {},
|
||||
"Push" : {}
|
||||
},
|
||||
/* 应用发布信息 */
|
||||
@@ -77,7 +81,7 @@
|
||||
"payment" : {
|
||||
"weixin" : {
|
||||
"__platform__" : [ "android" ],
|
||||
"appid" : "wxb7e3c263a2a37ab9",
|
||||
"appid" : "wx74b2fcb478707364",
|
||||
"UniversalLinks" : ""
|
||||
},
|
||||
"alipay" : {
|
||||
@@ -86,7 +90,7 @@
|
||||
},
|
||||
"share" : {
|
||||
"weixin" : {
|
||||
"appid" : "wxb7e3c263a2a37ab9",
|
||||
"appid" : "wx74b2fcb478707364",
|
||||
"UniversalLinks" : ""
|
||||
}
|
||||
},
|
||||
@@ -95,11 +99,6 @@
|
||||
"unipush" : {}
|
||||
},
|
||||
"geolocation" : {
|
||||
"amap" : {
|
||||
"__platform__" : [ "android" ],
|
||||
"appkey_ios" : "",
|
||||
"appkey_android" : "1dfbe526a37dcb1f13263e0b5871ca4d"
|
||||
},
|
||||
"system" : {
|
||||
"__platform__" : [ "android" ]
|
||||
}
|
||||
|
||||
219
pages.json
219
pages.json
@@ -1,5 +1,30 @@
|
||||
{
|
||||
"pages": [{
|
||||
"path": "pages/auth/auth",
|
||||
"name": "Auth",
|
||||
"style": {
|
||||
"navigationBarTitleText": "登录",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/auth/role",
|
||||
"name": "AuthRole",
|
||||
"style": {
|
||||
"navigationBarTitleText": "角色创建",
|
||||
"navigationBarBackgroundColor": "#FFF",
|
||||
"app-plus": {
|
||||
"titleNView": {
|
||||
"buttons": [{
|
||||
"text": "退出登录",
|
||||
"fontSize": "14",
|
||||
"width": "80px",
|
||||
"color": "#34CE98"
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
"path": "pages/life/life",
|
||||
"name": "Life",
|
||||
"style": {
|
||||
@@ -44,32 +69,7 @@
|
||||
"navigationBarTextStyle": "white"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/auth/auth",
|
||||
"name": "Auth",
|
||||
"style": {
|
||||
"navigationBarTitleText": "登录",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/auth/role",
|
||||
"name": "AuthRole",
|
||||
"style": {
|
||||
"navigationBarTitleText": "角色创建",
|
||||
"navigationBarBackgroundColor": "#FFF",
|
||||
"app-plus": {
|
||||
"titleNView": {
|
||||
"buttons": [{
|
||||
"text": "退出登录",
|
||||
"fontSize": "14",
|
||||
"width": "80px",
|
||||
"color": "#fdbc01"
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "pages/store/goods",
|
||||
"name": "StoreGoods",
|
||||
@@ -150,117 +150,6 @@
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/sign/index",
|
||||
"name": "signIndex",
|
||||
"style": {
|
||||
"navigationBarTitleText": "每日打卡",
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/notice/index",
|
||||
"name": "noticeIndex",
|
||||
"style": {
|
||||
"navigationBarTitleText": "消息",
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/notice/list",
|
||||
"name": "noticeList",
|
||||
"style": {
|
||||
"navigationBarTitleText": "消息",
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/notice/details",
|
||||
"name": "noticeDetails",
|
||||
"style": {
|
||||
"navigationBarTitleText": "消息",
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/wallet/add",
|
||||
"name": "WalletAdd",
|
||||
"style": {
|
||||
"navigationBarTitleText": "创建钱包",
|
||||
"navigationBarBackgroundColor": "#FFFFFF",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/wallet/create",
|
||||
"name": "WalletCreate",
|
||||
"style": {
|
||||
"navigationBarTitleText": "设置密码",
|
||||
"navigationBarBackgroundColor": "#FFFFFF",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/wallet/mnemonic",
|
||||
"name": "WalletMnemonic",
|
||||
"style": {
|
||||
"navigationBarTitleText": "导出助记词",
|
||||
"navigationBarBackgroundColor": "#FFFFFF",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/wallet/validation",
|
||||
"name": "WalletValidation",
|
||||
"style": {
|
||||
"navigationBarTitleText": "验证助记词",
|
||||
"navigationBarBackgroundColor": "#FFFFFF",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/wallet/property",
|
||||
"name": "WalletProperty",
|
||||
"style": {
|
||||
"navigationBarTitleText": "ZH钱包",
|
||||
"navigationBarTextStyle": "white",
|
||||
"app-plus": {
|
||||
"titleNView": {
|
||||
"backgroundImage": "linear-gradient(to right, #34ce98, #22aa98)",
|
||||
"type": "transparent",
|
||||
"buttons": [{
|
||||
"float": "right",
|
||||
"text": "\ue607",
|
||||
"fontSrc": "/static/iconfont.ttf",
|
||||
"color": "#FFF",
|
||||
"fontSize": "20px",
|
||||
"background": "rgba(0,0,0,0)"
|
||||
}],
|
||||
"backButton": {
|
||||
"background": "rgba(0,0,0,0)"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/wallet/privatekey",
|
||||
"name": "WalletPrivatekey",
|
||||
"style": {
|
||||
"navigationBarTitleText": "钱包私钥",
|
||||
"navigationBarBackgroundColor": "#FFFFFF",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/wallet/resetPassword",
|
||||
"name": "ResetPassword",
|
||||
"style": {
|
||||
"navigationBarTitleText": "修改钱包密码",
|
||||
"navigationBarBackgroundColor": "#FFFFFF",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/store/search",
|
||||
"name": "StoreSearch",
|
||||
@@ -268,6 +157,62 @@
|
||||
"navigationBarTitleText": "搜索",
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/refund/index",
|
||||
"name": "OrderRefund",
|
||||
"style": {
|
||||
"navigationBarTitleText": "退换货",
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/account/integral",
|
||||
"name": "AccountIntegral",
|
||||
"style": {
|
||||
"navigationBarTitleText": "共力值",
|
||||
"navigationBarBackgroundColor": "#34CE98",
|
||||
"navigationBarTextStyle": "white"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/account/dt",
|
||||
"name": "AccountDt",
|
||||
"style": {
|
||||
"navigationBarTitleText": "DT积分",
|
||||
"navigationBarBackgroundColor": "#34CE98",
|
||||
"backgroundColorTop": "#34CE98",
|
||||
"navigationBarTextStyle": "white",
|
||||
"app-plus": {
|
||||
"titleNView": {
|
||||
"buttons": [{
|
||||
"text": "充值",
|
||||
"width": "60",
|
||||
"fontSize": "14",
|
||||
"fontWeight": "bold"
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
"path": "pages/account/recharge",
|
||||
"name": "AccountRecharge",
|
||||
"style": {
|
||||
"navigationBarTitleText": "DT积分充值",
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/vip/vip",
|
||||
"name": "Vip",
|
||||
"style": {
|
||||
"navigationBarTitleText": "共力会员",
|
||||
"navigationBarBackgroundColor": "#242430",
|
||||
"navigationBarTextStyle": "white",
|
||||
"backgroundColorTop": "#242430"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/vip/agreement",
|
||||
"style": {
|
||||
"navigationBarTitleText": "共力会员协议"
|
||||
}
|
||||
},{
|
||||
"path" : "pages/store/shop/shopDetail",
|
||||
"name": "ShopDetail",
|
||||
|
||||
114
pages/account/dt.vue
Normal file
114
pages/account/dt.vue
Normal file
@@ -0,0 +1,114 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="dt-header">
|
||||
<view class="title">DT积分余额</view>
|
||||
<view class="num">0.00</view>
|
||||
</view>
|
||||
<view class="logs-title">账户记录</view>
|
||||
<view class="logs-item">
|
||||
<view class="logs-item-title">账户充值</view>
|
||||
<view class="logs-item-time">2022-06-07 10:10:51</view>
|
||||
<view class="logs-item-price add">+1000.0</view>
|
||||
</view>
|
||||
<view class="logs-item">
|
||||
<view class="logs-item-title">账户充值</view>
|
||||
<view class="logs-item-time">2022-06-07 10:10:51</view>
|
||||
<view class="logs-item-price remove">-1000.0</view>
|
||||
</view>
|
||||
<view class="logs-item">
|
||||
<view class="logs-item-title">账户充值</view>
|
||||
<view class="logs-item-time">2022-06-07 10:10:51</view>
|
||||
<view class="logs-item-price remove">-1000.0</view>
|
||||
</view>
|
||||
<view class="logs-item">
|
||||
<view class="logs-item-title">账户充值</view>
|
||||
<view class="logs-item-time">2022-06-07 10:10:51</view>
|
||||
<view class="logs-item-price remove">-1000.0</view>
|
||||
</view>
|
||||
<view class="logs-item">
|
||||
<view class="logs-item-title">账户充值</view>
|
||||
<view class="logs-item-time">2022-06-07 10:10:51</view>
|
||||
<view class="logs-item-price remove">-1000.0</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
||||
},
|
||||
onNavigationBarButtonTap() {
|
||||
this.$Router.push({name: 'AccountRecharge'})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content{
|
||||
background: $window-color;
|
||||
min-height: 100vh;
|
||||
.dt-header{
|
||||
background: $main-color;
|
||||
padding: $padding*3 $padding $padding*2;
|
||||
.title{
|
||||
color: rgba(255, 255, 255, .9);
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.num{
|
||||
font-weight: bold;
|
||||
font-size: 60rpx;
|
||||
padding-top: 10rpx;
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
// 账户记录
|
||||
.logs-title{
|
||||
padding: 0 $padding;
|
||||
font-weight: bold;
|
||||
line-height: 90rpx;
|
||||
color: #333;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.logs-item{
|
||||
position: relative;
|
||||
background: white;
|
||||
border-radius: $radius;
|
||||
padding: $padding - 10 $padding;
|
||||
padding-right: 240rpx;
|
||||
box-sizing: border-box;
|
||||
margin: 0 $margin ($margin - 10);
|
||||
.logs-item-title{
|
||||
font-weight: bold;
|
||||
font-size: 30rpx;
|
||||
line-height: 50rpx;
|
||||
}
|
||||
.logs-item-time{
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
color: gray;
|
||||
}
|
||||
.logs-item-price{
|
||||
position: absolute;
|
||||
right: $padding;
|
||||
top: $padding - 10;
|
||||
line-height: 90rpx;
|
||||
width: 180rpx;
|
||||
text-align: right;
|
||||
font-weight: bold;
|
||||
@extend .nowrap;
|
||||
&.add{
|
||||
color: $main-color;
|
||||
}
|
||||
&.remove{
|
||||
color: $text-price;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
114
pages/account/integral.vue
Normal file
114
pages/account/integral.vue
Normal file
@@ -0,0 +1,114 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="dt-header">
|
||||
<view class="title">共力值余额</view>
|
||||
<view class="num">0.00</view>
|
||||
</view>
|
||||
<view class="logs-title">账户记录</view>
|
||||
<view class="logs-item">
|
||||
<view class="logs-item-title">账户充值</view>
|
||||
<view class="logs-item-time">2022-06-07 10:10:51</view>
|
||||
<view class="logs-item-price add">+1000.0</view>
|
||||
</view>
|
||||
<view class="logs-item">
|
||||
<view class="logs-item-title">账户充值</view>
|
||||
<view class="logs-item-time">2022-06-07 10:10:51</view>
|
||||
<view class="logs-item-price remove">-1000.0</view>
|
||||
</view>
|
||||
<view class="logs-item">
|
||||
<view class="logs-item-title">账户充值</view>
|
||||
<view class="logs-item-time">2022-06-07 10:10:51</view>
|
||||
<view class="logs-item-price remove">-1000.0</view>
|
||||
</view>
|
||||
<view class="logs-item">
|
||||
<view class="logs-item-title">账户充值</view>
|
||||
<view class="logs-item-time">2022-06-07 10:10:51</view>
|
||||
<view class="logs-item-price remove">-1000.0</view>
|
||||
</view>
|
||||
<view class="logs-item">
|
||||
<view class="logs-item-title">账户充值</view>
|
||||
<view class="logs-item-time">2022-06-07 10:10:51</view>
|
||||
<view class="logs-item-price remove">-1000.0</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
||||
},
|
||||
onNavigationBarButtonTap() {
|
||||
this.$Router.push({name: 'AccountRecharge'})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content{
|
||||
background: $window-color;
|
||||
min-height: 100vh;
|
||||
.dt-header{
|
||||
background: $main-color;
|
||||
padding: $padding*3 $padding $padding*2;
|
||||
.title{
|
||||
color: rgba(255, 255, 255, .9);
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.num{
|
||||
font-weight: bold;
|
||||
font-size: 60rpx;
|
||||
padding-top: 10rpx;
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
// 账户记录
|
||||
.logs-title{
|
||||
padding: 0 $padding;
|
||||
font-weight: bold;
|
||||
line-height: 90rpx;
|
||||
color: #333;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.logs-item{
|
||||
position: relative;
|
||||
background: white;
|
||||
border-radius: $radius;
|
||||
padding: $padding - 10 $padding;
|
||||
padding-right: 240rpx;
|
||||
box-sizing: border-box;
|
||||
margin: 0 $margin ($margin - 10);
|
||||
.logs-item-title{
|
||||
font-weight: bold;
|
||||
font-size: 30rpx;
|
||||
line-height: 50rpx;
|
||||
}
|
||||
.logs-item-time{
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
color: gray;
|
||||
}
|
||||
.logs-item-price{
|
||||
position: absolute;
|
||||
right: $padding;
|
||||
top: $padding - 10;
|
||||
line-height: 90rpx;
|
||||
width: 180rpx;
|
||||
text-align: right;
|
||||
font-weight: bold;
|
||||
@extend .nowrap;
|
||||
&.add{
|
||||
color: $main-color;
|
||||
}
|
||||
&.remove{
|
||||
color: $text-price;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
19
pages/account/recharge.vue
Normal file
19
pages/account/recharge.vue
Normal file
@@ -0,0 +1,19 @@
|
||||
<template>
|
||||
<view>
|
||||
充值
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
</style>
|
||||
@@ -1,251 +1,227 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<!-- tool -->
|
||||
<view class="tool-flex">
|
||||
<view class="tool-flex-item" @click="$Router.back()">
|
||||
<uni-icons type="closeempty" size="22" color="#666"></uni-icons>
|
||||
</view>
|
||||
<view class="tool-flex-item" @click="onKeyAuth()" v-if="$Route.query.keyPhone == 1">一键登录</view>
|
||||
</view>
|
||||
<!-- 欢迎使用 -->
|
||||
<view class="header">
|
||||
<view class="title">欢迎使用</view>
|
||||
<view class="sumbit">共力生态,即刻开始共力人生</view>
|
||||
</view>
|
||||
<!-- 输入手机号相关 -->
|
||||
<view class="inputs phone">
|
||||
<label class="label">+86</label>
|
||||
<input type="number" placeholder="输入您的手机号码" maxlength="11" v-model="phone" />
|
||||
</view>
|
||||
<view class="inputs sms">
|
||||
<input type="number" placeholder="输入短信验证码" maxlength="4" v-model="code" />
|
||||
<button class="sms-btn" type="default" size="mini" :disabled="phone == '' || getSms"
|
||||
@click="getPhoneCode">{{getSms ? '重新发送' + smsTime + 's': '发送验证码'}}</button>
|
||||
</view>
|
||||
<button class="btn" type="default" :disabled="phone == '' || code == ''" @click="login">登录</button>
|
||||
<!-- 用户登录注册协议 -->
|
||||
<view class="agreement">
|
||||
未注册的手机号码验证后自动创建账号,登录即表示同意接受平台
|
||||
<view @click="$Router.push({name: 'agreement', params: {name : 'secret'}})">《隐私协议》</view>
|
||||
和
|
||||
<view @click="$Router.push({name: 'agreement', params: {name : 'service'}})">《服务协议》</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="auth">
|
||||
<image class="auth-back" src="/static/login/auth_bg.png" mode="aspectFill"></image>
|
||||
<view class="auth-center">
|
||||
<view class="auth-title">
|
||||
<view>共力生态</view>
|
||||
<view>即可开始共力人生</view>
|
||||
</view>
|
||||
<view class="auth-input">
|
||||
<input v-model="phone" type="number" maxlength="11" placeholder="输入手机号码">
|
||||
</view>
|
||||
<view class="auth-input auth-code">
|
||||
<input v-model="code" type="number" maxlength="4" placeholder="输入验证码">
|
||||
<button :disabled="getSms" size="mini" @click="getPhoneCode()">{{sendCode}}</button>
|
||||
</view>
|
||||
<view class="auth-button">
|
||||
<button @click="login('code')">登录</button>
|
||||
</view>
|
||||
<view class="auth-agreement">
|
||||
登录即表示同意<navigator hover-class="none">用户协议</navigator>和<navigator hover-class="none">隐私政策</navigator>
|
||||
</view>
|
||||
<!-- <view class="auth-other">
|
||||
<button @click="login('mnemonic')">使用助记词登录</button>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getSms, smsAuth } from "@/apis/interfaces/auth";
|
||||
import userAuth from "@/public/userAuth";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
phone: "",
|
||||
code: "",
|
||||
smsTime: 60,
|
||||
getSms: false,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 用户登录
|
||||
login() {
|
||||
smsAuth({
|
||||
mobileNo: this.phone,
|
||||
code: this.code,
|
||||
}).then((res) => {
|
||||
this.$store.commit(
|
||||
"setToken",
|
||||
res.token_type + " " + res.access_token
|
||||
);
|
||||
this.$Router.back();
|
||||
}).catch((err) => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: "none",
|
||||
});
|
||||
});
|
||||
},
|
||||
// 获取验证码
|
||||
getPhoneCode() {
|
||||
let outTime;
|
||||
getSms({
|
||||
mobileNo: this.phone,
|
||||
})
|
||||
.then((res) => {
|
||||
uni.showToast({
|
||||
title: res,
|
||||
icon: "none",
|
||||
});
|
||||
this.getSms = true;
|
||||
outTime = setInterval(() => {
|
||||
if (this.smsTime <= 1) {
|
||||
this.getSms = false;
|
||||
this.smsTime = 60;
|
||||
clearInterval(outTime);
|
||||
}
|
||||
this.smsTime -= 1;
|
||||
}, 1000);
|
||||
})
|
||||
.catch((err) => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: "none",
|
||||
});
|
||||
});
|
||||
},
|
||||
// 一键登录
|
||||
onKeyAuth() {
|
||||
const Auth = new userAuth();
|
||||
this.$Router.back();
|
||||
Auth.Login();
|
||||
},
|
||||
},
|
||||
};
|
||||
import {
|
||||
smsAuth,
|
||||
getSms
|
||||
} from '@/apis/interfaces/auth.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
phone : '18245180131',
|
||||
code : '',
|
||||
getSms : false,
|
||||
sendCode: '获取验证码'
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.$store.commit('setToken', '')
|
||||
},
|
||||
methods: {
|
||||
// 获取验证码
|
||||
getPhoneCode() {
|
||||
let outTime;
|
||||
let smsTime = 60;
|
||||
getSms({
|
||||
mobileNo: this.phone,
|
||||
}).then(res => {
|
||||
uni.showToast({
|
||||
title: res,
|
||||
icon: "none",
|
||||
});
|
||||
this.getSms = true;
|
||||
this.sendCode = smsTime + 's后重新获取';
|
||||
outTime = setInterval(() => {
|
||||
if (smsTime <= 1) {
|
||||
this.getSms = false;
|
||||
this.sendCode = '重新获取';
|
||||
clearInterval(outTime);
|
||||
return
|
||||
}
|
||||
this.sendCode = smsTime + 's后重新获取';
|
||||
smsTime -= 1;
|
||||
}, 1000);
|
||||
}).catch((err) => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: "none",
|
||||
});
|
||||
});
|
||||
},
|
||||
// 登录
|
||||
login(type) {
|
||||
if (type === 'code') {
|
||||
uni.showLoading({
|
||||
title: '登录中'
|
||||
})
|
||||
smsAuth({
|
||||
mobileNo: this.phone,
|
||||
code : this.code,
|
||||
}).then((res) => {
|
||||
this.$store.commit('setToken', res.token_type + ' ' + res.access_token);
|
||||
this.$store.commit('setIsNew', res.is_new ? 0 : 1)
|
||||
if(res.is_new){
|
||||
this.$Router.replace({name: 'AuthRole'})
|
||||
return
|
||||
}
|
||||
this.$Router.pushTab({name: 'Life'})
|
||||
uni.hideLoading()
|
||||
}).catch((err) => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: "none",
|
||||
});
|
||||
});
|
||||
return
|
||||
}
|
||||
if (type === 'mnemonic') {
|
||||
uni.showToast({
|
||||
title: '助记词登录暂未开放,敬请期待~',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
padding: $padding * 3;
|
||||
box-sizing: border-box;
|
||||
background: white;
|
||||
@extend .vertical;
|
||||
<style lang="scss">
|
||||
.auth {
|
||||
height: 100vh;
|
||||
|
||||
// 操作栏
|
||||
.tool-flex {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding-left: $padding * 2;
|
||||
padding-right: $padding * 2;
|
||||
background: white;
|
||||
@extend .ios-top;
|
||||
.auth-back {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
&-item {
|
||||
line-height: 90rpx;
|
||||
color: $text-gray;
|
||||
font-size: $title-size-lg;
|
||||
}
|
||||
}
|
||||
.auth-center {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-end;
|
||||
background: linear-gradient(to bottom, rgba(0, 0, 0, .0), rgba(0, 0, 0, .5));
|
||||
padding: 100rpx 50rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
// 表单
|
||||
.inputs {
|
||||
background: $window-color;
|
||||
position: relative;
|
||||
margin-top: $margin;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
border-radius: 45rpx;
|
||||
.auth-title {
|
||||
font-size: 50rpx;
|
||||
font-weight: bold;
|
||||
line-height: 70rpx;
|
||||
color: white;
|
||||
}
|
||||
|
||||
input {
|
||||
width: 100%;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
padding: 0 $padding;
|
||||
border: none;
|
||||
box-sizing: border-box;
|
||||
font-size: $title-size-lg;
|
||||
}
|
||||
.auth-input {
|
||||
background: white;
|
||||
height: 100rpx;
|
||||
border-radius: 50rpx;
|
||||
margin-top: 40rpx;
|
||||
overflow: hidden;
|
||||
|
||||
&.phone {
|
||||
padding-left: 120rpx;
|
||||
input {
|
||||
height: 100rpx;
|
||||
font-size: 32rpx;
|
||||
padding: 0 50rpx;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.label {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 120rpx;
|
||||
text-align: center;
|
||||
border-right: solid 1rpx $border-color;
|
||||
font-size: $title-size-lg;
|
||||
}
|
||||
}
|
||||
&.auth-code {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
&.sms {
|
||||
padding-right: 200rpx;
|
||||
button[size="mini"] {
|
||||
width: 280rpx;
|
||||
padding: 0;
|
||||
line-height: 100rpx;
|
||||
font-size: 32rpx;
|
||||
border-radius: 0;
|
||||
color: $main-color;
|
||||
background: white;
|
||||
&[disabled]{
|
||||
color: gray;
|
||||
}
|
||||
&::after {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.sms-btn[size='mini'] {
|
||||
width: 200rpx;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border-radius: 0 45rpx 45rpx 0;
|
||||
color: $main-color;
|
||||
font-size: $title-size-lg;
|
||||
background: $window-color;
|
||||
.auth-button {
|
||||
margin-top: 70rpx;
|
||||
|
||||
&::after {
|
||||
border: none;
|
||||
}
|
||||
button {
|
||||
background: $main-color;
|
||||
color: white;
|
||||
border-radius: 50rpx;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
padding: 0;
|
||||
font-weight: bold;
|
||||
font-size: 34rpx;
|
||||
|
||||
&[disabled] {
|
||||
color: rgba($color: $main-color, $alpha: .6);
|
||||
background: rgba($color: $window-color, $alpha: 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
&::after {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 头部
|
||||
.header {
|
||||
text-align: center;
|
||||
margin-bottom: 5vh;
|
||||
.auth-agreement {
|
||||
text-align: center;
|
||||
color: white;
|
||||
font-size: 28rpx;
|
||||
padding: 30rpx 0 100rpx 0;
|
||||
|
||||
.title {
|
||||
font-size: $title-size + 10;
|
||||
font-weight: bold;
|
||||
color: $text-color;
|
||||
line-height: 70rpx;
|
||||
}
|
||||
navigator {
|
||||
display: inline-block;
|
||||
padding: 0 10rpx;
|
||||
color: $main-color;
|
||||
}
|
||||
}
|
||||
|
||||
.sumbit {
|
||||
line-height: 50rpx;
|
||||
font-size: $title-size-m;
|
||||
color: $text-gray-m;
|
||||
}
|
||||
}
|
||||
.auth-other {
|
||||
padding: 0 10vw;
|
||||
|
||||
// 登录按钮
|
||||
.btn {
|
||||
margin: 0;
|
||||
margin-top: $margin*2;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
padding: 0;
|
||||
font-size: $title-size;
|
||||
border-radius: 45rpx;
|
||||
background: $main-color;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
|
||||
&::after {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&[disabled] {
|
||||
background: rgba($color: $main-color, $alpha: .5);
|
||||
}
|
||||
}
|
||||
|
||||
// 协议
|
||||
.agreement {
|
||||
padding-top: 5vh;
|
||||
font-size: $title-size-sm;
|
||||
color: $text-gray-m;
|
||||
|
||||
view {
|
||||
color: $main-color;
|
||||
display: inline-block;
|
||||
padding: 0 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
button {
|
||||
height: 100rpx;
|
||||
line-height: 98rpx;
|
||||
border-radius: 50rpx;
|
||||
border: solid 1px white;
|
||||
color: white;
|
||||
background: transparent;
|
||||
font-size: 34rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<scroll-view class="role-figure-scroll" scroll-x="true" >
|
||||
<view
|
||||
class="role-figure-item"
|
||||
v-for="(item, index) in figure"
|
||||
v-for="(item, index) in (sex === 1 ? male: female)"
|
||||
:class="storageId === item.storage_id ? 'active': ''"
|
||||
:key="index"
|
||||
@click="storageId = item.storage_id"
|
||||
@@ -34,7 +34,8 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
figure : [],
|
||||
male : [],
|
||||
female : [],
|
||||
nickname : '',
|
||||
sex : 1,
|
||||
storageId : '',
|
||||
@@ -43,14 +44,16 @@
|
||||
},
|
||||
watch: {
|
||||
sex(newVale){
|
||||
this.storageId = this.figure[0].storage_id
|
||||
this.storageId = (this.sex === 1 ? this.male[0].storage_id : this.female[0].storage_id)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
userFigure().then(res => {
|
||||
this.figure = res
|
||||
this.storageId = res[0].storage_id
|
||||
this.female = res.female
|
||||
this.male = res.male
|
||||
this.storageId = res.male[0].storage_id
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
uni.showToast({
|
||||
title: err.status_code + ':' + err.message,
|
||||
icon : 'none'
|
||||
@@ -127,8 +130,8 @@
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
&.active{
|
||||
border: solid 1px #fdbc01;
|
||||
color: #fdbc01;
|
||||
border: solid 1px $main-color;
|
||||
color: $main-color;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
@@ -151,7 +154,7 @@
|
||||
margin-right: 0;
|
||||
}
|
||||
&.active{
|
||||
border:solid 1px #fdbc01;
|
||||
border:solid 1px $main-color;
|
||||
}
|
||||
image{
|
||||
width: 280rpx;
|
||||
@@ -162,7 +165,7 @@
|
||||
.role-button{
|
||||
padding: 80rpx 0;
|
||||
button{
|
||||
background: #fdbc01;
|
||||
background: $main-color;
|
||||
color: white;
|
||||
border-radius: 50rpx;
|
||||
height: 100rpx;
|
||||
@@ -179,5 +182,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
// .role-button
|
||||
</style>
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="tips">
|
||||
<view class="noticeImg" :class="{active : noticeData.type == 'SystemNotification'}">
|
||||
<block v-if="noticeData.type == 'SystemNotification'">
|
||||
<u-icon name="bell-fill" color="#77e79f" size="20" bold style="padding: 14rpx"></u-icon>
|
||||
</block>
|
||||
<block v-else>
|
||||
<u-icon name="calendar-fill" color="#f1a166" size="20" bold style="padding: 14rpx"></u-icon>
|
||||
</block>
|
||||
</view>
|
||||
<view class="noticeBox">
|
||||
<view class="noticeTitle">
|
||||
{{ noticeData.type == 'SystemNotification' ? '系统通知' : '订单通知'}}
|
||||
</view>
|
||||
<view class="contant">
|
||||
<view class="title">
|
||||
{{ noticeData.title }}
|
||||
</view>
|
||||
<view class="text">
|
||||
时间:{{ noticeData.created_at }}
|
||||
</view>
|
||||
<view class="text">
|
||||
{{ noticeData.content }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { noticeDet } from '@/apis/interfaces/notice'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
noticeData : ''
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
// 获取列表
|
||||
this.getDet()
|
||||
},
|
||||
methods: {
|
||||
// 列表
|
||||
getDet(){
|
||||
noticeDet(this.$Route.query.id).then(res => {
|
||||
this.noticeData = res
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
background-color: $window-color;
|
||||
min-height: 100vh;
|
||||
}
|
||||
.tips {
|
||||
padding: $padding;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
.noticeImg {
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
text-align: center;
|
||||
border-radius: 50%;
|
||||
background-color: #ffefe2;
|
||||
&.active {
|
||||
background-color: #e7f8f0;
|
||||
}
|
||||
}
|
||||
.noticeBox {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
padding: $padding + 10 $padding $padding $padding + 90rpx;
|
||||
box-sizing: border-box;
|
||||
.noticeTitle {
|
||||
margin-bottom: $margin;
|
||||
}
|
||||
.contant {
|
||||
background-color: white;
|
||||
padding: $padding $padding - 10;
|
||||
box-sizing: border-box;
|
||||
border-radius: $radius;
|
||||
.title {
|
||||
font-weight: bold;
|
||||
margin-bottom: $margin;
|
||||
}
|
||||
.text {
|
||||
line-height: 48rpx;
|
||||
font-size: $title-size-m;
|
||||
color: $text-gray;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,103 +0,0 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="noticeList" v-for="(item, index) in tabArr" :key="index" @click="$Router.push({ name: 'noticeList', params: {type: item.type }})" >
|
||||
<view class="noticeImg" :class="{active : item.count != 0}">
|
||||
<block v-if="item.type == 'SystemNotification'">
|
||||
<u-icon name="bell-fill" color="#77e79f" size="22" bold style="padding: 14rpx"></u-icon>
|
||||
</block>
|
||||
<block v-else>
|
||||
<u-icon name="calendar-fill" color="#f1a166" size="22" bold style="padding: 14rpx"></u-icon>
|
||||
</block>
|
||||
</view>
|
||||
<view class="noticeCont">
|
||||
<view class="name">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
<view class="nowrap text">
|
||||
{{ item.type == 'SystemNotification' ? 'APP特色功能介绍、官方推进、活动通知' : '商品订单购买成功、发货成功、退货' }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { categories } from '@/apis/interfaces/notice'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tabArr : []
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
// 获取分类
|
||||
this.getNotice()
|
||||
},
|
||||
methods: {
|
||||
// 分类
|
||||
getNotice(){
|
||||
categories().then(res => {
|
||||
this.tabArr = res
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
padding: $padding;
|
||||
box-sizing: border-box;
|
||||
background-color: $window-color;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.noticeList {
|
||||
padding: $padding;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
background-color: white;
|
||||
margin-bottom: $margin;
|
||||
border-radius: $radius;
|
||||
height: 146rpx;
|
||||
&:first-child {
|
||||
.noticeImg {
|
||||
background-color: #e7f8f0;
|
||||
}
|
||||
}
|
||||
.noticeImg {
|
||||
width: 68rpx;
|
||||
height: 68rpx;
|
||||
text-align: center;
|
||||
border-radius: 50%;
|
||||
margin-top: $margin - 20;
|
||||
background-color: #ffefe2;
|
||||
position: relative;
|
||||
&.active::after {
|
||||
position: absolute;
|
||||
content: '';
|
||||
top: $margin - 25;
|
||||
right: 0;
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
border-radius: 50%;
|
||||
background-color: $text-price;
|
||||
}
|
||||
}
|
||||
.noticeCont {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
padding: $padding $padding 0 $padding + 100rpx;
|
||||
.name {
|
||||
font-weight: bold;
|
||||
font-size: $title-size-lg;
|
||||
}
|
||||
.text {
|
||||
margin-top: $margin - 20;
|
||||
font-size: $title-size-sm;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,109 +0,0 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="box" v-if="listArr.length > 0">
|
||||
<view class="list" v-for="(item, index) in listArr" @click="$Router.push({ name: 'noticeDetails', params: {id: item.notification_id }})">
|
||||
<view class="title">
|
||||
{{ item.title }}
|
||||
</view>
|
||||
<view class="text">
|
||||
{{ item.content }}<view class="more">点我查看<u-icon name="arrow-right-double" color="#34CE98" bold size="14" style="display: inline-block;"></u-icon></view>
|
||||
</view>
|
||||
</view>
|
||||
<block v-if="page.total_page > 1">
|
||||
<u-loadmore :status="status" />
|
||||
</block>
|
||||
</view>
|
||||
<view class="noMessage" v-else>
|
||||
<u-empty
|
||||
mode="message"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { lists } from '@/apis/interfaces/notice'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
listArr : [],
|
||||
status : 'loadmore',
|
||||
page : ''
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
// 获取列表
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
// 列表
|
||||
getList(pages){
|
||||
lists(this.$Route.query.type, {
|
||||
page: pages
|
||||
}).then(res => {
|
||||
if(res.page.current == 1){
|
||||
this.listArr = []
|
||||
}
|
||||
this.listArr = this.listArr.concat(res.data)
|
||||
this.status = this.page.has_more ? 'loadmore': 'nomore'
|
||||
this.page = res.page
|
||||
})
|
||||
}
|
||||
},
|
||||
// 下拉加载
|
||||
onReachBottom() {
|
||||
if(this.page.has_more){
|
||||
this.status = 'loading'
|
||||
let pages = this.page.current + 1
|
||||
// 获取列表
|
||||
this.getList(pages)
|
||||
return
|
||||
}
|
||||
this.status = 'nomore'
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
background-color: $window-color;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.box {
|
||||
padding: $padding;
|
||||
box-sizing: border-box;
|
||||
.list {
|
||||
padding: $padding;
|
||||
box-sizing: border-box;
|
||||
border-radius: $radius;
|
||||
background-color: white;
|
||||
margin-bottom: $margin;
|
||||
.title {
|
||||
font-size: $title-size-lg;
|
||||
margin-bottom: $margin - 10;
|
||||
font-weight: bold;
|
||||
}
|
||||
.text {
|
||||
font-size: $title-size-m;
|
||||
color: $text-gray-m;
|
||||
.more {
|
||||
color: $main-color;
|
||||
padding-left: $padding - 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.noMessage {
|
||||
background-color: white;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-box-pack: center;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
</style>
|
||||
186
pages/refund/index.vue
Normal file
186
pages/refund/index.vue
Normal file
@@ -0,0 +1,186 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<!-- tabs -->
|
||||
<u-sticky>
|
||||
<u-tabs
|
||||
class="tabs"
|
||||
:list="tabs"
|
||||
:scrollable="false"
|
||||
:current="index"
|
||||
lineColor="#34CE98"
|
||||
@click="onTabs"
|
||||
sticky
|
||||
></u-tabs>
|
||||
</u-sticky>
|
||||
<block v-if="array.length >= 1">
|
||||
<!-- 订单列表 -->
|
||||
<oct-order
|
||||
v-for="(item, arrayIndex) in array"
|
||||
:key="arrayIndex"
|
||||
:order-info="item"
|
||||
@onBtn="onType"
|
||||
></oct-order>
|
||||
<!-- 加载更多 -->
|
||||
<view class="pages-load">
|
||||
<u-loadmore :status="status" />
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="vertical order-null">
|
||||
<u-empty
|
||||
mode="order"
|
||||
icon="http://cdn.uviewui.com/uview/empty/order.png"
|
||||
text="暂无相关订单"
|
||||
textColor="#999"
|
||||
></u-empty>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { orders, del, cancel, sign } from '@/apis/interfaces/order'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
status: "loading",
|
||||
tabs: [
|
||||
{name: "售后申请", type: "unpay"},
|
||||
{name: "处理中", type: "paid"},
|
||||
{name: "申请记录", type: "completed"},
|
||||
],
|
||||
index: 0,
|
||||
array: [],
|
||||
page : 1
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
if(this.$store.getters.getRefresh == 1) {
|
||||
this.$store.commit('setRefresh', 0)
|
||||
this.array = []
|
||||
this.page = 1
|
||||
this.getOrder()
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.index = this.$Route.query.index
|
||||
this.getOrder()
|
||||
},
|
||||
methods:{
|
||||
getOrder(){
|
||||
orders({
|
||||
state: this.tabs[this.index].type,
|
||||
page : this.page
|
||||
}).then(res => {
|
||||
if(res.page.current === 1){
|
||||
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
|
||||
}
|
||||
})
|
||||
this.array = this.array.concat(ordersArr)
|
||||
this.status = res.page.has_more ? 'loadmore' : 'nomore'
|
||||
})
|
||||
},
|
||||
onTabs(e){
|
||||
this.page = 1
|
||||
this.index = e.index
|
||||
this.getOrder()
|
||||
},
|
||||
onType(e){
|
||||
let orderNo = e.order.no
|
||||
let onFount
|
||||
|
||||
switch (e.type){
|
||||
case 'delete':
|
||||
onFount = del(orderNo)
|
||||
break;
|
||||
case 'cancel':
|
||||
onFount = cancel(orderNo)
|
||||
break;
|
||||
case 'logistic':
|
||||
this.$Router.push({
|
||||
name: 'OrderLogistics',
|
||||
params: {
|
||||
orderNo
|
||||
},
|
||||
})
|
||||
break;
|
||||
case 'pay':
|
||||
this.$Router.push({
|
||||
name: 'Pay',
|
||||
params: {
|
||||
orderNo : orderNo,
|
||||
price : e.order.price,
|
||||
oepnType: 'order'
|
||||
}
|
||||
})
|
||||
break;
|
||||
case 'sign':
|
||||
onFount = sign(orderNo)
|
||||
break;
|
||||
}
|
||||
|
||||
if(!onFount) return
|
||||
|
||||
onFount.then(res =>{
|
||||
let orderIndex = this.array.findIndex(val => val.no === e.order.no)
|
||||
if(e.type === 'delete' || e.type === 'sign'){
|
||||
this.array.splice(orderIndex, 1)
|
||||
return
|
||||
}
|
||||
if(e.type === 'cancel'){
|
||||
this.array.splice(orderIndex, 1, {
|
||||
no : res.order_no,
|
||||
cover : res.items[0].sku.cover,
|
||||
name : res.items[0].sku.goods_name,
|
||||
price : res.items[0].price,
|
||||
sum : res.items[0].qty,
|
||||
stateText : res.state,
|
||||
cans : res.can
|
||||
})
|
||||
return
|
||||
}
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon : 'none'
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
if(this.status === 'loadmore'){
|
||||
this.page += 1
|
||||
this.status = 'loading'
|
||||
this.getOrder()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content{
|
||||
background: $window-color;
|
||||
min-height: 100vh;
|
||||
}
|
||||
.tabs{
|
||||
background: white;
|
||||
}
|
||||
// 数据列表空
|
||||
.order-null{
|
||||
height: 80vh;
|
||||
}
|
||||
// 加载分页
|
||||
.pages-load{
|
||||
padding-bottom: $padding;
|
||||
}
|
||||
</style>
|
||||
@@ -1,257 +0,0 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<image class="setting" src="/static/find/sign_img.png" mode="widthFix"></image>
|
||||
<view class="sign">
|
||||
<view class="signAdd">
|
||||
<view class="label">
|
||||
<image class="picture" src="/static/find/sign.png" mode="aspectFill"></image>
|
||||
<view class="label-day">
|
||||
<view class="number">
|
||||
<text>{{ dateData.total }}</text>天
|
||||
</view>
|
||||
本月打卡
|
||||
</view>
|
||||
</view>
|
||||
<view class="label">
|
||||
<image class="picture" src="/static/find/sign_active.png" mode="aspectFill"></image>
|
||||
<view class="label-day">
|
||||
<view class="number">
|
||||
<text>{{ dateData.continue }}</text>天
|
||||
</view>
|
||||
累计打卡
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="signDate">
|
||||
<view class="date">
|
||||
{{ dateData.month }}
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="week">
|
||||
<view class="week-label">
|
||||
日
|
||||
</view>
|
||||
<view class="week-label">
|
||||
一
|
||||
</view>
|
||||
<view class="week-label">
|
||||
二
|
||||
</view>
|
||||
<view class="week-label">
|
||||
三
|
||||
</view>
|
||||
<view class="week-label">
|
||||
四
|
||||
</view>
|
||||
<view class="week-label">
|
||||
五
|
||||
</view>
|
||||
<view class="week-label">
|
||||
六
|
||||
</view>
|
||||
</view>
|
||||
<view class="day" v-for="(item, index) in dateArr" :key="index">
|
||||
<view class="day-label" v-for="(items, index) in item" :key="index">
|
||||
<view class="label-block" :class="{active : items.isSign}" v-if="!items.isHidden">
|
||||
<uni-icons v-if="items.isSign" class="search-icon" custom-prefix="iconfont" type="icon-dui" color="#ffffff" size="18"></uni-icons>
|
||||
<block v-else>{{ items.date }}</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="signBtn">
|
||||
<view class="btn" @click="signClick" :class="{active : dateData.isSign}">
|
||||
{{ dateData.isSign ? '今日已打卡' : '今日打卡'}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tipsText">
|
||||
ZH大健康用户打卡
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { date, sign } from '@/apis/interfaces/sign'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dateData: '',
|
||||
dateArr : ''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.dateList();
|
||||
},
|
||||
methods: {
|
||||
// 用户登录
|
||||
dateList() {
|
||||
date().then(res => {
|
||||
this.dateData = res.base
|
||||
this.dateArr = res.calendar
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: "none"
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
// 签到
|
||||
signClick() {
|
||||
sign().then(res => {
|
||||
console.log(res)
|
||||
uni.showToast({
|
||||
title: '签到成功',
|
||||
icon: "none"
|
||||
})
|
||||
this.dateList();
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: "none"
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background: $window-color;
|
||||
height: 100vh;
|
||||
}
|
||||
.setting {
|
||||
width: 100%;
|
||||
}
|
||||
.sign {
|
||||
z-index: 9;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
padding: 0 $padding + 20;
|
||||
margin-top: -$margin * 2.5;
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
.signTitle {
|
||||
padding: $padding * 3;
|
||||
font-size: $title-size + 20;
|
||||
color: #48988d;
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
}
|
||||
.signAdd {
|
||||
padding: $padding $padding * 2.5;
|
||||
box-sizing: border-box;
|
||||
border-radius: $radius-m;
|
||||
background-color: white;
|
||||
margin-bottom: $margin;
|
||||
display: flex;
|
||||
.label {
|
||||
display: flex;
|
||||
font-size: $title-size-sm;
|
||||
.picture {
|
||||
width: 74rpx;
|
||||
height: 74rpx;
|
||||
margin-right: $margin - 10;
|
||||
}
|
||||
.label-day {
|
||||
color: $text-gray;
|
||||
text {
|
||||
font-size: $title-size-lg;
|
||||
color: $text-color;
|
||||
font-weight: 600;
|
||||
padding-right: $padding - 20;
|
||||
}
|
||||
}
|
||||
&:first-child {
|
||||
flex: 1;
|
||||
.label-day {
|
||||
text {
|
||||
color: $main-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.signDate {
|
||||
padding: $padding;
|
||||
border-radius: $radius-m;
|
||||
background-color: white;
|
||||
.date {
|
||||
text-align: center;
|
||||
font-size: $title-size + 6;
|
||||
margin-bottom: $margin;
|
||||
font-weight: 600;
|
||||
}
|
||||
.list {
|
||||
.week {
|
||||
display: flex;
|
||||
.week-label {
|
||||
text-align: center;
|
||||
font-size: $title-size-m;
|
||||
width: 14.28%;
|
||||
margin: $margin - 10 0;
|
||||
}
|
||||
}
|
||||
.day {
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
.day-label {
|
||||
width: 14.28%;
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
color: $text-color;
|
||||
font-size: $title-size-m;
|
||||
.label-block {
|
||||
display: inline-block;
|
||||
background-color: transparent;
|
||||
color: $text-gray-m;
|
||||
border-radius: 50%;
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
.label-icon {
|
||||
position: absolute;
|
||||
left: 10rpx;
|
||||
top: 0;
|
||||
}
|
||||
&.active {
|
||||
background-color: $main-color;
|
||||
color: white;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.signBtn {
|
||||
padding: $padding * 2 $padding * 2 0;
|
||||
.btn {
|
||||
color: white;
|
||||
background-color: $text-price;
|
||||
text-align: center;
|
||||
border-radius: $radius-m;
|
||||
line-height: 90rpx;
|
||||
&.active {
|
||||
background-color: #ededed;
|
||||
color: $text-gray;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tipsText {
|
||||
text-align: center;
|
||||
line-height: 120rpx;
|
||||
font-size: $title-size-sm;
|
||||
color: $text-gray-m;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -69,6 +69,7 @@
|
||||
<view class="goods-box">
|
||||
<oct-goods
|
||||
:lists="goodsArr"
|
||||
priceType="DT"
|
||||
color="#e6576b"
|
||||
@onGoods="$Router.push({ name: 'StoreGoods', params: {id: $event.goods_id}})"
|
||||
/>
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="chainAddress" v-if="userInfo.chain_address">
|
||||
<u-icon labelPos="left" @click="copy(userInfo.chain_address)" labelSize="14"
|
||||
<!-- <u-icon labelPos="left" @click="copy(userInfo.chain_address)" labelSize="14"
|
||||
labelColor="#fff" :label="userInfo.chain_address.substr(0, 20)+'...'" space="10"
|
||||
:name="require('@/static/imgs/copy.png')" size="16" />
|
||||
:name="require('@/static/imgs/copy.png')" size="16" /> -->
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
@@ -44,30 +44,19 @@
|
||||
<u-notice-bar :text="cardText" icon="" bgColor="" duration="3000" color="#fcc692" direction="column">
|
||||
</u-notice-bar>
|
||||
</view>
|
||||
<view class="btn" @click="openVip" v-if="userInfo.identity.length === 0">开通</view>
|
||||
<!-- v-if="userInfo.identity.length === 0" -->
|
||||
<view class="btn" @click="openVip">开通</view>
|
||||
</view>
|
||||
|
||||
<!-- 健康数据 -->
|
||||
<view class="health-flex" v-if="userInfo.has_record">
|
||||
<view class="health-flex-item">
|
||||
<view class="title">
|
||||
共力值
|
||||
<image class="icon" src="@/static/user/icon_04.png" mode="widthFix" />
|
||||
</view>
|
||||
<view class="num">
|
||||
{{ userInfo.record.fat.fat }}
|
||||
</view>
|
||||
<view class="hith">{{ userInfo.record.fat.text }}</view>
|
||||
<view class="health-flex">
|
||||
<view class="health-flex-item" @click="onBtn('AccountIntegral', {})">
|
||||
<view class="title">共力值</view>
|
||||
<view class="num">0.00</view>
|
||||
</view>
|
||||
<view class="health-flex-item">
|
||||
<view class="title">
|
||||
DT积分
|
||||
<image class="icon" src="@/static/user/icon_05.png" mode="widthFix" />
|
||||
</view>
|
||||
<view class="num">
|
||||
{{ userInfo.record.weight.weight }}
|
||||
</view>
|
||||
<view class="hith">{{ userInfo.record.weight.text }}</view>
|
||||
<view class="health-flex-item" @click="onBtn('AccountDt', {})">
|
||||
<view class="title">DT积分</view>
|
||||
<view class="num">0.00</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 订单 -->
|
||||
@@ -88,7 +77,7 @@
|
||||
<image class="icon" src="@/static/user/order_icon_03.png" mode="widthFix" />
|
||||
<view class="title">待收货</view>
|
||||
</view>
|
||||
<view class="order-box-item">
|
||||
<view class="order-box-item" @click="onBtn('OrderRefund', { index: 0 })">
|
||||
<image class="icon" src="@/static/user/order_icon_05.png" mode="widthFix" />
|
||||
<view class="title">退换货</view>
|
||||
</view>
|
||||
@@ -182,88 +171,25 @@
|
||||
},
|
||||
// 开通会员
|
||||
openVip() {
|
||||
if (this.isLogin()) {
|
||||
uni.showActionSheet({
|
||||
itemList: ['我是新用户', '我是老用户'],
|
||||
success: res => {
|
||||
switch (res.tapIndex) {
|
||||
case 0:
|
||||
uni.showModal({
|
||||
title: '开通提示',
|
||||
content: '平台新用户完成首笔订单,即可获赠ZH健康会员',
|
||||
showCancel: false,
|
||||
cancelText: '去完成',
|
||||
success: res => {
|
||||
console.log(res);
|
||||
this.$Router.pushTab({
|
||||
name: 'Store'
|
||||
});
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 1:
|
||||
uni.showToast({
|
||||
title: '老用户渠道暂未开放',
|
||||
icon: 'none'
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
// 开通钱包
|
||||
onWallet() {
|
||||
if (this.isLogin()) {
|
||||
if (this.userInfo.is_wallet) this.$Router.push({
|
||||
name: 'WalletProperty'
|
||||
});
|
||||
else this.$Router.push({
|
||||
name: 'WalletAdd'
|
||||
});
|
||||
}
|
||||
},
|
||||
// 个人档案
|
||||
onFiles() {
|
||||
if (this.isLogin()) {
|
||||
console.log("登录")
|
||||
}
|
||||
this.$Router.push({name: 'Vip'})
|
||||
},
|
||||
// 按钮导航
|
||||
onBtn(name, params) {
|
||||
if (this.isLogin()) {
|
||||
this.$Router.push({
|
||||
name,
|
||||
params
|
||||
});
|
||||
}
|
||||
this.$Router.push({
|
||||
name,
|
||||
params
|
||||
});
|
||||
},
|
||||
goSetting() {
|
||||
if (this.isLogin()) {
|
||||
this.$Router.push({
|
||||
name: 'Setting'
|
||||
})
|
||||
}
|
||||
},
|
||||
// 检查登录
|
||||
isLogin() {
|
||||
if (this.$store.state.token === '') {
|
||||
const Auth = new userAuth();
|
||||
Auth.Login();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
this.$Router.push({
|
||||
name: 'Setting'
|
||||
})
|
||||
},
|
||||
// 退出登录
|
||||
logOut() {
|
||||
this.userInfo = {
|
||||
nickname: '',
|
||||
avatar: '',
|
||||
identity: []
|
||||
};
|
||||
this.$store.commit('setToken', '');
|
||||
// 断开IM链接
|
||||
im.disconnect()
|
||||
this.$store.commit('setIsNew', '');
|
||||
this.$Router.replaceAll({name: 'Auth'})
|
||||
},
|
||||
copy(data) {
|
||||
uni.setClipboardData({
|
||||
@@ -468,7 +394,6 @@
|
||||
border-radius: $radius;
|
||||
padding: $padding;
|
||||
box-sizing: border-box;
|
||||
|
||||
.title {
|
||||
font-size: $title-size-lg;
|
||||
|
||||
@@ -480,22 +405,15 @@
|
||||
margin-bottom: 2rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.num {
|
||||
font-weight: bold;
|
||||
font-size: $title-size + 10;
|
||||
padding: $padding/3 0;
|
||||
|
||||
padding: $padding/3 0 0;
|
||||
text {
|
||||
font-size: 70%;
|
||||
padding-left: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.hith {
|
||||
font-size: $title-size-sm;
|
||||
color: $text-gray;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
19
pages/vip/agreement.vue
Normal file
19
pages/vip/agreement.vue
Normal file
@@ -0,0 +1,19 @@
|
||||
<template>
|
||||
<view>
|
||||
会员开通协议
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
</style>
|
||||
251
pages/vip/vip.vue
Normal file
251
pages/vip/vip.vue
Normal file
@@ -0,0 +1,251 @@
|
||||
<template>
|
||||
<view class="vip">
|
||||
<view class="vip-card">
|
||||
<view class="vip-user">
|
||||
<image class="user-cover" src="" mode="aspectFill"></image>
|
||||
<view class="user-nickname">唐明阳</view>
|
||||
<view class="user-date">到期日期:2023-06-07</view>
|
||||
<view class="vip-renewal">续费</view>
|
||||
</view>
|
||||
<view class="user-cards">
|
||||
<image class="vip-icon" src="/static/vip/lv_04.png" mode="widthFix"></image>
|
||||
<view>
|
||||
<view class="vip-lv">共力践行者</view>
|
||||
<view class="vip-progress">
|
||||
<view class="vip-progress-loding" style="width: 50%;"></view>
|
||||
</view>
|
||||
<view class="vip-loding">
|
||||
<view>1/3 邀请家庭会员</view>
|
||||
<view>3/100 邀请家族会员员</view>
|
||||
</view>
|
||||
</view>
|
||||
<navigator class="vip-more">成长体系<uni-icons size="14" type="forward" color="#9f5529"></uni-icons></navigator>
|
||||
</view>
|
||||
</view>
|
||||
<view class="vip-content">
|
||||
<view class="vip-content-title">会员成长值</view>
|
||||
<view class="vip-privilege">
|
||||
<view class="vip-privilege-item" v-for="(item, index) in 8" :key="index">
|
||||
<image class="vip-privilege-icon" src="" mode="widthFix"></image>
|
||||
<view class="vip-privilege-text">特权名称{{index}}</view>
|
||||
<view class="vip-privilege-sub">特权名称{{index}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="vip-content-title">会员折扣说明</view>
|
||||
<view class="vip-content-rich">
|
||||
<view>前1000名会员享受会员费5折优惠</view>
|
||||
<view>前1001-2000名会员享受会员费5折优惠</view>
|
||||
<view>前2001-5000名会员享受会员费5折优惠</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="footer-vip">
|
||||
<button @click="onOpenVip">开通会员</button>
|
||||
<view class="footer-text">开通即表示同意共力生态<navigator url="./agreement">《会员开通协议》</navigator></view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
onOpenVip(){
|
||||
uni.requestPayment({
|
||||
provider : "wxpay",
|
||||
success: res => {
|
||||
console.log(res)
|
||||
},
|
||||
fail: err=> {
|
||||
console.log(err)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
// 会员卡
|
||||
.vip-card{
|
||||
background-color: #242430;
|
||||
padding: $padding $padding 0;
|
||||
.vip-user{
|
||||
position: relative;
|
||||
padding: 6rpx 200rpx $padding 120rpx;
|
||||
.user-cover{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
background: white;
|
||||
border-radius: 50%;
|
||||
width: 92rpx;
|
||||
height: 92rpx;
|
||||
}
|
||||
.user-nickname{
|
||||
color: #fcc590;
|
||||
font-weight: bold;
|
||||
font-size: 36rpx;
|
||||
line-height: 50rpx;
|
||||
}
|
||||
.user-date{
|
||||
line-height: 30rpx;
|
||||
color: rgba(255, 255, 255, .5);
|
||||
font-size: 26rpx;
|
||||
}
|
||||
.vip-renewal{
|
||||
background: linear-gradient(to bottom right, #fce3c5, #fcc590);
|
||||
color: #9f5529;
|
||||
line-height: 60rpx;
|
||||
width: 170rpx;
|
||||
border-radius: 30rpx;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
top: 16rpx;
|
||||
right: 0;
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
.user-cards{
|
||||
padding: $padding;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
background: linear-gradient(to bottom right, #fce3c5, #fcc590);
|
||||
border-radius: 30rpx 30rpx 0 0;
|
||||
height: 300rpx;
|
||||
padding-right: 260rpx;
|
||||
margin-top: $margin;
|
||||
border-radius: $radius;
|
||||
color: #9f5529;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
.vip-icon{
|
||||
position: absolute;
|
||||
right: 30rpx;
|
||||
top: 50rpx;
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
}
|
||||
.vip-lv{
|
||||
font-weight: bold;
|
||||
font-size: 40rpx;
|
||||
padding-bottom: 30rpx;
|
||||
}
|
||||
.vip-progress{
|
||||
height: 10rpx;
|
||||
background-color: #feefe0;
|
||||
border-radius: 5rpx;
|
||||
overflow: hidden;
|
||||
&-loding{
|
||||
background: #9c5125;
|
||||
height: 10rpx;
|
||||
border-radius: 5rpx;
|
||||
}
|
||||
}
|
||||
.vip-loding{
|
||||
font-size: 26rpx;
|
||||
padding-top: 15rpx;
|
||||
}
|
||||
.vip-more{
|
||||
font-size: 26rpx;
|
||||
font-weight: bold;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 会员权益
|
||||
.vip-content{
|
||||
padding: 180rpx $padding $padding $padding;
|
||||
margin-top: -150rpx;
|
||||
background-color: white;
|
||||
border-radius: 30rpx 30rpx 0 0;
|
||||
box-sizing: border-box;
|
||||
.vip-content-title{
|
||||
position: relative;
|
||||
font-weight: bold;
|
||||
font-size: 30rpx;
|
||||
line-height: 70rpx;
|
||||
padding-left: 30rpx;
|
||||
color: #333;
|
||||
&::after{
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
left: 0;
|
||||
content: " ";
|
||||
background: #fcc590;
|
||||
width: 10rpx;
|
||||
height: 30rpx;
|
||||
}
|
||||
}
|
||||
.vip-content-rich{
|
||||
padding: 30rpx 0 0;
|
||||
font-size: 28rpx;
|
||||
line-height: 50rpx;
|
||||
color: gray;
|
||||
}
|
||||
.vip-privilege{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
padding: 10rpx 0;
|
||||
&-item{
|
||||
padding: 20rpx 10rpx;
|
||||
box-sizing: border-box;
|
||||
width: 25%;
|
||||
text-align: center;
|
||||
}
|
||||
&-icon{
|
||||
background: #fce3c5;
|
||||
border-radius: 50%;
|
||||
width: 82rpx;
|
||||
height: 82rpx;
|
||||
}
|
||||
&-text{
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
@extend .nowrap;
|
||||
}
|
||||
&-sub{
|
||||
font-size: 24rpx;
|
||||
color: gray;
|
||||
@extend .nowrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 会员支付
|
||||
.footer-vip{
|
||||
padding: $padding;
|
||||
button{
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
padding: 0;
|
||||
border-radius: 45rpx;
|
||||
border: none;
|
||||
background: linear-gradient(to right, #fce3c5, #fcc590);
|
||||
color: #31364a;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
&::after{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.footer-text{
|
||||
font-size: 26rpx;
|
||||
color: #888;
|
||||
text-align: center;
|
||||
padding: $padding 0;
|
||||
navigator{
|
||||
display: inline-block;
|
||||
color: #fcc590;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,68 +0,0 @@
|
||||
<template>
|
||||
<view class="content vertical">
|
||||
<!-- logo -->
|
||||
<image class="logo" src="@/static/wallet/logo.png" mode="widthFix"></image>
|
||||
<!-- 副标题 -->
|
||||
<view class="sub-title">激活您的ZH健康钱包获取钱包地址,地址可以理解为您的个人银行卡卡号</view>
|
||||
<!-- 按钮 -->
|
||||
<view class="wallet-btn" @click="$Router.replace({name: 'WalletCreate'})">激活钱包</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background-color: white;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
position: relative;
|
||||
height: 100vh;
|
||||
padding: 0 15vw;
|
||||
text-align: center;
|
||||
|
||||
.logo {
|
||||
width: 138rpx;
|
||||
vertical-align: top;
|
||||
margin-bottom: 20vh;
|
||||
}
|
||||
|
||||
.sub-title {
|
||||
font-size: $title-size-m;
|
||||
color: $text-gray;
|
||||
}
|
||||
|
||||
.wallet-btn {
|
||||
width: 100%;
|
||||
background-color: $main-color;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
margin-top: $margin * 2;
|
||||
border-radius: $radius-lg;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
font-size: $title-size;
|
||||
|
||||
&.hollow {
|
||||
background-color: white;
|
||||
color: $main-color;
|
||||
border: solid 2rpx $main-color;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,193 +0,0 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 设置钱包密码 -->
|
||||
<view class="password">
|
||||
<view class="prompt">请设置6位数字密码,建议不要使用连续的数字</view>
|
||||
<view class="group">
|
||||
<view class="inputs" @click="onShowKet('password')">
|
||||
<block v-if="password.length > 0">
|
||||
<text v-for="item in password.length" :key="item">•</text>
|
||||
</block>
|
||||
<block v-if="keyShow && valKye === 'password'">
|
||||
<text class="flicker-animation">|</text>
|
||||
</block>
|
||||
<block v-else>
|
||||
<text v-if="password.length === 0" class="placeholder">请设置密码</text>
|
||||
</block>
|
||||
</view>
|
||||
<view class="inputs" :class="{'hide': verify === ''}" @click="onShowKet('verify')">
|
||||
<block v-if="verify.length > 0">
|
||||
<text v-for="item in verify.length" :key="item">•</text>
|
||||
</block>
|
||||
<block v-if="keyShow && valKye === 'verify'">
|
||||
<text class="flicker-animation">|</text>
|
||||
</block>
|
||||
<block v-else>
|
||||
<text v-if="verify.length === 0" class="placeholder">请确认密码</text>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- key键盘 -->
|
||||
<u-keyboard mode="number" random dotDisabled :overlay="false" :show="keyShow" :showCancel="false"
|
||||
@change="keyValChange" @backspace="keyValBackspace" @confirm="keyShow = false"></u-keyboard>
|
||||
<!-- 按钮 -->
|
||||
<view class="buttons">
|
||||
<button type="default" form-type="submit" @click="createWallet">确认激活</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
security
|
||||
} from '@/apis/interfaces/wallet';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
password: '',
|
||||
verify: '',
|
||||
valKye: '',
|
||||
keyShow: false
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 唤起key
|
||||
onShowKet(key) {
|
||||
this.valKye = key
|
||||
this.keyShow = true
|
||||
},
|
||||
// 键盘输入
|
||||
keyValChange(e) {
|
||||
if (this[this.valKye].length >= 6) return
|
||||
this[this.valKye] += e
|
||||
},
|
||||
// 键盘删除
|
||||
keyValBackspace(e) {
|
||||
if (this[this.valKye].length) this[this.valKye] = this[this.valKye].substr(0, this[this.valKye].length -
|
||||
1)
|
||||
},
|
||||
// 激活钱包
|
||||
createWallet() {
|
||||
if (this.password === '' || this.verify === '') {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '请设置密码'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (this.password !== this.verify) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '两次输入密码不一致'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
security({
|
||||
code: Number(this.password)
|
||||
}).then(res => {
|
||||
this.$Router.replace({
|
||||
name: 'WalletProperty'
|
||||
})
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: err.message
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.flicker-animation {
|
||||
animation: flicker .8s infinite;
|
||||
}
|
||||
|
||||
@keyframes flicker {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
100 {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
// 副标题
|
||||
.sub-title {
|
||||
color: $text-gray;
|
||||
text-align: center;
|
||||
margin: $margin * 2 $margin;
|
||||
font-size: $title-size-m;
|
||||
}
|
||||
|
||||
// 设置密码
|
||||
.password {
|
||||
padding: 0 $padding * 2;
|
||||
|
||||
.prompt {
|
||||
margin-top: $margin * 2;
|
||||
font-size: $title-size-m;
|
||||
color: $main-color;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.group {
|
||||
padding-top: $padding;
|
||||
|
||||
.inputs {
|
||||
padding: 10rpx $padding + 10;
|
||||
margin-top: $margin;
|
||||
border-radius: $radius-m;
|
||||
background-color: $window-color;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
font-size: $title-size-lg;
|
||||
text-align: center;
|
||||
|
||||
text {
|
||||
padding: 0 10rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.placeholder {
|
||||
color: $text-gray;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 按钮
|
||||
.buttons {
|
||||
padding: $padding * 2;
|
||||
|
||||
.text {
|
||||
text-align: center;
|
||||
line-height: 90rpx;
|
||||
height: 90rpx;
|
||||
margin-bottom: $margin * 2;
|
||||
font-size: $title-size-lg;
|
||||
color: $main-color;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
button {
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
background-color: $main-color;
|
||||
border-radius: $radius-m;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
font-size: $title-size;
|
||||
|
||||
&::after {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,122 +0,0 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 提示信息 -->
|
||||
<view class="prompt">请按照顺序记录并确保正确备份助记词</view>
|
||||
<!-- 助记词 -->
|
||||
<ul class="mnemonic">
|
||||
<li v-for="(item, index) in mnemonic" :key="index">{{item}}</li>
|
||||
</ul>
|
||||
<!-- 按钮 -->
|
||||
<view class="buttons">
|
||||
<view class="text">注:助记词是用户账户的唯一标识,不能分享给他人,掌握该助记词即可控制该账户与钱包</view>
|
||||
<!-- <button type="default" @click="goto">验证助记词</button> -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
seed
|
||||
} from "@/apis/interfaces/wallet"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
mnemonic: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
seed({
|
||||
code: this.$Route.query.password
|
||||
}).then(res => {
|
||||
this.mnemonic = res.seed.split(' ')
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: err.message
|
||||
})
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
goto() {
|
||||
this.$Router.replace({
|
||||
name: 'WalletValidation',
|
||||
params: {
|
||||
seed: this.mnemonic,
|
||||
sign: this.sign
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
// 提示信息
|
||||
.prompt {
|
||||
color: $text-gray;
|
||||
text-align: center;
|
||||
line-height: 90rpx;
|
||||
font-size: $title-size-m;
|
||||
}
|
||||
|
||||
// 跳过
|
||||
.skip {
|
||||
padding: $padding * 2;
|
||||
text-align: center;
|
||||
color: $text-gray;
|
||||
|
||||
navigator {
|
||||
color: $main-color;
|
||||
margin-left: $margin/2;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
// 助记词
|
||||
.mnemonic {
|
||||
margin: $margin $margin * 2;
|
||||
border-radius: $radius-m;
|
||||
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
|
||||
background-color: white;
|
||||
padding: $padding;
|
||||
list-style: none;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
li {
|
||||
text-align: center;
|
||||
height: 58rpx;
|
||||
padding: 0 $padding/2;
|
||||
line-height: 58rpx;
|
||||
margin: $margin / 2;
|
||||
color: $text-color;
|
||||
background: rgba($color: $border-color, $alpha: .4);
|
||||
}
|
||||
}
|
||||
|
||||
// 按钮
|
||||
.buttons {
|
||||
padding: $padding $padding * 2;
|
||||
|
||||
.text {
|
||||
text-align: center;
|
||||
margin-bottom: $margin * 2;
|
||||
font-size: $title-size-m;
|
||||
color: $text-price;
|
||||
}
|
||||
|
||||
button {
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
background-color: $main-color;
|
||||
border-radius: $radius-lg;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
font-size: $title-size;
|
||||
|
||||
&::after {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,130 +0,0 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 私钥 -->
|
||||
<view class="keys">
|
||||
<view class="title">您的ZH托管钱包</view>
|
||||
<view class="key">{{key || '-'}}</view>
|
||||
<view class="copykey" @click="copykey">复制我的私钥</view>
|
||||
</view>
|
||||
<!-- 疑问 -->
|
||||
<view class="doubt" v-if="rules.length > 0">
|
||||
<view class="doubt-item" v-for="(item, index) in rules" :key="index">
|
||||
<view class="title">{{item.title || '-'}}</view>
|
||||
<view class="content">{{item.description || '-'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 免责说明 -->
|
||||
<!-- <view class="liability">
|
||||
<navigator url="/pages/wallet/cmsWithDraw">免责条款</navigator>
|
||||
</view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
privatekey,
|
||||
keyrules
|
||||
} from '@/apis/interfaces/wallet'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
key: "",
|
||||
rules: [{
|
||||
title: "什么是托管钱包?",
|
||||
description: "托管钱包顾名思义就是用户把私钥和数字资产委托给其他机构管理,也就是就是通过中心化的方式安全管理并保存资产,本质上是与区块链所追求的去中心化相背离的。"
|
||||
},
|
||||
{
|
||||
title: "什么是钱包私钥?",
|
||||
description: "作为管理和使用加密货币最关键的东西,私钥对所有数字货币用户而言具有所有权,拥有私钥才能支配相应的加密资产。"
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
privatekey(this.$Route.query.password).then(res => {
|
||||
this.key = res.private_key
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: 'none'
|
||||
})
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
copykey() {
|
||||
uni.setClipboardData({
|
||||
data: this.key
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.keys {
|
||||
margin: $margin * 2;
|
||||
background: white;
|
||||
padding: $padding * 2;
|
||||
box-shadow: 0 0 4rpx 4rpx rgba($color: #000000, $alpha: .02);
|
||||
border-radius: $radius;
|
||||
|
||||
.title {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: $title-size + 4;
|
||||
color: $text-color;
|
||||
}
|
||||
|
||||
.key {
|
||||
padding: $padding * 2 0;
|
||||
text-align: center;
|
||||
color: $main-color;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.copykey {
|
||||
background-color: $main-color;
|
||||
color: white;
|
||||
height: 95rpx;
|
||||
line-height: 95rpx;
|
||||
text-align: center;
|
||||
font-size: $title-size;
|
||||
border-radius: $radius-m;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.doubt {
|
||||
margin: $margin $margin * 2;
|
||||
|
||||
.doubt-item {
|
||||
padding: $padding 0;
|
||||
|
||||
.title {
|
||||
font-weight: bold;
|
||||
color: $text-color;
|
||||
line-height: 50rpx;
|
||||
font-size: $title-size + 2;
|
||||
}
|
||||
|
||||
.content {
|
||||
color: $text-gray;
|
||||
font-size: $title-size-m;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.liability {
|
||||
text-align: center;
|
||||
color: $text-gray;
|
||||
@extend .ios-bottom;
|
||||
|
||||
navigator {
|
||||
font-size: $title-size-sm;
|
||||
display: inline-block;
|
||||
line-height: 90rpx;
|
||||
padding: 0 ($padding * 2);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,386 +0,0 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="propery">
|
||||
<view class="propery-content">
|
||||
<view class="currency">钱包余额</view>
|
||||
<view class="balance">{{ balance.balance || '0' }}</view>
|
||||
<view class="frozen">{{ balance.frozen || '0' }} 冻结中</view>
|
||||
<view class="balance-flex">
|
||||
<view class="balance-flex-item" @click="showAddress">区块链地址</view>
|
||||
<view class="balance-flex-item" @click="showPrivatekey('privatekey')">我的私钥</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 账户记录 -->
|
||||
<view class="record">
|
||||
<view class="record-tabs">
|
||||
<view class="tabs-item" :class="logsType === 0 ? 'show': ''" @click="onLogsType(0)">全部</view>
|
||||
<view class="tabs-item" :class="logsType === 2 ? 'show': ''" @click="onLogsType(2)">收入</view>
|
||||
<view class="tabs-item" :class="logsType === 1 ? 'show': ''" @click="onLogsType(1)">支出</view>
|
||||
</view>
|
||||
<record :list="logs" />
|
||||
<!-- ios安全距离 -->
|
||||
<view class="ios-bottom"></view>
|
||||
</view>
|
||||
<!-- 钱包密码 -->
|
||||
<u-popup :show="passwordShow" @close="resetPassword" mode="center" round="10" borderRadius="10">
|
||||
<view class="validationPassword">
|
||||
<view class="from">
|
||||
<view class="title">验证钱包密码</view>
|
||||
<view class="inputs">
|
||||
<text v-for="item in password.length" :key="item">•</text>
|
||||
<text class="flicker-animation">|</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<!-- key -->
|
||||
<u-keyboard mode="number" random dotDisabled :overlay="false" :show="passwordShow" confirmText="验证"
|
||||
@change="keyValChange" @backspace="keyValBackspace" @confirm="payPassword('confirm', passwordPages)"
|
||||
@cancel="passwordShow = false"></u-keyboard>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import record from '@/components/property/record'
|
||||
import {
|
||||
sum,
|
||||
logs,
|
||||
securityCheck
|
||||
} from '@/apis/interfaces/wallet'
|
||||
export default {
|
||||
components: {
|
||||
record
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
balance: {},
|
||||
logs: [],
|
||||
logsType: 0,
|
||||
password: '',
|
||||
passwordShow: false,
|
||||
passwordPages: ''
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
Promise.all([
|
||||
sum(),
|
||||
logs()
|
||||
]).then(res => {
|
||||
this.balance = res[0]
|
||||
this.logs = res[1]
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: err.message
|
||||
})
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 键盘输入
|
||||
keyValChange(e) {
|
||||
if (this.password.length >= 6) return
|
||||
this.password += e
|
||||
},
|
||||
// 键盘删除
|
||||
keyValBackspace(e) {
|
||||
if (this.password.length) this.password = this.password.substr(0, this.password.length - 1)
|
||||
},
|
||||
// 弹出私钥
|
||||
showPrivatekey(pages) {
|
||||
this.passwordShow = true
|
||||
this.passwordPages = pages
|
||||
},
|
||||
// 重置密码
|
||||
resetPassword() {
|
||||
this.passwordShow = false
|
||||
this.password = ''
|
||||
},
|
||||
// 验证私钥
|
||||
payPassword(type) {
|
||||
if (type === 'confirm') {
|
||||
if (this.password === '') {
|
||||
uni.showToast({
|
||||
title: '请输入安全密码',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
securityCheck(this.password).then(res => {
|
||||
switch (this.passwordPages) {
|
||||
case 'privatekey':
|
||||
this.$Router.push({
|
||||
name: 'WalletPrivatekey',
|
||||
params: {
|
||||
password: this.password
|
||||
}
|
||||
})
|
||||
break;
|
||||
case 'ResetPassword':
|
||||
this.$Router.push({
|
||||
name: 'ResetPassword',
|
||||
params: {
|
||||
password: this.password
|
||||
}
|
||||
})
|
||||
break;
|
||||
case 'WalletMnemonic':
|
||||
this.$Router.push({
|
||||
name: 'WalletMnemonic',
|
||||
params: {
|
||||
password: this.password
|
||||
}
|
||||
})
|
||||
break;
|
||||
}
|
||||
this.resetPassword()
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: 'none',
|
||||
})
|
||||
})
|
||||
return
|
||||
}
|
||||
this.$refs.showPassword.close()
|
||||
},
|
||||
// 交易记录
|
||||
onLogsType(index) {
|
||||
if (this.logsType === index) return
|
||||
this.logsType = index
|
||||
this.logs = []
|
||||
logs({
|
||||
flag: this.logsType
|
||||
}).then(res => {
|
||||
this.logs = res
|
||||
})
|
||||
},
|
||||
// 区块地址
|
||||
showAddress() {
|
||||
uni.showModal({
|
||||
title: '我的区块链地址',
|
||||
content: this.balance.address,
|
||||
cancelText: '复制',
|
||||
cancelColor: '#009B69',
|
||||
success: (res) => {
|
||||
if (res.cancel) {
|
||||
uni.setClipboardData({
|
||||
data: this.balance.address
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
onNavigationBarButtonTap(e) {
|
||||
if (e.index === 0) {
|
||||
uni.showActionSheet({
|
||||
itemList: ['导出助记词', '修改密码'],
|
||||
success: (res) => {
|
||||
switch (res.tapIndex) {
|
||||
case 0:
|
||||
this.showPrivatekey('WalletMnemonic')
|
||||
break;
|
||||
case 1:
|
||||
this.showPrivatekey('ResetPassword')
|
||||
break;
|
||||
}
|
||||
uni.hideLoading()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.flicker-animation {
|
||||
animation: flicker .8s infinite;
|
||||
}
|
||||
|
||||
@keyframes flicker {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
100 {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
// 验证密码弹出层
|
||||
.validationPassword {
|
||||
width: 80vw;
|
||||
|
||||
.from {
|
||||
padding: $padding*2;
|
||||
text-align: center;
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: bold;
|
||||
font-size: $title-size;
|
||||
padding-bottom: $padding;
|
||||
}
|
||||
|
||||
// input{
|
||||
// background: $window-color;
|
||||
// height: 90rpx;
|
||||
// left: 90rpx;
|
||||
// font-size: $title-size-lg;
|
||||
// border-radius: 45rpx;
|
||||
// }
|
||||
.inputs {
|
||||
background-color: $window-color;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
border-radius: 45rpx;
|
||||
font-size: $title-size-lg;
|
||||
text-align: center;
|
||||
|
||||
text {
|
||||
padding: 0 10rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.placeholder {
|
||||
color: $text-gray;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.buttons {
|
||||
text-align: center;
|
||||
padding: 0 $padding*2;
|
||||
|
||||
.button {
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
margin-bottom: $margin;
|
||||
|
||||
&.cancel {
|
||||
color: $text-gray;
|
||||
}
|
||||
|
||||
&.confirm {
|
||||
color: white;
|
||||
background: $main-color;
|
||||
border-radius: 45rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
}
|
||||
|
||||
// 账户
|
||||
.propery {
|
||||
position: relative;
|
||||
padding-top: var(--status-bar-height);
|
||||
background-image: linear-gradient(to right, $main-color, #22aa98);
|
||||
|
||||
&::before {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
content: " ";
|
||||
// background-image: url(@/static/background/wallet-back.png);
|
||||
background-size: 100%;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.propery-content {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
padding: $padding * 5 $padding * 2;
|
||||
text-align: center;
|
||||
|
||||
.currency {
|
||||
font-size: $title-size-m;
|
||||
color: rgba($color: white, $alpha: .8);
|
||||
}
|
||||
|
||||
.balance {
|
||||
font-size: $title-size * 2;
|
||||
padding: ($padding / 2) 0;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.frozen {
|
||||
background: rgba($color: #000000, $alpha: .1);
|
||||
color: rgba($color: white, $alpha: .7);
|
||||
display: inline-block;
|
||||
padding: 0 $padding;
|
||||
font-size: $title-size-m;
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
border-radius: $radius-m;
|
||||
border: solid 1rpx rgba($color: white, $alpha: .4)
|
||||
}
|
||||
|
||||
.balance-flex {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: $margin * 3;
|
||||
|
||||
.balance-flex-item {
|
||||
background-color: white;
|
||||
width: 200rpx;
|
||||
height: 75rpx;
|
||||
line-height: 75rpx;
|
||||
color: $main-color;
|
||||
margin: 0 $margin;
|
||||
border-radius: $radius-m;
|
||||
font-size: $title-size-lg;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 记录
|
||||
.record {
|
||||
background-color: white;
|
||||
border-radius: $radius $radius 0 0;
|
||||
padding: $padding ($padding * 2);
|
||||
margin-top: -$margin;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
|
||||
.record-tabs {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
font-weight: bold;
|
||||
font-size: $title-size;
|
||||
color: $text-gray;
|
||||
line-height: 70rpx;
|
||||
margin-bottom: $margin;
|
||||
|
||||
.tabs-item {
|
||||
position: relative;
|
||||
padding: 0 $padding;
|
||||
|
||||
&.show {
|
||||
color: $main-color;
|
||||
|
||||
&::before {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: $padding;
|
||||
right: $padding;
|
||||
height: 4rpx;
|
||||
content: " ";
|
||||
background-color: $main-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,203 +0,0 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 设置钱包密码 -->
|
||||
<view class="password">
|
||||
<view class="prompt">请设置6位数字密码,建议不要使用连续的数字</view>
|
||||
<view class="group">
|
||||
<view class="inputs" @click="onShowKet('password')">
|
||||
<block v-if="password.length > 0">
|
||||
<text v-for="item in password.length" :key="item">•</text>
|
||||
</block>
|
||||
<block v-if="keyShow && valKye === 'password'">
|
||||
<text class="flicker-animation">|</text>
|
||||
</block>
|
||||
<block v-else>
|
||||
<text v-if="password.length === 0" class="placeholder">请设置密码</text>
|
||||
</block>
|
||||
</view>
|
||||
<view class="inputs" :class="{'hide': verify === ''}" @click="onShowKet('verify')">
|
||||
<block v-if="verify.length > 0">
|
||||
<text v-for="item in verify.length" :key="item">•</text>
|
||||
</block>
|
||||
<block v-if="keyShow && valKye === 'verify'">
|
||||
<text class="flicker-animation">|</text>
|
||||
</block>
|
||||
<block v-else>
|
||||
<text v-if="verify.length === 0" class="placeholder">请确认密码</text>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- key键盘 -->
|
||||
<u-keyboard mode="number" random dotDisabled :overlay="false" :show="keyShow" :showCancel="false"
|
||||
@change="keyValChange" @backspace="keyValBackspace" @confirm="keyShow = false"></u-keyboard>
|
||||
<!-- 按钮 -->
|
||||
<view class="buttons">
|
||||
<button type="default" form-type="submit" @click="createWallet">确认修改</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
securityReset
|
||||
} from '@/apis/interfaces/wallet'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
password: '',
|
||||
verify: '',
|
||||
oldPassword: '',
|
||||
valKye: '',
|
||||
keyShow: false
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.oldPassword = this.$Route.query.password
|
||||
},
|
||||
methods: {
|
||||
// 唤起key
|
||||
onShowKet(key) {
|
||||
this.valKye = key
|
||||
this.keyShow = true
|
||||
},
|
||||
// 键盘输入
|
||||
keyValChange(e) {
|
||||
if (this[this.valKye].length >= 6) return
|
||||
this[this.valKye] += e
|
||||
},
|
||||
// 键盘删除
|
||||
keyValBackspace(e) {
|
||||
if (this[this.valKye].length) this[this.valKye] = this[this.valKye].substr(0, this[this.valKye].length -
|
||||
1)
|
||||
},
|
||||
// 修改密码
|
||||
createWallet() {
|
||||
if (this.password === '' || this.verify === '') {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '请设置密码'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.password !== this.verify) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '两次输入密码不一致'
|
||||
})
|
||||
return
|
||||
}
|
||||
securityReset({
|
||||
new_code: this.password,
|
||||
code: this.oldPassword
|
||||
}).then(res => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '密码已重置',
|
||||
showCancel: false,
|
||||
success: res => {
|
||||
uni.navigateBack()
|
||||
}
|
||||
})
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: err.message
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style>
|
||||
.flicker-animation {
|
||||
animation: flicker .8s infinite;
|
||||
}
|
||||
|
||||
@keyframes flicker {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
100 {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
// 副标题
|
||||
.sub-title {
|
||||
color: $text-gray;
|
||||
text-align: center;
|
||||
margin: $margin * 2 $margin;
|
||||
font-size: $title-size-m;
|
||||
}
|
||||
|
||||
// 设置密码
|
||||
.password {
|
||||
padding: 0 $padding * 2;
|
||||
|
||||
.prompt {
|
||||
margin-top: $margin * 2;
|
||||
font-size: $title-size-m;
|
||||
color: $main-color;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.group {
|
||||
padding-top: $padding;
|
||||
|
||||
.inputs {
|
||||
padding: 10rpx $padding + 10;
|
||||
margin-top: $margin;
|
||||
border-radius: $radius-m;
|
||||
background-color: $window-color;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
font-size: $title-size-lg;
|
||||
text-align: center;
|
||||
|
||||
text {
|
||||
padding: 0 10rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.placeholder {
|
||||
color: $text-gray;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 按钮
|
||||
.buttons {
|
||||
padding: $padding * 2;
|
||||
|
||||
.text {
|
||||
text-align: center;
|
||||
line-height: 90rpx;
|
||||
height: 90rpx;
|
||||
margin-bottom: $margin * 2;
|
||||
font-size: $title-size-lg;
|
||||
color: $main-color;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
button {
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
background-color: $main-color;
|
||||
border-radius: $radius-m;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
font-size: $title-size;
|
||||
|
||||
&::after {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,178 +0,0 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 提示信息 -->
|
||||
<view class="prompt">
|
||||
验证您的钱包助记词
|
||||
</view>
|
||||
<!-- 助记词 -->
|
||||
<view class="mnemonic">
|
||||
<view class="item" v-for="(item, index) in validation" :key="index" :class="item === null ? 'hide': ''"
|
||||
@click="onKeys('removeKey', index)">{{ item }}</view>
|
||||
</view>
|
||||
<!-- 选择助记词 -->
|
||||
<block v-if="mnemonic.length > 0">
|
||||
<view class="mnemonic-title">
|
||||
按顺序填写助记词
|
||||
</view>
|
||||
<view class="mnemonic-select">
|
||||
<view class="item" v-for="(item, index) in mnemonic" :key="index" @click="onKeys('addKey', index)">
|
||||
{{ item }}</view>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 按钮 -->
|
||||
<view class="buttons">
|
||||
<button type="default" @click="verifyMnemonic">验证</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
hash
|
||||
} from "@/apis/interfaces/wallet"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
validation: new Array(12).fill(null), // 验证key
|
||||
mnemonic: [], // 助记词key
|
||||
sign: '', // 助记词校验签名
|
||||
seedString: '', // 助记词原词
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
let seed = this.$Route.query.seed.split(',')
|
||||
seed.sort(() => {
|
||||
return Math.random() - .5
|
||||
});
|
||||
console.log(seed)
|
||||
// this.mnemonic = seed
|
||||
// this.sign = this.$Route.query.sign
|
||||
// this.seedString = this.$Route.query.seed
|
||||
},
|
||||
methods: {
|
||||
// 填写助记词
|
||||
onKeys(type, index) {
|
||||
if (type === 'addKey') {
|
||||
this.$set(this.validation, this.validation.findIndex(val => val === null), this.mnemonic[index])
|
||||
this.$delete(this.mnemonic, index)
|
||||
return
|
||||
}
|
||||
if (type === 'removeKey' && this.validation[index] !== null) {
|
||||
this.mnemonic.push(this.validation[index])
|
||||
this.$delete(this.validation, index)
|
||||
this.validation.push(null)
|
||||
}
|
||||
},
|
||||
// 验证助记词
|
||||
verifyMnemonic() {
|
||||
if (this.validation.findIndex(val => val === null) > -1) {
|
||||
uni.showToast({
|
||||
title: '请完整填写助记词',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
let seed = this.validation.toString().replace(/,/g, ',')
|
||||
if (this.seedString !== seed) {
|
||||
uni.showToast({
|
||||
title: '验证失败,请确认您的助记词',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
uni.redirectTo({
|
||||
url: './create'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
// 提示信息
|
||||
.prompt {
|
||||
color: $text-gray;
|
||||
text-align: center;
|
||||
line-height: 90rpx;
|
||||
font-size: $title-size-m;
|
||||
}
|
||||
|
||||
// 选择助记词
|
||||
.mnemonic-title {
|
||||
padding-top: $padding * 2;
|
||||
margin: 0 $margin * 2;
|
||||
font-size: $title-size-m;
|
||||
color: $main-color;
|
||||
}
|
||||
|
||||
.mnemonic-select {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
padding: $padding $padding + $padding / 2;
|
||||
|
||||
.item {
|
||||
background-color: white;
|
||||
line-height: 68rpx;
|
||||
height: 68rpx;
|
||||
width: 68rpx;
|
||||
text-align: center;
|
||||
margin: $margin / 2;
|
||||
border-radius: $radius-m;
|
||||
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
|
||||
}
|
||||
}
|
||||
|
||||
// 助记词
|
||||
.mnemonic {
|
||||
margin: $margin ($margin * 2);
|
||||
border-radius: $radius-m;
|
||||
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
|
||||
background-color: white;
|
||||
padding: $padding;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-start;
|
||||
|
||||
.item {
|
||||
background: rgba($color: $border-color, $alpha: .4);
|
||||
min-width: 58rpx;
|
||||
height: 58rpx;
|
||||
line-height: 58rpx;
|
||||
text-align: center;
|
||||
color: $text-color;
|
||||
margin: $margin / 2;
|
||||
|
||||
&.hide {
|
||||
border: dashed 1px $border-color;
|
||||
box-sizing: border-box;
|
||||
background-color: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 按钮
|
||||
.buttons {
|
||||
padding: $padding $padding * 2;
|
||||
|
||||
.text {
|
||||
text-align: center;
|
||||
margin-bottom: $margin * 2;
|
||||
font-size: $title-size-lg;
|
||||
color: $text-price;
|
||||
}
|
||||
|
||||
button {
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
background-color: $main-color;
|
||||
border-radius: $radius-lg;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
font-size: $title-size;
|
||||
|
||||
&[disabled] {
|
||||
background: rgba($color: $main-color, $alpha: .8);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -53,6 +53,13 @@ class userAuth {
|
||||
}
|
||||
// 预登录
|
||||
Login() {
|
||||
router.push({
|
||||
name: 'Auth'
|
||||
})
|
||||
return
|
||||
|
||||
// 移出一键登录
|
||||
|
||||
//#ifdef H5
|
||||
router.push({
|
||||
name: 'Auth'
|
||||
|
||||
@@ -21,6 +21,20 @@ const router = createRouter({
|
||||
|
||||
//全局路由前置守卫
|
||||
router.beforeEach((to, from, next) => {
|
||||
if(to.name === 'Auth' && store.getters.getToken != '' && uni.getStorageSync('token') != ''){
|
||||
if(store.getters.getIsNew === 0 && uni.getStorageSync('isnew') === 0){
|
||||
next({
|
||||
name: 'Role',
|
||||
NAVTYPE: 'replace'
|
||||
})
|
||||
return
|
||||
}
|
||||
next({
|
||||
name: 'Life',
|
||||
NAVTYPE: 'pushTab'
|
||||
})
|
||||
return
|
||||
}
|
||||
next();
|
||||
});
|
||||
|
||||
|
||||
BIN
static/login/auth_bg.png
Normal file
BIN
static/login/auth_bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.7 MiB |
BIN
static/vip/lv_04.png
Normal file
BIN
static/vip/lv_04.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 166 KiB |
@@ -10,32 +10,33 @@ import Vuex from 'vuex'
|
||||
Vue.use(Vuex)
|
||||
|
||||
export default new Vuex.Store({
|
||||
state: {
|
||||
token: uni.getStorageSync('token') || '',
|
||||
address: {},
|
||||
refresh: 0
|
||||
},
|
||||
getters: {
|
||||
getToken: state => {
|
||||
return state.token
|
||||
},
|
||||
getAddress: state => {
|
||||
return state.address
|
||||
},
|
||||
getRefresh: state => {
|
||||
return state.refresh
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
setToken(state, tokenString) {
|
||||
state.token = tokenString
|
||||
uni.setStorageSync('token', tokenString)
|
||||
},
|
||||
setAddress(state, value) {
|
||||
state.address = value
|
||||
},
|
||||
setRefresh(state, value) {
|
||||
state.refresh = value
|
||||
}
|
||||
}
|
||||
state: {
|
||||
token: uni.getStorageSync('token') || '',
|
||||
address: {},
|
||||
isnew: uni.getStorageSync('isNew') || 0
|
||||
},
|
||||
getters: {
|
||||
getToken: state => {
|
||||
return state.token
|
||||
},
|
||||
getAddress: state => {
|
||||
return state.address
|
||||
},
|
||||
getIsNew: state => {
|
||||
return state.isnew
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
setToken(state, tokenString) {
|
||||
state.token = tokenString
|
||||
uni.setStorageSync('token', tokenString)
|
||||
},
|
||||
setAddress(state, value) {
|
||||
state.address = value
|
||||
},
|
||||
setIsNew(state, isNew) {
|
||||
state.isnew = isNew
|
||||
uni.setStorageSync('isnew', isNew)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,189 +0,0 @@
|
||||
import im from "@/utils/im/index.js"
|
||||
import {
|
||||
contactModel
|
||||
} from '@/utils/im/models.js'
|
||||
|
||||
export default {
|
||||
state: {
|
||||
contacts: {},
|
||||
myInfo: {}
|
||||
},
|
||||
getters: {
|
||||
contacts(state) {
|
||||
return state.contacts
|
||||
},
|
||||
contactInfo: (state) => (targetId) => {
|
||||
if (state.contacts[targetId]) {
|
||||
const info = state.contacts[targetId]
|
||||
|
||||
return {
|
||||
name: info.remark ? info.remark : info.name,
|
||||
hash: info.hash,
|
||||
portraitUrl: info.localAvatar ? info.localAvatar : require('@/static/user/cover.png')
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
name: '',
|
||||
hash: '',
|
||||
portraitUrl: require('@/static/user/cover.png')
|
||||
}
|
||||
}
|
||||
},
|
||||
// 联系人是否存在
|
||||
contactIsExist: (state) => (targetId) => {
|
||||
return Boolean(state.contacts[targetId])
|
||||
},
|
||||
sender(state) {
|
||||
return state.myInfo
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
updateContactInfo(state, contactInfo) {
|
||||
Vue.set(state.contacts, contactInfo.targetId, contactInfo)
|
||||
},
|
||||
// 设置我的资料
|
||||
setSenderInfo(state, contactInfo) {
|
||||
state.myInfo = {
|
||||
userId: contactInfo.targetId,
|
||||
name: contactInfo.name,
|
||||
portraitUrl: contactInfo.portraitUrl
|
||||
}
|
||||
},
|
||||
setContactRemark(state, contactInfo) {
|
||||
Vue.set(state.contacts, contactInfo.targetId, contactInfo)
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
setContactRemark({
|
||||
commit
|
||||
}, {
|
||||
targetId,
|
||||
remark
|
||||
}) {
|
||||
contactModel.find('targetId="' + targetId + '"', (err, result) => {
|
||||
if (!err && result.length > 0) {
|
||||
result[0].remark = remark
|
||||
contactModel.update('targetId="' + targetId + '"', result[0], (err, res) => {
|
||||
commit('setContactRemark', result[0])
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
setSenderInfo({
|
||||
commit,
|
||||
dispatch
|
||||
}, contactInfo) {
|
||||
contactInfo.type = 0 // type 更改为0,标记是我自己
|
||||
dispatch('updateContact', contactInfo)
|
||||
commit('setSenderInfo', contactInfo)
|
||||
},
|
||||
// 载入好友信息
|
||||
launchContact({
|
||||
commit
|
||||
}, data) {
|
||||
commit('updateContactInfo', data)
|
||||
},
|
||||
// 更新好友信息,这个时候要校验hash值了
|
||||
updateContact({
|
||||
commit,
|
||||
dispatch
|
||||
}, contactInfo) {
|
||||
contactModel.find('targetId="' + contactInfo.targetId + '"', (err, result) => {
|
||||
if (result.length == 0) {
|
||||
// 没有数据,直接新增一条
|
||||
dispatch('initContact', contactInfo)
|
||||
} else if (contactInfo.hash != result[0].hash) {
|
||||
if (contactInfo.portraitUrl && contactInfo.portraitUrl != result[0].portraitUrl) {
|
||||
saveAvatar(contactInfo, (savedFilePath) => {
|
||||
const info = {
|
||||
targetId: contactInfo.targetId,
|
||||
name: contactInfo.name,
|
||||
hash: contactInfo.hash,
|
||||
type: contactInfo.type,
|
||||
portraitUrl: contactInfo.portraitUrl,
|
||||
localAvatar: savedFilePath
|
||||
}
|
||||
contactModel.update('targetId="' + contactInfo.targetId + '"', info, (err,
|
||||
res) => {
|
||||
console.log('UPDATE AVATAR, ERR', err, info)
|
||||
})
|
||||
commit('updateContactInfo', info)
|
||||
})
|
||||
} else {
|
||||
const info = {
|
||||
targetId: contactInfo.targetId,
|
||||
name: contactInfo.name,
|
||||
hash: contactInfo.hash,
|
||||
type: contactInfo.type,
|
||||
portraitUrl: contactInfo.portraitUrl,
|
||||
localAvatar: result[0].localAvatar
|
||||
}
|
||||
contactModel.update('targetId="' + contactInfo.targetId + '"', info, (err, res) => {
|
||||
console.log('UPDATE NAME, ERR', err, info);
|
||||
})
|
||||
commit('updateContactInfo', info)
|
||||
}
|
||||
} else {
|
||||
console.log('updateContact, 无操作')
|
||||
}
|
||||
})
|
||||
},
|
||||
// 初始化好友信息
|
||||
initContact({
|
||||
commit
|
||||
}, contactInfo) {
|
||||
// 将好友信息保存到vuex的内存中,方便立即使用
|
||||
commit('updateContactInfo', contactInfo)
|
||||
// 用户头像,是否需要下载到本地
|
||||
if (contactInfo.portraitUrl) {
|
||||
saveAvatar(contactInfo, (savedFilePath) => {
|
||||
const info = {
|
||||
targetId: contactInfo.targetId,
|
||||
name: contactInfo.name,
|
||||
hash: contactInfo.hash,
|
||||
type: contactInfo.type,
|
||||
portraitUrl: contactInfo.portraitUrl,
|
||||
localAvatar: savedFilePath
|
||||
}
|
||||
contactModel.insert(info, (err, res) => {
|
||||
console.error('保存头像', err, res)
|
||||
})
|
||||
// 保存头像后,更新信息
|
||||
commit('updateContactInfo', info)
|
||||
})
|
||||
} else {
|
||||
// 直接将信息,写入数据库
|
||||
const info = {
|
||||
targetId: contactInfo.targetId,
|
||||
name: contactInfo.name,
|
||||
hash: contactInfo.hash,
|
||||
type: contactInfo.type,
|
||||
portraitUrl: contactInfo.portraitUrl,
|
||||
localAvatar: ''
|
||||
}
|
||||
contactModel.insert(info, (err, res) => {
|
||||
console.error('没保存头像', err, res)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const saveAvatar = (contactInfo, callback) => {
|
||||
uni.downloadFile({
|
||||
url: contactInfo.portraitUrl,
|
||||
success: ({
|
||||
tempFilePath
|
||||
}) => {
|
||||
uni.saveFile({
|
||||
tempFilePath: tempFilePath,
|
||||
success: ({
|
||||
savedFilePath
|
||||
}) => {
|
||||
callback(savedFilePath)
|
||||
}
|
||||
})
|
||||
},
|
||||
fail: (err) => {}
|
||||
})
|
||||
}
|
||||
2
unpackage/dist/dev/app-plus/__uniappscan.js
vendored
2
unpackage/dist/dev/app-plus/__uniappscan.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,8 +1,8 @@
|
||||
|
||||
var isReady=false;var onReadyCallbacks=[];
|
||||
var isServiceReady=false;var onServiceReadyCallbacks=[];
|
||||
var __uniConfig = {"pages":["pages/life/life","pages/store/index","pages/user/index","pages/setting/setting","pages/auth/auth","pages/auth/role","pages/store/goods","pages/store/buy","pages/order/index","pages/order/details","pages/address/index","pages/address/edit","pages/pay/pay","pages/store/list","pages/store/meals","pages/sign/index","pages/notice/index","pages/notice/list","pages/notice/details","pages/wallet/add","pages/wallet/create","pages/wallet/mnemonic","pages/wallet/validation","pages/wallet/property","pages/wallet/privatekey","pages/wallet/resetPassword","pages/store/search","pages/store/shop/shopDetail","pages/store/shop/shopList"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"ZH健康","navigationBarBackgroundColor":"#F3F6FB","backgroundColorTop":"#F3F6FB","backgroundColorBottom":"#F3F6FB"},"tabBar":{"borderStyle":"white","selectedColor":"#34CE98","list":[{"iconPath":"static/tabBar/tabBar_02.png","selectedIconPath":"static/tabBar/tabBar_show_02.png","pagePath":"pages/life/life","text":"共力人生"},{"iconPath":"static/tabBar/tabBar_02.png","selectedIconPath":"static/tabBar/tabBar_show_02.png","pagePath":"pages/store/index","text":"DT商城"},{"iconPath":"static/tabBar/tabBar_03.png","selectedIconPath":"static/tabBar/tabBar_show_03.png","pagePath":"pages/user/index","text":"我的"}]},"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"ZH-HEALTH","compilerVersion":"3.3.11","entryPagePath":"pages/life/life","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
|
||||
var __uniRoutes = [{"path":"/pages/life/life","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"共力人生","navigationStyle":"custom"}},{"path":"/pages/store/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"DT商城","enablePullDownRefresh":true,"titleNView":{"backgroundColor":"#FFFFFF","buttons":[{"float":"right","text":"","fontSrc":"/static/iconfont.ttf","color":"#000","fontSize":"20px"}]}}},{"path":"/pages/user/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"我的","navigationStyle":"custom"}},{"path":"/pages/setting/setting","meta":{},"window":{"navigationBarTitleText":"设置中心","navigationBarBackgroundColor":"#34CE98","navigationBarTextStyle":"white"}},{"path":"/pages/auth/auth","meta":{},"window":{"navigationBarTitleText":"登录","navigationStyle":"custom"}},{"path":"/pages/auth/role","meta":{},"window":{"navigationBarTitleText":"角色创建","navigationBarBackgroundColor":"#FFF","titleNView":{"buttons":[{"text":"退出登录","fontSize":"14","width":"80px","color":"#fdbc01"}]}}},{"path":"/pages/store/goods","meta":{},"window":{"navigationStyle":"custom","navigationBarTitleText":"详情","titleNView":{"backgroundColor":"#FFFFFF","type":"transparent"}}},{"path":"/pages/store/buy","meta":{},"window":{"navigationBarTitleText":"确认订单","enablePullDownRefresh":false}},{"path":"/pages/order/index","meta":{},"window":{"navigationBarTitleText":"订单","navigationBarBackgroundColor":"#FFFFFF","enablePullDownRefresh":false}},{"path":"/pages/order/details","meta":{},"window":{"navigationBarTitleText":"订单详情","enablePullDownRefresh":false}},{"path":"/pages/address/index","meta":{},"window":{"navigationBarTitleText":"收货地址"}},{"path":"/pages/address/edit","meta":{},"window":{"navigationBarTitleText":"编辑","enablePullDownRefresh":false}},{"path":"/pages/pay/pay","meta":{},"window":{"navigationBarTitleText":"收银台","navigationBarBackgroundColor":"#FFFFFF"}},{"path":"/pages/store/list","meta":{},"window":{"navigationBarTitleText":"商品","navigationBarBackgroundColor":"#FFFFFF","enablePullDownRefresh":true}},{"path":"/pages/store/meals","meta":{},"window":{"navigationBarTitleText":"套餐","navigationBarBackgroundColor":"#FFFFFF","enablePullDownRefresh":true}},{"path":"/pages/sign/index","meta":{},"window":{"navigationBarTitleText":"每日打卡","navigationBarBackgroundColor":"#FFFFFF"}},{"path":"/pages/notice/index","meta":{},"window":{"navigationBarTitleText":"消息","navigationBarBackgroundColor":"#FFFFFF"}},{"path":"/pages/notice/list","meta":{},"window":{"navigationBarTitleText":"消息","navigationBarBackgroundColor":"#FFFFFF"}},{"path":"/pages/notice/details","meta":{},"window":{"navigationBarTitleText":"消息","navigationBarBackgroundColor":"#FFFFFF"}},{"path":"/pages/wallet/add","meta":{},"window":{"navigationBarTitleText":"创建钱包","navigationBarBackgroundColor":"#FFFFFF","enablePullDownRefresh":false}},{"path":"/pages/wallet/create","meta":{},"window":{"navigationBarTitleText":"设置密码","navigationBarBackgroundColor":"#FFFFFF","enablePullDownRefresh":false}},{"path":"/pages/wallet/mnemonic","meta":{},"window":{"navigationBarTitleText":"导出助记词","navigationBarBackgroundColor":"#FFFFFF","enablePullDownRefresh":false}},{"path":"/pages/wallet/validation","meta":{},"window":{"navigationBarTitleText":"验证助记词","navigationBarBackgroundColor":"#FFFFFF","enablePullDownRefresh":false}},{"path":"/pages/wallet/property","meta":{},"window":{"navigationBarTitleText":"ZH钱包","navigationBarTextStyle":"white","titleNView":{"backgroundImage":"linear-gradient(to right, #34ce98, #22aa98)","type":"transparent","buttons":[{"float":"right","text":"","fontSrc":"/static/iconfont.ttf","color":"#FFF","fontSize":"20px","background":"rgba(0,0,0,0)"}],"backButton":{"background":"rgba(0,0,0,0)"}}}},{"path":"/pages/wallet/privatekey","meta":{},"window":{"navigationBarTitleText":"钱包私钥","navigationBarBackgroundColor":"#FFFFFF","enablePullDownRefresh":false}},{"path":"/pages/wallet/resetPassword","meta":{},"window":{"navigationBarTitleText":"修改钱包密码","navigationBarBackgroundColor":"#FFFFFF","enablePullDownRefresh":false}},{"path":"/pages/store/search","meta":{},"window":{"navigationBarTitleText":"搜索","navigationBarBackgroundColor":"#FFFFFF"}},{"path":"/pages/store/shop/shopDetail","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/store/shop/shopList","meta":{},"window":{"navigationBarTitleText":"更多店铺","navigationBarBackgroundColor":"#FFFFFF","enablePullDownRefresh":true}}];
|
||||
var __uniConfig = {"pages":["pages/auth/auth","pages/auth/role","pages/life/life","pages/store/index","pages/user/index","pages/setting/setting","pages/store/goods","pages/store/buy","pages/order/index","pages/order/details","pages/address/index","pages/address/edit","pages/pay/pay","pages/store/list","pages/store/meals","pages/store/search","pages/refund/index","pages/account/integral","pages/account/dt","pages/account/recharge","pages/vip/vip","pages/vip/agreement","pages/store/shop/shopDetail","pages/store/shop/shopList"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"ZH健康","navigationBarBackgroundColor":"#F3F6FB","backgroundColorTop":"#F3F6FB","backgroundColorBottom":"#F3F6FB"},"tabBar":{"borderStyle":"white","selectedColor":"#34CE98","list":[{"iconPath":"static/tabBar/tabBar_02.png","selectedIconPath":"static/tabBar/tabBar_show_02.png","pagePath":"pages/life/life","text":"共力人生"},{"iconPath":"static/tabBar/tabBar_02.png","selectedIconPath":"static/tabBar/tabBar_show_02.png","pagePath":"pages/store/index","text":"DT商城"},{"iconPath":"static/tabBar/tabBar_03.png","selectedIconPath":"static/tabBar/tabBar_show_03.png","pagePath":"pages/user/index","text":"我的"}]},"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"ZH-HEALTH","compilerVersion":"3.3.11","entryPagePath":"pages/auth/auth","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
|
||||
var __uniRoutes = [{"path":"/pages/auth/auth","meta":{"isQuit":true},"window":{"navigationBarTitleText":"登录","navigationStyle":"custom"}},{"path":"/pages/auth/role","meta":{},"window":{"navigationBarTitleText":"角色创建","navigationBarBackgroundColor":"#FFF","titleNView":{"buttons":[{"text":"退出登录","fontSize":"14","width":"80px","color":"#34CE98"}]}}},{"path":"/pages/life/life","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"共力人生","navigationStyle":"custom"}},{"path":"/pages/store/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"DT商城","enablePullDownRefresh":true,"titleNView":{"backgroundColor":"#FFFFFF","buttons":[{"float":"right","text":"","fontSrc":"/static/iconfont.ttf","color":"#000","fontSize":"20px"}]}}},{"path":"/pages/user/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"我的","navigationStyle":"custom"}},{"path":"/pages/setting/setting","meta":{},"window":{"navigationBarTitleText":"设置中心","navigationBarBackgroundColor":"#34CE98","navigationBarTextStyle":"white"}},{"path":"/pages/store/goods","meta":{},"window":{"navigationStyle":"custom","navigationBarTitleText":"详情","titleNView":{"backgroundColor":"#FFFFFF","type":"transparent"}}},{"path":"/pages/store/buy","meta":{},"window":{"navigationBarTitleText":"确认订单","enablePullDownRefresh":false}},{"path":"/pages/order/index","meta":{},"window":{"navigationBarTitleText":"订单","navigationBarBackgroundColor":"#FFFFFF","enablePullDownRefresh":false}},{"path":"/pages/order/details","meta":{},"window":{"navigationBarTitleText":"订单详情","enablePullDownRefresh":false}},{"path":"/pages/address/index","meta":{},"window":{"navigationBarTitleText":"收货地址"}},{"path":"/pages/address/edit","meta":{},"window":{"navigationBarTitleText":"编辑","enablePullDownRefresh":false}},{"path":"/pages/pay/pay","meta":{},"window":{"navigationBarTitleText":"收银台","navigationBarBackgroundColor":"#FFFFFF"}},{"path":"/pages/store/list","meta":{},"window":{"navigationBarTitleText":"商品","navigationBarBackgroundColor":"#FFFFFF","enablePullDownRefresh":true}},{"path":"/pages/store/meals","meta":{},"window":{"navigationBarTitleText":"套餐","navigationBarBackgroundColor":"#FFFFFF","enablePullDownRefresh":true}},{"path":"/pages/store/search","meta":{},"window":{"navigationBarTitleText":"搜索","navigationBarBackgroundColor":"#FFFFFF"}},{"path":"/pages/refund/index","meta":{},"window":{"navigationBarTitleText":"退换货","navigationBarBackgroundColor":"#FFFFFF"}},{"path":"/pages/account/integral","meta":{},"window":{"navigationBarTitleText":"共力值","navigationBarBackgroundColor":"#34CE98","navigationBarTextStyle":"white"}},{"path":"/pages/account/dt","meta":{},"window":{"navigationBarTitleText":"DT积分","navigationBarBackgroundColor":"#34CE98","backgroundColorTop":"#34CE98","navigationBarTextStyle":"white","titleNView":{"buttons":[{"text":"充值","width":"60","fontSize":"14","fontWeight":"bold"}]}}},{"path":"/pages/account/recharge","meta":{},"window":{"navigationBarTitleText":"DT积分充值","navigationBarBackgroundColor":"#FFFFFF"}},{"path":"/pages/vip/vip","meta":{},"window":{"navigationBarTitleText":"共力会员","navigationBarBackgroundColor":"#242430","navigationBarTextStyle":"white","backgroundColorTop":"#242430"}},{"path":"/pages/vip/agreement","meta":{},"window":{"navigationBarTitleText":"共力会员协议"}},{"path":"/pages/store/shop/shopDetail","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/store/shop/shopList","meta":{},"window":{"navigationBarTitleText":"更多店铺","navigationBarBackgroundColor":"#FFFFFF","enablePullDownRefresh":true}}];
|
||||
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
|
||||
__uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
|
||||
service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:void 0,window:void 0,document:void 0,frames:void 0,self:void 0,location:void 0,navigator:void 0,localStorage:void 0,history:void 0,Caches:void 0,screen:void 0,alert:void 0,confirm:void 0,prompt:void 0,fetch:void 0,XMLHttpRequest:void 0,WebSocket:void 0,webkit:void 0,print:void 0}}}});
|
||||
|
||||
5510
unpackage/dist/dev/app-plus/app-service.js
vendored
5510
unpackage/dist/dev/app-plus/app-service.js
vendored
File diff suppressed because one or more lines are too long
6503
unpackage/dist/dev/app-plus/app-view.js
vendored
6503
unpackage/dist/dev/app-plus/app-view.js
vendored
File diff suppressed because one or more lines are too long
2
unpackage/dist/dev/app-plus/manifest.json
vendored
2
unpackage/dist/dev/app-plus/manifest.json
vendored
File diff suppressed because one or more lines are too long
BIN
unpackage/dist/dev/app-plus/static/login/auth_bg.png
vendored
Normal file
BIN
unpackage/dist/dev/app-plus/static/login/auth_bg.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.7 MiB |
BIN
unpackage/dist/dev/app-plus/static/vip/lv_04.png
vendored
Normal file
BIN
unpackage/dist/dev/app-plus/static/vip/lv_04.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 166 KiB |
4
unpackage/dist/dev/app-plus/view.css
vendored
4
unpackage/dist/dev/app-plus/view.css
vendored
File diff suppressed because one or more lines are too long
8
unpackage/dist/dev/app-plus/view.umd.min.js
vendored
8
unpackage/dist/dev/app-plus/view.umd.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user