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
})
}
export function saveOrder(data) {
return request({
url: '/member/order/uniSaveOrder',

View File

@ -30,7 +30,9 @@
<!-- #endif -->
<!-- 调整h5 -->
<!-- #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 -->
</view>
@ -95,12 +97,16 @@
import {
getToken
} from '@/utils/auth'
import {
getConfigByCode
} from '@/api/system/config.js'
export default {
components: {
navigationBarVue
},
data() {
return {
payType: 'h5',
globalConfig: getApp().globalData.config,
menus: ['急招券', '购买记录'],
menuIndex: 0,
@ -124,6 +130,7 @@
},
onLoad(option) {
this.menuIndex = option.index || 0
this.getConfigKey()
this.initCoupon();
this.initOrder()
//urlsearch
@ -162,6 +169,13 @@
}
},
methods: {
getConfigKey() {
getConfigByCode('payType').then(res => {
if (res.msg) {
this.payType = res.msg
}
})
},
initMyCoupon() {
getMemberCoupon().then(res => {
this.coupon = res.data
@ -257,7 +271,8 @@
if (res.code == 200) {
//
let payData = {
orderNo: res.data.orderNo
orderNo: res.data.orderNo,
type: that.payType
}
prepayment(payData).then(paymentData => {
that.wxpay(paymentData)
@ -312,16 +327,47 @@
},
// WeixinJSBridge
wxpay(data) {
if (typeof WeixinJSBridge == "undefined") {
if (document.addEventListener) {
document.addEventListener('WeixinJSBridgeReady', onBridgeReady(data), false);
} else if (document.attachEvent) {
document.attachEvent('WeixinJSBridgeReady', onBridgeReady(data));
document.attachEvent('onWeixinJSBridgeReady', onBridgeReady(data));
if (this.payType == 'h5') {
if (typeof WeixinJSBridge == "undefined") {
if (document.addEventListener) {
document.addEventListener('WeixinJSBridgeReady', onBridgeReady(data), false);
} else if (document.attachEvent) {
document.attachEvent('WeixinJSBridgeReady', onBridgeReady(data));
document.attachEvent('onWeixinJSBridgeReady', onBridgeReady(data));
}
} else {
this.onBridgeReady(data);
}
} 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) {

View File

@ -33,9 +33,9 @@
<!-- #endif -->
<!-- 调整h5 -->
<!-- #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" v-else @click="toOrder()">立即开通</view>
<!-- #endif -->
<!-- 协议 -->
<view class="xieyi-box">
@ -77,6 +77,9 @@
<script>
import navigationBarVue from '@/components/navigation/navigationBar.vue';
import {
getConfigByCode
} from '@/api/system/config.js'
import {
baseCardList,
rightList
@ -99,6 +102,7 @@
},
data() {
return {
payType: 'h5',
globalConfig: getApp().globalData.config,
ifAgree: 0,
//
@ -204,9 +208,17 @@
} else {
this.toLogin(userTypeTemp)
}
this.getConfigKey()
},
methods: {
getConfigKey() {
getConfigByCode('payType').then(res => {
if (res.msg) {
this.payType = res.msg
}
})
},
openVip() {
//
wx.openOfficialAccountProfile({
@ -333,11 +345,15 @@
if (res.code == 200) {
//
let payData = {
orderNo: res.data.orderNo
orderNo: res.data.orderNo,
type: that.payType
}
prepayment(payData).then(paymentData => {
that.wxpay(paymentData)
})
// uni.navigateBack()
}
}).catch((e) => {
@ -350,16 +366,47 @@
},
// WeixinJSBridge
wxpay(data) {
if (typeof WeixinJSBridge == "undefined") {
if (document.addEventListener) {
document.addEventListener('WeixinJSBridgeReady', onBridgeReady(data), false);
} else if (document.attachEvent) {
document.attachEvent('WeixinJSBridgeReady', onBridgeReady(data));
document.attachEvent('onWeixinJSBridgeReady', onBridgeReady(data));
if (this.payType == 'h5') {
if (typeof WeixinJSBridge == "undefined") {
if (document.addEventListener) {
document.addEventListener('WeixinJSBridgeReady', onBridgeReady(data), false);
} else if (document.attachEvent) {
document.attachEvent('WeixinJSBridgeReady', onBridgeReady(data));
document.attachEvent('onWeixinJSBridgeReady', onBridgeReady(data));
}
} else {
this.onBridgeReady(data);
}
} 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) {
@ -617,4 +664,4 @@
}
}
}
</style>
</style>

View File

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

View File

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

View File

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