crm功能开发

This commit is contained in:
13405411873 2025-06-20 15:20:04 +08:00
parent 2128c68570
commit 56d58b4c0b
6 changed files with 243 additions and 70 deletions

View File

@ -176,7 +176,6 @@ export function prepayment(data) {
params: data params: data
}) })
} }
export function saveOrder(data) { export function saveOrder(data) {
return request({ return request({
url: '/member/order/uniSaveOrder', url: '/member/order/uniSaveOrder',

View File

@ -30,7 +30,9 @@
<!-- #endif --> <!-- #endif -->
<!-- 调整h5 --> <!-- 调整h5 -->
<!-- #ifdef MP-WEIXIN --> <!-- #ifdef MP-WEIXIN -->
<button class="button-dom" open-type="contact">购买</button> <button v-if="payType=='h5'" class="button-dom" open-type="contact">购买</button>
<!-- <view class="buy-button" @click="openVip()">立即开通</view> -->
<view class="button-dom" v-else @click="toOrder()">购买</view>
<!-- #endif --> <!-- #endif -->
</view> </view>
@ -95,12 +97,16 @@
import { import {
getToken getToken
} from '@/utils/auth' } from '@/utils/auth'
import {
getConfigByCode
} from '@/api/system/config.js'
export default { export default {
components: { components: {
navigationBarVue navigationBarVue
}, },
data() { data() {
return { return {
payType: 'h5',
globalConfig: getApp().globalData.config, globalConfig: getApp().globalData.config,
menus: ['急招券', '购买记录'], menus: ['急招券', '购买记录'],
menuIndex: 0, menuIndex: 0,
@ -124,6 +130,7 @@
}, },
onLoad(option) { onLoad(option) {
this.menuIndex = option.index || 0 this.menuIndex = option.index || 0
this.getConfigKey()
this.initCoupon(); this.initCoupon();
this.initOrder() this.initOrder()
//urlsearch //urlsearch
@ -162,6 +169,13 @@
} }
}, },
methods: { methods: {
getConfigKey() {
getConfigByCode('payType').then(res => {
if (res.msg) {
this.payType = res.msg
}
})
},
initMyCoupon() { initMyCoupon() {
getMemberCoupon().then(res => { getMemberCoupon().then(res => {
this.coupon = res.data this.coupon = res.data
@ -257,7 +271,8 @@
if (res.code == 200) { if (res.code == 200) {
// //
let payData = { let payData = {
orderNo: res.data.orderNo orderNo: res.data.orderNo,
type: that.payType
} }
prepayment(payData).then(paymentData => { prepayment(payData).then(paymentData => {
that.wxpay(paymentData) that.wxpay(paymentData)
@ -312,16 +327,47 @@
}, },
// WeixinJSBridge // WeixinJSBridge
wxpay(data) { wxpay(data) {
if (typeof WeixinJSBridge == "undefined") { if (this.payType == 'h5') {
if (document.addEventListener) { if (typeof WeixinJSBridge == "undefined") {
document.addEventListener('WeixinJSBridgeReady', onBridgeReady(data), false); if (document.addEventListener) {
} else if (document.attachEvent) { document.addEventListener('WeixinJSBridgeReady', onBridgeReady(data), false);
document.attachEvent('WeixinJSBridgeReady', onBridgeReady(data)); } else if (document.attachEvent) {
document.attachEvent('onWeixinJSBridgeReady', onBridgeReady(data)); document.attachEvent('WeixinJSBridgeReady', onBridgeReady(data));
document.attachEvent('onWeixinJSBridgeReady', onBridgeReady(data));
}
} else {
this.onBridgeReady(data);
} }
} else { } else {
this.onBridgeReady(data); console.log(data, 381);
uni.requestPayment({
provider: 'wxpay', //
timeStamp: data.timeStamp + '', //
nonceStr: data.nonceStr, //
appId: data.appId,
package: data.packageVal, // prepay_id
signType: data.signType, //
paySign: data.paySign, //
success: (res) => {
//
uni.showToast({
title: "支付成功",
icon: "success",
duration: 2000
})
},
fail: (err) => {
console.log(err, 160);
//
uni.showToast({
title: "支付失败,请联系管理员!",
icon: "none"
})
}
});
} }
}, },
onBridgeReady(data) { onBridgeReady(data) {

View File

@ -33,9 +33,9 @@
<!-- #endif --> <!-- #endif -->
<!-- 调整h5 --> <!-- 调整h5 -->
<!-- #ifdef MP-WEIXIN --> <!-- #ifdef MP-WEIXIN -->
<button class="buy-button" open-type="contact">立即开通</button> <button v-if="payType=='h5'" class="buy-button" open-type="contact">立即开通</button>
<!-- <view class="buy-button" @click="openVip()">立即开通</view> --> <!-- <view class="buy-button" @click="openVip()">立即开通</view> -->
<view class="buy-button" v-else @click="toOrder()">立即开通</view>
<!-- #endif --> <!-- #endif -->
<!-- 协议 --> <!-- 协议 -->
<view class="xieyi-box"> <view class="xieyi-box">
@ -77,6 +77,9 @@
<script> <script>
import navigationBarVue from '@/components/navigation/navigationBar.vue'; import navigationBarVue from '@/components/navigation/navigationBar.vue';
import {
getConfigByCode
} from '@/api/system/config.js'
import { import {
baseCardList, baseCardList,
rightList rightList
@ -99,6 +102,7 @@
}, },
data() { data() {
return { return {
payType: 'h5',
globalConfig: getApp().globalData.config, globalConfig: getApp().globalData.config,
ifAgree: 0, ifAgree: 0,
// //
@ -204,9 +208,17 @@
} else { } else {
this.toLogin(userTypeTemp) this.toLogin(userTypeTemp)
} }
this.getConfigKey()
}, },
methods: { methods: {
getConfigKey() {
getConfigByCode('payType').then(res => {
if (res.msg) {
this.payType = res.msg
}
})
},
openVip() { openVip() {
// //
wx.openOfficialAccountProfile({ wx.openOfficialAccountProfile({
@ -333,11 +345,15 @@
if (res.code == 200) { if (res.code == 200) {
// //
let payData = { let payData = {
orderNo: res.data.orderNo orderNo: res.data.orderNo,
type: that.payType
} }
prepayment(payData).then(paymentData => { prepayment(payData).then(paymentData => {
that.wxpay(paymentData) that.wxpay(paymentData)
}) })
// uni.navigateBack() // uni.navigateBack()
} }
}).catch((e) => { }).catch((e) => {
@ -350,16 +366,47 @@
}, },
// WeixinJSBridge // WeixinJSBridge
wxpay(data) { wxpay(data) {
if (typeof WeixinJSBridge == "undefined") { if (this.payType == 'h5') {
if (document.addEventListener) { if (typeof WeixinJSBridge == "undefined") {
document.addEventListener('WeixinJSBridgeReady', onBridgeReady(data), false); if (document.addEventListener) {
} else if (document.attachEvent) { document.addEventListener('WeixinJSBridgeReady', onBridgeReady(data), false);
document.attachEvent('WeixinJSBridgeReady', onBridgeReady(data)); } else if (document.attachEvent) {
document.attachEvent('onWeixinJSBridgeReady', onBridgeReady(data)); document.attachEvent('WeixinJSBridgeReady', onBridgeReady(data));
document.attachEvent('onWeixinJSBridgeReady', onBridgeReady(data));
}
} else {
this.onBridgeReady(data);
} }
} else { } else {
this.onBridgeReady(data); console.log(data, 381);
uni.requestPayment({
provider: 'wxpay', //
timeStamp: data.timeStamp + '', //
nonceStr: data.nonceStr, //
appId: data.appId,
package: data.packageVal, // prepay_id
signType: data.signType, //
paySign: data.paySign, //
success: (res) => {
//
uni.showToast({
title: "支付成功",
icon: "success",
duration: 2000
})
},
fail: (err) => {
console.log(err, 160);
//
uni.showToast({
title: "支付失败,请联系管理员!",
icon: "none"
})
}
});
} }
}, },
onBridgeReady(data) { onBridgeReady(data) {

View File

@ -34,7 +34,7 @@
<view v-if="ifHasWaiting" class="daiban-box"> <view v-if="ifHasWaiting" class="daiban-box">
<view class="daiban-dom" @click="repay()"> <view class="daiban-dom" @click="repay()">
<uni-icons type="chat-filled" size="18" style="padding-right: 10rpx;"></uni-icons> <uni-icons type="chat-filled" size="18" style="padding-right: 10rpx;"></uni-icons>
您有一笔<text>{{ wayOrder.points }}</text>积分的提现订单请及时处理 您有一笔<text>{{ wayOrder.points }}</text>积分的提现订单请及时处理
<uni-icons type="right" size="18" style="padding-left: 10rpx;"></uni-icons> <uni-icons type="right" size="18" style="padding-left: 10rpx;"></uni-icons>
</view> </view>
</view> </view>
@ -93,6 +93,9 @@
import { import {
entPay entPay
} from '@/api/wxApi.js' } from '@/api/wxApi.js'
import {
queryDetail
} from '@/api/business/member.js'
export default { export default {
components: { components: {
@ -102,6 +105,7 @@
return { return {
// //
ifMember: true, ifMember: true,
userInfo: {},
// //
ifHasWaiting: true, ifHasWaiting: true,
menus: ['积分收支明细'], menus: ['积分收支明细'],
@ -133,7 +137,8 @@
isTriggered: false, isTriggered: false,
userId: null, userId: null,
pointsBalance: 0, pointsBalance: 0,
money: "" money: "",
interval: null
} }
}, },
@ -142,12 +147,31 @@
this.queryParams.userId = option.userId this.queryParams.userId = option.userId
this.pointsBalance = option.pointsBalance this.pointsBalance = option.pointsBalance
this.initData() this.initData()
},
onShow() {
this.initWayOrder() this.initWayOrder()
}, this.getDetail()
let that = this
this.interval = setInterval(function() {
that.initData()
that.initWayOrder()
that.getDetail()
}, 1000);
},
onUnload() {
console.log('clear');
clearTimeout(this.interval); //
},
methods: { methods: {
getDetail() {
let param = {
userId: this.userId,
userType: '02'
}
queryDetail(param).then(res => {
this.pointsBalance = res.data.pointsBalance.toString()
this.$forceUpdate()
})
},
initWayOrder() { initWayOrder() {
getOnWayOrder().then(res => { getOnWayOrder().then(res => {
if (res.code == 200) { if (res.code == 200) {
@ -176,7 +200,7 @@
/**初始化数据*/ /**初始化数据*/
initData() { initData() {
pointList(this.queryParams).then(res => { pointList(this.queryParams).then(res => {
this.isTriggered = false this.isTriggered = false
if (res.code == 200) { if (res.code == 200) {
if (this.queryParams.pageNum == 1) { if (this.queryParams.pageNum == 1) {
this.dataList = res.data.records this.dataList = res.data.records
@ -186,13 +210,13 @@
this.total = res.data.total this.total = res.data.total
} }
}).catch((e) => { }).catch((e) => {
this.isTriggered = false this.isTriggered = false
uni.showToast({ uni.showToast({
icon: 'error', icon: 'error',
duration: 2000, duration: 2000,
title: e title: e
}); });
}) })
}, },
/** /**
* 计算提现的积分等于多少钱 * 计算提现的积分等于多少钱
@ -213,33 +237,36 @@
this.$refs.inputDialog.open() this.$refs.inputDialog.open()
}, },
repay(){ repay() {
// //
entPay(this.wayOrder.orderNo).then(payS => { entPay(this.wayOrder.orderNo).then(payS => {
uni.hideLoading() uni.hideLoading()
if (wx.canIUse('requestMerchantTransfer')) { if (wx.canIUse('requestMerchantTransfer')) {
wx.requestMerchantTransfer({ let that = this
mchId: payS.config.mchId, wx.requestMerchantTransfer({
appId: payS.config.appId, mchId: payS.config.mchId,
package: payS.runData.packageInfo, appId: payS.config.appId,
success: (res) => { package: payS.runData.packageInfo,
// res.err_msgok success: (res) => {
console.log('success:', res); // res.err_msgok
this.initWayOrder() console.log('success:', res);
this.initData() this.initWayOrder()
}, this.initData()
fail: (res) => { this.getDetail()
console.log('fail:', res);
}, },
}); fail: (res) => {
} else { console.log('fail:', res);
wx.showModal({ },
content: '你的微信版本过低,请更新至最新版本。', });
showCancel: false, } else {
}); wx.showModal({
} content: '你的微信版本过低,请更新至最新版本。',
}) showCancel: false,
}, });
}
})
},
dialogInputConfirm(val) { dialogInputConfirm(val) {
if (val) { if (val) {
@ -304,7 +331,7 @@
} }
//+1, //+1,
this.queryParams.pageNum++ this.queryParams.pageNum++
this.initData() this.initData()
}, },
/** /**
* 下拉刷新数据 * 下拉刷新数据
@ -313,7 +340,7 @@
this.isTriggered = true this.isTriggered = true
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
this.total = 0 this.total = 0
this.initData() this.initData()
}, },
} }
} }

View File

@ -210,6 +210,14 @@
placeholder="请输入通告明细" /> --> placeholder="请输入通告明细" /> -->
</view> </view>
</view> </view>
<!-- <view class="item-field" v-if="userInfo.identityType=='05'">
<view class="item-lable is-required">
三方报名链接
</view>
<view class="item-value">
<input class="uni-input" v-model="dataObj.thirdUrl" type="text" placeholder="请输入" />
</view>
</view> -->
<view class="item-field"> <view class="item-field">
<view class="item-lable"> <view class="item-lable">
三方报名链接 三方报名链接
@ -283,8 +291,14 @@
toast, toast,
hasRights hasRights
} from '@/utils/common.js' } from '@/utils/common.js'
import constant from '@/utils/constant';
import rightsCode from '@/utils/rightsCode' import rightsCode from '@/utils/rightsCode'
import {
getJSONData
} from '@/utils/auth.js'
import constant from '@/utils/constant';
import {
queryDetail
} from '@/api/business/member.js'
export default { export default {
components: { components: {
navigationBarVue, navigationBarVue,
@ -292,6 +306,7 @@
}, },
data() { data() {
return { return {
loading: false,
nowDate: new Date(), nowDate: new Date(),
// //
dataTree: [], dataTree: [],
@ -381,7 +396,8 @@
text: "限制" text: "限制"
} }
], ],
isEdit: 0 isEdit: 0,
userInfo: {}
} }
}, },
@ -397,9 +413,23 @@
} }
}, },
onShow() { onShow() {
if (null != getJSONData(constant.userInfo)) {
this.userInfo = getJSONData(constant.userInfo)
this.getDetail()
}
this.loading = false
}, },
methods: { methods: {
getDetail() {
let param = {
userId: this.userInfo.userId,
userType: '01'
}
queryDetail(param).then(res => {
this.userInfo.identityType = res.data.identityType
this.$forceUpdate()
})
},
/** /**
* 鉴权通用方法 * 鉴权通用方法
* @param {Object} rigthsCode * @param {Object} rigthsCode
@ -425,7 +455,6 @@
if (this.isEdit == 0) { if (this.isEdit == 0) {
this.dataObj.id = null this.dataObj.id = null
} }
if (res.data.noticeDetail.bloggerTypes) { if (res.data.noticeDetail.bloggerTypes) {
this.dataObj.bloggerTypesList = res.data.noticeDetail.bloggerTypes.split(",") this.dataObj.bloggerTypesList = res.data.noticeDetail.bloggerTypes.split(",")
} else { } else {
@ -553,12 +582,22 @@
}) })
return true; return true;
} }
// if (this.userInfo.identityType == '05' && !data.thirdUrl) {
// //pr
// uni.showToast({
// title: '',
// icon: 'none',
// duration: 1000
// })
// return
// }
}, },
// //
preview() { preview() {
if (this.validForm(this.dataObj)) { if (this.validForm(this.dataObj)) {
return return
} }
let str = this.dataObj.detail.replace(/\n|\r\n/g, "<br>") let str = this.dataObj.detail.replace(/\n|\r\n/g, "<br>")
console.log(str, "str") console.log(str, "str")
this.dataObj.detail = str this.dataObj.detail = str
@ -588,9 +627,20 @@
}) })
}, },
publish() { publish() {
if (this.loading) {
uni.showToast({
title: '请勿重复发布'
})
return
}
if (this.validForm(this.dataObj)) { if (this.validForm(this.dataObj)) {
return return
} }
this.loading = true
uni.showLoading({
title: '发布检测中'
})
//pr
let str = this.dataObj.detail.replace(/\n|\r\n/g, "<br>") let str = this.dataObj.detail.replace(/\n|\r\n/g, "<br>")
this.dataObj.detail = str this.dataObj.detail = str
if (this.fileList && this.fileList.length > 0) { if (this.fileList && this.fileList.length > 0) {
@ -603,8 +653,6 @@
this.dataObj.images = this.dataObj.images.join(',') this.dataObj.images = this.dataObj.images.join(',')
} }
} }
this.groupImageList.forEach(it => { this.groupImageList.forEach(it => {
this.dataObj.groupImage = it.url.replace(config.baseUrl, '') this.dataObj.groupImage = it.url.replace(config.baseUrl, '')
}) })
@ -613,19 +661,23 @@
// //
this.dataObj.approvalStatus = '0' this.dataObj.approvalStatus = '0'
saveNotice(this.dataObj).then(res => { saveNotice(this.dataObj).then(res => {
uni.hideLoading()
this.dataObj.id = res.data.noticeId this.dataObj.id = res.data.noticeId
uni.showToast({ uni.showToast({
title: res.data.msg, title: res.data.msg,
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) })
setTimeout(function() { setTimeout(function() {
this.loading = false
uni.navigateBack() uni.navigateBack()
}, 1000) }, 1000)
}) })
setTimeout(function() {
this.loading = false
}, 3000)
}, },
/** /**
* 查看通告详情 * 查看通告详情

View File

@ -35,6 +35,7 @@ const request = config => {
header: config.header, header: config.header,
dataType: 'json' dataType: 'json'
}).then(response => { }).then(response => {
uni.hideLoading()
let [error, res] = response let [error, res] = response
if (error) { if (error) {
toast('后端接口连接异常') toast('后端接口连接异常')
@ -65,6 +66,7 @@ const request = config => {
resolve(res.data) resolve(res.data)
}) })
.catch(error => { .catch(error => {
uni.hideLoading()
let { let {
message message
} = error } = error