Browse Source

微信支付代码

devlop
邓雄飞 4 years ago
parent
commit
4c07b85f3f
6 changed files with 228 additions and 365 deletions
  1. 72
      apis/commonApi.js
  2. 68
      enums/index.js
  3. 311
      pages/mine/index.vue
  4. 12
      pages/paper-details/index.vue
  5. 130
      pages/vip-center/index.vue
  6. BIN
      static/logo.png

72
apis/commonApi.js

@ -42,13 +42,13 @@ function syncStore(res) {
name: companyInfo.name,
fddEnterpriseStatus: companyInfo.fddEnterpriseStatus,
isVip: isVip,
vipExpireTime: vipExpireTime,
vipExpireTime: vipExpireTime
})
store.commit('setUserInfo', {
name: companyInfo.employeeName,
userId: res.userId,
mobile: res.mobile,
avatar: null,
avatar: null
})
} else {
if (res) {
@ -56,7 +56,7 @@ function syncStore(res) {
name: '',
userId: res.userId,
mobile: res.mobile,
avatar: null,
avatar: null
})
}
}
@ -74,17 +74,15 @@ 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)
}
})
}
})
}
@ -95,10 +93,8 @@ export function getBaseInfo(data = {}, refresh = false) {
*/
export function getVerifyUrl(data = {}) {
return http.post({
url:
'/yyt-uec/get/fdd-enterprise-verify-url?enterpriseId=' +
data.enterpriseId,
data,
url: '/yyt-uec/get/fdd-enterprise-verify-url?enterpriseId=' + data.enterpriseId,
data
})
}
@ -108,10 +104,8 @@ export function getVerifyUrl(data = {}) {
*/
export function getGuaranteeContract(data = {}) {
return http.post({
url:
'/yyt-uec/create/supplier/guarantee-contract?mallSupplierId=' +
data.mallSupplierId,
data,
url: '/yyt-uec/create/supplier/guarantee-contract?mallSupplierId=' + data.mallSupplierId,
data
})
}
@ -122,7 +116,7 @@ export function getGuaranteeContract(data = {}) {
export function getFsCredit(data = {}) {
return http.get({
url: '/yyt-uec/credit/get/enterprise-feisuan-credit',
data,
data
})
}
@ -141,7 +135,7 @@ export function getMonthCredit(data = {}) {
export function transformFileToImg(data) {
return http.get({
url: '/document/get/enterprise-documents/file-image-base64',
data: data,
data: data
})
}
@ -151,7 +145,7 @@ export function transformFileToImg(data) {
export function getFeisuanUrl(data = {}) {
return http.get({
url: '/yyt-uec/feisuan/feisuan-apply-url.json',
data: data,
data: data
})
}
@ -161,7 +155,7 @@ export function getFeisuanUrl(data = {}) {
export function getLicenseOcr(data = {}) {
return http.post({
url: '/base-paper-trading/ocr/business-license',
data: data,
data: data
})
}
@ -171,7 +165,7 @@ export function getLicenseOcr(data = {}) {
export function getFrontIdCardOcr(data = {}) {
return http.post({
url: '/base-paper-trading/ocr/id-card/face',
data: data,
data: data
})
}
@ -181,7 +175,7 @@ export function getFrontIdCardOcr(data = {}) {
export function getBackIdCardOcr(data = {}) {
return http.post({
url: '/base-paper-trading/ocr/id-card/back',
data: data,
data: data
})
}
@ -194,19 +188,33 @@ export function getBackIdCardOcr(data = {}) {
export function openVip(data = {}) {
return http.post({
url: `/yyt-uec/customer/apply/for/vip?type=${data.type}&enterpriseId=${data.enterpriseId}`,
data: data,
data: data
})
}
/**
* 纸盘商开通会员,真实支付
* @param {object} data
* @value {string} orderId
* @value {string} tradeOrderId
* @value {string} channelId
* @param {string} userOpenId 用户openId
*/
export function openVipPay(data = {}) {
return http.post({
url: PAY_URL,
data: data,
url: PAY_URL + `?userOpenId=${data.userOpenId}`,
data: data
})
}
/**
* 获取用户openId
* @param {object} data
* @value {string} authCode 授权码
* @value {string} authMethod 3WeChatServiceAccount
*/
export function getOpenId(data = {}) {
return http.post({
url: '/uec/get/user-openid/by-oauth2',
data: data
})
}

68
enums/index.js

@ -4,8 +4,12 @@ const urlEnv = env === 'production' ? '' : `-${env}`
export const XAPPID = '503258978847966404'
// 统一支付接口
export const PAY_URL = `https://api-client-psc${urlEnv}.qniao.cn/payment-settlement-center/pay`
export const PAY_URL = `https://api-client-psc${urlEnv}.qniao.cn/payment-settlement-center/pay-for-service-account`
// 当前支付页面地址
export const VIP_URL = `https://shopkeeper${urlEnv}.qniao.cn/#/pages/vip-center/index`
// 千鸟云工厂公众号appid
export const QN_APPID = 'wxa1bf402cebec98ed'
/**
* 账号类型
*/
@ -14,7 +18,7 @@ export const accountType = {
PHONE: 2,
EMAIL: 3,
APPLEID: 4,
CUSTOM: 5,
CUSTOM: 5
}
/**
@ -25,7 +29,7 @@ export const codePurpose = {
RESET_LOGIN_PASSWORD: 2,
RESET_PHONE: 3,
BIND_BANK_CARD: 4,
RESET_CREDIT_PASSWORD: 5,
RESET_CREDIT_PASSWORD: 5
}
/**
@ -33,7 +37,7 @@ export const codePurpose = {
*/
export const verificationType = {
PHONE: 1,
EMAIL: 2,
EMAIL: 2
}
/**
* 法大大企业认证状态 1:未认证 2:认证中 3:已认证 4:认证失败
@ -42,14 +46,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月结453月结60飞算2期4月结755月结90飞算3期
@ -57,24 +61,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'
}
]
/**
* 结算周期112233
@ -82,16 +86,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: 先息后本
@ -99,8 +103,8 @@ export const fsSettlementPeriodEnum = [
export const fsSettlementMethodEnum = [
{
value: 1,
label: '先息后本',
},
label: '先息后本'
}
]
/**
@ -110,7 +114,7 @@ export const fsAuditStatus = {
WAIT_APPLY: 0,
AUDITING: 1,
PASS: 2,
REJECT: 3,
REJECT: 3
}
/**
@ -122,7 +126,7 @@ export const orderStatusEnum = {
WAIT_SUPPLIER_CONFIRM: 30204,
ORDERED: 30101,
FINISHED: 30104,
CANCELED: 30105,
CANCELED: 30105
}
/**
@ -131,28 +135,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 = {
@ -161,7 +165,7 @@ export const orderStatusMap = {
[orderStatusEnum.WAIT_SUPPLIER_CONFIRM]: '待供应商确认',
[orderStatusEnum.ORDERED]: '已下单',
[orderStatusEnum.FINISHED]: '已完成',
[orderStatusEnum.CANCELED]: '已取消',
[orderStatusEnum.CANCELED]: '已取消'
}
/**
@ -179,7 +183,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
@ -196,7 +200,7 @@ export const supplierOrderStatusMap = {
[supplierOrderStatusEnum.FINISHED]: '已完成',
[supplierOrderStatusEnum.WAIT_CLIENT_REPAY]: '待还款',
[supplierOrderStatusEnum.REPAYING]: '还款中',
[supplierOrderStatusEnum.CANCELED]: '已取消',
[supplierOrderStatusEnum.CANCELED]: '已取消'
}
/**
@ -205,11 +209,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]: '飞算支付'
}

311
pages/mine/index.vue

@ -1,70 +1,41 @@
<template>
<view class="content">
<view class="top-area">
<view class="reset">
<image class="bg" src="/static/imgs/mine/mine-top-bg.png"></image>
<view class="operation-area">
<view class="user">
<image class="avatar" :src="curAvatar"></image>
<view v-if="!hasLogin" @click="go2('login')">
<view>
<text style="font-size: 40rpx; color: #fff; font-weight: 600"
>点击登录</text
>
</view>
<view style="margin-top: 10rpx">
<text style="font-size: 26rpx; color: #fff; font-weight: 400"
>登录解锁更全功能</text
>
</view>
<image class="bg" src="/static/imgs/mine/mine-top-bg.png"></image>
<view class="operation-area">
<view class="user">
<image class="avatar" :src="curAvatar"></image>
<view v-if="!hasLogin" @click="go2('login')">
<view>
<text style="font-size: 40rpx; color: #fff; font-weight: 600">点击登录</text>
</view>
<view v-else>
<view class="user__name">
<text class="name">{{ userInfo.name }}</text>
<image
v-if="
userInfo.fddEnterpriseStatus === fddStatus.CERTIFIED_SUCCESS
"
class="image"
src="/static/imgs/mine/certified-icon.png"
></image>
<image
v-else
class="image"
@click="certifyCompany()"
src="/static/imgs/mine/non-certified-icon.png"
></image>
</view>
<view style="margin-top: 10rpx">
<text
style="
font-size: 26rpx;
color: #fff;
font-weight: 400;
word-break: break-all;
"
@click="
loginGo2(
hasCompany ? 'enterprise-info-edit' : 'enterprise-info'
)
"
>
{{ hasCompany ? userInfo.companyName : '点击完善企业信息' }}
</text>
</view>
<view style="margin-top: 10rpx">
<text style="font-size: 26rpx; color: #fff; font-weight: 400">登录解锁更全功能</text>
</view>
</view>
<view v-if="hasLogin" class="logout" @click="logout">
<text class="text">退出登录</text>
<image class="icon" src="/static/imgs/mine/logout-icon.png"></image>
<view v-else>
<view class="user__name">
<text class="name">{{ userInfo.name }}</text>
<image v-if="userInfo.fddEnterpriseStatus === fddStatus.CERTIFIED_SUCCESS" class="image" src="/static/imgs/mine/certified-icon.png"></image>
<image v-else class="image" @click="certifyCompany()" src="/static/imgs/mine/non-certified-icon.png"></image>
</view>
<view style="margin-top: 10rpx">
<text
style="font-size: 26rpx; color: #fff; font-weight: 400; word-break: break-all"
@click="loginGo2(hasCompany ? 'enterprise-info-edit' : 'enterprise-info')"
>
{{ hasCompany ? userInfo.companyName : '点击完善企业信息' }}
</text>
</view>
</view>
</view>
<view v-if="hasLogin" class="logout" @click="logout">
<text class="text">退出登录</text>
<image class="icon" src="/static/imgs/mine/logout-icon.png"></image>
</view>
</view>
</view>
<view
class="justify-between section_3"
style="margin-top: -68rpx; z-index: 10"
>
<view class="justify-between section_3" style="margin-top: -68rpx; z-index: 10">
<view class="flex-row group_6">
<image
src="https://project-user-resource-1256085488.cos.ap-guangzhou.myqcloud.com/611dd17441a9be0011f45822/620ccb0962a7d90011fe5c8f/16457830406308195340.png"
@ -75,101 +46,53 @@
<text class="text_5">会员</text>
</view>
</view>
<text class="text_6">{{
isVip ? `到期时间:${vipExpireTime}` : '立即开通会员 尊享特权'
}}</text>
<text class="text_6">{{ isVip ? `到期时间:${vipExpireTime}` : '立即开通会员 尊享特权' }}</text>
<view class="flex-col items-center text-wrapper" @click="makeVip">
<text>{{ isVip ? '续费会员' : '开通会员' }}</text>
</view>
</view>
<view class="card-area">
<view class="header">
<text
style="font-size: 30rpx; color: rgba(0, 0, 0, 0.85); font-weight: 600"
>我的订单</text
>
<view
class="item"
@click="loginGo2('order-list', { status: orderStatusEnum.ALL })"
>
<text style="font-size: 30rpx; color: rgba(0, 0, 0, 0.85); font-weight: 600">我的订单</text>
<view class="item" @click="loginGo2('order-list', { status: orderStatusEnum.ALL })">
<text style="font-size: 26rpx; color: #000000">查看更多订单</text>
<uni-icons
style="margin-left: 16rpx"
type="right"
size="10"
></uni-icons>
<uni-icons style="margin-left: 16rpx" type="right" size="10"></uni-icons>
</view>
</view>
<view class="order-area">
<view
class="icon-item"
@click="loginGo2('order-list', { status: orderStatusEnum.ALL })"
>
<image
class="icon"
src="/static/imgs/mine/order-all-icon.png"
></image>
<view class="icon-item" @click="loginGo2('order-list', { status: orderStatusEnum.ALL })">
<image class="icon" src="/static/imgs/mine/order-all-icon.png"></image>
<text class="label">全部订单</text>
</view>
<view
class="icon-item"
@click="
loginGo2('order-list', { status: orderStatusEnum.WAIT_CONFIRM })
"
>
<image
class="icon"
src="/static/imgs/mine/order-ready-icon.png"
></image>
<view class="icon-item" @click="loginGo2('order-list', { status: orderStatusEnum.WAIT_CONFIRM })">
<image class="icon" src="/static/imgs/mine/order-ready-icon.png"></image>
<text class="label">待确认</text>
</view>
<view
class="icon-item"
@click="
loginGo2('order-list', {
status: orderStatusEnum.WAIT_SUPPLIER_CONFIRM,
status: orderStatusEnum.WAIT_SUPPLIER_CONFIRM
})
"
>
<image
class="icon"
src="/static/imgs/mine/order-supplier-ready-icon.png"
></image>
<image class="icon" src="/static/imgs/mine/order-supplier-ready-icon.png"></image>
<text class="label">待供应商确认</text>
</view>
<view
class="icon-item"
@click="loginGo2('order-list', { status: orderStatusEnum.ORDERED })"
>
<image
class="icon"
src="/static/imgs/mine/order-ing-icon.png"
></image>
<view class="icon-item" @click="loginGo2('order-list', { status: orderStatusEnum.ORDERED })">
<image class="icon" src="/static/imgs/mine/order-ing-icon.png"></image>
<text class="label">已下单</text>
</view>
<view
class="icon-item"
@click="loginGo2('order-list', { status: orderStatusEnum.FINISHED })"
>
<image
class="icon"
src="/static/imgs/mine/order-done-icon.png"
></image>
<view class="icon-item" @click="loginGo2('order-list', { status: orderStatusEnum.FINISHED })">
<image class="icon" src="/static/imgs/mine/order-done-icon.png"></image>
<text class="label">已完成</text>
</view>
</view>
</view>
<view
class="card-area"
v-if="fsInfo.status !== -1"
style="border-radius: 16rpx"
>
<view class="card-area" v-if="fsInfo.status !== -1" style="border-radius: 16rpx">
<image
class="poster"
v-if="
fsInfo.status == fsAuditStatus.WAIT_APPLY ||
fsInfo.status == fsAuditStatus.REJECT
"
v-if="fsInfo.status == fsAuditStatus.WAIT_APPLY || fsInfo.status == fsAuditStatus.REJECT"
src="https://qncloud.oss-cn-shenzhen.aliyuncs.com/paper_shopkeeper/fs-to-apply.png"
@click="applyForFinance()"
></image>
@ -180,60 +103,32 @@
></image>
<view class="fs-card" v-if="fsInfo.status == fsAuditStatus.PASS">
<view class="left">
<text
style="
font-size: 30rpx;
color: rgba(0, 0, 0, 0.85);
font-weight: 600;
"
>可用采购额度</text
>
<text style="font-size: 30rpx; color: rgba(0, 0, 0, 0.85); font-weight: 600">可用采购额度</text>
<!-- 下面这行不要换行 -->
<!-- prettier-ignore -->
<view style="margin:24rpx 0 16rpx;"><text class="pre"></text><text class="next">{{fsInfo.availableCreditLine}}</text></view>
<text style="font-size: 24rpx; color: rgba(0, 0, 0, 0.75)">{{
`已使用: ¥ ${fsInfo.usedCreditLine}`
}}</text>
<text style="font-size: 24rpx; color: rgba(0, 0, 0, 0.75)">{{ `已使用: ¥ ${fsInfo.usedCreditLine}` }}</text>
</view>
<view class="right">
<text>{{ `授信额度: ${fsInfo.creditLine / 10000}` }}</text>
<uni-icons
style="margin-left: 16rpx"
type="right"
size="10"
></uni-icons>
<uni-icons style="margin-left: 16rpx" type="right" size="10"></uni-icons>
</view>
</view>
</view>
<view class="card-area">
<view class="header">
<text
style="font-size: 30rpx; color: rgba(0, 0, 0, 0.85); font-weight: 600"
>其他工具</text
>
<text style="font-size: 30rpx; color: rgba(0, 0, 0, 0.85); font-weight: 600">其他工具</text>
</view>
<view class="icon-area">
<view
class="icon-item"
style="margin-right: 64rpx"
@click="loginGo2('account-management')"
>
<view class="icon-item" style="margin-right: 64rpx" @click="loginGo2('account-management')">
<image class="icon" src="/static/imgs/mine/account-icon.png"></image>
<text class="label">账号管理</text>
</view>
<view
class="icon-item"
style="margin-right: 64rpx"
@click="loginGo2('enquiry-list')"
>
<view class="icon-item" style="margin-right: 64rpx" @click="loginGo2('enquiry-list')">
<image class="icon" src="/static/imgs/mine/enquiry-icon.png"></image>
<text class="label">我的询价</text>
</view>
<view
class="icon-item"
style="margin-right: 64rpx"
@click="loginGo2('address-manage')"
>
<view class="icon-item" style="margin-right: 64rpx" @click="loginGo2('address-manage')">
<image class="icon" src="/static/imgs/mine/address-icon.png"></image>
<text class="label">收货地址</text>
</view>
@ -245,17 +140,8 @@
<script>
import { exit, go2, loginGo2 } from '@/utils/hook.js'
import {
fddEnterpriseStatus,
fsAuditStatus,
orderStatusEnum,
} from '@/enums/index.js'
import {
getVerifyUrl,
getFsCredit,
getBaseInfo,
getFeisuanUrl,
} from '@/apis/commonApi.js'
import { fddEnterpriseStatus, fsAuditStatus, orderStatusEnum, VIP_URL, QN_APPID } from '@/enums/index.js'
import { getVerifyUrl, getFsCredit, getBaseInfo, getFeisuanUrl } from '@/apis/commonApi.js'
export default {
data() {
@ -265,10 +151,10 @@ export default {
status: -1, //
availableCreditLine: 0,
usedCreditLine: 0,
creditLine: 0,
creditLine: 0
},
fsAuditStatus: Object.freeze(fsAuditStatus),
orderStatusEnum: Object.freeze(orderStatusEnum),
orderStatusEnum: Object.freeze(orderStatusEnum)
}
},
methods: {
@ -278,11 +164,13 @@ export default {
return
}
if (this.hasCompany) {
loginGo2('vip-center')
let redirectUrl = encodeURIComponent(VIP_URL)
window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${QN_APPID}&redirect_uri=${redirectUrl}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect`
// loginGo2('vip-center')
} else {
uni.showToast({
title: '请先完善企业信息',
icon: 'none',
icon: 'none'
})
}
},
@ -292,32 +180,25 @@ export default {
},
//
certifyCompany() {
if (
this.userInfo.fddEnterpriseStatus === fddEnterpriseStatus.UNCERTIFIED ||
this.userInfo.fddEnterpriseStatus === fddEnterpriseStatus.CERTIFIED_FAIL
) {
getVerifyUrl({ enterpriseId: this.$store.state.companyInfo.id }).then(
(res) => {
if (res) {
// #ifdef APP-PLUS
go2('page-view', {
title: '实名认证',
url: encodeURIComponent(res),
})
// #endif
// #ifdef H5
window ? (window.location.href = res) : ''
// #endif
}
if (this.userInfo.fddEnterpriseStatus === fddEnterpriseStatus.UNCERTIFIED || this.userInfo.fddEnterpriseStatus === fddEnterpriseStatus.CERTIFIED_FAIL) {
getVerifyUrl({ enterpriseId: this.$store.state.companyInfo.id }).then((res) => {
if (res) {
// #ifdef APP-PLUS
go2('page-view', {
title: '实名认证',
url: encodeURIComponent(res)
})
// #endif
// #ifdef H5
window ? (window.location.href = res) : ''
// #endif
}
)
})
}
if (
this.userInfo.fddEnterpriseStatus === fddEnterpriseStatus.UNCERTIFIED
) {
if (this.userInfo.fddEnterpriseStatus === fddEnterpriseStatus.UNCERTIFIED) {
uni.showToast({
title: '认证中,请稍后~',
icon: 'none',
icon: 'none'
})
}
},
@ -328,7 +209,7 @@ export default {
// #ifdef APP-PLUS
go2('page-view', {
title: '飞算申请',
url: encodeURIComponent(res),
url: encodeURIComponent(res)
})
// #endif
// #ifdef H5
@ -336,7 +217,7 @@ export default {
// #endif
}
})
},
}
//
},
computed: {
@ -367,23 +248,19 @@ export default {
console.log('companyInfo:', this.$store.state.companyInfo)
return {
avatar: this.$store.state.userInfo.avatar || '',
name:
this.$store.state.userInfo.name ||
this.$store.state.userInfo.mobile ||
'',
name: this.$store.state.userInfo.name || this.$store.state.userInfo.mobile || '',
companyName: this.$store.state.companyInfo.name || '',
fddEnterpriseStatus:
this.$store.state.companyInfo.fddEnterpriseStatus || 1,
fddEnterpriseStatus: this.$store.state.companyInfo.fddEnterpriseStatus || 1
}
},
hasCompany() {
return this.$store.state.companyInfo.id != null
},
}
},
onShow() {
this.hasLogin &&
getFsCredit({
enterpriseId: this.$store.state.companyInfo.id,
enterpriseId: this.$store.state.companyInfo.id
}).then((res) => {
if (res) {
this.fsInfo = res
@ -391,7 +268,7 @@ export default {
})
this.hasLogin && getBaseInfo({}, true)
!this.hasLogin && (this.fsInfo.status = -1)
},
}
}
</script>
@ -401,21 +278,13 @@ export default {
flex-direction: column;
align-items: center;
justify-content: center;
width: 750rpx;
}
.top-area {
width: 750rpx;
height: 380rpx;
overflow: hidden;
position: relative;
border-radius: 0 0 350px 350px;
transform: scaleX(2.5);
.reset {
width: 750rpx;
height: 380rpx;
transform: scaleX(0.4); //
position: relative;
overflow: hidden;
}
.bg {
width: 750rpx;
height: 380rpx;
@ -598,13 +467,7 @@ export default {
}
.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%
);
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 {
@ -648,13 +511,7 @@ export default {
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%
);
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;

12
pages/paper-details/index.vue

@ -28,8 +28,10 @@
</view>
<view class="list-box">
<view class="label">克重</view>
<view class="tag-box" v-for="(titem, tindex) in info.skuList" :key="tindex">
<text>{{ titem.weight }}g</text>
<view style="width: 600rpx; overflow-x: auto" class="flex-row-center-start">
<view class="tag-box" v-for="(tItem, tIndex) in info.skuList" :key="tIndex">
<text>{{ tItem.weight }}g</text>
</view>
</view>
</view>
<view class="list-box">
@ -94,7 +96,7 @@
</view>
<view class="choose-box">
<view class="label">请选择克重</view>
<view class="tag-row">
<view class="flex-row-center-start" style="width: 684rpx; overflow-x: auto">
<view
:class="['tag-box', kgActive === kIndex ? 'kg-select' : '']"
v-for="(kItem, kIndex) in info.skuList"
@ -118,11 +120,11 @@
</view>
</view>
<view class="input-row">
<view class="">
<view style="flex: 1 1 auto">
<uni-easyinput :inputBorder="false" class="easyinput" type="number" v-model="buyPaperDto.width" placeholder="请输入"></uni-easyinput>
</view>
<view class="symbol">x</view>
<view class="">
<view style="flex: 1 1 auto">
<uni-easyinput :inputBorder="false" class="easyinput" type="number" v-model="buyPaperDto.length" placeholder="请输入"></uni-easyinput>
</view>
</view>

130
pages/vip-center/index.vue

@ -1,12 +1,6 @@
<template>
<view class="content">
<uni-nav-bar
left-icon="back"
@clickLeft="back"
statusBar
fixed
title="会员中心"
></uni-nav-bar>
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="会员中心"></uni-nav-bar>
<view class="flex-col group_4">
<view class="flex-col">
<view class="flex-col section_1">
@ -50,9 +44,7 @@
<text class="text_14">服务说明</text>
<text class="text_15">1.纸掌柜会员支付支持微信支付</text>
<text class="text_16">2.支付成功后会员权益立即生效</text>
<text class="text_17"
>3.会员权益最终解释权归千鸟互联电商科技有限公司所有</text
>
<text class="text_17">3.会员权益最终解释权归千鸟互联电商科技有限公司所有</text>
</view>
</view>
</view>
@ -65,65 +57,77 @@
</view>
</template>
<script>
import { back } from '@/utils/hook.js'
import { openVip, openVipPay } from '@/apis/commonApi.js'
import { back, go2 } from '@/utils/hook.js'
import { openVip, openVipPay, getOpenId } from '@/apis/commonApi.js'
export default {
data() {
return {
money: 2000,
wxCode: null
}
},
methods: {
back,
payForVip() {
openVip({
enterpriseId: this.$store.state.companyInfo.id,
type: 1, //
}).then((res) => {
if (res) {
openVipPay({
tradeOrderId: res.orderId,
channelId: res.channelId,
}).then((info) => {
if (info) {
console.log('info', info)
if (typeof WeixinJSBridge == 'undefined') {
uni.showToast({
title: '请在微信内置浏览器中支付,或微信扫码进入本系统',
icon: 'error',
})
} else {
WeixinJSBridge.invoke(
'getBrandWCPayRequest',
info.extra,
function (res) {
if (res.err_msg == 'get_brand_wcpay_request:ok') {
uni.showToast({
title: '支付成功',
icon: 'success',
duration: 2000,
})
setTimeout(() => {
go2('mine', {}, true)
}, 2000)
// 使,
//res.err_msgok
} else {
uni.showToast({
title: '支付失败',
icon: 'error',
duration: 2000,
})
}
}
)
}
let promises = [
openVip({
enterpriseId: this.$store.state.companyInfo.id,
type: 1 //
}),
getOpenId({ authCode: this.wxCode, authMethod: 'WeChatServiceAccount' })
]
Promise.all(promises).then((res) => {
if (res[0] && res[1]) {
openVipPay({ channelId: res[0].channelId, tradeOrderId: res[0].orderId, userOpenId: res[1].openId }).then((res) => {
if (res) {
this.wxPay(res)
}
})
}
})
},
},
//
wxPay(info) {
WeixinJSBridge.invoke('getBrandWCPayRequest', info.extra, function (res) {
//res.err_msgok
if (res.err_msg == 'get_brand_wcpay_request:ok') {
uni.showToast({
title: '支付成功',
icon: 'success',
duration: 1000
})
setTimeout(() => {
go2('mine', {}, true)
}, 1000)
} else {
uni.showToast({
title: '支付失败',
icon: 'error',
duration: 2000
})
setTimeout(() => {
go2('mine', {}, true)
}, 1000)
}
})
},
onLoad() {
let url = window.location.href
let codeIndex = url.indexOf('code=')
if (codeIndex === -1) {
uni.showModal({
title: '提示',
content: '参数错误,请重新打开',
success: (res) => {
back()
}
})
} else {
let endIndex = url.indexOf('&', codeIndex)
this.wxCode = url.substring(codeIndex + 5, endIndex)
}
}
}
}
</script>
@ -142,23 +146,11 @@ export default {
font-weight: 500;
line-height: 50rpx;
white-space: nowrap;
background-image: linear-gradient(
180deg,
rgb(43, 41, 44) 0%,
rgb(43, 41, 44) 0%,
rgb(60, 58, 52) 100%,
rgb(60, 58, 52) 100%
);
background-image: linear-gradient(180deg, rgb(43, 41, 44) 0%, rgb(43, 41, 44) 0%, rgb(60, 58, 52) 100%, rgb(60, 58, 52) 100%);
.button {
margin: 0 32rpx;
padding: 23rpx 0;
background-image: linear-gradient(
90deg,
rgb(255, 234, 208) 0%,
rgb(255, 234, 208) 0%,
rgb(255, 206, 144) 100%,
rgb(255, 206, 144) 100%
);
background-image: linear-gradient(90deg, rgb(255, 234, 208) 0%, rgb(255, 234, 208) 0%, rgb(255, 206, 144) 100%, rgb(255, 206, 144) 100%);
border-radius: 48rpx;
}
}

BIN
static/logo.png

Before After
Width: 72  |  Height: 72  |  Size: 6.6 KiB Width: 100  |  Height: 100  |  Size: 10 KiB
Loading…
Cancel
Save