diff --git a/apis/commonApi.js b/apis/commonApi.js index 53aefec..8d93237 100644 --- a/apis/commonApi.js +++ b/apis/commonApi.js @@ -1,5 +1,6 @@ import http from '../utils/http/index.js' import store from '@/store/index' +import { PAY_URL } from '@/enums/index.js' let areaCache = null /** * 获取省市区街道 @@ -26,16 +27,28 @@ export function getArea(data = {}) { function syncStore(res) { if (res.enterpriseList && res.enterpriseList.length > 0) { let companyInfo = res.enterpriseList[0] + let vipExpireTime = companyInfo.vipExpireTime || null + let isVip = false + if (vipExpireTime) { + // 适配ios时间戳 + vipExpireTime = vipExpireTime.replace(/-/g, '/') + let now = new Date().getTime() + if (now < new Date(vipExpireTime).getTime()) { + isVip = true + } + } store.commit('setCompanyInfo', { id: companyInfo.id, name: companyInfo.name, - fddEnterpriseStatus: companyInfo.fddEnterpriseStatus + fddEnterpriseStatus: companyInfo.fddEnterpriseStatus, + isVip: isVip, + vipExpireTime: vipExpireTime, }) store.commit('setUserInfo', { name: companyInfo.employeeName, userId: res.userId, mobile: res.mobile, - avatar: null + avatar: null, }) } else { if (res) { @@ -43,7 +56,7 @@ function syncStore(res) { name: '', userId: res.userId, mobile: res.mobile, - avatar: null + avatar: null, }) } } @@ -61,15 +74,17 @@ export function getBaseInfo(data = {}, refresh = false) { if (!refresh && baseInfo) { resolve(baseInfo) } else { - http.get({ url: '/yyt-uec/get/base-info', data }, { hideLoading: true }).then((res) => { - if (res) { - baseInfo = res - syncStore(res) - resolve(res) - } else { - resolve(null) - } - }) + http + .get({ url: '/yyt-uec/get/base-info', data }, { hideLoading: true }) + .then((res) => { + if (res) { + baseInfo = res + syncStore(res) + resolve(res) + } else { + resolve(null) + } + }) } }) } @@ -79,7 +94,12 @@ export function getBaseInfo(data = {}, refresh = false) { * @param {object} data 参数 enterpriseId */ export function getVerifyUrl(data = {}) { - return http.post({ url: '/yyt-uec/get/fdd-enterprise-verify-url?enterpriseId=' + data.enterpriseId, data }) + return http.post({ + url: + '/yyt-uec/get/fdd-enterprise-verify-url?enterpriseId=' + + data.enterpriseId, + data, + }) } /** @@ -87,7 +107,12 @@ export function getVerifyUrl(data = {}) { * @param {object} data 参数 mallSupplierId */ export function getGuaranteeContract(data = {}) { - return http.post({ url: '/yyt-uec/create/supplier/guarantee-contract?mallSupplierId=' + data.mallSupplierId, data }) + return http.post({ + url: + '/yyt-uec/create/supplier/guarantee-contract?mallSupplierId=' + + data.mallSupplierId, + data, + }) } /** @@ -95,7 +120,10 @@ export function getGuaranteeContract(data = {}) { * @param {object} data 参数 enterpriseId */ export function getFsCredit(data = {}) { - return http.get({ url: '/yyt-uec/credit/get/enterprise-feisuan-credit', data }) + return http.get({ + url: '/yyt-uec/credit/get/enterprise-feisuan-credit', + data, + }) } /** @@ -113,7 +141,7 @@ export function getMonthCredit(data = {}) { export function transformFileToImg(data) { return http.get({ url: '/document/get/enterprise-documents/file-image-base64', - data: data + data: data, }) } @@ -123,7 +151,7 @@ export function transformFileToImg(data) { export function getFeisuanUrl(data = {}) { return http.get({ url: '/yyt-uec/feisuan/feisuan-apply-url.json', - data: data + data: data, }) } @@ -133,7 +161,7 @@ export function getFeisuanUrl(data = {}) { export function getLicenseOcr(data = {}) { return http.post({ url: '/base-paper-trading/ocr/business-license', - data: data + data: data, }) } @@ -143,7 +171,7 @@ export function getLicenseOcr(data = {}) { export function getFrontIdCardOcr(data = {}) { return http.post({ url: '/base-paper-trading/ocr/id-card/face', - data: data + data: data, }) } @@ -153,6 +181,32 @@ export function getFrontIdCardOcr(data = {}) { export function getBackIdCardOcr(data = {}) { return http.post({ url: '/base-paper-trading/ocr/id-card/back', - data: data + data: data, + }) +} + +/** + * 纸盘商开通会员,创建订单 + * @param {object} data + * @value {string} type + * @value {string} enterpriseId + */ +export function openVip(data = {}) { + return http.post({ + url: `/yyt-uec/customer/apply/for/vip?type=${data.type}&enterpriseId=${data.enterpriseId}`, + data: data, + }) +} + +/** + * 纸盘商开通会员,真实支付 + * @param {object} data + * @value {string} orderId + * @value {string} channelId + */ +export function openVipPay(data = {}) { + return http.post({ + url: PAY_URL, + data: data, }) } diff --git a/common/css/reset.scss b/common/css/reset.scss index 8aabfea..2178bac 100644 --- a/common/css/reset.scss +++ b/common/css/reset.scss @@ -24,6 +24,68 @@ form { display: block; } +view, +image, +text { + box-sizing: border-box; + flex-shrink: 0; +} + +.flex-row { + display: flex; + flex-direction: row; +} + +.flex-col { + display: flex; + flex-direction: column; +} + +.justify-start { + display: flex; + justify-content: flex-start; +} + +.justify-center { + display: flex; + justify-content: center; +} + +.justify-end { + display: flex; + justify-content: flex-end; +} + +.justify-evenly { + display: flex; + justify-content: space-evenly; +} + +.justify-around { + display: flex; + justify-content: space-around; +} + +.justify-between { + display: flex; + justify-content: space-between; +} + +.items-start { + display: flex; + align-items: flex-start; +} + +.items-center { + display: flex; + align-items: center; +} + +.items-end { + display: flex; + align-items: flex-end; +} + cover-view { line-height: 1.5; white-space: normal; @@ -45,6 +107,15 @@ button::after { clear: both; visibility: hidden; } +// 两行省略号 +.u-line-2 { + -webkit-line-clamp: 2; + overflow: hidden; + word-break: break-all; + text-overflow: ellipsis; + display: -webkit-box; // 弹性伸缩盒 + -webkit-box-orient: vertical; // 设置伸缩盒子元素排列方式 +} .flex-row-start-start { display: flex; diff --git a/enums/index.js b/enums/index.js index 3e80d18..1c2d7db 100644 --- a/enums/index.js +++ b/enums/index.js @@ -3,6 +3,9 @@ const urlEnv = env === 'production' ? '' : `-${env}` export const XAPPID = '503258978847966404' +// 统一支付接口 +export const PAY_URL = `https://api-client-psc${urlEnv}.qniao.cn/payment-settlement-center/pay` + /** * 账号类型 */ @@ -11,7 +14,7 @@ export const accountType = { PHONE: 2, EMAIL: 3, APPLEID: 4, - CUSTOM: 5 + CUSTOM: 5, } /** @@ -22,7 +25,7 @@ export const codePurpose = { RESET_LOGIN_PASSWORD: 2, RESET_PHONE: 3, BIND_BANK_CARD: 4, - RESET_CREDIT_PASSWORD: 5 + RESET_CREDIT_PASSWORD: 5, } /** @@ -30,7 +33,7 @@ export const codePurpose = { */ export const verificationType = { PHONE: 1, - EMAIL: 2 + EMAIL: 2, } /** * 法大大企业认证状态 1:未认证 2:认证中 3:已认证 4:认证失败 @@ -39,14 +42,14 @@ export const fddEnterpriseStatus = { UNCERTIFIED: 1, CERTIFIED_ING: 2, CERTIFIED_SUCCESS: 3, - CERTIFIED_FAIL: 4 + CERTIFIED_FAIL: 4, } /** * 上传地址 */ export const uploadUrl = { image: `https://api-client-yyt${urlEnv}.qniao.cn/yyt-uec/file-uploading/upload/image`, - file: `https://api-client-yyt${urlEnv}.qniao.cn/yyt-uec/file-uploading/upload/file` + file: `https://api-client-yyt${urlEnv}.qniao.cn/yyt-uec/file-uploading/upload/file`, } /** * 结算周期:1:月结30(飞算1期),2:月结45,3:月结60(飞算2期),4:月结75,5:月结90(飞算3期) @@ -54,24 +57,24 @@ export const uploadUrl = { export const settlementPeriodEnum = [ { value: 1, - label: '月结30' + label: '月结30', }, { value: 2, - label: '月结45' + label: '月结45', }, { value: 3, - label: '月结60' + label: '月结60', }, { value: 4, - label: '月结75' + label: '月结75', }, { value: 5, - label: '月结90' - } + label: '月结90', + }, ] /** * 结算周期:1:1期,2:2期,3:3期 @@ -79,16 +82,16 @@ export const settlementPeriodEnum = [ export const fsSettlementPeriodEnum = [ { value: 1, - label: '1期' + label: '1期', }, { value: 2, - label: '2期' + label: '2期', }, { value: 3, - label: '3期' - } + label: '3期', + }, ] /** * 飞算结算方式: 1: 先息后本 @@ -96,8 +99,8 @@ export const fsSettlementPeriodEnum = [ export const fsSettlementMethodEnum = [ { value: 1, - label: '先息后本' - } + label: '先息后本', + }, ] /** @@ -107,7 +110,7 @@ export const fsAuditStatus = { WAIT_APPLY: 0, AUDITING: 1, PASS: 2, - REJECT: 3 + REJECT: 3, } /** @@ -119,7 +122,7 @@ export const orderStatusEnum = { WAIT_SUPPLIER_CONFIRM: 30204, ORDERED: 30101, FINISHED: 30104, - CANCELED: 30105 + CANCELED: 30105, } /** @@ -128,28 +131,28 @@ export const orderStatusEnum = { export const orderStatusArray = [ { value: orderStatusEnum.ALL, - label: '全部' + label: '全部', }, { value: orderStatusEnum.WAIT_CONFIRM, - label: '待确认' + label: '待确认', }, { value: orderStatusEnum.WAIT_SUPPLIER_CONFIRM, - label: '待供应商确认' + label: '待供应商确认', }, { value: orderStatusEnum.ORDERED, - label: '已下单' + label: '已下单', }, { value: orderStatusEnum.FINISHED, - label: '已完成' + label: '已完成', }, { value: orderStatusEnum.CANCELED, - label: '已取消' - } + label: '已取消', + }, ] export const orderStatusMap = { @@ -158,7 +161,7 @@ export const orderStatusMap = { [orderStatusEnum.WAIT_SUPPLIER_CONFIRM]: '待供应商确认', [orderStatusEnum.ORDERED]: '已下单', [orderStatusEnum.FINISHED]: '已完成', - [orderStatusEnum.CANCELED]: '已取消' + [orderStatusEnum.CANCELED]: '已取消', } /** @@ -176,7 +179,7 @@ export const supplierOrderStatusEnum = { FINISHED: 30213, WAIT_CLIENT_REPAY: 30217, REPAYING: 30216, - CANCELED: 30212 + CANCELED: 30212, } /** * 供应商订单状态 待客户确认订单/30202,待供应商确认订单/30205,待发货/30106,已发货/30107 已发货在H5客户端显示 待收货/30107 ,待客户借款/30207,支付中/30208,待客户支付/30214,付款失败/30211,已完成/30213,待客户还款/30217,已取消/30212,还款中/30216 @@ -193,7 +196,7 @@ export const supplierOrderStatusMap = { [supplierOrderStatusEnum.FINISHED]: '已完成', [supplierOrderStatusEnum.WAIT_CLIENT_REPAY]: '待还款', [supplierOrderStatusEnum.REPAYING]: '还款中', - [supplierOrderStatusEnum.CANCELED]: '已取消' + [supplierOrderStatusEnum.CANCELED]: '已取消', } /** @@ -202,11 +205,11 @@ export const supplierOrderStatusMap = { export const paymentMethodEnum = { WECHAT_PAY: 1, MONTHLY_PAY: 2, - FLY_PAY: 4 + FLY_PAY: 4, } export const paymentMethodMap = { [paymentMethodEnum.WECHAT_PAY]: '微信支付', [paymentMethodEnum.MONTHLY_PAY]: '月结支付', - [paymentMethodEnum.FLY_PAY]: '飞算支付' + [paymentMethodEnum.FLY_PAY]: '飞算支付', } diff --git a/pages.json b/pages.json index 81b54d3..f3dce6c 100644 --- a/pages.json +++ b/pages.json @@ -163,6 +163,14 @@ "navigationStyle": "custom", "enablePullDownRefresh": false } + }, + { + "path": "pages/vip-center/index", + "style": { + "navigationBarTitleText": "会员中心", + "navigationStyle": "custom", + "enablePullDownRefresh": false + } } ], "globalStyle": { diff --git a/pages/mine/index.vue b/pages/mine/index.vue index d6a5746..2b8368d 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -8,22 +8,46 @@ - 点击登录 + 点击登录 - 登录解锁更全功能 + 登录解锁更全功能 {{ userInfo.name }} - - + + {{ hasCompany ? userInfo.companyName : '点击完善企业信息' }} @@ -37,41 +61,115 @@ - + + + + + VIP + 会员 + + + {{ + isVip ? `到期时间:${vipExpireTime}` : '立即开通会员 尊享特权' + }} + + {{ isVip ? '续费会员' : '开通会员' }} + + + - 我的订单 - + 我的订单 + 查看更多订单 - + - - + + 全部订单 - - + + 待确认 - - + + 待供应商确认 - - + + 已下单 - - + + 已完成 - + @@ -82,32 +180,60 @@ > - 可用采购额度 + 可用采购额度 {{fsInfo.availableCreditLine}} - {{ `已使用: ¥ ${fsInfo.usedCreditLine}` }} + {{ + `已使用: ¥ ${fsInfo.usedCreditLine}` + }} {{ `授信额度: ${fsInfo.creditLine / 10000}万` }} - + - 其他工具 + 其他工具 - + 账号管理 - + 我的询价 - + 收货地址 @@ -119,8 +245,17 @@ @@ -427,4 +596,68 @@ export default { font-weight: 500; } } +.section_3 { + padding: 14rpx 32rpx; + background-image: linear-gradient( + 270deg, + rgb(51, 51, 51) 0%, + rgb(51, 51, 51) 0%, + rgb(105, 108, 107) 98.91%, + rgb(105, 108, 107) 100% + ); + border-radius: 10rpx 10rpx 0rpx 0px; + width: 750rpx; + .group_6 { + margin: 4rpx 0; + .image_3 { + margin: 5rpx 0; + width: 28rpx; + height: 26rpx; + } + .group_7 { + margin-left: 7rpx; + line-height: 36rpx; + white-space: nowrap; + height: 36rpx; + .text_4 { + color: rgb(219, 193, 137); + font-size: 26rpx; + font-weight: 500; + line-height: 37rpx; + } + .text_5 { + color: rgb(219, 193, 137); + font-size: 26rpx; + font-weight: 500; + line-height: 37rpx; + } + } + } + .text_6 { + margin: 6rpx 0; + color: rgb(231, 225, 190); + font-size: 24rpx; + font-weight: 600; + line-height: 33rpx; + white-space: nowrap; + } + .text-wrapper { + padding: 6rpx 0; + color: rgb(68, 48, 21); + font-size: 24rpx; + font-weight: 500; + line-height: 33rpx; + white-space: nowrap; + background-image: linear-gradient( + 90deg, + rgb(244, 237, 206) 0%, + rgb(244, 237, 206) 1.2%, + rgb(243, 217, 158) 97.87%, + rgb(243, 217, 158) 100% + ); + border-radius: 22rpx; + width: 128rpx; + height: 44rpx; + } +} diff --git a/pages/vip-center/index.vue b/pages/vip-center/index.vue new file mode 100644 index 0000000..87d3da3 --- /dev/null +++ b/pages/vip-center/index.vue @@ -0,0 +1,312 @@ + + + + diff --git a/static/imgs/vip-center/1.png b/static/imgs/vip-center/1.png new file mode 100644 index 0000000..9529feb Binary files /dev/null and b/static/imgs/vip-center/1.png differ diff --git a/static/imgs/vip-center/2.png b/static/imgs/vip-center/2.png new file mode 100644 index 0000000..eb3765f Binary files /dev/null and b/static/imgs/vip-center/2.png differ diff --git a/static/imgs/vip-center/3.png b/static/imgs/vip-center/3.png new file mode 100644 index 0000000..0ad8854 Binary files /dev/null and b/static/imgs/vip-center/3.png differ diff --git a/static/imgs/vip-center/4.png b/static/imgs/vip-center/4.png new file mode 100644 index 0000000..8a27925 Binary files /dev/null and b/static/imgs/vip-center/4.png differ diff --git a/store/index.js b/store/index.js index bd0a7c2..e4dd7eb 100644 --- a/store/index.js +++ b/store/index.js @@ -14,6 +14,8 @@ let qnToken = null, * @value id 企业id * @value name 企业名称 * @value fddEnterpriseStatus 法大大认证状态 。1未认证,2认证进行中,3认证成功,4认证失败 + * @value isVip 是否是vip + * @value vipExpireTime vip过期时间 */ companyInfo = null, uecToken = null, @@ -22,7 +24,13 @@ let qnToken = null, * @value supplierId 当前被分享的供应商id */ supplierId = null -const companyInfoParams = ['id', 'name', 'fddEnterpriseStatus'] +const companyInfoParams = [ + 'id', + 'name', + 'fddEnterpriseStatus', + 'isVip', + 'vipExpireTime', +] const userInfoParams = ['name', 'userId', 'mobile', 'avatar'] try { uecToken = uni.getStorageSync('uecToken') @@ -54,7 +62,7 @@ const store = new Vuex.Store({ companyInfo: companyInfo || {}, // 印包厂信息 nextPage: { name: '', - data: {} + data: {}, }, searchHistory: searchHistory || [], /** @@ -62,8 +70,8 @@ const store = new Vuex.Store({ */ cache: { type: 'none', - data: null - } + data: null, + }, }, mutations: { setCache(state, { type, data }) { @@ -255,7 +263,7 @@ const store = new Vuex.Store({ } catch (e) { console.error('删除supplierId失败:', e) } - } + }, }, actions: { logout({ commit }) { @@ -275,7 +283,7 @@ const store = new Vuex.Store({ arr = arr.slice(0, 10) } commit('setSearchHistory', arr) - } - } + }, + }, }) export default store