diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json index db6692c..59d78d5 100644 --- a/.hbuilderx/launch.json +++ b/.hbuilderx/launch.json @@ -10,6 +10,10 @@ { "launchtype" : "local" }, + "h5" : + { + "launchtype" : "local" + }, "type" : "uniCloud" } ] diff --git a/App.vue b/App.vue index bf157fd..1dc90bf 100644 --- a/App.vue +++ b/App.vue @@ -10,7 +10,7 @@ console.log('App Hide') }, globalData: { - mainColor: "#c82626" + mainColor: "white" } } diff --git a/apis/index.js b/apis/index.js index 5238aa1..50759f7 100644 --- a/apis/index.js +++ b/apis/index.js @@ -31,8 +31,12 @@ const request = (parameter) => { 'Authorization': store.getters.getToken || '' } - console.log('发送数据调试用', parameter) + // 加载提示 + uni.showLoading({ + title: '加载中' + }); + console.log('dbug', parameter) // 请求实例 return new Promise((resolve, reject) => { uni.request({ @@ -46,6 +50,7 @@ const request = (parameter) => { updateToken('token', res.header.Authorization) } if(res.statusCode === 200){ + uni.hideLoading() const resolveData = res.data if(resolveData.status_code === 200) { resolve(resolveData.data) @@ -64,9 +69,41 @@ const request = (parameter) => { }) } +// 文件上传 +const uploading = (paths) => { + uni.showLoading({ + title: '上传中' + }); + // 注入header + config.header = { + 'Accept': 'application/json', + 'Authorization': store.getters.getToken || '' + } + // 上传图片 + return new Promise((resolve, reject) => { + uni.uploadFile({ + url : config.apiUrl + 'storage/uploads', + files : paths, + header : config.header || {}, + success : res=>{ + if(res.statusCode === 200){ + uni.hideLoading() + let updData = JSON.parse(res.data) + if(updData.status_code === 200){ + resolve(updData.data) + return + } + reject(updData) + return + } + errToast(res.statusCode) + } + }) + }) +} + // 处理一些http请求错误提示 const errToast = (code) => { - console.log(code) switch (code){ case 404: uni.showToast({ @@ -107,10 +144,13 @@ const loginHint = () => { success: res=> { loginHintState = false if (res.confirm) uni.reLaunch({ - url: '/pages/auth/login?type=overdue' + url: '/pages/equity/index' }) } }) } -export default request +export { + request, + uploading +} diff --git a/apis/interfaces/auth.js b/apis/interfaces/auth.js index 191a6ff..fc6e49c 100644 --- a/apis/interfaces/auth.js +++ b/apis/interfaces/auth.js @@ -6,7 +6,7 @@ * moduleName: 鉴权 */ -import request from '../index' +import { request } from '../index' // 一键登录 const keyAuth = (data) => { diff --git a/apis/interfaces/company.js b/apis/interfaces/company.js new file mode 100644 index 0000000..cba1aa5 --- /dev/null +++ b/apis/interfaces/company.js @@ -0,0 +1,91 @@ + +/** + * Web唐明明 + * 匆匆数载恍如梦,岁月迢迢华发增。 + * 碌碌无为枉半生,一朝惊醒万事空。 + * moduleName: 企业 + */ + +import { request } from '../index' + +// 企业注册配置信息 +const createConfig = () => { + return request({ + url: 'companies/inits/create' + }) +} + +// 企业行业信息 +const inits = data => { + return request({ + url: 'companies/inits', + method: 'POST', + data + }) +} + +// 企业广场 +const companies = data => { + return request({ + url: 'companies', + data + }) +} + +// 企业列表 +const companiesList = data => { + return request({ + url: 'companies/lists', + data + }) +} + +// 企业认证配置信息 +const appliesCreate = () => { + return request({ + url: 'companies/applies/create' + }) +} + +// 企业认证提交、编辑 +const applies = (data,method) => { + return request({ + url: 'companies/applies', + method, + data + }) +} + +// 企业认证前置条件 +const isallow = () => { + return request({ + url: 'companies/applies/isallow', + method: 'POST' + }) +} + +// 企业申请状态 +const appliesQuery = () => { + return request({ + url: 'companies/applies/query' + }) +} + +// 企业信息展示 +const appliesInfo = () => { + return request({ + url: 'companies/applies' + }) +} + +export { + createConfig, + inits, + companies, + companiesList, + appliesCreate, + applies, + isallow, + appliesQuery, + appliesInfo +} diff --git a/apis/interfaces/goods.js b/apis/interfaces/goods.js new file mode 100644 index 0000000..1400cc3 --- /dev/null +++ b/apis/interfaces/goods.js @@ -0,0 +1,36 @@ + +/** + * Web唐明明 + * 匆匆数载恍如梦,岁月迢迢华发增。 + * 碌碌无为枉半生,一朝惊醒万事空。 + * moduleName: 商品 + */ + +import { request } from '../index' + +// 商城首页 +const mall = data => { + return request({ + url: "mall" + }) +} + +// 商品列表 +const list = data => { + return request({ + url: "mall/goods" + }) +} + +// 商品详情 +const goods = id => { + return request({ + url: 'mall/goods/' + id + }) +} + +export { + mall, + list, + goods +} diff --git a/apis/interfaces/order.js b/apis/interfaces/order.js new file mode 100644 index 0000000..8ce7bfb --- /dev/null +++ b/apis/interfaces/order.js @@ -0,0 +1,22 @@ + +/** + * Web唐明明 + * 匆匆数载恍如梦,岁月迢迢华发增。 + * 碌碌无为枉半生,一朝惊醒万事空。 + * moduleName: 订单 + */ + +import { request } from '../index' + +// 创建,确认订单 +const buy = (data, method) => { + return request({ + url: 'mall/buy/goods', + method, + data + }) +} + +export { + buy +} diff --git a/apis/interfaces/store.js b/apis/interfaces/store.js new file mode 100644 index 0000000..5f9ad61 --- /dev/null +++ b/apis/interfaces/store.js @@ -0,0 +1,56 @@ + +/** + * Web唐明明 + * 匆匆数载恍如梦,岁月迢迢华发增。 + * 碌碌无为枉半生,一朝惊醒万事空。 + * moduleName: 企业工具 + */ + +import { request } from '../index' + +// 企业首页 +const index = () => { + return request({ + url: 'companies/index' + }) +} + +// 成交客户 +const customer = data => { + return request({ + url: 'mall/statistics', + data + }) +} + +// 访客记录 +const visitors = data => { + return request({ + url: 'companies/visitors/lists', + data + }) +} + +// 基础信息模块 +const basicsConfig = () => { + return request({ + url: 'companies/info/create' + }) +} + +// 企业基础信息 编辑 +const basicsInfo = (method, data) => { + return request({ + url: 'companies/info', + method, + data + }) +} + +export { + index, + customer, + visitors, + basicsConfig, + basicsInfo +} diff --git a/apis/interfaces/uploading.js b/apis/interfaces/uploading.js new file mode 100644 index 0000000..31b85f7 --- /dev/null +++ b/apis/interfaces/uploading.js @@ -0,0 +1,17 @@ + +/** + * Web唐明明 + * 匆匆数载恍如梦,岁月迢迢华发增。 + * 碌碌无为枉半生,一朝惊醒万事空。 + * moduleName: 上传图片 + */ + +import { uploading as upd } from '../index' + +const uploads = (paths) => { + return upd(paths) +} + +export { + uploads +} diff --git a/apis/interfaces/vip.js b/apis/interfaces/vip.js new file mode 100644 index 0000000..0b4b6ec --- /dev/null +++ b/apis/interfaces/vip.js @@ -0,0 +1,37 @@ + +/** + * Web唐明明 + * 匆匆数载恍如梦,岁月迢迢华发增。 + * 碌碌无为枉半生,一朝惊醒万事空。 + * moduleName: 会员 + */ + +import { request } from '../index' + +// 会员身份信息 +const identities = () => { + return request({ + url: 'user/identities' + }) +} + +// 开通会员 +const vipOrder = id =>{ + return request({ + url : 'user/identities/create/' + id, + method : 'POST' + }) +} + +// 开通会员微信支付 +const vipWechatPay = id => { + return request({ + url : 'user/identities/pay/' + id + '/wechat' + }) +} + +export { + identities, + vipOrder, + vipWechatPay +} diff --git a/components/goods-list/goods-list.vue b/components/goods-list/goods-list.vue index 5f29c01..1191e33 100644 --- a/components/goods-list/goods-list.vue +++ b/components/goods-list/goods-list.vue @@ -2,18 +2,18 @@ - + diff --git a/pages/order/submit.vue b/pages/equity/search.vue similarity index 94% rename from pages/order/submit.vue rename to pages/equity/search.vue index 8183fd0..86db642 100644 --- a/pages/order/submit.vue +++ b/pages/equity/search.vue @@ -1,6 +1,6 @@ diff --git a/pages/goods/details.vue b/pages/goods/details.vue index a20ec64..ec1f82f 100644 --- a/pages/goods/details.vue +++ b/pages/goods/details.vue @@ -1,33 +1,29 @@ @@ -102,7 +115,6 @@ top: 0; left: 0; z-index: 1; - background: #3F536E; width: 100%; padding-top: 100%; .swiper{ diff --git a/pages/goods/lists.vue b/pages/goods/lists.vue new file mode 100644 index 0000000..30aba0f --- /dev/null +++ b/pages/goods/lists.vue @@ -0,0 +1,83 @@ + + + + + diff --git a/pages/login/login.vue b/pages/login/login.vue index 8e1fc23..a80208c 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -52,6 +52,7 @@ this.$Router.replace({name: "Registered"}) return } + this.$Router.back() }).catch(err => { uni.showToast({ title: err.message, diff --git a/pages/market/index.vue b/pages/market/index.vue index c3b97b9..d0cc3aa 100644 --- a/pages/market/index.vue +++ b/pages/market/index.vue @@ -41,6 +41,9 @@ if(index == 1 && index == this.tabIndex) this.marketType = this.marketType == 'low' ? 'high': 'low' this.tabIndex = index } + }, + onNavigationBarButtonTap(){ + this.$Router.push({name: "marketLogs"}) } } diff --git a/pages/vip/pay.vue b/pages/market/logs.vue similarity index 71% rename from pages/vip/pay.vue rename to pages/market/logs.vue index 9eceec4..a84bbf6 100644 --- a/pages/vip/pay.vue +++ b/pages/market/logs.vue @@ -1,6 +1,6 @@ @@ -9,14 +9,11 @@ data() { return { - } - }, - methods: { - + }; } } - diff --git a/pages/order/buy.vue b/pages/order/buy.vue new file mode 100644 index 0000000..cb14546 --- /dev/null +++ b/pages/order/buy.vue @@ -0,0 +1,284 @@ + + + + + + + diff --git a/pages/property/index.vue b/pages/property/index.vue index 6da5391..4353dfb 100644 --- a/pages/property/index.vue +++ b/pages/property/index.vue @@ -1,6 +1,27 @@ @@ -9,11 +30,13 @@ data() { return { - }; + } + }, + methods: { + onOut(){ + this.$store.commit('setToken', '') + } } } - diff --git a/pages/store/basics.vue b/pages/store/basics.vue new file mode 100644 index 0000000..0fda350 --- /dev/null +++ b/pages/store/basics.vue @@ -0,0 +1,406 @@ +