first commit
2
滴滴淘/h5(1)/.browserslistrc
Normal file
@@ -0,0 +1,2 @@
|
||||
> 1%
|
||||
last 2 versions
|
||||
7
滴滴淘/h5(1)/.editorconfig
Normal file
@@ -0,0 +1,7 @@
|
||||
[*.{js,jsx,ts,tsx,vue}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
max_line_length = 100
|
||||
18
滴滴淘/h5(1)/.eslintrc.js
Normal file
@@ -0,0 +1,18 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
env: {
|
||||
node: true,
|
||||
},
|
||||
extends: [
|
||||
'plugin:vue/essential',
|
||||
'@vue/airbnb',
|
||||
'@vue/typescript',
|
||||
],
|
||||
rules: {
|
||||
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
||||
},
|
||||
parserOptions: {
|
||||
parser: '@typescript-eslint/parser',
|
||||
},
|
||||
};
|
||||
1
滴滴淘/h5(1)/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
12382fda-f47f-4ccc-9505-3e874bd338eb
|
||||
20
滴滴淘/h5(1)/README.md
Normal file
@@ -0,0 +1,20 @@
|
||||
### 1:安装依赖
|
||||
|
||||
---
|
||||
|
||||
```
|
||||
$ npm install
|
||||
or
|
||||
$ cnpm install
|
||||
or
|
||||
$ yarn install
|
||||
```
|
||||
|
||||
### 2:运行项目
|
||||
|
||||
---
|
||||
|
||||
1:开发阶段运行:
|
||||
```
|
||||
npm run serve
|
||||
```
|
||||
5
滴滴淘/h5(1)/babel.config.js
Normal file
@@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
presets: [
|
||||
'@vue/cli-plugin-babel/preset',
|
||||
],
|
||||
};
|
||||
13904
滴滴淘/h5(1)/package-lock.json
generated
Normal file
57
滴滴淘/h5(1)/package.json
Normal file
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"name": "share",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "set NODE_ENV=dev && vue-cli-service serve",
|
||||
"build": "set NODE_ENV=production && vue-cli-service build",
|
||||
"lint": "vue-cli-service lint",
|
||||
"dist": "serve dist",
|
||||
"analyz": "npm_config_report=true npm run build"
|
||||
},
|
||||
"dependencies": {
|
||||
"amfe-flexible": "^2.2.1",
|
||||
"axios": "^0.19.0",
|
||||
"core-js": "^3.3.2",
|
||||
"vant": "^2.5.3",
|
||||
"vue": "^2.6.10",
|
||||
"vue-class-component": "^7.0.2",
|
||||
"vue-property-decorator": "^8.3.0",
|
||||
"vue-router": "^3.1.3",
|
||||
"vuex": "^3.1.2",
|
||||
"vuex-class": "^0.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^12.12.7",
|
||||
"@vue/cli-plugin-babel": "^4.0.0",
|
||||
"@vue/cli-plugin-eslint": "^4.0.0",
|
||||
"@vue/cli-plugin-router": "^4.0.0",
|
||||
"@vue/cli-plugin-typescript": "^4.0.0",
|
||||
"@vue/cli-service": "^4.0.0",
|
||||
"@vue/eslint-config-airbnb": "^4.0.0",
|
||||
"@vue/eslint-config-typescript": "^4.0.0",
|
||||
"autoprefixer": "^9.7.1",
|
||||
"compression-webpack-plugin": "^3.0.0",
|
||||
"css-loader": "^3.2.0",
|
||||
"eslint": "^5.16.0",
|
||||
"eslint-plugin-vue": "^5.0.0",
|
||||
"postcss-pxtorem": "^4.0.1",
|
||||
"pug": "^2.0.4",
|
||||
"pug-html-loader": "^1.1.5",
|
||||
"pug-plain-loader": "^1.0.0",
|
||||
"serve": "^11.2.0",
|
||||
"style-resources-loader": "^1.2.1",
|
||||
"stylus": "^0.54.7",
|
||||
"stylus-loader": "^3.0.2",
|
||||
"timeago.js": "^4.0.2",
|
||||
"typescript": "~3.5.3",
|
||||
"uglifyjs-webpack-plugin": "^1.1.1",
|
||||
"vue-class-component": "^7.1.0",
|
||||
"vue-loader": "^15.7.2",
|
||||
"vue-server-renderer": "^2.6.10",
|
||||
"vue-style-loader": "^4.1.2",
|
||||
"vue-template-compiler": "^2.6.10",
|
||||
"webpack-bundle-analyzer": "^3.6.0",
|
||||
"webpack-node-externals": "^1.7.2"
|
||||
}
|
||||
}
|
||||
17
滴滴淘/h5(1)/postcss.config.js
Normal file
@@ -0,0 +1,17 @@
|
||||
module.exports = {
|
||||
plugins: {
|
||||
autoprefixer: {
|
||||
overrideBrowserslist: [
|
||||
'Android 4.1',
|
||||
'iOS 7.1',
|
||||
'Chrome > 31',
|
||||
'ff > 31',
|
||||
'ie >= 8',
|
||||
],
|
||||
},
|
||||
'postcss-pxtorem': {
|
||||
rootValue: 37.5,
|
||||
propList: ['*'],
|
||||
},
|
||||
},
|
||||
};
|
||||
1
滴滴淘/h5(1)/public/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
f1534e19-6add-450a-870f-7d2da7e4cf6a
|
||||
1
滴滴淘/h5(1)/public/css/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
34da5be0-e106-45ff-94fc-78ad05676319
|
||||
156
滴滴淘/h5(1)/public/css/font.css
Normal file
1
滴滴淘/h5(1)/public/image/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
a5defd90-da37-45cc-979a-a30b63383bae
|
||||
BIN
滴滴淘/h5(1)/public/image/favicon.ico
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
滴滴淘/h5(1)/public/image/logo.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
滴滴淘/h5(1)/public/image/nan.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
滴滴淘/h5(1)/public/image/nv.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
滴滴淘/h5(1)/public/image/task_info.png
Normal file
|
After Width: | Height: | Size: 68 KiB |
BIN
滴滴淘/h5(1)/public/image/task_list_right.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
滴滴淘/h5(1)/public/image/unknown.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
滴滴淘/h5(1)/public/image/user_av.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
滴滴淘/h5(1)/public/image/user_head.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
32
滴滴淘/h5(1)/public/index.html
Normal file
@@ -0,0 +1,32 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="description" content="买家端 马上赚"/>
|
||||
<meta name="apple-mobile-web-app-title" content="买家端 马上赚">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes"/>
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="#ee0a24"/>
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="Cache-Control" content="no-siteapp"/>
|
||||
<meta name="HandheldFriendly" content="true">
|
||||
<meta name="screen-orientation" content="portrait">
|
||||
<meta name="x5-orientation" content="portrait">
|
||||
<meta name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<!-- <link rel="stylesheet" href="https://cdn.bootcss.com/normalize/8.0.1/normalize.min.css"> -->
|
||||
<!-- <link rel="stylesheet" href="https://at.alicdn.com/t/font_1629634_cc9827trxzn.css"> -->
|
||||
<link rel="stylesheet" href="./css/font.css">
|
||||
<title>买家端 马上赚</title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
<strong>We're sorry but share doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
||||
</noscript>
|
||||
<div id="app">
|
||||
<!--vue-ssr-outlet-->
|
||||
</div>
|
||||
<!-- built files will be auto injected -->
|
||||
</body>
|
||||
</html>
|
||||
1
滴滴淘/h5(1)/src/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
c35788ee-4086-4903-bbc9-e93917bdd48d
|
||||
1
滴滴淘/h5(1)/src/core/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
fa1cac3b-74e7-40ce-92f2-991ec64862dd
|
||||
7
滴滴淘/h5(1)/src/core/class-component-hooks.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import Component from 'vue-class-component';
|
||||
|
||||
Component.registerHooks([
|
||||
'beforeRouteEnter',
|
||||
'beforeRouteLeave',
|
||||
'beforeRouteUpdate'
|
||||
])
|
||||
1
滴滴淘/h5(1)/src/core/config/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
7c4a4e64-72aa-49d8-ab93-234dd6ba1b4a
|
||||
277
滴滴淘/h5(1)/src/core/config/index.ts
Normal file
@@ -0,0 +1,277 @@
|
||||
import VueRouter from 'vue-router';
|
||||
|
||||
// vue 插件配置
|
||||
import 'amfe-flexible/index.js';
|
||||
import Vant from 'vant';
|
||||
import 'vant/lib/index.css';
|
||||
|
||||
// 自定义的非vue插件
|
||||
import Service from "../service/imports";
|
||||
import {Utils} from '../utils';
|
||||
|
||||
// 消息提示文字js
|
||||
// const Message = window.Message
|
||||
|
||||
export class config {
|
||||
/**
|
||||
* 接口配置,测试环境,正式环境,具体接口
|
||||
*/
|
||||
public static AjaxConfig: any = {
|
||||
DevUrl: 'http://new.gddh999.com/',
|
||||
ProdUrl: 'http://api.alkid888.com/',
|
||||
WsDevUrl: 'ws://118.25.189.247:2345',
|
||||
WsProdUrl: 'ws://ws.alkid888.com:2345',
|
||||
ApiList: {
|
||||
reg: '/index/reg/index', //注册买家
|
||||
login: '/index/login/index', //登录买家
|
||||
captcha: '/api/Sms/captcha', //注册验证码
|
||||
getvantcity: '/api/address/getvantcity', //省市区地址接口
|
||||
accountlist: '/index/index/accountAndAddressInfo', //买号列表
|
||||
accountTagInfo: '/index/buyer_accounts/accountTagInfo', //添加买号标签
|
||||
saveaccount: '/index/buyer_accounts/saveaccount', //买号添加
|
||||
modifyAccount: '/index/buyer_accounts/modifyAccount', //审核未通过修改买号
|
||||
uploadImg: '/index/api/upload', //买家图片上传
|
||||
referMoney: '/index/index/referMoney', //我的页面推广的资金
|
||||
financeInfo: '/index/index/financeInfo', //我的页面账户余额
|
||||
memberInfo: '/index/index/memberInfo', //我的页面用户信息
|
||||
saveAccountAddress: '/index/buyer_accounts/saveAccountAddress', //账号地址修改
|
||||
accountListByPlatform: '/index/buyer_accounts/accountInfoById', //查询买号详情
|
||||
cashout: '/index/finance/cashout', // 提现操作
|
||||
saveidcard: '/index/authentication/saveidcard', //实名认证添加修改
|
||||
banklist: '/index/authentication/banklist', //銀行列表
|
||||
idCardBankInfo: '/index/authentication/idCardBankInfo', //实名认证信息渲染
|
||||
getTaskAccount: '/index/Task/getTaskAccount', // 获取接单账号列表
|
||||
getTaskList: '/index/task/tasklist', //任务列表
|
||||
orderTask: 'index/Task/orderTask',
|
||||
commitTask: 'index/Task/commitTask',
|
||||
announceInfoById: 'index/index/announceInfoById', //公告详细内容
|
||||
announceList: 'index/index/announceList', //公告列表,
|
||||
messageList: 'index/message/messageList', // 消息列表
|
||||
taskDetail: '/index/Task/taskDetail', //任务详情
|
||||
setComparePrice: '/index/Task/setComparePrice', //确认货比信息
|
||||
verifyShop: '/index/Task/verifyShop', //验证店铺
|
||||
purchaseDone: '/index/Task/purchaseDone', //选购完成
|
||||
buyerOrder: '/index/Task/buyerOrder', //买家下单/付款
|
||||
confirmAccept: '/index/Task/confirmAccept', //买家确认收货
|
||||
financelist: '/index/finance/financelist', //资金列表
|
||||
commissionList: '/index/finance/commissionList', //佣金列表
|
||||
cashlist: '/index/cash_out/cashlist', //提现列表
|
||||
getMemberInfo: '/index/member/getMemberInfo', //获取用户信息
|
||||
forget: '/index/login/forget',
|
||||
referinfo: '/index/refer/referinfo', //推广信息
|
||||
index: '/index/index/index', //首页基础信息
|
||||
cancelTask: '/index/Task/cancelTask', //取消任务
|
||||
nextStep: '/index/Task/nextStep', //任务进入下一步
|
||||
setTaskTag: '/index/Task/setTaskTag', //任务打标
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* 需要控制未登录跳转的路由
|
||||
*/
|
||||
public static isRouter: Array<string> = ['/']
|
||||
|
||||
/**
|
||||
* 浏览器本地缓存的前缀
|
||||
*/
|
||||
public static prefix: string = 'h5_'
|
||||
|
||||
/**
|
||||
* 需要被挂载的节点
|
||||
*/
|
||||
public static mountElement: string = '#app';
|
||||
|
||||
/**
|
||||
* 非Vue插件
|
||||
*/
|
||||
public static NotVuePlugs: Array<Object> = [
|
||||
{n: '$http', f: Service},
|
||||
{n: '$utils', f: Utils},
|
||||
{n: '$config', f: config}
|
||||
];
|
||||
|
||||
/**
|
||||
* Vue插件
|
||||
*/
|
||||
public static VuePlugs: Array<any> = [VueRouter, Vant];
|
||||
|
||||
/**
|
||||
* Vue-router 配置
|
||||
*/
|
||||
public static RouterConfigUrl: Object = {
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
name: 'index',
|
||||
component: Utils.AsyncComponentHook("subject/subject"),
|
||||
redirect: {
|
||||
name: 'home'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'home',
|
||||
name: 'home',
|
||||
component: Utils.AsyncComponentHook("subject/index"),
|
||||
meta: {
|
||||
title: '首页',
|
||||
alive: false
|
||||
}
|
||||
},{
|
||||
path: 'task',
|
||||
name: 'task',
|
||||
component: Utils.AsyncComponentHook("subject/Task"),
|
||||
meta: {
|
||||
title: '任务',
|
||||
alive: false
|
||||
}
|
||||
},{
|
||||
path: 'news',
|
||||
name: 'news',
|
||||
component: Utils.AsyncComponentHook("subject/News"),
|
||||
meta: {
|
||||
title: '消息',
|
||||
alive: false
|
||||
}
|
||||
},{
|
||||
path: 'my',
|
||||
name: 'my',
|
||||
component: Utils.AsyncComponentHook("subject/My"),
|
||||
meta: {
|
||||
title: '我的',
|
||||
alive: false
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/taskInfo',
|
||||
name: 'taskinfo',
|
||||
component: Utils.AsyncComponentHook("TaskInfo"),
|
||||
meta: {
|
||||
title: '任务详情'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/taskHall',
|
||||
name: 'taskhall',
|
||||
component: Utils.AsyncComponentHook("TaskHall"),
|
||||
meta: {
|
||||
title: '任务大厅'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/login',
|
||||
name: '登录',
|
||||
component: Utils.AsyncComponentHook("Login"),
|
||||
meta: {
|
||||
title: '登录'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/register',
|
||||
name: 'register',
|
||||
component: Utils.AsyncComponentHook("Register"),
|
||||
meta: {
|
||||
title: '注册'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/fund',
|
||||
name: 'fund',
|
||||
component: Utils.AsyncComponentHook("Fund"),
|
||||
meta: {
|
||||
title: '资金管理'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/collection',
|
||||
name: 'collection',
|
||||
component: Utils.AsyncComponentHook("CollectionRecords"),
|
||||
meta: {
|
||||
title: '佣金记录'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/feedback',
|
||||
name: 'feedback',
|
||||
component: Utils.AsyncComponentHook("Feedback"),
|
||||
meta: {
|
||||
title: '意见反馈'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/extension',
|
||||
name: 'extension',
|
||||
component: Utils.AsyncComponentHook("Extension"),
|
||||
meta: {
|
||||
title: '推广赚钱'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/addAccount',
|
||||
name: 'addAccount',
|
||||
component: Utils.AsyncComponentHook("AddAccount"),
|
||||
meta: {
|
||||
title: '添加买号'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/authentication',
|
||||
name: 'authentication',
|
||||
component: Utils.AsyncComponentHook("Authentication"),
|
||||
meta: {
|
||||
title: '买号认证'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/modifyAddress',
|
||||
name: 'modifyAddress',
|
||||
component: Utils.AsyncComponentHook("ModifyAddress"),
|
||||
meta: {
|
||||
title: '修改地址'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/realName',
|
||||
name: 'realName',
|
||||
component: Utils.AsyncComponentHook("RealName"),
|
||||
meta: {
|
||||
title: '实名认证'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/forget',
|
||||
name: 'forget',
|
||||
component: Utils.AsyncComponentHook("Forget"),
|
||||
meta: {
|
||||
title: '修改密码'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/cashwithdrawal',
|
||||
name: 'cashwithdrawal',
|
||||
component: Utils.AsyncComponentHook("Cashwithdrawal"),
|
||||
meta: {
|
||||
title: '提现记录'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/principalRecord',
|
||||
name: 'principalRecord',
|
||||
component: Utils.AsyncComponentHook("PrincipalRecord"),
|
||||
meta: {
|
||||
title: '本金记录'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/noticeInfo',
|
||||
name: 'noticeInfo',
|
||||
component: Utils.AsyncComponentHook("NoticeInfo"),
|
||||
meta: {
|
||||
title: '公告详细内容'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
}
|
||||
1
滴滴淘/h5(1)/src/core/dao/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
0c33df44-42a1-4d79-9e5f-cb1363eaaf83
|
||||
152
滴滴淘/h5(1)/src/core/dao/index.ts
Normal file
@@ -0,0 +1,152 @@
|
||||
import {Utils} from '../utils';
|
||||
import axios, {AxiosInstance} from 'axios';
|
||||
import {Dialog, Toast} from 'vant';
|
||||
|
||||
export class Axios {
|
||||
private instance: AxiosInstance;
|
||||
private Utils: Utils = new Utils()
|
||||
|
||||
// @ts-ignore
|
||||
public async constructor() {
|
||||
this.instance = axios.create({
|
||||
baseURL: Utils.CheckAjaxUrl(),
|
||||
timeout: 3000
|
||||
});
|
||||
this.ResponseInterceptor();
|
||||
this.RequestInterceptor();
|
||||
console.log(Utils.CheckAjaxUrl());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get 请求
|
||||
* 请求参数请参考接口:RequestParams
|
||||
* @param params
|
||||
*/
|
||||
public async get(params: { url: string, data: Object }): Promise<Object> {
|
||||
try {
|
||||
return await this.instance.get(params.url, {params: params.data})
|
||||
} catch (e) {
|
||||
return e.message
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Post 请求
|
||||
* 请求参数请参考接口:RequestParams
|
||||
* @param params
|
||||
*/
|
||||
public async post(params: { url: string, data: Object, header?: Object }): Promise<Object> {
|
||||
try {
|
||||
return await this.instance.post(params.url, params.data, {
|
||||
headers: Object.assign({}, params.header)
|
||||
})
|
||||
} catch (e) {
|
||||
return e.message
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Put 请求
|
||||
* 请求参数请参考接口:RequestParams
|
||||
* @param params
|
||||
*/
|
||||
public async put(params: { url: string, data: Object }): Promise<Object> {
|
||||
try {
|
||||
return await this.instance.put(params.url, params.data)
|
||||
} catch (e) {
|
||||
return e.message
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* delete 请求
|
||||
* 请求参数请参考接口:RequestParams
|
||||
* @param params
|
||||
*/
|
||||
public async delete(params: { url: string, data: Object }): Promise<Object> {
|
||||
try {
|
||||
return await this.instance.delete(params.url, {params: params.data})
|
||||
} catch (e) {
|
||||
return e.message
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加响应拦截器
|
||||
* @constructor
|
||||
*/
|
||||
public async ResponseInterceptor(): Promise<any> {
|
||||
this.instance.interceptors.response.use( async response => {
|
||||
this.CloseLoadingData();
|
||||
switch (response.data.code) {
|
||||
case 0:
|
||||
switch (response.data.status) {
|
||||
case 1:
|
||||
if(response.data.data !== null && response.data.data !== void 0){
|
||||
return response.data.data;
|
||||
}else{
|
||||
Toast(response.data.msg)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
await Dialog.alert({
|
||||
message: `[${response.data.status}]${response.data.msg}`
|
||||
})
|
||||
return -1
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 1001:
|
||||
Dialog.alert({
|
||||
message: response.data.msg
|
||||
}).then(() => {
|
||||
this.Utils.delStorage('access_token')
|
||||
window.location.href = `${window.location.origin}${window.location.pathname}#/login`
|
||||
});
|
||||
break;
|
||||
default:
|
||||
alert(`[${response.data.code}]${response.data.msg}`)
|
||||
break;
|
||||
}
|
||||
}, function (error) {
|
||||
return Promise.reject(error)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加请求拦截器
|
||||
* @constructor
|
||||
*/
|
||||
public async RequestInterceptor(): Promise<any> {
|
||||
this.instance.interceptors.request.use(config => {
|
||||
// 添加token
|
||||
Object.assign(config.headers,{
|
||||
'authorization': this.Utils.getToken()
|
||||
})
|
||||
this.OpenLoadingData();
|
||||
return config
|
||||
}, function (error) {
|
||||
return Promise.reject(error)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示加载进度
|
||||
* @constructor
|
||||
*/
|
||||
private OpenLoadingData(): void {
|
||||
Toast.loading({
|
||||
message: '加载中...',
|
||||
forbidClick: true,
|
||||
loadingType: 'circular'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除加载进度条
|
||||
*/
|
||||
private CloseLoadingData(): void {
|
||||
Toast.clear();
|
||||
}
|
||||
|
||||
}
|
||||
1
滴滴淘/h5(1)/src/core/run/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
32b784bd-1a75-43f8-9b0b-565c56d600fc
|
||||
60
滴滴淘/h5(1)/src/core/run/init.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
import Vue, {VueConstructor} from 'vue';
|
||||
import App from '@/App.vue';
|
||||
import VueRouter from 'vue-router';
|
||||
import '../class-component-hooks';
|
||||
import {config} from '../config'
|
||||
|
||||
/**
|
||||
* 初始化Vue需要的插件和构造Vue启动参数
|
||||
*/
|
||||
export class init {
|
||||
private initVuePlugsArray: Array<any> = config.VuePlugs;
|
||||
private initOtherPlugsArray: Array<Object> = config.NotVuePlugs;
|
||||
protected router: any;
|
||||
protected Vues: any = Vue;
|
||||
public static App: VueConstructor = App;
|
||||
|
||||
|
||||
constructor() {
|
||||
this.Vues.config.productionTip = false;
|
||||
this.initPlugs();
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化Vue和非Vue插件
|
||||
*/
|
||||
private initPlugs(): void {
|
||||
// @ts-ignore
|
||||
this.initOtherPlugsArray.forEach(v => this.Vues.prototype[v['n']] = new (v['f'])());
|
||||
this.initVuePlugsArray.forEach(v => this.Vues.use(v));
|
||||
this.InitVueRouter();
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化配置全局路由
|
||||
* @constructor
|
||||
*/
|
||||
private InitVueRouter(): void {
|
||||
this.router = new VueRouter(config.RouterConfigUrl);
|
||||
// 重写路由Push
|
||||
const routerPush = VueRouter.prototype.push
|
||||
VueRouter.prototype.push = function push(location: any): any {
|
||||
// @ts-ignore
|
||||
return routerPush.call(this, location).catch((error: any) => error)
|
||||
}
|
||||
|
||||
this.router.beforeEach((to: any, from: any, next: any) => {
|
||||
if (to.meta.title) {
|
||||
document.title = to.meta.title;
|
||||
}
|
||||
// 如果用户未登录跳转至登录页
|
||||
if(!localStorage.getItem(`${config.prefix}access_token`) && config.isRouter.indexOf(to.path) !== -1){
|
||||
next('/login')
|
||||
}else{
|
||||
next();
|
||||
}
|
||||
// next();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
20
滴滴淘/h5(1)/src/core/run/run.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import {init} from './init';
|
||||
import {config} from '../config';
|
||||
import store from '../store/index'
|
||||
|
||||
/**
|
||||
* Vue项目的启动文件
|
||||
*/
|
||||
class Run extends init {
|
||||
|
||||
public initApp(): void {
|
||||
const router = this.router;
|
||||
new this.Vues({
|
||||
router,
|
||||
store,
|
||||
render: (h: (arg0: any) => void): any => h(init.App)
|
||||
}).$mount(config.mountElement);
|
||||
}
|
||||
}
|
||||
|
||||
(new Run()).initApp();
|
||||
1
滴滴淘/h5(1)/src/core/service/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
e44ecb30-2f2c-4ec3-b47e-63ecc51c9842
|
||||
14
滴滴淘/h5(1)/src/core/service/HomeService.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import * as ServeTypes from '../types/ServeTypes'
|
||||
|
||||
export interface HomeService {
|
||||
register(data: ServeTypes.registerType): Promise<Object[]>;
|
||||
login(data: ServeTypes.registerType): Promise<Object[]>;
|
||||
captcha(cellphone: string): Promise<Object[]>;
|
||||
saveaccount(data: ServeTypes.buyNumber): Promise<Object[]>;
|
||||
accountTagInfo(type: number): Promise<Object[]>;
|
||||
referMoney(): Promise<Object[]>;
|
||||
financeInfo(): Promise<Object[]>;
|
||||
memberInfo(): Promise<Object[]>;
|
||||
forget(data: ServeTypes.forget): Promise<Object[]>;
|
||||
getIndex(): Promise<Object[]>
|
||||
}
|
||||
5
滴滴淘/h5(1)/src/core/service/NewsService.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export interface NewsService {
|
||||
announceList(data: object): Promise<any>;
|
||||
announceInfoById(data: object): Promise<any>;
|
||||
messageList(data: object): Promise<any>;
|
||||
}
|
||||
7
滴滴淘/h5(1)/src/core/service/PublicService.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import * as ServeTypes from '../types/ServeTypes'
|
||||
|
||||
export interface PublicService {
|
||||
getvantcity(): Promise<Object[]>
|
||||
uploadImg(data: ServeTypes.imageType): Promise<Object[]>
|
||||
banklist(): Promise<Object[]>
|
||||
}
|
||||
17
滴滴淘/h5(1)/src/core/service/TaskService.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import * as ServeTypes from '../types/ServeTypes'
|
||||
|
||||
export interface TaskService {
|
||||
getTaskAccount(data: { platform_id: string }): Promise<any>;
|
||||
getTaskList(data: object): Promise<any>;
|
||||
orderTask(data: object): Promise<any>;
|
||||
commitTask(data: object): Promise<any>;
|
||||
taskDetail(id: string): Promise<any>;
|
||||
setComparePrice(data: ServeTypes.setComparePriceType): Promise<any>;
|
||||
verifyShop(data: ServeTypes.verifyShopType): Promise<any>;
|
||||
purchaseDone(data: ServeTypes.purchaseDoneType): Promise<any>;
|
||||
buyerOrder(data: ServeTypes.buyerOrderType): Promise<any>;
|
||||
confirmAccept(id: string): Promise<any>;
|
||||
cancelTask(id: string): Promise<any>;
|
||||
nextStep(id: string): Promise<any>;
|
||||
setTaskTag(data: ServeTypes.TaskTagType): Promise<any>;
|
||||
}
|
||||
16
滴滴淘/h5(1)/src/core/service/UserService.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import * as ServeTypes from '../types/ServeTypes'
|
||||
|
||||
export interface UserService {
|
||||
getAccountlist(): Promise<Object[]>
|
||||
saveAccountAddress(data: ServeTypes.saveAddress): Promise<Object[]>
|
||||
accountListByPlatform(id: string): Promise<Object[]>
|
||||
modifyAccount(data: ServeTypes.buyNumber): Promise<Object[]>
|
||||
cashout(type: number): Promise<Object[]>
|
||||
saveidcard(data: ServeTypes.realNameType): Promise<Object[]>
|
||||
idCardBankInfo(): Promise<Object[]>
|
||||
financelist(data: ServeTypes.paging): Promise<Object[]>
|
||||
commissionList(data: ServeTypes.paging): Promise<Object[]>
|
||||
cashlist(data: ServeTypes.paging): Promise<Object[]>
|
||||
getMemberInfo(): Promise<Object[]>
|
||||
referinfo(data: ServeTypes.paging): Promise<Object[]>
|
||||
}
|
||||
1
滴滴淘/h5(1)/src/core/service/impl/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
aa3cef1a-23ef-4f83-8be1-790da8f42bfe
|
||||
91
滴滴淘/h5(1)/src/core/service/impl/HomeServiceImpl.ts
Normal file
@@ -0,0 +1,91 @@
|
||||
import {HomeService} from "../HomeService"
|
||||
import {Axios} from "../../dao";
|
||||
import {config} from "../../config";
|
||||
import * as ServeTypes from '../../types/ServeTypes'
|
||||
|
||||
export class HomeServiceImpl extends Axios implements HomeService {
|
||||
|
||||
// 买家注册接口
|
||||
public async register(data: ServeTypes.registerType): Promise<any> {
|
||||
return await this.post({
|
||||
url: config.AjaxConfig.ApiList.reg,
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 买家登录接口
|
||||
public async login(data: ServeTypes.registerType): Promise<any> {
|
||||
return await this.post({
|
||||
url: config.AjaxConfig.ApiList.login,
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 注册的时候验证码
|
||||
public async captcha(cellphone: string): Promise<any> {
|
||||
return await this.post({
|
||||
url: config.AjaxConfig.ApiList.captcha,
|
||||
data: {
|
||||
'cellphone': cellphone,
|
||||
'template_id': '1'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 添加买号
|
||||
public async saveaccount(data: ServeTypes.buyNumber): Promise<any> {
|
||||
return await this.post({
|
||||
url: config.AjaxConfig.ApiList.saveaccount,
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 添加买号标签
|
||||
public async accountTagInfo(type: number): Promise<any> {
|
||||
return await this.post({
|
||||
url: config.AjaxConfig.ApiList.accountTagInfo,
|
||||
data: {
|
||||
platform: type
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 我的页面推广的资金
|
||||
public async referMoney(): Promise<any> {
|
||||
return await this.post({
|
||||
url: config.AjaxConfig.ApiList.referMoney,
|
||||
data: {}
|
||||
});
|
||||
}
|
||||
|
||||
// 我的页面账户余额
|
||||
public async financeInfo(): Promise<any> {
|
||||
return await this.post({
|
||||
url: config.AjaxConfig.ApiList.financeInfo,
|
||||
data: {}
|
||||
});
|
||||
}
|
||||
|
||||
// 我的页面个人信息
|
||||
public async memberInfo(): Promise<any> {
|
||||
return await this.post({
|
||||
url: config.AjaxConfig.ApiList.memberInfo,
|
||||
data: {}
|
||||
});
|
||||
}
|
||||
|
||||
// 忘记密码
|
||||
public async forget(data: ServeTypes.forget): Promise<any> {
|
||||
return await this.post({
|
||||
url: config.AjaxConfig.ApiList.forget,
|
||||
data: data
|
||||
});
|
||||
}
|
||||
// 忘记密码
|
||||
public async getIndex(): Promise<any> {
|
||||
return await this.post({
|
||||
url: config.AjaxConfig.ApiList.index,
|
||||
data: {}
|
||||
});
|
||||
}
|
||||
}
|
||||
30
滴滴淘/h5(1)/src/core/service/impl/NewsServiceImpl.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { Axios } from "../../dao";
|
||||
import { NewsService } from "../NewsService";
|
||||
import { config } from "../../config";
|
||||
|
||||
export class NewsServiceImpl extends Axios implements NewsService {
|
||||
|
||||
// 公共列表
|
||||
public async announceList(data: object): Promise<any> {
|
||||
return await this.get({
|
||||
url: config.AjaxConfig.ApiList.announceList,
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 公告详情
|
||||
public async announceInfoById(data: object): Promise<any> {
|
||||
return await this.get({
|
||||
url: config.AjaxConfig.ApiList.announceInfoById,
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 消息列表
|
||||
public async messageList(data: object): Promise<any> {
|
||||
return await this.get({
|
||||
url: config.AjaxConfig.ApiList.messageList,
|
||||
data: data
|
||||
});
|
||||
}
|
||||
}
|
||||
33
滴滴淘/h5(1)/src/core/service/impl/PublicServiceImpl.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { PublicService } from '../PublicService'
|
||||
import {Axios} from "../../dao";
|
||||
import {config} from "../../config";
|
||||
import * as ServeTypes from '../../types/ServeTypes'
|
||||
|
||||
export class PublicServiceImpl extends Axios implements PublicService {
|
||||
|
||||
public async getvantcity(): Promise<any> {
|
||||
return await this.post({
|
||||
url: config.AjaxConfig.ApiList.getvantcity,
|
||||
data: {}
|
||||
});
|
||||
}
|
||||
|
||||
// 买家图片上传
|
||||
public async uploadImg(data: ServeTypes.imageType): Promise<any> {
|
||||
return await this.post({
|
||||
url: config.AjaxConfig.ApiList.uploadImg,
|
||||
data: data,
|
||||
header: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 银行卡列表
|
||||
public async banklist(): Promise<any> {
|
||||
return await this.post({
|
||||
url: config.AjaxConfig.ApiList.banklist,
|
||||
data: {}
|
||||
});
|
||||
}
|
||||
}
|
||||
105
滴滴淘/h5(1)/src/core/service/impl/TaskServiceImpl.ts
Normal file
@@ -0,0 +1,105 @@
|
||||
import { TaskService } from '../TaskService'
|
||||
import {Axios} from "../../dao";
|
||||
import {config} from "../../config";
|
||||
import * as ServeTypes from '../../types/ServeTypes'
|
||||
|
||||
export class TaskServiceImpl extends Axios implements TaskService {
|
||||
public async getTaskAccount(data: { platform_id: string }): Promise<any> {
|
||||
return await this.get({
|
||||
url: config.AjaxConfig.ApiList.getTaskAccount,
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
public async getTaskList(data: object): Promise<any> {
|
||||
return await this.post({
|
||||
url: config.AjaxConfig.ApiList.getTaskList,
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
public async orderTask(data: object): Promise<any> {
|
||||
return await this.post({
|
||||
url: config.AjaxConfig.ApiList.orderTask,
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
public async commitTask(data: object): Promise<any> {
|
||||
return await this.post({
|
||||
url: config.AjaxConfig.ApiList.commitTask,
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
public async taskDetail(id: string): Promise<any> {
|
||||
return await this.get({
|
||||
url: config.AjaxConfig.ApiList.taskDetail,
|
||||
data: {
|
||||
task_id: id
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public async setComparePrice(data: ServeTypes.setComparePriceType): Promise<any> {
|
||||
return await this.post({
|
||||
url: config.AjaxConfig.ApiList.setComparePrice,
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
public async verifyShop(data: ServeTypes.verifyShopType): Promise<any> {
|
||||
return await this.post({
|
||||
url: config.AjaxConfig.ApiList.verifyShop,
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
public async purchaseDone(data: ServeTypes.purchaseDoneType): Promise<any> {
|
||||
return await this.post({
|
||||
url: config.AjaxConfig.ApiList.purchaseDone,
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
public async buyerOrder(data: ServeTypes.buyerOrderType): Promise<any> {
|
||||
return await this.post({
|
||||
url: config.AjaxConfig.ApiList.buyerOrder,
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
public async confirmAccept(id: string): Promise<any> {
|
||||
return await this.post({
|
||||
url: config.AjaxConfig.ApiList.confirmAccept,
|
||||
data: {
|
||||
task_id: id
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public async cancelTask(id: string): Promise<any> {
|
||||
return await this.post({
|
||||
url: config.AjaxConfig.ApiList.cancelTask,
|
||||
data: {
|
||||
task_id: id
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public async nextStep(id: string): Promise<any> {
|
||||
return await this.post({
|
||||
url: config.AjaxConfig.ApiList.nextStep,
|
||||
data: {
|
||||
task_id: id
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public async setTaskTag(data: ServeTypes.TaskTagType): Promise<any> {
|
||||
return await this.post({
|
||||
url: config.AjaxConfig.ApiList.setTaskTag,
|
||||
data: data
|
||||
});
|
||||
}
|
||||
}
|
||||
108
滴滴淘/h5(1)/src/core/service/impl/UserServiceImpl.ts
Normal file
@@ -0,0 +1,108 @@
|
||||
import { UserService } from '../UserService'
|
||||
import {Axios} from "../../dao";
|
||||
import {config} from "../../config";
|
||||
import * as ServeTypes from '../../types/ServeTypes'
|
||||
|
||||
export class UserServiceImpl extends Axios implements UserService {
|
||||
|
||||
// 买号列表
|
||||
public async getAccountlist(): Promise<any> {
|
||||
return await this.post({
|
||||
url: config.AjaxConfig.ApiList.accountlist,
|
||||
data: {}
|
||||
});
|
||||
}
|
||||
|
||||
// 修改买号地址
|
||||
public async saveAccountAddress(data: ServeTypes.saveAddress): Promise<any> {
|
||||
return await this.post({
|
||||
url: config.AjaxConfig.ApiList.saveAccountAddress,
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 获取当前买号信息
|
||||
public async accountListByPlatform(id: string): Promise<any> {
|
||||
return await this.post({
|
||||
url: config.AjaxConfig.ApiList.accountListByPlatform,
|
||||
data: {
|
||||
id: id
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 修改买号
|
||||
public async modifyAccount(data: ServeTypes.buyNumber): Promise<any> {
|
||||
return await this.post({
|
||||
url: config.AjaxConfig.ApiList.modifyAccount,
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 提现
|
||||
public async cashout(type: number): Promise<any> {
|
||||
return await this.post({
|
||||
url: config.AjaxConfig.ApiList.cashout,
|
||||
data: {
|
||||
type_id: type
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 实名认证
|
||||
public async saveidcard(data: ServeTypes.realNameType): Promise<any> {
|
||||
return await this.post({
|
||||
url: config.AjaxConfig.ApiList.saveidcard,
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 实名认证查询
|
||||
public async idCardBankInfo(): Promise<any> {
|
||||
return await this.post({
|
||||
url: config.AjaxConfig.ApiList.idCardBankInfo,
|
||||
data: {}
|
||||
});
|
||||
}
|
||||
|
||||
// 资金列表
|
||||
public async financelist(data: ServeTypes.paging): Promise<any> {
|
||||
return await this.get({
|
||||
url: config.AjaxConfig.ApiList.financelist,
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 佣金列表
|
||||
public async commissionList(data: ServeTypes.paging): Promise<any> {
|
||||
return await this.get({
|
||||
url: config.AjaxConfig.ApiList.commissionList,
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 提现列表
|
||||
public async cashlist(data: ServeTypes.paging): Promise<any> {
|
||||
return await this.get({
|
||||
url: config.AjaxConfig.ApiList.cashlist,
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 获取用户信息
|
||||
public async getMemberInfo(): Promise<any> {
|
||||
return await this.get({
|
||||
url: config.AjaxConfig.ApiList.getMemberInfo,
|
||||
data: {}
|
||||
});
|
||||
}
|
||||
|
||||
// 推广信息
|
||||
public async referinfo(data: ServeTypes.paging): Promise<any> {
|
||||
return await this.get({
|
||||
url: config.AjaxConfig.ApiList.referinfo,
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
13
滴滴淘/h5(1)/src/core/service/imports.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import {HomeServiceImpl} from "./impl/HomeServiceImpl";
|
||||
import {PublicServiceImpl} from "./impl/PublicServiceImpl";
|
||||
import {UserServiceImpl} from "./impl/UserServiceImpl";
|
||||
import {TaskServiceImpl} from "./impl/TaskServiceImpl";
|
||||
import {NewsServiceImpl} from "./impl/NewsServiceImpl";
|
||||
|
||||
export default class Imports {
|
||||
public HomeService = new HomeServiceImpl()
|
||||
public PublicService = new PublicServiceImpl()
|
||||
public UserService = new UserServiceImpl()
|
||||
public TaskService = new TaskServiceImpl()
|
||||
public NewsService = new NewsServiceImpl()
|
||||
}
|
||||
1
滴滴淘/h5(1)/src/core/store/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
2d824815-2536-4b1e-a089-96dda5ed23c6
|
||||
7
滴滴淘/h5(1)/src/core/store/actions.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { Commit } from 'vuex'
|
||||
|
||||
export default {
|
||||
NEWSNUM(context: { commit: Commit }, n: Object){
|
||||
context.commit('SET_NEWSNUM', n)
|
||||
}
|
||||
}
|
||||
5
滴滴淘/h5(1)/src/core/store/getters.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export default {
|
||||
getNewsNum: (state:any) => {
|
||||
return state.newsNum
|
||||
}
|
||||
}
|
||||
21
滴滴淘/h5(1)/src/core/store/index.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
|
||||
import mutations from './mutations'
|
||||
import actions from './actions'
|
||||
import getters from './getters'
|
||||
|
||||
Vue.use(Vuex)
|
||||
|
||||
|
||||
|
||||
const store = new Vuex.Store({
|
||||
state:{
|
||||
newsNum: 0, // 任务角标
|
||||
},
|
||||
actions,
|
||||
mutations,
|
||||
getters
|
||||
})
|
||||
|
||||
export default store
|
||||
1
滴滴淘/h5(1)/src/core/store/modules/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
70091933-524c-4d73-a89f-5c3d0bd021d8
|
||||
5
滴滴淘/h5(1)/src/core/store/mutations.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export default {
|
||||
SET_NEWSNUM (state:any, n: Object) {
|
||||
state.newsNum = n
|
||||
}
|
||||
}
|
||||
1
滴滴淘/h5(1)/src/core/types/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
28eee31e-8881-4fd1-87fb-de52da83c8e4
|
||||
199
滴滴淘/h5(1)/src/core/types/ServeTypes.ts
Normal file
@@ -0,0 +1,199 @@
|
||||
export type registerType = {
|
||||
// 手机号
|
||||
cellphone: string
|
||||
|
||||
// 密码(8-25位数组字母组合)
|
||||
password: string
|
||||
|
||||
// 验证码(暂未做验证(4位))
|
||||
verifyCode?: string
|
||||
|
||||
// 短信模板ID,此处为1,注册验证码
|
||||
templateId?: string
|
||||
|
||||
// 邀请码
|
||||
inviteCode?: string
|
||||
}
|
||||
|
||||
export type buyNumber = {
|
||||
|
||||
// 买号id修改买号时需要
|
||||
id?: string
|
||||
// 账号
|
||||
account: string
|
||||
|
||||
// 账号性别
|
||||
account_gender: number
|
||||
|
||||
// 账号等级
|
||||
account_rate: number
|
||||
|
||||
// 账号年龄
|
||||
account_ages: number
|
||||
|
||||
// 账号积分(淘气值,京享值,拼多多没有 )
|
||||
account_points: number
|
||||
|
||||
// 上传id
|
||||
image_id: number
|
||||
|
||||
// 姓名
|
||||
full_name: string
|
||||
|
||||
// 手机号码
|
||||
cellphone: string
|
||||
|
||||
// 地区id
|
||||
area_id: string
|
||||
|
||||
// 详细地址
|
||||
detail: string
|
||||
|
||||
// 标签id(1,2,3) 最多三个
|
||||
category_id: string
|
||||
|
||||
// 账号类型(1淘宝2京东3拼多多)
|
||||
account_type: string
|
||||
|
||||
}
|
||||
|
||||
// 上传图片接口
|
||||
export type imageType = {
|
||||
file: File
|
||||
imageType: string
|
||||
}
|
||||
|
||||
export type saveAddress = {
|
||||
|
||||
// 买号id
|
||||
id: string
|
||||
|
||||
// 姓名
|
||||
full_name: string
|
||||
|
||||
// 手机号码
|
||||
cellphone: string
|
||||
|
||||
// 地区id
|
||||
area_id: string
|
||||
|
||||
// 详情
|
||||
detail: string
|
||||
}
|
||||
|
||||
export type realNameType = {
|
||||
// 姓名
|
||||
username: string
|
||||
|
||||
// 省份证卡号
|
||||
id_card: string
|
||||
|
||||
// 上传身份证图片id
|
||||
id_card_image_id: string
|
||||
|
||||
// 手势图片id
|
||||
user_image_id: string
|
||||
|
||||
// 银行账号
|
||||
account: string
|
||||
|
||||
// 银行id
|
||||
bank_id: string
|
||||
|
||||
// 支行名称(开户行)
|
||||
bank_name: string
|
||||
|
||||
// 地区id
|
||||
bank_area_id: string
|
||||
}
|
||||
|
||||
export type setComparePriceType = {
|
||||
|
||||
// 任务ID
|
||||
task_id: string
|
||||
|
||||
// 淘口令
|
||||
compare_item_value: string
|
||||
|
||||
// 货比信息的主键ID,没有则表示新增货比信息 编辑时需传
|
||||
compare_price_id?: string
|
||||
}
|
||||
|
||||
export type verifyShopType = {
|
||||
// 任务ID
|
||||
task_id: string
|
||||
|
||||
// 店铺名或淘口令
|
||||
verify_value: string
|
||||
|
||||
// 图片id
|
||||
image_id: string
|
||||
}
|
||||
|
||||
export type purchaseDoneType = {
|
||||
|
||||
// 任务ID
|
||||
task_id: string
|
||||
|
||||
// 加购物车
|
||||
item_cart: 'no' | 1 | ''
|
||||
|
||||
// 宝贝收藏
|
||||
item_collect: 'no' | 1 | ''
|
||||
|
||||
// 拍前假聊
|
||||
item_chat: 'no' | 1 | ''
|
||||
|
||||
// 宝贝浏览
|
||||
item_scan: 'no' | 1 | ''
|
||||
|
||||
}
|
||||
|
||||
export type buyerOrderType = {
|
||||
// 任务ID
|
||||
task_id: string
|
||||
|
||||
// 淘宝/京东/PDD订单号
|
||||
trade_num: string
|
||||
|
||||
// 实付金额
|
||||
amount: string
|
||||
}
|
||||
|
||||
export type paging = {
|
||||
// 当前页
|
||||
page: number
|
||||
|
||||
// 分页大小
|
||||
limit: number
|
||||
}
|
||||
|
||||
// 忘记密码
|
||||
export type forget = {
|
||||
// 手机号
|
||||
cellphone: string
|
||||
|
||||
// 验证码
|
||||
verify_code: string
|
||||
|
||||
// 模板id
|
||||
template_id: string
|
||||
|
||||
// 密码
|
||||
password: string
|
||||
|
||||
// 确认密码
|
||||
repassword: string
|
||||
}
|
||||
|
||||
// 任务打标
|
||||
export type TaskTagType = {
|
||||
// 任务id
|
||||
task_id: string
|
||||
|
||||
// 任务详情接口种的参数
|
||||
process_id: string
|
||||
|
||||
// 图片上传后返回的id
|
||||
tag_image: number
|
||||
}
|
||||
1
滴滴淘/h5(1)/src/core/utils/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
34dc31dd-011b-4cc8-b29e-abd8f67f862a
|
||||
210
滴滴淘/h5(1)/src/core/utils/index.ts
Normal file
@@ -0,0 +1,210 @@
|
||||
import { config } from '../config';
|
||||
import { Toast } from 'vant';
|
||||
import { format } from 'timeago.js';
|
||||
|
||||
export class Utils {
|
||||
/**
|
||||
* 检测当前环境,动态返回ajax接口的对应的URL地址
|
||||
* @constructor
|
||||
*/
|
||||
public static CheckAjaxUrl(): string {
|
||||
if (process.env.NODE_ENV.replace(/^\s+|\s+$/g, '') == 'production') {
|
||||
return config.AjaxConfig.ProdUrl;
|
||||
} else {
|
||||
return config.AjaxConfig.DevUrl;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测当前环境,动态返回socket对应的URL地址
|
||||
* @constructor
|
||||
*/
|
||||
public static CheckWsUrl(): string {
|
||||
if (process.env.NODE_ENV.replace(/^\s+|\s+$/g, '') == 'production') {
|
||||
return config.AjaxConfig.WsProdUrl;
|
||||
} else {
|
||||
return config.AjaxConfig.WsDevUrl;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步加载组件,仅限 pages 中组件
|
||||
* @param fileName 组件的文件名称
|
||||
* @constructor
|
||||
*/
|
||||
public static AsyncComponentHook(fileName: String): Function {
|
||||
const component = import(/* webpackChunkName: "[request]" */ `@/pages/${fileName}.vue`);
|
||||
component.catch(e => console.error(`组件加载失败: ${e}`));
|
||||
return () => component;
|
||||
}
|
||||
|
||||
/**
|
||||
* 动态设置网页title
|
||||
* @param title
|
||||
*/
|
||||
public setTitle(title: string): void {
|
||||
document.title = title;
|
||||
}
|
||||
|
||||
/**
|
||||
* 本地存储
|
||||
* @param key 存储的名称
|
||||
* @param value 存储的数据
|
||||
*/
|
||||
public setStorage(key: string, value: any): void {
|
||||
try {
|
||||
if (typeof key !== 'string') {
|
||||
throw "key必须为字符串";
|
||||
}
|
||||
localStorage.setItem(config.prefix + key, JSON.stringify(value))
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取本地存储
|
||||
* @param key 存储的名称
|
||||
*/
|
||||
public getStorage(key: string): any {
|
||||
try {
|
||||
let value: string = localStorage.getItem(config.prefix + key) as string
|
||||
if (value !== void 0 && value !== null) {
|
||||
return JSON.parse(value)
|
||||
} else {
|
||||
throw `获取key:${key}的本地缓存数据失败`
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除本地存储
|
||||
* @param key 存储的名称
|
||||
*/
|
||||
public delStorage(key: string): void {
|
||||
return localStorage.removeItem(config.prefix + key);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取token
|
||||
*/
|
||||
public getToken(): void {
|
||||
return this.getStorage('access_token')
|
||||
}
|
||||
|
||||
/**
|
||||
* id 身份证号
|
||||
* 身份证验证
|
||||
*/
|
||||
public isIdentity(id: string): boolean{
|
||||
let str: RegExp = /^[1-9]\d{5}(18|19|20|(3\d))\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/
|
||||
return str.test(id)
|
||||
}
|
||||
/**
|
||||
* id 手机号
|
||||
* 手机号证验证
|
||||
*/
|
||||
public isTel(id: string): boolean{
|
||||
let str: RegExp = /^1[3456789]\d{9}$/
|
||||
return str.test(id)
|
||||
}
|
||||
|
||||
// 计算倒计时
|
||||
public leftTimer(time: number): string{
|
||||
//3.获取现在的时间
|
||||
let presentDate = new Date();
|
||||
//4.获取时间戳
|
||||
let funtureTime = time * 1000;
|
||||
let presenTime = presentDate.getTime();
|
||||
//5.获取剩余的时间戳
|
||||
let allTime = funtureTime - presenTime;
|
||||
//6.把毫秒转换为秒
|
||||
let allSecond: any = (allTime / 1000)
|
||||
//7.获取剩余多少天
|
||||
let day = this.size((allSecond / 3600 / 24))
|
||||
//8.获取剩余多少小时
|
||||
let hour = this.size((allSecond / 3600 % 24))
|
||||
//9.获取剩余多少分钟
|
||||
let minute = this.size((allSecond / 60 % 60));
|
||||
//10.获取剩余多少秒
|
||||
let second = this.size((allSecond % 60));
|
||||
if(second >= 0){
|
||||
return `${parseInt(hour)}时 ${parseInt(minute)}分 ${parseInt(second)}秒`
|
||||
}else{
|
||||
return '任务已超时'
|
||||
}
|
||||
}
|
||||
private size(num: any) {
|
||||
return num < 10 && num >= 0 ? '0' + num : num;
|
||||
}
|
||||
|
||||
// 时间戳转正常时间
|
||||
public formatDate(data: number): string {
|
||||
let now=new Date(data*1000);
|
||||
let year=now.getFullYear();
|
||||
let month=now.getMonth()+1;
|
||||
let date=now.getDate();
|
||||
let hour=now.getHours();
|
||||
let minute=now.getMinutes();
|
||||
let second=now.getSeconds();
|
||||
return year+"-"+month+"-"+date+" "+hour+":"+minute+":"+second;
|
||||
}
|
||||
|
||||
/**
|
||||
* 时间戳 转最近时间 转换后 类如(1天前)
|
||||
* @param time 时间戳
|
||||
*/
|
||||
public formatAge(time: number): string {
|
||||
return format(time*1000, 'zh_CN')
|
||||
}
|
||||
|
||||
// 复制到粘贴板
|
||||
public copy(str: string): void {
|
||||
var tag = document.createElement('input');
|
||||
tag.setAttribute('id', 'cp_hgz_input');
|
||||
tag.value = str;
|
||||
document.getElementsByTagName('body')[0].appendChild(tag);
|
||||
// @ts-ignore
|
||||
document.getElementById('cp_hgz_input').select();
|
||||
document.execCommand('copy');
|
||||
// @ts-ignore
|
||||
document.getElementById('cp_hgz_input').remove();
|
||||
Toast('复制成功')
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于把 单位为分 转换成 单位为元
|
||||
* @param m 后端返回被处理成 单位为分 的钱
|
||||
*/
|
||||
public conversionMoney(m: number): string {
|
||||
return (m/10/10).toFixed(2)
|
||||
}
|
||||
|
||||
/**
|
||||
* 使元素在可视区域内
|
||||
* @param event
|
||||
*/
|
||||
public onFocus(event: Event): void {
|
||||
try {
|
||||
// 获取对应事件的 input dom
|
||||
const inputDom: any = event.target;
|
||||
setTimeout(() => {
|
||||
// px to rem 的比例
|
||||
const rate = (window.screen.width || document.documentElement.clientWidth) / 375;
|
||||
// 底部按钮 375基准 的高度为 56,根据 rate 计算实际高度
|
||||
const bottomFixHeight = 56 * rate;
|
||||
// 高度计算
|
||||
const clientHeight = document.documentElement.clientHeight;
|
||||
const top = inputDom.getBoundingClientRect().top;
|
||||
const diff = clientHeight - top;
|
||||
// scrollIntoViewIfNeeded方法使 元素滚动到浏览器窗口的可视区域内
|
||||
inputDom.scrollIntoViewIfNeeded(true);
|
||||
inputDom.scrollIntoView(true)
|
||||
}, 200);
|
||||
} catch (error) {
|
||||
new Error(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
159
滴滴淘/h5(1)/src/core/utils/socket.ts
Normal file
@@ -0,0 +1,159 @@
|
||||
import {Utils} from './index'
|
||||
import store from '../store/index'
|
||||
|
||||
interface wxConfig {
|
||||
// 链接的通道的地址
|
||||
url: string
|
||||
|
||||
// 心跳时间间隔
|
||||
heartTime: number
|
||||
|
||||
// 心跳信息,默认为'ping'
|
||||
heartMsg: any
|
||||
|
||||
// 是否自动重连
|
||||
isReconnect: boolean
|
||||
|
||||
// 重连时间间隔
|
||||
reconnectTime: number
|
||||
|
||||
// 重连次数 -1 则不限制
|
||||
reconnectCount: number
|
||||
}
|
||||
|
||||
export class Socket {
|
||||
|
||||
private Utils: Utils = new Utils()
|
||||
|
||||
private ws!: WebSocket
|
||||
|
||||
private wxConfig: wxConfig = {
|
||||
url: Utils.CheckWsUrl(),
|
||||
heartTime: 40000,
|
||||
heartMsg: {dataType:'ping'},
|
||||
isReconnect: true,
|
||||
reconnectTime: 5000,
|
||||
reconnectCount: 5
|
||||
}
|
||||
|
||||
// 重连定时器
|
||||
private restartTime!: number
|
||||
|
||||
// 销毁定时器
|
||||
private closeTime!: number
|
||||
|
||||
constructor(option?: any){
|
||||
Object.assign(this.wxConfig, option)
|
||||
this.create()
|
||||
}
|
||||
|
||||
// 启动心跳
|
||||
private start() {
|
||||
// 开启定时器
|
||||
this.restartTime = setTimeout(() => {
|
||||
this.send(this.wxConfig.heartMsg)
|
||||
// 如果发送消息返回失败则触发关闭
|
||||
this.closeTime = setTimeout(() => {
|
||||
console.error('服务器长时间无响应,尝试重启服务');
|
||||
this.destroy()
|
||||
this.create()
|
||||
}, this.wxConfig.heartTime);
|
||||
}, this.wxConfig.heartTime);
|
||||
}
|
||||
|
||||
// 重启心跳
|
||||
private restart() {
|
||||
clearTimeout(this.restartTime) // 清除重连定时器
|
||||
clearTimeout(this.closeTime) // 清除销毁定时器
|
||||
this.start()
|
||||
}
|
||||
|
||||
// 创建链接
|
||||
private create() {
|
||||
if (!('WebSocket' in window)) {
|
||||
new Error('当前浏览器不支持,无法使用')
|
||||
return
|
||||
}
|
||||
if (!this.wxConfig.url) {
|
||||
new Error('地址不存在,无法建立通道')
|
||||
return
|
||||
}
|
||||
this.ws = new WebSocket(this.wxConfig.url)
|
||||
this.start()
|
||||
this.onopen()
|
||||
this.onmessage()
|
||||
this.onerror()
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义连接成功事件
|
||||
*/
|
||||
onopen () {
|
||||
this.ws.onopen = (event) => {
|
||||
let login = {
|
||||
dataType: 'login',
|
||||
token: this.Utils.getToken()
|
||||
}
|
||||
this.send(login)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义关闭事件
|
||||
*/
|
||||
onclose () {
|
||||
this.ws.onclose = (event) => {
|
||||
console.log(event);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义错误事件
|
||||
*/
|
||||
onerror () {
|
||||
this.ws.onerror = (event) => {
|
||||
console.log(event);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义消息监听事件
|
||||
*/
|
||||
onmessage () {
|
||||
this.ws.onmessage = (event) => {
|
||||
this.restart()
|
||||
let data = JSON.parse(event.data)
|
||||
// if(data.status == -1){
|
||||
// this.destroy()
|
||||
// this.create()
|
||||
// }
|
||||
// 如果返回的数据中有data存在则保存 消息数量
|
||||
if(data.data !== void 0){
|
||||
store.commit('SET_NEWSNUM', data.data.msg_num)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义发送消息事件
|
||||
* @param {any} msg 发送的文本
|
||||
*/
|
||||
send (msg: any) {
|
||||
if (this.ws.readyState !== this.ws.OPEN) {
|
||||
new Error('没有连接到服务器,无法推送')
|
||||
return
|
||||
}
|
||||
console.log(msg);
|
||||
let str: string = JSON.stringify(msg)
|
||||
this.ws.send(str)
|
||||
}
|
||||
|
||||
/**
|
||||
* 销毁
|
||||
*/
|
||||
destroy () {
|
||||
this.restart()
|
||||
clearTimeout(this.restartTime) // 清除重连定时器
|
||||
this.ws.close()
|
||||
}
|
||||
}
|
||||
1
滴滴淘/h5(1)/src/view/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
e416f7aa-cb1f-4934-9b8d-a6747b59848c
|
||||
43
滴滴淘/h5(1)/src/view/App.vue
Normal file
@@ -0,0 +1,43 @@
|
||||
<template lang="pug">
|
||||
#app
|
||||
router-view
|
||||
TabbarComponent(v-if="isTabBar")
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {Component, Provide, Vue} from 'vue-property-decorator';
|
||||
import TabbarComponent from "@/components/Tabbar.vue";
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
TabbarComponent
|
||||
}
|
||||
})
|
||||
export default class App extends Vue {
|
||||
// 控制导航条是否显示
|
||||
public isTabBar: boolean = true;
|
||||
|
||||
// 为后代组件提供方法 HiddenTabBar,ShowTabBar
|
||||
@Provide() HiddenTabBar = this.hiddenTabBar
|
||||
@Provide() ShowTabBar = this.showTabBar
|
||||
|
||||
|
||||
// 关闭底部导航条
|
||||
public hiddenTabBar(): void {
|
||||
this.$nextTick(function () {
|
||||
this.isTabBar = false
|
||||
})
|
||||
}
|
||||
|
||||
// 显示底部导航
|
||||
public showTabBar(): void {
|
||||
this.$nextTick(function () {
|
||||
this.isTabBar = true
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
@import "./assets/stylus/tpl/_public.styl"
|
||||
</style>
|
||||
1
滴滴淘/h5(1)/src/view/assets/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
521441a4-f37b-450c-b7f1-74cfbfe0c1f2
|
||||
1
滴滴淘/h5(1)/src/view/assets/stylus/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
c01e48bd-35c8-4ccb-b979-bb633d72fc8c
|
||||
3
滴滴淘/h5(1)/src/view/assets/stylus/imports.styl
Normal file
@@ -0,0 +1,3 @@
|
||||
// 对外全局导出,在vue.config.js被导入
|
||||
@import "./tpl/colors.styl"
|
||||
@import "./tpl/mixins.styl"
|
||||
1
滴滴淘/h5(1)/src/view/assets/stylus/page/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
21f1c3b8-5019-41d5-b760-4818c65eae54
|
||||
43
滴滴淘/h5(1)/src/view/assets/stylus/page/addAccount.styl
Normal file
@@ -0,0 +1,43 @@
|
||||
.add_account
|
||||
.alipay
|
||||
padding 0.267rem 0.48rem
|
||||
.alipay_title
|
||||
color: #323233;
|
||||
font-size: 0.37333rem;
|
||||
margin 0.3rem 0
|
||||
.alipay_img
|
||||
display flex
|
||||
align-items center
|
||||
.category
|
||||
margin-top 1.2rem
|
||||
.category_list
|
||||
height 5rem
|
||||
overflow-y scroll
|
||||
.row_list
|
||||
display: inline-block;
|
||||
width 25%
|
||||
padding 0.1rem
|
||||
box-sizing border-box
|
||||
.row
|
||||
height 0.83rem
|
||||
border 0.03rem solid #e5e5e5
|
||||
font-size 0.38rem
|
||||
color #999999
|
||||
border-radius 0.1rem
|
||||
.row_active
|
||||
border 0.03rem solid #4fc08d
|
||||
.category_custom
|
||||
margin-bottom 0.3rem
|
||||
input
|
||||
font-size 13px
|
||||
color #ccc
|
||||
padding-left 0.24rem
|
||||
padding-bottom 0.213rem
|
||||
border none
|
||||
width 100%
|
||||
border-bottom 0.026rem solid #ccc
|
||||
box-sizing border-box
|
||||
margin-bottom 0.507rem
|
||||
&:last-child {
|
||||
margin-bottom 0
|
||||
}
|
||||
23
滴滴淘/h5(1)/src/view/assets/stylus/page/authentication.styl
Normal file
@@ -0,0 +1,23 @@
|
||||
.platform_list
|
||||
padding-top 0.3rem
|
||||
.platform
|
||||
display flex
|
||||
align-items center
|
||||
padding 0.19rem
|
||||
border 0.05rem solid #e5e5e5
|
||||
border-radius 0.1rem
|
||||
img
|
||||
width 1.12rem
|
||||
height 1.12rem
|
||||
overflow hidden
|
||||
border-radius 50%
|
||||
p,span
|
||||
font-size 0.38rem
|
||||
.already
|
||||
background-color $taskColor
|
||||
padding 0.1rem
|
||||
color #ffffff
|
||||
.examine
|
||||
background-color #ee0a24
|
||||
padding 0.1rem
|
||||
color #ffffff
|
||||
21
滴滴淘/h5(1)/src/view/assets/stylus/page/fund.styl
Normal file
@@ -0,0 +1,21 @@
|
||||
@import '../imports.styl';
|
||||
.fund
|
||||
box-sizing border-box
|
||||
.fund_center
|
||||
padding-top 0.4rem
|
||||
padding-bottom 0.4rem
|
||||
.account
|
||||
background-color $themeColor
|
||||
height 3.37rem
|
||||
border-radius 0.1rem
|
||||
overflow hidden
|
||||
padding 0 0.6rem
|
||||
.money
|
||||
text-align center
|
||||
.money_text
|
||||
font-size 0.38rem
|
||||
font-weight 500
|
||||
color #ffffff
|
||||
p
|
||||
font-size 0.42rem
|
||||
color #ffffff
|
||||
87
滴滴淘/h5(1)/src/view/assets/stylus/page/index.styl
Normal file
@@ -0,0 +1,87 @@
|
||||
.Index
|
||||
padding-bottom 0.9rem
|
||||
.capital
|
||||
height 2.75rem
|
||||
background-color #20c6c2
|
||||
text-align center
|
||||
.p1,.p2
|
||||
color #ffffff
|
||||
.p1
|
||||
font-size 0.36rem
|
||||
font-weight 500
|
||||
.p2
|
||||
font-size 0.42rem
|
||||
font-weight 600
|
||||
margin 0.2rem 0 0.3rem 0
|
||||
span
|
||||
padding 0.09rem 0.19rem
|
||||
background-color #ffffff
|
||||
border-radius 0.1rem
|
||||
display flex
|
||||
align-items center
|
||||
font-size 0.32rem
|
||||
.text
|
||||
font-size 0.38rem
|
||||
color #666666
|
||||
.notice
|
||||
border 0.03rem solid #cccccc
|
||||
margin-top 0.52rem
|
||||
.news
|
||||
padding 0.4rem 0.53rem
|
||||
.news_cen
|
||||
p
|
||||
color #666666
|
||||
font-size 0.42rem
|
||||
margin 0.1rem 0
|
||||
.news_end
|
||||
text-align center
|
||||
span
|
||||
color #cccccc
|
||||
font-size 0.34rem
|
||||
position relative
|
||||
&:after
|
||||
content ''
|
||||
position absolute
|
||||
top 50%
|
||||
left 1.5rem
|
||||
margin-top 0.015rem
|
||||
width 0.96rem
|
||||
height 0.03rem
|
||||
background-color #cccccc
|
||||
&:before
|
||||
content ''
|
||||
position absolute
|
||||
top 50%
|
||||
right 1.5rem
|
||||
margin-top 0.015rem
|
||||
width 0.96rem
|
||||
height 0.03rem
|
||||
background-color #cccccc
|
||||
.advertisement
|
||||
height 2.48rem
|
||||
border-radius 0.1rem
|
||||
overflow hidden
|
||||
img
|
||||
height 2.48rem
|
||||
width 100%
|
||||
.task_num
|
||||
height 2.48rem
|
||||
border-radius 0.1rem
|
||||
overflow hidden
|
||||
box-shadow 0 2px 10px #0a10143d
|
||||
.task_num_li
|
||||
text-align center
|
||||
color #000
|
||||
span
|
||||
font-size 0.4rem
|
||||
font-weight bold
|
||||
p
|
||||
margin-top 0.2rem
|
||||
font-size 0.4rem
|
||||
.receipt
|
||||
font-size 0.42rem
|
||||
padding 0.3rem 0
|
||||
background-color #20c6c2
|
||||
color #ffffff
|
||||
font-weight 500
|
||||
text-align center
|
||||
58
滴滴淘/h5(1)/src/view/assets/stylus/page/login.styl
Normal file
@@ -0,0 +1,58 @@
|
||||
.login
|
||||
margin 0 auto
|
||||
width 8.227rem
|
||||
padding-top 1.32rem
|
||||
.head_portrait
|
||||
width 2.907rem
|
||||
height 2.88rem
|
||||
margin: 0 auto
|
||||
margin-bottom 1.32rem
|
||||
img
|
||||
width 100%
|
||||
height 100%
|
||||
.user_input
|
||||
margin-bottom 1.347rem
|
||||
input
|
||||
font-size 13px
|
||||
color #ccc
|
||||
padding-left 0.24rem
|
||||
padding-bottom 0.213rem
|
||||
border none
|
||||
width 100%
|
||||
border-bottom 0.026rem solid #ccc
|
||||
box-sizing border-box
|
||||
margin-bottom 0.507rem
|
||||
&:last-child {
|
||||
margin-bottom 0
|
||||
}
|
||||
.user_login
|
||||
width 100%
|
||||
height 1.267rem
|
||||
background $themeColor
|
||||
color #fff
|
||||
text-align center
|
||||
line-height 1.267rem
|
||||
font-size 16px
|
||||
margin-bottom 0.84rem
|
||||
.login_other
|
||||
text-align center
|
||||
span
|
||||
color #666
|
||||
font-size 14px
|
||||
.forget_password
|
||||
&:after
|
||||
content "|"
|
||||
margin-left 0.64rem
|
||||
margin-right 0.64rem
|
||||
color #ccc
|
||||
.agreement
|
||||
width 100%
|
||||
text-align center
|
||||
font-size 0.34667rem
|
||||
display flex
|
||||
justify-content center
|
||||
margin-top 1rem
|
||||
// margin-bottom 1rem
|
||||
.text
|
||||
color #ccc !important
|
||||
// vertical-align -webkit-baseline-middle
|
||||
3
滴滴淘/h5(1)/src/view/assets/stylus/page/modifyAddress.styl
Normal file
@@ -0,0 +1,3 @@
|
||||
.ModifyAddress
|
||||
padding-left 0.2rem
|
||||
padding-right 0.2rem
|
||||
82
滴滴淘/h5(1)/src/view/assets/stylus/page/my.styl
Normal file
@@ -0,0 +1,82 @@
|
||||
@import '../imports.styl';
|
||||
|
||||
.home
|
||||
width 100%
|
||||
height 100%
|
||||
background-color $themeColor
|
||||
.user
|
||||
padding 0.8rem 0.8rem 0.26rem 0.8rem
|
||||
.user_img
|
||||
height 1.5rem
|
||||
width 1.5rem
|
||||
border-radius 50%
|
||||
overflow hidden
|
||||
.user_info
|
||||
margin-left 0.2rem
|
||||
.user_name
|
||||
color #ffffff
|
||||
font-size 0.48rem
|
||||
font-weight 500
|
||||
.user_href
|
||||
margin-top 0.2rem
|
||||
color $themeColor
|
||||
background-color #ffffff
|
||||
padding 0.1rem 0.2rem
|
||||
border-radius 0.2rem
|
||||
font-size 0.38rem
|
||||
text-align center
|
||||
.sign_out
|
||||
font-size 0.42rem
|
||||
display flex
|
||||
justify-content center
|
||||
align-items center
|
||||
align-content center
|
||||
color #fff
|
||||
.home_center
|
||||
background-color #ffffff
|
||||
overflow hidden
|
||||
padding-bottom 1.33333rem
|
||||
border-radius 0.4rem 0.4rem 0 0
|
||||
.capital
|
||||
border_bottom();
|
||||
.capital_text
|
||||
display flex
|
||||
.capital_row
|
||||
flex 1
|
||||
padding 0.4rem 0.4rem
|
||||
box-sizing border-box
|
||||
.title
|
||||
color #000
|
||||
font-size 0.42rem
|
||||
.balance
|
||||
margin-top 0.4rem
|
||||
color #ccc
|
||||
font-size 0.46rem
|
||||
.order_row
|
||||
text-align center
|
||||
padding 0.4rem 0
|
||||
.row_l
|
||||
position relative
|
||||
p
|
||||
color #000000
|
||||
font-size 0.38rem
|
||||
span
|
||||
position absolute
|
||||
right -0.1rem
|
||||
top -0.1rem
|
||||
border-radius 50%
|
||||
background-color red
|
||||
color #fff
|
||||
font-size 0.28rem
|
||||
height 0.5rem
|
||||
width 0.5rem
|
||||
line-height 0.5rem
|
||||
text-align center
|
||||
.propaganda
|
||||
height 2.48rem
|
||||
padding 0.56rem 0.3rem 0.8rem 0.3rem
|
||||
img
|
||||
height 2.48rem
|
||||
width 100%
|
||||
.text_r
|
||||
text-align right
|
||||
17
滴滴淘/h5(1)/src/view/assets/stylus/page/realName.styl
Normal file
@@ -0,0 +1,17 @@
|
||||
.RealName
|
||||
.certificates
|
||||
padding 0.26667rem 0.42667rem
|
||||
.example
|
||||
width 50%
|
||||
padding 0.26667rem
|
||||
box-sizing border-box
|
||||
display inline-block
|
||||
img
|
||||
width 100%
|
||||
height 3.56rem
|
||||
.identity
|
||||
position relative
|
||||
.statusIcon
|
||||
position absolute
|
||||
right 0
|
||||
top -0.5rem
|
||||
3
滴滴淘/h5(1)/src/view/assets/stylus/page/task.styl
Normal file
@@ -0,0 +1,3 @@
|
||||
.task
|
||||
//padding 0 0.427rem
|
||||
box-sizing border-box
|
||||
89
滴滴淘/h5(1)/src/view/assets/stylus/page/taskinfo.styl
Normal file
@@ -0,0 +1,89 @@
|
||||
.task_info
|
||||
.remaining_time
|
||||
width 100%
|
||||
height 1.067rem
|
||||
background #334b4b
|
||||
text-align center
|
||||
line-height 1.067rem
|
||||
color #fff
|
||||
font-size 14px
|
||||
.info
|
||||
padding 0.267rem 0.48rem
|
||||
.info_message
|
||||
margin-top 0.413rem
|
||||
display flex
|
||||
img
|
||||
width 2.453rem
|
||||
height 2.453rem
|
||||
margin-right 0.293rem
|
||||
.message_right
|
||||
color $themeFontColor
|
||||
font-size 13px
|
||||
p
|
||||
margin-bottom 0.293rem
|
||||
.question
|
||||
vertical-align bottom
|
||||
margin-left 0.067rem
|
||||
.marking_task
|
||||
padding 0.267rem 0.48rem
|
||||
.task_title
|
||||
height 0.933rem
|
||||
display flex
|
||||
justify-content space-between
|
||||
align-items center
|
||||
margin-bottom 0.48rem
|
||||
border_bottom()
|
||||
span
|
||||
font-size 13px
|
||||
.title
|
||||
color #000
|
||||
.tips
|
||||
color $taskColor
|
||||
.question
|
||||
color $taskColor
|
||||
margin-left 0.147rem
|
||||
vertical-align bottom
|
||||
.steps
|
||||
margin-bottom 0.1rem
|
||||
.steps_button
|
||||
text-align right
|
||||
margin-bottom 0.107rem
|
||||
.collapse
|
||||
margin-top 0.253rem
|
||||
.upload
|
||||
margin-top 0.413rem
|
||||
.bottom_bar
|
||||
position fixed
|
||||
bottom 0
|
||||
left 0
|
||||
right 0
|
||||
z-index 999
|
||||
background-color #fff
|
||||
border-top 0.01rem solid #cccccc
|
||||
height 1.2rem
|
||||
width 100%
|
||||
display flex
|
||||
align-items center
|
||||
padding 0 0.32rem
|
||||
box-sizing border-box
|
||||
.bottom_bar_l
|
||||
flex 1
|
||||
text-align left
|
||||
display inline-flex
|
||||
.bottom_bar_r
|
||||
flex 2
|
||||
display flex
|
||||
justify-content flex-end
|
||||
.bottom_bar_but
|
||||
border 0.02rem solid #cccccc
|
||||
padding 0.15rem 0.32rem
|
||||
border-radius 2rem
|
||||
font-size 0.38rem
|
||||
display inline-block
|
||||
margin 0 0.1rem
|
||||
.bottom_bar_but_finish
|
||||
border 0.02rem solid #FF5722
|
||||
color #FF5722
|
||||
.fuzhi
|
||||
margin-left 0.2rem
|
||||
|
||||
1
滴滴淘/h5(1)/src/view/assets/stylus/tpl/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
4234538f-5565-4a2a-8666-e4dad3fe402d
|
||||
186
滴滴淘/h5(1)/src/view/assets/stylus/tpl/_public.styl
Normal file
@@ -0,0 +1,186 @@
|
||||
// 网站默认样式修改
|
||||
html,body,#app
|
||||
height 100%
|
||||
|
||||
h1,h2,h3,h4,h5,h6,ul,li,p
|
||||
padding 0
|
||||
margin 0
|
||||
|
||||
// 自定义全局css
|
||||
.line
|
||||
width 100%
|
||||
height 0.267rem
|
||||
background #f6f6f6
|
||||
|
||||
.content
|
||||
padding-top 46px
|
||||
padding-bottom 50px
|
||||
overflow auto
|
||||
|
||||
.inline_block
|
||||
display inline-block
|
||||
|
||||
.mt80
|
||||
margin-top 0.8rem
|
||||
.mt25
|
||||
margin-top 0.25rem
|
||||
.mt10
|
||||
margin-top 0.1rem
|
||||
.mt36
|
||||
margin-top 0.36rem
|
||||
.mt40
|
||||
margin-top 0.4rem
|
||||
.ml10
|
||||
margin-left 0.1rem
|
||||
.ml20
|
||||
margin-left 0.2rem
|
||||
.ml40
|
||||
margin-left 0.4rem
|
||||
.mr10
|
||||
margin-right 0.1rem
|
||||
.pd43
|
||||
padding 0 0.43rem
|
||||
.pd30
|
||||
padding 0 0.30rem
|
||||
.pt20
|
||||
padding-top 0.2rem
|
||||
|
||||
.mt
|
||||
margin-top mt()
|
||||
// 框架的一些样式重置
|
||||
// .task 限制只在task页面生效
|
||||
.task .van-tab--active,
|
||||
.news .van-tab--active
|
||||
background $themeColor
|
||||
|
||||
.task .van-tabs__line,
|
||||
.news .van-tabs__line
|
||||
background #ee0a2400 !important
|
||||
|
||||
.task .van-tabs__wrap,
|
||||
.news .van-tabs__wrap
|
||||
height 1.17333rem
|
||||
border-bottom 2px solid $themeColor
|
||||
|
||||
.task_info .van-cell,
|
||||
.news .van-cell
|
||||
padding-left 0
|
||||
padding-right 0
|
||||
|
||||
.task_hall .van-tabs__line,
|
||||
.news .van-tabs__line,
|
||||
.CapitalDetails .van-tabs__line{
|
||||
background-color: $themeColor;
|
||||
}
|
||||
// task和taskinfo页面列表头部的公共样式
|
||||
// 放在这里减少冗余
|
||||
.items_title
|
||||
display flex
|
||||
justify-content space-between
|
||||
height 1.187rem
|
||||
align-items center
|
||||
border_bottom()
|
||||
.title_status
|
||||
color: red;
|
||||
font-size 13px
|
||||
.title_left
|
||||
display flex
|
||||
align-items center
|
||||
img
|
||||
width 0.573rem
|
||||
height 0.573rem
|
||||
margin-right 0.28rem
|
||||
span
|
||||
font-size 13px
|
||||
margin-right 0.16rem
|
||||
margin-left 0.16rem
|
||||
max-width 3.5rem
|
||||
.y
|
||||
padding 0.107rem 0.23rem
|
||||
// width 1.067rem
|
||||
text-align center
|
||||
color #fff
|
||||
font-size 12px
|
||||
display inline-block
|
||||
.y_1
|
||||
margin-right 0.147rem
|
||||
// 任务详情组件中统一的标题和内容样式
|
||||
.tv_b
|
||||
color #e6a23c !important
|
||||
.tv_c
|
||||
color #67c23a !important
|
||||
.topic
|
||||
padding 0.2rem 0
|
||||
.title
|
||||
font-size 0.34667rem
|
||||
color #969799
|
||||
border-bottom 0.01rem #cccccc solid
|
||||
padding-bottom 0.1rem
|
||||
display flex
|
||||
.topic_title
|
||||
flex 1
|
||||
.topic_value
|
||||
flex 1
|
||||
text-align right
|
||||
.center
|
||||
padding 0.2rem 0.1rem 0
|
||||
.text
|
||||
padding 0 0.2rem
|
||||
.text_f
|
||||
display flex
|
||||
p
|
||||
font-size 0.36rem
|
||||
line-height 2
|
||||
color #969799
|
||||
flex 1
|
||||
.text_separate
|
||||
font-size 0.36rem
|
||||
line-height 2
|
||||
color #969799
|
||||
display flex
|
||||
.p
|
||||
width 20%
|
||||
.span
|
||||
width 80%
|
||||
.radio
|
||||
padding-top 0.2rem
|
||||
font-size 0.36rem
|
||||
color #969799
|
||||
|
||||
// 提示语样式
|
||||
.prompting
|
||||
flex 1
|
||||
font-size 0.24rem
|
||||
color red
|
||||
.prompting_m
|
||||
margin 0.2rem
|
||||
.prompting_cen
|
||||
text-align center
|
||||
// 按钮统一处理
|
||||
.account_sub
|
||||
padding 0.267rem 0.48rem
|
||||
.account_sub_top
|
||||
padding 0.267rem 0
|
||||
// 自定义面板组件的下划线
|
||||
// .mycell
|
||||
// &:not(:last-child)::after
|
||||
// position: absolute;
|
||||
// box-sizing: border-box;
|
||||
// content: ' ';
|
||||
// pointer-events: none;
|
||||
// right: 0;
|
||||
// bottom: 0;
|
||||
// left: 0.42667rem;
|
||||
// border-bottom: 0.02667rem solid #ebedf0;
|
||||
// transform: scaleY(.5);
|
||||
|
||||
// 边框
|
||||
.border_r
|
||||
border-right 0.01rem solid #eeeeee
|
||||
.border_b
|
||||
border-bottom 0.01rem solid #eeeeee
|
||||
|
||||
.task,
|
||||
.news
|
||||
.van-tab__pane
|
||||
overflow-y: scroll;
|
||||
8
滴滴淘/h5(1)/src/view/assets/stylus/tpl/colors.styl
Normal file
@@ -0,0 +1,8 @@
|
||||
// 公共颜色配置
|
||||
|
||||
// app 主题色
|
||||
$themeColor = #20c6c2
|
||||
$themeFontColor = #999
|
||||
$taskColor = #1ab51f
|
||||
|
||||
|
||||
22
滴滴淘/h5(1)/src/view/assets/stylus/tpl/mixins.styl
Normal file
@@ -0,0 +1,22 @@
|
||||
//公共css方法
|
||||
.img
|
||||
width 100%;
|
||||
height 100%;
|
||||
.flex
|
||||
display flex;
|
||||
.direction_column
|
||||
flex-direction column;
|
||||
.flex1
|
||||
flex 1;
|
||||
.flex_cen
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
align-content: center
|
||||
.pointer
|
||||
cursor pointer;
|
||||
border_bottom()
|
||||
border-bottom: 1px solid #ebedf0;
|
||||
|
||||
mt(a=10)
|
||||
unit(a, px)
|
||||
1
滴滴淘/h5(1)/src/view/components/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
985e0234-6659-4c29-8dd9-56637c6fd0fa
|
||||
70
滴滴淘/h5(1)/src/view/components/Address.vue
Normal file
@@ -0,0 +1,70 @@
|
||||
<template lang="pug">
|
||||
.Address
|
||||
van-field(clearable='', :label='areaTitle', disabled right-icon='arrow', :placeholder="area !== '选择地址'? area : areaText", @click="isPopup")
|
||||
//- 地址选择弹窗
|
||||
van-popup(v-model='show', position='bottom', :style="{ height: '40%' }")
|
||||
van-area( :value='value' :area-list="areaList" @confirm="onConfirm" @cancel="isPopup" show-toolbar :columns-num="level")
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import {Component, Provide, Vue, Prop} from 'vue-property-decorator';
|
||||
|
||||
type AreaType<T> = {
|
||||
[K in keyof T]: T[K]
|
||||
}
|
||||
interface AreaList {
|
||||
[id: string]: AreaType<object>[]
|
||||
}
|
||||
@Component
|
||||
export default class Address extends Vue {
|
||||
$http: any
|
||||
|
||||
// 回显的区id
|
||||
@Prop({default: '110101'}) readonly value!: string
|
||||
// 回显的文字
|
||||
@Prop({default: '选择地址'}) readonly areaText!: string
|
||||
// 回显的文字
|
||||
@Prop({default: '收货地址'}) readonly areaTitle!: string
|
||||
// 是否禁止弹出框弹出
|
||||
@Prop({default: false}) readonly isShow!: boolean
|
||||
// 是否禁止弹出框弹出
|
||||
@Prop({default: 3}) readonly level!: number
|
||||
|
||||
private show: Boolean = false
|
||||
|
||||
private area: string = '选择地址'
|
||||
private areaId: number[] = []
|
||||
|
||||
// 省市区数据
|
||||
private areaList: AreaList = {}
|
||||
|
||||
created() {
|
||||
this.getvantcity()
|
||||
}
|
||||
|
||||
private isPopup() {
|
||||
if(this.isShow) return;
|
||||
this.show = !this.show
|
||||
}
|
||||
|
||||
// 地址数据
|
||||
private async getvantcity(): Promise<void> {
|
||||
let res = await this.$http.PublicService.getvantcity()
|
||||
this.areaList = res
|
||||
}
|
||||
|
||||
// 确定选择城市
|
||||
private onConfirm(value: any, index: any): void {
|
||||
this.area = ''
|
||||
this.areaId = []
|
||||
value.forEach((v: any, i: number) => {
|
||||
this.area += (v.name + ' ')
|
||||
this.areaId.push(v.code)
|
||||
});
|
||||
this.show = !this.show
|
||||
this.$emit('confirm', this.areaId)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="stylus" scoped>
|
||||
|
||||
</style>
|
||||
126
滴滴淘/h5(1)/src/view/components/Choose.vue
Normal file
@@ -0,0 +1,126 @@
|
||||
<template lang="pug">
|
||||
.Choose
|
||||
div(v-for='it in data')
|
||||
.topic(v-for='(item, index) in optionConfig' :key='index' v-if='index == isType(it.item_type)')
|
||||
.title
|
||||
.topic_title {{item.title}}
|
||||
.topic_value.tv_b(v-if='!it.finish') 进行中
|
||||
.topic_value.tv_c(v-else) 已完成
|
||||
.center
|
||||
.text
|
||||
p(v-for='list in item.text') {{list}}
|
||||
.radio
|
||||
van-checkbox(v-model="item.checkbox" shape="square" icon-size='0.36rem' :disabled="isFinish" ) {{item.checkboxText}}
|
||||
.prompting 请按照任务要求完成选购环节,平台严惩任务欺诈行为
|
||||
van-button.my_button(type="primary" size="large" @click='purchaseDone' :disabled="isFinish") 我确认完成以上操作
|
||||
//- van-button.my_button(type="primary" size="large" color='#cccccc') 180s后可提交
|
||||
</template>
|
||||
<script lang="ts">
|
||||
// 进店组件
|
||||
import {Component, Provide, Vue, Prop} from 'vue-property-decorator';
|
||||
|
||||
@Component({})
|
||||
export default class Choose extends Vue {
|
||||
$http: any
|
||||
|
||||
@Prop({default: {}}) readonly data: any
|
||||
@Prop({default: ''}) readonly id!: string
|
||||
|
||||
// 是否完成
|
||||
private isFinish: boolean = true
|
||||
|
||||
private optionConfig: any = [
|
||||
{
|
||||
title: '宝贝浏览',
|
||||
text: [
|
||||
'浏览宝贝的说明文字'
|
||||
],
|
||||
checkboxText: '我已完成宝贝浏览',
|
||||
type: 'item_scan',
|
||||
checkbox: false
|
||||
},{
|
||||
title: '拍前咨询',
|
||||
text: [
|
||||
'浏览宝贝的说明文字'
|
||||
],
|
||||
checkboxText: '我已完成拍前咨询',
|
||||
type: 'item_chat',
|
||||
checkbox: false
|
||||
},{
|
||||
title: '宝贝收藏',
|
||||
text: [
|
||||
'浏览宝贝的说明文字'
|
||||
],
|
||||
checkboxText: '我已完成宝贝收藏',
|
||||
type: 'item_collect',
|
||||
checkbox: false
|
||||
},{
|
||||
title: '加入购物车',
|
||||
text: [
|
||||
'浏览宝贝的说明文字'
|
||||
],
|
||||
checkboxText: '我已完成加入购物车',
|
||||
type: 'item_cart',
|
||||
checkbox: false
|
||||
}
|
||||
]
|
||||
private created(): void {
|
||||
this.isCheckbox()
|
||||
}
|
||||
private isType(str: string): number | undefined {
|
||||
switch (str) {
|
||||
case 'item_scan':
|
||||
return 0
|
||||
break;
|
||||
case 'item_chat':
|
||||
return 1
|
||||
break;
|
||||
case 'item_collect':
|
||||
return 2
|
||||
break;
|
||||
case 'item_cart':
|
||||
return 3
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private async purchaseDone(): Promise<void> {
|
||||
let obj = this.optionConfig
|
||||
let data = {
|
||||
task_id: this.id
|
||||
}
|
||||
obj.forEach((v: any, i:number) => {
|
||||
if(v.checkbox){
|
||||
Object.assign(data, { [v.type]: 1})
|
||||
}else{
|
||||
Object.assign(data, { [v.type]: ''})
|
||||
}
|
||||
});
|
||||
let res = await this.$http.TaskService.purchaseDone(data)
|
||||
setTimeout(() => {
|
||||
this.$emit('click')
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
private isCheckbox(): void {
|
||||
let data = this.data
|
||||
for(let it in data){
|
||||
this.optionConfig[this.isType(data[it].item_type) as number].checkbox = data[it].finish
|
||||
// 循环接口中的所有数据判断是否完成当前step的所有步骤
|
||||
// 如果全部完成则不需要修改isFinish如果有未完成的则修改isFinish为可修改
|
||||
if(!data[it].finish){
|
||||
this.isFinish = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="stylus">
|
||||
.Choose
|
||||
.van-checkbox__label
|
||||
color red
|
||||
.my_button
|
||||
margin-top 0.4rem
|
||||
</style>
|
||||
41
滴滴淘/h5(1)/src/view/components/CountDown.vue
Normal file
@@ -0,0 +1,41 @@
|
||||
<template lang="pug">
|
||||
span.CountDown {{timeText}}
|
||||
</template>
|
||||
<script lang="ts">
|
||||
// 倒计时组件
|
||||
import {Component, Vue, Prop} from 'vue-property-decorator';
|
||||
|
||||
@Component({})
|
||||
export default class CountDown extends Vue {
|
||||
$utils: any
|
||||
|
||||
@Prop({default: 0}) readonly time!:number
|
||||
|
||||
private timeText: string = ''
|
||||
|
||||
private timer: number = NaN
|
||||
|
||||
private created(): void {
|
||||
this.fromDate()
|
||||
}
|
||||
|
||||
private beforeDestroy(): void {
|
||||
// 在页面销毁时关闭定时器
|
||||
clearInterval(this.timer)
|
||||
}
|
||||
|
||||
private fromDate(): void {
|
||||
this.timer = setInterval(()=>{
|
||||
let str: string = this.$utils.leftTimer(this.time)
|
||||
if(str == '任务已超时'){
|
||||
clearInterval(this.timer)
|
||||
}
|
||||
this.timeText = str
|
||||
},1000)
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="stylus" scoped>
|
||||
|
||||
</style>
|
||||
44
滴滴淘/h5(1)/src/view/components/CustomTabs.vue
Normal file
@@ -0,0 +1,44 @@
|
||||
<template lang="pug">
|
||||
.CustomTabs
|
||||
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {Component, Provide, Vue, Prop, Watch} from 'vue-property-decorator';
|
||||
import Icons from '@/components/Icons.vue'
|
||||
|
||||
@Component({
|
||||
components:{
|
||||
Icons
|
||||
}
|
||||
})
|
||||
export default class CustomTabs extends Vue {
|
||||
$utils: any;
|
||||
$http: any;
|
||||
|
||||
private active: number = 0;
|
||||
private SearchKey: String = "";
|
||||
|
||||
@Prop({ default: [] }) readonly list: Array<Object> | undefined
|
||||
@Prop({ default: 0 }) readonly index!: number
|
||||
|
||||
private created(): void {
|
||||
this.active = this.index
|
||||
}
|
||||
|
||||
private onClick(name: string, title: number): void {
|
||||
this.$emit('click', this.active)
|
||||
}
|
||||
|
||||
// @Watch('index')
|
||||
// private getIndex(n:number, o:number):void {
|
||||
// this.active = n
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="stylus">
|
||||
|
||||
</style>
|
||||
190
滴滴淘/h5(1)/src/view/components/EnterShop.vue
Normal file
@@ -0,0 +1,190 @@
|
||||
<template lang="pug">
|
||||
.EnterShop
|
||||
//- 如果type等于三则是淘口令
|
||||
.message(v-if="message.channel_info.type == 3")
|
||||
p 淘口令: {{message.channel_info.channel_value}}
|
||||
Icons.fuzhi( name="buyer-icon-fuzhi" color='#ccc' size='0.5' @click='$utils.copy(message.channel_info.channel_value)')
|
||||
//- 其他正常显示
|
||||
.message(v-else)
|
||||
p 搜索关键词: {{message.channel_info.channel_value}}
|
||||
p 搜索页价格: {{$utils.conversionMoney(message.channel_info.search_price)}}
|
||||
p 排序方式: {{message.channel_info.search_sort == 1?'默认排序':'销量排序'}}
|
||||
span.prompting 手动输入关键字,禁止复制粘贴
|
||||
van-collapse(class="collapse" :border="false" v-model='activeNames' accordion)
|
||||
van-collapse-item(
|
||||
v-for='(item, key, index) in data'
|
||||
:key='index'
|
||||
:name='index'
|
||||
:title="isTitle(item.item_type, item.process_id)"
|
||||
:value-class="item.finish?'tv_c':'tv_b'"
|
||||
:value="item.finish?'已完成':'进行中'"
|
||||
v-if="item.item_type !== 'task_start'")
|
||||
div(v-if="item.item_type == 'compare_price'")
|
||||
p.prompting 1. 在搜索结果页点击任意一个非"{{message.shop_info.shop_name}}"的宝贝
|
||||
p.prompting 2. 浏览宝贝的主图、详情不得少于3-5分钟,点击手机右上角"分享"
|
||||
p.prompting 3. 在分享页面点击"复制链接",获取淘口令提交平台完成货比
|
||||
van-field(v-model="item.detail" center clearable readonly v-if="item.finish" disabled)
|
||||
van-field(v-model="ambush[index]" center clearable placeholder="输入淘口令" @focus="$utils.onFocus" v-if="!item.finish")
|
||||
van-button(slot="button" size="small" type="primary" @click='setComparePrice(index,item.process_id)' :disabled="item.finish") 提交
|
||||
.prompting 系统自动检测淘口令,平台严惩任务欺诈行为
|
||||
div(v-if="item.item_type == 'verify_shop'")
|
||||
.message
|
||||
p 店铺名称: {{message.shop_info.shop_name}}
|
||||
p 店铺旺旺: {{message.shop_info.shop_wangwang}}
|
||||
p 店铺类型: {{message.shop_info.platform_id == 10?'淘宝':'天猫'}}
|
||||
.uploader(v-if="item.finish===false")
|
||||
span 搜索截图:
|
||||
.alipay_img
|
||||
van-uploader(v-model="fileList1" multiple :max-count='1' :deletable='false')
|
||||
van-uploader(v-model='fileList2' multiple :max-count='1' :after-read='afterRead')
|
||||
van-field(v-model="item.detail" center clearable readonly v-if="item.finish" disabled)
|
||||
van-field(v-model="sms" center clearable placeholder="输入店铺名或淘口令" ref='input3' @focus="$utils.onFocus" v-if="!item.finish")
|
||||
van-button(slot="button" size="small" type="primary" @click='verifyShop' :disabled="item.finish") 提交
|
||||
.prompting
|
||||
p 1.淘宝店铺名无法验证,请联系平台客服
|
||||
p 2.禁止使用淘宝客,农村淘宝等一切返利
|
||||
//- div(v-if="item.item_type == 'task_start'")
|
||||
//- p 开始时间: {{$utils.formatDate(item.finish_time)}}
|
||||
</template>
|
||||
<script lang="ts">
|
||||
// 进店组件
|
||||
import {Component, Provide, Vue, Prop, Watch} from 'vue-property-decorator';
|
||||
import Icons from '@/components/Icons.vue'
|
||||
|
||||
@Component({
|
||||
components:{
|
||||
Icons
|
||||
}
|
||||
})
|
||||
export default class EnterShop extends Vue {
|
||||
$http: any
|
||||
$utils: any
|
||||
$refs: any
|
||||
|
||||
// 仅渲染列表需要的数据
|
||||
@Prop({default: {}}) readonly data!: any
|
||||
|
||||
// 全部数据
|
||||
@Prop({default: {}}) readonly message!: any
|
||||
|
||||
private activeNames: string[] = ['0'];
|
||||
|
||||
// 淘口令
|
||||
private ambush: any = []
|
||||
|
||||
private sms: string = ''
|
||||
|
||||
private fileList1: any[] = [
|
||||
{ url: 'http://static.alkid888.com/example/verifyShop.jpg' }
|
||||
]
|
||||
|
||||
private fileList2: any[] = []
|
||||
|
||||
private imgId: string = ''
|
||||
|
||||
private async setComparePrice(index: number,process_id: string): Promise<void> {
|
||||
if(this.ambush[index] == void 0 || this.ambush[index] == ''){
|
||||
this.$toast('请输入淘口令')
|
||||
return
|
||||
}
|
||||
|
||||
let data = {
|
||||
task_id: String(this.message.base_info.id),
|
||||
process_id: String(process_id),
|
||||
compare_item_value: this.ambush[index]
|
||||
}
|
||||
let res = await this.$http.TaskService.setComparePrice(data)
|
||||
setTimeout(()=>{
|
||||
this.$emit('click')
|
||||
},2000)
|
||||
}
|
||||
|
||||
private async verifyShop(): Promise<void> {
|
||||
if(this.imgId == ''){
|
||||
this.$toast('请上传搜索截图')
|
||||
return
|
||||
}
|
||||
if(this.sms == ''){
|
||||
this.$toast('请输入店铺名或淘口令')
|
||||
return
|
||||
}
|
||||
let data = {
|
||||
task_id: String(this.message.base_info.id),
|
||||
verify_value: this.sms,
|
||||
image_id: this.imgId
|
||||
}
|
||||
let res = await this.$http.TaskService.verifyShop(data)
|
||||
this.$emit('click')
|
||||
}
|
||||
|
||||
// 支付宝图片上传
|
||||
private async afterRead(cell: any): Promise<void> {
|
||||
let fd = new FormData()
|
||||
fd.append('file', cell.file)
|
||||
fd.append('imageType', '4')
|
||||
let res = await this.$http.PublicService.uploadImg(fd)
|
||||
this.imgId = res.id
|
||||
}
|
||||
|
||||
// 显示手风琴标题
|
||||
private isTitle(str: string, process_id: number): string | undefined {
|
||||
switch (str) {
|
||||
case 'task_start':
|
||||
return '开始任务'
|
||||
break;
|
||||
case 'compare_price':
|
||||
return `货比${this.isIndex(process_id)}家`
|
||||
break;
|
||||
case 'verify_shop':
|
||||
return '店铺确认'
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 判断货比
|
||||
private isIndex(id: number): number | undefined {
|
||||
switch (id) {
|
||||
case 311:
|
||||
return 1
|
||||
case 312:
|
||||
return 2
|
||||
case 313:
|
||||
return 3
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="stylus">
|
||||
.EnterShop
|
||||
.van-field__body
|
||||
background-color #ccc
|
||||
.van-cell:not(:last-child)::after
|
||||
display none
|
||||
.message
|
||||
padding 0.24rem 0.253rem
|
||||
width 100%
|
||||
background #e5fffe
|
||||
box-sizing border-box
|
||||
font-size 13px
|
||||
color #969799
|
||||
line-height 1.5
|
||||
p
|
||||
line-height 1.8
|
||||
.uploader
|
||||
margin-top 0.4rem
|
||||
display flex
|
||||
.alipay_img
|
||||
flex 1
|
||||
display flex
|
||||
align-items center
|
||||
span
|
||||
margin-right 0.2rem
|
||||
.tips
|
||||
font-size 0.24rem
|
||||
color #ccc
|
||||
.fuzhi
|
||||
vertical-align middle
|
||||
margin-left 0.2rem
|
||||
</style>
|
||||
79
滴滴淘/h5(1)/src/view/components/Evaluate.vue
Normal file
@@ -0,0 +1,79 @@
|
||||
<template lang="pug">
|
||||
.Evaluate
|
||||
.topic
|
||||
.title
|
||||
.topic_title 本金返还
|
||||
.topic_value.tv_c(v-if='data.order_refund.finish') 已完成
|
||||
.topic_value.tv_b(v-else) 进行中
|
||||
.center.flex
|
||||
.text
|
||||
p 下单时间: {{$utils.formatDate(data.order_refund.trade_time)}}
|
||||
p 返款时间: {{$utils.formatDate(data.order_refund.refund_time)}}
|
||||
p 返款金额: {{$utils.conversionMoney(data.order_refund.refund_amount)}}
|
||||
span.prompting ({{data.order_refund.amount_confirm?'商家已确认':'商家未确认'}})
|
||||
p 收款账户: {{data.order_refund.refund_account}}
|
||||
FinishPrompt
|
||||
.topic
|
||||
.title
|
||||
.topic_title 确认收货
|
||||
.topic_value.tv_c(v-if='data.order_receive.finish') 已完成
|
||||
.topic_value.tv_b(v-else) 进行中
|
||||
.center
|
||||
.text
|
||||
p 收货姓名: {{data.order_receive.receiver}}
|
||||
p 收货地址: {{spellAdd(data.order_receive.address)}}
|
||||
.topic
|
||||
.title
|
||||
.topic_title 任务评价
|
||||
.topic_value.tv_b(v-if='data.order_comment.finish') 已完成
|
||||
.topic_value.tv_c(v-else) 进行中
|
||||
.center
|
||||
.text
|
||||
.comment_text {{data.order_comment.comment_text}}
|
||||
van-button.my_button(type="primary" block @click='confirmAccept' :disabled="isFinish" ) 确认收货
|
||||
</template>
|
||||
<script lang="ts">
|
||||
// 进店组件
|
||||
import {Component, Provide, Vue, Prop} from 'vue-property-decorator';
|
||||
import FinishPrompt from '@/components/FinishPrompt.vue'
|
||||
|
||||
@Component({
|
||||
components:{
|
||||
FinishPrompt
|
||||
}
|
||||
})
|
||||
export default class Evaluate extends Vue {
|
||||
$http: any
|
||||
$utils: any
|
||||
|
||||
@Prop({default: {}}) readonly data!: any
|
||||
@Prop({default: ''}) readonly id!: string
|
||||
|
||||
// 是否完成
|
||||
@Prop({default:false}) readonly isFinish!: boolean
|
||||
|
||||
private radio: string = ''
|
||||
|
||||
private spellAdd(data: any): string {
|
||||
return data.province+data.city+data.country+data.detail
|
||||
}
|
||||
private async created(): Promise<void>{
|
||||
console.log(typeof this.data.order_receive.finish)
|
||||
}
|
||||
private async confirmAccept(): Promise<void> {
|
||||
let res = await this.$http.TaskService.confirmAccept(this.id)
|
||||
setTimeout(() => {
|
||||
this.$emit('click')
|
||||
}, 2000);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="stylus">
|
||||
.Evaluate
|
||||
.my_button
|
||||
margin-top 0.4rem
|
||||
.comment_text
|
||||
color #ff0000
|
||||
font-size 0.4rem
|
||||
line-height 1.8
|
||||
</style>
|
||||
30
滴滴淘/h5(1)/src/view/components/FinanceRecord.vue
Normal file
@@ -0,0 +1,30 @@
|
||||
<template lang="pug">
|
||||
.FinanceRecord
|
||||
.news_item(v-for="(item,index) in itemArr" :key="index" v-if="item.model_type == 'FinanceRecord'")
|
||||
.item_title
|
||||
h2 资金到账
|
||||
span {{ $utils.formatAge(item.update_time) }}
|
||||
.item_content
|
||||
.content_left
|
||||
p.df 资金类型: {{item.notice.remark}}
|
||||
p.yj 到账金额:¥{{item.notice.amount / 100}}
|
||||
p.df 关联任务: {{item.notice.model_id}}
|
||||
//- .content_right(@click="showInfo(item.id)") 查看任务
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Prop, Vue } from 'vue-property-decorator';
|
||||
|
||||
@Component({})
|
||||
export default class FinanceRecord extends Vue {
|
||||
@Prop({default: [] }) readonly itemArr!: Array<object>;
|
||||
|
||||
public showInfo (id: number): void {
|
||||
alert(`查看任务,任务id为:${id}`)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="stylus">
|
||||
|
||||
</style>
|
||||
10
滴滴淘/h5(1)/src/view/components/FinishPrompt.vue
Normal file
@@ -0,0 +1,10 @@
|
||||
<template lang="pug">
|
||||
.prompting
|
||||
p 下单后24小时之内返本金,超时未返款,请联系平台客服,禁止旺旺联系商家,一经发现,立即封号处理!
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import {Component, Provide, Vue, Prop} from 'vue-property-decorator';
|
||||
|
||||
@Component({})
|
||||
export default class FinishPrompt extends Vue {}
|
||||
</script>
|
||||
23
滴滴淘/h5(1)/src/view/components/Icons.vue
Normal file
@@ -0,0 +1,23 @@
|
||||
<template lang="pug">
|
||||
i.icons( :class="'buyer-font '+name" :style='`font-size:${size}rem;color:${color};`' @click='onClick')
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import {Component, Provide, Vue, Prop} from 'vue-property-decorator';
|
||||
|
||||
@Component
|
||||
export default class Icons extends Vue {
|
||||
@Prop({default:''}) readonly name!: string
|
||||
@Prop({default:''}) readonly color!: string
|
||||
@Prop({default:'0.2'}) readonly size!: string
|
||||
|
||||
private onClick() :void {
|
||||
this.$emit('click')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="stylus" scoped>
|
||||
.icons
|
||||
display inline-block
|
||||
box-sizing border-box
|
||||
line-height normal
|
||||
</style>
|
||||
89
滴滴淘/h5(1)/src/view/components/Matter.vue
Normal file
@@ -0,0 +1,89 @@
|
||||
<template lang="pug">
|
||||
.matter
|
||||
van-popup(v-model="show" :style="{ width: '80%' }" :close-on-click-overlay='false')
|
||||
.matter_center
|
||||
.title 注意事项
|
||||
.text
|
||||
p(v-for='(item, index) in taskMsg' :key='index') {{index+1}}.{{item}}
|
||||
.button( :class=" time<=0 ? '':'button_c'" @click='onClick')
|
||||
span.time(v-if='time > 0') {{time}}
|
||||
span 关闭
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import {Component, Provide, Vue, Prop} from 'vue-property-decorator';
|
||||
|
||||
@Component
|
||||
export default class Matter extends Vue {
|
||||
name = '任务注意事项组件'
|
||||
|
||||
$utils: any
|
||||
|
||||
@Prop({default:''}) readonly id!:string
|
||||
@Prop({default: []}) readonly taskMsg!: string[]
|
||||
|
||||
private show: boolean = true
|
||||
|
||||
// 倒计时时间
|
||||
private time: number = 0
|
||||
|
||||
private created():void {
|
||||
let isMatter: any = this.$utils.getStorage(`isMatter${this.id}`) as any || 0
|
||||
if((Date.parse(String(new Date())) - isMatter) > 24*60*60*1000){
|
||||
this.$utils.delStorage(`isMatter${this.id}`)
|
||||
this.time = 8
|
||||
}
|
||||
this.countDown()
|
||||
}
|
||||
|
||||
private countDown(): void {
|
||||
if(this.time > 0){
|
||||
--this.time
|
||||
setTimeout(()=>{
|
||||
this.countDown()
|
||||
},1000)
|
||||
}
|
||||
}
|
||||
|
||||
private onClick(): void {
|
||||
if(this.time <= 0){
|
||||
this.show = !this.show
|
||||
this.$utils.setStorage(`isMatter${this.id}`,Date.parse(String(new Date())))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="stylus" scoped>
|
||||
.matter
|
||||
.van-popup--center
|
||||
border-radius 0.1rem
|
||||
.matter_center
|
||||
background-color #ffffff
|
||||
padding 0.32rem
|
||||
.title
|
||||
font-size 0.42rem
|
||||
font-weight 500
|
||||
text-align center
|
||||
margin 0.3rem 0
|
||||
.text
|
||||
color red
|
||||
font-size 0.36rem
|
||||
max-height 5rem
|
||||
overflow-y scroll
|
||||
p
|
||||
line-height 1.5
|
||||
.button
|
||||
font-size 0.42rem
|
||||
height 0.8rem
|
||||
width 2.5rem
|
||||
color #ffffff
|
||||
background-color #ff976a
|
||||
text-align center
|
||||
line-height 0.8rem
|
||||
margin 0.4rem auto 0.2rem
|
||||
border-radius inherit
|
||||
.time
|
||||
margin-right 0.2rem
|
||||
.button_c
|
||||
background-color #ccc
|
||||
</style>
|
||||
75
滴滴淘/h5(1)/src/view/components/MyCell.vue
Normal file
@@ -0,0 +1,75 @@
|
||||
<template lang="pug">
|
||||
//- 面板组件
|
||||
.mycell.van-cell(@click='onClick')
|
||||
Icons.Icons.mr(:name='icon' :size='size' :color='color' v-if="icon !== ''")
|
||||
.cell__title
|
||||
span {{title}}
|
||||
.cell__value
|
||||
slot
|
||||
van-icon.Icons(name="arrow" v-if='isLink' size='0.42667rem' color='#969799')
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import {Component, Prop, Vue} from 'vue-property-decorator';
|
||||
import Icons from '@/components/Icons.vue'
|
||||
|
||||
@Component({
|
||||
components:{
|
||||
Icons
|
||||
}
|
||||
})
|
||||
export default class Fund extends Vue {
|
||||
// 标题名称
|
||||
@Prop({default:''}) protected title!:string
|
||||
|
||||
// 左边icon
|
||||
@Prop({default:''}) protected icon!:string
|
||||
|
||||
// 左边icon 大小
|
||||
@Prop({default:'0.6'}) protected size!:string
|
||||
|
||||
// 左边icon 颜色
|
||||
@Prop({default:''}) protected color!:string
|
||||
|
||||
// 是否显示右边箭头
|
||||
@Prop({default: false}) protected isLink!:boolean
|
||||
|
||||
// 跳转地址
|
||||
@Prop({default: ''}) protected to!:string
|
||||
|
||||
private onClick(): void {
|
||||
if(this.to !== void 0 && this.to !== '' ){
|
||||
this.$router.push(this.to)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="stylus" scoped>
|
||||
.mycell
|
||||
position: relative;
|
||||
display: flex;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
padding: 0.26667rem 0.42667rem;
|
||||
overflow: hidden;
|
||||
color: #323233;
|
||||
font-size: 0.37333rem;
|
||||
line-height: 0.64rem;
|
||||
background-color: #fff;
|
||||
.mr
|
||||
margin-right 0.2rem
|
||||
.Icons
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
align-content: center
|
||||
.cell__title
|
||||
flex: none;
|
||||
width: 2.4rem;
|
||||
.cell__value
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
color: #969799;
|
||||
vertical-align: middle;
|
||||
word-wrap: break-word;
|
||||
flex 1
|
||||
</style>
|
||||
51
滴滴淘/h5(1)/src/view/components/MyPanel.vue
Normal file
@@ -0,0 +1,51 @@
|
||||
<template lang="pug">
|
||||
.MyPanel
|
||||
.title
|
||||
Icons(:name='icon' :size='size' color='#ccc' v-if="icon !== ''")
|
||||
.title_text {{title}}
|
||||
.title_tips {{tips}}
|
||||
.center
|
||||
slot
|
||||
</template>
|
||||
<script lang="ts">
|
||||
// 面板组件
|
||||
import {Component, Provide, Vue, Prop} from 'vue-property-decorator';
|
||||
import Icons from '@/components/Icons.vue'
|
||||
|
||||
@Component({
|
||||
components:{
|
||||
Icons
|
||||
}
|
||||
})
|
||||
export default class MyPanel extends Vue {
|
||||
|
||||
// icon的http链接后期改成css需要修改
|
||||
@Prop({default: ''}) readonly icon!: string
|
||||
|
||||
// icon大小
|
||||
@Prop({default: '0.4'}) readonly size!: string
|
||||
|
||||
// 标题文字
|
||||
@Prop({default: '标题'}) readonly title!: string
|
||||
|
||||
// 标题右侧提示语
|
||||
@Prop({default: ''}) readonly tips!: string
|
||||
}
|
||||
</script>
|
||||
<style lang="stylus" scoped>
|
||||
.MyPanel
|
||||
padding 0 0.42667rem
|
||||
.title
|
||||
padding 0.26667rem 0.22667rem 0
|
||||
display flex
|
||||
align-items center
|
||||
img
|
||||
width auto
|
||||
.title_text
|
||||
margin-left 0.2rem
|
||||
font-size 0.42rem
|
||||
.title_tips
|
||||
text-align right
|
||||
font-size 0.24rem
|
||||
color red
|
||||
</style>
|
||||
30
滴滴淘/h5(1)/src/view/components/Navbar.vue
Normal file
@@ -0,0 +1,30 @@
|
||||
<template lang="pug">
|
||||
van-nav-bar(:title="title",
|
||||
:fixed="true"
|
||||
:left-arrow="showLeft",
|
||||
@click-left='onClickLeft')
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {Component, Provide, Vue, Prop} from 'vue-property-decorator';
|
||||
|
||||
@Component
|
||||
export default class Navbar extends Vue {
|
||||
// 标题栏文字
|
||||
@Prop({ default: '' }) readonly title: String | undefined
|
||||
// 是否展示左边返回按钮
|
||||
@Prop({ default: false }) readonly showLeft: boolean | undefined
|
||||
$router: any;
|
||||
|
||||
private onClickLeft(): void {
|
||||
this.$router.go(-1)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="stylus">
|
||||
.van-nav-bar .van-icon
|
||||
color #666
|
||||
.van-nav-bar--fixed
|
||||
z-index 999
|
||||
</style>
|
||||
45
滴滴淘/h5(1)/src/view/components/NewsItem.vue
Normal file
@@ -0,0 +1,45 @@
|
||||
<template lang="pug">
|
||||
.NewsItem
|
||||
.news_item(v-for="(item,index) in itemArr" :key="index" v-if="item.model_type == 'TaskNotice'")
|
||||
.item_title
|
||||
h2 任务编号{{item.notice.notice_content.task_id}}
|
||||
span {{ $utils.formatAge(item.notice.notice_content.step_time) }}
|
||||
.item_content
|
||||
.content_left
|
||||
.name
|
||||
//- Icons(v-if='item.notice.platform_id == 10' name="buyer-icon-taobao_" color='#ff5000' size='0.5')
|
||||
//- Icons( v-else name="buyer-icon-tianmaobao" color='#FF0036' size='0.5')
|
||||
span 任务买号: {{item.notice.notice_content.account_text}}
|
||||
p.df 任务佣金:¥{{$utils.conversionMoney(item.notice.notice_content.commission)}}
|
||||
p.yj 任务状态:{{item.notice.notice_content.step_text}}
|
||||
p.df 消息时间:{{ $utils.formatDate(item.update_time) }}
|
||||
.content_right(@click="showInfo(item.id)") 查看任务
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {Component, Prop, Vue} from 'vue-property-decorator';
|
||||
import Icons from '@/components/Icons.vue';
|
||||
|
||||
@Component({
|
||||
components:{
|
||||
Icons
|
||||
}
|
||||
})
|
||||
export default class NewsItem extends Vue {
|
||||
$utils: any
|
||||
|
||||
@Prop({default: [] }) readonly itemArr!: Array<object>;
|
||||
|
||||
async created() {
|
||||
|
||||
}
|
||||
|
||||
public showInfo(id: number): void{
|
||||
this.$router.push(`/taskInfo?id=${id}`)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="stylus">
|
||||
|
||||
</style>
|
||||
112
滴滴淘/h5(1)/src/view/components/PlaceOrder.vue
Normal file
@@ -0,0 +1,112 @@
|
||||
<template lang="pug">
|
||||
.PlaceOrder
|
||||
.topic
|
||||
.title
|
||||
.topic_title 下单信息
|
||||
.topic_value.tv_b(v-if='!isFinish') 进行中
|
||||
.topic_value.tv_c(v-else) 已完成
|
||||
.center
|
||||
.text
|
||||
.text_separate
|
||||
.p 店铺名称:
|
||||
.span {{data.shop_info.shop_name}}
|
||||
.text_separate
|
||||
.p 宝贝标题:
|
||||
.span {{data.sku_info.spu_title}}
|
||||
.text_separate
|
||||
.p 宝贝规格:
|
||||
.span {{data.sku_info.sku_title}}
|
||||
.text_separate
|
||||
.p 宝贝单价:
|
||||
.span {{$utils.conversionMoney(data.sku_info.sku_price)}}
|
||||
.text_separate
|
||||
.p 购买数量:
|
||||
.span {{data.sku_info.order_num}}
|
||||
.topic(v-for='(item, index) in data.coupon_info' :key='index')
|
||||
.title
|
||||
.topic_title 优惠卷
|
||||
.topic_value.tv_b(v-if='!isFinish') 进行中
|
||||
.topic_value.tv_c(v-else) 已完成
|
||||
.center
|
||||
.text
|
||||
.text_f
|
||||
p 优惠名称: {{item.title}}
|
||||
p 优惠类型: {{item.coupon_type_text}}
|
||||
.text_f
|
||||
p 领取位置: {{item.coupon_position_text}}
|
||||
p 优惠金额: {{$utils.conversionMoney(item.coupon_amount)}}
|
||||
.topic
|
||||
.title
|
||||
.topic_title 其他费用
|
||||
.topic_value.tv_b(v-if='!isFinish') 进行中
|
||||
.topic_value.tv_c(v-else) 已完成
|
||||
.center
|
||||
.text
|
||||
.addition_text {{this.data.process_flow.item_order.order_addition.addition_text}}
|
||||
van-field(placeholder="请填写订单编号" v-model='trade_num' @focus="$utils.onFocus" v-bind:disabled="this.isFinish" v-bind:readonly="this.isFinish")
|
||||
.prompting.prompting_m 再次核对商家店铺名称与下单买号,避免拍错店铺或者用错买号
|
||||
van-field(placeholder="请填写实付金额" type='number' v-model='amount' @focus="$utils.onFocus" v-bind:disabled="this.isFinish" v-bind:readonly="this.isFinish")
|
||||
.prompting.prompting_m 商家无特殊要求,一律禁止使用花呗,信用卡付款
|
||||
.placeOrder_button
|
||||
van-button(type="primary" size="large" @click='buyerOrder' v-bind:disabled="this.isFinish") 提交订单号
|
||||
</template>
|
||||
<script lang="ts">
|
||||
// 进店组件
|
||||
import {Component, Provide, Vue, Prop} from 'vue-property-decorator';
|
||||
|
||||
@Component({})
|
||||
export default class PlaceOrder extends Vue {
|
||||
$http: any
|
||||
$utils: any
|
||||
|
||||
@Prop({default: {} }) readonly data!: any
|
||||
|
||||
@Prop({default: false }) readonly isFinish!: boolean
|
||||
|
||||
private trade_num: string =''
|
||||
|
||||
private amount: string =''
|
||||
private async created(): Promise<void> {
|
||||
let that =this;
|
||||
if(this.data.process_flow.item_order.trade_info.hasOwnProperty('trade_num')){
|
||||
that.trade_num = this.data.process_flow.item_order.trade_info.trade_num
|
||||
}
|
||||
if(this.data.process_flow.item_order.trade_info.hasOwnProperty('trade_amount')){
|
||||
that.amount = that.$utils.conversionMoney(+this.data.process_flow.item_order.trade_info.trade_amount)
|
||||
}
|
||||
|
||||
}
|
||||
private async buyerOrder(): Promise<void> {
|
||||
console.log(this.data.process_flow.item_order.trade_info.trade_amount)
|
||||
if(this.trade_num == ''){
|
||||
this.$toast('请填写订单编号')
|
||||
return
|
||||
}
|
||||
if(this.amount == ''){
|
||||
this.$toast('请填写实付金额')
|
||||
return
|
||||
}
|
||||
let data = {
|
||||
task_id: String(this.data.base_info.id),
|
||||
trade_num: this.trade_num,
|
||||
amount: this.amount
|
||||
}
|
||||
let res = await this.$http.TaskService.buyerOrder(data)
|
||||
setTimeout(() => {
|
||||
this.$emit('click')
|
||||
}, 2000);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="stylus">
|
||||
.PlaceOrder
|
||||
.van-cell
|
||||
margin-top 0.1rem
|
||||
background-color #eee
|
||||
.placeOrder_button
|
||||
margin-top 0.4rem
|
||||
.addition_text
|
||||
color #ff0000
|
||||
font-size 0.4rem
|
||||
line-height 1.8
|
||||
</style>
|
||||
24
滴滴淘/h5(1)/src/view/components/SystemNotice.vue
Normal file
@@ -0,0 +1,24 @@
|
||||
<template lang="pug">
|
||||
.SystemNotice
|
||||
.news_item(v-for="(item,index) in itemArr" :key="index" v-if="item.model_type == 'SystemNotice'")
|
||||
.item_title
|
||||
h2 {{ item.notice.notice_title }}
|
||||
span {{ $utils.formatAge(item.update_time) }}
|
||||
.item_content {{ item.notice.notice_content }}
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Prop, Vue } from 'vue-property-decorator';
|
||||
|
||||
@Component({})
|
||||
export default class SystemNotice extends Vue {
|
||||
@Prop({default: [] }) readonly itemArr!: Array<object>;
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="stylus">
|
||||
.item_content
|
||||
font-size 14px
|
||||
padding-left 0.1rem !important
|
||||
|
||||
</style>
|
||||
32
滴滴淘/h5(1)/src/view/components/Tabbar.vue
Normal file
@@ -0,0 +1,32 @@
|
||||
<template lang="pug">
|
||||
van-tabbar(class="tabbar" v-model='active' route @change="onChange")
|
||||
van-tabbar-item(:icon='item.icon' :to="item.href" v-for="(item,index) in TabBarList" :key="index" :info="index === 2?getNewsNum:''") {{item.title}}
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {Component, Provide, Vue} from 'vue-property-decorator';
|
||||
import { Getter } from 'vuex-class'
|
||||
|
||||
@Component
|
||||
export default class Tabbar extends Vue {
|
||||
|
||||
@Getter('getNewsNum') getNewsNum: any
|
||||
|
||||
private active: number = 0;
|
||||
private TabBarList: Array<Object> = [
|
||||
{ title: '首页', icon: ' buyer-font buyer-icon-shouye', href: '/home' },
|
||||
{ title: '任务', icon: ' buyer-font buyer-icon-renwu', href: '/task' },
|
||||
{ title: '消息', icon: ' buyer-font buyer-icon-xiaoxi', href: '/news' },
|
||||
{ title: '我的', icon: ' buyer-font buyer-icon-wode', href: '/my' },
|
||||
];
|
||||
|
||||
private onChange(index: number): void {
|
||||
console.log(index);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="stylus">
|
||||
.tabbar
|
||||
background #f6f6f6
|
||||
</style>
|
||||
98
滴滴淘/h5(1)/src/view/components/TaskHallItem.vue
Normal file
@@ -0,0 +1,98 @@
|
||||
<template lang="pug">
|
||||
.TaskHallItem
|
||||
.list-item(v-for="(item,index) in item" :key="index" @click="itemSendBroadcast(item, index)" :class="index == active?'active_shadow':'active_is'")
|
||||
.item-left
|
||||
Icons.Icons(v-if='item.account_type == 10' name="buyer-icon-taobao_" color='#ff5000' size='1.507')
|
||||
Icons.Icons(v-else name="buyer-icon-tianmaobao" color='#FF0036' size='1.507')
|
||||
.left-info
|
||||
p 账号: {{ item.account }}
|
||||
span 今日已接收任务{{ item.today_task }}/{{ item.today_task_limit }}
|
||||
.item-right(v-if="item.status == 1") 已经认证
|
||||
.item-right.item-right_color(v-if="item.status == -1") 认证失败
|
||||
.item-right.item-right_color(v-if="item.status == 0") 认证中
|
||||
.item-right.item-right_color(v-if="item.status == -9") 拒绝认证
|
||||
.active(v-if='index == active')
|
||||
Icons(v-if='item.account_type == 10' name="buyer-icon--jiaobiao-xuanzhong" color='#07c160' size='0.8')
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
|
||||
import {Component, Provide, Vue, Prop} from 'vue-property-decorator';
|
||||
import Icons from '@/components/Icons.vue'
|
||||
|
||||
@Component({
|
||||
components:{
|
||||
Icons
|
||||
}
|
||||
})
|
||||
export default class TaskHallItem extends Vue {
|
||||
|
||||
@Prop({default: [] }) readonly item!: Array<any>;
|
||||
private TaskItemBroadcast = new BroadcastChannel('TaskItemClick');
|
||||
|
||||
private active: number = NaN
|
||||
|
||||
async created() {
|
||||
|
||||
}
|
||||
|
||||
public itemSendBroadcast(data: {[key: string]: any}, index: number): void {
|
||||
if(data.status !== 1){
|
||||
this.$toast('买号必须认证通过才能接取任务')
|
||||
return
|
||||
}
|
||||
this.active = index
|
||||
this.TaskItemBroadcast.postMessage(data)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="stylus">
|
||||
.TaskHallItem
|
||||
margin-top: 0.48rem;
|
||||
.active_shadow
|
||||
box-shadow 0 2px 10px #23fd004f
|
||||
.active_is
|
||||
border 0.01rem solid #cccccc
|
||||
.list-item
|
||||
display flex
|
||||
justify-content space-between
|
||||
padding 0.28rem 0.307rem
|
||||
box-sizing border-box
|
||||
align-items center
|
||||
width 95%
|
||||
margin 0 auto
|
||||
margin-bottom 0.293rem
|
||||
position relative
|
||||
.item-left
|
||||
.Icons
|
||||
width 1.507rem
|
||||
height 1.507rem
|
||||
margin-right 0.587rem
|
||||
float left
|
||||
border-radius 100%
|
||||
.left-info
|
||||
float left
|
||||
padding-top 5px
|
||||
p
|
||||
color #333333
|
||||
font-size 16px
|
||||
span
|
||||
color #999999
|
||||
font-size 14px
|
||||
.item-right
|
||||
width 1.707rem
|
||||
height 0.613rem
|
||||
background #1ab51f
|
||||
text-align center
|
||||
color #fff
|
||||
font-size 12px
|
||||
line-height 0.643rem
|
||||
margin-right 0.6rem
|
||||
.item-right_color
|
||||
background-color red
|
||||
.active
|
||||
position absolute
|
||||
right -0.1rem
|
||||
bottom -0.18rem
|
||||
</style>
|
||||
136
滴滴淘/h5(1)/src/view/components/TaskTag.vue
Normal file
@@ -0,0 +1,136 @@
|
||||
<template lang="pug">
|
||||
.TaskTag
|
||||
div(v-if="isTask()")
|
||||
.message
|
||||
p 打标关键字: {{data.tag}}
|
||||
span.prompting 手动输入关键字,禁止复制粘贴
|
||||
//- 如果任务已经完成也就是 data.finish 是true 则隐藏
|
||||
div(v-if='!data.finish')
|
||||
.topic
|
||||
.title
|
||||
.topic_title 打标
|
||||
.topic_value.tv_b 进行中
|
||||
//- 已完成直接隐藏图片部分
|
||||
.center
|
||||
.uploader
|
||||
span 搜索截图:
|
||||
.alipay_img
|
||||
van-uploader(v-model="fileList1" multiple :max-count='1' :deletable='false')
|
||||
van-uploader(v-model='fileList2' multiple :max-count='1' :after-read='afterRead')
|
||||
van-button.my_button(type="primary" size="large" @click='setTaskTag' :disabled="data.finish") 提交
|
||||
.topic(v-else)
|
||||
.title
|
||||
.topic_title 打标
|
||||
.topic_value.tv_c 已完成
|
||||
.marking(v-else)
|
||||
p 打标关键字倒计时:
|
||||
CountDown( :time='data.next_time')
|
||||
span.prompting 打标间隔最少为12小时
|
||||
</template>
|
||||
<script lang="ts">
|
||||
// 进店组件
|
||||
import {Component, Provide, Vue, Prop, Watch} from 'vue-property-decorator';
|
||||
import Icons from '@/components/Icons.vue'
|
||||
import CountDown from '@/components/CountDown.vue'
|
||||
|
||||
@Component({
|
||||
components:{
|
||||
Icons,
|
||||
CountDown
|
||||
}
|
||||
})
|
||||
export default class TaskTag extends Vue {
|
||||
$http: any
|
||||
$utils: any
|
||||
|
||||
@Prop({default: {} }) readonly data!: any
|
||||
// 任务id
|
||||
@Prop({default: ''}) readonly id!: string
|
||||
|
||||
private fileList1: any[] = [
|
||||
{ url: 'https://img.yzcdn.cn/vant/leaf.jpg' }
|
||||
]
|
||||
|
||||
private fileList2: any[] = []
|
||||
|
||||
private imgId!: number
|
||||
|
||||
// 图片上传
|
||||
private async afterRead(cell: any): Promise<void> {
|
||||
let fd = new FormData()
|
||||
fd.append('file', cell.file)
|
||||
fd.append('imageType', '4')
|
||||
let res = await this.$http.PublicService.uploadImg(fd)
|
||||
this.imgId = res.id
|
||||
}
|
||||
|
||||
private async setTaskTag(): Promise<void> {
|
||||
if(this.imgId == void 0){
|
||||
this.$toast('请上传图片截图')
|
||||
return
|
||||
}
|
||||
let data = {
|
||||
task_id: this.id,
|
||||
process_id: this.data.process_id,
|
||||
tag_image: this.imgId
|
||||
}
|
||||
let res = await this.$http.TaskService.setTaskTag(data)
|
||||
setTimeout(() => {
|
||||
this.$emit('click')
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
// 如果返回true则代表任务开始,可以做任务了
|
||||
private isTask(): boolean {
|
||||
if(this.$utils.leftTimer(this.data.next_time) !== '任务已超时'){
|
||||
return false
|
||||
}else{
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="stylus" scoped>
|
||||
.TaskTag
|
||||
.van-field__body
|
||||
background-color #ccc
|
||||
.van-cell:not(:last-child)::after
|
||||
display none
|
||||
.message
|
||||
padding 0.24rem 0.253rem
|
||||
width 100%
|
||||
background #e5fffe
|
||||
box-sizing border-box
|
||||
font-size 13px
|
||||
color #969799
|
||||
line-height 1.5
|
||||
p
|
||||
line-height 1.8
|
||||
.uploader
|
||||
margin-top 0.4rem
|
||||
display flex
|
||||
.alipay_img
|
||||
flex 1
|
||||
display flex
|
||||
align-items center
|
||||
span
|
||||
margin-right 0.2rem
|
||||
padding 0.42667rem
|
||||
color #969799
|
||||
font-size 0.34667rem
|
||||
line-height 1.5
|
||||
background-color #fff
|
||||
.topic
|
||||
margin-top 0.2rem
|
||||
.marking
|
||||
margin-top 2rem
|
||||
padding 0.24rem 0.253rem
|
||||
box-sizing border-box
|
||||
font-size 0.34667rem
|
||||
color red
|
||||
text-align center
|
||||
span
|
||||
margin-top 0.2rem
|
||||
display inline-block
|
||||
</style>
|
||||
17
滴滴淘/h5(1)/src/view/components/test.vue
Normal file
@@ -0,0 +1,17 @@
|
||||
<template lang="pug">
|
||||
.test
|
||||
h3 测试子组件
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {Component, Provide, Vue} from 'vue-property-decorator';
|
||||
|
||||
@Component
|
||||
export default class Test extends Vue {
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="stylus">
|
||||
|
||||
</style>
|
||||
1
滴滴淘/h5(1)/src/view/pages/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
9b3f3449-84cd-4272-bf48-295d2c9ce78d
|
||||
413
滴滴淘/h5(1)/src/view/pages/AddAccount.vue
Normal file
@@ -0,0 +1,413 @@
|
||||
<template lang="pug">
|
||||
//- 添加账号
|
||||
.add_account.content
|
||||
NavbarComponent(:title="status == 0?'添加账号':'修改信息'" showLeft)
|
||||
.line
|
||||
van-field(v-model="account" placeholder="输入账号" label="账号")
|
||||
MyCell(title='性别')
|
||||
van-radio-group(v-model="gender")
|
||||
van-radio(name="1") 男
|
||||
van-radio(name="2") 女
|
||||
MyCell(title='花呗/白条')
|
||||
van-radio-group(v-model="credit")
|
||||
van-radio(name="0") 未开通
|
||||
van-radio(name="1") 已开通
|
||||
van-field(:placeholder="age.text == ''?'请选择年龄段':age.text" label="年龄段" disabled right-icon='arrow' @click='ageShow = true')
|
||||
van-field(v-model="points" placeholder="淘气值" label="淘气值")
|
||||
van-field(:placeholder="rate.text == ''?'信誉等级':rate.text" label="信誉等级" disabled right-icon='arrow' @click='levelShow = true')
|
||||
//- 最多选择三个
|
||||
van-field(clearable='', label='购买标签', disabled right-icon='arrow', :placeholder='labelName', @click="isPopup('show')")
|
||||
van-field(v-model="name" placeholder="输入姓名" label="收货人姓名")
|
||||
van-field(v-model="cellphone" type="tel" placeholder="输入手机号" label="收货人电话")
|
||||
Address(@confirm="onConfirm" :areaText='areaText' :value='areaIndex')
|
||||
van-field(v-model="detail" placeholder="地址详情" label="地址详情")
|
||||
.alipay
|
||||
.alipay_title 支付截图
|
||||
.alipay_img
|
||||
van-uploader(v-model="fileList1" multiple :deletable='false' :max-count='1')
|
||||
van-uploader(v-model="fileList2" multiple :max-count='1' :after-read='afterRead')
|
||||
.account_sub
|
||||
van-button(type='default' size='large' color='#20c6c2' @click='saveaccount') 提交
|
||||
//- 类目弹窗
|
||||
van-popup(v-model='show', closeable, :style="{ width: '80%' }")
|
||||
.category
|
||||
.category_list.pd30
|
||||
.row_list(v-for='(item,index) in label' :key='index' @click='changeLabel(index)')
|
||||
.row.flex_cen(:class="categoryId.indexOf(item.id) !== -1 ?'row_active':''") {{item.title}}
|
||||
.category_custom.pd30
|
||||
//- input( placeholder="自定义类目" type="text")
|
||||
.category_sub
|
||||
van-button(type='default' size='large' color='#20c6c2' @click='labelConfirm') 确定
|
||||
//- 信用等级选择
|
||||
van-popup(v-model='levelShow', position="bottom" )
|
||||
van-picker( :columns="level[type==10?0:1]" value-key='text' @cancel='levelShow = false' @confirm="onConfirmLevel" show-toolbar)
|
||||
//- 年龄段选择
|
||||
van-popup(v-model='ageShow', position="bottom" )
|
||||
van-picker( :columns="ageGroup" value-key='text' @cancel='ageShow = false' @confirm="onConfirmAge" show-toolbar)
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { Component, Provide, Vue, Inject } from "vue-property-decorator";
|
||||
import NavbarComponent from "@/components/Navbar.vue";
|
||||
import MyCell from "@/components/MyCell.vue";
|
||||
import Address from "@/components/Address.vue";
|
||||
import { Dialog } from 'vant';
|
||||
|
||||
type levelType = {
|
||||
text: string
|
||||
id: number
|
||||
}
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
MyCell,
|
||||
NavbarComponent,
|
||||
Address
|
||||
}
|
||||
})
|
||||
export default class AddAccount extends Vue {
|
||||
$http: any
|
||||
$utils: any
|
||||
|
||||
// 1淘宝2京东3拼多多
|
||||
private type: number = 1
|
||||
// 当前页面的状态对应买号列表的显示状态 0默认 1审核中 2已通过 -1 未通过
|
||||
private status: number = 0
|
||||
// 买号id 修改买号时需要
|
||||
private id: string = ''
|
||||
|
||||
// 信誉等级配置
|
||||
private level: Array<levelType[]> =[
|
||||
[{
|
||||
text: '3心',
|
||||
id: 1
|
||||
},{
|
||||
text: '4心',
|
||||
id: 2
|
||||
},{
|
||||
text: '5心',
|
||||
id: 3
|
||||
},{
|
||||
text: '一钻以上',
|
||||
id: 4
|
||||
}],[{
|
||||
text: '铜牌会员',
|
||||
id: 5
|
||||
},{
|
||||
text: '银牌会员',
|
||||
id: 6
|
||||
},{
|
||||
text: '金牌会员',
|
||||
id: 7
|
||||
},{
|
||||
text: '砖石会员',
|
||||
id: 8
|
||||
}]
|
||||
]
|
||||
|
||||
// 信誉等级弹出层控制
|
||||
private levelShow: boolean = false
|
||||
|
||||
// 年龄段
|
||||
private ageGroup: object[] = [
|
||||
{
|
||||
text: '18岁以下',
|
||||
id: 0
|
||||
},{
|
||||
text: '18-25岁',
|
||||
id: 1
|
||||
},{
|
||||
text: '26-30岁',
|
||||
id: 2
|
||||
},{
|
||||
text: '31-35岁',
|
||||
id: 3
|
||||
},{
|
||||
text: '36-40岁',
|
||||
id: 4
|
||||
},{
|
||||
text: '41-45岁',
|
||||
id: 5
|
||||
},{
|
||||
text: '45岁以上',
|
||||
id: 6
|
||||
}
|
||||
]
|
||||
// 年龄段弹出层控制
|
||||
private ageShow: boolean = false
|
||||
|
||||
private account: string = ''
|
||||
private credit: string = ''
|
||||
private gender: string = ''
|
||||
// 年龄段
|
||||
private age: levelType = {
|
||||
text: '',
|
||||
id: 0
|
||||
}
|
||||
private points: string = ''
|
||||
// 信誉等级
|
||||
private rate: levelType = {
|
||||
text: '',
|
||||
id: 0
|
||||
}
|
||||
private name: string = ''
|
||||
private cellphone: string = ''
|
||||
private areaId: Number[] = []
|
||||
private detail: string = ''
|
||||
// 回显的地址信息
|
||||
private areaText: string = '选择收货地址'
|
||||
private areaIndex: string = ''
|
||||
// 图片地址id
|
||||
private fileImg: string = '';
|
||||
|
||||
// 标签数据
|
||||
private label: any[] = []
|
||||
// 选中的标签最多三个
|
||||
private categoryId: Array<number> = []
|
||||
private labelName: string = '选择标签'
|
||||
|
||||
private fileList1: Array<any> = [
|
||||
{ url: "http://static.alkid888.com/example/alipay.png" }
|
||||
];
|
||||
private fileList2: Array<any> = []
|
||||
|
||||
// 控制弹出层
|
||||
private show: boolean = false;
|
||||
|
||||
@Inject() HiddenTabBar!: Function;
|
||||
|
||||
async created() {
|
||||
this.HiddenTabBar()
|
||||
this.accountTagInfo()
|
||||
if(this.$route.query.id !== void 0){
|
||||
let id = this.$route.query.id as string
|
||||
this.id = id
|
||||
this.status = parseInt(this.$route.query.status as string) | 0
|
||||
this.accountListByPlatform(id)
|
||||
}
|
||||
if(this.$route.query.type !== void 0){
|
||||
this.type = parseInt(this.$route.query.type as string)
|
||||
}
|
||||
}
|
||||
|
||||
// 获取回显的信息
|
||||
private async accountListByPlatform(id:string): Promise<void> {
|
||||
this.areaText = ''
|
||||
let res = (await this.$http.UserService.accountListByPlatform(id))[0]
|
||||
let area = res.address.area_text
|
||||
this.account = res.account
|
||||
this.gender = String(res.account_gender)
|
||||
this.ageGroup.forEach((v: any,i:number)=>{
|
||||
if(v.id == res.account_ages){
|
||||
this.age = {
|
||||
id: v.id,
|
||||
text: v.text
|
||||
}
|
||||
}
|
||||
})
|
||||
this.points = res.account_points
|
||||
this.rate.id = res.account_rate
|
||||
this.level[this.type==10?0:1].forEach((v: any,i:number)=>{
|
||||
if(v.id == res.account_ages){
|
||||
this.rate = {
|
||||
id: v.id,
|
||||
text: v.text
|
||||
}
|
||||
}
|
||||
})
|
||||
this.name = res.address.full_name
|
||||
this.cellphone = res.address.cellphone
|
||||
this.areaText = `${area.province} ${area.city} ${area.country}`
|
||||
this.areaIndex = String(res.address.area_id)
|
||||
this.detail = res.address.detail
|
||||
this.fileList2.push({url:res.review_img[0].uploads.local_path})
|
||||
this.fileImg = res.review_img[0].id
|
||||
this.labelName = ''
|
||||
this.areaId.push(res.address.area_id)
|
||||
res.tag.forEach((v:any,i:number)=>{
|
||||
if(v.title !== null){
|
||||
this.labelName += (v.title + ' ')
|
||||
this.categoryId.push(v.id)
|
||||
}
|
||||
})
|
||||
if(res.status == -1){
|
||||
Dialog.alert({
|
||||
title: '审核未通过',
|
||||
message: res.remark,
|
||||
}).then(() => {
|
||||
// on close
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 支付宝图片上传
|
||||
private async afterRead(cell: any): Promise<void> {
|
||||
let fd = new FormData()
|
||||
fd.append('file', cell.file)
|
||||
fd.append('imageType', '1')
|
||||
let res = await this.$http.PublicService.uploadImg(fd)
|
||||
this.fileImg = res.id
|
||||
}
|
||||
|
||||
// 打开关闭弹出层
|
||||
private isPopup(id: string): void {
|
||||
if (id == "show") this.show = !this.show;
|
||||
}
|
||||
|
||||
// 选中的标签
|
||||
private changeLabel(index: number): void {
|
||||
let categoryId: number[] = this.categoryId
|
||||
let id: number = this.label[index].id
|
||||
if(categoryId.indexOf(id) !== -1){
|
||||
categoryId.splice(categoryId.indexOf(id), 1)
|
||||
this.categoryId = [...categoryId]
|
||||
return
|
||||
}
|
||||
if(categoryId.length >= 3){
|
||||
this.$toast('最多选择三个标签')
|
||||
return
|
||||
}
|
||||
this.categoryId.push(id)
|
||||
}
|
||||
|
||||
// 标签提交
|
||||
private labelConfirm(): void {
|
||||
this.labelName = ''
|
||||
this.categoryId.forEach((v:any, i:number)=>{
|
||||
let s = this.label.filter(n=>{return n.id == v})
|
||||
this.labelName += (s[0].title + ' ')
|
||||
})
|
||||
this.show = !this.show
|
||||
}
|
||||
|
||||
// 信誉等级选择
|
||||
private onConfirmLevel(e: any): void {
|
||||
this.rate = e
|
||||
this.levelShow = false
|
||||
}
|
||||
|
||||
// 年龄段选择
|
||||
private onConfirmAge(e: any): void {
|
||||
this.age = e
|
||||
this.ageShow = false
|
||||
}
|
||||
|
||||
// 确定选择城市
|
||||
private onConfirm(value: any): void {
|
||||
this.areaId = value
|
||||
}
|
||||
|
||||
// 添加买号的标签
|
||||
private async accountTagInfo(): Promise<void> {
|
||||
let res = await this.$http.HomeService.accountTagInfo(1)
|
||||
this.label = res[0].sub
|
||||
}
|
||||
|
||||
// 添加买号
|
||||
private async saveaccount(): Promise<void> {
|
||||
if(this.account == ''){
|
||||
this.$toast('请填写账号')
|
||||
return
|
||||
}
|
||||
if(this.gender == ''){
|
||||
this.$toast('请选择性别')
|
||||
return
|
||||
}
|
||||
if(this.credit == ''){
|
||||
this.$toast('请选择是否开通花呗/白条')
|
||||
return
|
||||
}
|
||||
if(this.age.text == ''){
|
||||
this.$toast('请填写年龄')
|
||||
return
|
||||
}
|
||||
if(this.points == ''){
|
||||
this.$toast('请填写淘气值')
|
||||
return
|
||||
}
|
||||
if(this.rate.text == ''){
|
||||
this.$toast('请填写信用等级')
|
||||
return
|
||||
}
|
||||
if(this.labelName == '选择标签'){
|
||||
this.$toast('请选择标签')
|
||||
return
|
||||
}
|
||||
if(this.name == ''){
|
||||
this.$toast('请填写收货人姓名')
|
||||
return
|
||||
}
|
||||
if(this.cellphone == ''){
|
||||
this.$toast('请填写收货人电话')
|
||||
return
|
||||
}
|
||||
if(!this.$utils.isTel(this.cellphone)){
|
||||
this.$toast('收货人电话填写有误')
|
||||
return
|
||||
}
|
||||
if(this.areaId.length <= 0){
|
||||
this.$toast('请选择收货地址')
|
||||
return
|
||||
}
|
||||
if(this.detail == ''){
|
||||
this.$toast('请填写收货地详情')
|
||||
return
|
||||
}
|
||||
if(this.fileImg == ''){
|
||||
this.$toast('请上传支付宝截图')
|
||||
return
|
||||
}
|
||||
let data = {
|
||||
account: this.account,
|
||||
account_gender: this.gender,
|
||||
account_rate: this.rate.id,
|
||||
account_ages: this.age,
|
||||
account_points: this.points,
|
||||
image_id: this.fileImg,
|
||||
full_name: this.name,
|
||||
cellphone: this.cellphone,
|
||||
area_id: this.areaId[this.areaId.length-1],
|
||||
detail: this.detail,
|
||||
category_id: this.categoryId,
|
||||
account_type: this.type,
|
||||
credit_pay: this.credit
|
||||
}
|
||||
Dialog.confirm({
|
||||
title: '是否提交',
|
||||
message: '点击确定提交信息'
|
||||
}).then( async () => {
|
||||
if(this.status == 0){
|
||||
let res = await this.$http.HomeService.saveaccount(data)
|
||||
this.$toast('添加成功等待审核')
|
||||
setTimeout(() => {
|
||||
this.$router.go(-1)
|
||||
}, 2000);
|
||||
}else if(this.status == -1){
|
||||
Object.assign(data, {id: this.id})
|
||||
let res = await this.$http.UserService.modifyAccount(data)
|
||||
if(!!res){
|
||||
this.$toast('修改成功等待审核')
|
||||
setTimeout(() => {
|
||||
this.$router.go(-1)
|
||||
}, 2000)
|
||||
}else{
|
||||
setTimeout(() => {
|
||||
this.$router.go(-1)
|
||||
}, 2000)
|
||||
}
|
||||
}
|
||||
}).catch(() => {
|
||||
// on cancel
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="stylus" scoped>
|
||||
@import '~@assets/stylus/page/addAccount';
|
||||
</style>
|
||||
<style lang="stylus">
|
||||
.add_account
|
||||
.van-radio-group
|
||||
display flex
|
||||
.van-radio
|
||||
margin-right: 0.6rem;
|
||||
</style>
|
||||