chenkun 10 months ago
parent
commit
884667629b
5 changed files with 186 additions and 56 deletions
  1. +1
    -1
      api/api.js
  2. +8
    -3
      pages_mine/mine/promotionRecord.vue
  3. +91
    -28
      pages_mine/mine/sonPage/promotion/promotionDetail.vue
  4. +1
    -1
      pages_mine/mine/sonPage/promotion/promotionRecordList.vue
  5. +85
    -23
      pages_mine/mine/updateUserInfo.vue

+ 1
- 1
api/api.js View File

@ -164,7 +164,7 @@ const config = {
showLoading : true,
},
// 确认推广
ConfirmPromotion: {
confirmPromotion: {
url: '/api/info/confirmPromotion',
method: 'POST',
auth: true,


+ 8
- 3
pages_mine/mine/promotionRecord.vue View File

@ -59,7 +59,14 @@
},
data() {
return {
promotionRecordList: [],
promotionRecordList: [
{
name:'aaa',
tuTime:1,
price:9.9,
createTime:new Date(),
}
],
queryParams: {
pageNo: 1,
pageSize: 10,
@ -70,7 +77,6 @@
}
},
onReachBottom() {
console.log("=====")
let allTotal = this.queryParams.pageNo * this.queryParams.pageSize
if (allTotal < this.total) {
//
@ -79,7 +85,6 @@
}
},
mounted() {
console.log("====")
this.getData()
},
methods: {


+ 91
- 28
pages_mine/mine/sonPage/promotion/promotionDetail.vue View File

@ -20,7 +20,7 @@
</view>
</view> -->
<view class="item">
<view class="label">推广作品</view>
<view class="label">推广作品名称</view>
<view class="value">{{item.name}}</view>
</view>
<view class="item">
@ -42,8 +42,8 @@
<view class="label">剩余推广时长</view>
<view class="value">{{item.remainingPromotionTime}}</view>
</view>
<!-- <view>推广作品</view>
<view style="width: 30%;height: 300rpx;border-radius: 20rpx;overflow: hidden;">
<image :src="item.image" style="width: 100%;height: 100%;"></image>
@ -67,13 +67,13 @@
<!--付费周期-->
<view style="" class="payCycle">
<view>付费周期</view>
<view>{{item.day}}</view>
<view>{{popupData.day}}</view>
</view>
<!--金额-->
<view style="width:100%;display: flex;justify-content: space-between;align-items: center;">
<view>金额</view>
<view>{{item.money}}</view>
<view>{{popupData.money}}</view>
</view>
<!--确认推广按钮-->
@ -86,11 +86,11 @@
</uv-popup>
<!--支付弹框-->
<confirmationPopup ref="confirmationPopup" title="提示" @confirm="pay" confirmText="确认支付">
<confirmationPopup ref="confirmationPopup" title="提示" @confirm="payOrder" confirmText="确认支付">
<view class="confirmationPopup">
<image src="/static/image/publish/pay.png" style="width: 150rpx;height: 150rpx;" mode=""></image>
<view class="info">
确认支付{{ item.money }}可置顶{{ item.day }}
确认支付{{ popupData.money }}可置顶{{ popupData.day }}
</view>
</view>
</confirmationPopup>
@ -134,6 +134,10 @@
day: 0,
money: 0,
},
popupData: {
day: 0,
money: 0,
},
param: {
type: 'default',
title: '结束后跳转标签页',
@ -149,7 +153,9 @@
methods: {
// 广
getData() {
this.$api('infoGetPromotionDetail',{id: this.item.id}, res => {
this.$api('infoGetPromotionDetail', {
id: this.item.id
}, res => {
if (res.code == 200) {
this.item = res.result
@ -196,18 +202,19 @@
select(e) {
console.log('选中该项:', e);
// 使
const matches = e.name.match(/\d+/g).map(Number);
// 使
const matches = e.name.match(/(\d+\.?\d*)/g).map(Number);
//
if (matches) {
if (matches && matches.length >= 2) {
console.log(matches, "matches");
this.item.day = matches[0]
this.item.money = matches[1]
//
this.popupData.day = matches[0]; //
this.popupData.money = matches[1]; //
this.$refs.actionSheet.close() //
this.$refs.popup.open() //
}
console.log(this.item.day, "this.item.day");
this.$refs.actionSheet.close() //
this.$refs.popup.open() //
},
// ActionSheet
@ -224,10 +231,10 @@
},
// 广
continueToPromotion() {
if(this.item.phone=='' || this.item.phone==null){
if (this.item.phone == '' || this.item.phone == null) {
return uni.showToast({
title: '请输入联系电话',
icon : 'none'
icon: 'none'
})
}
this.$refs.actionSheet.open();
@ -238,17 +245,53 @@
this.$refs.confirmationPopup.open()
this.$refs.popup.close()
},
pay() {
this.$refs.confirmationPopupUpload.open()
return
//
this.$api('ConfirmPromotion', {}, res => {
if (res.code == 200) {
//
this.$refs.confirmationPopupUpload.open()
}
})
//
payOrder() {
let self = this
let data = {
id: this.item.id,
day: this.popupData.day,
money: this.popupData.money,
}
this.$api('confirmPromotion', data,
res => {
if (res.code == 200) {
if (self.form.topId) {
uni.requestPayment({
provider: 'wxpay', //
timeStamp: res.result.timeStamp, //
nonceStr: res.result.nonceStr, //
package: res.result.packageValue,
signType: res.result.signType, //
paySign: res.result.paySign, //
success: function(res) {
console.log('支付成功', res);
self.$refs.confirmationPopupUpload.open()
// self.$refs.confirmationPopup.close()
},
fail: function(err) {
console.log('支付失败', err);
self.$refs.confirmationPopup.close()
uni.showToast({
icon: 'none',
title: "支付失败"
})
}
});
} else {
self.$refs.confirmationPopupUpload.open()
}
}
})
},
}
}
</script>
@ -291,6 +334,7 @@
.value {
width: 40%;
text-align: right;
}
}
}
@ -307,6 +351,25 @@
background: $uni-linear-gradient-btn-color;
}
}
.confirmationPopup {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
height: 300rpx;
image {
margin-top: 40rpx;
}
.info {
margin-top: 40rpx;
font-size: 26rpx;
}
}
}


+ 1
- 1
pages_mine/mine/sonPage/promotion/promotionRecordList.vue View File

@ -3,7 +3,7 @@
<view class="item" v-for="(item, index) in list"
@click="gotoItem(item)"
:key="index">
<image src="/static/image/center/1.png" style="width: 40%"></image>
<image :src="item.image" style="width: 40%"></image>
<view class="text">
<view>
<view class="title">


+ 85
- 23
pages_mine/mine/updateUserInfo.vue View File

@ -5,11 +5,11 @@
<!--主页面-->
<view class="frame">
<view class="item">
<view style="width: 70%;height: 150rpx;">头像</view>
<view style="border-radius: 50%;border: 1px solid red;overflow: hidden;width: 30%;"
@click="updateUserImage">
<image :src='itemUserImage' style="width: 100%;height: 100%"></image>
<view class="headImage">
<view style="" class="key">头像</view>
<view style="" class="value" @click="chooseAndUpdateUserImage">
<image :src='form.headImage' style="width: 100%;height: 100%"></image>
<!-- <uv-upload :fileList="fileList" :maxCount="1" multiple width="150rpx" height="150rpx"
:deletable="false" :previewFullImage="false" @afterRead="afterRead" ></uv-upload> -->
</view>
@ -17,8 +17,7 @@
<view class="item">
<view class="label">昵称</view>
<view class="value">
<uv-input v-model="form.nickName" placeholder="昵称" border="bottom" clearable
></uv-input>
<uv-input v-model="form.nickName" placeholder="昵称" border="bottom" clearable></uv-input>
</view>
</view>
<view class="item" @click="sexChange">
@ -28,8 +27,7 @@
<view class="item">
<view class="label">联系方式</view>
<view class="value">
<uv-input v-model="form.phone" placeholder="联系方式" border="bottom" clearable
></uv-input>
<uv-input v-model="form.phone" placeholder="联系方式" border="bottom" clearable></uv-input>
</view>
</view>
</view>
@ -57,12 +55,12 @@
data() {
return {
form: {
sex: userInfo.sex || '',
sex: '',
nickName: '1',
phone: userInfo.phone || '',
image: userInfo.headImage,
phone: '',
headImage: '',
},
itemUserImage: userInfo.headImage,
// itemUserImage: userInfo.headImage,
fileList: [],
sexList: [{
name: '男',
@ -77,6 +75,10 @@
}
},
mounted() {
this.form = this.userInfo
if (this.userInfo.sex == '' || this.userInfo.sex == null) {
this.userInfo.sex = '未知'
}
console.log(this.userInfo.headImage, "this.userInfo.headImage");
// this.fileList.push({
// url: this.userInfo.headImage
@ -102,17 +104,42 @@
})
},
//
updateUserImage(e) {
console.log(e, "e");
let self = this
// e.file.forEach(file => {
self.$Oss.ossUpload(file.url).then(url => {
self.itemUserImage = {
url
//
chooseAndUpdateUserImage() {
const self = this;
uni.chooseImage({
count: 1, //
sizeType: ['original', 'compressed'], //
sourceType: ['album', 'camera'], //
success: (res) => {
//
const tempFilePath = res.tempFilePaths[0];
console.log(tempFilePath, "Selected Image");
//
self.updateUserImage(tempFilePath);
},
fail: (err) => {
console.error("Failed to select image:", err);
}
})
// })
});
},
//
updateUserImage(filePath) {
const self = this;
console.log(filePath, "Selected Image Path");
//
self.$Oss.ossUpload(filePath).then(url => {
// URL
self.form.headImage = url;
console.log("Uploaded Image URL:", url);
}).catch(err => {
console.error("Failed to upload image:", err);
});
},
deleteImage(e) {
@ -162,6 +189,27 @@
.frame {
padding: 28rpx 28rpx 0 28rpx;
.headImage {
display: flex;
// width: 100vw;
padding: 20rpx;
.key {
width: 70%;
height: 150rpx;
display: flex;
align-items: center;
}
.value {
border-radius: 50%;
border: 1px solid red;
overflow: hidden;
width: 30%;
}
}
.item {
display: flex;
justify-content: space-between;
@ -180,4 +228,18 @@
}
}
}
/deep/ .input__content {
/deep/.uv-input__content__field-wrapper {
border: 1px solid red;
input {
text-align: right;
}
}
}
/deep/ .uv-input__content__field-wrapper__field {
text-align: right;
}
</style>

Loading…
Cancel
Save